@pan-stack/test 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __panCreateRequire } from 'node:module'; const require = __panCreateRequire(import.meta.url);
3
- var Gg=Object.create;var aa=Object.defineProperty;var zg=Object.getOwnPropertyDescriptor;var Vg=Object.getOwnPropertyNames;var Xg=Object.getPrototypeOf,Yg=Object.prototype.hasOwnProperty;var Jr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ae=(e,t)=>()=>(e&&(t=e(e=0)),t);var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),oa=(e,t)=>{for(var n in t)aa(e,n,{get:t[n],enumerable:!0})},Jg=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Vg(t))!Yg.call(e,i)&&i!==n&&aa(e,i,{get:()=>t[i],enumerable:!(r=zg(t,i))||r.enumerable});return e};var Qg=(e,t,n)=>(n=e!=null?Gg(Xg(e)):{},Jg(t||!e||!e.__esModule?aa(n,"default",{value:e,enumerable:!0}):n,e));var R,S=Ae(()=>{R={"index.html":`<!doctype html>
3
+ var nb=Object.create;var pa=Object.defineProperty;var rb=Object.getOwnPropertyDescriptor;var ib=Object.getOwnPropertyNames;var sb=Object.getPrototypeOf,ab=Object.prototype.hasOwnProperty;var ri=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Se=(e,t)=>()=>(e&&(t=e(e=0)),t);var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ii=(e,t)=>{for(var n in t)pa(e,n,{get:t[n],enumerable:!0})},ob=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ib(t))!ab.call(e,i)&&i!==n&&pa(e,i,{get:()=>t[i],enumerable:!(r=rb(t,i))||r.enumerable});return e};var lb=(e,t,n)=>(n=e!=null?nb(sb(e)):{},ob(t||!e||!e.__esModule?pa(n,"default",{value:e,enumerable:!0}):n,e));var R,S=Se(()=>{R={"index.html":`<!doctype html>
4
4
  <html lang="vi" data-theme="system">
5
5
  <head>
6
6
  <meta charset="utf-8">
@@ -3445,6 +3445,7 @@ tr.pb-flash > td { animation: pb-flash 1.2s ease-out 1 both; }
3445
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"});
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
+ 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)."});
3448
3449
  Object.assign(EN, { "B\u1EA3n b\xE0n giao \u2014 \u0111\xFAng m\u1EABu: T\xECnh hu\u1ED1ng | C\xE1c b\u01B0\u1EDBc | K\u1EBFt qu\u1EA3 mong \u0111\u1EE3i": "Handover copy \u2014 template columns: Test case | Steps | Expected result", "B\u1EA5m \xABTh\xEAm k\u1ECBch b\u1EA3n\xBB \u2014 m\u1ED7i k\u1ECBch b\u1EA3n \u1EE9ng v\u1EDBi m\u1ED9t ch\u1EE9c n\u0103ng / UC.": "Click \xABAdd test suite\xBB \u2014 one suite per function / use case.", "B\u1EA5m \xABTh\xEAm ph\xE2n h\u1EC7\xBB \u0111\u1EC3 b\u1EAFt \u0111\u1EA7u.": "Click \xABAdd module\xBB to start.", "B\u1EA5m \xABTh\xEAm ph\xE2n h\u1EC7\xBB \u0111\u1EC3 t\u1EA1o nh\xF3m ch\u1EE9c n\u0103ng \u0111\u1EA7u ti\xEAn.": "Click \xABAdd module\xBB to create the first function group.", "B\u1ECB ch\u1EB7n": "Blocked", "Cao": "High", "Ch\u01B0a c\xF3 k\u1ECBch b\u1EA3n": "No test suites yet", "Ch\u01B0a c\xF3 ph\xE2n h\u1EC7": "No modules yet", "Ch\u01B0a c\xF3 t\xECnh hu\u1ED1ng \u2014 b\u1EA5m \xABTh\xEAm t\xECnh hu\u1ED1ng\xBB.": "No test cases yet \u2014 click \xABAdd test case\xBB.", "Ch\u01B0a c\xF3 \u2014 b\u01B0\u1EDBc chu\u1EA9n b\u1ECB d\xF9ng chung cho m\u1ECDi k\u1ECBch b\u1EA3n c\u1EE7a ph\xE2n h\u1EC7 (\u0111\u0103ng nh\u1EADp, m\u1EDF c\xF4ng c\u1EE5\u2026).": "None yet \u2014 preparation shared by every suite of the module (sign in, open the tool\u2026).", "Ch\u01B0a ghi ch\u1EE9c n\u0103ng \u0111\u01B0\u1EE3c ki\u1EC3m": "No function linked yet", "Ch\u01B0a li\xEAn k\u1EBFt repo t\xE0i li\u1EC7u BA (kho\xE1 \xABba\xBB trong .pantest.yaml) \u2014 ch\u01B0a ki\u1EC3m \u0111\u01B0\u1EE3c \u0111\u1ED9 ph\u1EE7 ch\u1EE9c n\u0103ng.": "No BA document repo linked (\xABba\xBB in .pantest.yaml) \u2014 function coverage cannot be checked.", "Ch\u01B0a test": "Not run", "Ch\u1EA1y test": "Run tests", "Ch\u1ECDn k\u1EBFt qu\u1EA3 test": "Choose the test result", "Ch\u1ECDn m\u1ED9t k\u1ECBch b\u1EA3n \u0111\u1EC3 xem v\xE0 s\u1EEDa thu\u1ED9c t\xEDnh.": "Select a test suite to view and edit its properties.", "Ch\u1ECDn \xEDt nh\u1EA5t m\u1ED9t \u0111\u1ECBnh d\u1EA1ng.": "Choose at least one format.", "C\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n": "Steps", "C\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n chung": "Common steps", "C\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n chung \u2014 {m}": "Common steps \u2014 {m}", "D\xF9ng g\u1EA1ch \u0111\u1EA7u d\xF2ng \xAB- \xBB cho t\u1EEBng b\u01B0\u1EDBc.": "Use a \xAB- \xBB bullet for each step.", "Ghi k\u1EBFt qu\u1EA3 {t} t\xECnh hu\u1ED1ng: \u0111\u1EA1t {p}, kh\xF4ng \u0111\u1EA1t {f}.": "Recorded {t} test case results: {p} passed, {f} failed.", "G\xF5 m\xE3 ho\u1EB7c t\xEAn ch\u1EE9c n\u0103ng\u2026": "Type a function code or name\u2026", "Hi\u1EC7n m\xE3 t\xECnh hu\u1ED1ng (TC-\u2026)": "Show test case codes (TC-\u2026)", "H\u1EC7 th\u1ED1ng b\xE1o l\u1ED7i \u2026 / m\xE0n kh\xF4ng hi\u1EC7n \u2026": "The system shows error \u2026 / the screen does not open \u2026", "H\u1EC7 th\u1ED1ng \u2026": "The system \u2026", "Kh\xF4ng c\xF2n t\xECnh hu\u1ED1ng n\xE0o \u1EDF \u0111\xE2y.": "No test cases left here.", "Kh\xF4ng c\xF3 l\u1ED7i hay c\u1EA3nh b\xE1o.": "No errors or warnings.", "Kh\xF4ng c\xF3 t\xECnh hu\u1ED1ng \u1EDF tr\u1EA1ng th\xE1i n\xE0y.": "No test cases with this result.", "Kh\xF4ng ki\u1EC3m \u0111\u01B0\u1EE3c": "Could not run the checks", "Kh\xF4ng m\u1EDF \u0111\u01B0\u1EE3c t\xE0i li\u1EC7u ki\u1EC3m th\u1EED": "Could not open the test documents", "Kh\xF4ng th\xEAm \u0111\u01B0\u1EE3c": "Could not add", "Kh\xF4ng th\u1EA5y repo BA \xAB{p}\xBB \u2014 b\u1ECF qua ki\u1EC3m tham chi\u1EBFu v\xE0 \u0111\u1ED9 ph\u1EE7.": "BA repo \xAB{p}\xBB not found \u2014 reference and coverage checks skipped.", "Kh\xF4ng t\u1EA1o \u0111\u01B0\u1EE3c": "Could not create", "Kh\xF4ng \u0111\u1EA1t": "Failed", "Kh\xF4ng \u0111\u1EA1t: c\u1EA7n ghi k\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF.": "Failed: enter the actual result.", "Kh\xF4ng \u0111\u1ECDc \u0111\u01B0\u1EE3c repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED": "Could not read the test document repo", "Ki\u1EC3m tra t\xE0i li\u1EC7u ki\u1EC3m th\u1EED": "Check the test documents", "Ki\u1EC3u t\xE0i li\u1EC7u": "Document type", "K\xE8m k\u1EBFt qu\u1EA3 test": "With test results", "K\xE8m k\u1EBFt qu\u1EA3 test \u2014 th\xEAm c\u1ED9t K\u1EBFt qu\u1EA3, Ng\u01B0\u1EDDi test / ng\xE0y v\xE0 ph\u1EE5 l\u1EE5c t\u1ED5ng h\u1EE3p": "With test results \u2014 adds Result and Tester / date columns and a summary appendix", "K\u1EBFt qu\u1EA3 ch\u1EA1y t\u1EF1 \u0111\u1ED9ng (results.json)\u2026": "Automated run results (results.json)\u2026", "K\u1EBFt qu\u1EA3 mong \u0111\u1EE3i": "Expected result", "K\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF": "Actual result", "K\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF (b\u1EAFt bu\u1ED9c khi Kh\xF4ng \u0111\u1EA1t)": "Actual result (required when Failed)", "K\u1ECBch b\u1EA3n": "Test suite", "K\u1ECBch b\u1EA3n .feature (pan-test)\u2026": ".feature scenarios (pan-test)\u2026", "K\u1ECBch b\u1EA3n c\u1EA7n t\xEAn.": "The test suite needs a name.", "K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED": "Test scenario", "K\u1ECBch b\u1EA3n v\xE0 m\u1ECDi t\xECnh hu\u1ED1ng \u1EA9n kh\u1ECFi t\xE0i li\u1EC7u; t\u1EC7p v\xE0 m\xE3 gi\u1EEF l\u1EA1i.": "The suite and its test cases are hidden from the document; the file and codes are kept.", "Link l\u1ED7i": "Bug link", "L\u01B0u k\u1EBFt qu\u1EA3": "Save result", "L\u01B0u thu\u1ED9c t\xEDnh": "Save properties", "L\u1ECDc t\xECnh hu\u1ED1ng theo k\u1EBFt qu\u1EA3": "Filter test cases by result", "M\xE3 ch\u1EE9c n\u0103ng, c\xE1ch nhau b\u1EB1ng d\u1EA5u ph\u1EA9y": "Function codes, comma separated", "M\xE3 ph\xE2n h\u1EC7 (ch\u1EEF hoa / s\u1ED1, 2\u201312 k\xFD t\u1EF1)": "Module code (capitals / digits, 2\u201312 characters)", "M\xF4 t\u1EA3 / ghi ch\xFA": "Description / notes", "M\xF4 t\u1EA3 t\xECnh hu\u1ED1ng\u2026": "Describe the test case\u2026", "M\xF4i tr\u01B0\u1EDDng": "Environment", "M\u1ECDi ph\xE2n h\u1EC7": "All modules", "M\u1ECDi t\xECnh hu\u1ED1ng": "All test cases", "Ng\u01B0\u1EDDi t\u1EA1o": "Created by", "Phi ch\u1EE9c n\u0103ng": "Non-functional", "Ph\xE2n h\u1EC7 ch\u01B0a c\xF3 k\u1ECBch b\u1EA3n": "This module has no test suites yet", "Ph\xE2n h\u1EC7 \u0111ang ch\u1ECDn": "Current module", "Ph\u1EE7 ch\u1EE9c n\u0103ng (t\xE0i li\u1EC7u BA)": "Covered functions (BA documents)", "Ph\u1EE7:": "Covers:", "So\u1EA1n xong": "Done", "S\u1EEDa thu\u1ED9c t\xEDnh": "Edit properties", "Th\xEAm k\u1ECBch b\u1EA3n": "Add test suite", "Th\xEAm k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED": "Add a test suite", "Th\xEAm k\u1ECBch b\u1EA3n sau": "Add a test suite after", "Th\xEAm ph\xE2n h\u1EC7": "Add module", "Th\xEAm thao t\xE1c": "More actions", "Th\xEAm t\xECnh hu\u1ED1ng": "Add test case", "Th\u1EA5p": "Low", "Th\u1EF1c t\u1EBF:": "Actual:", "Trung b\xECnh": "Medium", "Tr\u01B0\u1EDBc": "Previous", "T\xE0i li\u1EC7u ki\u1EC3m th\u1EED": "Test documents", "T\xEAn ch\u1EE9c n\u0103ng / UC \u0111\u01B0\u1EE3c ki\u1EC3m": "Function / use case under test", "T\xEAn k\u1ECBch b\u1EA3n": "Suite name", "T\xEAn ph\xE2n h\u1EC7 / nh\xF3m ch\u1EE9c n\u0103ng": "Module / function group name", "T\xECnh hu\u1ED1ng": "Test case", "T\xECnh hu\u1ED1ng m\u1EDBi": "New test case", "T\xECnh hu\u1ED1ng \u1EA9n kh\u1ECFi t\xE0i li\u1EC7u; m\xE3 gi\u1EEF l\u1EA1i trong t\u1EC7p \u0111\u1EC3 kh\xF4ng b\u1ECB d\xF9ng l\u1EA1i.": "The test case is hidden from the document; its code stays in the file so it is never reused.", "T\u1EA1o": "Create", "T\u1ED5ng": "Total", "T\u1ED5ng h\u1EE3p": "Summary", "T\u1ED5ng h\u1EE3p k\u1EBFt qu\u1EA3 ki\u1EC3m th\u1EED": "Test results summary", "T\u1EF7 l\u1EC7 \u0111\u1EA1t": "Pass rate", "Xo\xE1": "Delete", "Xo\xE1 k\u1ECBch b\u1EA3n": "Delete test suite", "Xo\xE1 k\u1ECBch b\u1EA3n {code}?": "Delete test suite {code}?", "Xo\xE1 t\xECnh hu\u1ED1ng": "Delete test case", "Xo\xE1 t\xECnh hu\u1ED1ng {code}?": "Delete test case {code}?", "Xu\u1EA5t t\xE0i li\u1EC7u ki\u1EC3m th\u1EED": "Export the test documents", "Y\xEAu c\u1EA7u": "Requirement", "{m} t\xECnh hu\u1ED1ng kh\xF4ng c\xF2n trong t\u1EC7p \u2014 gi\u1EEF nguy\xEAn, xem l\u1EA1i.": "{m} test case(s) no longer in the file \u2014 kept, please review.", "{n} kh\xF4ng \u0111\u1EA1t": "{n} failed", "{n} tag ch\u01B0a c\xF3 trong t\xE0i li\u1EC7u.": "{n} tag(s) not in the documents yet.", "{p}/{t} \u0111\u1EA1t": "{p}/{t} passed", "{t} \xB7 \u0111\u1EA1t {p} \xB7 kh\xF4ng \u0111\u1EA1t {f} \xB7 ch\u01B0a test {n}": "{t} \xB7 {p} passed \xB7 {f} failed \xB7 {n} not run", "\u0110ang xu\u1EA5t\u2026": "Exporting\u2026", "\u0110i\u1EC1u ki\u1EC7n ti\xEAn quy\u1EBFt": "Preconditions", "\u0110i\u1EC1u ki\u1EC7n ti\xEAn quy\u1EBFt:": "Preconditions:", "\u0110\xE1nh d\u1EA5u so\u1EA1n xong": "Mark as done", "\u0110\xE1nh d\u1EA5u \u0111ang so\u1EA1n": "Mark as drafting", "\u0110\xE3 nh\u1EADp {f} t\u1EC7p: th\xEAm {a}, c\u1EADp nh\u1EADt {u} t\xECnh hu\u1ED1ng.": "Imported {f} file(s): {a} added, {u} updated test case(s).", "\u0110\xE3 test {d}/{t}": "Tested {d}/{t}", "\u0110\xE3 xu\u1EA5t:": "Exported:", "\u0110\u1EA1t": "Passed", "\u0110\u1EA1t / t\u1ED5ng t\xECnh hu\u1ED1ng": "Passed / total test cases", "\u0110\u1ED3ng b\u1ED9 d\u1EEF li\u1EC7u, Qu\u1EA3n tr\u1ECB\u2026": "Data sync, Administration\u2026", "\u0110\u1ED5i b\u1ED9 l\u1ECDc \u0111\u1EC3 xem l\u1EA1i c\xE1c t\xECnh hu\u1ED1ng kh\xE1c.": "Change the filter to see other test cases.", "\u0110\u1ED9 ph\u1EE7 ch\u1EE9c n\u0103ng t\xE0i li\u1EC7u BA: {c}/{f} ch\u1EE9c n\u0103ng c\xF3 k\u1ECBch b\u1EA3n.": "BA function coverage: {c}/{f} functions have test suites.", "\u01AFu ti\xEAn": "Priority", "\u01AFu ti\xEAn:": "Priority:", "B\u1ECF qua": "Skipped", "Sau": "Next", "K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED, k\u1EBFt qu\u1EA3, xu\u1EA5t b\xE0n giao": "Test scenarios, results, handover export", "K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED UAT": "UAT test scenarios" });
3449
3450
  var PATTERNS = [
3450
3451
  [/^(\\d{2}) \xB7 Kh\xF4ng gian ph\xE2n h\u1EC7$/, '$1 \xB7 Module workspace'], [/^(\\d{2}) \xB7 Ki\u1EC3m tra$/, '$1 \xB7 Checks'],
@@ -3600,6 +3601,7 @@ function mountUi() {
3600
3601
  { id: 'add-module', label: T('Th\xEAm ph\xE2n h\u1EC7'), icon: 'layers', kind: 'secondary', testid: 'add-module', onClick: () => newModuleDialog() },
3601
3602
  { id: 'import', label: T('Nh\u1EADp'), icon: 'upload', kind: 'secondary', testid: 'import', onClick: (e) => importMenu(e && e.currentTarget) },
3602
3603
  { id: 'export', label: T('Xu\u1EA5t'), icon: 'download', kind: 'secondary', testid: 'export', onClick: () => exportDialog() },
3604
+ { id: 'studio', label: T('Studio'), icon: 'upload', kind: 'secondary', testid: 'studio', onClick: () => studioDialog() },
3603
3605
  { id: 'reload', label: T('T\u1EA3i l\u1EA1i'), icon: 'refresh', kind: 'secondary', testid: 'reload', onClick: () => reload() },
3604
3606
  ],
3605
3607
  left: true, stickyHead: true,
@@ -4283,6 +4285,50 @@ async function renderCheck(el) {
4283
4285
  }
4284
4286
 
4285
4287
  // ---------------------------------------------------------------- ti\u1EC7n \xEDch
4288
+ // ---------------------------------------------------------------- Pan Studio: ph\xE1t h\xE0nh (ghi \u0111\xE8) / g\u1EE1 \u2014 qua \`pan test publish\`
4289
+ function studioDialog() {
4290
+ const body = h('div', { class: 'pb-stack', 'data-testid': 'studio-body' }, h('p', { class: 'pb-muted' }, T('\u0110ang ki\u1EC3m tra Pan Studio\u2026')));
4291
+ const status = h('div', { 'aria-live': 'polite', 'data-testid': 'studio-status' });
4292
+ let st = null;
4293
+ const draw = () => {
4294
+ if (st.cli === false) { body.replaceChildren(h('p', { 'data-testid': 'studio-cli' }, st.error || T('C\u1EA7n Pan CLI \u0111\u1EC3 ph\xE1t h\xE0nh l\xEAn Pan Studio.'))); return; }
4295
+ if (!st.login) { body.replaceChildren(h('p', { 'data-testid': 'studio-login' }, T('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.'))); return; }
4296
+ const link = st.web ? h('a', { href: st.web, target: '_blank', rel: 'noopener', 'data-testid': 'studio-web' }, T('M\u1EDF tr\xEAn Pan Studio')) : null;
4297
+ // replaceChildren(null) in ch\u1EEF \xABnull\xBB \u21D2 l\u1ECDc ph\u1EA7n tr\u1ED1ng
4298
+ body.replaceChildren(...[
4299
+ st.doc ? h('p', { 'data-testid': 'studio-doc' }, T('\u0110\xE3 ph\xE1t h\xE0nh: \xAB{t}\xBB \u2014 b\u1EA3n {r}.', { t: st.doc.title, r: st.doc.revision }), ' ', link)
4300
+ : h('p', { 'data-testid': 'studio-none' }, T('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.')),
4301
+ st.project ? null : h('p', { class: 'pb-small pb-muted' }, T('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.')),
4302
+ st.error ? h('p', { class: 'pb-small', style: { color: 'var(--pb-broken)' } }, st.error) : null,
4303
+ h('p', { class: 'pb-small pb-muted' }, T('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).')),
4304
+ ].filter(Boolean));
4305
+ };
4306
+ P.dialog({
4307
+ title: T('Pan Studio'), size: 'md', testid: 'studio-dialog', body: h('div', { class: 'pb-stack' }, body, status),
4308
+ actions: [
4309
+ { label: T('\u0110\xF3ng'), kind: 'ghost' },
4310
+ { label: T('G\u1EE1 kh\u1ECFi Studio'), kind: 'ghost', testid: 'studio-remove', onClick: () => {
4311
+ if (!st || !st.doc) return false;
4312
+ status.textContent = T('\u0110ang g\u1EE1\u2026');
4313
+ void write('api/studio/remove', {}).then(async (r) => { status.textContent = r ? T('\u0110\xE3 g\u1EE1 kh\u1ECFi Pan Studio.') : ''; await refresh(); });
4314
+ return false;
4315
+ } },
4316
+ { label: T('Ph\xE1t h\xE0nh'), kind: 'primary', testid: 'studio-publish', onClick: () => {
4317
+ if (!st || !st.login) return false;
4318
+ status.replaceChildren(h('p', { class: 'pb-muted' }, P.iconEl('loader', { size: 16 }), ' ' + T('\u0110ang ph\xE1t h\xE0nh\u2026')));
4319
+ void write('api/studio/publish', {}).then(async (r) => {
4320
+ if (!r) { status.textContent = ''; return; }
4321
+ status.replaceChildren(h('p', { 'data-testid': 'studio-done' }, T('\u0110\xE3 ph\xE1t h\xE0nh b\u1EA3n {r} ({n} b\xE0i, t\u1EA3i l\xEAn {u} t\u1EC7p).', { r: r.revision, n: r.lessons, u: r.uploaded }), ' ', h('a', { href: r.web, target: '_blank', rel: 'noopener' }, T('M\u1EDF tr\xEAn Pan Studio'))));
4322
+ await refresh();
4323
+ });
4324
+ return false;
4325
+ } },
4326
+ ],
4327
+ });
4328
+ const refresh = async () => { const r = await api('api/studio'); st = r.json || { login: false }; draw(); };
4329
+ void refresh();
4330
+ }
4331
+
4286
4332
  async function copyText(text, done) {
4287
4333
  try { await navigator.clipboard.writeText(text); P.toast(done, { kind: 'success' }); return; } catch { /* th\u1EED c\xE1ch c\u0169 */ }
4288
4334
  const ta = h('textarea', { style: { position: 'fixed', top: '0', left: '0', opacity: '0' } }); ta.value = text;
@@ -5126,171 +5172,171 @@ export async function api(path, body) {
5126
5172
  try { json = await res.json(); } catch { /* kh\xF4ng ph\u1EA3i JSON */ }
5127
5173
  return { status: res.status, ok: res.ok && json.ok !== false, json };
5128
5174
  }
5129
- `}});function dn(e,t={}){Hc&&!t.pin||(Uc=e==="en"?"en":"vi",t.pin&&(Hc=!0))}var Uc,Hc,j,Dn=Ae(()=>{"use strict";S();Uc="vi",Hc=!1;j=(e,t)=>Uc==="en"?t:e});var Je,jc,Wc,pn,Qr=Ae(()=>{"use strict";S();Je=["not-run","passed","failed","blocked","skipped"],jc=["functional","non-functional"],Wc=["drafting","done","deleted"],pn=["high","medium","low"]});function eb(){let e=globalThis.crypto;return e?.getRandomValues?e.getRandomValues(new Uint32Array(1))[0]/2**32:Math.random()}function un(e,t,n,r=eb){for(;;){let i="";for(let a=0;a<6;a++)i+=Kc[Math.floor(r()*Kc.length)];if(!/[A-Z]/.test(i))continue;let s=`${e}-${t}-${i}`;if(!n.has(s))return s}}var Kc,Zr,ei,ti,hn=Ae(()=>{"use strict";S();Kc="ABCDEFGHJKMNPQRSTUVWXYZ23456789",Zr=/^[A-Z][A-Z0-9]{1,11}$/,ei=/^KB-([A-Z][A-Z0-9]{1,11})-([A-Z0-9]{6})$/,ti=/^TC-([A-Z][A-Z0-9]{1,11})-([A-Z0-9]{6})$/});var V=B(xe=>{"use strict";S();var la=Symbol.for("yaml.alias"),Gc=Symbol.for("yaml.document"),ni=Symbol.for("yaml.map"),zc=Symbol.for("yaml.pair"),ca=Symbol.for("yaml.scalar"),ri=Symbol.for("yaml.seq"),pt=Symbol.for("yaml.node.type"),tb=e=>!!e&&typeof e=="object"&&e[pt]===la,nb=e=>!!e&&typeof e=="object"&&e[pt]===Gc,rb=e=>!!e&&typeof e=="object"&&e[pt]===ni,ib=e=>!!e&&typeof e=="object"&&e[pt]===zc,Vc=e=>!!e&&typeof e=="object"&&e[pt]===ca,sb=e=>!!e&&typeof e=="object"&&e[pt]===ri;function Xc(e){if(e&&typeof e=="object")switch(e[pt]){case ni:case ri:return!0}return!1}function ab(e){if(e&&typeof e=="object")switch(e[pt]){case la:case ni:case ca:case ri:return!0}return!1}var ob=e=>(Vc(e)||Xc(e))&&!!e.anchor;xe.ALIAS=la;xe.DOC=Gc;xe.MAP=ni;xe.NODE_TYPE=pt;xe.PAIR=zc;xe.SCALAR=ca;xe.SEQ=ri;xe.hasAnchor=ob;xe.isAlias=tb;xe.isCollection=Xc;xe.isDocument=nb;xe.isMap=rb;xe.isNode=ab;xe.isPair=ib;xe.isScalar=Vc;xe.isSeq=sb});var Bn=B(da=>{"use strict";S();var he=V(),Ne=Symbol("break visit"),Yc=Symbol("skip children"),Qe=Symbol("remove node");function ii(e,t){let n=Jc(t);he.isDocument(e)?mn(null,e.contents,n,Object.freeze([e]))===Qe&&(e.contents=null):mn(null,e,n,Object.freeze([]))}ii.BREAK=Ne;ii.SKIP=Yc;ii.REMOVE=Qe;function mn(e,t,n,r){let i=Qc(e,t,n,r);if(he.isNode(i)||he.isPair(i))return Zc(e,r,i),mn(e,i,n,r);if(typeof i!="symbol"){if(he.isCollection(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){let a=mn(s,t.items[s],n,r);if(typeof a=="number")s=a-1;else{if(a===Ne)return Ne;a===Qe&&(t.items.splice(s,1),s-=1)}}}else if(he.isPair(t)){r=Object.freeze(r.concat(t));let s=mn("key",t.key,n,r);if(s===Ne)return Ne;s===Qe&&(t.key=null);let a=mn("value",t.value,n,r);if(a===Ne)return Ne;a===Qe&&(t.value=null)}}return i}async function si(e,t){let n=Jc(t);he.isDocument(e)?await fn(null,e.contents,n,Object.freeze([e]))===Qe&&(e.contents=null):await fn(null,e,n,Object.freeze([]))}si.BREAK=Ne;si.SKIP=Yc;si.REMOVE=Qe;async function fn(e,t,n,r){let i=await Qc(e,t,n,r);if(he.isNode(i)||he.isPair(i))return Zc(e,r,i),fn(e,i,n,r);if(typeof i!="symbol"){if(he.isCollection(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){let a=await fn(s,t.items[s],n,r);if(typeof a=="number")s=a-1;else{if(a===Ne)return Ne;a===Qe&&(t.items.splice(s,1),s-=1)}}}else if(he.isPair(t)){r=Object.freeze(r.concat(t));let s=await fn("key",t.key,n,r);if(s===Ne)return Ne;s===Qe&&(t.key=null);let a=await fn("value",t.value,n,r);if(a===Ne)return Ne;a===Qe&&(t.value=null)}}return i}function Jc(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 Qc(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(he.isMap(t))return n.Map?.(e,t,r);if(he.isSeq(t))return n.Seq?.(e,t,r);if(he.isPair(t))return n.Pair?.(e,t,r);if(he.isScalar(t))return n.Scalar?.(e,t,r);if(he.isAlias(t))return n.Alias?.(e,t,r)}function Zc(e,t,n){let r=t[t.length-1];if(he.isCollection(r))r.items[e]=n;else if(he.isPair(r))e==="key"?r.key=n:r.value=n;else if(he.isDocument(r))r.contents=n;else{let i=he.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}da.visit=ii;da.visitAsync=si});var pa=B(td=>{"use strict";S();var ed=V(),lb=Bn(),cb={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},db=e=>e.replace(/[!,[\]{}]/g,t=>cb[t]),$n=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+db(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&&ed.isNode(t.contents)){let s={};lb.visit(t.contents,(a,o)=>{ed.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(`
5130
- `)}};$n.defaultYaml={explicit:!1,version:"1.2"};$n.defaultTags={"!!":"tag:yaml.org,2002:"};td.Directives=$n});var ai=B(Fn=>{"use strict";S();var nd=V(),pb=Bn();function ub(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 rd(e){let t=new Set;return pb.visit(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function id(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function hb(e,t){let n=[],r=new Map,i=null;return{onAnchor:s=>{n.push(s),i??(i=rd(e));let a=id(t,i);return i.add(a),a},setAnchors:()=>{for(let s of n){let a=r.get(s);if(typeof a=="object"&&a.anchor&&(nd.isScalar(a.node)||nd.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}}Fn.anchorIsValid=ub;Fn.anchorNames=rd;Fn.createNodeAnchors=hb;Fn.findNewAnchor=id});var ua=B(sd=>{"use strict";S();function qn(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=qn(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=qn(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=qn(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=qn(e,r,i,s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}return e.call(t,n,r)}sd.applyReviver=qn});var At=B(od=>{"use strict";S();var mb=V();function ad(e,t,n){if(Array.isArray(e))return e.map((r,i)=>ad(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!mb.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}od.toJS=ad});var oi=B(cd=>{"use strict";S();var fb=ua(),ld=V(),gb=At(),ha=class{constructor(t){Object.defineProperty(this,ld.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(!ld.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=gb.toJS(this,"",a);if(typeof i=="function")for(let{count:c,res:l}of a.anchors.values())i(l,c);return typeof s=="function"?fb.applyReviver(s,{"":o},"",o):o}};cd.NodeBase=ha});var Hn=B(dd=>{"use strict";S();var bb=ai(),vb=Bn(),gn=V(),wb=oi(),yb=At(),ma=class extends wb.NodeBase{constructor(t){super(gn.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=[],vb.visit(t,{Node:(s,a)=>{(gn.isAlias(a)||gn.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||(yb.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=li(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(bb.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 li(e,t,n){if(gn.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(gn.isCollection(t)){let r=0;for(let i of t.items){let s=li(e,i,n);s>r&&(r=s)}return r}else if(gn.isPair(t)){let r=li(e,t.key,n),i=li(e,t.value,n);return Math.max(r,i)}return 1}dd.Alias=ma});var de=B(fa=>{"use strict";S();var xb=V(),kb=oi(),Tb=At(),Sb=e=>!e||typeof e!="function"&&typeof e!="object",_t=class extends kb.NodeBase{constructor(t){super(xb.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:Tb.toJS(this.value,t,n)}toString(){return String(this.value)}};_t.BLOCK_FOLDED="BLOCK_FOLDED";_t.BLOCK_LITERAL="BLOCK_LITERAL";_t.PLAIN="PLAIN";_t.QUOTE_DOUBLE="QUOTE_DOUBLE";_t.QUOTE_SINGLE="QUOTE_SINGLE";fa.Scalar=_t;fa.isScalarValue=Sb});var Un=B(ud=>{"use strict";S();var Cb=Hn(),Wt=V(),pd=de(),Eb="tag:yaml.org,2002:";function Ab(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(Wt.isDocument(e)&&(e=e.contents),Wt.isNode(e))return e;if(Wt.isPair(e)){let d=n.schema[Wt.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 Cb.Alias(c.anchor);c={anchor:null,node:null},o.set(e,c)}t?.startsWith("!!")&&(t=Eb+t.slice(2));let l=Ab(e,t,a.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new pd.Scalar(e);return c&&(c.node=d),d}l=e instanceof Map?a[Wt.MAP]:Symbol.iterator in Object(e)?a[Wt.SEQ]:a[Wt.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 pd.Scalar(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}ud.createNode=_b});var di=B(ci=>{"use strict";S();var Nb=Un(),Ze=V(),Ib=oi();function ga(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 Nb.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 hd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,ba=class extends Ib.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=>Ze.isNode(r)||Ze.isPair(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(hd(t))this.add(n);else{let[r,...i]=t,s=this.get(r,!0);if(Ze.isCollection(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,ga(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(Ze.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&&Ze.isScalar(s)?s.value:s:Ze.isCollection(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ze.isPair(n))return!1;let r=n.value;return r==null||t&&Ze.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 Ze.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(Ze.isCollection(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,ga(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};ci.Collection=ba;ci.collectionFromPath=ga;ci.isEmptyPath=hd});var jn=B(pi=>{"use strict";S();var Pb=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function va(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Ob=(e,t,n)=>e.endsWith(`
5131
- `)?va(n,t):n.includes(`
5175
+ `}});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(`
5176
+ `)}};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(`
5177
+ `)?ka(n,t):n.includes(`
5132
5178
  `)?`
5133
- `+va(n,t):(e.endsWith(" ")?"":" ")+n;pi.indentComment=va;pi.lineComment=Ob;pi.stringifyComment=Pb});var fd=B(Wn=>{"use strict";S();var Rb="flow",wa="block",ui="quoted";function Lb(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,m,f=!1,h=-1,g=-1,y=-1;n===wa&&(h=md(e,h,t.length),h!==-1&&(d=h+c));for(let b;b=e[h+=1];){if(n===ui&&b==="\\"){switch(g=h,e[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}y=h}if(b===`
5134
- `)n===wa&&(h=md(e,h,t.length)),d=h+t.length+c,p=void 0;else{if(b===" "&&m&&m!==" "&&m!==`
5135
- `&&m!==" "){let E=e[h+1];E&&E!==" "&&E!==`
5136
- `&&E!==" "&&(p=h)}if(h>=d)if(p)l.push(p),d=p+c,p=void 0;else if(n===ui){for(;m===" "||m===" ";)m=b,b=e[h+=1],f=!0;let E=h>y+1?h-2:g-1;if(u[E])return e;l.push(E),u[E]=!0,d=E+c,p=void 0}else f=!0}m=b}if(f&&o&&o(),l.length===0)return e;a&&a();let x=e.slice(0,l[0]);for(let b=0;b<l.length;++b){let E=l[b],_=l[b+1]||e.length;E===0?x=`
5137
- ${t}${e.slice(0,_)}`:(n===ui&&u[E]&&(x+=`${e[E]}\\`),x+=`
5138
- ${t}${e.slice(E+1,_)}`)}return x}function md(e,t,n){let r=t,i=t+1,s=e[i];for(;s===" "||s===" ";)if(t<i+n)s=e[++t];else{do s=e[++t];while(s&&s!==`
5139
- `);r=t,i=t+1,s=e[i]}return r}Wn.FOLD_BLOCK=wa;Wn.FOLD_FLOW=Rb;Wn.FOLD_QUOTED=ui;Wn.foldFlowLines=Lb});var Gn=B(gd=>{"use strict";S();var je=de(),Nt=fd(),mi=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),fi=e=>/^(%|---|\.\.\.)/m.test(e);function Mb(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let s=0,a=0;s<i;++s)if(e[s]===`
5140
- `){if(s-a>r)return!0;if(a=s+1,i-a<=r)return!1}return!0}function Kn(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(fi(e)?" ":""),a="",o=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(o,c)+"\\ ",c+=1,o=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{a+=n.slice(o,c);let u=n.substr(c+2,4);switch(u){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:u.substr(0,2)==="00"?a+="\\x"+u.substr(2):a+=n.substr(c,6)}c+=5,o=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<i)c+=1;else{for(a+=n.slice(o,c)+`
5179
+ `+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===`
5180
+ `)n===Ta&&(m=bd(e,m,t.length)),d=m+t.length+c,p=void 0;else{if(b===" "&&h&&h!==" "&&h!==`
5181
+ `&&h!==" "){let C=e[m+1];C&&C!==" "&&C!==`
5182
+ `&&C!==" "&&(p=m)}if(m>=d)if(p)l.push(p),d=p+c,p=void 0;else if(n===wi){for(;h===" "||h===" ";)h=b,b=e[m+=1],f=!0;let C=m>y+1?m-2:g-1;if(u[C])return e;l.push(C),u[C]=!0,d=C+c,p=void 0}else f=!0}h=b}if(f&&o&&o(),l.length===0)return e;a&&a();let T=e.slice(0,l[0]);for(let b=0;b<l.length;++b){let C=l[b],_=l[b+1]||e.length;C===0?T=`
5183
+ ${t}${e.slice(0,_)}`:(n===wi&&u[C]&&(T+=`${e[C]}\\`),T+=`
5184
+ ${t}${e.slice(C+1,_)}`)}return T}function bd(e,t,n){let r=t,i=t+1,s=e[i];for(;s===" "||s===" ";)if(t<i+n)s=e[++t];else{do s=e[++t];while(s&&s!==`
5185
+ `);r=t,i=t+1,s=e[i]}return r}Vn.FOLD_BLOCK=Ta;Vn.FOLD_FLOW=jb;Vn.FOLD_QUOTED=wi;Vn.foldFlowLines=Wb});var Yn=B(wd=>{"use strict";S();var We=pe(),It=vd(),xi=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ki=e=>/^(%|---|\.\.\.)/m.test(e);function Kb(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let s=0,a=0;s<i;++s)if(e[s]===`
5186
+ `){if(s-a>r)return!0;if(a=s+1,i-a<=r)return!1}return!0}function Xn(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(ki(e)?" ":""),a="",o=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(o,c)+"\\ ",c+=1,o=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{a+=n.slice(o,c);let u=n.substr(c+2,4);switch(u){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:u.substr(0,2)==="00"?a+="\\x"+u.substr(2):a+=n.substr(c,6)}c+=5,o=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<i)c+=1;else{for(a+=n.slice(o,c)+`
5141
5187
 
5142
5188
  `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)a+=`
5143
- `,c+=2;a+=s,n[c+2]===" "&&(a+="\\"),c+=1,o=c+1}break;default:c+=1}return a=o?a+n.slice(o):n,r?a:Nt.foldFlowLines(a,s,Nt.FOLD_QUOTED,mi(t,!1))}function ya(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
5144
- `)||/[ \t]\n|\n[ \t]/.test(e))return Kn(e,t);let n=t.indent||(fi(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
5145
- ${n}`)+"'";return t.implicitKey?r:Nt.foldFlowLines(r,n,Nt.FOLD_FLOW,mi(t,!1))}function bn(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Kn;else{let i=e.includes('"'),s=e.includes("'");i&&!s?r=ya:s&&!i?r=Kn:r=n?ya:Kn}return r(e,t)}var xa;try{xa=new RegExp(`(^|(?<!
5189
+ `,c+=2;a+=s,n[c+2]===" "&&(a+="\\"),c+=1,o=c+1}break;default:c+=1}return a=o?a+n.slice(o):n,r?a:It.foldFlowLines(a,s,It.FOLD_QUOTED,xi(t,!1))}function Sa(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
5190
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Xn(e,t);let n=t.indent||(ki(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
5191
+ ${n}`)+"'";return t.implicitKey?r:It.foldFlowLines(r,n,It.FOLD_FLOW,xi(t,!1))}function wn(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Xn;else{let i=e.includes('"'),s=e.includes("'");i&&!s?r=Sa:s&&!i?r=Xn:r=n?Sa:Xn}return r(e,t)}var Ca;try{Ca=new RegExp(`(^|(?<!
5146
5192
  ))
5147
5193
  +(?!
5148
- |$)`,"g")}catch{xa=/\n+(?!\n|$)/g}function hi({comment:e,type:t,value:n},r,i,s){let{blockQuote:a,commentString:o,lineWidth:c}=r.options;if(!a||/\n[\t ]+$/.test(n))return bn(n,r);let l=r.indent||(r.forceBlockIndent||fi(n)?" ":""),u=a==="literal"?!0:a==="folded"||t===je.Scalar.BLOCK_FOLDED?!1:t===je.Scalar.BLOCK_LITERAL?!0:!Mb(n,c,l.length);if(!n)return u?`|
5194
+ |$)`,"g")}catch{Ca=/\n+(?!\n|$)/g}function yi({comment:e,type:t,value:n},r,i,s){let{blockQuote:a,commentString:o,lineWidth:c}=r.options;if(!a||/\n[\t ]+$/.test(n))return wn(n,r);let l=r.indent||(r.forceBlockIndent||ki(n)?" ":""),u=a==="literal"?!0:a==="folded"||t===We.Scalar.BLOCK_FOLDED?!1:t===We.Scalar.BLOCK_LITERAL?!0:!Kb(n,c,l.length);if(!n)return u?`|
5149
5195
  `:`>
5150
5196
  `;let d,p;for(p=n.length;p>0;--p){let _=n[p-1];if(_!==`
5151
- `&&_!==" "&&_!==" ")break}let m=n.substring(p),f=m.indexOf(`
5152
- `);f===-1?d="-":n===m||f!==m.length-1?(d="+",s&&s()):d="",m&&(n=n.slice(0,-m.length),m[m.length-1]===`
5153
- `&&(m=m.slice(0,-1)),m=m.replace(xa,`$&${l}`));let h=!1,g,y=-1;for(g=0;g<n.length;++g){let _=n[g];if(_===" ")h=!0;else if(_===`
5154
- `)y=g;else break}let x=n.substring(0,y<g?y+1:g);x&&(n=n.substring(x.length),x=x.replace(/\n+/g,`$&${l}`));let E=(h?l?"2":"1":"")+d;if(e&&(E+=" "+o(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let _=n.replace(/\n+/g,`
5155
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),v=!1,T=mi(r,!0);a!=="folded"&&t!==je.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{v=!0});let w=Nt.foldFlowLines(`${x}${_}${m}`,l,Nt.FOLD_BLOCK,T);if(!v)return`>${E}
5156
- ${l}${w}`}return n=n.replace(/\n+/g,`$&${l}`),`|${E}
5157
- ${l}${x}${n}${m}`}function Db(e,t,n,r){let{type:i,value:s}=e,{actualString:a,implicitKey:o,indent:c,indentStep:l,inFlow:u}=t;if(o&&s.includes(`
5158
- `)||u&&/[[\]{},]/.test(s))return bn(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return o||u||!s.includes(`
5159
- `)?bn(s,t):hi(e,t,n,r);if(!o&&!u&&i!==je.Scalar.PLAIN&&s.includes(`
5160
- `))return hi(e,t,n,r);if(fi(s)){if(c==="")return t.forceBlockIndent=!0,hi(e,t,n,r);if(o&&c===l)return bn(s,t)}let d=s.replace(/\n+/g,`$&
5161
- ${c}`);if(a){let p=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:m,tags:f}=t.doc.schema;if(f.some(p)||m?.some(p))return bn(s,t)}return o?d:Nt.foldFlowLines(d,c,Nt.FOLD_FLOW,mi(t,!1))}function Bb(e,t,n,r){let{implicitKey:i,inFlow:s}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:o}=e;o!==je.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=je.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case je.Scalar.BLOCK_FOLDED:case je.Scalar.BLOCK_LITERAL:return i||s?bn(a.value,t):hi(a,t,n,r);case je.Scalar.QUOTE_DOUBLE:return Kn(a.value,t);case je.Scalar.QUOTE_SINGLE:return ya(a.value,t);case je.Scalar.PLAIN:return Db(a,t,n,r);default:return null}},l=c(o);if(l===null){let{defaultKeyType:u,defaultStringType:d}=t.options,p=i&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}gd.stringifyString=Bb});var zn=B(ka=>{"use strict";S();var $b=ai(),It=V(),Fb=jn(),qb=Gn();function Hb(e,t){let n=Object.assign({blockQuote:!0,commentString:Fb.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Ub(e,t){if(t.tag){let i=e.filter(s=>s.tag===t.tag);if(i.length>0)return i.find(s=>s.format===t.format)??i[0]}let n,r;if(It.isScalar(t)){r=t.value;let i=e.filter(s=>s.identify?.(r));if(i.length>1){let s=i.filter(a=>a.test);s.length>0&&(i=s)}n=i.find(s=>s.format===t.format)??i.find(s=>!s.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function jb(e,t,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],s=(It.isScalar(e)||It.isCollection(e))&&e.anchor;s&&$b.anchorIsValid(s)&&(n.add(s),i.push(`&${s}`));let a=e.tag??(t.default?null:t.tag);return a&&i.push(r.directives.tagString(a)),i.join(" ")}function Wb(e,t,n,r){if(It.isPair(e))return e.toString(t,n,r);if(It.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,s=It.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=Ub(t.doc.schema.tags,s));let a=jb(s,i,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);let o=typeof i.stringify=="function"?i.stringify(s,t,n,r):It.isScalar(s)?qb.stringifyString(s,t,n,r):s.toString(t,n,r);return a?It.isScalar(s)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a}
5162
- ${t.indent}${o}`:o}ka.createStringifyContext=Hb;ka.stringify=Wb});var yd=B(wd=>{"use strict";S();var ut=V(),bd=de(),vd=zn(),Vn=jn();function Kb({key:e,value:t},n,r,i){let{allNullValues:s,doc:a,indent:o,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,p=ut.isNode(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(ut.isCollection(e)||!ut.isNode(e)&&typeof e=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let m=!d&&(!e||p&&t==null&&!n.inFlow||ut.isCollection(e)||(ut.isScalar(e)?e.type===bd.Scalar.BLOCK_FOLDED||e.type===bd.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(d||!s),indent:o+c});let f=!1,h=!1,g=vd.stringify(e,n,()=>f=!0,()=>h=!0);if(!m&&!n.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(s||t==null)return f&&r&&r(),g===""?"?":m?`? ${g}`:g}else if(s&&!d||t==null&&m)return g=`? ${g}`,p&&!f?g+=Vn.lineComment(g,n.indent,l(p)):h&&i&&i(),g;f&&(p=null),m?(p&&(g+=Vn.lineComment(g,n.indent,l(p))),g=`? ${g}
5163
- ${o}:`):(g=`${g}:`,p&&(g+=Vn.lineComment(g,n.indent,l(p))));let y,x,b;ut.isNode(t)?(y=!!t.spaceBefore,x=t.commentBefore,b=t.comment):(y=!1,x=null,b=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!m&&!p&&ut.isScalar(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!m&&ut.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let E=!1,_=vd.stringify(t,n,()=>E=!0,()=>h=!0),v=" ";if(p||y||x){if(v=y?`
5164
- `:"",x){let T=l(x);v+=`
5165
- ${Vn.indentComment(T,n.indent)}`}_===""&&!n.inFlow?v===`
5166
- `&&b&&(v=`
5167
-
5168
- `):v+=`
5169
- ${n.indent}`}else if(!m&&ut.isCollection(t)){let T=_[0],w=_.indexOf(`
5170
- `),A=w!==-1,N=n.inFlow??t.flow??t.items.length===0;if(A||!N){let M=!1;if(A&&(T==="&"||T==="!")){let L=_.indexOf(" ");T==="&"&&L!==-1&&L<w&&_[L+1]==="!"&&(L=_.indexOf(" ",L+1)),(L===-1||w<L)&&(M=!0)}M||(v=`
5197
+ `&&_!==" "&&_!==" ")break}let h=n.substring(p),f=h.indexOf(`
5198
+ `);f===-1?d="-":n===h||f!==h.length-1?(d="+",s&&s()):d="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
5199
+ `&&(h=h.slice(0,-1)),h=h.replace(Ca,`$&${l}`));let m=!1,g,y=-1;for(g=0;g<n.length;++g){let _=n[g];if(_===" ")m=!0;else if(_===`
5200
+ `)y=g;else break}let T=n.substring(0,y<g?y+1:g);T&&(n=n.substring(T.length),T=T.replace(/\n+/g,`$&${l}`));let C=(m?l?"2":"1":"")+d;if(e&&(C+=" "+o(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let _=n.replace(/\n+/g,`
5201
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),w=!1,x=xi(r,!0);a!=="folded"&&t!==We.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{w=!0});let v=It.foldFlowLines(`${T}${_}${h}`,l,It.FOLD_BLOCK,x);if(!w)return`>${C}
5202
+ ${l}${v}`}return n=n.replace(/\n+/g,`$&${l}`),`|${C}
5203
+ ${l}${T}${n}${h}`}function Gb(e,t,n,r){let{type:i,value:s}=e,{actualString:a,implicitKey:o,indent:c,indentStep:l,inFlow:u}=t;if(o&&s.includes(`
5204
+ `)||u&&/[[\]{},]/.test(s))return wn(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return o||u||!s.includes(`
5205
+ `)?wn(s,t):yi(e,t,n,r);if(!o&&!u&&i!==We.Scalar.PLAIN&&s.includes(`
5206
+ `))return yi(e,t,n,r);if(ki(s)){if(c==="")return t.forceBlockIndent=!0,yi(e,t,n,r);if(o&&c===l)return wn(s,t)}let d=s.replace(/\n+/g,`$&
5207
+ ${c}`);if(a){let p=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(d),{compat:h,tags:f}=t.doc.schema;if(f.some(p)||h?.some(p))return wn(s,t)}return o?d:It.foldFlowLines(d,c,It.FOLD_FLOW,xi(t,!1))}function zb(e,t,n,r){let{implicitKey:i,inFlow:s}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:o}=e;o!==We.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=We.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case We.Scalar.BLOCK_FOLDED:case We.Scalar.BLOCK_LITERAL:return i||s?wn(a.value,t):yi(a,t,n,r);case We.Scalar.QUOTE_DOUBLE:return Xn(a.value,t);case We.Scalar.QUOTE_SINGLE:return Sa(a.value,t);case We.Scalar.PLAIN:return Gb(a,t,n,r);default:return null}},l=c(o);if(l===null){let{defaultKeyType:u,defaultStringType:d}=t.options,p=i&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}wd.stringifyString=zb});var Jn=B(Ea=>{"use strict";S();var Vb=hi(),Ot=X(),Xb=zn(),Yb=Yn();function Jb(e,t){let n=Object.assign({blockQuote:!0,commentString:Xb.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Qb(e,t){if(t.tag){let i=e.filter(s=>s.tag===t.tag);if(i.length>0)return i.find(s=>s.format===t.format)??i[0]}let n,r;if(Ot.isScalar(t)){r=t.value;let i=e.filter(s=>s.identify?.(r));if(i.length>1){let s=i.filter(a=>a.test);s.length>0&&(i=s)}n=i.find(s=>s.format===t.format)??i.find(s=>!s.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Zb(e,t,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],s=(Ot.isScalar(e)||Ot.isCollection(e))&&e.anchor;s&&Vb.anchorIsValid(s)&&(n.add(s),i.push(`&${s}`));let a=e.tag??(t.default?null:t.tag);return a&&i.push(r.directives.tagString(a)),i.join(" ")}function ev(e,t,n,r){if(Ot.isPair(e))return e.toString(t,n,r);if(Ot.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,s=Ot.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=Qb(t.doc.schema.tags,s));let a=Zb(s,i,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);let o=typeof i.stringify=="function"?i.stringify(s,t,n,r):Ot.isScalar(s)?Yb.stringifyString(s,t,n,r):s.toString(t,n,r);return a?Ot.isScalar(s)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a}
5208
+ ${t.indent}${o}`:o}Ea.createStringifyContext=Jb;Ea.stringify=ev});var Td=B(kd=>{"use strict";S();var mt=X(),yd=pe(),xd=Jn(),Qn=zn();function tv({key:e,value:t},n,r,i){let{allNullValues:s,doc:a,indent:o,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,p=mt.isNode(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(mt.isCollection(e)||!mt.isNode(e)&&typeof e=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let h=!d&&(!e||p&&t==null&&!n.inFlow||mt.isCollection(e)||(mt.isScalar(e)?e.type===yd.Scalar.BLOCK_FOLDED||e.type===yd.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(d||!s),indent:o+c});let f=!1,m=!1,g=xd.stringify(e,n,()=>f=!0,()=>m=!0);if(!h&&!n.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||t==null)return f&&r&&r(),g===""?"?":h?`? ${g}`:g}else if(s&&!d||t==null&&h)return g=`? ${g}`,p&&!f?g+=Qn.lineComment(g,n.indent,l(p)):m&&i&&i(),g;f&&(p=null),h?(p&&(g+=Qn.lineComment(g,n.indent,l(p))),g=`? ${g}
5209
+ ${o}:`):(g=`${g}:`,p&&(g+=Qn.lineComment(g,n.indent,l(p))));let y,T,b;mt.isNode(t)?(y=!!t.spaceBefore,T=t.commentBefore,b=t.comment):(y=!1,T=null,b=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!h&&!p&&mt.isScalar(t)&&(n.indentAtStart=g.length+1),m=!1,!u&&c.length>=2&&!n.inFlow&&!h&&mt.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1,_=xd.stringify(t,n,()=>C=!0,()=>m=!0),w=" ";if(p||y||T){if(w=y?`
5210
+ `:"",T){let x=l(T);w+=`
5211
+ ${Qn.indentComment(x,n.indent)}`}_===""&&!n.inFlow?w===`
5212
+ `&&b&&(w=`
5213
+
5214
+ `):w+=`
5215
+ ${n.indent}`}else if(!h&&mt.isCollection(t)){let x=_[0],v=_.indexOf(`
5216
+ `),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=`
5171
5217
  ${n.indent}`)}}else(_===""||_[0]===`
5172
- `)&&(v="");return g+=v+_,n.inFlow?E&&r&&r():b&&!E?g+=Vn.lineComment(g,n.indent,l(b)):h&&i&&i(),g}wd.stringifyPair=Kb});var Sa=B(Ta=>{"use strict";S();var xd=Jr("process");function Gb(e,...t){e==="debug"&&console.log(...t)}function zb(e,t){(e==="debug"||e==="warn")&&(typeof xd.emitWarning=="function"?xd.emitWarning(t):console.warn(t))}Ta.debug=Gb;Ta.warn=zb});var yi=B(wi=>{"use strict";S();var vi=V(),kd=de(),gi="<<",bi={identify:e=>e===gi||typeof e=="symbol"&&e.description===gi,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new kd.Scalar(Symbol(gi)),{addToJSMap:Td}),stringify:()=>gi},Vb=(e,t)=>(bi.identify(t)||vi.isScalar(t)&&(!t.type||t.type===kd.Scalar.PLAIN)&&bi.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===bi.tag&&n.default);function Td(e,t,n){let r=Sd(e,n);if(vi.isSeq(r))for(let i of r.items)Ca(e,t,i);else if(Array.isArray(r))for(let i of r)Ca(e,t,i);else Ca(e,t,r)}function Ca(e,t,n){let r=Sd(e,n);if(!vi.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 Sd(e,t){return e&&vi.isAlias(t)?t.resolve(e.doc,e):t}wi.addMergeToJSMap=Td;wi.isMergeKey=Vb;wi.merge=bi});var Aa=B(Ad=>{"use strict";S();var Xb=Sa(),Cd=yi(),Yb=zn(),Ed=V(),Ea=At();function Jb(e,t,{key:n,value:r}){if(Ed.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Cd.isMergeKey(e,n))Cd.addMergeToJSMap(e,t,r);else{let i=Ea.toJS(n,"",e);if(t instanceof Map)t.set(i,Ea.toJS(r,i,e));else if(t instanceof Set)t.add(i);else{let s=Qb(n,i,e),a=Ea.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 Qb(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ed.isNode(e)&&n?.doc){let r=Yb.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)+'..."'),Xb.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)}Ad.addPairToJSMap=Jb});var Pt=B(_a=>{"use strict";S();var _d=Un(),Zb=yd(),ev=Aa(),xi=V();function tv(e,t,n){let r=_d.createNode(e,void 0,n),i=_d.createNode(t,void 0,n);return new ki(r,i)}var ki=class e{constructor(t,n=null){Object.defineProperty(this,xi.NODE_TYPE,{value:xi.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return xi.isNode(n)&&(n=n.clone(t)),xi.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(t,n){let r=n?.mapAsMap?new Map:{};return ev.addPairToJSMap(n,r,this)}toString(t,n,r){return t?.doc?Zb.stringifyPair(this,t,n,r):JSON.stringify(this)}};_a.Pair=ki;_a.createPair=tv});var Na=B(Id=>{"use strict";S();var Kt=V(),Nd=zn(),Ti=jn();function nv(e,t,n){return(t.inFlow??e.flow?iv:rv)(e,t,n)}function rv({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 h=t[f],g=null;if(Kt.isNode(h))!d&&h.spaceBefore&&p.push(""),Si(n,p,h.commentBefore,d),h.comment&&(g=h.comment);else if(Kt.isPair(h)){let x=Kt.isNode(h.key)?h.key:null;x&&(!d&&x.spaceBefore&&p.push(""),Si(n,p,x.commentBefore,d))}d=!1;let y=Nd.stringify(h,u,()=>g=null,()=>d=!0);g&&(y+=Ti.lineComment(y,s,l(g))),d&&g&&(d=!1),p.push(r+y)}let m;if(p.length===0)m=i.start+i.end;else{m=p[0];for(let f=1;f<p.length;++f){let h=p[f];m+=h?`
5173
- ${c}${h}`:`
5174
- `}}return e?(m+=`
5175
- `+Ti.indentComment(l(e),c),o&&o()):d&&a&&a(),m}function iv({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:o}}=t;r+=s;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let f=0;f<e.length;++f){let h=e[f],g=null;if(Kt.isNode(h))h.spaceBefore&&d.push(""),Si(t,d,h.commentBefore,!1),h.comment&&(g=h.comment);else if(Kt.isPair(h)){let x=Kt.isNode(h.key)?h.key:null;x&&(x.spaceBefore&&d.push(""),Si(t,d,x.commentBefore,!1),x.comment&&(l=!0));let b=Kt.isNode(h.value)?h.value:null;b?(b.comment&&(g=b.comment),b.commentBefore&&(l=!0)):h.value==null&&x?.comment&&(g=x.comment)}g&&(l=!0);let y=Nd.stringify(h,c,()=>g=null);l||(l=d.length>u||y.includes(`
5176
- `)),f<e.length-1?y+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=d.reduce((x,b)=>x+b.length+2,2)+(y.length+2)>t.options.lineWidth)),l&&(y+=",")),g&&(y+=Ti.lineComment(y,r,o(g))),d.push(y),u=d.length}let{start:p,end:m}=n;if(d.length===0)return p+m;if(!l){let f=d.reduce((h,g)=>h+g.length+2,2);l=t.options.lineWidth>0&&f>t.options.lineWidth}if(l){let f=p;for(let h of d)f+=h?`
5177
- ${s}${i}${h}`:`
5218
+ `)&&(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?`
5219
+ ${c}${m}`:`
5220
+ `}}return e?(h+=`
5221
+ `+Pi.indentComment(l(e),c),o&&o()):d&&a&&a(),h}function mv({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:o}}=t;r+=s;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let f=0;f<e.length;++f){let m=e[f],g=null;if(zt.isNode(m))m.spaceBefore&&d.push(""),Ii(t,d,m.commentBefore,!1),m.comment&&(g=m.comment);else if(zt.isPair(m)){let T=zt.isNode(m.key)?m.key:null;T&&(T.spaceBefore&&d.push(""),Ii(t,d,T.commentBefore,!1),T.comment&&(l=!0));let b=zt.isNode(m.value)?m.value:null;b?(b.comment&&(g=b.comment),b.commentBefore&&(l=!0)):m.value==null&&T?.comment&&(g=T.comment)}g&&(l=!0);let y=Od.stringify(m,c,()=>g=null);l||(l=d.length>u||y.includes(`
5222
+ `)),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?`
5223
+ ${s}${i}${m}`:`
5178
5224
  `;return`${f}
5179
- ${i}${m}`}else return`${p}${a}${d.join(" ")}${a}${m}`}function Si({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let s=Ti.indentComment(t(r),e);n.push(s.trimStart())}}Id.stringifyCollection=nv});var Rt=B(Pa=>{"use strict";S();var sv=Na(),av=Aa(),ov=di(),Ot=V(),Ci=Pt(),lv=de();function Xn(e,t){let n=Ot.isScalar(t)?t.value:t;for(let r of e)if(Ot.isPair(r)&&(r.key===t||r.key===n||Ot.isScalar(r.key)&&r.key.value===n))return r}var Ia=class extends ov.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ot.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(Ci.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;Ot.isPair(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Ci.Pair(t,t?.value):r=new Ci.Pair(t.key,t.value);let i=Xn(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Ot.isScalar(i.value)&&lv.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=Xn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let i=Xn(this.items,t)?.value;return(!n&&Ot.isScalar(i)?i.value:i)??void 0}has(t){return!!Xn(this.items,t)}set(t,n){this.add(new Ci.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)av.addPairToJSMap(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(let i of this.items)if(!Ot.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})),sv.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}};Pa.YAMLMap=Ia;Pa.findPair=Xn});var vn=B(Od=>{"use strict";S();var cv=V(),Pd=Rt(),dv={collection:"map",default:!0,nodeClass:Pd.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return cv.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Pd.YAMLMap.from(e,t,n)};Od.map=dv});var Lt=B(Rd=>{"use strict";S();var pv=Un(),uv=Na(),hv=di(),Ai=V(),mv=de(),fv=At(),Oa=class extends hv.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ai.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Ei(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let r=Ei(t);if(typeof r!="number")return;let i=this.items[r];return!n&&Ai.isScalar(i)?i.value:i}has(t){let n=Ei(t);return typeof n=="number"&&n<this.items.length}set(t,n){let r=Ei(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);let i=this.items[r];Ai.isScalar(i)&&mv.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(fv.toJS(s,String(i++),n));return r}toString(t,n,r){return t?uv.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(pv.createNode(o,void 0,r))}}return s}};function Ei(e){let t=Ai.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}Rd.YAMLSeq=Oa});var wn=B(Md=>{"use strict";S();var gv=V(),Ld=Lt(),bv={collection:"seq",default:!0,nodeClass:Ld.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return gv.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ld.YAMLSeq.from(e,t,n)};Md.seq=bv});var Yn=B(Dd=>{"use strict";S();var vv=Gn(),wv={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),vv.stringifyString(e,t,n,r)}};Dd.string=wv});var _i=B(Fd=>{"use strict";S();var Bd=de(),$d={identify:e=>e==null,createNode:()=>new Bd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Bd.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&$d.test.test(e)?e:t.options.nullStr};Fd.nullTag=$d});var Ra=B(Hd=>{"use strict";S();var yv=de(),qd={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new yv.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&qd.test.test(e)){let r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};Hd.boolTag=qd});var yn=B(Ud=>{"use strict";S();function xv({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}Ud.stringifyNumber=xv});var Ma=B(Ni=>{"use strict";S();var kv=de(),La=yn(),Tv={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:La.stringifyNumber},Sv={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():La.stringifyNumber(e)}},Cv={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 kv.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:La.stringifyNumber};Ni.float=Cv;Ni.floatExp=Sv;Ni.floatNaN=Tv});var Ba=B(Pi=>{"use strict";S();var jd=yn(),Ii=e=>typeof e=="bigint"||Number.isInteger(e),Da=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Wd(e,t,n){let{value:r}=e;return Ii(r)&&r>=0?n+r.toString(t):jd.stringifyNumber(e)}var Ev={identify:e=>Ii(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Da(e,2,8,n),stringify:e=>Wd(e,8,"0o")},Av={identify:Ii,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Da(e,0,10,n),stringify:jd.stringifyNumber},_v={identify:e=>Ii(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Da(e,2,16,n),stringify:e=>Wd(e,16,"0x")};Pi.int=Av;Pi.intHex=_v;Pi.intOct=Ev});var Gd=B(Kd=>{"use strict";S();var Nv=vn(),Iv=_i(),Pv=wn(),Ov=Yn(),Rv=Ra(),$a=Ma(),Fa=Ba(),Lv=[Nv.map,Pv.seq,Ov.string,Iv.nullTag,Rv.boolTag,Fa.intOct,Fa.int,Fa.intHex,$a.floatNaN,$a.floatExp,$a.float];Kd.schema=Lv});var Xd=B(Vd=>{"use strict";S();var Mv=de(),Dv=vn(),Bv=wn();function zd(e){return typeof e=="bigint"||Number.isInteger(e)}var Oi=({value:e})=>JSON.stringify(e),$v=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Oi},{identify:e=>e==null,createNode:()=>new Mv.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Oi},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Oi},{identify:zd,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})=>zd(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:Oi}],Fv={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},qv=[Dv.map,Bv.seq].concat($v,Fv);Vd.schema=qv});var Ha=B(Yd=>{"use strict";S();var Jn=Jr("buffer"),qa=de(),Hv=Gn(),Uv={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Jn.Buffer=="function")return Jn.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 Jn.Buffer=="function")o=a instanceof Jn.Buffer?a.toString("base64"):Jn.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=qa.Scalar.BLOCK_LITERAL),t!==qa.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===qa.Scalar.BLOCK_LITERAL?`
5180
- `:" ")}return Hv.stringifyString({comment:e,type:t,value:o},r,i,s)}};Yd.binary=Uv});var Mi=B(Li=>{"use strict";S();var Ri=V(),Ua=Pt(),jv=de(),Wv=Lt();function Jd(e,t){if(Ri.isSeq(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Ri.isPair(r)){if(Ri.isMap(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");let i=r.items[0]||new Ua.Pair(new jv.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
5225
+ ${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?`
5226
+ `:" ")}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}
5181
5227
  ${i.key.commentBefore}`:r.commentBefore),r.comment){let s=i.value??i.key;s.comment=s.comment?`${r.comment}
5182
- ${s.comment}`:r.comment}r=i}e.items[n]=Ri.isPair(r)?r:new Ua.Pair(r)}}else t("Expected a sequence for this tag");return e}function Qd(e,t,n){let{replacer:r}=n,i=new Wv.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(Ua.createPair(o,c,n))}return i}var Kv={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Jd,createNode:Qd};Li.createPairs=Qd;Li.pairs=Kv;Li.resolvePairs=Jd});var Ka=B(Wa=>{"use strict";S();var Zd=V(),ja=At(),Qn=Rt(),Gv=Lt(),ep=Mi(),Gt=class e extends Gv.YAMLSeq{constructor(){super(),this.add=Qn.YAMLMap.prototype.add.bind(this),this.delete=Qn.YAMLMap.prototype.delete.bind(this),this.get=Qn.YAMLMap.prototype.get.bind(this),this.has=Qn.YAMLMap.prototype.has.bind(this),this.set=Qn.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(Zd.isPair(i)?(s=ja.toJS(i.key,"",n),a=ja.toJS(i.value,s,n)):s=ja.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=ep.createPairs(t,n,r),s=new this;return s.items=i.items,s}};Gt.tag="tag:yaml.org,2002:omap";var zv={collection:"seq",identify:e=>e instanceof Map,nodeClass:Gt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=ep.resolvePairs(e,t),r=[];for(let{key:i}of n.items)Zd.isScalar(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Gt,n)},createNode:(e,t,n)=>Gt.from(e,t,n)};Wa.YAMLOMap=Gt;Wa.omap=zv});var sp=B(Ga=>{"use strict";S();var tp=de();function np({value:e,source:t},n){return t&&(e?rp:ip).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var rp={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 tp.Scalar(!0),stringify:np},ip={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 tp.Scalar(!1),stringify:np};Ga.falseTag=ip;Ga.trueTag=rp});var ap=B(Di=>{"use strict";S();var Vv=de(),za=yn(),Xv={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:za.stringifyNumber},Yv={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():za.stringifyNumber(e)}},Jv={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 Vv.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:za.stringifyNumber};Di.float=Jv;Di.floatExp=Yv;Di.floatNaN=Xv});var lp=B(er=>{"use strict";S();var op=yn(),Zn=e=>typeof e=="bigint"||Number.isInteger(e);function Bi(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 Va(e,t,n){let{value:r}=e;if(Zn(r)){let i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return op.stringifyNumber(e)}var Qv={identify:Zn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Bi(e,2,2,n),stringify:e=>Va(e,2,"0b")},Zv={identify:Zn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Bi(e,1,8,n),stringify:e=>Va(e,8,"0")},ew={identify:Zn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Bi(e,0,10,n),stringify:op.stringifyNumber},tw={identify:Zn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Bi(e,2,16,n),stringify:e=>Va(e,16,"0x")};er.int=ew;er.intBin=Qv;er.intHex=tw;er.intOct=Zv});var Ya=B(Xa=>{"use strict";S();var qi=V(),$i=Pt(),Fi=Rt(),zt=class e extends Fi.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;qi.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new $i.Pair(t.key,null):n=new $i.Pair(t,null),Fi.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let r=Fi.findPair(this.items,t);return!n&&qi.isPair(r)?qi.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=Fi.findPair(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new $i.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($i.createPair(a,null,r));return s}};zt.tag="tag:yaml.org,2002:set";var nw={collection:"map",identify:e=>e instanceof Set,nodeClass:zt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>zt.from(e,t,n),resolve(e,t){if(qi.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new zt,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};Xa.YAMLSet=zt;Xa.set=nw});var Qa=B(Hi=>{"use strict";S();var rw=yn();function Ja(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 cp(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return rw.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 iw={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})=>Ja(e,n),stringify:cp},sw={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=>Ja(e,!1),stringify:cp},dp={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(dp.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=Ja(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$/,"")??""};Hi.floatTime=sw;Hi.intTime=iw;Hi.timestamp=dp});var hp=B(up=>{"use strict";S();var aw=vn(),ow=_i(),lw=wn(),cw=Yn(),dw=Ha(),pp=sp(),Za=ap(),Ui=lp(),pw=yi(),uw=Ka(),hw=Mi(),mw=Ya(),eo=Qa(),fw=[aw.map,lw.seq,cw.string,ow.nullTag,pp.trueTag,pp.falseTag,Ui.intBin,Ui.intOct,Ui.int,Ui.intHex,Za.floatNaN,Za.floatExp,Za.float,dw.binary,pw.merge,uw.omap,hw.pairs,mw.set,eo.intTime,eo.floatTime,eo.timestamp];up.schema=fw});var Tp=B(ro=>{"use strict";S();var bp=vn(),gw=_i(),vp=wn(),bw=Yn(),vw=Ra(),to=Ma(),no=Ba(),ww=Gd(),yw=Xd(),wp=Ha(),tr=yi(),yp=Ka(),xp=Mi(),mp=hp(),kp=Ya(),ji=Qa(),fp=new Map([["core",ww.schema],["failsafe",[bp.map,vp.seq,bw.string]],["json",yw.schema],["yaml11",mp.schema],["yaml-1.1",mp.schema]]),gp={binary:wp.binary,bool:vw.boolTag,float:to.float,floatExp:to.floatExp,floatNaN:to.floatNaN,floatTime:ji.floatTime,int:no.int,intHex:no.intHex,intOct:no.intOct,intTime:ji.intTime,map:bp.map,merge:tr.merge,null:gw.nullTag,omap:yp.omap,pairs:xp.pairs,seq:vp.seq,set:kp.set,timestamp:ji.timestamp},xw={"tag:yaml.org,2002:binary":wp.binary,"tag:yaml.org,2002:merge":tr.merge,"tag:yaml.org,2002:omap":yp.omap,"tag:yaml.org,2002:pairs":xp.pairs,"tag:yaml.org,2002:set":kp.set,"tag:yaml.org,2002:timestamp":ji.timestamp};function kw(e,t,n){let r=fp.get(t);if(r&&!e)return n&&!r.includes(tr.merge)?r.concat(tr.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let s=Array.from(fp.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(tr.merge)),i.reduce((s,a)=>{let o=typeof a=="string"?gp[a]:a;if(!o){let c=JSON.stringify(a),l=Object.keys(gp).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},[])}ro.coreKnownTags=xw;ro.getTags=kw});var ao=B(Sp=>{"use strict";S();var io=V(),Tw=vn(),Sw=wn(),Cw=Yn(),Wi=Tp(),Ew=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,so=class e{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?Wi.getTags(t,"compat"):t?Wi.getTags(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Wi.coreKnownTags:{},this.tags=Wi.getTags(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,io.MAP,{value:Tw.map}),Object.defineProperty(this,io.SCALAR,{value:Cw.string}),Object.defineProperty(this,io.SEQ,{value:Sw.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?Ew:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};Sp.Schema=so});var Ep=B(Cp=>{"use strict";S();var Aw=V(),oo=zn(),nr=jn();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=oo.createStringifyContext(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=s(e.commentBefore);n.unshift(nr.indentComment(c,""))}let a=!1,o=null;if(e.contents){if(Aw.isNode(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){let u=s(e.contents.commentBefore);n.push(nr.indentComment(u,""))}i.forceBlockIndent=!!e.comment,o=e.contents.comment}let c=o?void 0:()=>a=!0,l=oo.stringify(e.contents,i,()=>o=null,c);o&&(l+=nr.lineComment(l,"",s(o))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(oo.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=s(e.comment);c.includes(`
5183
- `)?(n.push("..."),n.push(nr.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(nr.indentComment(s(c),"")))}return n.join(`
5228
+ ${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(`
5229
+ `)?(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(`
5184
5230
  `)+`
5185
- `}Cp.stringifyDocument=_w});var rr=B(Ap=>{"use strict";S();var Nw=Hn(),xn=di(),Me=V(),Iw=Pt(),Pw=At(),Ow=ao(),Rw=Ep(),lo=ai(),Lw=ua(),Mw=Un(),co=pa(),po=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 co.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){kn(this.contents)&&this.contents.add(t)}addIn(t,n){kn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let r=lo.anchorNames(this);t.anchor=!n||r.has(n)?lo.findNewAnchor(n||"a",r):n}return new Nw.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=x=>typeof x=="number"||x instanceof String||x 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:m}=lo.createNodeAnchors(this,a||"a"),f={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:m},h=Mw.createNode(t,u,f);return o&&Me.isCollection(h)&&(h.flow=!0),p(),h}createPair(t,n,r={}){let i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new Iw.Pair(i,s)}delete(t){return kn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return xn.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):kn(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 xn.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 xn.isEmptyPath(t)?this.contents!==void 0:Me.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=xn.collectionFromPath(this.schema,[t],n):kn(this.contents)&&this.contents.set(t,n)}setIn(t,n){xn.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=xn.collectionFromPath(this.schema,Array.from(t),n):kn(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 co.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 co.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 Ow.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=Pw.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"?Lw.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 Rw.stringifyDocument(this,t)}};function kn(e){if(Me.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}Ap.Document=po});var ar=B(sr=>{"use strict";S();var ir=class extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}},uo=class extends ir{constructor(t,n,r){super("YAMLParseError",t,n,r)}},ho=class extends ir{constructor(t,n,r){super("YAMLWarning",t,n,r)}},Dw=(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
5231
+ `}_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
5186
5232
  `),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+=`:
5187
5233
 
5188
5234
  ${a}
5189
5235
  ${l}
5190
- `}};sr.YAMLError=ir;sr.YAMLParseError=uo;sr.YAMLWarning=ho;sr.prettifyError=Dw});var or=B(_p=>{"use strict";S();function Bw(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:a,startOnNewline:o}){let c=!1,l=o,u=o,d="",p="",m=!1,f=!1,h=null,g=null,y=null,x=null,b=null,E=null,_=null;for(let w of e)switch(f&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&s(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),h&&(l&&w.type!=="comment"&&w.type!=="newline"&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),w.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&w.source.includes(" ")&&(h=w),u=!0;break;case"comment":{u||s(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=w.source.substring(1)||" ";d?d+=p+A:d=A,p="",l=!1;break}case"newline":l?d?d+=w.source:(!E||n!=="seq-item-ind")&&(c=!0):p+=w.source,l=!0,m=!0,(g||y)&&(x=w),u=!0;break;case"anchor":g&&s(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&s(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=w,_??(_=w.offset),l=!1,u=!1,f=!0;break;case"tag":{y&&s(w,"MULTIPLE_TAGS","A node can have at most one tag"),y=w,_??(_=w.offset),l=!1,u=!1,f=!0;break}case n:(g||y)&&s(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),E&&s(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${t??"collection"}`),E=w,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){b&&s(w,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=w,l=!1,u=!1;break}default:s(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),l=!1,u=!1}let v=e[e.length-1],T=v?v.offset+v.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"),h&&(l&&h.indent<=a||r?.type==="block-map"||r?.type==="block-seq")&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:E,spaceBefore:c,comment:d,hasNewline:m,anchor:g,tag:y,newlineAfterProp:x,end:T,start:_??T}}_p.resolveProps=Bw});var Ki=B(Np=>{"use strict";S();function mo(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
5191
- `))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(mo(t.key)||mo(t.value))return!0}return!1;default:return!0}}Np.containsNewline=mo});var fo=B(Ip=>{"use strict";S();var $w=Ki();function Fw(e,t,n){if(t?.type==="flow-collection"){let r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&$w.containsNewline(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Ip.flowIndentCheck=Fw});var go=B(Op=>{"use strict";S();var Pp=V();function qw(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r=="function"?r:(s,a)=>s===a||Pp.isScalar(s)&&Pp.isScalar(a)&&s.value===a.value;return t.some(s=>i(s.key,n))}Op.mapIncludes=qw});var $p=B(Bp=>{"use strict";S();var Rp=Pt(),Hw=Rt(),Lp=or(),Uw=Ki(),Mp=fo(),jw=go(),Dp="All mapping items must start at the same column";function Ww({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=s?.nodeClass??Hw.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:m,value:f}=u,h=Lp.resolveProps(d,{indicator:"explicit-key-ind",next:p??m?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),g=!h.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",Dp)),!h.anchor&&!h.tag&&!m){l=h.end,h.comment&&(o.comment?o.comment+=`
5192
- `+h.comment:o.comment=h.comment);continue}(h.newlineAfterProp||Uw.containsNewline(p))&&i(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==r.indent&&i(c,"BAD_INDENT",Dp);n.atKey=!0;let y=h.end,x=p?e(n,p,h,i):t(n,y,d,null,h,i);n.schema.compat&&Mp.flowIndentCheck(r.indent,p,i),n.atKey=!1,jw.mapIncludes(n,o.items,x)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let b=Lp.resolveProps(m??[],{indicator:"map-value-ind",next:f,offset:x.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&&h.start<b.found.offset-1024&&i(x.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let E=f?e(n,f,b,i):t(n,c,m,null,b,i);n.schema.compat&&Mp.flowIndentCheck(r.indent,f,i),c=E.range[2];let _=new Rp.Pair(x,E);n.options.keepSourceTokens&&(_.srcToken=u),o.items.push(_)}else{g&&i(x.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(x.comment?x.comment+=`
5193
- `+b.comment:x.comment=b.comment);let E=new Rp.Pair(x);n.options.keepSourceTokens&&(E.srcToken=u),o.items.push(E)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),o.range=[r.offset,c,l??c],o}Bp.resolveBlockMap=Ww});var qp=B(Fp=>{"use strict";S();var Kw=Lt(),Gw=or(),zw=fo();function Vw({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=s?.nodeClass??Kw.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=Gw.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 m=d?e(n,d,p,i):t(n,p.end,u,null,p,i);n.schema.compat&&zw.flowIndentCheck(r.indent,d,i),c=m.range[2],o.items.push(m)}return o.range=[r.offset,c,l??c],o}Fp.resolveBlockSeq=Vw});var Tn=B(Hp=>{"use strict";S();function Xw(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}}Hp.resolveEnd=Xw});var Kp=B(Wp=>{"use strict";S();var Yw=V(),Jw=Pt(),Up=Rt(),Qw=Lt(),Zw=Tn(),jp=or(),e0=Ki(),t0=go(),bo="Block collections are not allowed within flow collections",vo=e=>e&&(e.type==="block-map"||e.type==="block-seq");function n0({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=r.start.source==="{",o=a?"flow map":"flow sequence",c=s?.nodeClass??(a?Up.YAMLMap:Qw.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:x,key:b,sep:E,value:_}=y,v=jp.resolveProps(x,{flow:o,indicator:"explicit-key-ind",next:b??E?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!v.found){if(!v.anchor&&!v.tag&&!E&&!_){g===0&&v.comma?i(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):g<r.items.length-1&&i(v.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),v.comment&&(l.comment?l.comment+=`
5194
- `+v.comment:l.comment=v.comment),d=v.end;continue}!a&&n.options.strict&&e0.containsNewline(b)&&i(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)v.comma&&i(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(v.comma||i(v.start,"MISSING_CHAR",`Missing , between ${o} items`),v.comment){let T="";e:for(let w of x)switch(w.type){case"comma":case"space":break;case"comment":T=w.source.substring(1);break e;default:break e}if(T){let w=l.items[l.items.length-1];Yw.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
5195
- `+T:w.comment=T,v.comment=v.comment.substring(T.length+1)}}if(!a&&!E&&!v.found){let T=_?e(n,_,v,i):t(n,v.end,E,null,v,i);l.items.push(T),d=T.range[2],vo(_)&&i(T.range,"BLOCK_IN_FLOW",bo)}else{n.atKey=!0;let T=v.end,w=b?e(n,b,v,i):t(n,T,x,null,v,i);vo(b)&&i(w.range,"BLOCK_IN_FLOW",bo),n.atKey=!1;let A=jp.resolveProps(E??[],{flow:o,indicator:"map-value-ind",next:_,offset:w.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(A.found){if(!a&&!v.found&&n.options.strict){if(E)for(let L of E){if(L===A.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}v.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,E,null,A,i):null;N?vo(_)&&i(N.range,"BLOCK_IN_FLOW",bo):A.comment&&(w.comment?w.comment+=`
5196
- `+A.comment:w.comment=A.comment);let M=new Jw.Pair(w,N);if(n.options.keepSourceTokens&&(M.srcToken=y),a){let L=l;t0.mapIncludes(n,L.items,w)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(M)}else{let L=new Up.YAMLMap(n.schema);L.flow=!0,L.items.push(M);let F=(N??w).range;L.range=[w.range[0],F[1],F[2]],l.items.push(L)}d=N?N.range[2]:A.end}}let p=a?"}":"]",[m,...f]=r.end,h=d;if(m?.source===p)h=m.offset+m.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),m&&m.source.length!==1&&f.unshift(m)}if(f.length>0){let g=Zw.resolveEnd(f,h,n.options.strict,i);g.comment&&(l.comment?l.comment+=`
5197
- `+g.comment:l.comment=g.comment),l.range=[r.offset,h,g.offset]}else l.range=[r.offset,h,h];return l}Wp.resolveFlowCollection=n0});var zp=B(Gp=>{"use strict";S();var r0=V(),i0=de(),s0=Rt(),a0=Lt(),o0=$p(),l0=qp(),c0=Kp();function wo(e,t,n,r,i,s){let a=n.type==="block-map"?o0.resolveBlockMap(e,t,n,r,s):n.type==="block-seq"?l0.resolveBlockSeq(e,t,n,r,s):c0.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 d0(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:m}=r,f=p&&s?p.offset>s.offset?p:s:p??s;f&&(!m||m.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===s0.YAMLMap.tagName&&o==="map"||a===a0.YAMLSeq.tagName&&o==="seq")return wo(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),wo(e,t,n,i,a)}let l=wo(e,t,n,i,a,c),u=c.resolve?.(l,p=>i(s,"TAG_RESOLVE_FAILED",p),t.options)??l,d=r0.isNode(u)?u:new i0.Scalar(u);return d.range=l.range,d.tag=a,c?.format&&(d.format=c.format),d}Gp.composeCollection=d0});var xo=B(Vp=>{"use strict";S();var yo=de();function p0(e,t,n){let r=t.offset,i=u0(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=i.mode===">"?yo.Scalar.BLOCK_FOLDED:yo.Scalar.BLOCK_LITERAL,a=t.source?h0(t.source):[],o=a.length;for(let h=a.length-1;h>=0;--h){let g=a[h][1];if(g===""||g==="\r")o=h;else break}if(o===0){let h=i.chomp==="+"&&a.length>0?`
5198
- `.repeat(Math.max(1,a.length-1)):"",g=r+i.length;return t.source&&(g+=t.source.length),{value:h,type:s,comment:i.comment,range:[r,g,g]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let h=0;h<o;++h){let[g,y]=a[h];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=h,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 h=a.length-1;h>=o;--h)a[h][0].length>c&&(o=h+1);let d="",p="",m=!1;for(let h=0;h<u;++h)d+=a[h][0].slice(c)+`
5199
- `;for(let h=u;h<o;++h){let[g,y]=a[h];l+=g.length+y.length+1;let x=y[y.length-1]==="\r";if(x&&(y=y.slice(0,-1)),y&&g.length<c){let E=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(l-y.length-(x?2:1),"BAD_INDENT",E),g=""}s===yo.Scalar.BLOCK_LITERAL?(d+=p+g.slice(c)+y,p=`
5236
+ `}};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(`
5237
+ `))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+=`
5238
+ `+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+=`
5239
+ `+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+=`
5240
+ `+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+=`
5241
+ `+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+=`
5242
+ `+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+=`
5243
+ `+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?`
5244
+ `.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)+`
5245
+ `;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=`
5200
5246
  `):g.length>c||y[0]===" "?(p===" "?p=`
5201
- `:!m&&p===`
5247
+ `:!h&&p===`
5202
5248
  `&&(p=`
5203
5249
 
5204
5250
  `),d+=p+g.slice(c)+y,p=`
5205
- `,m=!0):y===""?p===`
5251
+ `,h=!0):y===""?p===`
5206
5252
  `?d+=`
5207
5253
  `:p=`
5208
- `:(d+=p+y,p=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let h=o;h<a.length;++h)d+=`
5209
- `+a[h][0].slice(c);d[d.length-1]!==`
5254
+ `:(d+=p+y,p=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let m=o;m<a.length;++m)d+=`
5255
+ `+a[m][0].slice(c);d[d.length-1]!==`
5210
5256
  `&&(d+=`
5211
5257
  `);break;default:d+=`
5212
- `}let f=r+i.length+t.source.length;return{value:d,type:s,comment:i.comment,range:[r,f,f]}}function u0({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],s=i[0],a=0,o="",c=-1;for(let p=1;p<i.length;++p){let m=i[p];if(!o&&(m==="-"||m==="+"))o=m;else{let f=Number(m);!a&&f?a=f:c===-1&&(c=e+p)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",d=i.length;for(let p=1;p<t.length;++p){let m=t[p];switch(m.type){case"space":l=!0;case"newline":d+=m.source.length;break;case"comment":n&&!l&&r(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=m.source.length,u=m.source.substring(1);break;case"error":r(m,"UNEXPECTED_TOKEN",m.message),d+=m.source.length;break;default:{let f=`Unexpected token in block scalar header: ${m.type}`;r(m,"UNEXPECTED_TOKEN",f);let h=m.source;h&&typeof h=="string"&&(d+=h.length)}}}return{mode:s,indent:a,chomp:o,comment:u,length:d}}function h0(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)s.push([t[a],t[a+1]]);return s}Vp.resolveBlockScalar=p0});var To=B(Yp=>{"use strict";S();var ko=de(),m0=Tn();function f0(e,t,n){let{offset:r,type:i,source:s,end:a}=e,o,c,l=(p,m,f)=>n(r+p,m,f);switch(i){case"scalar":o=ko.Scalar.PLAIN,c=g0(s,l);break;case"single-quoted-scalar":o=ko.Scalar.QUOTE_SINGLE,c=b0(s,l);break;case"double-quoted-scalar":o=ko.Scalar.QUOTE_DOUBLE,c=v0(s,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let u=r+s.length,d=m0.resolveEnd(a,u,t,n);return{value:c,type:o,comment:d.comment,range:[r,u,d.offset]}}function g0(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Xp(e)}function b0(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Xp(e.slice(1,-1)).replace(/''/g,"'")}function Xp(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
5258
+ `}let f=r+i.length+t.source.length;return{value:d,type:s,comment:i.comment,range:[r,f,f]}}function k0({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],s=i[0],a=0,o="",c=-1;for(let p=1;p<i.length;++p){let h=i[p];if(!o&&(h==="-"||h==="+"))o=h;else{let f=Number(h);!a&&f?a=f:c===-1&&(c=e+p)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",d=i.length;for(let p=1;p<t.length;++p){let h=t[p];switch(h.type){case"space":l=!0;case"newline":d+=h.source.length;break;case"comment":n&&!l&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=h.source.length,u=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),d+=h.source.length;break;default:{let f=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",f);let m=h.source;m&&typeof m=="string"&&(d+=m.length)}}}return{mode:s,indent:a,chomp:o,comment:u,length:d}}function T0(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)s.push([t[a],t[a+1]]);return s}Jp.resolveBlockScalar=x0});var Ao=B(Zp=>{"use strict";S();var Eo=pe(),S0=Cn();function C0(e,t,n){let{offset:r,type:i,source:s,end:a}=e,o,c,l=(p,h,f)=>n(r+p,h,f);switch(i){case"scalar":o=Eo.Scalar.PLAIN,c=E0(s,l);break;case"single-quoted-scalar":o=Eo.Scalar.QUOTE_SINGLE,c=A0(s,l);break;case"double-quoted-scalar":o=Eo.Scalar.QUOTE_DOUBLE,c=_0(s,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let u=r+s.length,d=S0.resolveEnd(a,u,t,n);return{value:c,type:o,comment:d.comment,range:[r,u,d.offset]}}function E0(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Qp(e)}function A0(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Qp(e.slice(1,-1)).replace(/''/g,"'")}function Qp(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
5213
5259
  `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
5214
5260
  `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],s=" ",a=t.lastIndex;for(n.lastIndex=a;r=n.exec(e);)r[1]===""?s===`
5215
5261
  `?i+=s:s=`
5216
- `:(i+=s+r[1],s=" "),a=n.lastIndex;let o=/[ \t]*(.*)/sy;return o.lastIndex=a,r=o.exec(e),i+s+(r?.[1]??"")}function v0(e,t){let n="";for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i==="\r"&&e[r+1]===`
5262
+ `:(i+=s+r[1],s=" "),a=n.lastIndex;let o=/[ \t]*(.*)/sy;return o.lastIndex=a,r=o.exec(e),i+s+(r?.[1]??"")}function _0(e,t){let n="";for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i==="\r"&&e[r+1]===`
5217
5263
  `))if(i===`
5218
- `){let{fold:s,offset:a}=w0(e,r);n+=s,r=a}else if(i==="\\"){let s=e[++r],a=y0[s];if(a)n+=a;else if(s===`
5264
+ `){let{fold:s,offset:a}=N0(e,r);n+=s,r=a}else if(i==="\\"){let s=e[++r],a=P0[s];if(a)n+=a;else if(s===`
5219
5265
  `)for(s=e[r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="\r"&&e[r+1]===`
5220
- `)for(s=e[++r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="x"||s==="u"||s==="U"){let o=s==="x"?2:s==="u"?4:8;n+=x0(e,r+1,o,t),r+=o}else{let o=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),n+=o}}else if(i===" "||i===" "){let s=r,a=e[r+1];for(;a===" "||a===" ";)a=e[++r+1];a!==`
5266
+ `)for(s=e[++r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="x"||s==="u"||s==="U"){let o=s==="x"?2:s==="u"?4:8;n+=I0(e,r+1,o,t),r+=o}else{let o=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),n+=o}}else if(i===" "||i===" "){let s=r,a=e[r+1];for(;a===" "||a===" ";)a=e[++r+1];a!==`
5221
5267
  `&&!(a==="\r"&&e[r+2]===`
5222
- `)&&(n+=r>s?e.slice(s,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function w0(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
5268
+ `)&&(n+=r>s?e.slice(s,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function N0(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
5223
5269
  `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
5224
5270
  `);)r===`
5225
5271
  `&&(n+=`
5226
- `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}var y0={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
5227
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function x0(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}}Yp.resolveFlowScalar=f0});var Zp=B(Qp=>{"use strict";S();var Vt=V(),Jp=de(),k0=xo(),T0=To();function S0(e,t,n,r){let{value:i,type:s,comment:a,range:o}=t.type==="block-scalar"?k0.resolveBlockScalar(e,t,r):T0.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[Vt.SCALAR]:c?l=C0(e.schema,i,c,n,r):t.type==="scalar"?l=E0(e,i,t,r):l=e.schema[Vt.SCALAR];let u;try{let d=l.resolve(i,p=>r(n??t,"TAG_RESOLVE_FAILED",p),e.options);u=Vt.isScalar(d)?d:new Jp.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);r(n??t,"TAG_RESOLVE_FAILED",p),u=new Jp.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 C0(e,t,n,r,i){if(n==="!")return e[Vt.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[Vt.SCALAR])}function E0({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[Vt.SCALAR];if(n.compat){let o=n.compat.find(c=>c.default&&c.test?.test(r))??n[Vt.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}Qp.composeScalar=S0});var tu=B(eu=>{"use strict";S();function A0(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}eu.emptyScalarPosition=A0});var iu=B(Co=>{"use strict";S();var _0=Hn(),N0=V(),I0=zp(),nu=Zp(),P0=Tn(),O0=tu(),R0={composeNode:ru,composeEmptyNode:So};function ru(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=L0(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=nu.composeScalar(e,t,c,r),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=I0.composeCollection(R0,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=So(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&&(!N0.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 So(e,t,n,r,{spaceBefore:i,comment:s,anchor:a,tag:o,end:c},l){let u={type:"scalar",offset:O0.emptyScalarPosition(t,n,r),indent:-1,source:""},d=nu.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 L0({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=P0.resolveEnd(r,a,e.strict,i);return s.range=[t,a,o.offset],o.comment&&(s.comment=o.comment),s}Co.composeEmptyNode=So;Co.composeNode=ru});var ou=B(au=>{"use strict";S();var M0=rr(),su=iu(),D0=Tn(),B0=or();function $0(e,t,{offset:n,start:r,value:i,end:s},a){let o=Object.assign({_directives:t},e),c=new M0.Document(void 0,o),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=B0.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?su.composeNode(l,i,u,a):su.composeEmptyNode(l,u.end,r,null,u,a);let d=c.contents.range[2],p=D0.resolveEnd(s,d,!1,a);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}au.composeDoc=$0});var Ao=B(du=>{"use strict";S();var F0=Jr("process"),q0=pa(),H0=rr(),lr=ar(),lu=V(),U0=ou(),j0=Tn();function cr(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 cu(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?`
5272
+ `),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:`
5273
+ `,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?`
5228
5274
 
5229
5275
  `:`
5230
- `)+(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 Eo=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{let a=cr(n);s?this.warnings.push(new lr.YAMLWarning(a,r,i)):this.errors.push(new lr.YAMLParseError(a,r,i))},this.directives=new q0.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:r,afterEmptyLine:i}=cu(this.prelude);if(r){let s=t.contents;if(n)t.comment=t.comment?`${t.comment}
5231
- ${r}`:r;else if(i||t.directives.docStart||!s)t.commentBefore=r;else if(lu.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];lu.isPair(a)&&(a=a.key);let o=a.commentBefore;a.commentBefore=o?`${r}
5276
+ `)+(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}
5277
+ ${r}`:r;else if(i||t.directives.docStart||!s)t.commentBefore=r;else if(pu.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];pu.isPair(a)&&(a=a.key);let o=a.commentBefore;a.commentBefore=o?`${r}
5232
5278
  ${o}`:r}else{let a=s.commentBefore;s.commentBefore=a?`${r}
5233
- ${a}`:r}}if(n){for(let s=0;s<this.errors.length;++s)t.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)t.warnings.push(this.warnings[s])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:cu(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(let i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(F0.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{let s=cr(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=U0.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new lr.YAMLParseError(cr(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new lr.YAMLParseError(cr(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=j0.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
5234
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new lr.YAMLParseError(cr(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let r=Object.assign({_directives:this.directives},this.options),i=new H0.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};du.Composer=Eo});var hu=B(Gi=>{"use strict";S();var W0=xo(),K0=To(),G0=ar(),pu=Gn();function z0(e,t=!0,n){if(e){let r=(i,s,a)=>{let o=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(o,s,a);else throw new G0.YAMLParseError([o,o+1],s,a)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return K0.resolveFlowScalar(e,t,r);case"block-scalar":return W0.resolveBlockScalar({options:{strict:t}},e,r)}}return null}function V0(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=t,o=pu.stringifyString({type:a,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:r,source:`
5279
+ ${a}`:r}}if(n){for(let s=0;s<this.errors.length;++s)t.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)t.warnings.push(this.warnings[s])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:uu(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(let i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(X0.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{let s=hr(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=Q0.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new ur.YAMLParseError(hr(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new ur.YAMLParseError(hr(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=Z0.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
5280
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ur.YAMLParseError(hr(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let r=Object.assign({_directives:this.directives},this.options),i=new J0.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};hu.Composer=Po});var gu=B(Zi=>{"use strict";S();var ey=Co(),ty=Ao(),ny=dr(),mu=Yn();function ry(e,t=!0,n){if(e){let r=(i,s,a)=>{let o=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(o,s,a);else throw new ny.YAMLParseError([o,o+1],s,a)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ty.resolveFlowScalar(e,t,r);case"block-scalar":return ey.resolveBlockScalar({options:{strict:t}},e,r)}}return null}function iy(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=t,o=mu.stringifyString({type:a,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:r,source:`
5235
5281
  `}];switch(o[0]){case"|":case">":{let l=o.indexOf(`
5236
5282
  `),u=o.substring(0,l),d=o.substring(l+1)+`
5237
- `,p=[{type:"block-scalar-header",offset:s,indent:r,source:u}];return uu(p,c)||p.push({type:"newline",offset:-1,indent:r,source:`
5238
- `}),{type:"block-scalar",offset:s,indent:r,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:o,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:o,end:c};default:return{type:"scalar",offset:s,indent:r,source:o,end:c}}}function X0(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=n,o="indent"in e?e.indent:null;if(r&&typeof o=="number"&&(o+=2),!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let c=pu.stringifyString({type:a,value:t},{implicitKey:i||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Y0(e,c);break;case'"':_o(e,c,"double-quoted-scalar");break;case"'":_o(e,c,"single-quoted-scalar");break;default:_o(e,c,"scalar")}}function Y0(e,t){let n=t.indexOf(`
5283
+ `,p=[{type:"block-scalar-header",offset:s,indent:r,source:u}];return fu(p,c)||p.push({type:"newline",offset:-1,indent:r,source:`
5284
+ `}),{type:"block-scalar",offset:s,indent:r,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:o,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:o,end:c};default:return{type:"scalar",offset:s,indent:r,source:o,end:c}}}function sy(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=n,o="indent"in e?e.indent:null;if(r&&typeof o=="number"&&(o+=2),!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let c=mu.stringifyString({type:a,value:t},{implicitKey:i||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":ay(e,c);break;case'"':Oo(e,c,"double-quoted-scalar");break;case"'":Oo(e,c,"single-quoted-scalar");break;default:Oo(e,c,"scalar")}}function ay(e,t){let n=t.indexOf(`
5239
5285
  `),r=t.substring(0,n),i=t.substring(n+1)+`
5240
- `;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}];uu(o,"end"in e?e.end:void 0)||o.push({type:"newline",offset:-1,indent:a,source:`
5241
- `});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 uu(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 _o(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:`
5242
- `};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})}}}Gi.createScalarToken=V0;Gi.resolveAsScalar=z0;Gi.setScalarValue=X0});var fu=B(mu=>{"use strict";S();var J0=e=>"type"in e?Vi(e):zi(e);function Vi(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=Vi(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=zi(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=zi(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=zi(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 zi({start:e,key:t,sep:n,value:r}){let i="";for(let s of e)i+=s.source;if(t&&(i+=Vi(t)),n)for(let s of n)i+=s.source;return r&&(i+=Vi(r)),i}mu.stringify=J0});var wu=B(vu=>{"use strict";S();var No=Symbol("break visit"),Q0=Symbol("skip children"),gu=Symbol("remove item");function Xt(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),bu(Object.freeze([]),e,t)}Xt.BREAK=No;Xt.SKIP=Q0;Xt.REMOVE=gu;Xt.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};Xt.parentCollection=(e,t)=>{let n=Xt.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 bu(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=bu(Object.freeze(e.concat([[i,a]])),s.items[a],n);if(typeof o=="number")a=o-1;else{if(o===No)return No;o===gu&&(s.items.splice(a,1),a-=1)}}typeof r=="function"&&i==="key"&&(r=r(t,e))}}return typeof r=="function"?r(t,e):r}vu.visit=Xt});var Xi=B(Ie=>{"use strict";S();var Io=hu(),Z0=fu(),ey=wu(),Po="\uFEFF",Oo="",Ro="",Lo="",ty=e=>!!e&&"items"in e,ny=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function ry(e){switch(e){case Po:return"<BOM>";case Oo:return"<DOC>";case Ro:return"<FLOW_END>";case Lo:return"<SCALAR>";default:return JSON.stringify(e)}}function iy(e){switch(e){case Po:return"byte-order-mark";case Oo:return"doc-mode";case Ro:return"flow-error-end";case Lo:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
5286
+ `;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:`
5287
+ `});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:`
5288
+ `};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`
5243
5289
  `:case`\r
5244
- `: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}Ie.createScalarToken=Io.createScalarToken;Ie.resolveAsScalar=Io.resolveAsScalar;Ie.setScalarValue=Io.setScalarValue;Ie.stringify=Z0.stringify;Ie.visit=ey.visit;Ie.BOM=Po;Ie.DOCUMENT=Oo;Ie.FLOW_END=Ro;Ie.SCALAR=Lo;Ie.isCollection=ty;Ie.isScalar=ny;Ie.prettyToken=ry;Ie.tokenType=iy});var Bo=B(xu=>{"use strict";S();var dr=Xi();function We(e){switch(e){case void 0:case" ":case`
5245
- `:case"\r":case" ":return!0;default:return!1}}var yu=new Set("0123456789ABCDEFabcdef"),sy=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Yi=new Set(",[]{}"),ay=new Set(` ,[]{}
5246
- \r `),Mo=e=>!e||ay.has(e),Do=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===`
5290
+ `: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`
5291
+ `:case"\r":case" ":return!0;default:return!1}}var Tu=new Set("0123456789ABCDEFabcdef"),fy=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),rs=new Set(",[]{}"),gy=new Set(` ,[]{}
5292
+ \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===`
5247
5293
  `?!0:n==="\r"?this.buffer[t+1]===`
5248
5294
  `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){let i=this.buffer[r+t+1];if(i===`
5249
5295
  `||!i&&!this.atEnd)return t+r+1}return n===`
5250
- `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&We(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
5251
- `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===dr.BOM&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){let s=t[r-1];if(s===" "||s===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){let s=t[n-1];if(s===" "||s===" ")n-=1;else break}let i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield dr.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&We(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!We(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&We(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Mo),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&We(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield dr.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Mo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||We(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let t=this.charAt(0),n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}let r=this.buffer.substring(0,n),i=r.indexOf(`
5296
+ `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Ke(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
5297
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===mr.BOM&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){let s=t[r-1];if(s===" "||s===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){let s=t[n-1];if(s===" "||s===" ")n-=1;else break}let i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield mr.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&Ke(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Ke(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Ke(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Fo),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&Ke(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield mr.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Fo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||Ke(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let t=this.charAt(0),n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}let r=this.buffer.substring(0,n),i=r.indexOf(`
5252
5298
  `,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
5253
- `,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){let n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>We(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case`
5299
+ `,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){let n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Ke(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case`
5254
5300
  `:t=s,n=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
5255
5301
  `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(t+1);if(s===-1)break;t=this.buffer.indexOf(`
5256
5302
  `,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
5257
5303
  `;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let s=t-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);let o=s;for(;a===" ";)a=this.buffer[--s];if(a===`
5258
- `&&s>=this.pos&&s+1+n>o)t=s;else break}while(!0);return yield dr.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let s=this.buffer[r+1];if(We(s)||t&&Yi.has(s))break;n=r}else if(We(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
5304
+ `&&s>=this.pos&&s+1+n>o)t=s;else break}while(!0);return yield mr.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let s=this.buffer[r+1];if(Ke(s)||t&&rs.has(s))break;n=r}else if(Ke(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
5259
5305
  `?(r+=1,i=`
5260
- `,s=this.buffer[r+1]):n=r),s==="#"||t&&Yi.has(s))break;if(i===`
5261
- `){let a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Yi.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield dr.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Mo),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(We(r)||n&&Yi.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!We(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(sy.has(n))n=this.buffer[++t];else if(n==="%"&&yu.has(this.buffer[t+1])&&yu.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
5306
+ `,s=this.buffer[r+1]):n=r),s==="#"||t&&rs.has(s))break;if(i===`
5307
+ `){let a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&rs.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield mr.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Fo),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(Ke(r)||n&&rs.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Ke(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(fy.has(n))n=this.buffer[++t];else if(n==="%"&&Tu.has(this.buffer[t+1])&&Tu.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
5262
5308
  `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
5263
- `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};xu.Lexer=Do});var Fo=B(ku=>{"use strict";S();var $o=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){let s=n+r>>1;this.lineStarts[s]<t?n=s+1:r=s}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};let i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}};ku.LineCounter=$o});var Ho=B(Au=>{"use strict";S();var oy=Jr("process"),Tu=Xi(),ly=Bo();function Mt(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Su(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function Eu(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ji(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Sn(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function Qi(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function Cu(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!Mt(t.start,"explicit-key-ind")&&!Mt(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Eu(t.value)?t.value.end?Qi(t.value.end,t.sep):t.value.end=t.sep:Qi(t.start,t.sep),delete t.sep)}var qo=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new ly.Lexer,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,oy.env.LOG_TOKENS&&console.log("|",Tu.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=Tu.tokenType(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Cu(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Su(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Su(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let n=Ji(this.peek(2)),r=Sn(n),i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];let s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
5309
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Su.Lexer=qo});var jo=B(Cu=>{"use strict";S();var Uo=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){let s=n+r>>1;this.lineStarts[s]<t?n=s+1:r=s}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};let i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}};Cu.LineCounter=Uo});var Ko=B(Pu=>{"use strict";S();var by=ri("process"),Eu=ns(),vy=Ho();function Bt(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Au(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function Nu(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function is(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function En(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function ss(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function _u(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!Bt(t.start,"explicit-key-ind")&&!Bt(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Nu(t.value)?t.value.end?ss(t.value.end,t.sep):t.value.end=t.sep:ss(t.start,t.sep),delete t.sep)}var Wo=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new vy.Lexer,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,by.env.LOG_TOKENS&&console.log("|",Eu.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=Eu.tokenType(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&_u(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Au(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Au(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let n=is(this.peek(2)),r=En(n),i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];let s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
5264
5310
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
5265
- `,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)){Qi(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(Mt(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(Eu(n.key)&&!Mt(n.sep,"newline")){let a=Sn(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(Mt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let a=Sn(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]}):Mt(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&&!Mt(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)){Qi(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||Mt(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=Ji(r),s=Sn(i);Cu(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(`
5311
+ `,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(`
5266
5312
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
5267
- `,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=Ji(t),r=Sn(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=Ji(t),r=Sn(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())}}};Au.Parser=qo});var Ou=B(ur=>{"use strict";S();var _u=Ao(),cy=rr(),pr=ar(),dy=Sa(),py=V(),uy=Fo(),Nu=Ho();function Iu(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new uy.LineCounter||null,prettyErrors:t}}function hy(e,t={}){let{lineCounter:n,prettyErrors:r}=Iu(t),i=new Nu.Parser(n?.addNewLine),s=new _u.Composer(t),a=Array.from(s.compose(i.parse(e)));if(r&&n)for(let o of a)o.errors.forEach(pr.prettifyError(e,n)),o.warnings.forEach(pr.prettifyError(e,n));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function Pu(e,t={}){let{lineCounter:n,prettyErrors:r}=Iu(t),i=new Nu.Parser(n?.addNewLine),s=new _u.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 pr.YAMLParseError(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(pr.prettifyError(e,n)),a.warnings.forEach(pr.prettifyError(e,n))),a}function my(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let i=Pu(e,n);if(!i)return null;if(i.warnings.forEach(s=>dy.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 fy(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 py.isDocument(e)&&!r?e.toString(n):new cy.Document(e,r,n).toString(n)}ur.parse=my;ur.parseAllDocuments=hy;ur.parseDocument=Pu;ur.stringify=fy});var Lu=B(Q=>{"use strict";S();var gy=Ao(),by=rr(),vy=ao(),Uo=ar(),wy=Hn(),Dt=V(),yy=Pt(),xy=de(),ky=Rt(),Ty=Lt(),Sy=Xi(),Cy=Bo(),Ey=Fo(),Ay=Ho(),Zi=Ou(),Ru=Bn();Q.Composer=gy.Composer;Q.Document=by.Document;Q.Schema=vy.Schema;Q.YAMLError=Uo.YAMLError;Q.YAMLParseError=Uo.YAMLParseError;Q.YAMLWarning=Uo.YAMLWarning;Q.Alias=wy.Alias;Q.isAlias=Dt.isAlias;Q.isCollection=Dt.isCollection;Q.isDocument=Dt.isDocument;Q.isMap=Dt.isMap;Q.isNode=Dt.isNode;Q.isPair=Dt.isPair;Q.isScalar=Dt.isScalar;Q.isSeq=Dt.isSeq;Q.Pair=yy.Pair;Q.Scalar=xy.Scalar;Q.YAMLMap=ky.YAMLMap;Q.YAMLSeq=Ty.YAMLSeq;Q.CST=Sy;Q.Lexer=Cy.Lexer;Q.LineCounter=Ey.LineCounter;Q.Parser=Ay.Parser;Q.parse=Zi.parse;Q.parseAllDocuments=Zi.parseAllDocuments;Q.parseDocument=Zi.parseDocument;Q.stringify=Zi.stringify;Q.visit=Ru.visit;Q.visitAsync=Ru.visitAsync});import ht from"node:fs";import Pe from"node:path";function ts(e){let t=Pe.resolve(e);for(;;){if(ht.existsSync(Pe.join(t,Jt)))return t;let n=Pe.dirname(t);if(n===t)return null;t=n}}function ns(e){let t=e.replace(/^/,"").replace(/\r\n/g,`
5268
- `),n=/^---\n([\s\S]*?)\n---\n?/.exec(t);if(!n)return{front:{},body:t};let r=(0,Cn.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 es(e){return(0,Cn.stringify)(e,_y)}function mt(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 Ko(e,t,n){return t.includes(e)?e:n}function Du(e,t){return t.includes(e)?e:void 0}function Bu(e){if(!e||typeof e!="object")return;let t=e;return{by:G(t.by),at:G(t.at)}}function Ny(e){let t=(0,Cn.parse)(e)??{},n=Array.isArray(t.members)?t.members.map(s=>({id:G(s.id),name:G(s.name)||G(s.id),...s.role?{role:G(s.role)}:{}})):[],r=t.overview&&typeof t.overview=="object"?t.overview:null,i=r?mt({purpose:G(r.purpose).trimEnd(),scope:G(r.scope).trimEnd(),environment:G(r.environment).trimEnd(),references:G(r.references).trimEnd(),terms:Array.isArray(r.terms)?r.terms.map(s=>({term:G(s.term),desc:G(s.desc)})).filter(s=>s.term):void 0,owner:G(r.owner),contractor:G(r.contractor),docVersion:G(r.doc_version),place:G(r.place)}):void 0;return{version:Number(t.version??1),title:G(t.title),language:t.language==="en"?"en":"vi",...t.ba?{ba:G(t.ba)}:{},members:n,...i&&Object.keys(i).length?{overview:i}:{}}}function Iy(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?mt({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+es(mt({version:e.version,title:e.title,language:e.language,ba:e.ba,members:e.members.map(i=>mt({...i})),overview:r}))}function Py(e,t){let{front:n,body:r}=ns(e),i=G(n.code);if(!Zr.test(i))throw new Error(`m\xE3 ph\xE2n h\u1EC7 \xAB${i}\xBB sai m\u1EABu`);return{code:i,title:G(n.title),order:Number(n.order??0),suites:Wo(n.suites),commonSteps:r.trim(),file:t}}function Oy(e){return`---
5269
- ${es(mt({code:e.code,title:e.title,order:e.order,suites:e.suites}))}---
5313
+ `,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,`
5314
+ `),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`---
5315
+ ${os(gt({code:e.code,title:e.title,order:e.order,suites:e.suites}))}---
5270
5316
  ${e.commonSteps.trim()?e.commonSteps.trim()+`
5271
- `:""}`}function Ry(e){if(!e||typeof e!="object")return;let t=e;return{status:Ko(t.status,Je,"not-run"),...t.actual?{actual:G(t.actual)}:{},...t.by?{by:G(t.by)}:{},...t.at?{at:G(t.at)}:{},...t.env?{env:G(t.env)}:{},...t.bug?{bug:G(t.bug)}:{}}}function Ly(e){let t=Bu(e.deleted),n=Ry(e.result),r=Du(e.priority,pn);return{code:G(e.code),case:G(e.case).trimEnd(),...e.requirement?{requirement:G(e.requirement).trimEnd()}:{},steps:G(e.steps).trimEnd(),expected:G(e.expected).trimEnd(),...r?{priority:r}:{},...e.tag?{tag:G(e.tag)}:{},...n?{result:n}:{},...t?{deleted:{...t,...e.deleted.reason?{reason:G(e.deleted.reason)}:{}}}:{}}}function My(e,t){let{front:n,body:r}=ns(e),i=/^#\s+(\S+)\s*(?:·\s*(.*))?$/m.exec(r),s=i?.[1]??"",a=ei.exec(s);if(!a)throw new Error(`thi\u1EBFu ti\xEAu \u0111\u1EC1 \xAB# KB-<PH>-XXXXXX \xB7 T\xEAn\xBB ho\u1EB7c m\xE3 sai m\u1EABu (\xAB${s}\xBB)`);let o=r.slice((i?.index??0)+(i?.[0].length??0)),c=[],l=o.indexOf(jo);if(l>=0){let p=l+jo.length,m=o.indexOf("\n```",p);if(m<0)throw new Error("kh\u1ED1i ```yaml pt:cases``` kh\xF4ng c\xF3 d\u1EA5u \u0111\xF3ng");let f=(0,Cn.parse)(o.slice(p,m));if(f!==null&&!Array.isArray(f))throw new Error("kh\u1ED1i pt:cases ph\u1EA3i l\xE0 danh s\xE1ch");c=(f??[]).map(h=>Ly(h??{})),o=o.slice(0,l)+o.slice(m+4)}let u=Du(n.priority,pn),d=Bu(n.created);return{code:s,module:a[1],title:(i?.[2]??"").trim(),kind:Ko(n.kind,jc,"functional"),status:Ko(n.status,Wc,"drafting"),covers:Wo(n.covers),useCases:Wo(n.use_cases),...u?{priority:u}:{},...n.preconditions?{preconditions:G(n.preconditions).trimEnd()}:{},...n.owner?{owner:G(n.owner)}:{},...d?{created:d}:{},...n.source?{source:G(n.source)}:{},description:o.trim(),cases:c,file:t}}function Dy(e){return mt({code:e.code,case:e.case,requirement:e.requirement,steps:e.steps,expected:e.expected,priority:e.priority,tag:e.tag,result:e.result?mt({...e.result}):void 0,deleted:e.deleted?mt({...e.deleted}):void 0})}function By(e){let n=[`---
5272
- ${es(mt({kind:e.kind,status:e.status,covers:e.covers,use_cases:e.useCases,priority:e.priority,preconditions:e.preconditions,owner:e.owner,created:e.created,source:e.source}))}---
5317
+ `:""}`}function jy(e){if(!e||typeof e!="object")return;let t=e;return{status:Xo(t.status,et,"not-run"),...t.actual?{actual:z(t.actual)}:{},...t.by?{by:z(t.by)}:{},...t.at?{at:z(t.at)}:{},...t.env?{env:z(t.env)}:{},...t.bug?{bug:z(t.bug)}:{}}}function Wy(e){let t=qu(e.deleted),n=jy(e.result),r=Fu(e.priority,hn);return{code:z(e.code),case:z(e.case).trimEnd(),...e.requirement?{requirement:z(e.requirement).trimEnd()}:{},steps:z(e.steps).trimEnd(),expected:z(e.expected).trimEnd(),...r?{priority:r}:{},...e.tag?{tag:z(e.tag)}:{},...n?{result:n}:{},...t?{deleted:{...t,...e.deleted.reason?{reason:z(e.deleted.reason)}:{}}}:{}}}function Ky(e,t){let{front:n,body:r}=cs(e),i=/^#\s+(\S+)\s*(?:·\s*(.*))?$/m.exec(r),s=i?.[1]??"",a=oi.exec(s);if(!a)throw new Error(`thi\u1EBFu ti\xEAu \u0111\u1EC1 \xAB# KB-<PH>-XXXXXX \xB7 T\xEAn\xBB ho\u1EB7c m\xE3 sai m\u1EABu (\xAB${s}\xBB)`);let o=r.slice((i?.index??0)+(i?.[0].length??0)),c=[],l=o.indexOf(zo);if(l>=0){let p=l+zo.length,h=o.indexOf("\n```",p);if(h<0)throw new Error("kh\u1ED1i ```yaml pt:cases``` kh\xF4ng c\xF3 d\u1EA5u \u0111\xF3ng");let f=(0,An.parse)(o.slice(p,h));if(f!==null&&!Array.isArray(f))throw new Error("kh\u1ED1i pt:cases ph\u1EA3i l\xE0 danh s\xE1ch");c=(f??[]).map(m=>Wy(m??{})),o=o.slice(0,l)+o.slice(h+4)}let u=Fu(n.priority,hn),d=qu(n.created);return{code:s,module:a[1],title:(i?.[2]??"").trim(),kind:Xo(n.kind,Gc,"functional"),status:Xo(n.status,zc,"drafting"),covers:Vo(n.covers),useCases:Vo(n.use_cases),...u?{priority:u}:{},...n.preconditions?{preconditions:z(n.preconditions).trimEnd()}:{},...n.owner?{owner:z(n.owner)}:{},...d?{created:d}:{},...n.source?{source:z(n.source)}:{},description:o.trim(),cases:c,file:t}}function Gy(e){return gt({code:e.code,case:e.case,requirement:e.requirement,steps:e.steps,expected:e.expected,priority:e.priority,tag:e.tag,result:e.result?gt({...e.result}):void 0,deleted:e.deleted?gt({...e.deleted}):void 0})}function zy(e){let n=[`---
5318
+ ${os(gt({kind:e.kind,status:e.status,covers:e.covers,use_cases:e.useCases,priority:e.priority,preconditions:e.preconditions,owner:e.owner,created:e.created,source:e.source}))}---
5273
5319
  # ${e.code} \xB7 ${e.title}
5274
5320
  `];return e.description.trim()&&n.push(`
5275
5321
  ${e.description.trim()}
5276
5322
  `),n.push(`
5277
- ${jo}
5278
- ${e.cases.length?es(e.cases.map(Dy)):`[]
5323
+ ${zo}
5324
+ ${e.cases.length?os(e.cases.map(Gy)):`[]
5279
5325
  `}\`\`\`
5280
- `),n.join("")}function $y(e){return Pe.posix.join(Yt,e.module,`${e.code}.md`)}function Fy(e){return Pe.posix.join(Yt,e,Mu)}function Ke(e){let t=Ny(ht.readFileSync(Pe.join(e,Jt),"utf8")),n=[],r=[],i=[],s=Pe.join(e,Yt),a=ht.existsSync(s)?ht.readdirSync(s,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name).sort():[];for(let o of a)for(let c of ht.readdirSync(Pe.join(s,o)).sort()){if(!c.endsWith(".md"))continue;let l=Pe.posix.join(Yt,o,c);try{let u=ht.readFileSync(Pe.join(e,l),"utf8");c===Mu?n.push(Py(u,l)):r.push(My(u,l))}catch(u){i.push({file:l,message:u.message})}}return n.sort((o,c)=>o.order-c.order||o.code.localeCompare(c.code)),{root:e,config:t,modules:n,suites:r,readErrors:i}}function Go(e,t){ht.mkdirSync(Pe.dirname(e),{recursive:!0});let n=`${e}.${process.pid}.tmp`;ht.writeFileSync(n,t),ht.renameSync(n,e)}function Ge(e,t){t.file=$y(t),Go(Pe.join(e,t.file),By(t))}function zo(e,t){t.file=Fy(t.code),Go(Pe.join(e,t.file),Oy(t))}function $u(e,t){Go(Pe.join(e,Jt),Iy(t))}var Cn,Jt,Yt,Mu,jo,_y,G,Wo,En=Ae(()=>{"use strict";S();Cn=Qg(Lu(),1);hn();Qr();Jt=".pantest.yaml",Yt="modules",Mu="_module.md",jo="```yaml pt:cases";_y={lineWidth:0,blockQuote:"literal"};G=e=>e==null?"":String(e),Wo=e=>Array.isArray(e)?e.map(t=>String(t)):e?[String(e)]:[]});import Vo from"node:fs";import rs from"node:path";function qu(e,t,n=0){if(n>8)return;let r;try{r=Vo.readdirSync(e,{withFileTypes:!0})}catch{return}for(let i of r)i.isDirectory()?!qy.has(i.name)&&!i.name.startsWith(".")&&qu(rs.join(e,i.name),t,n+1):Fu.test(i.name)&&t.push(rs.join(e,i.name))}function Qt(e){let t=new Map,n=[];qu(e,n);for(let r of n){let i=Fu.exec(rs.basename(r))[1];try{let{front:s,body:a}=ns(Vo.readFileSync(r,"utf8")),o=/^#\s+(\S+)\s*(?:·\s*(.*))?$/m.exec(a);if(o?.[1]!==i)continue;t.set(i,{code:i,title:(o[2]??"").trim(),type:String(s.type??""),deleted:s.status==="deleted"})}catch{}}return t}function ft(e,t){if(!t)return null;let n=rs.resolve(e,t);return Vo.existsSync(n)?n:null}var Fu,qy,hr=Ae(()=>{"use strict";S();En();Fu=/^([A-Z][A-Z0-9]*-[A-Z0-9]+-[A-Z0-9]+)\.md$/,qy=new Set([".git","node_modules",".pan-ba","dist","build"])});import{execFileSync as Xo}from"node:child_process";import mr from"node:fs";import is from"node:path";function gt(e){let t=process.env.PAN_TEST_ME?.trim();if(t)return t;try{let n=Xo("git",["-C",e,"config","user.name"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(n)return n}catch{}return process.env.USER??process.env.USERNAME??"unknown"}function ss(e,t=[]){let n=new Set(t);for(let r of e.suites){n.add(r.code);for(let i of r.cases)n.add(i.code)}return n}function Bt(e){let t=new Set;try{let n=Xo("git",["-C",e,"for-each-ref","--format=%(refname)","refs/heads","refs/remotes"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).split(`
5281
- `).filter(Boolean);for(let r of n){let i=Xo("git",["-C",e,"grep","-h","-o","-E","(KB|TC)-[A-Z][A-Z0-9]{1,11}-[A-Z0-9]{6}",r,"--",Yt],{encoding:"utf8",stdio:["ignore","pipe","ignore"],maxBuffer:67108864});for(let s of i.split(`
5282
- `)){let a=s.slice(s.lastIndexOf(":")+1).trim();a&&t.add(a)}}}catch{}return t}function Uu(e,t){let n=is.resolve(e);if(mr.existsSync(is.join(n,Jt)))throw new K(j(`${n} \u0111\xE3 l\xE0 repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (${Jt})`,`${n} is already a test document repo (${Jt})`));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"}]:[]};$u(n,r),mr.mkdirSync(is.join(n,Yt),{recursive:!0});let i=is.join(n,".gitignore"),s=mr.existsSync(i)?mr.readFileSync(i,"utf8"):"";return/^\/?exports\/?$/m.test(s)||mr.writeFileSync(i,s+(s&&!s.endsWith(`
5326
+ `),n.join("")}function Vy(e){return Ie.posix.join(Qt,e.module,`${e.code}.md`)}function Xy(e){return Ie.posix.join(Qt,e,$u)}function Ge(e){let t=Fy(ft.readFileSync(Ie.join(e,Zt),"utf8")),n=[],r=[],i=[],s=Ie.join(e,Qt),a=ft.existsSync(s)?ft.readdirSync(s,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name).sort():[];for(let o of a)for(let c of ft.readdirSync(Ie.join(s,o)).sort()){if(!c.endsWith(".md"))continue;let l=Ie.posix.join(Qt,o,c);try{let u=ft.readFileSync(Ie.join(e,l),"utf8");c===$u?n.push(Hy(u,l)):r.push(Ky(u,l))}catch(u){i.push({file:l,message:u.message})}}return n.sort((o,c)=>o.order-c.order||o.code.localeCompare(c.code)),{root:e,config:t,modules:n,suites:r,readErrors:i}}function Yo(e,t){ft.mkdirSync(Ie.dirname(e),{recursive:!0});let n=`${e}.${process.pid}.tmp`;ft.writeFileSync(n,t),ft.renameSync(n,e)}function ze(e,t){t.file=Vy(t),Yo(Ie.join(e,t.file),zy(t))}function Jo(e,t){t.file=Xy(t.code),Yo(Ie.join(e,t.file),Uy(t))}function Hu(e,t){Yo(Ie.join(e,Zt),qy(t))}var An,Zt,Qt,$u,zo,$y,z,Vo,_n=Se(()=>{"use strict";S();An=lb(Bu(),1);fn();si();Zt=".pantest.yaml",Qt="modules",$u="_module.md",zo="```yaml pt:cases";$y={lineWidth:0,blockQuote:"literal"};z=e=>e==null?"":String(e),Vo=e=>Array.isArray(e)?e.map(t=>String(t)):e?[String(e)]:[]});import Qo from"node:fs";import ds from"node:path";function ju(e,t,n=0){if(n>8)return;let r;try{r=Qo.readdirSync(e,{withFileTypes:!0})}catch{return}for(let i of r)i.isDirectory()?!Yy.has(i.name)&&!i.name.startsWith(".")&&ju(ds.join(e,i.name),t,n+1):Uu.test(i.name)&&t.push(ds.join(e,i.name))}function bt(e){let t=new Map,n=[];ju(e,n);for(let r of n){let i=Uu.exec(ds.basename(r))[1];try{let{front:s,body:a}=cs(Qo.readFileSync(r,"utf8")),o=/^#\s+(\S+)\s*(?:·\s*(.*))?$/m.exec(a);if(o?.[1]!==i)continue;t.set(i,{code:i,title:(o[2]??"").trim(),type:String(s.type??""),deleted:s.status==="deleted"})}catch{}}return t}function Ve(e,t){if(!t)return null;let n=ds.resolve(e,t);return Qo.existsSync(n)?n:null}var Uu,Yy,Nn=Se(()=>{"use strict";S();_n();Uu=/^([A-Z][A-Z0-9]*-[A-Z0-9]+-[A-Z0-9]+)\.md$/,Yy=new Set([".git","node_modules",".pan-ba","dist","build"])});import{execFileSync as Zo}from"node:child_process";import br from"node:fs";import ps from"node:path";function vt(e){let t=process.env.PAN_TEST_ME?.trim();if(t)return t;try{let n=Zo("git",["-C",e,"config","user.name"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(n)return n}catch{}return process.env.USER??process.env.USERNAME??"unknown"}function us(e,t=[]){let n=new Set(t);for(let r of e.suites){n.add(r.code);for(let i of r.cases)n.add(i.code)}return n}function Ft(e){let t=new Set;try{let n=Zo("git",["-C",e,"for-each-ref","--format=%(refname)","refs/heads","refs/remotes"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).split(`
5327
+ `).filter(Boolean);for(let r of n){let i=Zo("git",["-C",e,"grep","-h","-o","-E","(KB|TC)-[A-Z][A-Z0-9]{1,11}-[A-Z0-9]{6}",r,"--",Qt],{encoding:"utf8",stdio:["ignore","pipe","ignore"],maxBuffer:67108864});for(let s of i.split(`
5328
+ `)){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(`
5283
5329
  `)?`
5284
5330
  `:"")+`exports/
5285
- `),r}function as(e,t,n){if(!Zr.test(t))throw new K(j(`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(j(`\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 zo(e.root,r),e.modules.push(r),r}function fr(e,t,n){let r=os(e,t);return Object.assign(r,n),zo(e.root,r),r}function os(e,t){let n=e.modules.find(r=>r.code===t);if(!n)throw new K(j(`Kh\xF4ng c\xF3 ph\xE2n h\u1EC7 ${t}.`,`No module ${t}.`));return n}function Zt(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 ls(e,t){let n=os(e,t.module);if(!t.title.trim())throw new K(j("K\u1ECBch b\u1EA3n c\u1EA7n t\xEAn.","The test suite needs a name."));let r=t.by??gt(e.root),i={code:un("KB",n.code,ss(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:Hu()},description:"",cases:[],file:""};Ge(e.root,i),e.suites.push(i);let s=Zt(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),fr(e,n.code,{suites:s}),i}function ju(e,t){let n=e.suites.find(r=>r.code===t);if(!n)throw new K(j(`Kh\xF4ng c\xF3 k\u1ECBch b\u1EA3n ${t}.`,`No test suite ${t}.`));return n}function Wu(e,t,n){let r=ju(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 Ge(e.root,r),r}function cs(e,t,n,r={}){let i=ju(e,t);if(!n.case.trim())throw new K(j("T\xECnh hu\u1ED1ng c\u1EA7n m\xF4 t\u1EA3.","The test case needs a description."));let s={code:un("TC",i.module,ss(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),Ge(e.root,i),s}function ds(e,t){if(!ti.test(t))throw new K(j(`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(j(`Kh\xF4ng c\xF3 t\xECnh hu\u1ED1ng ${t}.`,`No test case ${t}.`))}function ps(e,t,n){let{suite:r,tc:i}=ds(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 Ge(e.root,r),i}function Ku(e,t,n){let{suite:r,tc:i}=ds(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]],Ge(e.root,r)),i}function us(e,t,n="",r){let{suite:i,tc:s}=ds(e,t);return s.deleted={by:r??gt(e.root),at:Hu(),...n?{reason:n}:{}},Ge(e.root,i),s}function hs(e,t,n){if(!Je.includes(n.status))throw new K(j(`Tr\u1EA1ng th\xE1i \xAB${n.status}\xBB kh\xF4ng h\u1EE3p l\u1EC7 (${Je.join(" | ")}).`,`Invalid status \xAB${n.status}\xBB (${Je.join(" | ")}).`));let{suite:r,tc:i}=ds(e,t);if(n.status==="failed"&&!(n.actual??"").trim())throw new K(j("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??gt(e.root),at:n.at??Hy()};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 Ge(e.root,r),i}var K,Hy,Hu,gr=Ae(()=>{"use strict";S();Dn();hn();En();Qr();K=class extends Error{},Hy=()=>new Date().toISOString().slice(0,10),Hu=()=>new Date().toISOString().replace(/\.\d{3}Z$/,"Z")});function ms(e,t){let n=[],r=Uy[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),ei.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 m=ti.exec(p.code);m?m[1]!==l.module&&!p.deleted&&n.push({rule:"E02",severity:"error",code:p.code,file:l.file,message:r.E02mod(p.code,m[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 m=t.get(p);m?m.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 m=[!p.steps.trim()&&r.steps,!p.expected.trim()&&r.expected].filter(Boolean);m.length&&n.push({rule:"T03",severity:"warn",code:p.code,file:l.file,message:r.T03(p.code,m.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 br(){return{total:0,"not-run":0,passed:0,failed:0,blocked:0,skipped:0}}function Qo(e,t=br()){for(let n of e.cases)n.deleted||(t.total++,t[n.result?.status??"not-run"]++);return t}function fs(e,t){let n=br(),r=e.modules.map(s=>{let a=e.suites.filter(c=>c.module===s.code&&c.status!=="deleted"),o=br();for(let c of a)Qo(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 Uy,gs=Ae(()=>{"use strict";S();hn();Uy={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 Pr(e){"@babel/helpers - typeof";return Pr=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},Pr(e)}function Wy(e,t){if(Pr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Pr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ky(e){var t=Wy(e,"string");return Pr(t)=="symbol"?t:t+""}function C(e,t,n){return(t=Ky(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gu(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?Gu(Object(n),!0).forEach(function(r){C(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zy(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 Yl(e,t){if(e==null)return{};var n,r,i=zy(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 AC(e,t){return EC(e,t||{},0,0)}function _C(e,t){return xC(e,{i:2},t&&t.out,t&&t.dictionary)}function Sh(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(Th)return Th.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 Wr(s,0,a)}function IC(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($l)return $l.decode(e);var i=NC(e),s=i.s,n=i.r;return n.length&&Ce(8),s}}function MC(e,t){t||(t={});var n={},r=[];Rf(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=Sh(a),p=d.length,m=l.comment,f=m&&Sh(m),h=f&&f.length,g=Fl(l.extra);p>65535&&Ce(11);var y=u?AC(c,l):c,x=y.length,b=CC();b.p(c),r.push(Of(l,{size:c.length,crc:b.d(),c:y,f:d,m:f,u:p!=a.length||f&&m.length!=h,o:i,compression:u})),i+=30+p+g+x,s+=76+2*(p+g)+(h||0)+x}for(var E=new oe(s+22),_=i,v=s-i,T=0;T<r.length;++T){var d=r[T];Ch(E,d.o,d,d.f,d.u,d.c.length);var w=30+d.f.length+Fl(d.extra);E.set(d.c,d.o+w),Ch(E,i,d,d.f,d.u,d.c.length,d.o,d.m),i+=16+w+(d.m?d.m.length:0)}return LC(E,i,r.length,v,_),E}function DC(e,t){for(var n={},r=e.length-22;De(e,r)!=101010256;--r)(!r||e.length-r>65558)&&Ce(13);var i=nt(e,r+8);if(!i)return{};var s=De(e,r+16),a=De(e,r-20)==117853008;if(a){var o=De(e,r-12);a=De(e,o)==101075792,a&&(i=De(e,o+32),s=De(e,o+48))}for(var c=t&&t.filter,l=0;l<i;++l){var u=OC(e,s,a),d=u[0],p=u[1],m=u[2],f=u[3],h=u[4],g=u[5],y=PC(e,g);s=h,(!c||c({name:f,size:p,originalSize:m,compression:d}))&&(d?d==8?n[f]=_C(e.subarray(y,y+p),{out:new oe(m)}):Ce(14,"unknown compression type "+d):n[f]=Wr(e,y,y+p))}return n}function Nh(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 jt(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function a(c){Nh(s,r,i,a,o,"next",c)}function o(c){Nh(s,r,i,a,o,"throw",c)}a(void 0)})}}var jy,Fr,zh,Fs,Gy,I,kt,H,Vh,_e,Vy,Xy,Yy,Xh,Ts,Jy,Qy,qr,Zy,Yh,Ps,ex,Zo,Jh,Qh,U,Zh,em,tx,Jl,nx,rx,ix,tm,le,qs,nm,zu,Ql,sx,$t,rm,im,rt,ax,ve,ox,sm,lx,cx,dx,P,el,am,it,vr,Er,en,O,pe,om,Zl,lm,cm,dm,ec,px,ux,hx,Vu,mx,Xu,fx,gx,bx,vx,Yu,wx,yx,xx,tc,kx,nc,Hr,ue,Ur,Tx,Sx,Cx,Ex,Hs,rc,Sr,pm,Ax,um,_x,nn,rn,Ft,qt,Nx,Ix,Px,Ox,Us,Rx,qe,Lx,Mx,Dx,Bx,$x,Fx,qx,Hx,Ux,jx,et,HI,Wx,Kx,Gx,Ju,ze,Rn,zx,Vx,Xx,UI,Yx,hm,Jx,Qx,Ln,wr,mm,Zx,ek,tk,nk,rk,ik,tl,fm,sk,ak,gm,ok,sn,lk,ck,Or,bs,dk,Fe,Oe,ic,pk,bm,uk,hk,mk,fk,gk,bk,vk,sc,vm,wm,wk,yk,xk,kk,Tk,ym,Sk,Rr,xm,Ck,Ek,km,Tm,Ak,Sm,Cm,Em,ac,_k,Nk,at,ot,Xe,Be,oc,Ik,Am,Pk,Ok,Rk,_m,Lk,Mk,Nm,Im,_l,lc,Pm,Dk,Om,Bk,$k,Fk,qk,Hk,Uk,jk,Wk,Kk,Gk,cc,zk,Nl,Vk,Xk,nl,Qu,js,Rm,Yk,Jk,jr,Qk,be,Zk,e1,Zu,t1,n1,r1,i1,s1,a1,o1,l1,c1,d1,p1,Ws,u1,h1,Mm,m1,Pn,f1,Ks,Cr,eh,g1,b1,v1,vs,w1,y1,dc,x1,pc,Dm,k1,T1,S1,Bm,Fm,qm,C1,E1,A1,_1,Hm,Os,ws,N1,I1,P1,O1,Um,R1,L1,rl,M1,D1,On,th,ne,B1,jI,Wm,$1,F1,In,nh,il,q1,Km,H1,U1,rh,j1,W1,K1,G1,Rs,z1,V1,X1,Y1,tt,Ss,Il,J1,zm,$e,Lr,Cs,Vm,uc,Q1,Z1,ih,eT,Es,tT,nT,rT,iT,sT,aT,oT,lT,Xm,cT,dT,pT,uT,hT,Ym,mT,sh,fT,gT,Jm,bT,Mr,Pl,An,vT,Qm,sl,wT,yT,xT,kT,Zm,TT,ST,CT,hc,ET,AT,ef,_T,Ls,Ar,NT,Gs,tf,IT,PT,OT,bt,ge,RT,Ol,zs,LT,MT,ah,DT,BT,$T,FT,qT,HT,UT,jT,WT,KT,GT,zT,rf,VT,sf,oh,al,XT,af,YT,of,lf,JT,QT,ZT,eS,tS,nS,cf,lh,ol,rS,df,iS,sS,aS,oS,lS,pf,vt,cS,dS,pS,uS,hS,mS,fS,gS,bS,vS,wS,ll,yS,xS,ch,kS,TS,SS,CS,uf,hf,ES,AS,dh,ph,_S,NS,uh,IS,PS,OS,hh,mh,RS,LS,MS,mf,DS,BS,$S,mc,Tt,an,Ut,FS,qS,HS,US,jS,WS,KS,GS,zS,VS,XS,ff,fh,wt,gf,bf,vf,wf,yf,xf,YS,JS,QS,_r,fc,gh,bh,Rl,ZS,eC,cl,tC,nC,rC,iC,sC,aC,gc,vh,kf,oC,dl,lC,cC,wh,dC,Tf,As,pl,ul,hl,pC,uC,hC,Ye,Sf,Cf,on,bc,mC,oe,Le,vc,Vs,Xs,Ll,Ef,Af,_f,Ml,Nf,fC,yh,Dl,yt,Y,st,Ht,Y,Y,Y,Y,Dr,Y,gC,bC,vC,wC,ml,Ve,fl,wc,Wr,yC,Ce,xC,xt,yr,gl,Bl,xh,xr,If,kh,kC,Pf,TC,SC,CC,EC,Of,nt,De,bl,ke,Rf,Th,$l,NC,PC,OC,RC,Fl,Ch,LC,BC,Ms,$C,Eh,Lf,vl,_s,Ah,ql,FC,qC,HC,Br,Kr,Hl,Nr,UC,jC,WC,KC,GC,zC,VC,Mf,XC,YC,JC,Df,kr,wl,QC,ZC,ln,Bf,$f,eE,Ff,tE,nE,yl,rE,yc,iE,sE,_h,aE,oE,Ih,Ph,xc,qf,Hf,lE,cE,Ys,lt,Uf,jf,Te,Wf,_n,dE,pE,uE,kc,Ul,$r,Oh,hE,Rh,Lh,jl,mE,Mh,Dh,fE,gE,bE,vE,wE,Wl,Tc,yE,Ds,Kf,xE,kE,Se,TE,Js,Gf,Bh,SE,CE,Kl,Gl,EE,AE,_E,NE,IE,PE,OE,RE,zf,LE,ys,ME,DE,xs,Vf,BE,$h,$E,FE,ks,qE,HE,Fh,UE,jE,WE,qh,KE,zl,xl,GE,zE,VE,Xf,Ns,XE,YE,Yf,Bs,Gr,JE,Jf,QE,ZE,e2,Tr,Qf,kl,Hh,Zf,Sc,Tl,t2,Uh,n2,Cc,r2,i2,s2,a2,o2,Vl,l2,c2,eg,d2,Sl,jh,tn,tg,p2,u2,ng,h2,m2,f2,Cl,g2,Ir,Xl,Is,Wh,b2,v2,w2,y2,x2,k2,T2,S2,rg,C2,E2,A2,_2,ig,N2,I2,$s,P2,sg,O2,R2,ag,og,L2,lg,Kh,M2,D2,B2,Gh,WI,$2,KI,El,F2,cg=Ae(()=>{S();jy=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);Fr=class{constructor(e){C(this,"rootKey",void 0),this.rootKey=e}get writtenAs(){}},zh=e=>e instanceof Fr||typeof e=="object"&&e!==null&&typeof e.prepForXml=="function",Fs=e=>zh(e)?e.rootKey:void 0,Gy=Object.seal({}),I=class extends Fr{constructor(e){super(e),C(this,"root",void 0),this.root=new Array}prepForXml(e){var t;e.stack.push(this);let n=this.root.flatMap(r=>{if(zh(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:Gy}}addChildElement(e){return this.root.push(e),this}},kt=class extends I{constructor(e,t){super(e),C(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 Fr{constructor(e){super("_attr"),C(this,"root",void 0),C(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}}},Vh=class extends Fr{constructor(e){super("_attr"),C(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),C(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"})}};Vy=["elements"],Xy=new Map([["amp","&"],["lt","<"],["gt",">"],["quot",'"'],["apos","'"]]),Yy=/&([^;]*);?/g,Xh=e=>e.indexOf("&")===-1?e:e.replace(Yy,(t,n)=>{if(!t.endsWith(";"))throw new Error(`Invalid XML: "&" that starts no entity, in "${e}"`);let r=Xy.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)}),Ts=e=>e===" "||e===`
5286
- `||e===" "||e==="\r",Jy=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,Qy=e=>Object.fromEntries([...e.matchAll(Jy)].map(([,t,n,r])=>[t,n??r])),qr=(e,{keepWhitespaceText:t=!1}={})=>{let n={},r=[],i=e.charCodeAt(0)===65279?1:0;for(;i<e.length&&Ts(e[i]);)i++;let s=d=>{var p;let m=r.length===0?n:r[r.length-1];((p=m.elements)!==null&&p!==void 0?p:m.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:Xh(d)})},o=(d,p,m)=>{let f=e.indexOf(d,p);if(f===-1)throw new Error(`Invalid XML: ${m} 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"),m=e.slice(d+2,p),f=m.search(/\s/),h=f===-1?m:m.slice(0,f),g=f===-1?"":m.slice(f).trimStart();if(h.toLowerCase()==="xml"){let y=Qy(g);n.declaration=Object.keys(y).length>0?{attributes:y}:{}}else s({type:"instruction",name:h,instruction:g});i=p+2}else if(e.startsWith("<!--",d)){let p=o("-->",d+4,"comment"),m=e.slice(d+4,p);m!==""&&s({type:"comment",comment:m}),i=p+3}else if(e.startsWith("<![CDATA[",d)){let p=o("]]>",d+9,"CDATA section"),m=e.slice(d+9,p);m!==""&&s({type:"cdata",cdata:m}),i=p+3}else if(e.startsWith("<!DOCTYPE",d)){let p=d+9,m,f=!1;for(;p<e.length;p++){let h=e[p];if(m!==void 0)m=h===m?void 0:m;else if(h==='"'||h==="'")m=h;else if(h==="[")f=!0;else if(h==="]")f=!1;else if(h===">"&&!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"),m=e.slice(d+2,p).trimEnd(),f=r.pop();if(f?.name!==m){var c;throw new Error(`Invalid XML: closing tag </${m}> doesn't match <${(c=f?.name)!==null&&c!==void 0?c:""}>`)}i=p+1}else i=Zy(e,d+1,(p,m)=>{s(p),m||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=Yl(n,Vy);return l===void 0?u:k(k({},u),{},{elements:l})},Zy=(e,t,n)=>{let r=t;for(;r<e.length&&!Ts(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&&Ts(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&&Ts(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,Xh(e.slice(l+1,d))]),a=d+1}},Yh=new Map([["&","&amp;"],['"',"&quot;"],["'","&apos;"],["<","&lt;"],[">","&gt;"]]),Ps=e=>e.replace(/[&"'<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var n;return(n=Yh.get(t))!==null&&n!==void 0?n:""}),ex=e=>e.replace(/[&<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var n;return(n=Yh.get(t))!==null&&n!==void 0?n:""}),Zo=e=>typeof e=="string"?Ps(e):e,Jh=(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(Zo(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(Jh(d,t,n+1)):(a.pop(),u=!0,a.push(Zo(d)));u||a.push("")}}}else a.push(Zo(i));return{name:r,attributes:s,content:a,indents:n>1?t.repeat(n-1):""}},Qh=(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?`
5331
+ `),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===`
5332
+ `||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?`
5287
5333
  `:"");return o===0?c+(t?`
5288
- `:""):c+s.map(l=>l===void 0?"":Qh(l,t,!1)).join("")+(o>1?a:"")+(r?`</${r}>`:"")+(t&&!n?`
5289
- `:"")},U=(e,{indent:t="",declaration:n}={})=>{let r=Array.isArray(e)?e:[e],i=t?1:0,s=n?.standalone?` standalone="${Ps(n.standalone)}"`:"";return(n===void 0?"":`<?xml version="1.0" encoding="${Ps(n.encoding||"UTF-8")}"${s}?>${t?`
5290
- `:""}`)+r.map((a,o)=>Qh(Jh(a,t,i),t,o===r.length-1)).join("")},Zh=e=>Object.entries(e??{}).flatMap(([t,n])=>n==null?[]:[` ${t}="${Ps(String(n))}"`]).join(""),em=e=>{switch(e.type){case"element":{var t,n;let r=(t=e.elements)!==null&&t!==void 0?t:[],i=`<${e.name}${Zh(e.attributes)}`;return r.length>0||((n=e.attributes)===null||n===void 0?void 0:n["xml:space"])==="preserve"?`${i}>${r.map(em).join("")}</${e.name}>`:`${i}/>`}case"text":return ex(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""}},tx=e=>{var t;return(e.declaration?`<?xml${Zh(e.declaration.attributes)}?>`:"")+((t=e.elements)!==null&&t!==void 0?t:[]).map(em).join("")},Jl=e=>{switch(e.type){case void 0:case"element":let t=new rx(e.name,e.attributes),n=e.elements||[];for(let r of n){let i=Jl(r);i!==void 0&&t.push(i)}return t;case"text":return e.text;default:return}},nx=class extends H{},rx=class extends I{static fromXmlString(e){return Jl(qr(e))}constructor(e,t){super(e),t&&this.root.push(new nx(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)}},ix=class extends I{constructor(e){super(""),C(this,"_attr",void 0),this._attr=e}prepForXml(e){return{_attr:this._attr}}},tm=class extends I{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)},qs=e=>{let t=le(e);if(t<0)throw new Error(`Invalid value '${e}' specified. Must be a positive integer.`);return t},nm=(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},zu=e=>nm(e,1),Ql=e=>{let t=e.slice(-2),n=e.substring(0,e.length-2);return`${Number(n)}${t}`},sx={in:1440,cm:1440/2.54,mm:1440/25.4,pt:20,pc:240,pi:240},$t=e=>{if(typeof e=="number")return e;let t=e.slice(-2),n=Number(e.substring(0,e.length-2)),r=sx[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},rm=e=>{let t=Ql(e);if(parseFloat(t)<0)throw new Error(`Invalid value '${t}' specified. Expected a positive number.`);return t},im=e=>e==="auto"?e:nm(e.charAt(0)==="#"?e.substring(1):e,3),rt=e=>typeof e=="string"?Ql(e):le(e),ax=e=>typeof e=="string"?rm(e):qs(e),ve=e=>typeof e=="string"?rm(e):qs(e),ox=e=>{let t=e.substring(0,e.length-1);return`${Number(t)}%`},sm=e=>typeof e=="number"?le(e):e.slice(-1)==="%"?ox(e):Ql(e),lx=qs,cx=qs,dx=e=>e.toISOString(),P=class extends I{constructor(e,t=!0){super(e),t!==!0&&this.root.push(new _e({val:t}))}},el=class extends I{constructor(e,t){super(e),this.root.push(new _e({val:ax(t)}))}},am=class extends I{},it=class extends I{constructor(e,t){super(e),this.root.push(new _e({val:t}))}},vr=(e,t)=>new O({name:e,attributes:{value:{key:"w:val",value:t}}}),Er=class extends I{constructor(e,t){super(e),this.root.push(new _e({val:t}))}},en=class extends I{constructor(e,t){super(e),this.root.push(t)}},O=class extends I{constructor({name:e,attributes:t,children:n}){super(e),t&&this.root.push(new Vh(t)),n&&this.root.push(...n)}},pe={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"},om=e=>new O({name:"w:jc",attributes:{val:{key:"w:val",value:e}}}),Zl={dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hyperlink:"hlink",followedHyperlink:"folHlink"},lm={dark2:"44546A",light2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hyperlink:"0563C1",followedHyperlink:"954F72"},cm={dark1:{value:"windowText",lastColor:"000000"},light1:{value:"window",lastColor:"FFFFFF"}},dm=(e,t)=>{if(t==="auto")throw new Error(`Invalid theme color ${e} 'auto'. Expected 6 digit hex value`);return im(t)},ec=(e={})=>Object.fromEntries(Object.keys(Zl).map(t=>{let n=e[t],r=t==="dark1"||t==="light1"?cm[t].lastColor:lm[t];return[t,n===void 0?r:dm(t,n)]})),px=(e,t)=>new O({name:"a:srgbClr",attributes:{value:{key:"val",value:dm(e,t)}}}),ux=(e,t)=>{let n=t[e],r=e==="dark1"||e==="light1"?cm[e]:void 0;return new O({name:`a:${Zl[e]}`,children:[n===void 0&&r?new O({name:"a:sysClr",attributes:{value:{key:"val",value:r.value},lastColor:{key:"lastClr",value:r.lastColor}}}):px(e,n??lm[e])]})},hx=(e,t={})=>new O({name:"a:clrScheme",attributes:{name:{key:"name",value:e}},children:Object.keys(Zl).map(n=>ux(n,t))}),Vu=new Set(["dark1","light1","dark2","light2","accent1","accent2","accent3","accent4","accent5","accent6","hyperlink","followedHyperlink"]),mx=new Map([["dk1","dark1"],["lt1","light1"],["dk2","dark2"],["lt2","light2"],["hlink","hyperlink"],["folHlink","followedHyperlink"],["text1","dark1"],["background1","light1"],["text2","dark2"],["background2","light2"]]),Xu=(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))},fx=({theme:e,lighter:t,darker:n})=>{if(!Vu.has(e)){let s=mx.get(e);throw new Error(`Invalid theme color "${e}". ${s?`Did you mean "${s}"?`:`Expected one of ${[...Vu].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:Xu(t,"lighter"),i=n===void 0?void 0:Xu(n,"darker");return{tint:r===255?void 0:r,shade:i===255?void 0:i}},gx=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}},bx=({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()},vx=(e,{tint:t,shade:n})=>{if(t===void 0&&n===void 0)return e;let r=gx(e),i=t===void 0?r.lightness*n/255:r.lightness*t/255+(1-t/255);return bx(k(k({},r),{},{lightness:i}))},Yu=e=>e===void 0?void 0:e.toString(16).padStart(2,"0").toUpperCase(),wx=e=>typeof e=="string"?{type:"hex",value:im(e)}:{type:"theme",color:e,change:fx(e)},yx=(e,t)=>e.type==="hex"?{color:e.value}:{color:vx(t[e.color.theme],e.change),theme:e.color.theme,tint:Yu(e.change.tint),shade:Yu(e.change.shade)},xx=ec(),tc=class extends Fr{constructor(e){super("_attr"),C(this,"attributes",void 0),this.attributes=e.map(t=>"keys"in t?{keys:t.keys,color:t.color===void 0?void 0:wx(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:xx,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=yx(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))}}},kx=class extends I{constructor(e,t){super(e),this.root.push(new tc(t))}},nc=(e,t)=>new kx(e,t),Hr={color:"w:color",theme:"w:themeColor",tint:"w:themeTint",shade:"w:themeShade"},ue=(e,{color:t,size:n,space:r,style:i})=>nc(e,[{key:"w:val",value:i},{keys:Hr,color:t},{key:"w:sz",value:n===void 0?void 0:lx(n)},{key:"w:space",value:r===void 0?void 0:cx(r)}]),Ur={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"},Tx=class extends kt{constructor(e){super("w:pBdr"),e.top&&this.root.push(ue("w:top",e.top)),e.left&&this.root.push(ue("w:left",e.left)),e.bottom&&this.root.push(ue("w:bottom",e.bottom)),e.right&&this.root.push(ue("w:right",e.right)),e.between&&this.root.push(ue("w:between",e.between))}},Sx=class extends I{constructor(){super("w:pBdr");let e=ue("w:bottom",{color:"auto",space:1,style:Ur.SINGLE,size:6});this.root.push(e)}},Cx=({start:e,end:t,left:n,right:r,hanging:i,firstLine:s,firstLineChars:a})=>new O({name:"w:ind",attributes:{start:{key:"w:start",value:e===void 0?void 0:rt(e)},end:{key:"w:end",value:t===void 0?void 0:rt(t)},left:{key:"w:left",value:n===void 0?void 0:rt(n)},right:{key:"w:right",value:r===void 0?void 0:rt(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)}}}),Ex=()=>new O({name:"w:br"}),Hs={BEGIN:"begin",END:"end",SEPARATE:"separate"},rc=(e,t,n)=>new O({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:e},dirty:{key:"w:dirty",value:t},locked:{key:"w:fldLock",value:n}}}),Sr=(e,t)=>rc(Hs.BEGIN,e,t),pm=new WeakSet,Ax=class extends O{constructor(){super({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:Hs.BEGIN},dirty:{key:"w:dirty",value:!0}}})}prepForXml(e){let t=super.prepForXml(e);return pm.add(t),t}},um=()=>new Ax,_x=e=>typeof e=="object"&&e!==null&&pm.has(e),nn=e=>rc(Hs.SEPARATE,e),rn=e=>rc(Hs.END,e),Ft={DEFAULT:"default",PRESERVE:"preserve"},qt=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{space:"xml:space"})}},Nx=class extends I{constructor(){super("w:instrText"),this.root.push(new qt({space:Ft.PRESERVE})),this.root.push("PAGE")}},Ix=class extends I{constructor(){super("w:instrText"),this.root.push(new qt({space:Ft.PRESERVE})),this.root.push("NUMPAGES")}},Px=class extends I{constructor(){super("w:instrText"),this.root.push(new qt({space:Ft.PRESERVE})),this.root.push("SECTIONPAGES")}},Ox=class extends I{constructor(){super("w:instrText"),this.root.push(new qt({space:Ft.PRESERVE})),this.root.push("SECTION")}},Us=({fill:e,color:t,type:n})=>nc("w:shd",[{keys:{color:"w:fill",theme:"w:themeFill",tint:"w:themeFillTint",shade:"w:themeFillShade"},color:e},{keys:Hr,color:t},{key:"w:val",value:n??Rx.CLEAR}]),Rx={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"},qe=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}},Lx=class extends I{constructor(e){super("w:del"),this.root.push(new qe({id:e.id,author:e.author,date:e.date}))}},Mx=class extends I{constructor(e){super("w:ins"),this.root.push(new qe({id:e.id,author:e.author,date:e.date}))}},Dx=({twoLinesInOne:e,brackets:t,horizontalInVertical:n,fitToLine:r,group:i})=>new O({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}}}),Bx={DOT:"dot"},$x=(e=Bx.DOT)=>new O({name:"w:em",attributes:{val:{key:"w:val",value:e}}}),Fx="57X6y3wQZNzYjJB2L_10pxbackgroundhimselfUTF-8DEMOGRAPHICSVqvt4KW9",qx=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i-- >0;)r+=e[Math.random()*e.length|0];return r},Hx=(e=21)=>{let t="",n=e|0;for(;n-- >0;)t+=Fx[Math.random()*64|0];return t},Ux=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},jx=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},et=(e,t)=>e>>>t|e<<32-t,HI=Int32Array.of(1518500249,1859775393,2400959708,3395469782),Wx=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),Kx=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Gx=new Int32Array(64),Ju=e=>{let t=Ux(e),n=Gx,[r,i,s,a,o,c,l,u]=Kx;for(let d=0;d<t.length;d+=16){n.set(t.subarray(d,d+16));for(let E=16;E<64;E++){let _=n[E-15],v=n[E-2];n[E]=n[E-16]+(et(_,7)^et(_,18)^_>>>3)+n[E-7]+(et(v,17)^et(v,19)^v>>>10)}let[p,m,f,h,g,y,x,b]=[r,i,s,a,o,c,l,u];for(let E=0;E<64;E++){let _=b+(et(g,6)^et(g,11)^et(g,25))+(g&y^~g&x)+Wx[E]+n[E]|0,v=(et(p,2)^et(p,13)^et(p,22))+(p&m^p&f^m&f)|0;b=x,x=y,y=g,g=h+_|0,h=f,f=m,m=p,p=_+v|0}[r,i,s,a,o,c,l,u]=[r+p|0,i+m|0,s+f|0,a+h|0,o+g|0,c+y|0,l+x|0,u+b|0]}return jx([r,i,s,a,o,c,l,u])},ze=e=>Math.floor(e*72*20),Rn=(e=0)=>{let t=e;return()=>++t},zx=()=>Rn(),Vx=()=>Rn(1),Xx=()=>Rn(),UI=Xx(),Yx=()=>Rn(),hm=Yx(),Jx=Rn(),Qx=()=>-Jx(),Ln=()=>Hx().toLowerCase(),wr=e=>qx("1234567890abcdef",e)(),mm=()=>`${wr(8)}-${wr(4)}-${wr(4)}-${wr(4)}-${wr(12)}`,Zx=e=>new Uint8Array(new TextEncoder().encode(e)),ek=({width:e,group:t})=>new O({name:"w:fitText",attributes:{val:{key:"w:val",value:Math.round($t(ve(e)))},id:{key:"w:id",value:t===void 0?Qx():le(t)}}}),tk=class extends I{constructor(e){super("w:spacing"),this.root.push(new _e({val:rt(e)}))}},nk=class extends I{constructor(e){super("w:color"),this.root.push(new tc([{keys:k(k({},Hr),{},{color:"w:val"}),color:e}]))}},rk=class extends I{constructor(e){super("w:highlight"),this.root.push(new _e({val:e}))}},ik=e=>new O({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}}}),tl=(e,t)=>{if(typeof e=="string"){let r=e;return new O({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 O({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 O({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}}})},fm=e=>new O({name:"w:vertAlign",attributes:{val:{key:"w:val",value:e}}}),sk=()=>fm("superscript"),ak=()=>fm("subscript"),gm={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"},ok=(e=gm.SINGLE,t)=>nc("w:u",[{key:"w:val",value:e},{keys:Hr,color:t}]),sn=class extends kt{constructor(e){if(super("w:rPr"),!e)return;if(e.style&&this.push(new it("w:rStyle",e.style)),e.font&&(typeof e.font=="string"?this.push(tl(e.font)):"name"in e.font?this.push(tl(e.font.name,e.font.hint)):this.push(tl(e.font))),e.bold!==void 0&&this.push(new P("w:b",e.bold)),e.boldComplexScript===void 0&&e.bold!==void 0||e.boldComplexScript){var t;this.push(new P("w:bCs",(t=e.boldComplexScript)!==null&&t!==void 0?t:e.bold))}if(e.italics!==void 0&&this.push(new P("w:i",e.italics)),e.italicsComplexScript===void 0&&e.italics!==void 0||e.italicsComplexScript){var n;this.push(new P("w:iCs",(n=e.italicsComplexScript)!==null&&n!==void 0?n:e.italics))}e.smallCaps!==void 0?this.push(new P("w:smallCaps",e.smallCaps)):e.allCaps!==void 0&&this.push(new P("w:caps",e.allCaps)),e.strike!==void 0&&this.push(new P("w:strike",e.strike)),e.doubleStrike!==void 0&&this.push(new P("w:dstrike",e.doubleStrike)),e.emboss!==void 0&&this.push(new P("w:emboss",e.emboss)),e.imprint!==void 0&&this.push(new P("w:imprint",e.imprint)),e.noProof!==void 0&&this.push(new P("w:noProof",e.noProof)),e.snapToGrid!==void 0&&this.push(new P("w:snapToGrid",e.snapToGrid)),e.vanish!==void 0&&this.push(new P("w:vanish",e.vanish)),e.color&&this.push(new nk(e.color)),e.characterSpacing&&this.push(new tk(e.characterSpacing)),e.scale!==void 0&&this.push(new Er("w:w",e.scale)),e.kern&&this.push(new el("w:kern",e.kern)),e.position&&this.push(new it("w:position",e.position)),e.size!==void 0&&this.push(new el("w:sz",e.size));let r=e.sizeComplexScript===void 0||e.sizeComplexScript===!0?e.size:e.sizeComplexScript;r&&this.push(new el("w:szCs",r)),e.highlight&&this.push(new rk(e.highlight)),e.underline&&this.push(ok(e.underline.type,e.underline.color)),e.effect&&this.push(new it("w:effect",e.effect)),e.border&&this.push(ue("w:bdr",e.border)),e.shading&&this.push(Us(e.shading)),e.fitText&&this.push(ek(e.fitText)),e.subScript&&this.push(ak()),e.superScript&&this.push(sk()),e.rightToLeft!==void 0&&this.push(new P("w:rtl",e.rightToLeft)),e.emphasisMark&&this.push($x(e.emphasisMark.type)),e.language&&this.push(ik(e.language)),e.eastAsianLayout&&this.push(Dx(e.eastAsianLayout)),e.specVanish!==void 0&&this.push(new P("w:specVanish",e.specVanish)),e.math!==void 0&&this.push(new P("w:oMath",e.math)),e.revision&&this.push(new ck(e.revision))}push(e){this.root.push(e)}},lk=class extends sn{constructor(e){super(e),e?.insertion&&this.push(new Mx(e.insertion)),e?.deletion&&this.push(new Lx(e.deletion))}},ck=class extends I{constructor(e){super("w:rPrChange"),this.root.push(new qe({id:e.id,author:e.author,date:e.date})),this.addChildElement(new sn(e))}},Or=class extends I{constructor(e){if(super("w:t"),typeof e=="string")this.root.push(new qt({space:Ft.PRESERVE})),this.root.push(e);else{var t;this.root.push(new qt({space:(t=e.space)!==null&&t!==void 0?t:Ft.DEFAULT})),this.root.push(e.text)}}},bs={CURRENT:"CURRENT",TOTAL_PAGES:"TOTAL_PAGES",TOTAL_PAGES_IN_SECTION:"TOTAL_PAGES_IN_SECTION",CURRENT_SECTION:"SECTION"},dk=e=>{switch(e){case bs.CURRENT:return[Sr(),new Nx,nn(),rn()];case bs.TOTAL_PAGES:return[Sr(),new Ix,nn(),rn()];case bs.TOTAL_PAGES_IN_SECTION:return[Sr(),new Px,nn(),rn()];case bs.CURRENT_SECTION:return[Sr(),new Ox,nn(),rn()];default:return}},Fe=class Al extends I{constructor(t){if(super("w:r"),C(this,"properties",void 0),C(this,"following",[]),this.properties=new sn(t),this.root.push(this.properties),t.break)for(let n=0;n<t.break;n++)this.root.push(Ex());if(t.children)for(let[n,r]of t.children.entries()){if(Fs(r)==="w:r"){let i=t.children.slice(n+1);this.following=[r,...i.length>0?[new Al(k(k({},t),{},{break:void 0,children:i}))]:[]];break}if(typeof r=="string"){let i=dk(r);if(i){let s=t.children.slice(n+1),a=l=>new Al(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 Or(r));continue}this.root.push(r)}else t.text!==void 0&&this.root.push(new Or(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 Fe{constructor(e){super(typeof e=="string"?{text:e}:e)}},ic={EXTERNAL:"External"},pk=(e,t,n,r)=>new O({name:"Relationship",attributes:{id:{key:"Id",value:e},type:{key:"Type",value:t},target:{key:"Target",value:n},targetMode:{key:"TargetMode",value:r}}}),bm=(e,t)=>new O({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}`}})}),uk=class{constructor(e){C(this,"link",void 0),C(this,"linkId",Ln()),C(this,"addedTo",new WeakSet),this.link=e}createClick(e){return bm(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,ic.EXTERNAL))}},hk=32767,mk=780,fk=[[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"]],gk=e=>e<=hk?fk.reduce(({rest:t,text:n},[r,i])=>({rest:t%r,text:n+i.repeat(Math.floor(t/r))}),{rest:e,text:""}).text:void 0,bk=e=>e===0?"":e<=mk?String.fromCharCode(65+(e-1)%26).repeat(Math.ceil(e/26)):void 0,vk=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"}`},sc=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(gk);case"alphabetic":return n(bk);case"ordinal":return r=>r>0?vk(r):void 0;case"arabicdash":return r=>`- ${r} -`;default:return}},vm=new Set(["mergeformat","charformat","mergeformatinet"]),wm=new Set(["upper","lower","firstcap","caps"]),wk=e=>/^[#0,]*[#0][#0,]*$/.test(e),yk=(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},xk=(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}},kk=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 m=0;m<i.length;m++){let f=i[m],h=()=>{var g;return(f.length>2?f.slice(2):(g=i[++m])!==null&&g!==void 0?g:"").replace(/^"(.*)"$/,"$1")};if(/^\\p$/i.test(f))c=!0;else if(f.startsWith("\\#")){var u;let g=h();l&&(l=a===void 0&&wk(g)),(u=a)!==null&&u!==void 0||(a=g)}else if(f.startsWith("\\*")){let g=h(),y=g.toLowerCase();if(wm.has(y))o.push(y);else if(g!==""&&!vm.has(y)){var d;l&&(l=s===void 0&&sc(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)},Tk=e=>new RegExp("^\\s*TOC\\b.*\\\\s\\b","is").test(e),ym=(e,{enclosing:t,within:n,inTextBox:r},{estimate:i,sectionPageCount:s,blank:a,relativeTo:o})=>{let c=kk(e);if(c===void 0)return;let{bookmarks:l,pageCount:u,bookmarkPageNumbers:d}=i,{numberFormat:p,picture:m,capitals:f,written:h}=c,g=p!==void 0||m!==void 0,y=E=>E===void 0?void 0:m===void 0?sc(p??"arabic")(E):yk(E,m),x=c.type==="pageReference"&&c.relative&&n==="counted"&&!r?o?.(c.bookmark):void 0,b;return h?c.type==="pageCount"?b=y(c.scope==="document"?u:s):t.some(Tk)?b=void 0:g?b=y(d?.get(c.bookmark)):b=c.relative?x:l.get(c.bookmark):b=void 0,b===void 0?a?"":void 0:xk(b,f)},Sk=(e,t)=>e==="mc:Fallback"||t==="fallback"?"fallback":e==="w:del"||e==="w:moveFrom"?"deleted":t,Rr=(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 m=e.attributeOf(u,"w:fldCharType");m==="begin"?n.push({begin:u,instruction:"",inResult:!1}):m==="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++)):m==="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 m=r.resultOf(String(e.attributeOf(u,"w:instr")),{within:i,enclosing:n.map(f=>f.instruction),inTextBox:s});if(m===void 0){var a;Rr(e,(a=e.contentOf(u))!==null&&a!==void 0?a:[],[],r,i,s)}else e.setSimpleFieldResult(u,m)}else{var o;if(d==="w:p"){var c;(c=r.beforeParagraph)===null||c===void 0||c.call(r,u)}Rr(e,(o=e.contentOf(u))!==null&&o!==void 0?o:[],n,r,Sk(d,i),s||d==="w:txbxContent"),d==="w:p"&&r.afterParagraph(u)}}},xm=(e,t)=>t.flatMap(n=>{var r;let i=e.nameOf(n);return i===void 0?[]:i==="w:sectPr"?[n]:xm(e,(r=e.contentOf(n))!==null&&r!==void 0?r:[])}),Ck=(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")})},Ek=(e,t,n)=>{let r=xm(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]]:[]))},km=(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 Rr(e,[t],[],{resultOf:(l,u)=>ym(l,u,{estimate:n,sectionPageCount:i[a],blank:r,relativeTo:c}),afterParagraph:l=>{a+=Ck(e,l)?1:0}}),Ek(e,t,i)},Tm=(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}`};Rr(e,[t],[],{resultOf:(o,c)=>ym(o,c,k({estimate:n,sectionPageCount:i,blank:r},s?{relativeTo:a}:{})),afterParagraph:()=>{}})},Ak=(e,t,{beforeParagraph:n,resultOf:r})=>Rr(e,[t],[],{resultOf:(i,{within:s})=>r(i,s),beforeParagraph:n,afterParagraph:()=>{}}),Sm=class extends I{constructor(e={}){super("w:instrText"),C(this,"properties",void 0),this.properties=e,this.root.push(new qt({space:Ft.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)}},Cm=class extends I{constructor(){super("w:sdtContent")}},Em=e=>e===void 0?um():Sr(e),ac=new WeakMap,_k=(e,t)=>{ac.set(e,t)},Nk=class{constructor(){C(this,"ids",[])}get(e){var t,n;return(n=(t=this.ids)[e])!==null&&n!==void 0||(t[e]=hm()),this.ids[e]}},at=e=>typeof e=="object"&&e!==null?Object.keys(e)[0]:void 0,ot=e=>{let t=at(e),n=t===void 0?void 0:e[t];return Array.isArray(n)?n:n===void 0?[]:[n]},Xe=(e,t)=>ot(e).find(n=>at(n)===t),Be=(e,t)=>{var n;return(n=Xe(e,"_attr"))===null||n===void 0||(n=n._attr)===null||n===void 0?void 0:n[t]},oc=(e,t)=>{let n=Be(e,t);return n===void 0?void 0:Number(n)},Ik=new Set(["w:tbl","w:tr","w:tc","w:sdt","w:sdtContent","w:customXml"]),Am=e=>e.flatMap(t=>{let n=at(t);return n==="w:p"||ac.has(t)?[t]:n!==void 0&&Ik.has(n)?Am(ot(t)):[]}),Pk=new Set(["w:r","w:hyperlink","w:ins","w:moveTo","w:smartTag","w:customXml","w:sdt","w:sdtContent","w:fldSimple","w:dir","w:bdo"]),Ok=e=>{switch(at(e)){case"w:t":return ot(e).filter(t=>typeof t=="string").join("");case"w:tab":return" ";case"w:br":return[void 0,"textWrapping"].includes(Be(e,"w:type"))?`
5334
+ `:""):c+s.map(l=>l===void 0?"":tm(l,t,!1)).join("")+(o>1?a:"")+(r?`</${r}>`:"")+(t&&!n?`
5335
+ `:"")},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?`
5336
+ `:""}`)+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"))?`
5291
5337
  `:"";case"w:cr":return`
5292
- `;case"w:noBreakHyphen":return"-";default:return""}},Rk=e=>{let t=[],n=r=>{let i=at(r);if(i!==void 0&&Pk.has(i))return ot(r).map(n).join("");if(i==="w:fldChar"){let s=Be(r,"w:fldCharType");return s==="begin"?t.push(!1):s==="separate"?t[t.length-1]=!0:t.pop(),""}return t.every(Boolean)?Ok(r):""};return ot(e).map(n).join("")},_m=e=>{let t=at(e);return t==="w:bookmarkStart"?[{start:!0,id:Be(e,"w:id"),name:Be(e,"w:name")}]:t==="w:bookmarkEnd"?[{start:!1,id:Be(e,"w:id")}]:t===void 0||t==="_attr"?[]:ot(e).flatMap(_m)},Lk=e=>{let t=new Map;return e.map(n=>{let r=_m(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})},Mk=(e,t)=>{let n=t?Lk(e):[];return e.map((r,i)=>{var s;let a=Xe(r,"w:pPr");return{element:r,styleId:Be(Xe(a,"w:pStyle"),"w:val"),outlineLevel:oc(Xe(a,"w:outlineLvl"),"w:val"),text:Rk(r),bookmarks:(s=n[i])!==null&&s!==void 0?s:new Set}})},Nm=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(ot(n).filter(r=>at(r)==="w:style"&&["paragraph",void 0].includes(Be(r,"w:type"))).map(r=>[Be(r,"w:styleId"),{name:Be(Xe(r,"w:name"),"w:val"),basedOn:Be(Xe(r,"w:basedOn"),"w:val"),outlineLevel:oc(Xe(Xe(r,"w:pPr"),"w:outlineLvl"),"w:val")}]))},Im=e=>{let t=/^\s*(\d+)\s*-\s*(\d+)\s*$/.exec(e);return t?[Number(t[1]),Number(t[2])]:void 0},_l=(e,[t,n])=>e>=t&&e<=n,lc=(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},Pm=(e,t,n=0)=>{var r;if(e===void 0||n>t.size)return;let i=t.get(e),s=lc(e,t);return(r=i?.outlineLevel)!==null&&r!==void 0?r:s===void 0?Pm(i?.basedOn,t,n+1):s-1},Dk=e=>{let t=Nm(e);return n=>{let r=Xe(n,"w:pPr"),i=Be(Xe(r,"w:pStyle"),"w:val"),s=lc(i,t),a=Om({styleId:i,outlineLevel:oc(Xe(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"}},Om=(e,t)=>{var n;return(n=e.outlineLevel)!==null&&n!==void 0?n:Pm(e.styleId,t)},Bk=(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?Im(s):u?void 0:[1,9],p=lc(t.styleId,n);if(d&&p!==void 0&&_l(p,d))return p;let m=o?Om(t,n):void 0;return m!==void 0&&_l(m+1,d??[1,9])?m+1:void 0},$k=(e,t)=>{let n=t.preserveTabInEntries?e:e.replace(/\t/g," ");return(t.preserveNewLineInEntries?n.split(`
5293
- `):[n.replace(/\n/g," ")]).map((r,i)=>new Oe({break:i>0?1:void 0,children:r.split(" ").flatMap((s,a)=>[...a>0?[new Ws]:[],...s===""?[]:[s]])}))},Fk=({text:e,separator:t})=>t==="tab"?[new Oe(e),new Oe({children:[new Ws]})]:[new Oe(`${e} `)],qk=(e,t)=>{let n=240*(e-1)+t+240;return n<=1920?Math.ceil(n/240)*240:Math.round(n)},Hk=(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}`},Uk=({properties:e,beginDirty:t,textWidth:n,tabLeader:r},i,s,a)=>{var o;let c=e.pageNumbersEntryLevelsRange?(o=Im(e.pageNumbersEntryLevelsRange))!==null&&o!==void 0?o:[1,9]:void 0,l=new Cm;return i.forEach((u,d)=>{var p;let m=c===void 0||!_l(u.level,c),f=[...u.listNumber?Fk(u.listNumber):[],...$k(u.title,e),...m?[new Oe({children:[e.entryAndPageNumberSeparator||new Ws]}),new A1(u.bookmark,{hyperlink:e.hyperlink})]:[]];l.addChildElement(new ne({style:Hk(u.level,s),tabStops:[...((p=u.listNumber)===null||p===void 0?void 0:p.separator)==="tab"?[{type:"left",position:qk(u.level,u.listNumber.width)}]:[],{type:"right",position:n,leader:r}],children:[...d===0?[new Fe({children:[Em(t),new Sm(e),nn()]})]:[],...e.hyperlink?[new Dm({anchor:u.bookmark,children:f})]:f]}))}),l.addChildElement(new ne({children:[new Fe({children:[rn()]})]})),l.prepForXml(a)},jk=(e,t,n,r)=>{let i=ot(e),s=i.findIndex(a=>at(a)==="w:pPr")+1;e["w:p"]=[...i.slice(0,s),new Fm(t,n).prepForXml(r),...i.slice(s),new qm(n).prepForXml(r)]},Wk=(e,t,n,r)=>{let i=Am(ot(e)),s=i.flatMap(u=>{let d=ac.get(u);return d?[[u,d]]:[]});if(s.length===0)return;let a=Nm(t),o=s.some(([,{properties:u}])=>!!u.entriesFromBookmark),c=Mk(i.filter(u=>at(u)==="w:p"),o).map(u=>({paragraph:u,levels:s.map(([,{properties:d}])=>Bk(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)jk(u.element,`_Toc${d}`,d,t);let l=c.length>0?r?.(e):void 0;s.forEach(([u,d],p)=>{let m=c.flatMap(({paragraph:f,levels:h,id:g})=>{let y=h[p],x=l?.get(`_Toc${g}`);return y===void 0?[]:[k({title:f.text,level:y,bookmark:`_Toc${g}`},x?{listNumber:x}:{})]});m.length!==0&&(u["w:sdt"]=ot(u).map(f=>at(f)==="w:sdtContent"?Uk(d,m,a,t):f))})},Kk=new RegExp("^\\p{L}[\\p{L}\\p{N}_]*$","u"),Gk=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],m=(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(m))d++,f=p==="\\r"?{type:"reset",to:Number(m)}:{type:"heading",level:Number(m)};else if(p==="\\h")i=!0;else if(p==="\\#"&&d+1<e.length)d++,o=!0;else if(p==="\\*"&&d+1<e.length){let h=e[++d];if(wm.has(h.toLowerCase()))a=!0;else if(!vm.has(h.toLowerCase())){if(s!==void 0)return;s=h}}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":""}},cc=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 Kk.test(s)?{identifier:s,sequence:Gk(i)}:{identifier:s}},zk=e=>cc(e)!==void 0,Nl=e=>typeof e!="object"||e===null?[]:Array.isArray(e)?e.flatMap(Nl):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"?cc(r):void 0;return i?.identifier===void 0?[]:[i.identifier.toLowerCase()]}),...Nl(n)]),Vk=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(Nl(n.prepForXml(k(k({},e),{},{viewWrapper:r,stack:[]}))))},Xk=e=>{let t=Dk(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(h=>h!==void 0)),m=((d=r.get(l))!==null&&d!==void 0?d:[]).filter(h=>h.paragraph>=p),f=m.every(({step:h})=>h?.type==="next"||h?.type==="heading"&&h.level===u);return s>p||!f?void 0:m.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,m;let{identifier:f,sequence:h}=cc(l);if(f===void 0||u==="fallback")return;(d=o)!==null&&d!==void 0||(o=Vk(e));let g=f.toLowerCase();if(h?.step.type==="bookmark"&&u==="counted"&&!o.has(g))return;let y=n.has(g)?n.get(g):0,x=o.has(g)||u==="deleted"?void 0:h?.step,b=x?.type==="reset"?x.to:x?.type==="repeat"?y:x?.type==="heading"?c(g,x.level):x?.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:x})]),b===void 0||h===void 0?void 0:h.hidden?"":(m=sc(h.format))===null||m===void 0?void 0:m(b)}}},nl=e=>{let t=typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.keys(e)[0]:void 0;return t==="_attr"?void 0:t},Qu=e=>({"w:t":[{_attr:{"xml:space":"preserve"}},e]}),js={nameOf:nl,contentOf:e=>{let t=e[nl(e)];return Array.isArray(t)?t:void 0},attributeOf:(e,t)=>{var n;let r=e[nl(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=>js.contentOf(e).filter(t=>typeof t=="string").join(""),textElement:Qu,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":[Qu(t)]}]}},Rm=new WeakMap,Yk=(e,t)=>{let{startParagraph:n,numberOf:r}=Xk(t);Ak(js,e,{beforeParagraph:i=>n(i),resultOf:(i,s)=>zk(i)?r(i,s):void 0})},Jk=(e,t,n)=>{let r=n(e,t),i=km(js,e,r,{blank:!1});t.file&&Rm.set(t.file,{estimate:r,partPageCounts:i})},jr=(e,t,n)=>{let r=t.file&&Rm.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;Tm(js,e,r.estimate,{blank:!1,sectionPageCount:i,notes:s})},Qk=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{xmlns:"xmlns"})}},be=class Lm extends I{constructor(){super("Relationships"),this.root.push(new Qk({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}addRelationship(t,n,r,i){this.root.push(pk(`rId${t}`,n,r,i))}static copy(t){let n=new Lm;return n.root.push(...t.root.slice(1)),n}get RelationshipCount(){return this.root.length-1}},Zk=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}},e1=class extends H{constructor(...e){super(...e),C(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"})}},Zu=class extends I{constructor({id:e,initials:t,author:n,date:r=new Date,children:i},s){super("w:comment"),C(this,"paraId",void 0),this.paraId=s,this.root.push(new Zk({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}},t1=e=>(e+1).toString(16).toUpperCase().padStart(8,"0"),n1=class extends I{constructor({children:e}){super("w:comments"),C(this,"relationships",void 0),C(this,"threadData",void 0),C(this,"commentIdsData",void 0),C(this,"isEmpty",void 0),this.isEmpty=e.length===0,this.root.push(new e1({"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,t1(i.id)]));for(let i of e)this.root.push(new Zu(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 Zu(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 jr(t,e),t}},r1=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:mc":"xmlns:mc","xmlns:w15":"xmlns:w15","mc:Ignorable":"mc:Ignorable"})}},i1=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{paraId:"w15:paraId",paraIdParent:"w15:paraIdParent",done:"w15:done"})}},s1=class extends I{constructor(e){super("w15:commentEx"),this.root.push(new i1({paraId:e.paraId,paraIdParent:e.parentParaId,done:e.done!==void 0?e.done?"1":"0":void 0}))}},a1=class extends I{constructor(e){super("w15:commentsEx"),this.root.push(new r1({"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 s1(t))}},o1=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{paraId:"w16cid:paraId",durableId:"w16cid:durableId"})}},l1=class extends I{constructor(e){super("w16cid:commentId"),this.root.push(new o1({paraId:e.paraId,durableId:e.durableId}))}},c1=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{"xmlns:w16cid":"xmlns:w16cid","xmlns:mc":"xmlns:mc","mc:Ignorable":"mc:Ignorable"})}},d1=class extends I{constructor(e){super("w16cid:commentsIds"),this.root.push(new c1({"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 l1(t))}},p1=class extends am{constructor(){super("w:endnoteRef")}},Ws=class extends am{constructor(){super("w:tab")}},u1={COLUMN:"column",PAGE:"page"},h1=class extends I{constructor(e){super("w:br"),this.root.push(new _e({type:e}))}},Mm=class extends Fe{constructor(){super({}),this.root.push(new h1(u1.PAGE))}},m1=class extends I{constructor(){super("w:pageBreakBefore")}},Pn={AT_LEAST:"atLeast",EXACTLY:"exactly",EXACT:"exact",AUTO:"auto"},f1=({after:e,before:t,line:n,lineRule:r,beforeAutoSpacing:i,afterAutoSpacing:s})=>new O({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}}}),Ks={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"},Cr=e=>new O({name:"w:pStyle",attributes:{val:{key:"w:val",value:e}}}),eh={LEFT:"left",RIGHT:"right",CENTER:"center",BAR:"bar",CLEAR:"clear",DECIMAL:"decimal",END:"end",NUM:"num",START:"start"},g1={DOT:"dot",HYPHEN:"hyphen",MIDDLE_DOT:"middleDot",NONE:"none",UNDERSCORE:"underscore"},b1=({type:e,position:t,leader:n})=>new O({name:"w:tab",attributes:{val:{key:"w:val",value:e},pos:{key:"w:pos",value:rt(t)},leader:{key:"w:leader",value:n}}}),v1=e=>new O({name:"w:tabs",children:e.map(t=>b1(t))}),vs=class extends I{constructor(e,t){super("w:numPr"),this.root.push(new w1(t)),this.root.push(new y1(e))}},w1=class extends I{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}))}},y1=class extends I{constructor(e){super("w:numId"),this.root.push(new _e({val:typeof e=="string"?`{${e}}`:e}))}},dc=class extends I{constructor(...e){super(...e),C(this,"fileChild",Symbol())}},x1=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}},pc=class extends I{constructor(e,t,n,r){super("w:hyperlink"),C(this,"linkId",void 0),C(this,"drawingLink",void 0),this.linkId=t,this.drawingLink=n&&r!==void 0?new uk(r):void 0;let i=new x1({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)):bm(this.linkId,t)}},Dm=class extends pc{constructor(e){super(e.children,Ln(),e.anchor)}},k1=class extends I{constructor(e){super("w:externalHyperlink"),C(this,"options",void 0),this.options=e}},T1=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{id:"w:id",name:"w:name"})}},S1=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{id:"w:id"})}},Bm=class $m{constructor(t){C(this,"start",void 0),C(this,"children",void 0),C(this,"end",void 0);let n=hm();this.start=new Fm(t.id,n),this.children=t.children,this.end=new qm(n)}get writtenAs(){return[this.start,...this.children.flatMap(t=>t instanceof $m?t.writtenAs:[t]),this.end]}},Fm=class extends I{constructor(e,t){super("w:bookmarkStart");let n=new T1({name:e,id:t});this.root.push(n)}},qm=class extends I{constructor(e){super("w:bookmarkEnd");let t=new S1({id:e});this.root.push(t)}},C1=e=>new O({name:"w:outlineLvl",attributes:{val:{key:"w:val",value:e}}}),E1=class extends I{constructor(e,t={}){super("w:instrText"),this.root.push(new qt({space:Ft.PRESERVE}));let n=`PAGEREF ${e}`;t.hyperlink&&(n=`${n} \\h`),t.useRelativePosition&&(n=`${n} \\p`),this.root.push(n)}},A1=class extends Fe{constructor(e,t={}){super({children:[um(),new E1(e,t),nn(),rn()]})}},_1=255,Hm=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}},Os=(e,t,n)=>n===void 0?`${e}-${t}`:`${e}-restart ${n}`,ws=({id:e,fontKey:t,subsetted:n},r)=>new O({name:r,attributes:k({id:{key:"r:id",value:e}},t?{fontKey:{key:"w:fontKey",value:`{${t.toUpperCase()}}`}}:{}),children:[...n?[new P("w:subsetted",n)]:[]]}),N1=({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 O({name:"w:font",attributes:{name:{key:"w:name",value:e}},children:[...t?[vr("w:altName",t)]:[],...n?[vr("w:panose1",n)]:[],...r?[vr("w:charset",r)]:[],...i?[vr("w:family",i)]:[],...s?[new P("w:notTrueType",s)]:[],...a?[vr("w:pitch",a)]:[],...o?[new O({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?[ws(c,"w:embedRegular")]:[],...l?[ws(l,"w:embedBold")]:[],...u?[ws(u,"w:embedItalic")]:[],...d?[ws(d,"w:embedBoldItalic")]:[]]}),I1=({name:e,characterSet:t,embedRegular:n,embedBold:r,embedItalic:i,embedBoldItalic:s})=>N1({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}),P1=e=>new O({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(I1)}),O1=[{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}],Um=class{constructor(e){C(this,"options",void 0),C(this,"fontTable",void 0),C(this,"relationships",void 0),C(this,"fontOptionsWithKey",[]),C(this,"files",[]),this.options=e;let t=e.map(n=>O1.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:mm()}}]:[]}));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=P1(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}},R1=()=>new O({name:"w:wordWrap",attributes:{val:{key:"w:val",value:0}}}),L1=e=>{var t,n;return new O({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}}})},rl=new WeakMap,M1=Rn(),D1={left:"right",right:"left"},On=class extends kt{constructor(e,{implicitListParagraphStyle:t=!0,inListOrder:n=!0}={}){if(super("w:pPr",e?.includeIfEmpty),C(this,"numbering",void 0),C(this,"numberProperties",void 0),!e)return this;if(e.heading&&this.push(Cr(e.heading)),t&&(e.bullet&&this.push(Cr("ListParagraph")),e.numbering&&!e.numbering.custom&&!e.style&&!e.heading&&this.push(Cr("ListParagraph"))),e.style&&this.push(Cr(e.style)),e.keepNext!==void 0&&this.push(new P("w:keepNext",e.keepNext)),e.keepLines!==void 0&&this.push(new P("w:keepLines",e.keepLines)),e.pageBreakBefore&&this.push(new m1),e.frame&&this.push(L1(e.frame)),e.widowControl!==void 0&&this.push(new P("w:widowControl",e.widowControl)),e.bullet&&this.push(new vs(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 vs(Os(c,s??0),a);this.numbering={reference:c,level:a,instance:s,restartedListId:o&&n&&s===void 0?M1():void 0,definition:typeof i=="string"?void 0:i},this.numberProperties=l,this.push(l)}else e.numbering===!1&&this.push(new vs(0,0));e.border&&this.push(new Tx(e.border)),e.thematicBreak&&this.push(new Sx),e.shading&&this.push(Us(e.shading)),e.wordWrap&&this.push(R1()),e.overflowPunctuation&&this.push(new P("w:overflowPunct",e.overflowPunctuation));let r=[...e.rightTabStop!==void 0?[{type:eh.RIGHT,position:e.rightTabStop}]:[],...e.tabStops?e.tabStops:[],...e.leftTabStop!==void 0?[{type:eh.LEFT,position:e.leftTabStop}]:[]];r.length>0&&this.push(v1(r)),e.bidirectional!==void 0&&this.push(new P("w:bidi",e.bidirectional)),e.spacing&&this.push(f1(e.spacing)),e.indent&&this.push(Cx(e.indent)),e.contextualSpacing!==void 0&&this.push(new P("w:contextualSpacing",e.contextualSpacing)),e.alignment&&this.push(om(e.bidirectional&&D1[e.alignment]||e.alignment)),e.outlineLevel!==void 0&&this.push(C1(e.outlineLevel)),e.suppressLineNumbers!==void 0&&this.push(new P("w:suppressLineNumbers",e.suppressLineNumbers)),e.autoSpaceEastAsianText!==void 0&&this.push(new P("w:autoSpaceDN",e.autoSpaceEastAsianText)),e.run&&this.push(new lk(e.run)),e.revision&&this.push(new th(e.revision))}push(e){this.root.push(e)}addSectionProperties(e){let t=this.root.findIndex(n=>n instanceof th);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=rl.get(e))===null||r===void 0?void 0:r.get(a):void 0;e.viewWrapper instanceof Um||e.file.Numbering.createConcreteNumberingInstance(a,c,l,u);let d=new vs(Os(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;rl.set(e,new Map([...(s=rl.get(e))!==null&&s!==void 0?s:[],[this.numbering.reference,this.numbering.restartedListId]]))}return i}},th=class extends I{constructor(e){super("w:pPrChange"),this.root.push(new qe({id:e.id,author:e.author,date:e.date})),this.root.push(new On(k(k({},e),{},{includeIfEmpty:!0}),{inListOrder:!1}))}},ne=class jm extends dc{constructor(t){if(super("w:p"),C(this,"options",void 0),C(this,"properties",void 0),C(this,"alignment",void 0),this.options=typeof t=="string"?{text:t}:t,typeof t=="string")return this.alignment={},this.properties=new On({}),this.root.push(this.properties),this.root.push(new Oe(t)),this;if(this.alignment={alignment:t.alignment,bidirectional:t.bidirectional},this.properties=new On(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 Bm){this.root.push(...n.writtenAs);continue}this.root.push(n)}}prepForXml(t){for(let n of this.root)if(Fs(n)==="w:externalHyperlink"){let r=this.root.indexOf(n),{options:i}=n,{target:s,anchor:a}=Hm(i.link),o=new pc(i.children,Ln(),a,i.link);t.viewWrapper.Relationships.addRelationship(o.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",s,ic.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 jm(k(k({},this.options),t))}addRunToFront(t){return this.root.splice(1,0,t),this}},B1={TOP:"top",CENTER:"center",BOTTOM:"bottom"},jI=k(k({},B1),{},{BOTH:"both"}),Wm=e=>new O({name:"w:vAlign",attributes:{verticalAlign:{key:"w:val",value:e}}}),$1=({space:e,count:t,separate:n,equalWidth:r,children:i})=>new O({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}),F1=({type:e,linePitch:t,charSpace:n})=>new O({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}}}),In={DEFAULT:"default",FIRST:"first",EVEN:"even"},nh={HEADER:"w:headerReference",FOOTER:"w:footerReference"},il=(e,t)=>new O({name:e,attributes:{type:{key:"w:type",value:t.type||In.DEFAULT},id:{key:"r:id",value:`rId${t.id}`}}}),q1=({countBy:e,start:t,restart:n,distance:r})=>new O({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)}}}),Km=({name:e,position:t,numberFormat:n,start:r,restart:i})=>new O({name:e,children:[...t===void 0?[]:[new O({name:"w:pos",attributes:{val:{key:"w:val",value:t}}})],...n?[new O({name:"w:numFmt",attributes:{val:{key:"w:val",value:n.type},format:{key:"w:format",value:n.format}}})]:[],...r===void 0?[]:[new O({name:"w:numStart",attributes:{val:{key:"w:val",value:le(r)}}})],...i===void 0?[]:[new O({name:"w:numRestart",attributes:{val:{key:"w:val",value:i}}})]]}),H1=e=>Km(k({name:"w:footnotePr"},e)),U1=e=>Km(k({name:"w:endnotePr"},e)),rh=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}},j1=class extends kt{constructor(e){if(super("w:pgBorders"),!e)return this;e.pageBorders?this.root.push(new rh({display:e.pageBorders.display,offsetFrom:e.pageBorders.offsetFrom,zOrder:e.pageBorders.zOrder})):this.root.push(new rh({})),e.pageBorderTop&&this.root.push(ue("w:top",e.pageBorderTop)),e.pageBorderLeft&&this.root.push(ue("w:left",e.pageBorderLeft)),e.pageBorderBottom&&this.root.push(ue("w:bottom",e.pageBorderBottom)),e.pageBorderRight&&this.root.push(ue("w:right",e.pageBorderRight))}},W1=(e,t,n,r,i,s,a)=>new O({name:"w:pgMar",attributes:{top:{key:"w:top",value:rt(e)},right:{key:"w:right",value:ve(t)},bottom:{key:"w:bottom",value:rt(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)}}}),K1={HYPHEN:"hyphen",PERIOD:"period",COLON:"colon",EM_DASH:"emDash",EN_DASH:"endash"},G1=({start:e,formatType:t,separator:n,chapterHeadingLevel:r})=>new O({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===K1.EN_DASH?"enDash":n},chapterHeadingLevel:{key:"w:chapStyle",value:r===void 0?void 0:le(r)}}}),Rs={PORTRAIT:"portrait",LANDSCAPE:"landscape"},z1=({width:e,height:t,orientation:n,code:r})=>{let i=ve(e),s=ve(t);return new O({name:"w:pgSz",attributes:{width:{key:"w:w",value:n===Rs.LANDSCAPE?s:i},height:{key:"w:h",value:n===Rs.LANDSCAPE?i:s},orientation:{key:"w:orient",value:n},code:{key:"w:code",value:r}}})},V1=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{val:"w:val"})}},X1=class extends I{constructor(e){super("w:textDirection"),this.root.push(new V1({val:e}))}},Y1=e=>new O({name:"w:type",attributes:{val:{key:"w:val",value:e}}}),tt={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},Ss={WIDTH:11906,HEIGHT:16838,ORIENTATION:Rs.PORTRAIT},Il=class Gm extends I{constructor({page:{size:{width:t=Ss.WIDTH,height:n=Ss.HEIGHT,orientation:r=Ss.ORIENTATION,code:i}={},margin:{top:s=tt.TOP,right:a=tt.RIGHT,bottom:o=tt.BOTTOM,left:c=tt.LEFT,header:l=tt.HEADER,footer:u=tt.FOOTER,gutter:d=tt.GUTTER}={},pageNumbers:p={},borders:m,textDirection:f}={},grid:{linePitch:h=360,charSpace:g,type:y}={},headerWrapperGroup:x={},footerWrapperGroup:b={},lineNumbers:E,titlePage:_,verticalAlign:v,column:T,type:w,footnoteProperties:A,endnoteProperties:N,revision:M}={}){super("w:sectPr"),C(this,"availableTextWidth",void 0),this.availableTextWidth=Gm.calculateAvailableTextWidth({pageWidth:r===Rs.LANDSCAPE?n:t,left:c,right:a,gutter:d,column:T}),this.addHeaderFooterGroup(nh.HEADER,x),this.addHeaderFooterGroup(nh.FOOTER,b),A&&this.root.push(H1(A)),N&&this.root.push(U1(N)),w&&this.root.push(Y1(w)),this.root.push(z1({width:t,height:n,orientation:r,code:i})),this.root.push(W1(s,a,o,c,l,u,d)),m&&this.root.push(new j1(m)),E&&this.root.push(q1(E)),this.root.push(G1(p)),T&&this.root.push($1(T)),v&&this.root.push(Wm(v)),_!==void 0&&this.root.push(new P("w:titlePg",_)),f&&this.root.push(new X1(f)),this.root.push(F1({linePitch:h,charSpace:g,type:y})),M&&this.root.push(new J1(M))}get AvailableTextWidth(){return this.availableTextWidth}static calculateAvailableTextWidth({pageWidth:t,left:n,right:r,gutter:i,column:s}){var a,o;let c=$t(t)-$t(n)-$t(r)-$t(i),l=(a=s?.count)!==null&&a!==void 0?a:1;return l<=1?c:(c-$t((o=s?.space)!==null&&o!==void 0?o:720)*(l-1))/l}addHeaderFooterGroup(t,n){n.default&&this.root.push(il(t,{type:In.DEFAULT,id:n.default.View.ReferenceId})),n.first&&this.root.push(il(t,{type:In.FIRST,id:n.first.View.ReferenceId})),n.even&&this.root.push(il(t,{type:In.EVEN,id:n.even.View.ReferenceId}))}},J1=class extends I{constructor(e){super("w:sectPrChange"),this.root.push(new qe({id:e.id,author:e.author,date:e.date})),this.root.push(new Il(e))}},zm=class extends I{constructor({pageNumbers:e}={}){super("w:body"),C(this,"sections",[]),C(this,"sectionParagraphs",new Map),C(this,"headingBookmarkIds",new Nk),C(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 Il)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 Il(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 Wk(n,e,this.headingBookmarkIds,r&&(i=>r(i,e))),this.pageNumbers&&(Yk(n,e),Jk(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({})}},$e={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"},Lr=(e,{type:t=$e.AUTO,size:n})=>{let r=n;return t===$e.PERCENTAGE&&typeof n=="number"&&(r=Math.round(n*50)),new O({name:e,attributes:{type:{key:"w:type",value:t},size:{key:"w:w",value:sm(r)}}})},Cs=Ss.WIDTH-tt.LEFT-tt.RIGHT-tt.GUTTER,Vm=e=>e.options.columnSpan||1,uc=(e,t)=>{if(!e)return;let{type:n=$e.AUTO,size:r}=e;if(n!==$e.PERCENTAGE&&n!==$e.DXA)return;let i=typeof r=="number"?n===$e.PERCENTAGE?r/100*t:r:r.endsWith("%")?Number(r.slice(0,-1))/100*t:$t(r);return i>0?i:void 0},Q1=(e,t)=>{var n;return(n=uc(e,t))!==null&&n!==void 0?n:t},Z1=e=>Math.max(0,...e.map(t=>t.cells.reduce((n,r)=>n+Vm(r),0))),ih=({rows:e,width:t,availableWidth:n})=>{let r=Z1(e);if(r===0)return[];let i=Q1(t,n),s=Array.from({length:r},()=>{}),a=[];for(let u of e){let d=0;for(let p of u.cells){let m=Vm(p),f=uc(p.options.width,i);if(f!==void 0)if(m===1){var o,c;(c=s[o=d])!==null&&c!==void 0||(s[o]=f)}else a.push({start:d,span:m,width:f});d+=m}}for(let{start:u,span:d,width:p}of a){let m=Array.from({length:d},(g,y)=>u+y).filter(g=>g<r),f=m.filter(g=>s[g]===void 0),h=p-m.reduce((g,y)=>{var x;return g+((x=s[y])!==null&&x!==void 0?x:0)},0);if(f.length>0&&h>0)for(let g of f)s[g]=h/f.length}let l=s.flatMap((u,d)=>u===void 0?[d]:[]);if(l.length>0){let u=i-s.reduce((p,m)=>p+(m??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))},eT=e=>new O({name:"w:gridCol",attributes:e!==void 0?{width:{key:"w:w",value:ve(e)}}:void 0}),Es=class extends I{constructor(e,t){super("w:tblGrid");for(let n of e)this.root.push(eT(n));t&&this.root.push(new nT(t))}},tT=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{id:"w:id"})}},nT=class extends I{constructor(e){super("w:tblGridChange"),this.root.push(new tT({id:e.id})),this.root.push(new Es(e.columnWidths))}},rT=class extends I{constructor(e){super("w:ins"),this.root.push(new qe({id:e.id,author:e.author,date:e.date}))}},iT=class extends I{constructor(e){super("w:del"),this.root.push(new qe({id:e.id,author:e.author,date:e.date}))}},sT=class extends I{constructor(e){super("w:cellIns"),this.root.push(new qe({id:e.id,author:e.author,date:e.date}))}},aT=class extends I{constructor(e){super("w:cellDel"),this.root.push(new qe({id:e.id,author:e.author,date:e.date}))}},oT=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date",verticalMerge:"w:vMerge",verticalMergeOriginal:"w:vMergeOrig"})}},lT=class extends I{constructor(e){super("w:cellMerge"),this.root.push(new oT(e))}},Xm=({marginUnitType:e=$e.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})=>Lr(s,{type:e,size:a})),cT=e=>{let t=Xm(e);if(t.length!==0)return new O({name:"w:tblCellMar",children:t})},dT=e=>{let t=Xm(e);if(t.length!==0)return new O({name:"w:tcMar",children:t})},pT=class extends kt{constructor(e){super("w:tcBorders"),e.top&&this.root.push(ue("w:top",e.top)),e.start&&this.root.push(ue("w:start",e.start)),e.left&&this.root.push(ue("w:left",e.left)),e.bottom&&this.root.push(ue("w:bottom",e.bottom)),e.end&&this.root.push(ue("w:end",e.end)),e.right&&this.root.push(ue("w:right",e.right)),e.diagonalDown&&this.root.push(ue("w:tl2br",e.diagonalDown)),e.diagonalUp&&this.root.push(ue("w:tr2bl",e.diagonalUp))}},uT=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{val:"w:val"})}},hT=class extends I{constructor(e){super("w:gridSpan"),this.root.push(new uT({val:le(e)}))}},Ym={CONTINUE:"continue",RESTART:"restart"},mT=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{val:"w:val"})}},sh=class extends I{constructor(e){super("w:vMerge"),this.root.push(new mT({val:e}))}},fT=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{val:"w:val"})}},gT=class extends I{constructor(e){super("w:textDirection"),this.root.push(new fT({val:e}))}},Jm=class extends kt{constructor(e){if(super("w:tcPr",e.includeIfEmpty),C(this,"hasWidth",void 0),C(this,"hasColumnWidth",!1),this.hasWidth=e.width!==void 0,e.width&&this.root.push(Lr("w:tcW",e.width)),e.columnSpan&&this.root.push(new hT(e.columnSpan)),e.verticalMerge?this.root.push(new sh(e.verticalMerge)):e.rowSpan&&e.rowSpan>1&&this.root.push(new sh(Ym.RESTART)),e.borders&&this.root.push(new pT(e.borders)),e.shading&&this.root.push(Us(e.shading)),e.margins){let t=dT(e.margins);t&&this.root.push(t)}e.textDirection&&this.root.push(new gT(e.textDirection)),e.verticalAlign&&this.root.push(Wm(e.verticalAlign)),e.insertion&&this.root.push(new sT(e.insertion)),e.deletion&&this.root.push(new aT(e.deletion)),e.cellMerge&&this.root.push(new lT(e.cellMerge)),e.revision&&this.root.push(new bT(e.revision))}setColumnWidth(e){this.hasWidth||(this.root.splice(0,this.hasColumnWidth?1:0,Lr("w:tcW",{size:e,type:$e.DXA})),this.hasColumnWidth=!0)}},bT=class extends I{constructor(e){super("w:tcPrChange"),this.root.push(new qe({id:e.id,author:e.author,date:e.date})),this.root.push(new Jm(k(k({},e),{},{includeIfEmpty:!0})))}},Mr=class extends I{constructor(e){super("w:tc"),C(this,"options",void 0),C(this,"properties",void 0),this.options=e,this.properties=new Jm(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 Fs(this.root[this.root.length-1])!=="w:p"&&this.root.push(new ne({})),super.prepForXml(e)}},Pl=(e,t)=>t?new P(e):new it(e,"off"),An={style:Ur.NONE,size:0,color:"auto"},vT={style:Ur.SINGLE,size:4,color:"auto"},Qm=class extends kt{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?vT:void 0);s&&this.root.push(ue(r,s))}}};C(Qm,"NONE",{top:An,bottom:An,left:An,right:An,insideHorizontal:An,insideVertical:An});sl={CENTER:"center",INSIDE:"inside",LEFT:"left",OUTSIDE:"outside",RIGHT:"right"},wT={CENTER:"center",INSIDE:"inside",BOTTOM:"bottom",OUTSIDE:"outside",INLINE:"inline",TOP:"top"},yT=({horizontalAnchor:e,verticalAnchor:t,absoluteHorizontalPosition:n,relativeHorizontalPosition:r,absoluteVerticalPosition:i,relativeVerticalPosition:s,bottomFromText:a,topFromText:o,leftFromText:c,rightFromText:l})=>new O({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:rt(n)},absoluteVerticalPosition:{key:"w:tblpY",value:i===void 0?void 0:rt(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}}}),xT=e=>new O({name:"w:tblLayout",attributes:{type:{key:"w:type",value:e}}}),kT={DXA:"dxa",NIL:"nil"},Zm=({type:e=kT.DXA,value:t})=>new O({name:"w:tblCellSpacing",attributes:{type:{key:"w:type",value:e},value:{key:"w:w",value:sm(t)}}}),TT=({firstRow:e,lastRow:t,firstColumn:n,lastColumn:r,noHBand:i,noVBand:s})=>new O({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}}}),ST=e=>new O({name:"w:tblOverlap",attributes:{val:{key:"w:val",value:e}}}),CT={[sl.LEFT]:pe.LEFT,[sl.CENTER]:pe.CENTER,[sl.RIGHT]:pe.RIGHT},hc=class extends kt{constructor(e){var t,n,r;super("w:tblPr",e.includeIfEmpty),e.style&&this.root.push(new it("w:tblStyle",e.style));let i=((t=e.float)===null||t===void 0?void 0:t.relativeVerticalPosition)===wT.INLINE,s=i?void 0:e.float;s&&this.root.push(yT(s)),s?.overlap&&this.root.push(ST(s.overlap)),e.visuallyRightToLeft!==void 0&&this.root.push(Pl("w:bidiVisual",e.visuallyRightToLeft)),e.width&&this.root.push(Lr("w:tblW",e.width));let a=(n=e.alignment)!==null&&n!==void 0?n:i&&(!((r=e.float)===null||r===void 0)&&r.relativeHorizontalPosition)?CT[e.float.relativeHorizontalPosition]:void 0;if(a&&this.root.push(om(a)),e.cellSpacing&&this.root.push(Zm(e.cellSpacing)),e.indent&&this.root.push(Lr("w:tblInd",e.indent)),e.borders&&this.root.push(new Qm(e.borders,{fillMissingSides:!e.style})),e.shading&&this.root.push(Us(e.shading)),e.layout&&this.root.push(xT(e.layout)),e.cellMargin){let o=cT(e.cellMargin);o&&this.root.push(o)}e.tableLook&&this.root.push(TT(e.tableLook)),e.revision&&this.root.push(new ET(e.revision))}},ET=class extends I{constructor(e){super("w:tblPrChange"),this.root.push(new qe({id:e.id,author:e.author,date:e.date})),this.root.push(new hc(k(k({},e),{},{includeIfEmpty:!0})))}},AT=(e,t)=>new O({name:"w:trHeight",attributes:{value:{key:"w:val",value:ve(e)},rule:{key:"w:hRule",value:t}}}),ef=class extends kt{constructor(e){super("w:trPr",e.includeIfEmpty),e.cantSplit!==void 0&&this.root.push(Pl("w:cantSplit",e.cantSplit)),e.tableHeader!==void 0&&this.root.push(Pl("w:tblHeader",e.tableHeader)),e.height&&this.root.push(AT(e.height.value,e.height.rule)),e.cellSpacing&&this.root.push(Zm(e.cellSpacing)),e.insertion&&this.root.push(new rT(e.insertion)),e.deletion&&this.root.push(new iT(e.deletion)),e.revision&&this.root.push(new _T(e.revision))}},_T=class extends I{constructor(e){super("w:trPrChange"),this.root.push(new qe({id:e.id,author:e.author,date:e.date})),this.root.push(new ef(k(k({},e),{},{includeIfEmpty:!0})))}},Ls=(e,t)=>{let n=e[t];return Array.isArray(n)?n:[]},Ar=e=>Object.keys(e)[0],NT=(e,t)=>{let n=Ls(e,"w:p"),r=n.find(o=>Ar(o)==="w:pPr");if(!r)return{"w:p":[{"w:pPr":[t]},...n]};let i=Ls(r,"w:pPr");if(i.some(o=>Ar(o)==="w:keepNext"))return e;let s=i.filter(o=>Ar(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)}},Gs=class extends I{constructor(e){super("w:tr"),C(this,"options",void 0),this.options=e,this.root.push(new ef(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 P("w:keepNext",this.options.keepNext).prepForXml(e);return{"w:tr":Ls(t,"w:tr").map(r=>Ar(r)==="w:tc"?{"w:tc":Ls(r,"w:tc").map(i=>Ar(i)==="w:p"?NT(i,n):i)}:r)}}get CellCount(){return this.options.children.length}get cells(){return this.root.filter(e=>Fs(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}},tf=class nf extends dc{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:m,cellSpacing:f,revision:h}){super("w:tbl"),C(this,"rows",void 0),C(this,"width",void 0),C(this,"columnWidths",void 0),C(this,"columnWidthsRevision",void 0),C(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 x=0;g.cells.forEach(b=>{if(b.options.rowSpan&&b.options.rowSpan>1){let E=b.options.children[b.options.children.length-1],_=new Mr({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:E instanceof ne?[new ne(E.Alignment)]:[],verticalMerge:Ym.CONTINUE});t[y+1].addCellToColumnIndex(_,x)}x+=b.options.columnSpan||1})}),this.setCellWidths(Cs),this.resolvedColumnWidths=r??ih({rows:t,width:this.width,availableWidth:Cs}),this.root.push(new hc({borders:l?u:u??{},width:this.width,indent:a,float:o,layout:c,style:l,alignment:d,cellMargin:s,visuallyRightToLeft:p,tableLook:m,cellSpacing:f,revision:h})),this.root.push(new Es(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=ih({rows:this.rows,width:this.width,availableWidth:this.resolveAvailableWidth(t)});let n=this.root.findIndex(r=>r instanceof Es);this.root[n]=new Es(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=uc(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,m)=>p+m,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 Mr&&o instanceof Gs&&c instanceof nf){let p=c.getCellWidth(o,a);if(p!==void 0)return p}let l=s.findIndex(p=>p instanceof zm),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:Cs}},IT=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},PT=class extends I{constructor(){super("Properties"),this.root.push(new IT({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}},OT=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{xmlns:"xmlns"})}},bt=(e,t)=>new O({name:"Default",attributes:{contentType:{key:"ContentType",value:e},extension:{key:"Extension",value:t}}}),ge=(e,t)=>new O({name:"Override",attributes:{contentType:{key:"ContentType",value:e},partName:{key:"PartName",value:t}}}),RT=class extends I{constructor({macros:e=!1}={}){super("Types"),this.root.push(new OT({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(bt("image/png","png")),this.root.push(bt("image/jpeg","jpeg")),this.root.push(bt("image/jpeg","jpg")),this.root.push(bt("image/bmp","bmp")),this.root.push(bt("image/gif","gif")),this.root.push(bt("image/svg+xml","svg")),this.root.push(bt("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(bt("application/xml","xml")),this.root.push(bt("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`))}},Ol={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"},zs=class extends H{constructor(e,t){super(k({Ignorable:t},Object.fromEntries(e.map(n=>[n,Ol[n]])))),C(this,"xmlKeys",k({Ignorable:"mc:Ignorable"},Object.fromEntries(Object.keys(Ol).map(n=>[n,`xmlns:${n}`]))))}},LT=class extends I{constructor(e){super("cp:coreProperties"),this.root.push(new zs(["cp","dc","dcterms","dcmitype","xsi"])),e.title&&this.root.push(new en("dc:title",e.title)),e.subject&&this.root.push(new en("dc:subject",e.subject)),e.creator&&this.root.push(new en("dc:creator",e.creator)),e.keywords&&this.root.push(new en("cp:keywords",e.keywords)),e.description&&this.root.push(new en("dc:description",e.description)),e.lastModifiedBy&&this.root.push(new en("cp:lastModifiedBy",e.lastModifiedBy)),e.revision&&this.root.push(new en("cp:revision",String(e.revision))),this.root.push(new ah("dcterms:created")),this.root.push(new ah("dcterms:modified"))}},MT=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{type:"xsi:type"})}},ah=class extends I{constructor(e){super(e),this.root.push(new MT({type:"dcterms:W3CDTF"})),this.root.push(dx(new Date))}},DT=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},BT=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{formatId:"fmtid",pid:"pid",name:"name"})}},$T=class extends I{constructor(e,t){super("property"),this.root.push(new BT({formatId:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:e.toString(),name:t.name})),this.root.push(new FT(t.value))}},FT=class extends I{constructor(e){super("vt:lpwstr"),this.root.push(e)}},qT=class extends I{constructor(e){super("Properties"),C(this,"nextId",void 0),C(this,"properties",[]),this.root.push(new DT({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 $T(this.nextId++,e))}},HT=e=>new O({name:"ds:datastoreItem",attributes:{itemId:{key:"ds:itemID",value:e},namespace:{key:"xmlns:ds",value:"http://schemas.openxmlformats.org/officeDocument/2006/customXml"}},children:[new O({name:"ds:schemaRefs",children:[new O({name:"ds:schemaRef",attributes:{uri:{key:"ds:uri",value:"http://schemas.openxmlformats.org/officeDocument/2006/bibliography"}}})]})]}),UT={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"},jT=e=>new O({name:"wne:vbaSuppData",attributes:{namespace:{key:"xmlns:wne",value:"http://schemas.microsoft.com/office/word/2006/wordml"}},children:[new O({name:"wne:docEvents",children:Object.entries(UT).filter(([t])=>e.includes(t)).map(([,t])=>new O({name:t}))})]}),WT=class extends I{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 tc([{keys:Hr,color:e},{key:"w:themeColor",value:t},{key:"w:themeShade",value:n===void 0?void 0:zu(n)},{key:"w:themeTint",value:r===void 0?void 0:zu(r)}]))}},KT=class extends I{constructor(e){super("w:document"),C(this,"body",void 0),this.root.push(new zs(["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 zm({pageNumbers:e.pageNumbers}),e.background&&this.root.push(new WT(e.background)),this.root.push(this.body)}add(e){return this.body.push(e),this}get Body(){return this.body}},GT=class{constructor(e){C(this,"document",void 0),C(this,"relationships",void 0),this.document=new KT(e),this.relationships=new be}get View(){return this.document}get Relationships(){return this.relationships}},zT=class extends H{constructor(...e){super(...e),C(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"})}},rf=class extends I{constructor(e,t){super("w:p"),C(this,"paragraph",void 0),C(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)]}}},VT=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{type:"w:type",id:"w:id"})}},sf=class extends Fe{constructor(){super({style:"EndnoteReference"}),this.root.push(new p1)}},oh={SEPARATOR:"separator",CONTINUATION_SEPARATOR:"continuationSeparator"},al=class extends I{constructor(e){super("w:endnote"),this.root.push(new VT({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new rf(n,new sf):n)}},XT=class extends I{constructor(){super("w:continuationSeparator")}},af=class extends Fe{constructor(){super({}),this.root.push(new XT)}},YT=class extends I{constructor(){super("w:separator")}},of=class extends Fe{constructor(){super({}),this.root.push(new YT)}},lf=class extends I{constructor(){super("w:endnotes"),C(this,"ownNotes",new Map),C(this,"highestId",0),this.root.push(new zT({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 al({id:-1,type:oh.SEPARATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Pn.AUTO},children:[new of]})]});this.root.push(e);let t=new al({id:0,type:oh.CONTINUATION_SEPARATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Pn.AUTO},children:[new af]})]});this.root.push(t)}createEndnote(e,t){let n=new al({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 jr(t,e),t}},JT=class{constructor(){C(this,"endnotes",void 0),C(this,"relationships",void 0),this.endnotes=new lf,this.relationships=new be}get View(){return this.endnotes}get Relationships(){return this.relationships}},QT=class extends H{constructor(...e){super(...e),C(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"})}},ZT=class extends tm{constructor(e,t){super("w:ftr",t),C(this,"refId",void 0),this.refId=e,t||this.root.push(new QT({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 jr(t,e,this.refId),t}},eS=class{constructor(e,t,n){C(this,"media",void 0),C(this,"footer",void 0),C(this,"relationships",void 0),this.media=e,this.footer=new ZT(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}},tS=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{type:"w:type",id:"w:id"})}},nS=class extends I{constructor(){super("w:footnoteRef")}},cf=class extends Fe{constructor(){super({style:"FootnoteReference"}),this.root.push(new nS)}},lh={SEPERATOR:"separator",CONTINUATION_SEPERATOR:"continuationSeparator"},ol=class extends I{constructor(e){super("w:footnote"),this.root.push(new tS({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new rf(n,new cf):n)}},rS=class extends H{constructor(...e){super(...e),C(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"})}},df=class extends I{constructor(){super("w:footnotes"),C(this,"ownNotes",new Map),C(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 ol({id:-1,type:lh.SEPERATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Pn.AUTO},children:[new of]})]});this.root.push(e);let t=new ol({id:0,type:lh.CONTINUATION_SEPERATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Pn.AUTO},children:[new af]})]});this.root.push(t)}createFootNote(e,t){let n=new ol({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 jr(t,e),t}},iS=class{constructor(){C(this,"footnotess",void 0),C(this,"relationships",void 0),this.footnotess=new df,this.relationships=new be}get View(){return this.footnotess}get Relationships(){return this.relationships}},sS=class extends H{constructor(...e){super(...e),C(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"})}},aS=class extends tm{constructor(e,t){super("w:hdr",t),C(this,"refId",void 0),this.refId=e,t||this.root.push(new sS({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 jr(t,e,this.refId),t}},oS=class{constructor(e,t,n){C(this,"media",void 0),C(this,"header",void 0),C(this,"relationships",void 0),this.media=e,this.header=new aS(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}},lS=()=>{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}`}},pf=class{constructor(e=lS()){C(this,"map",new Map),C(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())}},vt={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"},cS=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{ilvl:"w:ilvl",tentative:"w:tentative"})}},dS=class extends I{constructor(e){super("w:numFmt"),this.root.push(new _e({val:e}))}},pS=class extends I{constructor(e){super("w:lvlText"),this.root.push(new _e({val:e}))}},uS=e=>{switch(e){case pe.CENTER:return"center";case pe.END:case pe.RIGHT:return"right";default:return"left"}},hS=class extends I{constructor(e){super("w:lvlJc"),this.root.push(new _e({val:uS(e)}))}},mS=class extends I{constructor(e){super("w:suff"),this.root.push(new _e({val:e}))}},fS=class extends I{constructor(){super("w:isLgl")}},gS=class extends I{constructor({level:e,format:t,text:n,alignment:r=pe.START,start:i=1,style:s,suffix:a,isLegalNumberingStyle:o}){if(super("w:lvl"),C(this,"paragraphProperties",void 0),C(this,"runProperties",void 0),this.root.push(new Er("w:start",le(i))),t&&this.root.push(new dS(t)),s?.style&&this.root.push(Cr(s.style)),o&&this.root.push(new fS),a&&this.root.push(new mS(a)),n&&this.root.push(new pS(n)),this.root.push(new hS(r)),this.paragraphProperties=new On(s&&s.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new sn(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 cS({ilvl:le(e),tentative:1}))}},bS=class extends gS{},vS=class extends I{constructor(e){super("w:multiLevelType"),this.root.push(new _e({val:e}))}},wS=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}},ll=class extends I{constructor(e,t){super("w:abstractNum"),C(this,"id",void 0),this.root.push(new wS({abstractNumId:le(e),restartNumberingAfterBreak:0})),this.root.push(new vS("hybridMultilevel")),this.id=e;for(let n of t)this.root.push(new bS(n))}},yS=class extends I{constructor(e){super("w:abstractNumId"),this.root.push(new _e({val:e}))}},xS=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{numId:"w:numId"})}},ch=class extends I{constructor(e){if(super("w:num"),C(this,"numId",void 0),C(this,"reference",void 0),C(this,"instance",void 0),C(this,"restartedListId",void 0),this.numId=e.numId,this.reference=e.reference,this.instance=e.instance,this.restartedListId=e.restartedListId,this.root.push(new xS({numId:le(e.numId)})),this.root.push(new yS(le(e.abstractNumId))),e.overrideLevels&&e.overrideLevels.length)for(let t of e.overrideLevels)this.root.push(new TS(t.num,t.start))}},kS=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{ilvl:"w:ilvl"})}},TS=class extends I{constructor(e,t){super("w:lvlOverride"),this.root.push(new kS({ilvl:e})),t!==void 0&&this.root.push(new CS(t))}},SS=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{val:"w:val"})}},CS=class extends I{constructor(e){super("w:startOverride"),this.root.push(new SS({val:e}))}},uf=class extends I{constructor(e){super("w:numbering"),C(this,"abstractNumberingMap",new Map),C(this,"concreteNumberingMap",new Map),C(this,"referenceConfigMap",new Map),C(this,"abstractNumUniqueNumericId",zx()),C(this,"concreteNumUniqueNumericId",Vx()),this.root.push(new zs(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps"],"w14 w15 wp14"));let t=new ll(this.abstractNumUniqueNumericId(),[{level:0,format:vt.BULLET,text:"\u25CF",alignment:pe.LEFT,style:{paragraph:{indent:{left:ze(.5),hanging:ze(.25)}}}},{level:1,format:vt.BULLET,text:"\u25CB",alignment:pe.LEFT,style:{paragraph:{indent:{left:ze(1),hanging:ze(.25)}}}},{level:2,format:vt.BULLET,text:"\u25A0",alignment:pe.LEFT,style:{paragraph:{indent:{left:2160,hanging:ze(.25)}}}},{level:3,format:vt.BULLET,text:"\u25CF",alignment:pe.LEFT,style:{paragraph:{indent:{left:2880,hanging:ze(.25)}}}},{level:4,format:vt.BULLET,text:"\u25CB",alignment:pe.LEFT,style:{paragraph:{indent:{left:3600,hanging:ze(.25)}}}},{level:5,format:vt.BULLET,text:"\u25A0",alignment:pe.LEFT,style:{paragraph:{indent:{left:4320,hanging:ze(.25)}}}},{level:6,format:vt.BULLET,text:"\u25CF",alignment:pe.LEFT,style:{paragraph:{indent:{left:5040,hanging:ze(.25)}}}},{level:7,format:vt.BULLET,text:"\u25CF",alignment:pe.LEFT,style:{paragraph:{indent:{left:5760,hanging:ze(.25)}}}},{level:8,format:vt.BULLET,text:"\u25CF",alignment:pe.LEFT,style:{paragraph:{indent:{left:6480,hanging:ze(.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new ch({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 ll(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 ll(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels));let s=this.abstractNumberingMap.get(e);if(!s)return;let a=Os(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 ch(c))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}},hf=class{constructor(e,t=new Set){C(this,"contentTypes",void 0),C(this,"paths",new Map),C(this,"taken",void 0),C(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}`}},ES=e=>new O({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"}}}),AS=class extends I{constructor(e){super("w:compat"),e.useSingleBorderforContiguousCells&&this.root.push(new P("w:useSingleBorderforContiguousCells",e.useSingleBorderforContiguousCells)),e.wordPerfectJustification&&this.root.push(new P("w:wpJustification",e.wordPerfectJustification)),e.noTabStopForHangingIndent&&this.root.push(new P("w:noTabHangInd",e.noTabStopForHangingIndent)),e.noLeading&&this.root.push(new P("w:noLeading",e.noLeading)),e.spaceForUnderline&&this.root.push(new P("w:spaceForUL",e.spaceForUnderline)),e.noColumnBalance&&this.root.push(new P("w:noColumnBalance",e.noColumnBalance)),e.balanceSingleByteDoubleByteWidth&&this.root.push(new P("w:balanceSingleByteDoubleByteWidth",e.balanceSingleByteDoubleByteWidth)),e.noExtraLineSpacing&&this.root.push(new P("w:noExtraLineSpacing",e.noExtraLineSpacing)),e.doNotLeaveBackslashAlone&&this.root.push(new P("w:doNotLeaveBackslashAlone",e.doNotLeaveBackslashAlone)),e.underlineTrailingSpaces&&this.root.push(new P("w:ulTrailSpace",e.underlineTrailingSpaces)),e.doNotExpandShiftReturn&&this.root.push(new P("w:doNotExpandShiftReturn",e.doNotExpandShiftReturn)),e.spacingInWholePoints&&this.root.push(new P("w:spacingInWholePoints",e.spacingInWholePoints)),e.lineWrapLikeWord6&&this.root.push(new P("w:lineWrapLikeWord6",e.lineWrapLikeWord6)),e.printBodyTextBeforeHeader&&this.root.push(new P("w:printBodyTextBeforeHeader",e.printBodyTextBeforeHeader)),e.printColorsBlack&&this.root.push(new P("w:printColBlack",e.printColorsBlack)),e.spaceWidth&&this.root.push(new P("w:wpSpaceWidth",e.spaceWidth)),e.showBreaksInFrames&&this.root.push(new P("w:showBreaksInFrames",e.showBreaksInFrames)),e.subFontBySize&&this.root.push(new P("w:subFontBySize",e.subFontBySize)),e.suppressBottomSpacing&&this.root.push(new P("w:suppressBottomSpacing",e.suppressBottomSpacing)),e.suppressTopSpacing&&this.root.push(new P("w:suppressTopSpacing",e.suppressTopSpacing)),e.suppressSpacingAtTopOfPage&&this.root.push(new P("w:suppressSpacingAtTopOfPage",e.suppressSpacingAtTopOfPage)),e.suppressTopSpacingWP&&this.root.push(new P("w:suppressTopSpacingWP",e.suppressTopSpacingWP)),e.suppressSpBfAfterPgBrk&&this.root.push(new P("w:suppressSpBfAfterPgBrk",e.suppressSpBfAfterPgBrk)),e.swapBordersFacingPages&&this.root.push(new P("w:swapBordersFacingPages",e.swapBordersFacingPages)),e.convertMailMergeEsc&&this.root.push(new P("w:convMailMergeEsc",e.convertMailMergeEsc)),e.truncateFontHeightsLikeWP6&&this.root.push(new P("w:truncateFontHeightsLikeWP6",e.truncateFontHeightsLikeWP6)),e.macWordSmallCaps&&this.root.push(new P("w:mwSmallCaps",e.macWordSmallCaps)),e.usePrinterMetrics&&this.root.push(new P("w:usePrinterMetrics",e.usePrinterMetrics)),e.doNotSuppressParagraphBorders&&this.root.push(new P("w:doNotSuppressParagraphBorders",e.doNotSuppressParagraphBorders)),e.wrapTrailSpaces&&this.root.push(new P("w:wrapTrailSpaces",e.wrapTrailSpaces)),e.footnoteLayoutLikeWW8&&this.root.push(new P("w:footnoteLayoutLikeWW8",e.footnoteLayoutLikeWW8)),e.shapeLayoutLikeWW8&&this.root.push(new P("w:shapeLayoutLikeWW8",e.shapeLayoutLikeWW8)),e.alignTablesRowByRow&&this.root.push(new P("w:alignTablesRowByRow",e.alignTablesRowByRow)),e.forgetLastTabAlignment&&this.root.push(new P("w:forgetLastTabAlignment",e.forgetLastTabAlignment)),e.adjustLineHeightInTable&&this.root.push(new P("w:adjustLineHeightInTable",e.adjustLineHeightInTable)),e.autoSpaceLikeWord95&&this.root.push(new P("w:autoSpaceLikeWord95",e.autoSpaceLikeWord95)),e.noSpaceRaiseLower&&this.root.push(new P("w:noSpaceRaiseLower",e.noSpaceRaiseLower)),e.doNotUseHTMLParagraphAutoSpacing&&this.root.push(new P("w:doNotUseHTMLParagraphAutoSpacing",e.doNotUseHTMLParagraphAutoSpacing)),e.layoutRawTableWidth&&this.root.push(new P("w:layoutRawTableWidth",e.layoutRawTableWidth)),e.layoutTableRowsApart&&this.root.push(new P("w:layoutTableRowsApart",e.layoutTableRowsApart)),e.useWord97LineBreakRules&&this.root.push(new P("w:useWord97LineBreakRules",e.useWord97LineBreakRules)),e.doNotBreakWrappedTables&&this.root.push(new P("w:doNotBreakWrappedTables",e.doNotBreakWrappedTables)),e.doNotSnapToGridInCell&&this.root.push(new P("w:doNotSnapToGridInCell",e.doNotSnapToGridInCell)),e.selectFieldWithFirstOrLastCharacter&&this.root.push(new P("w:selectFldWithFirstOrLastChar",e.selectFieldWithFirstOrLastCharacter)),e.applyBreakingRules&&this.root.push(new P("w:applyBreakingRules",e.applyBreakingRules)),e.doNotWrapTextWithPunctuation&&this.root.push(new P("w:doNotWrapTextWithPunct",e.doNotWrapTextWithPunctuation)),e.doNotUseEastAsianBreakRules&&this.root.push(new P("w:doNotUseEastAsianBreakRules",e.doNotUseEastAsianBreakRules)),e.useWord2002TableStyleRules&&this.root.push(new P("w:useWord2002TableStyleRules",e.useWord2002TableStyleRules)),e.growAutofit&&this.root.push(new P("w:growAutofit",e.growAutofit)),e.useFELayout&&this.root.push(new P("w:useFELayout",e.useFELayout)),e.useNormalStyleForList&&this.root.push(new P("w:useNormalStyleForList",e.useNormalStyleForList)),e.doNotUseIndentAsNumberingTabStop&&this.root.push(new P("w:doNotUseIndentAsNumberingTabStop",e.doNotUseIndentAsNumberingTabStop)),e.useAlternateEastAsianLineBreakRules&&this.root.push(new P("w:useAltKinsokuLineBreakRules",e.useAlternateEastAsianLineBreakRules)),e.allowSpaceOfSameStyleInTable&&this.root.push(new P("w:allowSpaceOfSameStyleInTable",e.allowSpaceOfSameStyleInTable)),e.doNotSuppressIndentation&&this.root.push(new P("w:doNotSuppressIndentation",e.doNotSuppressIndentation)),e.doNotAutofitConstrainedTables&&this.root.push(new P("w:doNotAutofitConstrainedTables",e.doNotAutofitConstrainedTables)),e.autofitToFirstFixedWidthCell&&this.root.push(new P("w:autofitToFirstFixedWidthCell",e.autofitToFirstFixedWidthCell)),e.underlineTabInNumberingList&&this.root.push(new P("w:underlineTabInNumList",e.underlineTabInNumberingList)),e.displayHangulFixedWidth&&this.root.push(new P("w:displayHangulFixedWidth",e.displayHangulFixedWidth)),e.splitPgBreakAndParaMark&&this.root.push(new P("w:splitPgBreakAndParaMark",e.splitPgBreakAndParaMark)),e.doNotVerticallyAlignCellWithSp&&this.root.push(new P("w:doNotVertAlignCellWithSp",e.doNotVerticallyAlignCellWithSp)),e.doNotBreakConstrainedForcedTable&&this.root.push(new P("w:doNotBreakConstrainedForcedTable",e.doNotBreakConstrainedForcedTable)),e.ignoreVerticalAlignmentInTextboxes&&this.root.push(new P("w:doNotVertAlignInTxbx",e.ignoreVerticalAlignmentInTextboxes)),e.useAnsiKerningPairs&&this.root.push(new P("w:useAnsiKerningPairs",e.useAnsiKerningPairs)),e.cachedColumnBalance&&this.root.push(new P("w:cachedColBalance",e.cachedColumnBalance)),e.version&&this.root.push(ES(e.version))}},dh=1e5,ph=15,_S=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],NS=[[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]],uh=e=>e>>14&1|e<<1&32767,IS=e=>{let t=e.slice(0,ph).split("").map(i=>{let s=i.charCodeAt(0);return(s&255)!==0?s&255:s>>8&255}),n=t.reduce((i,s,a)=>NS[ph-t.length+a].reduce((o,c,l)=>s>>l&1?o^c:o,i),_S[t.length-1]),r=(uh(t.reduceRight((i,s)=>uh(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("")},PS=(e,t,n)=>{let r=[...IS(e)].flatMap(o=>[o.charCodeAt(0),0]),i=Ju(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=Ju(s);return Array.from(i)},OS=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))},hh=class extends H{constructor(...e){super(...e),C(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"})}},mh=e=>btoa(String.fromCharCode(...e)),RS=class extends I{constructor({type:e,password:t}){if(super("w:documentProtection"),t===void 0||t===""){this.root.push(new hh({edit:e,enforcement:!0}));return}let n=OS(16);this.root.push(new hh({edit:e,enforcement:!0,cryptProviderType:"rsaAES",cryptAlgorithmClass:"hash",cryptAlgorithmType:"typeAny",cryptAlgorithmSid:12,cryptSpinCount:dh,hash:mh(PS(t,n,dh)),salt:mh(n)}))}},LS=class extends H{constructor(...e){super(...e),C(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"})}},MS=class extends I{constructor(e){var t,n,r,i,s,a,o,c,l;super("w:settings"),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",Ignorable:"w14 w15 wp14"})),this.root.push(new P("w:displayBackgroundShape",!0)),e.embedFonts!==void 0&&this.root.push(new P("w:embedTrueTypeFonts",e.embedFonts)),e.trackRevisions!==void 0&&this.root.push(new P("w:trackRevisions",e.trackRevisions)),e.protection!==void 0&&this.root.push(new RS(e.protection)),this.root.push(new Er("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 P("w:autoHyphenation",e.hyphenation.autoHyphenation)),((r=e.hyphenation)===null||r===void 0?void 0:r.consecutiveHyphenLimit)!==void 0&&this.root.push(new Er("w:consecutiveHyphenLimit",e.hyphenation.consecutiveHyphenLimit)),((i=e.hyphenation)===null||i===void 0?void 0:i.hyphenationZone)!==void 0&&this.root.push(new Er("w:hyphenationZone",e.hyphenation.hyphenationZone)),((s=e.hyphenation)===null||s===void 0?void 0:s.doNotHyphenateCaps)!==void 0&&this.root.push(new P("w:doNotHyphenateCaps",e.hyphenation.doNotHyphenateCaps)),e.evenAndOddHeaders!==void 0&&this.root.push(new P("w:evenAndOddHeaders",e.evenAndOddHeaders)),e.updateFields!==void 0&&this.root.push(new P("w:updateFields",e.updateFields)),this.root.push(new AS(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})))}},mf=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{val:"w:val"})}},DS=class extends I{constructor(e){super("w:name"),this.root.push(new mf({val:e}))}},BS=class extends I{constructor(e){super("w:uiPriority"),this.root.push(new mf({val:le(e)}))}},$S=class extends H{constructor(...e){super(...e),C(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}},mc=class extends I{constructor(e,t){super("w:style"),this.root.push(new $S(e)),t.name&&this.root.push(new DS(t.name)),t.basedOn&&t.basedOn!==e.styleId&&this.root.push(new it("w:basedOn",t.basedOn)),t.next&&this.root.push(new it("w:next",t.next)),t.link&&this.root.push(new it("w:link",t.link)),t.uiPriority!==void 0&&this.root.push(new BS(t.uiPriority)),t.semiHidden!==void 0&&this.root.push(new P("w:semiHidden",t.semiHidden)),t.unhideWhenUsed!==void 0&&this.root.push(new P("w:unhideWhenUsed",t.unhideWhenUsed)),t.quickFormat!==void 0&&this.root.push(new P("w:qFormat",t.quickFormat))}},Tt=class extends mc{constructor(e){super({type:"paragraph",styleId:e.id},e),C(this,"paragraphProperties",void 0),C(this,"runProperties",void 0),this.paragraphProperties=new On(e.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new sn(e.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}},an=class extends mc{constructor(e){super({type:"character",styleId:e.id},k({uiPriority:99,unhideWhenUsed:!0},e)),C(this,"runProperties",void 0),this.runProperties=new sn(e.run),this.root.push(this.runProperties)}},Ut=class extends Tt{constructor(e){super(k({basedOn:"Normal",next:"Normal",quickFormat:!0},e))}},FS=class extends Ut{constructor(e){super(k({id:"Title",name:"Title"},e))}},qS=class extends Ut{constructor(e){super(k({id:"Heading1",name:"Heading 1"},e))}},HS=class extends Ut{constructor(e){super(k({id:"Heading2",name:"Heading 2"},e))}},US=class extends Ut{constructor(e){super(k({id:"Heading3",name:"Heading 3"},e))}},jS=class extends Ut{constructor(e){super(k({id:"Heading4",name:"Heading 4"},e))}},WS=class extends Ut{constructor(e){super(k({id:"Heading5",name:"Heading 5"},e))}},KS=class extends Ut{constructor(e){super(k({id:"Heading6",name:"Heading 6"},e))}},GS=class extends Ut{constructor(e){super(k({id:"Strong",name:"Strong"},e))}},zS=class extends Tt{constructor(e){super(k({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},e))}},VS=class extends Tt{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))}},XS=class extends Tt{constructor(e){super(k({id:"Bibliography",name:"Bibliography",basedOn:"Normal",next:"Normal",uiPriority:37,unhideWhenUsed:!0},e))}},ff=new WeakSet,fh=e=>ff.has(e),wt=class extends Tt{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 ff.add(t),t}},gf=class extends Tt{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:Pn.AUTO}},run:{size:20}},e))}},bf=class extends an{constructor(e){super(k({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},vf=class extends an{constructor(e){super(k({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},e))}},wf=class extends Tt{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:Pn.AUTO}},run:{size:20}},e))}},yf=class extends an{constructor(e){super(k({id:"EndnoteReference",name:"endnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},xf=class extends an{constructor(e){super(k({id:"EndnoteTextChar",name:"Endnote Text Char",basedOn:"DefaultParagraphFont",link:"EndnoteText",semiHidden:!0,run:{size:20}},e))}},YS=class extends an{constructor(e){super(k({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:gm.SINGLE}}},e))}},JS=class extends an{constructor(e){super(k({id:"LineNumber",name:"line number",basedOn:"DefaultParagraphFont",semiHidden:!0},e))}},QS=class extends mc{constructor(){super({type:"table",styleId:"TableNormal",default:!0},{name:"Normal Table",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0}),this.root.push(new hc({indent:{size:0,type:$e.DXA},cellMargin:{top:0,left:108,bottom:0,right:108}}))}},_r=e=>typeof e=="object"?Object.keys(e)[0]:void 0,fc=e=>{var t;return(t=[e["w:style"]].flat().find(n=>n._attr))===null||t===void 0?void 0:t._attr},gh=e=>{var t;return(t=fc(e))===null||t===void 0?void 0:t["w:styleId"]},bh=e=>{var t;let n=(t=[e["w:style"]].flat().find(r=>_r(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()},Rl=e=>{var t,n;return _r(e)==="w:style"&&((t=(n=fc(e))===null||n===void 0?void 0:n["w:type"])!==null&&t!==void 0?t:"paragraph")==="paragraph"},ZS=e=>{let t=Rl(e)?fc(e):void 0;return t?.["w:default"]!==void 0&&!["0","false","off"].includes(String(t["w:default"]))},eC=e=>({"w:style":[e["w:style"]].flat().map(t=>t._attr?{_attr:k(k({},t._attr),{},{"w:default":"1"})}:t)}),cl=class extends I{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 Tt(t));if(e.characterStyles)for(let t of e.characterStyles)this.root.push(new an(t))}prepForXml(e){let t=super.prepForXml(e),n=t["w:styles"];if(!Array.isArray(n))return t;let r=l=>n.filter(u=>_r(u)===l),i=n.map(l=>_r(l)==="w:style"?gh(l):void 0),s=n.filter((l,u)=>!["_attr","w:docDefaults","w:latentStyles"].includes(_r(l))&&(i[u]===void 0||i.lastIndexOf(i[u])===u)),a=new Set(s.filter(l=>Rl(l)&&!fh(l)).map(bh)),o=s.filter(l=>!fh(l)||!a.has(bh(l))),c=o.some(ZS)?o:o.map(l=>Rl(l)&&gh(l)==="Normal"?eC(l):l);return{"w:styles":[...r("_attr"),...r("w:docDefaults").slice(-1),...r("w:latentStyles").slice(-1),...c]}}},tC=class extends I{constructor(e){super("w:pPrDefault"),this.root.push(new On(e,{implicitListParagraphStyle:!1,inListOrder:!1}))}},nC=class extends I{constructor(e){super("w:rPrDefault"),this.root.push(new sn(e))}},rC=class extends I{constructor(e){super("w:docDefaults"),C(this,"runPropertiesDefaults",void 0),C(this,"paragraphPropertiesDefaults",void 0),this.runPropertiesDefaults=new nC(e.run),this.paragraphPropertiesDefaults=new tC(e.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}},iC=class{newInstance(e){let t=qr(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 ix(n.attributes),importedStyles:r.map(i=>Jl(i))}}},sC=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:$t(n))},aC=e=>({tableOfContents1:new wt(1,e),tableOfContents2:new wt(2,e),tableOfContents3:new wt(3,e),tableOfContents4:new wt(4,e),tableOfContents5:new wt(5,e),tableOfContents6:new wt(6,e),tableOfContents7:new wt(7,e),tableOfContents8:new wt(8,e),tableOfContents9:new wt(9,e)}),gc=(e={})=>{var t;return k(k({normal:new Tt({id:"Normal",name:"Normal",quickFormat:!0}),normalTable:new QS,document:new rC((t=e.document)!==null&&t!==void 0?t:{}),title:new FS(k({run:{size:56}},e.title)),heading1:new qS(k({run:{color:"2E74B5",size:32}},e.heading1)),heading2:new HS(k({run:{color:"2E74B5",size:26}},e.heading2)),heading3:new US(k({run:{color:"1F4D78",size:24}},e.heading3)),heading4:new jS(k({run:{color:"2E74B5",italics:!0}},e.heading4)),heading5:new WS(k({run:{color:"2E74B5"}},e.heading5)),heading6:new KS(k({run:{color:"1F4D78"}},e.heading6)),strong:new GS(k({run:{bold:!0}},e.strong)),listParagraph:new zS(e.listParagraph||{}),caption:new VS(e.caption||{}),bibliography:new XS(e.bibliography||{})},aC(sC(e))),{},{hyperlink:new YS(e.hyperlink||{}),footnoteReference:new bf(e.footnoteReference||{}),footnoteText:new gf(e.footnoteText||{}),footnoteTextChar:new vf(e.footnoteTextChar||{}),endnoteReference:new yf(e.endnoteReference||{}),endnoteText:new wf(e.endnoteText||{}),endnoteTextChar:new xf(e.endnoteTextChar||{}),lineNumber:new JS(e.lineNumber||{})})},vh=class{newInstance(e={}){return{initialStyles:new zs(["mc","r","w","w14","w15"],"w14 w15"),importedStyles:Object.values(gc(e))}}},kf={headings:{latin:"Calibri Light",panose:"020F0302020204030204"},body:{latin:"Calibri",panose:"020F0502020204030204"}},oC=[["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"]],dl=(e,t,n)=>new O({name:e,attributes:{typeface:{key:"typeface",value:t},panose:{key:"panose",value:n}}}),lC=(e,t)=>{let n=t[e],r=typeof n=="string"?n:n?.latin;return r??kf[e].latin},cC=(e,t={})=>{let n=oC.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))]},wh=(e,t)=>{let n=t[e],{eastAsia:r="",complexScript:i="",scripts:s}=typeof n=="object"?n:{},a=lC(e,t),o=kf[e];return new O({name:e==="headings"?"a:majorFont":"a:minorFont",children:[dl("a:latin",a,a===o.latin?o.panose:void 0),dl("a:ea",r),dl("a:cs",i),...cC(e,s).map(([c,l])=>new O({name:"a:font",attributes:{script:{key:"script",value:c},typeface:{key:"typeface",value:l}}}))]})},dC=(e,t={})=>new O({name:"a:fontScheme",attributes:{name:{key:"name",value:e}},children:[wh("headings",t),wh("body",t)]}),Tf=(e=[])=>new O({name:"a:schemeClr",attributes:{value:{key:"val",value:"phClr"}},children:e.map(([t,n])=>new O({name:`a:${t}`,attributes:{value:{key:"val",value:n}}}))}),As=e=>new O({name:"a:solidFill",children:[Tf(e)]}),pl=e=>new O({name:"a:gradFill",attributes:{rotateWithShape:{key:"rotWithShape",value:!0}},children:[new O({name:"a:gsLst",children:e.map((t,n)=>new O({name:"a:gs",attributes:{position:{key:"pos",value:n*5e4}},children:[Tf(t)]}))}),new O({name:"a:lin",attributes:{angle:{key:"ang",value:54e5},scaled:{key:"scaled",value:!1}}})]}),ul=e=>new O({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:[As(),new O({name:"a:prstDash",attributes:{value:{key:"val",value:"solid"}}}),new O({name:"a:miter",attributes:{limit:{key:"lim",value:8e5}}})]}),hl=e=>new O({name:"a:effectStyle",children:[new O({name:"a:effectLst",children:e})]}),pC=()=>new O({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 O({name:"a:srgbClr",attributes:{value:{key:"val",value:"000000"}},children:[new O({name:"a:alpha",attributes:{value:{key:"val",value:63e3}}})]})]}),uC=()=>new O({name:"a:fmtScheme",attributes:{name:{key:"name",value:"Office"}},children:[new O({name:"a:fillStyleLst",children:[As(),pl([[["lumMod",11e4],["satMod",105e3],["tint",67e3]],[["lumMod",105e3],["satMod",103e3],["tint",73e3]],[["lumMod",105e3],["satMod",109e3],["tint",81e3]]]),pl([[["satMod",103e3],["lumMod",102e3],["tint",94e3]],[["satMod",11e4],["lumMod",1e5],["shade",1e5]],[["lumMod",99e3],["satMod",12e4],["shade",78e3]]])]}),new O({name:"a:lnStyleLst",children:[ul(6350),ul(12700),ul(19050)]}),new O({name:"a:effectStyleLst",children:[hl([]),hl([]),hl([pC()])]}),new O({name:"a:bgFillStyleLst",children:[As(),As([["tint",95e3],["satMod",17e4]]),pl([[["tint",93e3],["satMod",15e4],["shade",98e3],["lumMod",102e3]],[["tint",98e3],["satMod",13e4],["shade",9e4],["lumMod",103e3]],[["shade",63e3],["satMod",12e4]]])]})]}),hC=class extends I{constructor({name:e="Office Theme",colors:t,fonts:n}={}){super("a:theme"),C(this,"colors",void 0),this.colors=ec(t),this.root.push(new Vh({namespace:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"},name:{key:"name",value:e}})),this.root.push(new O({name:"a:themeElements",children:[hx(t?e:"Office",t),dC(n?e:"Office",n),uC()]})),this.root.push(new O({name:"a:objectDefaults"})),this.root.push(new O({name:"a:extraClrSchemeLst"}))}get Colors(){return this.colors}},Ye=e=>{let t=e.lastIndexOf("/");return`${e.slice(0,t+1)}_rels/${e.slice(t+1)}.rels`},Sf=e=>e.replace(/(^|\/)_rels\/([^/]*)\.rels$/,"$1$2"),Cf=e=>e.slice(0,e.lastIndexOf("/")+1),on=(e,t)=>{let n=t.replace(/\\/g,"/");return(n.startsWith("/")?n:`${Cf(e)}${n}`).split("/").reduce((r,i)=>i===""||i==="."?r:i===".."?r.slice(0,-1):[...r,i],[]).join("/")},bc=(e,t)=>{let n=Cf(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("/")},mC=(e,t)=>e.toLowerCase()===t.toLowerCase(),oe=Uint8Array,Le=Uint16Array,vc=Int32Array,Vs=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]),Xs=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]),Ll=new oe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ef=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 vc(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}},Af=Ef(Vs,2),_f=Af.b,Ml=Af.r;_f[28]=258,Ml[258]=28;Nf=Ef(Xs,0),fC=Nf.b,yh=Nf.r,Dl=new Le(32768);for(Y=0;Y<32768;++Y)yt=(Y&43690)>>1|(Y&21845)<<1,yt=(yt&52428)>>2|(yt&13107)<<2,yt=(yt&61680)>>4|(yt&3855)<<4,Dl[Y]=((yt&65280)>>8|(yt&255)<<8)>>1;st=(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[Dl[d]>>c]=l}else for(o=new Le(r),i=0;i<r;++i)e[i]&&(o[i]=Dl[a[e[i]-1]++]>>15-e[i]);return o}),Ht=new oe(288);for(Y=0;Y<144;++Y)Ht[Y]=8;for(Y=144;Y<256;++Y)Ht[Y]=9;for(Y=256;Y<280;++Y)Ht[Y]=7;for(Y=280;Y<288;++Y)Ht[Y]=8;Dr=new oe(32);for(Y=0;Y<32;++Y)Dr[Y]=5;gC=st(Ht,9,0),bC=st(Ht,9,1),vC=st(Dr,5,0),wC=st(Dr,5,1),ml=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Ve=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},fl=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},wc=function(e){return(e+7)/8|0},Wr=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))},yC=["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"],Ce=function(e,t,n){var r=new Error(t||yC[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Ce),!n)throw r;return r},xC=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,m=t.l,f=t.d,h=t.m,g=t.n,y=i*8;do{if(!m){u=Ve(e,d,1);var x=Ve(e,d+1,3);if(d+=3,x)if(x==1)m=bC,f=wC,h=9,g=5;else if(x==2){var v=Ve(e,d,31)+257,T=Ve(e,d+10,15)+4,w=v+Ve(e,d+5,31)+1;d+=14;for(var A=new oe(w),N=new oe(19),M=0;M<T;++M)N[Ll[M]]=Ve(e,d+M*3,7);d+=T*3;for(var L=ml(N),F=(1<<L)-1,J=st(N,L,1),M=0;M<w;){var z=J[Ve(e,d,F)];d+=z&15;var b=z>>4;if(b<16)A[M++]=b;else{var X=0,Z=0;for(b==16?(Z=3+Ve(e,d,3),d+=2,X=A[M-1]):b==17?(Z=3+Ve(e,d,7),d+=3):b==18&&(Z=11+Ve(e,d,127),d+=7);Z--;)A[M++]=X}}var fe=A.subarray(0,v),ce=A.subarray(v);h=ml(fe),g=ml(ce),m=st(fe,h,1),f=st(ce,g,1)}else Ce(1);else{var b=wc(d)+4,E=e[b-4]|e[b-3]<<8,_=b+E;if(_>i){c&&Ce(0);break}o&&l(p+E),n.set(e.subarray(b,_),p),t.b=p+=E,t.p=d=_*8,t.f=u;continue}if(d>y){c&&Ce(0);break}}o&&l(p+131072);for(var Et=(1<<h)-1,Ee=(1<<g)-1,He=d;;He=d){var X=m[fl(e,d)&Et],we=X>>4;if(d+=X&15,d>y){c&&Ce(0);break}if(X||Ce(2),we<256)n[p++]=we;else if(we==256){He=d,m=null;break}else{var ye=we-254;if(we>264){var M=we-257,re=Vs[M];ye=Ve(e,d,(1<<re)-1)+_f[M],d+=re}var D=f[fl(e,d)&Ee],$=D>>4;D||Ce(3),d+=D&15;var ce=fC[$];if($>3){var re=Xs[$];ce+=fl(e,d)&(1<<re)-1,d+=re}if(d>y){c&&Ce(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&&Ce(3);p<se;++p)n[p]=r[ie+p]}for(;p<q;++p)n[p]=n[p-ce]}}t.l=m,t.p=He,t.b=p,t.f=u,m&&(u=1,t.m=h,t.d=f,t.n=g)}while(!u);return p!=n.length&&a?Wr(n,0,p):n.subarray(0,p)},xt=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},yr=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},gl=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:Pf,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(_,v){return _.f-v.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 m=new Le(p+1),f=Bl(n[u-1],m,0);if(f>t){var r=0,h=0,g=f-t,y=1<<g;for(s.sort(function(v,T){return m[T.s]-m[v.s]||v.f-T.f});r<i;++r){var x=s[r].s;if(m[x]>t)h+=y-(1<<f-m[x]),m[x]=t;else break}for(h>>=g;h>0;){var b=s[r].s;m[b]<t?h-=1<<t-m[b]++-1:++r}for(;r>=0&&h;--r){var E=s[r].s;m[E]==t&&(--m[E],++h)}f=t}return{t:new oe(m),l:f}},Bl=function(e,t,n){return e.s==-1?Math.max(Bl(e.l,t,n+1),Bl(e.r,t,n+1)):t[e.s]=n},xh=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}},xr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},If=function(e,t,n){var r=n.length,i=wc(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},kh=function(e,t,n,r,i,s,a,o,c,l,u){xt(t,u++,n),++i[256];for(var d=gl(i,15),p=d.t,m=d.l,f=gl(s,15),h=f.t,g=f.l,y=xh(p),x=y.c,b=y.n,E=xh(h),_=E.c,v=E.n,T=new Le(19),w=0;w<x.length;++w)++T[x[w]&31];for(var w=0;w<_.length;++w)++T[_[w]&31];for(var A=gl(T,7),N=A.t,M=A.l,L=19;L>4&&!N[Ll[L-1]];--L);var F=l+5<<3,J=xr(i,Ht)+xr(s,Dr)+a,z=xr(i,p)+xr(s,h)+a+14+3*L+xr(T,N)+2*T[16]+3*T[17]+7*T[18];if(c>=0&&F<=J&&F<=z)return If(t,u,e.subarray(c,c+l));var X,Z,fe,ce;if(xt(t,u,1+(z<J)),u+=2,z<J){X=st(p,m,0),Z=p,fe=st(h,g,0),ce=h;var Et=st(N,M,0);xt(t,u,b-257),xt(t,u+5,v-1),xt(t,u+10,L-4),u+=14;for(var w=0;w<L;++w)xt(t,u+3*w,N[Ll[w]]);u+=3*L;for(var Ee=[x,_],He=0;He<2;++He)for(var we=Ee[He],w=0;w<we.length;++w){var ye=we[w]&31;xt(t,u,Et[ye]),u+=N[ye],ye>15&&(xt(t,u,we[w]>>5&127),u+=we[w]>>12)}}else X=gC,Z=Ht,fe=vC,ce=Dr;for(var w=0;w<o;++w){var re=r[w];if(re>255){var ye=re>>18&31;yr(t,u,X[ye+257]),u+=Z[ye+257],ye>7&&(xt(t,u,re>>23&31),u+=Vs[ye]);var D=re&31;yr(t,u,fe[D]),u+=ce[D],D>3&&(yr(t,u,re>>5&8191),u+=Xs[D])}else yr(t,u,X[re]),u+=Z[re]}return yr(t,u,X[256]),u+Z[256]},kC=new vc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pf=new oe(0),TC=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=kC[t-1],p=d>>13,m=d&8191,f=(1<<n)-1,h=s.p||new Le(32768),g=s.h||new Le(f+1),y=Math.ceil(n/3),x=2*y,b=function(Re){return(e[Re]^e[Re+1]<<y^e[Re+2]<<x)&f},E=new vc(25e3),_=new Le(288),v=new Le(32),T=0,w=0,A=s.i||0,N=0,M=s.w||0,L=0;A+2<a;++A){var F=b(A),J=A&32767,z=g[F];if(h[J]=z,g[F]=J,M<=A){var X=a-A;if((T>7e3||N>24576)&&(X>423||!l)){u=kh(e,c,0,E,_,v,w,N,L,A-L,u),N=T=w=0,L=A;for(var Z=0;Z<286;++Z)_[Z]=0;for(var Z=0;Z<30;++Z)v[Z]=0}var fe=2,ce=0,Et=m,Ee=J-z&32767;if(X>2&&F==b(A-Ee))for(var He=Math.min(p,X)-1,we=Math.min(32767,A),ye=Math.min(258,X);Ee<=we&&--Et&&J!=z;){if(e[A+fe]==e[A+fe-Ee]){for(var re=0;re<ye&&e[A+re]==e[A+re-Ee];++re);if(re>fe){if(fe=re,ce=Ee,re>He)break;for(var D=Math.min(Ee,re-2),$=0,Z=0;Z<D;++Z){var q=A-Ee+Z&32767,ie=q-h[q]&32767;ie>$&&($=ie,z=q)}}}J=z,z=h[J],Ee+=J-z&32767}if(ce){E[N++]=268435456|Ml[fe]<<18|yh[ce];var se=Ml[fe]&31,ae=yh[ce]&31;w+=Vs[se]+Xs[ae],++_[257+se],++v[ae],M=A+fe,++T}else E[N++]=e[A],++_[e[A]]}}for(A=Math.max(A,M);A<a;++A)E[N++]=e[A],++_[e[A]];u=kh(e,c,l,E,_,v,w,N,L,A-L,u),l||(s.r=u&7|c[u/8|0]<<3,u-=7,s.h=g,s.p=h,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=If(c,u+1,e.subarray(A,te))}s.i=a}return Wr(o,0,r+wc(u)+i)},SC=(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})(),CC=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=SC[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},EC=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 TC(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)},Of=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},nt=function(e,t){return e[t]|e[t+1]<<8},De=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},bl=function(e,t){return De(e,t)+De(e,t+4)*4294967296},ke=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};Rf=function(e,t,n,r){for(var i in e){var s=e[i],a=t+i,o=r;Array.isArray(s)&&(o=Of(r,s[1]),s=s[0]),ArrayBuffer.isView(s)?n[a]=[s,o]:(n[a+="/"]=[new oe(0),o],Rf(s,a,n,r))}},Th=typeof TextEncoder<"u"&&new TextEncoder,$l=typeof TextDecoder<"u"&&new TextDecoder;try{$l.decode(Pf,{stream:!0})}catch{}NC=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:Wr(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)}};PC=function(e,t){return t+30+nt(e,t+26)+nt(e,t+28)},OC=function(e,t,n){var r=nt(e,t+28),i=nt(e,t+30),s=IC(e.subarray(t+46,t+46+r),!(nt(e,t+8)&2048)),a=t+46+r,o=RC(e,a,i,n,De(e,t+20),De(e,t+24),De(e,t+42)),c=o[0],l=o[1],u=o[2];return[nt(e,t+10),c,l,s,a+i+nt(e,t+32),u]},RC=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+nt(e,t+2))if(nt(e,t)==1)return[o?bl(e,t+4+8*c):i,c?bl(e,t+4):s,l?bl(e,t+4+8*(c+o)):a,1];r<2&&Ce(13)}return[i,s,a,0]},Fl=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&Ce(9),t+=r+4}return t},Ch=function(e,t,n,r,i,s,a,o){var c=r.length,l=n.extra,u=o&&o.length,d=Fl(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),m=p.getFullYear()-1980;if((m<0||m>119)&&Ce(10),ke(e,t,m<<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 h=l[f],g=h.length;ke(e,t,+f),ke(e,t+2,g),e.set(h,t+4),t+=4+g}return u&&(e.set(o,t),t+=u),t},LC=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)};BC=e=>typeof e=="string"?Zx(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e),Ms=e=>MC(Object.fromEntries([...e].map(([t,n])=>[t,BC(n)]))),$C=1032,Eh=e=>new Error(`Corrupted zip: ${e} isn't the size the zip file gives it`),Lf=(e,t=()=>!0)=>{let n=new Map,r=0,i=DC(e,{filter:({name:a,size:o,originalSize:c})=>{if(a.endsWith("/")||!t(a))return!1;if(r+=o,r>e.length||c>o*$C)throw Eh(a);return n.set(a,c),!0}}),s=Object.entries(i).find(([a,o])=>o.length!==n.get(a));if(s!==void 0)throw Eh(s[0]);return new Map(Object.entries(i))},vl=e=>{let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t},_s=e=>new Error(`${e} is not supported by this platform`),Ah={uint8array:e=>e,arraybuffer:e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),array:e=>Array.from(e),string:vl,binarystring:vl,base64:e=>btoa(vl(e)),blob:(e,t)=>{if(typeof Blob>"u")throw _s("blob");return new Blob([e],{type:t})},nodebuffer:e=>{if(typeof Buffer>"u")throw _s("nodebuffer");return Buffer.from(e.buffer,e.byteOffset,e.byteLength)},text:()=>{throw _s("text")}},ql=(e,t,n)=>{let r=Object.prototype.hasOwnProperty.call(Ah,t.toLowerCase())?Ah[t.toLowerCase()]:void 0;if(r===void 0)throw _s(t);return r(e,n)},FC=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"]]),qC=new Map([["dark1","windowText"],["light1","window"]]),HC=new Set(["http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","http://purl.oclc.org/ooxml/officeDocument/relationships/theme"]),Br=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:""},Kr=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:[]},Hl=(e,t)=>Kr(e).find(n=>Br(n)===t),Nr=(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)},UC=e=>new TextDecoder(e[0]===255&&e[1]===254?"utf-16le":e[0]===254&&e[1]===255?"utf-16be":"utf-8").decode(e),jC=(e,t,n)=>{let r=e.get(Ye(t)),i=Nr(r&&Kr(Hl(qr(UC(r)),"Relationships")).find(s=>{var a;return n.has((a=Nr(s,"Type"))!==null&&a!==void 0?a:"")}),"Target");return i===void 0?void 0:on(t,i)},WC=(e,t)=>jC(e,t,HC),KC=(e,t,n)=>{let[r]=Kr(t),i=Br(r)==="srgbClr"?Nr(r,"val"):Br(r)==="sysClr"&&(n||Nr(r,"val")!==qC.get(e))?Nr(r,"lastClr"):void 0;return i!==void 0&&/^[0-9A-Fa-f]{6}$/.test(i)?i.toUpperCase():void 0},GC=(e,t=!1)=>Object.fromEntries(Kr(e).flatMap(n=>{let r=FC.get(Br(n)),i=r&&KC(r,n,t);return r&&i?[[r,i]]:[]})),zC=e=>{let[t]=Kr(qr(e)),n=Br(t)==="theme"?Hl(Hl(t,"themeElements"),"clrScheme"):void 0;return n?GC(n,!0):{}},VC=[208,207,17,224,161,177,26,225],Mf=class{constructor(e){var t,n,r,i,s,a,o,c,l,u,d,p,m,f;if(C(this,"currentRelationshipId",1),C(this,"documentWrapper",void 0),C(this,"headers",[]),C(this,"footers",[]),C(this,"coreProperties",void 0),C(this,"numbering",void 0),C(this,"media",void 0),C(this,"fileRelationships",void 0),C(this,"footnotesWrapper",void 0),C(this,"endnotesWrapper",void 0),C(this,"settings",void 0),C(this,"contentTypes",void 0),C(this,"customProperties",void 0),C(this,"appProperties",void 0),C(this,"styles",void 0),C(this,"comments",void 0),C(this,"commentsExtended",void 0),C(this,"commentsIds",void 0),C(this,"fontWrapper",void 0),C(this,"theme",void 0),C(this,"packageParts",void 0),C(this,"macros",void 0),C(this,"bibliography",void 0),e.macros!==void 0){let{project:b,events:E=[]}=e.macros,_=b instanceof Uint8Array?b:new Uint8Array(b);if(!VC.every((T,w)=>_[w]===T))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 v=new be;E.length>0&&v.addRelationship(1,"http://schemas.microsoft.com/office/2006/relationships/wordVbaData","vbaData.xml"),this.macros={project:_,events:E.length>0?jT(E):void 0,relationships:v}}if(this.coreProperties=new LT(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 uf(e.numbering?e.numbering:{config:[]}),this.comments=new n1((i=e.comments)!==null&&i!==void 0?i:{children:[]}),this.comments.ThreadData&&(this.commentsExtended=new a1(this.comments.ThreadData)),this.comments.CommentIdsData&&(this.commentsIds=new d1(this.comments.CommentIdsData)),this.fileRelationships=new be,this.customProperties=new qT((s=e.customProperties)!==null&&s!==void 0?s:[]),this.appProperties=new PT,this.footnotesWrapper=new iS,this.endnotesWrapper=new JT,this.contentTypes=new RT({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:HT(`{${mm().toUpperCase()}}`),relationships:b},this.contentTypes.addOverride("application/vnd.openxmlformats-officedocument.customXmlProperties+xml","/customXml/itemProps1.xml")}if(this.packageParts=new hf(this.contentTypes),this.documentWrapper=new GT({background:e.background,pageNumbers:e.pageNumbers}),this.settings=new MS({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:(m=e.hyphenation)===null||m===void 0?void 0:m.doNotHyphenateCaps}}),this.media=new pf(b=>this.packageParts.takePath("media","image",b)),e.externalStyles!==void 0){var h,g,y,x;let b=(h=(g=e.styles)===null||g===void 0?void 0:g.default)!==null&&h!==void 0?h:{},E=Object.entries(gc(b)),_=([T])=>b[T]!==void 0,v=new iC().newInstance(e.externalStyles);this.styles=new cl(k(k({},v),{},{paragraphStyles:(y=e.styles)===null||y===void 0?void 0:y.paragraphStyles,characterStyles:(x=e.styles)===null||x===void 0?void 0:x.characterStyles,importedStyles:[...E.filter(T=>!_(T)).map(([,T])=>T),...v.importedStyles,...E.filter(_).map(([,T])=>T)]}))}else if(e.styles){let b=new vh().newInstance(e.styles.default);this.styles=new cl(k(k({},b),e.styles))}else{let b=new vh;this.styles=new cl(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 Um((f=e.fonts)!==null&&f!==void 0?f:[]),this.theme=new hC(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 oS(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addHeaderToDocument(t),t}createFooter(e){let t=new eS(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addFooterToDocument(t),t}addHeaderToDocument(e,t=In.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=In.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}},XC=class extends I{constructor(e){super("w:sdtPr"),e&&this.root.push(new it("w:alias",e))}},YC=e=>new O({name:"w:docPartObj",children:[new it("w:docPartGallery",e),new O({name:"w:docPartUnique"})]}),JC=["contentChildren","cachedEntries","beginDirty","tabLeader"],Df=class extends dc{constructor(e="Table of Contents",t={}){let{contentChildren:n=[],cachedEntries:r=[],beginDirty:i,tabLeader:s=g1.DOT}=t,a=Yl(t,JC);super("w:sdt"),C(this,"fromHeadings",void 0);let o=new XC(e);o.addChildElement(YC("Table of Contents")),this.root.push(o);let c=new Cm,l=[new Fe({children:[Em(i),new Sm(a),nn()]})],u=[new Fe({children:[rn()]})];if(r!==void 0&&r.length>0){let{stylesWithLevels:d}=a,p=r.map((f,h)=>{var g,y;let x=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}`,E=h===0?[...l,x]:h===r.length-1?[x,...u]:[x];return new ne({style:b,tabStops:this.getTabStopsForLevel(f.level,s),children:E})}),m=p;r.length<=1&&(m=[...p,new ne({children:u})]);for(let f of m)c.addChildElement(f)}else{let d=new ne({children:l});c.addChildElement(d);for(let m of n)c.addChildElement(m);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:Cs}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 Fe({style:t?.hyperlink&&e.href!==void 0?"IndexLink":void 0,children:[new Or({text:e.title}),new Ws,new Or({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 Dm({anchor:e.href,children:[n]}):n}},kr=0,wl=32,QC=32,ZC=(e,t)=>{let n=t.replace(/-/g,"");if(n.length!==QC)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(kr,wl).map((a,o)=>a^r[o%r.length]),s=new Uint8Array(kr+i.length+Math.max(0,e.length-wl));return s.set(e.slice(0,kr)),s.set(i,kr),s.set(e.slice(wl),kr+i.length),s},ln=class{format(e,t={stack:[]}){let n=e.prepForXml(t);if(n)return n;throw Error("XMLComponent did not format correctly")}},Bf=/\{([^{}]+)\}/g,$f=(e,t)=>t.size===0?e:e.replace(Bf,(n,r)=>{var i;return(i=t.get(r))!==null&&i!==void 0?i:n}),eE=e=>new Set(Array.from(e.matchAll(Bf),([,t])=>t)),Ff=class{replace(e,t,n){return $f(e,new Map(t.map((r,i)=>[r.key,(n+i).toString()])))}getMediaData(e,t){let n=eE(e);return t.Entries.filter(([r])=>n.has(r)).map(([r,{fileName:i}])=>({key:r,fileName:i}))}},tE=class{replace(e,t){return $f(e,new Map(t.map(({reference:n,instance:r,restartedListId:i,numId:s})=>[Os(n,r,i),s.toString()])))}},nE=new ln,yl=(e,t,n,r,i=!0)=>U(nE.format(t,{viewWrapper:{View:t,Relationships:r},file:e,stack:[]}),{indent:n,declaration:i?{standalone:"yes",encoding:"UTF-8"}:{encoding:"UTF-8"}}),rE=(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:Ms(i.files.map(({path:l,content:u})=>[l,u instanceof Uint8Array?u:yl(e,u,r,new be)])),path:`word/${n}`}];let s=e.PackageParts.createRelationships(n),a=yl(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:yl(e,s,r,s,!1),path:`word/${o}/_rels/${c}.rels`}]:[]]},yc=(e,t,n=0)=>{let r=e.PackageParts.Array.slice(n);return r.length===0?[]:[...r.flatMap(({part:i,path:s})=>rE(e,i,s,t)),...yc(e,t,n+r.length)]},iE=["PackageParts"],sE=class{constructor(){C(this,"formatter",void 0),C(this,"imageReplacer",void 0),C(this,"numberingReplacer",void 0),this.formatter=new ln,this.imageReplacer=new Ff,this.numberingReplacer=new tE}compile(e,t,n=[]){let r=this.xmlifyFile(e,t),{PackageParts:i}=r,s=Yl(r,iE),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`,ZC(o,c)])])}xmlifyFile(e,t){var n;let r=U(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),i=U(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=U(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),a=U(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),m=this.imageReplacer.getMediaData(s,e.Media),f=this.imageReplacer.getMediaData(a,e.Media);return k(k(k(k(k(k({Relationships:{data:(()=>{let h=be.copy(e.Document.Relationships);return d.forEach((g,y)=>{h.addRelationship(o+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),h.addRelationship(h.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),U(this.formatter.format(h,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{let h=this.imageReplacer.replace(r,d,o);return this.numberingReplacer.replace(h,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{let h=U(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(h,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:U(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:U(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map((h,g)=>{let y=U(this.formatter.format(h.View,{viewWrapper:h,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),x=this.imageReplacer.getMediaData(y,e.Media),b=be.copy(h.Relationships);return x.forEach((E,_)=>{b.addRelationship(_,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${E.fileName}`)}),{data:U(this.formatter.format(b,{viewWrapper:h,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${g+1}.xml.rels`}}),FooterRelationships:e.Footers.map((h,g)=>{let y=U(this.formatter.format(h.View,{viewWrapper:h,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),x=this.imageReplacer.getMediaData(y,e.Media),b=be.copy(h.Relationships);return x.forEach((E,_)=>{b.addRelationship(_,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${E.fileName}`)}),{data:U(this.formatter.format(b,{viewWrapper:h,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${g+1}.xml.rels`}}),Headers:e.Headers.map((h,g)=>{let y=U(this.formatter.format(h.View,{viewWrapper:h,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),x=this.imageReplacer.getMediaData(y,e.Media),b=this.imageReplacer.replace(y,x,0);return{data:this.numberingReplacer.replace(b,e.Numbering.ConcreteNumbering),path:`word/header${g+1}.xml`}}),Footers:e.Footers.map((h,g)=>{let y=U(this.formatter.format(h.View,{viewWrapper:h,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),x=this.imageReplacer.getMediaData(y,e.Media),b=this.imageReplacer.replace(y,x,0);return{data:this.numberingReplacer.replace(b,e.Numbering.ConcreteNumbering),path:`word/footer${g+1}.xml`}}),CustomProperties:{data:U(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:U(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 h=this.imageReplacer.replace(s,m,l);return this.numberingReplacer.replace(h,e.Numbering.ConcreteNumbering)})(),path:"word/footnotes.xml"},FootNotesRelationships:{data:(()=>{let h=be.copy(e.FootNotes.Relationships);return m.forEach((g,y)=>{h.addRelationship(l+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),U(this.formatter.format(h,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/footnotes.xml.rels"},Endnotes:{data:(()=>{let h=this.imageReplacer.replace(a,f,u);return this.numberingReplacer.replace(h,e.Numbering.ConcreteNumbering)})(),path:"word/endnotes.xml"},EndnotesRelationships:{data:(()=>{let h=be.copy(e.Endnotes.Relationships);return f.forEach((g,y)=>{h.addRelationship(u+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),U(this.formatter.format(h,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/endnotes.xml.rels"},Settings:{data:U(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 h=this.imageReplacer.replace(i,p,c);return this.numberingReplacer.replace(h,e.Numbering.ConcreteNumbering)})(),path:"word/comments.xml"},CommentsRelationships:{data:(()=>{let h=be.copy(e.Comments.Relationships);return p.forEach((g,y)=>{h.addRelationship(c+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),U(this.formatter.format(h,{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:U(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:U(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:U(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:U(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:U(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:U(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:U(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:U(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:U(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:U(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:yc(e,t),Numbering:{data:U(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:U(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"}})}},_h=jy(((e,t)=>{var n=typeof Reflect=="object"?Reflect:null,r=n&&typeof n.apply=="function"?n.apply:function(T,w,A){return Function.prototype.apply.call(T,w,A)},i;n&&typeof n.ownKeys=="function"?i=n.ownKeys:Object.getOwnPropertySymbols?i=function(T){return Object.getOwnPropertyNames(T).concat(Object.getOwnPropertySymbols(T))}:i=function(T){return Object.getOwnPropertyNames(T)};function s(v){console&&console.warn&&console.warn(v)}var a=Number.isNaN||function(T){return T!==T};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(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(v){if(typeof v!="number"||v<0||a(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");c=v}}),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(T){if(typeof T!="number"||T<0||a(T))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+T+".");return this._maxListeners=T,this};function u(v){return v._maxListeners===void 0?o.defaultMaxListeners:v._maxListeners}o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(T){for(var w=[],A=1;A<arguments.length;A++)w.push(arguments[A]);var N=T==="error",M=this._events;if(M!==void 0)N=N&&M.error===void 0;else if(!N)return!1;if(N){var L;if(w.length>0&&(L=w[0]),L instanceof Error)throw L;var F=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw F.context=L,F}var J=M[T];if(J===void 0)return!1;if(typeof J=="function")r(J,this,w);else for(var z=J.length,X=g(J,z),A=0;A<z;++A)r(X[A],this,w);return!0};function d(v,T,w,A){var N,M,L;if(l(w),M=v._events,M===void 0?(M=v._events=Object.create(null),v._eventsCount=0):(M.newListener!==void 0&&(v.emit("newListener",T,w.listener?w.listener:w),M=v._events),L=M[T]),L===void 0)L=M[T]=w,++v._eventsCount;else if(typeof L=="function"?L=M[T]=A?[w,L]:[L,w]:A?L.unshift(w):L.push(w),N=u(v),N>0&&L.length>N&&!L.warned){L.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(T)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=v,F.type=T,F.count=L.length,s(F)}return v}o.prototype.addListener=function(T,w){return d(this,T,w,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(T,w){return d(this,T,w,!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 m(v,T,w){var A={fired:!1,wrapFn:void 0,target:v,type:T,listener:w},N=p.bind(A);return N.listener=w,A.wrapFn=N,N}o.prototype.once=function(T,w){return l(w),this.on(T,m(this,T,w)),this},o.prototype.prependOnceListener=function(T,w){return l(w),this.prependListener(T,m(this,T,w)),this},o.prototype.removeListener=function(T,w){var A,N,M,L,F;if(l(w),N=this._events,N===void 0)return this;if(A=N[T],A===void 0)return this;if(A===w||A.listener===w)--this._eventsCount===0?this._events=Object.create(null):(delete N[T],N.removeListener&&this.emit("removeListener",T,A.listener||w));else if(typeof A!="function"){for(M=-1,L=A.length-1;L>=0;L--)if(A[L]===w||A[L].listener===w){F=A[L].listener,M=L;break}if(M<0)return this;M===0?A.shift():y(A,M),A.length===1&&(N[T]=A[0]),N.removeListener!==void 0&&this.emit("removeListener",T,F||w)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(T){var w,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[T]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete A[T]),this;if(arguments.length===0){var M=Object.keys(A),L;for(N=0;N<M.length;++N)L=M[N],L!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(w=A[T],typeof w=="function")this.removeListener(T,w);else if(w!==void 0)for(N=w.length-1;N>=0;N--)this.removeListener(T,w[N]);return this};function f(v,T,w){var A=v._events;if(A===void 0)return[];var N=A[T];return N===void 0?[]:typeof N=="function"?w?[N.listener||N]:[N]:w?x(N):g(N,N.length)}o.prototype.listeners=function(T){return f(this,T,!0)},o.prototype.rawListeners=function(T){return f(this,T,!1)},o.listenerCount=function(v,T){return typeof v.listenerCount=="function"?v.listenerCount(T):h.call(v,T)},o.prototype.listenerCount=h;function h(v){var T=this._events;if(T!==void 0){var w=T[v];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(v,T){for(var w=new Array(T),A=0;A<T;++A)w[A]=v[A];return w}function y(v,T){for(;T+1<v.length;T++)v[T]=v[T+1];v.pop()}function x(v){for(var T=new Array(v.length),w=0;w<T.length;++w)T[w]=v[w].listener||v[w];return T}function b(v,T){return new Promise(function(w,A){function N(L){v.removeListener(T,M),A(L)}function M(){typeof v.removeListener=="function"&&v.removeListener("error",N),w([].slice.call(arguments))}_(v,T,M,{once:!0}),T!=="error"&&E(v,N,{once:!0})})}function E(v,T,w){typeof v.on=="function"&&_(v,"error",T,w)}function _(v,T,w,A){if(typeof v.on=="function")A.once?v.once(T,w):v.on(T,w);else if(typeof v.addEventListener=="function")v.addEventListener(T,function N(M){A.once&&v.removeEventListener(T,N),w(M)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v)}}))();aE=class extends _h.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(),_h.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}};oE={NONE:"",WITH_2_BLANKS:" ",WITH_4_BLANKS:" ",WITH_TAB:" "},Ih=e=>e===!0?oE.WITH_2_BLANKS:e===!1?void 0:e,Ph=e=>e.Macros===void 0?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/vnd.ms-word.document.macroEnabled.12",xc=class Nn{static pack(t,n,r){var i=this;return jt(function*(s,a,o,c=[]){return ql(Ms(i.compiler.compile(s,Ih(o),c)),a,Ph(s))}).apply(this,arguments)}static toString(t,n,r=[]){return Nn.pack(t,"string",n,r)}static toBuffer(t,n,r=[]){return Nn.pack(t,"nodebuffer",n,r)}static toBase64String(t,n,r=[]){return Nn.pack(t,"base64",n,r)}static toBlob(t,n,r=[]){return Nn.pack(t,"blob",n,r)}static toArrayBuffer(t,n,r=[]){return Nn.pack(t,"arraybuffer",n,r)}static toStream(t,n,r=[]){let i=new aE,s=this.compiler.compile(t,Ih(n),r);return new Promise(a=>setTimeout(a)).then(()=>ql(Ms(s),"nodebuffer",Ph(t))).then(a=>{i.emit("data",a),i.emit("end")},a=>i.emit("error",a)),i}};C(xc,"compiler",new sE);qf=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},Hf=e=>{var t;let n=qf(e);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Hf)]},lE=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=qf(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)},cE=new ln,Ys=e=>new TextDecoder("utf-8",{ignoreBOM:!0}).decode(e),lt=e=>qr(e,{keepWhitespaceText:!0}),Uf=e=>{var t;return(t=lt(U(cE.format(new Or({text:e})))).elements[0].elements)!==null&&t!==void 0?t:[]},jf=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)},Wf=e=>{if(!e?.start.trim()||!e?.end.trim())throw new Error("Both start and end delimiters must be non-empty strings.")},_n=(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"})},dE=(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"})},pE=(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())}))},uE=e=>{let t=parseInt(e.substring(3),10);return isNaN(t)?0:t},kc=e=>Te(e,"Relationships").map(t=>{var n,r;return uE((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,Ul=(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},$r=()=>({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:[]}]}),Oh="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",hE="application/vnd.openxmlformats-package.core-properties+xml",Rh="_rels/.rels",Lh="docProps/core.xml",jl={cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/"},mE={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"}},Mh=e=>e===""?[]:[{type:"text",text:String(e)}],Dh=e=>{var t;return(t=e.name)===null||t===void 0?void 0:t.slice(e.name.indexOf(":")+1)},fE=(e,t)=>{var n;let r=(n=Object.entries(k({},e.attributes)).find(([i,s])=>(i==="xmlns"||i.startsWith("xmlns:"))&&s===jl[t]))===null||n===void 0?void 0:n[0];return r===void 0?(e.attributes=k(k({},e.attributes),{},{[`xmlns:${t}`]:jl[t]}),`${t}:`):r==="xmlns"?"":`${r.slice(6)}:`},gE=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)},bE=(e,t,n)=>{var r;let i=t.get(n);if(i===void 0)return e.get(n);let s=lt(gE(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},vE=e=>{var t,n;let r=(t=e.get(Rh))!==null&&t!==void 0?t:$r(),i=(n=Te(r,"Relationships").find(s=>{var a;return((a=s.attributes)===null||a===void 0?void 0:a.Type)===Oh}))===null||n===void 0||(n=n.attributes)===null||n===void 0?void 0:n.Target;return typeof i=="string"?on("",i):(Ul(r,kc(r),Oh,Lh),e.set(Rh,r),Lh)},wE=(e,t,n,{addContentTypeOverride:r})=>{var i,s;let a=vE(e),o=bE(e,t,a),c=o??{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"cp:coreProperties",attributes:{"xmlns:cp":jl.cp},elements:[]}]};o===void 0&&(e.set(a,c),r(hE,`/${a}`));let l=(i=c.elements)===null||i===void 0?void 0:i.find(u=>Dh(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(mE)){let m=n[u];if(m===void 0)continue;let f=l.elements.find(h=>Dh(h)===p);f?f.elements=Mh(m):l.elements.push({type:"element",name:`${fE(l,d)}${p}`,elements:Mh(m)})}},Wl=new Set(["wp:inline","wp:anchor"]),Tc=new Set(["wp:docPr","wps:cNvPr","wpg:cNvPr"]),yE=new Set(["a:stCxn","a:endCxn"]),Ds=(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},Kf=e=>{var t;let n=Ds(e,Tc);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Kf)]},xE=e=>{let t=n=>{var r;let i=Ds(n,Tc);return[...i===void 0?[]:[i],...((r=n.elements)!==null&&r!==void 0?r:[]).flatMap(s=>{var a;return Wl.has((a=s.name)!==null&&a!==void 0?a:"")?[]:t(s)})]};return t(e)},kE=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(xE(a))].map(l=>[l,r(l)])),c=l=>{var u,d;if(l!==a&&Wl.has((u=l.name)!==null&&u!==void 0?u:""))return i(l);let p=(d=Ds(l,Tc))!==null&&d!==void 0?d:Ds(l,yE),m=p===void 0?void 0:o.get(p);return k(k(k({},l),m===void 0?{}:{attributes:k(k({},l.attributes),{},{id:String(m)})}),l.elements===void 0?{}:{elements:l.elements.map(c)})};return c(a)},s=a=>{var o;return Wl.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)},Se={DOCUMENT:"file",PARAGRAPH:"paragraph",TABLE_ROWS:"tableRows",DRAWING:"drawing"},TE=new Map([["wp:inline","wp:docPr"],["wp:anchor","wp:docPr"],["wpg:graphicFrame","wpg:cNvPr"],["wpc:graphicFrame","wpg:cNvPr"]]),Js=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(n=>{var r;let i=n.name===void 0?void 0:TE.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}]:[],...Js(n)]})},Gf=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)])},Bh="[Content_Types].xml",SE=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:[],...$r().elements]}return Te(e,"Relationships")},CE="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Kl=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===CE?[r.slice(6)]:[]),...((n=e.elements)!==null&&n!==void 0?n:[]).flatMap(r=>[...Kl(r)])])},Gl=(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=>[...Gl(i,t)])])},EE=(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(Ye(l));return d===void 0?void 0:Te(d,"Relationships").find(p=>{var m;return p.name==="Relationship"&&((m=p.attributes)===null||m===void 0?void 0:m.Id)===u})},s=(l,u)=>{var d,p;let m=(d=u.attributes)===null||d===void 0?void 0:d.Target;return((p=u.attributes)===null||p===void 0?void 0:p.TargetMode)==="External"||m===void 0?void 0:r(on(l,String(m)))},a=l=>[...e].some(([u,d])=>u.endsWith(".rels")&&Te(d,"Relationships").some(p=>s(Sf(u),p)===l)),o=(l,u)=>{if(u===void 0||u===l||u===Bh||u.endsWith(".rels")||a(u))return;let d=e.get(Ye(u));e.delete(u),t.delete(u),e.delete(Ye(u));let p=e.get(Bh);p!==void 0&&pE(p,`/${u}`);for(let m of d===void 0?[]:Te(d,"Relationships"))o(u,s(u,m))};return{findRelationship:i,pathOf:s,removeIfUnreferenced:o,removeRelationships:(l,u)=>{var d,p;let m=(d=e.get(Ye(l)))===null||d===void 0||(d=d.elements)===null||d===void 0?void 0:d.find(h=>h.name==="Relationships"),f=((p=m?.elements)!==null&&p!==void 0?p:[]).filter(h=>{var g;return h.name==="Relationship"&&u.has(String((g=h.attributes)===null||g===void 0?void 0:g.Id))});if(!(m===void 0||f.length===0)){m.elements=m.elements.filter(h=>!f.includes(h));for(let h of f)o(l,s(l,h))}}}},AE=(e,{findRelationship:t,pathOf:n,removeIfUnreferenced:r},i,s)=>{let a=new ln;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=bc(o.path,u),m=c===void 0?void 0:t(o.path,c);if(m===void 0){var f;let g=Ye(o.path),y=(f=e.get(g))!==null&&f!==void 0?f:$r();e.set(g,y);let x=c??`rId${kc(y)}`;return SE(y).push({type:"element",name:"Relationship",attributes:{Id:x,Type:d,Target:p}}),x}let h=n(o.path,m);return m.attributes=k(k({},Object.fromEntries(Object.entries(m.attributes).filter(([g])=>g!=="TargetMode"))),{},{Type:d,Target:p}),r(o.path,h),String(m.attributes.Id)},format:o=>lt(U(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])=>Js(u).flatMap(d=>{let p=Gf(d.properties),m=a.filter(({placeholder:g})=>p.some(y=>y.includes(g)));if(m.length>1){var f,h;throw new Error(`The drawing "${(f=(h=d.properties.attributes)===null||h===void 0?void 0:h.name)!==null&&f!==void 0?f:""}" in ${l} has the placeholders ${m.map(({placeholder:g})=>g).join(" and ")} in its alt text. A drawing can only be patched once`)}return m.map(({placeholder:g,patch:y})=>({drawing:k(k({placeholder:g},d),{},{part:{path:l,xml:u}}),patch:y}))})),c=EE(e,t);for(let{drawing:l,patch:u}of o){let d=Gl(l.element,Kl(l.part.xml));u.patch(l,AE(e,c,n,s(l.part.path)));let p=Gl(l.part.xml,Kl(l.part.xml));c.removeRelationships(l.part.path,new Set([...d].filter(m=>!p.has(m))))}},NE=e=>typeof e=="object"&&e!==null&&"on"in e&&typeof e.on=="function",IE=e=>typeof e=="object"&&e!==null&&"generateAsync"in e&&typeof e.generateAsync=="function",PE=e=>["[object Blob]","[object File]"].includes(Object.prototype.toString.call(e)),OE=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)})}),RE=(function(){var e=jt(function*(t){return IE(t)?t.generateAsync({type:"uint8array"}):NE(t)?OE(t):PE(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)}})(),zf=(function(){var e=jt(function*(t,n){return Lf(yield RE(t),n)});return function(n,r){return e.apply(this,arguments)}})(),LE=new ln,ys="word/document.xml",ME={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 df,mark:()=>new cf,styles:()=>[new gf({}),new vf({}),new bf({})]}},DE={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 lf,mark:()=>new sf,styles:()=>[new wf({}),new xf({}),new yf({})]}},xs=(e,t)=>lt(U(LE.format(e,t))).elements[0],Vf=(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=>Vf(a,t))]},BE=(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)]})},$h=(e,t,n,{createContext:r,addContentTypeOverride:i,renumberBookmarks:s,renumberDrawings:a,renumberLists:o,useStyles:c})=>{let l=new Map(Object.entries(t).map(([x,b])=>[Number(x),b])),u=new Map,d=[...l.keys()].filter(Number.isFinite).reduce((x,b)=>Math.max(x,Math.floor(b)),0),p=new Map,m,f=x=>{var b,E;let _=x.name===e.referenceName?l.get(Number((b=x.attributes)===null||b===void 0?void 0:b["w:id"])):void 0;return _===void 0?x.elements===void 0?x:k(k({},x),{},{elements:x.elements.map(f)}):(m=((E=m)!==null&&E!==void 0?E:[...n.values()].flatMap(v=>Vf(v,[e.noteName,e.referenceName])).reduce((v,T)=>Math.max(v,T),0))+1,p.set(m,_),k(k({},x),{},{attributes:k(k({},x.attributes),{},{"w:id":String(m)})}))},h=()=>{var x;let b=Te((x=n.get(Ye(ys)))!==null&&x!==void 0?x:{},"Relationships").find(_=>{var v;return((v=_.attributes)===null||v===void 0?void 0:v.Type)===e.relationshipType}),E=b?on(ys,String(b.attributes.Target)):e.path;return n.has(E)||(n.set(E,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[xs(e.create.part(),r(E))]}),i(e.contentType,`/${E}`)),b||r(ys).viewWrapper.Relationships.addRelationship(Ln(),e.relationshipType,bc(ys,E)),E};return{renumber:x=>x.map(f),write:()=>{if(p.size===0)return;let x=h(),b=r(x),E=new Map([...new Set(p.values())].map(v=>{let T=xs(e.create.mark(),b);return[v,c(o(s(v.children.map(w=>xs(w,b)).map((w,A)=>A===0?BE(w,T):w))))]}));Te(n.get(x),e.rootName).push(...[...p].map(([v,T])=>({type:"element",name:e.noteName,attributes:{"w:id":String(v)},elements:[...a(E.get(T))]})));let _=n.get("word/styles.xml");if(_){let v=Te(_,"w:styles"),T=new Set(v.map(w=>{var A;return(A=w.attributes)===null||A===void 0?void 0:A["w:styleId"]}));v.push(...e.create.styles().map(w=>xs(w,b)).filter(w=>{var A;return!T.has((A=w.attributes)===null||A===void 0?void 0:A["w:styleId"])}))}},carry:(x,b)=>{let E=u.get(x);return E!==void 0?E:(d++,l.set(d,b),u.set(x,d),d)}}},$E=({footnotes:e={},endnotes:t={}},n,r)=>{let i={footnotes:$h(ME,e,n,r),endnotes:$h(DE,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()}}},FE=new ln,ks="word/document.xml",qE="word/numbering.xml",HE="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Fh="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",UE="default-bullet-numbering",jE="1",WE=(e,t)=>lt(U(FE.format(e,t))).elements[0],qh=e=>e.reduce((t,n)=>Math.max(t,n),0),KE=(e,t,{createContext:n,addContentTypeOverride:r})=>{let i=new Map,s,a=()=>{var f;return Te((f=t.get(Ye(ks)))!==null&&f!==void 0?f:{},"Relationships").find(h=>{var g;return((g=h.attributes)===null||g===void 0?void 0:g.Type)===Fh})},o=(f=a())=>f?on(ks,String(f.attributes.Target)):qE,c=(f,h)=>{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[h]))},l=f=>{if(f===jE)return e.ConcreteNumbering.find(({reference:g})=>g===UE);if(!f.startsWith("{"))return;let h=e.ConcreteNumbering.find(({reference:g,instance:y})=>f===`{${g}-${y}}`);if(!h){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 h},u=f=>{var h;let g=i.get(f.numId);return g!==void 0?g:(s=((h=s)!==null&&h!==void 0?h:qh(c("w:num","w:numId")))+1,i.set(f.numId,s),s)},d=f=>{let h=f.name==="w:numId"?l(String(f.attributes["w:val"])):void 0;return h===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(h))})})},p=f=>{let h=a(),g=o(h);return t.has(g)||(t.set(g,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[k(k({},f),{},{elements:[]})]}),r(HE,`/${g}`)),h||n(ks).viewWrapper.Relationships.addRelationship(Ln(),Fh,bc(ks,g)),g};return{renumber:f=>f.map(d),write:()=>{var f,h;if(i.size===0)return;let g=WE(e,n(o())),y=N=>Number(N.elements.find(M=>M.name==="w:abstractNumId").attributes["w:val"]),x=g.elements.filter(N=>N.name==="w:num"&&i.has(Number(N.attributes["w:numId"]))),b=qh(c("w:abstractNum","w:abstractNumId")),E=new Map([...new Set(x.map(y))].map((N,M)=>[N,b+M+1])),_=g.elements.flatMap(N=>{let M=N.name==="w:abstractNum"?E.get(Number(N.attributes["w:abstractNumId"])):void 0;return M===void 0?[]:[k(k({},N),{},{attributes:k(k({},N.attributes),{},{"w:abstractNumId":String(M)})})]}),v=p(g),T=t.get(v).elements.find(N=>N.name==="w:numbering");T.attributes=k(k(k({},Object.fromEntries(Object.entries(g.attributes).filter(([N])=>N.startsWith("xmlns:")))),T.attributes),{},{"mc:Ignorable":[...new Set([...String((f=(h=T.attributes)===null||h===void 0?void 0:h["mc:Ignorable"])!==null&&f!==void 0?f:"").split(" "),...String(g.attributes["mc:Ignorable"]).split(" ")])].filter(N=>N!=="").join(" ")});let w=Te(t.get(v),"w:numbering"),A=N=>{let M=w.findIndex(L=>N.includes(L.name));return M===-1?w.length:M};w.splice(A(["w:num","w:numIdMacAtCleanup"]),0,..._),w.splice(A(["w:numIdMacAtCleanup"]),0,...x.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(E.get(y(N)))}}):M)})))}}},zl={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:[zl.textElement(t)]}]}},xl="word/document.xml",GE="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk",zE=[80,75,3,4],VE=(function(){var e=jt(function*(t){if(zE.every((n,r)=>t[r]===n))try{let n=new Map,r=new Map;for(let[s,a]of Lf(t))/\.(xml|rels)$/.test(s)?n.set(s,lt(Ys(a))):r.set(s,a);let i=yield Xf(n,r);return k({parts:n,binaryParts:r},i.size>0?{importedDocuments:i}:{})}catch{return}});return function(n){return e.apply(this,arguments)}})(),Xf=(function(){var e=jt(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=Ns(o))===null||s===void 0?void 0:s.elements)!==null&&i!==void 0?i:[]){let l=on(Sf(a),String(c.Target)),u=n.get(l),d=c.Type===GE&&c.TargetMode!=="External"&&u?yield VE(u):void 0;d&&r.set(l,d)}}return r});return function(n,r){return e.apply(this,arguments)}})(),Ns=e=>{var t;return e==null||(t=e.elements)===null||t===void 0?void 0:t.find(({type:n})=>n==="element")},XE=(function(){var e=jt(function*(t,n,r=new Map){var i,s;let a=Ns(t.get(xl));if(!a)return;let o=yield Xf(t,r),c=n(k({parts:t,binaryParts:r},o.size>0?{importedDocuments:o}:{})),l=km(zl,a,c,{blank:!0}),u=(i=(s=Ns(t.get(Ye(xl))))===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))?Ns(t.get(on(xl,String(d.Target)))):void 0;p&&Tm(zl,p,c,{blank:!0,sectionPageCount:l.get(String(d.Id))})}});return function(n,r){return e.apply(this,arguments)}})(),YE=new Set(["w:hyperlink","w:sdt","w:sdtContent","w:ins","w:moveTo","w:smartTag","w:customXml","w:fldSimple","w:dir","w:bdo"]),Yf=(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]}]:YE.has((s=r.name)!==null&&s!==void 0?s:"")?Yf(r,[...t,i]):[]})},Bs=(e,t)=>t.reduce((n,r)=>n.elements[r],e),Gr=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=Yf(e.element,[]).map(({element:r,path:i})=>{let s=JE(r,i,t);return t+=s.text.length,s});return{text:n.reduce((r,i)=>r+i.text,""),runs:n,index:e.index,pathToParagraph:Jf(e)}},JE=(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}},Jf=e=>e.parent?[...Jf(e.parent),e.index]:[e.index],QE=class extends Error{constructor(e){super(`Token ${e} not found`),this.name="TokenNotFoundError"}},ZE=(e,t)=>{let n=Gr({element:e,index:0,parent:void 0}).runs.find(({parts:r})=>r.some(({text:i})=>i.includes(t)));if(!n)throw new QE(t);return n.path},e2=(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),jf(a)),{},{elements:Uf(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)})}},Tr={START:0,MIDDLE:1,END:2},Qf=({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:r,fromIndex:i=0})=>{let s=t.text.indexOf(n,i),a=s+n.length-1,o=Tr.START;for(let c of t.runs){let l=Bs(e,c.path);for(let{text:u,index:d,start:p,end:m}of c.parts)switch(o){case Tr.START:if(s>=p&&s<=m){let f=s-p,h=Math.min(a,m)-p;if(u.substring(f,h+1)==="")continue;let g=u.substring(0,f)+r+u.substring(h+1);kl(l.elements[d],g),o=Tr.MIDDLE;continue}break;case Tr.MIDDLE:if(a<=m){let f=u.substring(a-p+1);kl(l.elements[d],f);let h=l.elements[d];l.elements[d]=jf(h),o=Tr.END}else kl(l.elements[d],"")}}return e},kl=(e,t)=>(e.elements=Uf(t),e),Hh=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:[]},Zf=e=>{let t=[],n=[...Hh({element:e,index:0,parent:void 0})],r;for(;n.length>0;)r=n.shift(),r.element.name==="w:p"&&(t=[...t,Gr(r)]),n.push(...Hh(r));return t},Sc=(e,t)=>Zf(e).filter(n=>n.text.includes(t)),Tl="\uFFFF",t2=({json:e,patch:t,patchText:n,context:r,keepOriginalStyles:i=!0,recursive:s=!0,renumberIds:a=o=>o})=>{let o=Sc(e,n);if(o.length===0)return{element:e,didFindOccurrence:!1};let c=[...o].reverse(),l=t.type===Se.DOCUMENT?u2(c):c,u,d=()=>{var m;return u=((m=u)!==null&&m!==void 0?m:tg(e))+1,String(u)};for(let m of l)switch(t.type){case Se.DOCUMENT:{var p;let f=h2(e,m.pathToParagraph),h=m2(m.pathToParagraph),g=Uh(t,r,a),y=f.name==="w:tc"&&h===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(h,1,...g,...y);break}case Se.PARAGRAPH:default:{let f=ng(e,m.pathToParagraph),h=m,g=0;do g=n2({paragraphElement:f,renderedParagraph:h,patchText:n,fromIndex:g,children:Uh(t,r,a),keepOriginalStyles:i,newTrackedChangeId:d}),h=Gr({element:f,index:m.index,parent:void 0});while(s&&h.text.includes(n,g));break}}return{element:e,didFindOccurrence:!0}},Uh=(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?[lt(U(i)).elements[0]]:[]})),n2=({paragraphElement:e,renderedParagraph:t,patchText:n,fromIndex:r,children:i,keepOriginalStyles:s,newTrackedChangeId:a})=>{let o=t.text.indexOf(n,r);Qf({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:Tl,fromIndex:r});let c=ZE(e,Tl),l=c.slice(0,-1),u=Bs(e,l),d=c[c.length-1],p=l.map((_,v)=>Bs(e,l.slice(0,v+1))).filter(_=>_.name==="w:sdt"),m=[...p].reverse().find(r2),f=u.elements[d],{left:h,right:g}=e2(f,Tl),y=f.elements.find(_=>_.type==="element"&&_.name==="w:rPr"),x=m?i2(m):y,b=s&&x?i.map(_=>eg(_,x)):i,E=y?k(k({},g),{},{elements:[y,...g.elements]}):g;return u.elements.splice(d,1,h,...b,E),p.forEach(_=>o2(_,b)),c2(e,l,a),o+Gr({element:{name:"w:p",elements:[...b]},index:0,parent:void 0}).text.length},Cc=e=>{var t;return(t=e.elements)===null||t===void 0?void 0:t.find(n=>n.name==="w:sdtPr")},r2=e=>{var t;return!!(!((t=Cc(e))===null||t===void 0||(t=t.elements)===null||t===void 0)&&t.some(n=>n.name==="w:showingPlcHdr"))},i2=e=>{var t;return(t=Cc(e))===null||t===void 0||(t=t.elements)===null||t===void 0?void 0:t.find(n=>n.name==="w:rPr")},s2=new Set(["w:rPr","w:t","w:tab","w:br"]),a2=e=>e.name==="w:bookmarkStart"||e.name==="w:bookmarkEnd"||e.name==="w:r"&&tn(e).every(t=>s2.has(t.name)),o2=(e,t)=>{let n=Cc(e);if(!n?.elements)return;let r=n.elements.some(i=>i.name==="w:text")&&!t.every(a2);n.elements=n.elements.filter(i=>i.name!=="w:showingPlcHdr"&&i.name!=="w:dataBinding"&&!(r&&i.name==="w:text"))},Vl=new Set(["w:hyperlink","w:fldSimple","w:subDoc"]),l2=new Map([["w:ins",Vl],["w:moveTo",Vl],["w:hyperlink",new Set(["w:hyperlink"])]]),c2=(e,t,n)=>{for(let i=t.length;i>0;i--){var r;let s=Bs(e,t.slice(0,i-1)),a=t[i-1],o=s.elements[a],c=l2.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])),m=c===Vl,f=!0,h=p.map(g=>{if(l(g[0]))return g[0];let y=m&&!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,...h)}},eg=(e,t)=>e.name==="w:r"?d2(e,t):e.elements?k(k({},e),{},{elements:e.elements.map(n=>eg(n,t))}):e,d2=(e,t)=>{let n=tn(e).find(a=>a.type==="element"&&a.name==="w:rPr");if(!n)return k(k({},e),{},{elements:[t,...tn(e)]});let r=new Set(tn(n).map(a=>a.name)),i=[...tn(t).filter(a=>!r.has(a.name)),...tn(n)],s=k(k({},n),{},{elements:[...i].sort((a,o)=>jh(a)-jh(o))});return k(k({},e),{},{elements:tn(e).map(a=>a===n?s:a)})},Sl=["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"],jh=e=>{var t;if(e.name==="w:rPrChange")return Sl.length+1;let n=Sl.indexOf((t=e.name)!==null&&t!==void 0?t:"");return n===-1?Sl.length:n},tn=e=>{var t;return(t=e.elements)!==null&&t!==void 0?t:[]},tg=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,tg(s)),Number.isInteger(r)?r:0)},p2=(e,t)=>e.length>t.length&&t.every((n,r)=>e[r]===n),u2=e=>e.filter(t=>!e.some(n=>p2(t.pathToParagraph,n.pathToParagraph))),ng=(e,t)=>{let n=e;for(let r=1;r<t.length;r++){let i=t[r];n=n.elements[i]}return n},h2=(e,t)=>ng(e,t.slice(0,t.length-1)),m2=e=>e[e.length-1],f2=new ln,Cl="word/styles.xml",g2=new Set(["w:pStyle","w:rStyle","w:tblStyle","w:basedOn","w:next","w:link"]),Ir=e=>{var t;return String((t=e.attributes)===null||t===void 0?void 0:t["w:styleId"])},Xl=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()},Is=(e,t)=>{var n;return e==null||(n=e.elements)===null||n===void 0?void 0:n.find(r=>r.name===t)},Wh=e=>{var t;let n=Number((t=Is(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},b2=e=>{var t,n;let r=e.filter(a=>a.name==="w:style"),i=(t=r.find(a=>Ir(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"&&Xl(a)==="normal"}),s=e.find(a=>a.name==="w:docDefaults");return(n=Wh(Is(i,"w:rPr")))!==null&&n!==void 0?n:Wh(Is(Is(s,"w:rPrDefault"),"w:rPr"))},v2=(e,t)=>new Map(Object.values(gc({document:{run:{size:t}}})).map(n=>lt(U(f2.format(n,e))).elements[0]).filter(n=>n.name==="w:style").map(n=>[Ir(n),n])),w2=(e,t)=>{var n;let r=Te((n=e.get(Cl))!==null&&n!==void 0?n:{},"w:styles"),i=r.filter(f=>f.name==="w:style"),s=new Set(i.map(Ir)),a,o=f=>{var h;return(h=a)!==null&&h!==void 0||(a=v2(t(Cl),b2(r))),a.get(f)},c=new Set,l=new Map,u=f=>{let h=s.has(f)?void 0:o(f);if(h===void 0)return f;let g=i.find(y=>{var x,b;return((x=y.attributes)===null||x===void 0?void 0:x["w:type"])===((b=h.attributes)===null||b===void 0?void 0:b["w:type"])&&Xl(y)===Xl(h)});return g!==void 0?Ir(g):(c.add(f),f)},d=f=>(l.has(f)||l.set(f,u(f)),l.get(f)),p=f=>{var h;return g2.has((h=f.name)!==null&&h!==void 0?h:"")?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(Cl);if(!f)return;let h=Te(f,"w:styles"),g=new Set(h.map(Ir));for(let y of c)g.has(y)||(g.add(y),h.push(p(o(y))))}}},y2={type:Se.PARAGRAPH,children:[]},x2=({json:e,key:t,patch:n,delimiters:{start:r,end:i},patchPlaceholder:s,renumberDrawings:a})=>{let o=`${r}${t}.`;for(let c of k2(e,o)){let l=C2(c.elements,o,i),u=n.rows.flatMap((d,p)=>{let m={type:"element",name:"w:tbl",elements:[...p===0?c.elements.map(E2):a(ig(c.elements))]},f=new Map(Object.entries(d).flatMap(([h,g])=>g===void 0?[]:[[h,g]]));for(let[h,g]of f)s(m,`${t}.${h}`,g);for(let h of l.filter(g=>!f.has(g)))s(m,`${t}.${h}`,y2);return m.elements});c.parent.elements.splice(c.parent.elements.indexOf(c.elements[0]),c.elements.length,...u),c.table&&!rg(c.table.element)&&c.table.parent.elements.splice(c.table.parent.elements.indexOf(c.table.element),1)}},k2=(e,t)=>{let n=Sc(e,t).flatMap(i=>{let s=T2(e,i.pathToParagraph);return s?[s]:[]}),r=n.filter(i=>!n.some(s=>S2(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)}})})},T2=(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},S2=(e,t)=>e.length>t.length&&t.every((n,r)=>e[r]===n),rg=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"&&rg(n))},C2=(e,t,n)=>{let r=Sc({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)]},E2=e=>JSON.parse(JSON.stringify(e)),A2=["w14:paraId","w14:textId"],_2=["w:bookmarkStart","w:bookmarkEnd"],ig=(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])=>!A2.includes(r)))}),n.elements===void 0?{}:{elements:[...ig(n.elements,n)]})),N2=e=>e[0]===255&&e[1]===254||e[0]===254&&e[1]===255,I2=e=>{var t;let n=WC(e,"word/document.xml"),r=n===void 0||(t=[...e].find(([i])=>mC(i,n)))===null||t===void 0?void 0:t[1];return r===void 0||N2(r)?void 0:ec(zC(Ys(r)))},$s=(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}`}}},P2=(e,t,n)=>{let r=e;for(let i=$s(r,0,t,n);i!==void 0;i=$s(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},sg=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(n=>[...n.name==="w:p"?[n]:[],...sg(n)])},O2=(e,t,n)=>{let r=()=>Gr({element:e,index:0,parent:void 0});for(let i=r(),s=$s(i.text,0,t,n);s!==void 0;i=r(),s=$s(i.text,s.index+s.trimmed.length,t,n))Qf({paragraphElement:e,renderedParagraph:i,originalText:s.placeholder,replacementText:s.trimmed,fromIndex:s.index})},R2=(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 sg(e))O2(c,t,s);let a=c=>i.has(c);for(let{properties:c}of Js(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]=P2(String(u),t,a))}},ag=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},og=e=>{var t;let n=ag(e);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(og)]},L2=e=>{let t=new Set(og(e)),n=r=>{let i=ag(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)},lg=(e,t,{inTableRow:n})=>{if(t?.type===Se.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&&lg(`${e}.${i}`,s,{inTableRow:!0})}return}if(!(t?.type===Se.DRAWING?!n&&typeof t.patch=="function":t?.type!==Se.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"}`)},Kh=new Ff,M2=new Uint8Array([255,254]),D2=new Uint8Array([254,255]),B2=new Set(["w:document","w:hdr","w:ftr","w:footnotes","w:endnotes","w:comments"]),Gh=(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},WI=(function(){var e=jt(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 m=yield zf(n),f=new Map,h=I2(m),g=[],y=new hf({addOverride:(D,$)=>g.push({contentType:D,partName:$})},new Set([...m.keys()].filter(D=>D.startsWith("word/")).map(D=>D.slice(5)))),x={Media:new pf(D=>y.takePath("media","image",D)),Numbering:new uf(u),Theme:h&&{Colors:h},FootNotes:{View:{idOf:(D,$,q)=>Et("footnotes",D,$,q)}},Endnotes:{View:{idOf:(D,$,q)=>Et("endnotes",D,$,q)}},PackageParts:y},b=new Map,E=[],_=[],v=!1,T=new Map;Wf(s);let{start:w,end:A}=s;for(let[D,$]of Object.entries(r))lg(D,$,{inTableRow:!1});for(let[D,$]of m){var N;let q=$.slice(0,2);if(Gh(q,M2)||Gh(q,D2)){T.set(D,$);continue}if(!D.endsWith(".xml")&&!D.endsWith(".rels")){T.set(D,$);continue}let ie=lt(Ys($)),se=(N=ie.elements)===null||N===void 0?void 0:N.find(ae=>{var te;return B2.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}`]=Ol[ae];se.attributes["mc:Ignorable"]=`${se.attributes["mc:Ignorable"]||""} w15`.trim()}b.set(D,ie)}let M=lE([...b.values()].flatMap(Hf)),L=kE([...b.values()].flatMap(Kf)),F=new Map,J=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:x,viewWrapper:J(D),stack:[]}),X=(D,$)=>{g.push({contentType:D,partName:$})},Z=w2(b,z),fe=KE(x.Numbering,b,{createContext:z,addContentTypeOverride:X}),ce=$E({footnotes:c,endnotes:l},b,{createContext:z,addContentTypeOverride:X,renumberBookmarks:M,renumberDrawings:L,renumberLists:fe.renumber,useStyles:Z.use}),Et=(D,$,q,ie)=>ie.viewWrapper===J("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:w,end:A},textKeys:new Set(D(q=>q!==Se.TABLE_ROWS&&q!==Se.DRAWING)),tableRowsKeys:D(q=>q===Se.TABLE_ROWS),drawingKeys:new Set(D(q=>q===Se.DRAWING))};for(let[q,ie]of b)q.startsWith("word/")&&!q.endsWith(".rels")&&R2(ie,$)}_E({parts:b,binaryParts:T,file:x,patches:Object.entries(r).flatMap(([D,$])=>$.type===Se.DRAWING?[[D,$]]:[]),delimiters:{start:w,end:A}},z);let Ee=Object.entries(r).flatMap(([D,$])=>$.type===Se.DRAWING?[]:[[D,$]]),He=[...Ee.filter(([,D])=>D.type===Se.TABLE_ROWS),...Ee.filter(([,D])=>D.type!==Se.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=L2($),se=(ae,te,Re)=>{if(Re.type===Se.TABLE_ROWS){x2({json:ae,key:te,patch:Re,delimiters:{start:w,end:A},patchPlaceholder:se,renumberDrawings:L});return}let Fc=[],{didFindOccurrence:jg}=t2({json:ae,patch:k(k({},Re),{},{children:Re.children.flatMap(Ue=>Ue instanceof Bm?Ue.writtenAs:[Ue]).map(Ue=>{if(Ue instanceof k1){let{target:Wg,anchor:Kg}=Hm(Ue.options.link),qc=new pc(Ue.options.children,Ln(),Kg,Ue.options.link);return Fc.push({key:D,id:qc.linkId,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",target:Wg,targetMode:ic.EXTERNAL}),qc}else return Ue})}),patchText:`${w}${te}${A}`,context:q,keepOriginalStyles:i,recursive:a,renumberIds:Ue=>Z.use(fe.renumber(ce.renumber(M(L(ie(Ue))))))});jg&&_.push(...Fc)};for(let[ae,te]of He)se($,ae,te)}ce.write(),fe.write(),Z.write();for(let[D,$]of b){if(!D.startsWith("word/")||D.endsWith(".xml.rels"))continue;let q=Kh.getMediaData(JSON.stringify($),x.Media);q.length>0&&(v=!0,E.push({key:D,mediaDatas:q}))}for(let{key:D,mediaDatas:$}of E){var we;let q=Ye(D),ie=(we=b.get(q))!==null&&we!==void 0?we:$r();b.set(q,ie);let se=kc(ie),ae=Kh.replace(JSON.stringify(b.get(D)),$,se);b.set(D,JSON.parse(ae));for(let te=0;te<$.length;te++){let{fileName:Re}=$[te];Ul(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=Ye(D),te=(ye=b.get(ae))!==null&&ye!==void 0?ye:$r();b.set(ae,te),Ul(te,$,q,ie,se)}d&&(yield XE(b,d,T)),p&&wE(b,T,p,{addContentTypeOverride:X});let re=yc(x,void 0);if(v||g.length>0){let D=b.get("[Content_Types].xml");if(!D)throw new Error("Could not find content types file");v&&(_n(D,"image/png","png"),_n(D,"image/jpeg","jpeg"),_n(D,"image/jpeg","jpg"),_n(D,"image/bmp","bmp"),_n(D,"image/gif","gif"),_n(D,"image/svg+xml","svg"));for(let{contentType:$,partName:q}of g)dE(D,$,q)}return ql(Ms([...[...b].map(([D,$])=>[D,tx($)]),...T,...x.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)}})(),$2=e=>e.startsWith("word/")&&/\.(xml|rels)$/.test(e)&&!e.endsWith(".xml.rels"),KI=(function(){var e=jt(function*({data:t,placeholderDelimiters:n={start:"{{",end:"}}"},trimPlaceholders:r=!1}){Wf(n);let i=F2(n),s=yield zf(t,$2),a=new Set;for(let[,o]of s){let c=lt(Ys(o));[...Zf(c).map(l=>l.text),...Js(c).flatMap(({properties:l})=>Gf(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)}})(),El=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),F2=({start:e,end:t})=>new RegExp(`(?<=${El(e)})(?:(?!${El(e)}).)+?(?=${El(t)})`,"gs")});var gg={};oa(gg,{EXPORT_DIR:()=>zr,FORMATS:()=>Ec,buildIR:()=>ea,exportDoc:()=>Ac,irToDocx:()=>fg,irToHtml:()=>ta});import dg from"node:fs";import pg from"node:path";function H2(e){return`${String(e.getDate()).padStart(2,"0")}/${String(e.getMonth()+1).padStart(2,"0")}/${e.getFullYear()}`}function j2(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 W2(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]:[]],Zs(i&&l.requirement||l.case),Zs(l.steps),Zs(l.expected)];return t.results&&p.push(j2(l,n),l.result?[l.result.by??"",U2(l.result.at,r)].filter(Boolean):[]),p});return{head:a,widths:o,rows:c}}function hg(e){let t=br();for(let n of e)Qo(n,t);return t}function ea(e,t={}){let n=e.config,r=n.overview??{},i=t.date??new Date,s=n.language==="en"?"en":"vi",a=q2[s],o=[],c=b=>Zt(e,b),l=e.modules.filter(b=>c(b.code).some(E=>E.kind==="functional")),u=e.modules.filter(b=>c(b.code).some(E=>E.kind==="non-functional")),d=ft(e.root,n.ba),p=d?Qt(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"?H2(i):i.toISOString().slice(0,10))}]}),o.push({k:"pagebreak"}),o.push({k:"p",text:a.signPage,bold:!0});let m=n.members.length?n.members:[{id:"",name:"",role:""}];o.push({k:"table",head:a.signHead,widths:[6,16,30,28,20],rows:m.map((b,E)=>[[String(E+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:`${ug[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 h=r.terms?.length?r.terms:a.termsDefault;o.push({k:"table",head:a.termsHead,widths:[8,30,62],rows:h.map((b,E)=>[[String(E+1)],[b.term],[b.desc]])});let g=(b,E,_)=>{if(o.push({k:"pagebreak"}),o.push({k:"h",level:1,text:`${ug[f++]}. ${b}`}),!E.length){o.push({k:"p",text:a.noSuites,italic:!0});return}E.forEach((v,T)=>{o.push({k:"h",level:2,text:`${T+1}. ${v.title}`}),_==="functional"&&v.commonSteps.trim()&&(o.push({k:"p",text:a.commonSteps,bold:!0}),o.push({k:"list",items:Zs(v.commonSteps)})),c(v.code).filter(w=>w.kind===_).forEach((w,A)=>{o.push({k:"h",level:3,text:`${T+1}.${A+1}. ${w.title}`});let N=[w.useCases.length?a.useCase+w.useCases.join(", "):"",w.covers.length?a.functions+w.covers.map(L=>p?.get(L)?.title?`${L} (${p.get(L).title})`:L).join("; "):""].filter(Boolean);if(N.length&&o.push({k:"p",text:N.join(" \xB7 "),italic:!0}),w.preconditions&&o.push({k:"p",text:a.pre+w.preconditions}),w.description.trim())for(let L of w.description.trim().split(/\n\s*\n/))o.push({k:"p",text:L.trim()});let M=W2(w,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(v=>({m:v,c:hg(c(v.code))})).filter(v=>v.c.total),E=hg(e.modules.flatMap(v=>c(v.code))),_=v=>v.total?Math.round(100*v.passed/v.total)+"%":"\u2014";o.push({k:"table",head:a.sumHead,widths:[30,10,8,10,9,9,11,13],rows:[...b.map(({m:v,c:T})=>[[v.title],[String(T.total)],[String(T.passed)],[String(T.failed)],[String(T.blocked)],[String(T.skipped)],[String(T["not-run"])],[_(T)]]),[[a.total],[String(E.total)],[String(E.passed)],[String(E.failed)],[String(E.blocked)],[String(E.skipped)],[String(E["not-run"])],[_(E)]]]})});let x=e.suites.filter(b=>b.status!=="deleted"&&b.covers.length);if(x.length&&y.push(()=>{o.push({k:"h",level:2,text:a.matrix});let b=new Map;for(let E of x)for(let _ of E.covers)b.set(_,[...b.get(_)??[],E.title]);o.push({k:"table",head:a.matrixHead,widths:[8,42,50],rows:[...b.entries()].sort((E,_)=>E[0].localeCompare(_[0])).map(([E,_],v)=>[[String(v+1)],[p?.get(E)?.title?`${E} \u2013 ${p.get(E).title}`:E],_])})}),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 ta(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"`:""}>${St(a.text)}</p>`:"<p>&nbsp;</p>").join("")}</section>`);else if(s.k==="h")t.push(`<h${s.level} id="h${r++}">${St(s.text)}</h${s.level}>`);else if(s.k==="p")t.push(`<p${s.bold||s.italic?` class="${s.bold?"b":""} ${s.italic?"i":""}"`:""}>${St(s.text).replace(/\n/g,"<br>")}</p>`);else if(s.k==="list")t.push(`<ul>${s.items.map(a=>`<li>${St(a)}</li>`).join("")}</ul>`);else if(s.k==="toc")t.push(`<nav class="toc"><p class="b">${St(s.title)}</p>${n.map((a,o)=>`<a class="l${a.level}" href="#h${o}">${St(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>${St(o)}</th>`).join("")}</tr></thead><tbody>${s.rows.map(o=>`<tr>${o.map(c=>`<td>${c.map(St).join("<br>")}</td>`).join("")}</tr>`).join("")}</tbody></table>`)}return`<!doctype html><html lang="${e.lang}"><head><meta charset="utf-8"><title>${St(e.title)}</title><style>body{background:#e9ecef;margin:0;font:12pt/1.45 "Times New Roman",serif;color:#111}
5338
+ `;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(`
5339
+ `):[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}
5294
5340
  main{background:#fff;max-width:794px;margin:24px auto;padding:72px 64px;box-shadow:0 1px 4px rgba(0,0,0,.15)}
5295
5341
  .cover{text-align:center;min-height:900px;display:flex;flex-direction:column;justify-content:center}.cover p{margin:4px 0}
5296
5342
  .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}
@@ -5298,20 +5344,25 @@ p{margin:6px 0;text-align:justify}table{width:100%;border-collapse:collapse;marg
5298
5344
  th,td{border:1px solid #555;padding:4px 6px;vertical-align:top;text-align:left;overflow-wrap:break-word}th{background:#f1f3f5;overflow-wrap:normal;word-break:keep-all}
5299
5345
  .pb{height:0;border-top:1px dashed #ccc;margin:36px -64px;page-break-after:always}.toc a{display:block;color:#111;text-decoration:none;padding:2px 0}
5300
5346
  .toc .l2{padding-left:18px}.toc .l3{padding-left:36px;font-size:11pt}@media print{body{background:#fff}main{box-shadow:none;margin:0;padding:0}.pb{border:0;margin:0}}</style></head><body><main>${t.join(`
5301
- `)}</main></body></html>`}async function fg(e){let t=[],n=(i,s=!1)=>(i.length?i:[""]).map(a=>new ne({children:[new Oe({text:a,bold:s})]}));for(let i of e.nodes)if(i.k==="cover")for(let s of i.lines)t.push(new ne({alignment:pe.CENTER,spacing:{after:120},children:[new Oe({text:s.text,bold:!!s.bold,...s.size?{size:s.size}:{}})]}));else if(i.k==="h")t.push(new ne({heading:K2[Math.min(i.level,3)-1],keepNext:!0,children:[new Oe({text:i.text})]}));else if(i.k==="p")t.push(new ne({alignment:pe.JUSTIFIED,children:i.text.split(`
5302
- `).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:pe.CENTER,children:[new Oe({text:i.title,bold:!0})]})),t.push(new Df(i.title,{hyperlink:!0,headingStyleRange:"1-3"}));else if(i.k==="pagebreak")t.push(new ne({children:[new Mm]}));else if(i.k==="table"){let s=c=>i.widths?.[c]?{width:{size:i.widths[c],type:$e.PERCENTAGE}}:{},a=new Gs({tableHeader:!0,cantSplit:!0,children:i.head.map((c,l)=>new Mr({borders:mg,shading:{fill:"F1F3F5"},...s(l),children:n([c],!0)}))}),o=i.rows.map(c=>new Gs({cantSplit:!1,children:c.map((l,u)=>new Mr({borders:mg,...s(u),children:n(l)}))}));t.push(new tf({width:{size:100,type:$e.PERCENTAGE},rows:[a,...o]})),t.push(new ne({children:[]}))}let r=new Mf({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 xc.toBuffer(r)}async function Ac(e,t={}){let n=ea(e,t),r=pg.resolve(e.root,t.out??zr);dg.mkdirSync(r,{recursive:!0});let i=t.date??new Date,s=pg.join(r,`${G2(e.config.title)}${t.results?"-ket-qua":""}-${i.toISOString().slice(0,10)}`),a=[];for(let o of t.formats??["docx"]){let c=`${s}.${o}`;dg.writeFileSync(c,o==="docx"?await fg(n):ta(n)),a.push(c)}return a}var q2,ug,Zs,U2,St,Qs,mg,K2,zr,Ec,G2,na=Ae(()=>{"use strict";S();cg();hr();gs();gr();q2={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"]}},ug=["I","II","III","IV","V","VI"],Zs=e=>String(e??"").split(`
5303
- `).map(t=>t.replace(/^\s*[-*+]\s+/,"").trimEnd()).filter(t=>t.trim());U2=(e,t)=>{let n=/^(\d{4})-(\d{2})-(\d{2})/.exec(e??"");return n&&t==="vi"?`${n[3]}/${n[2]}/${n[1]}`:e??""};St=e=>e.replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t]);Qs={style:Ur.SINGLE,size:4,color:"555555"},mg={top:Qs,bottom:Qs,left:Qs,right:Qs},K2=[Ks.HEADING_1,Ks.HEADING_2,Ks.HEADING_3];zr="exports",Ec=["docx","html"],G2=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 wg(e){return e==="mixed"?["vi","en"]:[e]}function _c(e){let t=[];for(let n of wg(e))for(let r of z2)for(let i of vg[n][r])t.push({kind:r,keyword:i});return t.sort((n,r)=>r.keyword.length-n.keyword.length)}function Nc(e){let t=[X2];for(let n of wg(e))for(let r of V2)t.push(...vg[n][r]);return t.sort((n,r)=>r.length-n.length)}function Z2(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 eA(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 tA(e){return e.trim().split(/\s+/).filter(t=>t.startsWith("@"))}function nA(e,t){let n=e.find(s=>s.trim()!=="");if(!n)return"mixed";let r=n.trim().match(Y2);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 bg(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 yg(e){return e.length>0?e[e.length-1]:null}function rA(e,t){let n=yg(e);n&&(n.dataTable||(n.dataTable=[]),n.dataTable.push(t))}function iA(e,t){let n=yg(e);n&&(n.docString=t)}function sA(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(`
5304
- `),n}function xg(e,t){let n=e.split(/\r?\n/),r=nA(n,t),i=J2[r],s=Q2[r],a=[],o="",c=[],l=[],u=[],d=0,p=null,m="none",f,h=[],g=!1,y=[],x=null;function b(){return m==="background"?c:m==="ruleBackground"?h:p&&m==="scenario"?p.scenario.ownSteps:null}let E=new Map;function _(){if(!p)return;let v=sA(p,n);E.set(v,[...p.ruleBackgroundSteps]),l.push(v),p=null}for(let v=0;v<n.length;v+=1){let T=n[v],w=v+1,A=T.trim();if(!A)continue;if(g){A==='"""'?(x&&iA(x,y.join(`
5305
- `)),g=!1,y=[],x=null):y.push(T),p&&(p.endLine=w);continue}if(A.startsWith("@")){u.length===0&&(d=w),u.push(...tA(T));continue}if(A.startsWith("#"))continue;let N=Z2(A,i);if(N){switch(N.kind){case"feature":_(),a=[...u],o=N.title,f=void 0,h=[],m="none";break;case"background":_(),m=f!==void 0?"ruleBackground":"background";break;case"rule":_(),f=N.title,h=[],m="none";break;case"scenario":case"scenarioOutline":{_();let F=u.length>0?d:w;p={startLine:F,endLine:w,ruleBackgroundSteps:[...h],scenario:{tags:[...u],title:N.title,keyword:N.keyword,isOutline:N.kind==="scenarioOutline",rule:f,steps:[],ownSteps:[],examples:[],rawBlock:"",lineRange:{start:F,end:w}}},m="scenario";break}case"examples":p&&(p.scenario.examples.push({keyword:N.keyword,headers:[],rows:[]}),p.endLine=w,m="examples");break}u=[];continue}let M=eA(A,s);if(M){m==="background"?c.push(M):m==="ruleBackground"?h.push(M):p&&(p.scenario.ownSteps.push(M),p.endLine=w,m="scenario");continue}if(m==="examples"&&p){let F=bg(A);if(F){let J=p.scenario.examples[p.scenario.examples.length-1];J.headers.length===0?J.headers=F:J.rows.push(F),p.endLine=w;continue}}if(A==='"""'){let F=b();if(F&&F.length>0){g=!0,y=[],x=F,p&&(p.endLine=w);continue}}let L=bg(A);if(L){let F=b();if(F){rA(F,L),p&&(p.endLine=w);continue}}p&&(p.endLine=w)}_();for(let v of l){let T=E.get(v)??[];v.steps=[...c,...T,...v.ownSteps]}return{filePath:t,language:r,featureTags:a,featureTitle:o,backgroundSteps:c,scenarios:l}}var vg,z2,V2,X2,Y2,J2,Q2,kg=Ae(()=>{"use strict";S();vg={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"]}},z2=["feature","background","rule","scenario","scenarioOutline","examples"],V2=["given","when","then","and","but"],X2="*",Y2=/^#\s*language\s*:\s*(.+?)\s*$/;J2={vi:_c("vi"),en:_c("en"),mixed:_c("mixed")},Q2={vi:Nc("vi"),en:Nc("en"),mixed:Nc("mixed")}});function Tg(e){let t=[];Sg(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 Sg(e,t,n=""){for(let r of e){let i=r.file??n;for(let s of r.specs??[])t.push(aA(s,s.file??i));r.suites&&Sg(r.suites,t,i)}}function aA(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=oA(d).split(`
5347
+ `)}</main></body></html>`}async function vg(e){let t=[],n=(i,s=!1)=>(i.length?i:[""]).map(a=>new ne({children:[new Oe({text:a,bold:s})]}));for(let i of e.nodes)if(i.k==="cover")for(let s of i.lines)t.push(new ne({alignment:ue.CENTER,spacing:{after:120},children:[new Oe({text:s.text,bold:!!s.bold,...s.size?{size:s.size}:{}})]}));else if(i.k==="h")t.push(new ne({heading:Z2[Math.min(i.level,3)-1],keepNext:!0,children:[new Oe({text:i.text})]}));else if(i.k==="p")t.push(new ne({alignment:ue.JUSTIFIED,children:i.text.split(`
5348
+ `).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(`
5349
+ `).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(`
5350
+ `),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(`
5351
+ `)),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(`
5306
5352
  `).slice(0,4).join(`
5307
- `))}}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 oA(e){return e.replace(/\u001b\[[0-9;]*[a-zA-Z]/g,"")}var Cg=Ae(()=>{"use strict";S()});var Rc={};oa(Rc,{applyRunResults:()=>Oc,featureFiles:()=>pA,importFeature:()=>Pc,parseRunResults:()=>ra,readRunResults:()=>uA,scenarioTag:()=>Eg,scenarioToCase:()=>_g});import Vr from"node:fs";import Ic from"node:path";function Eg(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 Ag(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 _g(e){let t=[],n=[],r="do";for(let a of e.ownSteps){let o=a.keyword.trim();dA.test(o)?r="expect":(lA.test(o)||cA.test(o))&&(r="do"),(r==="expect"?n:t).push(Ag(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(`
5353
+ `))}}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(`
5308
5354
  `),expected:n.join(`
5309
- `)}}function Pc(e,t,n){let r=os(e,n.module),i=xg(t,n.file);if(!i.featureTitle&&!i.scenarios.length)throw new K(j(`${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??gt(e.root),a=ss(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=un("KB",r.code,a);a.add(d),o={code:d,module:r.code,title:i.featureTitle||Ic.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(Ag).join("; "));let l={suite:o.code,created:c,added:[],updated:[],missing:[],untagged:0},u=new Set;for(let d of i.scenarios){let p=Eg(d.tags,i.featureTags);p||l.untagged++;let{steps:m,expected:f}=_g(d),h=o.cases.filter(y=>!y.deleted),g=p?h.find(y=>y.tag?.toLowerCase()===p.toLowerCase()):h.find(y=>!y.tag&&y.case===d.title);if(g)g.case=d.title,g.steps=m,g.expected=f,u.add(g.code),l.updated.push(g.code);else{let y=un("TC",r.code,a);a.add(y);let x={code:y,case:d.title,steps:m,expected:f,...p?{tag:p}:{}};o.cases.push(x),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),Ge(e.root,o),c&&fr(e,r.code,{suites:[...Zt(e,r.code).map(d=>d.code).filter(d=>d!==o.code),o.code]}),l}function pA(e){let t=[],n=r=>{for(let i of Vr.readdirSync(r,{withFileTypes:!0})){if(i.name.startsWith(".")||i.name==="node_modules")continue;let s=Ic.join(r,i.name);i.isDirectory()?n(s):i.name.endsWith(".feature")&&t.push(s)}};return n(e),t.sort()}function uA(e){let t=Vr.existsSync(e)&&Vr.statSync(e).isDirectory()?Ic.join(e,"results.json"):e;if(!Vr.existsSync(t))throw new K(j(`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 ra(Vr.readFileSync(t,"utf8"))}function ra(e){let t;try{t=JSON.parse(e)}catch{throw new K(j("results.json kh\xF4ng ph\u1EA3i JSON h\u1EE3p l\u1EC7.","results.json is not valid JSON."))}return Tg(t).specs}function Oc(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 m=p.filter(g=>g.status==="failed"),f=m.length?"failed":p.every(g=>g.status==="skipped")?"skipped":"passed",h=m.length?(m.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,...h?{actual:h}:{},...n.env?{env:n.env}:{}},i.applied.push({code:u.code,status:f}),l=!0}l&&Ge(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 lA,cA,dA,Xr=Ae(()=>{"use strict";S();Dn();kg();Cg();hn();gr();En();lA=/^(given|cho|biết)$/i,cA=/^(when|khi)$/i,dA=/^(then|thì)$/i});import{spawn as hA}from"node:child_process";import mA from"node:http";import fA from"node:path";function gA(e,t){let n=["ai-host","--dir",e,"--lang",t,"--lifeline"],r=process.env.PAN_CLI_JS?.trim();return r?{file:process.execPath,args:[r,...n],shell:!1}:{file:"pan",args:n,shell:process.platform==="win32"}}function bA(e,t){let n=cn.get(e);if(n)return n;let r=new Promise((i,s)=>{let a=gA(e,t),o=hA(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(`
5310
- `))if(p.trim().startsWith("{"))try{let m=JSON.parse(p);if(m.event==="listening"&&m.url&&m.token){clearTimeout(u),i({url:new URL(m.url),token:m.token,child:o});return}}catch{}}),o.stderr.on("data",d=>{l=(l+d.toString("utf8")).slice(-2e3)}),o.on("error",d=>{clearTimeout(u),cn.delete(e),s(d)}),o.on("exit",d=>{clearTimeout(u),cn.delete(e),s(new Error(`PAN_AI_HOST_EXIT ${d} ${l.slice(-400)}`))})});return cn.set(e,r),r.catch(()=>cn.delete(e)),r}function Ng(){for(let e of cn.values())e.then(t=>{try{t.child.stdin.end()}catch{}}).catch(()=>{});cn.clear()}function Ig(e,t){let n=e.config.language==="en",r=ft(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(`
5355
+ `)}}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(`
5356
+ `).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(`
5357
+ `))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(`
5311
5358
  `);return{system:[...a,"",(n?`Context:
5312
5359
  `:`Ng\u1EEF c\u1EA3nh:
5313
5360
  `)+o].join(`
5314
- `),addDirs:r?[fA.resolve(r)]:[]}}async function Lc(e,t,n,r,i,s){let a=await bA(e,t),o=s===void 0?void 0:Buffer.from(JSON.stringify(s));await new Promise((c,l)=>{let u=mA.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 cn,Pg=Ae(()=>{"use strict";S();hr();cn=new Map});var $g={};oa($g,{CSP:()=>Bc,VIEW_CSP:()=>Dc,createDocServer:()=>TA,embedSources:()=>Dg});import{randomBytes as vA,timingSafeEqual as wA}from"node:crypto";import Mc from"node:fs";import yA from"node:http";import ct from"node:path";import{fileURLToPath as xA}from"node:url";function Rg(e){if(typeof R<"u"&&R[e]!==void 0)return R[e];for(let t of[ct.join(Og,"ui"),ct.join(Og,"..","..","src","doc","ui")]){let n=ct.join(t,ia[e].file);if(Mc.existsSync(n))return Mc.readFileSync(n,"utf8")}throw new Error(`Thi\u1EBFu t\u1EC7p giao di\u1EC7n ${e}`)}function Bg(e){let t=ft(e.root,e.config.ba);return t?Qt(t):null}function kA(e){let t=Bg(e);return{root:e.root,me:gt(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:fs(e,t)}}function Mg(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 TA(e){let t=ts(e.start);if(!t)throw new K(j(`Kh\xF4ng th\u1EA5y repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (.pantest.yaml) t\u1EEB ${ct.resolve(e.start)}. T\u1EA1o b\u1EB1ng: pan-test doc init`,`No test document repo (.pantest.yaml) found from ${ct.resolve(e.start)}. Create one with: pan-test doc init`));let n=e.token??vA(24).toString("hex"),r=Dg(e.embed),i=r.length?Bc.replace("frame-ancestors 'none'",`frame-ancestors ${r.join(" ")}`):Bc,s=d=>({status:200,body:d}),a=r.length?Dc.replace("frame-ancestors 'self'",`frame-ancestors 'self' ${r.join(" ")}`):Dc,o={"/api/export":async(d,p)=>{let m=(Array.isArray(d.formats)?d.formats:["docx"]).map(String).filter(h=>Ec.includes(h)),f=await Ac(p,{formats:m.length?m:["docx"],results:d.results===!0,codes:d.codes===!0});return s({ok:!0,dir:ct.join(p.root,zr),files:f.map(h=>ct.relative(p.root,h).split(ct.sep).join("/"))})},"/api/open":async(d,p)=>{let m=ct.join(p.root,zr);Mc.mkdirSync(m,{recursive:!0});let{spawn:f}=await import("node:child_process"),h=process.platform==="darwin"?"open":process.platform==="win32"?"explorer":"xdg-open";try{f(h,[m],{stdio:"ignore",detached:!0,windowsHide:!0}).unref()}catch{}return s({ok:!0,dir:m})}},c={"/api/module/new":(d,p)=>s(as(p,String(d.code??"").trim().toUpperCase(),String(d.title??"").trim())),"/api/module":(d,p)=>s(fr(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(ls(p,{module:String(d.module),title:String(d.title??""),...d.kind==="non-functional"?{kind:"non-functional"}:{},...Mn(d.covers)?{covers:Mn(d.covers)}:{},...ee(d.after)?{after:ee(d.after)}:{},avoid:Bt(p.root)})),"/api/suite":(d,p)=>{let m={};for(let f of["title","preconditions","description","owner"])ee(d[f])!==void 0&&(m[f]=ee(d[f]));return(d.kind==="functional"||d.kind==="non-functional")&&(m.kind=d.kind),(d.status==="drafting"||d.status==="done"||d.status==="deleted")&&(m.status=d.status),ee(d.priority)!==void 0&&(m.priority=ee(d.priority)),Mn(d.covers)&&(m.covers=Mn(d.covers)),Mn(d.useCases)&&(m.useCases=Mn(d.useCases)),s(Wu(p,String(d.code),m))},"/api/case/new":(d,p)=>s(cs(p,String(d.suite),{case:"",...Mg(d)},{...ee(d.after)?{after:ee(d.after)}:{},avoid:Bt(p.root)})),"/api/case":(d,p)=>s(ps(p,String(d.code),Mg(d))),"/api/import/feature":(d,p)=>{let m=Array.isArray(d.files)?d.files:[];if(!m.length)throw new K(j("Ch\u01B0a ch\u1ECDn t\u1EC7p .feature n\xE0o.","No .feature file selected."));let f=Bt(p.root);return s({ok:!0,reports:m.map(h=>({name:String(h.name??""),...Pc(p,String(h.content??""),{file:String(h.name??"feature.feature"),module:String(d.module),avoid:f})}))})},"/api/results":(d,p)=>s({ok:!0,...Oc(p,ra(String(d.content??"")),{...ee(d.env)?{env:ee(d.env)}:{}})}),"/api/case/move":(d,p)=>s(Ku(p,String(d.code),d.dir===-1?-1:1)),"/api/case/delete":(d,p)=>s(us(p,String(d.code),ee(d.reason)??"")),"/api/result":(d,p)=>s(hs(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=yA.createServer((d,p)=>{let m=(x,b,E)=>{p.writeHead(x,{"Content-Type":E,"X-Content-Type-Options":"nosniff","Referrer-Policy":"no-referrer","Cache-Control":"no-store","Content-Security-Policy":i}),p.end(d.method==="HEAD"?void 0:b)},f=(x,b)=>m(x,JSON.stringify(b),"application/json; charset=utf-8"),h=x=>f(x instanceof K?400:500,{ok:!1,error:x.message}),g=x=>{if(p.headersSent){p.end();return}let b=j("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: ")+x.message;y==="/api/ai"?f(200,{engines:[],max:0,runs:[],error:b}):f(503,{ok:!1,error:b})},y=(()=>{try{return new URL(d.url||"/","http://x").pathname}catch{return""}})();try{let x=u.address()?.port,b=String(d.headers.host||""),E=[`127.0.0.1:${x}`,`localhost:${x}`];if(!E.includes(b))return f(403,{error:"Host kh\xF4ng h\u1EE3p l\u1EC7"});let _=new URL(d.url||"/",`http://${b}`),v=_.pathname,T=v==="/api/ai"||v.startsWith("/api/ai/");if(d.method==="POST"){let A=c[v]??o[v]??(T?l:void 0);if(!A)return f(404,{error:"Kh\xF4ng c\xF3"});let N=String(d.headers.origin||"");if(N&&!E.some(z=>N===`http://${z}`))return f(403,{error:"Origin kh\xF4ng h\u1EE3p l\u1EC7"});let M=Buffer.from(String(d.headers["x-pan-test-token"]||"")),L=Buffer.from(n);if(M.length!==L.length||!wA(M,L))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 F=[],J=0;d.on("data",z=>{J+=z.length,J>Lg?(f(413,{error:"Qu\xE1 l\u1EDBn"}),d.destroy()):F.push(z)}),d.on("end",()=>{if(J>Lg)return;let z;try{z=JSON.parse(Buffer.concat(F).toString("utf8")||"{}")}catch{return f(400,{error:"JSON sai"})}if(A===l){let X=Ke(t),Z=v==="/api/ai/run"?{...z,...Ig(X,ee(z.item))}:z;Lc(t,X.config.language,d,p,v,Z).catch(g);return}Promise.resolve().then(()=>{let X=Ke(t);return dn(X.config.language),A(z,X)}).then(X=>f(X.status,X.body)).catch(h)});return}if(d.method!=="GET"&&d.method!=="HEAD")return f(405,{error:"Ch\u1EC9 cho GET/POST"});if(T){let A=Ke(t);Lc(t,A.config.language,d,p,v+_.search).catch(g);return}if(v==="/"||v==="/index.html"){let A=_.searchParams.get("lang")||e.lang||Ke(t).config.language,N=Rg("index.html").replace(/<head[^>]*>/,M=>`${M}<meta name="pantest-token" content="${n}"><meta name="panba-lang" content="${A==="en"?"en":"vi"}">`);return m(200,N,ia["index.html"].type)}let w=/^\/ui\/([a-z0-9.]+)$/.exec(v);if(w&&ia[w[1]])return m(200,Rg(w[1]),ia[w[1]].type);if(v==="/favicon.ico")return m(204,"","image/x-icon");if(v==="/api/index")return f(200,kA(Ke(t)));if(v==="/view/doc"){let A=ta(ea(Ke(t),{results:_.searchParams.get("results")==="1",codes:_.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:A)}if(v==="/api/check"){let A=Ke(t);return f(200,{findings:ms(A,Bg(A))})}return f(404,{error:"Kh\xF4ng c\xF3"})}catch(x){return h(x)}});return u.on("close",()=>Ng()),Object.assign(u,{token:n,root:t})}var Og,ia,Dc,Bc,Lg,Dg,ee,Mn,Fg=Ae(()=>{"use strict";S();Dn();hr();gs();gr();Xr();na();En();Pg();Og=ct.dirname(xA(import.meta.url)),ia={"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"}};Dc="default-src 'none'; style-src 'unsafe-inline'; img-src 'self' data:; base-uri 'none'; form-action 'none'; frame-ancestors 'self'",Bc="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'",Lg=24*1024*1024,Dg=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,Mn=e=>Array.isArray(e)?e.map(String).map(t=>t.trim()).filter(Boolean):void 0});S();S();Dn();import sa from"node:fs";import Ct from"node:path";S();Qr();hn();En();hr();gr();gs();na();Xr();var SA=`pan-test doc \u2014 t\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED
5361
+ `),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(`
5362
+ `)}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","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(`
5363
+ `),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(`
5364
+ `)+`
5365
+ `,{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
5315
5366
 
5316
5367
  doc init [th\u01B0 m\u1EE5c] --title <t\xEAn> [--ba <\u0111\u01B0\u1EDDng d\u1EABn repo BA>] [--lang vi|en]
5317
5368
  doc module add <PH> --title <t\xEAn>
@@ -5321,17 +5372,18 @@ th,td{border:1px solid #555;padding:4px 6px;vertical-align:top;text-align:left;o
5321
5372
  [--requirement <y\xEAu c\u1EA7u>] [--priority \u2026] [--tag <@tag>] [--after <TC-\u2026>]
5322
5373
  doc case edit <TC-\u2026> [--case \u2026] [--steps \u2026] [--expected \u2026] [--requirement \u2026] [--priority \u2026] [--tag \u2026]
5323
5374
  doc case rm <TC-\u2026> [--reason <l\xFD do>]
5324
- doc result <TC-\u2026> <${Je.join("|")}> [--actual <k\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF>] [--env <m\xF4i tr\u01B0\u1EDDng>] [--bug <link>]
5375
+ doc result <TC-\u2026> <${et.join("|")}> [--actual <k\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF>] [--env <m\xF4i tr\u01B0\u1EDDng>] [--bug <link>]
5325
5376
  doc list [--json] m\u1EE5c l\u1EE5c: ph\xE2n h\u1EC7 \u2192 k\u1ECBch b\u1EA3n \u2192 s\u1ED1 t\xECnh hu\u1ED1ng / k\u1EBFt qu\u1EA3
5326
5377
  doc check [--json] ki\u1EC3m l\u1ED7i (E01\u2013E04) v\xE0 c\u1EA3nh b\xE1o (T01\u2013T06)
5327
5378
  doc summary [--json] t\u1ED5ng h\u1EE3p k\u1EBFt qu\u1EA3 theo ph\xE2n h\u1EC7 + \u0111\u1ED9 ph\u1EE7 ch\u1EE9c n\u0103ng BA
5379
+ doc bundle g\xF3i b\xE0n giao (JSON) cho \xABpan test publish\xBB \u2014 ph\xE1t h\xE0nh l\xEAn Pan Studio
5328
5380
  doc import <t\u1EC7p.feature | th\u01B0 m\u1EE5c> --module <PH> nh\u1EADp k\u1ECBch b\u1EA3n Gherkin (pan-test); nh\u1EADp l\u1EA1i th\xEC c\u1EADp nh\u1EADt theo tag
5329
5381
  doc results <results.json | th\u01B0 m\u1EE5c b\xE1o c\xE1o> [--env <m\xF4i tr\u01B0\u1EDDng>] ghi k\u1EBFt qu\u1EA3 l\u1EA7n ch\u1EA1y t\u1EF1 \u0111\u1ED9ng theo tag
5330
5382
  doc export [--format docx,html] [--results] [--codes] [--out <th\u01B0 m\u1EE5c>]
5331
5383
  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
5332
5384
  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
5333
5385
 
5334
- 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)`,CA=`pan-test doc \u2014 test case documents
5386
+ 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
5335
5387
 
5336
5388
  doc init [dir] --title <name> [--ba <BA repo path>] [--lang vi|en]
5337
5389
  doc module add <MOD> --title <name>
@@ -5341,28 +5393,28 @@ th,td{border:1px solid #555;padding:4px 6px;vertical-align:top;text-align:left;o
5341
5393
  [--requirement <requirement>] [--priority \u2026] [--tag <@tag>] [--after <TC-\u2026>]
5342
5394
  doc case edit <TC-\u2026> [--case \u2026] [--steps \u2026] [--expected \u2026] [--requirement \u2026] [--priority \u2026] [--tag \u2026]
5343
5395
  doc case rm <TC-\u2026> [--reason <reason>]
5344
- doc result <TC-\u2026> <${Je.join("|")}> [--actual <actual result>] [--env <environment>] [--bug <link>]
5396
+ doc result <TC-\u2026> <${et.join("|")}> [--actual <actual result>] [--env <environment>] [--bug <link>]
5345
5397
  doc import <file.feature | dir> --module <MOD> import Gherkin scenarios (pan-test); re-import updates by tag
5346
5398
  doc results <results.json | report dir> [--env <environment>] record an automated run by tag
5347
5399
  doc export [--format docx,html] [--results] [--codes] [--out <dir>]
5348
- doc list [--json] \xB7 doc check [--json] \xB7 doc summary [--json]
5400
+ doc list [--json] \xB7 doc check [--json] \xB7 doc summary [--json] \xB7 doc bundle (JSON for \xABpan test publish\xBB)
5349
5401
  doc ui [--port <n>] [--no-open] [--json] [--lang vi|en] open the test document app
5350
5402
 
5351
- Common: --dir <repo> (default: current folder, searching up to .pantest.yaml)`,qg=()=>j(SA,CA);function EA(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,Yr=e=>W(e)?.split(",").map(t=>t.trim()).filter(Boolean),me=e=>W(e)?.replace(/\\n/g,`
5352
- `);function $c(e){let t=W(e);if(t!==void 0){if(!pn.includes(t))throw new K(`--priority ph\u1EA3i l\xE0 ${pn.join(" | ")}.`);return t}}function dt(e){let t=W(e.dir)??process.cwd(),n=ts(t);if(!n)throw new K(j(`Kh\xF4ng th\u1EA5y repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (.pantest.yaml) t\u1EEB ${Ct.resolve(t)}. T\u1EA1o b\u1EB1ng: pan-test doc init`,`No test document repo (.pantest.yaml) found from ${Ct.resolve(t)}. Create one with: pan-test doc init`));let r=Ke(n);return dn(r.config.language),r}var AA={"not-run":"Ch\u01B0a test",passed:"\u0110\u1EA1t",failed:"Kh\xF4ng \u0111\u1EA1t",blocked:"B\u1ECB ch\u1EB7n",skipped:"B\u1ECF qua"};function Hg(e){return j(`${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 Ug(e){let{pos:t,opt:n}=EA(e);typeof n.lang=="string"?dn(n.lang,{pin:!0}):process.env.PANAUTO_LANG&&dn(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(qg()),r?0:1;case"ui":{let{createDocServer:c}=await Promise.resolve().then(()=>(Fg(),$g)),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,h)=>{u.once("error",h),u.listen(d,"127.0.0.1",()=>f())});let m=`http://127.0.0.1:${u.address().port}/`;if(console.log(a?JSON.stringify({event:"listening",url:m,root:u.root}):`Pan Test \u2014 t\xE0i li\u1EC7u ki\u1EC3m th\u1EED: ${m}
5403
+ 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,`
5404
+ `);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}
5353
5405
  repo: ${u.root}
5354
- Ctrl+C \u0111\u1EC3 d\u1EEBng.`),n["no-open"]!==!0&&!a){let{spawn:f}=await import("node:child_process"),h=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",g=process.platform==="win32"?["/c","start","",m]:[m];try{f(h,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=Ct.resolve(i??W(n.dir)??"."),l=W(n.title)??Ct.basename(c),u=(W(n.lang)??process.env.PANAUTO_LANG)==="en"?"en":"vi",d=gt(sa.existsSync(c)?c:process.cwd()),p=Uu(c,{title:l,language:u,...W(n.ba)?{ba:W(n.ba)}:{},me:{id:d,name:d}});return o(p,j(`\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})`:""}.
5406
+ 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})`:""}.
5355
5407
  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})`:""}.
5356
- 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=dt(n),l=as(c,s,W(n.title)??s);return o(l,j(`\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=dt(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=$c(n.priority),d=ls(c,{module:i,title:W(n.title)??"",...l?{kind:l}:{},...Yr(n.covers)?{covers:Yr(n.covers)}:{},...Yr(n.uc)?{useCases:Yr(n.uc)}:{},...u?{priority:u}:{},...me(n.preconditions)?{preconditions:me(n.preconditions)}:{},...W(n.after)?{after:W(n.after)}:{},avoid:Bt(c.root)});return o(d,j(`\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=dt(n);if(i==="add"&&s){let l=$c(n.priority),u=cs(c,s,{case:me(n.case)??"",...me(n.steps)?{steps:me(n.steps)}:{},...me(n.expected)?{expected:me(n.expected)}:{},...me(n.requirement)?{requirement:me(n.requirement)}:{},...l?{priority:l}:{},...W(n.tag)?{tag:W(n.tag)}:{}},{...W(n.after)?{after:W(n.after)}:{},avoid:Bt(c.root)});return o(u,j(`\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=$c(n.priority),u=ps(c,s,{...me(n.case)!==void 0?{case:me(n.case)}:{},...me(n.steps)!==void 0?{steps:me(n.steps)}:{},...me(n.expected)!==void 0?{expected:me(n.expected)}:{},...me(n.requirement)!==void 0?{requirement:me(n.requirement)}:{},...l?{priority:l}:{},...W(n.tag)!==void 0?{tag:W(n.tag)}:{}});return o(u,j(`\u2713 \u0110\xE3 s\u1EEDa t\xECnh hu\u1ED1ng ${u.code}`,`\u2713 Updated test case ${u.code}`)),0}if(i==="rm"&&s){let l=us(c,s,W(n.reason)??"");return o(l,j(`\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> <${Je.join("|")}>`);let c=dt(n),l=hs(c,i,{status:s,...me(n.actual)?{actual:me(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}: ${j(AA[l.result?.status??"not-run"],l.result?.status??"not-run")}`),0}case"export":{let{exportDoc:c,FORMATS:l}=await Promise.resolve().then(()=>(na(),gg)),u=dt(n),d=Yr(n.format)??["docx"];if(d.filter(f=>!l.includes(f)).length)throw new K(`--format ch\u1EC9 nh\u1EADn ${l.join(", ")}.`);let m=await c(u,{formats:d,results:n.results===!0,codes:n.codes===!0,...W(n.out)?{out:W(n.out)}:{}});return o({files:m},m.map(f=>`\u2713 ${f}`).join(`
5357
- `)),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(()=>(Xr(),Rc)),u=dt(n),d=Ct.resolve(i);if(!sa.existsSync(d))throw new K(`Kh\xF4ng th\u1EA5y ${d}.`);let p=sa.statSync(d).isDirectory()?c(d):[d];if(!p.length)throw new K(`Kh\xF4ng c\xF3 t\u1EC7p .feature n\xE0o trong ${d}.`);let m=Bt(u.root),f=p.map(h=>({file:h,...l(u,sa.readFileSync(h,"utf8"),{file:Ct.relative(u.root,h).split(Ct.sep).join("/"),module:W(n.module),avoid:m})}));return o(f,f.map(h=>`\u2713 ${Ct.relative(process.cwd(),h.file)} \u2192 ${h.suite}${h.created?" (m\u1EDBi)":""}: th\xEAm ${h.added.length}, c\u1EADp nh\u1EADt ${h.updated.length}${h.missing.length?`, ${h.missing.length} t\xECnh hu\u1ED1ng kh\xF4ng c\xF2n trong t\u1EC7p (gi\u1EEF nguy\xEAn, xem l\u1EA1i)`:""}${h.untagged?`, ${h.untagged} k\u1ECBch b\u1EA3n kh\xF4ng c\xF3 tag \u0111\u1ECBnh danh (kh\u1EDBp theo t\xEAn)`:""}`).join(`
5358
- `)),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(()=>(Xr(),Rc)),u=dt(n),d=c(u,l(Ct.resolve(i)),{...W(n.env)?{env:W(n.env)}:{}}),p=m=>d.applied.filter(f=>f.status===m).length;return o(d,j(`\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?`
5408
+ 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(`
5409
+ `)),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(`
5410
+ `)),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?`
5359
5411
  ${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?`
5360
- 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=dt(n),l=c.modules.map(d=>({code:d.code,title:d.title,suites:Zt(c,d.code).map(p=>({code:p.code,title:p.title,kind:p.kind,cases:p.cases.filter(m=>!m.deleted).map(m=>({code:m.code,case:m.case,status:m.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((m,f)=>{let h=m.cases.filter(g=>g.status==="passed").length;u.push(` ${p+1}.${f+1} ${m.code} \xB7 ${m.title} [${h}/${m.cases.length} ${j("\u0111\u1EA1t","passed")}]`)})}),o(l,u.join(`
5361
- `)),0}case"check":{let c=dt(n),l=ft(c.root,c.config.ba),u=ms(c,l?Qt(l):null),d=u.filter(f=>f.severity==="error").length,p=u.filter(f=>f.severity==="warn").length,m=u.length?u.map(f=>`${f.severity==="error"?"\u2717":f.severity==="warn"?"!":"i"} ${f.rule} ${f.message}${f.file?` (${f.file})`:""}`).join(`
5412
+ 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(`
5413
+ `)),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(`
5362
5414
  `)+`
5363
5415
 
5364
- ${j(`${d} l\u1ED7i \xB7 ${p} c\u1EA3nh b\xE1o`,`${d} error(s) \xB7 ${p} warning(s)`)}`:j("\u2713 Kh\xF4ng c\xF3 l\u1ED7i.","\u2713 No errors.");return o({errors:d,warnings:p,findings:u},(c.config.ba&&!l?`! Kh\xF4ng th\u1EA5y repo BA \xAB${c.config.ba}\xBB \u2014 b\u1ECF qua ki\u1EC3m tham chi\u1EBFu.
5365
- `:"")+m),d?2:0}case"summary":{let c=dt(n),l=ft(c.root,c.config.ba),u=fs(c,l?Qt(l):null),d=[`${j("T\u1ED5ng","Total")}: ${Hg(u.all)}`,...u.modules.map(p=>` ${p.code} \xB7 ${p.title}: ${p.suites} ${j("k\u1ECBch b\u1EA3n","suite(s)")} \xB7 ${Hg(p.count)}`)];return u.coverage&&d.push(`${j("\u0110\u1ED9 ph\u1EE7 ch\u1EE9c n\u0103ng BA","BA function coverage")}: ${u.coverage.covered}/${u.coverage.functions}`),o(u,d.join(`
5416
+ ${U(`${d} l\u1ED7i \xB7 ${p} c\u1EA3nh b\xE1o`,`${d} error(s) \xB7 ${p} warning(s)`)}`:U("\u2713 Kh\xF4ng c\xF3 l\u1ED7i.","\u2713 No errors.");return o({errors:d,warnings:p,findings:u},(c.config.ba&&!l?`! Kh\xF4ng th\u1EA5y repo BA \xAB${c.config.ba}\xBB \u2014 b\u1ECF qua ki\u1EC3m tham chi\u1EBFu.
5417
+ `:"")+h),d?2:0}case"bundle":{let{buildBundle:c}=await Promise.resolve().then(()=>(Xg(),Vg)),l=Ze(n);return console.log(JSON.stringify({root:l.root,...c(l)})),0}case"summary":{let c=Ze(n),l=Ve(c.root,c.config.ba),u=Pn(c,l?bt(l):null),d=[`${U("T\u1ED5ng","Total")}: ${Jg(u.all)}`,...u.modules.map(p=>` ${p.code} \xB7 ${p.title}: ${p.suites} ${U("k\u1ECBch b\u1EA3n","suite(s)")} \xB7 ${Jg(p.count)}`)];return u.coverage&&d.push(`${U("\u0110\u1ED9 ph\u1EE7 ch\u1EE9c n\u0103ng BA","BA function coverage")}: ${u.coverage.covered}/${u.coverage.functions}`),o(u,d.join(`
5366
5418
  `)),0}default:throw new K(`Kh\xF4ng c\xF3 l\u1EC7nh \xABdoc ${r}\xBB.
5367
5419
 
5368
- ${qg()}`)}}catch(c){if(c instanceof K)return console.error(`\u2717 ${c.message}`),1;throw c}}Ug(process.argv.slice(2)).then(e=>process.exit(e)).catch(e=>{console.error(e),process.exit(1)});
5420
+ ${Yg()}`)}}catch(c){if(c instanceof K)return console.error(`\u2717 ${c.message}`),1;throw c}}Qg(process.argv.slice(2)).then(e=>process.exit(e)).catch(e=>{console.error(e),process.exit(1)});