@pan-stack/test 0.0.12 → 0.0.13

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.
@@ -2444,10 +2444,10 @@ tr.pb-flash > td { animation: pb-flash 1.2s ease-out 1 both; }
2444
2444
  { id: 'chuong-trinh', label: 'Ch\u01B0\u01A1ng tr\xECnh', desc: 'K\u1EBF ho\u1EA1ch, use case, c\xF4ng tr\u01B0\u1EDDng 3D', ico: 'target' },
2445
2445
  { id: 'studio', label: 'Studio thi\u1EBFt k\u1EBF', desc: 'M\xE0n panui, canvas, \u1EA3nh m\xE0n', ico: 'pen-tool' },
2446
2446
  { id: 'giong-doc', label: 'Gi\u1ECDng \u0111\u1ECDc', desc: 'L\u1ED3ng ti\u1EBFng, k\u1ECBch b\u1EA3n \u0111\u1ECDc', ico: 'mic' },
2447
- { id: 'ban-giao', label: 'B\xE0n giao', desc: 'T\xE0i li\u1EC7u b\xE0n giao, b\xECnh lu\u1EADn', ico: 'package' },
2448
2447
  { id: 'tai-lieu-ba', label: 'T\xE0i li\u1EC7u BA', desc: '\u0110\u1EB7c t\u1EA3, tham chi\u1EBFu, xu\u1EA5t DOCX/PDF', ico: 'file-text' },
2449
2448
  { id: 'test-docs', label: 'T\xE0i li\u1EC7u ki\u1EC3m th\u1EED', desc: 'K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED, k\u1EBFt qu\u1EA3, xu\u1EA5t b\xE0n giao', ico: 'check' },
2450
- { id: 'handover-docs', label: 'T\xE0i li\u1EC7u b\xE0n giao', desc: 'H\u01B0\u1EDBng d\u1EABn c\xE0i \u0111\u1EB7t, v\u1EADn h\xE0nh, s\u1EED d\u1EE5ng \u2014 xu\u1EA5t Word', ico: 'package' },
2449
+ // Handoff Document: t\xEAn chung cho c\u1EA3 b\xE0n giao ki\u1EC3u kho\xE1 h\u1ECDc l\u1EABn ki\u1EC3u t\xE0i li\u1EC7u (04/12/2026)
2450
+ { id: 'handover-docs', label: 'Handoff Document', desc: 'H\u01B0\u1EDBng d\u1EABn c\xE0i \u0111\u1EB7t, v\u1EADn h\xE0nh, s\u1EED d\u1EE5ng \u2014 kho\xE1 h\u1ECDc ho\u1EB7c t\xE0i li\u1EC7u, xu\u1EA5t Word', ico: 'package' },
2451
2451
  ];
2452
2452
  var ROLE_LABEL = { ba: 'BA', 'ba-lead': 'BA Lead', designer: 'Designer' };
2453
2453
  var refs = {};
@@ -3442,7 +3442,7 @@ tr.pb-flash > td { animation: pb-flash 1.2s ease-out 1 both; }
3442
3442
  'G\xF5 m\xE3, t\xEAn ho\u1EB7c s\u1ED1 m\u1EE5c': 'Type a code, name or section number', 'Kh\xF4ng th\u1EA5y k\u1EBFt qu\u1EA3': 'No results',
3443
3443
  };
3444
3444
  // nh\xE3n workspace (b\u1ED9 ch\u1ECDn workspace trong trang)
3445
- Object.assign(EN, {"T\xE0i li\u1EC7u ki\u1EC3m th\u1EED": "Test documents", "K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED, k\u1EBFt qu\u1EA3, xu\u1EA5t b\xE0n giao": "Test scenarios, results, handover export", "T\xE0i li\u1EC7u b\xE0n giao": "Handover documents", "H\u01B0\u1EDBng d\u1EABn c\xE0i \u0111\u1EB7t, v\u1EADn h\xE0nh, s\u1EED d\u1EE5ng \u2014 xu\u1EA5t Word": "Installation, operation and user guides \u2014 Word export"});
3445
+ Object.assign(EN, {"T\xE0i li\u1EC7u ki\u1EC3m th\u1EED": "Test documents", "K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED, k\u1EBFt qu\u1EA3, xu\u1EA5t b\xE0n giao": "Test scenarios, results, handover export", "T\xE0i li\u1EC7u b\xE0n giao": "Handover documents", "H\u01B0\u1EDBng d\u1EABn c\xE0i \u0111\u1EB7t, v\u1EADn h\xE0nh, s\u1EED d\u1EE5ng \u2014 kho\xE1 h\u1ECDc ho\u1EB7c t\xE0i li\u1EC7u, xu\u1EA5t Word": "Installation, operation and user guides \u2014 course or document, Word export"});
3446
3446
  // Pan Test (app t\xE0i li\u1EC7u ki\u1EC3m th\u1EED) \u2014 ch\u1EEF ri\xEAng c\u1EE7a app.browser.js
3447
3447
  Object.assign(EN, {"Tr\u1EE3 l\xFD AI": "AI assistant", "AI l\xE0m vi\u1EC7c ngay trong repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED: th\xEAm / s\u1EEDa k\u1ECBch b\u1EA3n v\xE0 t\xECnh hu\u1ED1ng b\u1EB1ng l\u1EC7nh pan test (m\xE3 kh\xF4ng tr\xF9ng, k\u1EBFt qu\u1EA3 gi\u1EEF nguy\xEAn), t\u1EF1 ch\u1EA1y pan test check, kh\xF4ng commit. Xong b\u1EA1n xem thay \u0111\u1ED5i r\u1ED3i Gi\u1EEF ho\u1EB7c Ho\xE0n t\xE1c.": "The AI works right in this test document repo: it adds / edits suites and cases with pan test commands (unique codes, results kept), runs pan test check itself and never commits. Then review the changes and Keep or Undo.", "Ng\u1EEF c\u1EA3nh:": "Context:", "ph\xE2n h\u1EC7 {m}": "module {m}", "B\u1ED5 sung t\xECnh hu\u1ED1ng": "Add missing cases", "Vi\u1EBFt t\xECnh hu\u1ED1ng": "Write test cases", "R\xE0 so\xE1t": "Review", "K\u1ECBch b\u1EA3n c\xF2n thi\u1EBFu": "Missing suites", "S\u1EEDa l\u1ED7i ki\u1EC3m tra": "Fix check issues", "B\u1ED5 sung t\xECnh hu\u1ED1ng c\xF2n thi\u1EBFu cho k\u1ECBch b\u1EA3n {c} \xAB{t}\xBB (\u0111\u1ED1i chi\u1EBFu t\xE0i li\u1EC7u BA{v}).": "Add the missing test cases to suite {c} \xAB{t}\xBB (compare with the BA document{v}).", "Vi\u1EBFt c\xE1c t\xECnh hu\u1ED1ng ki\u1EC3m th\u1EED cho k\u1ECBch b\u1EA3n {c} \xAB{t}\xBB theo t\xE0i li\u1EC7u BA{v}.": "Write the test cases for suite {c} \xAB{t}\xBB from the BA document{v}.", "R\xE0 so\xE1t k\u1ECBch b\u1EA3n {c} \xAB{t}\xBB: b\u01B0\u1EDBc m\u01A1 h\u1ED3, k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i kh\xF4ng ki\u1EC3m \u0111\u01B0\u1EE3c, tr\xF9ng l\u1EB7p \u2014 s\u1EEDa b\u1EB1ng l\u1EC7nh v\xE0 b\xE1o l\u1EA1i.": "Review suite {c} \xAB{t}\xBB: vague steps, unverifiable expected results, duplicates \u2014 fix with commands and report back.", "\u0110\u1ED1i chi\u1EBFu t\xE0i li\u1EC7u BA: ch\u1EE9c n\u0103ng n\xE0o c\u1EE7a ph\xE2n h\u1EC7 {m} ch\u01B0a c\xF3 k\u1ECBch b\u1EA3n? T\u1EA1o k\u1ECBch b\u1EA3n + t\xECnh hu\u1ED1ng cho c\xE1c ch\u1EE9c n\u0103ng \u0111\xF3.": "Compare with the BA document: which functions of module {m} have no suite? Create suites + cases for them.", "Ch\u1EA1y pan test check r\u1ED3i s\u1EEDa c\xE1c l\u1ED7i / c\u1EA3nh b\xE1o.": "Run pan test check, then fix the errors / warnings."});
3448
3448
  Object.assign(EN, {"Studio": "Studio", "\u0110ang ki\u1EC3m tra Pan Studio\u2026": "Checking Pan Studio\u2026", "C\u1EA7n Pan CLI \u0111\u1EC3 ph\xE1t h\xE0nh l\xEAn Pan Studio.": "Pan CLI is needed to publish to Pan Studio.", "M\xE1y n\xE0y ch\u01B0a \u0111\u0103ng nh\u1EADp Pan Studio. \u0110\u0103ng nh\u1EADp trong Pan Studio Desktop (g\xF3c ph\u1EA3i tr\xEAn) ho\u1EB7c ch\u1EA1y \xABpan login\xBB, r\u1ED3i m\u1EDF l\u1EA1i h\u1ED9p n\xE0y.": "This machine is not signed in to Pan Studio. Sign in from Pan Studio Desktop (top right) or run \xABpan login\xBB, then reopen this dialog.", "M\u1EDF tr\xEAn Pan Studio": "Open on Pan Studio", "\u0110\xE3 ph\xE1t h\xE0nh: \xAB{t}\xBB \u2014 b\u1EA3n {r}.": "Published: \xAB{t}\xBB \u2014 revision {r}.", "Ch\u01B0a ph\xE1t h\xE0nh l\xEAn Pan Studio. Ph\xE1t h\xE0nh xong, t\xE0i li\u1EC7u hi\u1EC7n \u1EDF workspace \xABT\xE0i li\u1EC7u ki\u1EC3m th\u1EED\xBB tr\xEAn web: th\xE0nh vi\xEAn d\u1EF1 \xE1n xem, b\xECnh lu\u1EADn theo t\u1EEBng k\u1ECBch b\u1EA3n.": "Not published to Pan Studio yet. Once published, the document appears in the \xABTest documents\xBB workspace on the web: project members read it and comment per test suite.", "Ch\u01B0a g\u1EAFn d\u1EF1 \xE1n Studio (repo t\xE0i li\u1EC7u BA li\xEAn k\u1EBFt ch\u01B0a khai d\u1EF1 \xE1n) \u2014 t\xE0i li\u1EC7u ch\u1EC9 b\u1EA1n v\xE0 ng\u01B0\u1EDDi \u0111\u01B0\u1EE3c m\u1EDDi th\u1EA5y.": "Not linked to a Studio project (the linked BA repo has no project) \u2014 only you and invited people see it.", "Ph\xE1t h\xE0nh l\u1EA1i s\u1EBD GHI \u0110\xC8 b\u1EA3n tr\xEAn Studio b\u1EB1ng n\u1ED9i dung hi\u1EC7n t\u1EA1i c\u1EE7a repo (k\u1EC3 c\u1EA3 k\u1EBFt qu\u1EA3 test).": "Publishing again OVERWRITES the Studio copy with the current repo content (results included).", "Pan Studio": "Pan Studio", "G\u1EE1 kh\u1ECFi Studio": "Remove from Studio", "Ph\xE1t h\xE0nh": "Publish", "\u0110ang g\u1EE1\u2026": "Removing\u2026", "\u0110\xE3 g\u1EE1 kh\u1ECFi Pan Studio.": "Removed from Pan Studio.", "\u0110ang ph\xE1t h\xE0nh\u2026": "Publishing\u2026", "\u0110\xE3 ph\xE1t h\xE0nh b\u1EA3n {r} ({n} b\xE0i, t\u1EA3i l\xEAn {u} t\u1EC7p).": "Published revision {r} ({n} lessons, {u} files uploaded)."});
@@ -5177,7 +5177,7 @@ export async function api(path, body) {
5177
5177
  return { status: res.status, ok: res.ok && json.ok !== false, json };
5178
5178
  }
5179
5179
  `}});function un(e,t={}){Wc&&!t.pin||(Kc=e==="en"?"en":"vi",t.pin&&(Wc=!0))}var Kc,Wc,U,qn=Se(()=>{"use strict";S();Kc="vi",Wc=!1;U=(e,t)=>Kc==="en"?t:e});var et,Gc,zc,hn,si=Se(()=>{"use strict";S();et=["not-run","passed","failed","blocked","skipped"],Gc=["functional","non-functional"],zc=["drafting","done","deleted"],hn=["high","medium","low"]});function db(){let e=globalThis.crypto;return e?.getRandomValues?e.getRandomValues(new Uint32Array(1))[0]/2**32:Math.random()}function mn(e,t,n,r=db){for(;;){let i="";for(let a=0;a<6;a++)i+=Vc[Math.floor(r()*Vc.length)];if(!/[A-Z]/.test(i))continue;let s=`${e}-${t}-${i}`;if(!n.has(s))return s}}var Vc,ai,oi,li,fn=Se(()=>{"use strict";S();Vc="ABCDEFGHJKMNPQRSTUVWXYZ23456789",ai=/^[A-Z][A-Z0-9]{1,11}$/,oi=/^KB-([A-Z][A-Z0-9]{1,11})-([A-Z0-9]{6})$/,li=/^TC-([A-Z][A-Z0-9]{1,11})-([A-Z0-9]{6})$/});var X=B(xe=>{"use strict";S();var ua=Symbol.for("yaml.alias"),Xc=Symbol.for("yaml.document"),ci=Symbol.for("yaml.map"),Yc=Symbol.for("yaml.pair"),ha=Symbol.for("yaml.scalar"),di=Symbol.for("yaml.seq"),ht=Symbol.for("yaml.node.type"),pb=e=>!!e&&typeof e=="object"&&e[ht]===ua,ub=e=>!!e&&typeof e=="object"&&e[ht]===Xc,hb=e=>!!e&&typeof e=="object"&&e[ht]===ci,mb=e=>!!e&&typeof e=="object"&&e[ht]===Yc,Jc=e=>!!e&&typeof e=="object"&&e[ht]===ha,fb=e=>!!e&&typeof e=="object"&&e[ht]===di;function Qc(e){if(e&&typeof e=="object")switch(e[ht]){case ci:case di:return!0}return!1}function gb(e){if(e&&typeof e=="object")switch(e[ht]){case ua:case ci:case ha:case di:return!0}return!1}var bb=e=>(Jc(e)||Qc(e))&&!!e.anchor;xe.ALIAS=ua;xe.DOC=Xc;xe.MAP=ci;xe.NODE_TYPE=ht;xe.PAIR=Yc;xe.SCALAR=ha;xe.SEQ=di;xe.hasAnchor=bb;xe.isAlias=pb;xe.isCollection=Qc;xe.isDocument=ub;xe.isMap=hb;xe.isNode=gb;xe.isPair=mb;xe.isScalar=Jc;xe.isSeq=fb});var Hn=B(ma=>{"use strict";S();var me=X(),Ne=Symbol("break visit"),Zc=Symbol("skip children"),tt=Symbol("remove node");function pi(e,t){let n=ed(t);me.isDocument(e)?gn(null,e.contents,n,Object.freeze([e]))===tt&&(e.contents=null):gn(null,e,n,Object.freeze([]))}pi.BREAK=Ne;pi.SKIP=Zc;pi.REMOVE=tt;function gn(e,t,n,r){let i=td(e,t,n,r);if(me.isNode(i)||me.isPair(i))return nd(e,r,i),gn(e,i,n,r);if(typeof i!="symbol"){if(me.isCollection(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){let a=gn(s,t.items[s],n,r);if(typeof a=="number")s=a-1;else{if(a===Ne)return Ne;a===tt&&(t.items.splice(s,1),s-=1)}}}else if(me.isPair(t)){r=Object.freeze(r.concat(t));let s=gn("key",t.key,n,r);if(s===Ne)return Ne;s===tt&&(t.key=null);let a=gn("value",t.value,n,r);if(a===Ne)return Ne;a===tt&&(t.value=null)}}return i}async function ui(e,t){let n=ed(t);me.isDocument(e)?await bn(null,e.contents,n,Object.freeze([e]))===tt&&(e.contents=null):await bn(null,e,n,Object.freeze([]))}ui.BREAK=Ne;ui.SKIP=Zc;ui.REMOVE=tt;async function bn(e,t,n,r){let i=await td(e,t,n,r);if(me.isNode(i)||me.isPair(i))return nd(e,r,i),bn(e,i,n,r);if(typeof i!="symbol"){if(me.isCollection(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){let a=await bn(s,t.items[s],n,r);if(typeof a=="number")s=a-1;else{if(a===Ne)return Ne;a===tt&&(t.items.splice(s,1),s-=1)}}}else if(me.isPair(t)){r=Object.freeze(r.concat(t));let s=await bn("key",t.key,n,r);if(s===Ne)return Ne;s===tt&&(t.key=null);let a=await bn("value",t.value,n,r);if(a===Ne)return Ne;a===tt&&(t.value=null)}}return i}function ed(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function td(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(me.isMap(t))return n.Map?.(e,t,r);if(me.isSeq(t))return n.Seq?.(e,t,r);if(me.isPair(t))return n.Pair?.(e,t,r);if(me.isScalar(t))return n.Scalar?.(e,t,r);if(me.isAlias(t))return n.Alias?.(e,t,r)}function nd(e,t,n){let r=t[t.length-1];if(me.isCollection(r))r.items[e]=n;else if(me.isPair(r))e==="key"?r.key=n:r.value=n;else if(me.isDocument(r))r.contents=n;else{let i=me.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}ma.visit=pi;ma.visitAsync=ui});var fa=B(id=>{"use strict";S();var rd=X(),vb=Hn(),wb={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},yb=e=>e.replace(/[!,[\]{}]/g,t=>wb[t]),Un=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,a]=r;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,a),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}let[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+yb(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(t&&r.length>0&&rd.isNode(t.contents)){let s={};vb.visit(t.contents,(a,o)=>{rd.isNode(o)&&o.tag&&(s[o.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of r)s==="!!"&&a==="tag:yaml.org,2002:"||(!t||i.some(o=>o.startsWith(a)))&&n.push(`%TAG ${s} ${a}`);return n.join(`
5180
- `)}};Un.defaultYaml={explicit:!1,version:"1.2"};Un.defaultTags={"!!":"tag:yaml.org,2002:"};id.Directives=Un});var hi=B(jn=>{"use strict";S();var sd=X(),xb=Hn();function kb(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function ad(e){let t=new Set;return xb.visit(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function od(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Tb(e,t){let n=[],r=new Map,i=null;return{onAnchor:s=>{n.push(s),i??(i=ad(e));let a=od(t,i);return i.add(a),a},setAnchors:()=>{for(let s of n){let a=r.get(s);if(typeof a=="object"&&a.anchor&&(sd.isScalar(a.node)||sd.isCollection(a.node)))a.node.anchor=a.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=s,o}}},sourceObjects:r}}jn.anchorIsValid=kb;jn.anchorNames=ad;jn.createNodeAnchors=Tb;jn.findNewAnchor=od});var ga=B(ld=>{"use strict";S();function Wn(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){let a=r[i],o=Wn(e,r,String(i),a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let s=r.get(i),a=Wn(e,r,i,s);a===void 0?r.delete(i):a!==s&&r.set(i,a)}else if(r instanceof Set)for(let i of Array.from(r)){let s=Wn(e,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(let[i,s]of Object.entries(r)){let a=Wn(e,r,i,s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}return e.call(t,n,r)}ld.applyReviver=Wn});var Nt=B(dd=>{"use strict";S();var Sb=X();function cd(e,t,n){if(Array.isArray(e))return e.map((r,i)=>cd(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!Sb.hasAnchor(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=s=>{r.res=s,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}dd.toJS=cd});var mi=B(ud=>{"use strict";S();var Cb=ga(),pd=X(),Eb=Nt(),ba=class{constructor(t){Object.defineProperty(this,pd.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!pd.isDocument(t))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},o=Eb.toJS(this,"",a);if(typeof i=="function")for(let{count:c,res:l}of a.anchors.values())i(l,c);return typeof s=="function"?Cb.applyReviver(s,{"":o},"",o):o}};ud.NodeBase=ba});var Kn=B(hd=>{"use strict";S();var Ab=hi(),_b=Hn(),vn=X(),Nb=mi(),Pb=Nt(),va=class extends Nb.NodeBase{constructor(t){super(vn.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],_b.visit(t,{Node:(s,a)=>{(vn.isAlias(a)||vn.hasAnchor(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let i;for(let s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:s}=n,a=this.resolve(i,n);if(!a){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let o=r.get(a);if(o||(Pb.toJS(a,null,n),o=r.get(a)),o?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=fi(i,a,r)),o.count*o.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return o.res}toString(t,n,r){let i=`*${this.source}`;if(t){if(Ab.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}};function fi(e,t,n){if(vn.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(vn.isCollection(t)){let r=0;for(let i of t.items){let s=fi(e,i,n);s>r&&(r=s)}return r}else if(vn.isPair(t)){let r=fi(e,t.key,n),i=fi(e,t.value,n);return Math.max(r,i)}return 1}hd.Alias=va});var pe=B(wa=>{"use strict";S();var Ib=X(),Ob=mi(),Rb=Nt(),Lb=e=>!e||typeof e!="function"&&typeof e!="object",Pt=class extends Ob.NodeBase{constructor(t){super(Ib.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:Rb.toJS(this.value,t,n)}toString(){return String(this.value)}};Pt.BLOCK_FOLDED="BLOCK_FOLDED";Pt.BLOCK_LITERAL="BLOCK_LITERAL";Pt.PLAIN="PLAIN";Pt.QUOTE_DOUBLE="QUOTE_DOUBLE";Pt.QUOTE_SINGLE="QUOTE_SINGLE";wa.Scalar=Pt;wa.isScalarValue=Lb});var Gn=B(fd=>{"use strict";S();var Mb=Kn(),Gt=X(),md=pe(),Db="tag:yaml.org,2002:";function Bb(e,t,n){if(t){let r=n.filter(s=>s.tag===t),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function $b(e,t,n){if(Gt.isDocument(e)&&(e=e.contents),Gt.isNode(e))return e;if(Gt.isPair(e)){let d=n.schema[Gt.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:a,sourceObjects:o}=n,c;if(r&&e&&typeof e=="object"){if(c=o.get(e),c)return c.anchor??(c.anchor=i(e)),new Mb.Alias(c.anchor);c={anchor:null,node:null},o.set(e,c)}t?.startsWith("!!")&&(t=Db+t.slice(2));let l=Bb(e,t,a.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new md.Scalar(e);return c&&(c.node=d),d}l=e instanceof Map?a[Gt.MAP]:Symbol.iterator in Object(e)?a[Gt.SEQ]:a[Gt.MAP]}s&&(s(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new md.Scalar(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}fd.createNode=$b});var bi=B(gi=>{"use strict";S();var Fb=Gn(),nt=X(),qb=mi();function ya(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){let s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=r,r=a}else r=new Map([[s,r]])}return Fb.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var gd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,xa=class extends qb.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>nt.isNode(r)||nt.isPair(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(gd(t))this.add(n);else{let[r,...i]=t,s=this.get(r,!0);if(nt.isCollection(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,ya(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){let[n,...r]=t;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(nt.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){let[r,...i]=t,s=this.get(r,!0);return i.length===0?!n&&nt.isScalar(s)?s.value:s:nt.isCollection(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!nt.isPair(n))return!1;let r=n.value;return r==null||t&&nt.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){let[n,...r]=t;if(r.length===0)return this.has(n);let i=this.get(n,!0);return nt.isCollection(i)?i.hasIn(r):!1}setIn(t,n){let[r,...i]=t;if(i.length===0)this.set(r,n);else{let s=this.get(r,!0);if(nt.isCollection(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,ya(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};gi.Collection=xa;gi.collectionFromPath=ya;gi.isEmptyPath=gd});var zn=B(vi=>{"use strict";S();var Hb=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ka(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Ub=(e,t,n)=>e.endsWith(`
5180
+ `)}};Un.defaultYaml={explicit:!1,version:"1.2"};Un.defaultTags={"!!":"tag:yaml.org,2002:"};id.Directives=Un});var hi=B(jn=>{"use strict";S();var sd=X(),xb=Hn();function kb(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function ad(e){let t=new Set;return xb.visit(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function od(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Tb(e,t){let n=[],r=new Map,i=null;return{onAnchor:s=>{n.push(s),i??(i=ad(e));let a=od(t,i);return i.add(a),a},setAnchors:()=>{for(let s of n){let a=r.get(s);if(typeof a=="object"&&a.anchor&&(sd.isScalar(a.node)||sd.isCollection(a.node)))a.node.anchor=a.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=s,o}}},sourceObjects:r}}jn.anchorIsValid=kb;jn.anchorNames=ad;jn.createNodeAnchors=Tb;jn.findNewAnchor=od});var ga=B(ld=>{"use strict";S();function Wn(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){let a=r[i],o=Wn(e,r,String(i),a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let s=r.get(i),a=Wn(e,r,i,s);a===void 0?r.delete(i):a!==s&&r.set(i,a)}else if(r instanceof Set)for(let i of Array.from(r)){let s=Wn(e,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(let[i,s]of Object.entries(r)){let a=Wn(e,r,i,s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}return e.call(t,n,r)}ld.applyReviver=Wn});var Nt=B(dd=>{"use strict";S();var Sb=X();function cd(e,t,n){if(Array.isArray(e))return e.map((r,i)=>cd(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!Sb.hasAnchor(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=s=>{r.res=s,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}dd.toJS=cd});var mi=B(ud=>{"use strict";S();var Cb=ga(),pd=X(),Eb=Nt(),ba=class{constructor(t){Object.defineProperty(this,pd.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!pd.isDocument(t))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},o=Eb.toJS(this,"",a);if(typeof i=="function")for(let{count:c,res:l}of a.anchors.values())i(l,c);return typeof s=="function"?Cb.applyReviver(s,{"":o},"",o):o}};ud.NodeBase=ba});var Kn=B(hd=>{"use strict";S();var Ab=hi(),_b=Hn(),vn=X(),Nb=mi(),Pb=Nt(),va=class extends Nb.NodeBase{constructor(t){super(vn.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],_b.visit(t,{Node:(s,a)=>{(vn.isAlias(a)||vn.hasAnchor(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let i;for(let s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:s}=n,a=this.resolve(i,n);if(!a){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let o=r.get(a);if(o||(Pb.toJS(a,null,n),o=r.get(a)),o?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=fi(i,a,r)),o.count*o.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return o.res}toString(t,n,r){let i=`*${this.source}`;if(t){if(Ab.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}};function fi(e,t,n){if(vn.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(vn.isCollection(t)){let r=0;for(let i of t.items){let s=fi(e,i,n);s>r&&(r=s)}return r}else if(vn.isPair(t)){let r=fi(e,t.key,n),i=fi(e,t.value,n);return Math.max(r,i)}return 1}hd.Alias=va});var pe=B(wa=>{"use strict";S();var Ib=X(),Ob=mi(),Rb=Nt(),Lb=e=>!e||typeof e!="function"&&typeof e!="object",Pt=class extends Ob.NodeBase{constructor(t){super(Ib.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:Rb.toJS(this.value,t,n)}toString(){return String(this.value)}};Pt.BLOCK_FOLDED="BLOCK_FOLDED";Pt.BLOCK_LITERAL="BLOCK_LITERAL";Pt.PLAIN="PLAIN";Pt.QUOTE_DOUBLE="QUOTE_DOUBLE";Pt.QUOTE_SINGLE="QUOTE_SINGLE";wa.Scalar=Pt;wa.isScalarValue=Lb});var Gn=B(fd=>{"use strict";S();var Db=Kn(),Gt=X(),md=pe(),Mb="tag:yaml.org,2002:";function Bb(e,t,n){if(t){let r=n.filter(s=>s.tag===t),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function $b(e,t,n){if(Gt.isDocument(e)&&(e=e.contents),Gt.isNode(e))return e;if(Gt.isPair(e)){let d=n.schema[Gt.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:a,sourceObjects:o}=n,c;if(r&&e&&typeof e=="object"){if(c=o.get(e),c)return c.anchor??(c.anchor=i(e)),new Db.Alias(c.anchor);c={anchor:null,node:null},o.set(e,c)}t?.startsWith("!!")&&(t=Mb+t.slice(2));let l=Bb(e,t,a.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new md.Scalar(e);return c&&(c.node=d),d}l=e instanceof Map?a[Gt.MAP]:Symbol.iterator in Object(e)?a[Gt.SEQ]:a[Gt.MAP]}s&&(s(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new md.Scalar(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}fd.createNode=$b});var bi=B(gi=>{"use strict";S();var Fb=Gn(),nt=X(),qb=mi();function ya(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){let s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=r,r=a}else r=new Map([[s,r]])}return Fb.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var gd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,xa=class extends qb.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>nt.isNode(r)||nt.isPair(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(gd(t))this.add(n);else{let[r,...i]=t,s=this.get(r,!0);if(nt.isCollection(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,ya(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){let[n,...r]=t;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(nt.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){let[r,...i]=t,s=this.get(r,!0);return i.length===0?!n&&nt.isScalar(s)?s.value:s:nt.isCollection(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!nt.isPair(n))return!1;let r=n.value;return r==null||t&&nt.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){let[n,...r]=t;if(r.length===0)return this.has(n);let i=this.get(n,!0);return nt.isCollection(i)?i.hasIn(r):!1}setIn(t,n){let[r,...i]=t;if(i.length===0)this.set(r,n);else{let s=this.get(r,!0);if(nt.isCollection(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,ya(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};gi.Collection=xa;gi.collectionFromPath=ya;gi.isEmptyPath=gd});var zn=B(vi=>{"use strict";S();var Hb=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ka(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Ub=(e,t,n)=>e.endsWith(`
5181
5181
  `)?ka(n,t):n.includes(`
5182
5182
  `)?`
5183
5183
  `+ka(n,t):(e.endsWith(" ")?"":" ")+n;vi.indentComment=ka;vi.lineComment=Ub;vi.stringifyComment=Hb});var vd=B(Vn=>{"use strict";S();var jb="flow",Ta="block",wi="quoted";function Wb(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:o}={}){if(!i||i<0)return e;i<s&&(s=0);let c=Math.max(1+s,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r=="number"&&(r>i-Math.max(2,s)?l.push(0):d=i-r);let p,h,f=!1,m=-1,g=-1,y=-1;n===Ta&&(m=bd(e,m,t.length),m!==-1&&(d=m+c));for(let b;b=e[m+=1];){if(n===wi&&b==="\\"){switch(g=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}y=m}if(b===`
@@ -5217,7 +5217,7 @@ ${Qn.indentComment(x,n.indent)}`}_===""&&!n.inFlow?w===`
5217
5217
 
5218
5218
  `):w+=`
5219
5219
  ${n.indent}`}else if(!h&&mt.isCollection(t)){let x=_[0],v=_.indexOf(`
5220
- `),A=v!==-1,N=n.inFlow??t.flow??t.items.length===0;if(A||!N){let M=!1;if(A&&(x==="&"||x==="!")){let O=_.indexOf(" ");x==="&"&&O!==-1&&O<v&&_[O+1]==="!"&&(O=_.indexOf(" ",O+1)),(O===-1||v<O)&&(M=!0)}M||(w=`
5220
+ `),A=v!==-1,N=n.inFlow??t.flow??t.items.length===0;if(A||!N){let D=!1;if(A&&(x==="&"||x==="!")){let O=_.indexOf(" ");x==="&"&&O!==-1&&O<v&&_[O+1]==="!"&&(O=_.indexOf(" ",O+1)),(O===-1||v<O)&&(D=!0)}D||(w=`
5221
5221
  ${n.indent}`)}}else(_===""||_[0]===`
5222
5222
  `)&&(w="");return g+=w+_,n.inFlow?C&&r&&r():b&&!C?g+=Qn.lineComment(g,n.indent,l(b)):m&&i&&i(),g}kd.stringifyPair=tv});var _a=B(Aa=>{"use strict";S();var Sd=ri("process");function nv(e,...t){e==="debug"&&console.log(...t)}function rv(e,t){(e==="debug"||e==="warn")&&(typeof Sd.emitWarning=="function"?Sd.emitWarning(t):console.warn(t))}Aa.debug=nv;Aa.warn=rv});var Ai=B(Ei=>{"use strict";S();var Ci=X(),Cd=pe(),Ti="<<",Si={identify:e=>e===Ti||typeof e=="symbol"&&e.description===Ti,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Cd.Scalar(Symbol(Ti)),{addToJSMap:Ed}),stringify:()=>Ti},iv=(e,t)=>(Si.identify(t)||Ci.isScalar(t)&&(!t.type||t.type===Cd.Scalar.PLAIN)&&Si.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Si.tag&&n.default);function Ed(e,t,n){let r=Ad(e,n);if(Ci.isSeq(r))for(let i of r.items)Na(e,t,i);else if(Array.isArray(r))for(let i of r)Na(e,t,i);else Na(e,t,r)}function Na(e,t,n){let r=Ad(e,n);if(!Ci.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,e,Map);for(let[s,a]of i)t instanceof Map?t.has(s)||t.set(s,a):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function Ad(e,t){return e&&Ci.isAlias(t)?t.resolve(e.doc,e):t}Ei.addMergeToJSMap=Ed;Ei.isMergeKey=iv;Ei.merge=Si});var Ia=B(Pd=>{"use strict";S();var sv=_a(),_d=Ai(),av=Jn(),Nd=X(),Pa=Nt();function ov(e,t,{key:n,value:r}){if(Nd.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(_d.isMergeKey(e,n))_d.addMergeToJSMap(e,t,r);else{let i=Pa.toJS(n,"",e);if(t instanceof Map)t.set(i,Pa.toJS(r,i,e));else if(t instanceof Set)t.add(i);else{let s=lv(n,i,e),a=Pa.toJS(r,s,e);s in t?Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[s]=a}}return t}function lv(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Nd.isNode(e)&&n?.doc){let r=av.createStringifyContext(n.doc,{});r.anchors=new Set;for(let s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=e.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),sv.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}Pd.addPairToJSMap=ov});var Rt=B(Oa=>{"use strict";S();var Id=Gn(),cv=Td(),dv=Ia(),_i=X();function pv(e,t,n){let r=Id.createNode(e,void 0,n),i=Id.createNode(t,void 0,n);return new Ni(r,i)}var Ni=class e{constructor(t,n=null){Object.defineProperty(this,_i.NODE_TYPE,{value:_i.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return _i.isNode(n)&&(n=n.clone(t)),_i.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(t,n){let r=n?.mapAsMap?new Map:{};return dv.addPairToJSMap(n,r,this)}toString(t,n,r){return t?.doc?cv.stringifyPair(this,t,n,r):JSON.stringify(this)}};Oa.Pair=Ni;Oa.createPair=pv});var Ra=B(Rd=>{"use strict";S();var zt=X(),Od=Jn(),Pi=zn();function uv(e,t,n){return(t.inFlow??e.flow?mv:hv)(e,t,n)}function hv({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:a,onComment:o}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:s,type:null}),d=!1,p=[];for(let f=0;f<t.length;++f){let m=t[f],g=null;if(zt.isNode(m))!d&&m.spaceBefore&&p.push(""),Ii(n,p,m.commentBefore,d),m.comment&&(g=m.comment);else if(zt.isPair(m)){let T=zt.isNode(m.key)?m.key:null;T&&(!d&&T.spaceBefore&&p.push(""),Ii(n,p,T.commentBefore,d))}d=!1;let y=Od.stringify(m,u,()=>g=null,()=>d=!0);g&&(y+=Pi.lineComment(y,s,l(g))),d&&g&&(d=!1),p.push(r+y)}let h;if(p.length===0)h=i.start+i.end;else{h=p[0];for(let f=1;f<p.length;++f){let m=p[f];h+=m?`
5223
5223
  ${c}${m}`:`
@@ -5226,25 +5226,25 @@ ${c}${m}`:`
5226
5226
  `)),f<e.length-1?y+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=d.reduce((T,b)=>T+b.length+2,2)+(y.length+2)>t.options.lineWidth)),l&&(y+=",")),g&&(y+=Pi.lineComment(y,r,o(g))),d.push(y),u=d.length}let{start:p,end:h}=n;if(d.length===0)return p+h;if(!l){let f=d.reduce((m,g)=>m+g.length+2,2);l=t.options.lineWidth>0&&f>t.options.lineWidth}if(l){let f=p;for(let m of d)f+=m?`
5227
5227
  ${s}${i}${m}`:`
5228
5228
  `;return`${f}
5229
- ${i}${h}`}else return`${p}${a}${d.join(" ")}${a}${h}`}function Ii({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let s=Pi.indentComment(t(r),e);n.push(s.trimStart())}}Rd.stringifyCollection=uv});var Mt=B(Ma=>{"use strict";S();var fv=Ra(),gv=Ia(),bv=bi(),Lt=X(),Oi=Rt(),vv=pe();function Zn(e,t){let n=Lt.isScalar(t)?t.value:t;for(let r of e)if(Lt.isPair(r)&&(r.key===t||r.key===n||Lt.isScalar(r.key)&&r.key.value===n))return r}var La=class extends bv.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Lt.MAP,t),this.items=[]}static from(t,n,r){let{keepUndefined:i,replacer:s}=r,a=new this(t),o=(c,l)=>{if(typeof s=="function")l=s.call(n,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||i)&&a.items.push(Oi.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)o(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))o(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){let r;Lt.isPair(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Oi.Pair(t,t?.value):r=new Oi.Pair(t.key,t.value);let i=Zn(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Lt.isScalar(i.value)&&vv.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(s){let a=this.items.findIndex(o=>s(r,o)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(t){let n=Zn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let i=Zn(this.items,t)?.value;return(!n&&Lt.isScalar(i)?i.value:i)??void 0}has(t){return!!Zn(this.items,t)}set(t,n){this.add(new Oi.Pair(t,n),!0)}toJSON(t,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let s of this.items)gv.addPairToJSMap(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(let i of this.items)if(!Lt.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),fv.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}};Ma.YAMLMap=La;Ma.findPair=Zn});var yn=B(Md=>{"use strict";S();var wv=X(),Ld=Mt(),yv={collection:"map",default:!0,nodeClass:Ld.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return wv.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ld.YAMLMap.from(e,t,n)};Md.map=yv});var Dt=B(Dd=>{"use strict";S();var xv=Gn(),kv=Ra(),Tv=bi(),Li=X(),Sv=pe(),Cv=Nt(),Da=class extends Tv.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Li.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Ri(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let r=Ri(t);if(typeof r!="number")return;let i=this.items[r];return!n&&Li.isScalar(i)?i.value:i}has(t){let n=Ri(t);return typeof n=="number"&&n<this.items.length}set(t,n){let r=Ri(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);let i=this.items[r];Li.isScalar(i)&&Sv.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(t,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let s of this.items)r.push(Cv.toJS(s,String(i++),n));return r}toString(t,n,r){return t?kv.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){let{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let o of n){if(typeof i=="function"){let c=n instanceof Set?o:String(a++);o=i.call(n,c,o)}s.items.push(xv.createNode(o,void 0,r))}}return s}};function Ri(e){let t=Li.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}Dd.YAMLSeq=Da});var xn=B($d=>{"use strict";S();var Ev=X(),Bd=Dt(),Av={collection:"seq",default:!0,nodeClass:Bd.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Ev.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Bd.YAMLSeq.from(e,t,n)};$d.seq=Av});var er=B(Fd=>{"use strict";S();var _v=Yn(),Nv={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),_v.stringifyString(e,t,n,r)}};Fd.string=Nv});var Mi=B(Ud=>{"use strict";S();var qd=pe(),Hd={identify:e=>e==null,createNode:()=>new qd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new qd.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Hd.test.test(e)?e:t.options.nullStr};Ud.nullTag=Hd});var Ba=B(Wd=>{"use strict";S();var Pv=pe(),jd={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Pv.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&jd.test.test(e)){let r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};Wd.boolTag=jd});var kn=B(Kd=>{"use strict";S();function Iv({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let o=t-(s.length-a-1);for(;o-- >0;)s+="0"}return s}Kd.stringifyNumber=Iv});var Fa=B(Di=>{"use strict";S();var Ov=pe(),$a=kn(),Rv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:$a.stringifyNumber},Lv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():$a.stringifyNumber(e)}},Mv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Ov.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:$a.stringifyNumber};Di.float=Mv;Di.floatExp=Lv;Di.floatNaN=Rv});var Ha=B($i=>{"use strict";S();var Gd=kn(),Bi=e=>typeof e=="bigint"||Number.isInteger(e),qa=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function zd(e,t,n){let{value:r}=e;return Bi(r)&&r>=0?n+r.toString(t):Gd.stringifyNumber(e)}var Dv={identify:e=>Bi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>qa(e,2,8,n),stringify:e=>zd(e,8,"0o")},Bv={identify:Bi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>qa(e,0,10,n),stringify:Gd.stringifyNumber},$v={identify:e=>Bi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>qa(e,2,16,n),stringify:e=>zd(e,16,"0x")};$i.int=Bv;$i.intHex=$v;$i.intOct=Dv});var Xd=B(Vd=>{"use strict";S();var Fv=yn(),qv=Mi(),Hv=xn(),Uv=er(),jv=Ba(),Ua=Fa(),ja=Ha(),Wv=[Fv.map,Hv.seq,Uv.string,qv.nullTag,jv.boolTag,ja.intOct,ja.int,ja.intHex,Ua.floatNaN,Ua.floatExp,Ua.float];Vd.schema=Wv});var Qd=B(Jd=>{"use strict";S();var Kv=pe(),Gv=yn(),zv=xn();function Yd(e){return typeof e=="bigint"||Number.isInteger(e)}var Fi=({value:e})=>JSON.stringify(e),Vv=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Fi},{identify:e=>e==null,createNode:()=>new Kv.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Fi},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Fi},{identify:Yd,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Yd(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Fi}],Xv={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Yv=[Gv.map,zv.seq].concat(Vv,Xv);Jd.schema=Yv});var Ka=B(Zd=>{"use strict";S();var tr=ri("buffer"),Wa=pe(),Jv=Yn(),Qv={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof tr.Buffer=="function")return tr.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,s){if(!n)return"";let a=n,o;if(typeof tr.Buffer=="function")o=a instanceof tr.Buffer?a.toString("base64"):tr.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<a.length;++l)c+=String.fromCharCode(a[l]);o=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Wa.Scalar.BLOCK_LITERAL),t!==Wa.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(o.length/c),u=new Array(l);for(let d=0,p=0;d<l;++d,p+=c)u[d]=o.substr(p,c);o=u.join(t===Wa.Scalar.BLOCK_LITERAL?`
5230
- `:" ")}return Jv.stringifyString({comment:e,type:t,value:o},r,i,s)}};Zd.binary=Qv});var Ui=B(Hi=>{"use strict";S();var qi=X(),Ga=Rt(),Zv=pe(),ew=Dt();function ep(e,t){if(qi.isSeq(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!qi.isPair(r)){if(qi.isMap(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");let i=r.items[0]||new Ga.Pair(new Zv.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
5229
+ ${i}${h}`}else return`${p}${a}${d.join(" ")}${a}${h}`}function Ii({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let s=Pi.indentComment(t(r),e);n.push(s.trimStart())}}Rd.stringifyCollection=uv});var Dt=B(Da=>{"use strict";S();var fv=Ra(),gv=Ia(),bv=bi(),Lt=X(),Oi=Rt(),vv=pe();function Zn(e,t){let n=Lt.isScalar(t)?t.value:t;for(let r of e)if(Lt.isPair(r)&&(r.key===t||r.key===n||Lt.isScalar(r.key)&&r.key.value===n))return r}var La=class extends bv.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Lt.MAP,t),this.items=[]}static from(t,n,r){let{keepUndefined:i,replacer:s}=r,a=new this(t),o=(c,l)=>{if(typeof s=="function")l=s.call(n,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||i)&&a.items.push(Oi.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)o(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))o(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){let r;Lt.isPair(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Oi.Pair(t,t?.value):r=new Oi.Pair(t.key,t.value);let i=Zn(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Lt.isScalar(i.value)&&vv.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(s){let a=this.items.findIndex(o=>s(r,o)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(t){let n=Zn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let i=Zn(this.items,t)?.value;return(!n&&Lt.isScalar(i)?i.value:i)??void 0}has(t){return!!Zn(this.items,t)}set(t,n){this.add(new Oi.Pair(t,n),!0)}toJSON(t,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let s of this.items)gv.addPairToJSMap(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(let i of this.items)if(!Lt.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),fv.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}};Da.YAMLMap=La;Da.findPair=Zn});var yn=B(Dd=>{"use strict";S();var wv=X(),Ld=Dt(),yv={collection:"map",default:!0,nodeClass:Ld.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return wv.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ld.YAMLMap.from(e,t,n)};Dd.map=yv});var Mt=B(Md=>{"use strict";S();var xv=Gn(),kv=Ra(),Tv=bi(),Li=X(),Sv=pe(),Cv=Nt(),Ma=class extends Tv.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Li.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Ri(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let r=Ri(t);if(typeof r!="number")return;let i=this.items[r];return!n&&Li.isScalar(i)?i.value:i}has(t){let n=Ri(t);return typeof n=="number"&&n<this.items.length}set(t,n){let r=Ri(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);let i=this.items[r];Li.isScalar(i)&&Sv.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(t,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let s of this.items)r.push(Cv.toJS(s,String(i++),n));return r}toString(t,n,r){return t?kv.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){let{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let o of n){if(typeof i=="function"){let c=n instanceof Set?o:String(a++);o=i.call(n,c,o)}s.items.push(xv.createNode(o,void 0,r))}}return s}};function Ri(e){let t=Li.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}Md.YAMLSeq=Ma});var xn=B($d=>{"use strict";S();var Ev=X(),Bd=Mt(),Av={collection:"seq",default:!0,nodeClass:Bd.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Ev.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Bd.YAMLSeq.from(e,t,n)};$d.seq=Av});var er=B(Fd=>{"use strict";S();var _v=Yn(),Nv={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),_v.stringifyString(e,t,n,r)}};Fd.string=Nv});var Di=B(Ud=>{"use strict";S();var qd=pe(),Hd={identify:e=>e==null,createNode:()=>new qd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new qd.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Hd.test.test(e)?e:t.options.nullStr};Ud.nullTag=Hd});var Ba=B(Wd=>{"use strict";S();var Pv=pe(),jd={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Pv.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&jd.test.test(e)){let r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};Wd.boolTag=jd});var kn=B(Kd=>{"use strict";S();function Iv({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let o=t-(s.length-a-1);for(;o-- >0;)s+="0"}return s}Kd.stringifyNumber=Iv});var Fa=B(Mi=>{"use strict";S();var Ov=pe(),$a=kn(),Rv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:$a.stringifyNumber},Lv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():$a.stringifyNumber(e)}},Dv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Ov.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:$a.stringifyNumber};Mi.float=Dv;Mi.floatExp=Lv;Mi.floatNaN=Rv});var Ha=B($i=>{"use strict";S();var Gd=kn(),Bi=e=>typeof e=="bigint"||Number.isInteger(e),qa=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function zd(e,t,n){let{value:r}=e;return Bi(r)&&r>=0?n+r.toString(t):Gd.stringifyNumber(e)}var Mv={identify:e=>Bi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>qa(e,2,8,n),stringify:e=>zd(e,8,"0o")},Bv={identify:Bi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>qa(e,0,10,n),stringify:Gd.stringifyNumber},$v={identify:e=>Bi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>qa(e,2,16,n),stringify:e=>zd(e,16,"0x")};$i.int=Bv;$i.intHex=$v;$i.intOct=Mv});var Xd=B(Vd=>{"use strict";S();var Fv=yn(),qv=Di(),Hv=xn(),Uv=er(),jv=Ba(),Ua=Fa(),ja=Ha(),Wv=[Fv.map,Hv.seq,Uv.string,qv.nullTag,jv.boolTag,ja.intOct,ja.int,ja.intHex,Ua.floatNaN,Ua.floatExp,Ua.float];Vd.schema=Wv});var Qd=B(Jd=>{"use strict";S();var Kv=pe(),Gv=yn(),zv=xn();function Yd(e){return typeof e=="bigint"||Number.isInteger(e)}var Fi=({value:e})=>JSON.stringify(e),Vv=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Fi},{identify:e=>e==null,createNode:()=>new Kv.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Fi},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Fi},{identify:Yd,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Yd(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Fi}],Xv={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Yv=[Gv.map,zv.seq].concat(Vv,Xv);Jd.schema=Yv});var Ka=B(Zd=>{"use strict";S();var tr=ri("buffer"),Wa=pe(),Jv=Yn(),Qv={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof tr.Buffer=="function")return tr.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,s){if(!n)return"";let a=n,o;if(typeof tr.Buffer=="function")o=a instanceof tr.Buffer?a.toString("base64"):tr.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<a.length;++l)c+=String.fromCharCode(a[l]);o=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Wa.Scalar.BLOCK_LITERAL),t!==Wa.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(o.length/c),u=new Array(l);for(let d=0,p=0;d<l;++d,p+=c)u[d]=o.substr(p,c);o=u.join(t===Wa.Scalar.BLOCK_LITERAL?`
5230
+ `:" ")}return Jv.stringifyString({comment:e,type:t,value:o},r,i,s)}};Zd.binary=Qv});var Ui=B(Hi=>{"use strict";S();var qi=X(),Ga=Rt(),Zv=pe(),ew=Mt();function ep(e,t){if(qi.isSeq(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!qi.isPair(r)){if(qi.isMap(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");let i=r.items[0]||new Ga.Pair(new Zv.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
5231
5231
  ${i.key.commentBefore}`:r.commentBefore),r.comment){let s=i.value??i.key;s.comment=s.comment?`${r.comment}
5232
- ${s.comment}`:r.comment}r=i}e.items[n]=qi.isPair(r)?r:new Ga.Pair(r)}}else t("Expected a sequence for this tag");return e}function tp(e,t,n){let{replacer:r}=n,i=new ew.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(s++),a));let o,c;if(Array.isArray(a))if(a.length===2)o=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let l=Object.keys(a);if(l.length===1)o=l[0],c=a[o];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else o=a;i.items.push(Ga.createPair(o,c,n))}return i}var tw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ep,createNode:tp};Hi.createPairs=tp;Hi.pairs=tw;Hi.resolvePairs=ep});var Xa=B(Va=>{"use strict";S();var np=X(),za=Nt(),nr=Mt(),nw=Dt(),rp=Ui(),Vt=class e extends nw.YAMLSeq{constructor(){super(),this.add=nr.YAMLMap.prototype.add.bind(this),this.delete=nr.YAMLMap.prototype.delete.bind(this),this.get=nr.YAMLMap.prototype.get.bind(this),this.has=nr.YAMLMap.prototype.has.bind(this),this.set=nr.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let s,a;if(np.isPair(i)?(s=za.toJS(i.key,"",n),a=za.toJS(i.value,s,n)):s=za.toJS(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,a)}return r}static from(t,n,r){let i=rp.createPairs(t,n,r),s=new this;return s.items=i.items,s}};Vt.tag="tag:yaml.org,2002:omap";var rw={collection:"seq",identify:e=>e instanceof Map,nodeClass:Vt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=rp.resolvePairs(e,t),r=[];for(let{key:i}of n.items)np.isScalar(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Vt,n)},createNode:(e,t,n)=>Vt.from(e,t,n)};Va.YAMLOMap=Vt;Va.omap=rw});var lp=B(Ya=>{"use strict";S();var ip=pe();function sp({value:e,source:t},n){return t&&(e?ap:op).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var ap={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ip.Scalar(!0),stringify:sp},op={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ip.Scalar(!1),stringify:sp};Ya.falseTag=op;Ya.trueTag=ap});var cp=B(ji=>{"use strict";S();var iw=pe(),Ja=kn(),sw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ja.stringifyNumber},aw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Ja.stringifyNumber(e)}},ow={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new iw.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Ja.stringifyNumber};ji.float=ow;ji.floatExp=aw;ji.floatNaN=sw});var pp=B(ir=>{"use strict";S();var dp=kn(),rr=e=>typeof e=="bigint"||Number.isInteger(e);function Wi(e,t,n,{intAsBigInt:r}){let i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let a=BigInt(e);return i==="-"?BigInt(-1)*a:a}let s=parseInt(e,n);return i==="-"?-1*s:s}function Qa(e,t,n){let{value:r}=e;if(rr(r)){let i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return dp.stringifyNumber(e)}var lw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Wi(e,2,2,n),stringify:e=>Qa(e,2,"0b")},cw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Wi(e,1,8,n),stringify:e=>Qa(e,8,"0")},dw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Wi(e,0,10,n),stringify:dp.stringifyNumber},pw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Wi(e,2,16,n),stringify:e=>Qa(e,16,"0x")};ir.int=dw;ir.intBin=lw;ir.intHex=pw;ir.intOct=cw});var eo=B(Za=>{"use strict";S();var zi=X(),Ki=Rt(),Gi=Mt(),Xt=class e extends Gi.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;zi.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ki.Pair(t.key,null):n=new Ki.Pair(t,null),Gi.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let r=Gi.findPair(this.items,t);return!n&&zi.isPair(r)?zi.isScalar(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Gi.findPair(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ki.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){let{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof i=="function"&&(a=i.call(n,a,a)),s.items.push(Ki.createPair(a,null,r));return s}};Xt.tag="tag:yaml.org,2002:set";var uw={collection:"map",identify:e=>e instanceof Set,nodeClass:Xt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Xt.from(e,t,n),resolve(e,t){if(zi.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new Xt,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};Za.YAMLSet=Xt;Za.set=uw});var no=B(Vi=>{"use strict";S();var hw=kn();function to(e,t){let n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=a=>t?BigInt(a):Number(a),s=r.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return n==="-"?i(-1)*s:s}function up(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return hw.stringifyNumber(e);let r="";t<0&&(r="-",t*=n(-1));let i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var mw={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>to(e,n),stringify:up},fw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>to(e,!1),stringify:up},hp={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(hp.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,a,o]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,s||0,a||0,o||0,c),u=t[8];if(u&&u!=="Z"){let d=to(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Vi.floatTime=fw;Vi.intTime=mw;Vi.timestamp=hp});var gp=B(fp=>{"use strict";S();var gw=yn(),bw=Mi(),vw=xn(),ww=er(),yw=Ka(),mp=lp(),ro=cp(),Xi=pp(),xw=Ai(),kw=Xa(),Tw=Ui(),Sw=eo(),io=no(),Cw=[gw.map,vw.seq,ww.string,bw.nullTag,mp.trueTag,mp.falseTag,Xi.intBin,Xi.intOct,Xi.int,Xi.intHex,ro.floatNaN,ro.floatExp,ro.float,yw.binary,xw.merge,kw.omap,Tw.pairs,Sw.set,io.intTime,io.floatTime,io.timestamp];fp.schema=Cw});var Ep=B(oo=>{"use strict";S();var yp=yn(),Ew=Mi(),xp=xn(),Aw=er(),_w=Ba(),so=Fa(),ao=Ha(),Nw=Xd(),Pw=Qd(),kp=Ka(),sr=Ai(),Tp=Xa(),Sp=Ui(),bp=gp(),Cp=eo(),Yi=no(),vp=new Map([["core",Nw.schema],["failsafe",[yp.map,xp.seq,Aw.string]],["json",Pw.schema],["yaml11",bp.schema],["yaml-1.1",bp.schema]]),wp={binary:kp.binary,bool:_w.boolTag,float:so.float,floatExp:so.floatExp,floatNaN:so.floatNaN,floatTime:Yi.floatTime,int:ao.int,intHex:ao.intHex,intOct:ao.intOct,intTime:Yi.intTime,map:yp.map,merge:sr.merge,null:Ew.nullTag,omap:Tp.omap,pairs:Sp.pairs,seq:xp.seq,set:Cp.set,timestamp:Yi.timestamp},Iw={"tag:yaml.org,2002:binary":kp.binary,"tag:yaml.org,2002:merge":sr.merge,"tag:yaml.org,2002:omap":Tp.omap,"tag:yaml.org,2002:pairs":Sp.pairs,"tag:yaml.org,2002:set":Cp.set,"tag:yaml.org,2002:timestamp":Yi.timestamp};function Ow(e,t,n){let r=vp.get(t);if(r&&!e)return n&&!r.includes(sr.merge)?r.concat(sr.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let s=Array.from(vp.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(let s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(sr.merge)),i.reduce((s,a)=>{let o=typeof a=="string"?wp[a]:a;if(!o){let c=JSON.stringify(a),l=Object.keys(wp).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(o)||s.push(o),s},[])}oo.coreKnownTags=Iw;oo.getTags=Ow});var po=B(Ap=>{"use strict";S();var lo=X(),Rw=yn(),Lw=xn(),Mw=er(),Ji=Ep(),Dw=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,co=class e{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?Ji.getTags(t,"compat"):t?Ji.getTags(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Ji.coreKnownTags:{},this.tags=Ji.getTags(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,lo.MAP,{value:Rw.map}),Object.defineProperty(this,lo.SCALAR,{value:Mw.string}),Object.defineProperty(this,lo.SEQ,{value:Lw.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?Dw:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};Ap.Schema=co});var Np=B(_p=>{"use strict";S();var Bw=X(),uo=Jn(),ar=zn();function $w(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");let i=uo.createStringifyContext(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=s(e.commentBefore);n.unshift(ar.indentComment(c,""))}let a=!1,o=null;if(e.contents){if(Bw.isNode(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){let u=s(e.contents.commentBefore);n.push(ar.indentComment(u,""))}i.forceBlockIndent=!!e.comment,o=e.contents.comment}let c=o?void 0:()=>a=!0,l=uo.stringify(e.contents,i,()=>o=null,c);o&&(l+=ar.lineComment(l,"",s(o))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(uo.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=s(e.comment);c.includes(`
5232
+ ${s.comment}`:r.comment}r=i}e.items[n]=qi.isPair(r)?r:new Ga.Pair(r)}}else t("Expected a sequence for this tag");return e}function tp(e,t,n){let{replacer:r}=n,i=new ew.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(s++),a));let o,c;if(Array.isArray(a))if(a.length===2)o=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let l=Object.keys(a);if(l.length===1)o=l[0],c=a[o];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else o=a;i.items.push(Ga.createPair(o,c,n))}return i}var tw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ep,createNode:tp};Hi.createPairs=tp;Hi.pairs=tw;Hi.resolvePairs=ep});var Xa=B(Va=>{"use strict";S();var np=X(),za=Nt(),nr=Dt(),nw=Mt(),rp=Ui(),Vt=class e extends nw.YAMLSeq{constructor(){super(),this.add=nr.YAMLMap.prototype.add.bind(this),this.delete=nr.YAMLMap.prototype.delete.bind(this),this.get=nr.YAMLMap.prototype.get.bind(this),this.has=nr.YAMLMap.prototype.has.bind(this),this.set=nr.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let s,a;if(np.isPair(i)?(s=za.toJS(i.key,"",n),a=za.toJS(i.value,s,n)):s=za.toJS(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,a)}return r}static from(t,n,r){let i=rp.createPairs(t,n,r),s=new this;return s.items=i.items,s}};Vt.tag="tag:yaml.org,2002:omap";var rw={collection:"seq",identify:e=>e instanceof Map,nodeClass:Vt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=rp.resolvePairs(e,t),r=[];for(let{key:i}of n.items)np.isScalar(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Vt,n)},createNode:(e,t,n)=>Vt.from(e,t,n)};Va.YAMLOMap=Vt;Va.omap=rw});var lp=B(Ya=>{"use strict";S();var ip=pe();function sp({value:e,source:t},n){return t&&(e?ap:op).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var ap={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ip.Scalar(!0),stringify:sp},op={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ip.Scalar(!1),stringify:sp};Ya.falseTag=op;Ya.trueTag=ap});var cp=B(ji=>{"use strict";S();var iw=pe(),Ja=kn(),sw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ja.stringifyNumber},aw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Ja.stringifyNumber(e)}},ow={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new iw.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Ja.stringifyNumber};ji.float=ow;ji.floatExp=aw;ji.floatNaN=sw});var pp=B(ir=>{"use strict";S();var dp=kn(),rr=e=>typeof e=="bigint"||Number.isInteger(e);function Wi(e,t,n,{intAsBigInt:r}){let i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let a=BigInt(e);return i==="-"?BigInt(-1)*a:a}let s=parseInt(e,n);return i==="-"?-1*s:s}function Qa(e,t,n){let{value:r}=e;if(rr(r)){let i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return dp.stringifyNumber(e)}var lw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Wi(e,2,2,n),stringify:e=>Qa(e,2,"0b")},cw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Wi(e,1,8,n),stringify:e=>Qa(e,8,"0")},dw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Wi(e,0,10,n),stringify:dp.stringifyNumber},pw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Wi(e,2,16,n),stringify:e=>Qa(e,16,"0x")};ir.int=dw;ir.intBin=lw;ir.intHex=pw;ir.intOct=cw});var eo=B(Za=>{"use strict";S();var zi=X(),Ki=Rt(),Gi=Dt(),Xt=class e extends Gi.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;zi.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ki.Pair(t.key,null):n=new Ki.Pair(t,null),Gi.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let r=Gi.findPair(this.items,t);return!n&&zi.isPair(r)?zi.isScalar(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Gi.findPair(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ki.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){let{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof i=="function"&&(a=i.call(n,a,a)),s.items.push(Ki.createPair(a,null,r));return s}};Xt.tag="tag:yaml.org,2002:set";var uw={collection:"map",identify:e=>e instanceof Set,nodeClass:Xt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Xt.from(e,t,n),resolve(e,t){if(zi.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new Xt,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};Za.YAMLSet=Xt;Za.set=uw});var no=B(Vi=>{"use strict";S();var hw=kn();function to(e,t){let n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=a=>t?BigInt(a):Number(a),s=r.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return n==="-"?i(-1)*s:s}function up(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return hw.stringifyNumber(e);let r="";t<0&&(r="-",t*=n(-1));let i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var mw={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>to(e,n),stringify:up},fw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>to(e,!1),stringify:up},hp={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(hp.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,a,o]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,s||0,a||0,o||0,c),u=t[8];if(u&&u!=="Z"){let d=to(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Vi.floatTime=fw;Vi.intTime=mw;Vi.timestamp=hp});var gp=B(fp=>{"use strict";S();var gw=yn(),bw=Di(),vw=xn(),ww=er(),yw=Ka(),mp=lp(),ro=cp(),Xi=pp(),xw=Ai(),kw=Xa(),Tw=Ui(),Sw=eo(),io=no(),Cw=[gw.map,vw.seq,ww.string,bw.nullTag,mp.trueTag,mp.falseTag,Xi.intBin,Xi.intOct,Xi.int,Xi.intHex,ro.floatNaN,ro.floatExp,ro.float,yw.binary,xw.merge,kw.omap,Tw.pairs,Sw.set,io.intTime,io.floatTime,io.timestamp];fp.schema=Cw});var Ep=B(oo=>{"use strict";S();var yp=yn(),Ew=Di(),xp=xn(),Aw=er(),_w=Ba(),so=Fa(),ao=Ha(),Nw=Xd(),Pw=Qd(),kp=Ka(),sr=Ai(),Tp=Xa(),Sp=Ui(),bp=gp(),Cp=eo(),Yi=no(),vp=new Map([["core",Nw.schema],["failsafe",[yp.map,xp.seq,Aw.string]],["json",Pw.schema],["yaml11",bp.schema],["yaml-1.1",bp.schema]]),wp={binary:kp.binary,bool:_w.boolTag,float:so.float,floatExp:so.floatExp,floatNaN:so.floatNaN,floatTime:Yi.floatTime,int:ao.int,intHex:ao.intHex,intOct:ao.intOct,intTime:Yi.intTime,map:yp.map,merge:sr.merge,null:Ew.nullTag,omap:Tp.omap,pairs:Sp.pairs,seq:xp.seq,set:Cp.set,timestamp:Yi.timestamp},Iw={"tag:yaml.org,2002:binary":kp.binary,"tag:yaml.org,2002:merge":sr.merge,"tag:yaml.org,2002:omap":Tp.omap,"tag:yaml.org,2002:pairs":Sp.pairs,"tag:yaml.org,2002:set":Cp.set,"tag:yaml.org,2002:timestamp":Yi.timestamp};function Ow(e,t,n){let r=vp.get(t);if(r&&!e)return n&&!r.includes(sr.merge)?r.concat(sr.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let s=Array.from(vp.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(let s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(sr.merge)),i.reduce((s,a)=>{let o=typeof a=="string"?wp[a]:a;if(!o){let c=JSON.stringify(a),l=Object.keys(wp).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(o)||s.push(o),s},[])}oo.coreKnownTags=Iw;oo.getTags=Ow});var po=B(Ap=>{"use strict";S();var lo=X(),Rw=yn(),Lw=xn(),Dw=er(),Ji=Ep(),Mw=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,co=class e{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?Ji.getTags(t,"compat"):t?Ji.getTags(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Ji.coreKnownTags:{},this.tags=Ji.getTags(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,lo.MAP,{value:Rw.map}),Object.defineProperty(this,lo.SCALAR,{value:Dw.string}),Object.defineProperty(this,lo.SEQ,{value:Lw.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?Mw:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};Ap.Schema=co});var Np=B(_p=>{"use strict";S();var Bw=X(),uo=Jn(),ar=zn();function $w(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");let i=uo.createStringifyContext(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=s(e.commentBefore);n.unshift(ar.indentComment(c,""))}let a=!1,o=null;if(e.contents){if(Bw.isNode(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){let u=s(e.contents.commentBefore);n.push(ar.indentComment(u,""))}i.forceBlockIndent=!!e.comment,o=e.contents.comment}let c=o?void 0:()=>a=!0,l=uo.stringify(e.contents,i,()=>o=null,c);o&&(l+=ar.lineComment(l,"",s(o))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(uo.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=s(e.comment);c.includes(`
5233
5233
  `)?(n.push("..."),n.push(ar.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&a&&(c=c.replace(/^\n+/,"")),c&&((!a||o)&&n[n.length-1]!==""&&n.push(""),n.push(ar.indentComment(s(c),"")))}return n.join(`
5234
5234
  `)+`
5235
- `}_p.stringifyDocument=$w});var or=B(Pp=>{"use strict";S();var Fw=Kn(),Tn=bi(),De=X(),qw=Rt(),Hw=Nt(),Uw=po(),jw=Np(),ho=hi(),Ww=ga(),Kw=Gn(),mo=fa(),fo=class e{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,De.NODE_TYPE,{value:De.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:a}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new mo.Directives({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){let t=Object.create(e.prototype,{[De.NODE_TYPE]:{value:De.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=De.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Sn(this.contents)&&this.contents.add(t)}addIn(t,n){Sn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let r=ho.anchorNames(this);t.anchor=!n||r.has(n)?ho.findNewAnchor(n||"a",r):n}return new Fw.Alias(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){let g=T=>typeof T=="number"||T instanceof String||T instanceof Number,y=n.filter(g).map(String);y.length>0&&(n=n.concat(y)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:o,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:p,sourceObjects:h}=ho.createNodeAnchors(this,a||"a"),f={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:h},m=Kw.createNode(t,u,f);return o&&De.isCollection(m)&&(m.flow=!0),p(),m}createPair(t,n,r={}){let i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new qw.Pair(i,s)}delete(t){return Sn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Tn.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):Sn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return De.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Tn.isEmptyPath(t)?!n&&De.isScalar(this.contents)?this.contents.value:this.contents:De.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return De.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Tn.isEmptyPath(t)?this.contents!==void 0:De.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Tn.collectionFromPath(this.schema,[t],n):Sn(this.contents)&&this.contents.set(t,n)}setIn(t,n){Tn.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Tn.collectionFromPath(this.schema,Array.from(t),n):Sn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new mo.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new mo.Directives({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Uw.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Hw.toJS(this.contents,n??"",o);if(typeof s=="function")for(let{count:l,res:u}of o.anchors.values())s(u,l);return typeof a=="function"?Ww.applyReviver(a,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return jw.stringifyDocument(this,t)}};function Sn(e){if(De.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}Pp.Document=fo});var dr=B(cr=>{"use strict";S();var lr=class extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}},go=class extends lr{constructor(t,n,r){super("YAMLParseError",t,n,r)}},bo=class extends lr{constructor(t,n,r){super("YAMLWarning",t,n,r)}},Gw=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(o=>t.linePos(o));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let o=Math.min(s-39,a.length-79);a="\u2026"+a.substring(o),s-=o-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(a.substring(0,s))){let o=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`\u2026
5235
+ `}_p.stringifyDocument=$w});var or=B(Pp=>{"use strict";S();var Fw=Kn(),Tn=bi(),Me=X(),qw=Rt(),Hw=Nt(),Uw=po(),jw=Np(),ho=hi(),Ww=ga(),Kw=Gn(),mo=fa(),fo=class e{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Me.NODE_TYPE,{value:Me.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:a}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new mo.Directives({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){let t=Object.create(e.prototype,{[Me.NODE_TYPE]:{value:Me.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Me.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Sn(this.contents)&&this.contents.add(t)}addIn(t,n){Sn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let r=ho.anchorNames(this);t.anchor=!n||r.has(n)?ho.findNewAnchor(n||"a",r):n}return new Fw.Alias(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){let g=T=>typeof T=="number"||T instanceof String||T instanceof Number,y=n.filter(g).map(String);y.length>0&&(n=n.concat(y)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:o,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:p,sourceObjects:h}=ho.createNodeAnchors(this,a||"a"),f={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:h},m=Kw.createNode(t,u,f);return o&&Me.isCollection(m)&&(m.flow=!0),p(),m}createPair(t,n,r={}){let i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new qw.Pair(i,s)}delete(t){return Sn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Tn.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):Sn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Me.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Tn.isEmptyPath(t)?!n&&Me.isScalar(this.contents)?this.contents.value:this.contents:Me.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Me.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Tn.isEmptyPath(t)?this.contents!==void 0:Me.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Tn.collectionFromPath(this.schema,[t],n):Sn(this.contents)&&this.contents.set(t,n)}setIn(t,n){Tn.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Tn.collectionFromPath(this.schema,Array.from(t),n):Sn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new mo.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new mo.Directives({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Uw.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Hw.toJS(this.contents,n??"",o);if(typeof s=="function")for(let{count:l,res:u}of o.anchors.values())s(u,l);return typeof a=="function"?Ww.applyReviver(a,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return jw.stringifyDocument(this,t)}};function Sn(e){if(Me.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}Pp.Document=fo});var dr=B(cr=>{"use strict";S();var lr=class extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}},go=class extends lr{constructor(t,n,r){super("YAMLParseError",t,n,r)}},bo=class extends lr{constructor(t,n,r){super("YAMLWarning",t,n,r)}},Gw=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(o=>t.linePos(o));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let o=Math.min(s-39,a.length-79);a="\u2026"+a.substring(o),s-=o-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(a.substring(0,s))){let o=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`\u2026
5236
5236
  `),a=o+a}if(/[^ ]/.test(a)){let o=1,c=n.linePos[1];c?.line===r&&c.col>i&&(o=Math.max(1,Math.min(c.col-i,80-s)));let l=" ".repeat(s)+"^".repeat(o);n.message+=`:
5237
5237
 
5238
5238
  ${a}
5239
5239
  ${l}
5240
5240
  `}};cr.YAMLError=lr;cr.YAMLParseError=go;cr.YAMLWarning=bo;cr.prettifyError=Gw});var pr=B(Ip=>{"use strict";S();function zw(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:a,startOnNewline:o}){let c=!1,l=o,u=o,d="",p="",h=!1,f=!1,m=null,g=null,y=null,T=null,b=null,C=null,_=null;for(let v of e)switch(f&&(v.type!=="space"&&v.type!=="newline"&&v.type!=="comma"&&s(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),m&&(l&&v.type!=="comment"&&v.type!=="newline"&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),v.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&v.source.includes(" ")&&(m=v),u=!0;break;case"comment":{u||s(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=v.source.substring(1)||" ";d?d+=p+A:d=A,p="",l=!1;break}case"newline":l?d?d+=v.source:(!C||n!=="seq-item-ind")&&(c=!0):p+=v.source,l=!0,h=!0,(g||y)&&(T=v),u=!0;break;case"anchor":g&&s(v,"MULTIPLE_ANCHORS","A node can have at most one anchor"),v.source.endsWith(":")&&s(v.offset+v.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=v,_??(_=v.offset),l=!1,u=!1,f=!0;break;case"tag":{y&&s(v,"MULTIPLE_TAGS","A node can have at most one tag"),y=v,_??(_=v.offset),l=!1,u=!1,f=!0;break}case n:(g||y)&&s(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`),C&&s(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${t??"collection"}`),C=v,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){b&&s(v,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=v,l=!1,u=!1;break}default:s(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),l=!1,u=!1}let w=e[e.length-1],x=w?w.offset+w.source.length:i;return f&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=a||r?.type==="block-map"||r?.type==="block-seq")&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:C,spaceBefore:c,comment:d,hasNewline:h,anchor:g,tag:y,newlineAfterProp:T,end:x,start:_??x}}Ip.resolveProps=zw});var Qi=B(Op=>{"use strict";S();function vo(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
5241
- `))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(vo(t.key)||vo(t.value))return!0}return!1;default:return!0}}Op.containsNewline=vo});var wo=B(Rp=>{"use strict";S();var Vw=Qi();function Xw(e,t,n){if(t?.type==="flow-collection"){let r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Vw.containsNewline(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Rp.flowIndentCheck=Xw});var yo=B(Mp=>{"use strict";S();var Lp=X();function Yw(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r=="function"?r:(s,a)=>s===a||Lp.isScalar(s)&&Lp.isScalar(a)&&s.value===a.value;return t.some(s=>i(s.key,n))}Mp.mapIncludes=Yw});var Hp=B(qp=>{"use strict";S();var Dp=Rt(),Jw=Mt(),Bp=pr(),Qw=Qi(),$p=wo(),Zw=yo(),Fp="All mapping items must start at the same column";function e0({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=s?.nodeClass??Jw.YAMLMap,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:p,sep:h,value:f}=u,m=Bp.resolveProps(d,{indicator:"explicit-key-ind",next:p??h?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),g=!m.found;if(g){if(p&&(p.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&i(c,"BAD_INDENT",Fp)),!m.anchor&&!m.tag&&!h){l=m.end,m.comment&&(o.comment?o.comment+=`
5242
- `+m.comment:o.comment=m.comment);continue}(m.newlineAfterProp||Qw.containsNewline(p))&&i(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==r.indent&&i(c,"BAD_INDENT",Fp);n.atKey=!0;let y=m.end,T=p?e(n,p,m,i):t(n,y,d,null,m,i);n.schema.compat&&$p.flowIndentCheck(r.indent,p,i),n.atKey=!1,Zw.mapIncludes(n,o.items,T)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let b=Bp.resolveProps(h??[],{indicator:"map-value-ind",next:f,offset:T.range[2],onError:i,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=b.end,b.found){g&&(f?.type==="block-map"&&!b.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<b.found.offset-1024&&i(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let C=f?e(n,f,b,i):t(n,c,h,null,b,i);n.schema.compat&&$p.flowIndentCheck(r.indent,f,i),c=C.range[2];let _=new Dp.Pair(T,C);n.options.keepSourceTokens&&(_.srcToken=u),o.items.push(_)}else{g&&i(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(T.comment?T.comment+=`
5243
- `+b.comment:T.comment=b.comment);let C=new Dp.Pair(T);n.options.keepSourceTokens&&(C.srcToken=u),o.items.push(C)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),o.range=[r.offset,c,l??c],o}qp.resolveBlockMap=e0});var jp=B(Up=>{"use strict";S();var t0=Dt(),n0=pr(),r0=wo();function i0({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=s?.nodeClass??t0.YAMLSeq,o=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let p=n0.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(o.comment=p.comment);continue}let h=d?e(n,d,p,i):t(n,p.end,u,null,p,i);n.schema.compat&&r0.flowIndentCheck(r.indent,d,i),c=h.range[2],o.items.push(h)}return o.range=[r.offset,c,l??c],o}Up.resolveBlockSeq=i0});var Cn=B(Wp=>{"use strict";S();function s0(e,t,n,r){let i="";if(e){let s=!1,a="";for(let o of e){let{source:c,type:l}=o;switch(l){case"space":s=!0;break;case"comment":{n&&!s&&r(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=a+u:i=u,a="";break}case"newline":i&&(a+=c),s=!0;break;default:r(o,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}Wp.resolveEnd=s0});var Vp=B(zp=>{"use strict";S();var a0=X(),o0=Rt(),Kp=Mt(),l0=Dt(),c0=Cn(),Gp=pr(),d0=Qi(),p0=yo(),xo="Block collections are not allowed within flow collections",ko=e=>e&&(e.type==="block-map"||e.type==="block-seq");function u0({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=r.start.source==="{",o=a?"flow map":"flow sequence",c=s?.nodeClass??(a?Kp.YAMLMap:l0.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let g=0;g<r.items.length;++g){let y=r.items[g],{start:T,key:b,sep:C,value:_}=y,w=Gp.resolveProps(T,{flow:o,indicator:"explicit-key-ind",next:b??C?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!w.found){if(!w.anchor&&!w.tag&&!C&&!_){g===0&&w.comma?i(w.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):g<r.items.length-1&&i(w.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),w.comment&&(l.comment?l.comment+=`
5241
+ `))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(vo(t.key)||vo(t.value))return!0}return!1;default:return!0}}Op.containsNewline=vo});var wo=B(Rp=>{"use strict";S();var Vw=Qi();function Xw(e,t,n){if(t?.type==="flow-collection"){let r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Vw.containsNewline(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Rp.flowIndentCheck=Xw});var yo=B(Dp=>{"use strict";S();var Lp=X();function Yw(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r=="function"?r:(s,a)=>s===a||Lp.isScalar(s)&&Lp.isScalar(a)&&s.value===a.value;return t.some(s=>i(s.key,n))}Dp.mapIncludes=Yw});var Hp=B(qp=>{"use strict";S();var Mp=Rt(),Jw=Dt(),Bp=pr(),Qw=Qi(),$p=wo(),Zw=yo(),Fp="All mapping items must start at the same column";function e0({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=s?.nodeClass??Jw.YAMLMap,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:p,sep:h,value:f}=u,m=Bp.resolveProps(d,{indicator:"explicit-key-ind",next:p??h?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),g=!m.found;if(g){if(p&&(p.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&i(c,"BAD_INDENT",Fp)),!m.anchor&&!m.tag&&!h){l=m.end,m.comment&&(o.comment?o.comment+=`
5242
+ `+m.comment:o.comment=m.comment);continue}(m.newlineAfterProp||Qw.containsNewline(p))&&i(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==r.indent&&i(c,"BAD_INDENT",Fp);n.atKey=!0;let y=m.end,T=p?e(n,p,m,i):t(n,y,d,null,m,i);n.schema.compat&&$p.flowIndentCheck(r.indent,p,i),n.atKey=!1,Zw.mapIncludes(n,o.items,T)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let b=Bp.resolveProps(h??[],{indicator:"map-value-ind",next:f,offset:T.range[2],onError:i,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=b.end,b.found){g&&(f?.type==="block-map"&&!b.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<b.found.offset-1024&&i(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let C=f?e(n,f,b,i):t(n,c,h,null,b,i);n.schema.compat&&$p.flowIndentCheck(r.indent,f,i),c=C.range[2];let _=new Mp.Pair(T,C);n.options.keepSourceTokens&&(_.srcToken=u),o.items.push(_)}else{g&&i(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(T.comment?T.comment+=`
5243
+ `+b.comment:T.comment=b.comment);let C=new Mp.Pair(T);n.options.keepSourceTokens&&(C.srcToken=u),o.items.push(C)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),o.range=[r.offset,c,l??c],o}qp.resolveBlockMap=e0});var jp=B(Up=>{"use strict";S();var t0=Mt(),n0=pr(),r0=wo();function i0({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=s?.nodeClass??t0.YAMLSeq,o=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let p=n0.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(o.comment=p.comment);continue}let h=d?e(n,d,p,i):t(n,p.end,u,null,p,i);n.schema.compat&&r0.flowIndentCheck(r.indent,d,i),c=h.range[2],o.items.push(h)}return o.range=[r.offset,c,l??c],o}Up.resolveBlockSeq=i0});var Cn=B(Wp=>{"use strict";S();function s0(e,t,n,r){let i="";if(e){let s=!1,a="";for(let o of e){let{source:c,type:l}=o;switch(l){case"space":s=!0;break;case"comment":{n&&!s&&r(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=a+u:i=u,a="";break}case"newline":i&&(a+=c),s=!0;break;default:r(o,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}Wp.resolveEnd=s0});var Vp=B(zp=>{"use strict";S();var a0=X(),o0=Rt(),Kp=Dt(),l0=Mt(),c0=Cn(),Gp=pr(),d0=Qi(),p0=yo(),xo="Block collections are not allowed within flow collections",ko=e=>e&&(e.type==="block-map"||e.type==="block-seq");function u0({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=r.start.source==="{",o=a?"flow map":"flow sequence",c=s?.nodeClass??(a?Kp.YAMLMap:l0.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let g=0;g<r.items.length;++g){let y=r.items[g],{start:T,key:b,sep:C,value:_}=y,w=Gp.resolveProps(T,{flow:o,indicator:"explicit-key-ind",next:b??C?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!w.found){if(!w.anchor&&!w.tag&&!C&&!_){g===0&&w.comma?i(w.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):g<r.items.length-1&&i(w.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),w.comment&&(l.comment?l.comment+=`
5244
5244
  `+w.comment:l.comment=w.comment),d=w.end;continue}!a&&n.options.strict&&d0.containsNewline(b)&&i(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)w.comma&&i(w.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(w.comma||i(w.start,"MISSING_CHAR",`Missing , between ${o} items`),w.comment){let x="";e:for(let v of T)switch(v.type){case"comma":case"space":break;case"comment":x=v.source.substring(1);break e;default:break e}if(x){let v=l.items[l.items.length-1];a0.isPair(v)&&(v=v.value??v.key),v.comment?v.comment+=`
5245
5245
  `+x:v.comment=x,w.comment=w.comment.substring(x.length+1)}}if(!a&&!C&&!w.found){let x=_?e(n,_,w,i):t(n,w.end,C,null,w,i);l.items.push(x),d=x.range[2],ko(_)&&i(x.range,"BLOCK_IN_FLOW",xo)}else{n.atKey=!0;let x=w.end,v=b?e(n,b,w,i):t(n,x,T,null,w,i);ko(b)&&i(v.range,"BLOCK_IN_FLOW",xo),n.atKey=!1;let A=Gp.resolveProps(C??[],{flow:o,indicator:"map-value-ind",next:_,offset:v.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(A.found){if(!a&&!w.found&&n.options.strict){if(C)for(let O of C){if(O===A.found)break;if(O.type==="newline"){i(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}w.start<A.found.offset-1024&&i(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else _&&("source"in _&&_.source?.[0]===":"?i(_,"MISSING_CHAR",`Missing space after : in ${o}`):i(A.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let N=_?e(n,_,A,i):A.found?t(n,A.end,C,null,A,i):null;N?ko(_)&&i(N.range,"BLOCK_IN_FLOW",xo):A.comment&&(v.comment?v.comment+=`
5246
- `+A.comment:v.comment=A.comment);let M=new o0.Pair(v,N);if(n.options.keepSourceTokens&&(M.srcToken=y),a){let O=l;p0.mapIncludes(n,O.items,v)&&i(x,"DUPLICATE_KEY","Map keys must be unique"),O.items.push(M)}else{let O=new Kp.YAMLMap(n.schema);O.flow=!0,O.items.push(M);let F=(N??v).range;O.range=[v.range[0],F[1],F[2]],l.items.push(O)}d=N?N.range[2]:A.end}}let p=a?"}":"]",[h,...f]=r.end,m=d;if(h?.source===p)m=h.offset+h.source.length;else{let g=o[0].toUpperCase()+o.substring(1),y=u?`${g} must end with a ${p}`:`${g} in block collection must be sufficiently indented and end with a ${p}`;i(d,u?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&f.unshift(h)}if(f.length>0){let g=c0.resolveEnd(f,m,n.options.strict,i);g.comment&&(l.comment?l.comment+=`
5247
- `+g.comment:l.comment=g.comment),l.range=[r.offset,m,g.offset]}else l.range=[r.offset,m,m];return l}zp.resolveFlowCollection=u0});var Yp=B(Xp=>{"use strict";S();var h0=X(),m0=pe(),f0=Mt(),g0=Dt(),b0=Hp(),v0=jp(),w0=Vp();function To(e,t,n,r,i,s){let a=n.type==="block-map"?b0.resolveBlockMap(e,t,n,r,s):n.type==="block-seq"?v0.resolveBlockSeq(e,t,n,r,s):w0.resolveFlowCollection(e,t,n,r,s),o=a.constructor;return i==="!"||i===o.tagName?(a.tag=o.tagName,a):(i&&(a.tag=i),a)}function y0(e,t,n,r,i){let s=r.tag,a=s?t.directives.tagName(s.source,p=>i(s,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:h}=r,f=p&&s?p.offset>s.offset?p:s:p??s;f&&(!h||h.offset<f.offset)&&i(f,"MISSING_CHAR","Missing newline after block sequence props")}let o=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===f0.YAMLMap.tagName&&o==="map"||a===g0.YAMLSeq.tagName&&o==="seq")return To(e,t,n,i,a);let c=t.schema.tags.find(p=>p.tag===a&&p.collection===o);if(!c){let p=t.schema.knownTags[a];if(p?.collection===o)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?i(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),To(e,t,n,i,a)}let l=To(e,t,n,i,a,c),u=c.resolve?.(l,p=>i(s,"TAG_RESOLVE_FAILED",p),t.options)??l,d=h0.isNode(u)?u:new m0.Scalar(u);return d.range=l.range,d.tag=a,c?.format&&(d.format=c.format),d}Xp.composeCollection=y0});var Co=B(Jp=>{"use strict";S();var So=pe();function x0(e,t,n){let r=t.offset,i=k0(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=i.mode===">"?So.Scalar.BLOCK_FOLDED:So.Scalar.BLOCK_LITERAL,a=t.source?T0(t.source):[],o=a.length;for(let m=a.length-1;m>=0;--m){let g=a[m][1];if(g===""||g==="\r")o=m;else break}if(o===0){let m=i.chomp==="+"&&a.length>0?`
5246
+ `+A.comment:v.comment=A.comment);let D=new o0.Pair(v,N);if(n.options.keepSourceTokens&&(D.srcToken=y),a){let O=l;p0.mapIncludes(n,O.items,v)&&i(x,"DUPLICATE_KEY","Map keys must be unique"),O.items.push(D)}else{let O=new Kp.YAMLMap(n.schema);O.flow=!0,O.items.push(D);let F=(N??v).range;O.range=[v.range[0],F[1],F[2]],l.items.push(O)}d=N?N.range[2]:A.end}}let p=a?"}":"]",[h,...f]=r.end,m=d;if(h?.source===p)m=h.offset+h.source.length;else{let g=o[0].toUpperCase()+o.substring(1),y=u?`${g} must end with a ${p}`:`${g} in block collection must be sufficiently indented and end with a ${p}`;i(d,u?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&f.unshift(h)}if(f.length>0){let g=c0.resolveEnd(f,m,n.options.strict,i);g.comment&&(l.comment?l.comment+=`
5247
+ `+g.comment:l.comment=g.comment),l.range=[r.offset,m,g.offset]}else l.range=[r.offset,m,m];return l}zp.resolveFlowCollection=u0});var Yp=B(Xp=>{"use strict";S();var h0=X(),m0=pe(),f0=Dt(),g0=Mt(),b0=Hp(),v0=jp(),w0=Vp();function To(e,t,n,r,i,s){let a=n.type==="block-map"?b0.resolveBlockMap(e,t,n,r,s):n.type==="block-seq"?v0.resolveBlockSeq(e,t,n,r,s):w0.resolveFlowCollection(e,t,n,r,s),o=a.constructor;return i==="!"||i===o.tagName?(a.tag=o.tagName,a):(i&&(a.tag=i),a)}function y0(e,t,n,r,i){let s=r.tag,a=s?t.directives.tagName(s.source,p=>i(s,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:h}=r,f=p&&s?p.offset>s.offset?p:s:p??s;f&&(!h||h.offset<f.offset)&&i(f,"MISSING_CHAR","Missing newline after block sequence props")}let o=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===f0.YAMLMap.tagName&&o==="map"||a===g0.YAMLSeq.tagName&&o==="seq")return To(e,t,n,i,a);let c=t.schema.tags.find(p=>p.tag===a&&p.collection===o);if(!c){let p=t.schema.knownTags[a];if(p?.collection===o)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?i(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),To(e,t,n,i,a)}let l=To(e,t,n,i,a,c),u=c.resolve?.(l,p=>i(s,"TAG_RESOLVE_FAILED",p),t.options)??l,d=h0.isNode(u)?u:new m0.Scalar(u);return d.range=l.range,d.tag=a,c?.format&&(d.format=c.format),d}Xp.composeCollection=y0});var Co=B(Jp=>{"use strict";S();var So=pe();function x0(e,t,n){let r=t.offset,i=k0(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=i.mode===">"?So.Scalar.BLOCK_FOLDED:So.Scalar.BLOCK_LITERAL,a=t.source?T0(t.source):[],o=a.length;for(let m=a.length-1;m>=0;--m){let g=a[m][1];if(g===""||g==="\r")o=m;else break}if(o===0){let m=i.chomp==="+"&&a.length>0?`
5248
5248
  `.repeat(Math.max(1,a.length-1)):"",g=r+i.length;return t.source&&(g+=t.source.length),{value:m,type:s,comment:i.comment,range:[r,g,g]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let m=0;m<o;++m){let[g,y]=a[m];if(y===""||y==="\r")i.indent===0&&g.length>c&&(c=g.length);else{g.length<c&&n(l+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=g.length),u=m,c===0&&!e.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=g.length+y.length+1}for(let m=a.length-1;m>=o;--m)a[m][0].length>c&&(o=m+1);let d="",p="",h=!1;for(let m=0;m<u;++m)d+=a[m][0].slice(c)+`
5249
5249
  `;for(let m=u;m<o;++m){let[g,y]=a[m];l+=g.length+y.length+1;let T=y[y.length-1]==="\r";if(T&&(y=y.slice(0,-1)),y&&g.length<c){let C=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(l-y.length-(T?2:1),"BAD_INDENT",C),g=""}s===So.Scalar.BLOCK_LITERAL?(d+=p+g.slice(c)+y,p=`
5250
5250
  `):g.length>c||y[0]===" "?(p===" "?p=`
@@ -5274,7 +5274,7 @@ ${l}
5274
5274
  `);)r===`
5275
5275
  `&&(n+=`
5276
5276
  `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}var P0={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
5277
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function I0(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let o=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}Zp.resolveFlowScalar=C0});var nu=B(tu=>{"use strict";S();var Yt=X(),eu=pe(),O0=Co(),R0=Ao();function L0(e,t,n,r){let{value:i,type:s,comment:a,range:o}=t.type==="block-scalar"?O0.resolveBlockScalar(e,t,r):R0.resolveFlowScalar(t,e.options.strict,r),c=n?e.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[Yt.SCALAR]:c?l=M0(e.schema,i,c,n,r):t.type==="scalar"?l=D0(e,i,t,r):l=e.schema[Yt.SCALAR];let u;try{let d=l.resolve(i,p=>r(n??t,"TAG_RESOLVE_FAILED",p),e.options);u=Yt.isScalar(d)?d:new eu.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);r(n??t,"TAG_RESOLVE_FAILED",p),u=new eu.Scalar(i)}return u.range=o,u.source=i,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),a&&(u.comment=a),u}function M0(e,t,n,r,i){if(n==="!")return e[Yt.SCALAR];let s=[];for(let o of e.tags)if(!o.collection&&o.tag===n)if(o.default&&o.test)s.push(o);else return o;for(let o of s)if(o.test?.test(t))return o;let a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Yt.SCALAR])}function D0({atKey:e,directives:t,schema:n},r,i,s){let a=n.tags.find(o=>(o.default===!0||e&&o.default==="key")&&o.test?.test(r))||n[Yt.SCALAR];if(n.compat){let o=n.compat.find(c=>c.default&&c.test?.test(r))??n[Yt.SCALAR];if(a.tag!==o.tag){let c=t.tagString(a.tag),l=t.tagString(o.tag),u=`Value may be parsed as either ${c} or ${l}`;s(i,"TAG_RESOLVE_FAILED",u,!0)}}return a}tu.composeScalar=L0});var iu=B(ru=>{"use strict";S();function B0(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];i?.type==="space";)e+=i.source.length,i=t[++r];break}}return e}ru.emptyScalarPosition=B0});var ou=B(No=>{"use strict";S();var $0=Kn(),F0=X(),q0=Yp(),su=nu(),H0=Cn(),U0=iu(),j0={composeNode:au,composeEmptyNode:_o};function au(e,t,n,r){let i=e.atKey,{spaceBefore:s,comment:a,anchor:o,tag:c}=n,l,u=!0;switch(t.type){case"alias":l=W0(e,t,r),(o||c)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=su.composeScalar(e,t,c,r),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=q0.composeCollection(j0,e,t,n,r),o&&(l.anchor=o.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);r(t,"RESOURCE_EXHAUSTION",p)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=_o(e,t.offset,void 0,null,n,r)),o&&l.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!F0.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?l.comment=a:l.commentBefore=a),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function _o(e,t,n,r,{spaceBefore:i,comment:s,anchor:a,tag:o,end:c},l){let u={type:"scalar",offset:U0.emptyScalarPosition(t,n,r),indent:-1,source:""},d=su.composeScalar(e,u,o,l);return a&&(d.anchor=a.source.substring(1),d.anchor===""&&l(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function W0({options:e},{offset:t,source:n,end:r},i){let s=new $0.Alias(n.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=t+n.length,o=H0.resolveEnd(r,a,e.strict,i);return s.range=[t,a,o.offset],o.comment&&(s.comment=o.comment),s}No.composeEmptyNode=_o;No.composeNode=au});var du=B(cu=>{"use strict";S();var K0=or(),lu=ou(),G0=Cn(),z0=pr();function V0(e,t,{offset:n,start:r,value:i,end:s},a){let o=Object.assign({_directives:t},e),c=new K0.Document(void 0,o),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=z0.resolveProps(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&a(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?lu.composeNode(l,i,u,a):lu.composeEmptyNode(l,u.end,r,null,u,a);let d=c.contents.range[2],p=G0.resolveEnd(s,d,!1,a);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}cu.composeDoc=V0});var Io=B(hu=>{"use strict";S();var X0=ri("process"),Y0=fa(),J0=or(),ur=dr(),pu=X(),Q0=du(),Z0=Cn();function hr(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function uu(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){let s=e[i];switch(s[0]){case"#":t+=(t===""?"":r?`
5277
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function I0(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let o=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}Zp.resolveFlowScalar=C0});var nu=B(tu=>{"use strict";S();var Yt=X(),eu=pe(),O0=Co(),R0=Ao();function L0(e,t,n,r){let{value:i,type:s,comment:a,range:o}=t.type==="block-scalar"?O0.resolveBlockScalar(e,t,r):R0.resolveFlowScalar(t,e.options.strict,r),c=n?e.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[Yt.SCALAR]:c?l=D0(e.schema,i,c,n,r):t.type==="scalar"?l=M0(e,i,t,r):l=e.schema[Yt.SCALAR];let u;try{let d=l.resolve(i,p=>r(n??t,"TAG_RESOLVE_FAILED",p),e.options);u=Yt.isScalar(d)?d:new eu.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);r(n??t,"TAG_RESOLVE_FAILED",p),u=new eu.Scalar(i)}return u.range=o,u.source=i,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),a&&(u.comment=a),u}function D0(e,t,n,r,i){if(n==="!")return e[Yt.SCALAR];let s=[];for(let o of e.tags)if(!o.collection&&o.tag===n)if(o.default&&o.test)s.push(o);else return o;for(let o of s)if(o.test?.test(t))return o;let a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Yt.SCALAR])}function M0({atKey:e,directives:t,schema:n},r,i,s){let a=n.tags.find(o=>(o.default===!0||e&&o.default==="key")&&o.test?.test(r))||n[Yt.SCALAR];if(n.compat){let o=n.compat.find(c=>c.default&&c.test?.test(r))??n[Yt.SCALAR];if(a.tag!==o.tag){let c=t.tagString(a.tag),l=t.tagString(o.tag),u=`Value may be parsed as either ${c} or ${l}`;s(i,"TAG_RESOLVE_FAILED",u,!0)}}return a}tu.composeScalar=L0});var iu=B(ru=>{"use strict";S();function B0(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];i?.type==="space";)e+=i.source.length,i=t[++r];break}}return e}ru.emptyScalarPosition=B0});var ou=B(No=>{"use strict";S();var $0=Kn(),F0=X(),q0=Yp(),su=nu(),H0=Cn(),U0=iu(),j0={composeNode:au,composeEmptyNode:_o};function au(e,t,n,r){let i=e.atKey,{spaceBefore:s,comment:a,anchor:o,tag:c}=n,l,u=!0;switch(t.type){case"alias":l=W0(e,t,r),(o||c)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=su.composeScalar(e,t,c,r),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=q0.composeCollection(j0,e,t,n,r),o&&(l.anchor=o.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);r(t,"RESOURCE_EXHAUSTION",p)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=_o(e,t.offset,void 0,null,n,r)),o&&l.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!F0.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?l.comment=a:l.commentBefore=a),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function _o(e,t,n,r,{spaceBefore:i,comment:s,anchor:a,tag:o,end:c},l){let u={type:"scalar",offset:U0.emptyScalarPosition(t,n,r),indent:-1,source:""},d=su.composeScalar(e,u,o,l);return a&&(d.anchor=a.source.substring(1),d.anchor===""&&l(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function W0({options:e},{offset:t,source:n,end:r},i){let s=new $0.Alias(n.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=t+n.length,o=H0.resolveEnd(r,a,e.strict,i);return s.range=[t,a,o.offset],o.comment&&(s.comment=o.comment),s}No.composeEmptyNode=_o;No.composeNode=au});var du=B(cu=>{"use strict";S();var K0=or(),lu=ou(),G0=Cn(),z0=pr();function V0(e,t,{offset:n,start:r,value:i,end:s},a){let o=Object.assign({_directives:t},e),c=new K0.Document(void 0,o),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=z0.resolveProps(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&a(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?lu.composeNode(l,i,u,a):lu.composeEmptyNode(l,u.end,r,null,u,a);let d=c.contents.range[2],p=G0.resolveEnd(s,d,!1,a);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}cu.composeDoc=V0});var Io=B(hu=>{"use strict";S();var X0=ri("process"),Y0=fa(),J0=or(),ur=dr(),pu=X(),Q0=du(),Z0=Cn();function hr(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function uu(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){let s=e[i];switch(s[0]){case"#":t+=(t===""?"":r?`
5278
5278
 
5279
5279
  `:`
5280
5280
  `)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Po=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{let a=hr(n);s?this.warnings.push(new ur.YAMLWarning(a,r,i)):this.errors.push(new ur.YAMLParseError(a,r,i))},this.directives=new Y0.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:r,afterEmptyLine:i}=uu(this.prelude);if(r){let s=t.contents;if(n)t.comment=t.comment?`${t.comment}
@@ -5289,9 +5289,9 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
5289
5289
  `),r=t.substring(0,n),i=t.substring(n+1)+`
5290
5290
  `;if(e.type==="block-scalar"){let s=e.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=r,e.source=i}else{let{offset:s}=e,a="indent"in e?e.indent:-1,o=[{type:"block-scalar-header",offset:s,indent:a,source:r}];fu(o,"end"in e?e.end:void 0)||o.push({type:"newline",offset:-1,indent:a,source:`
5291
5291
  `});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:a,props:o,source:i})}}function fu(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function Oo(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let r=e.props.slice(1),i=t.length;e.props[0].type==="block-scalar-header"&&(i-=e.props[0].source.length);for(let s of r)s.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
5292
- `};delete e.items,Object.assign(e,{type:n,source:t,end:[i]});break}default:{let r="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(e))s!=="type"&&s!=="offset"&&delete e[s];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}Zi.createScalarToken=iy;Zi.resolveAsScalar=ry;Zi.setScalarValue=sy});var vu=B(bu=>{"use strict";S();var oy=e=>"type"in e?ts(e):es(e);function ts(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=ts(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=es(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=es(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=es(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function es({start:e,key:t,sep:n,value:r}){let i="";for(let s of e)i+=s.source;if(t&&(i+=ts(t)),n)for(let s of n)i+=s.source;return r&&(i+=ts(r)),i}bu.stringify=oy});var ku=B(xu=>{"use strict";S();var Ro=Symbol("break visit"),ly=Symbol("skip children"),wu=Symbol("remove item");function Jt(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),yu(Object.freeze([]),e,t)}Jt.BREAK=Ro;Jt.SKIP=ly;Jt.REMOVE=wu;Jt.itemAtPath=(e,t)=>{let n=e;for(let[r,i]of t){let s=n?.[r];if(s&&"items"in s)n=s.items[i];else return}return n};Jt.parentCollection=(e,t)=>{let n=Jt.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function yu(e,t,n){let r=n(t,e);if(typeof r=="symbol")return r;for(let i of["key","value"]){let s=t[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let o=yu(Object.freeze(e.concat([[i,a]])),s.items[a],n);if(typeof o=="number")a=o-1;else{if(o===Ro)return Ro;o===wu&&(s.items.splice(a,1),a-=1)}}typeof r=="function"&&i==="key"&&(r=r(t,e))}}return typeof r=="function"?r(t,e):r}xu.visit=Jt});var ns=B(Pe=>{"use strict";S();var Lo=gu(),cy=vu(),dy=ku(),Mo="\uFEFF",Do="",Bo="",$o="",py=e=>!!e&&"items"in e,uy=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function hy(e){switch(e){case Mo:return"<BOM>";case Do:return"<DOC>";case Bo:return"<FLOW_END>";case $o:return"<SCALAR>";default:return JSON.stringify(e)}}function my(e){switch(e){case Mo:return"byte-order-mark";case Do:return"doc-mode";case Bo:return"flow-error-end";case $o:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
5292
+ `};delete e.items,Object.assign(e,{type:n,source:t,end:[i]});break}default:{let r="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(e))s!=="type"&&s!=="offset"&&delete e[s];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}Zi.createScalarToken=iy;Zi.resolveAsScalar=ry;Zi.setScalarValue=sy});var vu=B(bu=>{"use strict";S();var oy=e=>"type"in e?ts(e):es(e);function ts(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=ts(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=es(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=es(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=es(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function es({start:e,key:t,sep:n,value:r}){let i="";for(let s of e)i+=s.source;if(t&&(i+=ts(t)),n)for(let s of n)i+=s.source;return r&&(i+=ts(r)),i}bu.stringify=oy});var ku=B(xu=>{"use strict";S();var Ro=Symbol("break visit"),ly=Symbol("skip children"),wu=Symbol("remove item");function Jt(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),yu(Object.freeze([]),e,t)}Jt.BREAK=Ro;Jt.SKIP=ly;Jt.REMOVE=wu;Jt.itemAtPath=(e,t)=>{let n=e;for(let[r,i]of t){let s=n?.[r];if(s&&"items"in s)n=s.items[i];else return}return n};Jt.parentCollection=(e,t)=>{let n=Jt.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function yu(e,t,n){let r=n(t,e);if(typeof r=="symbol")return r;for(let i of["key","value"]){let s=t[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let o=yu(Object.freeze(e.concat([[i,a]])),s.items[a],n);if(typeof o=="number")a=o-1;else{if(o===Ro)return Ro;o===wu&&(s.items.splice(a,1),a-=1)}}typeof r=="function"&&i==="key"&&(r=r(t,e))}}return typeof r=="function"?r(t,e):r}xu.visit=Jt});var ns=B(Pe=>{"use strict";S();var Lo=gu(),cy=vu(),dy=ku(),Do="\uFEFF",Mo="",Bo="",$o="",py=e=>!!e&&"items"in e,uy=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function hy(e){switch(e){case Do:return"<BOM>";case Mo:return"<DOC>";case Bo:return"<FLOW_END>";case $o:return"<SCALAR>";default:return JSON.stringify(e)}}function my(e){switch(e){case Do:return"byte-order-mark";case Mo:return"doc-mode";case Bo:return"flow-error-end";case $o:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
5293
5293
  `:case`\r
5294
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Pe.createScalarToken=Lo.createScalarToken;Pe.resolveAsScalar=Lo.resolveAsScalar;Pe.setScalarValue=Lo.setScalarValue;Pe.stringify=cy.stringify;Pe.visit=dy.visit;Pe.BOM=Mo;Pe.DOCUMENT=Do;Pe.FLOW_END=Bo;Pe.SCALAR=$o;Pe.isCollection=py;Pe.isScalar=uy;Pe.prettyToken=hy;Pe.tokenType=my});var Ho=B(Su=>{"use strict";S();var mr=ns();function Ke(e){switch(e){case void 0:case" ":case`
5294
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Pe.createScalarToken=Lo.createScalarToken;Pe.resolveAsScalar=Lo.resolveAsScalar;Pe.setScalarValue=Lo.setScalarValue;Pe.stringify=cy.stringify;Pe.visit=dy.visit;Pe.BOM=Do;Pe.DOCUMENT=Mo;Pe.FLOW_END=Bo;Pe.SCALAR=$o;Pe.isCollection=py;Pe.isScalar=uy;Pe.prettyToken=hy;Pe.tokenType=my});var Ho=B(Su=>{"use strict";S();var mr=ns();function Ke(e){switch(e){case void 0:case" ":case`
5295
5295
  `:case"\r":case" ":return!0;default:return!1}}var Tu=new Set("0123456789ABCDEFabcdef"),fy=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),rs=new Set(",[]{}"),gy=new Set(` ,[]{}
5296
5296
  \r `),Fo=e=>!e||gy.has(e),qo=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
5297
5297
  `?!0:n==="\r"?this.buffer[t+1]===`
@@ -5314,7 +5314,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
5314
5314
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
5315
5315
  `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){ss(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&n.sep&&!n.value){let a=[];for(let o=0;o<n.sep.length;++o){let c=n.sep[o];switch(c.type){case"newline":a.push(o);break;case"space":break;case"comment":c.indent>t.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),t.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(s.push(this.sourceToken),t.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Bt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Nu(n.key)&&!Bt(n.sep,"newline")){let a=En(n.start),o=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:o,sep:c}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(Bt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let a=En(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:s,key:null,sep:[this.sourceToken]}):Bt(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);i||n.value?(t.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(t);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Bt(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){ss(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Bt(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=is(r),s=En(i);_u(t);let a=t.end.splice(1,t.end.length);a.push(this.sourceToken);let o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
5316
5316
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
5317
- `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=is(t),r=En(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=is(t),r=En(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Pu.Parser=Wo});var Mu=B(gr=>{"use strict";S();var Iu=Io(),wy=or(),fr=dr(),yy=_a(),xy=X(),ky=jo(),Ou=Ko();function Ru(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new ky.LineCounter||null,prettyErrors:t}}function Ty(e,t={}){let{lineCounter:n,prettyErrors:r}=Ru(t),i=new Ou.Parser(n?.addNewLine),s=new Iu.Composer(t),a=Array.from(s.compose(i.parse(e)));if(r&&n)for(let o of a)o.errors.forEach(fr.prettifyError(e,n)),o.warnings.forEach(fr.prettifyError(e,n));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function Lu(e,t={}){let{lineCounter:n,prettyErrors:r}=Ru(t),i=new Ou.Parser(n?.addNewLine),s=new Iu.Composer(t),a=null;for(let o of s.compose(i.parse(e),!0,e.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new fr.YAMLParseError(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(fr.prettifyError(e,n)),a.warnings.forEach(fr.prettifyError(e,n))),a}function Sy(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let i=Lu(e,n);if(!i)return null;if(i.warnings.forEach(s=>yy.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Cy(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=n??t??{};if(!i)return}return xy.isDocument(e)&&!r?e.toString(n):new wy.Document(e,r,n).toString(n)}gr.parse=Sy;gr.parseAllDocuments=Ty;gr.parseDocument=Lu;gr.stringify=Cy});var Bu=B(J=>{"use strict";S();var Ey=Io(),Ay=or(),_y=po(),Go=dr(),Ny=Kn(),$t=X(),Py=Rt(),Iy=pe(),Oy=Mt(),Ry=Dt(),Ly=ns(),My=Ho(),Dy=jo(),By=Ko(),as=Mu(),Du=Hn();J.Composer=Ey.Composer;J.Document=Ay.Document;J.Schema=_y.Schema;J.YAMLError=Go.YAMLError;J.YAMLParseError=Go.YAMLParseError;J.YAMLWarning=Go.YAMLWarning;J.Alias=Ny.Alias;J.isAlias=$t.isAlias;J.isCollection=$t.isCollection;J.isDocument=$t.isDocument;J.isMap=$t.isMap;J.isNode=$t.isNode;J.isPair=$t.isPair;J.isScalar=$t.isScalar;J.isSeq=$t.isSeq;J.Pair=Py.Pair;J.Scalar=Iy.Scalar;J.YAMLMap=Oy.YAMLMap;J.YAMLSeq=Ry.YAMLSeq;J.CST=Ly;J.Lexer=My.Lexer;J.LineCounter=Dy.LineCounter;J.Parser=By.Parser;J.parse=as.parse;J.parseAllDocuments=as.parseAllDocuments;J.parseDocument=as.parseDocument;J.stringify=as.stringify;J.visit=Du.visit;J.visitAsync=Du.visitAsync});import ft from"node:fs";import Ie from"node:path";function ls(e){let t=Ie.resolve(e);for(;;){if(ft.existsSync(Ie.join(t,Zt)))return t;let n=Ie.dirname(t);if(n===t)return null;t=n}}function cs(e){let t=e.replace(/^/,"").replace(/\r\n/g,`
5317
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=is(t),r=En(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=is(t),r=En(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Pu.Parser=Wo});var Du=B(gr=>{"use strict";S();var Iu=Io(),wy=or(),fr=dr(),yy=_a(),xy=X(),ky=jo(),Ou=Ko();function Ru(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new ky.LineCounter||null,prettyErrors:t}}function Ty(e,t={}){let{lineCounter:n,prettyErrors:r}=Ru(t),i=new Ou.Parser(n?.addNewLine),s=new Iu.Composer(t),a=Array.from(s.compose(i.parse(e)));if(r&&n)for(let o of a)o.errors.forEach(fr.prettifyError(e,n)),o.warnings.forEach(fr.prettifyError(e,n));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function Lu(e,t={}){let{lineCounter:n,prettyErrors:r}=Ru(t),i=new Ou.Parser(n?.addNewLine),s=new Iu.Composer(t),a=null;for(let o of s.compose(i.parse(e),!0,e.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new fr.YAMLParseError(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(fr.prettifyError(e,n)),a.warnings.forEach(fr.prettifyError(e,n))),a}function Sy(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let i=Lu(e,n);if(!i)return null;if(i.warnings.forEach(s=>yy.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Cy(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=n??t??{};if(!i)return}return xy.isDocument(e)&&!r?e.toString(n):new wy.Document(e,r,n).toString(n)}gr.parse=Sy;gr.parseAllDocuments=Ty;gr.parseDocument=Lu;gr.stringify=Cy});var Bu=B(J=>{"use strict";S();var Ey=Io(),Ay=or(),_y=po(),Go=dr(),Ny=Kn(),$t=X(),Py=Rt(),Iy=pe(),Oy=Dt(),Ry=Mt(),Ly=ns(),Dy=Ho(),My=jo(),By=Ko(),as=Du(),Mu=Hn();J.Composer=Ey.Composer;J.Document=Ay.Document;J.Schema=_y.Schema;J.YAMLError=Go.YAMLError;J.YAMLParseError=Go.YAMLParseError;J.YAMLWarning=Go.YAMLWarning;J.Alias=Ny.Alias;J.isAlias=$t.isAlias;J.isCollection=$t.isCollection;J.isDocument=$t.isDocument;J.isMap=$t.isMap;J.isNode=$t.isNode;J.isPair=$t.isPair;J.isScalar=$t.isScalar;J.isSeq=$t.isSeq;J.Pair=Py.Pair;J.Scalar=Iy.Scalar;J.YAMLMap=Oy.YAMLMap;J.YAMLSeq=Ry.YAMLSeq;J.CST=Ly;J.Lexer=Dy.Lexer;J.LineCounter=My.LineCounter;J.Parser=By.Parser;J.parse=as.parse;J.parseAllDocuments=as.parseAllDocuments;J.parseDocument=as.parseDocument;J.stringify=as.stringify;J.visit=Mu.visit;J.visitAsync=Mu.visitAsync});import ft from"node:fs";import Ie from"node:path";function ls(e){let t=Ie.resolve(e);for(;;){if(ft.existsSync(Ie.join(t,Zt)))return t;let n=Ie.dirname(t);if(n===t)return null;t=n}}function cs(e){let t=e.replace(/^/,"").replace(/\r\n/g,`
5318
5318
  `),n=/^---\n([\s\S]*?)\n---\n?/.exec(t);if(!n)return{front:{},body:t};let r=(0,An.parse)(n[1]);if(r!==null&&(typeof r!="object"||Array.isArray(r)))throw new Error("frontmatter kh\xF4ng ph\u1EA3i b\u1EA3ng kho\xE1");return{front:r??{},body:t.slice(n[0].length)}}function os(e){return(0,An.stringify)(e,$y)}function gt(e){let t={};for(let[n,r]of Object.entries(e))r==null||r===""||Array.isArray(r)&&r.length===0||typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0||(t[n]=r);return t}function Xo(e,t,n){return t.includes(e)?e:n}function Fu(e,t){return t.includes(e)?e:void 0}function qu(e){if(!e||typeof e!="object")return;let t=e;return{by:z(t.by),at:z(t.at)}}function Fy(e){let t=(0,An.parse)(e)??{},n=Array.isArray(t.members)?t.members.map(s=>({id:z(s.id),name:z(s.name)||z(s.id),...s.role?{role:z(s.role)}:{}})):[],r=t.overview&&typeof t.overview=="object"?t.overview:null,i=r?gt({purpose:z(r.purpose).trimEnd(),scope:z(r.scope).trimEnd(),environment:z(r.environment).trimEnd(),references:z(r.references).trimEnd(),terms:Array.isArray(r.terms)?r.terms.map(s=>({term:z(s.term),desc:z(s.desc)})).filter(s=>s.term):void 0,owner:z(r.owner),contractor:z(r.contractor),docVersion:z(r.doc_version),place:z(r.place)}):void 0;return{version:Number(t.version??1),title:z(t.title),language:t.language==="en"?"en":"vi",...t.ba?{ba:z(t.ba)}:{},members:n,...i&&Object.keys(i).length?{overview:i}:{}}}function qy(e){let t="# T\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED (Pan Test). `ba`: repo t\xE0i li\u1EC7u BA \u0111\u1EC3 tham chi\u1EBFu [[CN-\u2026]] v\xE0 ki\u1EC3m \u0111\u1ED9 ph\u1EE7.\n",n=e.overview,r=n?gt({purpose:n.purpose,scope:n.scope,environment:n.environment,references:n.references,terms:n.terms,owner:n.owner,contractor:n.contractor,doc_version:n.docVersion,place:n.place}):void 0;return t+os(gt({version:e.version,title:e.title,language:e.language,ba:e.ba,members:e.members.map(i=>gt({...i})),overview:r}))}function Hy(e,t){let{front:n,body:r}=cs(e),i=z(n.code);if(!ai.test(i))throw new Error(`m\xE3 ph\xE2n h\u1EC7 \xAB${i}\xBB sai m\u1EABu`);return{code:i,title:z(n.title),order:Number(n.order??0),suites:Vo(n.suites),commonSteps:r.trim(),file:t}}function Uy(e){return`---
5319
5319
  ${os(gt({code:e.code,title:e.title,order:e.order,suites:e.suites}))}---
5320
5320
  ${e.commonSteps.trim()?e.commonSteps.trim()+`
@@ -5332,15 +5332,15 @@ ${e.cases.length?os(e.cases.map(Gy)):`[]
5332
5332
  `)){let a=s.slice(s.lastIndexOf(":")+1).trim();a&&t.add(a)}}}catch{}return t}function Ku(e,t){let n=ps.resolve(e);if(br.existsSync(ps.join(n,Zt)))throw new K(U(`${n} \u0111\xE3 l\xE0 repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (${Zt})`,`${n} is already a test document repo (${Zt})`));let r={version:1,title:t.title,language:t.language??"vi",...t.ba?{ba:t.ba}:{},members:t.me?[{id:t.me.id,name:t.me.name,role:"Tester"}]:[]};Hu(n,r),br.mkdirSync(ps.join(n,Qt),{recursive:!0});let i=ps.join(n,".gitignore"),s=br.existsSync(i)?br.readFileSync(i,"utf8"):"";return/^\/?exports\/?$/m.test(s)||br.writeFileSync(i,s+(s&&!s.endsWith(`
5333
5333
  `)?`
5334
5334
  `:"")+`exports/
5335
- `),r}function hs(e,t,n){if(!ai.test(t))throw new K(U(`M\xE3 ph\xE2n h\u1EC7 \xAB${t}\xBB ph\u1EA3i l\xE0 ch\u1EEF hoa / s\u1ED1, 2\u201312 k\xFD t\u1EF1, b\u1EAFt \u0111\u1EA7u b\u1EB1ng ch\u1EEF.`,`Module code \xAB${t}\xBB must be 2\u201312 capitals / digits starting with a letter.`));if(e.modules.some(i=>i.code===t))throw new K(U(`\u0110\xE3 c\xF3 ph\xE2n h\u1EC7 ${t}.`,`Module ${t} already exists.`));let r={code:t,title:n,order:Math.max(0,...e.modules.map(i=>i.order))+1,suites:[],commonSteps:"",file:""};return Jo(e.root,r),e.modules.push(r),r}function vr(e,t,n){let r=ms(e,t);return Object.assign(r,n),Jo(e.root,r),r}function ms(e,t){let n=e.modules.find(r=>r.code===t);if(!n)throw new K(U(`Kh\xF4ng c\xF3 ph\xE2n h\u1EC7 ${t}.`,`No module ${t}.`));return n}function en(e,t,{withDeleted:n=!1}={}){let r=e.modules.find(s=>s.code===t),i=new Map((r?.suites??[]).map((s,a)=>[s,a]));return e.suites.filter(s=>s.module===t&&(n||s.status!=="deleted")).sort((s,a)=>(i.get(s.code)??1e9)-(i.get(a.code)??1e9)||s.code.localeCompare(a.code))}function fs(e,t){let n=ms(e,t.module);if(!t.title.trim())throw new K(U("K\u1ECBch b\u1EA3n c\u1EA7n t\xEAn.","The test suite needs a name."));let r=t.by??vt(e.root),i={code:mn("KB",n.code,us(e,t.avoid)),module:n.code,title:t.title.trim(),kind:t.kind??"functional",status:"drafting",covers:t.covers??[],useCases:t.useCases??[],...t.priority?{priority:t.priority}:{},...t.preconditions?{preconditions:t.preconditions}:{},owner:r,created:{by:r,at:Wu()},description:"",cases:[],file:""};ze(e.root,i),e.suites.push(i);let s=en(e,n.code).map(o=>o.code).filter(o=>o!==i.code),a=t.after?s.indexOf(t.after):-1;return s.splice(a>=0?a+1:s.length,0,i.code),vr(e,n.code,{suites:s}),i}function Gu(e,t){let n=e.suites.find(r=>r.code===t);if(!n)throw new K(U(`Kh\xF4ng c\xF3 k\u1ECBch b\u1EA3n ${t}.`,`No test suite ${t}.`));return n}function zu(e,t,n){let r=Gu(e,t);for(let[i,s]of Object.entries(n))s!==void 0&&(s===""&&(i==="priority"||i==="preconditions"||i==="owner")?delete r[i]:r[i]=s);return ze(e.root,r),r}function gs(e,t,n,r={}){let i=Gu(e,t);if(!n.case.trim())throw new K(U("T\xECnh hu\u1ED1ng c\u1EA7n m\xF4 t\u1EA3.","The test case needs a description."));let s={code:mn("TC",i.module,us(e,r.avoid)),case:n.case.trim(),...n.requirement?{requirement:n.requirement.trim()}:{},steps:(n.steps??"").trim(),expected:(n.expected??"").trim(),...n.priority?{priority:n.priority}:{},...n.tag?{tag:n.tag.trim()}:{}},a=r.after?i.cases.findIndex(o=>o.code===r.after):-1;return i.cases.splice(a>=0?a+1:i.cases.length,0,s),ze(e.root,i),s}function bs(e,t){if(!li.test(t))throw new K(U(`M\xE3 t\xECnh hu\u1ED1ng \xAB${t}\xBB sai m\u1EABu (TC-<PH>-XXXXXX).`,`Test case code \xAB${t}\xBB has the wrong format (TC-<MODULE>-XXXXXX).`));for(let n of e.suites){let r=n.cases.find(i=>i.code===t);if(r)return{suite:n,tc:r}}throw new K(U(`Kh\xF4ng c\xF3 t\xECnh hu\u1ED1ng ${t}.`,`No test case ${t}.`))}function vs(e,t,n){let{suite:r,tc:i}=bs(e,t);for(let[s,a]of Object.entries(n)){if(a===void 0)continue;let o=typeof a=="string"?a.trim():a;o===""&&(s==="requirement"||s==="priority"||s==="tag")?delete i[s]:i[s]=o}return ze(e.root,r),i}function Vu(e,t,n){let{suite:r,tc:i}=bs(e,t),s=r.cases.indexOf(i),a=s+n;return a<0||a>=r.cases.length||([r.cases[s],r.cases[a]]=[r.cases[a],r.cases[s]],ze(e.root,r)),i}function ws(e,t,n="",r){let{suite:i,tc:s}=bs(e,t);return s.deleted={by:r??vt(e.root),at:Wu(),...n?{reason:n}:{}},ze(e.root,i),s}function ys(e,t,n){if(!et.includes(n.status))throw new K(U(`Tr\u1EA1ng th\xE1i \xAB${n.status}\xBB kh\xF4ng h\u1EE3p l\u1EC7 (${et.join(" | ")}).`,`Invalid status \xAB${n.status}\xBB (${et.join(" | ")}).`));let{suite:r,tc:i}=bs(e,t);if(n.status==="failed"&&!(n.actual??"").trim())throw new K(U("Kh\xF4ng \u0111\u1EA1t: c\u1EA7n ghi k\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF.","Failed: enter the actual result."));if(n.status==="not-run")delete i.result;else{let s={status:n.status,by:n.by??vt(e.root),at:n.at??Jy()};n.actual?.trim()&&(s.actual=n.actual.trim()),n.env?.trim()&&(s.env=n.env.trim()),n.bug?.trim()&&(s.bug=n.bug.trim()),i.result=s}return ze(e.root,r),i}var K,Jy,Wu,wr=Se(()=>{"use strict";S();qn();fn();_n();si();K=class extends Error{},Jy=()=>new Date().toISOString().slice(0,10),Wu=()=>new Date().toISOString().replace(/\.\d{3}Z$/,"Z")});function xs(e,t){let n=[],r=Qy[e.config.language==="en"?"en":"vi"];for(let l of e.readErrors)n.push({rule:"E03",severity:"error",file:l.file,message:r.E03(l.message)});let i=new Map,s=(l,u)=>{let d=i.get(l);d?n.push({rule:"E01",severity:"error",code:l,file:u,message:r.E01(l,d)}):i.set(l,u)},a=new Set(e.modules.map(l=>l.code)),o=new Set;for(let l of e.suites){s(l.code,l.file),oi.exec(l.code)||n.push({rule:"E02",severity:"error",code:l.code,file:l.file,message:r.E02suite(l.code)}),a.has(l.module)||n.push({rule:"E04",severity:"error",code:l.code,file:l.file,message:r.E04(l.module)});for(let p of l.cases){s(p.code,l.file);let h=li.exec(p.code);h?h[1]!==l.module&&!p.deleted&&n.push({rule:"E02",severity:"error",code:p.code,file:l.file,message:r.E02mod(p.code,h[1],l.code)}):n.push({rule:"E02",severity:"error",code:p.code,file:l.file,message:r.E02case(p.code)})}if(l.status==="deleted")continue;for(let p of l.covers)o.add(p);let d=l.cases.filter(p=>!p.deleted);if(d.length===0&&n.push({rule:"T06",severity:"warn",code:l.code,file:l.file,message:r.T06(l.code)}),l.kind==="functional"&&l.covers.length===0&&n.push({rule:"T01",severity:"warn",code:l.code,file:l.file,message:r.T01(l.code)}),t)for(let p of l.covers){let h=t.get(p);h?h.deleted&&n.push({rule:"T05",severity:"warn",code:l.code,file:l.file,message:r.T05del(l.code,p)}):n.push({rule:"T05",severity:"warn",code:l.code,file:l.file,message:r.T05none(l.code,p)})}for(let p of d){let h=[!p.steps.trim()&&r.steps,!p.expected.trim()&&r.expected].filter(Boolean);h.length&&n.push({rule:"T03",severity:"warn",code:p.code,file:l.file,message:r.T03(p.code,h.join(r.and))}),p.result?.status==="failed"&&!p.result.actual?.trim()&&n.push({rule:"T04",severity:"warn",code:p.code,file:l.file,message:r.T04(p.code)})}}if(t)for(let l of t.values())l.deleted||l.type!=="function"||o.has(l.code)||n.push({rule:"T02",severity:"info",code:l.code,message:r.T02(l.code,l.title)});let c={error:0,warn:1,info:2};return n.sort((l,u)=>c[l.severity]-c[u.severity]||l.rule.localeCompare(u.rule))}function tn(){return{total:0,"not-run":0,passed:0,failed:0,blocked:0,skipped:0}}function yr(e,t=tn()){for(let n of e.cases)n.deleted||(t.total++,t[n.result?.status??"not-run"]++);return t}function Pn(e,t){let n=tn(),r=e.modules.map(s=>{let a=e.suites.filter(c=>c.module===s.code&&c.status!=="deleted"),o=tn();for(let c of a)yr(c,o);for(let c of Object.keys(n))n[c]+=o[c];return{code:s.code,title:s.title,suites:a.length,count:o}}),i=null;if(t){let s=new Set(e.suites.filter(o=>o.status!=="deleted").flatMap(o=>o.covers)),a=[...t.values()].filter(o=>o.type==="function"&&!o.deleted);i={functions:a.length,covered:a.filter(o=>s.has(o.code)).length}}return{all:n,modules:r,coverage:i}}var Qy,xr=Se(()=>{"use strict";S();fn();Qy={vi:{E03:e=>`Kh\xF4ng \u0111\u1ECDc \u0111\u01B0\u1EE3c t\u1EC7p: ${e}`,E01:(e,t)=>`Tr\xF9ng m\xE3 ${e} (\u0111\xE3 c\xF3 \u1EDF ${t}) \u2014 \u0111\u1ED5i m\xE3 m\u1ED9t b\xEAn (th\u01B0\u1EDDng do hai nh\xE1nh git c\xF9ng sinh).`,E02suite:e=>`M\xE3 k\u1ECBch b\u1EA3n \xAB${e}\xBB sai m\u1EABu.`,E04:e=>`K\u1ECBch b\u1EA3n thu\u1ED9c ph\xE2n h\u1EC7 ${e} nh\u01B0ng ch\u01B0a c\xF3 modules/${e}/_module.md.`,E02case:e=>`M\xE3 t\xECnh hu\u1ED1ng \xAB${e}\xBB sai m\u1EABu (TC-<PH>-XXXXXX).`,E02mod:(e,t,n)=>`T\xECnh hu\u1ED1ng ${e} mang m\xE3 ph\xE2n h\u1EC7 ${t} nh\u01B0ng n\u1EB1m trong k\u1ECBch b\u1EA3n ${n}.`,T06:e=>`K\u1ECBch b\u1EA3n ${e} ch\u01B0a c\xF3 t\xECnh hu\u1ED1ng.`,T01:e=>`K\u1ECBch b\u1EA3n ${e} ch\u01B0a ghi ch\u1EE9c n\u0103ng n\xE0o \u0111\u01B0\u1EE3c ki\u1EC3m (covers).`,T05none:(e,t)=>`${e} ph\u1EE7 ${t} nh\u01B0ng repo BA kh\xF4ng c\xF3 m\u1EE5c n\xE0y.`,T05del:(e,t)=>`${e} ph\u1EE7 ${t} \u2014 m\u1EE5c n\xE0y \u0111\xE3 b\u1ECB xo\xE1 trong repo BA.`,steps:"c\xE1c b\u01B0\u1EDBc",expected:"k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i",and:" v\xE0 ",T03:(e,t)=>`T\xECnh hu\u1ED1ng ${e} thi\u1EBFu ${t}.`,T04:e=>`T\xECnh hu\u1ED1ng ${e} Kh\xF4ng \u0111\u1EA1t nh\u01B0ng ch\u01B0a ghi k\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF.`,T02:(e,t)=>`Ch\u1EE9c n\u0103ng ${e}${t?" \xAB"+t+"\xBB":""} ch\u01B0a c\xF3 k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED.`},en:{E03:e=>`Cannot read the file: ${e}`,E01:(e,t)=>`Duplicate code ${e} (already in ${t}) \u2014 change one of them (usually two git branches generated the same code).`,E02suite:e=>`Test suite code \xAB${e}\xBB has the wrong format.`,E04:e=>`The test suite belongs to module ${e}, but modules/${e}/_module.md does not exist.`,E02case:e=>`Test case code \xAB${e}\xBB has the wrong format (TC-<MODULE>-XXXXXX).`,E02mod:(e,t,n)=>`Test case ${e} has module code ${t} but is in test suite ${n}.`,T06:e=>`Test suite ${e} has no test cases yet.`,T01:e=>`Test suite ${e} does not name any function under test (covers).`,T05none:(e,t)=>`${e} covers ${t}, but the BA repo has no such item.`,T05del:(e,t)=>`${e} covers ${t} \u2014 that item was deleted in the BA repo.`,steps:"steps",expected:"expected result",and:" and ",T03:(e,t)=>`Test case ${e} has no ${t}.`,T04:e=>`Test case ${e} failed but has no actual result.`,T02:(e,t)=>`Function ${e}${t?" \xAB"+t+"\xBB":""} has no test suite yet.`}}});function Mr(e){"@babel/helpers - typeof";return Mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(e)}function ex(e,t){if(Mr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Mr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tx(e){var t=ex(e,"string");return Mr(t)=="symbol"?t:t+""}function E(e,t,n){return(t=tx(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xu(Object(n),!0).forEach(function(r){E(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rx(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Zl(e,t){if(e==null)return{};var n,r,i=rx(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function BC(e,t){return DC(e,t||{},0,0)}function $C(e,t){return IC(e,{i:2},t&&t.out,t&&t.dictionary)}function Ah(e,t){if(t){for(var n=new oe(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Eh)return Eh.encode(e);for(var i=e.length,s=new oe(e.length+(e.length>>1)),a=0,o=function(u){s[a++]=u},r=0;r<i;++r){if(a+5>s.length){var c=new oe(a+8+(i-r<<1));c.set(s),s=c}var l=e.charCodeAt(r);l<128||t?o(l):l<2048?(o(192|l>>6),o(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++r)&1023,o(240|l>>18),o(128|l>>12&63),o(128|l>>6&63),o(128|l&63)):(o(224|l>>12),o(128|l>>6&63),o(128|l&63))}return Vr(s,0,a)}function qC(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else{if(Hl)return Hl.decode(e);var i=FC(e),s=i.s,n=i.r;return n.length&&Ee(8),s}}function KC(e,t){t||(t={});var n={},r=[];Df(e,"",n,t);var i=0,s=0;for(var a in n){var o=n[a],c=o[0],l=o[1],u=l.level==0?0:8,d=Ah(a),p=d.length,h=l.comment,f=h&&Ah(h),m=f&&f.length,g=Ul(l.extra);p>65535&&Ee(11);var y=u?BC(c,l):c,T=y.length,b=MC();b.p(c),r.push(Mf(l,{size:c.length,crc:b.d(),c:y,f:d,m:f,u:p!=a.length||f&&h.length!=m,o:i,compression:u})),i+=30+p+g+T,s+=76+2*(p+g)+(m||0)+T}for(var C=new oe(s+22),_=i,w=s-i,x=0;x<r.length;++x){var d=r[x];_h(C,d.o,d,d.f,d.u,d.c.length);var v=30+d.f.length+Ul(d.extra);C.set(d.c,d.o+v),_h(C,i,d,d.f,d.u,d.c.length,d.o,d.m),i+=16+v+(d.m?d.m.length:0)}return WC(C,i,r.length,w,_),C}function GC(e,t){for(var n={},r=e.length-22;Be(e,r)!=101010256;--r)(!r||e.length-r>65558)&&Ee(13);var i=st(e,r+8);if(!i)return{};var s=Be(e,r+16),a=Be(e,r-20)==117853008;if(a){var o=Be(e,r-12);a=Be(e,o)==101075792,a&&(i=Be(e,o+32),s=Be(e,o+48))}for(var c=t&&t.filter,l=0;l<i;++l){var u=UC(e,s,a),d=u[0],p=u[1],h=u[2],f=u[3],m=u[4],g=u[5],y=HC(e,g);s=m,(!c||c({name:f,size:p,originalSize:h,compression:d}))&&(d?d==8?n[f]=$C(e.subarray(y,y+p),{out:new oe(h)}):Ee(14,"unknown compression type "+d):n[f]=Vr(e,y,y+p))}return n}function Oh(e,t,n,r,i,s,a){try{var o=e[s](a),c=o.value}catch(l){n(l);return}o.done?t(c):Promise.resolve(c).then(r,i)}function Kt(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function a(c){Oh(s,r,i,a,o,"next",c)}function o(c){Oh(s,r,i,a,o,"throw",c)}a(void 0)})}}var Zy,jr,Yh,Ws,nx,P,St,H,Jh,_e,ix,sx,ax,Qh,_s,ox,lx,Wr,cx,Zh,Ds,dx,nl,em,tm,j,nm,rm,px,ec,ux,hx,mx,im,le,Ks,sm,Yu,tc,fx,qt,am,om,at,gx,ve,bx,lm,vx,wx,yx,I,rl,cm,ot,kr,Pr,nn,L,ue,dm,nc,pm,um,hm,rc,xx,kx,Tx,Ju,Sx,Qu,Cx,Ex,Ax,_x,Zu,Nx,Px,Ix,ic,Ox,sc,Kr,he,Gr,Rx,Lx,Mx,Dx,Gs,ac,_r,mm,Bx,fm,$x,sn,an,Ht,Ut,Fx,qx,Hx,Ux,zs,jx,He,Wx,Kx,Gx,zx,Vx,Xx,Yx,Jx,Qx,Zx,rt,JP,ek,tk,nk,eh,Xe,Bn,rk,ik,sk,QP,ak,gm,ok,lk,$n,Tr,bm,ck,dk,pk,uk,hk,mk,il,vm,fk,gk,wm,bk,on,vk,wk,Dr,ks,yk,qe,Oe,oc,xk,ym,kk,Tk,Sk,Ck,Ek,Ak,_k,lc,xm,km,Nk,Pk,Ik,Ok,Rk,Tm,Lk,Br,Sm,Mk,Dk,Cm,Em,Bk,Am,_m,Nm,cc,$k,Fk,ct,dt,Je,$e,dc,qk,Pm,Hk,Uk,jk,Im,Wk,Kk,Om,Rm,Il,pc,Lm,Gk,Mm,zk,Vk,Xk,Yk,Jk,Qk,Zk,e1,t1,n1,uc,r1,Ol,i1,s1,sl,th,Vs,Dm,a1,o1,zr,l1,be,c1,d1,nh,p1,u1,h1,m1,f1,g1,b1,v1,w1,y1,x1,Xs,k1,T1,$m,S1,Mn,C1,Ys,Nr,rh,E1,A1,_1,Ts,N1,P1,hc,I1,mc,Fm,O1,R1,L1,qm,Um,jm,M1,D1,B1,$1,Wm,Bs,Ss,F1,q1,H1,U1,Km,j1,W1,al,K1,G1,Dn,ih,ne,z1,ZP,zm,V1,X1,Ln,sh,ol,Y1,Vm,J1,Q1,ah,Z1,eT,tT,nT,$s,rT,iT,sT,aT,it,Ns,Rl,oT,Ym,Fe,$r,Ps,Jm,fc,lT,cT,oh,dT,Is,pT,uT,hT,mT,fT,gT,bT,vT,Qm,wT,yT,xT,kT,TT,Zm,ST,lh,CT,ET,ef,AT,Fr,Ll,In,_T,tf,ll,NT,PT,IT,OT,nf,RT,LT,MT,gc,DT,BT,rf,$T,Fs,Ir,FT,Js,sf,qT,HT,UT,wt,ge,jT,Ml,Qs,WT,KT,ch,GT,zT,VT,XT,YT,JT,QT,ZT,eS,tS,nS,rS,of,iS,lf,dh,cl,sS,cf,aS,df,pf,oS,lS,cS,dS,pS,uS,uf,ph,dl,hS,hf,mS,fS,gS,bS,vS,mf,yt,wS,yS,xS,kS,TS,SS,CS,ES,AS,_S,NS,pl,PS,IS,uh,OS,RS,LS,MS,ff,gf,DS,BS,hh,mh,$S,FS,fh,qS,HS,US,gh,bh,jS,WS,KS,bf,GS,zS,VS,bc,Ct,ln,Wt,XS,YS,JS,QS,ZS,eC,tC,nC,rC,iC,sC,vf,vh,xt,wf,yf,xf,kf,Tf,Sf,aC,oC,lC,Or,vc,wh,yh,Dl,cC,dC,ul,pC,uC,hC,mC,fC,gC,wc,xh,Cf,bC,hl,vC,wC,kh,yC,Ef,Os,ml,fl,gl,xC,kC,TC,Qe,Af,_f,cn,yc,SC,oe,Le,xc,Zs,ea,Bl,Nf,Pf,If,$l,Of,CC,Th,Fl,kt,Y,lt,jt,Y,Y,Y,Y,qr,Y,EC,AC,_C,NC,bl,Ye,vl,kc,Vr,PC,Ee,IC,Tt,Sr,wl,ql,Sh,Cr,Rf,Ch,OC,Lf,RC,LC,MC,DC,Mf,st,Be,yl,ke,Df,Eh,Hl,FC,HC,UC,jC,Ul,_h,WC,zC,qs,VC,Nh,Bf,xl,Rs,Ph,jl,XC,YC,JC,Hr,Xr,Wl,Rr,QC,ZC,eE,tE,nE,rE,iE,$f,sE,aE,oE,Ff,Er,kl,lE,cE,dn,qf,Hf,dE,Uf,pE,uE,Tl,hE,Tc,mE,fE,Ih,gE,bE,Rh,Lh,Sc,jf,Wf,vE,wE,ta,pt,Kf,Gf,Te,zf,On,yE,xE,kE,Cc,Kl,Ur,Mh,TE,Dh,Bh,Gl,SE,$h,Fh,CE,EE,AE,_E,NE,zl,Ec,PE,Hs,Vf,IE,OE,Ce,RE,na,Xf,qh,LE,ME,Vl,Xl,DE,BE,$E,FE,qE,HE,UE,jE,Yf,WE,Cs,KE,GE,Es,Jf,zE,Hh,VE,XE,As,YE,JE,Uh,QE,ZE,e2,jh,t2,Yl,Sl,n2,r2,i2,Qf,Ls,s2,a2,Zf,Us,Yr,o2,eg,l2,c2,d2,Ar,tg,Cl,Wh,ng,Ac,El,p2,Kh,u2,_c,h2,m2,f2,g2,b2,Jl,v2,w2,rg,y2,Al,Gh,rn,ig,x2,k2,sg,T2,S2,C2,_l,E2,Lr,Ql,Ms,zh,A2,_2,N2,P2,I2,O2,R2,L2,ag,M2,D2,B2,$2,og,F2,q2,js,H2,lg,U2,j2,cg,dg,W2,pg,Vh,K2,G2,z2,Xh,eI,V2,tI,Nl,X2,ug=Se(()=>{S();Zy=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);jr=class{constructor(e){E(this,"rootKey",void 0),this.rootKey=e}get writtenAs(){}},Yh=e=>e instanceof jr||typeof e=="object"&&e!==null&&typeof e.prepForXml=="function",Ws=e=>Yh(e)?e.rootKey:void 0,nx=Object.seal({}),P=class extends jr{constructor(e){super(e),E(this,"root",void 0),this.root=new Array}prepForXml(e){var t;e.stack.push(this);let n=this.root.flatMap(r=>{if(Yh(r)){let i=r.writtenAs;return i?i.map(s=>s.prepForXml(e)):r.prepForXml(e)}return r}).filter(r=>r!==void 0);return e.stack.pop(),{[this.rootKey]:n.length?n.length===1&&(!((t=n[0])===null||t===void 0)&&t._attr)?n[0]:n:nx}}addChildElement(e){return this.root.push(e),this}},St=class extends P{constructor(e,t){super(e),E(this,"includeIfEmpty",void 0),this.includeIfEmpty=t}prepForXml(e){let t=super.prepForXml(e);return this.includeIfEmpty||t&&(typeof t[this.rootKey]!="object"||Object.keys(t[this.rootKey]).length)?t:void 0}};H=class extends jr{constructor(e){super("_attr"),E(this,"root",void 0),E(this,"xmlKeys",void 0),this.root=e}prepForXml(e){let t={};return Object.entries(this.root).forEach(([n,r])=>{if(r!==void 0){let i=this.xmlKeys&&this.xmlKeys[n]||n;t[i]=r}}),{_attr:t}}},Jh=class extends jr{constructor(e){super("_attr"),E(this,"root",void 0),this.root=e}prepForXml(e){return{_attr:Object.values(this.root).filter(({value:t})=>t!==void 0).reduce((t,{key:n,value:r})=>k(k({},t),{},{[n]:r}),{})}}},_e=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}};ix=["elements"],sx=new Map([["amp","&"],["lt","<"],["gt",">"],["quot",'"'],["apos","'"]]),ax=/&([^;]*);?/g,Qh=e=>e.indexOf("&")===-1?e:e.replace(ax,(t,n)=>{if(!t.endsWith(";"))throw new Error(`Invalid XML: "&" that starts no entity, in "${e}"`);let r=sx.get(n);if(r!==void 0)return r;let i=/^#x[0-9a-f]+$/i.test(n)?parseInt(n.slice(2),16):/^#[0-9]+$/.test(n)?parseInt(n.slice(1),10):NaN;if(!(i>0&&i<=1114111))throw new Error(`Invalid XML: unknown entity "${t}"`);return String.fromCodePoint(i)}),_s=e=>e===" "||e===`
5336
- `||e===" "||e==="\r",ox=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,lx=e=>Object.fromEntries([...e.matchAll(ox)].map(([,t,n,r])=>[t,n??r])),Wr=(e,{keepWhitespaceText:t=!1}={})=>{let n={},r=[],i=e.charCodeAt(0)===65279?1:0;for(;i<e.length&&_s(e[i]);)i++;let s=d=>{var p;let h=r.length===0?n:r[r.length-1];((p=h.elements)!==null&&p!==void 0?p:h.elements=[]).push(d)},a=d=>{if(d.trim()===""){d!==""&&t&&s({type:"text",text:d});return}if(r.length===0)throw new Error(`Invalid XML: text outside of the root element, "${d.trim()}"`);s({type:"text",text:Qh(d)})},o=(d,p,h)=>{let f=e.indexOf(d,p);if(f===-1)throw new Error(`Invalid XML: ${h} that isn't closed`);return f};for(;i<e.length;){let d=e.indexOf("<",i);if(a(e.slice(i,d===-1?e.length:d)),d===-1)break;if(e.startsWith("<?",d)){let p=o("?>",d+2,"processing instruction"),h=e.slice(d+2,p),f=h.search(/\s/),m=f===-1?h:h.slice(0,f),g=f===-1?"":h.slice(f).trimStart();if(m.toLowerCase()==="xml"){let y=lx(g);n.declaration=Object.keys(y).length>0?{attributes:y}:{}}else s({type:"instruction",name:m,instruction:g});i=p+2}else if(e.startsWith("<!--",d)){let p=o("-->",d+4,"comment"),h=e.slice(d+4,p);h!==""&&s({type:"comment",comment:h}),i=p+3}else if(e.startsWith("<![CDATA[",d)){let p=o("]]>",d+9,"CDATA section"),h=e.slice(d+9,p);h!==""&&s({type:"cdata",cdata:h}),i=p+3}else if(e.startsWith("<!DOCTYPE",d)){let p=d+9,h,f=!1;for(;p<e.length;p++){let m=e[p];if(h!==void 0)h=m===h?void 0:h;else if(m==='"'||m==="'")h=m;else if(m==="[")f=!0;else if(m==="]")f=!1;else if(m===">"&&!f)break}if(p===e.length)throw new Error("Invalid XML: DOCTYPE that isn't closed");s({type:"doctype",doctype:e.slice(d+9,p).replace(/^ /,"")}),i=p+1}else if(e.startsWith("</",d)){let p=o(">",d+2,"closing tag"),h=e.slice(d+2,p).trimEnd(),f=r.pop();if(f?.name!==h){var c;throw new Error(`Invalid XML: closing tag </${h}> doesn't match <${(c=f?.name)!==null&&c!==void 0?c:""}>`)}i=p+1}else i=cx(e,d+1,(p,h)=>{s(p),h||r.push(p)})}if(r.length>0)throw new Error(`Invalid XML: <${r[r.length-1].name}> isn't closed`);let{elements:l}=n,u=Zl(n,ix);return l===void 0?u:k(k({},u),{},{elements:l})},cx=(e,t,n)=>{let r=t;for(;r<e.length&&!_s(e[r])&&e[r]!=="/"&&e[r]!==">";)r++;let i=e.slice(t,r);if(i==="")throw new Error("Invalid XML: tag without a name");let s=[],a=r;for(;;){for(;a<e.length&&_s(e[a]);)a++;if(a>=e.length)throw new Error(`Invalid XML: <${i}> that isn't closed`);if(e[a]===">"||e.startsWith("/>",a)){let p=e[a]==="/";return n(k({type:"element",name:i},s.length>0?{attributes:Object.fromEntries(s)}:{}),p),a+(p?2:1)}let o=e.indexOf("=",a),c=e.slice(a,o===-1?e.length:o).trimEnd();if(o===-1||c===""||/[\s/>]/.test(c))throw new Error(`Invalid XML: attribute of <${i}> without a value`);let l=o+1;for(;l<e.length&&_s(e[l]);)l++;let u=e[l];if(u!=='"'&&u!=="'")throw new Error(`Invalid XML: value of ${c} on <${i}> isn't quoted`);let d=e.indexOf(u,l+1);if(d===-1)throw new Error(`Invalid XML: value of ${c} on <${i}> isn't closed`);s.some(([p])=>p===c)||s.push([c,Qh(e.slice(l+1,d))]),a=d+1}},Zh=new Map([["&","&amp;"],['"',"&quot;"],["'","&apos;"],["<","&lt;"],[">","&gt;"]]),Ds=e=>e.replace(/[&"'<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var n;return(n=Zh.get(t))!==null&&n!==void 0?n:""}),dx=e=>e.replace(/[&<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var n;return(n=Zh.get(t))!==null&&n!==void 0?n:""}),nl=e=>typeof e=="string"?Ds(e):e,em=(e,t,n)=>{let r=Object.keys(e)[0],i=r===void 0?void 0:e[r],s=[],a=[],o=c=>{for(let[l,u]of Object.entries(c))s.push(`${l}="${String(nl(u))}"`)};if(typeof i=="object"){if(i!==null){let{_attr:c,_cdata:l}=i;if(c&&o(c),l&&a.push(`<![CDATA[${l.replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`),Array.isArray(i)){let u=!1;a.push("");for(let d of i)typeof d=="object"?Object.keys(d)[0]==="_attr"?o(d._attr):a.push(em(d,t,n+1)):(a.pop(),u=!0,a.push(nl(d)));u||a.push("")}}}else a.push(nl(i));return{name:r,attributes:s,content:a,indents:n>1?t.repeat(n-1):""}},tm=(e,t,n)=>{if(typeof e!="object")return String(e);let{name:r,attributes:i,content:s,indents:a}=e,{length:o}=s,c=a+(r?`<${r}`:"")+(i.length>0?` ${i.join(" ")}`:"")+(o>0?r?">":"":"/>")+(t&&o>1?`
5335
+ `),r}function hs(e,t,n){if(!ai.test(t))throw new K(U(`M\xE3 ph\xE2n h\u1EC7 \xAB${t}\xBB ph\u1EA3i l\xE0 ch\u1EEF hoa / s\u1ED1, 2\u201312 k\xFD t\u1EF1, b\u1EAFt \u0111\u1EA7u b\u1EB1ng ch\u1EEF.`,`Module code \xAB${t}\xBB must be 2\u201312 capitals / digits starting with a letter.`));if(e.modules.some(i=>i.code===t))throw new K(U(`\u0110\xE3 c\xF3 ph\xE2n h\u1EC7 ${t}.`,`Module ${t} already exists.`));let r={code:t,title:n,order:Math.max(0,...e.modules.map(i=>i.order))+1,suites:[],commonSteps:"",file:""};return Jo(e.root,r),e.modules.push(r),r}function vr(e,t,n){let r=ms(e,t);return Object.assign(r,n),Jo(e.root,r),r}function ms(e,t){let n=e.modules.find(r=>r.code===t);if(!n)throw new K(U(`Kh\xF4ng c\xF3 ph\xE2n h\u1EC7 ${t}.`,`No module ${t}.`));return n}function en(e,t,{withDeleted:n=!1}={}){let r=e.modules.find(s=>s.code===t),i=new Map((r?.suites??[]).map((s,a)=>[s,a]));return e.suites.filter(s=>s.module===t&&(n||s.status!=="deleted")).sort((s,a)=>(i.get(s.code)??1e9)-(i.get(a.code)??1e9)||s.code.localeCompare(a.code))}function fs(e,t){let n=ms(e,t.module);if(!t.title.trim())throw new K(U("K\u1ECBch b\u1EA3n c\u1EA7n t\xEAn.","The test suite needs a name."));let r=t.by??vt(e.root),i={code:mn("KB",n.code,us(e,t.avoid)),module:n.code,title:t.title.trim(),kind:t.kind??"functional",status:"drafting",covers:t.covers??[],useCases:t.useCases??[],...t.priority?{priority:t.priority}:{},...t.preconditions?{preconditions:t.preconditions}:{},owner:r,created:{by:r,at:Wu()},description:"",cases:[],file:""};ze(e.root,i),e.suites.push(i);let s=en(e,n.code).map(o=>o.code).filter(o=>o!==i.code),a=t.after?s.indexOf(t.after):-1;return s.splice(a>=0?a+1:s.length,0,i.code),vr(e,n.code,{suites:s}),i}function Gu(e,t){let n=e.suites.find(r=>r.code===t);if(!n)throw new K(U(`Kh\xF4ng c\xF3 k\u1ECBch b\u1EA3n ${t}.`,`No test suite ${t}.`));return n}function zu(e,t,n){let r=Gu(e,t);for(let[i,s]of Object.entries(n))s!==void 0&&(s===""&&(i==="priority"||i==="preconditions"||i==="owner")?delete r[i]:r[i]=s);return ze(e.root,r),r}function gs(e,t,n,r={}){let i=Gu(e,t);if(!n.case.trim())throw new K(U("T\xECnh hu\u1ED1ng c\u1EA7n m\xF4 t\u1EA3.","The test case needs a description."));let s={code:mn("TC",i.module,us(e,r.avoid)),case:n.case.trim(),...n.requirement?{requirement:n.requirement.trim()}:{},steps:(n.steps??"").trim(),expected:(n.expected??"").trim(),...n.priority?{priority:n.priority}:{},...n.tag?{tag:n.tag.trim()}:{}},a=r.after?i.cases.findIndex(o=>o.code===r.after):-1;return i.cases.splice(a>=0?a+1:i.cases.length,0,s),ze(e.root,i),s}function bs(e,t){if(!li.test(t))throw new K(U(`M\xE3 t\xECnh hu\u1ED1ng \xAB${t}\xBB sai m\u1EABu (TC-<PH>-XXXXXX).`,`Test case code \xAB${t}\xBB has the wrong format (TC-<MODULE>-XXXXXX).`));for(let n of e.suites){let r=n.cases.find(i=>i.code===t);if(r)return{suite:n,tc:r}}throw new K(U(`Kh\xF4ng c\xF3 t\xECnh hu\u1ED1ng ${t}.`,`No test case ${t}.`))}function vs(e,t,n){let{suite:r,tc:i}=bs(e,t);for(let[s,a]of Object.entries(n)){if(a===void 0)continue;let o=typeof a=="string"?a.trim():a;o===""&&(s==="requirement"||s==="priority"||s==="tag")?delete i[s]:i[s]=o}return ze(e.root,r),i}function Vu(e,t,n){let{suite:r,tc:i}=bs(e,t),s=r.cases.indexOf(i),a=s+n;return a<0||a>=r.cases.length||([r.cases[s],r.cases[a]]=[r.cases[a],r.cases[s]],ze(e.root,r)),i}function ws(e,t,n="",r){let{suite:i,tc:s}=bs(e,t);return s.deleted={by:r??vt(e.root),at:Wu(),...n?{reason:n}:{}},ze(e.root,i),s}function ys(e,t,n){if(!et.includes(n.status))throw new K(U(`Tr\u1EA1ng th\xE1i \xAB${n.status}\xBB kh\xF4ng h\u1EE3p l\u1EC7 (${et.join(" | ")}).`,`Invalid status \xAB${n.status}\xBB (${et.join(" | ")}).`));let{suite:r,tc:i}=bs(e,t);if(n.status==="failed"&&!(n.actual??"").trim())throw new K(U("Kh\xF4ng \u0111\u1EA1t: c\u1EA7n ghi k\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF.","Failed: enter the actual result."));if(n.status==="not-run")delete i.result;else{let s={status:n.status,by:n.by??vt(e.root),at:n.at??Jy()};n.actual?.trim()&&(s.actual=n.actual.trim()),n.env?.trim()&&(s.env=n.env.trim()),n.bug?.trim()&&(s.bug=n.bug.trim()),i.result=s}return ze(e.root,r),i}var K,Jy,Wu,wr=Se(()=>{"use strict";S();qn();fn();_n();si();K=class extends Error{},Jy=()=>new Date().toISOString().slice(0,10),Wu=()=>new Date().toISOString().replace(/\.\d{3}Z$/,"Z")});function xs(e,t){let n=[],r=Qy[e.config.language==="en"?"en":"vi"];for(let l of e.readErrors)n.push({rule:"E03",severity:"error",file:l.file,message:r.E03(l.message)});let i=new Map,s=(l,u)=>{let d=i.get(l);d?n.push({rule:"E01",severity:"error",code:l,file:u,message:r.E01(l,d)}):i.set(l,u)},a=new Set(e.modules.map(l=>l.code)),o=new Set;for(let l of e.suites){s(l.code,l.file),oi.exec(l.code)||n.push({rule:"E02",severity:"error",code:l.code,file:l.file,message:r.E02suite(l.code)}),a.has(l.module)||n.push({rule:"E04",severity:"error",code:l.code,file:l.file,message:r.E04(l.module)});for(let p of l.cases){s(p.code,l.file);let h=li.exec(p.code);h?h[1]!==l.module&&!p.deleted&&n.push({rule:"E02",severity:"error",code:p.code,file:l.file,message:r.E02mod(p.code,h[1],l.code)}):n.push({rule:"E02",severity:"error",code:p.code,file:l.file,message:r.E02case(p.code)})}if(l.status==="deleted")continue;for(let p of l.covers)o.add(p);let d=l.cases.filter(p=>!p.deleted);if(d.length===0&&n.push({rule:"T06",severity:"warn",code:l.code,file:l.file,message:r.T06(l.code)}),l.kind==="functional"&&l.covers.length===0&&n.push({rule:"T01",severity:"warn",code:l.code,file:l.file,message:r.T01(l.code)}),t)for(let p of l.covers){let h=t.get(p);h?h.deleted&&n.push({rule:"T05",severity:"warn",code:l.code,file:l.file,message:r.T05del(l.code,p)}):n.push({rule:"T05",severity:"warn",code:l.code,file:l.file,message:r.T05none(l.code,p)})}for(let p of d){let h=[!p.steps.trim()&&r.steps,!p.expected.trim()&&r.expected].filter(Boolean);h.length&&n.push({rule:"T03",severity:"warn",code:p.code,file:l.file,message:r.T03(p.code,h.join(r.and))}),p.result?.status==="failed"&&!p.result.actual?.trim()&&n.push({rule:"T04",severity:"warn",code:p.code,file:l.file,message:r.T04(p.code)})}}if(t)for(let l of t.values())l.deleted||l.type!=="function"||o.has(l.code)||n.push({rule:"T02",severity:"info",code:l.code,message:r.T02(l.code,l.title)});let c={error:0,warn:1,info:2};return n.sort((l,u)=>c[l.severity]-c[u.severity]||l.rule.localeCompare(u.rule))}function tn(){return{total:0,"not-run":0,passed:0,failed:0,blocked:0,skipped:0}}function yr(e,t=tn()){for(let n of e.cases)n.deleted||(t.total++,t[n.result?.status??"not-run"]++);return t}function Pn(e,t){let n=tn(),r=e.modules.map(s=>{let a=e.suites.filter(c=>c.module===s.code&&c.status!=="deleted"),o=tn();for(let c of a)yr(c,o);for(let c of Object.keys(n))n[c]+=o[c];return{code:s.code,title:s.title,suites:a.length,count:o}}),i=null;if(t){let s=new Set(e.suites.filter(o=>o.status!=="deleted").flatMap(o=>o.covers)),a=[...t.values()].filter(o=>o.type==="function"&&!o.deleted);i={functions:a.length,covered:a.filter(o=>s.has(o.code)).length}}return{all:n,modules:r,coverage:i}}var Qy,xr=Se(()=>{"use strict";S();fn();Qy={vi:{E03:e=>`Kh\xF4ng \u0111\u1ECDc \u0111\u01B0\u1EE3c t\u1EC7p: ${e}`,E01:(e,t)=>`Tr\xF9ng m\xE3 ${e} (\u0111\xE3 c\xF3 \u1EDF ${t}) \u2014 \u0111\u1ED5i m\xE3 m\u1ED9t b\xEAn (th\u01B0\u1EDDng do hai nh\xE1nh git c\xF9ng sinh).`,E02suite:e=>`M\xE3 k\u1ECBch b\u1EA3n \xAB${e}\xBB sai m\u1EABu.`,E04:e=>`K\u1ECBch b\u1EA3n thu\u1ED9c ph\xE2n h\u1EC7 ${e} nh\u01B0ng ch\u01B0a c\xF3 modules/${e}/_module.md.`,E02case:e=>`M\xE3 t\xECnh hu\u1ED1ng \xAB${e}\xBB sai m\u1EABu (TC-<PH>-XXXXXX).`,E02mod:(e,t,n)=>`T\xECnh hu\u1ED1ng ${e} mang m\xE3 ph\xE2n h\u1EC7 ${t} nh\u01B0ng n\u1EB1m trong k\u1ECBch b\u1EA3n ${n}.`,T06:e=>`K\u1ECBch b\u1EA3n ${e} ch\u01B0a c\xF3 t\xECnh hu\u1ED1ng.`,T01:e=>`K\u1ECBch b\u1EA3n ${e} ch\u01B0a ghi ch\u1EE9c n\u0103ng n\xE0o \u0111\u01B0\u1EE3c ki\u1EC3m (covers).`,T05none:(e,t)=>`${e} ph\u1EE7 ${t} nh\u01B0ng repo BA kh\xF4ng c\xF3 m\u1EE5c n\xE0y.`,T05del:(e,t)=>`${e} ph\u1EE7 ${t} \u2014 m\u1EE5c n\xE0y \u0111\xE3 b\u1ECB xo\xE1 trong repo BA.`,steps:"c\xE1c b\u01B0\u1EDBc",expected:"k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i",and:" v\xE0 ",T03:(e,t)=>`T\xECnh hu\u1ED1ng ${e} thi\u1EBFu ${t}.`,T04:e=>`T\xECnh hu\u1ED1ng ${e} Kh\xF4ng \u0111\u1EA1t nh\u01B0ng ch\u01B0a ghi k\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF.`,T02:(e,t)=>`Ch\u1EE9c n\u0103ng ${e}${t?" \xAB"+t+"\xBB":""} ch\u01B0a c\xF3 k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED.`},en:{E03:e=>`Cannot read the file: ${e}`,E01:(e,t)=>`Duplicate code ${e} (already in ${t}) \u2014 change one of them (usually two git branches generated the same code).`,E02suite:e=>`Test suite code \xAB${e}\xBB has the wrong format.`,E04:e=>`The test suite belongs to module ${e}, but modules/${e}/_module.md does not exist.`,E02case:e=>`Test case code \xAB${e}\xBB has the wrong format (TC-<MODULE>-XXXXXX).`,E02mod:(e,t,n)=>`Test case ${e} has module code ${t} but is in test suite ${n}.`,T06:e=>`Test suite ${e} has no test cases yet.`,T01:e=>`Test suite ${e} does not name any function under test (covers).`,T05none:(e,t)=>`${e} covers ${t}, but the BA repo has no such item.`,T05del:(e,t)=>`${e} covers ${t} \u2014 that item was deleted in the BA repo.`,steps:"steps",expected:"expected result",and:" and ",T03:(e,t)=>`Test case ${e} has no ${t}.`,T04:e=>`Test case ${e} failed but has no actual result.`,T02:(e,t)=>`Function ${e}${t?" \xAB"+t+"\xBB":""} has no test suite yet.`}}});function Dr(e){"@babel/helpers - typeof";return Dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dr(e)}function ex(e,t){if(Dr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Dr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tx(e){var t=ex(e,"string");return Dr(t)=="symbol"?t:t+""}function E(e,t,n){return(t=tx(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xu(Object(n),!0).forEach(function(r){E(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rx(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Zl(e,t){if(e==null)return{};var n,r,i=rx(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function BC(e,t){return MC(e,t||{},0,0)}function $C(e,t){return IC(e,{i:2},t&&t.out,t&&t.dictionary)}function Ah(e,t){if(t){for(var n=new oe(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Eh)return Eh.encode(e);for(var i=e.length,s=new oe(e.length+(e.length>>1)),a=0,o=function(u){s[a++]=u},r=0;r<i;++r){if(a+5>s.length){var c=new oe(a+8+(i-r<<1));c.set(s),s=c}var l=e.charCodeAt(r);l<128||t?o(l):l<2048?(o(192|l>>6),o(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++r)&1023,o(240|l>>18),o(128|l>>12&63),o(128|l>>6&63),o(128|l&63)):(o(224|l>>12),o(128|l>>6&63),o(128|l&63))}return Vr(s,0,a)}function qC(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else{if(Hl)return Hl.decode(e);var i=FC(e),s=i.s,n=i.r;return n.length&&Ee(8),s}}function KC(e,t){t||(t={});var n={},r=[];Mf(e,"",n,t);var i=0,s=0;for(var a in n){var o=n[a],c=o[0],l=o[1],u=l.level==0?0:8,d=Ah(a),p=d.length,h=l.comment,f=h&&Ah(h),m=f&&f.length,g=Ul(l.extra);p>65535&&Ee(11);var y=u?BC(c,l):c,T=y.length,b=DC();b.p(c),r.push(Df(l,{size:c.length,crc:b.d(),c:y,f:d,m:f,u:p!=a.length||f&&h.length!=m,o:i,compression:u})),i+=30+p+g+T,s+=76+2*(p+g)+(m||0)+T}for(var C=new oe(s+22),_=i,w=s-i,x=0;x<r.length;++x){var d=r[x];_h(C,d.o,d,d.f,d.u,d.c.length);var v=30+d.f.length+Ul(d.extra);C.set(d.c,d.o+v),_h(C,i,d,d.f,d.u,d.c.length,d.o,d.m),i+=16+v+(d.m?d.m.length:0)}return WC(C,i,r.length,w,_),C}function GC(e,t){for(var n={},r=e.length-22;Be(e,r)!=101010256;--r)(!r||e.length-r>65558)&&Ee(13);var i=st(e,r+8);if(!i)return{};var s=Be(e,r+16),a=Be(e,r-20)==117853008;if(a){var o=Be(e,r-12);a=Be(e,o)==101075792,a&&(i=Be(e,o+32),s=Be(e,o+48))}for(var c=t&&t.filter,l=0;l<i;++l){var u=UC(e,s,a),d=u[0],p=u[1],h=u[2],f=u[3],m=u[4],g=u[5],y=HC(e,g);s=m,(!c||c({name:f,size:p,originalSize:h,compression:d}))&&(d?d==8?n[f]=$C(e.subarray(y,y+p),{out:new oe(h)}):Ee(14,"unknown compression type "+d):n[f]=Vr(e,y,y+p))}return n}function Oh(e,t,n,r,i,s,a){try{var o=e[s](a),c=o.value}catch(l){n(l);return}o.done?t(c):Promise.resolve(c).then(r,i)}function Kt(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function a(c){Oh(s,r,i,a,o,"next",c)}function o(c){Oh(s,r,i,a,o,"throw",c)}a(void 0)})}}var Zy,jr,Yh,Ws,nx,P,St,H,Jh,_e,ix,sx,ax,Qh,_s,ox,lx,Wr,cx,Zh,Ms,dx,nl,em,tm,j,nm,rm,px,ec,ux,hx,mx,im,le,Ks,sm,Yu,tc,fx,qt,am,om,at,gx,ve,bx,lm,vx,wx,yx,I,rl,cm,ot,kr,Pr,nn,L,ue,dm,nc,pm,um,hm,rc,xx,kx,Tx,Ju,Sx,Qu,Cx,Ex,Ax,_x,Zu,Nx,Px,Ix,ic,Ox,sc,Kr,he,Gr,Rx,Lx,Dx,Mx,Gs,ac,_r,mm,Bx,fm,$x,sn,an,Ht,Ut,Fx,qx,Hx,Ux,zs,jx,He,Wx,Kx,Gx,zx,Vx,Xx,Yx,Jx,Qx,Zx,rt,JP,ek,tk,nk,eh,Xe,Bn,rk,ik,sk,QP,ak,gm,ok,lk,$n,Tr,bm,ck,dk,pk,uk,hk,mk,il,vm,fk,gk,wm,bk,on,vk,wk,Mr,ks,yk,qe,Oe,oc,xk,ym,kk,Tk,Sk,Ck,Ek,Ak,_k,lc,xm,km,Nk,Pk,Ik,Ok,Rk,Tm,Lk,Br,Sm,Dk,Mk,Cm,Em,Bk,Am,_m,Nm,cc,$k,Fk,ct,dt,Je,$e,dc,qk,Pm,Hk,Uk,jk,Im,Wk,Kk,Om,Rm,Il,pc,Lm,Gk,Dm,zk,Vk,Xk,Yk,Jk,Qk,Zk,e1,t1,n1,uc,r1,Ol,i1,s1,sl,th,Vs,Mm,a1,o1,zr,l1,be,c1,d1,nh,p1,u1,h1,m1,f1,g1,b1,v1,w1,y1,x1,Xs,k1,T1,$m,S1,Dn,C1,Ys,Nr,rh,E1,A1,_1,Ts,N1,P1,hc,I1,mc,Fm,O1,R1,L1,qm,Um,jm,D1,M1,B1,$1,Wm,Bs,Ss,F1,q1,H1,U1,Km,j1,W1,al,K1,G1,Mn,ih,ne,z1,ZP,zm,V1,X1,Ln,sh,ol,Y1,Vm,J1,Q1,ah,Z1,eT,tT,nT,$s,rT,iT,sT,aT,it,Ns,Rl,oT,Ym,Fe,$r,Ps,Jm,fc,lT,cT,oh,dT,Is,pT,uT,hT,mT,fT,gT,bT,vT,Qm,wT,yT,xT,kT,TT,Zm,ST,lh,CT,ET,ef,AT,Fr,Ll,In,_T,tf,ll,NT,PT,IT,OT,nf,RT,LT,DT,gc,MT,BT,rf,$T,Fs,Ir,FT,Js,sf,qT,HT,UT,wt,ge,jT,Dl,Qs,WT,KT,ch,GT,zT,VT,XT,YT,JT,QT,ZT,eS,tS,nS,rS,of,iS,lf,dh,cl,sS,cf,aS,df,pf,oS,lS,cS,dS,pS,uS,uf,ph,dl,hS,hf,mS,fS,gS,bS,vS,mf,yt,wS,yS,xS,kS,TS,SS,CS,ES,AS,_S,NS,pl,PS,IS,uh,OS,RS,LS,DS,ff,gf,MS,BS,hh,mh,$S,FS,fh,qS,HS,US,gh,bh,jS,WS,KS,bf,GS,zS,VS,bc,Ct,ln,Wt,XS,YS,JS,QS,ZS,eC,tC,nC,rC,iC,sC,vf,vh,xt,wf,yf,xf,kf,Tf,Sf,aC,oC,lC,Or,vc,wh,yh,Ml,cC,dC,ul,pC,uC,hC,mC,fC,gC,wc,xh,Cf,bC,hl,vC,wC,kh,yC,Ef,Os,ml,fl,gl,xC,kC,TC,Qe,Af,_f,cn,yc,SC,oe,Le,xc,Zs,ea,Bl,Nf,Pf,If,$l,Of,CC,Th,Fl,kt,Y,lt,jt,Y,Y,Y,Y,qr,Y,EC,AC,_C,NC,bl,Ye,vl,kc,Vr,PC,Ee,IC,Tt,Sr,wl,ql,Sh,Cr,Rf,Ch,OC,Lf,RC,LC,DC,MC,Df,st,Be,yl,ke,Mf,Eh,Hl,FC,HC,UC,jC,Ul,_h,WC,zC,qs,VC,Nh,Bf,xl,Rs,Ph,jl,XC,YC,JC,Hr,Xr,Wl,Rr,QC,ZC,eE,tE,nE,rE,iE,$f,sE,aE,oE,Ff,Er,kl,lE,cE,dn,qf,Hf,dE,Uf,pE,uE,Tl,hE,Tc,mE,fE,Ih,gE,bE,Rh,Lh,Sc,jf,Wf,vE,wE,ta,pt,Kf,Gf,Te,zf,On,yE,xE,kE,Cc,Kl,Ur,Dh,TE,Mh,Bh,Gl,SE,$h,Fh,CE,EE,AE,_E,NE,zl,Ec,PE,Hs,Vf,IE,OE,Ce,RE,na,Xf,qh,LE,DE,Vl,Xl,ME,BE,$E,FE,qE,HE,UE,jE,Yf,WE,Cs,KE,GE,Es,Jf,zE,Hh,VE,XE,As,YE,JE,Uh,QE,ZE,e2,jh,t2,Yl,Sl,n2,r2,i2,Qf,Ls,s2,a2,Zf,Us,Yr,o2,eg,l2,c2,d2,Ar,tg,Cl,Wh,ng,Ac,El,p2,Kh,u2,_c,h2,m2,f2,g2,b2,Jl,v2,w2,rg,y2,Al,Gh,rn,ig,x2,k2,sg,T2,S2,C2,_l,E2,Lr,Ql,Ds,zh,A2,_2,N2,P2,I2,O2,R2,L2,ag,D2,M2,B2,$2,og,F2,q2,js,H2,lg,U2,j2,cg,dg,W2,pg,Vh,K2,G2,z2,Xh,eI,V2,tI,Nl,X2,ug=Se(()=>{S();Zy=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);jr=class{constructor(e){E(this,"rootKey",void 0),this.rootKey=e}get writtenAs(){}},Yh=e=>e instanceof jr||typeof e=="object"&&e!==null&&typeof e.prepForXml=="function",Ws=e=>Yh(e)?e.rootKey:void 0,nx=Object.seal({}),P=class extends jr{constructor(e){super(e),E(this,"root",void 0),this.root=new Array}prepForXml(e){var t;e.stack.push(this);let n=this.root.flatMap(r=>{if(Yh(r)){let i=r.writtenAs;return i?i.map(s=>s.prepForXml(e)):r.prepForXml(e)}return r}).filter(r=>r!==void 0);return e.stack.pop(),{[this.rootKey]:n.length?n.length===1&&(!((t=n[0])===null||t===void 0)&&t._attr)?n[0]:n:nx}}addChildElement(e){return this.root.push(e),this}},St=class extends P{constructor(e,t){super(e),E(this,"includeIfEmpty",void 0),this.includeIfEmpty=t}prepForXml(e){let t=super.prepForXml(e);return this.includeIfEmpty||t&&(typeof t[this.rootKey]!="object"||Object.keys(t[this.rootKey]).length)?t:void 0}};H=class extends jr{constructor(e){super("_attr"),E(this,"root",void 0),E(this,"xmlKeys",void 0),this.root=e}prepForXml(e){let t={};return Object.entries(this.root).forEach(([n,r])=>{if(r!==void 0){let i=this.xmlKeys&&this.xmlKeys[n]||n;t[i]=r}}),{_attr:t}}},Jh=class extends jr{constructor(e){super("_attr"),E(this,"root",void 0),this.root=e}prepForXml(e){return{_attr:Object.values(this.root).filter(({value:t})=>t!==void 0).reduce((t,{key:n,value:r})=>k(k({},t),{},{[n]:r}),{})}}},_e=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}};ix=["elements"],sx=new Map([["amp","&"],["lt","<"],["gt",">"],["quot",'"'],["apos","'"]]),ax=/&([^;]*);?/g,Qh=e=>e.indexOf("&")===-1?e:e.replace(ax,(t,n)=>{if(!t.endsWith(";"))throw new Error(`Invalid XML: "&" that starts no entity, in "${e}"`);let r=sx.get(n);if(r!==void 0)return r;let i=/^#x[0-9a-f]+$/i.test(n)?parseInt(n.slice(2),16):/^#[0-9]+$/.test(n)?parseInt(n.slice(1),10):NaN;if(!(i>0&&i<=1114111))throw new Error(`Invalid XML: unknown entity "${t}"`);return String.fromCodePoint(i)}),_s=e=>e===" "||e===`
5336
+ `||e===" "||e==="\r",ox=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,lx=e=>Object.fromEntries([...e.matchAll(ox)].map(([,t,n,r])=>[t,n??r])),Wr=(e,{keepWhitespaceText:t=!1}={})=>{let n={},r=[],i=e.charCodeAt(0)===65279?1:0;for(;i<e.length&&_s(e[i]);)i++;let s=d=>{var p;let h=r.length===0?n:r[r.length-1];((p=h.elements)!==null&&p!==void 0?p:h.elements=[]).push(d)},a=d=>{if(d.trim()===""){d!==""&&t&&s({type:"text",text:d});return}if(r.length===0)throw new Error(`Invalid XML: text outside of the root element, "${d.trim()}"`);s({type:"text",text:Qh(d)})},o=(d,p,h)=>{let f=e.indexOf(d,p);if(f===-1)throw new Error(`Invalid XML: ${h} that isn't closed`);return f};for(;i<e.length;){let d=e.indexOf("<",i);if(a(e.slice(i,d===-1?e.length:d)),d===-1)break;if(e.startsWith("<?",d)){let p=o("?>",d+2,"processing instruction"),h=e.slice(d+2,p),f=h.search(/\s/),m=f===-1?h:h.slice(0,f),g=f===-1?"":h.slice(f).trimStart();if(m.toLowerCase()==="xml"){let y=lx(g);n.declaration=Object.keys(y).length>0?{attributes:y}:{}}else s({type:"instruction",name:m,instruction:g});i=p+2}else if(e.startsWith("<!--",d)){let p=o("-->",d+4,"comment"),h=e.slice(d+4,p);h!==""&&s({type:"comment",comment:h}),i=p+3}else if(e.startsWith("<![CDATA[",d)){let p=o("]]>",d+9,"CDATA section"),h=e.slice(d+9,p);h!==""&&s({type:"cdata",cdata:h}),i=p+3}else if(e.startsWith("<!DOCTYPE",d)){let p=d+9,h,f=!1;for(;p<e.length;p++){let m=e[p];if(h!==void 0)h=m===h?void 0:h;else if(m==='"'||m==="'")h=m;else if(m==="[")f=!0;else if(m==="]")f=!1;else if(m===">"&&!f)break}if(p===e.length)throw new Error("Invalid XML: DOCTYPE that isn't closed");s({type:"doctype",doctype:e.slice(d+9,p).replace(/^ /,"")}),i=p+1}else if(e.startsWith("</",d)){let p=o(">",d+2,"closing tag"),h=e.slice(d+2,p).trimEnd(),f=r.pop();if(f?.name!==h){var c;throw new Error(`Invalid XML: closing tag </${h}> doesn't match <${(c=f?.name)!==null&&c!==void 0?c:""}>`)}i=p+1}else i=cx(e,d+1,(p,h)=>{s(p),h||r.push(p)})}if(r.length>0)throw new Error(`Invalid XML: <${r[r.length-1].name}> isn't closed`);let{elements:l}=n,u=Zl(n,ix);return l===void 0?u:k(k({},u),{},{elements:l})},cx=(e,t,n)=>{let r=t;for(;r<e.length&&!_s(e[r])&&e[r]!=="/"&&e[r]!==">";)r++;let i=e.slice(t,r);if(i==="")throw new Error("Invalid XML: tag without a name");let s=[],a=r;for(;;){for(;a<e.length&&_s(e[a]);)a++;if(a>=e.length)throw new Error(`Invalid XML: <${i}> that isn't closed`);if(e[a]===">"||e.startsWith("/>",a)){let p=e[a]==="/";return n(k({type:"element",name:i},s.length>0?{attributes:Object.fromEntries(s)}:{}),p),a+(p?2:1)}let o=e.indexOf("=",a),c=e.slice(a,o===-1?e.length:o).trimEnd();if(o===-1||c===""||/[\s/>]/.test(c))throw new Error(`Invalid XML: attribute of <${i}> without a value`);let l=o+1;for(;l<e.length&&_s(e[l]);)l++;let u=e[l];if(u!=='"'&&u!=="'")throw new Error(`Invalid XML: value of ${c} on <${i}> isn't quoted`);let d=e.indexOf(u,l+1);if(d===-1)throw new Error(`Invalid XML: value of ${c} on <${i}> isn't closed`);s.some(([p])=>p===c)||s.push([c,Qh(e.slice(l+1,d))]),a=d+1}},Zh=new Map([["&","&amp;"],['"',"&quot;"],["'","&apos;"],["<","&lt;"],[">","&gt;"]]),Ms=e=>e.replace(/[&"'<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var n;return(n=Zh.get(t))!==null&&n!==void 0?n:""}),dx=e=>e.replace(/[&<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var n;return(n=Zh.get(t))!==null&&n!==void 0?n:""}),nl=e=>typeof e=="string"?Ms(e):e,em=(e,t,n)=>{let r=Object.keys(e)[0],i=r===void 0?void 0:e[r],s=[],a=[],o=c=>{for(let[l,u]of Object.entries(c))s.push(`${l}="${String(nl(u))}"`)};if(typeof i=="object"){if(i!==null){let{_attr:c,_cdata:l}=i;if(c&&o(c),l&&a.push(`<![CDATA[${l.replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`),Array.isArray(i)){let u=!1;a.push("");for(let d of i)typeof d=="object"?Object.keys(d)[0]==="_attr"?o(d._attr):a.push(em(d,t,n+1)):(a.pop(),u=!0,a.push(nl(d)));u||a.push("")}}}else a.push(nl(i));return{name:r,attributes:s,content:a,indents:n>1?t.repeat(n-1):""}},tm=(e,t,n)=>{if(typeof e!="object")return String(e);let{name:r,attributes:i,content:s,indents:a}=e,{length:o}=s,c=a+(r?`<${r}`:"")+(i.length>0?` ${i.join(" ")}`:"")+(o>0?r?">":"":"/>")+(t&&o>1?`
5337
5337
  `:"");return o===0?c+(t?`
5338
5338
  `:""):c+s.map(l=>l===void 0?"":tm(l,t,!1)).join("")+(o>1?a:"")+(r?`</${r}>`:"")+(t&&!n?`
5339
- `:"")},j=(e,{indent:t="",declaration:n}={})=>{let r=Array.isArray(e)?e:[e],i=t?1:0,s=n?.standalone?` standalone="${Ds(n.standalone)}"`:"";return(n===void 0?"":`<?xml version="1.0" encoding="${Ds(n.encoding||"UTF-8")}"${s}?>${t?`
5340
- `:""}`)+r.map((a,o)=>tm(em(a,t,i),t,o===r.length-1)).join("")},nm=e=>Object.entries(e??{}).flatMap(([t,n])=>n==null?[]:[` ${t}="${Ds(String(n))}"`]).join(""),rm=e=>{switch(e.type){case"element":{var t,n;let r=(t=e.elements)!==null&&t!==void 0?t:[],i=`<${e.name}${nm(e.attributes)}`;return r.length>0||((n=e.attributes)===null||n===void 0?void 0:n["xml:space"])==="preserve"?`${i}>${r.map(rm).join("")}</${e.name}>`:`${i}/>`}case"text":return dx(String(e.text));case"cdata":return`<![CDATA[${String(e.cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`;case"comment":return`<!--${e.comment}-->`;case"doctype":return`<!DOCTYPE ${e.doctype}>`;case"instruction":return`<?${e.name}${e.instruction?` ${e.instruction}`:""}?>`;default:return""}},px=e=>{var t;return(e.declaration?`<?xml${nm(e.declaration.attributes)}?>`:"")+((t=e.elements)!==null&&t!==void 0?t:[]).map(rm).join("")},ec=e=>{switch(e.type){case void 0:case"element":let t=new hx(e.name,e.attributes),n=e.elements||[];for(let r of n){let i=ec(r);i!==void 0&&t.push(i)}return t;case"text":return e.text;default:return}},ux=class extends H{},hx=class extends P{static fromXmlString(e){return ec(Wr(e))}constructor(e,t){super(e),t&&this.root.push(new ux(t))}push(e){this.root.push(e)}get writtenAs(){return this.rootKey===void 0?this.root.filter(e=>typeof e!="string"):void 0}prepForXml(e){let t=this.writtenAs;return t?.length===1?t[0].prepForXml(e):super.prepForXml(e)}},mx=class extends P{constructor(e){super(""),E(this,"_attr",void 0),this._attr=e}prepForXml(e){return{_attr:this._attr}}},im=class extends P{constructor(e,t){super(e),t&&(this.root=t.root)}},le=e=>{if(!Number.isFinite(e))throw new Error(`Invalid value '${e}' specified. Must be an integer.`);return Math.floor(e)},Ks=e=>{let t=le(e);if(t<0)throw new Error(`Invalid value '${e}' specified. Must be a positive integer.`);return t},sm=(e,t)=>{let n=t*2;if(e.length!==n||isNaN(+`0x${e}`))throw new Error(`Invalid hex value '${e}'. Expected ${n} digit hex value`);return e},Yu=e=>sm(e,1),tc=e=>{let t=e.slice(-2),n=e.substring(0,e.length-2);return`${Number(n)}${t}`},fx={in:1440,cm:1440/2.54,mm:1440/25.4,pt:20,pc:240,pi:240},qt=e=>{if(typeof e=="number")return e;let t=e.slice(-2),n=Number(e.substring(0,e.length-2)),r=fx[t];if(r===void 0||Number.isNaN(n))throw new Error(`Invalid universal measure '${e}'. Expected a number followed by mm, cm, in, pt, pc or pi.`);return n*r},am=e=>{let t=tc(e);if(parseFloat(t)<0)throw new Error(`Invalid value '${t}' specified. Expected a positive number.`);return t},om=e=>e==="auto"?e:sm(e.charAt(0)==="#"?e.substring(1):e,3),at=e=>typeof e=="string"?tc(e):le(e),gx=e=>typeof e=="string"?am(e):Ks(e),ve=e=>typeof e=="string"?am(e):Ks(e),bx=e=>{let t=e.substring(0,e.length-1);return`${Number(t)}%`},lm=e=>typeof e=="number"?le(e):e.slice(-1)==="%"?bx(e):tc(e),vx=Ks,wx=Ks,yx=e=>e.toISOString(),I=class extends P{constructor(e,t=!0){super(e),t!==!0&&this.root.push(new _e({val:t}))}},rl=class extends P{constructor(e,t){super(e),this.root.push(new _e({val:gx(t)}))}},cm=class extends P{},ot=class extends P{constructor(e,t){super(e),this.root.push(new _e({val:t}))}},kr=(e,t)=>new L({name:e,attributes:{value:{key:"w:val",value:t}}}),Pr=class extends P{constructor(e,t){super(e),this.root.push(new _e({val:t}))}},nn=class extends P{constructor(e,t){super(e),this.root.push(t)}},L=class extends P{constructor({name:e,attributes:t,children:n}){super(e),t&&this.root.push(new Jh(t)),n&&this.root.push(...n)}},ue={START:"start",CENTER:"center",END:"end",BOTH:"both",MEDIUM_KASHIDA:"mediumKashida",DISTRIBUTE:"distribute",NUM_TAB:"numTab",HIGH_KASHIDA:"highKashida",LOW_KASHIDA:"lowKashida",THAI_DISTRIBUTE:"thaiDistribute",LEFT:"left",RIGHT:"right",JUSTIFIED:"both"},dm=e=>new L({name:"w:jc",attributes:{val:{key:"w:val",value:e}}}),nc={dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hyperlink:"hlink",followedHyperlink:"folHlink"},pm={dark2:"44546A",light2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hyperlink:"0563C1",followedHyperlink:"954F72"},um={dark1:{value:"windowText",lastColor:"000000"},light1:{value:"window",lastColor:"FFFFFF"}},hm=(e,t)=>{if(t==="auto")throw new Error(`Invalid theme color ${e} 'auto'. Expected 6 digit hex value`);return om(t)},rc=(e={})=>Object.fromEntries(Object.keys(nc).map(t=>{let n=e[t],r=t==="dark1"||t==="light1"?um[t].lastColor:pm[t];return[t,n===void 0?r:hm(t,n)]})),xx=(e,t)=>new L({name:"a:srgbClr",attributes:{value:{key:"val",value:hm(e,t)}}}),kx=(e,t)=>{let n=t[e],r=e==="dark1"||e==="light1"?um[e]:void 0;return new L({name:`a:${nc[e]}`,children:[n===void 0&&r?new L({name:"a:sysClr",attributes:{value:{key:"val",value:r.value},lastColor:{key:"lastClr",value:r.lastColor}}}):xx(e,n??pm[e])]})},Tx=(e,t={})=>new L({name:"a:clrScheme",attributes:{name:{key:"name",value:e}},children:Object.keys(nc).map(n=>kx(n,t))}),Ju=new Set(["dark1","light1","dark2","light2","accent1","accent2","accent3","accent4","accent5","accent6","hyperlink","followedHyperlink"]),Sx=new Map([["dk1","dark1"],["lt1","light1"],["dk2","dark2"],["lt2","light2"],["hlink","hyperlink"],["folHlink","followedHyperlink"],["text1","dark1"],["background1","light1"],["text2","dark2"],["background2","light2"]]),Qu=(e,t)=>{if(!(e>=0&&e<=100))throw new Error(`Invalid ${t} ${e}. Expected a number from 0 to 100`);return Math.round(255*(1-e/100))},Cx=({theme:e,lighter:t,darker:n})=>{if(!Ju.has(e)){let s=Sx.get(e);throw new Error(`Invalid theme color "${e}". ${s?`Did you mean "${s}"?`:`Expected one of ${[...Ju].join(", ")}`}`)}if(t!==void 0&&n!==void 0)throw new Error("Invalid theme color. Expected lighter or darker, not both");let r=t===void 0?void 0:Qu(t,"lighter"),i=n===void 0?void 0:Qu(n,"darker");return{tint:r===255?void 0:r,shade:i===255?void 0:i}},Ex=e=>{let[t,n,r]=[0,2,4].map(c=>parseInt(e.slice(c,c+2),16)/255),i=Math.max(t,n,r),s=Math.min(t,n,r),a=(i+s)/2,o=i-s;return o===0?{hue:0,saturation:0,lightness:a}:{hue:(i===t?((n-r)/o+6)%6:i===n?(r-t)/o+2:(t-n)/o+4)*60,saturation:o/(1-Math.abs(2*a-1)),lightness:a}},Ax=({hue:e,saturation:t,lightness:n})=>{let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),[s,a,o]=e<60?[r,i,0]:e<120?[i,r,0]:e<180?[0,r,i]:e<240?[0,i,r]:e<300?[i,0,r]:[r,0,i],c=n-r/2;return[s,a,o].map(l=>Math.floor((l+c)*255+1e-9).toString(16).padStart(2,"0")).join("").toUpperCase()},_x=(e,{tint:t,shade:n})=>{if(t===void 0&&n===void 0)return e;let r=Ex(e),i=t===void 0?r.lightness*n/255:r.lightness*t/255+(1-t/255);return Ax(k(k({},r),{},{lightness:i}))},Zu=e=>e===void 0?void 0:e.toString(16).padStart(2,"0").toUpperCase(),Nx=e=>typeof e=="string"?{type:"hex",value:om(e)}:{type:"theme",color:e,change:Cx(e)},Px=(e,t)=>e.type==="hex"?{color:e.value}:{color:_x(t[e.color.theme],e.change),theme:e.color.theme,tint:Zu(e.change.tint),shade:Zu(e.change.shade)},Ix=rc(),ic=class extends jr{constructor(e){super("_attr"),E(this,"attributes",void 0),this.attributes=e.map(t=>"keys"in t?{keys:t.keys,color:t.color===void 0?void 0:Nx(t.color)}:t)}prepForXml(e){var t,n;let r=(t=(n=e.file)===null||n===void 0||(n=n.Theme)===null||n===void 0?void 0:n.Colors)!==null&&t!==void 0?t:Ix,i=this.attributes.flatMap(s=>{if(!("keys"in s))return[[s.key,s.value]];if(s.color===void 0)return[];let{keys:a}=s,o=Px(s.color,r);return[[a.color,o.color],[a.theme,o.theme],[a.tint,o.tint],[a.shade,o.shade]]});return{_attr:Object.fromEntries(i.filter(([,s])=>s!==void 0))}}},Ox=class extends P{constructor(e,t){super(e),this.root.push(new ic(t))}},sc=(e,t)=>new Ox(e,t),Kr={color:"w:color",theme:"w:themeColor",tint:"w:themeTint",shade:"w:themeShade"},he=(e,{color:t,size:n,space:r,style:i})=>sc(e,[{key:"w:val",value:i},{keys:Kr,color:t},{key:"w:sz",value:n===void 0?void 0:vx(n)},{key:"w:space",value:r===void 0?void 0:wx(r)}]),Gr={SINGLE:"single",DASH_DOT_STROKED:"dashDotStroked",DASHED:"dashed",DASH_SMALL_GAP:"dashSmallGap",DOT_DASH:"dotDash",DOT_DOT_DASH:"dotDotDash",DOTTED:"dotted",DOUBLE:"double",DOUBLE_WAVE:"doubleWave",INSET:"inset",NIL:"nil",NONE:"none",OUTSET:"outset",THICK:"thick",THICK_THIN_LARGE_GAP:"thickThinLargeGap",THICK_THIN_MEDIUM_GAP:"thickThinMediumGap",THICK_THIN_SMALL_GAP:"thickThinSmallGap",THIN_THICK_LARGE_GAP:"thinThickLargeGap",THIN_THICK_MEDIUM_GAP:"thinThickMediumGap",THIN_THICK_SMALL_GAP:"thinThickSmallGap",THIN_THICK_THIN_LARGE_GAP:"thinThickThinLargeGap",THIN_THICK_THIN_MEDIUM_GAP:"thinThickThinMediumGap",THIN_THICK_THIN_SMALL_GAP:"thinThickThinSmallGap",THREE_D_EMBOSS:"threeDEmboss",THREE_D_ENGRAVE:"threeDEngrave",TRIPLE:"triple",WAVE:"wave"},Rx=class extends St{constructor(e){super("w:pBdr"),e.top&&this.root.push(he("w:top",e.top)),e.left&&this.root.push(he("w:left",e.left)),e.bottom&&this.root.push(he("w:bottom",e.bottom)),e.right&&this.root.push(he("w:right",e.right)),e.between&&this.root.push(he("w:between",e.between))}},Lx=class extends P{constructor(){super("w:pBdr");let e=he("w:bottom",{color:"auto",space:1,style:Gr.SINGLE,size:6});this.root.push(e)}},Mx=({start:e,end:t,left:n,right:r,hanging:i,firstLine:s,firstLineChars:a})=>new L({name:"w:ind",attributes:{start:{key:"w:start",value:e===void 0?void 0:at(e)},end:{key:"w:end",value:t===void 0?void 0:at(t)},left:{key:"w:left",value:n===void 0?void 0:at(n)},right:{key:"w:right",value:r===void 0?void 0:at(r)},hanging:{key:"w:hanging",value:i===void 0?void 0:ve(i)},firstLine:{key:"w:firstLine",value:s===void 0?void 0:ve(s)},firstLineChars:{key:"w:firstLineChars",value:a===void 0?void 0:le(a)}}}),Dx=()=>new L({name:"w:br"}),Gs={BEGIN:"begin",END:"end",SEPARATE:"separate"},ac=(e,t,n)=>new L({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:e},dirty:{key:"w:dirty",value:t},locked:{key:"w:fldLock",value:n}}}),_r=(e,t)=>ac(Gs.BEGIN,e,t),mm=new WeakSet,Bx=class extends L{constructor(){super({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:Gs.BEGIN},dirty:{key:"w:dirty",value:!0}}})}prepForXml(e){let t=super.prepForXml(e);return mm.add(t),t}},fm=()=>new Bx,$x=e=>typeof e=="object"&&e!==null&&mm.has(e),sn=e=>ac(Gs.SEPARATE,e),an=e=>ac(Gs.END,e),Ht={DEFAULT:"default",PRESERVE:"preserve"},Ut=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{space:"xml:space"})}},Fx=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("PAGE")}},qx=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("NUMPAGES")}},Hx=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("SECTIONPAGES")}},Ux=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("SECTION")}},zs=({fill:e,color:t,type:n})=>sc("w:shd",[{keys:{color:"w:fill",theme:"w:themeFill",tint:"w:themeFillTint",shade:"w:themeFillShade"},color:e},{keys:Kr,color:t},{key:"w:val",value:n??jx.CLEAR}]),jx={CLEAR:"clear",DIAGONAL_CROSS:"diagCross",DIAGONAL_STRIPE:"diagStripe",HORIZONTAL_CROSS:"horzCross",HORIZONTAL_STRIPE:"horzStripe",NIL:"nil",PERCENT_5:"pct5",PERCENT_10:"pct10",PERCENT_12:"pct12",PERCENT_15:"pct15",PERCENT_20:"pct20",PERCENT_25:"pct25",PERCENT_30:"pct30",PERCENT_35:"pct35",PERCENT_37:"pct37",PERCENT_40:"pct40",PERCENT_45:"pct45",PERCENT_50:"pct50",PERCENT_55:"pct55",PERCENT_60:"pct60",PERCENT_62:"pct62",PERCENT_65:"pct65",PERCENT_70:"pct70",PERCENT_75:"pct75",PERCENT_80:"pct80",PERCENT_85:"pct85",PERCENT_87:"pct87",PERCENT_90:"pct90",PERCENT_95:"pct95",REVERSE_DIAGONAL_STRIPE:"reverseDiagStripe",SOLID:"solid",THIN_DIAGONAL_CROSS:"thinDiagCross",THIN_DIAGONAL_STRIPE:"thinDiagStripe",THIN_HORIZONTAL_CROSS:"thinHorzCross",THIN_REVERSE_DIAGONAL_STRIPE:"thinReverseDiagStripe",THIN_VERTICAL_STRIPE:"thinVertStripe",VERTICAL_STRIPE:"vertStripe"},He=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}},Wx=class extends P{constructor(e){super("w:del"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},Kx=class extends P{constructor(e){super("w:ins"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},Gx=({twoLinesInOne:e,brackets:t,horizontalInVertical:n,fitToLine:r,group:i})=>new L({name:"w:eastAsianLayout",attributes:{id:{key:"w:id",value:i===void 0?void 0:le(i)},combine:{key:"w:combine",value:e},combineBrackets:{key:"w:combineBrackets",value:t},vert:{key:"w:vert",value:n},vertCompress:{key:"w:vertCompress",value:r}}}),zx={DOT:"dot"},Vx=(e=zx.DOT)=>new L({name:"w:em",attributes:{val:{key:"w:val",value:e}}}),Xx="57X6y3wQZNzYjJB2L_10pxbackgroundhimselfUTF-8DEMOGRAPHICSVqvt4KW9",Yx=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i-- >0;)r+=e[Math.random()*e.length|0];return r},Jx=(e=21)=>{let t="",n=e|0;for(;n-- >0;)t+=Xx[Math.random()*64|0];return t},Qx=e=>{let t=new Int32Array(Math.ceil((e.length+9)/64)*16);for(let n=0;n<e.length;n++)t[n>>2]|=e[n]<<24-(n&3)*8;return t[e.length>>2]|=128<<24-(e.length&3)*8,t[t.length-2]=Math.floor(e.length/536870912),t[t.length-1]=e.length*8,t},Zx=e=>{let t=new Uint8Array(e.length*4);for(let n=0;n<t.length;n++)t[n]=e[n>>2]>>>24-(n&3)*8;return t},rt=(e,t)=>e>>>t|e<<32-t,JP=Int32Array.of(1518500249,1859775393,2400959708,3395469782),ek=Int32Array.of(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),tk=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],nk=new Int32Array(64),eh=e=>{let t=Qx(e),n=nk,[r,i,s,a,o,c,l,u]=tk;for(let d=0;d<t.length;d+=16){n.set(t.subarray(d,d+16));for(let C=16;C<64;C++){let _=n[C-15],w=n[C-2];n[C]=n[C-16]+(rt(_,7)^rt(_,18)^_>>>3)+n[C-7]+(rt(w,17)^rt(w,19)^w>>>10)}let[p,h,f,m,g,y,T,b]=[r,i,s,a,o,c,l,u];for(let C=0;C<64;C++){let _=b+(rt(g,6)^rt(g,11)^rt(g,25))+(g&y^~g&T)+ek[C]+n[C]|0,w=(rt(p,2)^rt(p,13)^rt(p,22))+(p&h^p&f^h&f)|0;b=T,T=y,y=g,g=m+_|0,m=f,f=h,h=p,p=_+w|0}[r,i,s,a,o,c,l,u]=[r+p|0,i+h|0,s+f|0,a+m|0,o+g|0,c+y|0,l+T|0,u+b|0]}return Zx([r,i,s,a,o,c,l,u])},Xe=e=>Math.floor(e*72*20),Bn=(e=0)=>{let t=e;return()=>++t},rk=()=>Bn(),ik=()=>Bn(1),sk=()=>Bn(),QP=sk(),ak=()=>Bn(),gm=ak(),ok=Bn(),lk=()=>-ok(),$n=()=>Jx().toLowerCase(),Tr=e=>Yx("1234567890abcdef",e)(),bm=()=>`${Tr(8)}-${Tr(4)}-${Tr(4)}-${Tr(4)}-${Tr(12)}`,ck=e=>new Uint8Array(new TextEncoder().encode(e)),dk=({width:e,group:t})=>new L({name:"w:fitText",attributes:{val:{key:"w:val",value:Math.round(qt(ve(e)))},id:{key:"w:id",value:t===void 0?lk():le(t)}}}),pk=class extends P{constructor(e){super("w:spacing"),this.root.push(new _e({val:at(e)}))}},uk=class extends P{constructor(e){super("w:color"),this.root.push(new ic([{keys:k(k({},Kr),{},{color:"w:val"}),color:e}]))}},hk=class extends P{constructor(e){super("w:highlight"),this.root.push(new _e({val:e}))}},mk=e=>new L({name:"w:lang",attributes:{value:{key:"w:val",value:e.value},eastAsia:{key:"w:eastAsia",value:e.eastAsia},bidirectional:{key:"w:bidi",value:e.bidirectional}}}),il=(e,t)=>{if(typeof e=="string"){let r=e;return new L({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:r},cs:{key:"w:cs",value:r},eastAsia:{key:"w:eastAsia",value:r},hAnsi:{key:"w:hAnsi",value:r},hint:{key:"w:hint",value:t}}})}if("theme"in e){let r=e.theme==="headings"?"major":"minor";return new L({name:"w:rFonts",attributes:{ascii:{key:"w:asciiTheme",value:`${r}HAnsi`},eastAsia:{key:"w:eastAsiaTheme",value:`${r}EastAsia`},hAnsi:{key:"w:hAnsiTheme",value:`${r}HAnsi`},cs:{key:"w:cstheme",value:`${r}Bidi`}}})}let n=e;return new L({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:n.ascii},cs:{key:"w:cs",value:n.cs},eastAsia:{key:"w:eastAsia",value:n.eastAsia},hAnsi:{key:"w:hAnsi",value:n.hAnsi},hint:{key:"w:hint",value:n.hint}}})},vm=e=>new L({name:"w:vertAlign",attributes:{val:{key:"w:val",value:e}}}),fk=()=>vm("superscript"),gk=()=>vm("subscript"),wm={SINGLE:"single",WORDS:"words",DOUBLE:"double",THICK:"thick",DOTTED:"dotted",DOTTEDHEAVY:"dottedHeavy",DASH:"dash",DASHEDHEAVY:"dashedHeavy",DASHLONG:"dashLong",DASHLONGHEAVY:"dashLongHeavy",DOTDASH:"dotDash",DASHDOTHEAVY:"dashDotHeavy",DOTDOTDASH:"dotDotDash",DASHDOTDOTHEAVY:"dashDotDotHeavy",WAVE:"wave",WAVYHEAVY:"wavyHeavy",WAVYDOUBLE:"wavyDouble",NONE:"none"},bk=(e=wm.SINGLE,t)=>sc("w:u",[{key:"w:val",value:e},{keys:Kr,color:t}]),on=class extends St{constructor(e){if(super("w:rPr"),!e)return;if(e.style&&this.push(new ot("w:rStyle",e.style)),e.font&&(typeof e.font=="string"?this.push(il(e.font)):"name"in e.font?this.push(il(e.font.name,e.font.hint)):this.push(il(e.font))),e.bold!==void 0&&this.push(new I("w:b",e.bold)),e.boldComplexScript===void 0&&e.bold!==void 0||e.boldComplexScript){var t;this.push(new I("w:bCs",(t=e.boldComplexScript)!==null&&t!==void 0?t:e.bold))}if(e.italics!==void 0&&this.push(new I("w:i",e.italics)),e.italicsComplexScript===void 0&&e.italics!==void 0||e.italicsComplexScript){var n;this.push(new I("w:iCs",(n=e.italicsComplexScript)!==null&&n!==void 0?n:e.italics))}e.smallCaps!==void 0?this.push(new I("w:smallCaps",e.smallCaps)):e.allCaps!==void 0&&this.push(new I("w:caps",e.allCaps)),e.strike!==void 0&&this.push(new I("w:strike",e.strike)),e.doubleStrike!==void 0&&this.push(new I("w:dstrike",e.doubleStrike)),e.emboss!==void 0&&this.push(new I("w:emboss",e.emboss)),e.imprint!==void 0&&this.push(new I("w:imprint",e.imprint)),e.noProof!==void 0&&this.push(new I("w:noProof",e.noProof)),e.snapToGrid!==void 0&&this.push(new I("w:snapToGrid",e.snapToGrid)),e.vanish!==void 0&&this.push(new I("w:vanish",e.vanish)),e.color&&this.push(new uk(e.color)),e.characterSpacing&&this.push(new pk(e.characterSpacing)),e.scale!==void 0&&this.push(new Pr("w:w",e.scale)),e.kern&&this.push(new rl("w:kern",e.kern)),e.position&&this.push(new ot("w:position",e.position)),e.size!==void 0&&this.push(new rl("w:sz",e.size));let r=e.sizeComplexScript===void 0||e.sizeComplexScript===!0?e.size:e.sizeComplexScript;r&&this.push(new rl("w:szCs",r)),e.highlight&&this.push(new hk(e.highlight)),e.underline&&this.push(bk(e.underline.type,e.underline.color)),e.effect&&this.push(new ot("w:effect",e.effect)),e.border&&this.push(he("w:bdr",e.border)),e.shading&&this.push(zs(e.shading)),e.fitText&&this.push(dk(e.fitText)),e.subScript&&this.push(gk()),e.superScript&&this.push(fk()),e.rightToLeft!==void 0&&this.push(new I("w:rtl",e.rightToLeft)),e.emphasisMark&&this.push(Vx(e.emphasisMark.type)),e.language&&this.push(mk(e.language)),e.eastAsianLayout&&this.push(Gx(e.eastAsianLayout)),e.specVanish!==void 0&&this.push(new I("w:specVanish",e.specVanish)),e.math!==void 0&&this.push(new I("w:oMath",e.math)),e.revision&&this.push(new wk(e.revision))}push(e){this.root.push(e)}},vk=class extends on{constructor(e){super(e),e?.insertion&&this.push(new Kx(e.insertion)),e?.deletion&&this.push(new Wx(e.deletion))}},wk=class extends P{constructor(e){super("w:rPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.addChildElement(new on(e))}},Dr=class extends P{constructor(e){if(super("w:t"),typeof e=="string")this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push(e);else{var t;this.root.push(new Ut({space:(t=e.space)!==null&&t!==void 0?t:Ht.DEFAULT})),this.root.push(e.text)}}},ks={CURRENT:"CURRENT",TOTAL_PAGES:"TOTAL_PAGES",TOTAL_PAGES_IN_SECTION:"TOTAL_PAGES_IN_SECTION",CURRENT_SECTION:"SECTION"},yk=e=>{switch(e){case ks.CURRENT:return[_r(),new Fx,sn(),an()];case ks.TOTAL_PAGES:return[_r(),new qx,sn(),an()];case ks.TOTAL_PAGES_IN_SECTION:return[_r(),new Hx,sn(),an()];case ks.CURRENT_SECTION:return[_r(),new Ux,sn(),an()];default:return}},qe=class Pl extends P{constructor(t){if(super("w:r"),E(this,"properties",void 0),E(this,"following",[]),this.properties=new on(t),this.root.push(this.properties),t.break)for(let n=0;n<t.break;n++)this.root.push(Dx());if(t.children)for(let[n,r]of t.children.entries()){if(Ws(r)==="w:r"){let i=t.children.slice(n+1);this.following=[r,...i.length>0?[new Pl(k(k({},t),{},{break:void 0,children:i}))]:[]];break}if(typeof r=="string"){let i=yk(r);if(i){let s=t.children.slice(n+1),a=l=>new Pl(k(k({},t),{},{break:void 0,children:l})),o=this.root.length===1;o&&this.root.push(i[0]);let c=o?i.slice(1):i;this.following=[...c.map(l=>a([l])),...s.length>0?[a(s)]:[]];break}this.root.push(new Dr(r));continue}this.root.push(r)}else t.text!==void 0&&this.root.push(new Dr(t.text))}get writtenAs(){return this.following.length>0?[this,...this.following.flatMap(t=>{var n;return(n=t.writtenAs)!==null&&n!==void 0?n:t})]:void 0}},Oe=class extends qe{constructor(e){super(typeof e=="string"?{text:e}:e)}},oc={EXTERNAL:"External"},xk=(e,t,n,r)=>new L({name:"Relationship",attributes:{id:{key:"Id",value:e},type:{key:"Type",value:t},target:{key:"Target",value:n},targetMode:{key:"TargetMode",value:r}}}),ym=(e,t)=>new L({name:"a:hlinkClick",attributes:k(k({},t?{xmlns:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"}}:{}),{},{id:{key:"r:id",value:`rId${e}`}})}),kk=class{constructor(e){E(this,"link",void 0),E(this,"linkId",$n()),E(this,"addedTo",new WeakSet),this.link=e}createClick(e){return ym(this.linkId,e)}addRelationship(e){let t=e.viewWrapper.Relationships;this.addedTo.has(t)||(this.addedTo.add(t),t.addRelationship(this.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",this.link,oc.EXTERNAL))}},Tk=32767,Sk=780,Ck=[[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"]],Ek=e=>e<=Tk?Ck.reduce(({rest:t,text:n},[r,i])=>({rest:t%r,text:n+i.repeat(Math.floor(t/r))}),{rest:e,text:""}).text:void 0,Ak=e=>e===0?"":e<=Sk?String.fromCharCode(65+(e-1)%26).repeat(Math.ceil(e/26)):void 0,_k=e=>{var t;return`${e}${e%100>=11&&e%100<=13?"th":(t=["th","st","nd","rd"][e%10])!==null&&t!==void 0?t:"th"}`},lc=e=>{let t=e.charAt(0)!==e.charAt(0).toUpperCase(),n=r=>i=>{var s;return t?(s=r(i))===null||s===void 0?void 0:s.toLowerCase():r(i)};switch(e.toLowerCase()){case"arabic":return String;case"roman":return n(Ek);case"alphabetic":return n(Ak);case"ordinal":return r=>r>0?_k(r):void 0;case"arabicdash":return r=>`- ${r} -`;default:return}},xm=new Set(["mergeformat","charformat","mergeformatinet"]),km=new Set(["upper","lower","firstcap","caps"]),Nk=e=>/^[#0,]*[#0][#0,]*$/.test(e),Pk=(e,t)=>{let n=[...t].filter(s=>s==="0").length,r=n+[...t].filter(s=>s==="#").length,i=String(e).padStart(n,"0");if(!(i.length<r||n===0&&e===0))return t.includes(",")?i.replace(/\B(?=(\d{3})+$)/g,","):i},Ik=(e,t)=>{switch(t){case"upper":return e.toUpperCase();case"lower":return e.toLowerCase();case"firstcap":return e.charAt(0).toUpperCase()+e.slice(1);default:return e}},Ok=e=>{var t;let n=new RegExp("^\\s*(PAGEREF|NUMPAGES|SECTIONPAGES)\\b(.*)$","is").exec(e),r=n?.[1].toUpperCase()==="PAGEREF"?new RegExp('^\\s*("?)([^\\s"\\\\]+)\\1(.*)$',"s").exec(n[2]):void 0;if(!n||n[1].toUpperCase()==="PAGEREF"&&!r)return;let i=(t=(r?r[3]:n[2]).match(/"[^"]*"|\S+/g))!==null&&t!==void 0?t:[],s,a,o=[],c=!1,l=!0;for(let h=0;h<i.length;h++){let f=i[h],m=()=>{var g;return(f.length>2?f.slice(2):(g=i[++h])!==null&&g!==void 0?g:"").replace(/^"(.*)"$/,"$1")};if(/^\\p$/i.test(f))c=!0;else if(f.startsWith("\\#")){var u;let g=m();l&&(l=a===void 0&&Nk(g)),(u=a)!==null&&u!==void 0||(a=g)}else if(f.startsWith("\\*")){let g=m(),y=g.toLowerCase();if(km.has(y))o.push(y);else if(g!==""&&!xm.has(y)){var d;l&&(l=s===void 0&&lc(g)!==void 0),(d=s)!==null&&d!==void 0||(s=g)}}}let p=k(k(k(k({},s===void 0?{}:{numberFormat:s}),a===void 0?{}:{picture:a}),o.length===0?{}:{capitals:o[0]}),{},{written:l&&o.length<=1&&o[0]!=="caps"&&(s===void 0||a===void 0)});return k(r?{type:"pageReference",bookmark:r[2],relative:c}:{type:"pageCount",scope:n[1].toUpperCase()==="NUMPAGES"?"document":"section"},p)},Rk=e=>new RegExp("^\\s*TOC\\b.*\\\\s\\b","is").test(e),Tm=(e,{enclosing:t,within:n,inTextBox:r},{estimate:i,sectionPageCount:s,blank:a,relativeTo:o})=>{let c=Ok(e);if(c===void 0)return;let{bookmarks:l,pageCount:u,bookmarkPageNumbers:d}=i,{numberFormat:p,picture:h,capitals:f,written:m}=c,g=p!==void 0||h!==void 0,y=C=>C===void 0?void 0:h===void 0?lc(p??"arabic")(C):Pk(C,h),T=c.type==="pageReference"&&c.relative&&n==="counted"&&!r?o?.(c.bookmark):void 0,b;return m?c.type==="pageCount"?b=y(c.scope==="document"?u:s):t.some(Rk)?b=void 0:g?b=y(d?.get(c.bookmark)):b=c.relative?T:l.get(c.bookmark):b=void 0,b===void 0?a?"":void 0:Ik(b,f)},Lk=(e,t)=>e==="mc:Fallback"||t==="fallback"?"fallback":e==="w:del"||e==="w:moveFrom"?"deleted":t,Br=(e,t,n,r,i="counted",s=!1)=>{for(let l=0;l<t.length;l++){let u=t[l],d=e.nameOf(u);if(d===void 0)continue;let p=n[n.length-1];if(d==="w:fldChar"){let h=e.attributeOf(u,"w:fldCharType");h==="begin"?n.push({begin:u,instruction:"",inResult:!1}):h==="separate"&&p?(e.writeClean(p.begin,p.instruction),p.inResult=!0,p.result=r.resultOf(p.instruction,{within:i,enclosing:n.slice(0,-1).map(f=>f.instruction),inTextBox:s}),p.result!==void 0&&(t.splice(l+1,0,e.textElement(p.result)),l++)):h==="end"&&n.pop()}else if(d==="w:instrText"&&p&&!p.inResult)p.instruction+=e.textOf(u);else if((d==="w:t"||d==="w:tab"||d==="w:br"||d==="w:cr")&&p?.result!==void 0)t.splice(l,1),l--;else if(d==="w:fldSimple"){let h=r.resultOf(String(e.attributeOf(u,"w:instr")),{within:i,enclosing:n.map(f=>f.instruction),inTextBox:s});if(h===void 0){var a;Br(e,(a=e.contentOf(u))!==null&&a!==void 0?a:[],[],r,i,s)}else e.setSimpleFieldResult(u,h)}else{var o;if(d==="w:p"){var c;(c=r.beforeParagraph)===null||c===void 0||c.call(r,u)}Br(e,(o=e.contentOf(u))!==null&&o!==void 0?o:[],n,r,Lk(d,i),s||d==="w:txbxContent"),d==="w:p"&&r.afterParagraph(u)}}},Sm=(e,t)=>t.flatMap(n=>{var r;let i=e.nameOf(n);return i===void 0?[]:i==="w:sectPr"?[n]:Sm(e,(r=e.contentOf(n))!==null&&r!==void 0?r:[])}),Mk=(e,t)=>{var n;return((n=e.contentOf(t))!==null&&n!==void 0?n:[]).some(r=>{var i;return e.nameOf(r)==="w:pPr"&&((i=e.contentOf(r))!==null&&i!==void 0?i:[]).some(s=>e.nameOf(s)==="w:sectPr")})},Dk=(e,t,n)=>{let r=Sm(e,[t]).reduce((i,s)=>{var a,o;let c=((a=e.contentOf(s))!==null&&a!==void 0?a:[]).flatMap(l=>{let u=e.nameOf(l);return u==="w:headerReference"||u==="w:footerReference"?[[`${u} ${String(e.attributeOf(l,"w:type"))}`,String(e.attributeOf(l,"r:id"))]]:[]});return[...i,new Map([...(o=i[i.length-1])!==null&&o!==void 0?o:[],...c])]},[]).reduce((i,s,a)=>{for(let c of s.values()){var o;i.set(c,[...(o=i.get(c))!==null&&o!==void 0?o:[],n[a]])}return i},new Map);return new Map([...r].flatMap(([i,[s,...a]])=>s!==void 0&&a.every(o=>o===s)?[[i,s]]:[]))},Cm=(e,t,n,{blank:r})=>{let{sectionPageCounts:i=[],relativePositions:s}=n,a=0,o=new Map,c=l=>{var u,d;let p=(u=o.get(l))!==null&&u!==void 0?u:0;return o.set(l,p+1),s==null||(d=s.get(l))===null||d===void 0?void 0:d[p]};return Br(e,[t],[],{resultOf:(l,u)=>Tm(l,u,{estimate:n,sectionPageCount:i[a],blank:r,relativeTo:c}),afterParagraph:l=>{a+=Mk(e,l)?1:0}}),Dk(e,t,i)},Em=(e,t,n,{blank:r,sectionPageCount:i,notes:s=!1})=>{let a=o=>{let c=n.bookmarks.get(o);return c===void 0?void 0:`on page ${c}`};Br(e,[t],[],{resultOf:(o,c)=>Tm(o,c,k({estimate:n,sectionPageCount:i,blank:r},s?{relativeTo:a}:{})),afterParagraph:()=>{}})},Bk=(e,t,{beforeParagraph:n,resultOf:r})=>Br(e,[t],[],{resultOf:(i,{within:s})=>r(i,s),beforeParagraph:n,afterParagraph:()=>{}}),Am=class extends P{constructor(e={}){super("w:instrText"),E(this,"properties",void 0),this.properties=e,this.root.push(new Ut({space:Ht.PRESERVE}));let t="TOC";if(this.properties.captionLabel&&(t=`${t} \\a "${this.properties.captionLabel}"`),this.properties.entriesFromBookmark&&(t=`${t} \\b "${this.properties.entriesFromBookmark}"`),this.properties.captionLabelIncludingNumbers&&(t=`${t} \\c "${this.properties.captionLabelIncludingNumbers}"`),this.properties.sequenceAndPageNumbersSeparator&&(t=`${t} \\d "${this.properties.sequenceAndPageNumbersSeparator}"`),this.properties.tcFieldIdentifier&&(t=`${t} \\f "${this.properties.tcFieldIdentifier}"`),this.properties.hyperlink&&(t=`${t} \\h`),this.properties.tcFieldLevelRange&&(t=`${t} \\l "${this.properties.tcFieldLevelRange}"`),this.properties.pageNumbersEntryLevelsRange&&(t=`${t} \\n "${this.properties.pageNumbersEntryLevelsRange}"`),this.properties.headingStyleRange&&(t=`${t} \\o "${this.properties.headingStyleRange}"`),this.properties.entryAndPageNumberSeparator&&(t=`${t} \\p "${this.properties.entryAndPageNumberSeparator}"`),this.properties.seqFieldIdentifierForPrefix&&(t=`${t} \\s "${this.properties.seqFieldIdentifierForPrefix}"`),this.properties.stylesWithLevels&&this.properties.stylesWithLevels.length){let n=this.properties.stylesWithLevels.map(r=>`${r.styleName},${r.level}`).join(",");t=`${t} \\t "${n}"`}this.properties.useAppliedParagraphOutlineLevel&&(t=`${t} \\u`),this.properties.preserveTabInEntries&&(t=`${t} \\w`),this.properties.preserveNewLineInEntries&&(t=`${t} \\x`),this.properties.hideTabAndPageNumbersInWebView&&(t=`${t} \\z`),this.root.push(t)}},_m=class extends P{constructor(){super("w:sdtContent")}},Nm=e=>e===void 0?fm():_r(e),cc=new WeakMap,$k=(e,t)=>{cc.set(e,t)},Fk=class{constructor(){E(this,"ids",[])}get(e){var t,n;return(n=(t=this.ids)[e])!==null&&n!==void 0||(t[e]=gm()),this.ids[e]}},ct=e=>typeof e=="object"&&e!==null?Object.keys(e)[0]:void 0,dt=e=>{let t=ct(e),n=t===void 0?void 0:e[t];return Array.isArray(n)?n:n===void 0?[]:[n]},Je=(e,t)=>dt(e).find(n=>ct(n)===t),$e=(e,t)=>{var n;return(n=Je(e,"_attr"))===null||n===void 0||(n=n._attr)===null||n===void 0?void 0:n[t]},dc=(e,t)=>{let n=$e(e,t);return n===void 0?void 0:Number(n)},qk=new Set(["w:tbl","w:tr","w:tc","w:sdt","w:sdtContent","w:customXml"]),Pm=e=>e.flatMap(t=>{let n=ct(t);return n==="w:p"||cc.has(t)?[t]:n!==void 0&&qk.has(n)?Pm(dt(t)):[]}),Hk=new Set(["w:r","w:hyperlink","w:ins","w:moveTo","w:smartTag","w:customXml","w:sdt","w:sdtContent","w:fldSimple","w:dir","w:bdo"]),Uk=e=>{switch(ct(e)){case"w:t":return dt(e).filter(t=>typeof t=="string").join("");case"w:tab":return" ";case"w:br":return[void 0,"textWrapping"].includes($e(e,"w:type"))?`
5339
+ `:"")},j=(e,{indent:t="",declaration:n}={})=>{let r=Array.isArray(e)?e:[e],i=t?1:0,s=n?.standalone?` standalone="${Ms(n.standalone)}"`:"";return(n===void 0?"":`<?xml version="1.0" encoding="${Ms(n.encoding||"UTF-8")}"${s}?>${t?`
5340
+ `:""}`)+r.map((a,o)=>tm(em(a,t,i),t,o===r.length-1)).join("")},nm=e=>Object.entries(e??{}).flatMap(([t,n])=>n==null?[]:[` ${t}="${Ms(String(n))}"`]).join(""),rm=e=>{switch(e.type){case"element":{var t,n;let r=(t=e.elements)!==null&&t!==void 0?t:[],i=`<${e.name}${nm(e.attributes)}`;return r.length>0||((n=e.attributes)===null||n===void 0?void 0:n["xml:space"])==="preserve"?`${i}>${r.map(rm).join("")}</${e.name}>`:`${i}/>`}case"text":return dx(String(e.text));case"cdata":return`<![CDATA[${String(e.cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`;case"comment":return`<!--${e.comment}-->`;case"doctype":return`<!DOCTYPE ${e.doctype}>`;case"instruction":return`<?${e.name}${e.instruction?` ${e.instruction}`:""}?>`;default:return""}},px=e=>{var t;return(e.declaration?`<?xml${nm(e.declaration.attributes)}?>`:"")+((t=e.elements)!==null&&t!==void 0?t:[]).map(rm).join("")},ec=e=>{switch(e.type){case void 0:case"element":let t=new hx(e.name,e.attributes),n=e.elements||[];for(let r of n){let i=ec(r);i!==void 0&&t.push(i)}return t;case"text":return e.text;default:return}},ux=class extends H{},hx=class extends P{static fromXmlString(e){return ec(Wr(e))}constructor(e,t){super(e),t&&this.root.push(new ux(t))}push(e){this.root.push(e)}get writtenAs(){return this.rootKey===void 0?this.root.filter(e=>typeof e!="string"):void 0}prepForXml(e){let t=this.writtenAs;return t?.length===1?t[0].prepForXml(e):super.prepForXml(e)}},mx=class extends P{constructor(e){super(""),E(this,"_attr",void 0),this._attr=e}prepForXml(e){return{_attr:this._attr}}},im=class extends P{constructor(e,t){super(e),t&&(this.root=t.root)}},le=e=>{if(!Number.isFinite(e))throw new Error(`Invalid value '${e}' specified. Must be an integer.`);return Math.floor(e)},Ks=e=>{let t=le(e);if(t<0)throw new Error(`Invalid value '${e}' specified. Must be a positive integer.`);return t},sm=(e,t)=>{let n=t*2;if(e.length!==n||isNaN(+`0x${e}`))throw new Error(`Invalid hex value '${e}'. Expected ${n} digit hex value`);return e},Yu=e=>sm(e,1),tc=e=>{let t=e.slice(-2),n=e.substring(0,e.length-2);return`${Number(n)}${t}`},fx={in:1440,cm:1440/2.54,mm:1440/25.4,pt:20,pc:240,pi:240},qt=e=>{if(typeof e=="number")return e;let t=e.slice(-2),n=Number(e.substring(0,e.length-2)),r=fx[t];if(r===void 0||Number.isNaN(n))throw new Error(`Invalid universal measure '${e}'. Expected a number followed by mm, cm, in, pt, pc or pi.`);return n*r},am=e=>{let t=tc(e);if(parseFloat(t)<0)throw new Error(`Invalid value '${t}' specified. Expected a positive number.`);return t},om=e=>e==="auto"?e:sm(e.charAt(0)==="#"?e.substring(1):e,3),at=e=>typeof e=="string"?tc(e):le(e),gx=e=>typeof e=="string"?am(e):Ks(e),ve=e=>typeof e=="string"?am(e):Ks(e),bx=e=>{let t=e.substring(0,e.length-1);return`${Number(t)}%`},lm=e=>typeof e=="number"?le(e):e.slice(-1)==="%"?bx(e):tc(e),vx=Ks,wx=Ks,yx=e=>e.toISOString(),I=class extends P{constructor(e,t=!0){super(e),t!==!0&&this.root.push(new _e({val:t}))}},rl=class extends P{constructor(e,t){super(e),this.root.push(new _e({val:gx(t)}))}},cm=class extends P{},ot=class extends P{constructor(e,t){super(e),this.root.push(new _e({val:t}))}},kr=(e,t)=>new L({name:e,attributes:{value:{key:"w:val",value:t}}}),Pr=class extends P{constructor(e,t){super(e),this.root.push(new _e({val:t}))}},nn=class extends P{constructor(e,t){super(e),this.root.push(t)}},L=class extends P{constructor({name:e,attributes:t,children:n}){super(e),t&&this.root.push(new Jh(t)),n&&this.root.push(...n)}},ue={START:"start",CENTER:"center",END:"end",BOTH:"both",MEDIUM_KASHIDA:"mediumKashida",DISTRIBUTE:"distribute",NUM_TAB:"numTab",HIGH_KASHIDA:"highKashida",LOW_KASHIDA:"lowKashida",THAI_DISTRIBUTE:"thaiDistribute",LEFT:"left",RIGHT:"right",JUSTIFIED:"both"},dm=e=>new L({name:"w:jc",attributes:{val:{key:"w:val",value:e}}}),nc={dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hyperlink:"hlink",followedHyperlink:"folHlink"},pm={dark2:"44546A",light2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hyperlink:"0563C1",followedHyperlink:"954F72"},um={dark1:{value:"windowText",lastColor:"000000"},light1:{value:"window",lastColor:"FFFFFF"}},hm=(e,t)=>{if(t==="auto")throw new Error(`Invalid theme color ${e} 'auto'. Expected 6 digit hex value`);return om(t)},rc=(e={})=>Object.fromEntries(Object.keys(nc).map(t=>{let n=e[t],r=t==="dark1"||t==="light1"?um[t].lastColor:pm[t];return[t,n===void 0?r:hm(t,n)]})),xx=(e,t)=>new L({name:"a:srgbClr",attributes:{value:{key:"val",value:hm(e,t)}}}),kx=(e,t)=>{let n=t[e],r=e==="dark1"||e==="light1"?um[e]:void 0;return new L({name:`a:${nc[e]}`,children:[n===void 0&&r?new L({name:"a:sysClr",attributes:{value:{key:"val",value:r.value},lastColor:{key:"lastClr",value:r.lastColor}}}):xx(e,n??pm[e])]})},Tx=(e,t={})=>new L({name:"a:clrScheme",attributes:{name:{key:"name",value:e}},children:Object.keys(nc).map(n=>kx(n,t))}),Ju=new Set(["dark1","light1","dark2","light2","accent1","accent2","accent3","accent4","accent5","accent6","hyperlink","followedHyperlink"]),Sx=new Map([["dk1","dark1"],["lt1","light1"],["dk2","dark2"],["lt2","light2"],["hlink","hyperlink"],["folHlink","followedHyperlink"],["text1","dark1"],["background1","light1"],["text2","dark2"],["background2","light2"]]),Qu=(e,t)=>{if(!(e>=0&&e<=100))throw new Error(`Invalid ${t} ${e}. Expected a number from 0 to 100`);return Math.round(255*(1-e/100))},Cx=({theme:e,lighter:t,darker:n})=>{if(!Ju.has(e)){let s=Sx.get(e);throw new Error(`Invalid theme color "${e}". ${s?`Did you mean "${s}"?`:`Expected one of ${[...Ju].join(", ")}`}`)}if(t!==void 0&&n!==void 0)throw new Error("Invalid theme color. Expected lighter or darker, not both");let r=t===void 0?void 0:Qu(t,"lighter"),i=n===void 0?void 0:Qu(n,"darker");return{tint:r===255?void 0:r,shade:i===255?void 0:i}},Ex=e=>{let[t,n,r]=[0,2,4].map(c=>parseInt(e.slice(c,c+2),16)/255),i=Math.max(t,n,r),s=Math.min(t,n,r),a=(i+s)/2,o=i-s;return o===0?{hue:0,saturation:0,lightness:a}:{hue:(i===t?((n-r)/o+6)%6:i===n?(r-t)/o+2:(t-n)/o+4)*60,saturation:o/(1-Math.abs(2*a-1)),lightness:a}},Ax=({hue:e,saturation:t,lightness:n})=>{let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),[s,a,o]=e<60?[r,i,0]:e<120?[i,r,0]:e<180?[0,r,i]:e<240?[0,i,r]:e<300?[i,0,r]:[r,0,i],c=n-r/2;return[s,a,o].map(l=>Math.floor((l+c)*255+1e-9).toString(16).padStart(2,"0")).join("").toUpperCase()},_x=(e,{tint:t,shade:n})=>{if(t===void 0&&n===void 0)return e;let r=Ex(e),i=t===void 0?r.lightness*n/255:r.lightness*t/255+(1-t/255);return Ax(k(k({},r),{},{lightness:i}))},Zu=e=>e===void 0?void 0:e.toString(16).padStart(2,"0").toUpperCase(),Nx=e=>typeof e=="string"?{type:"hex",value:om(e)}:{type:"theme",color:e,change:Cx(e)},Px=(e,t)=>e.type==="hex"?{color:e.value}:{color:_x(t[e.color.theme],e.change),theme:e.color.theme,tint:Zu(e.change.tint),shade:Zu(e.change.shade)},Ix=rc(),ic=class extends jr{constructor(e){super("_attr"),E(this,"attributes",void 0),this.attributes=e.map(t=>"keys"in t?{keys:t.keys,color:t.color===void 0?void 0:Nx(t.color)}:t)}prepForXml(e){var t,n;let r=(t=(n=e.file)===null||n===void 0||(n=n.Theme)===null||n===void 0?void 0:n.Colors)!==null&&t!==void 0?t:Ix,i=this.attributes.flatMap(s=>{if(!("keys"in s))return[[s.key,s.value]];if(s.color===void 0)return[];let{keys:a}=s,o=Px(s.color,r);return[[a.color,o.color],[a.theme,o.theme],[a.tint,o.tint],[a.shade,o.shade]]});return{_attr:Object.fromEntries(i.filter(([,s])=>s!==void 0))}}},Ox=class extends P{constructor(e,t){super(e),this.root.push(new ic(t))}},sc=(e,t)=>new Ox(e,t),Kr={color:"w:color",theme:"w:themeColor",tint:"w:themeTint",shade:"w:themeShade"},he=(e,{color:t,size:n,space:r,style:i})=>sc(e,[{key:"w:val",value:i},{keys:Kr,color:t},{key:"w:sz",value:n===void 0?void 0:vx(n)},{key:"w:space",value:r===void 0?void 0:wx(r)}]),Gr={SINGLE:"single",DASH_DOT_STROKED:"dashDotStroked",DASHED:"dashed",DASH_SMALL_GAP:"dashSmallGap",DOT_DASH:"dotDash",DOT_DOT_DASH:"dotDotDash",DOTTED:"dotted",DOUBLE:"double",DOUBLE_WAVE:"doubleWave",INSET:"inset",NIL:"nil",NONE:"none",OUTSET:"outset",THICK:"thick",THICK_THIN_LARGE_GAP:"thickThinLargeGap",THICK_THIN_MEDIUM_GAP:"thickThinMediumGap",THICK_THIN_SMALL_GAP:"thickThinSmallGap",THIN_THICK_LARGE_GAP:"thinThickLargeGap",THIN_THICK_MEDIUM_GAP:"thinThickMediumGap",THIN_THICK_SMALL_GAP:"thinThickSmallGap",THIN_THICK_THIN_LARGE_GAP:"thinThickThinLargeGap",THIN_THICK_THIN_MEDIUM_GAP:"thinThickThinMediumGap",THIN_THICK_THIN_SMALL_GAP:"thinThickThinSmallGap",THREE_D_EMBOSS:"threeDEmboss",THREE_D_ENGRAVE:"threeDEngrave",TRIPLE:"triple",WAVE:"wave"},Rx=class extends St{constructor(e){super("w:pBdr"),e.top&&this.root.push(he("w:top",e.top)),e.left&&this.root.push(he("w:left",e.left)),e.bottom&&this.root.push(he("w:bottom",e.bottom)),e.right&&this.root.push(he("w:right",e.right)),e.between&&this.root.push(he("w:between",e.between))}},Lx=class extends P{constructor(){super("w:pBdr");let e=he("w:bottom",{color:"auto",space:1,style:Gr.SINGLE,size:6});this.root.push(e)}},Dx=({start:e,end:t,left:n,right:r,hanging:i,firstLine:s,firstLineChars:a})=>new L({name:"w:ind",attributes:{start:{key:"w:start",value:e===void 0?void 0:at(e)},end:{key:"w:end",value:t===void 0?void 0:at(t)},left:{key:"w:left",value:n===void 0?void 0:at(n)},right:{key:"w:right",value:r===void 0?void 0:at(r)},hanging:{key:"w:hanging",value:i===void 0?void 0:ve(i)},firstLine:{key:"w:firstLine",value:s===void 0?void 0:ve(s)},firstLineChars:{key:"w:firstLineChars",value:a===void 0?void 0:le(a)}}}),Mx=()=>new L({name:"w:br"}),Gs={BEGIN:"begin",END:"end",SEPARATE:"separate"},ac=(e,t,n)=>new L({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:e},dirty:{key:"w:dirty",value:t},locked:{key:"w:fldLock",value:n}}}),_r=(e,t)=>ac(Gs.BEGIN,e,t),mm=new WeakSet,Bx=class extends L{constructor(){super({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:Gs.BEGIN},dirty:{key:"w:dirty",value:!0}}})}prepForXml(e){let t=super.prepForXml(e);return mm.add(t),t}},fm=()=>new Bx,$x=e=>typeof e=="object"&&e!==null&&mm.has(e),sn=e=>ac(Gs.SEPARATE,e),an=e=>ac(Gs.END,e),Ht={DEFAULT:"default",PRESERVE:"preserve"},Ut=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{space:"xml:space"})}},Fx=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("PAGE")}},qx=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("NUMPAGES")}},Hx=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("SECTIONPAGES")}},Ux=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("SECTION")}},zs=({fill:e,color:t,type:n})=>sc("w:shd",[{keys:{color:"w:fill",theme:"w:themeFill",tint:"w:themeFillTint",shade:"w:themeFillShade"},color:e},{keys:Kr,color:t},{key:"w:val",value:n??jx.CLEAR}]),jx={CLEAR:"clear",DIAGONAL_CROSS:"diagCross",DIAGONAL_STRIPE:"diagStripe",HORIZONTAL_CROSS:"horzCross",HORIZONTAL_STRIPE:"horzStripe",NIL:"nil",PERCENT_5:"pct5",PERCENT_10:"pct10",PERCENT_12:"pct12",PERCENT_15:"pct15",PERCENT_20:"pct20",PERCENT_25:"pct25",PERCENT_30:"pct30",PERCENT_35:"pct35",PERCENT_37:"pct37",PERCENT_40:"pct40",PERCENT_45:"pct45",PERCENT_50:"pct50",PERCENT_55:"pct55",PERCENT_60:"pct60",PERCENT_62:"pct62",PERCENT_65:"pct65",PERCENT_70:"pct70",PERCENT_75:"pct75",PERCENT_80:"pct80",PERCENT_85:"pct85",PERCENT_87:"pct87",PERCENT_90:"pct90",PERCENT_95:"pct95",REVERSE_DIAGONAL_STRIPE:"reverseDiagStripe",SOLID:"solid",THIN_DIAGONAL_CROSS:"thinDiagCross",THIN_DIAGONAL_STRIPE:"thinDiagStripe",THIN_HORIZONTAL_CROSS:"thinHorzCross",THIN_REVERSE_DIAGONAL_STRIPE:"thinReverseDiagStripe",THIN_VERTICAL_STRIPE:"thinVertStripe",VERTICAL_STRIPE:"vertStripe"},He=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}},Wx=class extends P{constructor(e){super("w:del"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},Kx=class extends P{constructor(e){super("w:ins"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},Gx=({twoLinesInOne:e,brackets:t,horizontalInVertical:n,fitToLine:r,group:i})=>new L({name:"w:eastAsianLayout",attributes:{id:{key:"w:id",value:i===void 0?void 0:le(i)},combine:{key:"w:combine",value:e},combineBrackets:{key:"w:combineBrackets",value:t},vert:{key:"w:vert",value:n},vertCompress:{key:"w:vertCompress",value:r}}}),zx={DOT:"dot"},Vx=(e=zx.DOT)=>new L({name:"w:em",attributes:{val:{key:"w:val",value:e}}}),Xx="57X6y3wQZNzYjJB2L_10pxbackgroundhimselfUTF-8DEMOGRAPHICSVqvt4KW9",Yx=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i-- >0;)r+=e[Math.random()*e.length|0];return r},Jx=(e=21)=>{let t="",n=e|0;for(;n-- >0;)t+=Xx[Math.random()*64|0];return t},Qx=e=>{let t=new Int32Array(Math.ceil((e.length+9)/64)*16);for(let n=0;n<e.length;n++)t[n>>2]|=e[n]<<24-(n&3)*8;return t[e.length>>2]|=128<<24-(e.length&3)*8,t[t.length-2]=Math.floor(e.length/536870912),t[t.length-1]=e.length*8,t},Zx=e=>{let t=new Uint8Array(e.length*4);for(let n=0;n<t.length;n++)t[n]=e[n>>2]>>>24-(n&3)*8;return t},rt=(e,t)=>e>>>t|e<<32-t,JP=Int32Array.of(1518500249,1859775393,2400959708,3395469782),ek=Int32Array.of(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),tk=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],nk=new Int32Array(64),eh=e=>{let t=Qx(e),n=nk,[r,i,s,a,o,c,l,u]=tk;for(let d=0;d<t.length;d+=16){n.set(t.subarray(d,d+16));for(let C=16;C<64;C++){let _=n[C-15],w=n[C-2];n[C]=n[C-16]+(rt(_,7)^rt(_,18)^_>>>3)+n[C-7]+(rt(w,17)^rt(w,19)^w>>>10)}let[p,h,f,m,g,y,T,b]=[r,i,s,a,o,c,l,u];for(let C=0;C<64;C++){let _=b+(rt(g,6)^rt(g,11)^rt(g,25))+(g&y^~g&T)+ek[C]+n[C]|0,w=(rt(p,2)^rt(p,13)^rt(p,22))+(p&h^p&f^h&f)|0;b=T,T=y,y=g,g=m+_|0,m=f,f=h,h=p,p=_+w|0}[r,i,s,a,o,c,l,u]=[r+p|0,i+h|0,s+f|0,a+m|0,o+g|0,c+y|0,l+T|0,u+b|0]}return Zx([r,i,s,a,o,c,l,u])},Xe=e=>Math.floor(e*72*20),Bn=(e=0)=>{let t=e;return()=>++t},rk=()=>Bn(),ik=()=>Bn(1),sk=()=>Bn(),QP=sk(),ak=()=>Bn(),gm=ak(),ok=Bn(),lk=()=>-ok(),$n=()=>Jx().toLowerCase(),Tr=e=>Yx("1234567890abcdef",e)(),bm=()=>`${Tr(8)}-${Tr(4)}-${Tr(4)}-${Tr(4)}-${Tr(12)}`,ck=e=>new Uint8Array(new TextEncoder().encode(e)),dk=({width:e,group:t})=>new L({name:"w:fitText",attributes:{val:{key:"w:val",value:Math.round(qt(ve(e)))},id:{key:"w:id",value:t===void 0?lk():le(t)}}}),pk=class extends P{constructor(e){super("w:spacing"),this.root.push(new _e({val:at(e)}))}},uk=class extends P{constructor(e){super("w:color"),this.root.push(new ic([{keys:k(k({},Kr),{},{color:"w:val"}),color:e}]))}},hk=class extends P{constructor(e){super("w:highlight"),this.root.push(new _e({val:e}))}},mk=e=>new L({name:"w:lang",attributes:{value:{key:"w:val",value:e.value},eastAsia:{key:"w:eastAsia",value:e.eastAsia},bidirectional:{key:"w:bidi",value:e.bidirectional}}}),il=(e,t)=>{if(typeof e=="string"){let r=e;return new L({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:r},cs:{key:"w:cs",value:r},eastAsia:{key:"w:eastAsia",value:r},hAnsi:{key:"w:hAnsi",value:r},hint:{key:"w:hint",value:t}}})}if("theme"in e){let r=e.theme==="headings"?"major":"minor";return new L({name:"w:rFonts",attributes:{ascii:{key:"w:asciiTheme",value:`${r}HAnsi`},eastAsia:{key:"w:eastAsiaTheme",value:`${r}EastAsia`},hAnsi:{key:"w:hAnsiTheme",value:`${r}HAnsi`},cs:{key:"w:cstheme",value:`${r}Bidi`}}})}let n=e;return new L({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:n.ascii},cs:{key:"w:cs",value:n.cs},eastAsia:{key:"w:eastAsia",value:n.eastAsia},hAnsi:{key:"w:hAnsi",value:n.hAnsi},hint:{key:"w:hint",value:n.hint}}})},vm=e=>new L({name:"w:vertAlign",attributes:{val:{key:"w:val",value:e}}}),fk=()=>vm("superscript"),gk=()=>vm("subscript"),wm={SINGLE:"single",WORDS:"words",DOUBLE:"double",THICK:"thick",DOTTED:"dotted",DOTTEDHEAVY:"dottedHeavy",DASH:"dash",DASHEDHEAVY:"dashedHeavy",DASHLONG:"dashLong",DASHLONGHEAVY:"dashLongHeavy",DOTDASH:"dotDash",DASHDOTHEAVY:"dashDotHeavy",DOTDOTDASH:"dotDotDash",DASHDOTDOTHEAVY:"dashDotDotHeavy",WAVE:"wave",WAVYHEAVY:"wavyHeavy",WAVYDOUBLE:"wavyDouble",NONE:"none"},bk=(e=wm.SINGLE,t)=>sc("w:u",[{key:"w:val",value:e},{keys:Kr,color:t}]),on=class extends St{constructor(e){if(super("w:rPr"),!e)return;if(e.style&&this.push(new ot("w:rStyle",e.style)),e.font&&(typeof e.font=="string"?this.push(il(e.font)):"name"in e.font?this.push(il(e.font.name,e.font.hint)):this.push(il(e.font))),e.bold!==void 0&&this.push(new I("w:b",e.bold)),e.boldComplexScript===void 0&&e.bold!==void 0||e.boldComplexScript){var t;this.push(new I("w:bCs",(t=e.boldComplexScript)!==null&&t!==void 0?t:e.bold))}if(e.italics!==void 0&&this.push(new I("w:i",e.italics)),e.italicsComplexScript===void 0&&e.italics!==void 0||e.italicsComplexScript){var n;this.push(new I("w:iCs",(n=e.italicsComplexScript)!==null&&n!==void 0?n:e.italics))}e.smallCaps!==void 0?this.push(new I("w:smallCaps",e.smallCaps)):e.allCaps!==void 0&&this.push(new I("w:caps",e.allCaps)),e.strike!==void 0&&this.push(new I("w:strike",e.strike)),e.doubleStrike!==void 0&&this.push(new I("w:dstrike",e.doubleStrike)),e.emboss!==void 0&&this.push(new I("w:emboss",e.emboss)),e.imprint!==void 0&&this.push(new I("w:imprint",e.imprint)),e.noProof!==void 0&&this.push(new I("w:noProof",e.noProof)),e.snapToGrid!==void 0&&this.push(new I("w:snapToGrid",e.snapToGrid)),e.vanish!==void 0&&this.push(new I("w:vanish",e.vanish)),e.color&&this.push(new uk(e.color)),e.characterSpacing&&this.push(new pk(e.characterSpacing)),e.scale!==void 0&&this.push(new Pr("w:w",e.scale)),e.kern&&this.push(new rl("w:kern",e.kern)),e.position&&this.push(new ot("w:position",e.position)),e.size!==void 0&&this.push(new rl("w:sz",e.size));let r=e.sizeComplexScript===void 0||e.sizeComplexScript===!0?e.size:e.sizeComplexScript;r&&this.push(new rl("w:szCs",r)),e.highlight&&this.push(new hk(e.highlight)),e.underline&&this.push(bk(e.underline.type,e.underline.color)),e.effect&&this.push(new ot("w:effect",e.effect)),e.border&&this.push(he("w:bdr",e.border)),e.shading&&this.push(zs(e.shading)),e.fitText&&this.push(dk(e.fitText)),e.subScript&&this.push(gk()),e.superScript&&this.push(fk()),e.rightToLeft!==void 0&&this.push(new I("w:rtl",e.rightToLeft)),e.emphasisMark&&this.push(Vx(e.emphasisMark.type)),e.language&&this.push(mk(e.language)),e.eastAsianLayout&&this.push(Gx(e.eastAsianLayout)),e.specVanish!==void 0&&this.push(new I("w:specVanish",e.specVanish)),e.math!==void 0&&this.push(new I("w:oMath",e.math)),e.revision&&this.push(new wk(e.revision))}push(e){this.root.push(e)}},vk=class extends on{constructor(e){super(e),e?.insertion&&this.push(new Kx(e.insertion)),e?.deletion&&this.push(new Wx(e.deletion))}},wk=class extends P{constructor(e){super("w:rPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.addChildElement(new on(e))}},Mr=class extends P{constructor(e){if(super("w:t"),typeof e=="string")this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push(e);else{var t;this.root.push(new Ut({space:(t=e.space)!==null&&t!==void 0?t:Ht.DEFAULT})),this.root.push(e.text)}}},ks={CURRENT:"CURRENT",TOTAL_PAGES:"TOTAL_PAGES",TOTAL_PAGES_IN_SECTION:"TOTAL_PAGES_IN_SECTION",CURRENT_SECTION:"SECTION"},yk=e=>{switch(e){case ks.CURRENT:return[_r(),new Fx,sn(),an()];case ks.TOTAL_PAGES:return[_r(),new qx,sn(),an()];case ks.TOTAL_PAGES_IN_SECTION:return[_r(),new Hx,sn(),an()];case ks.CURRENT_SECTION:return[_r(),new Ux,sn(),an()];default:return}},qe=class Pl extends P{constructor(t){if(super("w:r"),E(this,"properties",void 0),E(this,"following",[]),this.properties=new on(t),this.root.push(this.properties),t.break)for(let n=0;n<t.break;n++)this.root.push(Mx());if(t.children)for(let[n,r]of t.children.entries()){if(Ws(r)==="w:r"){let i=t.children.slice(n+1);this.following=[r,...i.length>0?[new Pl(k(k({},t),{},{break:void 0,children:i}))]:[]];break}if(typeof r=="string"){let i=yk(r);if(i){let s=t.children.slice(n+1),a=l=>new Pl(k(k({},t),{},{break:void 0,children:l})),o=this.root.length===1;o&&this.root.push(i[0]);let c=o?i.slice(1):i;this.following=[...c.map(l=>a([l])),...s.length>0?[a(s)]:[]];break}this.root.push(new Mr(r));continue}this.root.push(r)}else t.text!==void 0&&this.root.push(new Mr(t.text))}get writtenAs(){return this.following.length>0?[this,...this.following.flatMap(t=>{var n;return(n=t.writtenAs)!==null&&n!==void 0?n:t})]:void 0}},Oe=class extends qe{constructor(e){super(typeof e=="string"?{text:e}:e)}},oc={EXTERNAL:"External"},xk=(e,t,n,r)=>new L({name:"Relationship",attributes:{id:{key:"Id",value:e},type:{key:"Type",value:t},target:{key:"Target",value:n},targetMode:{key:"TargetMode",value:r}}}),ym=(e,t)=>new L({name:"a:hlinkClick",attributes:k(k({},t?{xmlns:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"}}:{}),{},{id:{key:"r:id",value:`rId${e}`}})}),kk=class{constructor(e){E(this,"link",void 0),E(this,"linkId",$n()),E(this,"addedTo",new WeakSet),this.link=e}createClick(e){return ym(this.linkId,e)}addRelationship(e){let t=e.viewWrapper.Relationships;this.addedTo.has(t)||(this.addedTo.add(t),t.addRelationship(this.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",this.link,oc.EXTERNAL))}},Tk=32767,Sk=780,Ck=[[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"]],Ek=e=>e<=Tk?Ck.reduce(({rest:t,text:n},[r,i])=>({rest:t%r,text:n+i.repeat(Math.floor(t/r))}),{rest:e,text:""}).text:void 0,Ak=e=>e===0?"":e<=Sk?String.fromCharCode(65+(e-1)%26).repeat(Math.ceil(e/26)):void 0,_k=e=>{var t;return`${e}${e%100>=11&&e%100<=13?"th":(t=["th","st","nd","rd"][e%10])!==null&&t!==void 0?t:"th"}`},lc=e=>{let t=e.charAt(0)!==e.charAt(0).toUpperCase(),n=r=>i=>{var s;return t?(s=r(i))===null||s===void 0?void 0:s.toLowerCase():r(i)};switch(e.toLowerCase()){case"arabic":return String;case"roman":return n(Ek);case"alphabetic":return n(Ak);case"ordinal":return r=>r>0?_k(r):void 0;case"arabicdash":return r=>`- ${r} -`;default:return}},xm=new Set(["mergeformat","charformat","mergeformatinet"]),km=new Set(["upper","lower","firstcap","caps"]),Nk=e=>/^[#0,]*[#0][#0,]*$/.test(e),Pk=(e,t)=>{let n=[...t].filter(s=>s==="0").length,r=n+[...t].filter(s=>s==="#").length,i=String(e).padStart(n,"0");if(!(i.length<r||n===0&&e===0))return t.includes(",")?i.replace(/\B(?=(\d{3})+$)/g,","):i},Ik=(e,t)=>{switch(t){case"upper":return e.toUpperCase();case"lower":return e.toLowerCase();case"firstcap":return e.charAt(0).toUpperCase()+e.slice(1);default:return e}},Ok=e=>{var t;let n=new RegExp("^\\s*(PAGEREF|NUMPAGES|SECTIONPAGES)\\b(.*)$","is").exec(e),r=n?.[1].toUpperCase()==="PAGEREF"?new RegExp('^\\s*("?)([^\\s"\\\\]+)\\1(.*)$',"s").exec(n[2]):void 0;if(!n||n[1].toUpperCase()==="PAGEREF"&&!r)return;let i=(t=(r?r[3]:n[2]).match(/"[^"]*"|\S+/g))!==null&&t!==void 0?t:[],s,a,o=[],c=!1,l=!0;for(let h=0;h<i.length;h++){let f=i[h],m=()=>{var g;return(f.length>2?f.slice(2):(g=i[++h])!==null&&g!==void 0?g:"").replace(/^"(.*)"$/,"$1")};if(/^\\p$/i.test(f))c=!0;else if(f.startsWith("\\#")){var u;let g=m();l&&(l=a===void 0&&Nk(g)),(u=a)!==null&&u!==void 0||(a=g)}else if(f.startsWith("\\*")){let g=m(),y=g.toLowerCase();if(km.has(y))o.push(y);else if(g!==""&&!xm.has(y)){var d;l&&(l=s===void 0&&lc(g)!==void 0),(d=s)!==null&&d!==void 0||(s=g)}}}let p=k(k(k(k({},s===void 0?{}:{numberFormat:s}),a===void 0?{}:{picture:a}),o.length===0?{}:{capitals:o[0]}),{},{written:l&&o.length<=1&&o[0]!=="caps"&&(s===void 0||a===void 0)});return k(r?{type:"pageReference",bookmark:r[2],relative:c}:{type:"pageCount",scope:n[1].toUpperCase()==="NUMPAGES"?"document":"section"},p)},Rk=e=>new RegExp("^\\s*TOC\\b.*\\\\s\\b","is").test(e),Tm=(e,{enclosing:t,within:n,inTextBox:r},{estimate:i,sectionPageCount:s,blank:a,relativeTo:o})=>{let c=Ok(e);if(c===void 0)return;let{bookmarks:l,pageCount:u,bookmarkPageNumbers:d}=i,{numberFormat:p,picture:h,capitals:f,written:m}=c,g=p!==void 0||h!==void 0,y=C=>C===void 0?void 0:h===void 0?lc(p??"arabic")(C):Pk(C,h),T=c.type==="pageReference"&&c.relative&&n==="counted"&&!r?o?.(c.bookmark):void 0,b;return m?c.type==="pageCount"?b=y(c.scope==="document"?u:s):t.some(Rk)?b=void 0:g?b=y(d?.get(c.bookmark)):b=c.relative?T:l.get(c.bookmark):b=void 0,b===void 0?a?"":void 0:Ik(b,f)},Lk=(e,t)=>e==="mc:Fallback"||t==="fallback"?"fallback":e==="w:del"||e==="w:moveFrom"?"deleted":t,Br=(e,t,n,r,i="counted",s=!1)=>{for(let l=0;l<t.length;l++){let u=t[l],d=e.nameOf(u);if(d===void 0)continue;let p=n[n.length-1];if(d==="w:fldChar"){let h=e.attributeOf(u,"w:fldCharType");h==="begin"?n.push({begin:u,instruction:"",inResult:!1}):h==="separate"&&p?(e.writeClean(p.begin,p.instruction),p.inResult=!0,p.result=r.resultOf(p.instruction,{within:i,enclosing:n.slice(0,-1).map(f=>f.instruction),inTextBox:s}),p.result!==void 0&&(t.splice(l+1,0,e.textElement(p.result)),l++)):h==="end"&&n.pop()}else if(d==="w:instrText"&&p&&!p.inResult)p.instruction+=e.textOf(u);else if((d==="w:t"||d==="w:tab"||d==="w:br"||d==="w:cr")&&p?.result!==void 0)t.splice(l,1),l--;else if(d==="w:fldSimple"){let h=r.resultOf(String(e.attributeOf(u,"w:instr")),{within:i,enclosing:n.map(f=>f.instruction),inTextBox:s});if(h===void 0){var a;Br(e,(a=e.contentOf(u))!==null&&a!==void 0?a:[],[],r,i,s)}else e.setSimpleFieldResult(u,h)}else{var o;if(d==="w:p"){var c;(c=r.beforeParagraph)===null||c===void 0||c.call(r,u)}Br(e,(o=e.contentOf(u))!==null&&o!==void 0?o:[],n,r,Lk(d,i),s||d==="w:txbxContent"),d==="w:p"&&r.afterParagraph(u)}}},Sm=(e,t)=>t.flatMap(n=>{var r;let i=e.nameOf(n);return i===void 0?[]:i==="w:sectPr"?[n]:Sm(e,(r=e.contentOf(n))!==null&&r!==void 0?r:[])}),Dk=(e,t)=>{var n;return((n=e.contentOf(t))!==null&&n!==void 0?n:[]).some(r=>{var i;return e.nameOf(r)==="w:pPr"&&((i=e.contentOf(r))!==null&&i!==void 0?i:[]).some(s=>e.nameOf(s)==="w:sectPr")})},Mk=(e,t,n)=>{let r=Sm(e,[t]).reduce((i,s)=>{var a,o;let c=((a=e.contentOf(s))!==null&&a!==void 0?a:[]).flatMap(l=>{let u=e.nameOf(l);return u==="w:headerReference"||u==="w:footerReference"?[[`${u} ${String(e.attributeOf(l,"w:type"))}`,String(e.attributeOf(l,"r:id"))]]:[]});return[...i,new Map([...(o=i[i.length-1])!==null&&o!==void 0?o:[],...c])]},[]).reduce((i,s,a)=>{for(let c of s.values()){var o;i.set(c,[...(o=i.get(c))!==null&&o!==void 0?o:[],n[a]])}return i},new Map);return new Map([...r].flatMap(([i,[s,...a]])=>s!==void 0&&a.every(o=>o===s)?[[i,s]]:[]))},Cm=(e,t,n,{blank:r})=>{let{sectionPageCounts:i=[],relativePositions:s}=n,a=0,o=new Map,c=l=>{var u,d;let p=(u=o.get(l))!==null&&u!==void 0?u:0;return o.set(l,p+1),s==null||(d=s.get(l))===null||d===void 0?void 0:d[p]};return Br(e,[t],[],{resultOf:(l,u)=>Tm(l,u,{estimate:n,sectionPageCount:i[a],blank:r,relativeTo:c}),afterParagraph:l=>{a+=Dk(e,l)?1:0}}),Mk(e,t,i)},Em=(e,t,n,{blank:r,sectionPageCount:i,notes:s=!1})=>{let a=o=>{let c=n.bookmarks.get(o);return c===void 0?void 0:`on page ${c}`};Br(e,[t],[],{resultOf:(o,c)=>Tm(o,c,k({estimate:n,sectionPageCount:i,blank:r},s?{relativeTo:a}:{})),afterParagraph:()=>{}})},Bk=(e,t,{beforeParagraph:n,resultOf:r})=>Br(e,[t],[],{resultOf:(i,{within:s})=>r(i,s),beforeParagraph:n,afterParagraph:()=>{}}),Am=class extends P{constructor(e={}){super("w:instrText"),E(this,"properties",void 0),this.properties=e,this.root.push(new Ut({space:Ht.PRESERVE}));let t="TOC";if(this.properties.captionLabel&&(t=`${t} \\a "${this.properties.captionLabel}"`),this.properties.entriesFromBookmark&&(t=`${t} \\b "${this.properties.entriesFromBookmark}"`),this.properties.captionLabelIncludingNumbers&&(t=`${t} \\c "${this.properties.captionLabelIncludingNumbers}"`),this.properties.sequenceAndPageNumbersSeparator&&(t=`${t} \\d "${this.properties.sequenceAndPageNumbersSeparator}"`),this.properties.tcFieldIdentifier&&(t=`${t} \\f "${this.properties.tcFieldIdentifier}"`),this.properties.hyperlink&&(t=`${t} \\h`),this.properties.tcFieldLevelRange&&(t=`${t} \\l "${this.properties.tcFieldLevelRange}"`),this.properties.pageNumbersEntryLevelsRange&&(t=`${t} \\n "${this.properties.pageNumbersEntryLevelsRange}"`),this.properties.headingStyleRange&&(t=`${t} \\o "${this.properties.headingStyleRange}"`),this.properties.entryAndPageNumberSeparator&&(t=`${t} \\p "${this.properties.entryAndPageNumberSeparator}"`),this.properties.seqFieldIdentifierForPrefix&&(t=`${t} \\s "${this.properties.seqFieldIdentifierForPrefix}"`),this.properties.stylesWithLevels&&this.properties.stylesWithLevels.length){let n=this.properties.stylesWithLevels.map(r=>`${r.styleName},${r.level}`).join(",");t=`${t} \\t "${n}"`}this.properties.useAppliedParagraphOutlineLevel&&(t=`${t} \\u`),this.properties.preserveTabInEntries&&(t=`${t} \\w`),this.properties.preserveNewLineInEntries&&(t=`${t} \\x`),this.properties.hideTabAndPageNumbersInWebView&&(t=`${t} \\z`),this.root.push(t)}},_m=class extends P{constructor(){super("w:sdtContent")}},Nm=e=>e===void 0?fm():_r(e),cc=new WeakMap,$k=(e,t)=>{cc.set(e,t)},Fk=class{constructor(){E(this,"ids",[])}get(e){var t,n;return(n=(t=this.ids)[e])!==null&&n!==void 0||(t[e]=gm()),this.ids[e]}},ct=e=>typeof e=="object"&&e!==null?Object.keys(e)[0]:void 0,dt=e=>{let t=ct(e),n=t===void 0?void 0:e[t];return Array.isArray(n)?n:n===void 0?[]:[n]},Je=(e,t)=>dt(e).find(n=>ct(n)===t),$e=(e,t)=>{var n;return(n=Je(e,"_attr"))===null||n===void 0||(n=n._attr)===null||n===void 0?void 0:n[t]},dc=(e,t)=>{let n=$e(e,t);return n===void 0?void 0:Number(n)},qk=new Set(["w:tbl","w:tr","w:tc","w:sdt","w:sdtContent","w:customXml"]),Pm=e=>e.flatMap(t=>{let n=ct(t);return n==="w:p"||cc.has(t)?[t]:n!==void 0&&qk.has(n)?Pm(dt(t)):[]}),Hk=new Set(["w:r","w:hyperlink","w:ins","w:moveTo","w:smartTag","w:customXml","w:sdt","w:sdtContent","w:fldSimple","w:dir","w:bdo"]),Uk=e=>{switch(ct(e)){case"w:t":return dt(e).filter(t=>typeof t=="string").join("");case"w:tab":return" ";case"w:br":return[void 0,"textWrapping"].includes($e(e,"w:type"))?`
5341
5341
  `:"";case"w:cr":return`
5342
- `;case"w:noBreakHyphen":return"-";default:return""}},jk=e=>{let t=[],n=r=>{let i=ct(r);if(i!==void 0&&Hk.has(i))return dt(r).map(n).join("");if(i==="w:fldChar"){let s=$e(r,"w:fldCharType");return s==="begin"?t.push(!1):s==="separate"?t[t.length-1]=!0:t.pop(),""}return t.every(Boolean)?Uk(r):""};return dt(e).map(n).join("")},Im=e=>{let t=ct(e);return t==="w:bookmarkStart"?[{start:!0,id:$e(e,"w:id"),name:$e(e,"w:name")}]:t==="w:bookmarkEnd"?[{start:!1,id:$e(e,"w:id")}]:t===void 0||t==="_attr"?[]:dt(e).flatMap(Im)},Wk=e=>{let t=new Map;return e.map(n=>{let r=Im(n),i=new Set([...t.values(),...r.flatMap(s=>s.start?[s.name]:[])]);for(let s of r)s.start?t.set(s.id,s.name):t.delete(s.id);return i})},Kk=(e,t)=>{let n=t?Wk(e):[];return e.map((r,i)=>{var s;let a=Je(r,"w:pPr");return{element:r,styleId:$e(Je(a,"w:pStyle"),"w:val"),outlineLevel:dc(Je(a,"w:outlineLvl"),"w:val"),text:jk(r),bookmarks:(s=n[i])!==null&&s!==void 0?s:new Set}})},Om=e=>{var t;let n=(t=e.file)===null||t===void 0||(t=t.Styles)===null||t===void 0?void 0:t.prepForXml(e);return new Map(dt(n).filter(r=>ct(r)==="w:style"&&["paragraph",void 0].includes($e(r,"w:type"))).map(r=>[$e(r,"w:styleId"),{name:$e(Je(r,"w:name"),"w:val"),basedOn:$e(Je(r,"w:basedOn"),"w:val"),outlineLevel:dc(Je(Je(r,"w:pPr"),"w:outlineLvl"),"w:val")}]))},Rm=e=>{let t=/^\s*(\d+)\s*-\s*(\d+)\s*$/.exec(e);return t?[Number(t[1]),Number(t[2])]:void 0},Il=(e,[t,n])=>e>=t&&e<=n,pc=(e,t)=>{var n,r;if(e===void 0)return;let i=/^heading ?([1-9])$/i.exec((n=(r=t.get(e))===null||r===void 0?void 0:r.name)!==null&&n!==void 0?n:e);return i?Number(i[1]):void 0},Lm=(e,t,n=0)=>{var r;if(e===void 0||n>t.size)return;let i=t.get(e),s=pc(e,t);return(r=i?.outlineLevel)!==null&&r!==void 0?r:s===void 0?Lm(i?.basedOn,t,n+1):s-1},Gk=e=>{let t=Om(e);return n=>{let r=Je(n,"w:pPr"),i=$e(Je(r,"w:pStyle"),"w:val"),s=pc(i,t),a=Mm({styleId:i,outlineLevel:dc(Je(r,"w:outlineLvl"),"w:val")},t),o=a===void 0||a>=9?void 0:a+1;return s!==void 0&&(o===void 0||o===s)?s:o===void 0?void 0:"unclear"}},Mm=(e,t)=>{var n;return(n=e.outlineLevel)!==null&&n!==void 0?n:Lm(e.styleId,t)},zk=(e,t,n)=>{var r;let{entriesFromBookmark:i,headingStyleRange:s,stylesWithLevels:a=[],useAppliedParagraphOutlineLevel:o}=e;if(t.text.trim()===""||i&&!t.bookmarks.has(i))return;let c=[t.styleId,t.styleId===void 0||(r=n.get(t.styleId))===null||r===void 0?void 0:r.name].filter(f=>f!==void 0).map(f=>f.toLowerCase()),l=a.find(f=>c.includes(f.styleName.toLowerCase()));if(l)return l.level;let u=!!s||a.length>0||!!o||!!e.tcFieldIdentifier||!!e.tcFieldLevelRange||!!e.captionLabel||!!e.captionLabelIncludingNumbers,d=s?Rm(s):u?void 0:[1,9],p=pc(t.styleId,n);if(d&&p!==void 0&&Il(p,d))return p;let h=o?Mm(t,n):void 0;return h!==void 0&&Il(h+1,d??[1,9])?h+1:void 0},Vk=(e,t)=>{let n=t.preserveTabInEntries?e:e.replace(/\t/g," ");return(t.preserveNewLineInEntries?n.split(`
5343
- `):[n.replace(/\n/g," ")]).map((r,i)=>new Oe({break:i>0?1:void 0,children:r.split(" ").flatMap((s,a)=>[...a>0?[new Xs]:[],...s===""?[]:[s]])}))},Xk=({text:e,separator:t})=>t==="tab"?[new Oe(e),new Oe({children:[new Xs]})]:[new Oe(`${e} `)],Yk=(e,t)=>{let n=240*(e-1)+t+240;return n<=1920?Math.ceil(n/240)*240:Math.round(n)},Jk=(e,t)=>{var n,r;return(n=(r=[...t].find(([,i])=>{var s;return((s=i.name)===null||s===void 0?void 0:s.toLowerCase())===`toc ${e}`}))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:`TOC${e}`},Qk=({properties:e,beginDirty:t,textWidth:n,tabLeader:r},i,s,a)=>{var o;let c=e.pageNumbersEntryLevelsRange?(o=Rm(e.pageNumbersEntryLevelsRange))!==null&&o!==void 0?o:[1,9]:void 0,l=new _m;return i.forEach((u,d)=>{var p;let h=c===void 0||!Il(u.level,c),f=[...u.listNumber?Xk(u.listNumber):[],...Vk(u.title,e),...h?[new Oe({children:[e.entryAndPageNumberSeparator||new Xs]}),new B1(u.bookmark,{hyperlink:e.hyperlink})]:[]];l.addChildElement(new ne({style:Jk(u.level,s),tabStops:[...((p=u.listNumber)===null||p===void 0?void 0:p.separator)==="tab"?[{type:"left",position:Yk(u.level,u.listNumber.width)}]:[],{type:"right",position:n,leader:r}],children:[...d===0?[new qe({children:[Nm(t),new Am(e),sn()]})]:[],...e.hyperlink?[new Fm({anchor:u.bookmark,children:f})]:f]}))}),l.addChildElement(new ne({children:[new qe({children:[an()]})]})),l.prepForXml(a)},Zk=(e,t,n,r)=>{let i=dt(e),s=i.findIndex(a=>ct(a)==="w:pPr")+1;e["w:p"]=[...i.slice(0,s),new Um(t,n).prepForXml(r),...i.slice(s),new jm(n).prepForXml(r)]},e1=(e,t,n,r)=>{let i=Pm(dt(e)),s=i.flatMap(u=>{let d=cc.get(u);return d?[[u,d]]:[]});if(s.length===0)return;let a=Om(t),o=s.some(([,{properties:u}])=>!!u.entriesFromBookmark),c=Kk(i.filter(u=>ct(u)==="w:p"),o).map(u=>({paragraph:u,levels:s.map(([,{properties:d}])=>zk(d,u,a))})).filter(({levels:u})=>u.some(d=>d!==void 0)).map((u,d)=>k(k({},u),{},{id:n.get(d)}));for(let{paragraph:u,id:d}of c)Zk(u.element,`_Toc${d}`,d,t);let l=c.length>0?r?.(e):void 0;s.forEach(([u,d],p)=>{let h=c.flatMap(({paragraph:f,levels:m,id:g})=>{let y=m[p],T=l?.get(`_Toc${g}`);return y===void 0?[]:[k({title:f.text,level:y,bookmark:`_Toc${g}`},T?{listNumber:T}:{})]});h.length!==0&&(u["w:sdt"]=dt(u).map(f=>ct(f)==="w:sdtContent"?Qk(d,h,a,t):f))})},t1=new RegExp("^\\p{L}[\\p{L}\\p{N}_]*$","u"),n1=e=>{var t,n;let r,i=!1,s,a=!1,o=!1;for(let d=0;d<e.length;d++){var c,l;let p=e[d],h=(c=e[d+1])!==null&&c!==void 0?c:"",f;if(d===0&&!p.startsWith("\\"))f={type:"bookmark"};else if(p==="\\c"||p==="\\n")f={type:p==="\\c"?"repeat":"next"};else if((p==="\\r"||p==="\\s")&&/^\d+$/.test(h))d++,f=p==="\\r"?{type:"reset",to:Number(h)}:{type:"heading",level:Number(h)};else if(p==="\\h")i=!0;else if(p==="\\#"&&d+1<e.length)d++,o=!0;else if(p==="\\*"&&d+1<e.length){let m=e[++d];if(km.has(m.toLowerCase()))a=!0;else if(!xm.has(m.toLowerCase())){if(s!==void 0)return;s=m}}else return;if(f&&r)return;r=(l=f)!==null&&l!==void 0?l:r}if(r?.type==="bookmark"&&e.length>1)return;let u=!o&&!(a&&s!==void 0&&s.toLowerCase()!=="arabic");return{step:(t=r)!==null&&t!==void 0?t:{type:"next"},hidden:i&&s===void 0,format:u?(n=s)!==null&&n!==void 0?n:"ARABIC":""}},uc=e=>{var t;let n=new RegExp("^\\s*SEQ\\b(.*)$","is").exec(e);if(!n)return;let[r,...i]=(t=n[1].match(/"[^"]*"|\S+/g))!==null&&t!==void 0?t:[];if(r===void 0)return{};let s=r.replace(/^"(.*)"$/,"$1");return t1.test(s)?{identifier:s,sequence:n1(i)}:{identifier:s}},r1=e=>uc(e)!==void 0,Ol=e=>typeof e!="object"||e===null?[]:Array.isArray(e)?e.flatMap(Ol):Object.entries(e).flatMap(([t,n])=>[...(t==="w:instrText"&&Array.isArray(n)?n:t==="_attr"?[n["w:instr"]]:[]).flatMap(r=>{let i=typeof r=="string"?uc(r):void 0;return i?.identifier===void 0?[]:[i.identifier.toLowerCase()]}),...Ol(n)]),i1=e=>{var t;let n=(t=e.file)===null||t===void 0?void 0:t.Comments;if(!n)return new Set;let r={View:n,Relationships:n.Relationships};return new Set(Ol(n.prepForXml(k(k({},e),{},{viewWrapper:r,stack:[]}))))},s1=e=>{let t=Gk(e),n=new Map,r=new Map,i=[],s=-1,a=-1,o,c=(l,u)=>{var d;let p=Math.max(-1,...i.slice(1,u+1).filter(m=>m!==void 0)),h=((d=r.get(l))!==null&&d!==void 0?d:[]).filter(m=>m.paragraph>=p),f=h.every(({step:m})=>m?.type==="next"||m?.type==="heading"&&m.level===u);return s>p||!f?void 0:h.length+1};return{startParagraph:l=>{a++;let u=t(l);u==="unclear"?s=a:u!==void 0&&(i[u]=a)},numberOf:(l,u)=>{var d,p,h;let{identifier:f,sequence:m}=uc(l);if(f===void 0||u==="fallback")return;(d=o)!==null&&d!==void 0||(o=i1(e));let g=f.toLowerCase();if(m?.step.type==="bookmark"&&u==="counted"&&!o.has(g))return;let y=n.has(g)?n.get(g):0,T=o.has(g)||u==="deleted"?void 0:m?.step,b=T?.type==="reset"?T.to:T?.type==="repeat"?y:T?.type==="heading"?c(g,T.level):T?.type==="next"&&y!==void 0?y+1:void 0;return n.set(g,b),r.set(g,[...(p=r.get(g))!==null&&p!==void 0?p:[],k({paragraph:a},b===void 0?{}:{step:T})]),b===void 0||m===void 0?void 0:m.hidden?"":(h=lc(m.format))===null||h===void 0?void 0:h(b)}}},sl=e=>{let t=typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.keys(e)[0]:void 0;return t==="_attr"?void 0:t},th=e=>({"w:t":[{_attr:{"xml:space":"preserve"}},e]}),Vs={nameOf:sl,contentOf:e=>{let t=e[sl(e)];return Array.isArray(t)?t:void 0},attributeOf:(e,t)=>{var n;let r=e[sl(e)],i=Array.isArray(r)?r.find(s=>typeof s=="object"&&s!==null&&"_attr"in s):r;return i==null||(n=i._attr)===null||n===void 0?void 0:n[t]},textOf:e=>Vs.contentOf(e).filter(t=>typeof t=="string").join(""),textElement:th,writeClean:e=>{if($x(e)){let t=e["w:fldChar"]._attr;e["w:fldChar"]={_attr:Object.fromEntries(Object.entries(t).filter(([n])=>n!=="w:dirty"))}}},setSimpleFieldResult:(e,t)=>{let n=e["w:fldSimple"];e["w:fldSimple"]=[...(Array.isArray(n)?n:[n]).filter(r=>typeof r=="object"&&r!==null&&"_attr"in r),{"w:r":[th(t)]}]}},Dm=new WeakMap,a1=(e,t)=>{let{startParagraph:n,numberOf:r}=s1(t);Bk(Vs,e,{beforeParagraph:i=>n(i),resultOf:(i,s)=>r1(i)?r(i,s):void 0})},o1=(e,t,n)=>{let r=n(e,t),i=Cm(Vs,e,r,{blank:!1});t.file&&Dm.set(t.file,{estimate:r,partPageCounts:i})},zr=(e,t,n)=>{let r=t.file&&Dm.get(t.file);if(!e||!r)return;let i=n===void 0?void 0:r.partPageCounts.get(`rId${n}`),s="w:footnotes"in e||"w:endnotes"in e;Em(Vs,e,r.estimate,{blank:!1,sectionPageCount:i,notes:s})},l1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns"})}},be=class Bm extends P{constructor(){super("Relationships"),this.root.push(new l1({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}addRelationship(t,n,r,i){this.root.push(xk(`rId${t}`,n,r,i))}static copy(t){let n=new Bm;return n.root.push(...t.root.slice(1)),n}get RelationshipCount(){return this.root.length-1}},c1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}},d1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:cx":"xmlns:cx","xmlns:cx1":"xmlns:cx1","xmlns:cx2":"xmlns:cx2","xmlns:cx3":"xmlns:cx3","xmlns:cx4":"xmlns:cx4","xmlns:cx5":"xmlns:cx5","xmlns:cx6":"xmlns:cx6","xmlns:cx7":"xmlns:cx7","xmlns:cx8":"xmlns:cx8","xmlns:mc":"xmlns:mc","xmlns:aink":"xmlns:aink","xmlns:am3d":"xmlns:am3d","xmlns:o":"xmlns:o","xmlns:r":"xmlns:r","xmlns:m":"xmlns:m","xmlns:v":"xmlns:v","xmlns:wp14":"xmlns:wp14","xmlns:wp":"xmlns:wp","xmlns:w10":"xmlns:w10","xmlns:w":"xmlns:w","xmlns:w14":"xmlns:w14","xmlns:w15":"xmlns:w15","xmlns:w16cex":"xmlns:w16cex","xmlns:w16cid":"xmlns:w16cid","xmlns:w16":"xmlns:w16","xmlns:w16sdtdh":"xmlns:w16sdtdh","xmlns:w16se":"xmlns:w16se","xmlns:wpg":"xmlns:wpg","xmlns:wpi":"xmlns:wpi","xmlns:wne":"xmlns:wne","xmlns:wps":"xmlns:wps","mc:Ignorable":"mc:Ignorable"})}},nh=class extends P{constructor({id:e,initials:t,author:n,date:r=new Date,children:i},s){super("w:comment"),E(this,"paraId",void 0),this.paraId=s,this.root.push(new c1({id:e,initials:t,author:n,date:r.toISOString()}));for(let a of i)this.root.push(a)}prepForXml(e){let t=super.prepForXml(e);if(!t||!this.paraId)return t;let n=t["w:comment"];if(!Array.isArray(n))return t;for(let r=n.length-1;r>=0;r--){let i=n[r];if(i&&typeof i=="object"&&"w:p"in i){let s=i["w:p"];Array.isArray(s)&&s.unshift({_attr:{"w14:paraId":this.paraId,"w14:textId":this.paraId}});break}}return t}},p1=e=>(e+1).toString(16).toUpperCase().padStart(8,"0"),u1=class extends P{constructor({children:e}){super("w:comments"),E(this,"relationships",void 0),E(this,"threadData",void 0),E(this,"commentIdsData",void 0),E(this,"isEmpty",void 0),this.isEmpty=e.length===0,this.root.push(new d1({"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","xmlns:cx":"http://schemas.microsoft.com/office/drawing/2014/chartex","xmlns:cx1":"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex","xmlns:cx2":"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex","xmlns:cx3":"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex","xmlns:cx4":"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex","xmlns:cx5":"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex","xmlns:cx6":"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex","xmlns:cx7":"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex","xmlns:cx8":"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:aink":"http://schemas.microsoft.com/office/drawing/2016/ink","xmlns:am3d":"http://schemas.microsoft.com/office/drawing/2017/model3d","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:m":"http://schemas.openxmlformats.org/officeDocument/2006/math","xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:wp14":"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing","xmlns:wp":"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing","xmlns:w10":"urn:schemas-microsoft-com:office:word","xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main","xmlns:w14":"http://schemas.microsoft.com/office/word/2010/wordml","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","xmlns:w16cex":"http://schemas.microsoft.com/office/word/2018/wordml/cex","xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:w16":"http://schemas.microsoft.com/office/word/2018/wordml","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16se":"http://schemas.microsoft.com/office/word/2015/wordml/symex","xmlns:wpg":"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup","xmlns:wpi":"http://schemas.microsoft.com/office/word/2010/wordprocessingInk","xmlns:wne":"http://schemas.microsoft.com/office/word/2006/wordml","xmlns:wps":"http://schemas.microsoft.com/office/word/2010/wordprocessingShape","mc:Ignorable":"w14 w15 wp14"}));let t=e.some(r=>r.parentId!==void 0),n=e.some(r=>r.durableId!==void 0);if(t||n){let r=new Map(e.map(i=>[i.id,p1(i.id)]));for(let i of e)this.root.push(new nh(i,r.get(i.id)));t&&(this.threadData=e.map(i=>({paraId:r.get(i.id),parentParaId:i.parentId!==void 0?r.get(i.parentId):void 0,done:i.resolved}))),n&&(this.commentIdsData=e.map(i=>{var s;return{paraId:r.get(i.id),durableId:(s=i.durableId)!==null&&s!==void 0?s:r.get(i.id)}}))}else for(let r of e)this.root.push(new nh(r));this.relationships=new be}get Relationships(){return this.relationships}get ThreadData(){return this.threadData}get CommentIdsData(){return this.commentIdsData}get IsEmpty(){return this.isEmpty}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},h1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:mc":"xmlns:mc","xmlns:w15":"xmlns:w15","mc:Ignorable":"mc:Ignorable"})}},m1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{paraId:"w15:paraId",paraIdParent:"w15:paraIdParent",done:"w15:done"})}},f1=class extends P{constructor(e){super("w15:commentEx"),this.root.push(new m1({paraId:e.paraId,paraIdParent:e.parentParaId,done:e.done!==void 0?e.done?"1":"0":void 0}))}},g1=class extends P{constructor(e){super("w15:commentsEx"),this.root.push(new h1({"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","mc:Ignorable":"w15"}));for(let t of e)this.root.push(new f1(t))}},b1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{paraId:"w16cid:paraId",durableId:"w16cid:durableId"})}},v1=class extends P{constructor(e){super("w16cid:commentId"),this.root.push(new b1({paraId:e.paraId,durableId:e.durableId}))}},w1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:w16cid":"xmlns:w16cid","xmlns:mc":"xmlns:mc","mc:Ignorable":"mc:Ignorable"})}},y1=class extends P{constructor(e){super("w16cid:commentsIds"),this.root.push(new w1({"xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"w16cid"}));for(let t of e)this.root.push(new v1(t))}},x1=class extends cm{constructor(){super("w:endnoteRef")}},Xs=class extends cm{constructor(){super("w:tab")}},k1={COLUMN:"column",PAGE:"page"},T1=class extends P{constructor(e){super("w:br"),this.root.push(new _e({type:e}))}},$m=class extends qe{constructor(){super({}),this.root.push(new T1(k1.PAGE))}},S1=class extends P{constructor(){super("w:pageBreakBefore")}},Mn={AT_LEAST:"atLeast",EXACTLY:"exactly",EXACT:"exact",AUTO:"auto"},C1=({after:e,before:t,line:n,lineRule:r,beforeAutoSpacing:i,afterAutoSpacing:s})=>new L({name:"w:spacing",attributes:{after:{key:"w:after",value:e},before:{key:"w:before",value:t},line:{key:"w:line",value:n},lineRule:{key:"w:lineRule",value:r},beforeAutoSpacing:{key:"w:beforeAutospacing",value:i},afterAutoSpacing:{key:"w:afterAutospacing",value:s}}}),Ys={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"},Nr=e=>new L({name:"w:pStyle",attributes:{val:{key:"w:val",value:e}}}),rh={LEFT:"left",RIGHT:"right",CENTER:"center",BAR:"bar",CLEAR:"clear",DECIMAL:"decimal",END:"end",NUM:"num",START:"start"},E1={DOT:"dot",HYPHEN:"hyphen",MIDDLE_DOT:"middleDot",NONE:"none",UNDERSCORE:"underscore"},A1=({type:e,position:t,leader:n})=>new L({name:"w:tab",attributes:{val:{key:"w:val",value:e},pos:{key:"w:pos",value:at(t)},leader:{key:"w:leader",value:n}}}),_1=e=>new L({name:"w:tabs",children:e.map(t=>A1(t))}),Ts=class extends P{constructor(e,t){super("w:numPr"),this.root.push(new N1(t)),this.root.push(new P1(e))}},N1=class extends P{constructor(e){if(super("w:ilvl"),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new _e({val:e}))}},P1=class extends P{constructor(e){super("w:numId"),this.root.push(new _e({val:typeof e=="string"?`{${e}}`:e}))}},hc=class extends P{constructor(...e){super(...e),E(this,"fileChild",Symbol())}},I1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}},mc=class extends P{constructor(e,t,n,r){super("w:hyperlink"),E(this,"linkId",void 0),E(this,"drawingLink",void 0),this.linkId=t,this.drawingLink=n&&r!==void 0?new kk(r):void 0;let i=new I1({history:1,anchor:n||void 0,id:!n||r!==void 0?`rId${this.linkId}`:void 0});this.root.push(i),e.forEach(s=>{this.root.push(s)})}createDrawingClick(e,t){return this.drawingLink?(this.drawingLink.addRelationship(e),this.drawingLink.createClick(t)):ym(this.linkId,t)}},Fm=class extends mc{constructor(e){super(e.children,$n(),e.anchor)}},O1=class extends P{constructor(e){super("w:externalHyperlink"),E(this,"options",void 0),this.options=e}},R1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",name:"w:name"})}},L1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id"})}},qm=class Hm{constructor(t){E(this,"start",void 0),E(this,"children",void 0),E(this,"end",void 0);let n=gm();this.start=new Um(t.id,n),this.children=t.children,this.end=new jm(n)}get writtenAs(){return[this.start,...this.children.flatMap(t=>t instanceof Hm?t.writtenAs:[t]),this.end]}},Um=class extends P{constructor(e,t){super("w:bookmarkStart");let n=new R1({name:e,id:t});this.root.push(n)}},jm=class extends P{constructor(e){super("w:bookmarkEnd");let t=new L1({id:e});this.root.push(t)}},M1=e=>new L({name:"w:outlineLvl",attributes:{val:{key:"w:val",value:e}}}),D1=class extends P{constructor(e,t={}){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE}));let n=`PAGEREF ${e}`;t.hyperlink&&(n=`${n} \\h`),t.useRelativePosition&&(n=`${n} \\p`),this.root.push(n)}},B1=class extends qe{constructor(e,t={}){super({children:[fm(),new D1(e,t),sn(),an()]})}},$1=255,Wm=e=>{let t=e.indexOf("#"),n=e.length-t-1;return t>0&&n>0&&n<=$1?{target:e.slice(0,t),anchor:e.slice(t+1)}:{target:e}},Bs=(e,t,n)=>n===void 0?`${e}-${t}`:`${e}-restart ${n}`,Ss=({id:e,fontKey:t,subsetted:n},r)=>new L({name:r,attributes:k({id:{key:"r:id",value:e}},t?{fontKey:{key:"w:fontKey",value:`{${t.toUpperCase()}}`}}:{}),children:[...n?[new I("w:subsetted",n)]:[]]}),F1=({name:e,altName:t,panose1:n,charset:r,family:i,notTrueType:s,pitch:a,sig:o,embedRegular:c,embedBold:l,embedItalic:u,embedBoldItalic:d})=>new L({name:"w:font",attributes:{name:{key:"w:name",value:e}},children:[...t?[kr("w:altName",t)]:[],...n?[kr("w:panose1",n)]:[],...r?[kr("w:charset",r)]:[],...i?[kr("w:family",i)]:[],...s?[new I("w:notTrueType",s)]:[],...a?[kr("w:pitch",a)]:[],...o?[new L({name:"w:sig",attributes:{usb0:{key:"w:usb0",value:o.usb0},usb1:{key:"w:usb1",value:o.usb1},usb2:{key:"w:usb2",value:o.usb2},usb3:{key:"w:usb3",value:o.usb3},csb0:{key:"w:csb0",value:o.csb0},csb1:{key:"w:csb1",value:o.csb1}}})]:[],...c?[Ss(c,"w:embedRegular")]:[],...l?[Ss(l,"w:embedBold")]:[],...u?[Ss(u,"w:embedItalic")]:[],...d?[Ss(d,"w:embedBoldItalic")]:[]]}),q1=({name:e,characterSet:t,embedRegular:n,embedBold:r,embedItalic:i,embedBoldItalic:s})=>F1({name:e,sig:{usb0:"E0002AFF",usb1:"C000247B",usb2:"00000009",usb3:"00000000",csb0:"000001FF",csb1:"00000000"},charset:t,family:"auto",pitch:"variable",embedRegular:n,embedBold:r,embedItalic:i,embedBoldItalic:s}),H1=e=>new L({name:"w:fonts",attributes:{mc:{key:"xmlns:mc",value:"http://schemas.openxmlformats.org/markup-compatibility/2006"},r:{key:"xmlns:r",value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},w:{key:"xmlns:w",value:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},w14:{key:"xmlns:w14",value:"http://schemas.microsoft.com/office/word/2010/wordml"},w15:{key:"xmlns:w15",value:"http://schemas.microsoft.com/office/word/2012/wordml"},w16cex:{key:"xmlns:w16cex",value:"http://schemas.microsoft.com/office/word/2018/wordml/cex"},w16cid:{key:"xmlns:w16cid",value:"http://schemas.microsoft.com/office/word/2016/wordml/cid"},w16:{key:"xmlns:w16",value:"http://schemas.microsoft.com/office/word/2018/wordml"},w16sdtdh:{key:"xmlns:w16sdtdh",value:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"},w16se:{key:"xmlns:w16se",value:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Ignorable:{key:"mc:Ignorable",value:"w14 w15 w16se w16cid w16 w16cex w16sdtdh"}},children:e.map(q1)}),U1=[{option:"data",element:"embedRegular",bold:!1,italic:!1},{option:"bold",element:"embedBold",bold:!0,italic:!1},{option:"italic",element:"embedItalic",bold:!1,italic:!0},{option:"boldItalic",element:"embedBoldItalic",bold:!0,italic:!0}],Km=class{constructor(e){E(this,"options",void 0),E(this,"fontTable",void 0),E(this,"relationships",void 0),E(this,"fontOptionsWithKey",[]),E(this,"files",[]),this.options=e;let t=e.map(n=>U1.flatMap(({option:r,element:i,bold:s,italic:a})=>{let o=n[r];return o?[{element:i,file:{name:n.name,data:o,bold:s,italic:a,fontKey:bm()}}]:[]}));this.files=t.flatMap(n=>n.map(({file:r})=>r)),this.fontOptionsWithKey=e.map((n,r)=>k(k({},n),{},{fontKey:t[r][0].file.fontKey})),this.fontTable=H1(e.map((n,r)=>k({name:n.name,characterSet:n.characterSet},Object.fromEntries(t[r].map(({element:i,file:s})=>[i,{id:`rId${this.files.indexOf(s)+1}`,fontKey:s.fontKey}]))))),this.relationships=new be;for(let n=0;n<this.files.length;n++)this.relationships.addRelationship(n+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",`fonts/font${n+1}.odttf`)}get View(){return this.fontTable}get Relationships(){return this.relationships}},j1=()=>new L({name:"w:wordWrap",attributes:{val:{key:"w:val",value:0}}}),W1=e=>{var t,n;return new L({name:"w:framePr",attributes:{anchorLock:{key:"w:anchorLock",value:e.anchorLock},dropCap:{key:"w:dropCap",value:e.dropCap},width:{key:"w:w",value:e.width},height:{key:"w:h",value:e.height},x:{key:"w:x",value:e.position?e.position.x:void 0},y:{key:"w:y",value:e.position?e.position.y:void 0},anchorHorizontal:{key:"w:hAnchor",value:e.anchor.horizontal},anchorVertical:{key:"w:vAnchor",value:e.anchor.vertical},spaceHorizontal:{key:"w:hSpace",value:(t=e.space)===null||t===void 0?void 0:t.horizontal},spaceVertical:{key:"w:vSpace",value:(n=e.space)===null||n===void 0?void 0:n.vertical},rule:{key:"w:hRule",value:e.rule},alignmentX:{key:"w:xAlign",value:e.alignment?e.alignment.x:void 0},alignmentY:{key:"w:yAlign",value:e.alignment?e.alignment.y:void 0},lines:{key:"w:lines",value:e.lines},wrap:{key:"w:wrap",value:e.wrap}}})},al=new WeakMap,K1=Bn(),G1={left:"right",right:"left"},Dn=class extends St{constructor(e,{implicitListParagraphStyle:t=!0,inListOrder:n=!0}={}){if(super("w:pPr",e?.includeIfEmpty),E(this,"numbering",void 0),E(this,"numberProperties",void 0),!e)return this;if(e.heading&&this.push(Nr(e.heading)),t&&(e.bullet&&this.push(Nr("ListParagraph")),e.numbering&&!e.numbering.custom&&!e.style&&!e.heading&&this.push(Nr("ListParagraph"))),e.style&&this.push(Nr(e.style)),e.keepNext!==void 0&&this.push(new I("w:keepNext",e.keepNext)),e.keepLines!==void 0&&this.push(new I("w:keepLines",e.keepLines)),e.pageBreakBefore&&this.push(new S1),e.frame&&this.push(W1(e.frame)),e.widowControl!==void 0&&this.push(new I("w:widowControl",e.widowControl)),e.bullet&&this.push(new Ts(1,e.bullet.level)),e.numbering){let{reference:i,instance:s,level:a,restart:o}=e.numbering,c=typeof i=="string"?i:i.reference,l=new Ts(Bs(c,s??0),a);this.numbering={reference:c,level:a,instance:s,restartedListId:o&&n&&s===void 0?K1():void 0,definition:typeof i=="string"?void 0:i},this.numberProperties=l,this.push(l)}else e.numbering===!1&&this.push(new Ts(0,0));e.border&&this.push(new Rx(e.border)),e.thematicBreak&&this.push(new Lx),e.shading&&this.push(zs(e.shading)),e.wordWrap&&this.push(j1()),e.overflowPunctuation&&this.push(new I("w:overflowPunct",e.overflowPunctuation));let r=[...e.rightTabStop!==void 0?[{type:rh.RIGHT,position:e.rightTabStop}]:[],...e.tabStops?e.tabStops:[],...e.leftTabStop!==void 0?[{type:rh.LEFT,position:e.leftTabStop}]:[]];r.length>0&&this.push(_1(r)),e.bidirectional!==void 0&&this.push(new I("w:bidi",e.bidirectional)),e.spacing&&this.push(C1(e.spacing)),e.indent&&this.push(Mx(e.indent)),e.contextualSpacing!==void 0&&this.push(new I("w:contextualSpacing",e.contextualSpacing)),e.alignment&&this.push(dm(e.bidirectional&&G1[e.alignment]||e.alignment)),e.outlineLevel!==void 0&&this.push(M1(e.outlineLevel)),e.suppressLineNumbers!==void 0&&this.push(new I("w:suppressLineNumbers",e.suppressLineNumbers)),e.autoSpaceEastAsianText!==void 0&&this.push(new I("w:autoSpaceDN",e.autoSpaceEastAsianText)),e.run&&this.push(new vk(e.run)),e.revision&&this.push(new ih(e.revision))}push(e){this.root.push(e)}addSectionProperties(e){let t=this.root.findIndex(n=>n instanceof ih);if(t===-1){this.root.push(e);return}this.root.splice(t,0,e)}removeSectionProperties(e){let t=this.root.indexOf(e);t!==-1&&this.root.splice(t,1)}prepForXml(e){var t;if(this.numbering){var n,r;let{reference:a,level:o,instance:c=0,definition:l}=this.numbering,u=this.numbering.instance===void 0?(n=this.numbering.restartedListId)!==null&&n!==void 0?n:(r=al.get(e))===null||r===void 0?void 0:r.get(a):void 0;e.viewWrapper instanceof Km||e.file.Numbering.createConcreteNumberingInstance(a,c,l,u);let d=new Ts(Bs(a,c,u),o);this.root.splice(this.root.indexOf(this.numberProperties),1,d),this.numberProperties=d}let i=super.prepForXml(e);if(((t=this.numbering)===null||t===void 0?void 0:t.restartedListId)!==void 0){var s;al.set(e,new Map([...(s=al.get(e))!==null&&s!==void 0?s:[],[this.numbering.reference,this.numbering.restartedListId]]))}return i}},ih=class extends P{constructor(e){super("w:pPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new Dn(k(k({},e),{},{includeIfEmpty:!0}),{inListOrder:!1}))}},ne=class Gm extends hc{constructor(t){if(super("w:p"),E(this,"options",void 0),E(this,"properties",void 0),E(this,"alignment",void 0),this.options=typeof t=="string"?{text:t}:t,typeof t=="string")return this.alignment={},this.properties=new Dn({}),this.root.push(this.properties),this.root.push(new Oe(t)),this;if(this.alignment={alignment:t.alignment,bidirectional:t.bidirectional},this.properties=new Dn(t),this.root.push(this.properties),t.text&&this.root.push(new Oe(t.text)),t.children)for(let n of t.children){if(n instanceof qm){this.root.push(...n.writtenAs);continue}this.root.push(n)}}prepForXml(t){for(let n of this.root)if(Ws(n)==="w:externalHyperlink"){let r=this.root.indexOf(n),{options:i}=n,{target:s,anchor:a}=Wm(i.link),o=new mc(i.children,$n(),a,i.link);t.viewWrapper.Relationships.addRelationship(o.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",s,oc.EXTERNAL),this.root[r]=o}return super.prepForXml(t)}addSectionProperties(t){this.properties.addSectionProperties(t)}removeSectionProperties(t){this.properties.removeSectionProperties(t)}get Alignment(){return this.alignment}with(t){return new Gm(k(k({},this.options),t))}addRunToFront(t){return this.root.splice(1,0,t),this}},z1={TOP:"top",CENTER:"center",BOTTOM:"bottom"},ZP=k(k({},z1),{},{BOTH:"both"}),zm=e=>new L({name:"w:vAlign",attributes:{verticalAlign:{key:"w:val",value:e}}}),V1=({space:e,count:t,separate:n,equalWidth:r,children:i})=>new L({name:"w:cols",attributes:{space:{key:"w:space",value:e===void 0?void 0:ve(e)},count:{key:"w:num",value:t===void 0?void 0:le(t)},separate:{key:"w:sep",value:n},equalWidth:{key:"w:equalWidth",value:r}},children:!r&&i?i:void 0}),X1=({type:e,linePitch:t,charSpace:n})=>new L({name:"w:docGrid",attributes:{type:{key:"w:type",value:e},linePitch:{key:"w:linePitch",value:le(t)},charSpace:{key:"w:charSpace",value:n?le(n):void 0}}}),Ln={DEFAULT:"default",FIRST:"first",EVEN:"even"},sh={HEADER:"w:headerReference",FOOTER:"w:footerReference"},ol=(e,t)=>new L({name:e,attributes:{type:{key:"w:type",value:t.type||Ln.DEFAULT},id:{key:"r:id",value:`rId${t.id}`}}}),Y1=({countBy:e,start:t,restart:n,distance:r})=>new L({name:"w:lnNumType",attributes:{countBy:{key:"w:countBy",value:e===void 0?void 0:le(e)},start:{key:"w:start",value:t===void 0?void 0:le(t)},restart:{key:"w:restart",value:n},distance:{key:"w:distance",value:r===void 0?void 0:ve(r)}}}),Vm=({name:e,position:t,numberFormat:n,start:r,restart:i})=>new L({name:e,children:[...t===void 0?[]:[new L({name:"w:pos",attributes:{val:{key:"w:val",value:t}}})],...n?[new L({name:"w:numFmt",attributes:{val:{key:"w:val",value:n.type},format:{key:"w:format",value:n.format}}})]:[],...r===void 0?[]:[new L({name:"w:numStart",attributes:{val:{key:"w:val",value:le(r)}}})],...i===void 0?[]:[new L({name:"w:numRestart",attributes:{val:{key:"w:val",value:i}}})]]}),J1=e=>Vm(k({name:"w:footnotePr"},e)),Q1=e=>Vm(k({name:"w:endnotePr"},e)),ah=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}},Z1=class extends St{constructor(e){if(super("w:pgBorders"),!e)return this;e.pageBorders?this.root.push(new ah({display:e.pageBorders.display,offsetFrom:e.pageBorders.offsetFrom,zOrder:e.pageBorders.zOrder})):this.root.push(new ah({})),e.pageBorderTop&&this.root.push(he("w:top",e.pageBorderTop)),e.pageBorderLeft&&this.root.push(he("w:left",e.pageBorderLeft)),e.pageBorderBottom&&this.root.push(he("w:bottom",e.pageBorderBottom)),e.pageBorderRight&&this.root.push(he("w:right",e.pageBorderRight))}},eT=(e,t,n,r,i,s,a)=>new L({name:"w:pgMar",attributes:{top:{key:"w:top",value:at(e)},right:{key:"w:right",value:ve(t)},bottom:{key:"w:bottom",value:at(n)},left:{key:"w:left",value:ve(r)},header:{key:"w:header",value:ve(i)},footer:{key:"w:footer",value:ve(s)},gutter:{key:"w:gutter",value:ve(a)}}}),tT={HYPHEN:"hyphen",PERIOD:"period",COLON:"colon",EM_DASH:"emDash",EN_DASH:"endash"},nT=({start:e,formatType:t,separator:n,chapterHeadingLevel:r})=>new L({name:"w:pgNumType",attributes:{start:{key:"w:start",value:e===void 0?void 0:le(e)},formatType:{key:"w:fmt",value:t},separator:{key:"w:chapSep",value:n===tT.EN_DASH?"enDash":n},chapterHeadingLevel:{key:"w:chapStyle",value:r===void 0?void 0:le(r)}}}),$s={PORTRAIT:"portrait",LANDSCAPE:"landscape"},rT=({width:e,height:t,orientation:n,code:r})=>{let i=ve(e),s=ve(t);return new L({name:"w:pgSz",attributes:{width:{key:"w:w",value:n===$s.LANDSCAPE?s:i},height:{key:"w:h",value:n===$s.LANDSCAPE?i:s},orientation:{key:"w:orient",value:n},code:{key:"w:code",value:r}}})},iT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},sT=class extends P{constructor(e){super("w:textDirection"),this.root.push(new iT({val:e}))}},aT=e=>new L({name:"w:type",attributes:{val:{key:"w:val",value:e}}}),it={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},Ns={WIDTH:11906,HEIGHT:16838,ORIENTATION:$s.PORTRAIT},Rl=class Xm extends P{constructor({page:{size:{width:t=Ns.WIDTH,height:n=Ns.HEIGHT,orientation:r=Ns.ORIENTATION,code:i}={},margin:{top:s=it.TOP,right:a=it.RIGHT,bottom:o=it.BOTTOM,left:c=it.LEFT,header:l=it.HEADER,footer:u=it.FOOTER,gutter:d=it.GUTTER}={},pageNumbers:p={},borders:h,textDirection:f}={},grid:{linePitch:m=360,charSpace:g,type:y}={},headerWrapperGroup:T={},footerWrapperGroup:b={},lineNumbers:C,titlePage:_,verticalAlign:w,column:x,type:v,footnoteProperties:A,endnoteProperties:N,revision:M}={}){super("w:sectPr"),E(this,"availableTextWidth",void 0),this.availableTextWidth=Xm.calculateAvailableTextWidth({pageWidth:r===$s.LANDSCAPE?n:t,left:c,right:a,gutter:d,column:x}),this.addHeaderFooterGroup(sh.HEADER,T),this.addHeaderFooterGroup(sh.FOOTER,b),A&&this.root.push(J1(A)),N&&this.root.push(Q1(N)),v&&this.root.push(aT(v)),this.root.push(rT({width:t,height:n,orientation:r,code:i})),this.root.push(eT(s,a,o,c,l,u,d)),h&&this.root.push(new Z1(h)),C&&this.root.push(Y1(C)),this.root.push(nT(p)),x&&this.root.push(V1(x)),w&&this.root.push(zm(w)),_!==void 0&&this.root.push(new I("w:titlePg",_)),f&&this.root.push(new sT(f)),this.root.push(X1({linePitch:m,charSpace:g,type:y})),M&&this.root.push(new oT(M))}get AvailableTextWidth(){return this.availableTextWidth}static calculateAvailableTextWidth({pageWidth:t,left:n,right:r,gutter:i,column:s}){var a,o;let c=qt(t)-qt(n)-qt(r)-qt(i),l=(a=s?.count)!==null&&a!==void 0?a:1;return l<=1?c:(c-qt((o=s?.space)!==null&&o!==void 0?o:720)*(l-1))/l}addHeaderFooterGroup(t,n){n.default&&this.root.push(ol(t,{type:Ln.DEFAULT,id:n.default.View.ReferenceId})),n.first&&this.root.push(ol(t,{type:Ln.FIRST,id:n.first.View.ReferenceId})),n.even&&this.root.push(ol(t,{type:Ln.EVEN,id:n.even.View.ReferenceId}))}},oT=class extends P{constructor(e){super("w:sectPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new Rl(e))}},Ym=class extends P{constructor({pageNumbers:e}={}){super("w:body"),E(this,"sections",[]),E(this,"sectionParagraphs",new Map),E(this,"headingBookmarkIds",new Fk),E(this,"pageNumbers",void 0),this.pageNumbers=e}getSectionPropertiesFor(e){let t=e?Math.max(this.root.indexOf(e),0):0;for(let n=t;n<this.root.length;n++){let r=this.root[n];if(r instanceof Rl)return r;let i=this.sectionParagraphs.get(r);if(i)return i}return this.sections[this.sections.length-1]}addSection(e){let t=this.sections.pop(),n=this.lastParagraphOfSection();if(t&&n)this.sectionParagraphs.set(n,t);else{let r=this.createSectionParagraph();this.root.push(r),t&&this.sectionParagraphs.set(r,t)}this.sections.push(new Rl(e))}prepForXml(e){var t;this.sections.length===1&&(this.root.splice(0,1),this.root.push(this.sections.pop()));for(let[i,s]of this.sectionParagraphs)i.addSectionProperties(s);let n;try{n=super.prepForXml(e)}finally{for(let[i,s]of this.sectionParagraphs)i.removeSectionProperties(s)}let r=(t=this.pageNumbers)===null||t===void 0?void 0:t.listNumbers;return e1(n,e,this.headingBookmarkIds,r&&(i=>r(i,e))),this.pageNumbers&&(a1(n,e),o1(n,e,this.pageNumbers)),n}push(e){let t=e instanceof ne?this.sectionParagraphs.get(e):void 0;if(t){let n=this.createSectionParagraph();this.root.splice(this.root.indexOf(e)+1,0,n),this.sectionParagraphs.delete(e),this.sectionParagraphs.set(n,t)}this.root.push(e)}lastParagraphOfSection(){let e=this.root[this.root.length-1];return e instanceof ne&&e!==this.root[0]&&!this.sectionParagraphs.has(e)&&this.root.indexOf(e)===this.root.length-1?e:void 0}createSectionParagraph(){return new ne({})}},Fe={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"},$r=(e,{type:t=Fe.AUTO,size:n})=>{let r=n;return t===Fe.PERCENTAGE&&typeof n=="number"&&(r=Math.round(n*50)),new L({name:e,attributes:{type:{key:"w:type",value:t},size:{key:"w:w",value:lm(r)}}})},Ps=Ns.WIDTH-it.LEFT-it.RIGHT-it.GUTTER,Jm=e=>e.options.columnSpan||1,fc=(e,t)=>{if(!e)return;let{type:n=Fe.AUTO,size:r}=e;if(n!==Fe.PERCENTAGE&&n!==Fe.DXA)return;let i=typeof r=="number"?n===Fe.PERCENTAGE?r/100*t:r:r.endsWith("%")?Number(r.slice(0,-1))/100*t:qt(r);return i>0?i:void 0},lT=(e,t)=>{var n;return(n=fc(e,t))!==null&&n!==void 0?n:t},cT=e=>Math.max(0,...e.map(t=>t.cells.reduce((n,r)=>n+Jm(r),0))),oh=({rows:e,width:t,availableWidth:n})=>{let r=cT(e);if(r===0)return[];let i=lT(t,n),s=Array.from({length:r},()=>{}),a=[];for(let u of e){let d=0;for(let p of u.cells){let h=Jm(p),f=fc(p.options.width,i);if(f!==void 0)if(h===1){var o,c;(c=s[o=d])!==null&&c!==void 0||(s[o]=f)}else a.push({start:d,span:h,width:f});d+=h}}for(let{start:u,span:d,width:p}of a){let h=Array.from({length:d},(g,y)=>u+y).filter(g=>g<r),f=h.filter(g=>s[g]===void 0),m=p-h.reduce((g,y)=>{var T;return g+((T=s[y])!==null&&T!==void 0?T:0)},0);if(f.length>0&&m>0)for(let g of f)s[g]=m/f.length}let l=s.flatMap((u,d)=>u===void 0?[d]:[]);if(l.length>0){let u=i-s.reduce((p,h)=>p+(h??0),0),d=u>0?u/l.length:i/r;for(let p of l)s[p]=d}return s.map(u=>Math.round(u))},dT=e=>new L({name:"w:gridCol",attributes:e!==void 0?{width:{key:"w:w",value:ve(e)}}:void 0}),Is=class extends P{constructor(e,t){super("w:tblGrid");for(let n of e)this.root.push(dT(n));t&&this.root.push(new uT(t))}},pT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id"})}},uT=class extends P{constructor(e){super("w:tblGridChange"),this.root.push(new pT({id:e.id})),this.root.push(new Is(e.columnWidths))}},hT=class extends P{constructor(e){super("w:ins"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},mT=class extends P{constructor(e){super("w:del"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},fT=class extends P{constructor(e){super("w:cellIns"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},gT=class extends P{constructor(e){super("w:cellDel"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},bT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date",verticalMerge:"w:vMerge",verticalMergeOriginal:"w:vMergeOrig"})}},vT=class extends P{constructor(e){super("w:cellMerge"),this.root.push(new bT(e))}},Qm=({marginUnitType:e=Fe.DXA,top:t,left:n,bottom:r,right:i})=>[{name:"w:top",size:t},{name:"w:left",size:n},{name:"w:bottom",size:r},{name:"w:right",size:i}].filter(s=>s.size!==void 0).map(({name:s,size:a})=>$r(s,{type:e,size:a})),wT=e=>{let t=Qm(e);if(t.length!==0)return new L({name:"w:tblCellMar",children:t})},yT=e=>{let t=Qm(e);if(t.length!==0)return new L({name:"w:tcMar",children:t})},xT=class extends St{constructor(e){super("w:tcBorders"),e.top&&this.root.push(he("w:top",e.top)),e.start&&this.root.push(he("w:start",e.start)),e.left&&this.root.push(he("w:left",e.left)),e.bottom&&this.root.push(he("w:bottom",e.bottom)),e.end&&this.root.push(he("w:end",e.end)),e.right&&this.root.push(he("w:right",e.right)),e.diagonalDown&&this.root.push(he("w:tl2br",e.diagonalDown)),e.diagonalUp&&this.root.push(he("w:tr2bl",e.diagonalUp))}},kT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},TT=class extends P{constructor(e){super("w:gridSpan"),this.root.push(new kT({val:le(e)}))}},Zm={CONTINUE:"continue",RESTART:"restart"},ST=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},lh=class extends P{constructor(e){super("w:vMerge"),this.root.push(new ST({val:e}))}},CT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},ET=class extends P{constructor(e){super("w:textDirection"),this.root.push(new CT({val:e}))}},ef=class extends St{constructor(e){if(super("w:tcPr",e.includeIfEmpty),E(this,"hasWidth",void 0),E(this,"hasColumnWidth",!1),this.hasWidth=e.width!==void 0,e.width&&this.root.push($r("w:tcW",e.width)),e.columnSpan&&this.root.push(new TT(e.columnSpan)),e.verticalMerge?this.root.push(new lh(e.verticalMerge)):e.rowSpan&&e.rowSpan>1&&this.root.push(new lh(Zm.RESTART)),e.borders&&this.root.push(new xT(e.borders)),e.shading&&this.root.push(zs(e.shading)),e.margins){let t=yT(e.margins);t&&this.root.push(t)}e.textDirection&&this.root.push(new ET(e.textDirection)),e.verticalAlign&&this.root.push(zm(e.verticalAlign)),e.insertion&&this.root.push(new fT(e.insertion)),e.deletion&&this.root.push(new gT(e.deletion)),e.cellMerge&&this.root.push(new vT(e.cellMerge)),e.revision&&this.root.push(new AT(e.revision))}setColumnWidth(e){this.hasWidth||(this.root.splice(0,this.hasColumnWidth?1:0,$r("w:tcW",{size:e,type:Fe.DXA})),this.hasColumnWidth=!0)}},AT=class extends P{constructor(e){super("w:tcPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new ef(k(k({},e),{},{includeIfEmpty:!0})))}},Fr=class extends P{constructor(e){super("w:tc"),E(this,"options",void 0),E(this,"properties",void 0),this.options=e,this.properties=new ef(e),this.root.push(this.properties);for(let t of e.children)this.root.push(t)}setColumnWidth(e){this.properties.setColumnWidth(e)}prepForXml(e){return Ws(this.root[this.root.length-1])!=="w:p"&&this.root.push(new ne({})),super.prepForXml(e)}},Ll=(e,t)=>t?new I(e):new ot(e,"off"),In={style:Gr.NONE,size:0,color:"auto"},_T={style:Gr.SINGLE,size:4,color:"auto"},tf=class extends St{constructor(e,{fillMissingSides:t=!0}={}){super("w:tblBorders");let n=[["w:top",e.top],["w:left",e.left],["w:bottom",e.bottom],["w:right",e.right],["w:insideH",e.insideHorizontal],["w:insideV",e.insideVertical]];for(let[r,i]of n){let s=i??(t?_T:void 0);s&&this.root.push(he(r,s))}}};E(tf,"NONE",{top:In,bottom:In,left:In,right:In,insideHorizontal:In,insideVertical:In});ll={CENTER:"center",INSIDE:"inside",LEFT:"left",OUTSIDE:"outside",RIGHT:"right"},NT={CENTER:"center",INSIDE:"inside",BOTTOM:"bottom",OUTSIDE:"outside",INLINE:"inline",TOP:"top"},PT=({horizontalAnchor:e,verticalAnchor:t,absoluteHorizontalPosition:n,relativeHorizontalPosition:r,absoluteVerticalPosition:i,relativeVerticalPosition:s,bottomFromText:a,topFromText:o,leftFromText:c,rightFromText:l})=>new L({name:"w:tblpPr",attributes:{leftFromText:{key:"w:leftFromText",value:c===void 0?void 0:ve(c)},rightFromText:{key:"w:rightFromText",value:l===void 0?void 0:ve(l)},topFromText:{key:"w:topFromText",value:o===void 0?void 0:ve(o)},bottomFromText:{key:"w:bottomFromText",value:a===void 0?void 0:ve(a)},absoluteHorizontalPosition:{key:"w:tblpX",value:n===void 0?void 0:at(n)},absoluteVerticalPosition:{key:"w:tblpY",value:i===void 0?void 0:at(i)},horizontalAnchor:{key:"w:horzAnchor",value:e},relativeHorizontalPosition:{key:"w:tblpXSpec",value:r},relativeVerticalPosition:{key:"w:tblpYSpec",value:s},verticalAnchor:{key:"w:vertAnchor",value:t}}}),IT=e=>new L({name:"w:tblLayout",attributes:{type:{key:"w:type",value:e}}}),OT={DXA:"dxa",NIL:"nil"},nf=({type:e=OT.DXA,value:t})=>new L({name:"w:tblCellSpacing",attributes:{type:{key:"w:type",value:e},value:{key:"w:w",value:lm(t)}}}),RT=({firstRow:e,lastRow:t,firstColumn:n,lastColumn:r,noHBand:i,noVBand:s})=>new L({name:"w:tblLook",attributes:{firstRow:{key:"w:firstRow",value:e},lastRow:{key:"w:lastRow",value:t},firstColumn:{key:"w:firstColumn",value:n},lastColumn:{key:"w:lastColumn",value:r},noHBand:{key:"w:noHBand",value:i},noVBand:{key:"w:noVBand",value:s}}}),LT=e=>new L({name:"w:tblOverlap",attributes:{val:{key:"w:val",value:e}}}),MT={[ll.LEFT]:ue.LEFT,[ll.CENTER]:ue.CENTER,[ll.RIGHT]:ue.RIGHT},gc=class extends St{constructor(e){var t,n,r;super("w:tblPr",e.includeIfEmpty),e.style&&this.root.push(new ot("w:tblStyle",e.style));let i=((t=e.float)===null||t===void 0?void 0:t.relativeVerticalPosition)===NT.INLINE,s=i?void 0:e.float;s&&this.root.push(PT(s)),s?.overlap&&this.root.push(LT(s.overlap)),e.visuallyRightToLeft!==void 0&&this.root.push(Ll("w:bidiVisual",e.visuallyRightToLeft)),e.width&&this.root.push($r("w:tblW",e.width));let a=(n=e.alignment)!==null&&n!==void 0?n:i&&(!((r=e.float)===null||r===void 0)&&r.relativeHorizontalPosition)?MT[e.float.relativeHorizontalPosition]:void 0;if(a&&this.root.push(dm(a)),e.cellSpacing&&this.root.push(nf(e.cellSpacing)),e.indent&&this.root.push($r("w:tblInd",e.indent)),e.borders&&this.root.push(new tf(e.borders,{fillMissingSides:!e.style})),e.shading&&this.root.push(zs(e.shading)),e.layout&&this.root.push(IT(e.layout)),e.cellMargin){let o=wT(e.cellMargin);o&&this.root.push(o)}e.tableLook&&this.root.push(RT(e.tableLook)),e.revision&&this.root.push(new DT(e.revision))}},DT=class extends P{constructor(e){super("w:tblPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new gc(k(k({},e),{},{includeIfEmpty:!0})))}},BT=(e,t)=>new L({name:"w:trHeight",attributes:{value:{key:"w:val",value:ve(e)},rule:{key:"w:hRule",value:t}}}),rf=class extends St{constructor(e){super("w:trPr",e.includeIfEmpty),e.cantSplit!==void 0&&this.root.push(Ll("w:cantSplit",e.cantSplit)),e.tableHeader!==void 0&&this.root.push(Ll("w:tblHeader",e.tableHeader)),e.height&&this.root.push(BT(e.height.value,e.height.rule)),e.cellSpacing&&this.root.push(nf(e.cellSpacing)),e.insertion&&this.root.push(new hT(e.insertion)),e.deletion&&this.root.push(new mT(e.deletion)),e.revision&&this.root.push(new $T(e.revision))}},$T=class extends P{constructor(e){super("w:trPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new rf(k(k({},e),{},{includeIfEmpty:!0})))}},Fs=(e,t)=>{let n=e[t];return Array.isArray(n)?n:[]},Ir=e=>Object.keys(e)[0],FT=(e,t)=>{let n=Fs(e,"w:p"),r=n.find(o=>Ir(o)==="w:pPr");if(!r)return{"w:p":[{"w:pPr":[t]},...n]};let i=Fs(r,"w:pPr");if(i.some(o=>Ir(o)==="w:keepNext"))return e;let s=i.filter(o=>Ir(o)==="w:pStyle").length,a={"w:pPr":[...i.slice(0,s),t,...i.slice(s)]};return{"w:p":n.map(o=>o===r?a:o)}},Js=class extends P{constructor(e){super("w:tr"),E(this,"options",void 0),this.options=e,this.root.push(new rf(e));for(let t of e.children)this.root.push(t)}prepForXml(e){if(this.cells.length===0)return;let t=super.prepForXml(e);if(!t||this.options.keepNext===void 0)return t;let n=new I("w:keepNext",this.options.keepNext).prepForXml(e);return{"w:tr":Fs(t,"w:tr").map(r=>Ir(r)==="w:tc"?{"w:tc":Fs(r,"w:tc").map(i=>Ir(i)==="w:p"?FT(i,n):i)}:r)}}get CellCount(){return this.options.children.length}get cells(){return this.root.filter(e=>Ws(e)==="w:tc")}addCellToIndex(e,t){this.root.splice(t+1,0,e)}addCellToColumnIndex(e,t){let n=this.columnIndexToRootIndex(t,!0);this.addCellToIndex(e,n-1)}rootIndexToColumnIndex(e){if(e<1||e>=this.root.length)throw new Error(`cell 'rootIndex' should between 1 to ${this.root.length-1}`);let t=0;for(let n=1;n<e;n++){let r=this.root[n];t+=r.options.columnSpan||1}return t}columnIndexToRootIndex(e,t=!1){if(e<0)throw new Error("cell 'columnIndex' should not less than zero");let n=0,r=1;for(;n<=e;){if(r>=this.root.length){if(t)return this.root.length;throw new Error(`cell 'columnIndex' should not great than ${n-1}`)}let i=this.root[r];r+=1,n+=i&&i.options.columnSpan||1}return r-1}},sf=class af extends hc{constructor({rows:t,width:n,columnWidths:r,columnWidthsRevision:i,margins:s,indent:a,float:o,layout:c,style:l,borders:u,alignment:d,visuallyRightToLeft:p,tableLook:h,cellSpacing:f,revision:m}){super("w:tbl"),E(this,"rows",void 0),E(this,"width",void 0),E(this,"columnWidths",void 0),E(this,"columnWidthsRevision",void 0),E(this,"resolvedColumnWidths",void 0),this.rows=t,this.width=n??{size:100},this.columnWidths=r,this.columnWidthsRevision=i,t.forEach((g,y)=>{if(y===t.length-1)return;let T=0;g.cells.forEach(b=>{if(b.options.rowSpan&&b.options.rowSpan>1){let C=b.options.children[b.options.children.length-1],_=new Fr({rowSpan:b.options.rowSpan-1,columnSpan:b.options.columnSpan,width:b.options.width,borders:b.options.borders,shading:b.options.shading,margins:b.options.margins,textDirection:b.options.textDirection,verticalAlign:b.options.verticalAlign,children:C instanceof ne?[new ne(C.Alignment)]:[],verticalMerge:Zm.CONTINUE});t[y+1].addCellToColumnIndex(_,T)}T+=b.options.columnSpan||1})}),this.setCellWidths(Ps),this.resolvedColumnWidths=r??oh({rows:t,width:this.width,availableWidth:Ps}),this.root.push(new gc({borders:l?u:u??{},width:this.width,indent:a,float:o,layout:c,style:l,alignment:d,cellMargin:s,visuallyRightToLeft:p,tableLook:h,cellSpacing:f,revision:m})),this.root.push(new Is(this.resolvedColumnWidths,i));for(let g of t)this.root.push(g)}get ColumnWidths(){return this.resolvedColumnWidths}getCellWidth(t,n){let{cells:r}=t,i=r.indexOf(n);if(i===-1)return;let s=r.slice(0,i).reduce((o,c)=>o+(c.options.columnSpan||1),0),a=this.resolvedColumnWidths.slice(s,s+(n.options.columnSpan||1));return a.length===0?void 0:a.reduce((o,c)=>o+c,0)}prepForXml(t){if(this.setCellWidths(this.resolveAvailableWidth(t)),this.columnWidths===void 0){this.resolvedColumnWidths=oh({rows:this.rows,width:this.width,availableWidth:this.resolveAvailableWidth(t)});let n=this.root.findIndex(r=>r instanceof Is);this.root[n]=new Is(this.resolvedColumnWidths,this.columnWidthsRevision)}return super.prepForXml(t)}setCellWidths(t){var n;if(this.columnWidths===void 0)return;let r=this.columnWidths.reduce((a,o)=>a+o,0),i=(n=fc(this.width,t))!==null&&n!==void 0?n:0,s=r>0&&i>r?i/r:1;for(let a of this.rows){let o=0;for(let c of a.cells){let l=c.options.columnSpan||1,u=this.columnWidths.slice(o,o+l),d=Math.round(u.reduce((p,h)=>p+h,0)*s);u.length===l&&d>0&&c.setColumnWidth(d),o+=l}}}resolveAvailableWidth(t){var n,r,i;let{stack:s}=t,a=s[s.length-1],o=s[s.length-2],c=s[s.length-3];if(a instanceof Fr&&o instanceof Js&&c instanceof af){let p=c.getCellWidth(o,a);if(p!==void 0)return p}let l=s.findIndex(p=>p instanceof Ym),u=(n=t.file)===null||n===void 0||(n=n.Document)===null||n===void 0?void 0:n.View.Body,d=l>=0?s[l].getSectionPropertiesFor((r=s[l+1])!==null&&r!==void 0?r:this):u?.getSectionPropertiesFor();return(i=d?.AvailableTextWidth)!==null&&i!==void 0?i:Ps}},qT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},HT=class extends P{constructor(){super("Properties"),this.root.push(new qT({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}},UT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns"})}},wt=(e,t)=>new L({name:"Default",attributes:{contentType:{key:"ContentType",value:e},extension:{key:"Extension",value:t}}}),ge=(e,t)=>new L({name:"Override",attributes:{contentType:{key:"ContentType",value:e},partName:{key:"PartName",value:t}}}),jT=class extends P{constructor({macros:e=!1}={}){super("Types"),this.root.push(new UT({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(wt("image/png","png")),this.root.push(wt("image/jpeg","jpeg")),this.root.push(wt("image/jpeg","jpg")),this.root.push(wt("image/bmp","bmp")),this.root.push(wt("image/gif","gif")),this.root.push(wt("image/svg+xml","svg")),this.root.push(wt("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(wt("application/xml","xml")),this.root.push(wt("application/vnd.openxmlformats-officedocument.obfuscatedFont","odttf")),this.root.push(ge(e?"application/vnd.ms-word.document.macroEnabled.main+xml":"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","/word/document.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","/word/styles.xml")),this.root.push(ge("application/vnd.openxmlformats-package.core-properties+xml","/docProps/core.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.custom-properties+xml","/docProps/custom.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.extended-properties+xml","/docProps/app.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","/word/numbering.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","/word/footnotes.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml","/word/endnotes.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","/word/settings.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","/word/fontTable.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.theme+xml","/word/theme/theme1.xml")),e&&this.root.push(ge("application/vnd.ms-office.vbaProject","/word/vbaProject.bin"))}addComments(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","/word/comments.xml"))}addCommentsExtended(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml","/word/commentsExtended.xml"))}addCommentsIds(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml","/word/commentsIds.xml"))}addFooter(e){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",`/word/footer${e}.xml`))}addOverride(e,t){this.root.push(ge(e,t))}addHeader(e){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",`/word/header${e}.xml`))}},Ml={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",aink:"http://schemas.microsoft.com/office/drawing/2016/ink",am3d:"http://schemas.microsoft.com/office/drawing/2017/model3d",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Qs=class extends H{constructor(e,t){super(k({Ignorable:t},Object.fromEntries(e.map(n=>[n,Ml[n]])))),E(this,"xmlKeys",k({Ignorable:"mc:Ignorable"},Object.fromEntries(Object.keys(Ml).map(n=>[n,`xmlns:${n}`]))))}},WT=class extends P{constructor(e){super("cp:coreProperties"),this.root.push(new Qs(["cp","dc","dcterms","dcmitype","xsi"])),e.title&&this.root.push(new nn("dc:title",e.title)),e.subject&&this.root.push(new nn("dc:subject",e.subject)),e.creator&&this.root.push(new nn("dc:creator",e.creator)),e.keywords&&this.root.push(new nn("cp:keywords",e.keywords)),e.description&&this.root.push(new nn("dc:description",e.description)),e.lastModifiedBy&&this.root.push(new nn("cp:lastModifiedBy",e.lastModifiedBy)),e.revision&&this.root.push(new nn("cp:revision",String(e.revision))),this.root.push(new ch("dcterms:created")),this.root.push(new ch("dcterms:modified"))}},KT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"xsi:type"})}},ch=class extends P{constructor(e){super(e),this.root.push(new KT({type:"dcterms:W3CDTF"})),this.root.push(yx(new Date))}},GT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},zT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{formatId:"fmtid",pid:"pid",name:"name"})}},VT=class extends P{constructor(e,t){super("property"),this.root.push(new zT({formatId:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:e.toString(),name:t.name})),this.root.push(new XT(t.value))}},XT=class extends P{constructor(e){super("vt:lpwstr"),this.root.push(e)}},YT=class extends P{constructor(e){super("Properties"),E(this,"nextId",void 0),E(this,"properties",[]),this.root.push(new GT({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})),this.nextId=2;for(let t of e)this.addCustomProperty(t)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.properties),super.prepForXml(e)}addCustomProperty(e){this.properties.push(new VT(this.nextId++,e))}},JT=e=>new L({name:"ds:datastoreItem",attributes:{itemId:{key:"ds:itemID",value:e},namespace:{key:"xmlns:ds",value:"http://schemas.openxmlformats.org/officeDocument/2006/customXml"}},children:[new L({name:"ds:schemaRefs",children:[new L({name:"ds:schemaRef",attributes:{uri:{key:"ds:uri",value:"http://schemas.openxmlformats.org/officeDocument/2006/bibliography"}}})]})]}),QT={new:"wne:eventDocNew",open:"wne:eventDocOpen",close:"wne:eventDocClose",sync:"wne:eventDocSync",xmlAfterInsert:"wne:eventDocXmlAfterInsert",xmlBeforeDelete:"wne:eventDocXmlBeforeDelete",contentControlAfterAdd:"wne:eventDocContentControlAfterInsert",contentControlBeforeDelete:"wne:eventDocContentControlBeforeDelete",contentControlOnExit:"wne:eventDocContentControlOnExit",contentControlOnEnter:"wne:eventDocContentControlOnEnter",contentControlBeforeStoreUpdate:"wne:eventDocStoreUpdate",contentControlBeforeContentUpdate:"wne:eventDocContentControlContentUpdate",buildingBlockInsert:"wne:eventDocBuildingBlockAfterInsert"},ZT=e=>new L({name:"wne:vbaSuppData",attributes:{namespace:{key:"xmlns:wne",value:"http://schemas.microsoft.com/office/word/2006/wordml"}},children:[new L({name:"wne:docEvents",children:Object.entries(QT).filter(([t])=>e.includes(t)).map(([,t])=>new L({name:t}))})]}),eS=class extends P{constructor({color:e,themeColor:t,themeShade:n,themeTint:r}){if(super("w:background"),typeof e=="object"&&(t!==void 0||n!==void 0||r!==void 0))throw new Error("Invalid background. Expected a theme color in color, or themeColor, themeShade and themeTint, not both");this.root.push(new ic([{keys:Kr,color:e},{key:"w:themeColor",value:t},{key:"w:themeShade",value:n===void 0?void 0:Yu(n)},{key:"w:themeTint",value:r===void 0?void 0:Yu(r)}]))}},tS=class extends P{constructor(e){super("w:document"),E(this,"body",void 0),this.root.push(new Qs(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps","cx","cx1","cx2","cx3","cx4","cx5","cx6","cx7","cx8","aink","am3d","w16cex","w16cid","w16","w16sdtdh","w16se"],"w14 w15 wp14")),this.body=new Ym({pageNumbers:e.pageNumbers}),e.background&&this.root.push(new eS(e.background)),this.root.push(this.body)}add(e){return this.body.push(e),this}get Body(){return this.body}},nS=class{constructor(e){E(this,"document",void 0),E(this,"relationships",void 0),this.document=new tS(e),this.relationships=new be}get View(){return this.document}get Relationships(){return this.relationships}},rS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},of=class extends P{constructor(e,t){super("w:p"),E(this,"paragraph",void 0),E(this,"mark",void 0),this.paragraph=e,this.mark=t}prepForXml(e){let t=this.paragraph.prepForXml(e)["w:p"],n=Array.isArray(t)?t:[],r=n.length>0&&"w:pPr"in n[0]?1:0;return{"w:p":[...n.slice(0,r),this.mark.prepForXml(e),...n.slice(r)]}}},iS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",id:"w:id"})}},lf=class extends qe{constructor(){super({style:"EndnoteReference"}),this.root.push(new x1)}},dh={SEPARATOR:"separator",CONTINUATION_SEPARATOR:"continuationSeparator"},cl=class extends P{constructor(e){super("w:endnote"),this.root.push(new iS({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new of(n,new lf):n)}},sS=class extends P{constructor(){super("w:continuationSeparator")}},cf=class extends qe{constructor(){super({}),this.root.push(new sS)}},aS=class extends P{constructor(){super("w:separator")}},df=class extends qe{constructor(){super({}),this.root.push(new aS)}},pf=class extends P{constructor(){super("w:endnotes"),E(this,"ownNotes",new Map),E(this,"highestId",0),this.root.push(new rS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));let e=new cl({id:-1,type:dh.SEPARATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Mn.AUTO},children:[new df]})]});this.root.push(e);let t=new cl({id:0,type:dh.CONTINUATION_SEPARATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Mn.AUTO},children:[new cf]})]});this.root.push(t)}createEndnote(e,t){let n=new cl({id:e,children:t});this.root.push(n),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,n){if(n.viewWrapper!==n.file.Document)return;let r=this.ownNotes.get(e);if(r!==void 0)return r;let i=this.highestId+1;return this.createEndnote(i,t.children),this.ownNotes.set(e,i),i}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},oS=class{constructor(){E(this,"endnotes",void 0),E(this,"relationships",void 0),this.endnotes=new pf,this.relationships=new be}get View(){return this.endnotes}get Relationships(){return this.relationships}},lS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type"})}},cS=class extends im{constructor(e,t){super("w:ftr",t),E(this,"refId",void 0),this.refId=e,t||this.root.push(new lS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){let t=super.prepForXml(e);return zr(t,e,this.refId),t}},dS=class{constructor(e,t,n){E(this,"media",void 0),E(this,"footer",void 0),E(this,"relationships",void 0),this.media=e,this.footer=new cS(t,n),this.relationships=new be}add(e){this.footer.add(e)}addChildElement(e){this.footer.addChildElement(e)}get View(){return this.footer}get Relationships(){return this.relationships}get Media(){return this.media}},pS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",id:"w:id"})}},uS=class extends P{constructor(){super("w:footnoteRef")}},uf=class extends qe{constructor(){super({style:"FootnoteReference"}),this.root.push(new uS)}},ph={SEPERATOR:"separator",CONTINUATION_SEPERATOR:"continuationSeparator"},dl=class extends P{constructor(e){super("w:footnote"),this.root.push(new pS({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new of(n,new uf):n)}},hS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},hf=class extends P{constructor(){super("w:footnotes"),E(this,"ownNotes",new Map),E(this,"highestId",0),this.root.push(new hS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));let e=new dl({id:-1,type:ph.SEPERATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Mn.AUTO},children:[new df]})]});this.root.push(e);let t=new dl({id:0,type:ph.CONTINUATION_SEPERATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Mn.AUTO},children:[new cf]})]});this.root.push(t)}createFootNote(e,t){let n=new dl({id:e,children:t});this.root.push(n),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,n){if(n.viewWrapper!==n.file.Document)return;let r=this.ownNotes.get(e);if(r!==void 0)return r;let i=this.highestId+1;return this.createFootNote(i,t.children),this.ownNotes.set(e,i),i}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},mS=class{constructor(){E(this,"footnotess",void 0),E(this,"relationships",void 0),this.footnotess=new hf,this.relationships=new be}get View(){return this.footnotess}get Relationships(){return this.relationships}},fS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",w16cid:"xmlns:w16cid",w16se:"xmlns:w16se"})}},gS=class extends im{constructor(e,t){super("w:hdr",t),E(this,"refId",void 0),this.refId=e,t||this.root.push(new fS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){let t=super.prepForXml(e);return zr(t,e,this.refId),t}},bS=class{constructor(e,t,n){E(this,"media",void 0),E(this,"header",void 0),E(this,"relationships",void 0),this.media=e,this.header=new gS(t,n),this.relationships=new be}add(e){return this.header.add(e),this}addChildElement(e){this.header.addChildElement(e)}get View(){return this.header}get Relationships(){return this.relationships}get Media(){return this.media}},vS=()=>{let e=new Map;return t=>{var n;let r=((n=e.get(t))!==null&&n!==void 0?n:0)+1;return e.set(t,r),`media/image${r}.${t}`}},mf=class{constructor(e=vS()){E(this,"map",new Map),E(this,"takePath",void 0),this.takePath=e}addImage(e,t){if(this.map.has(e))return;let n=this.takePath(t.type);this.map.set(e,k(k({},t),{},{fileName:n.slice(n.lastIndexOf("/")+1)}))}get Array(){return Array.from(this.map.values())}get Entries(){return Array.from(this.map.entries())}},yt={DECIMAL:"decimal",UPPER_ROMAN:"upperRoman",LOWER_ROMAN:"lowerRoman",UPPER_LETTER:"upperLetter",LOWER_LETTER:"lowerLetter",ORDINAL:"ordinal",CARDINAL_TEXT:"cardinalText",ORDINAL_TEXT:"ordinalText",HEX:"hex",CHICAGO:"chicago",IDEOGRAPH__DIGITAL:"ideographDigital",JAPANESE_COUNTING:"japaneseCounting",AIUEO:"aiueo",IROHA:"iroha",DECIMAL_FULL_WIDTH:"decimalFullWidth",DECIMAL_HALF_WIDTH:"decimalHalfWidth",JAPANESE_LEGAL:"japaneseLegal",JAPANESE_DIGITAL_TEN_THOUSAND:"japaneseDigitalTenThousand",DECIMAL_ENCLOSED_CIRCLE:"decimalEnclosedCircle",DECIMAL_FULL_WIDTH2:"decimalFullWidth2",AIUEO_FULL_WIDTH:"aiueoFullWidth",IROHA_FULL_WIDTH:"irohaFullWidth",DECIMAL_ZERO:"decimalZero",BULLET:"bullet",GANADA:"ganada",CHOSUNG:"chosung",DECIMAL_ENCLOSED_FULLSTOP:"decimalEnclosedFullstop",DECIMAL_ENCLOSED_PARENTHESES:"decimalEnclosedParen",DECIMAL_ENCLOSED_CIRCLE_CHINESE:"decimalEnclosedCircleChinese",IDEOGRAPH_ENCLOSED_CIRCLE:"ideographEnclosedCircle",IDEOGRAPH_TRADITIONAL:"ideographTraditional",IDEOGRAPH_ZODIAC:"ideographZodiac",IDEOGRAPH_ZODIAC_TRADITIONAL:"ideographZodiacTraditional",TAIWANESE_COUNTING:"taiwaneseCounting",IDEOGRAPH_LEGAL_TRADITIONAL:"ideographLegalTraditional",TAIWANESE_COUNTING_THOUSAND:"taiwaneseCountingThousand",TAIWANESE_DIGITAL:"taiwaneseDigital",CHINESE_COUNTING:"chineseCounting",CHINESE_LEGAL_SIMPLIFIED:"chineseLegalSimplified",CHINESE_COUNTING_THOUSAND:"chineseCountingThousand",KOREAN_DIGITAL:"koreanDigital",KOREAN_COUNTING:"koreanCounting",KOREAN_LEGAL:"koreanLegal",KOREAN_DIGITAL2:"koreanDigital2",VIETNAMESE_COUNTING:"vietnameseCounting",RUSSIAN_LOWER:"russianLower",RUSSIAN_UPPER:"russianUpper",NONE:"none",NUMBER_IN_DASH:"numberInDash",HEBREW1:"hebrew1",HEBREW2:"hebrew2",ARABIC_ALPHA:"arabicAlpha",ARABIC_ABJAD:"arabicAbjad",HINDI_VOWELS:"hindiVowels",HINDI_CONSONANTS:"hindiConsonants",HINDI_NUMBERS:"hindiNumbers",HINDI_COUNTING:"hindiCounting",THAI_LETTERS:"thaiLetters",THAI_NUMBERS:"thaiNumbers",THAI_COUNTING:"thaiCounting",BAHT_TEXT:"bahtText",DOLLAR_TEXT:"dollarText",CUSTOM:"custom"},wS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{ilvl:"w:ilvl",tentative:"w:tentative"})}},yS=class extends P{constructor(e){super("w:numFmt"),this.root.push(new _e({val:e}))}},xS=class extends P{constructor(e){super("w:lvlText"),this.root.push(new _e({val:e}))}},kS=e=>{switch(e){case ue.CENTER:return"center";case ue.END:case ue.RIGHT:return"right";default:return"left"}},TS=class extends P{constructor(e){super("w:lvlJc"),this.root.push(new _e({val:kS(e)}))}},SS=class extends P{constructor(e){super("w:suff"),this.root.push(new _e({val:e}))}},CS=class extends P{constructor(){super("w:isLgl")}},ES=class extends P{constructor({level:e,format:t,text:n,alignment:r=ue.START,start:i=1,style:s,suffix:a,isLegalNumberingStyle:o}){if(super("w:lvl"),E(this,"paragraphProperties",void 0),E(this,"runProperties",void 0),this.root.push(new Pr("w:start",le(i))),t&&this.root.push(new yS(t)),s?.style&&this.root.push(Nr(s.style)),o&&this.root.push(new CS),a&&this.root.push(new SS(a)),n&&this.root.push(new xS(n)),this.root.push(new TS(r)),this.paragraphProperties=new Dn(s&&s.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new on(s?.run&&k(k({},s.run),{},{highlight:void 0,math:void 0,revision:void 0})),this.root.push(this.paragraphProperties),this.root.push(this.runProperties),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new wS({ilvl:le(e),tentative:1}))}},AS=class extends ES{},_S=class extends P{constructor(e){super("w:multiLevelType"),this.root.push(new _e({val:e}))}},NS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}},pl=class extends P{constructor(e,t){super("w:abstractNum"),E(this,"id",void 0),this.root.push(new NS({abstractNumId:le(e),restartNumberingAfterBreak:0})),this.root.push(new _S("hybridMultilevel")),this.id=e;for(let n of t)this.root.push(new AS(n))}},PS=class extends P{constructor(e){super("w:abstractNumId"),this.root.push(new _e({val:e}))}},IS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{numId:"w:numId"})}},uh=class extends P{constructor(e){if(super("w:num"),E(this,"numId",void 0),E(this,"reference",void 0),E(this,"instance",void 0),E(this,"restartedListId",void 0),this.numId=e.numId,this.reference=e.reference,this.instance=e.instance,this.restartedListId=e.restartedListId,this.root.push(new IS({numId:le(e.numId)})),this.root.push(new PS(le(e.abstractNumId))),e.overrideLevels&&e.overrideLevels.length)for(let t of e.overrideLevels)this.root.push(new RS(t.num,t.start))}},OS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{ilvl:"w:ilvl"})}},RS=class extends P{constructor(e,t){super("w:lvlOverride"),this.root.push(new OS({ilvl:e})),t!==void 0&&this.root.push(new MS(t))}},LS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},MS=class extends P{constructor(e){super("w:startOverride"),this.root.push(new LS({val:e}))}},ff=class extends P{constructor(e){super("w:numbering"),E(this,"abstractNumberingMap",new Map),E(this,"concreteNumberingMap",new Map),E(this,"referenceConfigMap",new Map),E(this,"abstractNumUniqueNumericId",rk()),E(this,"concreteNumUniqueNumericId",ik()),this.root.push(new Qs(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps"],"w14 w15 wp14"));let t=new pl(this.abstractNumUniqueNumericId(),[{level:0,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:Xe(.5),hanging:Xe(.25)}}}},{level:1,format:yt.BULLET,text:"\u25CB",alignment:ue.LEFT,style:{paragraph:{indent:{left:Xe(1),hanging:Xe(.25)}}}},{level:2,format:yt.BULLET,text:"\u25A0",alignment:ue.LEFT,style:{paragraph:{indent:{left:2160,hanging:Xe(.25)}}}},{level:3,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:2880,hanging:Xe(.25)}}}},{level:4,format:yt.BULLET,text:"\u25CB",alignment:ue.LEFT,style:{paragraph:{indent:{left:3600,hanging:Xe(.25)}}}},{level:5,format:yt.BULLET,text:"\u25A0",alignment:ue.LEFT,style:{paragraph:{indent:{left:4320,hanging:Xe(.25)}}}},{level:6,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:5040,hanging:Xe(.25)}}}},{level:7,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:5760,hanging:Xe(.25)}}}},{level:8,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:6480,hanging:Xe(.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new uh({numId:1,abstractNumId:t.id,reference:"default-bullet-numbering",instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set("default-bullet-numbering",t);for(let n of e.config)this.abstractNumberingMap.set(n.reference,new pl(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.abstractNumberingMap.values(),...this.concreteNumberingMap.values()),super.prepForXml(e)}createConcreteNumberingInstance(e,t,n,r){var i;n&&!this.abstractNumberingMap.has(n.reference)&&(this.abstractNumberingMap.set(n.reference,new pl(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels));let s=this.abstractNumberingMap.get(e);if(!s)return;let a=Bs(e,t,r);if(this.concreteNumberingMap.has(a))return;let o=(i=this.referenceConfigMap.get(e))!==null&&i!==void 0?i:[{level:0}],c={numId:this.concreteNumUniqueNumericId(),abstractNumId:s.id,reference:e,instance:t,restartedListId:r,overrideLevels:o.map(({level:l,start:u=1})=>({num:l,start:le(u)}))};this.concreteNumberingMap.set(a,new uh(c))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}},gf=class{constructor(e,t=new Set){E(this,"contentTypes",void 0),E(this,"paths",new Map),E(this,"taken",void 0),E(this,"folders",new WeakMap),this.contentTypes=e,this.taken=new Set(t)}add(e){let t=this.paths.get(e);if(t!==void 0)return t;let{folder:n,name:r,extension:i,contentType:s}=e.options,a=this.takePath(n,r,i);return this.paths.set(e,a),this.contentTypes.addOverride(s,`/word/${a}`),a}takePath(e,t,n){let r=1;for(;this.taken.has(`${e}/${t}${r}.${n}`);)r++;let i=`${e}/${t}${r}.${n}`;return this.taken.add(i),i}get Array(){return[...this.paths].map(([e,t])=>({part:e,path:t}))}createRelationships(e){let t=new be;return this.folders.set(t,e.slice(0,e.indexOf("/"))),t}getTarget(e,t){let n=this.folders.get(e);return n===void 0?t:t.startsWith(`${n}/`)?t.slice(n.length+1):`../${t}`}},DS=e=>new L({name:"w:compatSetting",attributes:{version:{key:"w:val",value:e},name:{key:"w:name",value:"compatibilityMode"},uri:{key:"w:uri",value:"http://schemas.microsoft.com/office/word"}}}),BS=class extends P{constructor(e){super("w:compat"),e.useSingleBorderforContiguousCells&&this.root.push(new I("w:useSingleBorderforContiguousCells",e.useSingleBorderforContiguousCells)),e.wordPerfectJustification&&this.root.push(new I("w:wpJustification",e.wordPerfectJustification)),e.noTabStopForHangingIndent&&this.root.push(new I("w:noTabHangInd",e.noTabStopForHangingIndent)),e.noLeading&&this.root.push(new I("w:noLeading",e.noLeading)),e.spaceForUnderline&&this.root.push(new I("w:spaceForUL",e.spaceForUnderline)),e.noColumnBalance&&this.root.push(new I("w:noColumnBalance",e.noColumnBalance)),e.balanceSingleByteDoubleByteWidth&&this.root.push(new I("w:balanceSingleByteDoubleByteWidth",e.balanceSingleByteDoubleByteWidth)),e.noExtraLineSpacing&&this.root.push(new I("w:noExtraLineSpacing",e.noExtraLineSpacing)),e.doNotLeaveBackslashAlone&&this.root.push(new I("w:doNotLeaveBackslashAlone",e.doNotLeaveBackslashAlone)),e.underlineTrailingSpaces&&this.root.push(new I("w:ulTrailSpace",e.underlineTrailingSpaces)),e.doNotExpandShiftReturn&&this.root.push(new I("w:doNotExpandShiftReturn",e.doNotExpandShiftReturn)),e.spacingInWholePoints&&this.root.push(new I("w:spacingInWholePoints",e.spacingInWholePoints)),e.lineWrapLikeWord6&&this.root.push(new I("w:lineWrapLikeWord6",e.lineWrapLikeWord6)),e.printBodyTextBeforeHeader&&this.root.push(new I("w:printBodyTextBeforeHeader",e.printBodyTextBeforeHeader)),e.printColorsBlack&&this.root.push(new I("w:printColBlack",e.printColorsBlack)),e.spaceWidth&&this.root.push(new I("w:wpSpaceWidth",e.spaceWidth)),e.showBreaksInFrames&&this.root.push(new I("w:showBreaksInFrames",e.showBreaksInFrames)),e.subFontBySize&&this.root.push(new I("w:subFontBySize",e.subFontBySize)),e.suppressBottomSpacing&&this.root.push(new I("w:suppressBottomSpacing",e.suppressBottomSpacing)),e.suppressTopSpacing&&this.root.push(new I("w:suppressTopSpacing",e.suppressTopSpacing)),e.suppressSpacingAtTopOfPage&&this.root.push(new I("w:suppressSpacingAtTopOfPage",e.suppressSpacingAtTopOfPage)),e.suppressTopSpacingWP&&this.root.push(new I("w:suppressTopSpacingWP",e.suppressTopSpacingWP)),e.suppressSpBfAfterPgBrk&&this.root.push(new I("w:suppressSpBfAfterPgBrk",e.suppressSpBfAfterPgBrk)),e.swapBordersFacingPages&&this.root.push(new I("w:swapBordersFacingPages",e.swapBordersFacingPages)),e.convertMailMergeEsc&&this.root.push(new I("w:convMailMergeEsc",e.convertMailMergeEsc)),e.truncateFontHeightsLikeWP6&&this.root.push(new I("w:truncateFontHeightsLikeWP6",e.truncateFontHeightsLikeWP6)),e.macWordSmallCaps&&this.root.push(new I("w:mwSmallCaps",e.macWordSmallCaps)),e.usePrinterMetrics&&this.root.push(new I("w:usePrinterMetrics",e.usePrinterMetrics)),e.doNotSuppressParagraphBorders&&this.root.push(new I("w:doNotSuppressParagraphBorders",e.doNotSuppressParagraphBorders)),e.wrapTrailSpaces&&this.root.push(new I("w:wrapTrailSpaces",e.wrapTrailSpaces)),e.footnoteLayoutLikeWW8&&this.root.push(new I("w:footnoteLayoutLikeWW8",e.footnoteLayoutLikeWW8)),e.shapeLayoutLikeWW8&&this.root.push(new I("w:shapeLayoutLikeWW8",e.shapeLayoutLikeWW8)),e.alignTablesRowByRow&&this.root.push(new I("w:alignTablesRowByRow",e.alignTablesRowByRow)),e.forgetLastTabAlignment&&this.root.push(new I("w:forgetLastTabAlignment",e.forgetLastTabAlignment)),e.adjustLineHeightInTable&&this.root.push(new I("w:adjustLineHeightInTable",e.adjustLineHeightInTable)),e.autoSpaceLikeWord95&&this.root.push(new I("w:autoSpaceLikeWord95",e.autoSpaceLikeWord95)),e.noSpaceRaiseLower&&this.root.push(new I("w:noSpaceRaiseLower",e.noSpaceRaiseLower)),e.doNotUseHTMLParagraphAutoSpacing&&this.root.push(new I("w:doNotUseHTMLParagraphAutoSpacing",e.doNotUseHTMLParagraphAutoSpacing)),e.layoutRawTableWidth&&this.root.push(new I("w:layoutRawTableWidth",e.layoutRawTableWidth)),e.layoutTableRowsApart&&this.root.push(new I("w:layoutTableRowsApart",e.layoutTableRowsApart)),e.useWord97LineBreakRules&&this.root.push(new I("w:useWord97LineBreakRules",e.useWord97LineBreakRules)),e.doNotBreakWrappedTables&&this.root.push(new I("w:doNotBreakWrappedTables",e.doNotBreakWrappedTables)),e.doNotSnapToGridInCell&&this.root.push(new I("w:doNotSnapToGridInCell",e.doNotSnapToGridInCell)),e.selectFieldWithFirstOrLastCharacter&&this.root.push(new I("w:selectFldWithFirstOrLastChar",e.selectFieldWithFirstOrLastCharacter)),e.applyBreakingRules&&this.root.push(new I("w:applyBreakingRules",e.applyBreakingRules)),e.doNotWrapTextWithPunctuation&&this.root.push(new I("w:doNotWrapTextWithPunct",e.doNotWrapTextWithPunctuation)),e.doNotUseEastAsianBreakRules&&this.root.push(new I("w:doNotUseEastAsianBreakRules",e.doNotUseEastAsianBreakRules)),e.useWord2002TableStyleRules&&this.root.push(new I("w:useWord2002TableStyleRules",e.useWord2002TableStyleRules)),e.growAutofit&&this.root.push(new I("w:growAutofit",e.growAutofit)),e.useFELayout&&this.root.push(new I("w:useFELayout",e.useFELayout)),e.useNormalStyleForList&&this.root.push(new I("w:useNormalStyleForList",e.useNormalStyleForList)),e.doNotUseIndentAsNumberingTabStop&&this.root.push(new I("w:doNotUseIndentAsNumberingTabStop",e.doNotUseIndentAsNumberingTabStop)),e.useAlternateEastAsianLineBreakRules&&this.root.push(new I("w:useAltKinsokuLineBreakRules",e.useAlternateEastAsianLineBreakRules)),e.allowSpaceOfSameStyleInTable&&this.root.push(new I("w:allowSpaceOfSameStyleInTable",e.allowSpaceOfSameStyleInTable)),e.doNotSuppressIndentation&&this.root.push(new I("w:doNotSuppressIndentation",e.doNotSuppressIndentation)),e.doNotAutofitConstrainedTables&&this.root.push(new I("w:doNotAutofitConstrainedTables",e.doNotAutofitConstrainedTables)),e.autofitToFirstFixedWidthCell&&this.root.push(new I("w:autofitToFirstFixedWidthCell",e.autofitToFirstFixedWidthCell)),e.underlineTabInNumberingList&&this.root.push(new I("w:underlineTabInNumList",e.underlineTabInNumberingList)),e.displayHangulFixedWidth&&this.root.push(new I("w:displayHangulFixedWidth",e.displayHangulFixedWidth)),e.splitPgBreakAndParaMark&&this.root.push(new I("w:splitPgBreakAndParaMark",e.splitPgBreakAndParaMark)),e.doNotVerticallyAlignCellWithSp&&this.root.push(new I("w:doNotVertAlignCellWithSp",e.doNotVerticallyAlignCellWithSp)),e.doNotBreakConstrainedForcedTable&&this.root.push(new I("w:doNotBreakConstrainedForcedTable",e.doNotBreakConstrainedForcedTable)),e.ignoreVerticalAlignmentInTextboxes&&this.root.push(new I("w:doNotVertAlignInTxbx",e.ignoreVerticalAlignmentInTextboxes)),e.useAnsiKerningPairs&&this.root.push(new I("w:useAnsiKerningPairs",e.useAnsiKerningPairs)),e.cachedColumnBalance&&this.root.push(new I("w:cachedColBalance",e.cachedColumnBalance)),e.version&&this.root.push(DS(e.version))}},hh=1e5,mh=15,$S=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],FS=[[44796,19929,39858,10053,20106,40212,10761],[31585,63170,64933,60267,50935,40399,11199],[17763,35526,1453,2906,5812,11624,23248],[885,1770,3540,7080,14160,28320,56640],[55369,41139,20807,41614,21821,43642,17621],[28485,56970,44341,19019,38038,14605,29210],[60195,50791,40175,10751,21502,43004,24537],[18387,36774,3949,7898,15796,31592,63184],[47201,24803,49606,37805,14203,28406,56812],[17824,35648,1697,3394,6788,13576,27152],[43601,17539,35078,557,1114,2228,4456],[30388,60776,51953,34243,7079,14158,28316],[14128,28256,56512,43425,17251,34502,7597],[13105,26210,52420,35241,883,1766,3532],[4129,8258,16516,33032,4657,9314,18628]],fh=e=>e>>14&1|e<<1&32767,qS=e=>{let t=e.slice(0,mh).split("").map(i=>{let s=i.charCodeAt(0);return(s&255)!==0?s&255:s>>8&255}),n=t.reduce((i,s,a)=>FS[mh-t.length+a].reduce((o,c,l)=>s>>l&1?o^c:o,i),$S[t.length-1]),r=(fh(t.reduceRight((i,s)=>fh(i)^s,0))^t.length^52811)&65535;return[r&255,r>>8,n&255,n>>8].map(i=>i.toString(16).toUpperCase().padStart(2,"0")).join("")},HS=(e,t,n)=>{let r=[...qS(e)].flatMap(o=>[o.charCodeAt(0),0]),i=eh(Uint8Array.from([...t,...r])),s=new Uint8Array(i.length+4),a=new DataView(s.buffer);for(let o=0;o<n;o++)s.set(i),a.setUint32(i.length,o,!0),i=eh(s);return Array.from(i)},US=e=>{var t;let n=new Uint8Array(e);return typeof((t=globalThis.crypto)===null||t===void 0?void 0:t.getRandomValues)=="function"?(globalThis.crypto.getRandomValues(n),[...n]):[...n].map(()=>Math.floor(Math.random()*256))},gh=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{edit:"w:edit",enforcement:"w:enforcement",cryptProviderType:"w:cryptProviderType",cryptAlgorithmClass:"w:cryptAlgorithmClass",cryptAlgorithmType:"w:cryptAlgorithmType",cryptAlgorithmSid:"w:cryptAlgorithmSid",cryptSpinCount:"w:cryptSpinCount",hash:"w:hash",salt:"w:salt"})}},bh=e=>btoa(String.fromCharCode(...e)),jS=class extends P{constructor({type:e,password:t}){if(super("w:documentProtection"),t===void 0||t===""){this.root.push(new gh({edit:e,enforcement:!0}));return}let n=US(16);this.root.push(new gh({edit:e,enforcement:!0,cryptProviderType:"rsaAES",cryptAlgorithmClass:"hash",cryptAlgorithmType:"typeAny",cryptAlgorithmSid:12,cryptSpinCount:hh,hash:bh(HS(t,n,hh)),salt:bh(n)}))}},WS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},KS=class extends P{constructor(e){var t,n,r,i,s,a,o,c,l;super("w:settings"),this.root.push(new WS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"})),this.root.push(new I("w:displayBackgroundShape",!0)),e.embedFonts!==void 0&&this.root.push(new I("w:embedTrueTypeFonts",e.embedFonts)),e.trackRevisions!==void 0&&this.root.push(new I("w:trackRevisions",e.trackRevisions)),e.protection!==void 0&&this.root.push(new jS(e.protection)),this.root.push(new Pr("w:defaultTabStop",(t=e.defaultTabStop)!==null&&t!==void 0?t:720)),((n=e.hyphenation)===null||n===void 0?void 0:n.autoHyphenation)!==void 0&&this.root.push(new I("w:autoHyphenation",e.hyphenation.autoHyphenation)),((r=e.hyphenation)===null||r===void 0?void 0:r.consecutiveHyphenLimit)!==void 0&&this.root.push(new Pr("w:consecutiveHyphenLimit",e.hyphenation.consecutiveHyphenLimit)),((i=e.hyphenation)===null||i===void 0?void 0:i.hyphenationZone)!==void 0&&this.root.push(new Pr("w:hyphenationZone",e.hyphenation.hyphenationZone)),((s=e.hyphenation)===null||s===void 0?void 0:s.doNotHyphenateCaps)!==void 0&&this.root.push(new I("w:doNotHyphenateCaps",e.hyphenation.doNotHyphenateCaps)),e.evenAndOddHeaders!==void 0&&this.root.push(new I("w:evenAndOddHeaders",e.evenAndOddHeaders)),e.updateFields!==void 0&&this.root.push(new I("w:updateFields",e.updateFields)),this.root.push(new BS(k(k({},(a=e.compatibility)!==null&&a!==void 0?a:{}),{},{version:(o=(c=(l=e.compatibility)===null||l===void 0?void 0:l.version)!==null&&c!==void 0?c:e.compatibilityModeVersion)!==null&&o!==void 0?o:15})))}},bf=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},GS=class extends P{constructor(e){super("w:name"),this.root.push(new bf({val:e}))}},zS=class extends P{constructor(e){super("w:uiPriority"),this.root.push(new bf({val:le(e)}))}},VS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}},bc=class extends P{constructor(e,t){super("w:style"),this.root.push(new VS(e)),t.name&&this.root.push(new GS(t.name)),t.basedOn&&t.basedOn!==e.styleId&&this.root.push(new ot("w:basedOn",t.basedOn)),t.next&&this.root.push(new ot("w:next",t.next)),t.link&&this.root.push(new ot("w:link",t.link)),t.uiPriority!==void 0&&this.root.push(new zS(t.uiPriority)),t.semiHidden!==void 0&&this.root.push(new I("w:semiHidden",t.semiHidden)),t.unhideWhenUsed!==void 0&&this.root.push(new I("w:unhideWhenUsed",t.unhideWhenUsed)),t.quickFormat!==void 0&&this.root.push(new I("w:qFormat",t.quickFormat))}},Ct=class extends bc{constructor(e){super({type:"paragraph",styleId:e.id},e),E(this,"paragraphProperties",void 0),E(this,"runProperties",void 0),this.paragraphProperties=new Dn(e.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new on(e.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}},ln=class extends bc{constructor(e){super({type:"character",styleId:e.id},k({uiPriority:99,unhideWhenUsed:!0},e)),E(this,"runProperties",void 0),this.runProperties=new on(e.run),this.root.push(this.runProperties)}},Wt=class extends Ct{constructor(e){super(k({basedOn:"Normal",next:"Normal",quickFormat:!0},e))}},XS=class extends Wt{constructor(e){super(k({id:"Title",name:"Title"},e))}},YS=class extends Wt{constructor(e){super(k({id:"Heading1",name:"Heading 1"},e))}},JS=class extends Wt{constructor(e){super(k({id:"Heading2",name:"Heading 2"},e))}},QS=class extends Wt{constructor(e){super(k({id:"Heading3",name:"Heading 3"},e))}},ZS=class extends Wt{constructor(e){super(k({id:"Heading4",name:"Heading 4"},e))}},eC=class extends Wt{constructor(e){super(k({id:"Heading5",name:"Heading 5"},e))}},tC=class extends Wt{constructor(e){super(k({id:"Heading6",name:"Heading 6"},e))}},nC=class extends Wt{constructor(e){super(k({id:"Strong",name:"Strong"},e))}},rC=class extends Ct{constructor(e){super(k({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},e))}},iC=class extends Ct{constructor(e){super(k({id:"Caption",name:"caption",basedOn:"Normal",next:"Normal",uiPriority:35,semiHidden:!0,unhideWhenUsed:!0,quickFormat:!0,paragraph:{spacing:{after:200}},run:{italics:!0,color:{theme:"dark2"},size:18}},e))}},sC=class extends Ct{constructor(e){super(k({id:"Bibliography",name:"Bibliography",basedOn:"Normal",next:"Normal",uiPriority:37,unhideWhenUsed:!0},e))}},vf=new WeakSet,vh=e=>vf.has(e),xt=class extends Ct{constructor(e,t){super({id:`TOC${e}`,name:`toc ${e}`,basedOn:"Normal",next:"Normal",uiPriority:39,semiHidden:!0,unhideWhenUsed:!0,paragraph:k({spacing:{after:100}},e>1?{indent:{left:(e-1)*t}}:{})})}prepForXml(e){let t=super.prepForXml(e);return vf.add(t),t}},wf=class extends Ct{constructor(e){super(k({id:"FootnoteText",name:"footnote text",link:"FootnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:Mn.AUTO}},run:{size:20}},e))}},yf=class extends ln{constructor(e){super(k({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},xf=class extends ln{constructor(e){super(k({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},e))}},kf=class extends Ct{constructor(e){super(k({id:"EndnoteText",name:"endnote text",link:"EndnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:Mn.AUTO}},run:{size:20}},e))}},Tf=class extends ln{constructor(e){super(k({id:"EndnoteReference",name:"endnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},Sf=class extends ln{constructor(e){super(k({id:"EndnoteTextChar",name:"Endnote Text Char",basedOn:"DefaultParagraphFont",link:"EndnoteText",semiHidden:!0,run:{size:20}},e))}},aC=class extends ln{constructor(e){super(k({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:wm.SINGLE}}},e))}},oC=class extends ln{constructor(e){super(k({id:"LineNumber",name:"line number",basedOn:"DefaultParagraphFont",semiHidden:!0},e))}},lC=class extends bc{constructor(){super({type:"table",styleId:"TableNormal",default:!0},{name:"Normal Table",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0}),this.root.push(new gc({indent:{size:0,type:Fe.DXA},cellMargin:{top:0,left:108,bottom:0,right:108}}))}},Or=e=>typeof e=="object"?Object.keys(e)[0]:void 0,vc=e=>{var t;return(t=[e["w:style"]].flat().find(n=>n._attr))===null||t===void 0?void 0:t._attr},wh=e=>{var t;return(t=vc(e))===null||t===void 0?void 0:t["w:styleId"]},yh=e=>{var t;let n=(t=[e["w:style"]].flat().find(r=>Or(r)==="w:name"))===null||t===void 0||(t=t["w:name"])===null||t===void 0||(t=t._attr)===null||t===void 0?void 0:t["w:val"];return n===void 0?void 0:String(n).toLowerCase()},Dl=e=>{var t,n;return Or(e)==="w:style"&&((t=(n=vc(e))===null||n===void 0?void 0:n["w:type"])!==null&&t!==void 0?t:"paragraph")==="paragraph"},cC=e=>{let t=Dl(e)?vc(e):void 0;return t?.["w:default"]!==void 0&&!["0","false","off"].includes(String(t["w:default"]))},dC=e=>({"w:style":[e["w:style"]].flat().map(t=>t._attr?{_attr:k(k({},t._attr),{},{"w:default":"1"})}:t)}),ul=class extends P{constructor(e){if(super("w:styles"),e.initialStyles&&this.root.push(e.initialStyles),e.importedStyles)for(let t of e.importedStyles)this.root.push(t);if(e.paragraphStyles)for(let t of e.paragraphStyles)this.root.push(new Ct(t));if(e.characterStyles)for(let t of e.characterStyles)this.root.push(new ln(t))}prepForXml(e){let t=super.prepForXml(e),n=t["w:styles"];if(!Array.isArray(n))return t;let r=l=>n.filter(u=>Or(u)===l),i=n.map(l=>Or(l)==="w:style"?wh(l):void 0),s=n.filter((l,u)=>!["_attr","w:docDefaults","w:latentStyles"].includes(Or(l))&&(i[u]===void 0||i.lastIndexOf(i[u])===u)),a=new Set(s.filter(l=>Dl(l)&&!vh(l)).map(yh)),o=s.filter(l=>!vh(l)||!a.has(yh(l))),c=o.some(cC)?o:o.map(l=>Dl(l)&&wh(l)==="Normal"?dC(l):l);return{"w:styles":[...r("_attr"),...r("w:docDefaults").slice(-1),...r("w:latentStyles").slice(-1),...c]}}},pC=class extends P{constructor(e){super("w:pPrDefault"),this.root.push(new Dn(e,{implicitListParagraphStyle:!1,inListOrder:!1}))}},uC=class extends P{constructor(e){super("w:rPrDefault"),this.root.push(new on(e))}},hC=class extends P{constructor(e){super("w:docDefaults"),E(this,"runPropertiesDefaults",void 0),E(this,"paragraphPropertiesDefaults",void 0),this.runPropertiesDefaults=new uC(e.run),this.paragraphPropertiesDefaults=new pC(e.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}},mC=class{newInstance(e){let t=Wr(e),n;for(let i of t.elements||[])i.name==="w:styles"&&(n=i);if(n===void 0)throw new Error("can not find styles element");let r=n.elements||[];return{initialStyles:new mx(n.attributes),importedStyles:r.map(i=>ec(i))}}},fC=e=>{var t;let n=(t=e.document)===null||t===void 0||(t=t.run)===null||t===void 0?void 0:t.size;return n===void 0?200:Math.round(typeof n=="number"?n*10:qt(n))},gC=e=>({tableOfContents1:new xt(1,e),tableOfContents2:new xt(2,e),tableOfContents3:new xt(3,e),tableOfContents4:new xt(4,e),tableOfContents5:new xt(5,e),tableOfContents6:new xt(6,e),tableOfContents7:new xt(7,e),tableOfContents8:new xt(8,e),tableOfContents9:new xt(9,e)}),wc=(e={})=>{var t;return k(k({normal:new Ct({id:"Normal",name:"Normal",quickFormat:!0}),normalTable:new lC,document:new hC((t=e.document)!==null&&t!==void 0?t:{}),title:new XS(k({run:{size:56}},e.title)),heading1:new YS(k({run:{color:"2E74B5",size:32}},e.heading1)),heading2:new JS(k({run:{color:"2E74B5",size:26}},e.heading2)),heading3:new QS(k({run:{color:"1F4D78",size:24}},e.heading3)),heading4:new ZS(k({run:{color:"2E74B5",italics:!0}},e.heading4)),heading5:new eC(k({run:{color:"2E74B5"}},e.heading5)),heading6:new tC(k({run:{color:"1F4D78"}},e.heading6)),strong:new nC(k({run:{bold:!0}},e.strong)),listParagraph:new rC(e.listParagraph||{}),caption:new iC(e.caption||{}),bibliography:new sC(e.bibliography||{})},gC(fC(e))),{},{hyperlink:new aC(e.hyperlink||{}),footnoteReference:new yf(e.footnoteReference||{}),footnoteText:new wf(e.footnoteText||{}),footnoteTextChar:new xf(e.footnoteTextChar||{}),endnoteReference:new Tf(e.endnoteReference||{}),endnoteText:new kf(e.endnoteText||{}),endnoteTextChar:new Sf(e.endnoteTextChar||{}),lineNumber:new oC(e.lineNumber||{})})},xh=class{newInstance(e={}){return{initialStyles:new Qs(["mc","r","w","w14","w15"],"w14 w15"),importedStyles:Object.values(wc(e))}}},Cf={headings:{latin:"Calibri Light",panose:"020F0302020204030204"},body:{latin:"Calibri",panose:"020F0502020204030204"}},bC=[["Jpan","\u6E38\u30B4\u30B7\u30C3\u30AF Light","\u6E38\u660E\u671D"],["Hang","\uB9D1\uC740 \uACE0\uB515"],["Hans","\u7B49\u7EBF Light","\u7B49\u7EBF"],["Hant","\u65B0\u7D30\u660E\u9AD4"],["Arab","Times New Roman","Arial"],["Hebr","Times New Roman","Arial"],["Thai","Angsana New","Cordia New"],["Ethi","Nyala"],["Beng","Vrinda"],["Gujr","Shruti"],["Khmr","MoolBoran","DaunPenh"],["Knda","Tunga"],["Guru","Raavi"],["Cans","Euphemia"],["Cher","Plantagenet Cherokee"],["Yiii","Microsoft Yi Baiti"],["Tibt","Microsoft Himalaya"],["Thaa","MV Boli"],["Deva","Mangal"],["Telu","Gautami"],["Taml","Latha"],["Syrc","Estrangelo Edessa"],["Orya","Kalinga"],["Mlym","Kartika"],["Laoo","DokChampa"],["Sinh","Iskoola Pota"],["Mong","Mongolian Baiti"],["Viet","Times New Roman","Arial"],["Uigh","Microsoft Uighur"],["Geor","Sylfaen"],["Armn","Arial"],["Bugi","Leelawadee UI"],["Bopo","Microsoft JhengHei"],["Java","Javanese Text"],["Lisu","Segoe UI"],["Mymr","Myanmar Text"],["Nkoo","Ebrima"],["Olck","Nirmala UI"],["Osma","Ebrima"],["Phag","Phagspa"],["Syrn","Estrangelo Edessa"],["Syrj","Estrangelo Edessa"],["Syre","Estrangelo Edessa"],["Sora","Nirmala UI"],["Tale","Microsoft Tai Le"],["Talu","Microsoft New Tai Lue"],["Tfng","Ebrima"]],hl=(e,t,n)=>new L({name:e,attributes:{typeface:{key:"typeface",value:t},panose:{key:"panose",value:n}}}),vC=(e,t)=>{let n=t[e],r=typeof n=="string"?n:n?.latin;return r??Cf[e].latin},wC=(e,t={})=>{let n=bC.map(([i,s,a=s])=>{var o;return[i,(o=t[i])!==null&&o!==void 0?o:e==="headings"?s:a]}),r=new Set(n.map(([i])=>i));return[...n,...Object.entries(t).filter(([i])=>!r.has(i))]},kh=(e,t)=>{let n=t[e],{eastAsia:r="",complexScript:i="",scripts:s}=typeof n=="object"?n:{},a=vC(e,t),o=Cf[e];return new L({name:e==="headings"?"a:majorFont":"a:minorFont",children:[hl("a:latin",a,a===o.latin?o.panose:void 0),hl("a:ea",r),hl("a:cs",i),...wC(e,s).map(([c,l])=>new L({name:"a:font",attributes:{script:{key:"script",value:c},typeface:{key:"typeface",value:l}}}))]})},yC=(e,t={})=>new L({name:"a:fontScheme",attributes:{name:{key:"name",value:e}},children:[kh("headings",t),kh("body",t)]}),Ef=(e=[])=>new L({name:"a:schemeClr",attributes:{value:{key:"val",value:"phClr"}},children:e.map(([t,n])=>new L({name:`a:${t}`,attributes:{value:{key:"val",value:n}}}))}),Os=e=>new L({name:"a:solidFill",children:[Ef(e)]}),ml=e=>new L({name:"a:gradFill",attributes:{rotateWithShape:{key:"rotWithShape",value:!0}},children:[new L({name:"a:gsLst",children:e.map((t,n)=>new L({name:"a:gs",attributes:{position:{key:"pos",value:n*5e4}},children:[Ef(t)]}))}),new L({name:"a:lin",attributes:{angle:{key:"ang",value:54e5},scaled:{key:"scaled",value:!1}}})]}),fl=e=>new L({name:"a:ln",attributes:{width:{key:"w",value:e},cap:{key:"cap",value:"flat"},compound:{key:"cmpd",value:"sng"},alignment:{key:"algn",value:"ctr"}},children:[Os(),new L({name:"a:prstDash",attributes:{value:{key:"val",value:"solid"}}}),new L({name:"a:miter",attributes:{limit:{key:"lim",value:8e5}}})]}),gl=e=>new L({name:"a:effectStyle",children:[new L({name:"a:effectLst",children:e})]}),xC=()=>new L({name:"a:outerShdw",attributes:{blurRadius:{key:"blurRad",value:57150},distance:{key:"dist",value:19050},direction:{key:"dir",value:54e5},alignment:{key:"algn",value:"ctr"},rotateWithShape:{key:"rotWithShape",value:!1}},children:[new L({name:"a:srgbClr",attributes:{value:{key:"val",value:"000000"}},children:[new L({name:"a:alpha",attributes:{value:{key:"val",value:63e3}}})]})]}),kC=()=>new L({name:"a:fmtScheme",attributes:{name:{key:"name",value:"Office"}},children:[new L({name:"a:fillStyleLst",children:[Os(),ml([[["lumMod",11e4],["satMod",105e3],["tint",67e3]],[["lumMod",105e3],["satMod",103e3],["tint",73e3]],[["lumMod",105e3],["satMod",109e3],["tint",81e3]]]),ml([[["satMod",103e3],["lumMod",102e3],["tint",94e3]],[["satMod",11e4],["lumMod",1e5],["shade",1e5]],[["lumMod",99e3],["satMod",12e4],["shade",78e3]]])]}),new L({name:"a:lnStyleLst",children:[fl(6350),fl(12700),fl(19050)]}),new L({name:"a:effectStyleLst",children:[gl([]),gl([]),gl([xC()])]}),new L({name:"a:bgFillStyleLst",children:[Os(),Os([["tint",95e3],["satMod",17e4]]),ml([[["tint",93e3],["satMod",15e4],["shade",98e3],["lumMod",102e3]],[["tint",98e3],["satMod",13e4],["shade",9e4],["lumMod",103e3]],[["shade",63e3],["satMod",12e4]]])]})]}),TC=class extends P{constructor({name:e="Office Theme",colors:t,fonts:n}={}){super("a:theme"),E(this,"colors",void 0),this.colors=rc(t),this.root.push(new Jh({namespace:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"},name:{key:"name",value:e}})),this.root.push(new L({name:"a:themeElements",children:[Tx(t?e:"Office",t),yC(n?e:"Office",n),kC()]})),this.root.push(new L({name:"a:objectDefaults"})),this.root.push(new L({name:"a:extraClrSchemeLst"}))}get Colors(){return this.colors}},Qe=e=>{let t=e.lastIndexOf("/");return`${e.slice(0,t+1)}_rels/${e.slice(t+1)}.rels`},Af=e=>e.replace(/(^|\/)_rels\/([^/]*)\.rels$/,"$1$2"),_f=e=>e.slice(0,e.lastIndexOf("/")+1),cn=(e,t)=>{let n=t.replace(/\\/g,"/");return(n.startsWith("/")?n:`${_f(e)}${n}`).split("/").reduce((r,i)=>i===""||i==="."?r:i===".."?r.slice(0,-1):[...r,i],[]).join("/")},yc=(e,t)=>{let n=_f(e).split("/").filter(Boolean),r=t.split("/"),i=n.findIndex((a,o)=>o>=r.length-1||r[o]!==a),s=i===-1?n.length:i;return[...n.slice(s).map(()=>".."),...r.slice(s)].join("/")},SC=(e,t)=>e.toLowerCase()===t.toLowerCase(),oe=Uint8Array,Le=Uint16Array,xc=Int32Array,Zs=new oe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ea=new oe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bl=new oe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nf=function(e,t){for(var n=new Le(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new xc(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return{b:n,r:i}},Pf=Nf(Zs,2),If=Pf.b,$l=Pf.r;If[28]=258,$l[258]=28;Of=Nf(ea,0),CC=Of.b,Th=Of.r,Fl=new Le(32768);for(Y=0;Y<32768;++Y)kt=(Y&43690)>>1|(Y&21845)<<1,kt=(kt&52428)>>2|(kt&13107)<<2,kt=(kt&61680)>>4|(kt&3855)<<4,Fl[Y]=((kt&65280)>>8|(kt&255)<<8)>>1;lt=(function(e,t,n){for(var r=e.length,i=0,s=new Le(t);i<r;++i)e[i]&&++s[e[i]-1];var a=new Le(t);for(i=1;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var o;if(n){o=new Le(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)o[Fl[d]>>c]=l}else for(o=new Le(r),i=0;i<r;++i)e[i]&&(o[i]=Fl[a[e[i]-1]++]>>15-e[i]);return o}),jt=new oe(288);for(Y=0;Y<144;++Y)jt[Y]=8;for(Y=144;Y<256;++Y)jt[Y]=9;for(Y=256;Y<280;++Y)jt[Y]=7;for(Y=280;Y<288;++Y)jt[Y]=8;qr=new oe(32);for(Y=0;Y<32;++Y)qr[Y]=5;EC=lt(jt,9,0),AC=lt(jt,9,1),_C=lt(qr,5,0),NC=lt(qr,5,1),bl=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Ye=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},vl=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},kc=function(e){return(e+7)/8|0},Vr=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new oe(e.subarray(t,n))},PC=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ee=function(e,t,n){var r=new Error(t||PC[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Ee),!n)throw r;return r},IC=function(e,t,n,r){var i=e.length,s=r?r.length:0;if(!i||t.f&&!t.l)return n||new oe(0);var a=!n,o=a||t.i!=2,c=t.i;a&&(n=new oe(i*3));var l=function(ae){var te=n.length;if(ae>te){var Re=new oe(Math.max(te*2,ae));Re.set(n),n=Re}},u=t.f||0,d=t.p||0,p=t.b||0,h=t.l,f=t.d,m=t.m,g=t.n,y=i*8;do{if(!h){u=Ye(e,d,1);var T=Ye(e,d+1,3);if(d+=3,T)if(T==1)h=AC,f=NC,m=9,g=5;else if(T==2){var w=Ye(e,d,31)+257,x=Ye(e,d+10,15)+4,v=w+Ye(e,d+5,31)+1;d+=14;for(var A=new oe(v),N=new oe(19),M=0;M<x;++M)N[Bl[M]]=Ye(e,d+M*3,7);d+=x*3;for(var O=bl(N),F=(1<<O)-1,Q=lt(N,O,1),M=0;M<v;){var Z=Q[Ye(e,d,F)];d+=Z&15;var b=Z>>4;if(b<16)A[M++]=b;else{var V=0,G=0;for(b==16?(G=3+Ye(e,d,3),d+=2,V=A[M-1]):b==17?(G=3+Ye(e,d,7),d+=3):b==18&&(G=11+Ye(e,d,127),d+=7);G--;)A[M++]=V}}var de=A.subarray(0,w),ce=A.subarray(w);m=bl(de),g=bl(ce),h=lt(de,m,1),f=lt(ce,g,1)}else Ee(1);else{var b=kc(d)+4,C=e[b-4]|e[b-3]<<8,_=b+C;if(_>i){c&&Ee(0);break}o&&l(p+C),n.set(e.subarray(b,_),p),t.b=p+=C,t.p=d=_*8,t.f=u;continue}if(d>y){c&&Ee(0);break}}o&&l(p+131072);for(var _t=(1<<m)-1,Ae=(1<<g)-1,Ue=d;;Ue=d){var V=h[vl(e,d)&_t],we=V>>4;if(d+=V&15,d>y){c&&Ee(0);break}if(V||Ee(2),we<256)n[p++]=we;else if(we==256){Ue=d,h=null;break}else{var ye=we-254;if(we>264){var M=we-257,re=Zs[M];ye=Ye(e,d,(1<<re)-1)+If[M],d+=re}var D=f[vl(e,d)&Ae],$=D>>4;D||Ee(3),d+=D&15;var ce=CC[$];if($>3){var re=ea[$];ce+=vl(e,d)&(1<<re)-1,d+=re}if(d>y){c&&Ee(0);break}o&&l(p+131072);var q=p+ye;if(p<ce){var ie=s-ce,se=Math.min(ce,q);for(ie+p<0&&Ee(3);p<se;++p)n[p]=r[ie+p]}for(;p<q;++p)n[p]=n[p-ce]}}t.l=h,t.p=Ue,t.b=p,t.f=u,h&&(u=1,t.m=m,t.d=f,t.n=g)}while(!u);return p!=n.length&&a?Vr(n,0,p):n.subarray(0,p)},Tt=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Sr=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},wl=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return{t:Lf,l:0};if(i==1){var a=new oe(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(_,w){return _.f-w.f}),n.push({s:-1,f:25001});var o=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:o.f+c.f,l:o,r:c};u!=i-1;)o=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:o.f+c.f,l:o,r:c};for(var p=s[0].s,r=1;r<i;++r)s[r].s>p&&(p=s[r].s);var h=new Le(p+1),f=ql(n[u-1],h,0);if(f>t){var r=0,m=0,g=f-t,y=1<<g;for(s.sort(function(w,x){return h[x.s]-h[w.s]||w.f-x.f});r<i;++r){var T=s[r].s;if(h[T]>t)m+=y-(1<<f-h[T]),h[T]=t;else break}for(m>>=g;m>0;){var b=s[r].s;h[b]<t?m-=1<<t-h[b]++-1:++r}for(;r>=0&&m;--r){var C=s[r].s;h[C]==t&&(--h[C],++m)}f=t}return{t:new oe(h),l:f}},ql=function(e,t,n){return e.s==-1?Math.max(ql(e.l,t,n+1),ql(e.r,t,n+1)):t[e.s]=n},Sh=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Le(++t),r=0,i=e[0],s=1,a=function(c){n[r++]=c},o=1;o<=t;++o)if(e[o]==i&&o!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=e[o]}return{c:n.subarray(0,r),n:t}},Cr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Rf=function(e,t,n){var r=n.length,i=kc(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s<r;++s)e[i+s+4]=n[s];return(i+4+r)*8},Ch=function(e,t,n,r,i,s,a,o,c,l,u){Tt(t,u++,n),++i[256];for(var d=wl(i,15),p=d.t,h=d.l,f=wl(s,15),m=f.t,g=f.l,y=Sh(p),T=y.c,b=y.n,C=Sh(m),_=C.c,w=C.n,x=new Le(19),v=0;v<T.length;++v)++x[T[v]&31];for(var v=0;v<_.length;++v)++x[_[v]&31];for(var A=wl(x,7),N=A.t,M=A.l,O=19;O>4&&!N[Bl[O-1]];--O);var F=l+5<<3,Q=Cr(i,jt)+Cr(s,qr)+a,Z=Cr(i,p)+Cr(s,m)+a+14+3*O+Cr(x,N)+2*x[16]+3*x[17]+7*x[18];if(c>=0&&F<=Q&&F<=Z)return Rf(t,u,e.subarray(c,c+l));var V,G,de,ce;if(Tt(t,u,1+(Z<Q)),u+=2,Z<Q){V=lt(p,h,0),G=p,de=lt(m,g,0),ce=m;var _t=lt(N,M,0);Tt(t,u,b-257),Tt(t,u+5,w-1),Tt(t,u+10,O-4),u+=14;for(var v=0;v<O;++v)Tt(t,u+3*v,N[Bl[v]]);u+=3*O;for(var Ae=[T,_],Ue=0;Ue<2;++Ue)for(var we=Ae[Ue],v=0;v<we.length;++v){var ye=we[v]&31;Tt(t,u,_t[ye]),u+=N[ye],ye>15&&(Tt(t,u,we[v]>>5&127),u+=we[v]>>12)}}else V=EC,G=jt,de=_C,ce=qr;for(var v=0;v<o;++v){var re=r[v];if(re>255){var ye=re>>18&31;Sr(t,u,V[ye+257]),u+=G[ye+257],ye>7&&(Tt(t,u,re>>23&31),u+=Zs[ye]);var D=re&31;Sr(t,u,de[D]),u+=ce[D],D>3&&(Sr(t,u,re>>5&8191),u+=ea[D])}else Sr(t,u,V[re]),u+=G[re]}return Sr(t,u,V[256]),u+G[256]},OC=new xc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Lf=new oe(0),RC=function(e,t,n,r,i,s){var a=s.z||e.length,o=new oe(r+a+5*(1+Math.ceil(a/7e3))+i),c=o.subarray(r,o.length-i),l=s.l,u=(s.r||0)&7;if(t){u&&(c[0]=s.r>>3);for(var d=OC[t-1],p=d>>13,h=d&8191,f=(1<<n)-1,m=s.p||new Le(32768),g=s.h||new Le(f+1),y=Math.ceil(n/3),T=2*y,b=function(Re){return(e[Re]^e[Re+1]<<y^e[Re+2]<<T)&f},C=new xc(25e3),_=new Le(288),w=new Le(32),x=0,v=0,A=s.i||0,N=0,M=s.w||0,O=0;A+2<a;++A){var F=b(A),Q=A&32767,Z=g[F];if(m[Q]=Z,g[F]=Q,M<=A){var V=a-A;if((x>7e3||N>24576)&&(V>423||!l)){u=Ch(e,c,0,C,_,w,v,N,O,A-O,u),N=x=v=0,O=A;for(var G=0;G<286;++G)_[G]=0;for(var G=0;G<30;++G)w[G]=0}var de=2,ce=0,_t=h,Ae=Q-Z&32767;if(V>2&&F==b(A-Ae))for(var Ue=Math.min(p,V)-1,we=Math.min(32767,A),ye=Math.min(258,V);Ae<=we&&--_t&&Q!=Z;){if(e[A+de]==e[A+de-Ae]){for(var re=0;re<ye&&e[A+re]==e[A+re-Ae];++re);if(re>de){if(de=re,ce=Ae,re>Ue)break;for(var D=Math.min(Ae,re-2),$=0,G=0;G<D;++G){var q=A-Ae+G&32767,ie=q-m[q]&32767;ie>$&&($=ie,Z=q)}}}Q=Z,Z=m[Q],Ae+=Q-Z&32767}if(ce){C[N++]=268435456|$l[de]<<18|Th[ce];var se=$l[de]&31,ae=Th[ce]&31;v+=Zs[se]+ea[ae],++_[257+se],++w[ae],M=A+de,++x}else C[N++]=e[A],++_[e[A]]}}for(A=Math.max(A,M);A<a;++A)C[N++]=e[A],++_[e[A]];u=Ch(e,c,l,C,_,w,v,N,O,A-O,u),l||(s.r=u&7|c[u/8|0]<<3,u-=7,s.h=g,s.p=m,s.i=A,s.w=M)}else{for(var A=s.w||0;A<a+l;A+=65535){var te=A+65535;te>=a&&(c[u/8|0]=l,te=a),u=Rf(c,u+1,e.subarray(A,te))}s.i=a}return Vr(o,0,r+kc(u)+i)},LC=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),MC=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=LC[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},DC=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),a=new oe(s.length+e.length);a.set(s),a.set(e,s.length),e=a,i.w=s.length}return RC(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},Mf=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},st=function(e,t){return e[t]|e[t+1]<<8},Be=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},yl=function(e,t){return Be(e,t)+Be(e,t+4)*4294967296},ke=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};Df=function(e,t,n,r){for(var i in e){var s=e[i],a=t+i,o=r;Array.isArray(s)&&(o=Mf(r,s[1]),s=s[0]),ArrayBuffer.isView(s)?n[a]=[s,o]:(n[a+="/"]=[new oe(0),o],Df(s,a,n,r))}},Eh=typeof TextEncoder<"u"&&new TextEncoder,Hl=typeof TextDecoder<"u"&&new TextDecoder;try{Hl.decode(Lf,{stream:!0})}catch{}FC=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:Vr(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};HC=function(e,t){return t+30+st(e,t+26)+st(e,t+28)},UC=function(e,t,n){var r=st(e,t+28),i=st(e,t+30),s=qC(e.subarray(t+46,t+46+r),!(st(e,t+8)&2048)),a=t+46+r,o=jC(e,a,i,n,Be(e,t+20),Be(e,t+24),Be(e,t+42)),c=o[0],l=o[1],u=o[2];return[st(e,t+10),c,l,s,a+i+st(e,t+32),u]},jC=function(e,t,n,r,i,s,a){var o=i==4294967295,c=s==4294967295,l=a==4294967295,u=t+n,d=o+c+l;if(r&&d){for(;t+4<u;t+=4+st(e,t+2))if(st(e,t)==1)return[o?yl(e,t+4+8*c):i,c?yl(e,t+4):s,l?yl(e,t+4+8*(c+o)):a,1];r<2&&Ee(13)}return[i,s,a,0]},Ul=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&Ee(9),t+=r+4}return t},_h=function(e,t,n,r,i,s,a,o){var c=r.length,l=n.extra,u=o&&o.length,d=Ul(l);ke(e,t,a!=null?33639248:67324752),t+=4,a!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(s<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var p=new Date(n.mtime==null?Date.now():n.mtime),h=p.getFullYear()-1980;if((h<0||h>119)&&Ee(10),ke(e,t,h<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),t+=4,s!=-1&&(ke(e,t,n.crc),ke(e,t+4,s<0?-s-2:s),ke(e,t+8,n.size)),ke(e,t+12,c),ke(e,t+14,d),t+=16,a!=null&&(ke(e,t,u),ke(e,t+6,n.attrs),ke(e,t+10,a),t+=14),e.set(r,t),t+=c,d)for(var f in l){var m=l[f],g=m.length;ke(e,t,+f),ke(e,t+2,g),e.set(m,t+4),t+=4+g}return u&&(e.set(o,t),t+=u),t},WC=function(e,t,n,r,i){ke(e,t,101010256),ke(e,t+8,n),ke(e,t+10,n),ke(e,t+12,r),ke(e,t+16,i)};zC=e=>typeof e=="string"?ck(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e),qs=e=>KC(Object.fromEntries([...e].map(([t,n])=>[t,zC(n)]))),VC=1032,Nh=e=>new Error(`Corrupted zip: ${e} isn't the size the zip file gives it`),Bf=(e,t=()=>!0)=>{let n=new Map,r=0,i=GC(e,{filter:({name:a,size:o,originalSize:c})=>{if(a.endsWith("/")||!t(a))return!1;if(r+=o,r>e.length||c>o*VC)throw Nh(a);return n.set(a,c),!0}}),s=Object.entries(i).find(([a,o])=>o.length!==n.get(a));if(s!==void 0)throw Nh(s[0]);return new Map(Object.entries(i))},xl=e=>{let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t},Rs=e=>new Error(`${e} is not supported by this platform`),Ph={uint8array:e=>e,arraybuffer:e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),array:e=>Array.from(e),string:xl,binarystring:xl,base64:e=>btoa(xl(e)),blob:(e,t)=>{if(typeof Blob>"u")throw Rs("blob");return new Blob([e],{type:t})},nodebuffer:e=>{if(typeof Buffer>"u")throw Rs("nodebuffer");return Buffer.from(e.buffer,e.byteOffset,e.byteLength)},text:()=>{throw Rs("text")}},jl=(e,t,n)=>{let r=Object.prototype.hasOwnProperty.call(Ph,t.toLowerCase())?Ph[t.toLowerCase()]:void 0;if(r===void 0)throw Rs(t);return r(e,n)},XC=new Map([["dk1","dark1"],["lt1","light1"],["dk2","dark2"],["lt2","light2"],["accent1","accent1"],["accent2","accent2"],["accent3","accent3"],["accent4","accent4"],["accent5","accent5"],["accent6","accent6"],["hlink","hyperlink"],["folHlink","followedHyperlink"]]),YC=new Map([["dark1","windowText"],["light1","window"]]),JC=new Set(["http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","http://purl.oclc.org/ooxml/officeDocument/relationships/theme"]),Hr=e=>{var t,n;return(t=e==null||(n=e.name)===null||n===void 0?void 0:n.slice(e.name.indexOf(":")+1))!==null&&t!==void 0?t:""},Xr=e=>{var t,n;return(t=e==null||(n=e.elements)===null||n===void 0?void 0:n.filter(r=>r.type==="element"))!==null&&t!==void 0?t:[]},Wl=(e,t)=>Xr(e).find(n=>Hr(n)===t),Rr=(e,t)=>{var n;let r=e==null||(n=e.attributes)===null||n===void 0?void 0:n[t];return r===void 0?void 0:String(r)},QC=e=>new TextDecoder(e[0]===255&&e[1]===254?"utf-16le":e[0]===254&&e[1]===255?"utf-16be":"utf-8").decode(e),ZC=(e,t,n)=>{let r=e.get(Qe(t)),i=Rr(r&&Xr(Wl(Wr(QC(r)),"Relationships")).find(s=>{var a;return n.has((a=Rr(s,"Type"))!==null&&a!==void 0?a:"")}),"Target");return i===void 0?void 0:cn(t,i)},eE=(e,t)=>ZC(e,t,JC),tE=(e,t,n)=>{let[r]=Xr(t),i=Hr(r)==="srgbClr"?Rr(r,"val"):Hr(r)==="sysClr"&&(n||Rr(r,"val")!==YC.get(e))?Rr(r,"lastClr"):void 0;return i!==void 0&&/^[0-9A-Fa-f]{6}$/.test(i)?i.toUpperCase():void 0},nE=(e,t=!1)=>Object.fromEntries(Xr(e).flatMap(n=>{let r=XC.get(Hr(n)),i=r&&tE(r,n,t);return r&&i?[[r,i]]:[]})),rE=e=>{let[t]=Xr(Wr(e)),n=Hr(t)==="theme"?Wl(Wl(t,"themeElements"),"clrScheme"):void 0;return n?nE(n,!0):{}},iE=[208,207,17,224,161,177,26,225],$f=class{constructor(e){var t,n,r,i,s,a,o,c,l,u,d,p,h,f;if(E(this,"currentRelationshipId",1),E(this,"documentWrapper",void 0),E(this,"headers",[]),E(this,"footers",[]),E(this,"coreProperties",void 0),E(this,"numbering",void 0),E(this,"media",void 0),E(this,"fileRelationships",void 0),E(this,"footnotesWrapper",void 0),E(this,"endnotesWrapper",void 0),E(this,"settings",void 0),E(this,"contentTypes",void 0),E(this,"customProperties",void 0),E(this,"appProperties",void 0),E(this,"styles",void 0),E(this,"comments",void 0),E(this,"commentsExtended",void 0),E(this,"commentsIds",void 0),E(this,"fontWrapper",void 0),E(this,"theme",void 0),E(this,"packageParts",void 0),E(this,"macros",void 0),E(this,"bibliography",void 0),e.macros!==void 0){let{project:b,events:C=[]}=e.macros,_=b instanceof Uint8Array?b:new Uint8Array(b);if(!iE.every((x,v)=>_[v]===x))throw new Error("macros.project isn't a VBA project. Use createMacros from docx/macros, or the word/vbaProject.bin in a .docm rather than the .docm itself");let w=new be;C.length>0&&w.addRelationship(1,"http://schemas.microsoft.com/office/2006/relationships/wordVbaData","vbaData.xml"),this.macros={project:_,events:C.length>0?ZT(C):void 0,relationships:w}}if(this.coreProperties=new WT(k(k({},e),{},{creator:(t=e.creator)!==null&&t!==void 0?t:"Un-named",revision:(n=e.revision)!==null&&n!==void 0?n:1,lastModifiedBy:(r=e.lastModifiedBy)!==null&&r!==void 0?r:"Un-named"})),this.numbering=new ff(e.numbering?e.numbering:{config:[]}),this.comments=new u1((i=e.comments)!==null&&i!==void 0?i:{children:[]}),this.comments.ThreadData&&(this.commentsExtended=new g1(this.comments.ThreadData)),this.comments.CommentIdsData&&(this.commentsIds=new y1(this.comments.CommentIdsData)),this.fileRelationships=new be,this.customProperties=new YT((s=e.customProperties)!==null&&s!==void 0?s:[]),this.appProperties=new HT,this.footnotesWrapper=new mS,this.endnotesWrapper=new oS,this.contentTypes=new jT({macros:this.macros!==void 0}),((a=this.macros)===null||a===void 0?void 0:a.events)!==void 0&&this.contentTypes.addOverride("application/vnd.ms-word.vbaData+xml","/word/vbaData.xml"),e.bibliography!==void 0){let b=new be;b.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps","itemProps1.xml"),this.bibliography={sources:e.bibliography.sources,properties:JT(`{${bm().toUpperCase()}}`),relationships:b},this.contentTypes.addOverride("application/vnd.openxmlformats-officedocument.customXmlProperties+xml","/customXml/itemProps1.xml")}if(this.packageParts=new gf(this.contentTypes),this.documentWrapper=new nS({background:e.background,pageNumbers:e.pageNumbers}),this.settings=new KS({compatibilityModeVersion:e.compatabilityModeVersion,compatibility:e.compatibility,evenAndOddHeaders:!!e.evenAndOddHeaderAndFooters,trackRevisions:(o=e.features)===null||o===void 0?void 0:o.trackRevisions,updateFields:(c=e.features)===null||c===void 0?void 0:c.updateFields,embedFonts:!((l=e.fonts)===null||l===void 0)&&l.length?!0:void 0,defaultTabStop:e.defaultTabStop,protection:e.protection,hyphenation:{autoHyphenation:(u=e.hyphenation)===null||u===void 0?void 0:u.autoHyphenation,hyphenationZone:(d=e.hyphenation)===null||d===void 0?void 0:d.hyphenationZone,consecutiveHyphenLimit:(p=e.hyphenation)===null||p===void 0?void 0:p.consecutiveHyphenLimit,doNotHyphenateCaps:(h=e.hyphenation)===null||h===void 0?void 0:h.doNotHyphenateCaps}}),this.media=new mf(b=>this.packageParts.takePath("media","image",b)),e.externalStyles!==void 0){var m,g,y,T;let b=(m=(g=e.styles)===null||g===void 0?void 0:g.default)!==null&&m!==void 0?m:{},C=Object.entries(wc(b)),_=([x])=>b[x]!==void 0,w=new mC().newInstance(e.externalStyles);this.styles=new ul(k(k({},w),{},{paragraphStyles:(y=e.styles)===null||y===void 0?void 0:y.paragraphStyles,characterStyles:(T=e.styles)===null||T===void 0?void 0:T.characterStyles,importedStyles:[...C.filter(x=>!_(x)).map(([,x])=>x),...w.importedStyles,...C.filter(_).map(([,x])=>x)]}))}else if(e.styles){let b=new xh().newInstance(e.styles.default);this.styles=new ul(k(k({},b),e.styles))}else{let b=new xh;this.styles=new ul(b.newInstance())}this.addDefaultRelationships();for(let b of e.sections)this.addSection(b);if(e.footnotes)for(let b in e.footnotes)this.footnotesWrapper.View.createFootNote(parseFloat(b),e.footnotes[b].children);if(e.endnotes)for(let b in e.endnotes)this.endnotesWrapper.View.createEndnote(parseFloat(b),e.endnotes[b].children);this.fontWrapper=new Km((f=e.fonts)!==null&&f!==void 0?f:[]),this.theme=new TC(e.theme),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","theme/theme1.xml"),this.macros!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2006/relationships/vbaProject","vbaProject.bin"),this.bibliography!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml","../customXml/item1.xml")}addSection({headers:e={},footers:t={},children:n,properties:r}){this.documentWrapper.View.Body.addSection(k(k({},r),{},{headerWrapperGroup:{default:e.default?this.createHeader(e.default):void 0,first:e.first?this.createHeader(e.first):void 0,even:e.even?this.createHeader(e.even):void 0},footerWrapperGroup:{default:t.default?this.createFooter(t.default):void 0,first:t.first?this.createFooter(t.first):void 0,even:t.even?this.createFooter(t.even):void 0}}));for(let i of n)this.documentWrapper.View.add(i)}createHeader(e){let t=new bS(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addHeaderToDocument(t),t}createFooter(e){let t=new dS(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addFooterToDocument(t),t}addHeaderToDocument(e,t=Ln.DEFAULT){this.headers.push({header:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",`header${this.headers.length}.xml`),this.contentTypes.addHeader(this.headers.length)}addFooterToDocument(e,t=Ln.DEFAULT){this.footers.push({footer:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",`footer${this.footers.length}.xml`),this.contentTypes.addFooter(this.footers.length)}addDefaultRelationships(){this.fileRelationships.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument","word/document.xml"),this.fileRelationships.addRelationship(2,"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"),this.fileRelationships.addRelationship(3,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties","docProps/app.xml"),this.fileRelationships.addRelationship(4,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties","docProps/custom.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","styles.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering","numbering.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes","footnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes","endnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings","settings.xml"),this.comments.IsEmpty||(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments","comments.xml"),this.contentTypes.addComments()),this.commentsExtended&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2011/relationships/commentsExtended","commentsExtended.xml"),this.contentTypes.addCommentsExtended()),this.commentsIds&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds","commentsIds.xml"),this.contentTypes.addCommentsIds())}get Document(){return this.documentWrapper}get Styles(){return this.styles}get CoreProperties(){return this.coreProperties}get Numbering(){return this.numbering}get Media(){return this.media}get FileRelationships(){return this.fileRelationships}get Headers(){return this.headers.map(e=>e.header)}get Footers(){return this.footers.map(e=>e.footer)}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Endnotes(){return this.endnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get CommentsExtended(){return this.commentsExtended}get CommentsIds(){return this.commentsIds}get FontTable(){return this.fontWrapper}get Theme(){return this.theme}get PackageParts(){return this.packageParts}get Macros(){return this.macros}get Bibliography(){return this.bibliography}},sE=class extends P{constructor(e){super("w:sdtPr"),e&&this.root.push(new ot("w:alias",e))}},aE=e=>new L({name:"w:docPartObj",children:[new ot("w:docPartGallery",e),new L({name:"w:docPartUnique"})]}),oE=["contentChildren","cachedEntries","beginDirty","tabLeader"],Ff=class extends hc{constructor(e="Table of Contents",t={}){let{contentChildren:n=[],cachedEntries:r=[],beginDirty:i,tabLeader:s=E1.DOT}=t,a=Zl(t,oE);super("w:sdt"),E(this,"fromHeadings",void 0);let o=new sE(e);o.addChildElement(aE("Table of Contents")),this.root.push(o);let c=new _m,l=[new qe({children:[Nm(i),new Am(a),sn()]})],u=[new qe({children:[an()]})];if(r!==void 0&&r.length>0){let{stylesWithLevels:d}=a,p=r.map((f,m)=>{var g,y;let T=this.buildCachedContentParagraphChild(f,a),b=(g=d==null||(y=d.find(_=>_.level===f.level))===null||y===void 0?void 0:y.styleName)!==null&&g!==void 0?g:`TOC${f.level}`,C=m===0?[...l,T]:m===r.length-1?[T,...u]:[T];return new ne({style:b,tabStops:this.getTabStopsForLevel(f.level,s),children:C})}),h=p;r.length<=1&&(h=[...p,new ne({children:u})]);for(let f of h)c.addChildElement(f)}else{let d=new ne({children:l});c.addChildElement(d);for(let h of n)c.addChildElement(h);let p=new ne({children:u});c.addChildElement(p),n.length===0&&(this.fromHeadings={properties:a,beginDirty:i,tabLeader:s})}this.root.push(c)}prepForXml(e){let t=super.prepForXml(e);return $k(t,this.fromHeadings&&k(k({},this.fromHeadings),{},{textWidth:this.textWidthIn(e)})),t}textWidthIn(e){var t,n;return(t=(n=e.file)===null||n===void 0||(n=n.Document)===null||n===void 0||(n=n.View.Body.getSectionPropertiesFor(this))===null||n===void 0?void 0:n.AvailableTextWidth)!==null&&t!==void 0?t:Ps}getTabStopsForLevel(e,t,n=9025){return[{type:"clear",position:n+1-(e-1)*240},{type:"right",position:n,leader:t}]}buildCachedContentRun(e,t){var n,r;return new qe({style:t?.hyperlink&&e.href!==void 0?"IndexLink":void 0,children:[new Dr({text:e.title}),new Xs,new Dr({text:(n=(r=e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""})]})}buildCachedContentParagraphChild(e,t){let n=this.buildCachedContentRun(e,t);return t?.hyperlink&&e.href!==void 0?new Fm({anchor:e.href,children:[n]}):n}},Er=0,kl=32,lE=32,cE=(e,t)=>{let n=t.replace(/-/g,"");if(n.length!==lE)throw new Error(`Error: Cannot extract GUID from font filename: ${t}`);let r=n.replace(/(..)/g,"$1 ").trim().split(" ").map(a=>parseInt(a,16));r.reverse();let i=e.slice(Er,kl).map((a,o)=>a^r[o%r.length]),s=new Uint8Array(Er+i.length+Math.max(0,e.length-kl));return s.set(e.slice(0,Er)),s.set(i,Er),s.set(e.slice(kl),Er+i.length),s},dn=class{format(e,t={stack:[]}){let n=e.prepForXml(t);if(n)return n;throw Error("XMLComponent did not format correctly")}},qf=/\{([^{}]+)\}/g,Hf=(e,t)=>t.size===0?e:e.replace(qf,(n,r)=>{var i;return(i=t.get(r))!==null&&i!==void 0?i:n}),dE=e=>new Set(Array.from(e.matchAll(qf),([,t])=>t)),Uf=class{replace(e,t,n){return Hf(e,new Map(t.map((r,i)=>[r.key,(n+i).toString()])))}getMediaData(e,t){let n=dE(e);return t.Entries.filter(([r])=>n.has(r)).map(([r,{fileName:i}])=>({key:r,fileName:i}))}},pE=class{replace(e,t){return Hf(e,new Map(t.map(({reference:n,instance:r,restartedListId:i,numId:s})=>[Bs(n,r,i),s.toString()])))}},uE=new dn,Tl=(e,t,n,r,i=!0)=>j(uE.format(t,{viewWrapper:{View:t,Relationships:r},file:e,stack:[]}),{indent:n,declaration:i?{standalone:"yes",encoding:"UTF-8"}:{encoding:"UTF-8"}}),hE=(e,t,n,r)=>{let{content:i}=t.options;if(i instanceof Uint8Array)return[{data:i,path:`word/${n}`}];if("files"in i)return[{data:qs(i.files.map(({path:l,content:u})=>[l,u instanceof Uint8Array?u:Tl(e,u,r,new be)])),path:`word/${n}`}];let s=e.PackageParts.createRelationships(n),a=Tl(e,i,r,s),o=n.slice(0,n.lastIndexOf("/")),c=n.slice(n.lastIndexOf("/")+1);return[{data:a,path:`word/${n}`},...s.RelationshipCount>0?[{data:Tl(e,s,r,s,!1),path:`word/${o}/_rels/${c}.rels`}]:[]]},Tc=(e,t,n=0)=>{let r=e.PackageParts.Array.slice(n);return r.length===0?[]:[...r.flatMap(({part:i,path:s})=>hE(e,i,s,t)),...Tc(e,t,n+r.length)]},mE=["PackageParts"],fE=class{constructor(){E(this,"formatter",void 0),E(this,"imageReplacer",void 0),E(this,"numberingReplacer",void 0),this.formatter=new dn,this.imageReplacer=new Uf,this.numberingReplacer=new pE}compile(e,t,n=[]){let r=this.xmlifyFile(e,t),{PackageParts:i}=r,s=Zl(r,mE),a=Object.values(s).flatMap(o=>Array.isArray(o)?o:[o]);return new Map([...a.map(({path:o,data:c})=>[o,c]),...i.map(({path:o,data:c})=>[o,c]),...n.map(({path:o,data:c})=>[o,c]),...e.Macros===void 0?[]:[["word/vbaProject.bin",e.Macros.project]],...e.Media.Array.map(o=>[`word/media/${o.fileName}`,o.data]),...e.FontTable.files.map(({data:o,fontKey:c},l)=>[`word/fonts/font${l+1}.odttf`,cE(o,c)])])}xmlifyFile(e,t){var n;let r=j(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),i=j(this.formatter.format(e.Comments,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),s=j(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),a=j(this.formatter.format(e.Endnotes.View,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),o=e.Document.Relationships.RelationshipCount+1,c=e.Comments.Relationships.RelationshipCount+1,l=e.FootNotes.Relationships.RelationshipCount+1,u=e.Endnotes.Relationships.RelationshipCount+1,d=this.imageReplacer.getMediaData(r,e.Media),p=this.imageReplacer.getMediaData(i,e.Media),h=this.imageReplacer.getMediaData(s,e.Media),f=this.imageReplacer.getMediaData(a,e.Media);return k(k(k(k(k(k({Relationships:{data:(()=>{let m=be.copy(e.Document.Relationships);return d.forEach((g,y)=>{m.addRelationship(o+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),m.addRelationship(m.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),j(this.formatter.format(m,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{let m=this.imageReplacer.replace(r,d,o);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{let m=j(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:j(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},FileRelationships:{data:j(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=be.copy(m.Relationships);return T.forEach((C,_)=>{b.addRelationship(_,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${C.fileName}`)}),{data:j(this.formatter.format(b,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${g+1}.xml.rels`}}),FooterRelationships:e.Footers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=be.copy(m.Relationships);return T.forEach((C,_)=>{b.addRelationship(_,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${C.fileName}`)}),{data:j(this.formatter.format(b,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${g+1}.xml.rels`}}),Headers:e.Headers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=this.imageReplacer.replace(y,T,0);return{data:this.numberingReplacer.replace(b,e.Numbering.ConcreteNumbering),path:`word/header${g+1}.xml`}}),Footers:e.Footers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=this.imageReplacer.replace(y,T,0);return{data:this.numberingReplacer.replace(b,e.Numbering.ConcreteNumbering),path:`word/footer${g+1}.xml`}}),CustomProperties:{data:j(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:j(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:(()=>{let m=this.imageReplacer.replace(s,h,l);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/footnotes.xml"},FootNotesRelationships:{data:(()=>{let m=be.copy(e.FootNotes.Relationships);return h.forEach((g,y)=>{m.addRelationship(l+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/footnotes.xml.rels"},Endnotes:{data:(()=>{let m=this.imageReplacer.replace(a,f,u);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/endnotes.xml"},EndnotesRelationships:{data:(()=>{let m=be.copy(e.Endnotes.Relationships);return f.forEach((g,y)=>{m.addRelationship(u+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/endnotes.xml.rels"},Settings:{data:j(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"}},e.Comments.IsEmpty?{}:{Comments:{data:(()=>{let m=this.imageReplacer.replace(i,p,c);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/comments.xml"},CommentsRelationships:{data:(()=>{let m=be.copy(e.Comments.Relationships);return p.forEach((g,y)=>{m.addRelationship(c+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/comments.xml.rels"}}),e.CommentsExtended?{CommentsExtended:{data:j(this.formatter.format(e.CommentsExtended,{viewWrapper:{View:e.CommentsExtended,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsExtended.xml"}}:{}),e.CommentsIds?{CommentsIds:{data:j(this.formatter.format(e.CommentsIds,{viewWrapper:{View:e.CommentsIds,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsIds.xml"}}:{}),{},{FontTable:{data:j(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:j(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/fontTable.xml.rels"},Theme:{data:j(this.formatter.format(e.Theme,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/theme/theme1.xml"}},!((n=e.Macros)===null||n===void 0)&&n.events?{MacroEvents:{data:j(this.formatter.format(e.Macros.events,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/vbaData.xml"},MacroRelationships:{data:j(this.formatter.format(e.Macros.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/vbaProject.bin.rels"}}:{}),e.Bibliography?{BibliographySources:{data:j(this.formatter.format(e.Bibliography.sources,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"customXml/item1.xml"},BibliographySourcesProperties:{data:j(this.formatter.format(e.Bibliography.properties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"no",encoding:"UTF-8"}}),path:"customXml/itemProps1.xml"},BibliographySourcesRelationships:{data:j(this.formatter.format(e.Bibliography.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"customXml/_rels/item1.xml.rels"}}:{}),{},{PackageParts:Tc(e,t),Numbering:{data:j(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},ContentTypes:{data:j(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"}})}},Ih=Zy(((e,t)=>{var n=typeof Reflect=="object"?Reflect:null,r=n&&typeof n.apply=="function"?n.apply:function(x,v,A){return Function.prototype.apply.call(x,v,A)},i;n&&typeof n.ownKeys=="function"?i=n.ownKeys:Object.getOwnPropertySymbols?i=function(x){return Object.getOwnPropertyNames(x).concat(Object.getOwnPropertySymbols(x))}:i=function(x){return Object.getOwnPropertyNames(x)};function s(w){console&&console.warn&&console.warn(w)}var a=Number.isNaN||function(x){return x!==x};function o(){o.init.call(this)}t.exports=o,t.exports.once=b,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function l(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(w){if(typeof w!="number"||w<0||a(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");c=w}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(x){if(typeof x!="number"||x<0||a(x))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+x+".");return this._maxListeners=x,this};function u(w){return w._maxListeners===void 0?o.defaultMaxListeners:w._maxListeners}o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(x){for(var v=[],A=1;A<arguments.length;A++)v.push(arguments[A]);var N=x==="error",M=this._events;if(M!==void 0)N=N&&M.error===void 0;else if(!N)return!1;if(N){var O;if(v.length>0&&(O=v[0]),O instanceof Error)throw O;var F=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw F.context=O,F}var Q=M[x];if(Q===void 0)return!1;if(typeof Q=="function")r(Q,this,v);else for(var Z=Q.length,V=g(Q,Z),A=0;A<Z;++A)r(V[A],this,v);return!0};function d(w,x,v,A){var N,M,O;if(l(v),M=w._events,M===void 0?(M=w._events=Object.create(null),w._eventsCount=0):(M.newListener!==void 0&&(w.emit("newListener",x,v.listener?v.listener:v),M=w._events),O=M[x]),O===void 0)O=M[x]=v,++w._eventsCount;else if(typeof O=="function"?O=M[x]=A?[v,O]:[O,v]:A?O.unshift(v):O.push(v),N=u(w),N>0&&O.length>N&&!O.warned){O.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=w,F.type=x,F.count=O.length,s(F)}return w}o.prototype.addListener=function(x,v){return d(this,x,v,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(x,v){return d(this,x,v,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(w,x,v){var A={fired:!1,wrapFn:void 0,target:w,type:x,listener:v},N=p.bind(A);return N.listener=v,A.wrapFn=N,N}o.prototype.once=function(x,v){return l(v),this.on(x,h(this,x,v)),this},o.prototype.prependOnceListener=function(x,v){return l(v),this.prependListener(x,h(this,x,v)),this},o.prototype.removeListener=function(x,v){var A,N,M,O,F;if(l(v),N=this._events,N===void 0)return this;if(A=N[x],A===void 0)return this;if(A===v||A.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete N[x],N.removeListener&&this.emit("removeListener",x,A.listener||v));else if(typeof A!="function"){for(M=-1,O=A.length-1;O>=0;O--)if(A[O]===v||A[O].listener===v){F=A[O].listener,M=O;break}if(M<0)return this;M===0?A.shift():y(A,M),A.length===1&&(N[x]=A[0]),N.removeListener!==void 0&&this.emit("removeListener",x,F||v)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(x){var v,A=this._events,N;if(A===void 0)return this;if(A.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):A[x]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete A[x]),this;if(arguments.length===0){var M=Object.keys(A),O;for(N=0;N<M.length;++N)O=M[N],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=A[x],typeof v=="function")this.removeListener(x,v);else if(v!==void 0)for(N=v.length-1;N>=0;N--)this.removeListener(x,v[N]);return this};function f(w,x,v){var A=w._events;if(A===void 0)return[];var N=A[x];return N===void 0?[]:typeof N=="function"?v?[N.listener||N]:[N]:v?T(N):g(N,N.length)}o.prototype.listeners=function(x){return f(this,x,!0)},o.prototype.rawListeners=function(x){return f(this,x,!1)},o.listenerCount=function(w,x){return typeof w.listenerCount=="function"?w.listenerCount(x):m.call(w,x)},o.prototype.listenerCount=m;function m(w){var x=this._events;if(x!==void 0){var v=x[w];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(w,x){for(var v=new Array(x),A=0;A<x;++A)v[A]=w[A];return v}function y(w,x){for(;x+1<w.length;x++)w[x]=w[x+1];w.pop()}function T(w){for(var x=new Array(w.length),v=0;v<x.length;++v)x[v]=w[v].listener||w[v];return x}function b(w,x){return new Promise(function(v,A){function N(O){w.removeListener(x,M),A(O)}function M(){typeof w.removeListener=="function"&&w.removeListener("error",N),v([].slice.call(arguments))}_(w,x,M,{once:!0}),x!=="error"&&C(w,N,{once:!0})})}function C(w,x,v){typeof w.on=="function"&&_(w,"error",x,v)}function _(w,x,v,A){if(typeof w.on=="function")A.once?w.once(x,v):w.on(x,v);else if(typeof w.addEventListener=="function")w.addEventListener(x,function N(M){A.once&&w.removeEventListener(x,N),v(M)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}}))();gE=class extends Ih.EventEmitter{pipe(e,t){let n=this,r=e,i=d=>{r.writable&&r.write(d)===!1&&n.pause&&n.pause()};n.on("data",i);let s=()=>{n.readable&&n.resume&&n.resume()};r.on("drain",s),!r._isStdio&&(!t||t.end!==!1)&&(n.on("end",o),n.on("close",c));let a=!1;function o(){a||(a=!0,r.end())}function c(){a||(a=!0,typeof r.destroy=="function"&&r.destroy())}function l(d){if(u(),Ih.EventEmitter.listenerCount(this,"error")===0)throw d}n.on("error",l),r.on("error",l);function u(){n.removeListener("data",i),r.removeListener("drain",s),n.removeListener("end",o),n.removeListener("close",c),n.removeListener("error",l),r.removeListener("error",l),n.removeListener("end",u),n.removeListener("close",u),r.removeListener("close",u)}return n.on("end",u),n.on("close",u),r.on("close",u),r.emit("pipe",n),r}};bE={NONE:"",WITH_2_BLANKS:" ",WITH_4_BLANKS:" ",WITH_TAB:" "},Rh=e=>e===!0?bE.WITH_2_BLANKS:e===!1?void 0:e,Lh=e=>e.Macros===void 0?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/vnd.ms-word.document.macroEnabled.12",Sc=class Rn{static pack(t,n,r){var i=this;return Kt(function*(s,a,o,c=[]){return jl(qs(i.compiler.compile(s,Rh(o),c)),a,Lh(s))}).apply(this,arguments)}static toString(t,n,r=[]){return Rn.pack(t,"string",n,r)}static toBuffer(t,n,r=[]){return Rn.pack(t,"nodebuffer",n,r)}static toBase64String(t,n,r=[]){return Rn.pack(t,"base64",n,r)}static toBlob(t,n,r=[]){return Rn.pack(t,"blob",n,r)}static toArrayBuffer(t,n,r=[]){return Rn.pack(t,"arraybuffer",n,r)}static toStream(t,n,r=[]){let i=new gE,s=this.compiler.compile(t,Rh(n),r);return new Promise(a=>setTimeout(a)).then(()=>jl(qs(s),"nodebuffer",Lh(t))).then(a=>{i.emit("data",a),i.emit("end")},a=>i.emit("error",a)),i}};E(Sc,"compiler",new fE);jf=e=>{var t;if(e.name!=="w:bookmarkStart"&&e.name!=="w:bookmarkEnd")return;let n=Number((t=e.attributes)===null||t===void 0?void 0:t["w:id"]);return Number.isInteger(n)?n:void 0},Wf=e=>{var t;let n=jf(e);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Wf)]},vE=e=>{let t=new Set(e),n=new Map,r=e.reduce((a,o)=>Math.max(a,o),0),i=a=>{let o=n.get(a);if(o!==void 0)return o;let c=t.has(a)?r+1:a;return r=Math.max(r,c),t.add(c),n.set(a,c),c},s=a=>{let o=jf(a);return k(k(k({},a),o===void 0?{}:{attributes:k(k({},a.attributes),{},{"w:id":String(i(o))})}),a.elements===void 0?{}:{elements:a.elements.map(s)})};return a=>a.map(s)},wE=new dn,ta=e=>new TextDecoder("utf-8",{ignoreBOM:!0}).decode(e),pt=e=>Wr(e,{keepWhitespaceText:!0}),Kf=e=>{var t;return(t=pt(j(wE.format(new Dr({text:e})))).elements[0].elements)!==null&&t!==void 0?t:[]},Gf=e=>k(k({},e),{},{attributes:{"xml:space":"preserve"}}),Te=(e,t)=>{var n,r;let i=(n=e.elements)===null||n===void 0?void 0:n.find(s=>s.name===t);return i===void 0?[]:((r=i.elements)!==null&&r!==void 0||(i.elements=[]),i.elements)},zf=e=>{if(!e?.start.trim()||!e?.end.trim())throw new Error("Both start and end delimiters must be non-empty strings.")},On=(e,t,n)=>{let r=Te(e,"Types");r.some(i=>{var s,a;return i.type==="element"&&i.name==="Default"&&(i==null||(s=i.attributes)===null||s===void 0?void 0:s.ContentType)===t&&(i==null||(a=i.attributes)===null||a===void 0?void 0:a.Extension)===n})||r.push({attributes:{ContentType:t,Extension:n},name:"Default",type:"element"})},yE=(e,t,n)=>{let r=Te(e,"Types");r.some(i=>{var s;return i.type==="element"&&i.name==="Override"&&((s=i.attributes)===null||s===void 0?void 0:s.PartName)===n})||r.push({attributes:{ContentType:t,PartName:n},name:"Override",type:"element"})},xE=(e,t)=>{var n;let r=(n=e.elements)===null||n===void 0?void 0:n.find(i=>i.name==="Types");r?.elements!==void 0&&(r.elements=r.elements.filter(i=>{var s,a;return!(i.name==="Override"&&String((s=(a=i.attributes)===null||a===void 0?void 0:a.PartName)!==null&&s!==void 0?s:"").toLowerCase()===t.toLowerCase())}))},kE=e=>{let t=parseInt(e.substring(3),10);return isNaN(t)?0:t},Cc=e=>Te(e,"Relationships").map(t=>{var n,r;return kE((n=(r=t.attributes)===null||r===void 0||(r=r.Id)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"")}).reduce((t,n)=>Math.max(t,n),0)+1,Kl=(e,t,n,r,i)=>{let s=Te(e,"Relationships");return s.push({attributes:{Id:`rId${t}`,Type:n,Target:r,TargetMode:i},name:"Relationship",type:"element"}),s},Ur=()=>({declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"Relationships",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},elements:[]}]}),Mh="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",TE="application/vnd.openxmlformats-package.core-properties+xml",Dh="_rels/.rels",Bh="docProps/core.xml",Gl={cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/"},SE={title:{namespace:"dc",name:"title"},subject:{namespace:"dc",name:"subject"},creator:{namespace:"dc",name:"creator"},keywords:{namespace:"cp",name:"keywords"},description:{namespace:"dc",name:"description"},lastModifiedBy:{namespace:"cp",name:"lastModifiedBy"},revision:{namespace:"cp",name:"revision"}},$h=e=>e===""?[]:[{type:"text",text:String(e)}],Fh=e=>{var t;return(t=e.name)===null||t===void 0?void 0:t.slice(e.name.indexOf(":")+1)},CE=(e,t)=>{var n;let r=(n=Object.entries(k({},e.attributes)).find(([i,s])=>(i==="xmlns"||i.startsWith("xmlns:"))&&s===Gl[t]))===null||n===void 0?void 0:n[0];return r===void 0?(e.attributes=k(k({},e.attributes),{},{[`xmlns:${t}`]:Gl[t]}),`${t}:`):r==="xmlns"?"":`${r.slice(6)}:`},EE=e=>{let t=e[0]===255&&e[1]===254?"utf-16le":e[0]===254&&e[1]===255?"utf-16be":"utf-8";return new TextDecoder(t).decode(e)},AE=(e,t,n)=>{var r;let i=t.get(n);if(i===void 0)return e.get(n);let s=pt(EE(i));return!((r=s.declaration)===null||r===void 0)&&r.attributes&&(s.declaration.attributes.encoding="UTF-8"),t.delete(n),e.set(n,s),s},_E=e=>{var t,n;let r=(t=e.get(Dh))!==null&&t!==void 0?t:Ur(),i=(n=Te(r,"Relationships").find(s=>{var a;return((a=s.attributes)===null||a===void 0?void 0:a.Type)===Mh}))===null||n===void 0||(n=n.attributes)===null||n===void 0?void 0:n.Target;return typeof i=="string"?cn("",i):(Kl(r,Cc(r),Mh,Bh),e.set(Dh,r),Bh)},NE=(e,t,n,{addContentTypeOverride:r})=>{var i,s;let a=_E(e),o=AE(e,t,a),c=o??{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"cp:coreProperties",attributes:{"xmlns:cp":Gl.cp},elements:[]}]};o===void 0&&(e.set(a,c),r(TE,`/${a}`));let l=(i=c.elements)===null||i===void 0?void 0:i.find(u=>Fh(u)==="coreProperties");if(l===void 0)throw new Error(`Could not find the core properties in ${a}`);(s=l.elements)!==null&&s!==void 0||(l.elements=[]);for(let[u,{namespace:d,name:p}]of Object.entries(SE)){let h=n[u];if(h===void 0)continue;let f=l.elements.find(m=>Fh(m)===p);f?f.elements=$h(h):l.elements.push({type:"element",name:`${CE(l,d)}${p}`,elements:$h(h)})}},zl=new Set(["wp:inline","wp:anchor"]),Ec=new Set(["wp:docPr","wps:cNvPr","wpg:cNvPr"]),PE=new Set(["a:stCxn","a:endCxn"]),Hs=(e,t)=>{var n,r;if(!t.has((n=e.name)!==null&&n!==void 0?n:""))return;let i=Number((r=e.attributes)===null||r===void 0?void 0:r.id);return Number.isInteger(i)?i:void 0},Vf=e=>{var t;let n=Hs(e,Ec);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Vf)]},IE=e=>{let t=n=>{var r;let i=Hs(n,Ec);return[...i===void 0?[]:[i],...((r=n.elements)!==null&&r!==void 0?r:[]).flatMap(s=>{var a;return zl.has((a=s.name)!==null&&a!==void 0?a:"")?[]:t(s)})]};return t(e)},OE=e=>{let t=new Set(e),n=e.reduce((a,o)=>Math.max(a,o),0),r=a=>{let o=t.has(a)?n+1:a;return n=Math.max(n,o),t.add(o),o},i=a=>{let o=new Map([...new Set(IE(a))].map(l=>[l,r(l)])),c=l=>{var u,d;if(l!==a&&zl.has((u=l.name)!==null&&u!==void 0?u:""))return i(l);let p=(d=Hs(l,Ec))!==null&&d!==void 0?d:Hs(l,PE),h=p===void 0?void 0:o.get(p);return k(k(k({},l),h===void 0?{}:{attributes:k(k({},l.attributes),{},{id:String(h)})}),l.elements===void 0?{}:{elements:l.elements.map(c)})};return c(a)},s=a=>{var o;return zl.has((o=a.name)!==null&&o!==void 0?o:"")?i(a):k(k({},a),a.elements===void 0?{}:{elements:a.elements.map(s)})};return a=>a.map(s)},Ce={DOCUMENT:"file",PARAGRAPH:"paragraph",TABLE_ROWS:"tableRows",DRAWING:"drawing"},RE=new Map([["wp:inline","wp:docPr"],["wp:anchor","wp:docPr"],["wpg:graphicFrame","wpg:cNvPr"],["wpc:graphicFrame","wpg:cNvPr"]]),na=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(n=>{var r;let i=n.name===void 0?void 0:RE.get(n.name),s=i===void 0||(r=n.elements)===null||r===void 0?void 0:r.find(a=>a.name===i);return[...s?[{element:n,properties:s}]:[],...na(n)]})},Xf=e=>{var t,n;return[(t=e.attributes)===null||t===void 0?void 0:t.descr,(n=e.attributes)===null||n===void 0?void 0:n.title].flatMap(r=>r===void 0?[]:[String(r)])},qh="[Content_Types].xml",LE=e=>{var t;if(!(!((t=e.elements)===null||t===void 0)&&t.some(r=>r.name==="Relationships"))){var n;e.elements=[...(n=e.elements)!==null&&n!==void 0?n:[],...Ur().elements]}return Te(e,"Relationships")},ME="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Vl=e=>{var t,n;return new Set(["r",...Object.entries((t=e.attributes)!==null&&t!==void 0?t:{}).flatMap(([r,i])=>r.startsWith("xmlns:")&&i===ME?[r.slice(6)]:[]),...((n=e.elements)!==null&&n!==void 0?n:[]).flatMap(r=>[...Vl(r)])])},Xl=(e,t)=>{var n,r;return new Set([...Object.entries((n=e.attributes)!==null&&n!==void 0?n:{}).flatMap(([i,s])=>i.includes(":")&&t.has(i.slice(0,i.indexOf(":")))?[String(s)]:[]),...((r=e.elements)!==null&&r!==void 0?r:[]).flatMap(i=>[...Xl(i,t)])])},DE=(e,t)=>{let n=l=>e.has(l)||t.has(l),r=l=>{if(n(l))return l;let u=(()=>{try{return decodeURI(l)}catch{return}})();if(u!==void 0&&n(u))return u;let d=l.toLowerCase();return[...e.keys(),...t.keys()].find(p=>p.toLowerCase()===d)},i=(l,u)=>{let d=e.get(Qe(l));return d===void 0?void 0:Te(d,"Relationships").find(p=>{var h;return p.name==="Relationship"&&((h=p.attributes)===null||h===void 0?void 0:h.Id)===u})},s=(l,u)=>{var d,p;let h=(d=u.attributes)===null||d===void 0?void 0:d.Target;return((p=u.attributes)===null||p===void 0?void 0:p.TargetMode)==="External"||h===void 0?void 0:r(cn(l,String(h)))},a=l=>[...e].some(([u,d])=>u.endsWith(".rels")&&Te(d,"Relationships").some(p=>s(Af(u),p)===l)),o=(l,u)=>{if(u===void 0||u===l||u===qh||u.endsWith(".rels")||a(u))return;let d=e.get(Qe(u));e.delete(u),t.delete(u),e.delete(Qe(u));let p=e.get(qh);p!==void 0&&xE(p,`/${u}`);for(let h of d===void 0?[]:Te(d,"Relationships"))o(u,s(u,h))};return{findRelationship:i,pathOf:s,removeIfUnreferenced:o,removeRelationships:(l,u)=>{var d,p;let h=(d=e.get(Qe(l)))===null||d===void 0||(d=d.elements)===null||d===void 0?void 0:d.find(m=>m.name==="Relationships"),f=((p=h?.elements)!==null&&p!==void 0?p:[]).filter(m=>{var g;return m.name==="Relationship"&&u.has(String((g=m.attributes)===null||g===void 0?void 0:g.Id))});if(!(h===void 0||f.length===0)){h.elements=h.elements.filter(m=>!f.includes(m));for(let m of f)o(l,s(l,m))}}}},BE=(e,{findRelationship:t,pathOf:n,removeIfUnreferenced:r},i,s)=>{let a=new dn;return{getRelatedPart:(o,c)=>{let l=t(o.path,c),u=l===void 0?void 0:n(o.path,l);return u===void 0?void 0:{path:u,xml:e.get(u)}},replaceRelatedPart:(o,c,l)=>{let u=`word/${i.PackageParts.add(l)}`,{relationshipType:d}=l.options,p=yc(o.path,u),h=c===void 0?void 0:t(o.path,c);if(h===void 0){var f;let g=Qe(o.path),y=(f=e.get(g))!==null&&f!==void 0?f:Ur();e.set(g,y);let T=c??`rId${Cc(y)}`;return LE(y).push({type:"element",name:"Relationship",attributes:{Id:T,Type:d,Target:p}}),T}let m=n(o.path,h);return h.attributes=k(k({},Object.fromEntries(Object.entries(h.attributes).filter(([g])=>g!=="TargetMode"))),{},{Type:d,Target:p}),r(o.path,m),String(h.attributes.Id)},format:o=>pt(j(a.format(o,s))).elements[0]}},$E=({parts:e,binaryParts:t,file:n,patches:r,delimiters:i},s)=>{let a=r.map(([l,u])=>({placeholder:`${i.start}${l}${i.end}`,patch:u})),o=[...e].filter(([l])=>l.startsWith("word/")&&!l.endsWith(".rels")).flatMap(([l,u])=>na(u).flatMap(d=>{let p=Xf(d.properties),h=a.filter(({placeholder:g})=>p.some(y=>y.includes(g)));if(h.length>1){var f,m;throw new Error(`The drawing "${(f=(m=d.properties.attributes)===null||m===void 0?void 0:m.name)!==null&&f!==void 0?f:""}" in ${l} has the placeholders ${h.map(({placeholder:g})=>g).join(" and ")} in its alt text. A drawing can only be patched once`)}return h.map(({placeholder:g,patch:y})=>({drawing:k(k({placeholder:g},d),{},{part:{path:l,xml:u}}),patch:y}))})),c=DE(e,t);for(let{drawing:l,patch:u}of o){let d=Xl(l.element,Vl(l.part.xml));u.patch(l,BE(e,c,n,s(l.part.path)));let p=Xl(l.part.xml,Vl(l.part.xml));c.removeRelationships(l.part.path,new Set([...d].filter(h=>!p.has(h))))}},FE=e=>typeof e=="object"&&e!==null&&"on"in e&&typeof e.on=="function",qE=e=>typeof e=="object"&&e!==null&&"generateAsync"in e&&typeof e.generateAsync=="function",HE=e=>["[object Blob]","[object File]"].includes(Object.prototype.toString.call(e)),UE=e=>new Promise((t,n)=>{let r=[];e.on("data",i=>{ArrayBuffer.isView(i)?r.push(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)):typeof i=="number"?r.push(i):n(new TypeError(`A template stream must give bytes, but it gave a ${typeof i}. A stream with an encoding set gives text, so do not set one.`))}),e.on("error",n),e.on("end",()=>{let i=new Uint8Array(r.reduce((s,a)=>s+(typeof a=="number"?1:a.length),0));r.reduce((s,a)=>typeof a=="number"?(i[s]=a,s+1):(i.set(a,s),s+a.length),0),t(i)})}),jE=(function(){var e=Kt(function*(t){return qE(t)?t.generateAsync({type:"uint8array"}):FE(t)?UE(t):HE(t)?new Uint8Array(yield t.arrayBuffer()):typeof t=="string"?Uint8Array.from({length:t.length},(n,r)=>t.charCodeAt(r)):Array.isArray(t)?Uint8Array.from(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)});return function(n){return e.apply(this,arguments)}})(),Yf=(function(){var e=Kt(function*(t,n){return Bf(yield jE(t),n)});return function(n,r){return e.apply(this,arguments)}})(),WE=new dn,Cs="word/document.xml",KE={path:"word/footnotes.xml",rootName:"w:footnotes",noteName:"w:footnote",referenceName:"w:footnoteReference",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",create:{part:()=>new hf,mark:()=>new uf,styles:()=>[new wf({}),new xf({}),new yf({})]}},GE={path:"word/endnotes.xml",rootName:"w:endnotes",noteName:"w:endnote",referenceName:"w:endnoteReference",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",create:{part:()=>new pf,mark:()=>new lf,styles:()=>[new kf({}),new Sf({}),new Tf({})]}},Es=(e,t)=>pt(j(WE.format(e,t))).elements[0],Jf=(e,t)=>{var n,r,i;let s=t.includes((n=e.name)!==null&&n!==void 0?n:"")?Number((r=e.attributes)===null||r===void 0?void 0:r["w:id"]):NaN;return[...Number.isInteger(s)?[s]:[],...((i=e.elements)!==null&&i!==void 0?i:[]).flatMap(a=>Jf(a,t))]},zE=(e,t)=>{var n,r;let i=(n=e.elements)!==null&&n!==void 0?n:[],s=((r=i[0])===null||r===void 0?void 0:r.name)==="w:pPr"?1:0;return k(k({},e),{},{elements:[...i.slice(0,s),t,...i.slice(s)]})},Hh=(e,t,n,{createContext:r,addContentTypeOverride:i,renumberBookmarks:s,renumberDrawings:a,renumberLists:o,useStyles:c})=>{let l=new Map(Object.entries(t).map(([T,b])=>[Number(T),b])),u=new Map,d=[...l.keys()].filter(Number.isFinite).reduce((T,b)=>Math.max(T,Math.floor(b)),0),p=new Map,h,f=T=>{var b,C;let _=T.name===e.referenceName?l.get(Number((b=T.attributes)===null||b===void 0?void 0:b["w:id"])):void 0;return _===void 0?T.elements===void 0?T:k(k({},T),{},{elements:T.elements.map(f)}):(h=((C=h)!==null&&C!==void 0?C:[...n.values()].flatMap(w=>Jf(w,[e.noteName,e.referenceName])).reduce((w,x)=>Math.max(w,x),0))+1,p.set(h,_),k(k({},T),{},{attributes:k(k({},T.attributes),{},{"w:id":String(h)})}))},m=()=>{var T;let b=Te((T=n.get(Qe(Cs)))!==null&&T!==void 0?T:{},"Relationships").find(_=>{var w;return((w=_.attributes)===null||w===void 0?void 0:w.Type)===e.relationshipType}),C=b?cn(Cs,String(b.attributes.Target)):e.path;return n.has(C)||(n.set(C,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[Es(e.create.part(),r(C))]}),i(e.contentType,`/${C}`)),b||r(Cs).viewWrapper.Relationships.addRelationship($n(),e.relationshipType,yc(Cs,C)),C};return{renumber:T=>T.map(f),write:()=>{if(p.size===0)return;let T=m(),b=r(T),C=new Map([...new Set(p.values())].map(w=>{let x=Es(e.create.mark(),b);return[w,c(o(s(w.children.map(v=>Es(v,b)).map((v,A)=>A===0?zE(v,x):v))))]}));Te(n.get(T),e.rootName).push(...[...p].map(([w,x])=>({type:"element",name:e.noteName,attributes:{"w:id":String(w)},elements:[...a(C.get(x))]})));let _=n.get("word/styles.xml");if(_){let w=Te(_,"w:styles"),x=new Set(w.map(v=>{var A;return(A=v.attributes)===null||A===void 0?void 0:A["w:styleId"]}));w.push(...e.create.styles().map(v=>Es(v,b)).filter(v=>{var A;return!x.has((A=v.attributes)===null||A===void 0?void 0:A["w:styleId"])}))}},carry:(T,b)=>{let C=u.get(T);return C!==void 0?C:(d++,l.set(d,b),u.set(T,d),d)}}},VE=({footnotes:e={},endnotes:t={}},n,r)=>{let i={footnotes:Hh(KE,e,n,r),endnotes:Hh(GE,t,n,r)};return{carry:(s,a,o)=>i[s].carry(a,o),renumber:s=>Object.values(i).reduce((a,o)=>o.renumber(a),s),write:()=>{for(let s of Object.values(i))s.write()}}},XE=new dn,As="word/document.xml",YE="word/numbering.xml",JE="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Uh="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",QE="default-bullet-numbering",ZE="1",e2=(e,t)=>pt(j(XE.format(e,t))).elements[0],jh=e=>e.reduce((t,n)=>Math.max(t,n),0),t2=(e,t,{createContext:n,addContentTypeOverride:r})=>{let i=new Map,s,a=()=>{var f;return Te((f=t.get(Qe(As)))!==null&&f!==void 0?f:{},"Relationships").find(m=>{var g;return((g=m.attributes)===null||g===void 0?void 0:g.Type)===Uh})},o=(f=a())=>f?cn(As,String(f.attributes.Target)):YE,c=(f,m)=>{var g;return Te((g=t.get(o()))!==null&&g!==void 0?g:{},"w:numbering").filter(y=>y.name===f).map(y=>Number(y.attributes[m]))},l=f=>{if(f===ZE)return e.ConcreteNumbering.find(({reference:g})=>g===QE);if(!f.startsWith("{"))return;let m=e.ConcreteNumbering.find(({reference:g,instance:y})=>f===`{${g}-${y}}`);if(!m){let g=f.slice(1,-1).replace(/-\d+$/,"");throw new Error(`A paragraph in a patch uses the numbering "${g}", which isn't in the numbering option of patchDocument. Add it there with its levels, as in a Document`)}return m},u=f=>{var m;let g=i.get(f.numId);return g!==void 0?g:(s=((m=s)!==null&&m!==void 0?m:jh(c("w:num","w:numId")))+1,i.set(f.numId,s),s)},d=f=>{let m=f.name==="w:numId"?l(String(f.attributes["w:val"])):void 0;return m===void 0?f.elements===void 0?f:k(k({},f),{},{elements:f.elements.map(d)}):k(k({},f),{},{attributes:k(k({},f.attributes),{},{"w:val":String(u(m))})})},p=f=>{let m=a(),g=o(m);return t.has(g)||(t.set(g,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[k(k({},f),{},{elements:[]})]}),r(JE,`/${g}`)),m||n(As).viewWrapper.Relationships.addRelationship($n(),Uh,yc(As,g)),g};return{renumber:f=>f.map(d),write:()=>{var f,m;if(i.size===0)return;let g=e2(e,n(o())),y=N=>Number(N.elements.find(M=>M.name==="w:abstractNumId").attributes["w:val"]),T=g.elements.filter(N=>N.name==="w:num"&&i.has(Number(N.attributes["w:numId"]))),b=jh(c("w:abstractNum","w:abstractNumId")),C=new Map([...new Set(T.map(y))].map((N,M)=>[N,b+M+1])),_=g.elements.flatMap(N=>{let M=N.name==="w:abstractNum"?C.get(Number(N.attributes["w:abstractNumId"])):void 0;return M===void 0?[]:[k(k({},N),{},{attributes:k(k({},N.attributes),{},{"w:abstractNumId":String(M)})})]}),w=p(g),x=t.get(w).elements.find(N=>N.name==="w:numbering");x.attributes=k(k(k({},Object.fromEntries(Object.entries(g.attributes).filter(([N])=>N.startsWith("xmlns:")))),x.attributes),{},{"mc:Ignorable":[...new Set([...String((f=(m=x.attributes)===null||m===void 0?void 0:m["mc:Ignorable"])!==null&&f!==void 0?f:"").split(" "),...String(g.attributes["mc:Ignorable"]).split(" ")])].filter(N=>N!=="").join(" ")});let v=Te(t.get(w),"w:numbering"),A=N=>{let M=v.findIndex(O=>N.includes(O.name));return M===-1?v.length:M};v.splice(A(["w:num","w:numIdMacAtCleanup"]),0,..._),v.splice(A(["w:numIdMacAtCleanup"]),0,...T.map(N=>k(k({},N),{},{attributes:k(k({},N.attributes),{},{"w:numId":String(i.get(Number(N.attributes["w:numId"])))}),elements:N.elements.map(M=>M.name==="w:abstractNumId"?k(k({},M),{},{attributes:{"w:val":String(C.get(y(N)))}}):M)})))}}},Yl={nameOf:e=>e.type==="element"?e.name:void 0,contentOf:e=>e.elements,attributeOf:(e,t)=>{var n;return(n=e.attributes)===null||n===void 0?void 0:n[t]},textOf:e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).filter(({type:n})=>n==="text").map(({text:n})=>String(n)).join("")},textElement:e=>({type:"element",name:"w:t",attributes:{"xml:space":"preserve"},elements:[{type:"text",text:e}]}),writeClean:(e,t)=>{var n;/^\s*(PAGEREF|TOC)\b/i.test(t)&&((n=e.attributes)===null||n===void 0?void 0:n["w:dirty"])!==void 0&&(e.attributes=Object.fromEntries(Object.entries(e.attributes).filter(([r])=>r!=="w:dirty")))},setSimpleFieldResult:(e,t)=>{e.elements=[{type:"element",name:"w:r",elements:[Yl.textElement(t)]}]}},Sl="word/document.xml",n2="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk",r2=[80,75,3,4],i2=(function(){var e=Kt(function*(t){if(r2.every((n,r)=>t[r]===n))try{let n=new Map,r=new Map;for(let[s,a]of Bf(t))/\.(xml|rels)$/.test(s)?n.set(s,pt(ta(a))):r.set(s,a);let i=yield Qf(n,r);return k({parts:n,binaryParts:r},i.size>0?{importedDocuments:i}:{})}catch{return}});return function(n){return e.apply(this,arguments)}})(),Qf=(function(){var e=Kt(function*(t,n){let r=new Map;for(let[a,o]of t){var i,s;if(a.endsWith(".rels"))for(let{attributes:c={}}of(i=(s=Ls(o))===null||s===void 0?void 0:s.elements)!==null&&i!==void 0?i:[]){let l=cn(Af(a),String(c.Target)),u=n.get(l),d=c.Type===n2&&c.TargetMode!=="External"&&u?yield i2(u):void 0;d&&r.set(l,d)}}return r});return function(n,r){return e.apply(this,arguments)}})(),Ls=e=>{var t;return e==null||(t=e.elements)===null||t===void 0?void 0:t.find(({type:n})=>n==="element")},s2=(function(){var e=Kt(function*(t,n,r=new Map){var i,s;let a=Ls(t.get(Sl));if(!a)return;let o=yield Qf(t,r),c=n(k({parts:t,binaryParts:r},o.size>0?{importedDocuments:o}:{})),l=Cm(Yl,a,c,{blank:!0}),u=(i=(s=Ls(t.get(Qe(Sl))))===null||s===void 0?void 0:s.elements)!==null&&i!==void 0?i:[];for(let{attributes:d={}}of u){let p=/\/(header|footer)$/.test(String(d.Type))?Ls(t.get(cn(Sl,String(d.Target)))):void 0;p&&Em(Yl,p,c,{blank:!0,sectionPageCount:l.get(String(d.Id))})}});return function(n,r){return e.apply(this,arguments)}})(),a2=new Set(["w:hyperlink","w:sdt","w:sdtContent","w:ins","w:moveTo","w:smartTag","w:customXml","w:fldSimple","w:dir","w:bdo"]),Zf=(e,t)=>{var n;return((n=e.elements)!==null&&n!==void 0?n:[]).flatMap((r,i)=>{var s;return r.name==="w:r"?[{element:r,path:[...t,i]}]:a2.has((s=r.name)!==null&&s!==void 0?s:"")?Zf(r,[...t,i]):[]})},Us=(e,t)=>t.reduce((n,r)=>n.elements[r],e),Yr=e=>{if(e.element.name!=="w:p")throw new Error(`Invalid node type: ${e.element.name}`);if(!e.element.elements)return{text:"",runs:[],index:-1,pathToParagraph:[]};let t=0,n=Zf(e.element,[]).map(({element:r,path:i})=>{let s=o2(r,i,t);return t+=s.text.length,s});return{text:n.reduce((r,i)=>r+i.text,""),runs:n,index:e.index,pathToParagraph:eg(e)}},o2=(e,t,n)=>{if(!e.elements)return{text:"",parts:[],path:t,start:n,end:n};let r=n,i=e.elements.map((s,a)=>{var o,c;if(s.name!=="w:t"||!s.elements||s.elements.length===0)return;let l=(o=(c=s.elements[0].text)===null||c===void 0?void 0:c.toString())!==null&&o!==void 0?o:"",u=r;return r+=l.length,{text:l,index:a,start:u,end:u+l.length-1}}).filter(s=>!!s).map(s=>s);return{text:i.reduce((s,a)=>s+a.text,""),parts:i,path:t,start:n,end:i.length>0?i[i.length-1].end:n}},eg=e=>e.parent?[...eg(e.parent),e.index]:[e.index],l2=class extends Error{constructor(e){super(`Token ${e} not found`),this.name="TokenNotFoundError"}},c2=(e,t)=>{let n=Yr({element:e,index:0,parent:void 0}).runs.find(({parts:r})=>r.some(({text:i})=>i.includes(t)));if(!n)throw new l2(t);return n.path},d2=(e,t)=>{var n,r;let i=-1,s=(n=(r=e.elements)===null||r===void 0?void 0:r.map((a,o)=>{if(i!==-1)return a;if(a.type==="element"&&a.name==="w:t"){var c,l;let u=((c=(l=a.elements)===null||l===void 0||(l=l[0])===null||l===void 0?void 0:l.text)!==null&&c!==void 0?c:"").split(t),d=u.map(p=>k(k(k({},a),Gf(a)),{},{elements:Kf(p)}));return u.length>1&&(i=o),d}else return a}).flat())!==null&&n!==void 0?n:[];return{left:k(k({},JSON.parse(JSON.stringify(e))),{},{elements:s.slice(0,i+1)}),right:k(k({},JSON.parse(JSON.stringify(e))),{},{elements:s.slice(i+1)})}},Ar={START:0,MIDDLE:1,END:2},tg=({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:r,fromIndex:i=0})=>{let s=t.text.indexOf(n,i),a=s+n.length-1,o=Ar.START;for(let c of t.runs){let l=Us(e,c.path);for(let{text:u,index:d,start:p,end:h}of c.parts)switch(o){case Ar.START:if(s>=p&&s<=h){let f=s-p,m=Math.min(a,h)-p;if(u.substring(f,m+1)==="")continue;let g=u.substring(0,f)+r+u.substring(m+1);Cl(l.elements[d],g),o=Ar.MIDDLE;continue}break;case Ar.MIDDLE:if(a<=h){let f=u.substring(a-p+1);Cl(l.elements[d],f);let m=l.elements[d];l.elements[d]=Gf(m),o=Ar.END}else Cl(l.elements[d],"")}}return e},Cl=(e,t)=>(e.elements=Kf(t),e),Wh=e=>{var t,n;return(t=(n=e.element.elements)===null||n===void 0?void 0:n.map((r,i)=>({element:r,index:i,parent:e})))!==null&&t!==void 0?t:[]},ng=e=>{let t=[],n=[...Wh({element:e,index:0,parent:void 0})],r;for(;n.length>0;)r=n.shift(),r.element.name==="w:p"&&(t=[...t,Yr(r)]),n.push(...Wh(r));return t},Ac=(e,t)=>ng(e).filter(n=>n.text.includes(t)),El="\uFFFF",p2=({json:e,patch:t,patchText:n,context:r,keepOriginalStyles:i=!0,recursive:s=!0,renumberIds:a=o=>o})=>{let o=Ac(e,n);if(o.length===0)return{element:e,didFindOccurrence:!1};let c=[...o].reverse(),l=t.type===Ce.DOCUMENT?k2(c):c,u,d=()=>{var h;return u=((h=u)!==null&&h!==void 0?h:ig(e))+1,String(u)};for(let h of l)switch(t.type){case Ce.DOCUMENT:{var p;let f=T2(e,h.pathToParagraph),m=S2(h.pathToParagraph),g=Kh(t,r,a),y=f.name==="w:tc"&&m===f.elements.length-1&&((p=g[g.length-1])===null||p===void 0?void 0:p.name)!=="w:p"?[{type:"element",name:"w:p"}]:[];f.elements.splice(m,1,...g,...y);break}case Ce.PARAGRAPH:default:{let f=sg(e,h.pathToParagraph),m=h,g=0;do g=u2({paragraphElement:f,renderedParagraph:m,patchText:n,fromIndex:g,children:Kh(t,r,a),keepOriginalStyles:i,newTrackedChangeId:d}),m=Yr({element:f,index:h.index,parent:void 0});while(s&&m.text.includes(n,g));break}}return{element:e,didFindOccurrence:!0}},Kh=(e,t,n)=>n(e.children.flatMap(r=>{var i;return(i=r.writtenAs)!==null&&i!==void 0?i:r}).flatMap(r=>{let i=r.prepForXml(t);return i?[pt(j(i)).elements[0]]:[]})),u2=({paragraphElement:e,renderedParagraph:t,patchText:n,fromIndex:r,children:i,keepOriginalStyles:s,newTrackedChangeId:a})=>{let o=t.text.indexOf(n,r);tg({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:El,fromIndex:r});let c=c2(e,El),l=c.slice(0,-1),u=Us(e,l),d=c[c.length-1],p=l.map((_,w)=>Us(e,l.slice(0,w+1))).filter(_=>_.name==="w:sdt"),h=[...p].reverse().find(h2),f=u.elements[d],{left:m,right:g}=d2(f,El),y=f.elements.find(_=>_.type==="element"&&_.name==="w:rPr"),T=h?m2(h):y,b=s&&T?i.map(_=>rg(_,T)):i,C=y?k(k({},g),{},{elements:[y,...g.elements]}):g;return u.elements.splice(d,1,m,...b,C),p.forEach(_=>b2(_,b)),w2(e,l,a),o+Yr({element:{name:"w:p",elements:[...b]},index:0,parent:void 0}).text.length},_c=e=>{var t;return(t=e.elements)===null||t===void 0?void 0:t.find(n=>n.name==="w:sdtPr")},h2=e=>{var t;return!!(!((t=_c(e))===null||t===void 0||(t=t.elements)===null||t===void 0)&&t.some(n=>n.name==="w:showingPlcHdr"))},m2=e=>{var t;return(t=_c(e))===null||t===void 0||(t=t.elements)===null||t===void 0?void 0:t.find(n=>n.name==="w:rPr")},f2=new Set(["w:rPr","w:t","w:tab","w:br"]),g2=e=>e.name==="w:bookmarkStart"||e.name==="w:bookmarkEnd"||e.name==="w:r"&&rn(e).every(t=>f2.has(t.name)),b2=(e,t)=>{let n=_c(e);if(!n?.elements)return;let r=n.elements.some(i=>i.name==="w:text")&&!t.every(g2);n.elements=n.elements.filter(i=>i.name!=="w:showingPlcHdr"&&i.name!=="w:dataBinding"&&!(r&&i.name==="w:text"))},Jl=new Set(["w:hyperlink","w:fldSimple","w:subDoc"]),v2=new Map([["w:ins",Jl],["w:moveTo",Jl],["w:hyperlink",new Set(["w:hyperlink"])]]),w2=(e,t,n)=>{for(let i=t.length;i>0;i--){var r;let s=Us(e,t.slice(0,i-1)),a=t[i-1],o=s.elements[a],c=v2.get(o.name),l=g=>!!c?.has(g.name);if(!(!((r=o.elements)===null||r===void 0)&&r.some(l)))continue;let{elements:u}=o,d=u.flatMap((g,y)=>y===0||l(g)||l(u[y-1])?[y]:[]),p=d.map((g,y)=>u.slice(g,d[y+1])),h=c===Jl,f=!0,m=p.map(g=>{if(l(g[0]))return g[0];let y=h&&!f?k(k({},o.attributes),{},{"w:id":n()}):o.attributes;return f=!1,k(k({},o),{},{attributes:y,elements:[...g]})});s.elements.splice(a,1,...m)}},rg=(e,t)=>e.name==="w:r"?y2(e,t):e.elements?k(k({},e),{},{elements:e.elements.map(n=>rg(n,t))}):e,y2=(e,t)=>{let n=rn(e).find(a=>a.type==="element"&&a.name==="w:rPr");if(!n)return k(k({},e),{},{elements:[t,...rn(e)]});let r=new Set(rn(n).map(a=>a.name)),i=[...rn(t).filter(a=>!r.has(a.name)),...rn(n)],s=k(k({},n),{},{elements:[...i].sort((a,o)=>Gh(a)-Gh(o))});return k(k({},e),{},{elements:rn(e).map(a=>a===n?s:a)})},Al=["w:rStyle","w:rFonts","w:b","w:bCs","w:i","w:iCs","w:caps","w:smallCaps","w:strike","w:dstrike","w:outline","w:shadow","w:emboss","w:imprint","w:noProof","w:snapToGrid","w:vanish","w:webHidden","w:color","w:spacing","w:w","w:kern","w:position","w:sz","w:szCs","w:highlight","w:u","w:effect","w:bdr","w:shd","w:fitText","w:vertAlign","w:rtl","w:cs","w:em","w:lang","w:eastAsianLayout","w:specVanish","w:oMath","w14:glow","w14:shadow","w14:reflection","w14:textOutline","w14:textFill","w14:scene3d","w14:props3d","w14:ligatures","w14:numForm","w14:numSpacing","w14:stylisticSets","w14:cntxtAlts"],Gh=e=>{var t;if(e.name==="w:rPrChange")return Al.length+1;let n=Al.indexOf((t=e.name)!==null&&t!==void 0?t:"");return n===-1?Al.length:n},rn=e=>{var t;return(t=e.elements)!==null&&t!==void 0?t:[]},ig=e=>{var t,n;let r=Number((t=e.attributes)===null||t===void 0?void 0:t["w:id"]);return((n=e.elements)!==null&&n!==void 0?n:[]).reduce((i,s)=>Math.max(i,ig(s)),Number.isInteger(r)?r:0)},x2=(e,t)=>e.length>t.length&&t.every((n,r)=>e[r]===n),k2=e=>e.filter(t=>!e.some(n=>x2(t.pathToParagraph,n.pathToParagraph))),sg=(e,t)=>{let n=e;for(let r=1;r<t.length;r++){let i=t[r];n=n.elements[i]}return n},T2=(e,t)=>sg(e,t.slice(0,t.length-1)),S2=e=>e[e.length-1],C2=new dn,_l="word/styles.xml",E2=new Set(["w:pStyle","w:rStyle","w:tblStyle","w:basedOn","w:next","w:link"]),Lr=e=>{var t;return String((t=e.attributes)===null||t===void 0?void 0:t["w:styleId"])},Ql=e=>{var t;let n=(t=e.elements)===null||t===void 0||(t=t.find(r=>r.name==="w:name"))===null||t===void 0||(t=t.attributes)===null||t===void 0?void 0:t["w:val"];return n===void 0?void 0:String(n).toLowerCase()},Ms=(e,t)=>{var n;return e==null||(n=e.elements)===null||n===void 0?void 0:n.find(r=>r.name===t)},zh=e=>{var t;let n=Number((t=Ms(e,"w:sz"))===null||t===void 0||(t=t.attributes)===null||t===void 0?void 0:t["w:val"]);return Number.isNaN(n)?void 0:n},A2=e=>{var t,n;let r=e.filter(a=>a.name==="w:style"),i=(t=r.find(a=>Lr(a)==="Normal"))!==null&&t!==void 0?t:r.find(a=>{var o;return((o=a.attributes)===null||o===void 0?void 0:o["w:type"])==="paragraph"&&Ql(a)==="normal"}),s=e.find(a=>a.name==="w:docDefaults");return(n=zh(Ms(i,"w:rPr")))!==null&&n!==void 0?n:zh(Ms(Ms(s,"w:rPrDefault"),"w:rPr"))},_2=(e,t)=>new Map(Object.values(wc({document:{run:{size:t}}})).map(n=>pt(j(C2.format(n,e))).elements[0]).filter(n=>n.name==="w:style").map(n=>[Lr(n),n])),N2=(e,t)=>{var n;let r=Te((n=e.get(_l))!==null&&n!==void 0?n:{},"w:styles"),i=r.filter(f=>f.name==="w:style"),s=new Set(i.map(Lr)),a,o=f=>{var m;return(m=a)!==null&&m!==void 0||(a=_2(t(_l),A2(r))),a.get(f)},c=new Set,l=new Map,u=f=>{let m=s.has(f)?void 0:o(f);if(m===void 0)return f;let g=i.find(y=>{var T,b;return((T=y.attributes)===null||T===void 0?void 0:T["w:type"])===((b=m.attributes)===null||b===void 0?void 0:b["w:type"])&&Ql(y)===Ql(m)});return g!==void 0?Lr(g):(c.add(f),f)},d=f=>(l.has(f)||l.set(f,u(f)),l.get(f)),p=f=>{var m;return E2.has((m=f.name)!==null&&m!==void 0?m:"")?k(k({},f),{},{attributes:k(k({},f.attributes),{},{"w:val":d(String(f.attributes["w:val"]))})}):f.elements===void 0?f:k(k({},f),{},{elements:f.elements.map(p)})};return{use:f=>f.map(p),write:()=>{let f=e.get(_l);if(!f)return;let m=Te(f,"w:styles"),g=new Set(m.map(Lr));for(let y of c)g.has(y)||(g.add(y),m.push(p(o(y))))}}},P2={type:Ce.PARAGRAPH,children:[]},I2=({json:e,key:t,patch:n,delimiters:{start:r,end:i},patchPlaceholder:s,renumberDrawings:a})=>{let o=`${r}${t}.`;for(let c of O2(e,o)){let l=M2(c.elements,o,i),u=n.rows.flatMap((d,p)=>{let h={type:"element",name:"w:tbl",elements:[...p===0?c.elements.map(D2):a(og(c.elements))]},f=new Map(Object.entries(d).flatMap(([m,g])=>g===void 0?[]:[[m,g]]));for(let[m,g]of f)s(h,`${t}.${m}`,g);for(let m of l.filter(g=>!f.has(g)))s(h,`${t}.${m}`,P2);return h.elements});c.parent.elements.splice(c.parent.elements.indexOf(c.elements[0]),c.elements.length,...u),c.table&&!ag(c.table.element)&&c.table.parent.elements.splice(c.table.parent.elements.indexOf(c.table.element),1)}},O2=(e,t)=>{let n=Ac(e,t).flatMap(i=>{let s=R2(e,i.pathToParagraph);return s?[s]:[]}),r=n.filter(i=>!n.some(s=>L2(i.path,s.path))).filter((i,s,a)=>a.findIndex(o=>o.row===i.row)===s);return[...new Set(r.map(i=>i.parent))].flatMap(i=>{let s=i.elements.filter(c=>c.name==="w:tr"),a=r.filter(c=>c.parent===i).map(c=>s.indexOf(c.row)).sort((c,l)=>c-l),{table:o}=r.find(c=>c.parent===i);return a.reduce((c,l)=>{let u=c[c.length-1];return u?.[u.length-1]===l-1?[...c.slice(0,-1),[...u,l]]:[...c,[l]]},[]).map(c=>{let l=i.elements.indexOf(s[c[0]]),u=i.elements.indexOf(s[c[c.length-1]]);return{parent:i,table:o,elements:i.elements.slice(l,u+1)}})})},R2=(e,t)=>{let n=e,r,i;for(let s=1;s<t.length;s++){let a=n.elements[t[s]];a.name==="w:tbl"&&(i={element:a,parent:n}),a.name==="w:tr"&&(r={parent:n,table:i,row:a,path:t.slice(0,s+1)}),n=a}return r},L2=(e,t)=>e.length>t.length&&t.every((n,r)=>e[r]===n),ag=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).some(n=>n.name==="w:tr"||n.name!=="w:tblPr"&&n.name!=="w:tblGrid"&&ag(n))},M2=(e,t,n)=>{let r=Ac({elements:[...e]},t).flatMap(({text:i})=>i.split(t).slice(1).flatMap(s=>{let a=s.indexOf(n);return a>0?[s.slice(0,a)]:[]}));return[...new Set(r)]},D2=e=>JSON.parse(JSON.stringify(e)),B2=["w14:paraId","w14:textId"],$2=["w:bookmarkStart","w:bookmarkEnd"],og=(e,t)=>e.filter(n=>{var r;return!$2.includes((r=n.name)!==null&&r!==void 0?r:"")&&!(t?.name==="w:sdtPr"&&n.name==="w:id")}).map(n=>k(k(k({},n),n.attributes===void 0?{}:{attributes:Object.fromEntries(Object.entries(n.attributes).filter(([r])=>!B2.includes(r)))}),n.elements===void 0?{}:{elements:[...og(n.elements,n)]})),F2=e=>e[0]===255&&e[1]===254||e[0]===254&&e[1]===255,q2=e=>{var t;let n=eE(e,"word/document.xml"),r=n===void 0||(t=[...e].find(([i])=>SC(i,n)))===null||t===void 0?void 0:t[1];return r===void 0||F2(r)?void 0:rc(rE(ta(r)))},js=(e,t,{start:n,end:r},i)=>{for(let s=e.indexOf(n,t);s!==-1;s=e.indexOf(n,s+1)){let a=e.indexOf(r,s+n.length);if(a===-1)return;let o=e.slice(s+n.length,a),c=o.trim();if(c!==o&&i(c))return{index:s,placeholder:e.slice(s,a+r.length),trimmed:`${n}${c}${r}`}}},H2=(e,t,n)=>{let r=e;for(let i=js(r,0,t,n);i!==void 0;i=js(r,i.index+i.trimmed.length,t,n))r=`${r.slice(0,i.index)}${i.trimmed}${r.slice(i.index+i.placeholder.length)}`;return r},lg=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(n=>[...n.name==="w:p"?[n]:[],...lg(n)])},U2=(e,t,n)=>{let r=()=>Yr({element:e,index:0,parent:void 0});for(let i=r(),s=js(i.text,0,t,n);s!==void 0;i=r(),s=js(i.text,s.index+s.trimmed.length,t,n))tg({paragraphElement:e,renderedParagraph:i,originalText:s.placeholder,replacementText:s.trimmed,fromIndex:s.index})},j2=(e,{delimiters:t,textKeys:n,tableRowsKeys:r,drawingKeys:i})=>{let s=c=>n.has(c)||r.some(l=>c.startsWith(`${l}.`));for(let c of lg(e))U2(c,t,s);let a=c=>i.has(c);for(let{properties:c}of na(e))for(let l of["descr","title"]){var o;let u=(o=c.attributes)===null||o===void 0?void 0:o[l];u!==void 0&&(c.attributes[l]=H2(String(u),t,a))}},cg=e=>{var t;return e.name==="v:shapetype"&&((t=e.attributes)===null||t===void 0?void 0:t.id)!==void 0?String(e.attributes.id):void 0},dg=e=>{var t;let n=cg(e);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(dg)]},W2=e=>{let t=new Set(dg(e)),n=r=>{let i=cg(r);return i!==void 0?t.has(i)?[]:(t.add(i),[r]):[r.elements===void 0?r:k(k({},r),{},{elements:r.elements.flatMap(n)})]};return r=>r.flatMap(n)},pg=(e,t,{inTableRow:n})=>{if(t?.type===Ce.TABLE_ROWS&&Array.isArray(t.rows)){for(let r of t.rows){if(typeof r!="object"||r===null)throw new Error(`Invalid patch "${e}". Expected each of its rows to be an object of patches, by the name of their field`);for(let[i,s]of Object.entries(r))s!==void 0&&pg(`${e}.${i}`,s,{inTableRow:!0})}return}if(!(t?.type===Ce.DRAWING?!n&&typeof t.patch=="function":t?.type!==Ce.TABLE_ROWS&&Array.isArray(t?.children)))throw new Error(`Invalid patch "${e}". Expected { type: PatchType.PARAGRAPH or PatchType.DOCUMENT, children: [...] }, ${n?"or { type: PatchType.TABLE_ROWS, rows: [...] }":"{ type: PatchType.TABLE_ROWS, rows: [...] }, or a drawing patch such as ImagePatch, or ChartDataPatch from docx/charts"}`)},Vh=new Uf,K2=new Uint8Array([255,254]),G2=new Uint8Array([254,255]),z2=new Set(["w:document","w:hdr","w:ftr","w:footnotes","w:endnotes","w:comments"]),Xh=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},eI=(function(){var e=Kt(function*({outputType:t,data:n,patches:r,keepOriginalStyles:i,placeholderDelimiters:s={start:"{{",end:"}}"},recursive:a=!0,trimPlaceholders:o=!1,footnotes:c,endnotes:l,numbering:u={config:[]},pageNumbers:d,properties:p}){let h=yield Yf(n),f=new Map,m=q2(h),g=[],y=new gf({addOverride:(D,$)=>g.push({contentType:D,partName:$})},new Set([...h.keys()].filter(D=>D.startsWith("word/")).map(D=>D.slice(5)))),T={Media:new mf(D=>y.takePath("media","image",D)),Numbering:new ff(u),Theme:m&&{Colors:m},FootNotes:{View:{idOf:(D,$,q)=>_t("footnotes",D,$,q)}},Endnotes:{View:{idOf:(D,$,q)=>_t("endnotes",D,$,q)}},PackageParts:y},b=new Map,C=[],_=[],w=!1,x=new Map;zf(s);let{start:v,end:A}=s;for(let[D,$]of Object.entries(r))pg(D,$,{inTableRow:!1});for(let[D,$]of h){var N;let q=$.slice(0,2);if(Xh(q,K2)||Xh(q,G2)){x.set(D,$);continue}if(!D.endsWith(".xml")&&!D.endsWith(".rels")){x.set(D,$);continue}let ie=pt(ta($)),se=(N=ie.elements)===null||N===void 0?void 0:N.find(ae=>{var te;return z2.has((te=ae.name)!==null&&te!==void 0?te:"")});if(se&&se.attributes){for(let ae of["mc","wp","r","w15","m","v","o"])se.attributes[`xmlns:${ae}`]=Ml[ae];se.attributes["mc:Ignorable"]=`${se.attributes["mc:Ignorable"]||""} w15`.trim()}b.set(D,ie)}let M=vE([...b.values()].flatMap(Wf)),O=OE([...b.values()].flatMap(Vf)),F=new Map,Q=D=>{let $=F.get(D);if($)return $;let q={Relationships:{addRelationship:(ie,se,ae,te)=>{_.push({key:D,id:ie,type:se,target:ae,targetMode:te})}}};return F.set(D,q),q},Z=D=>({file:T,viewWrapper:Q(D),stack:[]}),V=(D,$)=>{g.push({contentType:D,partName:$})},G=N2(b,Z),de=t2(T.Numbering,b,{createContext:Z,addContentTypeOverride:V}),ce=VE({footnotes:c,endnotes:l},b,{createContext:Z,addContentTypeOverride:V,renumberBookmarks:M,renumberDrawings:O,renumberLists:de.renumber,useStyles:G.use}),_t=(D,$,q,ie)=>ie.viewWrapper===Q("word/document.xml")?ce.carry(D,$,q):void 0;if(o){let D=q=>Object.entries(r).flatMap(([ie,se])=>q(se.type)?[ie]:[]),$={delimiters:{start:v,end:A},textKeys:new Set(D(q=>q!==Ce.TABLE_ROWS&&q!==Ce.DRAWING)),tableRowsKeys:D(q=>q===Ce.TABLE_ROWS),drawingKeys:new Set(D(q=>q===Ce.DRAWING))};for(let[q,ie]of b)q.startsWith("word/")&&!q.endsWith(".rels")&&j2(ie,$)}$E({parts:b,binaryParts:x,file:T,patches:Object.entries(r).flatMap(([D,$])=>$.type===Ce.DRAWING?[[D,$]]:[]),delimiters:{start:v,end:A}},Z);let Ae=Object.entries(r).flatMap(([D,$])=>$.type===Ce.DRAWING?[]:[[D,$]]),Ue=[...Ae.filter(([,D])=>D.type===Ce.TABLE_ROWS),...Ae.filter(([,D])=>D.type!==Ce.TABLE_ROWS)];for(let[D,$]of[...b]){if(!D.startsWith("word/")||D.endsWith(".xml.rels"))continue;let q=Z(D);f.set(D,q);let ie=W2($),se=(ae,te,Re)=>{if(Re.type===Ce.TABLE_ROWS){I2({json:ae,key:te,patch:Re,delimiters:{start:v,end:A},patchPlaceholder:se,renumberDrawings:O});return}let Uc=[],{didFindOccurrence:Zg}=p2({json:ae,patch:k(k({},Re),{},{children:Re.children.flatMap(je=>je instanceof qm?je.writtenAs:[je]).map(je=>{if(je instanceof O1){let{target:eb,anchor:tb}=Wm(je.options.link),jc=new mc(je.options.children,$n(),tb,je.options.link);return Uc.push({key:D,id:jc.linkId,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",target:eb,targetMode:oc.EXTERNAL}),jc}else return je})}),patchText:`${v}${te}${A}`,context:q,keepOriginalStyles:i,recursive:a,renumberIds:je=>G.use(de.renumber(ce.renumber(M(O(ie(je))))))});Zg&&_.push(...Uc)};for(let[ae,te]of Ue)se($,ae,te)}ce.write(),de.write(),G.write();for(let[D,$]of b){if(!D.startsWith("word/")||D.endsWith(".xml.rels"))continue;let q=Vh.getMediaData(JSON.stringify($),T.Media);q.length>0&&(w=!0,C.push({key:D,mediaDatas:q}))}for(let{key:D,mediaDatas:$}of C){var we;let q=Qe(D),ie=(we=b.get(q))!==null&&we!==void 0?we:Ur();b.set(q,ie);let se=Cc(ie),ae=Vh.replace(JSON.stringify(b.get(D)),$,se);b.set(D,JSON.parse(ae));for(let te=0;te<$.length;te++){let{fileName:Re}=$[te];Kl(ie,se+te,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${Re}`)}}for(let{key:D,id:$,type:q,target:ie,targetMode:se}of _){var ye;let ae=Qe(D),te=(ye=b.get(ae))!==null&&ye!==void 0?ye:Ur();b.set(ae,te),Kl(te,$,q,ie,se)}d&&(yield s2(b,d,x)),p&&NE(b,x,p,{addContentTypeOverride:V});let re=Tc(T,void 0);if(w||g.length>0){let D=b.get("[Content_Types].xml");if(!D)throw new Error("Could not find content types file");w&&(On(D,"image/png","png"),On(D,"image/jpeg","jpeg"),On(D,"image/jpeg","jpg"),On(D,"image/bmp","bmp"),On(D,"image/gif","gif"),On(D,"image/svg+xml","svg"));for(let{contentType:$,partName:q}of g)yE(D,$,q)}return jl(qs([...[...b].map(([D,$])=>[D,px($)]),...x,...T.Media.Array.map(({data:D,fileName:$})=>[`word/media/${$}`,D]),...re.map(({path:D,data:$})=>[D,$])]),t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document")});return function(n){return e.apply(this,arguments)}})(),V2=e=>e.startsWith("word/")&&/\.(xml|rels)$/.test(e)&&!e.endsWith(".xml.rels"),tI=(function(){var e=Kt(function*({data:t,placeholderDelimiters:n={start:"{{",end:"}}"},trimPlaceholders:r=!1}){zf(n);let i=X2(n),s=yield Yf(t,V2),a=new Set;for(let[,o]of s){let c=pt(ta(o));[...ng(c).map(l=>l.text),...na(c).flatMap(({properties:l})=>Xf(l))].flatMap(l=>{var u;return(u=l.match(i))!==null&&u!==void 0?u:[]}).map(l=>r?l.trim():l).filter(l=>l!=="").forEach(l=>a.add(l))}return Array.from(a)});return function(n){return e.apply(this,arguments)}})(),Nl=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X2=({start:e,end:t})=>new RegExp(`(?<=${Nl(e)})(?:(?!${Nl(e)}).)+?(?=${Nl(t)})`,"gs")});var wg={};ii(wg,{EXPORT_DIR:()=>Qr,FORMATS:()=>Nc,TX:()=>Jr,buildIR:()=>aa,caseRows:()=>sa,exportDoc:()=>Pc,irToDocx:()=>vg,irToHtml:()=>oa});import hg from"node:fs";import mg from"node:path";function Y2(e){return`${String(e.getDate()).padStart(2,"0")}/${String(e.getMonth()+1).padStart(2,"0")}/${e.getFullYear()}`}function Q2(e,t){let n=e.result;if(!n)return[t.status["not-run"]];let r=[t.status[n.status]];return n.actual&&r.push(t.actual+n.actual),n.bug&&r.push(t.bug+n.bug),r}function sa(e,t,n,r){let i=e.kind==="non-functional",s=e.cases.filter(l=>!l.deleted),a=[...i?n.headNf:n.headFn],o=[7,27,38,28];t.results&&(a.push(...n.headResult),o=[8,20,27,20,13,12]);let c=s.map((l,u)=>{let p=[[String(u+1),...t.codes?[l.code]:[]],ia(i&&l.requirement||l.case),ia(l.steps),ia(l.expected)];return t.results&&p.push(Q2(l,n),l.result?[l.result.by??"",J2(l.result.at,r)].filter(Boolean):[]),p});return{head:a,widths:o,rows:c}}function gg(e){let t=tn();for(let n of e)yr(n,t);return t}function aa(e,t={}){let n=e.config,r=n.overview??{},i=t.date??new Date,s=n.language==="en"?"en":"vi",a=Jr[s],o=[],c=b=>en(e,b),l=e.modules.filter(b=>c(b.code).some(C=>C.kind==="functional")),u=e.modules.filter(b=>c(b.code).some(C=>C.kind==="non-functional")),d=Ve(e.root,n.ba),p=d?bt(d):null;o.push({k:"cover",lines:[...r.owner?[{text:r.owner.toUpperCase(),bold:!0}]:[],{text:""},{text:a.coverDoc,bold:!0,size:32},{text:a.coverTitle,bold:!0,size:32},{text:n.title,bold:!0,size:28},{text:""},{text:a.docVersion+(r.docVersion||"1.0")},...t.results?[{text:a.withResults}]:[],{text:""},...r.owner?[{text:a.owner+r.owner}]:[],...r.contractor?[{text:a.contractor+r.contractor}]:[],{text:""},{text:(r.place?r.place+", ":"")+(s==="vi"?Y2(i):i.toISOString().slice(0,10))}]}),o.push({k:"pagebreak"}),o.push({k:"p",text:a.signPage,bold:!0});let h=n.members.length?n.members:[{id:"",name:"",role:""}];o.push({k:"table",head:a.signHead,widths:[6,16,30,28,20],rows:h.map((b,C)=>[[String(C+1)],[""],[b.name],[b.role??""],[""]])}),o.push({k:"pagebreak"}),o.push({k:"toc",title:a.toc}),o.push({k:"pagebreak"});let f=0;o.push({k:"h",level:1,text:`${fg[f++]}. ${a.overview}`}),o.push({k:"h",level:2,text:a.purpose}),o.push({k:"p",text:r.purpose||a.purposeText(n.title)}),o.push({k:"h",level:2,text:a.scope}),r.scope?o.push({k:"p",text:r.scope}):(o.push({k:"p",text:a.scopeIntro}),o.push({k:"list",items:e.modules.filter(b=>c(b.code).length).map(b=>b.title)})),o.push({k:"h",level:2,text:a.env}),o.push({k:"p",text:r.environment||a.envDefault}),o.push({k:"h",level:2,text:a.refs}),o.push({k:"p",text:r.references||a.refsIntro}),r.references||o.push({k:"list",items:a.refsList}),o.push({k:"h",level:2,text:a.terms});let m=r.terms?.length?r.terms:a.termsDefault;o.push({k:"table",head:a.termsHead,widths:[8,30,62],rows:m.map((b,C)=>[[String(C+1)],[b.term],[b.desc]])});let g=(b,C,_)=>{if(o.push({k:"pagebreak"}),o.push({k:"h",level:1,text:`${fg[f++]}. ${b}`}),!C.length){o.push({k:"p",text:a.noSuites,italic:!0});return}C.forEach((w,x)=>{o.push({k:"h",level:2,text:`${x+1}. ${w.title}`}),_==="functional"&&w.commonSteps.trim()&&(o.push({k:"p",text:a.commonSteps,bold:!0}),o.push({k:"list",items:ia(w.commonSteps)})),c(w.code).filter(v=>v.kind===_).forEach((v,A)=>{o.push({k:"h",level:3,text:`${x+1}.${A+1}. ${v.title}`});let N=[v.useCases.length?a.useCase+v.useCases.join(", "):"",v.covers.length?a.functions+v.covers.map(O=>p?.get(O)?.title?`${O} (${p.get(O).title})`:O).join("; "):""].filter(Boolean);if(N.length&&o.push({k:"p",text:N.join(" \xB7 "),italic:!0}),v.preconditions&&o.push({k:"p",text:a.pre+v.preconditions}),v.description.trim())for(let O of v.description.trim().split(/\n\s*\n/))o.push({k:"p",text:O.trim()});let M=sa(v,t,a,s);M.rows.length?o.push({k:"table",...M}):o.push({k:"p",text:a.noCases,italic:!0})})})};g(a.chFn,l,"functional"),g(a.chNf,u,"non-functional");let y=[];t.results&&y.push(()=>{o.push({k:"h",level:2,text:a.sumTitle});let b=e.modules.map(w=>({m:w,c:gg(c(w.code))})).filter(w=>w.c.total),C=gg(e.modules.flatMap(w=>c(w.code))),_=w=>w.total?Math.round(100*w.passed/w.total)+"%":"\u2014";o.push({k:"table",head:a.sumHead,widths:[30,10,8,10,9,9,11,13],rows:[...b.map(({m:w,c:x})=>[[w.title],[String(x.total)],[String(x.passed)],[String(x.failed)],[String(x.blocked)],[String(x.skipped)],[String(x["not-run"])],[_(x)]]),[[a.total],[String(C.total)],[String(C.passed)],[String(C.failed)],[String(C.blocked)],[String(C.skipped)],[String(C["not-run"])],[_(C)]]]})});let T=e.suites.filter(b=>b.status!=="deleted"&&b.covers.length);if(T.length&&y.push(()=>{o.push({k:"h",level:2,text:a.matrix});let b=new Map;for(let C of T)for(let _ of C.covers)b.set(_,[...b.get(_)??[],C.title]);o.push({k:"table",head:a.matrixHead,widths:[8,42,50],rows:[...b.entries()].sort((C,_)=>C[0].localeCompare(_[0])).map(([C,_],w)=>[[String(w+1)],[p?.get(C)?.title?`${C} \u2013 ${p.get(C).title}`:C],_])})}),y.length){o.push({k:"pagebreak"}),o.push({k:"h",level:1,text:a.appendix});for(let b of y)b()}return{title:n.title,lang:s,results:!!t.results,nodes:o}}function oa(e){let t=[],n=e.nodes.filter(s=>s.k==="h"),r=0;for(let s of e.nodes)if(s.k==="cover")t.push(`<section class="cover">${s.lines.map(a=>a.text?`<p class="${a.bold?"b":""}"${a.size?` style="font-size:${a.size/2}pt"`:""}>${Et(a.text)}</p>`:"<p>&nbsp;</p>").join("")}</section>`);else if(s.k==="h")t.push(`<h${s.level} id="h${r++}">${Et(s.text)}</h${s.level}>`);else if(s.k==="p")t.push(`<p${s.bold||s.italic?` class="${s.bold?"b":""} ${s.italic?"i":""}"`:""}>${Et(s.text).replace(/\n/g,"<br>")}</p>`);else if(s.k==="list")t.push(`<ul>${s.items.map(a=>`<li>${Et(a)}</li>`).join("")}</ul>`);else if(s.k==="toc")t.push(`<nav class="toc"><p class="b">${Et(s.title)}</p>${n.map((a,o)=>`<a class="l${a.level}" href="#h${o}">${Et(a.text)}</a>`).join("")}</nav>`);else if(s.k==="pagebreak")t.push('<div class="pb"></div>');else if(s.k==="table"){let a=s.widths?`<colgroup>${s.widths.map(o=>`<col style="width:${o}%">`).join("")}</colgroup>`:"";t.push(`<table>${a}<thead><tr>${s.head.map(o=>`<th>${Et(o)}</th>`).join("")}</tr></thead><tbody>${s.rows.map(o=>`<tr>${o.map(c=>`<td>${c.map(Et).join("<br>")}</td>`).join("")}</tr>`).join("")}</tbody></table>`)}return`<!doctype html><html lang="${e.lang}"><head><meta charset="utf-8"><title>${Et(e.title)}</title><style>body{background:#e9ecef;margin:0;font:12pt/1.45 "Times New Roman",serif;color:#111}
5342
+ `;case"w:noBreakHyphen":return"-";default:return""}},jk=e=>{let t=[],n=r=>{let i=ct(r);if(i!==void 0&&Hk.has(i))return dt(r).map(n).join("");if(i==="w:fldChar"){let s=$e(r,"w:fldCharType");return s==="begin"?t.push(!1):s==="separate"?t[t.length-1]=!0:t.pop(),""}return t.every(Boolean)?Uk(r):""};return dt(e).map(n).join("")},Im=e=>{let t=ct(e);return t==="w:bookmarkStart"?[{start:!0,id:$e(e,"w:id"),name:$e(e,"w:name")}]:t==="w:bookmarkEnd"?[{start:!1,id:$e(e,"w:id")}]:t===void 0||t==="_attr"?[]:dt(e).flatMap(Im)},Wk=e=>{let t=new Map;return e.map(n=>{let r=Im(n),i=new Set([...t.values(),...r.flatMap(s=>s.start?[s.name]:[])]);for(let s of r)s.start?t.set(s.id,s.name):t.delete(s.id);return i})},Kk=(e,t)=>{let n=t?Wk(e):[];return e.map((r,i)=>{var s;let a=Je(r,"w:pPr");return{element:r,styleId:$e(Je(a,"w:pStyle"),"w:val"),outlineLevel:dc(Je(a,"w:outlineLvl"),"w:val"),text:jk(r),bookmarks:(s=n[i])!==null&&s!==void 0?s:new Set}})},Om=e=>{var t;let n=(t=e.file)===null||t===void 0||(t=t.Styles)===null||t===void 0?void 0:t.prepForXml(e);return new Map(dt(n).filter(r=>ct(r)==="w:style"&&["paragraph",void 0].includes($e(r,"w:type"))).map(r=>[$e(r,"w:styleId"),{name:$e(Je(r,"w:name"),"w:val"),basedOn:$e(Je(r,"w:basedOn"),"w:val"),outlineLevel:dc(Je(Je(r,"w:pPr"),"w:outlineLvl"),"w:val")}]))},Rm=e=>{let t=/^\s*(\d+)\s*-\s*(\d+)\s*$/.exec(e);return t?[Number(t[1]),Number(t[2])]:void 0},Il=(e,[t,n])=>e>=t&&e<=n,pc=(e,t)=>{var n,r;if(e===void 0)return;let i=/^heading ?([1-9])$/i.exec((n=(r=t.get(e))===null||r===void 0?void 0:r.name)!==null&&n!==void 0?n:e);return i?Number(i[1]):void 0},Lm=(e,t,n=0)=>{var r;if(e===void 0||n>t.size)return;let i=t.get(e),s=pc(e,t);return(r=i?.outlineLevel)!==null&&r!==void 0?r:s===void 0?Lm(i?.basedOn,t,n+1):s-1},Gk=e=>{let t=Om(e);return n=>{let r=Je(n,"w:pPr"),i=$e(Je(r,"w:pStyle"),"w:val"),s=pc(i,t),a=Dm({styleId:i,outlineLevel:dc(Je(r,"w:outlineLvl"),"w:val")},t),o=a===void 0||a>=9?void 0:a+1;return s!==void 0&&(o===void 0||o===s)?s:o===void 0?void 0:"unclear"}},Dm=(e,t)=>{var n;return(n=e.outlineLevel)!==null&&n!==void 0?n:Lm(e.styleId,t)},zk=(e,t,n)=>{var r;let{entriesFromBookmark:i,headingStyleRange:s,stylesWithLevels:a=[],useAppliedParagraphOutlineLevel:o}=e;if(t.text.trim()===""||i&&!t.bookmarks.has(i))return;let c=[t.styleId,t.styleId===void 0||(r=n.get(t.styleId))===null||r===void 0?void 0:r.name].filter(f=>f!==void 0).map(f=>f.toLowerCase()),l=a.find(f=>c.includes(f.styleName.toLowerCase()));if(l)return l.level;let u=!!s||a.length>0||!!o||!!e.tcFieldIdentifier||!!e.tcFieldLevelRange||!!e.captionLabel||!!e.captionLabelIncludingNumbers,d=s?Rm(s):u?void 0:[1,9],p=pc(t.styleId,n);if(d&&p!==void 0&&Il(p,d))return p;let h=o?Dm(t,n):void 0;return h!==void 0&&Il(h+1,d??[1,9])?h+1:void 0},Vk=(e,t)=>{let n=t.preserveTabInEntries?e:e.replace(/\t/g," ");return(t.preserveNewLineInEntries?n.split(`
5343
+ `):[n.replace(/\n/g," ")]).map((r,i)=>new Oe({break:i>0?1:void 0,children:r.split(" ").flatMap((s,a)=>[...a>0?[new Xs]:[],...s===""?[]:[s]])}))},Xk=({text:e,separator:t})=>t==="tab"?[new Oe(e),new Oe({children:[new Xs]})]:[new Oe(`${e} `)],Yk=(e,t)=>{let n=240*(e-1)+t+240;return n<=1920?Math.ceil(n/240)*240:Math.round(n)},Jk=(e,t)=>{var n,r;return(n=(r=[...t].find(([,i])=>{var s;return((s=i.name)===null||s===void 0?void 0:s.toLowerCase())===`toc ${e}`}))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:`TOC${e}`},Qk=({properties:e,beginDirty:t,textWidth:n,tabLeader:r},i,s,a)=>{var o;let c=e.pageNumbersEntryLevelsRange?(o=Rm(e.pageNumbersEntryLevelsRange))!==null&&o!==void 0?o:[1,9]:void 0,l=new _m;return i.forEach((u,d)=>{var p;let h=c===void 0||!Il(u.level,c),f=[...u.listNumber?Xk(u.listNumber):[],...Vk(u.title,e),...h?[new Oe({children:[e.entryAndPageNumberSeparator||new Xs]}),new B1(u.bookmark,{hyperlink:e.hyperlink})]:[]];l.addChildElement(new ne({style:Jk(u.level,s),tabStops:[...((p=u.listNumber)===null||p===void 0?void 0:p.separator)==="tab"?[{type:"left",position:Yk(u.level,u.listNumber.width)}]:[],{type:"right",position:n,leader:r}],children:[...d===0?[new qe({children:[Nm(t),new Am(e),sn()]})]:[],...e.hyperlink?[new Fm({anchor:u.bookmark,children:f})]:f]}))}),l.addChildElement(new ne({children:[new qe({children:[an()]})]})),l.prepForXml(a)},Zk=(e,t,n,r)=>{let i=dt(e),s=i.findIndex(a=>ct(a)==="w:pPr")+1;e["w:p"]=[...i.slice(0,s),new Um(t,n).prepForXml(r),...i.slice(s),new jm(n).prepForXml(r)]},e1=(e,t,n,r)=>{let i=Pm(dt(e)),s=i.flatMap(u=>{let d=cc.get(u);return d?[[u,d]]:[]});if(s.length===0)return;let a=Om(t),o=s.some(([,{properties:u}])=>!!u.entriesFromBookmark),c=Kk(i.filter(u=>ct(u)==="w:p"),o).map(u=>({paragraph:u,levels:s.map(([,{properties:d}])=>zk(d,u,a))})).filter(({levels:u})=>u.some(d=>d!==void 0)).map((u,d)=>k(k({},u),{},{id:n.get(d)}));for(let{paragraph:u,id:d}of c)Zk(u.element,`_Toc${d}`,d,t);let l=c.length>0?r?.(e):void 0;s.forEach(([u,d],p)=>{let h=c.flatMap(({paragraph:f,levels:m,id:g})=>{let y=m[p],T=l?.get(`_Toc${g}`);return y===void 0?[]:[k({title:f.text,level:y,bookmark:`_Toc${g}`},T?{listNumber:T}:{})]});h.length!==0&&(u["w:sdt"]=dt(u).map(f=>ct(f)==="w:sdtContent"?Qk(d,h,a,t):f))})},t1=new RegExp("^\\p{L}[\\p{L}\\p{N}_]*$","u"),n1=e=>{var t,n;let r,i=!1,s,a=!1,o=!1;for(let d=0;d<e.length;d++){var c,l;let p=e[d],h=(c=e[d+1])!==null&&c!==void 0?c:"",f;if(d===0&&!p.startsWith("\\"))f={type:"bookmark"};else if(p==="\\c"||p==="\\n")f={type:p==="\\c"?"repeat":"next"};else if((p==="\\r"||p==="\\s")&&/^\d+$/.test(h))d++,f=p==="\\r"?{type:"reset",to:Number(h)}:{type:"heading",level:Number(h)};else if(p==="\\h")i=!0;else if(p==="\\#"&&d+1<e.length)d++,o=!0;else if(p==="\\*"&&d+1<e.length){let m=e[++d];if(km.has(m.toLowerCase()))a=!0;else if(!xm.has(m.toLowerCase())){if(s!==void 0)return;s=m}}else return;if(f&&r)return;r=(l=f)!==null&&l!==void 0?l:r}if(r?.type==="bookmark"&&e.length>1)return;let u=!o&&!(a&&s!==void 0&&s.toLowerCase()!=="arabic");return{step:(t=r)!==null&&t!==void 0?t:{type:"next"},hidden:i&&s===void 0,format:u?(n=s)!==null&&n!==void 0?n:"ARABIC":""}},uc=e=>{var t;let n=new RegExp("^\\s*SEQ\\b(.*)$","is").exec(e);if(!n)return;let[r,...i]=(t=n[1].match(/"[^"]*"|\S+/g))!==null&&t!==void 0?t:[];if(r===void 0)return{};let s=r.replace(/^"(.*)"$/,"$1");return t1.test(s)?{identifier:s,sequence:n1(i)}:{identifier:s}},r1=e=>uc(e)!==void 0,Ol=e=>typeof e!="object"||e===null?[]:Array.isArray(e)?e.flatMap(Ol):Object.entries(e).flatMap(([t,n])=>[...(t==="w:instrText"&&Array.isArray(n)?n:t==="_attr"?[n["w:instr"]]:[]).flatMap(r=>{let i=typeof r=="string"?uc(r):void 0;return i?.identifier===void 0?[]:[i.identifier.toLowerCase()]}),...Ol(n)]),i1=e=>{var t;let n=(t=e.file)===null||t===void 0?void 0:t.Comments;if(!n)return new Set;let r={View:n,Relationships:n.Relationships};return new Set(Ol(n.prepForXml(k(k({},e),{},{viewWrapper:r,stack:[]}))))},s1=e=>{let t=Gk(e),n=new Map,r=new Map,i=[],s=-1,a=-1,o,c=(l,u)=>{var d;let p=Math.max(-1,...i.slice(1,u+1).filter(m=>m!==void 0)),h=((d=r.get(l))!==null&&d!==void 0?d:[]).filter(m=>m.paragraph>=p),f=h.every(({step:m})=>m?.type==="next"||m?.type==="heading"&&m.level===u);return s>p||!f?void 0:h.length+1};return{startParagraph:l=>{a++;let u=t(l);u==="unclear"?s=a:u!==void 0&&(i[u]=a)},numberOf:(l,u)=>{var d,p,h;let{identifier:f,sequence:m}=uc(l);if(f===void 0||u==="fallback")return;(d=o)!==null&&d!==void 0||(o=i1(e));let g=f.toLowerCase();if(m?.step.type==="bookmark"&&u==="counted"&&!o.has(g))return;let y=n.has(g)?n.get(g):0,T=o.has(g)||u==="deleted"?void 0:m?.step,b=T?.type==="reset"?T.to:T?.type==="repeat"?y:T?.type==="heading"?c(g,T.level):T?.type==="next"&&y!==void 0?y+1:void 0;return n.set(g,b),r.set(g,[...(p=r.get(g))!==null&&p!==void 0?p:[],k({paragraph:a},b===void 0?{}:{step:T})]),b===void 0||m===void 0?void 0:m.hidden?"":(h=lc(m.format))===null||h===void 0?void 0:h(b)}}},sl=e=>{let t=typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.keys(e)[0]:void 0;return t==="_attr"?void 0:t},th=e=>({"w:t":[{_attr:{"xml:space":"preserve"}},e]}),Vs={nameOf:sl,contentOf:e=>{let t=e[sl(e)];return Array.isArray(t)?t:void 0},attributeOf:(e,t)=>{var n;let r=e[sl(e)],i=Array.isArray(r)?r.find(s=>typeof s=="object"&&s!==null&&"_attr"in s):r;return i==null||(n=i._attr)===null||n===void 0?void 0:n[t]},textOf:e=>Vs.contentOf(e).filter(t=>typeof t=="string").join(""),textElement:th,writeClean:e=>{if($x(e)){let t=e["w:fldChar"]._attr;e["w:fldChar"]={_attr:Object.fromEntries(Object.entries(t).filter(([n])=>n!=="w:dirty"))}}},setSimpleFieldResult:(e,t)=>{let n=e["w:fldSimple"];e["w:fldSimple"]=[...(Array.isArray(n)?n:[n]).filter(r=>typeof r=="object"&&r!==null&&"_attr"in r),{"w:r":[th(t)]}]}},Mm=new WeakMap,a1=(e,t)=>{let{startParagraph:n,numberOf:r}=s1(t);Bk(Vs,e,{beforeParagraph:i=>n(i),resultOf:(i,s)=>r1(i)?r(i,s):void 0})},o1=(e,t,n)=>{let r=n(e,t),i=Cm(Vs,e,r,{blank:!1});t.file&&Mm.set(t.file,{estimate:r,partPageCounts:i})},zr=(e,t,n)=>{let r=t.file&&Mm.get(t.file);if(!e||!r)return;let i=n===void 0?void 0:r.partPageCounts.get(`rId${n}`),s="w:footnotes"in e||"w:endnotes"in e;Em(Vs,e,r.estimate,{blank:!1,sectionPageCount:i,notes:s})},l1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns"})}},be=class Bm extends P{constructor(){super("Relationships"),this.root.push(new l1({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}addRelationship(t,n,r,i){this.root.push(xk(`rId${t}`,n,r,i))}static copy(t){let n=new Bm;return n.root.push(...t.root.slice(1)),n}get RelationshipCount(){return this.root.length-1}},c1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}},d1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:cx":"xmlns:cx","xmlns:cx1":"xmlns:cx1","xmlns:cx2":"xmlns:cx2","xmlns:cx3":"xmlns:cx3","xmlns:cx4":"xmlns:cx4","xmlns:cx5":"xmlns:cx5","xmlns:cx6":"xmlns:cx6","xmlns:cx7":"xmlns:cx7","xmlns:cx8":"xmlns:cx8","xmlns:mc":"xmlns:mc","xmlns:aink":"xmlns:aink","xmlns:am3d":"xmlns:am3d","xmlns:o":"xmlns:o","xmlns:r":"xmlns:r","xmlns:m":"xmlns:m","xmlns:v":"xmlns:v","xmlns:wp14":"xmlns:wp14","xmlns:wp":"xmlns:wp","xmlns:w10":"xmlns:w10","xmlns:w":"xmlns:w","xmlns:w14":"xmlns:w14","xmlns:w15":"xmlns:w15","xmlns:w16cex":"xmlns:w16cex","xmlns:w16cid":"xmlns:w16cid","xmlns:w16":"xmlns:w16","xmlns:w16sdtdh":"xmlns:w16sdtdh","xmlns:w16se":"xmlns:w16se","xmlns:wpg":"xmlns:wpg","xmlns:wpi":"xmlns:wpi","xmlns:wne":"xmlns:wne","xmlns:wps":"xmlns:wps","mc:Ignorable":"mc:Ignorable"})}},nh=class extends P{constructor({id:e,initials:t,author:n,date:r=new Date,children:i},s){super("w:comment"),E(this,"paraId",void 0),this.paraId=s,this.root.push(new c1({id:e,initials:t,author:n,date:r.toISOString()}));for(let a of i)this.root.push(a)}prepForXml(e){let t=super.prepForXml(e);if(!t||!this.paraId)return t;let n=t["w:comment"];if(!Array.isArray(n))return t;for(let r=n.length-1;r>=0;r--){let i=n[r];if(i&&typeof i=="object"&&"w:p"in i){let s=i["w:p"];Array.isArray(s)&&s.unshift({_attr:{"w14:paraId":this.paraId,"w14:textId":this.paraId}});break}}return t}},p1=e=>(e+1).toString(16).toUpperCase().padStart(8,"0"),u1=class extends P{constructor({children:e}){super("w:comments"),E(this,"relationships",void 0),E(this,"threadData",void 0),E(this,"commentIdsData",void 0),E(this,"isEmpty",void 0),this.isEmpty=e.length===0,this.root.push(new d1({"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","xmlns:cx":"http://schemas.microsoft.com/office/drawing/2014/chartex","xmlns:cx1":"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex","xmlns:cx2":"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex","xmlns:cx3":"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex","xmlns:cx4":"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex","xmlns:cx5":"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex","xmlns:cx6":"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex","xmlns:cx7":"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex","xmlns:cx8":"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:aink":"http://schemas.microsoft.com/office/drawing/2016/ink","xmlns:am3d":"http://schemas.microsoft.com/office/drawing/2017/model3d","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:m":"http://schemas.openxmlformats.org/officeDocument/2006/math","xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:wp14":"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing","xmlns:wp":"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing","xmlns:w10":"urn:schemas-microsoft-com:office:word","xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main","xmlns:w14":"http://schemas.microsoft.com/office/word/2010/wordml","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","xmlns:w16cex":"http://schemas.microsoft.com/office/word/2018/wordml/cex","xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:w16":"http://schemas.microsoft.com/office/word/2018/wordml","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16se":"http://schemas.microsoft.com/office/word/2015/wordml/symex","xmlns:wpg":"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup","xmlns:wpi":"http://schemas.microsoft.com/office/word/2010/wordprocessingInk","xmlns:wne":"http://schemas.microsoft.com/office/word/2006/wordml","xmlns:wps":"http://schemas.microsoft.com/office/word/2010/wordprocessingShape","mc:Ignorable":"w14 w15 wp14"}));let t=e.some(r=>r.parentId!==void 0),n=e.some(r=>r.durableId!==void 0);if(t||n){let r=new Map(e.map(i=>[i.id,p1(i.id)]));for(let i of e)this.root.push(new nh(i,r.get(i.id)));t&&(this.threadData=e.map(i=>({paraId:r.get(i.id),parentParaId:i.parentId!==void 0?r.get(i.parentId):void 0,done:i.resolved}))),n&&(this.commentIdsData=e.map(i=>{var s;return{paraId:r.get(i.id),durableId:(s=i.durableId)!==null&&s!==void 0?s:r.get(i.id)}}))}else for(let r of e)this.root.push(new nh(r));this.relationships=new be}get Relationships(){return this.relationships}get ThreadData(){return this.threadData}get CommentIdsData(){return this.commentIdsData}get IsEmpty(){return this.isEmpty}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},h1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:mc":"xmlns:mc","xmlns:w15":"xmlns:w15","mc:Ignorable":"mc:Ignorable"})}},m1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{paraId:"w15:paraId",paraIdParent:"w15:paraIdParent",done:"w15:done"})}},f1=class extends P{constructor(e){super("w15:commentEx"),this.root.push(new m1({paraId:e.paraId,paraIdParent:e.parentParaId,done:e.done!==void 0?e.done?"1":"0":void 0}))}},g1=class extends P{constructor(e){super("w15:commentsEx"),this.root.push(new h1({"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","mc:Ignorable":"w15"}));for(let t of e)this.root.push(new f1(t))}},b1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{paraId:"w16cid:paraId",durableId:"w16cid:durableId"})}},v1=class extends P{constructor(e){super("w16cid:commentId"),this.root.push(new b1({paraId:e.paraId,durableId:e.durableId}))}},w1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:w16cid":"xmlns:w16cid","xmlns:mc":"xmlns:mc","mc:Ignorable":"mc:Ignorable"})}},y1=class extends P{constructor(e){super("w16cid:commentsIds"),this.root.push(new w1({"xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"w16cid"}));for(let t of e)this.root.push(new v1(t))}},x1=class extends cm{constructor(){super("w:endnoteRef")}},Xs=class extends cm{constructor(){super("w:tab")}},k1={COLUMN:"column",PAGE:"page"},T1=class extends P{constructor(e){super("w:br"),this.root.push(new _e({type:e}))}},$m=class extends qe{constructor(){super({}),this.root.push(new T1(k1.PAGE))}},S1=class extends P{constructor(){super("w:pageBreakBefore")}},Dn={AT_LEAST:"atLeast",EXACTLY:"exactly",EXACT:"exact",AUTO:"auto"},C1=({after:e,before:t,line:n,lineRule:r,beforeAutoSpacing:i,afterAutoSpacing:s})=>new L({name:"w:spacing",attributes:{after:{key:"w:after",value:e},before:{key:"w:before",value:t},line:{key:"w:line",value:n},lineRule:{key:"w:lineRule",value:r},beforeAutoSpacing:{key:"w:beforeAutospacing",value:i},afterAutoSpacing:{key:"w:afterAutospacing",value:s}}}),Ys={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"},Nr=e=>new L({name:"w:pStyle",attributes:{val:{key:"w:val",value:e}}}),rh={LEFT:"left",RIGHT:"right",CENTER:"center",BAR:"bar",CLEAR:"clear",DECIMAL:"decimal",END:"end",NUM:"num",START:"start"},E1={DOT:"dot",HYPHEN:"hyphen",MIDDLE_DOT:"middleDot",NONE:"none",UNDERSCORE:"underscore"},A1=({type:e,position:t,leader:n})=>new L({name:"w:tab",attributes:{val:{key:"w:val",value:e},pos:{key:"w:pos",value:at(t)},leader:{key:"w:leader",value:n}}}),_1=e=>new L({name:"w:tabs",children:e.map(t=>A1(t))}),Ts=class extends P{constructor(e,t){super("w:numPr"),this.root.push(new N1(t)),this.root.push(new P1(e))}},N1=class extends P{constructor(e){if(super("w:ilvl"),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new _e({val:e}))}},P1=class extends P{constructor(e){super("w:numId"),this.root.push(new _e({val:typeof e=="string"?`{${e}}`:e}))}},hc=class extends P{constructor(...e){super(...e),E(this,"fileChild",Symbol())}},I1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}},mc=class extends P{constructor(e,t,n,r){super("w:hyperlink"),E(this,"linkId",void 0),E(this,"drawingLink",void 0),this.linkId=t,this.drawingLink=n&&r!==void 0?new kk(r):void 0;let i=new I1({history:1,anchor:n||void 0,id:!n||r!==void 0?`rId${this.linkId}`:void 0});this.root.push(i),e.forEach(s=>{this.root.push(s)})}createDrawingClick(e,t){return this.drawingLink?(this.drawingLink.addRelationship(e),this.drawingLink.createClick(t)):ym(this.linkId,t)}},Fm=class extends mc{constructor(e){super(e.children,$n(),e.anchor)}},O1=class extends P{constructor(e){super("w:externalHyperlink"),E(this,"options",void 0),this.options=e}},R1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",name:"w:name"})}},L1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id"})}},qm=class Hm{constructor(t){E(this,"start",void 0),E(this,"children",void 0),E(this,"end",void 0);let n=gm();this.start=new Um(t.id,n),this.children=t.children,this.end=new jm(n)}get writtenAs(){return[this.start,...this.children.flatMap(t=>t instanceof Hm?t.writtenAs:[t]),this.end]}},Um=class extends P{constructor(e,t){super("w:bookmarkStart");let n=new R1({name:e,id:t});this.root.push(n)}},jm=class extends P{constructor(e){super("w:bookmarkEnd");let t=new L1({id:e});this.root.push(t)}},D1=e=>new L({name:"w:outlineLvl",attributes:{val:{key:"w:val",value:e}}}),M1=class extends P{constructor(e,t={}){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE}));let n=`PAGEREF ${e}`;t.hyperlink&&(n=`${n} \\h`),t.useRelativePosition&&(n=`${n} \\p`),this.root.push(n)}},B1=class extends qe{constructor(e,t={}){super({children:[fm(),new M1(e,t),sn(),an()]})}},$1=255,Wm=e=>{let t=e.indexOf("#"),n=e.length-t-1;return t>0&&n>0&&n<=$1?{target:e.slice(0,t),anchor:e.slice(t+1)}:{target:e}},Bs=(e,t,n)=>n===void 0?`${e}-${t}`:`${e}-restart ${n}`,Ss=({id:e,fontKey:t,subsetted:n},r)=>new L({name:r,attributes:k({id:{key:"r:id",value:e}},t?{fontKey:{key:"w:fontKey",value:`{${t.toUpperCase()}}`}}:{}),children:[...n?[new I("w:subsetted",n)]:[]]}),F1=({name:e,altName:t,panose1:n,charset:r,family:i,notTrueType:s,pitch:a,sig:o,embedRegular:c,embedBold:l,embedItalic:u,embedBoldItalic:d})=>new L({name:"w:font",attributes:{name:{key:"w:name",value:e}},children:[...t?[kr("w:altName",t)]:[],...n?[kr("w:panose1",n)]:[],...r?[kr("w:charset",r)]:[],...i?[kr("w:family",i)]:[],...s?[new I("w:notTrueType",s)]:[],...a?[kr("w:pitch",a)]:[],...o?[new L({name:"w:sig",attributes:{usb0:{key:"w:usb0",value:o.usb0},usb1:{key:"w:usb1",value:o.usb1},usb2:{key:"w:usb2",value:o.usb2},usb3:{key:"w:usb3",value:o.usb3},csb0:{key:"w:csb0",value:o.csb0},csb1:{key:"w:csb1",value:o.csb1}}})]:[],...c?[Ss(c,"w:embedRegular")]:[],...l?[Ss(l,"w:embedBold")]:[],...u?[Ss(u,"w:embedItalic")]:[],...d?[Ss(d,"w:embedBoldItalic")]:[]]}),q1=({name:e,characterSet:t,embedRegular:n,embedBold:r,embedItalic:i,embedBoldItalic:s})=>F1({name:e,sig:{usb0:"E0002AFF",usb1:"C000247B",usb2:"00000009",usb3:"00000000",csb0:"000001FF",csb1:"00000000"},charset:t,family:"auto",pitch:"variable",embedRegular:n,embedBold:r,embedItalic:i,embedBoldItalic:s}),H1=e=>new L({name:"w:fonts",attributes:{mc:{key:"xmlns:mc",value:"http://schemas.openxmlformats.org/markup-compatibility/2006"},r:{key:"xmlns:r",value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},w:{key:"xmlns:w",value:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},w14:{key:"xmlns:w14",value:"http://schemas.microsoft.com/office/word/2010/wordml"},w15:{key:"xmlns:w15",value:"http://schemas.microsoft.com/office/word/2012/wordml"},w16cex:{key:"xmlns:w16cex",value:"http://schemas.microsoft.com/office/word/2018/wordml/cex"},w16cid:{key:"xmlns:w16cid",value:"http://schemas.microsoft.com/office/word/2016/wordml/cid"},w16:{key:"xmlns:w16",value:"http://schemas.microsoft.com/office/word/2018/wordml"},w16sdtdh:{key:"xmlns:w16sdtdh",value:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"},w16se:{key:"xmlns:w16se",value:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Ignorable:{key:"mc:Ignorable",value:"w14 w15 w16se w16cid w16 w16cex w16sdtdh"}},children:e.map(q1)}),U1=[{option:"data",element:"embedRegular",bold:!1,italic:!1},{option:"bold",element:"embedBold",bold:!0,italic:!1},{option:"italic",element:"embedItalic",bold:!1,italic:!0},{option:"boldItalic",element:"embedBoldItalic",bold:!0,italic:!0}],Km=class{constructor(e){E(this,"options",void 0),E(this,"fontTable",void 0),E(this,"relationships",void 0),E(this,"fontOptionsWithKey",[]),E(this,"files",[]),this.options=e;let t=e.map(n=>U1.flatMap(({option:r,element:i,bold:s,italic:a})=>{let o=n[r];return o?[{element:i,file:{name:n.name,data:o,bold:s,italic:a,fontKey:bm()}}]:[]}));this.files=t.flatMap(n=>n.map(({file:r})=>r)),this.fontOptionsWithKey=e.map((n,r)=>k(k({},n),{},{fontKey:t[r][0].file.fontKey})),this.fontTable=H1(e.map((n,r)=>k({name:n.name,characterSet:n.characterSet},Object.fromEntries(t[r].map(({element:i,file:s})=>[i,{id:`rId${this.files.indexOf(s)+1}`,fontKey:s.fontKey}]))))),this.relationships=new be;for(let n=0;n<this.files.length;n++)this.relationships.addRelationship(n+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",`fonts/font${n+1}.odttf`)}get View(){return this.fontTable}get Relationships(){return this.relationships}},j1=()=>new L({name:"w:wordWrap",attributes:{val:{key:"w:val",value:0}}}),W1=e=>{var t,n;return new L({name:"w:framePr",attributes:{anchorLock:{key:"w:anchorLock",value:e.anchorLock},dropCap:{key:"w:dropCap",value:e.dropCap},width:{key:"w:w",value:e.width},height:{key:"w:h",value:e.height},x:{key:"w:x",value:e.position?e.position.x:void 0},y:{key:"w:y",value:e.position?e.position.y:void 0},anchorHorizontal:{key:"w:hAnchor",value:e.anchor.horizontal},anchorVertical:{key:"w:vAnchor",value:e.anchor.vertical},spaceHorizontal:{key:"w:hSpace",value:(t=e.space)===null||t===void 0?void 0:t.horizontal},spaceVertical:{key:"w:vSpace",value:(n=e.space)===null||n===void 0?void 0:n.vertical},rule:{key:"w:hRule",value:e.rule},alignmentX:{key:"w:xAlign",value:e.alignment?e.alignment.x:void 0},alignmentY:{key:"w:yAlign",value:e.alignment?e.alignment.y:void 0},lines:{key:"w:lines",value:e.lines},wrap:{key:"w:wrap",value:e.wrap}}})},al=new WeakMap,K1=Bn(),G1={left:"right",right:"left"},Mn=class extends St{constructor(e,{implicitListParagraphStyle:t=!0,inListOrder:n=!0}={}){if(super("w:pPr",e?.includeIfEmpty),E(this,"numbering",void 0),E(this,"numberProperties",void 0),!e)return this;if(e.heading&&this.push(Nr(e.heading)),t&&(e.bullet&&this.push(Nr("ListParagraph")),e.numbering&&!e.numbering.custom&&!e.style&&!e.heading&&this.push(Nr("ListParagraph"))),e.style&&this.push(Nr(e.style)),e.keepNext!==void 0&&this.push(new I("w:keepNext",e.keepNext)),e.keepLines!==void 0&&this.push(new I("w:keepLines",e.keepLines)),e.pageBreakBefore&&this.push(new S1),e.frame&&this.push(W1(e.frame)),e.widowControl!==void 0&&this.push(new I("w:widowControl",e.widowControl)),e.bullet&&this.push(new Ts(1,e.bullet.level)),e.numbering){let{reference:i,instance:s,level:a,restart:o}=e.numbering,c=typeof i=="string"?i:i.reference,l=new Ts(Bs(c,s??0),a);this.numbering={reference:c,level:a,instance:s,restartedListId:o&&n&&s===void 0?K1():void 0,definition:typeof i=="string"?void 0:i},this.numberProperties=l,this.push(l)}else e.numbering===!1&&this.push(new Ts(0,0));e.border&&this.push(new Rx(e.border)),e.thematicBreak&&this.push(new Lx),e.shading&&this.push(zs(e.shading)),e.wordWrap&&this.push(j1()),e.overflowPunctuation&&this.push(new I("w:overflowPunct",e.overflowPunctuation));let r=[...e.rightTabStop!==void 0?[{type:rh.RIGHT,position:e.rightTabStop}]:[],...e.tabStops?e.tabStops:[],...e.leftTabStop!==void 0?[{type:rh.LEFT,position:e.leftTabStop}]:[]];r.length>0&&this.push(_1(r)),e.bidirectional!==void 0&&this.push(new I("w:bidi",e.bidirectional)),e.spacing&&this.push(C1(e.spacing)),e.indent&&this.push(Dx(e.indent)),e.contextualSpacing!==void 0&&this.push(new I("w:contextualSpacing",e.contextualSpacing)),e.alignment&&this.push(dm(e.bidirectional&&G1[e.alignment]||e.alignment)),e.outlineLevel!==void 0&&this.push(D1(e.outlineLevel)),e.suppressLineNumbers!==void 0&&this.push(new I("w:suppressLineNumbers",e.suppressLineNumbers)),e.autoSpaceEastAsianText!==void 0&&this.push(new I("w:autoSpaceDN",e.autoSpaceEastAsianText)),e.run&&this.push(new vk(e.run)),e.revision&&this.push(new ih(e.revision))}push(e){this.root.push(e)}addSectionProperties(e){let t=this.root.findIndex(n=>n instanceof ih);if(t===-1){this.root.push(e);return}this.root.splice(t,0,e)}removeSectionProperties(e){let t=this.root.indexOf(e);t!==-1&&this.root.splice(t,1)}prepForXml(e){var t;if(this.numbering){var n,r;let{reference:a,level:o,instance:c=0,definition:l}=this.numbering,u=this.numbering.instance===void 0?(n=this.numbering.restartedListId)!==null&&n!==void 0?n:(r=al.get(e))===null||r===void 0?void 0:r.get(a):void 0;e.viewWrapper instanceof Km||e.file.Numbering.createConcreteNumberingInstance(a,c,l,u);let d=new Ts(Bs(a,c,u),o);this.root.splice(this.root.indexOf(this.numberProperties),1,d),this.numberProperties=d}let i=super.prepForXml(e);if(((t=this.numbering)===null||t===void 0?void 0:t.restartedListId)!==void 0){var s;al.set(e,new Map([...(s=al.get(e))!==null&&s!==void 0?s:[],[this.numbering.reference,this.numbering.restartedListId]]))}return i}},ih=class extends P{constructor(e){super("w:pPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new Mn(k(k({},e),{},{includeIfEmpty:!0}),{inListOrder:!1}))}},ne=class Gm extends hc{constructor(t){if(super("w:p"),E(this,"options",void 0),E(this,"properties",void 0),E(this,"alignment",void 0),this.options=typeof t=="string"?{text:t}:t,typeof t=="string")return this.alignment={},this.properties=new Mn({}),this.root.push(this.properties),this.root.push(new Oe(t)),this;if(this.alignment={alignment:t.alignment,bidirectional:t.bidirectional},this.properties=new Mn(t),this.root.push(this.properties),t.text&&this.root.push(new Oe(t.text)),t.children)for(let n of t.children){if(n instanceof qm){this.root.push(...n.writtenAs);continue}this.root.push(n)}}prepForXml(t){for(let n of this.root)if(Ws(n)==="w:externalHyperlink"){let r=this.root.indexOf(n),{options:i}=n,{target:s,anchor:a}=Wm(i.link),o=new mc(i.children,$n(),a,i.link);t.viewWrapper.Relationships.addRelationship(o.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",s,oc.EXTERNAL),this.root[r]=o}return super.prepForXml(t)}addSectionProperties(t){this.properties.addSectionProperties(t)}removeSectionProperties(t){this.properties.removeSectionProperties(t)}get Alignment(){return this.alignment}with(t){return new Gm(k(k({},this.options),t))}addRunToFront(t){return this.root.splice(1,0,t),this}},z1={TOP:"top",CENTER:"center",BOTTOM:"bottom"},ZP=k(k({},z1),{},{BOTH:"both"}),zm=e=>new L({name:"w:vAlign",attributes:{verticalAlign:{key:"w:val",value:e}}}),V1=({space:e,count:t,separate:n,equalWidth:r,children:i})=>new L({name:"w:cols",attributes:{space:{key:"w:space",value:e===void 0?void 0:ve(e)},count:{key:"w:num",value:t===void 0?void 0:le(t)},separate:{key:"w:sep",value:n},equalWidth:{key:"w:equalWidth",value:r}},children:!r&&i?i:void 0}),X1=({type:e,linePitch:t,charSpace:n})=>new L({name:"w:docGrid",attributes:{type:{key:"w:type",value:e},linePitch:{key:"w:linePitch",value:le(t)},charSpace:{key:"w:charSpace",value:n?le(n):void 0}}}),Ln={DEFAULT:"default",FIRST:"first",EVEN:"even"},sh={HEADER:"w:headerReference",FOOTER:"w:footerReference"},ol=(e,t)=>new L({name:e,attributes:{type:{key:"w:type",value:t.type||Ln.DEFAULT},id:{key:"r:id",value:`rId${t.id}`}}}),Y1=({countBy:e,start:t,restart:n,distance:r})=>new L({name:"w:lnNumType",attributes:{countBy:{key:"w:countBy",value:e===void 0?void 0:le(e)},start:{key:"w:start",value:t===void 0?void 0:le(t)},restart:{key:"w:restart",value:n},distance:{key:"w:distance",value:r===void 0?void 0:ve(r)}}}),Vm=({name:e,position:t,numberFormat:n,start:r,restart:i})=>new L({name:e,children:[...t===void 0?[]:[new L({name:"w:pos",attributes:{val:{key:"w:val",value:t}}})],...n?[new L({name:"w:numFmt",attributes:{val:{key:"w:val",value:n.type},format:{key:"w:format",value:n.format}}})]:[],...r===void 0?[]:[new L({name:"w:numStart",attributes:{val:{key:"w:val",value:le(r)}}})],...i===void 0?[]:[new L({name:"w:numRestart",attributes:{val:{key:"w:val",value:i}}})]]}),J1=e=>Vm(k({name:"w:footnotePr"},e)),Q1=e=>Vm(k({name:"w:endnotePr"},e)),ah=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}},Z1=class extends St{constructor(e){if(super("w:pgBorders"),!e)return this;e.pageBorders?this.root.push(new ah({display:e.pageBorders.display,offsetFrom:e.pageBorders.offsetFrom,zOrder:e.pageBorders.zOrder})):this.root.push(new ah({})),e.pageBorderTop&&this.root.push(he("w:top",e.pageBorderTop)),e.pageBorderLeft&&this.root.push(he("w:left",e.pageBorderLeft)),e.pageBorderBottom&&this.root.push(he("w:bottom",e.pageBorderBottom)),e.pageBorderRight&&this.root.push(he("w:right",e.pageBorderRight))}},eT=(e,t,n,r,i,s,a)=>new L({name:"w:pgMar",attributes:{top:{key:"w:top",value:at(e)},right:{key:"w:right",value:ve(t)},bottom:{key:"w:bottom",value:at(n)},left:{key:"w:left",value:ve(r)},header:{key:"w:header",value:ve(i)},footer:{key:"w:footer",value:ve(s)},gutter:{key:"w:gutter",value:ve(a)}}}),tT={HYPHEN:"hyphen",PERIOD:"period",COLON:"colon",EM_DASH:"emDash",EN_DASH:"endash"},nT=({start:e,formatType:t,separator:n,chapterHeadingLevel:r})=>new L({name:"w:pgNumType",attributes:{start:{key:"w:start",value:e===void 0?void 0:le(e)},formatType:{key:"w:fmt",value:t},separator:{key:"w:chapSep",value:n===tT.EN_DASH?"enDash":n},chapterHeadingLevel:{key:"w:chapStyle",value:r===void 0?void 0:le(r)}}}),$s={PORTRAIT:"portrait",LANDSCAPE:"landscape"},rT=({width:e,height:t,orientation:n,code:r})=>{let i=ve(e),s=ve(t);return new L({name:"w:pgSz",attributes:{width:{key:"w:w",value:n===$s.LANDSCAPE?s:i},height:{key:"w:h",value:n===$s.LANDSCAPE?i:s},orientation:{key:"w:orient",value:n},code:{key:"w:code",value:r}}})},iT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},sT=class extends P{constructor(e){super("w:textDirection"),this.root.push(new iT({val:e}))}},aT=e=>new L({name:"w:type",attributes:{val:{key:"w:val",value:e}}}),it={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},Ns={WIDTH:11906,HEIGHT:16838,ORIENTATION:$s.PORTRAIT},Rl=class Xm extends P{constructor({page:{size:{width:t=Ns.WIDTH,height:n=Ns.HEIGHT,orientation:r=Ns.ORIENTATION,code:i}={},margin:{top:s=it.TOP,right:a=it.RIGHT,bottom:o=it.BOTTOM,left:c=it.LEFT,header:l=it.HEADER,footer:u=it.FOOTER,gutter:d=it.GUTTER}={},pageNumbers:p={},borders:h,textDirection:f}={},grid:{linePitch:m=360,charSpace:g,type:y}={},headerWrapperGroup:T={},footerWrapperGroup:b={},lineNumbers:C,titlePage:_,verticalAlign:w,column:x,type:v,footnoteProperties:A,endnoteProperties:N,revision:D}={}){super("w:sectPr"),E(this,"availableTextWidth",void 0),this.availableTextWidth=Xm.calculateAvailableTextWidth({pageWidth:r===$s.LANDSCAPE?n:t,left:c,right:a,gutter:d,column:x}),this.addHeaderFooterGroup(sh.HEADER,T),this.addHeaderFooterGroup(sh.FOOTER,b),A&&this.root.push(J1(A)),N&&this.root.push(Q1(N)),v&&this.root.push(aT(v)),this.root.push(rT({width:t,height:n,orientation:r,code:i})),this.root.push(eT(s,a,o,c,l,u,d)),h&&this.root.push(new Z1(h)),C&&this.root.push(Y1(C)),this.root.push(nT(p)),x&&this.root.push(V1(x)),w&&this.root.push(zm(w)),_!==void 0&&this.root.push(new I("w:titlePg",_)),f&&this.root.push(new sT(f)),this.root.push(X1({linePitch:m,charSpace:g,type:y})),D&&this.root.push(new oT(D))}get AvailableTextWidth(){return this.availableTextWidth}static calculateAvailableTextWidth({pageWidth:t,left:n,right:r,gutter:i,column:s}){var a,o;let c=qt(t)-qt(n)-qt(r)-qt(i),l=(a=s?.count)!==null&&a!==void 0?a:1;return l<=1?c:(c-qt((o=s?.space)!==null&&o!==void 0?o:720)*(l-1))/l}addHeaderFooterGroup(t,n){n.default&&this.root.push(ol(t,{type:Ln.DEFAULT,id:n.default.View.ReferenceId})),n.first&&this.root.push(ol(t,{type:Ln.FIRST,id:n.first.View.ReferenceId})),n.even&&this.root.push(ol(t,{type:Ln.EVEN,id:n.even.View.ReferenceId}))}},oT=class extends P{constructor(e){super("w:sectPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new Rl(e))}},Ym=class extends P{constructor({pageNumbers:e}={}){super("w:body"),E(this,"sections",[]),E(this,"sectionParagraphs",new Map),E(this,"headingBookmarkIds",new Fk),E(this,"pageNumbers",void 0),this.pageNumbers=e}getSectionPropertiesFor(e){let t=e?Math.max(this.root.indexOf(e),0):0;for(let n=t;n<this.root.length;n++){let r=this.root[n];if(r instanceof Rl)return r;let i=this.sectionParagraphs.get(r);if(i)return i}return this.sections[this.sections.length-1]}addSection(e){let t=this.sections.pop(),n=this.lastParagraphOfSection();if(t&&n)this.sectionParagraphs.set(n,t);else{let r=this.createSectionParagraph();this.root.push(r),t&&this.sectionParagraphs.set(r,t)}this.sections.push(new Rl(e))}prepForXml(e){var t;this.sections.length===1&&(this.root.splice(0,1),this.root.push(this.sections.pop()));for(let[i,s]of this.sectionParagraphs)i.addSectionProperties(s);let n;try{n=super.prepForXml(e)}finally{for(let[i,s]of this.sectionParagraphs)i.removeSectionProperties(s)}let r=(t=this.pageNumbers)===null||t===void 0?void 0:t.listNumbers;return e1(n,e,this.headingBookmarkIds,r&&(i=>r(i,e))),this.pageNumbers&&(a1(n,e),o1(n,e,this.pageNumbers)),n}push(e){let t=e instanceof ne?this.sectionParagraphs.get(e):void 0;if(t){let n=this.createSectionParagraph();this.root.splice(this.root.indexOf(e)+1,0,n),this.sectionParagraphs.delete(e),this.sectionParagraphs.set(n,t)}this.root.push(e)}lastParagraphOfSection(){let e=this.root[this.root.length-1];return e instanceof ne&&e!==this.root[0]&&!this.sectionParagraphs.has(e)&&this.root.indexOf(e)===this.root.length-1?e:void 0}createSectionParagraph(){return new ne({})}},Fe={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"},$r=(e,{type:t=Fe.AUTO,size:n})=>{let r=n;return t===Fe.PERCENTAGE&&typeof n=="number"&&(r=Math.round(n*50)),new L({name:e,attributes:{type:{key:"w:type",value:t},size:{key:"w:w",value:lm(r)}}})},Ps=Ns.WIDTH-it.LEFT-it.RIGHT-it.GUTTER,Jm=e=>e.options.columnSpan||1,fc=(e,t)=>{if(!e)return;let{type:n=Fe.AUTO,size:r}=e;if(n!==Fe.PERCENTAGE&&n!==Fe.DXA)return;let i=typeof r=="number"?n===Fe.PERCENTAGE?r/100*t:r:r.endsWith("%")?Number(r.slice(0,-1))/100*t:qt(r);return i>0?i:void 0},lT=(e,t)=>{var n;return(n=fc(e,t))!==null&&n!==void 0?n:t},cT=e=>Math.max(0,...e.map(t=>t.cells.reduce((n,r)=>n+Jm(r),0))),oh=({rows:e,width:t,availableWidth:n})=>{let r=cT(e);if(r===0)return[];let i=lT(t,n),s=Array.from({length:r},()=>{}),a=[];for(let u of e){let d=0;for(let p of u.cells){let h=Jm(p),f=fc(p.options.width,i);if(f!==void 0)if(h===1){var o,c;(c=s[o=d])!==null&&c!==void 0||(s[o]=f)}else a.push({start:d,span:h,width:f});d+=h}}for(let{start:u,span:d,width:p}of a){let h=Array.from({length:d},(g,y)=>u+y).filter(g=>g<r),f=h.filter(g=>s[g]===void 0),m=p-h.reduce((g,y)=>{var T;return g+((T=s[y])!==null&&T!==void 0?T:0)},0);if(f.length>0&&m>0)for(let g of f)s[g]=m/f.length}let l=s.flatMap((u,d)=>u===void 0?[d]:[]);if(l.length>0){let u=i-s.reduce((p,h)=>p+(h??0),0),d=u>0?u/l.length:i/r;for(let p of l)s[p]=d}return s.map(u=>Math.round(u))},dT=e=>new L({name:"w:gridCol",attributes:e!==void 0?{width:{key:"w:w",value:ve(e)}}:void 0}),Is=class extends P{constructor(e,t){super("w:tblGrid");for(let n of e)this.root.push(dT(n));t&&this.root.push(new uT(t))}},pT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id"})}},uT=class extends P{constructor(e){super("w:tblGridChange"),this.root.push(new pT({id:e.id})),this.root.push(new Is(e.columnWidths))}},hT=class extends P{constructor(e){super("w:ins"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},mT=class extends P{constructor(e){super("w:del"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},fT=class extends P{constructor(e){super("w:cellIns"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},gT=class extends P{constructor(e){super("w:cellDel"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},bT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date",verticalMerge:"w:vMerge",verticalMergeOriginal:"w:vMergeOrig"})}},vT=class extends P{constructor(e){super("w:cellMerge"),this.root.push(new bT(e))}},Qm=({marginUnitType:e=Fe.DXA,top:t,left:n,bottom:r,right:i})=>[{name:"w:top",size:t},{name:"w:left",size:n},{name:"w:bottom",size:r},{name:"w:right",size:i}].filter(s=>s.size!==void 0).map(({name:s,size:a})=>$r(s,{type:e,size:a})),wT=e=>{let t=Qm(e);if(t.length!==0)return new L({name:"w:tblCellMar",children:t})},yT=e=>{let t=Qm(e);if(t.length!==0)return new L({name:"w:tcMar",children:t})},xT=class extends St{constructor(e){super("w:tcBorders"),e.top&&this.root.push(he("w:top",e.top)),e.start&&this.root.push(he("w:start",e.start)),e.left&&this.root.push(he("w:left",e.left)),e.bottom&&this.root.push(he("w:bottom",e.bottom)),e.end&&this.root.push(he("w:end",e.end)),e.right&&this.root.push(he("w:right",e.right)),e.diagonalDown&&this.root.push(he("w:tl2br",e.diagonalDown)),e.diagonalUp&&this.root.push(he("w:tr2bl",e.diagonalUp))}},kT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},TT=class extends P{constructor(e){super("w:gridSpan"),this.root.push(new kT({val:le(e)}))}},Zm={CONTINUE:"continue",RESTART:"restart"},ST=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},lh=class extends P{constructor(e){super("w:vMerge"),this.root.push(new ST({val:e}))}},CT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},ET=class extends P{constructor(e){super("w:textDirection"),this.root.push(new CT({val:e}))}},ef=class extends St{constructor(e){if(super("w:tcPr",e.includeIfEmpty),E(this,"hasWidth",void 0),E(this,"hasColumnWidth",!1),this.hasWidth=e.width!==void 0,e.width&&this.root.push($r("w:tcW",e.width)),e.columnSpan&&this.root.push(new TT(e.columnSpan)),e.verticalMerge?this.root.push(new lh(e.verticalMerge)):e.rowSpan&&e.rowSpan>1&&this.root.push(new lh(Zm.RESTART)),e.borders&&this.root.push(new xT(e.borders)),e.shading&&this.root.push(zs(e.shading)),e.margins){let t=yT(e.margins);t&&this.root.push(t)}e.textDirection&&this.root.push(new ET(e.textDirection)),e.verticalAlign&&this.root.push(zm(e.verticalAlign)),e.insertion&&this.root.push(new fT(e.insertion)),e.deletion&&this.root.push(new gT(e.deletion)),e.cellMerge&&this.root.push(new vT(e.cellMerge)),e.revision&&this.root.push(new AT(e.revision))}setColumnWidth(e){this.hasWidth||(this.root.splice(0,this.hasColumnWidth?1:0,$r("w:tcW",{size:e,type:Fe.DXA})),this.hasColumnWidth=!0)}},AT=class extends P{constructor(e){super("w:tcPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new ef(k(k({},e),{},{includeIfEmpty:!0})))}},Fr=class extends P{constructor(e){super("w:tc"),E(this,"options",void 0),E(this,"properties",void 0),this.options=e,this.properties=new ef(e),this.root.push(this.properties);for(let t of e.children)this.root.push(t)}setColumnWidth(e){this.properties.setColumnWidth(e)}prepForXml(e){return Ws(this.root[this.root.length-1])!=="w:p"&&this.root.push(new ne({})),super.prepForXml(e)}},Ll=(e,t)=>t?new I(e):new ot(e,"off"),In={style:Gr.NONE,size:0,color:"auto"},_T={style:Gr.SINGLE,size:4,color:"auto"},tf=class extends St{constructor(e,{fillMissingSides:t=!0}={}){super("w:tblBorders");let n=[["w:top",e.top],["w:left",e.left],["w:bottom",e.bottom],["w:right",e.right],["w:insideH",e.insideHorizontal],["w:insideV",e.insideVertical]];for(let[r,i]of n){let s=i??(t?_T:void 0);s&&this.root.push(he(r,s))}}};E(tf,"NONE",{top:In,bottom:In,left:In,right:In,insideHorizontal:In,insideVertical:In});ll={CENTER:"center",INSIDE:"inside",LEFT:"left",OUTSIDE:"outside",RIGHT:"right"},NT={CENTER:"center",INSIDE:"inside",BOTTOM:"bottom",OUTSIDE:"outside",INLINE:"inline",TOP:"top"},PT=({horizontalAnchor:e,verticalAnchor:t,absoluteHorizontalPosition:n,relativeHorizontalPosition:r,absoluteVerticalPosition:i,relativeVerticalPosition:s,bottomFromText:a,topFromText:o,leftFromText:c,rightFromText:l})=>new L({name:"w:tblpPr",attributes:{leftFromText:{key:"w:leftFromText",value:c===void 0?void 0:ve(c)},rightFromText:{key:"w:rightFromText",value:l===void 0?void 0:ve(l)},topFromText:{key:"w:topFromText",value:o===void 0?void 0:ve(o)},bottomFromText:{key:"w:bottomFromText",value:a===void 0?void 0:ve(a)},absoluteHorizontalPosition:{key:"w:tblpX",value:n===void 0?void 0:at(n)},absoluteVerticalPosition:{key:"w:tblpY",value:i===void 0?void 0:at(i)},horizontalAnchor:{key:"w:horzAnchor",value:e},relativeHorizontalPosition:{key:"w:tblpXSpec",value:r},relativeVerticalPosition:{key:"w:tblpYSpec",value:s},verticalAnchor:{key:"w:vertAnchor",value:t}}}),IT=e=>new L({name:"w:tblLayout",attributes:{type:{key:"w:type",value:e}}}),OT={DXA:"dxa",NIL:"nil"},nf=({type:e=OT.DXA,value:t})=>new L({name:"w:tblCellSpacing",attributes:{type:{key:"w:type",value:e},value:{key:"w:w",value:lm(t)}}}),RT=({firstRow:e,lastRow:t,firstColumn:n,lastColumn:r,noHBand:i,noVBand:s})=>new L({name:"w:tblLook",attributes:{firstRow:{key:"w:firstRow",value:e},lastRow:{key:"w:lastRow",value:t},firstColumn:{key:"w:firstColumn",value:n},lastColumn:{key:"w:lastColumn",value:r},noHBand:{key:"w:noHBand",value:i},noVBand:{key:"w:noVBand",value:s}}}),LT=e=>new L({name:"w:tblOverlap",attributes:{val:{key:"w:val",value:e}}}),DT={[ll.LEFT]:ue.LEFT,[ll.CENTER]:ue.CENTER,[ll.RIGHT]:ue.RIGHT},gc=class extends St{constructor(e){var t,n,r;super("w:tblPr",e.includeIfEmpty),e.style&&this.root.push(new ot("w:tblStyle",e.style));let i=((t=e.float)===null||t===void 0?void 0:t.relativeVerticalPosition)===NT.INLINE,s=i?void 0:e.float;s&&this.root.push(PT(s)),s?.overlap&&this.root.push(LT(s.overlap)),e.visuallyRightToLeft!==void 0&&this.root.push(Ll("w:bidiVisual",e.visuallyRightToLeft)),e.width&&this.root.push($r("w:tblW",e.width));let a=(n=e.alignment)!==null&&n!==void 0?n:i&&(!((r=e.float)===null||r===void 0)&&r.relativeHorizontalPosition)?DT[e.float.relativeHorizontalPosition]:void 0;if(a&&this.root.push(dm(a)),e.cellSpacing&&this.root.push(nf(e.cellSpacing)),e.indent&&this.root.push($r("w:tblInd",e.indent)),e.borders&&this.root.push(new tf(e.borders,{fillMissingSides:!e.style})),e.shading&&this.root.push(zs(e.shading)),e.layout&&this.root.push(IT(e.layout)),e.cellMargin){let o=wT(e.cellMargin);o&&this.root.push(o)}e.tableLook&&this.root.push(RT(e.tableLook)),e.revision&&this.root.push(new MT(e.revision))}},MT=class extends P{constructor(e){super("w:tblPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new gc(k(k({},e),{},{includeIfEmpty:!0})))}},BT=(e,t)=>new L({name:"w:trHeight",attributes:{value:{key:"w:val",value:ve(e)},rule:{key:"w:hRule",value:t}}}),rf=class extends St{constructor(e){super("w:trPr",e.includeIfEmpty),e.cantSplit!==void 0&&this.root.push(Ll("w:cantSplit",e.cantSplit)),e.tableHeader!==void 0&&this.root.push(Ll("w:tblHeader",e.tableHeader)),e.height&&this.root.push(BT(e.height.value,e.height.rule)),e.cellSpacing&&this.root.push(nf(e.cellSpacing)),e.insertion&&this.root.push(new hT(e.insertion)),e.deletion&&this.root.push(new mT(e.deletion)),e.revision&&this.root.push(new $T(e.revision))}},$T=class extends P{constructor(e){super("w:trPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new rf(k(k({},e),{},{includeIfEmpty:!0})))}},Fs=(e,t)=>{let n=e[t];return Array.isArray(n)?n:[]},Ir=e=>Object.keys(e)[0],FT=(e,t)=>{let n=Fs(e,"w:p"),r=n.find(o=>Ir(o)==="w:pPr");if(!r)return{"w:p":[{"w:pPr":[t]},...n]};let i=Fs(r,"w:pPr");if(i.some(o=>Ir(o)==="w:keepNext"))return e;let s=i.filter(o=>Ir(o)==="w:pStyle").length,a={"w:pPr":[...i.slice(0,s),t,...i.slice(s)]};return{"w:p":n.map(o=>o===r?a:o)}},Js=class extends P{constructor(e){super("w:tr"),E(this,"options",void 0),this.options=e,this.root.push(new rf(e));for(let t of e.children)this.root.push(t)}prepForXml(e){if(this.cells.length===0)return;let t=super.prepForXml(e);if(!t||this.options.keepNext===void 0)return t;let n=new I("w:keepNext",this.options.keepNext).prepForXml(e);return{"w:tr":Fs(t,"w:tr").map(r=>Ir(r)==="w:tc"?{"w:tc":Fs(r,"w:tc").map(i=>Ir(i)==="w:p"?FT(i,n):i)}:r)}}get CellCount(){return this.options.children.length}get cells(){return this.root.filter(e=>Ws(e)==="w:tc")}addCellToIndex(e,t){this.root.splice(t+1,0,e)}addCellToColumnIndex(e,t){let n=this.columnIndexToRootIndex(t,!0);this.addCellToIndex(e,n-1)}rootIndexToColumnIndex(e){if(e<1||e>=this.root.length)throw new Error(`cell 'rootIndex' should between 1 to ${this.root.length-1}`);let t=0;for(let n=1;n<e;n++){let r=this.root[n];t+=r.options.columnSpan||1}return t}columnIndexToRootIndex(e,t=!1){if(e<0)throw new Error("cell 'columnIndex' should not less than zero");let n=0,r=1;for(;n<=e;){if(r>=this.root.length){if(t)return this.root.length;throw new Error(`cell 'columnIndex' should not great than ${n-1}`)}let i=this.root[r];r+=1,n+=i&&i.options.columnSpan||1}return r-1}},sf=class af extends hc{constructor({rows:t,width:n,columnWidths:r,columnWidthsRevision:i,margins:s,indent:a,float:o,layout:c,style:l,borders:u,alignment:d,visuallyRightToLeft:p,tableLook:h,cellSpacing:f,revision:m}){super("w:tbl"),E(this,"rows",void 0),E(this,"width",void 0),E(this,"columnWidths",void 0),E(this,"columnWidthsRevision",void 0),E(this,"resolvedColumnWidths",void 0),this.rows=t,this.width=n??{size:100},this.columnWidths=r,this.columnWidthsRevision=i,t.forEach((g,y)=>{if(y===t.length-1)return;let T=0;g.cells.forEach(b=>{if(b.options.rowSpan&&b.options.rowSpan>1){let C=b.options.children[b.options.children.length-1],_=new Fr({rowSpan:b.options.rowSpan-1,columnSpan:b.options.columnSpan,width:b.options.width,borders:b.options.borders,shading:b.options.shading,margins:b.options.margins,textDirection:b.options.textDirection,verticalAlign:b.options.verticalAlign,children:C instanceof ne?[new ne(C.Alignment)]:[],verticalMerge:Zm.CONTINUE});t[y+1].addCellToColumnIndex(_,T)}T+=b.options.columnSpan||1})}),this.setCellWidths(Ps),this.resolvedColumnWidths=r??oh({rows:t,width:this.width,availableWidth:Ps}),this.root.push(new gc({borders:l?u:u??{},width:this.width,indent:a,float:o,layout:c,style:l,alignment:d,cellMargin:s,visuallyRightToLeft:p,tableLook:h,cellSpacing:f,revision:m})),this.root.push(new Is(this.resolvedColumnWidths,i));for(let g of t)this.root.push(g)}get ColumnWidths(){return this.resolvedColumnWidths}getCellWidth(t,n){let{cells:r}=t,i=r.indexOf(n);if(i===-1)return;let s=r.slice(0,i).reduce((o,c)=>o+(c.options.columnSpan||1),0),a=this.resolvedColumnWidths.slice(s,s+(n.options.columnSpan||1));return a.length===0?void 0:a.reduce((o,c)=>o+c,0)}prepForXml(t){if(this.setCellWidths(this.resolveAvailableWidth(t)),this.columnWidths===void 0){this.resolvedColumnWidths=oh({rows:this.rows,width:this.width,availableWidth:this.resolveAvailableWidth(t)});let n=this.root.findIndex(r=>r instanceof Is);this.root[n]=new Is(this.resolvedColumnWidths,this.columnWidthsRevision)}return super.prepForXml(t)}setCellWidths(t){var n;if(this.columnWidths===void 0)return;let r=this.columnWidths.reduce((a,o)=>a+o,0),i=(n=fc(this.width,t))!==null&&n!==void 0?n:0,s=r>0&&i>r?i/r:1;for(let a of this.rows){let o=0;for(let c of a.cells){let l=c.options.columnSpan||1,u=this.columnWidths.slice(o,o+l),d=Math.round(u.reduce((p,h)=>p+h,0)*s);u.length===l&&d>0&&c.setColumnWidth(d),o+=l}}}resolveAvailableWidth(t){var n,r,i;let{stack:s}=t,a=s[s.length-1],o=s[s.length-2],c=s[s.length-3];if(a instanceof Fr&&o instanceof Js&&c instanceof af){let p=c.getCellWidth(o,a);if(p!==void 0)return p}let l=s.findIndex(p=>p instanceof Ym),u=(n=t.file)===null||n===void 0||(n=n.Document)===null||n===void 0?void 0:n.View.Body,d=l>=0?s[l].getSectionPropertiesFor((r=s[l+1])!==null&&r!==void 0?r:this):u?.getSectionPropertiesFor();return(i=d?.AvailableTextWidth)!==null&&i!==void 0?i:Ps}},qT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},HT=class extends P{constructor(){super("Properties"),this.root.push(new qT({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}},UT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns"})}},wt=(e,t)=>new L({name:"Default",attributes:{contentType:{key:"ContentType",value:e},extension:{key:"Extension",value:t}}}),ge=(e,t)=>new L({name:"Override",attributes:{contentType:{key:"ContentType",value:e},partName:{key:"PartName",value:t}}}),jT=class extends P{constructor({macros:e=!1}={}){super("Types"),this.root.push(new UT({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(wt("image/png","png")),this.root.push(wt("image/jpeg","jpeg")),this.root.push(wt("image/jpeg","jpg")),this.root.push(wt("image/bmp","bmp")),this.root.push(wt("image/gif","gif")),this.root.push(wt("image/svg+xml","svg")),this.root.push(wt("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(wt("application/xml","xml")),this.root.push(wt("application/vnd.openxmlformats-officedocument.obfuscatedFont","odttf")),this.root.push(ge(e?"application/vnd.ms-word.document.macroEnabled.main+xml":"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","/word/document.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","/word/styles.xml")),this.root.push(ge("application/vnd.openxmlformats-package.core-properties+xml","/docProps/core.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.custom-properties+xml","/docProps/custom.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.extended-properties+xml","/docProps/app.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","/word/numbering.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","/word/footnotes.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml","/word/endnotes.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","/word/settings.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","/word/fontTable.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.theme+xml","/word/theme/theme1.xml")),e&&this.root.push(ge("application/vnd.ms-office.vbaProject","/word/vbaProject.bin"))}addComments(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","/word/comments.xml"))}addCommentsExtended(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml","/word/commentsExtended.xml"))}addCommentsIds(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml","/word/commentsIds.xml"))}addFooter(e){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",`/word/footer${e}.xml`))}addOverride(e,t){this.root.push(ge(e,t))}addHeader(e){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",`/word/header${e}.xml`))}},Dl={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",aink:"http://schemas.microsoft.com/office/drawing/2016/ink",am3d:"http://schemas.microsoft.com/office/drawing/2017/model3d",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Qs=class extends H{constructor(e,t){super(k({Ignorable:t},Object.fromEntries(e.map(n=>[n,Dl[n]])))),E(this,"xmlKeys",k({Ignorable:"mc:Ignorable"},Object.fromEntries(Object.keys(Dl).map(n=>[n,`xmlns:${n}`]))))}},WT=class extends P{constructor(e){super("cp:coreProperties"),this.root.push(new Qs(["cp","dc","dcterms","dcmitype","xsi"])),e.title&&this.root.push(new nn("dc:title",e.title)),e.subject&&this.root.push(new nn("dc:subject",e.subject)),e.creator&&this.root.push(new nn("dc:creator",e.creator)),e.keywords&&this.root.push(new nn("cp:keywords",e.keywords)),e.description&&this.root.push(new nn("dc:description",e.description)),e.lastModifiedBy&&this.root.push(new nn("cp:lastModifiedBy",e.lastModifiedBy)),e.revision&&this.root.push(new nn("cp:revision",String(e.revision))),this.root.push(new ch("dcterms:created")),this.root.push(new ch("dcterms:modified"))}},KT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"xsi:type"})}},ch=class extends P{constructor(e){super(e),this.root.push(new KT({type:"dcterms:W3CDTF"})),this.root.push(yx(new Date))}},GT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},zT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{formatId:"fmtid",pid:"pid",name:"name"})}},VT=class extends P{constructor(e,t){super("property"),this.root.push(new zT({formatId:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:e.toString(),name:t.name})),this.root.push(new XT(t.value))}},XT=class extends P{constructor(e){super("vt:lpwstr"),this.root.push(e)}},YT=class extends P{constructor(e){super("Properties"),E(this,"nextId",void 0),E(this,"properties",[]),this.root.push(new GT({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})),this.nextId=2;for(let t of e)this.addCustomProperty(t)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.properties),super.prepForXml(e)}addCustomProperty(e){this.properties.push(new VT(this.nextId++,e))}},JT=e=>new L({name:"ds:datastoreItem",attributes:{itemId:{key:"ds:itemID",value:e},namespace:{key:"xmlns:ds",value:"http://schemas.openxmlformats.org/officeDocument/2006/customXml"}},children:[new L({name:"ds:schemaRefs",children:[new L({name:"ds:schemaRef",attributes:{uri:{key:"ds:uri",value:"http://schemas.openxmlformats.org/officeDocument/2006/bibliography"}}})]})]}),QT={new:"wne:eventDocNew",open:"wne:eventDocOpen",close:"wne:eventDocClose",sync:"wne:eventDocSync",xmlAfterInsert:"wne:eventDocXmlAfterInsert",xmlBeforeDelete:"wne:eventDocXmlBeforeDelete",contentControlAfterAdd:"wne:eventDocContentControlAfterInsert",contentControlBeforeDelete:"wne:eventDocContentControlBeforeDelete",contentControlOnExit:"wne:eventDocContentControlOnExit",contentControlOnEnter:"wne:eventDocContentControlOnEnter",contentControlBeforeStoreUpdate:"wne:eventDocStoreUpdate",contentControlBeforeContentUpdate:"wne:eventDocContentControlContentUpdate",buildingBlockInsert:"wne:eventDocBuildingBlockAfterInsert"},ZT=e=>new L({name:"wne:vbaSuppData",attributes:{namespace:{key:"xmlns:wne",value:"http://schemas.microsoft.com/office/word/2006/wordml"}},children:[new L({name:"wne:docEvents",children:Object.entries(QT).filter(([t])=>e.includes(t)).map(([,t])=>new L({name:t}))})]}),eS=class extends P{constructor({color:e,themeColor:t,themeShade:n,themeTint:r}){if(super("w:background"),typeof e=="object"&&(t!==void 0||n!==void 0||r!==void 0))throw new Error("Invalid background. Expected a theme color in color, or themeColor, themeShade and themeTint, not both");this.root.push(new ic([{keys:Kr,color:e},{key:"w:themeColor",value:t},{key:"w:themeShade",value:n===void 0?void 0:Yu(n)},{key:"w:themeTint",value:r===void 0?void 0:Yu(r)}]))}},tS=class extends P{constructor(e){super("w:document"),E(this,"body",void 0),this.root.push(new Qs(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps","cx","cx1","cx2","cx3","cx4","cx5","cx6","cx7","cx8","aink","am3d","w16cex","w16cid","w16","w16sdtdh","w16se"],"w14 w15 wp14")),this.body=new Ym({pageNumbers:e.pageNumbers}),e.background&&this.root.push(new eS(e.background)),this.root.push(this.body)}add(e){return this.body.push(e),this}get Body(){return this.body}},nS=class{constructor(e){E(this,"document",void 0),E(this,"relationships",void 0),this.document=new tS(e),this.relationships=new be}get View(){return this.document}get Relationships(){return this.relationships}},rS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},of=class extends P{constructor(e,t){super("w:p"),E(this,"paragraph",void 0),E(this,"mark",void 0),this.paragraph=e,this.mark=t}prepForXml(e){let t=this.paragraph.prepForXml(e)["w:p"],n=Array.isArray(t)?t:[],r=n.length>0&&"w:pPr"in n[0]?1:0;return{"w:p":[...n.slice(0,r),this.mark.prepForXml(e),...n.slice(r)]}}},iS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",id:"w:id"})}},lf=class extends qe{constructor(){super({style:"EndnoteReference"}),this.root.push(new x1)}},dh={SEPARATOR:"separator",CONTINUATION_SEPARATOR:"continuationSeparator"},cl=class extends P{constructor(e){super("w:endnote"),this.root.push(new iS({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new of(n,new lf):n)}},sS=class extends P{constructor(){super("w:continuationSeparator")}},cf=class extends qe{constructor(){super({}),this.root.push(new sS)}},aS=class extends P{constructor(){super("w:separator")}},df=class extends qe{constructor(){super({}),this.root.push(new aS)}},pf=class extends P{constructor(){super("w:endnotes"),E(this,"ownNotes",new Map),E(this,"highestId",0),this.root.push(new rS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));let e=new cl({id:-1,type:dh.SEPARATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Dn.AUTO},children:[new df]})]});this.root.push(e);let t=new cl({id:0,type:dh.CONTINUATION_SEPARATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Dn.AUTO},children:[new cf]})]});this.root.push(t)}createEndnote(e,t){let n=new cl({id:e,children:t});this.root.push(n),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,n){if(n.viewWrapper!==n.file.Document)return;let r=this.ownNotes.get(e);if(r!==void 0)return r;let i=this.highestId+1;return this.createEndnote(i,t.children),this.ownNotes.set(e,i),i}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},oS=class{constructor(){E(this,"endnotes",void 0),E(this,"relationships",void 0),this.endnotes=new pf,this.relationships=new be}get View(){return this.endnotes}get Relationships(){return this.relationships}},lS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type"})}},cS=class extends im{constructor(e,t){super("w:ftr",t),E(this,"refId",void 0),this.refId=e,t||this.root.push(new lS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){let t=super.prepForXml(e);return zr(t,e,this.refId),t}},dS=class{constructor(e,t,n){E(this,"media",void 0),E(this,"footer",void 0),E(this,"relationships",void 0),this.media=e,this.footer=new cS(t,n),this.relationships=new be}add(e){this.footer.add(e)}addChildElement(e){this.footer.addChildElement(e)}get View(){return this.footer}get Relationships(){return this.relationships}get Media(){return this.media}},pS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",id:"w:id"})}},uS=class extends P{constructor(){super("w:footnoteRef")}},uf=class extends qe{constructor(){super({style:"FootnoteReference"}),this.root.push(new uS)}},ph={SEPERATOR:"separator",CONTINUATION_SEPERATOR:"continuationSeparator"},dl=class extends P{constructor(e){super("w:footnote"),this.root.push(new pS({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new of(n,new uf):n)}},hS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},hf=class extends P{constructor(){super("w:footnotes"),E(this,"ownNotes",new Map),E(this,"highestId",0),this.root.push(new hS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));let e=new dl({id:-1,type:ph.SEPERATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Dn.AUTO},children:[new df]})]});this.root.push(e);let t=new dl({id:0,type:ph.CONTINUATION_SEPERATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Dn.AUTO},children:[new cf]})]});this.root.push(t)}createFootNote(e,t){let n=new dl({id:e,children:t});this.root.push(n),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,n){if(n.viewWrapper!==n.file.Document)return;let r=this.ownNotes.get(e);if(r!==void 0)return r;let i=this.highestId+1;return this.createFootNote(i,t.children),this.ownNotes.set(e,i),i}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},mS=class{constructor(){E(this,"footnotess",void 0),E(this,"relationships",void 0),this.footnotess=new hf,this.relationships=new be}get View(){return this.footnotess}get Relationships(){return this.relationships}},fS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",w16cid:"xmlns:w16cid",w16se:"xmlns:w16se"})}},gS=class extends im{constructor(e,t){super("w:hdr",t),E(this,"refId",void 0),this.refId=e,t||this.root.push(new fS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){let t=super.prepForXml(e);return zr(t,e,this.refId),t}},bS=class{constructor(e,t,n){E(this,"media",void 0),E(this,"header",void 0),E(this,"relationships",void 0),this.media=e,this.header=new gS(t,n),this.relationships=new be}add(e){return this.header.add(e),this}addChildElement(e){this.header.addChildElement(e)}get View(){return this.header}get Relationships(){return this.relationships}get Media(){return this.media}},vS=()=>{let e=new Map;return t=>{var n;let r=((n=e.get(t))!==null&&n!==void 0?n:0)+1;return e.set(t,r),`media/image${r}.${t}`}},mf=class{constructor(e=vS()){E(this,"map",new Map),E(this,"takePath",void 0),this.takePath=e}addImage(e,t){if(this.map.has(e))return;let n=this.takePath(t.type);this.map.set(e,k(k({},t),{},{fileName:n.slice(n.lastIndexOf("/")+1)}))}get Array(){return Array.from(this.map.values())}get Entries(){return Array.from(this.map.entries())}},yt={DECIMAL:"decimal",UPPER_ROMAN:"upperRoman",LOWER_ROMAN:"lowerRoman",UPPER_LETTER:"upperLetter",LOWER_LETTER:"lowerLetter",ORDINAL:"ordinal",CARDINAL_TEXT:"cardinalText",ORDINAL_TEXT:"ordinalText",HEX:"hex",CHICAGO:"chicago",IDEOGRAPH__DIGITAL:"ideographDigital",JAPANESE_COUNTING:"japaneseCounting",AIUEO:"aiueo",IROHA:"iroha",DECIMAL_FULL_WIDTH:"decimalFullWidth",DECIMAL_HALF_WIDTH:"decimalHalfWidth",JAPANESE_LEGAL:"japaneseLegal",JAPANESE_DIGITAL_TEN_THOUSAND:"japaneseDigitalTenThousand",DECIMAL_ENCLOSED_CIRCLE:"decimalEnclosedCircle",DECIMAL_FULL_WIDTH2:"decimalFullWidth2",AIUEO_FULL_WIDTH:"aiueoFullWidth",IROHA_FULL_WIDTH:"irohaFullWidth",DECIMAL_ZERO:"decimalZero",BULLET:"bullet",GANADA:"ganada",CHOSUNG:"chosung",DECIMAL_ENCLOSED_FULLSTOP:"decimalEnclosedFullstop",DECIMAL_ENCLOSED_PARENTHESES:"decimalEnclosedParen",DECIMAL_ENCLOSED_CIRCLE_CHINESE:"decimalEnclosedCircleChinese",IDEOGRAPH_ENCLOSED_CIRCLE:"ideographEnclosedCircle",IDEOGRAPH_TRADITIONAL:"ideographTraditional",IDEOGRAPH_ZODIAC:"ideographZodiac",IDEOGRAPH_ZODIAC_TRADITIONAL:"ideographZodiacTraditional",TAIWANESE_COUNTING:"taiwaneseCounting",IDEOGRAPH_LEGAL_TRADITIONAL:"ideographLegalTraditional",TAIWANESE_COUNTING_THOUSAND:"taiwaneseCountingThousand",TAIWANESE_DIGITAL:"taiwaneseDigital",CHINESE_COUNTING:"chineseCounting",CHINESE_LEGAL_SIMPLIFIED:"chineseLegalSimplified",CHINESE_COUNTING_THOUSAND:"chineseCountingThousand",KOREAN_DIGITAL:"koreanDigital",KOREAN_COUNTING:"koreanCounting",KOREAN_LEGAL:"koreanLegal",KOREAN_DIGITAL2:"koreanDigital2",VIETNAMESE_COUNTING:"vietnameseCounting",RUSSIAN_LOWER:"russianLower",RUSSIAN_UPPER:"russianUpper",NONE:"none",NUMBER_IN_DASH:"numberInDash",HEBREW1:"hebrew1",HEBREW2:"hebrew2",ARABIC_ALPHA:"arabicAlpha",ARABIC_ABJAD:"arabicAbjad",HINDI_VOWELS:"hindiVowels",HINDI_CONSONANTS:"hindiConsonants",HINDI_NUMBERS:"hindiNumbers",HINDI_COUNTING:"hindiCounting",THAI_LETTERS:"thaiLetters",THAI_NUMBERS:"thaiNumbers",THAI_COUNTING:"thaiCounting",BAHT_TEXT:"bahtText",DOLLAR_TEXT:"dollarText",CUSTOM:"custom"},wS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{ilvl:"w:ilvl",tentative:"w:tentative"})}},yS=class extends P{constructor(e){super("w:numFmt"),this.root.push(new _e({val:e}))}},xS=class extends P{constructor(e){super("w:lvlText"),this.root.push(new _e({val:e}))}},kS=e=>{switch(e){case ue.CENTER:return"center";case ue.END:case ue.RIGHT:return"right";default:return"left"}},TS=class extends P{constructor(e){super("w:lvlJc"),this.root.push(new _e({val:kS(e)}))}},SS=class extends P{constructor(e){super("w:suff"),this.root.push(new _e({val:e}))}},CS=class extends P{constructor(){super("w:isLgl")}},ES=class extends P{constructor({level:e,format:t,text:n,alignment:r=ue.START,start:i=1,style:s,suffix:a,isLegalNumberingStyle:o}){if(super("w:lvl"),E(this,"paragraphProperties",void 0),E(this,"runProperties",void 0),this.root.push(new Pr("w:start",le(i))),t&&this.root.push(new yS(t)),s?.style&&this.root.push(Nr(s.style)),o&&this.root.push(new CS),a&&this.root.push(new SS(a)),n&&this.root.push(new xS(n)),this.root.push(new TS(r)),this.paragraphProperties=new Mn(s&&s.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new on(s?.run&&k(k({},s.run),{},{highlight:void 0,math:void 0,revision:void 0})),this.root.push(this.paragraphProperties),this.root.push(this.runProperties),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new wS({ilvl:le(e),tentative:1}))}},AS=class extends ES{},_S=class extends P{constructor(e){super("w:multiLevelType"),this.root.push(new _e({val:e}))}},NS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}},pl=class extends P{constructor(e,t){super("w:abstractNum"),E(this,"id",void 0),this.root.push(new NS({abstractNumId:le(e),restartNumberingAfterBreak:0})),this.root.push(new _S("hybridMultilevel")),this.id=e;for(let n of t)this.root.push(new AS(n))}},PS=class extends P{constructor(e){super("w:abstractNumId"),this.root.push(new _e({val:e}))}},IS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{numId:"w:numId"})}},uh=class extends P{constructor(e){if(super("w:num"),E(this,"numId",void 0),E(this,"reference",void 0),E(this,"instance",void 0),E(this,"restartedListId",void 0),this.numId=e.numId,this.reference=e.reference,this.instance=e.instance,this.restartedListId=e.restartedListId,this.root.push(new IS({numId:le(e.numId)})),this.root.push(new PS(le(e.abstractNumId))),e.overrideLevels&&e.overrideLevels.length)for(let t of e.overrideLevels)this.root.push(new RS(t.num,t.start))}},OS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{ilvl:"w:ilvl"})}},RS=class extends P{constructor(e,t){super("w:lvlOverride"),this.root.push(new OS({ilvl:e})),t!==void 0&&this.root.push(new DS(t))}},LS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},DS=class extends P{constructor(e){super("w:startOverride"),this.root.push(new LS({val:e}))}},ff=class extends P{constructor(e){super("w:numbering"),E(this,"abstractNumberingMap",new Map),E(this,"concreteNumberingMap",new Map),E(this,"referenceConfigMap",new Map),E(this,"abstractNumUniqueNumericId",rk()),E(this,"concreteNumUniqueNumericId",ik()),this.root.push(new Qs(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps"],"w14 w15 wp14"));let t=new pl(this.abstractNumUniqueNumericId(),[{level:0,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:Xe(.5),hanging:Xe(.25)}}}},{level:1,format:yt.BULLET,text:"\u25CB",alignment:ue.LEFT,style:{paragraph:{indent:{left:Xe(1),hanging:Xe(.25)}}}},{level:2,format:yt.BULLET,text:"\u25A0",alignment:ue.LEFT,style:{paragraph:{indent:{left:2160,hanging:Xe(.25)}}}},{level:3,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:2880,hanging:Xe(.25)}}}},{level:4,format:yt.BULLET,text:"\u25CB",alignment:ue.LEFT,style:{paragraph:{indent:{left:3600,hanging:Xe(.25)}}}},{level:5,format:yt.BULLET,text:"\u25A0",alignment:ue.LEFT,style:{paragraph:{indent:{left:4320,hanging:Xe(.25)}}}},{level:6,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:5040,hanging:Xe(.25)}}}},{level:7,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:5760,hanging:Xe(.25)}}}},{level:8,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:6480,hanging:Xe(.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new uh({numId:1,abstractNumId:t.id,reference:"default-bullet-numbering",instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set("default-bullet-numbering",t);for(let n of e.config)this.abstractNumberingMap.set(n.reference,new pl(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.abstractNumberingMap.values(),...this.concreteNumberingMap.values()),super.prepForXml(e)}createConcreteNumberingInstance(e,t,n,r){var i;n&&!this.abstractNumberingMap.has(n.reference)&&(this.abstractNumberingMap.set(n.reference,new pl(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels));let s=this.abstractNumberingMap.get(e);if(!s)return;let a=Bs(e,t,r);if(this.concreteNumberingMap.has(a))return;let o=(i=this.referenceConfigMap.get(e))!==null&&i!==void 0?i:[{level:0}],c={numId:this.concreteNumUniqueNumericId(),abstractNumId:s.id,reference:e,instance:t,restartedListId:r,overrideLevels:o.map(({level:l,start:u=1})=>({num:l,start:le(u)}))};this.concreteNumberingMap.set(a,new uh(c))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}},gf=class{constructor(e,t=new Set){E(this,"contentTypes",void 0),E(this,"paths",new Map),E(this,"taken",void 0),E(this,"folders",new WeakMap),this.contentTypes=e,this.taken=new Set(t)}add(e){let t=this.paths.get(e);if(t!==void 0)return t;let{folder:n,name:r,extension:i,contentType:s}=e.options,a=this.takePath(n,r,i);return this.paths.set(e,a),this.contentTypes.addOverride(s,`/word/${a}`),a}takePath(e,t,n){let r=1;for(;this.taken.has(`${e}/${t}${r}.${n}`);)r++;let i=`${e}/${t}${r}.${n}`;return this.taken.add(i),i}get Array(){return[...this.paths].map(([e,t])=>({part:e,path:t}))}createRelationships(e){let t=new be;return this.folders.set(t,e.slice(0,e.indexOf("/"))),t}getTarget(e,t){let n=this.folders.get(e);return n===void 0?t:t.startsWith(`${n}/`)?t.slice(n.length+1):`../${t}`}},MS=e=>new L({name:"w:compatSetting",attributes:{version:{key:"w:val",value:e},name:{key:"w:name",value:"compatibilityMode"},uri:{key:"w:uri",value:"http://schemas.microsoft.com/office/word"}}}),BS=class extends P{constructor(e){super("w:compat"),e.useSingleBorderforContiguousCells&&this.root.push(new I("w:useSingleBorderforContiguousCells",e.useSingleBorderforContiguousCells)),e.wordPerfectJustification&&this.root.push(new I("w:wpJustification",e.wordPerfectJustification)),e.noTabStopForHangingIndent&&this.root.push(new I("w:noTabHangInd",e.noTabStopForHangingIndent)),e.noLeading&&this.root.push(new I("w:noLeading",e.noLeading)),e.spaceForUnderline&&this.root.push(new I("w:spaceForUL",e.spaceForUnderline)),e.noColumnBalance&&this.root.push(new I("w:noColumnBalance",e.noColumnBalance)),e.balanceSingleByteDoubleByteWidth&&this.root.push(new I("w:balanceSingleByteDoubleByteWidth",e.balanceSingleByteDoubleByteWidth)),e.noExtraLineSpacing&&this.root.push(new I("w:noExtraLineSpacing",e.noExtraLineSpacing)),e.doNotLeaveBackslashAlone&&this.root.push(new I("w:doNotLeaveBackslashAlone",e.doNotLeaveBackslashAlone)),e.underlineTrailingSpaces&&this.root.push(new I("w:ulTrailSpace",e.underlineTrailingSpaces)),e.doNotExpandShiftReturn&&this.root.push(new I("w:doNotExpandShiftReturn",e.doNotExpandShiftReturn)),e.spacingInWholePoints&&this.root.push(new I("w:spacingInWholePoints",e.spacingInWholePoints)),e.lineWrapLikeWord6&&this.root.push(new I("w:lineWrapLikeWord6",e.lineWrapLikeWord6)),e.printBodyTextBeforeHeader&&this.root.push(new I("w:printBodyTextBeforeHeader",e.printBodyTextBeforeHeader)),e.printColorsBlack&&this.root.push(new I("w:printColBlack",e.printColorsBlack)),e.spaceWidth&&this.root.push(new I("w:wpSpaceWidth",e.spaceWidth)),e.showBreaksInFrames&&this.root.push(new I("w:showBreaksInFrames",e.showBreaksInFrames)),e.subFontBySize&&this.root.push(new I("w:subFontBySize",e.subFontBySize)),e.suppressBottomSpacing&&this.root.push(new I("w:suppressBottomSpacing",e.suppressBottomSpacing)),e.suppressTopSpacing&&this.root.push(new I("w:suppressTopSpacing",e.suppressTopSpacing)),e.suppressSpacingAtTopOfPage&&this.root.push(new I("w:suppressSpacingAtTopOfPage",e.suppressSpacingAtTopOfPage)),e.suppressTopSpacingWP&&this.root.push(new I("w:suppressTopSpacingWP",e.suppressTopSpacingWP)),e.suppressSpBfAfterPgBrk&&this.root.push(new I("w:suppressSpBfAfterPgBrk",e.suppressSpBfAfterPgBrk)),e.swapBordersFacingPages&&this.root.push(new I("w:swapBordersFacingPages",e.swapBordersFacingPages)),e.convertMailMergeEsc&&this.root.push(new I("w:convMailMergeEsc",e.convertMailMergeEsc)),e.truncateFontHeightsLikeWP6&&this.root.push(new I("w:truncateFontHeightsLikeWP6",e.truncateFontHeightsLikeWP6)),e.macWordSmallCaps&&this.root.push(new I("w:mwSmallCaps",e.macWordSmallCaps)),e.usePrinterMetrics&&this.root.push(new I("w:usePrinterMetrics",e.usePrinterMetrics)),e.doNotSuppressParagraphBorders&&this.root.push(new I("w:doNotSuppressParagraphBorders",e.doNotSuppressParagraphBorders)),e.wrapTrailSpaces&&this.root.push(new I("w:wrapTrailSpaces",e.wrapTrailSpaces)),e.footnoteLayoutLikeWW8&&this.root.push(new I("w:footnoteLayoutLikeWW8",e.footnoteLayoutLikeWW8)),e.shapeLayoutLikeWW8&&this.root.push(new I("w:shapeLayoutLikeWW8",e.shapeLayoutLikeWW8)),e.alignTablesRowByRow&&this.root.push(new I("w:alignTablesRowByRow",e.alignTablesRowByRow)),e.forgetLastTabAlignment&&this.root.push(new I("w:forgetLastTabAlignment",e.forgetLastTabAlignment)),e.adjustLineHeightInTable&&this.root.push(new I("w:adjustLineHeightInTable",e.adjustLineHeightInTable)),e.autoSpaceLikeWord95&&this.root.push(new I("w:autoSpaceLikeWord95",e.autoSpaceLikeWord95)),e.noSpaceRaiseLower&&this.root.push(new I("w:noSpaceRaiseLower",e.noSpaceRaiseLower)),e.doNotUseHTMLParagraphAutoSpacing&&this.root.push(new I("w:doNotUseHTMLParagraphAutoSpacing",e.doNotUseHTMLParagraphAutoSpacing)),e.layoutRawTableWidth&&this.root.push(new I("w:layoutRawTableWidth",e.layoutRawTableWidth)),e.layoutTableRowsApart&&this.root.push(new I("w:layoutTableRowsApart",e.layoutTableRowsApart)),e.useWord97LineBreakRules&&this.root.push(new I("w:useWord97LineBreakRules",e.useWord97LineBreakRules)),e.doNotBreakWrappedTables&&this.root.push(new I("w:doNotBreakWrappedTables",e.doNotBreakWrappedTables)),e.doNotSnapToGridInCell&&this.root.push(new I("w:doNotSnapToGridInCell",e.doNotSnapToGridInCell)),e.selectFieldWithFirstOrLastCharacter&&this.root.push(new I("w:selectFldWithFirstOrLastChar",e.selectFieldWithFirstOrLastCharacter)),e.applyBreakingRules&&this.root.push(new I("w:applyBreakingRules",e.applyBreakingRules)),e.doNotWrapTextWithPunctuation&&this.root.push(new I("w:doNotWrapTextWithPunct",e.doNotWrapTextWithPunctuation)),e.doNotUseEastAsianBreakRules&&this.root.push(new I("w:doNotUseEastAsianBreakRules",e.doNotUseEastAsianBreakRules)),e.useWord2002TableStyleRules&&this.root.push(new I("w:useWord2002TableStyleRules",e.useWord2002TableStyleRules)),e.growAutofit&&this.root.push(new I("w:growAutofit",e.growAutofit)),e.useFELayout&&this.root.push(new I("w:useFELayout",e.useFELayout)),e.useNormalStyleForList&&this.root.push(new I("w:useNormalStyleForList",e.useNormalStyleForList)),e.doNotUseIndentAsNumberingTabStop&&this.root.push(new I("w:doNotUseIndentAsNumberingTabStop",e.doNotUseIndentAsNumberingTabStop)),e.useAlternateEastAsianLineBreakRules&&this.root.push(new I("w:useAltKinsokuLineBreakRules",e.useAlternateEastAsianLineBreakRules)),e.allowSpaceOfSameStyleInTable&&this.root.push(new I("w:allowSpaceOfSameStyleInTable",e.allowSpaceOfSameStyleInTable)),e.doNotSuppressIndentation&&this.root.push(new I("w:doNotSuppressIndentation",e.doNotSuppressIndentation)),e.doNotAutofitConstrainedTables&&this.root.push(new I("w:doNotAutofitConstrainedTables",e.doNotAutofitConstrainedTables)),e.autofitToFirstFixedWidthCell&&this.root.push(new I("w:autofitToFirstFixedWidthCell",e.autofitToFirstFixedWidthCell)),e.underlineTabInNumberingList&&this.root.push(new I("w:underlineTabInNumList",e.underlineTabInNumberingList)),e.displayHangulFixedWidth&&this.root.push(new I("w:displayHangulFixedWidth",e.displayHangulFixedWidth)),e.splitPgBreakAndParaMark&&this.root.push(new I("w:splitPgBreakAndParaMark",e.splitPgBreakAndParaMark)),e.doNotVerticallyAlignCellWithSp&&this.root.push(new I("w:doNotVertAlignCellWithSp",e.doNotVerticallyAlignCellWithSp)),e.doNotBreakConstrainedForcedTable&&this.root.push(new I("w:doNotBreakConstrainedForcedTable",e.doNotBreakConstrainedForcedTable)),e.ignoreVerticalAlignmentInTextboxes&&this.root.push(new I("w:doNotVertAlignInTxbx",e.ignoreVerticalAlignmentInTextboxes)),e.useAnsiKerningPairs&&this.root.push(new I("w:useAnsiKerningPairs",e.useAnsiKerningPairs)),e.cachedColumnBalance&&this.root.push(new I("w:cachedColBalance",e.cachedColumnBalance)),e.version&&this.root.push(MS(e.version))}},hh=1e5,mh=15,$S=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],FS=[[44796,19929,39858,10053,20106,40212,10761],[31585,63170,64933,60267,50935,40399,11199],[17763,35526,1453,2906,5812,11624,23248],[885,1770,3540,7080,14160,28320,56640],[55369,41139,20807,41614,21821,43642,17621],[28485,56970,44341,19019,38038,14605,29210],[60195,50791,40175,10751,21502,43004,24537],[18387,36774,3949,7898,15796,31592,63184],[47201,24803,49606,37805,14203,28406,56812],[17824,35648,1697,3394,6788,13576,27152],[43601,17539,35078,557,1114,2228,4456],[30388,60776,51953,34243,7079,14158,28316],[14128,28256,56512,43425,17251,34502,7597],[13105,26210,52420,35241,883,1766,3532],[4129,8258,16516,33032,4657,9314,18628]],fh=e=>e>>14&1|e<<1&32767,qS=e=>{let t=e.slice(0,mh).split("").map(i=>{let s=i.charCodeAt(0);return(s&255)!==0?s&255:s>>8&255}),n=t.reduce((i,s,a)=>FS[mh-t.length+a].reduce((o,c,l)=>s>>l&1?o^c:o,i),$S[t.length-1]),r=(fh(t.reduceRight((i,s)=>fh(i)^s,0))^t.length^52811)&65535;return[r&255,r>>8,n&255,n>>8].map(i=>i.toString(16).toUpperCase().padStart(2,"0")).join("")},HS=(e,t,n)=>{let r=[...qS(e)].flatMap(o=>[o.charCodeAt(0),0]),i=eh(Uint8Array.from([...t,...r])),s=new Uint8Array(i.length+4),a=new DataView(s.buffer);for(let o=0;o<n;o++)s.set(i),a.setUint32(i.length,o,!0),i=eh(s);return Array.from(i)},US=e=>{var t;let n=new Uint8Array(e);return typeof((t=globalThis.crypto)===null||t===void 0?void 0:t.getRandomValues)=="function"?(globalThis.crypto.getRandomValues(n),[...n]):[...n].map(()=>Math.floor(Math.random()*256))},gh=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{edit:"w:edit",enforcement:"w:enforcement",cryptProviderType:"w:cryptProviderType",cryptAlgorithmClass:"w:cryptAlgorithmClass",cryptAlgorithmType:"w:cryptAlgorithmType",cryptAlgorithmSid:"w:cryptAlgorithmSid",cryptSpinCount:"w:cryptSpinCount",hash:"w:hash",salt:"w:salt"})}},bh=e=>btoa(String.fromCharCode(...e)),jS=class extends P{constructor({type:e,password:t}){if(super("w:documentProtection"),t===void 0||t===""){this.root.push(new gh({edit:e,enforcement:!0}));return}let n=US(16);this.root.push(new gh({edit:e,enforcement:!0,cryptProviderType:"rsaAES",cryptAlgorithmClass:"hash",cryptAlgorithmType:"typeAny",cryptAlgorithmSid:12,cryptSpinCount:hh,hash:bh(HS(t,n,hh)),salt:bh(n)}))}},WS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},KS=class extends P{constructor(e){var t,n,r,i,s,a,o,c,l;super("w:settings"),this.root.push(new WS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"})),this.root.push(new I("w:displayBackgroundShape",!0)),e.embedFonts!==void 0&&this.root.push(new I("w:embedTrueTypeFonts",e.embedFonts)),e.trackRevisions!==void 0&&this.root.push(new I("w:trackRevisions",e.trackRevisions)),e.protection!==void 0&&this.root.push(new jS(e.protection)),this.root.push(new Pr("w:defaultTabStop",(t=e.defaultTabStop)!==null&&t!==void 0?t:720)),((n=e.hyphenation)===null||n===void 0?void 0:n.autoHyphenation)!==void 0&&this.root.push(new I("w:autoHyphenation",e.hyphenation.autoHyphenation)),((r=e.hyphenation)===null||r===void 0?void 0:r.consecutiveHyphenLimit)!==void 0&&this.root.push(new Pr("w:consecutiveHyphenLimit",e.hyphenation.consecutiveHyphenLimit)),((i=e.hyphenation)===null||i===void 0?void 0:i.hyphenationZone)!==void 0&&this.root.push(new Pr("w:hyphenationZone",e.hyphenation.hyphenationZone)),((s=e.hyphenation)===null||s===void 0?void 0:s.doNotHyphenateCaps)!==void 0&&this.root.push(new I("w:doNotHyphenateCaps",e.hyphenation.doNotHyphenateCaps)),e.evenAndOddHeaders!==void 0&&this.root.push(new I("w:evenAndOddHeaders",e.evenAndOddHeaders)),e.updateFields!==void 0&&this.root.push(new I("w:updateFields",e.updateFields)),this.root.push(new BS(k(k({},(a=e.compatibility)!==null&&a!==void 0?a:{}),{},{version:(o=(c=(l=e.compatibility)===null||l===void 0?void 0:l.version)!==null&&c!==void 0?c:e.compatibilityModeVersion)!==null&&o!==void 0?o:15})))}},bf=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},GS=class extends P{constructor(e){super("w:name"),this.root.push(new bf({val:e}))}},zS=class extends P{constructor(e){super("w:uiPriority"),this.root.push(new bf({val:le(e)}))}},VS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}},bc=class extends P{constructor(e,t){super("w:style"),this.root.push(new VS(e)),t.name&&this.root.push(new GS(t.name)),t.basedOn&&t.basedOn!==e.styleId&&this.root.push(new ot("w:basedOn",t.basedOn)),t.next&&this.root.push(new ot("w:next",t.next)),t.link&&this.root.push(new ot("w:link",t.link)),t.uiPriority!==void 0&&this.root.push(new zS(t.uiPriority)),t.semiHidden!==void 0&&this.root.push(new I("w:semiHidden",t.semiHidden)),t.unhideWhenUsed!==void 0&&this.root.push(new I("w:unhideWhenUsed",t.unhideWhenUsed)),t.quickFormat!==void 0&&this.root.push(new I("w:qFormat",t.quickFormat))}},Ct=class extends bc{constructor(e){super({type:"paragraph",styleId:e.id},e),E(this,"paragraphProperties",void 0),E(this,"runProperties",void 0),this.paragraphProperties=new Mn(e.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new on(e.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}},ln=class extends bc{constructor(e){super({type:"character",styleId:e.id},k({uiPriority:99,unhideWhenUsed:!0},e)),E(this,"runProperties",void 0),this.runProperties=new on(e.run),this.root.push(this.runProperties)}},Wt=class extends Ct{constructor(e){super(k({basedOn:"Normal",next:"Normal",quickFormat:!0},e))}},XS=class extends Wt{constructor(e){super(k({id:"Title",name:"Title"},e))}},YS=class extends Wt{constructor(e){super(k({id:"Heading1",name:"Heading 1"},e))}},JS=class extends Wt{constructor(e){super(k({id:"Heading2",name:"Heading 2"},e))}},QS=class extends Wt{constructor(e){super(k({id:"Heading3",name:"Heading 3"},e))}},ZS=class extends Wt{constructor(e){super(k({id:"Heading4",name:"Heading 4"},e))}},eC=class extends Wt{constructor(e){super(k({id:"Heading5",name:"Heading 5"},e))}},tC=class extends Wt{constructor(e){super(k({id:"Heading6",name:"Heading 6"},e))}},nC=class extends Wt{constructor(e){super(k({id:"Strong",name:"Strong"},e))}},rC=class extends Ct{constructor(e){super(k({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},e))}},iC=class extends Ct{constructor(e){super(k({id:"Caption",name:"caption",basedOn:"Normal",next:"Normal",uiPriority:35,semiHidden:!0,unhideWhenUsed:!0,quickFormat:!0,paragraph:{spacing:{after:200}},run:{italics:!0,color:{theme:"dark2"},size:18}},e))}},sC=class extends Ct{constructor(e){super(k({id:"Bibliography",name:"Bibliography",basedOn:"Normal",next:"Normal",uiPriority:37,unhideWhenUsed:!0},e))}},vf=new WeakSet,vh=e=>vf.has(e),xt=class extends Ct{constructor(e,t){super({id:`TOC${e}`,name:`toc ${e}`,basedOn:"Normal",next:"Normal",uiPriority:39,semiHidden:!0,unhideWhenUsed:!0,paragraph:k({spacing:{after:100}},e>1?{indent:{left:(e-1)*t}}:{})})}prepForXml(e){let t=super.prepForXml(e);return vf.add(t),t}},wf=class extends Ct{constructor(e){super(k({id:"FootnoteText",name:"footnote text",link:"FootnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:Dn.AUTO}},run:{size:20}},e))}},yf=class extends ln{constructor(e){super(k({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},xf=class extends ln{constructor(e){super(k({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},e))}},kf=class extends Ct{constructor(e){super(k({id:"EndnoteText",name:"endnote text",link:"EndnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:Dn.AUTO}},run:{size:20}},e))}},Tf=class extends ln{constructor(e){super(k({id:"EndnoteReference",name:"endnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},Sf=class extends ln{constructor(e){super(k({id:"EndnoteTextChar",name:"Endnote Text Char",basedOn:"DefaultParagraphFont",link:"EndnoteText",semiHidden:!0,run:{size:20}},e))}},aC=class extends ln{constructor(e){super(k({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:wm.SINGLE}}},e))}},oC=class extends ln{constructor(e){super(k({id:"LineNumber",name:"line number",basedOn:"DefaultParagraphFont",semiHidden:!0},e))}},lC=class extends bc{constructor(){super({type:"table",styleId:"TableNormal",default:!0},{name:"Normal Table",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0}),this.root.push(new gc({indent:{size:0,type:Fe.DXA},cellMargin:{top:0,left:108,bottom:0,right:108}}))}},Or=e=>typeof e=="object"?Object.keys(e)[0]:void 0,vc=e=>{var t;return(t=[e["w:style"]].flat().find(n=>n._attr))===null||t===void 0?void 0:t._attr},wh=e=>{var t;return(t=vc(e))===null||t===void 0?void 0:t["w:styleId"]},yh=e=>{var t;let n=(t=[e["w:style"]].flat().find(r=>Or(r)==="w:name"))===null||t===void 0||(t=t["w:name"])===null||t===void 0||(t=t._attr)===null||t===void 0?void 0:t["w:val"];return n===void 0?void 0:String(n).toLowerCase()},Ml=e=>{var t,n;return Or(e)==="w:style"&&((t=(n=vc(e))===null||n===void 0?void 0:n["w:type"])!==null&&t!==void 0?t:"paragraph")==="paragraph"},cC=e=>{let t=Ml(e)?vc(e):void 0;return t?.["w:default"]!==void 0&&!["0","false","off"].includes(String(t["w:default"]))},dC=e=>({"w:style":[e["w:style"]].flat().map(t=>t._attr?{_attr:k(k({},t._attr),{},{"w:default":"1"})}:t)}),ul=class extends P{constructor(e){if(super("w:styles"),e.initialStyles&&this.root.push(e.initialStyles),e.importedStyles)for(let t of e.importedStyles)this.root.push(t);if(e.paragraphStyles)for(let t of e.paragraphStyles)this.root.push(new Ct(t));if(e.characterStyles)for(let t of e.characterStyles)this.root.push(new ln(t))}prepForXml(e){let t=super.prepForXml(e),n=t["w:styles"];if(!Array.isArray(n))return t;let r=l=>n.filter(u=>Or(u)===l),i=n.map(l=>Or(l)==="w:style"?wh(l):void 0),s=n.filter((l,u)=>!["_attr","w:docDefaults","w:latentStyles"].includes(Or(l))&&(i[u]===void 0||i.lastIndexOf(i[u])===u)),a=new Set(s.filter(l=>Ml(l)&&!vh(l)).map(yh)),o=s.filter(l=>!vh(l)||!a.has(yh(l))),c=o.some(cC)?o:o.map(l=>Ml(l)&&wh(l)==="Normal"?dC(l):l);return{"w:styles":[...r("_attr"),...r("w:docDefaults").slice(-1),...r("w:latentStyles").slice(-1),...c]}}},pC=class extends P{constructor(e){super("w:pPrDefault"),this.root.push(new Mn(e,{implicitListParagraphStyle:!1,inListOrder:!1}))}},uC=class extends P{constructor(e){super("w:rPrDefault"),this.root.push(new on(e))}},hC=class extends P{constructor(e){super("w:docDefaults"),E(this,"runPropertiesDefaults",void 0),E(this,"paragraphPropertiesDefaults",void 0),this.runPropertiesDefaults=new uC(e.run),this.paragraphPropertiesDefaults=new pC(e.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}},mC=class{newInstance(e){let t=Wr(e),n;for(let i of t.elements||[])i.name==="w:styles"&&(n=i);if(n===void 0)throw new Error("can not find styles element");let r=n.elements||[];return{initialStyles:new mx(n.attributes),importedStyles:r.map(i=>ec(i))}}},fC=e=>{var t;let n=(t=e.document)===null||t===void 0||(t=t.run)===null||t===void 0?void 0:t.size;return n===void 0?200:Math.round(typeof n=="number"?n*10:qt(n))},gC=e=>({tableOfContents1:new xt(1,e),tableOfContents2:new xt(2,e),tableOfContents3:new xt(3,e),tableOfContents4:new xt(4,e),tableOfContents5:new xt(5,e),tableOfContents6:new xt(6,e),tableOfContents7:new xt(7,e),tableOfContents8:new xt(8,e),tableOfContents9:new xt(9,e)}),wc=(e={})=>{var t;return k(k({normal:new Ct({id:"Normal",name:"Normal",quickFormat:!0}),normalTable:new lC,document:new hC((t=e.document)!==null&&t!==void 0?t:{}),title:new XS(k({run:{size:56}},e.title)),heading1:new YS(k({run:{color:"2E74B5",size:32}},e.heading1)),heading2:new JS(k({run:{color:"2E74B5",size:26}},e.heading2)),heading3:new QS(k({run:{color:"1F4D78",size:24}},e.heading3)),heading4:new ZS(k({run:{color:"2E74B5",italics:!0}},e.heading4)),heading5:new eC(k({run:{color:"2E74B5"}},e.heading5)),heading6:new tC(k({run:{color:"1F4D78"}},e.heading6)),strong:new nC(k({run:{bold:!0}},e.strong)),listParagraph:new rC(e.listParagraph||{}),caption:new iC(e.caption||{}),bibliography:new sC(e.bibliography||{})},gC(fC(e))),{},{hyperlink:new aC(e.hyperlink||{}),footnoteReference:new yf(e.footnoteReference||{}),footnoteText:new wf(e.footnoteText||{}),footnoteTextChar:new xf(e.footnoteTextChar||{}),endnoteReference:new Tf(e.endnoteReference||{}),endnoteText:new kf(e.endnoteText||{}),endnoteTextChar:new Sf(e.endnoteTextChar||{}),lineNumber:new oC(e.lineNumber||{})})},xh=class{newInstance(e={}){return{initialStyles:new Qs(["mc","r","w","w14","w15"],"w14 w15"),importedStyles:Object.values(wc(e))}}},Cf={headings:{latin:"Calibri Light",panose:"020F0302020204030204"},body:{latin:"Calibri",panose:"020F0502020204030204"}},bC=[["Jpan","\u6E38\u30B4\u30B7\u30C3\u30AF Light","\u6E38\u660E\u671D"],["Hang","\uB9D1\uC740 \uACE0\uB515"],["Hans","\u7B49\u7EBF Light","\u7B49\u7EBF"],["Hant","\u65B0\u7D30\u660E\u9AD4"],["Arab","Times New Roman","Arial"],["Hebr","Times New Roman","Arial"],["Thai","Angsana New","Cordia New"],["Ethi","Nyala"],["Beng","Vrinda"],["Gujr","Shruti"],["Khmr","MoolBoran","DaunPenh"],["Knda","Tunga"],["Guru","Raavi"],["Cans","Euphemia"],["Cher","Plantagenet Cherokee"],["Yiii","Microsoft Yi Baiti"],["Tibt","Microsoft Himalaya"],["Thaa","MV Boli"],["Deva","Mangal"],["Telu","Gautami"],["Taml","Latha"],["Syrc","Estrangelo Edessa"],["Orya","Kalinga"],["Mlym","Kartika"],["Laoo","DokChampa"],["Sinh","Iskoola Pota"],["Mong","Mongolian Baiti"],["Viet","Times New Roman","Arial"],["Uigh","Microsoft Uighur"],["Geor","Sylfaen"],["Armn","Arial"],["Bugi","Leelawadee UI"],["Bopo","Microsoft JhengHei"],["Java","Javanese Text"],["Lisu","Segoe UI"],["Mymr","Myanmar Text"],["Nkoo","Ebrima"],["Olck","Nirmala UI"],["Osma","Ebrima"],["Phag","Phagspa"],["Syrn","Estrangelo Edessa"],["Syrj","Estrangelo Edessa"],["Syre","Estrangelo Edessa"],["Sora","Nirmala UI"],["Tale","Microsoft Tai Le"],["Talu","Microsoft New Tai Lue"],["Tfng","Ebrima"]],hl=(e,t,n)=>new L({name:e,attributes:{typeface:{key:"typeface",value:t},panose:{key:"panose",value:n}}}),vC=(e,t)=>{let n=t[e],r=typeof n=="string"?n:n?.latin;return r??Cf[e].latin},wC=(e,t={})=>{let n=bC.map(([i,s,a=s])=>{var o;return[i,(o=t[i])!==null&&o!==void 0?o:e==="headings"?s:a]}),r=new Set(n.map(([i])=>i));return[...n,...Object.entries(t).filter(([i])=>!r.has(i))]},kh=(e,t)=>{let n=t[e],{eastAsia:r="",complexScript:i="",scripts:s}=typeof n=="object"?n:{},a=vC(e,t),o=Cf[e];return new L({name:e==="headings"?"a:majorFont":"a:minorFont",children:[hl("a:latin",a,a===o.latin?o.panose:void 0),hl("a:ea",r),hl("a:cs",i),...wC(e,s).map(([c,l])=>new L({name:"a:font",attributes:{script:{key:"script",value:c},typeface:{key:"typeface",value:l}}}))]})},yC=(e,t={})=>new L({name:"a:fontScheme",attributes:{name:{key:"name",value:e}},children:[kh("headings",t),kh("body",t)]}),Ef=(e=[])=>new L({name:"a:schemeClr",attributes:{value:{key:"val",value:"phClr"}},children:e.map(([t,n])=>new L({name:`a:${t}`,attributes:{value:{key:"val",value:n}}}))}),Os=e=>new L({name:"a:solidFill",children:[Ef(e)]}),ml=e=>new L({name:"a:gradFill",attributes:{rotateWithShape:{key:"rotWithShape",value:!0}},children:[new L({name:"a:gsLst",children:e.map((t,n)=>new L({name:"a:gs",attributes:{position:{key:"pos",value:n*5e4}},children:[Ef(t)]}))}),new L({name:"a:lin",attributes:{angle:{key:"ang",value:54e5},scaled:{key:"scaled",value:!1}}})]}),fl=e=>new L({name:"a:ln",attributes:{width:{key:"w",value:e},cap:{key:"cap",value:"flat"},compound:{key:"cmpd",value:"sng"},alignment:{key:"algn",value:"ctr"}},children:[Os(),new L({name:"a:prstDash",attributes:{value:{key:"val",value:"solid"}}}),new L({name:"a:miter",attributes:{limit:{key:"lim",value:8e5}}})]}),gl=e=>new L({name:"a:effectStyle",children:[new L({name:"a:effectLst",children:e})]}),xC=()=>new L({name:"a:outerShdw",attributes:{blurRadius:{key:"blurRad",value:57150},distance:{key:"dist",value:19050},direction:{key:"dir",value:54e5},alignment:{key:"algn",value:"ctr"},rotateWithShape:{key:"rotWithShape",value:!1}},children:[new L({name:"a:srgbClr",attributes:{value:{key:"val",value:"000000"}},children:[new L({name:"a:alpha",attributes:{value:{key:"val",value:63e3}}})]})]}),kC=()=>new L({name:"a:fmtScheme",attributes:{name:{key:"name",value:"Office"}},children:[new L({name:"a:fillStyleLst",children:[Os(),ml([[["lumMod",11e4],["satMod",105e3],["tint",67e3]],[["lumMod",105e3],["satMod",103e3],["tint",73e3]],[["lumMod",105e3],["satMod",109e3],["tint",81e3]]]),ml([[["satMod",103e3],["lumMod",102e3],["tint",94e3]],[["satMod",11e4],["lumMod",1e5],["shade",1e5]],[["lumMod",99e3],["satMod",12e4],["shade",78e3]]])]}),new L({name:"a:lnStyleLst",children:[fl(6350),fl(12700),fl(19050)]}),new L({name:"a:effectStyleLst",children:[gl([]),gl([]),gl([xC()])]}),new L({name:"a:bgFillStyleLst",children:[Os(),Os([["tint",95e3],["satMod",17e4]]),ml([[["tint",93e3],["satMod",15e4],["shade",98e3],["lumMod",102e3]],[["tint",98e3],["satMod",13e4],["shade",9e4],["lumMod",103e3]],[["shade",63e3],["satMod",12e4]]])]})]}),TC=class extends P{constructor({name:e="Office Theme",colors:t,fonts:n}={}){super("a:theme"),E(this,"colors",void 0),this.colors=rc(t),this.root.push(new Jh({namespace:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"},name:{key:"name",value:e}})),this.root.push(new L({name:"a:themeElements",children:[Tx(t?e:"Office",t),yC(n?e:"Office",n),kC()]})),this.root.push(new L({name:"a:objectDefaults"})),this.root.push(new L({name:"a:extraClrSchemeLst"}))}get Colors(){return this.colors}},Qe=e=>{let t=e.lastIndexOf("/");return`${e.slice(0,t+1)}_rels/${e.slice(t+1)}.rels`},Af=e=>e.replace(/(^|\/)_rels\/([^/]*)\.rels$/,"$1$2"),_f=e=>e.slice(0,e.lastIndexOf("/")+1),cn=(e,t)=>{let n=t.replace(/\\/g,"/");return(n.startsWith("/")?n:`${_f(e)}${n}`).split("/").reduce((r,i)=>i===""||i==="."?r:i===".."?r.slice(0,-1):[...r,i],[]).join("/")},yc=(e,t)=>{let n=_f(e).split("/").filter(Boolean),r=t.split("/"),i=n.findIndex((a,o)=>o>=r.length-1||r[o]!==a),s=i===-1?n.length:i;return[...n.slice(s).map(()=>".."),...r.slice(s)].join("/")},SC=(e,t)=>e.toLowerCase()===t.toLowerCase(),oe=Uint8Array,Le=Uint16Array,xc=Int32Array,Zs=new oe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ea=new oe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bl=new oe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nf=function(e,t){for(var n=new Le(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new xc(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return{b:n,r:i}},Pf=Nf(Zs,2),If=Pf.b,$l=Pf.r;If[28]=258,$l[258]=28;Of=Nf(ea,0),CC=Of.b,Th=Of.r,Fl=new Le(32768);for(Y=0;Y<32768;++Y)kt=(Y&43690)>>1|(Y&21845)<<1,kt=(kt&52428)>>2|(kt&13107)<<2,kt=(kt&61680)>>4|(kt&3855)<<4,Fl[Y]=((kt&65280)>>8|(kt&255)<<8)>>1;lt=(function(e,t,n){for(var r=e.length,i=0,s=new Le(t);i<r;++i)e[i]&&++s[e[i]-1];var a=new Le(t);for(i=1;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var o;if(n){o=new Le(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)o[Fl[d]>>c]=l}else for(o=new Le(r),i=0;i<r;++i)e[i]&&(o[i]=Fl[a[e[i]-1]++]>>15-e[i]);return o}),jt=new oe(288);for(Y=0;Y<144;++Y)jt[Y]=8;for(Y=144;Y<256;++Y)jt[Y]=9;for(Y=256;Y<280;++Y)jt[Y]=7;for(Y=280;Y<288;++Y)jt[Y]=8;qr=new oe(32);for(Y=0;Y<32;++Y)qr[Y]=5;EC=lt(jt,9,0),AC=lt(jt,9,1),_C=lt(qr,5,0),NC=lt(qr,5,1),bl=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Ye=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},vl=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},kc=function(e){return(e+7)/8|0},Vr=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new oe(e.subarray(t,n))},PC=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ee=function(e,t,n){var r=new Error(t||PC[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Ee),!n)throw r;return r},IC=function(e,t,n,r){var i=e.length,s=r?r.length:0;if(!i||t.f&&!t.l)return n||new oe(0);var a=!n,o=a||t.i!=2,c=t.i;a&&(n=new oe(i*3));var l=function(ae){var te=n.length;if(ae>te){var Re=new oe(Math.max(te*2,ae));Re.set(n),n=Re}},u=t.f||0,d=t.p||0,p=t.b||0,h=t.l,f=t.d,m=t.m,g=t.n,y=i*8;do{if(!h){u=Ye(e,d,1);var T=Ye(e,d+1,3);if(d+=3,T)if(T==1)h=AC,f=NC,m=9,g=5;else if(T==2){var w=Ye(e,d,31)+257,x=Ye(e,d+10,15)+4,v=w+Ye(e,d+5,31)+1;d+=14;for(var A=new oe(v),N=new oe(19),D=0;D<x;++D)N[Bl[D]]=Ye(e,d+D*3,7);d+=x*3;for(var O=bl(N),F=(1<<O)-1,Q=lt(N,O,1),D=0;D<v;){var Z=Q[Ye(e,d,F)];d+=Z&15;var b=Z>>4;if(b<16)A[D++]=b;else{var V=0,G=0;for(b==16?(G=3+Ye(e,d,3),d+=2,V=A[D-1]):b==17?(G=3+Ye(e,d,7),d+=3):b==18&&(G=11+Ye(e,d,127),d+=7);G--;)A[D++]=V}}var de=A.subarray(0,w),ce=A.subarray(w);m=bl(de),g=bl(ce),h=lt(de,m,1),f=lt(ce,g,1)}else Ee(1);else{var b=kc(d)+4,C=e[b-4]|e[b-3]<<8,_=b+C;if(_>i){c&&Ee(0);break}o&&l(p+C),n.set(e.subarray(b,_),p),t.b=p+=C,t.p=d=_*8,t.f=u;continue}if(d>y){c&&Ee(0);break}}o&&l(p+131072);for(var _t=(1<<m)-1,Ae=(1<<g)-1,Ue=d;;Ue=d){var V=h[vl(e,d)&_t],we=V>>4;if(d+=V&15,d>y){c&&Ee(0);break}if(V||Ee(2),we<256)n[p++]=we;else if(we==256){Ue=d,h=null;break}else{var ye=we-254;if(we>264){var D=we-257,re=Zs[D];ye=Ye(e,d,(1<<re)-1)+If[D],d+=re}var M=f[vl(e,d)&Ae],$=M>>4;M||Ee(3),d+=M&15;var ce=CC[$];if($>3){var re=ea[$];ce+=vl(e,d)&(1<<re)-1,d+=re}if(d>y){c&&Ee(0);break}o&&l(p+131072);var q=p+ye;if(p<ce){var ie=s-ce,se=Math.min(ce,q);for(ie+p<0&&Ee(3);p<se;++p)n[p]=r[ie+p]}for(;p<q;++p)n[p]=n[p-ce]}}t.l=h,t.p=Ue,t.b=p,t.f=u,h&&(u=1,t.m=m,t.d=f,t.n=g)}while(!u);return p!=n.length&&a?Vr(n,0,p):n.subarray(0,p)},Tt=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Sr=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},wl=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return{t:Lf,l:0};if(i==1){var a=new oe(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(_,w){return _.f-w.f}),n.push({s:-1,f:25001});var o=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:o.f+c.f,l:o,r:c};u!=i-1;)o=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:o.f+c.f,l:o,r:c};for(var p=s[0].s,r=1;r<i;++r)s[r].s>p&&(p=s[r].s);var h=new Le(p+1),f=ql(n[u-1],h,0);if(f>t){var r=0,m=0,g=f-t,y=1<<g;for(s.sort(function(w,x){return h[x.s]-h[w.s]||w.f-x.f});r<i;++r){var T=s[r].s;if(h[T]>t)m+=y-(1<<f-h[T]),h[T]=t;else break}for(m>>=g;m>0;){var b=s[r].s;h[b]<t?m-=1<<t-h[b]++-1:++r}for(;r>=0&&m;--r){var C=s[r].s;h[C]==t&&(--h[C],++m)}f=t}return{t:new oe(h),l:f}},ql=function(e,t,n){return e.s==-1?Math.max(ql(e.l,t,n+1),ql(e.r,t,n+1)):t[e.s]=n},Sh=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Le(++t),r=0,i=e[0],s=1,a=function(c){n[r++]=c},o=1;o<=t;++o)if(e[o]==i&&o!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=e[o]}return{c:n.subarray(0,r),n:t}},Cr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Rf=function(e,t,n){var r=n.length,i=kc(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s<r;++s)e[i+s+4]=n[s];return(i+4+r)*8},Ch=function(e,t,n,r,i,s,a,o,c,l,u){Tt(t,u++,n),++i[256];for(var d=wl(i,15),p=d.t,h=d.l,f=wl(s,15),m=f.t,g=f.l,y=Sh(p),T=y.c,b=y.n,C=Sh(m),_=C.c,w=C.n,x=new Le(19),v=0;v<T.length;++v)++x[T[v]&31];for(var v=0;v<_.length;++v)++x[_[v]&31];for(var A=wl(x,7),N=A.t,D=A.l,O=19;O>4&&!N[Bl[O-1]];--O);var F=l+5<<3,Q=Cr(i,jt)+Cr(s,qr)+a,Z=Cr(i,p)+Cr(s,m)+a+14+3*O+Cr(x,N)+2*x[16]+3*x[17]+7*x[18];if(c>=0&&F<=Q&&F<=Z)return Rf(t,u,e.subarray(c,c+l));var V,G,de,ce;if(Tt(t,u,1+(Z<Q)),u+=2,Z<Q){V=lt(p,h,0),G=p,de=lt(m,g,0),ce=m;var _t=lt(N,D,0);Tt(t,u,b-257),Tt(t,u+5,w-1),Tt(t,u+10,O-4),u+=14;for(var v=0;v<O;++v)Tt(t,u+3*v,N[Bl[v]]);u+=3*O;for(var Ae=[T,_],Ue=0;Ue<2;++Ue)for(var we=Ae[Ue],v=0;v<we.length;++v){var ye=we[v]&31;Tt(t,u,_t[ye]),u+=N[ye],ye>15&&(Tt(t,u,we[v]>>5&127),u+=we[v]>>12)}}else V=EC,G=jt,de=_C,ce=qr;for(var v=0;v<o;++v){var re=r[v];if(re>255){var ye=re>>18&31;Sr(t,u,V[ye+257]),u+=G[ye+257],ye>7&&(Tt(t,u,re>>23&31),u+=Zs[ye]);var M=re&31;Sr(t,u,de[M]),u+=ce[M],M>3&&(Sr(t,u,re>>5&8191),u+=ea[M])}else Sr(t,u,V[re]),u+=G[re]}return Sr(t,u,V[256]),u+G[256]},OC=new xc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Lf=new oe(0),RC=function(e,t,n,r,i,s){var a=s.z||e.length,o=new oe(r+a+5*(1+Math.ceil(a/7e3))+i),c=o.subarray(r,o.length-i),l=s.l,u=(s.r||0)&7;if(t){u&&(c[0]=s.r>>3);for(var d=OC[t-1],p=d>>13,h=d&8191,f=(1<<n)-1,m=s.p||new Le(32768),g=s.h||new Le(f+1),y=Math.ceil(n/3),T=2*y,b=function(Re){return(e[Re]^e[Re+1]<<y^e[Re+2]<<T)&f},C=new xc(25e3),_=new Le(288),w=new Le(32),x=0,v=0,A=s.i||0,N=0,D=s.w||0,O=0;A+2<a;++A){var F=b(A),Q=A&32767,Z=g[F];if(m[Q]=Z,g[F]=Q,D<=A){var V=a-A;if((x>7e3||N>24576)&&(V>423||!l)){u=Ch(e,c,0,C,_,w,v,N,O,A-O,u),N=x=v=0,O=A;for(var G=0;G<286;++G)_[G]=0;for(var G=0;G<30;++G)w[G]=0}var de=2,ce=0,_t=h,Ae=Q-Z&32767;if(V>2&&F==b(A-Ae))for(var Ue=Math.min(p,V)-1,we=Math.min(32767,A),ye=Math.min(258,V);Ae<=we&&--_t&&Q!=Z;){if(e[A+de]==e[A+de-Ae]){for(var re=0;re<ye&&e[A+re]==e[A+re-Ae];++re);if(re>de){if(de=re,ce=Ae,re>Ue)break;for(var M=Math.min(Ae,re-2),$=0,G=0;G<M;++G){var q=A-Ae+G&32767,ie=q-m[q]&32767;ie>$&&($=ie,Z=q)}}}Q=Z,Z=m[Q],Ae+=Q-Z&32767}if(ce){C[N++]=268435456|$l[de]<<18|Th[ce];var se=$l[de]&31,ae=Th[ce]&31;v+=Zs[se]+ea[ae],++_[257+se],++w[ae],D=A+de,++x}else C[N++]=e[A],++_[e[A]]}}for(A=Math.max(A,D);A<a;++A)C[N++]=e[A],++_[e[A]];u=Ch(e,c,l,C,_,w,v,N,O,A-O,u),l||(s.r=u&7|c[u/8|0]<<3,u-=7,s.h=g,s.p=m,s.i=A,s.w=D)}else{for(var A=s.w||0;A<a+l;A+=65535){var te=A+65535;te>=a&&(c[u/8|0]=l,te=a),u=Rf(c,u+1,e.subarray(A,te))}s.i=a}return Vr(o,0,r+kc(u)+i)},LC=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),DC=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=LC[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},MC=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),a=new oe(s.length+e.length);a.set(s),a.set(e,s.length),e=a,i.w=s.length}return RC(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},Df=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},st=function(e,t){return e[t]|e[t+1]<<8},Be=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},yl=function(e,t){return Be(e,t)+Be(e,t+4)*4294967296},ke=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};Mf=function(e,t,n,r){for(var i in e){var s=e[i],a=t+i,o=r;Array.isArray(s)&&(o=Df(r,s[1]),s=s[0]),ArrayBuffer.isView(s)?n[a]=[s,o]:(n[a+="/"]=[new oe(0),o],Mf(s,a,n,r))}},Eh=typeof TextEncoder<"u"&&new TextEncoder,Hl=typeof TextDecoder<"u"&&new TextDecoder;try{Hl.decode(Lf,{stream:!0})}catch{}FC=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:Vr(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};HC=function(e,t){return t+30+st(e,t+26)+st(e,t+28)},UC=function(e,t,n){var r=st(e,t+28),i=st(e,t+30),s=qC(e.subarray(t+46,t+46+r),!(st(e,t+8)&2048)),a=t+46+r,o=jC(e,a,i,n,Be(e,t+20),Be(e,t+24),Be(e,t+42)),c=o[0],l=o[1],u=o[2];return[st(e,t+10),c,l,s,a+i+st(e,t+32),u]},jC=function(e,t,n,r,i,s,a){var o=i==4294967295,c=s==4294967295,l=a==4294967295,u=t+n,d=o+c+l;if(r&&d){for(;t+4<u;t+=4+st(e,t+2))if(st(e,t)==1)return[o?yl(e,t+4+8*c):i,c?yl(e,t+4):s,l?yl(e,t+4+8*(c+o)):a,1];r<2&&Ee(13)}return[i,s,a,0]},Ul=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&Ee(9),t+=r+4}return t},_h=function(e,t,n,r,i,s,a,o){var c=r.length,l=n.extra,u=o&&o.length,d=Ul(l);ke(e,t,a!=null?33639248:67324752),t+=4,a!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(s<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var p=new Date(n.mtime==null?Date.now():n.mtime),h=p.getFullYear()-1980;if((h<0||h>119)&&Ee(10),ke(e,t,h<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),t+=4,s!=-1&&(ke(e,t,n.crc),ke(e,t+4,s<0?-s-2:s),ke(e,t+8,n.size)),ke(e,t+12,c),ke(e,t+14,d),t+=16,a!=null&&(ke(e,t,u),ke(e,t+6,n.attrs),ke(e,t+10,a),t+=14),e.set(r,t),t+=c,d)for(var f in l){var m=l[f],g=m.length;ke(e,t,+f),ke(e,t+2,g),e.set(m,t+4),t+=4+g}return u&&(e.set(o,t),t+=u),t},WC=function(e,t,n,r,i){ke(e,t,101010256),ke(e,t+8,n),ke(e,t+10,n),ke(e,t+12,r),ke(e,t+16,i)};zC=e=>typeof e=="string"?ck(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e),qs=e=>KC(Object.fromEntries([...e].map(([t,n])=>[t,zC(n)]))),VC=1032,Nh=e=>new Error(`Corrupted zip: ${e} isn't the size the zip file gives it`),Bf=(e,t=()=>!0)=>{let n=new Map,r=0,i=GC(e,{filter:({name:a,size:o,originalSize:c})=>{if(a.endsWith("/")||!t(a))return!1;if(r+=o,r>e.length||c>o*VC)throw Nh(a);return n.set(a,c),!0}}),s=Object.entries(i).find(([a,o])=>o.length!==n.get(a));if(s!==void 0)throw Nh(s[0]);return new Map(Object.entries(i))},xl=e=>{let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t},Rs=e=>new Error(`${e} is not supported by this platform`),Ph={uint8array:e=>e,arraybuffer:e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),array:e=>Array.from(e),string:xl,binarystring:xl,base64:e=>btoa(xl(e)),blob:(e,t)=>{if(typeof Blob>"u")throw Rs("blob");return new Blob([e],{type:t})},nodebuffer:e=>{if(typeof Buffer>"u")throw Rs("nodebuffer");return Buffer.from(e.buffer,e.byteOffset,e.byteLength)},text:()=>{throw Rs("text")}},jl=(e,t,n)=>{let r=Object.prototype.hasOwnProperty.call(Ph,t.toLowerCase())?Ph[t.toLowerCase()]:void 0;if(r===void 0)throw Rs(t);return r(e,n)},XC=new Map([["dk1","dark1"],["lt1","light1"],["dk2","dark2"],["lt2","light2"],["accent1","accent1"],["accent2","accent2"],["accent3","accent3"],["accent4","accent4"],["accent5","accent5"],["accent6","accent6"],["hlink","hyperlink"],["folHlink","followedHyperlink"]]),YC=new Map([["dark1","windowText"],["light1","window"]]),JC=new Set(["http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","http://purl.oclc.org/ooxml/officeDocument/relationships/theme"]),Hr=e=>{var t,n;return(t=e==null||(n=e.name)===null||n===void 0?void 0:n.slice(e.name.indexOf(":")+1))!==null&&t!==void 0?t:""},Xr=e=>{var t,n;return(t=e==null||(n=e.elements)===null||n===void 0?void 0:n.filter(r=>r.type==="element"))!==null&&t!==void 0?t:[]},Wl=(e,t)=>Xr(e).find(n=>Hr(n)===t),Rr=(e,t)=>{var n;let r=e==null||(n=e.attributes)===null||n===void 0?void 0:n[t];return r===void 0?void 0:String(r)},QC=e=>new TextDecoder(e[0]===255&&e[1]===254?"utf-16le":e[0]===254&&e[1]===255?"utf-16be":"utf-8").decode(e),ZC=(e,t,n)=>{let r=e.get(Qe(t)),i=Rr(r&&Xr(Wl(Wr(QC(r)),"Relationships")).find(s=>{var a;return n.has((a=Rr(s,"Type"))!==null&&a!==void 0?a:"")}),"Target");return i===void 0?void 0:cn(t,i)},eE=(e,t)=>ZC(e,t,JC),tE=(e,t,n)=>{let[r]=Xr(t),i=Hr(r)==="srgbClr"?Rr(r,"val"):Hr(r)==="sysClr"&&(n||Rr(r,"val")!==YC.get(e))?Rr(r,"lastClr"):void 0;return i!==void 0&&/^[0-9A-Fa-f]{6}$/.test(i)?i.toUpperCase():void 0},nE=(e,t=!1)=>Object.fromEntries(Xr(e).flatMap(n=>{let r=XC.get(Hr(n)),i=r&&tE(r,n,t);return r&&i?[[r,i]]:[]})),rE=e=>{let[t]=Xr(Wr(e)),n=Hr(t)==="theme"?Wl(Wl(t,"themeElements"),"clrScheme"):void 0;return n?nE(n,!0):{}},iE=[208,207,17,224,161,177,26,225],$f=class{constructor(e){var t,n,r,i,s,a,o,c,l,u,d,p,h,f;if(E(this,"currentRelationshipId",1),E(this,"documentWrapper",void 0),E(this,"headers",[]),E(this,"footers",[]),E(this,"coreProperties",void 0),E(this,"numbering",void 0),E(this,"media",void 0),E(this,"fileRelationships",void 0),E(this,"footnotesWrapper",void 0),E(this,"endnotesWrapper",void 0),E(this,"settings",void 0),E(this,"contentTypes",void 0),E(this,"customProperties",void 0),E(this,"appProperties",void 0),E(this,"styles",void 0),E(this,"comments",void 0),E(this,"commentsExtended",void 0),E(this,"commentsIds",void 0),E(this,"fontWrapper",void 0),E(this,"theme",void 0),E(this,"packageParts",void 0),E(this,"macros",void 0),E(this,"bibliography",void 0),e.macros!==void 0){let{project:b,events:C=[]}=e.macros,_=b instanceof Uint8Array?b:new Uint8Array(b);if(!iE.every((x,v)=>_[v]===x))throw new Error("macros.project isn't a VBA project. Use createMacros from docx/macros, or the word/vbaProject.bin in a .docm rather than the .docm itself");let w=new be;C.length>0&&w.addRelationship(1,"http://schemas.microsoft.com/office/2006/relationships/wordVbaData","vbaData.xml"),this.macros={project:_,events:C.length>0?ZT(C):void 0,relationships:w}}if(this.coreProperties=new WT(k(k({},e),{},{creator:(t=e.creator)!==null&&t!==void 0?t:"Un-named",revision:(n=e.revision)!==null&&n!==void 0?n:1,lastModifiedBy:(r=e.lastModifiedBy)!==null&&r!==void 0?r:"Un-named"})),this.numbering=new ff(e.numbering?e.numbering:{config:[]}),this.comments=new u1((i=e.comments)!==null&&i!==void 0?i:{children:[]}),this.comments.ThreadData&&(this.commentsExtended=new g1(this.comments.ThreadData)),this.comments.CommentIdsData&&(this.commentsIds=new y1(this.comments.CommentIdsData)),this.fileRelationships=new be,this.customProperties=new YT((s=e.customProperties)!==null&&s!==void 0?s:[]),this.appProperties=new HT,this.footnotesWrapper=new mS,this.endnotesWrapper=new oS,this.contentTypes=new jT({macros:this.macros!==void 0}),((a=this.macros)===null||a===void 0?void 0:a.events)!==void 0&&this.contentTypes.addOverride("application/vnd.ms-word.vbaData+xml","/word/vbaData.xml"),e.bibliography!==void 0){let b=new be;b.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps","itemProps1.xml"),this.bibliography={sources:e.bibliography.sources,properties:JT(`{${bm().toUpperCase()}}`),relationships:b},this.contentTypes.addOverride("application/vnd.openxmlformats-officedocument.customXmlProperties+xml","/customXml/itemProps1.xml")}if(this.packageParts=new gf(this.contentTypes),this.documentWrapper=new nS({background:e.background,pageNumbers:e.pageNumbers}),this.settings=new KS({compatibilityModeVersion:e.compatabilityModeVersion,compatibility:e.compatibility,evenAndOddHeaders:!!e.evenAndOddHeaderAndFooters,trackRevisions:(o=e.features)===null||o===void 0?void 0:o.trackRevisions,updateFields:(c=e.features)===null||c===void 0?void 0:c.updateFields,embedFonts:!((l=e.fonts)===null||l===void 0)&&l.length?!0:void 0,defaultTabStop:e.defaultTabStop,protection:e.protection,hyphenation:{autoHyphenation:(u=e.hyphenation)===null||u===void 0?void 0:u.autoHyphenation,hyphenationZone:(d=e.hyphenation)===null||d===void 0?void 0:d.hyphenationZone,consecutiveHyphenLimit:(p=e.hyphenation)===null||p===void 0?void 0:p.consecutiveHyphenLimit,doNotHyphenateCaps:(h=e.hyphenation)===null||h===void 0?void 0:h.doNotHyphenateCaps}}),this.media=new mf(b=>this.packageParts.takePath("media","image",b)),e.externalStyles!==void 0){var m,g,y,T;let b=(m=(g=e.styles)===null||g===void 0?void 0:g.default)!==null&&m!==void 0?m:{},C=Object.entries(wc(b)),_=([x])=>b[x]!==void 0,w=new mC().newInstance(e.externalStyles);this.styles=new ul(k(k({},w),{},{paragraphStyles:(y=e.styles)===null||y===void 0?void 0:y.paragraphStyles,characterStyles:(T=e.styles)===null||T===void 0?void 0:T.characterStyles,importedStyles:[...C.filter(x=>!_(x)).map(([,x])=>x),...w.importedStyles,...C.filter(_).map(([,x])=>x)]}))}else if(e.styles){let b=new xh().newInstance(e.styles.default);this.styles=new ul(k(k({},b),e.styles))}else{let b=new xh;this.styles=new ul(b.newInstance())}this.addDefaultRelationships();for(let b of e.sections)this.addSection(b);if(e.footnotes)for(let b in e.footnotes)this.footnotesWrapper.View.createFootNote(parseFloat(b),e.footnotes[b].children);if(e.endnotes)for(let b in e.endnotes)this.endnotesWrapper.View.createEndnote(parseFloat(b),e.endnotes[b].children);this.fontWrapper=new Km((f=e.fonts)!==null&&f!==void 0?f:[]),this.theme=new TC(e.theme),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","theme/theme1.xml"),this.macros!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2006/relationships/vbaProject","vbaProject.bin"),this.bibliography!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml","../customXml/item1.xml")}addSection({headers:e={},footers:t={},children:n,properties:r}){this.documentWrapper.View.Body.addSection(k(k({},r),{},{headerWrapperGroup:{default:e.default?this.createHeader(e.default):void 0,first:e.first?this.createHeader(e.first):void 0,even:e.even?this.createHeader(e.even):void 0},footerWrapperGroup:{default:t.default?this.createFooter(t.default):void 0,first:t.first?this.createFooter(t.first):void 0,even:t.even?this.createFooter(t.even):void 0}}));for(let i of n)this.documentWrapper.View.add(i)}createHeader(e){let t=new bS(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addHeaderToDocument(t),t}createFooter(e){let t=new dS(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addFooterToDocument(t),t}addHeaderToDocument(e,t=Ln.DEFAULT){this.headers.push({header:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",`header${this.headers.length}.xml`),this.contentTypes.addHeader(this.headers.length)}addFooterToDocument(e,t=Ln.DEFAULT){this.footers.push({footer:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",`footer${this.footers.length}.xml`),this.contentTypes.addFooter(this.footers.length)}addDefaultRelationships(){this.fileRelationships.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument","word/document.xml"),this.fileRelationships.addRelationship(2,"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"),this.fileRelationships.addRelationship(3,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties","docProps/app.xml"),this.fileRelationships.addRelationship(4,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties","docProps/custom.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","styles.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering","numbering.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes","footnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes","endnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings","settings.xml"),this.comments.IsEmpty||(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments","comments.xml"),this.contentTypes.addComments()),this.commentsExtended&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2011/relationships/commentsExtended","commentsExtended.xml"),this.contentTypes.addCommentsExtended()),this.commentsIds&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds","commentsIds.xml"),this.contentTypes.addCommentsIds())}get Document(){return this.documentWrapper}get Styles(){return this.styles}get CoreProperties(){return this.coreProperties}get Numbering(){return this.numbering}get Media(){return this.media}get FileRelationships(){return this.fileRelationships}get Headers(){return this.headers.map(e=>e.header)}get Footers(){return this.footers.map(e=>e.footer)}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Endnotes(){return this.endnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get CommentsExtended(){return this.commentsExtended}get CommentsIds(){return this.commentsIds}get FontTable(){return this.fontWrapper}get Theme(){return this.theme}get PackageParts(){return this.packageParts}get Macros(){return this.macros}get Bibliography(){return this.bibliography}},sE=class extends P{constructor(e){super("w:sdtPr"),e&&this.root.push(new ot("w:alias",e))}},aE=e=>new L({name:"w:docPartObj",children:[new ot("w:docPartGallery",e),new L({name:"w:docPartUnique"})]}),oE=["contentChildren","cachedEntries","beginDirty","tabLeader"],Ff=class extends hc{constructor(e="Table of Contents",t={}){let{contentChildren:n=[],cachedEntries:r=[],beginDirty:i,tabLeader:s=E1.DOT}=t,a=Zl(t,oE);super("w:sdt"),E(this,"fromHeadings",void 0);let o=new sE(e);o.addChildElement(aE("Table of Contents")),this.root.push(o);let c=new _m,l=[new qe({children:[Nm(i),new Am(a),sn()]})],u=[new qe({children:[an()]})];if(r!==void 0&&r.length>0){let{stylesWithLevels:d}=a,p=r.map((f,m)=>{var g,y;let T=this.buildCachedContentParagraphChild(f,a),b=(g=d==null||(y=d.find(_=>_.level===f.level))===null||y===void 0?void 0:y.styleName)!==null&&g!==void 0?g:`TOC${f.level}`,C=m===0?[...l,T]:m===r.length-1?[T,...u]:[T];return new ne({style:b,tabStops:this.getTabStopsForLevel(f.level,s),children:C})}),h=p;r.length<=1&&(h=[...p,new ne({children:u})]);for(let f of h)c.addChildElement(f)}else{let d=new ne({children:l});c.addChildElement(d);for(let h of n)c.addChildElement(h);let p=new ne({children:u});c.addChildElement(p),n.length===0&&(this.fromHeadings={properties:a,beginDirty:i,tabLeader:s})}this.root.push(c)}prepForXml(e){let t=super.prepForXml(e);return $k(t,this.fromHeadings&&k(k({},this.fromHeadings),{},{textWidth:this.textWidthIn(e)})),t}textWidthIn(e){var t,n;return(t=(n=e.file)===null||n===void 0||(n=n.Document)===null||n===void 0||(n=n.View.Body.getSectionPropertiesFor(this))===null||n===void 0?void 0:n.AvailableTextWidth)!==null&&t!==void 0?t:Ps}getTabStopsForLevel(e,t,n=9025){return[{type:"clear",position:n+1-(e-1)*240},{type:"right",position:n,leader:t}]}buildCachedContentRun(e,t){var n,r;return new qe({style:t?.hyperlink&&e.href!==void 0?"IndexLink":void 0,children:[new Mr({text:e.title}),new Xs,new Mr({text:(n=(r=e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""})]})}buildCachedContentParagraphChild(e,t){let n=this.buildCachedContentRun(e,t);return t?.hyperlink&&e.href!==void 0?new Fm({anchor:e.href,children:[n]}):n}},Er=0,kl=32,lE=32,cE=(e,t)=>{let n=t.replace(/-/g,"");if(n.length!==lE)throw new Error(`Error: Cannot extract GUID from font filename: ${t}`);let r=n.replace(/(..)/g,"$1 ").trim().split(" ").map(a=>parseInt(a,16));r.reverse();let i=e.slice(Er,kl).map((a,o)=>a^r[o%r.length]),s=new Uint8Array(Er+i.length+Math.max(0,e.length-kl));return s.set(e.slice(0,Er)),s.set(i,Er),s.set(e.slice(kl),Er+i.length),s},dn=class{format(e,t={stack:[]}){let n=e.prepForXml(t);if(n)return n;throw Error("XMLComponent did not format correctly")}},qf=/\{([^{}]+)\}/g,Hf=(e,t)=>t.size===0?e:e.replace(qf,(n,r)=>{var i;return(i=t.get(r))!==null&&i!==void 0?i:n}),dE=e=>new Set(Array.from(e.matchAll(qf),([,t])=>t)),Uf=class{replace(e,t,n){return Hf(e,new Map(t.map((r,i)=>[r.key,(n+i).toString()])))}getMediaData(e,t){let n=dE(e);return t.Entries.filter(([r])=>n.has(r)).map(([r,{fileName:i}])=>({key:r,fileName:i}))}},pE=class{replace(e,t){return Hf(e,new Map(t.map(({reference:n,instance:r,restartedListId:i,numId:s})=>[Bs(n,r,i),s.toString()])))}},uE=new dn,Tl=(e,t,n,r,i=!0)=>j(uE.format(t,{viewWrapper:{View:t,Relationships:r},file:e,stack:[]}),{indent:n,declaration:i?{standalone:"yes",encoding:"UTF-8"}:{encoding:"UTF-8"}}),hE=(e,t,n,r)=>{let{content:i}=t.options;if(i instanceof Uint8Array)return[{data:i,path:`word/${n}`}];if("files"in i)return[{data:qs(i.files.map(({path:l,content:u})=>[l,u instanceof Uint8Array?u:Tl(e,u,r,new be)])),path:`word/${n}`}];let s=e.PackageParts.createRelationships(n),a=Tl(e,i,r,s),o=n.slice(0,n.lastIndexOf("/")),c=n.slice(n.lastIndexOf("/")+1);return[{data:a,path:`word/${n}`},...s.RelationshipCount>0?[{data:Tl(e,s,r,s,!1),path:`word/${o}/_rels/${c}.rels`}]:[]]},Tc=(e,t,n=0)=>{let r=e.PackageParts.Array.slice(n);return r.length===0?[]:[...r.flatMap(({part:i,path:s})=>hE(e,i,s,t)),...Tc(e,t,n+r.length)]},mE=["PackageParts"],fE=class{constructor(){E(this,"formatter",void 0),E(this,"imageReplacer",void 0),E(this,"numberingReplacer",void 0),this.formatter=new dn,this.imageReplacer=new Uf,this.numberingReplacer=new pE}compile(e,t,n=[]){let r=this.xmlifyFile(e,t),{PackageParts:i}=r,s=Zl(r,mE),a=Object.values(s).flatMap(o=>Array.isArray(o)?o:[o]);return new Map([...a.map(({path:o,data:c})=>[o,c]),...i.map(({path:o,data:c})=>[o,c]),...n.map(({path:o,data:c})=>[o,c]),...e.Macros===void 0?[]:[["word/vbaProject.bin",e.Macros.project]],...e.Media.Array.map(o=>[`word/media/${o.fileName}`,o.data]),...e.FontTable.files.map(({data:o,fontKey:c},l)=>[`word/fonts/font${l+1}.odttf`,cE(o,c)])])}xmlifyFile(e,t){var n;let r=j(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),i=j(this.formatter.format(e.Comments,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),s=j(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),a=j(this.formatter.format(e.Endnotes.View,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),o=e.Document.Relationships.RelationshipCount+1,c=e.Comments.Relationships.RelationshipCount+1,l=e.FootNotes.Relationships.RelationshipCount+1,u=e.Endnotes.Relationships.RelationshipCount+1,d=this.imageReplacer.getMediaData(r,e.Media),p=this.imageReplacer.getMediaData(i,e.Media),h=this.imageReplacer.getMediaData(s,e.Media),f=this.imageReplacer.getMediaData(a,e.Media);return k(k(k(k(k(k({Relationships:{data:(()=>{let m=be.copy(e.Document.Relationships);return d.forEach((g,y)=>{m.addRelationship(o+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),m.addRelationship(m.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),j(this.formatter.format(m,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{let m=this.imageReplacer.replace(r,d,o);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{let m=j(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:j(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},FileRelationships:{data:j(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=be.copy(m.Relationships);return T.forEach((C,_)=>{b.addRelationship(_,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${C.fileName}`)}),{data:j(this.formatter.format(b,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${g+1}.xml.rels`}}),FooterRelationships:e.Footers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=be.copy(m.Relationships);return T.forEach((C,_)=>{b.addRelationship(_,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${C.fileName}`)}),{data:j(this.formatter.format(b,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${g+1}.xml.rels`}}),Headers:e.Headers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=this.imageReplacer.replace(y,T,0);return{data:this.numberingReplacer.replace(b,e.Numbering.ConcreteNumbering),path:`word/header${g+1}.xml`}}),Footers:e.Footers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=this.imageReplacer.replace(y,T,0);return{data:this.numberingReplacer.replace(b,e.Numbering.ConcreteNumbering),path:`word/footer${g+1}.xml`}}),CustomProperties:{data:j(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:j(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:(()=>{let m=this.imageReplacer.replace(s,h,l);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/footnotes.xml"},FootNotesRelationships:{data:(()=>{let m=be.copy(e.FootNotes.Relationships);return h.forEach((g,y)=>{m.addRelationship(l+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/footnotes.xml.rels"},Endnotes:{data:(()=>{let m=this.imageReplacer.replace(a,f,u);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/endnotes.xml"},EndnotesRelationships:{data:(()=>{let m=be.copy(e.Endnotes.Relationships);return f.forEach((g,y)=>{m.addRelationship(u+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/endnotes.xml.rels"},Settings:{data:j(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"}},e.Comments.IsEmpty?{}:{Comments:{data:(()=>{let m=this.imageReplacer.replace(i,p,c);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/comments.xml"},CommentsRelationships:{data:(()=>{let m=be.copy(e.Comments.Relationships);return p.forEach((g,y)=>{m.addRelationship(c+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/comments.xml.rels"}}),e.CommentsExtended?{CommentsExtended:{data:j(this.formatter.format(e.CommentsExtended,{viewWrapper:{View:e.CommentsExtended,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsExtended.xml"}}:{}),e.CommentsIds?{CommentsIds:{data:j(this.formatter.format(e.CommentsIds,{viewWrapper:{View:e.CommentsIds,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsIds.xml"}}:{}),{},{FontTable:{data:j(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:j(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/fontTable.xml.rels"},Theme:{data:j(this.formatter.format(e.Theme,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/theme/theme1.xml"}},!((n=e.Macros)===null||n===void 0)&&n.events?{MacroEvents:{data:j(this.formatter.format(e.Macros.events,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/vbaData.xml"},MacroRelationships:{data:j(this.formatter.format(e.Macros.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/vbaProject.bin.rels"}}:{}),e.Bibliography?{BibliographySources:{data:j(this.formatter.format(e.Bibliography.sources,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"customXml/item1.xml"},BibliographySourcesProperties:{data:j(this.formatter.format(e.Bibliography.properties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"no",encoding:"UTF-8"}}),path:"customXml/itemProps1.xml"},BibliographySourcesRelationships:{data:j(this.formatter.format(e.Bibliography.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"customXml/_rels/item1.xml.rels"}}:{}),{},{PackageParts:Tc(e,t),Numbering:{data:j(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},ContentTypes:{data:j(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"}})}},Ih=Zy(((e,t)=>{var n=typeof Reflect=="object"?Reflect:null,r=n&&typeof n.apply=="function"?n.apply:function(x,v,A){return Function.prototype.apply.call(x,v,A)},i;n&&typeof n.ownKeys=="function"?i=n.ownKeys:Object.getOwnPropertySymbols?i=function(x){return Object.getOwnPropertyNames(x).concat(Object.getOwnPropertySymbols(x))}:i=function(x){return Object.getOwnPropertyNames(x)};function s(w){console&&console.warn&&console.warn(w)}var a=Number.isNaN||function(x){return x!==x};function o(){o.init.call(this)}t.exports=o,t.exports.once=b,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function l(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(w){if(typeof w!="number"||w<0||a(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");c=w}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(x){if(typeof x!="number"||x<0||a(x))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+x+".");return this._maxListeners=x,this};function u(w){return w._maxListeners===void 0?o.defaultMaxListeners:w._maxListeners}o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(x){for(var v=[],A=1;A<arguments.length;A++)v.push(arguments[A]);var N=x==="error",D=this._events;if(D!==void 0)N=N&&D.error===void 0;else if(!N)return!1;if(N){var O;if(v.length>0&&(O=v[0]),O instanceof Error)throw O;var F=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw F.context=O,F}var Q=D[x];if(Q===void 0)return!1;if(typeof Q=="function")r(Q,this,v);else for(var Z=Q.length,V=g(Q,Z),A=0;A<Z;++A)r(V[A],this,v);return!0};function d(w,x,v,A){var N,D,O;if(l(v),D=w._events,D===void 0?(D=w._events=Object.create(null),w._eventsCount=0):(D.newListener!==void 0&&(w.emit("newListener",x,v.listener?v.listener:v),D=w._events),O=D[x]),O===void 0)O=D[x]=v,++w._eventsCount;else if(typeof O=="function"?O=D[x]=A?[v,O]:[O,v]:A?O.unshift(v):O.push(v),N=u(w),N>0&&O.length>N&&!O.warned){O.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=w,F.type=x,F.count=O.length,s(F)}return w}o.prototype.addListener=function(x,v){return d(this,x,v,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(x,v){return d(this,x,v,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(w,x,v){var A={fired:!1,wrapFn:void 0,target:w,type:x,listener:v},N=p.bind(A);return N.listener=v,A.wrapFn=N,N}o.prototype.once=function(x,v){return l(v),this.on(x,h(this,x,v)),this},o.prototype.prependOnceListener=function(x,v){return l(v),this.prependListener(x,h(this,x,v)),this},o.prototype.removeListener=function(x,v){var A,N,D,O,F;if(l(v),N=this._events,N===void 0)return this;if(A=N[x],A===void 0)return this;if(A===v||A.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete N[x],N.removeListener&&this.emit("removeListener",x,A.listener||v));else if(typeof A!="function"){for(D=-1,O=A.length-1;O>=0;O--)if(A[O]===v||A[O].listener===v){F=A[O].listener,D=O;break}if(D<0)return this;D===0?A.shift():y(A,D),A.length===1&&(N[x]=A[0]),N.removeListener!==void 0&&this.emit("removeListener",x,F||v)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(x){var v,A=this._events,N;if(A===void 0)return this;if(A.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):A[x]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete A[x]),this;if(arguments.length===0){var D=Object.keys(A),O;for(N=0;N<D.length;++N)O=D[N],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=A[x],typeof v=="function")this.removeListener(x,v);else if(v!==void 0)for(N=v.length-1;N>=0;N--)this.removeListener(x,v[N]);return this};function f(w,x,v){var A=w._events;if(A===void 0)return[];var N=A[x];return N===void 0?[]:typeof N=="function"?v?[N.listener||N]:[N]:v?T(N):g(N,N.length)}o.prototype.listeners=function(x){return f(this,x,!0)},o.prototype.rawListeners=function(x){return f(this,x,!1)},o.listenerCount=function(w,x){return typeof w.listenerCount=="function"?w.listenerCount(x):m.call(w,x)},o.prototype.listenerCount=m;function m(w){var x=this._events;if(x!==void 0){var v=x[w];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(w,x){for(var v=new Array(x),A=0;A<x;++A)v[A]=w[A];return v}function y(w,x){for(;x+1<w.length;x++)w[x]=w[x+1];w.pop()}function T(w){for(var x=new Array(w.length),v=0;v<x.length;++v)x[v]=w[v].listener||w[v];return x}function b(w,x){return new Promise(function(v,A){function N(O){w.removeListener(x,D),A(O)}function D(){typeof w.removeListener=="function"&&w.removeListener("error",N),v([].slice.call(arguments))}_(w,x,D,{once:!0}),x!=="error"&&C(w,N,{once:!0})})}function C(w,x,v){typeof w.on=="function"&&_(w,"error",x,v)}function _(w,x,v,A){if(typeof w.on=="function")A.once?w.once(x,v):w.on(x,v);else if(typeof w.addEventListener=="function")w.addEventListener(x,function N(D){A.once&&w.removeEventListener(x,N),v(D)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}}))();gE=class extends Ih.EventEmitter{pipe(e,t){let n=this,r=e,i=d=>{r.writable&&r.write(d)===!1&&n.pause&&n.pause()};n.on("data",i);let s=()=>{n.readable&&n.resume&&n.resume()};r.on("drain",s),!r._isStdio&&(!t||t.end!==!1)&&(n.on("end",o),n.on("close",c));let a=!1;function o(){a||(a=!0,r.end())}function c(){a||(a=!0,typeof r.destroy=="function"&&r.destroy())}function l(d){if(u(),Ih.EventEmitter.listenerCount(this,"error")===0)throw d}n.on("error",l),r.on("error",l);function u(){n.removeListener("data",i),r.removeListener("drain",s),n.removeListener("end",o),n.removeListener("close",c),n.removeListener("error",l),r.removeListener("error",l),n.removeListener("end",u),n.removeListener("close",u),r.removeListener("close",u)}return n.on("end",u),n.on("close",u),r.on("close",u),r.emit("pipe",n),r}};bE={NONE:"",WITH_2_BLANKS:" ",WITH_4_BLANKS:" ",WITH_TAB:" "},Rh=e=>e===!0?bE.WITH_2_BLANKS:e===!1?void 0:e,Lh=e=>e.Macros===void 0?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/vnd.ms-word.document.macroEnabled.12",Sc=class Rn{static pack(t,n,r){var i=this;return Kt(function*(s,a,o,c=[]){return jl(qs(i.compiler.compile(s,Rh(o),c)),a,Lh(s))}).apply(this,arguments)}static toString(t,n,r=[]){return Rn.pack(t,"string",n,r)}static toBuffer(t,n,r=[]){return Rn.pack(t,"nodebuffer",n,r)}static toBase64String(t,n,r=[]){return Rn.pack(t,"base64",n,r)}static toBlob(t,n,r=[]){return Rn.pack(t,"blob",n,r)}static toArrayBuffer(t,n,r=[]){return Rn.pack(t,"arraybuffer",n,r)}static toStream(t,n,r=[]){let i=new gE,s=this.compiler.compile(t,Rh(n),r);return new Promise(a=>setTimeout(a)).then(()=>jl(qs(s),"nodebuffer",Lh(t))).then(a=>{i.emit("data",a),i.emit("end")},a=>i.emit("error",a)),i}};E(Sc,"compiler",new fE);jf=e=>{var t;if(e.name!=="w:bookmarkStart"&&e.name!=="w:bookmarkEnd")return;let n=Number((t=e.attributes)===null||t===void 0?void 0:t["w:id"]);return Number.isInteger(n)?n:void 0},Wf=e=>{var t;let n=jf(e);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Wf)]},vE=e=>{let t=new Set(e),n=new Map,r=e.reduce((a,o)=>Math.max(a,o),0),i=a=>{let o=n.get(a);if(o!==void 0)return o;let c=t.has(a)?r+1:a;return r=Math.max(r,c),t.add(c),n.set(a,c),c},s=a=>{let o=jf(a);return k(k(k({},a),o===void 0?{}:{attributes:k(k({},a.attributes),{},{"w:id":String(i(o))})}),a.elements===void 0?{}:{elements:a.elements.map(s)})};return a=>a.map(s)},wE=new dn,ta=e=>new TextDecoder("utf-8",{ignoreBOM:!0}).decode(e),pt=e=>Wr(e,{keepWhitespaceText:!0}),Kf=e=>{var t;return(t=pt(j(wE.format(new Mr({text:e})))).elements[0].elements)!==null&&t!==void 0?t:[]},Gf=e=>k(k({},e),{},{attributes:{"xml:space":"preserve"}}),Te=(e,t)=>{var n,r;let i=(n=e.elements)===null||n===void 0?void 0:n.find(s=>s.name===t);return i===void 0?[]:((r=i.elements)!==null&&r!==void 0||(i.elements=[]),i.elements)},zf=e=>{if(!e?.start.trim()||!e?.end.trim())throw new Error("Both start and end delimiters must be non-empty strings.")},On=(e,t,n)=>{let r=Te(e,"Types");r.some(i=>{var s,a;return i.type==="element"&&i.name==="Default"&&(i==null||(s=i.attributes)===null||s===void 0?void 0:s.ContentType)===t&&(i==null||(a=i.attributes)===null||a===void 0?void 0:a.Extension)===n})||r.push({attributes:{ContentType:t,Extension:n},name:"Default",type:"element"})},yE=(e,t,n)=>{let r=Te(e,"Types");r.some(i=>{var s;return i.type==="element"&&i.name==="Override"&&((s=i.attributes)===null||s===void 0?void 0:s.PartName)===n})||r.push({attributes:{ContentType:t,PartName:n},name:"Override",type:"element"})},xE=(e,t)=>{var n;let r=(n=e.elements)===null||n===void 0?void 0:n.find(i=>i.name==="Types");r?.elements!==void 0&&(r.elements=r.elements.filter(i=>{var s,a;return!(i.name==="Override"&&String((s=(a=i.attributes)===null||a===void 0?void 0:a.PartName)!==null&&s!==void 0?s:"").toLowerCase()===t.toLowerCase())}))},kE=e=>{let t=parseInt(e.substring(3),10);return isNaN(t)?0:t},Cc=e=>Te(e,"Relationships").map(t=>{var n,r;return kE((n=(r=t.attributes)===null||r===void 0||(r=r.Id)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"")}).reduce((t,n)=>Math.max(t,n),0)+1,Kl=(e,t,n,r,i)=>{let s=Te(e,"Relationships");return s.push({attributes:{Id:`rId${t}`,Type:n,Target:r,TargetMode:i},name:"Relationship",type:"element"}),s},Ur=()=>({declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"Relationships",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},elements:[]}]}),Dh="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",TE="application/vnd.openxmlformats-package.core-properties+xml",Mh="_rels/.rels",Bh="docProps/core.xml",Gl={cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/"},SE={title:{namespace:"dc",name:"title"},subject:{namespace:"dc",name:"subject"},creator:{namespace:"dc",name:"creator"},keywords:{namespace:"cp",name:"keywords"},description:{namespace:"dc",name:"description"},lastModifiedBy:{namespace:"cp",name:"lastModifiedBy"},revision:{namespace:"cp",name:"revision"}},$h=e=>e===""?[]:[{type:"text",text:String(e)}],Fh=e=>{var t;return(t=e.name)===null||t===void 0?void 0:t.slice(e.name.indexOf(":")+1)},CE=(e,t)=>{var n;let r=(n=Object.entries(k({},e.attributes)).find(([i,s])=>(i==="xmlns"||i.startsWith("xmlns:"))&&s===Gl[t]))===null||n===void 0?void 0:n[0];return r===void 0?(e.attributes=k(k({},e.attributes),{},{[`xmlns:${t}`]:Gl[t]}),`${t}:`):r==="xmlns"?"":`${r.slice(6)}:`},EE=e=>{let t=e[0]===255&&e[1]===254?"utf-16le":e[0]===254&&e[1]===255?"utf-16be":"utf-8";return new TextDecoder(t).decode(e)},AE=(e,t,n)=>{var r;let i=t.get(n);if(i===void 0)return e.get(n);let s=pt(EE(i));return!((r=s.declaration)===null||r===void 0)&&r.attributes&&(s.declaration.attributes.encoding="UTF-8"),t.delete(n),e.set(n,s),s},_E=e=>{var t,n;let r=(t=e.get(Mh))!==null&&t!==void 0?t:Ur(),i=(n=Te(r,"Relationships").find(s=>{var a;return((a=s.attributes)===null||a===void 0?void 0:a.Type)===Dh}))===null||n===void 0||(n=n.attributes)===null||n===void 0?void 0:n.Target;return typeof i=="string"?cn("",i):(Kl(r,Cc(r),Dh,Bh),e.set(Mh,r),Bh)},NE=(e,t,n,{addContentTypeOverride:r})=>{var i,s;let a=_E(e),o=AE(e,t,a),c=o??{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"cp:coreProperties",attributes:{"xmlns:cp":Gl.cp},elements:[]}]};o===void 0&&(e.set(a,c),r(TE,`/${a}`));let l=(i=c.elements)===null||i===void 0?void 0:i.find(u=>Fh(u)==="coreProperties");if(l===void 0)throw new Error(`Could not find the core properties in ${a}`);(s=l.elements)!==null&&s!==void 0||(l.elements=[]);for(let[u,{namespace:d,name:p}]of Object.entries(SE)){let h=n[u];if(h===void 0)continue;let f=l.elements.find(m=>Fh(m)===p);f?f.elements=$h(h):l.elements.push({type:"element",name:`${CE(l,d)}${p}`,elements:$h(h)})}},zl=new Set(["wp:inline","wp:anchor"]),Ec=new Set(["wp:docPr","wps:cNvPr","wpg:cNvPr"]),PE=new Set(["a:stCxn","a:endCxn"]),Hs=(e,t)=>{var n,r;if(!t.has((n=e.name)!==null&&n!==void 0?n:""))return;let i=Number((r=e.attributes)===null||r===void 0?void 0:r.id);return Number.isInteger(i)?i:void 0},Vf=e=>{var t;let n=Hs(e,Ec);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Vf)]},IE=e=>{let t=n=>{var r;let i=Hs(n,Ec);return[...i===void 0?[]:[i],...((r=n.elements)!==null&&r!==void 0?r:[]).flatMap(s=>{var a;return zl.has((a=s.name)!==null&&a!==void 0?a:"")?[]:t(s)})]};return t(e)},OE=e=>{let t=new Set(e),n=e.reduce((a,o)=>Math.max(a,o),0),r=a=>{let o=t.has(a)?n+1:a;return n=Math.max(n,o),t.add(o),o},i=a=>{let o=new Map([...new Set(IE(a))].map(l=>[l,r(l)])),c=l=>{var u,d;if(l!==a&&zl.has((u=l.name)!==null&&u!==void 0?u:""))return i(l);let p=(d=Hs(l,Ec))!==null&&d!==void 0?d:Hs(l,PE),h=p===void 0?void 0:o.get(p);return k(k(k({},l),h===void 0?{}:{attributes:k(k({},l.attributes),{},{id:String(h)})}),l.elements===void 0?{}:{elements:l.elements.map(c)})};return c(a)},s=a=>{var o;return zl.has((o=a.name)!==null&&o!==void 0?o:"")?i(a):k(k({},a),a.elements===void 0?{}:{elements:a.elements.map(s)})};return a=>a.map(s)},Ce={DOCUMENT:"file",PARAGRAPH:"paragraph",TABLE_ROWS:"tableRows",DRAWING:"drawing"},RE=new Map([["wp:inline","wp:docPr"],["wp:anchor","wp:docPr"],["wpg:graphicFrame","wpg:cNvPr"],["wpc:graphicFrame","wpg:cNvPr"]]),na=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(n=>{var r;let i=n.name===void 0?void 0:RE.get(n.name),s=i===void 0||(r=n.elements)===null||r===void 0?void 0:r.find(a=>a.name===i);return[...s?[{element:n,properties:s}]:[],...na(n)]})},Xf=e=>{var t,n;return[(t=e.attributes)===null||t===void 0?void 0:t.descr,(n=e.attributes)===null||n===void 0?void 0:n.title].flatMap(r=>r===void 0?[]:[String(r)])},qh="[Content_Types].xml",LE=e=>{var t;if(!(!((t=e.elements)===null||t===void 0)&&t.some(r=>r.name==="Relationships"))){var n;e.elements=[...(n=e.elements)!==null&&n!==void 0?n:[],...Ur().elements]}return Te(e,"Relationships")},DE="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Vl=e=>{var t,n;return new Set(["r",...Object.entries((t=e.attributes)!==null&&t!==void 0?t:{}).flatMap(([r,i])=>r.startsWith("xmlns:")&&i===DE?[r.slice(6)]:[]),...((n=e.elements)!==null&&n!==void 0?n:[]).flatMap(r=>[...Vl(r)])])},Xl=(e,t)=>{var n,r;return new Set([...Object.entries((n=e.attributes)!==null&&n!==void 0?n:{}).flatMap(([i,s])=>i.includes(":")&&t.has(i.slice(0,i.indexOf(":")))?[String(s)]:[]),...((r=e.elements)!==null&&r!==void 0?r:[]).flatMap(i=>[...Xl(i,t)])])},ME=(e,t)=>{let n=l=>e.has(l)||t.has(l),r=l=>{if(n(l))return l;let u=(()=>{try{return decodeURI(l)}catch{return}})();if(u!==void 0&&n(u))return u;let d=l.toLowerCase();return[...e.keys(),...t.keys()].find(p=>p.toLowerCase()===d)},i=(l,u)=>{let d=e.get(Qe(l));return d===void 0?void 0:Te(d,"Relationships").find(p=>{var h;return p.name==="Relationship"&&((h=p.attributes)===null||h===void 0?void 0:h.Id)===u})},s=(l,u)=>{var d,p;let h=(d=u.attributes)===null||d===void 0?void 0:d.Target;return((p=u.attributes)===null||p===void 0?void 0:p.TargetMode)==="External"||h===void 0?void 0:r(cn(l,String(h)))},a=l=>[...e].some(([u,d])=>u.endsWith(".rels")&&Te(d,"Relationships").some(p=>s(Af(u),p)===l)),o=(l,u)=>{if(u===void 0||u===l||u===qh||u.endsWith(".rels")||a(u))return;let d=e.get(Qe(u));e.delete(u),t.delete(u),e.delete(Qe(u));let p=e.get(qh);p!==void 0&&xE(p,`/${u}`);for(let h of d===void 0?[]:Te(d,"Relationships"))o(u,s(u,h))};return{findRelationship:i,pathOf:s,removeIfUnreferenced:o,removeRelationships:(l,u)=>{var d,p;let h=(d=e.get(Qe(l)))===null||d===void 0||(d=d.elements)===null||d===void 0?void 0:d.find(m=>m.name==="Relationships"),f=((p=h?.elements)!==null&&p!==void 0?p:[]).filter(m=>{var g;return m.name==="Relationship"&&u.has(String((g=m.attributes)===null||g===void 0?void 0:g.Id))});if(!(h===void 0||f.length===0)){h.elements=h.elements.filter(m=>!f.includes(m));for(let m of f)o(l,s(l,m))}}}},BE=(e,{findRelationship:t,pathOf:n,removeIfUnreferenced:r},i,s)=>{let a=new dn;return{getRelatedPart:(o,c)=>{let l=t(o.path,c),u=l===void 0?void 0:n(o.path,l);return u===void 0?void 0:{path:u,xml:e.get(u)}},replaceRelatedPart:(o,c,l)=>{let u=`word/${i.PackageParts.add(l)}`,{relationshipType:d}=l.options,p=yc(o.path,u),h=c===void 0?void 0:t(o.path,c);if(h===void 0){var f;let g=Qe(o.path),y=(f=e.get(g))!==null&&f!==void 0?f:Ur();e.set(g,y);let T=c??`rId${Cc(y)}`;return LE(y).push({type:"element",name:"Relationship",attributes:{Id:T,Type:d,Target:p}}),T}let m=n(o.path,h);return h.attributes=k(k({},Object.fromEntries(Object.entries(h.attributes).filter(([g])=>g!=="TargetMode"))),{},{Type:d,Target:p}),r(o.path,m),String(h.attributes.Id)},format:o=>pt(j(a.format(o,s))).elements[0]}},$E=({parts:e,binaryParts:t,file:n,patches:r,delimiters:i},s)=>{let a=r.map(([l,u])=>({placeholder:`${i.start}${l}${i.end}`,patch:u})),o=[...e].filter(([l])=>l.startsWith("word/")&&!l.endsWith(".rels")).flatMap(([l,u])=>na(u).flatMap(d=>{let p=Xf(d.properties),h=a.filter(({placeholder:g})=>p.some(y=>y.includes(g)));if(h.length>1){var f,m;throw new Error(`The drawing "${(f=(m=d.properties.attributes)===null||m===void 0?void 0:m.name)!==null&&f!==void 0?f:""}" in ${l} has the placeholders ${h.map(({placeholder:g})=>g).join(" and ")} in its alt text. A drawing can only be patched once`)}return h.map(({placeholder:g,patch:y})=>({drawing:k(k({placeholder:g},d),{},{part:{path:l,xml:u}}),patch:y}))})),c=ME(e,t);for(let{drawing:l,patch:u}of o){let d=Xl(l.element,Vl(l.part.xml));u.patch(l,BE(e,c,n,s(l.part.path)));let p=Xl(l.part.xml,Vl(l.part.xml));c.removeRelationships(l.part.path,new Set([...d].filter(h=>!p.has(h))))}},FE=e=>typeof e=="object"&&e!==null&&"on"in e&&typeof e.on=="function",qE=e=>typeof e=="object"&&e!==null&&"generateAsync"in e&&typeof e.generateAsync=="function",HE=e=>["[object Blob]","[object File]"].includes(Object.prototype.toString.call(e)),UE=e=>new Promise((t,n)=>{let r=[];e.on("data",i=>{ArrayBuffer.isView(i)?r.push(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)):typeof i=="number"?r.push(i):n(new TypeError(`A template stream must give bytes, but it gave a ${typeof i}. A stream with an encoding set gives text, so do not set one.`))}),e.on("error",n),e.on("end",()=>{let i=new Uint8Array(r.reduce((s,a)=>s+(typeof a=="number"?1:a.length),0));r.reduce((s,a)=>typeof a=="number"?(i[s]=a,s+1):(i.set(a,s),s+a.length),0),t(i)})}),jE=(function(){var e=Kt(function*(t){return qE(t)?t.generateAsync({type:"uint8array"}):FE(t)?UE(t):HE(t)?new Uint8Array(yield t.arrayBuffer()):typeof t=="string"?Uint8Array.from({length:t.length},(n,r)=>t.charCodeAt(r)):Array.isArray(t)?Uint8Array.from(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)});return function(n){return e.apply(this,arguments)}})(),Yf=(function(){var e=Kt(function*(t,n){return Bf(yield jE(t),n)});return function(n,r){return e.apply(this,arguments)}})(),WE=new dn,Cs="word/document.xml",KE={path:"word/footnotes.xml",rootName:"w:footnotes",noteName:"w:footnote",referenceName:"w:footnoteReference",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",create:{part:()=>new hf,mark:()=>new uf,styles:()=>[new wf({}),new xf({}),new yf({})]}},GE={path:"word/endnotes.xml",rootName:"w:endnotes",noteName:"w:endnote",referenceName:"w:endnoteReference",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",create:{part:()=>new pf,mark:()=>new lf,styles:()=>[new kf({}),new Sf({}),new Tf({})]}},Es=(e,t)=>pt(j(WE.format(e,t))).elements[0],Jf=(e,t)=>{var n,r,i;let s=t.includes((n=e.name)!==null&&n!==void 0?n:"")?Number((r=e.attributes)===null||r===void 0?void 0:r["w:id"]):NaN;return[...Number.isInteger(s)?[s]:[],...((i=e.elements)!==null&&i!==void 0?i:[]).flatMap(a=>Jf(a,t))]},zE=(e,t)=>{var n,r;let i=(n=e.elements)!==null&&n!==void 0?n:[],s=((r=i[0])===null||r===void 0?void 0:r.name)==="w:pPr"?1:0;return k(k({},e),{},{elements:[...i.slice(0,s),t,...i.slice(s)]})},Hh=(e,t,n,{createContext:r,addContentTypeOverride:i,renumberBookmarks:s,renumberDrawings:a,renumberLists:o,useStyles:c})=>{let l=new Map(Object.entries(t).map(([T,b])=>[Number(T),b])),u=new Map,d=[...l.keys()].filter(Number.isFinite).reduce((T,b)=>Math.max(T,Math.floor(b)),0),p=new Map,h,f=T=>{var b,C;let _=T.name===e.referenceName?l.get(Number((b=T.attributes)===null||b===void 0?void 0:b["w:id"])):void 0;return _===void 0?T.elements===void 0?T:k(k({},T),{},{elements:T.elements.map(f)}):(h=((C=h)!==null&&C!==void 0?C:[...n.values()].flatMap(w=>Jf(w,[e.noteName,e.referenceName])).reduce((w,x)=>Math.max(w,x),0))+1,p.set(h,_),k(k({},T),{},{attributes:k(k({},T.attributes),{},{"w:id":String(h)})}))},m=()=>{var T;let b=Te((T=n.get(Qe(Cs)))!==null&&T!==void 0?T:{},"Relationships").find(_=>{var w;return((w=_.attributes)===null||w===void 0?void 0:w.Type)===e.relationshipType}),C=b?cn(Cs,String(b.attributes.Target)):e.path;return n.has(C)||(n.set(C,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[Es(e.create.part(),r(C))]}),i(e.contentType,`/${C}`)),b||r(Cs).viewWrapper.Relationships.addRelationship($n(),e.relationshipType,yc(Cs,C)),C};return{renumber:T=>T.map(f),write:()=>{if(p.size===0)return;let T=m(),b=r(T),C=new Map([...new Set(p.values())].map(w=>{let x=Es(e.create.mark(),b);return[w,c(o(s(w.children.map(v=>Es(v,b)).map((v,A)=>A===0?zE(v,x):v))))]}));Te(n.get(T),e.rootName).push(...[...p].map(([w,x])=>({type:"element",name:e.noteName,attributes:{"w:id":String(w)},elements:[...a(C.get(x))]})));let _=n.get("word/styles.xml");if(_){let w=Te(_,"w:styles"),x=new Set(w.map(v=>{var A;return(A=v.attributes)===null||A===void 0?void 0:A["w:styleId"]}));w.push(...e.create.styles().map(v=>Es(v,b)).filter(v=>{var A;return!x.has((A=v.attributes)===null||A===void 0?void 0:A["w:styleId"])}))}},carry:(T,b)=>{let C=u.get(T);return C!==void 0?C:(d++,l.set(d,b),u.set(T,d),d)}}},VE=({footnotes:e={},endnotes:t={}},n,r)=>{let i={footnotes:Hh(KE,e,n,r),endnotes:Hh(GE,t,n,r)};return{carry:(s,a,o)=>i[s].carry(a,o),renumber:s=>Object.values(i).reduce((a,o)=>o.renumber(a),s),write:()=>{for(let s of Object.values(i))s.write()}}},XE=new dn,As="word/document.xml",YE="word/numbering.xml",JE="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Uh="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",QE="default-bullet-numbering",ZE="1",e2=(e,t)=>pt(j(XE.format(e,t))).elements[0],jh=e=>e.reduce((t,n)=>Math.max(t,n),0),t2=(e,t,{createContext:n,addContentTypeOverride:r})=>{let i=new Map,s,a=()=>{var f;return Te((f=t.get(Qe(As)))!==null&&f!==void 0?f:{},"Relationships").find(m=>{var g;return((g=m.attributes)===null||g===void 0?void 0:g.Type)===Uh})},o=(f=a())=>f?cn(As,String(f.attributes.Target)):YE,c=(f,m)=>{var g;return Te((g=t.get(o()))!==null&&g!==void 0?g:{},"w:numbering").filter(y=>y.name===f).map(y=>Number(y.attributes[m]))},l=f=>{if(f===ZE)return e.ConcreteNumbering.find(({reference:g})=>g===QE);if(!f.startsWith("{"))return;let m=e.ConcreteNumbering.find(({reference:g,instance:y})=>f===`{${g}-${y}}`);if(!m){let g=f.slice(1,-1).replace(/-\d+$/,"");throw new Error(`A paragraph in a patch uses the numbering "${g}", which isn't in the numbering option of patchDocument. Add it there with its levels, as in a Document`)}return m},u=f=>{var m;let g=i.get(f.numId);return g!==void 0?g:(s=((m=s)!==null&&m!==void 0?m:jh(c("w:num","w:numId")))+1,i.set(f.numId,s),s)},d=f=>{let m=f.name==="w:numId"?l(String(f.attributes["w:val"])):void 0;return m===void 0?f.elements===void 0?f:k(k({},f),{},{elements:f.elements.map(d)}):k(k({},f),{},{attributes:k(k({},f.attributes),{},{"w:val":String(u(m))})})},p=f=>{let m=a(),g=o(m);return t.has(g)||(t.set(g,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[k(k({},f),{},{elements:[]})]}),r(JE,`/${g}`)),m||n(As).viewWrapper.Relationships.addRelationship($n(),Uh,yc(As,g)),g};return{renumber:f=>f.map(d),write:()=>{var f,m;if(i.size===0)return;let g=e2(e,n(o())),y=N=>Number(N.elements.find(D=>D.name==="w:abstractNumId").attributes["w:val"]),T=g.elements.filter(N=>N.name==="w:num"&&i.has(Number(N.attributes["w:numId"]))),b=jh(c("w:abstractNum","w:abstractNumId")),C=new Map([...new Set(T.map(y))].map((N,D)=>[N,b+D+1])),_=g.elements.flatMap(N=>{let D=N.name==="w:abstractNum"?C.get(Number(N.attributes["w:abstractNumId"])):void 0;return D===void 0?[]:[k(k({},N),{},{attributes:k(k({},N.attributes),{},{"w:abstractNumId":String(D)})})]}),w=p(g),x=t.get(w).elements.find(N=>N.name==="w:numbering");x.attributes=k(k(k({},Object.fromEntries(Object.entries(g.attributes).filter(([N])=>N.startsWith("xmlns:")))),x.attributes),{},{"mc:Ignorable":[...new Set([...String((f=(m=x.attributes)===null||m===void 0?void 0:m["mc:Ignorable"])!==null&&f!==void 0?f:"").split(" "),...String(g.attributes["mc:Ignorable"]).split(" ")])].filter(N=>N!=="").join(" ")});let v=Te(t.get(w),"w:numbering"),A=N=>{let D=v.findIndex(O=>N.includes(O.name));return D===-1?v.length:D};v.splice(A(["w:num","w:numIdMacAtCleanup"]),0,..._),v.splice(A(["w:numIdMacAtCleanup"]),0,...T.map(N=>k(k({},N),{},{attributes:k(k({},N.attributes),{},{"w:numId":String(i.get(Number(N.attributes["w:numId"])))}),elements:N.elements.map(D=>D.name==="w:abstractNumId"?k(k({},D),{},{attributes:{"w:val":String(C.get(y(N)))}}):D)})))}}},Yl={nameOf:e=>e.type==="element"?e.name:void 0,contentOf:e=>e.elements,attributeOf:(e,t)=>{var n;return(n=e.attributes)===null||n===void 0?void 0:n[t]},textOf:e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).filter(({type:n})=>n==="text").map(({text:n})=>String(n)).join("")},textElement:e=>({type:"element",name:"w:t",attributes:{"xml:space":"preserve"},elements:[{type:"text",text:e}]}),writeClean:(e,t)=>{var n;/^\s*(PAGEREF|TOC)\b/i.test(t)&&((n=e.attributes)===null||n===void 0?void 0:n["w:dirty"])!==void 0&&(e.attributes=Object.fromEntries(Object.entries(e.attributes).filter(([r])=>r!=="w:dirty")))},setSimpleFieldResult:(e,t)=>{e.elements=[{type:"element",name:"w:r",elements:[Yl.textElement(t)]}]}},Sl="word/document.xml",n2="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk",r2=[80,75,3,4],i2=(function(){var e=Kt(function*(t){if(r2.every((n,r)=>t[r]===n))try{let n=new Map,r=new Map;for(let[s,a]of Bf(t))/\.(xml|rels)$/.test(s)?n.set(s,pt(ta(a))):r.set(s,a);let i=yield Qf(n,r);return k({parts:n,binaryParts:r},i.size>0?{importedDocuments:i}:{})}catch{return}});return function(n){return e.apply(this,arguments)}})(),Qf=(function(){var e=Kt(function*(t,n){let r=new Map;for(let[a,o]of t){var i,s;if(a.endsWith(".rels"))for(let{attributes:c={}}of(i=(s=Ls(o))===null||s===void 0?void 0:s.elements)!==null&&i!==void 0?i:[]){let l=cn(Af(a),String(c.Target)),u=n.get(l),d=c.Type===n2&&c.TargetMode!=="External"&&u?yield i2(u):void 0;d&&r.set(l,d)}}return r});return function(n,r){return e.apply(this,arguments)}})(),Ls=e=>{var t;return e==null||(t=e.elements)===null||t===void 0?void 0:t.find(({type:n})=>n==="element")},s2=(function(){var e=Kt(function*(t,n,r=new Map){var i,s;let a=Ls(t.get(Sl));if(!a)return;let o=yield Qf(t,r),c=n(k({parts:t,binaryParts:r},o.size>0?{importedDocuments:o}:{})),l=Cm(Yl,a,c,{blank:!0}),u=(i=(s=Ls(t.get(Qe(Sl))))===null||s===void 0?void 0:s.elements)!==null&&i!==void 0?i:[];for(let{attributes:d={}}of u){let p=/\/(header|footer)$/.test(String(d.Type))?Ls(t.get(cn(Sl,String(d.Target)))):void 0;p&&Em(Yl,p,c,{blank:!0,sectionPageCount:l.get(String(d.Id))})}});return function(n,r){return e.apply(this,arguments)}})(),a2=new Set(["w:hyperlink","w:sdt","w:sdtContent","w:ins","w:moveTo","w:smartTag","w:customXml","w:fldSimple","w:dir","w:bdo"]),Zf=(e,t)=>{var n;return((n=e.elements)!==null&&n!==void 0?n:[]).flatMap((r,i)=>{var s;return r.name==="w:r"?[{element:r,path:[...t,i]}]:a2.has((s=r.name)!==null&&s!==void 0?s:"")?Zf(r,[...t,i]):[]})},Us=(e,t)=>t.reduce((n,r)=>n.elements[r],e),Yr=e=>{if(e.element.name!=="w:p")throw new Error(`Invalid node type: ${e.element.name}`);if(!e.element.elements)return{text:"",runs:[],index:-1,pathToParagraph:[]};let t=0,n=Zf(e.element,[]).map(({element:r,path:i})=>{let s=o2(r,i,t);return t+=s.text.length,s});return{text:n.reduce((r,i)=>r+i.text,""),runs:n,index:e.index,pathToParagraph:eg(e)}},o2=(e,t,n)=>{if(!e.elements)return{text:"",parts:[],path:t,start:n,end:n};let r=n,i=e.elements.map((s,a)=>{var o,c;if(s.name!=="w:t"||!s.elements||s.elements.length===0)return;let l=(o=(c=s.elements[0].text)===null||c===void 0?void 0:c.toString())!==null&&o!==void 0?o:"",u=r;return r+=l.length,{text:l,index:a,start:u,end:u+l.length-1}}).filter(s=>!!s).map(s=>s);return{text:i.reduce((s,a)=>s+a.text,""),parts:i,path:t,start:n,end:i.length>0?i[i.length-1].end:n}},eg=e=>e.parent?[...eg(e.parent),e.index]:[e.index],l2=class extends Error{constructor(e){super(`Token ${e} not found`),this.name="TokenNotFoundError"}},c2=(e,t)=>{let n=Yr({element:e,index:0,parent:void 0}).runs.find(({parts:r})=>r.some(({text:i})=>i.includes(t)));if(!n)throw new l2(t);return n.path},d2=(e,t)=>{var n,r;let i=-1,s=(n=(r=e.elements)===null||r===void 0?void 0:r.map((a,o)=>{if(i!==-1)return a;if(a.type==="element"&&a.name==="w:t"){var c,l;let u=((c=(l=a.elements)===null||l===void 0||(l=l[0])===null||l===void 0?void 0:l.text)!==null&&c!==void 0?c:"").split(t),d=u.map(p=>k(k(k({},a),Gf(a)),{},{elements:Kf(p)}));return u.length>1&&(i=o),d}else return a}).flat())!==null&&n!==void 0?n:[];return{left:k(k({},JSON.parse(JSON.stringify(e))),{},{elements:s.slice(0,i+1)}),right:k(k({},JSON.parse(JSON.stringify(e))),{},{elements:s.slice(i+1)})}},Ar={START:0,MIDDLE:1,END:2},tg=({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:r,fromIndex:i=0})=>{let s=t.text.indexOf(n,i),a=s+n.length-1,o=Ar.START;for(let c of t.runs){let l=Us(e,c.path);for(let{text:u,index:d,start:p,end:h}of c.parts)switch(o){case Ar.START:if(s>=p&&s<=h){let f=s-p,m=Math.min(a,h)-p;if(u.substring(f,m+1)==="")continue;let g=u.substring(0,f)+r+u.substring(m+1);Cl(l.elements[d],g),o=Ar.MIDDLE;continue}break;case Ar.MIDDLE:if(a<=h){let f=u.substring(a-p+1);Cl(l.elements[d],f);let m=l.elements[d];l.elements[d]=Gf(m),o=Ar.END}else Cl(l.elements[d],"")}}return e},Cl=(e,t)=>(e.elements=Kf(t),e),Wh=e=>{var t,n;return(t=(n=e.element.elements)===null||n===void 0?void 0:n.map((r,i)=>({element:r,index:i,parent:e})))!==null&&t!==void 0?t:[]},ng=e=>{let t=[],n=[...Wh({element:e,index:0,parent:void 0})],r;for(;n.length>0;)r=n.shift(),r.element.name==="w:p"&&(t=[...t,Yr(r)]),n.push(...Wh(r));return t},Ac=(e,t)=>ng(e).filter(n=>n.text.includes(t)),El="\uFFFF",p2=({json:e,patch:t,patchText:n,context:r,keepOriginalStyles:i=!0,recursive:s=!0,renumberIds:a=o=>o})=>{let o=Ac(e,n);if(o.length===0)return{element:e,didFindOccurrence:!1};let c=[...o].reverse(),l=t.type===Ce.DOCUMENT?k2(c):c,u,d=()=>{var h;return u=((h=u)!==null&&h!==void 0?h:ig(e))+1,String(u)};for(let h of l)switch(t.type){case Ce.DOCUMENT:{var p;let f=T2(e,h.pathToParagraph),m=S2(h.pathToParagraph),g=Kh(t,r,a),y=f.name==="w:tc"&&m===f.elements.length-1&&((p=g[g.length-1])===null||p===void 0?void 0:p.name)!=="w:p"?[{type:"element",name:"w:p"}]:[];f.elements.splice(m,1,...g,...y);break}case Ce.PARAGRAPH:default:{let f=sg(e,h.pathToParagraph),m=h,g=0;do g=u2({paragraphElement:f,renderedParagraph:m,patchText:n,fromIndex:g,children:Kh(t,r,a),keepOriginalStyles:i,newTrackedChangeId:d}),m=Yr({element:f,index:h.index,parent:void 0});while(s&&m.text.includes(n,g));break}}return{element:e,didFindOccurrence:!0}},Kh=(e,t,n)=>n(e.children.flatMap(r=>{var i;return(i=r.writtenAs)!==null&&i!==void 0?i:r}).flatMap(r=>{let i=r.prepForXml(t);return i?[pt(j(i)).elements[0]]:[]})),u2=({paragraphElement:e,renderedParagraph:t,patchText:n,fromIndex:r,children:i,keepOriginalStyles:s,newTrackedChangeId:a})=>{let o=t.text.indexOf(n,r);tg({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:El,fromIndex:r});let c=c2(e,El),l=c.slice(0,-1),u=Us(e,l),d=c[c.length-1],p=l.map((_,w)=>Us(e,l.slice(0,w+1))).filter(_=>_.name==="w:sdt"),h=[...p].reverse().find(h2),f=u.elements[d],{left:m,right:g}=d2(f,El),y=f.elements.find(_=>_.type==="element"&&_.name==="w:rPr"),T=h?m2(h):y,b=s&&T?i.map(_=>rg(_,T)):i,C=y?k(k({},g),{},{elements:[y,...g.elements]}):g;return u.elements.splice(d,1,m,...b,C),p.forEach(_=>b2(_,b)),w2(e,l,a),o+Yr({element:{name:"w:p",elements:[...b]},index:0,parent:void 0}).text.length},_c=e=>{var t;return(t=e.elements)===null||t===void 0?void 0:t.find(n=>n.name==="w:sdtPr")},h2=e=>{var t;return!!(!((t=_c(e))===null||t===void 0||(t=t.elements)===null||t===void 0)&&t.some(n=>n.name==="w:showingPlcHdr"))},m2=e=>{var t;return(t=_c(e))===null||t===void 0||(t=t.elements)===null||t===void 0?void 0:t.find(n=>n.name==="w:rPr")},f2=new Set(["w:rPr","w:t","w:tab","w:br"]),g2=e=>e.name==="w:bookmarkStart"||e.name==="w:bookmarkEnd"||e.name==="w:r"&&rn(e).every(t=>f2.has(t.name)),b2=(e,t)=>{let n=_c(e);if(!n?.elements)return;let r=n.elements.some(i=>i.name==="w:text")&&!t.every(g2);n.elements=n.elements.filter(i=>i.name!=="w:showingPlcHdr"&&i.name!=="w:dataBinding"&&!(r&&i.name==="w:text"))},Jl=new Set(["w:hyperlink","w:fldSimple","w:subDoc"]),v2=new Map([["w:ins",Jl],["w:moveTo",Jl],["w:hyperlink",new Set(["w:hyperlink"])]]),w2=(e,t,n)=>{for(let i=t.length;i>0;i--){var r;let s=Us(e,t.slice(0,i-1)),a=t[i-1],o=s.elements[a],c=v2.get(o.name),l=g=>!!c?.has(g.name);if(!(!((r=o.elements)===null||r===void 0)&&r.some(l)))continue;let{elements:u}=o,d=u.flatMap((g,y)=>y===0||l(g)||l(u[y-1])?[y]:[]),p=d.map((g,y)=>u.slice(g,d[y+1])),h=c===Jl,f=!0,m=p.map(g=>{if(l(g[0]))return g[0];let y=h&&!f?k(k({},o.attributes),{},{"w:id":n()}):o.attributes;return f=!1,k(k({},o),{},{attributes:y,elements:[...g]})});s.elements.splice(a,1,...m)}},rg=(e,t)=>e.name==="w:r"?y2(e,t):e.elements?k(k({},e),{},{elements:e.elements.map(n=>rg(n,t))}):e,y2=(e,t)=>{let n=rn(e).find(a=>a.type==="element"&&a.name==="w:rPr");if(!n)return k(k({},e),{},{elements:[t,...rn(e)]});let r=new Set(rn(n).map(a=>a.name)),i=[...rn(t).filter(a=>!r.has(a.name)),...rn(n)],s=k(k({},n),{},{elements:[...i].sort((a,o)=>Gh(a)-Gh(o))});return k(k({},e),{},{elements:rn(e).map(a=>a===n?s:a)})},Al=["w:rStyle","w:rFonts","w:b","w:bCs","w:i","w:iCs","w:caps","w:smallCaps","w:strike","w:dstrike","w:outline","w:shadow","w:emboss","w:imprint","w:noProof","w:snapToGrid","w:vanish","w:webHidden","w:color","w:spacing","w:w","w:kern","w:position","w:sz","w:szCs","w:highlight","w:u","w:effect","w:bdr","w:shd","w:fitText","w:vertAlign","w:rtl","w:cs","w:em","w:lang","w:eastAsianLayout","w:specVanish","w:oMath","w14:glow","w14:shadow","w14:reflection","w14:textOutline","w14:textFill","w14:scene3d","w14:props3d","w14:ligatures","w14:numForm","w14:numSpacing","w14:stylisticSets","w14:cntxtAlts"],Gh=e=>{var t;if(e.name==="w:rPrChange")return Al.length+1;let n=Al.indexOf((t=e.name)!==null&&t!==void 0?t:"");return n===-1?Al.length:n},rn=e=>{var t;return(t=e.elements)!==null&&t!==void 0?t:[]},ig=e=>{var t,n;let r=Number((t=e.attributes)===null||t===void 0?void 0:t["w:id"]);return((n=e.elements)!==null&&n!==void 0?n:[]).reduce((i,s)=>Math.max(i,ig(s)),Number.isInteger(r)?r:0)},x2=(e,t)=>e.length>t.length&&t.every((n,r)=>e[r]===n),k2=e=>e.filter(t=>!e.some(n=>x2(t.pathToParagraph,n.pathToParagraph))),sg=(e,t)=>{let n=e;for(let r=1;r<t.length;r++){let i=t[r];n=n.elements[i]}return n},T2=(e,t)=>sg(e,t.slice(0,t.length-1)),S2=e=>e[e.length-1],C2=new dn,_l="word/styles.xml",E2=new Set(["w:pStyle","w:rStyle","w:tblStyle","w:basedOn","w:next","w:link"]),Lr=e=>{var t;return String((t=e.attributes)===null||t===void 0?void 0:t["w:styleId"])},Ql=e=>{var t;let n=(t=e.elements)===null||t===void 0||(t=t.find(r=>r.name==="w:name"))===null||t===void 0||(t=t.attributes)===null||t===void 0?void 0:t["w:val"];return n===void 0?void 0:String(n).toLowerCase()},Ds=(e,t)=>{var n;return e==null||(n=e.elements)===null||n===void 0?void 0:n.find(r=>r.name===t)},zh=e=>{var t;let n=Number((t=Ds(e,"w:sz"))===null||t===void 0||(t=t.attributes)===null||t===void 0?void 0:t["w:val"]);return Number.isNaN(n)?void 0:n},A2=e=>{var t,n;let r=e.filter(a=>a.name==="w:style"),i=(t=r.find(a=>Lr(a)==="Normal"))!==null&&t!==void 0?t:r.find(a=>{var o;return((o=a.attributes)===null||o===void 0?void 0:o["w:type"])==="paragraph"&&Ql(a)==="normal"}),s=e.find(a=>a.name==="w:docDefaults");return(n=zh(Ds(i,"w:rPr")))!==null&&n!==void 0?n:zh(Ds(Ds(s,"w:rPrDefault"),"w:rPr"))},_2=(e,t)=>new Map(Object.values(wc({document:{run:{size:t}}})).map(n=>pt(j(C2.format(n,e))).elements[0]).filter(n=>n.name==="w:style").map(n=>[Lr(n),n])),N2=(e,t)=>{var n;let r=Te((n=e.get(_l))!==null&&n!==void 0?n:{},"w:styles"),i=r.filter(f=>f.name==="w:style"),s=new Set(i.map(Lr)),a,o=f=>{var m;return(m=a)!==null&&m!==void 0||(a=_2(t(_l),A2(r))),a.get(f)},c=new Set,l=new Map,u=f=>{let m=s.has(f)?void 0:o(f);if(m===void 0)return f;let g=i.find(y=>{var T,b;return((T=y.attributes)===null||T===void 0?void 0:T["w:type"])===((b=m.attributes)===null||b===void 0?void 0:b["w:type"])&&Ql(y)===Ql(m)});return g!==void 0?Lr(g):(c.add(f),f)},d=f=>(l.has(f)||l.set(f,u(f)),l.get(f)),p=f=>{var m;return E2.has((m=f.name)!==null&&m!==void 0?m:"")?k(k({},f),{},{attributes:k(k({},f.attributes),{},{"w:val":d(String(f.attributes["w:val"]))})}):f.elements===void 0?f:k(k({},f),{},{elements:f.elements.map(p)})};return{use:f=>f.map(p),write:()=>{let f=e.get(_l);if(!f)return;let m=Te(f,"w:styles"),g=new Set(m.map(Lr));for(let y of c)g.has(y)||(g.add(y),m.push(p(o(y))))}}},P2={type:Ce.PARAGRAPH,children:[]},I2=({json:e,key:t,patch:n,delimiters:{start:r,end:i},patchPlaceholder:s,renumberDrawings:a})=>{let o=`${r}${t}.`;for(let c of O2(e,o)){let l=D2(c.elements,o,i),u=n.rows.flatMap((d,p)=>{let h={type:"element",name:"w:tbl",elements:[...p===0?c.elements.map(M2):a(og(c.elements))]},f=new Map(Object.entries(d).flatMap(([m,g])=>g===void 0?[]:[[m,g]]));for(let[m,g]of f)s(h,`${t}.${m}`,g);for(let m of l.filter(g=>!f.has(g)))s(h,`${t}.${m}`,P2);return h.elements});c.parent.elements.splice(c.parent.elements.indexOf(c.elements[0]),c.elements.length,...u),c.table&&!ag(c.table.element)&&c.table.parent.elements.splice(c.table.parent.elements.indexOf(c.table.element),1)}},O2=(e,t)=>{let n=Ac(e,t).flatMap(i=>{let s=R2(e,i.pathToParagraph);return s?[s]:[]}),r=n.filter(i=>!n.some(s=>L2(i.path,s.path))).filter((i,s,a)=>a.findIndex(o=>o.row===i.row)===s);return[...new Set(r.map(i=>i.parent))].flatMap(i=>{let s=i.elements.filter(c=>c.name==="w:tr"),a=r.filter(c=>c.parent===i).map(c=>s.indexOf(c.row)).sort((c,l)=>c-l),{table:o}=r.find(c=>c.parent===i);return a.reduce((c,l)=>{let u=c[c.length-1];return u?.[u.length-1]===l-1?[...c.slice(0,-1),[...u,l]]:[...c,[l]]},[]).map(c=>{let l=i.elements.indexOf(s[c[0]]),u=i.elements.indexOf(s[c[c.length-1]]);return{parent:i,table:o,elements:i.elements.slice(l,u+1)}})})},R2=(e,t)=>{let n=e,r,i;for(let s=1;s<t.length;s++){let a=n.elements[t[s]];a.name==="w:tbl"&&(i={element:a,parent:n}),a.name==="w:tr"&&(r={parent:n,table:i,row:a,path:t.slice(0,s+1)}),n=a}return r},L2=(e,t)=>e.length>t.length&&t.every((n,r)=>e[r]===n),ag=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).some(n=>n.name==="w:tr"||n.name!=="w:tblPr"&&n.name!=="w:tblGrid"&&ag(n))},D2=(e,t,n)=>{let r=Ac({elements:[...e]},t).flatMap(({text:i})=>i.split(t).slice(1).flatMap(s=>{let a=s.indexOf(n);return a>0?[s.slice(0,a)]:[]}));return[...new Set(r)]},M2=e=>JSON.parse(JSON.stringify(e)),B2=["w14:paraId","w14:textId"],$2=["w:bookmarkStart","w:bookmarkEnd"],og=(e,t)=>e.filter(n=>{var r;return!$2.includes((r=n.name)!==null&&r!==void 0?r:"")&&!(t?.name==="w:sdtPr"&&n.name==="w:id")}).map(n=>k(k(k({},n),n.attributes===void 0?{}:{attributes:Object.fromEntries(Object.entries(n.attributes).filter(([r])=>!B2.includes(r)))}),n.elements===void 0?{}:{elements:[...og(n.elements,n)]})),F2=e=>e[0]===255&&e[1]===254||e[0]===254&&e[1]===255,q2=e=>{var t;let n=eE(e,"word/document.xml"),r=n===void 0||(t=[...e].find(([i])=>SC(i,n)))===null||t===void 0?void 0:t[1];return r===void 0||F2(r)?void 0:rc(rE(ta(r)))},js=(e,t,{start:n,end:r},i)=>{for(let s=e.indexOf(n,t);s!==-1;s=e.indexOf(n,s+1)){let a=e.indexOf(r,s+n.length);if(a===-1)return;let o=e.slice(s+n.length,a),c=o.trim();if(c!==o&&i(c))return{index:s,placeholder:e.slice(s,a+r.length),trimmed:`${n}${c}${r}`}}},H2=(e,t,n)=>{let r=e;for(let i=js(r,0,t,n);i!==void 0;i=js(r,i.index+i.trimmed.length,t,n))r=`${r.slice(0,i.index)}${i.trimmed}${r.slice(i.index+i.placeholder.length)}`;return r},lg=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(n=>[...n.name==="w:p"?[n]:[],...lg(n)])},U2=(e,t,n)=>{let r=()=>Yr({element:e,index:0,parent:void 0});for(let i=r(),s=js(i.text,0,t,n);s!==void 0;i=r(),s=js(i.text,s.index+s.trimmed.length,t,n))tg({paragraphElement:e,renderedParagraph:i,originalText:s.placeholder,replacementText:s.trimmed,fromIndex:s.index})},j2=(e,{delimiters:t,textKeys:n,tableRowsKeys:r,drawingKeys:i})=>{let s=c=>n.has(c)||r.some(l=>c.startsWith(`${l}.`));for(let c of lg(e))U2(c,t,s);let a=c=>i.has(c);for(let{properties:c}of na(e))for(let l of["descr","title"]){var o;let u=(o=c.attributes)===null||o===void 0?void 0:o[l];u!==void 0&&(c.attributes[l]=H2(String(u),t,a))}},cg=e=>{var t;return e.name==="v:shapetype"&&((t=e.attributes)===null||t===void 0?void 0:t.id)!==void 0?String(e.attributes.id):void 0},dg=e=>{var t;let n=cg(e);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(dg)]},W2=e=>{let t=new Set(dg(e)),n=r=>{let i=cg(r);return i!==void 0?t.has(i)?[]:(t.add(i),[r]):[r.elements===void 0?r:k(k({},r),{},{elements:r.elements.flatMap(n)})]};return r=>r.flatMap(n)},pg=(e,t,{inTableRow:n})=>{if(t?.type===Ce.TABLE_ROWS&&Array.isArray(t.rows)){for(let r of t.rows){if(typeof r!="object"||r===null)throw new Error(`Invalid patch "${e}". Expected each of its rows to be an object of patches, by the name of their field`);for(let[i,s]of Object.entries(r))s!==void 0&&pg(`${e}.${i}`,s,{inTableRow:!0})}return}if(!(t?.type===Ce.DRAWING?!n&&typeof t.patch=="function":t?.type!==Ce.TABLE_ROWS&&Array.isArray(t?.children)))throw new Error(`Invalid patch "${e}". Expected { type: PatchType.PARAGRAPH or PatchType.DOCUMENT, children: [...] }, ${n?"or { type: PatchType.TABLE_ROWS, rows: [...] }":"{ type: PatchType.TABLE_ROWS, rows: [...] }, or a drawing patch such as ImagePatch, or ChartDataPatch from docx/charts"}`)},Vh=new Uf,K2=new Uint8Array([255,254]),G2=new Uint8Array([254,255]),z2=new Set(["w:document","w:hdr","w:ftr","w:footnotes","w:endnotes","w:comments"]),Xh=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},eI=(function(){var e=Kt(function*({outputType:t,data:n,patches:r,keepOriginalStyles:i,placeholderDelimiters:s={start:"{{",end:"}}"},recursive:a=!0,trimPlaceholders:o=!1,footnotes:c,endnotes:l,numbering:u={config:[]},pageNumbers:d,properties:p}){let h=yield Yf(n),f=new Map,m=q2(h),g=[],y=new gf({addOverride:(M,$)=>g.push({contentType:M,partName:$})},new Set([...h.keys()].filter(M=>M.startsWith("word/")).map(M=>M.slice(5)))),T={Media:new mf(M=>y.takePath("media","image",M)),Numbering:new ff(u),Theme:m&&{Colors:m},FootNotes:{View:{idOf:(M,$,q)=>_t("footnotes",M,$,q)}},Endnotes:{View:{idOf:(M,$,q)=>_t("endnotes",M,$,q)}},PackageParts:y},b=new Map,C=[],_=[],w=!1,x=new Map;zf(s);let{start:v,end:A}=s;for(let[M,$]of Object.entries(r))pg(M,$,{inTableRow:!1});for(let[M,$]of h){var N;let q=$.slice(0,2);if(Xh(q,K2)||Xh(q,G2)){x.set(M,$);continue}if(!M.endsWith(".xml")&&!M.endsWith(".rels")){x.set(M,$);continue}let ie=pt(ta($)),se=(N=ie.elements)===null||N===void 0?void 0:N.find(ae=>{var te;return z2.has((te=ae.name)!==null&&te!==void 0?te:"")});if(se&&se.attributes){for(let ae of["mc","wp","r","w15","m","v","o"])se.attributes[`xmlns:${ae}`]=Dl[ae];se.attributes["mc:Ignorable"]=`${se.attributes["mc:Ignorable"]||""} w15`.trim()}b.set(M,ie)}let D=vE([...b.values()].flatMap(Wf)),O=OE([...b.values()].flatMap(Vf)),F=new Map,Q=M=>{let $=F.get(M);if($)return $;let q={Relationships:{addRelationship:(ie,se,ae,te)=>{_.push({key:M,id:ie,type:se,target:ae,targetMode:te})}}};return F.set(M,q),q},Z=M=>({file:T,viewWrapper:Q(M),stack:[]}),V=(M,$)=>{g.push({contentType:M,partName:$})},G=N2(b,Z),de=t2(T.Numbering,b,{createContext:Z,addContentTypeOverride:V}),ce=VE({footnotes:c,endnotes:l},b,{createContext:Z,addContentTypeOverride:V,renumberBookmarks:D,renumberDrawings:O,renumberLists:de.renumber,useStyles:G.use}),_t=(M,$,q,ie)=>ie.viewWrapper===Q("word/document.xml")?ce.carry(M,$,q):void 0;if(o){let M=q=>Object.entries(r).flatMap(([ie,se])=>q(se.type)?[ie]:[]),$={delimiters:{start:v,end:A},textKeys:new Set(M(q=>q!==Ce.TABLE_ROWS&&q!==Ce.DRAWING)),tableRowsKeys:M(q=>q===Ce.TABLE_ROWS),drawingKeys:new Set(M(q=>q===Ce.DRAWING))};for(let[q,ie]of b)q.startsWith("word/")&&!q.endsWith(".rels")&&j2(ie,$)}$E({parts:b,binaryParts:x,file:T,patches:Object.entries(r).flatMap(([M,$])=>$.type===Ce.DRAWING?[[M,$]]:[]),delimiters:{start:v,end:A}},Z);let Ae=Object.entries(r).flatMap(([M,$])=>$.type===Ce.DRAWING?[]:[[M,$]]),Ue=[...Ae.filter(([,M])=>M.type===Ce.TABLE_ROWS),...Ae.filter(([,M])=>M.type!==Ce.TABLE_ROWS)];for(let[M,$]of[...b]){if(!M.startsWith("word/")||M.endsWith(".xml.rels"))continue;let q=Z(M);f.set(M,q);let ie=W2($),se=(ae,te,Re)=>{if(Re.type===Ce.TABLE_ROWS){I2({json:ae,key:te,patch:Re,delimiters:{start:v,end:A},patchPlaceholder:se,renumberDrawings:O});return}let Uc=[],{didFindOccurrence:Zg}=p2({json:ae,patch:k(k({},Re),{},{children:Re.children.flatMap(je=>je instanceof qm?je.writtenAs:[je]).map(je=>{if(je instanceof O1){let{target:eb,anchor:tb}=Wm(je.options.link),jc=new mc(je.options.children,$n(),tb,je.options.link);return Uc.push({key:M,id:jc.linkId,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",target:eb,targetMode:oc.EXTERNAL}),jc}else return je})}),patchText:`${v}${te}${A}`,context:q,keepOriginalStyles:i,recursive:a,renumberIds:je=>G.use(de.renumber(ce.renumber(D(O(ie(je))))))});Zg&&_.push(...Uc)};for(let[ae,te]of Ue)se($,ae,te)}ce.write(),de.write(),G.write();for(let[M,$]of b){if(!M.startsWith("word/")||M.endsWith(".xml.rels"))continue;let q=Vh.getMediaData(JSON.stringify($),T.Media);q.length>0&&(w=!0,C.push({key:M,mediaDatas:q}))}for(let{key:M,mediaDatas:$}of C){var we;let q=Qe(M),ie=(we=b.get(q))!==null&&we!==void 0?we:Ur();b.set(q,ie);let se=Cc(ie),ae=Vh.replace(JSON.stringify(b.get(M)),$,se);b.set(M,JSON.parse(ae));for(let te=0;te<$.length;te++){let{fileName:Re}=$[te];Kl(ie,se+te,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${Re}`)}}for(let{key:M,id:$,type:q,target:ie,targetMode:se}of _){var ye;let ae=Qe(M),te=(ye=b.get(ae))!==null&&ye!==void 0?ye:Ur();b.set(ae,te),Kl(te,$,q,ie,se)}d&&(yield s2(b,d,x)),p&&NE(b,x,p,{addContentTypeOverride:V});let re=Tc(T,void 0);if(w||g.length>0){let M=b.get("[Content_Types].xml");if(!M)throw new Error("Could not find content types file");w&&(On(M,"image/png","png"),On(M,"image/jpeg","jpeg"),On(M,"image/jpeg","jpg"),On(M,"image/bmp","bmp"),On(M,"image/gif","gif"),On(M,"image/svg+xml","svg"));for(let{contentType:$,partName:q}of g)yE(M,$,q)}return jl(qs([...[...b].map(([M,$])=>[M,px($)]),...x,...T.Media.Array.map(({data:M,fileName:$})=>[`word/media/${$}`,M]),...re.map(({path:M,data:$})=>[M,$])]),t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document")});return function(n){return e.apply(this,arguments)}})(),V2=e=>e.startsWith("word/")&&/\.(xml|rels)$/.test(e)&&!e.endsWith(".xml.rels"),tI=(function(){var e=Kt(function*({data:t,placeholderDelimiters:n={start:"{{",end:"}}"},trimPlaceholders:r=!1}){zf(n);let i=X2(n),s=yield Yf(t,V2),a=new Set;for(let[,o]of s){let c=pt(ta(o));[...ng(c).map(l=>l.text),...na(c).flatMap(({properties:l})=>Xf(l))].flatMap(l=>{var u;return(u=l.match(i))!==null&&u!==void 0?u:[]}).map(l=>r?l.trim():l).filter(l=>l!=="").forEach(l=>a.add(l))}return Array.from(a)});return function(n){return e.apply(this,arguments)}})(),Nl=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X2=({start:e,end:t})=>new RegExp(`(?<=${Nl(e)})(?:(?!${Nl(e)}).)+?(?=${Nl(t)})`,"gs")});var wg={};ii(wg,{EXPORT_DIR:()=>Qr,FORMATS:()=>Nc,TX:()=>Jr,buildIR:()=>aa,caseRows:()=>sa,exportDoc:()=>Pc,irToDocx:()=>vg,irToHtml:()=>oa});import hg from"node:fs";import mg from"node:path";function Y2(e){return`${String(e.getDate()).padStart(2,"0")}/${String(e.getMonth()+1).padStart(2,"0")}/${e.getFullYear()}`}function Q2(e,t){let n=e.result;if(!n)return[t.status["not-run"]];let r=[t.status[n.status]];return n.actual&&r.push(t.actual+n.actual),n.bug&&r.push(t.bug+n.bug),r}function sa(e,t,n,r){let i=e.kind==="non-functional",s=e.cases.filter(l=>!l.deleted),a=[...i?n.headNf:n.headFn],o=[7,27,38,28];t.results&&(a.push(...n.headResult),o=[8,20,27,20,13,12]);let c=s.map((l,u)=>{let p=[[String(u+1),...t.codes?[l.code]:[]],ia(i&&l.requirement||l.case),ia(l.steps),ia(l.expected)];return t.results&&p.push(Q2(l,n),l.result?[l.result.by??"",J2(l.result.at,r)].filter(Boolean):[]),p});return{head:a,widths:o,rows:c}}function gg(e){let t=tn();for(let n of e)yr(n,t);return t}function aa(e,t={}){let n=e.config,r=n.overview??{},i=t.date??new Date,s=n.language==="en"?"en":"vi",a=Jr[s],o=[],c=b=>en(e,b),l=e.modules.filter(b=>c(b.code).some(C=>C.kind==="functional")),u=e.modules.filter(b=>c(b.code).some(C=>C.kind==="non-functional")),d=Ve(e.root,n.ba),p=d?bt(d):null;o.push({k:"cover",lines:[...r.owner?[{text:r.owner.toUpperCase(),bold:!0}]:[],{text:""},{text:a.coverDoc,bold:!0,size:32},{text:a.coverTitle,bold:!0,size:32},{text:n.title,bold:!0,size:28},{text:""},{text:a.docVersion+(r.docVersion||"1.0")},...t.results?[{text:a.withResults}]:[],{text:""},...r.owner?[{text:a.owner+r.owner}]:[],...r.contractor?[{text:a.contractor+r.contractor}]:[],{text:""},{text:(r.place?r.place+", ":"")+(s==="vi"?Y2(i):i.toISOString().slice(0,10))}]}),o.push({k:"pagebreak"}),o.push({k:"p",text:a.signPage,bold:!0});let h=n.members.length?n.members:[{id:"",name:"",role:""}];o.push({k:"table",head:a.signHead,widths:[6,16,30,28,20],rows:h.map((b,C)=>[[String(C+1)],[""],[b.name],[b.role??""],[""]])}),o.push({k:"pagebreak"}),o.push({k:"toc",title:a.toc}),o.push({k:"pagebreak"});let f=0;o.push({k:"h",level:1,text:`${fg[f++]}. ${a.overview}`}),o.push({k:"h",level:2,text:a.purpose}),o.push({k:"p",text:r.purpose||a.purposeText(n.title)}),o.push({k:"h",level:2,text:a.scope}),r.scope?o.push({k:"p",text:r.scope}):(o.push({k:"p",text:a.scopeIntro}),o.push({k:"list",items:e.modules.filter(b=>c(b.code).length).map(b=>b.title)})),o.push({k:"h",level:2,text:a.env}),o.push({k:"p",text:r.environment||a.envDefault}),o.push({k:"h",level:2,text:a.refs}),o.push({k:"p",text:r.references||a.refsIntro}),r.references||o.push({k:"list",items:a.refsList}),o.push({k:"h",level:2,text:a.terms});let m=r.terms?.length?r.terms:a.termsDefault;o.push({k:"table",head:a.termsHead,widths:[8,30,62],rows:m.map((b,C)=>[[String(C+1)],[b.term],[b.desc]])});let g=(b,C,_)=>{if(o.push({k:"pagebreak"}),o.push({k:"h",level:1,text:`${fg[f++]}. ${b}`}),!C.length){o.push({k:"p",text:a.noSuites,italic:!0});return}C.forEach((w,x)=>{o.push({k:"h",level:2,text:`${x+1}. ${w.title}`}),_==="functional"&&w.commonSteps.trim()&&(o.push({k:"p",text:a.commonSteps,bold:!0}),o.push({k:"list",items:ia(w.commonSteps)})),c(w.code).filter(v=>v.kind===_).forEach((v,A)=>{o.push({k:"h",level:3,text:`${x+1}.${A+1}. ${v.title}`});let N=[v.useCases.length?a.useCase+v.useCases.join(", "):"",v.covers.length?a.functions+v.covers.map(O=>p?.get(O)?.title?`${O} (${p.get(O).title})`:O).join("; "):""].filter(Boolean);if(N.length&&o.push({k:"p",text:N.join(" \xB7 "),italic:!0}),v.preconditions&&o.push({k:"p",text:a.pre+v.preconditions}),v.description.trim())for(let O of v.description.trim().split(/\n\s*\n/))o.push({k:"p",text:O.trim()});let D=sa(v,t,a,s);D.rows.length?o.push({k:"table",...D}):o.push({k:"p",text:a.noCases,italic:!0})})})};g(a.chFn,l,"functional"),g(a.chNf,u,"non-functional");let y=[];t.results&&y.push(()=>{o.push({k:"h",level:2,text:a.sumTitle});let b=e.modules.map(w=>({m:w,c:gg(c(w.code))})).filter(w=>w.c.total),C=gg(e.modules.flatMap(w=>c(w.code))),_=w=>w.total?Math.round(100*w.passed/w.total)+"%":"\u2014";o.push({k:"table",head:a.sumHead,widths:[30,10,8,10,9,9,11,13],rows:[...b.map(({m:w,c:x})=>[[w.title],[String(x.total)],[String(x.passed)],[String(x.failed)],[String(x.blocked)],[String(x.skipped)],[String(x["not-run"])],[_(x)]]),[[a.total],[String(C.total)],[String(C.passed)],[String(C.failed)],[String(C.blocked)],[String(C.skipped)],[String(C["not-run"])],[_(C)]]]})});let T=e.suites.filter(b=>b.status!=="deleted"&&b.covers.length);if(T.length&&y.push(()=>{o.push({k:"h",level:2,text:a.matrix});let b=new Map;for(let C of T)for(let _ of C.covers)b.set(_,[...b.get(_)??[],C.title]);o.push({k:"table",head:a.matrixHead,widths:[8,42,50],rows:[...b.entries()].sort((C,_)=>C[0].localeCompare(_[0])).map(([C,_],w)=>[[String(w+1)],[p?.get(C)?.title?`${C} \u2013 ${p.get(C).title}`:C],_])})}),y.length){o.push({k:"pagebreak"}),o.push({k:"h",level:1,text:a.appendix});for(let b of y)b()}return{title:n.title,lang:s,results:!!t.results,nodes:o}}function oa(e){let t=[],n=e.nodes.filter(s=>s.k==="h"),r=0;for(let s of e.nodes)if(s.k==="cover")t.push(`<section class="cover">${s.lines.map(a=>a.text?`<p class="${a.bold?"b":""}"${a.size?` style="font-size:${a.size/2}pt"`:""}>${Et(a.text)}</p>`:"<p>&nbsp;</p>").join("")}</section>`);else if(s.k==="h")t.push(`<h${s.level} id="h${r++}">${Et(s.text)}</h${s.level}>`);else if(s.k==="p")t.push(`<p${s.bold||s.italic?` class="${s.bold?"b":""} ${s.italic?"i":""}"`:""}>${Et(s.text).replace(/\n/g,"<br>")}</p>`);else if(s.k==="list")t.push(`<ul>${s.items.map(a=>`<li>${Et(a)}</li>`).join("")}</ul>`);else if(s.k==="toc")t.push(`<nav class="toc"><p class="b">${Et(s.title)}</p>${n.map((a,o)=>`<a class="l${a.level}" href="#h${o}">${Et(a.text)}</a>`).join("")}</nav>`);else if(s.k==="pagebreak")t.push('<div class="pb"></div>');else if(s.k==="table"){let a=s.widths?`<colgroup>${s.widths.map(o=>`<col style="width:${o}%">`).join("")}</colgroup>`:"";t.push(`<table>${a}<thead><tr>${s.head.map(o=>`<th>${Et(o)}</th>`).join("")}</tr></thead><tbody>${s.rows.map(o=>`<tr>${o.map(c=>`<td>${c.map(Et).join("<br>")}</td>`).join("")}</tr>`).join("")}</tbody></table>`)}return`<!doctype html><html lang="${e.lang}"><head><meta charset="utf-8"><title>${Et(e.title)}</title><style>body{background:#e9ecef;margin:0;font:12pt/1.45 "Times New Roman",serif;color:#111}
5344
5344
  main{background:#fff;max-width:794px;margin:24px auto;padding:72px 64px;box-shadow:0 1px 4px rgba(0,0,0,.15)}
5345
5345
  .cover{text-align:center;min-height:900px;display:flex;flex-direction:column;justify-content:center}.cover p{margin:4px 0}
5346
5346
  .b{font-weight:700}.i{font-style:italic}h1{font-size:14pt;margin:24px 0 10px}h2{font-size:13pt;margin:18px 0 8px}h3{font-size:12pt;margin:14px 0 6px}
@@ -5352,21 +5352,21 @@ th,td{border:1px solid #555;padding:4px 6px;vertical-align:top;text-align:left;o
5352
5352
  `).map((s,a)=>new Oe({text:s,bold:!!i.bold,italics:!!i.italic,...a?{break:1}:{}}))}));else if(i.k==="list")for(let s of i.items)t.push(new ne({bullet:{level:0},children:[new Oe({text:s})]}));else if(i.k==="toc")t.push(new ne({alignment:ue.CENTER,children:[new Oe({text:i.title,bold:!0})]})),t.push(new Ff(i.title,{hyperlink:!0,headingStyleRange:"1-3"}));else if(i.k==="pagebreak")t.push(new ne({children:[new $m]}));else if(i.k==="table"){let s=c=>i.widths?.[c]?{width:{size:i.widths[c],type:Fe.PERCENTAGE}}:{},a=new Js({tableHeader:!0,cantSplit:!0,children:i.head.map((c,l)=>new Fr({borders:bg,shading:{fill:"F1F3F5"},...s(l),children:n([c],!0)}))}),o=i.rows.map(c=>new Js({cantSplit:!1,children:c.map((l,u)=>new Fr({borders:bg,...s(u),children:n(l)}))}));t.push(new sf({width:{size:100,type:Fe.PERCENTAGE},rows:[a,...o]})),t.push(new ne({children:[]}))}let r=new $f({creator:"Pan Test",title:e.title,features:{updateFields:!0},styles:{default:{document:{run:{font:"Times New Roman",size:26}}}},sections:[{properties:{page:{margin:{top:1134,bottom:1134,left:1701,right:1134}}},children:t}]});return Sc.toBuffer(r)}async function Pc(e,t={}){let n=aa(e,t),r=mg.resolve(e.root,t.out??Qr);hg.mkdirSync(r,{recursive:!0});let i=t.date??new Date,s=mg.join(r,`${eA(e.config.title)}${t.results?"-ket-qua":""}-${i.toISOString().slice(0,10)}`),a=[];for(let o of t.formats??["docx"]){let c=`${s}.${o}`;hg.writeFileSync(c,o==="docx"?await vg(n):oa(n)),a.push(c)}return a}var Jr,fg,ia,J2,Et,ra,bg,Z2,Qr,Nc,eA,Zr=Se(()=>{"use strict";S();ug();Nn();xr();wr();Jr={vi:{status:{"not-run":"Ch\u01B0a test",passed:"\u0110\u1EA1t",failed:"Kh\xF4ng \u0111\u1EA1t",blocked:"B\u1ECB ch\u1EB7n",skipped:"B\u1ECF qua"},actual:"Th\u1EF1c t\u1EBF: ",bug:"L\u1ED7i: ",headFn:["STT","T\xECnh hu\u1ED1ng","C\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n","K\u1EBFt qu\u1EA3 mong \u0111\u1EE3i"],headNf:["STT","Y\xEAu c\u1EA7u","K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED","K\u1EBFt qu\u1EA3 mong \u0111\u1EE3i"],headResult:["K\u1EBFt qu\u1EA3","Ng\u01B0\u1EDDi test / ng\xE0y"],coverDoc:"T\xC0I LI\u1EC6U",coverTitle:"K\u1ECACH B\u1EA2N KI\u1EC2M TH\u1EEC (CH\u1EE8C N\u0102NG, PHI CH\u1EE8C N\u0102NG)",docVersion:"Phi\xEAn b\u1EA3n t\xE0i li\u1EC7u: ",withResults:"B\u1EA3n k\xE8m k\u1EBFt qu\u1EA3 ki\u1EC3m th\u1EED",owner:"\u0110\u01A1n v\u1ECB qu\u1EA3n l\xFD: ",contractor:"\u0110\u01A1n v\u1ECB th\u1EF1c hi\u1EC7n: ",signPage:"TRANG K\xDD",signHead:["TT","Ng\xE0y","H\u1ECD t\xEAn","Vai tr\xF2","K\xFD t\xEAn"],toc:"M\u1EE4C L\u1EE4C",overview:"T\u1ED4NG QUAN",purpose:"1. M\u1EE5c \u0111\xEDch t\xE0i li\u1EC7u",purposeText:e=>`T\xE0i li\u1EC7u n\xE0y m\xF4 t\u1EA3 c\xE1c t\xECnh hu\u1ED1ng ki\u1EC3m th\u1EED ch\u1EE9c n\u0103ng v\xE0 phi ch\u1EE9c n\u0103ng c\u1EE7a ${e}, l\xE0m c\u0103n c\u1EE9 ki\u1EC3m th\u1EED ch\u1EA5p nh\u1EADn (UAT) v\xE0 b\xE0n giao.`,scope:"2. Ph\u1EA1m vi",scopeIntro:"T\xE0i li\u1EC7u ki\u1EC3m th\u1EED c\xE1c ch\u1EE9c n\u0103ng, th\u1ECFa m\xE3n c\xE1c \u0111\u1EA7u m\u1EE5c ch\xEDnh nh\u01B0 sau:",env:"3. Th\xF4ng tin m\xF4i tr\u01B0\u1EDDng ki\u1EC3m th\u1EED",envDefault:"\u0110\u01B0\u1EDDng d\u1EABn / m\xE1y ch\u1EE7: (b\u1ED5 sung)",refs:"4. T\xE0i li\u1EC7u li\xEAn quan",refsIntro:"T\xE0i li\u1EC7u n\xE0y \u0111\u01B0\u1EE3c x\xE2y d\u1EF1ng d\u1EF1a tr\xEAn c\xE1c t\xE0i li\u1EC7u:",refsList:["T\xE0i li\u1EC7u \u0111\u1EB7c t\u1EA3 y\xEAu c\u1EA7u ph\u1EA7n m\u1EC1m;","T\xE0i li\u1EC7u thi\u1EBFt k\u1EBF chi ti\u1EBFt;","T\xE0i li\u1EC7u \u0111\u1EB7c t\u1EA3 chi ti\u1EBFt ch\u1EE9c n\u0103ng."],terms:"5. Thu\u1EADt ng\u1EEF v\xE0 \u0111\u1ECBnh ngh\u0129a",termsHead:["STT","Thu\u1EADt ng\u1EEF / vi\u1EBFt t\u1EAFt","M\xF4 t\u1EA3"],termsDefault:[{term:"UAT",desc:"Ki\u1EC3m th\u1EED ch\u1EA5p nh\u1EADn ng\u01B0\u1EDDi d\xF9ng (User Acceptance Test)"},{term:"K\u1ECBch b\u1EA3n",desc:"T\u1EADp t\xECnh hu\u1ED1ng ki\u1EC3m th\u1EED cho m\u1ED9t ch\u1EE9c n\u0103ng / use case"},{term:"T\xECnh hu\u1ED1ng",desc:"M\u1ED9t tr\u01B0\u1EDDng h\u1EE3p ki\u1EC3m th\u1EED: c\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n v\xE0 k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i"}],chFn:"CHI TI\u1EBET T\xCCNH HU\u1ED0NG KI\u1EC2M TH\u1EEC Y\xCAU C\u1EA6U CH\u1EE8C N\u0102NG \u1EE8NG D\u1EE4NG",chNf:"CHI TI\u1EBET T\xCCNH HU\u1ED0NG KI\u1EC2M TH\u1EEC Y\xCAU C\u1EA6U PHI CH\u1EE8C N\u0102NG \u1EE8NG D\u1EE4NG",noSuites:"(Ch\u01B0a c\xF3 k\u1ECBch b\u1EA3n.)",noCases:"(Ch\u01B0a c\xF3 t\xECnh hu\u1ED1ng.)",commonSteps:"C\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n chung:",useCase:"Use case: ",functions:"Ch\u1EE9c n\u0103ng: ",pre:"\u0110i\u1EC1u ki\u1EC7n ti\xEAn quy\u1EBFt: ",appendix:"PH\u1EE4 L\u1EE4C",sumTitle:"T\u1ED5ng h\u1EE3p k\u1EBFt qu\u1EA3 ki\u1EC3m th\u1EED",sumHead:["Ph\xE2n h\u1EC7","T\xECnh hu\u1ED1ng","\u0110\u1EA1t","Kh\xF4ng \u0111\u1EA1t","B\u1ECB ch\u1EB7n","B\u1ECF qua","Ch\u01B0a test","T\u1EF7 l\u1EC7 \u0111\u1EA1t"],total:"T\u1ED5ng",matrix:"Ma tr\u1EADn ch\u1EE9c n\u0103ng \u2013 k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED",matrixHead:["STT","Ch\u1EE9c n\u0103ng / m\xE0n (t\xE0i li\u1EC7u BA)","K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED"]},en:{status:{"not-run":"Not run",passed:"Passed",failed:"Failed",blocked:"Blocked",skipped:"Skipped"},actual:"Actual: ",bug:"Bug: ",headFn:["No.","Test case","Steps","Expected result"],headNf:["No.","Requirement","Test scenario","Expected result"],headResult:["Result","Tester / date"],coverDoc:"DOCUMENT",coverTitle:"TEST SCENARIOS (FUNCTIONAL, NON-FUNCTIONAL)",docVersion:"Document version: ",withResults:"With test results",owner:"Owner: ",contractor:"Contractor: ",signPage:"SIGN-OFF",signHead:["No.","Date","Full name","Role","Signature"],toc:"TABLE OF CONTENTS",overview:"OVERVIEW",purpose:"1. Purpose",purposeText:e=>`This document describes the functional and non-functional test scenarios of ${e}, used for user acceptance testing (UAT) and handover.`,scope:"2. Scope",scopeIntro:"The document covers the following main areas:",env:"3. Test environment",envDefault:"URL / server: (to be added)",refs:"4. Related documents",refsIntro:"This document is based on:",refsList:["Software requirements specification;","Detailed design;","Detailed functional specification."],terms:"5. Terms and definitions",termsHead:["No.","Term / abbreviation","Description"],termsDefault:[{term:"UAT",desc:"User Acceptance Test"},{term:"Test suite",desc:"The test cases of one function / use case"},{term:"Test case",desc:"One check: steps to perform and the expected result"}],chFn:"FUNCTIONAL TEST SCENARIOS",chNf:"NON-FUNCTIONAL TEST SCENARIOS",noSuites:"(No test suites yet.)",noCases:"(No test cases yet.)",commonSteps:"Common steps:",useCase:"Use case: ",functions:"Functions: ",pre:"Preconditions: ",appendix:"APPENDIX",sumTitle:"Test results summary",sumHead:["Module","Test cases","Passed","Failed","Blocked","Skipped","Not run","Pass rate"],total:"Total",matrix:"Function \u2013 test suite matrix",matrixHead:["No.","Function / screen (BA document)","Test suite"]}},fg=["I","II","III","IV","V","VI"],ia=e=>String(e??"").split(`
5353
5353
  `).map(t=>t.replace(/^\s*[-*+]\s+/,"").trimEnd()).filter(t=>t.trim());J2=(e,t)=>{let n=/^(\d{4})-(\d{2})-(\d{2})/.exec(e??"");return n&&t==="vi"?`${n[3]}/${n[2]}/${n[1]}`:e??""};Et=e=>e.replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t]);ra={style:Gr.SINGLE,size:4,color:"555555"},bg={top:ra,bottom:ra,left:ra,right:ra},Z2=[Ys.HEADING_1,Ys.HEADING_2,Ys.HEADING_3];Qr="exports",Nc=["docx","html"],eA=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/Đ/g,"D").replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)||"tai-lieu-kiem-thu"});function kg(e){return e==="mixed"?["vi","en"]:[e]}function Ic(e){let t=[];for(let n of kg(e))for(let r of tA)for(let i of xg[n][r])t.push({kind:r,keyword:i});return t.sort((n,r)=>r.keyword.length-n.keyword.length)}function Oc(e){let t=[rA];for(let n of kg(e))for(let r of nA)t.push(...xg[n][r]);return t.sort((n,r)=>r.length-n.length)}function oA(e,t){for(let{kind:n,keyword:r}of t){let i=`${r}:`;if(e.startsWith(i))return{kind:n,keyword:r,title:e.slice(i.length).trim()}}return null}function lA(e,t){for(let n of t){let r=`${n} `;if(!e.startsWith(r))continue;let i=e.slice(r.length).trim();if(i)return{keyword:n,text:i}}return null}function cA(e){return e.trim().split(/\s+/).filter(t=>t.startsWith("@"))}function dA(e,t){let n=e.find(s=>s.trim()!=="");if(!n)return"mixed";let r=n.trim().match(iA);if(!r)return"mixed";let i=r[1].toLowerCase();if(i!=="vi"&&i!=="en")throw new Error(`Unsupported Gherkin language "${r[1]}" in ${t} (supported: vi, en)`);return i}function yg(e){if(!e.startsWith("|"))return null;let t=e.split("|");return t.length<2?null:t.slice(1,t.at(-1)?.trim()===""?-1:void 0).map(r=>r.trim())}function Tg(e){return e.length>0?e[e.length-1]:null}function pA(e,t){let n=Tg(e);n&&(n.dataTable||(n.dataTable=[]),n.dataTable.push(t))}function uA(e,t){let n=Tg(e);n&&(n.docString=t)}function hA(e,t){let{scenario:n,startLine:r,endLine:i}=e;return n.lineRange={start:r,end:i},n.rawBlock=t.slice(r-1,i).join(`
5354
5354
  `),n}function Sg(e,t){let n=e.split(/\r?\n/),r=dA(n,t),i=sA[r],s=aA[r],a=[],o="",c=[],l=[],u=[],d=0,p=null,h="none",f,m=[],g=!1,y=[],T=null;function b(){return h==="background"?c:h==="ruleBackground"?m:p&&h==="scenario"?p.scenario.ownSteps:null}let C=new Map;function _(){if(!p)return;let w=hA(p,n);C.set(w,[...p.ruleBackgroundSteps]),l.push(w),p=null}for(let w=0;w<n.length;w+=1){let x=n[w],v=w+1,A=x.trim();if(!A)continue;if(g){A==='"""'?(T&&uA(T,y.join(`
5355
- `)),g=!1,y=[],T=null):y.push(x),p&&(p.endLine=v);continue}if(A.startsWith("@")){u.length===0&&(d=v),u.push(...cA(x));continue}if(A.startsWith("#"))continue;let N=oA(A,i);if(N){switch(N.kind){case"feature":_(),a=[...u],o=N.title,f=void 0,m=[],h="none";break;case"background":_(),h=f!==void 0?"ruleBackground":"background";break;case"rule":_(),f=N.title,m=[],h="none";break;case"scenario":case"scenarioOutline":{_();let F=u.length>0?d:v;p={startLine:F,endLine:v,ruleBackgroundSteps:[...m],scenario:{tags:[...u],title:N.title,keyword:N.keyword,isOutline:N.kind==="scenarioOutline",rule:f,steps:[],ownSteps:[],examples:[],rawBlock:"",lineRange:{start:F,end:v}}},h="scenario";break}case"examples":p&&(p.scenario.examples.push({keyword:N.keyword,headers:[],rows:[]}),p.endLine=v,h="examples");break}u=[];continue}let M=lA(A,s);if(M){h==="background"?c.push(M):h==="ruleBackground"?m.push(M):p&&(p.scenario.ownSteps.push(M),p.endLine=v,h="scenario");continue}if(h==="examples"&&p){let F=yg(A);if(F){let Q=p.scenario.examples[p.scenario.examples.length-1];Q.headers.length===0?Q.headers=F:Q.rows.push(F),p.endLine=v;continue}}if(A==='"""'){let F=b();if(F&&F.length>0){g=!0,y=[],T=F,p&&(p.endLine=v);continue}}let O=yg(A);if(O){let F=b();if(F){pA(F,O),p&&(p.endLine=v);continue}}p&&(p.endLine=v)}_();for(let w of l){let x=C.get(w)??[];w.steps=[...c,...x,...w.ownSteps]}return{filePath:t,language:r,featureTags:a,featureTitle:o,backgroundSteps:c,scenarios:l}}var xg,tA,nA,rA,iA,sA,aA,Cg=Se(()=>{"use strict";S();xg={vi:{feature:["T\xEDnh n\u0103ng"],background:["B\u1ED1i c\u1EA3nh"],rule:["Quy t\u1EAFc"],scenario:["T\xECnh hu\u1ED1ng","K\u1ECBch b\u1EA3n"],scenarioOutline:["Khung t\xECnh hu\u1ED1ng","Khung k\u1ECBch b\u1EA3n","K\u1ECBch b\u1EA3n m\u1EABu"],examples:["D\u1EEF li\u1EC7u","V\xED d\u1EE5"],given:["Bi\u1EBFt","Cho"],when:["Khi"],then:["Th\xEC"],and:["V\xE0"],but:["Nh\u01B0ng"]},en:{feature:["Feature"],background:["Background"],rule:["Rule"],scenario:["Scenario","Example"],scenarioOutline:["Scenario Outline","Scenario Template"],examples:["Examples","Scenarios"],given:["Given"],when:["When"],then:["Then"],and:["And"],but:["But"]}},tA=["feature","background","rule","scenario","scenarioOutline","examples"],nA=["given","when","then","and","but"],rA="*",iA=/^#\s*language\s*:\s*(.+?)\s*$/;sA={vi:Ic("vi"),en:Ic("en"),mixed:Ic("mixed")},aA={vi:Oc("vi"),en:Oc("en"),mixed:Oc("mixed")}});function Eg(e){let t=[];Ag(e.suites??[],t);let n=0,r=0,i=0,s=0;for(let a of t)a.status==="skipped"?s++:a.flaky?i++:a.status==="passed"?n++:r++;return{passed:n,failed:r,flaky:i,skipped:s,specs:t}}function Ag(e,t,n=""){for(let r of e){let i=r.file??n;for(let s of r.specs??[])t.push(mA(s,s.file??i));r.suites&&Ag(r.suites,t,i)}}function mA(e,t){let n=e.tests??[],r="skipped",i=!1,s=0,a;for(let o of n){let c=o.results??[];for(let u of c)s+=Number(u.duration??0)||0;let l=o.status;if(l==="flaky")i=!0,r="passed";else if(l==="expected")r="passed";else if(l==="unexpected")r="failed";else if(l==="skipped")r="skipped";else{let u=c[c.length-1]?.status;r=u==="passed"?"passed":u==="skipped"?"skipped":u?"failed":r}if(!a){let u=c.find(p=>p.error?.message||p.errors&&p.errors[0]?.message),d=u?.error?.message??u?.errors?.[0]?.message;d&&(a=fA(d).split(`
5355
+ `)),g=!1,y=[],T=null):y.push(x),p&&(p.endLine=v);continue}if(A.startsWith("@")){u.length===0&&(d=v),u.push(...cA(x));continue}if(A.startsWith("#"))continue;let N=oA(A,i);if(N){switch(N.kind){case"feature":_(),a=[...u],o=N.title,f=void 0,m=[],h="none";break;case"background":_(),h=f!==void 0?"ruleBackground":"background";break;case"rule":_(),f=N.title,m=[],h="none";break;case"scenario":case"scenarioOutline":{_();let F=u.length>0?d:v;p={startLine:F,endLine:v,ruleBackgroundSteps:[...m],scenario:{tags:[...u],title:N.title,keyword:N.keyword,isOutline:N.kind==="scenarioOutline",rule:f,steps:[],ownSteps:[],examples:[],rawBlock:"",lineRange:{start:F,end:v}}},h="scenario";break}case"examples":p&&(p.scenario.examples.push({keyword:N.keyword,headers:[],rows:[]}),p.endLine=v,h="examples");break}u=[];continue}let D=lA(A,s);if(D){h==="background"?c.push(D):h==="ruleBackground"?m.push(D):p&&(p.scenario.ownSteps.push(D),p.endLine=v,h="scenario");continue}if(h==="examples"&&p){let F=yg(A);if(F){let Q=p.scenario.examples[p.scenario.examples.length-1];Q.headers.length===0?Q.headers=F:Q.rows.push(F),p.endLine=v;continue}}if(A==='"""'){let F=b();if(F&&F.length>0){g=!0,y=[],T=F,p&&(p.endLine=v);continue}}let O=yg(A);if(O){let F=b();if(F){pA(F,O),p&&(p.endLine=v);continue}}p&&(p.endLine=v)}_();for(let w of l){let x=C.get(w)??[];w.steps=[...c,...x,...w.ownSteps]}return{filePath:t,language:r,featureTags:a,featureTitle:o,backgroundSteps:c,scenarios:l}}var xg,tA,nA,rA,iA,sA,aA,Cg=Se(()=>{"use strict";S();xg={vi:{feature:["T\xEDnh n\u0103ng"],background:["B\u1ED1i c\u1EA3nh"],rule:["Quy t\u1EAFc"],scenario:["T\xECnh hu\u1ED1ng","K\u1ECBch b\u1EA3n"],scenarioOutline:["Khung t\xECnh hu\u1ED1ng","Khung k\u1ECBch b\u1EA3n","K\u1ECBch b\u1EA3n m\u1EABu"],examples:["D\u1EEF li\u1EC7u","V\xED d\u1EE5"],given:["Bi\u1EBFt","Cho"],when:["Khi"],then:["Th\xEC"],and:["V\xE0"],but:["Nh\u01B0ng"]},en:{feature:["Feature"],background:["Background"],rule:["Rule"],scenario:["Scenario","Example"],scenarioOutline:["Scenario Outline","Scenario Template"],examples:["Examples","Scenarios"],given:["Given"],when:["When"],then:["Then"],and:["And"],but:["But"]}},tA=["feature","background","rule","scenario","scenarioOutline","examples"],nA=["given","when","then","and","but"],rA="*",iA=/^#\s*language\s*:\s*(.+?)\s*$/;sA={vi:Ic("vi"),en:Ic("en"),mixed:Ic("mixed")},aA={vi:Oc("vi"),en:Oc("en"),mixed:Oc("mixed")}});function Eg(e){let t=[];Ag(e.suites??[],t);let n=0,r=0,i=0,s=0;for(let a of t)a.status==="skipped"?s++:a.flaky?i++:a.status==="passed"?n++:r++;return{passed:n,failed:r,flaky:i,skipped:s,specs:t}}function Ag(e,t,n=""){for(let r of e){let i=r.file??n;for(let s of r.specs??[])t.push(mA(s,s.file??i));r.suites&&Ag(r.suites,t,i)}}function mA(e,t){let n=e.tests??[],r="skipped",i=!1,s=0,a;for(let o of n){let c=o.results??[];for(let u of c)s+=Number(u.duration??0)||0;let l=o.status;if(l==="flaky")i=!0,r="passed";else if(l==="expected")r="passed";else if(l==="unexpected")r="failed";else if(l==="skipped")r="skipped";else{let u=c[c.length-1]?.status;r=u==="passed"?"passed":u==="skipped"?"skipped":u?"failed":r}if(!a){let u=c.find(p=>p.error?.message||p.errors&&p.errors[0]?.message),d=u?.error?.message??u?.errors?.[0]?.message;d&&(a=fA(d).split(`
5356
5356
  `).slice(0,4).join(`
5357
- `))}}return{title:e.title??"(untitled)",file:t,tags:(e.tags??[]).map(o=>o.startsWith("@")?o:`@${o}`),status:r,flaky:i,durationMs:s,errorText:a}}function fA(e){return e.replace(/\u001b\[[0-9;]*[a-zA-Z]/g,"")}var _g=Se(()=>{"use strict";S()});var Dc={};ii(Dc,{applyRunResults:()=>Mc,featureFiles:()=>wA,importFeature:()=>Lc,parseRunResults:()=>la,readRunResults:()=>yA,scenarioTag:()=>Ng,scenarioToCase:()=>Ig});import ei from"node:fs";import Rc from"node:path";function Ng(e,t=[]){let n=new Set(t.map(r=>r.toLowerCase()));return e.find(r=>!/^@p\d+$/i.test(r)&&!/^@domain-/i.test(r)&&!n.has(r.toLowerCase())&&!/^@(guide-video|flake|skip|wip|manual)$/i.test(r))}function Pg(e){let t=e.text;return e.dataTable?.length&&(t+=" "+e.dataTable.map(n=>n.join(" | ")).join("; ")),e.docString&&(t+=" \xAB"+e.docString.trim().replace(/\s+/g," ").slice(0,200)+"\xBB"),t}function Ig(e){let t=[],n=[],r="do";for(let a of e.ownSteps){let o=a.keyword.trim();vA.test(o)?r="expect":(gA.test(o)||bA.test(o))&&(r="do"),(r==="expect"?n:t).push(Pg(a))}let i=t.map((a,o)=>`B${o+1}: ${a}`),s=e.examples.reduce((a,o)=>a+o.rows.length,0);return e.isOutline&&s&&i.push(`(Ch\u1EA1y v\u1EDBi ${s} b\u1ED9 d\u1EEF li\u1EC7u: ${e.examples[0].headers.join(", ")})`),{steps:i.join(`
5357
+ `))}}return{title:e.title??"(untitled)",file:t,tags:(e.tags??[]).map(o=>o.startsWith("@")?o:`@${o}`),status:r,flaky:i,durationMs:s,errorText:a}}function fA(e){return e.replace(/\u001b\[[0-9;]*[a-zA-Z]/g,"")}var _g=Se(()=>{"use strict";S()});var Mc={};ii(Mc,{applyRunResults:()=>Dc,featureFiles:()=>wA,importFeature:()=>Lc,parseRunResults:()=>la,readRunResults:()=>yA,scenarioTag:()=>Ng,scenarioToCase:()=>Ig});import ei from"node:fs";import Rc from"node:path";function Ng(e,t=[]){let n=new Set(t.map(r=>r.toLowerCase()));return e.find(r=>!/^@p\d+$/i.test(r)&&!/^@domain-/i.test(r)&&!n.has(r.toLowerCase())&&!/^@(guide-video|flake|skip|wip|manual)$/i.test(r))}function Pg(e){let t=e.text;return e.dataTable?.length&&(t+=" "+e.dataTable.map(n=>n.join(" | ")).join("; ")),e.docString&&(t+=" \xAB"+e.docString.trim().replace(/\s+/g," ").slice(0,200)+"\xBB"),t}function Ig(e){let t=[],n=[],r="do";for(let a of e.ownSteps){let o=a.keyword.trim();vA.test(o)?r="expect":(gA.test(o)||bA.test(o))&&(r="do"),(r==="expect"?n:t).push(Pg(a))}let i=t.map((a,o)=>`B${o+1}: ${a}`),s=e.examples.reduce((a,o)=>a+o.rows.length,0);return e.isOutline&&s&&i.push(`(Ch\u1EA1y v\u1EDBi ${s} b\u1ED9 d\u1EEF li\u1EC7u: ${e.examples[0].headers.join(", ")})`),{steps:i.join(`
5358
5358
  `),expected:n.join(`
5359
- `)}}function Lc(e,t,n){let r=ms(e,n.module),i=Sg(t,n.file);if(!i.featureTitle&&!i.scenarios.length)throw new K(U(`${n.file}: kh\xF4ng th\u1EA5y \xABT\xEDnh n\u0103ng:\xBB / \xABFeature:\xBB hay k\u1ECBch b\u1EA3n n\xE0o.`,`${n.file}: no \xABFeature:\xBB / \xABT\xEDnh n\u0103ng:\xBB or scenarios found.`));let s=n.by??vt(e.root),a=us(e,n.avoid),o=e.suites.find(d=>d.source===n.file&&d.status!=="deleted"),c=!o;if(o)i.featureTitle&&(o.title=i.featureTitle);else{let d=mn("KB",r.code,a);a.add(d),o={code:d,module:r.code,title:i.featureTitle||Rc.basename(n.file,".feature"),kind:"functional",status:"drafting",covers:[],useCases:[],owner:s,created:{by:s,at:new Date().toISOString().replace(/\.\d{3}Z$/,"Z")},source:n.file,description:"",cases:[],file:""},e.suites.push(o)}i.backgroundSteps.length&&(o.preconditions=i.backgroundSteps.map(Pg).join("; "));let l={suite:o.code,created:c,added:[],updated:[],missing:[],untagged:0},u=new Set;for(let d of i.scenarios){let p=Ng(d.tags,i.featureTags);p||l.untagged++;let{steps:h,expected:f}=Ig(d),m=o.cases.filter(y=>!y.deleted),g=p?m.find(y=>y.tag?.toLowerCase()===p.toLowerCase()):m.find(y=>!y.tag&&y.case===d.title);if(g)g.case=d.title,g.steps=h,g.expected=f,u.add(g.code),l.updated.push(g.code);else{let y=mn("TC",r.code,a);a.add(y);let T={code:y,case:d.title,steps:h,expected:f,...p?{tag:p}:{}};o.cases.push(T),u.add(y),l.added.push(y)}}return l.missing=o.cases.filter(d=>!d.deleted&&d.tag&&!u.has(d.code)).map(d=>d.code),ze(e.root,o),c&&vr(e,r.code,{suites:[...en(e,r.code).map(d=>d.code).filter(d=>d!==o.code),o.code]}),l}function wA(e){let t=[],n=r=>{for(let i of ei.readdirSync(r,{withFileTypes:!0})){if(i.name.startsWith(".")||i.name==="node_modules")continue;let s=Rc.join(r,i.name);i.isDirectory()?n(s):i.name.endsWith(".feature")&&t.push(s)}};return n(e),t.sort()}function yA(e){let t=ei.existsSync(e)&&ei.statSync(e).isDirectory()?Rc.join(e,"results.json"):e;if(!ei.existsSync(t))throw new K(U(`Kh\xF4ng th\u1EA5y ${t} \u2014 c\u1EA7n results.json c\u1EE7a l\u1EA7n ch\u1EA1y pan-test (Playwright JSON reporter).`,`${t} not found \u2014 need the results.json of a pan-test run (Playwright JSON reporter).`));return la(ei.readFileSync(t,"utf8"))}function la(e){let t;try{t=JSON.parse(e)}catch{throw new K(U("results.json kh\xF4ng ph\u1EA3i JSON h\u1EE3p l\u1EC7.","results.json is not valid JSON."))}return Eg(t).specs}function Mc(e,t,n={}){let r=new Map;for(let c of t)for(let l of c.tags)r.set(l.toLowerCase(),[...r.get(l.toLowerCase())??[],c]);let i={applied:[],notRun:[],unknownTags:[]},s=new Set,a=n.at??new Date().toISOString().slice(0,10);for(let c of e.suites){if(c.status==="deleted")continue;let l=!1;for(let u of c.cases){if(u.deleted||!u.tag)continue;let d=u.tag.toLowerCase();s.add(d);let p=r.get(d);if(!p?.length){i.notRun.push(u.code);continue}let h=p.filter(g=>g.status==="failed"),f=h.length?"failed":p.every(g=>g.status==="skipped")?"skipped":"passed",m=h.length?(h.map(g=>g.errorText).find(Boolean)??"K\u1ECBch b\u1EA3n t\u1EF1 \u0111\u1ED9ng kh\xF4ng \u0111\u1EA1t.").slice(0,600):void 0;u.result={status:f,by:n.by??"pan-test",at:a,...m?{actual:m}:{},...n.env?{env:n.env}:{}},i.applied.push({code:u.code,status:f}),l=!0}l&&ze(e.root,c)}let o=/^@(p\d+|domain-.*|guide-video|flake|skip|wip)$/i;return i.unknownTags=[...r.keys()].filter(c=>!s.has(c)&&!o.test(c)).sort(),i}var gA,bA,vA,ti=Se(()=>{"use strict";S();qn();Cg();_g();fn();wr();_n();gA=/^(given|cho|biết)$/i,bA=/^(when|khi)$/i,vA=/^(then|thì)$/i});import{spawn as Og}from"node:child_process";import xA from"node:http";import kA from"node:path";function Rg(e){let t=process.env.PAN_CLI_JS?.trim();return t?{file:process.execPath,args:[t,...e],shell:!1}:{file:"pan",args:e,shell:process.platform==="win32"}}function Lg(e,t){return new Promise(n=>{let r=Rg(e),i="",s="",a;try{a=Og(r.file,r.args,{cwd:t,env:process.env,stdio:["ignore","pipe","pipe"],shell:r.shell,windowsHide:!0})}catch(o){n({code:null,json:null,stderr:o.message});return}a.stdout.on("data",o=>{i+=o.toString("utf8")}),a.stderr.on("data",o=>{s=(s+o.toString("utf8")).slice(-4e3)}),a.on("error",o=>n({code:null,json:null,stderr:o.message})),a.on("close",o=>{let c=null;for(let l of i.trim().split(`
5359
+ `)}}function Lc(e,t,n){let r=ms(e,n.module),i=Sg(t,n.file);if(!i.featureTitle&&!i.scenarios.length)throw new K(U(`${n.file}: kh\xF4ng th\u1EA5y \xABT\xEDnh n\u0103ng:\xBB / \xABFeature:\xBB hay k\u1ECBch b\u1EA3n n\xE0o.`,`${n.file}: no \xABFeature:\xBB / \xABT\xEDnh n\u0103ng:\xBB or scenarios found.`));let s=n.by??vt(e.root),a=us(e,n.avoid),o=e.suites.find(d=>d.source===n.file&&d.status!=="deleted"),c=!o;if(o)i.featureTitle&&(o.title=i.featureTitle);else{let d=mn("KB",r.code,a);a.add(d),o={code:d,module:r.code,title:i.featureTitle||Rc.basename(n.file,".feature"),kind:"functional",status:"drafting",covers:[],useCases:[],owner:s,created:{by:s,at:new Date().toISOString().replace(/\.\d{3}Z$/,"Z")},source:n.file,description:"",cases:[],file:""},e.suites.push(o)}i.backgroundSteps.length&&(o.preconditions=i.backgroundSteps.map(Pg).join("; "));let l={suite:o.code,created:c,added:[],updated:[],missing:[],untagged:0},u=new Set;for(let d of i.scenarios){let p=Ng(d.tags,i.featureTags);p||l.untagged++;let{steps:h,expected:f}=Ig(d),m=o.cases.filter(y=>!y.deleted),g=p?m.find(y=>y.tag?.toLowerCase()===p.toLowerCase()):m.find(y=>!y.tag&&y.case===d.title);if(g)g.case=d.title,g.steps=h,g.expected=f,u.add(g.code),l.updated.push(g.code);else{let y=mn("TC",r.code,a);a.add(y);let T={code:y,case:d.title,steps:h,expected:f,...p?{tag:p}:{}};o.cases.push(T),u.add(y),l.added.push(y)}}return l.missing=o.cases.filter(d=>!d.deleted&&d.tag&&!u.has(d.code)).map(d=>d.code),ze(e.root,o),c&&vr(e,r.code,{suites:[...en(e,r.code).map(d=>d.code).filter(d=>d!==o.code),o.code]}),l}function wA(e){let t=[],n=r=>{for(let i of ei.readdirSync(r,{withFileTypes:!0})){if(i.name.startsWith(".")||i.name==="node_modules")continue;let s=Rc.join(r,i.name);i.isDirectory()?n(s):i.name.endsWith(".feature")&&t.push(s)}};return n(e),t.sort()}function yA(e){let t=ei.existsSync(e)&&ei.statSync(e).isDirectory()?Rc.join(e,"results.json"):e;if(!ei.existsSync(t))throw new K(U(`Kh\xF4ng th\u1EA5y ${t} \u2014 c\u1EA7n results.json c\u1EE7a l\u1EA7n ch\u1EA1y pan-test (Playwright JSON reporter).`,`${t} not found \u2014 need the results.json of a pan-test run (Playwright JSON reporter).`));return la(ei.readFileSync(t,"utf8"))}function la(e){let t;try{t=JSON.parse(e)}catch{throw new K(U("results.json kh\xF4ng ph\u1EA3i JSON h\u1EE3p l\u1EC7.","results.json is not valid JSON."))}return Eg(t).specs}function Dc(e,t,n={}){let r=new Map;for(let c of t)for(let l of c.tags)r.set(l.toLowerCase(),[...r.get(l.toLowerCase())??[],c]);let i={applied:[],notRun:[],unknownTags:[]},s=new Set,a=n.at??new Date().toISOString().slice(0,10);for(let c of e.suites){if(c.status==="deleted")continue;let l=!1;for(let u of c.cases){if(u.deleted||!u.tag)continue;let d=u.tag.toLowerCase();s.add(d);let p=r.get(d);if(!p?.length){i.notRun.push(u.code);continue}let h=p.filter(g=>g.status==="failed"),f=h.length?"failed":p.every(g=>g.status==="skipped")?"skipped":"passed",m=h.length?(h.map(g=>g.errorText).find(Boolean)??"K\u1ECBch b\u1EA3n t\u1EF1 \u0111\u1ED9ng kh\xF4ng \u0111\u1EA1t.").slice(0,600):void 0;u.result={status:f,by:n.by??"pan-test",at:a,...m?{actual:m}:{},...n.env?{env:n.env}:{}},i.applied.push({code:u.code,status:f}),l=!0}l&&ze(e.root,c)}let o=/^@(p\d+|domain-.*|guide-video|flake|skip|wip)$/i;return i.unknownTags=[...r.keys()].filter(c=>!s.has(c)&&!o.test(c)).sort(),i}var gA,bA,vA,ti=Se(()=>{"use strict";S();qn();Cg();_g();fn();wr();_n();gA=/^(given|cho|biết)$/i,bA=/^(when|khi)$/i,vA=/^(then|thì)$/i});import{spawn as Og}from"node:child_process";import xA from"node:http";import kA from"node:path";function Rg(e){let t=process.env.PAN_CLI_JS?.trim();return t?{file:process.execPath,args:[t,...e],shell:!1}:{file:"pan",args:e,shell:process.platform==="win32"}}function Lg(e,t){return new Promise(n=>{let r=Rg(e),i="",s="",a;try{a=Og(r.file,r.args,{cwd:t,env:process.env,stdio:["ignore","pipe","pipe"],shell:r.shell,windowsHide:!0})}catch(o){n({code:null,json:null,stderr:o.message});return}a.stdout.on("data",o=>{i+=o.toString("utf8")}),a.stderr.on("data",o=>{s=(s+o.toString("utf8")).slice(-4e3)}),a.on("error",o=>n({code:null,json:null,stderr:o.message})),a.on("close",o=>{let c=null;for(let l of i.trim().split(`
5360
5360
  `).reverse())if(l.trim().startsWith("{"))try{c=JSON.parse(l);break}catch{}n({code:o,json:c,stderr:s})})})}function SA(e,t){let n=pn.get(e);if(n)return n;let r=new Promise((i,s)=>{let a=TA(e,t),o=Og(a.file,a.args,{cwd:e,env:process.env,stdio:["pipe","pipe","pipe"],shell:a.shell,windowsHide:!0}),c="",l="",u=setTimeout(()=>{o.kill(),s(new Error("PAN_AI_HOST_TIMEOUT"))},3e4);o.stdout.on("data",d=>{c+=d.toString("utf8");for(let p of c.split(`
5361
- `))if(p.trim().startsWith("{"))try{let h=JSON.parse(p);if(h.event==="listening"&&h.url&&h.token){clearTimeout(u),i({url:new URL(h.url),token:h.token,child:o});return}}catch{}}),o.stderr.on("data",d=>{l=(l+d.toString("utf8")).slice(-2e3)}),o.on("error",d=>{clearTimeout(u),pn.delete(e),s(d)}),o.on("exit",d=>{clearTimeout(u),pn.delete(e),s(new Error(`PAN_AI_HOST_EXIT ${d} ${l.slice(-400)}`))})});return pn.set(e,r),r.catch(()=>pn.delete(e)),r}function Mg(){for(let e of pn.values())e.then(t=>{try{t.child.stdin.end()}catch{}}).catch(()=>{});pn.clear()}function Dg(e,t){let n=e.config.language==="en",r=Ve(e.root,e.config.ba),i=t?e.suites.find(c=>c.code===t||c.cases.some(l=>l.code===t)):void 0,s=t&&i?i.cases.find(c=>c.code===t):void 0,a=n?["You are an assistant working DIRECTLY in a test-case document repo (Pan Test, `.pantest.yaml`) in the current folder \u2014 the tester has the app open.","Rules:","- Change content ONLY through commands so codes stay unique and results are kept: `pan test module add`, `pan test new <MOD> --title \u2026 --covers CN-\u2026,SCR-\u2026`, `pan test case add <KB-\u2026> --case \u2026 --steps \u2026 --expected \u2026`, `pan test case edit <TC-\u2026> \u2026`, `pan test case rm <TC-\u2026> --reason \u2026`. Never hand-edit the ```yaml pt:cases``` blocks; never invent or renumber codes.","- Test cases: happy path first, then validation (each required field, formats, limits), permissions, edge cases from the business rules. Steps = user actions on the screen (\xABB1: \u2026\xBB, \xABB2: \u2026\xBB); expected = what the user sees (quote message text from the BA doc).","- Read the BA document (read-only) for the covered functions / screens. Do NOT invent behaviour it does not state \u2014 write \xAB[To confirm]\xBB.","- Do NOT set results (`pan test result`) unless the user says the test was run.","- When done run `pan test check`; fix errors. No commit, no push. Keys and enum values stay English.","- If the user must choose: end the answer with a ```pan-choices block (\xAB? question\xBB, then \xAB- option\xBB lines, max 5).","- Answer SHORT in English: what you added / changed (by code), what still needs a decision."]:["B\u1EA1n l\xE0 tr\u1EE3 l\xFD l\xE0m vi\u1EC7c TR\u1EF0C TI\u1EBEP trong repo t\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED (Pan Test, `.pantest.yaml`) \u1EDF th\u01B0 m\u1EE5c hi\u1EC7n t\u1EA1i \u2014 tester \u0111ang m\u1EDF app.","Lu\u1EADt:","- S\u1EEDa n\u1ED9i dung CH\u1EC8 b\u1EB1ng l\u1EC7nh \u0111\u1EC3 m\xE3 kh\xF4ng tr\xF9ng v\xE0 k\u1EBFt qu\u1EA3 kh\xF4ng m\u1EA5t: `pan test module add`, `pan test new <PH> --title \u2026 --covers CN-\u2026,SCR-\u2026`, `pan test case add <KB-\u2026> --case \u2026 --steps \u2026 --expected \u2026`, `pan test case edit <TC-\u2026> \u2026`, `pan test case rm <TC-\u2026> --reason \u2026`. Kh\xF4ng s\u1EEDa tay kh\u1ED1i ```yaml pt:cases```; kh\xF4ng b\u1ECBa / \u0111\xE1nh l\u1EA1i m\xE3.","- T\xECnh hu\u1ED1ng: lu\u1ED3ng \u0111\xFAng tr\u01B0\u1EDBc, r\u1ED3i ki\u1EC3m tra d\u1EEF li\u1EC7u (t\u1EEBng tr\u01B0\u1EDDng b\u1EAFt bu\u1ED9c, \u0111\u1ECBnh d\u1EA1ng, gi\u1EDBi h\u1EA1n), ph\xE2n quy\u1EC1n, tr\u01B0\u1EDDng h\u1EE3p bi\xEAn theo quy t\u1EAFc nghi\u1EC7p v\u1EE5. C\xE1c b\u01B0\u1EDBc = thao t\xE1c ng\u01B0\u1EDDi d\xF9ng tr\xEAn m\xE0n (\xABB1: \u2026\xBB, \xABB2: \u2026\xBB); k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i = \u0111i\u1EC1u ng\u01B0\u1EDDi d\xF9ng th\u1EA5y (th\xF4ng b\xE1o tr\xEDch nguy\xEAn v\u0103n t\xE0i li\u1EC7u BA trong \xAB\u2026\xBB).","- \u0110\u1ECDc t\xE0i li\u1EC7u BA (ch\u1EC9 \u0111\u1ECDc) cho ch\u1EE9c n\u0103ng / m\xE0n \u0111\u01B0\u1EE3c ph\u1EE7. KH\xD4NG b\u1ECBa nghi\u1EC7p v\u1EE5 t\xE0i li\u1EC7u BA kh\xF4ng n\xF3i \u2014 ghi \xAB[C\u1EA7n x\xE1c nh\u1EADn]\xBB.","- KH\xD4NG ghi k\u1EBFt qu\u1EA3 (`pan test result`) tr\u1EEB khi ng\u01B0\u1EDDi d\xF9ng n\xF3i \u0111\xE3 ch\u1EA1y test.","- Xong ch\u1EA1y `pan test check`; c\xF2n l\u1ED7i th\xEC s\u1EEDa. Kh\xF4ng commit, kh\xF4ng push. Kho\xE1 v\xE0 gi\xE1 tr\u1ECB enum gi\u1EEF ti\u1EBFng Anh.","- C\u1EA7n ng\u01B0\u1EDDi d\xF9ng ch\u1ECDn: k\u1EBFt th\xFAc c\xE2u tr\u1EA3 l\u1EDDi b\u1EB1ng kh\u1ED1i ```pan-choices (d\xF2ng \u0111\u1EA7u \xAB? c\xE2u h\u1ECFi\xBB, m\u1ED7i l\u1EF1a ch\u1ECDn m\u1ED9t d\xF2ng \xAB- \u2026\xBB, t\u1ED1i \u0111a 5).","- Tr\u1EA3 l\u1EDDi NG\u1EAEN b\u1EB1ng ti\u1EBFng Vi\u1EC7t: \u0111\xE3 th\xEAm / s\u1EEDa g\xEC (theo m\xE3), c\xF2n g\xEC c\u1EA7n quy\u1EBFt."],o=[`${n?"Document":"T\xE0i li\u1EC7u"}: \xAB${e.config.title}\xBB (${e.suites.length} ${n?"suites":"k\u1ECBch b\u1EA3n"}, ${e.suites.reduce((c,l)=>c+l.cases.length,0)} ${n?"cases":"t\xECnh hu\u1ED1ng"})`,r?`${n?"BA document repo (read-only)":"Repo t\xE0i li\u1EC7u BA (ch\u1EC9 \u0111\u1ECDc)"}: ${r}`:"",i?`${n?"Selected suite":"K\u1ECBch b\u1EA3n \u0111ang ch\u1ECDn"}: ${i.code} \xAB${i.title}\xBB${i.covers.length?` (covers ${i.covers.join(", ")})`:""} \u2014 ${i.file}`:"",s?`${n?"Selected case":"T\xECnh hu\u1ED1ng \u0111ang ch\u1ECDn"}: ${s.code} \xAB${s.case}\xBB`:""].filter(Boolean).join(`
5361
+ `))if(p.trim().startsWith("{"))try{let h=JSON.parse(p);if(h.event==="listening"&&h.url&&h.token){clearTimeout(u),i({url:new URL(h.url),token:h.token,child:o});return}}catch{}}),o.stderr.on("data",d=>{l=(l+d.toString("utf8")).slice(-2e3)}),o.on("error",d=>{clearTimeout(u),pn.delete(e),s(d)}),o.on("exit",d=>{clearTimeout(u),pn.delete(e),s(new Error(`PAN_AI_HOST_EXIT ${d} ${l.slice(-400)}`))})});return pn.set(e,r),r.catch(()=>pn.delete(e)),r}function Dg(){for(let e of pn.values())e.then(t=>{try{t.child.stdin.end()}catch{}}).catch(()=>{});pn.clear()}function Mg(e,t){let n=e.config.language==="en",r=Ve(e.root,e.config.ba),i=t?e.suites.find(c=>c.code===t||c.cases.some(l=>l.code===t)):void 0,s=t&&i?i.cases.find(c=>c.code===t):void 0,a=n?["You are an assistant working DIRECTLY in a test-case document repo (Pan Test, `.pantest.yaml`) in the current folder \u2014 the tester has the app open.","Rules:","- Change content ONLY through commands so codes stay unique and results are kept: `pan test module add`, `pan test new <MOD> --title \u2026 --covers CN-\u2026,SCR-\u2026`, `pan test case add <KB-\u2026> --case \u2026 --steps \u2026 --expected \u2026`, `pan test case edit <TC-\u2026> \u2026`, `pan test case rm <TC-\u2026> --reason \u2026`. Never hand-edit the ```yaml pt:cases``` blocks; never invent or renumber codes.","- Test cases: happy path first, then validation (each required field, formats, limits), permissions, edge cases from the business rules. Steps = user actions on the screen (\xABB1: \u2026\xBB, \xABB2: \u2026\xBB); expected = what the user sees (quote message text from the BA doc).","- Read the BA document (read-only) for the covered functions / screens. Do NOT invent behaviour it does not state \u2014 write \xAB[To confirm]\xBB.","- Do NOT set results (`pan test result`) unless the user says the test was run.","- When done run `pan test check`; fix errors. No commit, no push. Keys and enum values stay English.","- If the user must choose: end the answer with a ```pan-choices block (\xAB? question\xBB, then \xAB- option\xBB lines, max 5).","- Answer SHORT in English: what you added / changed (by code), what still needs a decision."]:["B\u1EA1n l\xE0 tr\u1EE3 l\xFD l\xE0m vi\u1EC7c TR\u1EF0C TI\u1EBEP trong repo t\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED (Pan Test, `.pantest.yaml`) \u1EDF th\u01B0 m\u1EE5c hi\u1EC7n t\u1EA1i \u2014 tester \u0111ang m\u1EDF app.","Lu\u1EADt:","- S\u1EEDa n\u1ED9i dung CH\u1EC8 b\u1EB1ng l\u1EC7nh \u0111\u1EC3 m\xE3 kh\xF4ng tr\xF9ng v\xE0 k\u1EBFt qu\u1EA3 kh\xF4ng m\u1EA5t: `pan test module add`, `pan test new <PH> --title \u2026 --covers CN-\u2026,SCR-\u2026`, `pan test case add <KB-\u2026> --case \u2026 --steps \u2026 --expected \u2026`, `pan test case edit <TC-\u2026> \u2026`, `pan test case rm <TC-\u2026> --reason \u2026`. Kh\xF4ng s\u1EEDa tay kh\u1ED1i ```yaml pt:cases```; kh\xF4ng b\u1ECBa / \u0111\xE1nh l\u1EA1i m\xE3.","- T\xECnh hu\u1ED1ng: lu\u1ED3ng \u0111\xFAng tr\u01B0\u1EDBc, r\u1ED3i ki\u1EC3m tra d\u1EEF li\u1EC7u (t\u1EEBng tr\u01B0\u1EDDng b\u1EAFt bu\u1ED9c, \u0111\u1ECBnh d\u1EA1ng, gi\u1EDBi h\u1EA1n), ph\xE2n quy\u1EC1n, tr\u01B0\u1EDDng h\u1EE3p bi\xEAn theo quy t\u1EAFc nghi\u1EC7p v\u1EE5. C\xE1c b\u01B0\u1EDBc = thao t\xE1c ng\u01B0\u1EDDi d\xF9ng tr\xEAn m\xE0n (\xABB1: \u2026\xBB, \xABB2: \u2026\xBB); k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i = \u0111i\u1EC1u ng\u01B0\u1EDDi d\xF9ng th\u1EA5y (th\xF4ng b\xE1o tr\xEDch nguy\xEAn v\u0103n t\xE0i li\u1EC7u BA trong \xAB\u2026\xBB).","- \u0110\u1ECDc t\xE0i li\u1EC7u BA (ch\u1EC9 \u0111\u1ECDc) cho ch\u1EE9c n\u0103ng / m\xE0n \u0111\u01B0\u1EE3c ph\u1EE7. KH\xD4NG b\u1ECBa nghi\u1EC7p v\u1EE5 t\xE0i li\u1EC7u BA kh\xF4ng n\xF3i \u2014 ghi \xAB[C\u1EA7n x\xE1c nh\u1EADn]\xBB.","- KH\xD4NG ghi k\u1EBFt qu\u1EA3 (`pan test result`) tr\u1EEB khi ng\u01B0\u1EDDi d\xF9ng n\xF3i \u0111\xE3 ch\u1EA1y test.","- Xong ch\u1EA1y `pan test check`; c\xF2n l\u1ED7i th\xEC s\u1EEDa. Kh\xF4ng commit, kh\xF4ng push. Kho\xE1 v\xE0 gi\xE1 tr\u1ECB enum gi\u1EEF ti\u1EBFng Anh.","- C\u1EA7n ng\u01B0\u1EDDi d\xF9ng ch\u1ECDn: k\u1EBFt th\xFAc c\xE2u tr\u1EA3 l\u1EDDi b\u1EB1ng kh\u1ED1i ```pan-choices (d\xF2ng \u0111\u1EA7u \xAB? c\xE2u h\u1ECFi\xBB, m\u1ED7i l\u1EF1a ch\u1ECDn m\u1ED9t d\xF2ng \xAB- \u2026\xBB, t\u1ED1i \u0111a 5).","- Tr\u1EA3 l\u1EDDi NG\u1EAEN b\u1EB1ng ti\u1EBFng Vi\u1EC7t: \u0111\xE3 th\xEAm / s\u1EEDa g\xEC (theo m\xE3), c\xF2n g\xEC c\u1EA7n quy\u1EBFt."],o=[`${n?"Document":"T\xE0i li\u1EC7u"}: \xAB${e.config.title}\xBB (${e.suites.length} ${n?"suites":"k\u1ECBch b\u1EA3n"}, ${e.suites.reduce((c,l)=>c+l.cases.length,0)} ${n?"cases":"t\xECnh hu\u1ED1ng"})`,r?`${n?"BA document repo (read-only)":"Repo t\xE0i li\u1EC7u BA (ch\u1EC9 \u0111\u1ECDc)"}: ${r}`:"",i?`${n?"Selected suite":"K\u1ECBch b\u1EA3n \u0111ang ch\u1ECDn"}: ${i.code} \xAB${i.title}\xBB${i.covers.length?` (covers ${i.covers.join(", ")})`:""} \u2014 ${i.file}`:"",s?`${n?"Selected case":"T\xECnh hu\u1ED1ng \u0111ang ch\u1ECDn"}: ${s.code} \xAB${s.case}\xBB`:""].filter(Boolean).join(`
5362
5362
  `);return{system:[...a,"",(n?`Context:
5363
5363
  `:`Ng\u1EEF c\u1EA3nh:
5364
5364
  `)+o].join(`
5365
- `),addDirs:r?[kA.resolve(r)]:[]}}async function Bc(e,t,n,r,i,s){let a=await SA(e,t),o=s===void 0?void 0:Buffer.from(JSON.stringify(s));await new Promise((c,l)=>{let u=xA.request({host:a.url.hostname,port:a.url.port,path:i,method:s===void 0?"GET":"POST",headers:{"x-pan-ai-token":a.token,...o?{"content-type":"application/json","content-length":String(o.length)}:{}}},d=>{r.writeHead(d.statusCode??502,{"Content-Type":String(d.headers["content-type"]||"application/json; charset=utf-8"),"Cache-Control":"no-store","X-Content-Type-Options":"nosniff"}),d.pipe(r),d.on("end",c)});u.on("error",l),n.on("close",()=>u.destroy()),u.end(o)})}var pn,TA,Bg=Se(()=>{"use strict";S();Nn();pn=new Map;TA=(e,t)=>Rg(["ai-host","--dir",e,"--lang",t,"--lifeline"])});var Wg={};ii(Wg,{CSP:()=>qc,VIEW_CSP:()=>Fc,createDocServer:()=>PA,embedSources:()=>Ug});import{randomBytes as CA,timingSafeEqual as EA}from"node:crypto";import $c from"node:fs";import AA from"node:http";import ut from"node:path";import{fileURLToPath as _A}from"node:url";function Fg(e){if(typeof R<"u"&&R[e]!==void 0)return R[e];for(let t of[ut.join($g,"ui"),ut.join($g,"..","..","src","doc","ui")]){let n=ut.join(t,ca[e].file);if($c.existsSync(n))return $c.readFileSync(n,"utf8")}throw new Error(`Thi\u1EBFu t\u1EC7p giao di\u1EC7n ${e}`)}function jg(e){let t=Ve(e.root,e.config.ba);return t?bt(t):null}function NA(e){let t=jg(e);return{root:e.root,me:vt(e.root),config:e.config,modules:e.modules,suites:e.suites,readErrors:e.readErrors,ba:t?{linked:!0,items:[...t.values()].filter(n=>!n.deleted&&(n.type==="function"||n.type==="screen")).map(n=>({code:n.code,title:n.title,type:n.type}))}:{linked:!1,path:e.config.ba??null,items:[]},summary:Pn(e,t)}}function Hg(e){let t={};for(let n of["case","steps","expected","requirement","tag"])ee(e[n])!==void 0&&(t[n]=ee(e[n]));return ee(e.priority)!==void 0&&(t.priority=ee(e.priority)),t}function PA(e){let t=ls(e.start);if(!t)throw new K(U(`Kh\xF4ng th\u1EA5y repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (.pantest.yaml) t\u1EEB ${ut.resolve(e.start)}. T\u1EA1o b\u1EB1ng: pan-test doc init`,`No test document repo (.pantest.yaml) found from ${ut.resolve(e.start)}. Create one with: pan-test doc init`));let n=e.token??CA(24).toString("hex"),r=Ug(e.embed),i=r.length?qc.replace("frame-ancestors 'none'",`frame-ancestors ${r.join(" ")}`):qc,s=d=>({status:200,body:d}),a=r.length?Fc.replace("frame-ancestors 'self'",`frame-ancestors 'self' ${r.join(" ")}`):Fc,o={"/api/export":async(d,p)=>{let h=(Array.isArray(d.formats)?d.formats:["docx"]).map(String).filter(m=>Nc.includes(m)),f=await Pc(p,{formats:h.length?h:["docx"],results:d.results===!0,codes:d.codes===!0});return s({ok:!0,dir:ut.join(p.root,Qr),files:f.map(m=>ut.relative(p.root,m).split(ut.sep).join("/"))})},"/api/open":async(d,p)=>{let h=ut.join(p.root,Qr);$c.mkdirSync(h,{recursive:!0});let{spawn:f}=await import("node:child_process"),m=process.platform==="darwin"?"open":process.platform==="win32"?"explorer":"xdg-open";try{f(m,[h],{stdio:"ignore",detached:!0,windowsHide:!0}).unref()}catch{}return s({ok:!0,dir:h})}},c={"/api/module/new":(d,p)=>s(hs(p,String(d.code??"").trim().toUpperCase(),String(d.title??"").trim())),"/api/module":(d,p)=>s(vr(p,String(d.code),{...ee(d.title)!==void 0?{title:ee(d.title)}:{},...ee(d.commonSteps)!==void 0?{commonSteps:ee(d.commonSteps)}:{}})),"/api/suite/new":(d,p)=>s(fs(p,{module:String(d.module),title:String(d.title??""),...d.kind==="non-functional"?{kind:"non-functional"}:{},...Fn(d.covers)?{covers:Fn(d.covers)}:{},...ee(d.after)?{after:ee(d.after)}:{},avoid:Ft(p.root)})),"/api/suite":(d,p)=>{let h={};for(let f of["title","preconditions","description","owner"])ee(d[f])!==void 0&&(h[f]=ee(d[f]));return(d.kind==="functional"||d.kind==="non-functional")&&(h.kind=d.kind),(d.status==="drafting"||d.status==="done"||d.status==="deleted")&&(h.status=d.status),ee(d.priority)!==void 0&&(h.priority=ee(d.priority)),Fn(d.covers)&&(h.covers=Fn(d.covers)),Fn(d.useCases)&&(h.useCases=Fn(d.useCases)),s(zu(p,String(d.code),h))},"/api/case/new":(d,p)=>s(gs(p,String(d.suite),{case:"",...Hg(d)},{...ee(d.after)?{after:ee(d.after)}:{},avoid:Ft(p.root)})),"/api/case":(d,p)=>s(vs(p,String(d.code),Hg(d))),"/api/import/feature":(d,p)=>{let h=Array.isArray(d.files)?d.files:[];if(!h.length)throw new K(U("Ch\u01B0a ch\u1ECDn t\u1EC7p .feature n\xE0o.","No .feature file selected."));let f=Ft(p.root);return s({ok:!0,reports:h.map(m=>({name:String(m.name??""),...Lc(p,String(m.content??""),{file:String(m.name??"feature.feature"),module:String(d.module),avoid:f})}))})},"/api/results":(d,p)=>s({ok:!0,...Mc(p,la(String(d.content??"")),{...ee(d.env)?{env:ee(d.env)}:{}})}),"/api/case/move":(d,p)=>s(Vu(p,String(d.code),d.dir===-1?-1:1)),"/api/case/delete":(d,p)=>s(ws(p,String(d.code),ee(d.reason)??"")),"/api/result":(d,p)=>s(ys(p,String(d.code),{status:String(d.status),...ee(d.actual)!==void 0?{actual:ee(d.actual)}:{},...ee(d.env)!==void 0?{env:ee(d.env)}:{},...ee(d.bug)!==void 0?{bug:ee(d.bug)}:{}}))},l=()=>({status:404,body:{}}),u=AA.createServer((d,p)=>{let h=(b,C,_)=>{p.writeHead(b,{"Content-Type":_,"X-Content-Type-Options":"nosniff","Referrer-Policy":"no-referrer","Cache-Control":"no-store","Content-Security-Policy":i}),p.end(d.method==="HEAD"?void 0:C)},f=(b,C)=>h(b,JSON.stringify(C),"application/json; charset=utf-8"),m=b=>f(b instanceof K?400:500,{ok:!1,error:b.message}),g=b=>{if(p.headersSent){p.end();return}let C=U("C\u1EA7n Pan CLI (@pan-stack/cli \u2265 0.3.90) \u0111\u1EC3 d\xF9ng Tr\u1EE3 l\xFD AI: ","Pan CLI (@pan-stack/cli \u2265 0.3.90) is needed for the AI assistant: ")+b.message;T==="/api/ai"?f(200,{engines:[],max:0,runs:[],error:C}):f(503,{ok:!1,error:C})},y=b=>{Lg(["test",b,"--dir",t,"--json"],t).then(C=>{if(C.json)return f(C.json.ok===!1?400:200,C.json);let _=U("C\u1EA7n Pan CLI (@pan-stack/cli \u2265 0.3.91) \u0111\u1EC3 ph\xE1t h\xE0nh l\xEAn Pan Studio: ","Pan CLI (@pan-stack/cli \u2265 0.3.91) is needed to publish to Pan Studio: ")+(C.stderr.trim().slice(-300)||`exit ${C.code}`);return b==="studio"?f(200,{ok:!0,login:!1,cli:!1,error:_}):f(503,{ok:!1,error:_})}).catch(m)},T=(()=>{try{return new URL(d.url||"/","http://x").pathname}catch{return""}})();try{let b=u.address()?.port,C=String(d.headers.host||""),_=[`127.0.0.1:${b}`,`localhost:${b}`];if(!_.includes(C))return f(403,{error:"Host kh\xF4ng h\u1EE3p l\u1EC7"});let w=new URL(d.url||"/",`http://${C}`),x=w.pathname,v=x==="/api/ai"||x.startsWith("/api/ai/");if(d.method==="POST"){let N=c[x]??o[x]??(v||x.startsWith("/api/studio/")?l:void 0);if(!N)return f(404,{error:"Kh\xF4ng c\xF3"});let M=String(d.headers.origin||"");if(M&&!_.some(V=>M===`http://${V}`))return f(403,{error:"Origin kh\xF4ng h\u1EE3p l\u1EC7"});let O=Buffer.from(String(d.headers["x-pan-test-token"]||"")),F=Buffer.from(n);if(O.length!==F.length||!EA(O,F))return f(403,{error:"Thi\u1EBFu token phi\xEAn"});if(!String(d.headers["content-type"]||"").startsWith("application/json"))return f(415,{error:"C\u1EA7n application/json"});let Q=[],Z=0;d.on("data",V=>{Z+=V.length,Z>qg?(f(413,{error:"Qu\xE1 l\u1EDBn"}),d.destroy()):Q.push(V)}),d.on("end",()=>{if(Z>qg)return;let V;try{V=JSON.parse(Buffer.concat(Q).toString("utf8")||"{}")}catch{return f(400,{error:"JSON sai"})}if(x==="/api/studio/publish"||x==="/api/studio/remove"){y(x==="/api/studio/publish"?"publish":"unpublish");return}if(N===l){let G=Ge(t),de=x==="/api/ai/run"?{...V,...Dg(G,ee(V.item))}:V;Bc(t,G.config.language,d,p,x,de).catch(g);return}Promise.resolve().then(()=>{let G=Ge(t);return un(G.config.language),N(V,G)}).then(G=>f(G.status,G.body)).catch(m)});return}if(d.method!=="GET"&&d.method!=="HEAD")return f(405,{error:"Ch\u1EC9 cho GET/POST"});if(x==="/api/studio"){y("studio");return}if(v){let N=Ge(t);Bc(t,N.config.language,d,p,x+w.search).catch(g);return}if(x==="/"||x==="/index.html"){let N=w.searchParams.get("lang")||e.lang||Ge(t).config.language,M=Fg("index.html").replace(/<head[^>]*>/,O=>`${O}<meta name="pantest-token" content="${n}"><meta name="panba-lang" content="${N==="en"?"en":"vi"}">`);return h(200,M,ca["index.html"].type)}let A=/^\/ui\/([a-z0-9.]+)$/.exec(x);if(A&&ca[A[1]])return h(200,Fg(A[1]),ca[A[1]].type);if(x==="/favicon.ico")return h(204,"","image/x-icon");if(x==="/api/index")return f(200,NA(Ge(t)));if(x==="/view/doc"){let N=oa(aa(Ge(t),{results:w.searchParams.get("results")==="1",codes:w.searchParams.get("codes")==="1"}));return p.writeHead(200,{"Content-Type":"text/html; charset=utf-8","X-Content-Type-Options":"nosniff","Referrer-Policy":"no-referrer","Cache-Control":"no-store","Content-Security-Policy":a}),p.end(d.method==="HEAD"?void 0:N)}if(x==="/api/check"){let N=Ge(t);return f(200,{findings:xs(N,jg(N))})}return f(404,{error:"Kh\xF4ng c\xF3"})}catch(b){return m(b)}});return u.on("close",()=>Mg()),Object.assign(u,{token:n,root:t})}var $g,ca,Fc,qc,qg,Ug,ee,Fn,Kg=Se(()=>{"use strict";S();qn();Nn();xr();wr();ti();Zr();_n();Bg();$g=ut.dirname(_A(import.meta.url)),ca={"index.html":{file:"index.html",type:"text/html; charset=utf-8"},"tokens.css":{file:"tokens.css",type:"text/css; charset=utf-8"},"shell.js":{file:"shell.browser.js",type:"text/javascript; charset=utf-8"},"i18n.js":{file:"i18n.browser.js",type:"text/javascript; charset=utf-8"},"app.js":{file:"app.browser.js",type:"text/javascript; charset=utf-8"},"assist.js":{file:"assist.browser.js",type:"text/javascript; charset=utf-8"},"edit.js":{file:"edit.browser.js",type:"text/javascript; charset=utf-8"}};Fc="default-src 'none'; style-src 'unsafe-inline'; img-src 'self' data:; base-uri 'none'; form-action 'none'; frame-ancestors 'self'",qc="default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'self'; font-src 'self'; frame-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'",qg=24*1024*1024,Ug=e=>(e??[]).filter(t=>/^[a-z][a-z0-9+.-]*:$/.test(t)||/^https?:\/\/[A-Za-z0-9.-]+(:\d+)?$/.test(t)),ee=e=>typeof e=="string"?e:void 0,Fn=e=>Array.isArray(e)?e.map(String).map(t=>t.trim()).filter(Boolean):void 0});var Vg={};ii(Vg,{buildBundle:()=>RA});function OA(e,t,n){let r=Jr[n],i=yr(e,tn()),s=[`# ${e.code} \xB7 ${e.title}`,""],a=[e.covers.length?`- ${r.functions}${e.covers.join(", ")}`:"",e.useCases.length?`- ${r.useCase}${e.useCases.join(", ")}`:"",e.preconditions?`- ${r.pre}${e.preconditions.replace(/\n+/g," ")}`:"",`- ${r.sumHead[2]}: ${i.passed}/${i.total} \xB7 ${r.sumHead[3]}: ${i.failed} \xB7 ${r.sumHead[6]}: ${i["not-run"]}`].filter(Boolean);s.push(...a,""),e.description.trim()&&s.push(e.description.trim(),"");let o=t.modules.find(l=>l.code===e.module);o?.commonSteps.trim()&&s.push(`**${r.commonSteps}**`,"",o.commonSteps.trim(),"");let c=sa(e,{results:!0,codes:!0},r,n);if(!c.rows.length)s.push(r.noCases,"");else{s.push("| "+c.head.join(" | ")+" |","|"+c.head.map(()=>" --- |").join(""));for(let l of c.rows)s.push("| "+l.map(IA).join(" | ")+" |");s.push("")}return s.join(`
5366
- `)}function RA(e){let t=e.config.language==="en"?"en":"vi",n=Jr[t],r=Ve(e.root,e.config.ba),i=Pn(e,r?bt(r):null),s={},a=[`# ${t==="en"?"Generated by \xABpan test publish\xBB \u2014 do not edit; the test document repo is the source.":"Sinh b\u1EDFi \xABpan test publish\xBB \u2014 \u0111\u1EEBng s\u1EEDa tay; ngu\u1ED3n l\xE0 repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED."}`,`title: ${Me(e.config.title)}`,`locale: ${t}`,"theme: classic","layout: document","sections:"],o=n.sumHead,c=i.modules.map(h=>[`${h.code} \xB7 ${h.title}`,h.count.total,h.count.passed,h.count.failed,h.count.blocked,h.count.skipped,h.count["not-run"],zg(h.count.passed,h.count.total)]);c.push([`**${n.total}**`,i.all.total,i.all.passed,i.all.failed,i.all.blocked,i.all.skipped,i.all["not-run"],zg(i.all.passed,i.all.total)]),s["content/tong-hop/tong-hop.md"]=[`# ${n.sumTitle}`,"","| "+o.join(" | ")+" |","|"+o.map(()=>" --- |").join(""),...c.map(h=>"| "+h.join(" | ")+" |"),"",...i.coverage?[`${t==="en"?"BA function coverage":"\u0110\u1ED9 ph\u1EE7 ch\u1EE9c n\u0103ng t\xE0i li\u1EC7u BA"}: ${i.coverage.covered}/${i.coverage.functions}`,""]:[]].join(`
5367
- `),a.push(` - id: ${Me("tong-hop")}`,` title: ${Me(n.sumTitle)}`," lessons:",` - id: ${Me("tong-hop")}`,` title: ${Me(n.sumTitle)}`," type: article",` src: ${Me("content/tong-hop/tong-hop.md")}`);let l=1,u=new Set(["tong-hop"]),d=h=>{let f=h;for(let m=2;u.has(f);m++)f=`${h}-${m}`;return u.add(f),f};return[...e.modules].sort((h,f)=>h.order-f.order).forEach((h,f)=>{let m=e.suites.filter(y=>y.module===h.code&&y.status!=="deleted").sort((y,T)=>(h.suites.indexOf(y.code)+1||1e9)-(h.suites.indexOf(T.code)+1||1e9)||y.code.localeCompare(T.code));if(!m.length)return;let g=d(Gg(h.code));a.push(` - id: ${Me(g)}`,` title: ${Me(`${f+1}. ${h.title}`)}`," lessons:");for(let y of m){let T=d(Gg(y.code)),b=`content/${g}/${T}.md`;s[b]=OA(y,e,t),a.push(` - id: ${Me(T)}`,` title: ${Me(`${y.code} \xB7 ${y.title}`)}`," type: article",` src: ${Me(b)}`,` code: ${Me(y.code)}`,` module: ${Me(h.code)}`),l++}}),s["handover.yaml"]=a.join(`
5365
+ `),addDirs:r?[kA.resolve(r)]:[]}}async function Bc(e,t,n,r,i,s){let a=await SA(e,t),o=s===void 0?void 0:Buffer.from(JSON.stringify(s));await new Promise((c,l)=>{let u=xA.request({host:a.url.hostname,port:a.url.port,path:i,method:s===void 0?"GET":"POST",headers:{"x-pan-ai-token":a.token,...o?{"content-type":"application/json","content-length":String(o.length)}:{}}},d=>{r.writeHead(d.statusCode??502,{"Content-Type":String(d.headers["content-type"]||"application/json; charset=utf-8"),"Cache-Control":"no-store","X-Content-Type-Options":"nosniff"}),d.pipe(r),d.on("end",c)});u.on("error",l),n.on("close",()=>u.destroy()),u.end(o)})}var pn,TA,Bg=Se(()=>{"use strict";S();Nn();pn=new Map;TA=(e,t)=>Rg(["ai-host","--dir",e,"--lang",t,"--lifeline"])});var Wg={};ii(Wg,{CSP:()=>qc,VIEW_CSP:()=>Fc,createDocServer:()=>PA,embedSources:()=>Ug});import{randomBytes as CA,timingSafeEqual as EA}from"node:crypto";import $c from"node:fs";import AA from"node:http";import ut from"node:path";import{fileURLToPath as _A}from"node:url";function Fg(e){if(typeof R<"u"&&R[e]!==void 0)return R[e];for(let t of[ut.join($g,"ui"),ut.join($g,"..","..","src","doc","ui")]){let n=ut.join(t,ca[e].file);if($c.existsSync(n))return $c.readFileSync(n,"utf8")}throw new Error(`Thi\u1EBFu t\u1EC7p giao di\u1EC7n ${e}`)}function jg(e){let t=Ve(e.root,e.config.ba);return t?bt(t):null}function NA(e){let t=jg(e);return{root:e.root,me:vt(e.root),config:e.config,modules:e.modules,suites:e.suites,readErrors:e.readErrors,ba:t?{linked:!0,items:[...t.values()].filter(n=>!n.deleted&&(n.type==="function"||n.type==="screen")).map(n=>({code:n.code,title:n.title,type:n.type}))}:{linked:!1,path:e.config.ba??null,items:[]},summary:Pn(e,t)}}function Hg(e){let t={};for(let n of["case","steps","expected","requirement","tag"])ee(e[n])!==void 0&&(t[n]=ee(e[n]));return ee(e.priority)!==void 0&&(t.priority=ee(e.priority)),t}function PA(e){let t=ls(e.start);if(!t)throw new K(U(`Kh\xF4ng th\u1EA5y repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (.pantest.yaml) t\u1EEB ${ut.resolve(e.start)}. T\u1EA1o b\u1EB1ng: pan-test doc init`,`No test document repo (.pantest.yaml) found from ${ut.resolve(e.start)}. Create one with: pan-test doc init`));let n=e.token??CA(24).toString("hex"),r=Ug(e.embed),i=r.length?qc.replace("frame-ancestors 'none'",`frame-ancestors ${r.join(" ")}`):qc,s=d=>({status:200,body:d}),a=r.length?Fc.replace("frame-ancestors 'self'",`frame-ancestors 'self' ${r.join(" ")}`):Fc,o={"/api/export":async(d,p)=>{let h=(Array.isArray(d.formats)?d.formats:["docx"]).map(String).filter(m=>Nc.includes(m)),f=await Pc(p,{formats:h.length?h:["docx"],results:d.results===!0,codes:d.codes===!0});return s({ok:!0,dir:ut.join(p.root,Qr),files:f.map(m=>ut.relative(p.root,m).split(ut.sep).join("/"))})},"/api/open":async(d,p)=>{let h=ut.join(p.root,Qr);$c.mkdirSync(h,{recursive:!0});let{spawn:f}=await import("node:child_process"),m=process.platform==="darwin"?"open":process.platform==="win32"?"explorer":"xdg-open";try{f(m,[h],{stdio:"ignore",detached:!0,windowsHide:!0}).unref()}catch{}return s({ok:!0,dir:h})}},c={"/api/module/new":(d,p)=>s(hs(p,String(d.code??"").trim().toUpperCase(),String(d.title??"").trim())),"/api/module":(d,p)=>s(vr(p,String(d.code),{...ee(d.title)!==void 0?{title:ee(d.title)}:{},...ee(d.commonSteps)!==void 0?{commonSteps:ee(d.commonSteps)}:{}})),"/api/suite/new":(d,p)=>s(fs(p,{module:String(d.module),title:String(d.title??""),...d.kind==="non-functional"?{kind:"non-functional"}:{},...Fn(d.covers)?{covers:Fn(d.covers)}:{},...ee(d.after)?{after:ee(d.after)}:{},avoid:Ft(p.root)})),"/api/suite":(d,p)=>{let h={};for(let f of["title","preconditions","description","owner"])ee(d[f])!==void 0&&(h[f]=ee(d[f]));return(d.kind==="functional"||d.kind==="non-functional")&&(h.kind=d.kind),(d.status==="drafting"||d.status==="done"||d.status==="deleted")&&(h.status=d.status),ee(d.priority)!==void 0&&(h.priority=ee(d.priority)),Fn(d.covers)&&(h.covers=Fn(d.covers)),Fn(d.useCases)&&(h.useCases=Fn(d.useCases)),s(zu(p,String(d.code),h))},"/api/case/new":(d,p)=>s(gs(p,String(d.suite),{case:"",...Hg(d)},{...ee(d.after)?{after:ee(d.after)}:{},avoid:Ft(p.root)})),"/api/case":(d,p)=>s(vs(p,String(d.code),Hg(d))),"/api/import/feature":(d,p)=>{let h=Array.isArray(d.files)?d.files:[];if(!h.length)throw new K(U("Ch\u01B0a ch\u1ECDn t\u1EC7p .feature n\xE0o.","No .feature file selected."));let f=Ft(p.root);return s({ok:!0,reports:h.map(m=>({name:String(m.name??""),...Lc(p,String(m.content??""),{file:String(m.name??"feature.feature"),module:String(d.module),avoid:f})}))})},"/api/results":(d,p)=>s({ok:!0,...Dc(p,la(String(d.content??"")),{...ee(d.env)?{env:ee(d.env)}:{}})}),"/api/case/move":(d,p)=>s(Vu(p,String(d.code),d.dir===-1?-1:1)),"/api/case/delete":(d,p)=>s(ws(p,String(d.code),ee(d.reason)??"")),"/api/result":(d,p)=>s(ys(p,String(d.code),{status:String(d.status),...ee(d.actual)!==void 0?{actual:ee(d.actual)}:{},...ee(d.env)!==void 0?{env:ee(d.env)}:{},...ee(d.bug)!==void 0?{bug:ee(d.bug)}:{}}))},l=()=>({status:404,body:{}}),u=AA.createServer((d,p)=>{let h=(b,C,_)=>{p.writeHead(b,{"Content-Type":_,"X-Content-Type-Options":"nosniff","Referrer-Policy":"no-referrer","Cache-Control":"no-store","Content-Security-Policy":i}),p.end(d.method==="HEAD"?void 0:C)},f=(b,C)=>h(b,JSON.stringify(C),"application/json; charset=utf-8"),m=b=>f(b instanceof K?400:500,{ok:!1,error:b.message}),g=b=>{if(p.headersSent){p.end();return}let C=U("C\u1EA7n Pan CLI (@pan-stack/cli \u2265 0.3.90) \u0111\u1EC3 d\xF9ng Tr\u1EE3 l\xFD AI: ","Pan CLI (@pan-stack/cli \u2265 0.3.90) is needed for the AI assistant: ")+b.message;T==="/api/ai"?f(200,{engines:[],max:0,runs:[],error:C}):f(503,{ok:!1,error:C})},y=b=>{Lg(["test",b,"--dir",t,"--json"],t).then(C=>{if(C.json)return f(C.json.ok===!1?400:200,C.json);let _=U("C\u1EA7n Pan CLI (@pan-stack/cli \u2265 0.3.91) \u0111\u1EC3 ph\xE1t h\xE0nh l\xEAn Pan Studio: ","Pan CLI (@pan-stack/cli \u2265 0.3.91) is needed to publish to Pan Studio: ")+(C.stderr.trim().slice(-300)||`exit ${C.code}`);return b==="studio"?f(200,{ok:!0,login:!1,cli:!1,error:_}):f(503,{ok:!1,error:_})}).catch(m)},T=(()=>{try{return new URL(d.url||"/","http://x").pathname}catch{return""}})();try{let b=u.address()?.port,C=String(d.headers.host||""),_=[`127.0.0.1:${b}`,`localhost:${b}`];if(!_.includes(C))return f(403,{error:"Host kh\xF4ng h\u1EE3p l\u1EC7"});let w=new URL(d.url||"/",`http://${C}`),x=w.pathname,v=x==="/api/ai"||x.startsWith("/api/ai/");if(d.method==="POST"){let N=c[x]??o[x]??(v||x.startsWith("/api/studio/")?l:void 0);if(!N)return f(404,{error:"Kh\xF4ng c\xF3"});let D=String(d.headers.origin||"");if(D&&!_.some(V=>D===`http://${V}`))return f(403,{error:"Origin kh\xF4ng h\u1EE3p l\u1EC7"});let O=Buffer.from(String(d.headers["x-pan-test-token"]||"")),F=Buffer.from(n);if(O.length!==F.length||!EA(O,F))return f(403,{error:"Thi\u1EBFu token phi\xEAn"});if(!String(d.headers["content-type"]||"").startsWith("application/json"))return f(415,{error:"C\u1EA7n application/json"});let Q=[],Z=0;d.on("data",V=>{Z+=V.length,Z>qg?(f(413,{error:"Qu\xE1 l\u1EDBn"}),d.destroy()):Q.push(V)}),d.on("end",()=>{if(Z>qg)return;let V;try{V=JSON.parse(Buffer.concat(Q).toString("utf8")||"{}")}catch{return f(400,{error:"JSON sai"})}if(x==="/api/studio/publish"||x==="/api/studio/remove"){y(x==="/api/studio/publish"?"publish":"unpublish");return}if(N===l){let G=Ge(t),de=x==="/api/ai/run"?{...V,...Mg(G,ee(V.item))}:V;Bc(t,G.config.language,d,p,x,de).catch(g);return}Promise.resolve().then(()=>{let G=Ge(t);return un(G.config.language),N(V,G)}).then(G=>f(G.status,G.body)).catch(m)});return}if(d.method!=="GET"&&d.method!=="HEAD")return f(405,{error:"Ch\u1EC9 cho GET/POST"});if(x==="/api/studio"){y("studio");return}if(v){let N=Ge(t);Bc(t,N.config.language,d,p,x+w.search).catch(g);return}if(x==="/"||x==="/index.html"){let N=w.searchParams.get("lang")||e.lang||Ge(t).config.language,D=Fg("index.html").replace(/<head[^>]*>/,O=>`${O}<meta name="pantest-token" content="${n}"><meta name="panba-lang" content="${N==="en"?"en":"vi"}">`);return h(200,D,ca["index.html"].type)}let A=/^\/ui\/([a-z0-9.]+)$/.exec(x);if(A&&ca[A[1]])return h(200,Fg(A[1]),ca[A[1]].type);if(x==="/favicon.ico")return h(204,"","image/x-icon");if(x==="/api/index")return f(200,NA(Ge(t)));if(x==="/view/doc"){let N=oa(aa(Ge(t),{results:w.searchParams.get("results")==="1",codes:w.searchParams.get("codes")==="1"}));return p.writeHead(200,{"Content-Type":"text/html; charset=utf-8","X-Content-Type-Options":"nosniff","Referrer-Policy":"no-referrer","Cache-Control":"no-store","Content-Security-Policy":a}),p.end(d.method==="HEAD"?void 0:N)}if(x==="/api/check"){let N=Ge(t);return f(200,{findings:xs(N,jg(N))})}return f(404,{error:"Kh\xF4ng c\xF3"})}catch(b){return m(b)}});return u.on("close",()=>Dg()),Object.assign(u,{token:n,root:t})}var $g,ca,Fc,qc,qg,Ug,ee,Fn,Kg=Se(()=>{"use strict";S();qn();Nn();xr();wr();ti();Zr();_n();Bg();$g=ut.dirname(_A(import.meta.url)),ca={"index.html":{file:"index.html",type:"text/html; charset=utf-8"},"tokens.css":{file:"tokens.css",type:"text/css; charset=utf-8"},"shell.js":{file:"shell.browser.js",type:"text/javascript; charset=utf-8"},"i18n.js":{file:"i18n.browser.js",type:"text/javascript; charset=utf-8"},"app.js":{file:"app.browser.js",type:"text/javascript; charset=utf-8"},"assist.js":{file:"assist.browser.js",type:"text/javascript; charset=utf-8"},"edit.js":{file:"edit.browser.js",type:"text/javascript; charset=utf-8"}};Fc="default-src 'none'; style-src 'unsafe-inline'; img-src 'self' data:; base-uri 'none'; form-action 'none'; frame-ancestors 'self'",qc="default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'self'; font-src 'self'; frame-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'",qg=24*1024*1024,Ug=e=>(e??[]).filter(t=>/^[a-z][a-z0-9+.-]*:$/.test(t)||/^https?:\/\/[A-Za-z0-9.-]+(:\d+)?$/.test(t)),ee=e=>typeof e=="string"?e:void 0,Fn=e=>Array.isArray(e)?e.map(String).map(t=>t.trim()).filter(Boolean):void 0});var Vg={};ii(Vg,{buildBundle:()=>RA});function OA(e,t,n){let r=Jr[n],i=yr(e,tn()),s=[`# ${e.code} \xB7 ${e.title}`,""],a=[e.covers.length?`- ${r.functions}${e.covers.join(", ")}`:"",e.useCases.length?`- ${r.useCase}${e.useCases.join(", ")}`:"",e.preconditions?`- ${r.pre}${e.preconditions.replace(/\n+/g," ")}`:"",`- ${r.sumHead[2]}: ${i.passed}/${i.total} \xB7 ${r.sumHead[3]}: ${i.failed} \xB7 ${r.sumHead[6]}: ${i["not-run"]}`].filter(Boolean);s.push(...a,""),e.description.trim()&&s.push(e.description.trim(),"");let o=t.modules.find(l=>l.code===e.module);o?.commonSteps.trim()&&s.push(`**${r.commonSteps}**`,"",o.commonSteps.trim(),"");let c=sa(e,{results:!0,codes:!0},r,n);if(!c.rows.length)s.push(r.noCases,"");else{s.push("| "+c.head.join(" | ")+" |","|"+c.head.map(()=>" --- |").join(""));for(let l of c.rows)s.push("| "+l.map(IA).join(" | ")+" |");s.push("")}return s.join(`
5366
+ `)}function RA(e){let t=e.config.language==="en"?"en":"vi",n=Jr[t],r=Ve(e.root,e.config.ba),i=Pn(e,r?bt(r):null),s={},a=[`# ${t==="en"?"Generated by \xABpan test publish\xBB \u2014 do not edit; the test document repo is the source.":"Sinh b\u1EDFi \xABpan test publish\xBB \u2014 \u0111\u1EEBng s\u1EEDa tay; ngu\u1ED3n l\xE0 repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED."}`,`title: ${De(e.config.title)}`,`locale: ${t}`,"theme: classic","layout: document","sections:"],o=n.sumHead,c=i.modules.map(h=>[`${h.code} \xB7 ${h.title}`,h.count.total,h.count.passed,h.count.failed,h.count.blocked,h.count.skipped,h.count["not-run"],zg(h.count.passed,h.count.total)]);c.push([`**${n.total}**`,i.all.total,i.all.passed,i.all.failed,i.all.blocked,i.all.skipped,i.all["not-run"],zg(i.all.passed,i.all.total)]),s["content/tong-hop/tong-hop.md"]=[`# ${n.sumTitle}`,"","| "+o.join(" | ")+" |","|"+o.map(()=>" --- |").join(""),...c.map(h=>"| "+h.join(" | ")+" |"),"",...i.coverage?[`${t==="en"?"BA function coverage":"\u0110\u1ED9 ph\u1EE7 ch\u1EE9c n\u0103ng t\xE0i li\u1EC7u BA"}: ${i.coverage.covered}/${i.coverage.functions}`,""]:[]].join(`
5367
+ `),a.push(` - id: ${De("tong-hop")}`,` title: ${De(n.sumTitle)}`," lessons:",` - id: ${De("tong-hop")}`,` title: ${De(n.sumTitle)}`," type: article",` src: ${De("content/tong-hop/tong-hop.md")}`);let l=1,u=new Set(["tong-hop"]),d=h=>{let f=h;for(let m=2;u.has(f);m++)f=`${h}-${m}`;return u.add(f),f};return[...e.modules].sort((h,f)=>h.order-f.order).forEach((h,f)=>{let m=e.suites.filter(y=>y.module===h.code&&y.status!=="deleted").sort((y,T)=>(h.suites.indexOf(y.code)+1||1e9)-(h.suites.indexOf(T.code)+1||1e9)||y.code.localeCompare(T.code));if(!m.length)return;let g=d(Gg(h.code));a.push(` - id: ${De(g)}`,` title: ${De(`${f+1}. ${h.title}`)}`," lessons:");for(let y of m){let T=d(Gg(y.code)),b=`content/${g}/${T}.md`;s[b]=OA(y,e,t),a.push(` - id: ${De(T)}`,` title: ${De(`${y.code} \xB7 ${y.title}`)}`," type: article",` src: ${De(b)}`,` code: ${De(y.code)}`,` module: ${De(h.code)}`),l++}}),s["handover.yaml"]=a.join(`
5368
5368
  `)+`
5369
- `,{title:e.config.title,language:t,ba:r,lessons:l,files:s}}var Me,Gg,IA,zg,Xg=Se(()=>{"use strict";S();Nn();xr();Zr();Me=e=>JSON.stringify(e),Gg=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/Đ/g,"D").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"muc",IA=e=>e.map(t=>t.replace(/\|/g,"\\|")).join("<br>")||" ",zg=(e,t)=>t?`${Math.round(e/t*100)}%`:"\u2014"});S();S();qn();import da from"node:fs";import At from"node:path";S();si();fn();_n();Nn();wr();xr();Zr();ti();var LA=`pan-test doc \u2014 t\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED
5369
+ `,{title:e.config.title,language:t,ba:r,lessons:l,files:s}}var De,Gg,IA,zg,Xg=Se(()=>{"use strict";S();Nn();xr();Zr();De=e=>JSON.stringify(e),Gg=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/Đ/g,"D").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"muc",IA=e=>e.map(t=>t.replace(/\|/g,"\\|")).join("<br>")||" ",zg=(e,t)=>t?`${Math.round(e/t*100)}%`:"\u2014"});S();S();qn();import da from"node:fs";import At from"node:path";S();si();fn();_n();Nn();wr();xr();Zr();ti();var LA=`pan-test doc \u2014 t\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED
5370
5370
 
5371
5371
  doc init [th\u01B0 m\u1EE5c] --title <t\xEAn> [--ba <\u0111\u01B0\u1EDDng d\u1EABn repo BA>] [--lang vi|en]
5372
5372
  doc module add <PH> --title <t\xEAn>
@@ -5387,7 +5387,7 @@ th,td{border:1px solid #555;padding:4px 6px;vertical-align:top;text-align:left;o
5387
5387
  xu\u1EA5t t\xE0i li\u1EC7u (m\u1EB7c \u0111\u1ECBnh: b\u1EA3n b\xE0n giao DOCX v\xE0o exports/); --results k\xE8m k\u1EBFt qu\u1EA3 test
5388
5388
  doc ui [--port <n>] [--no-open] [--json] [--lang vi|en] m\u1EDF app so\u1EA1n t\xE0i li\u1EC7u ki\u1EC3m th\u1EED tr\xEAn tr\xECnh duy\u1EC7t
5389
5389
 
5390
- Chung: --dir <repo> (m\u1EB7c \u0111\u1ECBnh: th\u01B0 m\u1EE5c hi\u1EC7n t\u1EA1i, d\xF2 ng\u01B0\u1EE3c l\xEAn t\u1EDBi .pantest.yaml)`,MA=`pan-test doc \u2014 test case documents
5390
+ Chung: --dir <repo> (m\u1EB7c \u0111\u1ECBnh: th\u01B0 m\u1EE5c hi\u1EC7n t\u1EA1i, d\xF2 ng\u01B0\u1EE3c l\xEAn t\u1EDBi .pantest.yaml)`,DA=`pan-test doc \u2014 test case documents
5391
5391
 
5392
5392
  doc init [dir] --title <name> [--ba <BA repo path>] [--lang vi|en]
5393
5393
  doc module add <MOD> --title <name>
@@ -5404,14 +5404,14 @@ th,td{border:1px solid #555;padding:4px 6px;vertical-align:top;text-align:left;o
5404
5404
  doc list [--json] \xB7 doc check [--json] \xB7 doc summary [--json] \xB7 doc bundle (JSON for \xABpan test publish\xBB)
5405
5405
  doc ui [--port <n>] [--no-open] [--json] [--lang vi|en] open the test document app
5406
5406
 
5407
- Common: --dir <repo> (default: current folder, searching up to .pantest.yaml)`,Yg=()=>U(LA,MA);function DA(e){let t=[],n={};for(let r=0;r<e.length;r++){let i=e[r];if(i.startsWith("--")){let s=i.indexOf("=");if(s>0)n[i.slice(2,s)]=i.slice(s+1);else{let a=e[r+1];a!==void 0&&!a.startsWith("--")?(n[i.slice(2)]=a,r++):n[i.slice(2)]=!0}}else t.push(i)}return{pos:t,opt:n}}var W=e=>typeof e=="string"?e:void 0,ni=e=>W(e)?.split(",").map(t=>t.trim()).filter(Boolean),fe=e=>W(e)?.replace(/\\n/g,`
5408
- `);function Hc(e){let t=W(e);if(t!==void 0){if(!hn.includes(t))throw new K(`--priority ph\u1EA3i l\xE0 ${hn.join(" | ")}.`);return t}}function Ze(e){let t=W(e.dir)??process.cwd(),n=ls(t);if(!n)throw new K(U(`Kh\xF4ng th\u1EA5y repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (.pantest.yaml) t\u1EEB ${At.resolve(t)}. T\u1EA1o b\u1EB1ng: pan-test doc init`,`No test document repo (.pantest.yaml) found from ${At.resolve(t)}. Create one with: pan-test doc init`));let r=Ge(n);return un(r.config.language),r}var BA={"not-run":"Ch\u01B0a test",passed:"\u0110\u1EA1t",failed:"Kh\xF4ng \u0111\u1EA1t",blocked:"B\u1ECB ch\u1EB7n",skipped:"B\u1ECF qua"};function Jg(e){return U(`${e.total} t\xECnh hu\u1ED1ng \xB7 \u0111\u1EA1t ${e.passed} \xB7 kh\xF4ng \u0111\u1EA1t ${e.failed} \xB7 b\u1ECB ch\u1EB7n ${e.blocked} \xB7 b\u1ECF qua ${e.skipped} \xB7 ch\u01B0a test ${e["not-run"]}`,`${e.total} test case(s) \xB7 ${e.passed} passed \xB7 ${e.failed} failed \xB7 ${e.blocked} blocked \xB7 ${e.skipped} skipped \xB7 ${e["not-run"]} not run`)}async function Qg(e){let{pos:t,opt:n}=DA(e);typeof n.lang=="string"?un(n.lang,{pin:!0}):process.env.PANAUTO_LANG&&un(process.env.PANAUTO_LANG,{pin:!0});let[r,i,s]=t,a=n.json===!0,o=(c,l)=>console.log(a?JSON.stringify(c,null,2):l);try{switch(r){case void 0:case"help":return console.log(Yg()),r?0:1;case"ui":{let{createDocServer:c}=await Promise.resolve().then(()=>(Kg(),Wg)),l=W(n.embed)?.split(",").map(f=>f.trim()).filter(Boolean),u=c({start:W(n.dir)??process.cwd(),...W(n.lang)??process.env.PANAUTO_LANG?{lang:W(n.lang)??process.env.PANAUTO_LANG}:{},...l?{embed:l}:{}}),d=Number(W(n.port)??0)||0;await new Promise((f,m)=>{u.once("error",m),u.listen(d,"127.0.0.1",()=>f())});let h=`http://127.0.0.1:${u.address().port}/`;if(console.log(a?JSON.stringify({event:"listening",url:h,root:u.root}):`Pan Test \u2014 t\xE0i li\u1EC7u ki\u1EC3m th\u1EED: ${h}
5407
+ Common: --dir <repo> (default: current folder, searching up to .pantest.yaml)`,Yg=()=>U(LA,DA);function MA(e){let t=[],n={};for(let r=0;r<e.length;r++){let i=e[r];if(i.startsWith("--")){let s=i.indexOf("=");if(s>0)n[i.slice(2,s)]=i.slice(s+1);else{let a=e[r+1];a!==void 0&&!a.startsWith("--")?(n[i.slice(2)]=a,r++):n[i.slice(2)]=!0}}else t.push(i)}return{pos:t,opt:n}}var W=e=>typeof e=="string"?e:void 0,ni=e=>W(e)?.split(",").map(t=>t.trim()).filter(Boolean),fe=e=>W(e)?.replace(/\\n/g,`
5408
+ `);function Hc(e){let t=W(e);if(t!==void 0){if(!hn.includes(t))throw new K(`--priority ph\u1EA3i l\xE0 ${hn.join(" | ")}.`);return t}}function Ze(e){let t=W(e.dir)??process.cwd(),n=ls(t);if(!n)throw new K(U(`Kh\xF4ng th\u1EA5y repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (.pantest.yaml) t\u1EEB ${At.resolve(t)}. T\u1EA1o b\u1EB1ng: pan-test doc init`,`No test document repo (.pantest.yaml) found from ${At.resolve(t)}. Create one with: pan-test doc init`));let r=Ge(n);return un(r.config.language),r}var BA={"not-run":"Ch\u01B0a test",passed:"\u0110\u1EA1t",failed:"Kh\xF4ng \u0111\u1EA1t",blocked:"B\u1ECB ch\u1EB7n",skipped:"B\u1ECF qua"};function Jg(e){return U(`${e.total} t\xECnh hu\u1ED1ng \xB7 \u0111\u1EA1t ${e.passed} \xB7 kh\xF4ng \u0111\u1EA1t ${e.failed} \xB7 b\u1ECB ch\u1EB7n ${e.blocked} \xB7 b\u1ECF qua ${e.skipped} \xB7 ch\u01B0a test ${e["not-run"]}`,`${e.total} test case(s) \xB7 ${e.passed} passed \xB7 ${e.failed} failed \xB7 ${e.blocked} blocked \xB7 ${e.skipped} skipped \xB7 ${e["not-run"]} not run`)}async function Qg(e){let{pos:t,opt:n}=MA(e);typeof n.lang=="string"?un(n.lang,{pin:!0}):process.env.PANAUTO_LANG&&un(process.env.PANAUTO_LANG,{pin:!0});let[r,i,s]=t,a=n.json===!0,o=(c,l)=>console.log(a?JSON.stringify(c,null,2):l);try{switch(r){case void 0:case"help":return console.log(Yg()),r?0:1;case"ui":{let{createDocServer:c}=await Promise.resolve().then(()=>(Kg(),Wg)),l=W(n.embed)?.split(",").map(f=>f.trim()).filter(Boolean),u=c({start:W(n.dir)??process.cwd(),...W(n.lang)??process.env.PANAUTO_LANG?{lang:W(n.lang)??process.env.PANAUTO_LANG}:{},...l?{embed:l}:{}}),d=Number(W(n.port)??0)||0;await new Promise((f,m)=>{u.once("error",m),u.listen(d,"127.0.0.1",()=>f())});let h=`http://127.0.0.1:${u.address().port}/`;if(console.log(a?JSON.stringify({event:"listening",url:h,root:u.root}):`Pan Test \u2014 t\xE0i li\u1EC7u ki\u1EC3m th\u1EED: ${h}
5409
5409
  repo: ${u.root}
5410
5410
  Ctrl+C \u0111\u1EC3 d\u1EEBng.`),n["no-open"]!==!0&&!a){let{spawn:f}=await import("node:child_process"),m=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",g=process.platform==="win32"?["/c","start","",h]:[h];try{f(m,g,{stdio:"ignore",detached:!0}).unref()}catch{}}return n.lifeline===!0&&process.stdin.on("end",()=>process.exit(0)).resume(),await new Promise(()=>{}),0}case"init":{let c=At.resolve(i??W(n.dir)??"."),l=W(n.title)??At.basename(c),u=(W(n.lang)??process.env.PANAUTO_LANG)==="en"?"en":"vi",d=vt(da.existsSync(c)?c:process.cwd()),p=Ku(c,{title:l,language:u,...W(n.ba)?{ba:W(n.ba)}:{},me:{id:d,name:d}});return o(p,U(`\u2713 \u0110\xE3 t\u1EA1o repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED \xAB${p.title}\xBB \u1EDF ${c}${p.ba?` (repo BA: ${p.ba})`:""}.
5411
5411
  Ti\u1EBFp: pan-test doc module add <PH> --title <t\xEAn ph\xE2n h\u1EC7>`,`\u2713 Created test document repo \xAB${p.title}\xBB in ${c}${p.ba?` (BA repo: ${p.ba})`:""}.
5412
5412
  Next: pan-test doc module add <MOD> --title <module name>`)),0}case"module":{if(i!=="add"||!s)throw new K("D\xF9ng: pan-test doc module add <PH> --title <t\xEAn>");let c=Ze(n),l=hs(c,s,W(n.title)??s);return o(l,U(`\u2713 \u0110\xE3 th\xEAm ph\xE2n h\u1EC7 ${l.code} \xB7 ${l.title}`,`\u2713 Added module ${l.code} \xB7 ${l.title}`)),0}case"new":{if(!i)throw new K("D\xF9ng: pan-test doc new <PH> --title <t\xEAn k\u1ECBch b\u1EA3n>");let c=Ze(n),l=W(n.kind);if(l&&l!=="functional"&&l!=="non-functional")throw new K("--kind ph\u1EA3i l\xE0 functional | non-functional.");let u=Hc(n.priority),d=fs(c,{module:i,title:W(n.title)??"",...l?{kind:l}:{},...ni(n.covers)?{covers:ni(n.covers)}:{},...ni(n.uc)?{useCases:ni(n.uc)}:{},...u?{priority:u}:{},...fe(n.preconditions)?{preconditions:fe(n.preconditions)}:{},...W(n.after)?{after:W(n.after)}:{},avoid:Ft(c.root)});return o(d,U(`\u2713 \u0110\xE3 t\u1EA1o k\u1ECBch b\u1EA3n ${d.code} \xB7 ${d.title} (${d.file})`,`\u2713 Created test suite ${d.code} \xB7 ${d.title} (${d.file})`)),0}case"case":{let c=Ze(n);if(i==="add"&&s){let l=Hc(n.priority),u=gs(c,s,{case:fe(n.case)??"",...fe(n.steps)?{steps:fe(n.steps)}:{},...fe(n.expected)?{expected:fe(n.expected)}:{},...fe(n.requirement)?{requirement:fe(n.requirement)}:{},...l?{priority:l}:{},...W(n.tag)?{tag:W(n.tag)}:{}},{...W(n.after)?{after:W(n.after)}:{},avoid:Ft(c.root)});return o(u,U(`\u2713 \u0110\xE3 th\xEAm t\xECnh hu\u1ED1ng ${u.code} v\xE0o ${s}`,`\u2713 Added test case ${u.code} to ${s}`)),0}if(i==="edit"&&s){let l=Hc(n.priority),u=vs(c,s,{...fe(n.case)!==void 0?{case:fe(n.case)}:{},...fe(n.steps)!==void 0?{steps:fe(n.steps)}:{},...fe(n.expected)!==void 0?{expected:fe(n.expected)}:{},...fe(n.requirement)!==void 0?{requirement:fe(n.requirement)}:{},...l?{priority:l}:{},...W(n.tag)!==void 0?{tag:W(n.tag)}:{}});return o(u,U(`\u2713 \u0110\xE3 s\u1EEDa t\xECnh hu\u1ED1ng ${u.code}`,`\u2713 Updated test case ${u.code}`)),0}if(i==="rm"&&s){let l=ws(c,s,W(n.reason)??"");return o(l,U(`\u2713 \u0110\xE3 xo\xE1 (m\u1EC1m) t\xECnh hu\u1ED1ng ${l.code} \u2014 m\xE3 gi\u1EEF l\u1EA1i, kh\xF4ng d\xF9ng l\u1EA1i.`,`\u2713 Soft-deleted test case ${l.code} \u2014 the code is kept and never reused.`)),0}throw new K("D\xF9ng: pan-test doc case add <KB-\u2026> | edit <TC-\u2026> | rm <TC-\u2026>")}case"result":{if(!i||!s)throw new K(`D\xF9ng: pan-test doc result <TC-\u2026> <${et.join("|")}>`);let c=Ze(n),l=ys(c,i,{status:s,...fe(n.actual)?{actual:fe(n.actual)}:{},...W(n.env)?{env:W(n.env)}:{},...W(n.bug)?{bug:W(n.bug)}:{},...W(n.by)?{by:W(n.by)}:{}});return o(l,`\u2713 ${l.code}: ${U(BA[l.result?.status??"not-run"],l.result?.status??"not-run")}`),0}case"export":{let{exportDoc:c,FORMATS:l}=await Promise.resolve().then(()=>(Zr(),wg)),u=Ze(n),d=ni(n.format)??["docx"];if(d.filter(f=>!l.includes(f)).length)throw new K(`--format ch\u1EC9 nh\u1EADn ${l.join(", ")}.`);let h=await c(u,{formats:d,results:n.results===!0,codes:n.codes===!0,...W(n.out)?{out:W(n.out)}:{}});return o({files:h},h.map(f=>`\u2713 ${f}`).join(`
5413
- `)),0}case"import":{if(!i||!W(n.module))throw new K("D\xF9ng: pan-test doc import <t\u1EC7p.feature | th\u01B0 m\u1EE5c> --module <PH> [--json]");let{featureFiles:c,importFeature:l}=await Promise.resolve().then(()=>(ti(),Dc)),u=Ze(n),d=At.resolve(i);if(!da.existsSync(d))throw new K(`Kh\xF4ng th\u1EA5y ${d}.`);let p=da.statSync(d).isDirectory()?c(d):[d];if(!p.length)throw new K(`Kh\xF4ng c\xF3 t\u1EC7p .feature n\xE0o trong ${d}.`);let h=Ft(u.root),f=p.map(m=>({file:m,...l(u,da.readFileSync(m,"utf8"),{file:At.relative(u.root,m).split(At.sep).join("/"),module:W(n.module),avoid:h})}));return o(f,f.map(m=>`\u2713 ${At.relative(process.cwd(),m.file)} \u2192 ${m.suite}${m.created?" (m\u1EDBi)":""}: th\xEAm ${m.added.length}, c\u1EADp nh\u1EADt ${m.updated.length}${m.missing.length?`, ${m.missing.length} t\xECnh hu\u1ED1ng kh\xF4ng c\xF2n trong t\u1EC7p (gi\u1EEF nguy\xEAn, xem l\u1EA1i)`:""}${m.untagged?`, ${m.untagged} k\u1ECBch b\u1EA3n kh\xF4ng c\xF3 tag \u0111\u1ECBnh danh (kh\u1EDBp theo t\xEAn)`:""}`).join(`
5414
- `)),0}case"results":{if(!i)throw new K("D\xF9ng: pan-test doc results <results.json | th\u01B0 m\u1EE5c b\xE1o c\xE1o> [--env UAT] [--json]");let{applyRunResults:c,readRunResults:l}=await Promise.resolve().then(()=>(ti(),Dc)),u=Ze(n),d=c(u,l(At.resolve(i)),{...W(n.env)?{env:W(n.env)}:{}}),p=h=>d.applied.filter(f=>f.status===h).length;return o(d,U(`\u2713 Ghi k\u1EBFt qu\u1EA3 ${d.applied.length} t\xECnh hu\u1ED1ng: \u0111\u1EA1t ${p("passed")}, kh\xF4ng \u0111\u1EA1t ${p("failed")}, b\u1ECF qua ${p("skipped")}.`,`\u2713 Recorded ${d.applied.length} result(s): ${p("passed")} passed, ${p("failed")} failed, ${p("skipped")} skipped.`)+(d.notRun.length?`
5413
+ `)),0}case"import":{if(!i||!W(n.module))throw new K("D\xF9ng: pan-test doc import <t\u1EC7p.feature | th\u01B0 m\u1EE5c> --module <PH> [--json]");let{featureFiles:c,importFeature:l}=await Promise.resolve().then(()=>(ti(),Mc)),u=Ze(n),d=At.resolve(i);if(!da.existsSync(d))throw new K(`Kh\xF4ng th\u1EA5y ${d}.`);let p=da.statSync(d).isDirectory()?c(d):[d];if(!p.length)throw new K(`Kh\xF4ng c\xF3 t\u1EC7p .feature n\xE0o trong ${d}.`);let h=Ft(u.root),f=p.map(m=>({file:m,...l(u,da.readFileSync(m,"utf8"),{file:At.relative(u.root,m).split(At.sep).join("/"),module:W(n.module),avoid:h})}));return o(f,f.map(m=>`\u2713 ${At.relative(process.cwd(),m.file)} \u2192 ${m.suite}${m.created?" (m\u1EDBi)":""}: th\xEAm ${m.added.length}, c\u1EADp nh\u1EADt ${m.updated.length}${m.missing.length?`, ${m.missing.length} t\xECnh hu\u1ED1ng kh\xF4ng c\xF2n trong t\u1EC7p (gi\u1EEF nguy\xEAn, xem l\u1EA1i)`:""}${m.untagged?`, ${m.untagged} k\u1ECBch b\u1EA3n kh\xF4ng c\xF3 tag \u0111\u1ECBnh danh (kh\u1EDBp theo t\xEAn)`:""}`).join(`
5414
+ `)),0}case"results":{if(!i)throw new K("D\xF9ng: pan-test doc results <results.json | th\u01B0 m\u1EE5c b\xE1o c\xE1o> [--env UAT] [--json]");let{applyRunResults:c,readRunResults:l}=await Promise.resolve().then(()=>(ti(),Mc)),u=Ze(n),d=c(u,l(At.resolve(i)),{...W(n.env)?{env:W(n.env)}:{}}),p=h=>d.applied.filter(f=>f.status===h).length;return o(d,U(`\u2713 Ghi k\u1EBFt qu\u1EA3 ${d.applied.length} t\xECnh hu\u1ED1ng: \u0111\u1EA1t ${p("passed")}, kh\xF4ng \u0111\u1EA1t ${p("failed")}, b\u1ECF qua ${p("skipped")}.`,`\u2713 Recorded ${d.applied.length} result(s): ${p("passed")} passed, ${p("failed")} failed, ${p("skipped")} skipped.`)+(d.notRun.length?`
5415
5415
  ${d.notRun.length} t\xECnh hu\u1ED1ng c\xF3 tag nh\u01B0ng l\u1EA7n ch\u1EA1y kh\xF4ng c\xF3: ${d.notRun.slice(0,10).join(", ")}${d.notRun.length>10?"\u2026":""}`:"")+(d.unknownTags.length?`
5416
5416
  Tag trong l\u1EA7n ch\u1EA1y ch\u01B0a c\xF3 trong t\xE0i li\u1EC7u: ${d.unknownTags.slice(0,10).join(", ")}${d.unknownTags.length>10?"\u2026":""}`:"")),0}case"list":{let c=Ze(n),l=c.modules.map(d=>({code:d.code,title:d.title,suites:en(c,d.code).map(p=>({code:p.code,title:p.title,kind:p.kind,cases:p.cases.filter(h=>!h.deleted).map(h=>({code:h.code,case:h.case,status:h.result?.status??"not-run"}))}))})),u=[`${c.config.title}`];return l.forEach((d,p)=>{u.push(`${p+1}. ${d.code} \xB7 ${d.title}`),d.suites.forEach((h,f)=>{let m=h.cases.filter(g=>g.status==="passed").length;u.push(` ${p+1}.${f+1} ${h.code} \xB7 ${h.title} [${m}/${h.cases.length} ${U("\u0111\u1EA1t","passed")}]`)})}),o(l,u.join(`
5417
5417
  `)),0}case"check":{let c=Ze(n),l=Ve(c.root,c.config.ba),u=xs(c,l?bt(l):null),d=u.filter(f=>f.severity==="error").length,p=u.filter(f=>f.severity==="warn").length,h=u.length?u.map(f=>`${f.severity==="error"?"\u2717":f.severity==="warn"?"!":"i"} ${f.rule} ${f.message}${f.file?` (${f.file})`:""}`).join(`