n8n-nodes-adeu 3.0.5 → 3.0.6

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.
@@ -82,7 +82,7 @@ ${l}`:l);}else s=[...r];let o=s.length;return {pages:s.map((l,u)=>({page:u+1,tot
82
82
  ${u}`,l++;else break}e.push([a,i]),t=l;}return e}g(Nl,"_merge_footnote_sections");function kl(n){if(!n.length)return [[""],[0]];let e=[],t=[],r=[],i=0,s=-1,o=g(()=>{r.length>0&&(e.push(r.join(`
83
83
 
84
84
  `)),t.push(s)),r=[],i=0,s=-1;},"flush_current");for(let[a,l,u]of n){let c=a.length,d=c+(r.length>0?2:0);if(r.length>0&&i+d>Qr&&o(),r.length===0&&c>Qr){e.push(a),t.push(l);continue}r.length===0&&(s=l),r.push(a),i+=i>0?d:c,u&&o();}return o(),e.length?[e,t]:[[""],[0]]}g(kl,"_assemble_pages");function Zr(n){let e=[...n.matchAll(vl)];return new Set(e.map(r=>r[1])).size}g(Zr,"_count_tracked_changes");var El=5,Kr=50;function Al(n,e,t,r){let i=r.length;if(i<2)throw new Error(`format_ambiguity_error requires at least 2 matches, got ${i}`);let s=r.slice(0,El),o=i-s.length,a=[`- Edit ${n} Failed: Ambiguous match. Target text appears ${i} times. First ${s.length} occurrences:`];for(let l=0;l<s.length;l++){let[u,c]=s[l],d=Math.max(0,u-Kr),f=Math.min(t.length,c+Kr),h=t.substring(d,u).replace(/\n/g," "),m=t.substring(c,f).replace(/\n/g," "),p=t.substring(u,c).replace(/\n/g," ");p.length>50&&(p=p.substring(0,25)+"..."+p.substring(p.length-20));let _=d>0?"...":"",w=f<t.length?"...":"";a.push(` ${l+1}. "${_}${h}[${p}]${m}${w}"`);}return o>0&&a.push(` ... and ${o} more occurrence(s) not shown.`),a.push(" To resolve, re-send this edit using ONE of these strategies:"),a.push(' 1. RECOMMENDED: Provide more surrounding context in your target_text to uniquely identify a single location (keep the default "match_mode": "strict").'),a.push(` 2. Set "match_mode": "all" to modify ALL ${i} occurrences \u2014 only after verifying from the occurrence list above that EVERY occurrence should change.`),a.push(' 3. Set "match_mode": "first" to modify only the FIRST occurrence \u2014 only after verifying the first occurrence above is the one you intend to change.'),a.join(`
85
- `)}g(Al,"format_ambiguity_error");var Cl="3.0.5";function ee(n,e){let t=[],r=n.getElementsByTagName("*");for(let i=0;i<r.length;i++){let s=r[i].tagName;(s===e||s.endsWith(":"+e))&&t.push(r[i]);}return t}g(ee,"findDescendantsByLocalName");function Pl(n){let e=0;function t(o,a){let l=o?o.toString():"",u=a?a.toString():"";return l===u}g(t,"areRunsIdentical");function r(o){let a=["w:t","w:tab","w:br","w:cr","w:delText","w:rPr"];for(let l=0;l<o.childNodes.length;l++){let u=o.childNodes[l];if(u.nodeType===1){let c=u.tagName;if(!a.includes(c))return true}}return false}g(r,"hasSpecialContent");function i(o){let a=Array.from(o.childNodes).filter(u=>u.nodeType===1),l=0;for(;l<a.length-1;){let u=a[l],c=a[l+1];if(u.tagName==="w:r"&&c.tagName==="w:r"&&!r(u)&&!r(c)){let d=O(u,"w:rPr"),f=O(c,"w:rPr");if(t(d,f)){let h=null;for(let p=0;p<u.childNodes.length;p++){let _=u.childNodes[p];_.nodeType===1&&(_.tagName==="w:t"||_.tagName==="w:delText")&&(h=_);}let m=Array.from(c.childNodes).filter(p=>p.nodeType===1);for(let p of m)if(p.tagName!=="w:rPr")if((p.tagName==="w:t"||p.tagName==="w:delText")&&h&&h.tagName===p.tagName){let _=h.textContent||"",w=p.textContent||"",v=_+w;h.textContent=v,v.trim()!==v&&h.setAttribute("xml:space","preserve");}else u.appendChild(p),(p.tagName==="w:t"||p.tagName==="w:delText")&&(h=p);o.removeChild(c),a.splice(l+1,1),e++;continue}}["w:ins","w:del","w:hyperlink","w:sdt","w:smartTag","w:fldSimple","w:sdtContent"].includes(u.tagName)&&i(u),l++;}if(a.length>0){let u=a[a.length-1];["w:ins","w:del","w:hyperlink","w:sdt","w:smartTag","w:fldSimple","w:sdtContent"].includes(u.tagName)&&i(u);}}g(i,"coalesceContainer");let s=R(n.element,"w:p");for(let o of s)i(o);return e?[`Adjacent identical runs coalesced: ${e}`]:[]}g(Pl,"coalesce_runs");function Tl(n){let e=0,t=["w:rsidR","w:rsidRPr","w:rsidRDefault","w:rsidP","w:rsidDel","w:rsidSect","w:rsidTr"],r=n.element.getElementsByTagName("*");for(let s=0;s<r.length;s++)for(let o of t)r[s].hasAttribute(o)&&(r[s].removeAttribute(o),e++);let i=R(n.element,"w:rsids");for(let s of i)s.parentNode&&(s.parentNode.removeChild(s),e++);return e?[`rsid attributes: ${e} removed`]:[]}g(Tl,"strip_rsid");function $l(n){let e=0,t=["w14:paraId","w14:textId"],r=n.element.getElementsByTagName("*");for(let i=0;i<r.length;i++)for(let s of t)r[i].hasAttribute(s)&&(r[i].removeAttribute(s),e++);return e?[`Paragraph/text IDs: ${e} removed`]:[]}g($l,"strip_para_ids");function Sl(n){let e=R(n.element,"w:proofErr");return e.forEach(t=>t.parentNode?.removeChild(t)),e.length?[`Spell check markers: ${e.length} removed`]:[]}g(Sl,"strip_proof_errors");function Il(n){let e=0;for(let t of ["w:rPr","w:pPr"]){let r=R(n.element,t);for(let i of r)(i.childNodes.length===0||i.childNodes.length===1&&i.childNodes[0].nodeType===3&&!i.childNodes[0].textContent?.trim())&&(i.parentNode?.removeChild(i),e++);}return e?[`Empty property elements: ${e} removed`]:[]}g(Il,"strip_empty_properties");function Ol(n){let e=0,t=R(n.element,"w:rPr");for(let r of t)if(O(r,"w:vanish")||O(r,"w:webHidden")){let i=r.parentNode;i&&i.tagName==="w:r"&&i.parentNode&&(i.parentNode.removeChild(i),e++);}return e?[`Hidden text runs: ${e} removed`]:[]}g(Ol,"strip_hidden_text");function ei(n){let e=R(n.element,"w:ins").length,t=R(n.element,"w:del").length,r=R(n.element,"w:rPrChange").length+R(n.element,"w:pPrChange").length+R(n.element,"w:sectPrChange").length;return [e,t,r]}g(ei,"count_tracked_changes");function Dl(n){let e=new Set;for(let t of ["w:ins","w:del","w:rPrChange","w:pPrChange","w:sectPrChange"])for(let r of R(n.element,t)){let i=r.getAttribute("w:author");i&&e.add(i);}return e}g(Dl,"get_track_change_authors");function ti(n){let e=[],t=R(n,"w:t");for(let i of t)i.textContent&&e.push(i.textContent);let r=R(n,"w:delText");for(let i of r)i.textContent&&e.push(i.textContent);return e.join("")}g(ti,"_getElementText");function Be(n,e=60){let t=n.replace(/\n/g," ").trim();return t.length<=e?t:t.substring(0,e-3)+"..."}g(Be,"_truncate");function ni(n){let e=n.parentNode;if(e&&e.tagName==="w:rPr"){let t=e.parentNode;if(t&&t.tagName==="w:pPr")return "(paragraph mark)"}return e&&e.tagName==="w:trPr"?"(table row)":"(no visible text)"}g(ni,"_describe_textless_revision");function Rl(n){let e=[],t=R(n.element,"w:ins"),r=R(n.element,"w:del");for(let o of t){let a=ti(o).trim();a?e.push(` Accepted insertion: "${Be(a,60)}"`):e.push(` Accepted insertion: ${ni(o)}`);}for(let o of r){let a=ti(o).trim();a?e.push(` Accepted deletion of: "${Be(a,60)}"`):e.push(` Accepted deletion of: ${ni(o)}`);}new fn(n).accept_all_revisions();for(let o of ["w:rPrChange","w:pPrChange","w:sectPrChange"])for(let a of R(n.element,o))a.parentNode?.removeChild(a);let s=t.length+r.length;return s?[`Tracked changes auto-accepted: ${s}`].concat(e):[]}g(Rl,"accept_all_tracked_changes");function jt(n){let e=Me(n.pkg),t=[],r=0,i=0;for(let[s,o]of Object.entries(e))o.resolved?i++:r++,t.push({id:s,...o});return {total:t.length,open:r,resolved:i,comments:t}}g(jt,"get_comments_summary");function Ml(n){let e=Me(n.pkg),t=Object.keys(e);if(t.length===0)return [];let r=[],i=new Et(n);for(let[l,u]of Object.entries(e)){let c=u.resolved?"[Resolved]":"[Open]";r.push(` ${c} "${Be(u.text||"",60)}" (${u.author||"Unknown"})`),i.deleteComment(l);}for(let l of ["w:commentRangeStart","w:commentRangeEnd"])for(let u of R(n.element,l))u.parentNode?.removeChild(u);let s=R(n.element,"w:commentReference");for(let l of s){let u=l.parentNode;u&&((u.tagName==="w:r"||u.tagName.endsWith(":r"))&&Array.from(u.childNodes).filter(d=>d.nodeType===1&&d.tagName!=="w:rPr"&&d.tagName!=="rPr").length<=1?u.parentNode?.removeChild(u):u.removeChild(l));}let o=Object.values(e).filter(l=>l.resolved).length,a=Object.values(e).filter(l=>!l.resolved).length;return [`Comments removed: ${t.length} (${o} resolved, ${a} open)`].concat(r)}g(Ml,"remove_all_comments");function jl(n){let e=n.pkg,t=new Set;for(let i of e.parts)if(i.partname.toLowerCase().includes("comments")){t.add(i.partname);let s=i.partname.startsWith("/")?i.partname:"/"+i.partname,o=i.partname.startsWith("/")?i.partname.substring(1):i.partname;t.add(s),t.add(o);}if(t.size===0)return;for(let i of e.parts)if(i.partname.endsWith(".rels")){let s=R(i._element,"Relationship"),o=[];for(let a of s)if((a.getAttribute("Target")||"").toLowerCase().includes("comments")){o.push(a);let u=i.partname.replace("/_rels/","/").replace(".rels",""),c=e.getPartByPath(u);if(c){let d=a.getAttribute("Id");d&&c.rels.delete(d);}}for(let a of o)a.parentNode?.removeChild(a);}let r=e.getPartByPath("[Content_Types].xml");if(r){let i=R(r._element,"Override"),s=[];for(let o of i){let a=o.getAttribute("PartName")||"";(t.has(a)||a.toLowerCase().includes("comments"))&&s.push(o);}for(let o of s)o.parentNode?.removeChild(o);}e.parts=e.parts.filter(i=>!i.partname.toLowerCase().includes("comments"));for(let i of Object.keys(e.unzipped))i.toLowerCase().includes("comments")&&delete e.unzipped[i];}g(jl,"eject_comment_parts");function Bl(n,e){let t=new Et(n);if(!t.commentsPart)return [];let r=new Set,i=R(t.commentsPart._element,"w:comment");for(let s of i){let o=s.getAttribute("w:author");if(o&&(r.add(o),s.setAttribute("w:author",e)),s.hasAttribute("w:initials")){let a=e.split(" ").filter(Boolean).map(l=>l[0]).join("").toUpperCase();s.setAttribute("w:initials",a);}}return r.size?[`Comment authors replaced: ${Array.from(r).sort().join(", ")} \u2192 "${e}"`]:[]}g(Bl,"replace_comment_authors");function Fl(n,e){let t=new Set;for(let r of ["w:ins","w:del","w:rPrChange","w:pPrChange"])for(let i of R(n.element,r)){let s=i.getAttribute("w:author");s&&(t.add(s),i.setAttribute("w:author",e));}return t.size?[`Track change authors replaced: ${Array.from(t).sort().join(", ")} \u2192 "${e}"`]:[]}g(Fl,"replace_change_authors");function Ll(n){let e=0,t="2025-01-01T00:00:00Z";for(let r of ["w:ins","w:del","w:rPrChange","w:pPrChange"])for(let i of R(n.element,r))i.hasAttribute("w:date")&&(i.setAttribute("w:date",t),e++);return e?[`Track change timestamps: ${e} normalized`]:[]}g(Ll,"normalize_change_dates");function Wl(n){let e=0,t="2025-01-01T00:00:00Z";for(let r of n.pkg.parts)if(r.contentType.includes("comments")){for(let i of R(r._element,"w:comment"))i.hasAttribute("w:date")&&(i.setAttribute("w:date",t),e++);for(let i of R(r._element,"w16cex:commentExtensible"))i.hasAttribute("w16cex:dateUtc")&&(i.setAttribute("w16cex:dateUtc",t),e++);}return e?[`Comment timestamps: ${e} normalized`]:[]}g(Wl,"normalize_comment_dates");function zl(n){let e=[],t=n.pkg.getPartByPath("docProps/core.xml");if(t){ee(t._element,"creator").forEach(u=>{u.textContent&&(e.push(`Author: ${u.textContent}`),u.textContent="");}),ee(t._element,"lastModifiedBy").forEach(u=>{u.textContent&&(e.push(`Last modified by: ${u.textContent}`),u.textContent="");}),ee(t._element,"title").forEach(u=>{u.textContent&&e.push(`Title kept (review manually): "${u.textContent}"`);});let a=[["category","Category"],["keywords","Keywords"],["subject","Subject"],["contentStatus","Content status"],["description","Description/comments"],["identifier","Identifier"],["language","Language"],["version","Version"]];for(let[u,c]of a)ee(t._element,u).forEach(d=>{d.textContent&&(e.push(`${c}: ${d.textContent}`),d.textContent="");});ee(t._element,"revision").forEach(u=>{u.textContent&&parseInt(u.textContent)>1&&(e.push(`Revision count: ${u.textContent} \u2192 1`),u.textContent="1");});}let r=n.pkg.getPartByPath("docProps/app.xml");if(r){let i=r._element,s=["TotalTime","Words","Characters","Paragraphs","Lines","CharactersWithSpaces"];for(let a of s)ee(i,a).forEach(l=>{l.textContent&&l.textContent!=="0"&&(a==="TotalTime"&&e.push(`Total editing time: ${l.textContent} minutes`),l.textContent="0");});let o=["Template","Manager","Company"];for(let a of o)ee(i,a).forEach(l=>{l.textContent&&(e.push(`${a}: ${l.textContent}`),l.textContent="");});}return e.length?["Metadata scrubbed:",...e.map(i=>` ${i}`)]:[]}g(zl,"scrub_doc_properties");function Ul(n){let e=false,t="1970-01-01T00:00:00Z",r=n.pkg.getPartByPath("docProps/core.xml");if(r)for(let i of ["created","modified","lastPrinted"])ee(r._element,i).forEach(s=>{s.textContent&&s.textContent!==t&&(s.textContent=t,e=true);});return e?["Timestamps normalized to epoch"]:[]}g(Ul,"scrub_timestamps");function ps(n,e,t){let r=n.pkg,i=g(o=>o.startsWith("/")?o.substring(1):o,"normalized");for(let o of r.parts){if(!o.partname.endsWith(".rels"))continue;let a=[];for(let l of R(o._element,"Relationship")){let u=l.getAttribute("Target")||"";if(t(u)){a.push(l);let c=o.partname.replace("/_rels/","/").replace(".rels",""),d=r.getPartByPath(c);if(d){let f=l.getAttribute("Id");f&&d.rels.delete(f);}}}a.forEach(l=>l.parentNode?.removeChild(l));}let s=r.getPartByPath("[Content_Types].xml");if(s){let o=[];for(let a of R(s._element,"Override")){let l=a.getAttribute("PartName")||"";e(i(l))&&o.push(a);}o.forEach(a=>a.parentNode?.removeChild(a));}r.parts=r.parts.filter(o=>!e(i(o.partname)));for(let o of Object.keys(r.unzipped))e(i(o))&&delete r.unzipped[o];}g(ps,"ejectPackageMembers");function Hl(n){let e=g(i=>i.startsWith("customXml/"),"isCustomXml"),t=n.pkg.parts.filter(i=>e(i.partname.startsWith("/")?i.partname.substring(1):i.partname)),r=Object.keys(n.pkg.unzipped).filter(e);if(t.length===0&&r.length===0)return [];ps(n,e,i=>i.includes("customXml"));for(let i of R(n.element,"w:sdtPr"))Zt(i,"w:dataBinding").forEach(s=>i.removeChild(s));return [`Custom XML parts: ${Math.max(t.length,r.length)} removed`]}g(Hl,"strip_custom_xml");var Rn="docProps/custom.xml";function Xl(n){let e=n.pkg.getPartByPath(Rn),t=Object.keys(n.pkg.unzipped).includes(Rn);if(!e&&!t)return [];let r=[];if(e)for(let s of ee(e._element,"property")){let o=s.getAttribute("name")||"(unnamed)",a=(s.textContent||"").trim();r.push(` Custom property removed: ${o} = "${Be(a,60)}"`);}return ps(n,s=>s===Rn,s=>s.includes("docProps/custom.xml")),[`Custom document properties: ${Math.max(r.length,1)} removed (docProps/custom.xml)`].concat(r)}g(Xl,"strip_custom_properties");function ql(n){let e=n.pkg.getPartByPath("word/settings.xml");if(!e)return [];let t=[],r=false;for(let s of ee(e._element,"docVars")){for(let o of Array.from(s.childNodes)){let a=o,l=a.tagName||"";(l==="docVar"||l.endsWith(":docVar"))&&t.push(a.getAttribute("w:name")||a.getAttribute("name")||"(unnamed)");}s.parentNode?.removeChild(s),r=true;}for(let s of ee(e._element,"docVar"))t.push(s.getAttribute("w:name")||s.getAttribute("name")||"(unnamed)"),s.parentNode?.removeChild(s),r=true;if(!r)return [];let i=Array.from(new Set(t)).sort().join(", ")||"(unnamed)";return [`Document variables: ${t.length} removed (${i})`]}g(ql,"strip_document_variables");function Yl(n){let e=0;for(let t of ee(n.element,"docPr")){let r=t.getAttribute("descr");if(r){let i=r.length<10,s=r.includes(".")&&r.length<60;(i||s)&&(t.removeAttribute("descr"),e++);}}return e?[`Image alt text: ${e} auto-generated descriptions removed`]:[]}g(Yl,"strip_image_alt_text");function Gl(n){let e=[],t=new Set;for(let r of n.pkg.parts){let i=String(r.partname),s;if(i.startsWith("/word/header"))s="header";else if(i.startsWith("/word/footer"))s="footer";else if(i==="/word/document.xml")s="body";else continue;let o;try{o=ee(r._element,"textpath");}catch{continue}for(let a of o){let l=(a.getAttribute("string")||"").trim(),u=`${s}${l}`;if(t.has(u))continue;t.add(u);let c=l?`"${Be(l,60)}"`:"(no text)";e.push(`Watermark-like text object in ${s}: ${c} \u2014 NOT removed. It remains in the document package and may render in other applications; review and remove it in Word if it must not reach the counterparty.`);}}return e}g(Gl,"detect_watermarks");function Jl(n){let e=["sharepoint.com","onedrive.com",".internal","intranet","localhost","10.","192.168.","172.16."],t=[],r=n.pkg.getOrCreateRelsPart(n.part.partname);for(let i of R(r._element,"Relationship"))if(i.getAttribute("TargetMode")==="External"){let s=i.getAttribute("Target")||"";for(let o of e)if(s.toLowerCase().includes(o.toLowerCase())){t.push(`Hyperlink targets internal URL: ${Be(s,80)}`);break}}return t}g(Jl,"audit_hyperlinks");var Ql="word/settings.xml",Vl=new Set(["readOnly","forms","comments","trackedChanges"]),Zl={readOnly:"read-only",forms:"fill-in-forms",comments:"comments-only",trackedChanges:"tracked-changes-only"},yt=Object.freeze({edit:null,enforced:false});function an(n){return n.edit!==null&&n.enforced}g(an,"isProtectionActive");function cr(n){return n.edit===null?"unprotected":`${Zl[n.edit]??n.edit}, ${n.enforced?"enforced":"not enforced"}`}g(cr,"describeProtection");function Kl(n){return n==null?true:!["0","false","off"].includes(n.toLowerCase())}g(Kl,"isTruthy");function _s(n){let e=null;try{let s=n?.pkg?.getPartByPath?.(Ql);if(!s?._element)return yt;e=ee(s._element,"documentProtection")[0]??null;}catch{return yt}if(!e)return yt;let t=null,r=null,i=e.attributes;if(i)for(let s=0;s<i.length;s++){let o=i[s],a=(o.name??"").split(":").pop()??"";a==="edit"?t=o.value:a==="enforcement"&&(r=o.value);}return t===null||!Vl.has(t)?yt:{edit:t,enforced:Kl(r)}}g(_s,"readDocumentProtection");var ln="ignore_control_locks",bt="ignore_document_protection",ur="allow_untracked_writes",Ge=Object.freeze({ignore_control_locks:false,ignore_document_protection:false,allow_untracked_writes:false});function ec(n){return n.ignore_control_locks||n.ignore_document_protection||n.allow_untracked_writes}g(ec,"anyOverrideUsed");function he(n){let e=[`CC:${n.ordinal}`];return n.alias&&e.push(`"${n.alias}"`),n.tag&&e.push(`(tag: ${n.tag})`),e.join(" ")}g(he,"describeControl");function fe(n,e){let t=`- Edit ${n} Failed: ${e.subject} ${e.rule} ${tc(e.alternative)}`;return e.override&&(t+=` Pass ${e.override}=true to override deliberately.`),t.split(/\s+/).join(" ")}g(fe,"gateError");function tc(n){let e=n.replace(/\s+$/,"");return /[.!?:]$/.test(e)?e:`${e}.`}g(tc,"endSentence");function nc(n){return n.find(e=>e.contentLocked)??null}g(nc,"lockedAncestor");function rc(n,e,t=Ge){if(t.ignore_control_locks)return null;let r=nc(e);return r?fe(n,{subject:`edit targets content inside ${he(r)}, which is content-locked (sdtContentLocked).`,rule:"Word refuses edits inside locked controls, so this edit would silently fail to appear in the document.",alternative:"Remove the lock in Word (Developer -> Properties)",override:ln}):null}g(rc,"checkContentLock");function ic(n,e,t=Ge){if(t.ignore_control_locks)return null;let r=e.find(i=>i.cls==="group");return !r||e.some(i=>i.cls!=="group")?null:fe(n,{subject:`edit targets text inside ${he(r)}, which is a group (a locked region).`,rule:"Word treats a group's own text as fixed boilerplate and only permits edits to the fields nested inside it.",alternative:"Target one of the nested controls instead",override:ln})}g(ic,"checkGroupRegion");function sc(n,e,t,r=Ge){if(r.ignore_control_locks||!t)return null;let i=e.find(s=>s.deleteLocked);return i?fe(n,{subject:`edit would remove ${he(i)} itself, which is delete-locked (sdtLocked).`,rule:"Word refuses to delete a locked control, and hoisting its content out would dissolve the wrapper.",alternative:"Delete the control's CONTENT instead (the wrapper stays, leaving an empty field)",override:ln}):null}g(sc,"checkDeleteLock");function oc(n,e,t={}){let r=t.overrides??Ge;if(!an(e)||r.ignore_document_protection)return null;let i=cr(e);return e.edit==="readOnly"?fe(n,{subject:`the document is protected (${i}).`,rule:"Word blocks every modification while read-only protection is enforced.",alternative:"Remove the restriction in Word (Review -> Restrict Editing -> Stop Protection)",override:bt}):e.edit==="comments"?t.isCommentOnly?null:fe(n,{subject:`the document is protected (${i}).`,rule:"Word permits only comments while comments-only protection is enforced; text mutations are blocked.",alternative:"Attach a comment instead (set new_text equal to target_text and supply comment)",override:bt}):e.edit==="forms"?(t.controls??[]).some(o=>o.cls!=="group")?null:fe(n,{subject:`the document is protected (${i}).`,rule:"Word permits only form-field fills while fill-in-forms protection is enforced; body text outside a content control is locked.",alternative:"Target the content of a form field instead",override:bt}):null}g(oc,"checkProtectionBlocksEdit");function ac(n,e,t,r=Ge){if(!an(t)||r.ignore_document_protection||e!=="accept"&&e!=="reject"||t.edit!=="trackedChanges"&&t.edit!=="readOnly")return null;let i=t.edit==="readOnly"?"Word blocks every modification while read-only protection is enforced.":"Resolving revisions is exactly what this protection forbids, so Word refuses Accept and Reject.";return `- Action ${n} Failed: the document is protected (${cr(t)}). ${i} Remove the restriction in Word (Review -> Restrict Editing -> Stop Protection) or pass ${bt}=true to override deliberately.`}g(ac,"checkProtectionBlocksReview");function lc(n,e,t=Ge){return !an(e)||e.edit!=="forms"||t.allow_untracked_writes?null:fe(n,{subject:`the document is protected (${cr(e)}).`,rule:"Word records fills in a forms-protected document as UNTRACKED changes, so Adeu cannot honour its guarantee that every write is a tracked change.",alternative:"Remove the protection to write tracked changes normally",override:ur})}g(lc,"checkUntrackedWrite");function cc(n,e,t){let r=(e||"").trim();if(!r)return null;for(let i of t){if(!i.showingPlaceholder)continue;let s=(i.placeholderText||"").trim();if(!(!s||!s.includes(r)))return fe(n,{subject:`target_text is the placeholder text of ${he(i)}, which is EMPTY.`,rule:"Placeholder text is a ghost prompt, not content: Word discards it as soon as the field is filled, so an edit to it would be silently lost.",alternative:`Fill the field with set_field, or insert at its empty pair {#cc:${i.ordinal}}{#/cc:${i.ordinal}}`})}return null}g(cc,"checkPlaceholderTarget");var vt=["[ ]","[x]"];function uc(n,e,t,r){let i=e.find(o=>o.cls==="checkbox");if(!i)return null;let s=vt;return s.includes(t.trim())&&s.includes(r.trim())?null:fe(n,{subject:`edit targets ${he(i)}, which is a checkbox.`,rule:"Its [x] / [ ] projection reflects the w14:checked state rather than editable text, so replacing it with other text would leave the checkbox state unchanged.",alternative:"Toggle it by replacing [x] with [ ] (or the reverse), or use set_field"})}g(uc,"checkCheckboxEdit");function dc(n,e){let t=e.find(i=>i.bound);if(!t)return null;let r=t.bindingXpath?` (bound to ${t.bindingXpath})`:"";return fe(n,{subject:`edit targets the content of ${he(t)}, which is data-bound${r}.`,rule:"Its text is a projection of an XML data store, and Word re-reads that store when the document opens, so an edit that skips the store is reverted.",alternative:"Use set_field, which writes the control and its bound store together"})}g(dc,"checkBoundControl");function ri(n,e,t){let r=new Set(e),i=new Set(t);return n.filter(s=>r.has(s)!==i.has(s))}g(ri,"crossedControlWalls");function fc(n,e){if(e.length===0)return null;let t=e.map(he).join(", ");return fe(n,{subject:`edit merges paragraphs across the boundary of ${t}.`,rule:"Content may not be hoisted into or out of a content control by a merge: the wrapper would gain or lose text that was never scoped to it.",alternative:"Split this into two edits, one on each side of the control boundary"})}g(fc,"checkBlockMergeAcrossControl");function hc(n){return `segmented at the boundary of ${n.map(he).join(", ")}: only the text outside the control was changed`}g(hc,"segmentationNote");function pc(n,e){if(!ec(n))return null;let t=[];if(n.ignore_control_locks){let r=e.length>0?` (${e.map(he).join(", ")} edited inside locked controls)`:"";t.push(`${ln}${r}`);}return n.ignore_document_protection&&t.push(bt),n.allow_untracked_writes&&t.push(ur),"Overrides: "+t.join(", ")}g(pc,"overridesNote");function _c(n,e,t=2){if(n===e)return 0;if(Math.abs(n.length-e.length)>t)return t+1;if(n.length===0)return e.length<=t?e.length:t+1;if(e.length===0)return n.length<=t?n.length:t+1;if(n.length>e.length){let i=n;n=e,e=i;}let r=Array.from({length:n.length+1},(i,s)=>s);for(let i=1;i<=e.length;i++){let s=[i],o=i;for(let a=1;a<=n.length;a++){let l=n[a-1]===e[i-1]?0:1,u=Math.min(r[a]+1,s[a-1]+1,r[a-1]+l);s.push(u),u<o&&(o=u);}if(o>t)return t+1;r=s;}return r[n.length]<=t?r[n.length]:t+1}g(_c,"boundedLevenshtein");function mc(n){let e="",t=R(n._element,"w:r");for(let r of t)e+=Te(new Re(r,n));return e}g(mc,"_get_paragraph_text");var dr="[A-Z][A-Za-z0-9\\s\\-&'\u2019]{1,60}",gc=new RegExp(`^(?:[\\d.\\-()a-zA-Z]+\\s*)?["\u201C](${dr})["\u201D]`,"d"),wc=new RegExp(`(?<=[.;:!?])\\s+(?:[\\d.\\-()a-zA-Z]+\\s+)?["\u201C](${dr})["\u201D]`,"dg"),yc=new RegExp(`\\([^)]*?["\u201C](${dr})["\u201D][^)]*?\\)`,"dg");function vc(n){let e=[],t=gc.exec(n);t&&t.indices&&t.indices[1]&&e.push([t.indices[1][0],t[1].trim()]);for(let s of n.matchAll(wc)){let o=s.indices;o&&o[1]&&e.push([o[1][0],s[1].trim()]);}for(let s of n.matchAll(yc)){let o=s.indices;o&&o[1]&&e.push([o[1][0],s[1].trim()]);}let r=[],i=new Set;e.sort((s,o)=>s[0]-o[0]);for(let[s,o]of e)i.has(s)||(i.add(s),r.push(o));return r}g(vc,"extract_terms_from_paragraph");function bc(n,e){let t=Object.create(null),r=new Set,i=Object.create(null),s=[];for(let p of We(n)){if(!(p instanceof ne))continue;let _=mc(p).trim();if(!_)continue;for(let b of vc(_))t[b]?r.add(b):t[b]={count:0};let w=_.length>60?_.substring(0,60)+"...":_,v=R(p._element,"*");for(let b of v){if(b.tagName==="w:bookmarkStart"){let N=b.getAttribute("w:name");N&&(!N.startsWith("_")||N.startsWith("_Ref"))&&(i[N]||(i[N]={anchored_to:w,referenced_from:[]}));}let y=null;if(b.tagName==="w:fldSimple"){let k=(b.getAttribute("w:instr")||"").trim().split(/\s+/);k.length>1&&k[0]==="REF"&&(y=k[1]);}else if(b.tagName==="w:instrText"){let k=(b.textContent||"").trim().split(/\s+/);k.length>1&&k[0]==="REF"&&(y=k[1]);}y&&s.push([y,w]);}}for(let[p,_]of s)i[p]&&i[p].referenced_from.push(_);let o=[],a=Object.keys(t);if(a.length>0){let p=a.sort((b,y)=>y.length-b.length),_=g(b=>b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRegExp"),w=p.map(_).join("|"),v=new RegExp(`(?<!["\u201C])\\b(${w})\\b(?![\u201D"])`,"g");for(let b of e.matchAll(v)){let y=b[1];t[y]&&t[y].count++;}for(let b of a)t[b].count===0&&(delete t[b],r.has(b)||o.push(`[Warning] Unused Definition: '${b}' is defined but never used.`));}for(let p of r)o.push(`[Error] Duplicate Definition: '${p}' is defined multiple times.`);let l=new Set(["The","This","That","Such","A","An","Any","All","Some","No","Every","Each","As","In","Of","For","To","On","By","With"]),u=/\b[A-Z][a-zA-Z]*(?:\s+[A-Z][a-zA-Z]*)*\b/g,c=new Set(e.match(u)||[]),d=new Set(Object.keys(t)),f={};for(let p of d){let _=p[0].toLowerCase();f[_]||(f[_]=[]),f[_].push(p);}let h=Object.create(null);for(let p of c){let _=p.trim(),w=_.split(/\s+/);for(;w.length>0;){let y=w[0],N=y.charAt(0).toUpperCase()+y.slice(1).toLowerCase();if(l.has(N))w.shift();else break}if(_=w.join(" "),_.length<4||d.has(_))continue;let v=_[0].toLowerCase(),b=f[v]||[];if(_.length>5)for(let[y,N]of Object.entries(f))y!==v&&(b=b.concat(N));for(let y of b){if(Math.abs(_.length-y.length)>2||_===y+"s"||_===y+"es"||y===_+"s"||y===_+"es")continue;let N=_c(_,y,2);N===0||N>2||y.length<=5&&(N>1||_[0].toLowerCase()!==y[0].toLowerCase())||(h[y]||(h[y]=[]),h[y].includes(_)||h[y].push(_));}}for(let[p,_]of Object.entries(h)){_.sort();let w=_.map(v=>`'${v}'`).join(", ");o.push(`[Info] Possible Typos for '${p}': Found ${w}`);}function m(p){return p.startsWith("[Error]")?0:p.startsWith("[Warning]")?1:2}return g(m,"diag_sort_key"),o.sort((p,_)=>{let w=m(p),v=m(_);return w!==v?w-v:p.localeCompare(_)}),[t,o,i]}g(bc,"extract_all_domain_metadata");function xc(n){let e=[],t=n.pkg.getPartByPath("word/settings.xml");if(!t)return e;let r=g(o=>{if(!o.hasAttribute("w:val"))return true;let a=(o.getAttribute("w:val")||"").toLowerCase();return a!=="0"&&a!=="false"&&a!=="off"},"isTruthy2"),i=ee(t._element,"removePersonalInformation");i.length>0&&r(i[0])&&e.push("[Warning] Privacy flag `removePersonalInformation` is enabled in word/settings.xml. Microsoft Word will strip the `w:author`, `w:initials`, and `w:date` attributes from every tracked change and comment the next time this document is opened and saved. Edits made by this agent will lose attribution, breaking audit trails and any multi-turn workflow that relies on identifying prior edits.");let s=ee(t._element,"removeDateAndTime");return s.length>0&&r(s[0])&&e.push("[Warning] Privacy flag `removeDateAndTime` is enabled in word/settings.xml. Microsoft Word will strip the `w:date` attribute from every tracked change and comment the next time this document is opened and saved. Timestamps on this agent's edits will be lost on the next Word save."),e}g(xc,"extract_document_settings_warnings");function Nc(n,e){try{let t=Yc(n),r=_s(n);return Qc(t,r,'Read with mode="fields" for the full field ledger.')}catch{return []}}g(Nc,"content_controls_appendix_section");function kc(n,e){let[t,r,i]=bc(n,e),s=xc(n),o=[`
85
+ `)}g(Al,"format_ambiguity_error");var Cl="3.0.6";function ee(n,e){let t=[],r=n.getElementsByTagName("*");for(let i=0;i<r.length;i++){let s=r[i].tagName;(s===e||s.endsWith(":"+e))&&t.push(r[i]);}return t}g(ee,"findDescendantsByLocalName");function Pl(n){let e=0;function t(o,a){let l=o?o.toString():"",u=a?a.toString():"";return l===u}g(t,"areRunsIdentical");function r(o){let a=["w:t","w:tab","w:br","w:cr","w:delText","w:rPr"];for(let l=0;l<o.childNodes.length;l++){let u=o.childNodes[l];if(u.nodeType===1){let c=u.tagName;if(!a.includes(c))return true}}return false}g(r,"hasSpecialContent");function i(o){let a=Array.from(o.childNodes).filter(u=>u.nodeType===1),l=0;for(;l<a.length-1;){let u=a[l],c=a[l+1];if(u.tagName==="w:r"&&c.tagName==="w:r"&&!r(u)&&!r(c)){let d=O(u,"w:rPr"),f=O(c,"w:rPr");if(t(d,f)){let h=null;for(let p=0;p<u.childNodes.length;p++){let _=u.childNodes[p];_.nodeType===1&&(_.tagName==="w:t"||_.tagName==="w:delText")&&(h=_);}let m=Array.from(c.childNodes).filter(p=>p.nodeType===1);for(let p of m)if(p.tagName!=="w:rPr")if((p.tagName==="w:t"||p.tagName==="w:delText")&&h&&h.tagName===p.tagName){let _=h.textContent||"",w=p.textContent||"",v=_+w;h.textContent=v,v.trim()!==v&&h.setAttribute("xml:space","preserve");}else u.appendChild(p),(p.tagName==="w:t"||p.tagName==="w:delText")&&(h=p);o.removeChild(c),a.splice(l+1,1),e++;continue}}["w:ins","w:del","w:hyperlink","w:sdt","w:smartTag","w:fldSimple","w:sdtContent"].includes(u.tagName)&&i(u),l++;}if(a.length>0){let u=a[a.length-1];["w:ins","w:del","w:hyperlink","w:sdt","w:smartTag","w:fldSimple","w:sdtContent"].includes(u.tagName)&&i(u);}}g(i,"coalesceContainer");let s=R(n.element,"w:p");for(let o of s)i(o);return e?[`Adjacent identical runs coalesced: ${e}`]:[]}g(Pl,"coalesce_runs");function Tl(n){let e=0,t=["w:rsidR","w:rsidRPr","w:rsidRDefault","w:rsidP","w:rsidDel","w:rsidSect","w:rsidTr"],r=n.element.getElementsByTagName("*");for(let s=0;s<r.length;s++)for(let o of t)r[s].hasAttribute(o)&&(r[s].removeAttribute(o),e++);let i=R(n.element,"w:rsids");for(let s of i)s.parentNode&&(s.parentNode.removeChild(s),e++);return e?[`rsid attributes: ${e} removed`]:[]}g(Tl,"strip_rsid");function $l(n){let e=0,t=["w14:paraId","w14:textId"],r=n.element.getElementsByTagName("*");for(let i=0;i<r.length;i++)for(let s of t)r[i].hasAttribute(s)&&(r[i].removeAttribute(s),e++);return e?[`Paragraph/text IDs: ${e} removed`]:[]}g($l,"strip_para_ids");function Sl(n){let e=R(n.element,"w:proofErr");return e.forEach(t=>t.parentNode?.removeChild(t)),e.length?[`Spell check markers: ${e.length} removed`]:[]}g(Sl,"strip_proof_errors");function Il(n){let e=0;for(let t of ["w:rPr","w:pPr"]){let r=R(n.element,t);for(let i of r)(i.childNodes.length===0||i.childNodes.length===1&&i.childNodes[0].nodeType===3&&!i.childNodes[0].textContent?.trim())&&(i.parentNode?.removeChild(i),e++);}return e?[`Empty property elements: ${e} removed`]:[]}g(Il,"strip_empty_properties");function Ol(n){let e=0,t=R(n.element,"w:rPr");for(let r of t)if(O(r,"w:vanish")||O(r,"w:webHidden")){let i=r.parentNode;i&&i.tagName==="w:r"&&i.parentNode&&(i.parentNode.removeChild(i),e++);}return e?[`Hidden text runs: ${e} removed`]:[]}g(Ol,"strip_hidden_text");function ei(n){let e=R(n.element,"w:ins").length,t=R(n.element,"w:del").length,r=R(n.element,"w:rPrChange").length+R(n.element,"w:pPrChange").length+R(n.element,"w:sectPrChange").length;return [e,t,r]}g(ei,"count_tracked_changes");function Dl(n){let e=new Set;for(let t of ["w:ins","w:del","w:rPrChange","w:pPrChange","w:sectPrChange"])for(let r of R(n.element,t)){let i=r.getAttribute("w:author");i&&e.add(i);}return e}g(Dl,"get_track_change_authors");function ti(n){let e=[],t=R(n,"w:t");for(let i of t)i.textContent&&e.push(i.textContent);let r=R(n,"w:delText");for(let i of r)i.textContent&&e.push(i.textContent);return e.join("")}g(ti,"_getElementText");function Be(n,e=60){let t=n.replace(/\n/g," ").trim();return t.length<=e?t:t.substring(0,e-3)+"..."}g(Be,"_truncate");function ni(n){let e=n.parentNode;if(e&&e.tagName==="w:rPr"){let t=e.parentNode;if(t&&t.tagName==="w:pPr")return "(paragraph mark)"}return e&&e.tagName==="w:trPr"?"(table row)":"(no visible text)"}g(ni,"_describe_textless_revision");function Rl(n){let e=[],t=R(n.element,"w:ins"),r=R(n.element,"w:del");for(let o of t){let a=ti(o).trim();a?e.push(` Accepted insertion: "${Be(a,60)}"`):e.push(` Accepted insertion: ${ni(o)}`);}for(let o of r){let a=ti(o).trim();a?e.push(` Accepted deletion of: "${Be(a,60)}"`):e.push(` Accepted deletion of: ${ni(o)}`);}new fn(n).accept_all_revisions();for(let o of ["w:rPrChange","w:pPrChange","w:sectPrChange"])for(let a of R(n.element,o))a.parentNode?.removeChild(a);let s=t.length+r.length;return s?[`Tracked changes auto-accepted: ${s}`].concat(e):[]}g(Rl,"accept_all_tracked_changes");function jt(n){let e=Me(n.pkg),t=[],r=0,i=0;for(let[s,o]of Object.entries(e))o.resolved?i++:r++,t.push({id:s,...o});return {total:t.length,open:r,resolved:i,comments:t}}g(jt,"get_comments_summary");function Ml(n){let e=Me(n.pkg),t=Object.keys(e);if(t.length===0)return [];let r=[],i=new Et(n);for(let[l,u]of Object.entries(e)){let c=u.resolved?"[Resolved]":"[Open]";r.push(` ${c} "${Be(u.text||"",60)}" (${u.author||"Unknown"})`),i.deleteComment(l);}for(let l of ["w:commentRangeStart","w:commentRangeEnd"])for(let u of R(n.element,l))u.parentNode?.removeChild(u);let s=R(n.element,"w:commentReference");for(let l of s){let u=l.parentNode;u&&((u.tagName==="w:r"||u.tagName.endsWith(":r"))&&Array.from(u.childNodes).filter(d=>d.nodeType===1&&d.tagName!=="w:rPr"&&d.tagName!=="rPr").length<=1?u.parentNode?.removeChild(u):u.removeChild(l));}let o=Object.values(e).filter(l=>l.resolved).length,a=Object.values(e).filter(l=>!l.resolved).length;return [`Comments removed: ${t.length} (${o} resolved, ${a} open)`].concat(r)}g(Ml,"remove_all_comments");function jl(n){let e=n.pkg,t=new Set;for(let i of e.parts)if(i.partname.toLowerCase().includes("comments")){t.add(i.partname);let s=i.partname.startsWith("/")?i.partname:"/"+i.partname,o=i.partname.startsWith("/")?i.partname.substring(1):i.partname;t.add(s),t.add(o);}if(t.size===0)return;for(let i of e.parts)if(i.partname.endsWith(".rels")){let s=R(i._element,"Relationship"),o=[];for(let a of s)if((a.getAttribute("Target")||"").toLowerCase().includes("comments")){o.push(a);let u=i.partname.replace("/_rels/","/").replace(".rels",""),c=e.getPartByPath(u);if(c){let d=a.getAttribute("Id");d&&c.rels.delete(d);}}for(let a of o)a.parentNode?.removeChild(a);}let r=e.getPartByPath("[Content_Types].xml");if(r){let i=R(r._element,"Override"),s=[];for(let o of i){let a=o.getAttribute("PartName")||"";(t.has(a)||a.toLowerCase().includes("comments"))&&s.push(o);}for(let o of s)o.parentNode?.removeChild(o);}e.parts=e.parts.filter(i=>!i.partname.toLowerCase().includes("comments"));for(let i of Object.keys(e.unzipped))i.toLowerCase().includes("comments")&&delete e.unzipped[i];}g(jl,"eject_comment_parts");function Bl(n,e){let t=new Et(n);if(!t.commentsPart)return [];let r=new Set,i=R(t.commentsPart._element,"w:comment");for(let s of i){let o=s.getAttribute("w:author");if(o&&(r.add(o),s.setAttribute("w:author",e)),s.hasAttribute("w:initials")){let a=e.split(" ").filter(Boolean).map(l=>l[0]).join("").toUpperCase();s.setAttribute("w:initials",a);}}return r.size?[`Comment authors replaced: ${Array.from(r).sort().join(", ")} \u2192 "${e}"`]:[]}g(Bl,"replace_comment_authors");function Fl(n,e){let t=new Set;for(let r of ["w:ins","w:del","w:rPrChange","w:pPrChange"])for(let i of R(n.element,r)){let s=i.getAttribute("w:author");s&&(t.add(s),i.setAttribute("w:author",e));}return t.size?[`Track change authors replaced: ${Array.from(t).sort().join(", ")} \u2192 "${e}"`]:[]}g(Fl,"replace_change_authors");function Ll(n){let e=0,t="2025-01-01T00:00:00Z";for(let r of ["w:ins","w:del","w:rPrChange","w:pPrChange"])for(let i of R(n.element,r))i.hasAttribute("w:date")&&(i.setAttribute("w:date",t),e++);return e?[`Track change timestamps: ${e} normalized`]:[]}g(Ll,"normalize_change_dates");function Wl(n){let e=0,t="2025-01-01T00:00:00Z";for(let r of n.pkg.parts)if(r.contentType.includes("comments")){for(let i of R(r._element,"w:comment"))i.hasAttribute("w:date")&&(i.setAttribute("w:date",t),e++);for(let i of R(r._element,"w16cex:commentExtensible"))i.hasAttribute("w16cex:dateUtc")&&(i.setAttribute("w16cex:dateUtc",t),e++);}return e?[`Comment timestamps: ${e} normalized`]:[]}g(Wl,"normalize_comment_dates");function zl(n){let e=[],t=n.pkg.getPartByPath("docProps/core.xml");if(t){ee(t._element,"creator").forEach(u=>{u.textContent&&(e.push(`Author: ${u.textContent}`),u.textContent="");}),ee(t._element,"lastModifiedBy").forEach(u=>{u.textContent&&(e.push(`Last modified by: ${u.textContent}`),u.textContent="");}),ee(t._element,"title").forEach(u=>{u.textContent&&e.push(`Title kept (review manually): "${u.textContent}"`);});let a=[["category","Category"],["keywords","Keywords"],["subject","Subject"],["contentStatus","Content status"],["description","Description/comments"],["identifier","Identifier"],["language","Language"],["version","Version"]];for(let[u,c]of a)ee(t._element,u).forEach(d=>{d.textContent&&(e.push(`${c}: ${d.textContent}`),d.textContent="");});ee(t._element,"revision").forEach(u=>{u.textContent&&parseInt(u.textContent)>1&&(e.push(`Revision count: ${u.textContent} \u2192 1`),u.textContent="1");});}let r=n.pkg.getPartByPath("docProps/app.xml");if(r){let i=r._element,s=["TotalTime","Words","Characters","Paragraphs","Lines","CharactersWithSpaces"];for(let a of s)ee(i,a).forEach(l=>{l.textContent&&l.textContent!=="0"&&(a==="TotalTime"&&e.push(`Total editing time: ${l.textContent} minutes`),l.textContent="0");});let o=["Template","Manager","Company"];for(let a of o)ee(i,a).forEach(l=>{l.textContent&&(e.push(`${a}: ${l.textContent}`),l.textContent="");});}return e.length?["Metadata scrubbed:",...e.map(i=>` ${i}`)]:[]}g(zl,"scrub_doc_properties");function Ul(n){let e=false,t="1970-01-01T00:00:00Z",r=n.pkg.getPartByPath("docProps/core.xml");if(r)for(let i of ["created","modified","lastPrinted"])ee(r._element,i).forEach(s=>{s.textContent&&s.textContent!==t&&(s.textContent=t,e=true);});return e?["Timestamps normalized to epoch"]:[]}g(Ul,"scrub_timestamps");function ps(n,e,t){let r=n.pkg,i=g(o=>o.startsWith("/")?o.substring(1):o,"normalized");for(let o of r.parts){if(!o.partname.endsWith(".rels"))continue;let a=[];for(let l of R(o._element,"Relationship")){let u=l.getAttribute("Target")||"";if(t(u)){a.push(l);let c=o.partname.replace("/_rels/","/").replace(".rels",""),d=r.getPartByPath(c);if(d){let f=l.getAttribute("Id");f&&d.rels.delete(f);}}}a.forEach(l=>l.parentNode?.removeChild(l));}let s=r.getPartByPath("[Content_Types].xml");if(s){let o=[];for(let a of R(s._element,"Override")){let l=a.getAttribute("PartName")||"";e(i(l))&&o.push(a);}o.forEach(a=>a.parentNode?.removeChild(a));}r.parts=r.parts.filter(o=>!e(i(o.partname)));for(let o of Object.keys(r.unzipped))e(i(o))&&delete r.unzipped[o];}g(ps,"ejectPackageMembers");function Hl(n){let e=g(i=>i.startsWith("customXml/"),"isCustomXml"),t=n.pkg.parts.filter(i=>e(i.partname.startsWith("/")?i.partname.substring(1):i.partname)),r=Object.keys(n.pkg.unzipped).filter(e);if(t.length===0&&r.length===0)return [];ps(n,e,i=>i.includes("customXml"));for(let i of R(n.element,"w:sdtPr"))Zt(i,"w:dataBinding").forEach(s=>i.removeChild(s));return [`Custom XML parts: ${Math.max(t.length,r.length)} removed`]}g(Hl,"strip_custom_xml");var Rn="docProps/custom.xml";function Xl(n){let e=n.pkg.getPartByPath(Rn),t=Object.keys(n.pkg.unzipped).includes(Rn);if(!e&&!t)return [];let r=[];if(e)for(let s of ee(e._element,"property")){let o=s.getAttribute("name")||"(unnamed)",a=(s.textContent||"").trim();r.push(` Custom property removed: ${o} = "${Be(a,60)}"`);}return ps(n,s=>s===Rn,s=>s.includes("docProps/custom.xml")),[`Custom document properties: ${Math.max(r.length,1)} removed (docProps/custom.xml)`].concat(r)}g(Xl,"strip_custom_properties");function ql(n){let e=n.pkg.getPartByPath("word/settings.xml");if(!e)return [];let t=[],r=false;for(let s of ee(e._element,"docVars")){for(let o of Array.from(s.childNodes)){let a=o,l=a.tagName||"";(l==="docVar"||l.endsWith(":docVar"))&&t.push(a.getAttribute("w:name")||a.getAttribute("name")||"(unnamed)");}s.parentNode?.removeChild(s),r=true;}for(let s of ee(e._element,"docVar"))t.push(s.getAttribute("w:name")||s.getAttribute("name")||"(unnamed)"),s.parentNode?.removeChild(s),r=true;if(!r)return [];let i=Array.from(new Set(t)).sort().join(", ")||"(unnamed)";return [`Document variables: ${t.length} removed (${i})`]}g(ql,"strip_document_variables");function Yl(n){let e=0;for(let t of ee(n.element,"docPr")){let r=t.getAttribute("descr");if(r){let i=r.length<10,s=r.includes(".")&&r.length<60;(i||s)&&(t.removeAttribute("descr"),e++);}}return e?[`Image alt text: ${e} auto-generated descriptions removed`]:[]}g(Yl,"strip_image_alt_text");function Gl(n){let e=[],t=new Set;for(let r of n.pkg.parts){let i=String(r.partname),s;if(i.startsWith("/word/header"))s="header";else if(i.startsWith("/word/footer"))s="footer";else if(i==="/word/document.xml")s="body";else continue;let o;try{o=ee(r._element,"textpath");}catch{continue}for(let a of o){let l=(a.getAttribute("string")||"").trim(),u=`${s}${l}`;if(t.has(u))continue;t.add(u);let c=l?`"${Be(l,60)}"`:"(no text)";e.push(`Watermark-like text object in ${s}: ${c} \u2014 NOT removed. It remains in the document package and may render in other applications; review and remove it in Word if it must not reach the counterparty.`);}}return e}g(Gl,"detect_watermarks");function Jl(n){let e=["sharepoint.com","onedrive.com",".internal","intranet","localhost","10.","192.168.","172.16."],t=[],r=n.pkg.getOrCreateRelsPart(n.part.partname);for(let i of R(r._element,"Relationship"))if(i.getAttribute("TargetMode")==="External"){let s=i.getAttribute("Target")||"";for(let o of e)if(s.toLowerCase().includes(o.toLowerCase())){t.push(`Hyperlink targets internal URL: ${Be(s,80)}`);break}}return t}g(Jl,"audit_hyperlinks");var Ql="word/settings.xml",Vl=new Set(["readOnly","forms","comments","trackedChanges"]),Zl={readOnly:"read-only",forms:"fill-in-forms",comments:"comments-only",trackedChanges:"tracked-changes-only"},yt=Object.freeze({edit:null,enforced:false});function an(n){return n.edit!==null&&n.enforced}g(an,"isProtectionActive");function cr(n){return n.edit===null?"unprotected":`${Zl[n.edit]??n.edit}, ${n.enforced?"enforced":"not enforced"}`}g(cr,"describeProtection");function Kl(n){return n==null?true:!["0","false","off"].includes(n.toLowerCase())}g(Kl,"isTruthy");function _s(n){let e=null;try{let s=n?.pkg?.getPartByPath?.(Ql);if(!s?._element)return yt;e=ee(s._element,"documentProtection")[0]??null;}catch{return yt}if(!e)return yt;let t=null,r=null,i=e.attributes;if(i)for(let s=0;s<i.length;s++){let o=i[s],a=(o.name??"").split(":").pop()??"";a==="edit"?t=o.value:a==="enforcement"&&(r=o.value);}return t===null||!Vl.has(t)?yt:{edit:t,enforced:Kl(r)}}g(_s,"readDocumentProtection");var ln="ignore_control_locks",bt="ignore_document_protection",ur="allow_untracked_writes",Ge=Object.freeze({ignore_control_locks:false,ignore_document_protection:false,allow_untracked_writes:false});function ec(n){return n.ignore_control_locks||n.ignore_document_protection||n.allow_untracked_writes}g(ec,"anyOverrideUsed");function he(n){let e=[`CC:${n.ordinal}`];return n.alias&&e.push(`"${n.alias}"`),n.tag&&e.push(`(tag: ${n.tag})`),e.join(" ")}g(he,"describeControl");function fe(n,e){let t=`- Edit ${n} Failed: ${e.subject} ${e.rule} ${tc(e.alternative)}`;return e.override&&(t+=` Pass ${e.override}=true to override deliberately.`),t.split(/\s+/).join(" ")}g(fe,"gateError");function tc(n){let e=n.replace(/\s+$/,"");return /[.!?:]$/.test(e)?e:`${e}.`}g(tc,"endSentence");function nc(n){return n.find(e=>e.contentLocked)??null}g(nc,"lockedAncestor");function rc(n,e,t=Ge){if(t.ignore_control_locks)return null;let r=nc(e);return r?fe(n,{subject:`edit targets content inside ${he(r)}, which is content-locked (sdtContentLocked).`,rule:"Word refuses edits inside locked controls, so this edit would silently fail to appear in the document.",alternative:"Remove the lock in Word (Developer -> Properties)",override:ln}):null}g(rc,"checkContentLock");function ic(n,e,t=Ge){if(t.ignore_control_locks)return null;let r=e.find(i=>i.cls==="group");return !r||e.some(i=>i.cls!=="group")?null:fe(n,{subject:`edit targets text inside ${he(r)}, which is a group (a locked region).`,rule:"Word treats a group's own text as fixed boilerplate and only permits edits to the fields nested inside it.",alternative:"Target one of the nested controls instead",override:ln})}g(ic,"checkGroupRegion");function sc(n,e,t,r=Ge){if(r.ignore_control_locks||!t)return null;let i=e.find(s=>s.deleteLocked);return i?fe(n,{subject:`edit would remove ${he(i)} itself, which is delete-locked (sdtLocked).`,rule:"Word refuses to delete a locked control, and hoisting its content out would dissolve the wrapper.",alternative:"Delete the control's CONTENT instead (the wrapper stays, leaving an empty field)",override:ln}):null}g(sc,"checkDeleteLock");function oc(n,e,t={}){let r=t.overrides??Ge;if(!an(e)||r.ignore_document_protection)return null;let i=cr(e);return e.edit==="readOnly"?fe(n,{subject:`the document is protected (${i}).`,rule:"Word blocks every modification while read-only protection is enforced.",alternative:"Remove the restriction in Word (Review -> Restrict Editing -> Stop Protection)",override:bt}):e.edit==="comments"?t.isCommentOnly?null:fe(n,{subject:`the document is protected (${i}).`,rule:"Word permits only comments while comments-only protection is enforced; text mutations are blocked.",alternative:"Attach a comment instead (set new_text equal to target_text and supply comment)",override:bt}):e.edit==="forms"?(t.controls??[]).some(o=>o.cls!=="group")?null:fe(n,{subject:`the document is protected (${i}).`,rule:"Word permits only form-field fills while fill-in-forms protection is enforced; body text outside a content control is locked.",alternative:"Target the content of a form field instead",override:bt}):null}g(oc,"checkProtectionBlocksEdit");function ac(n,e,t,r=Ge){if(!an(t)||r.ignore_document_protection||e!=="accept"&&e!=="reject"||t.edit!=="trackedChanges"&&t.edit!=="readOnly")return null;let i=t.edit==="readOnly"?"Word blocks every modification while read-only protection is enforced.":"Resolving revisions is exactly what this protection forbids, so Word refuses Accept and Reject.";return `- Action ${n} Failed: the document is protected (${cr(t)}). ${i} Remove the restriction in Word (Review -> Restrict Editing -> Stop Protection) or pass ${bt}=true to override deliberately.`}g(ac,"checkProtectionBlocksReview");function lc(n,e,t=Ge){return !an(e)||e.edit!=="forms"||t.allow_untracked_writes?null:fe(n,{subject:`the document is protected (${cr(e)}).`,rule:"Word records fills in a forms-protected document as UNTRACKED changes, so Adeu cannot honour its guarantee that every write is a tracked change.",alternative:"Remove the protection to write tracked changes normally",override:ur})}g(lc,"checkUntrackedWrite");function cc(n,e,t){let r=(e||"").trim();if(!r)return null;for(let i of t){if(!i.showingPlaceholder)continue;let s=(i.placeholderText||"").trim();if(!(!s||!s.includes(r)))return fe(n,{subject:`target_text is the placeholder text of ${he(i)}, which is EMPTY.`,rule:"Placeholder text is a ghost prompt, not content: Word discards it as soon as the field is filled, so an edit to it would be silently lost.",alternative:`Fill the field with set_field, or insert at its empty pair {#cc:${i.ordinal}}{#/cc:${i.ordinal}}`})}return null}g(cc,"checkPlaceholderTarget");var vt=["[ ]","[x]"];function uc(n,e,t,r){let i=e.find(o=>o.cls==="checkbox");if(!i)return null;let s=vt;return s.includes(t.trim())&&s.includes(r.trim())?null:fe(n,{subject:`edit targets ${he(i)}, which is a checkbox.`,rule:"Its [x] / [ ] projection reflects the w14:checked state rather than editable text, so replacing it with other text would leave the checkbox state unchanged.",alternative:"Toggle it by replacing [x] with [ ] (or the reverse), or use set_field"})}g(uc,"checkCheckboxEdit");function dc(n,e){let t=e.find(i=>i.bound);if(!t)return null;let r=t.bindingXpath?` (bound to ${t.bindingXpath})`:"";return fe(n,{subject:`edit targets the content of ${he(t)}, which is data-bound${r}.`,rule:"Its text is a projection of an XML data store, and Word re-reads that store when the document opens, so an edit that skips the store is reverted.",alternative:"Use set_field, which writes the control and its bound store together"})}g(dc,"checkBoundControl");function ri(n,e,t){let r=new Set(e),i=new Set(t);return n.filter(s=>r.has(s)!==i.has(s))}g(ri,"crossedControlWalls");function fc(n,e){if(e.length===0)return null;let t=e.map(he).join(", ");return fe(n,{subject:`edit merges paragraphs across the boundary of ${t}.`,rule:"Content may not be hoisted into or out of a content control by a merge: the wrapper would gain or lose text that was never scoped to it.",alternative:"Split this into two edits, one on each side of the control boundary"})}g(fc,"checkBlockMergeAcrossControl");function hc(n){return `segmented at the boundary of ${n.map(he).join(", ")}: only the text outside the control was changed`}g(hc,"segmentationNote");function pc(n,e){if(!ec(n))return null;let t=[];if(n.ignore_control_locks){let r=e.length>0?` (${e.map(he).join(", ")} edited inside locked controls)`:"";t.push(`${ln}${r}`);}return n.ignore_document_protection&&t.push(bt),n.allow_untracked_writes&&t.push(ur),"Overrides: "+t.join(", ")}g(pc,"overridesNote");function _c(n,e,t=2){if(n===e)return 0;if(Math.abs(n.length-e.length)>t)return t+1;if(n.length===0)return e.length<=t?e.length:t+1;if(e.length===0)return n.length<=t?n.length:t+1;if(n.length>e.length){let i=n;n=e,e=i;}let r=Array.from({length:n.length+1},(i,s)=>s);for(let i=1;i<=e.length;i++){let s=[i],o=i;for(let a=1;a<=n.length;a++){let l=n[a-1]===e[i-1]?0:1,u=Math.min(r[a]+1,s[a-1]+1,r[a-1]+l);s.push(u),u<o&&(o=u);}if(o>t)return t+1;r=s;}return r[n.length]<=t?r[n.length]:t+1}g(_c,"boundedLevenshtein");function mc(n){let e="",t=R(n._element,"w:r");for(let r of t)e+=Te(new Re(r,n));return e}g(mc,"_get_paragraph_text");var dr="[A-Z][A-Za-z0-9\\s\\-&'\u2019]{1,60}",gc=new RegExp(`^(?:[\\d.\\-()a-zA-Z]+\\s*)?["\u201C](${dr})["\u201D]`,"d"),wc=new RegExp(`(?<=[.;:!?])\\s+(?:[\\d.\\-()a-zA-Z]+\\s+)?["\u201C](${dr})["\u201D]`,"dg"),yc=new RegExp(`\\([^)]*?["\u201C](${dr})["\u201D][^)]*?\\)`,"dg");function vc(n){let e=[],t=gc.exec(n);t&&t.indices&&t.indices[1]&&e.push([t.indices[1][0],t[1].trim()]);for(let s of n.matchAll(wc)){let o=s.indices;o&&o[1]&&e.push([o[1][0],s[1].trim()]);}for(let s of n.matchAll(yc)){let o=s.indices;o&&o[1]&&e.push([o[1][0],s[1].trim()]);}let r=[],i=new Set;e.sort((s,o)=>s[0]-o[0]);for(let[s,o]of e)i.has(s)||(i.add(s),r.push(o));return r}g(vc,"extract_terms_from_paragraph");function bc(n,e){let t=Object.create(null),r=new Set,i=Object.create(null),s=[];for(let p of We(n)){if(!(p instanceof ne))continue;let _=mc(p).trim();if(!_)continue;for(let b of vc(_))t[b]?r.add(b):t[b]={count:0};let w=_.length>60?_.substring(0,60)+"...":_,v=R(p._element,"*");for(let b of v){if(b.tagName==="w:bookmarkStart"){let N=b.getAttribute("w:name");N&&(!N.startsWith("_")||N.startsWith("_Ref"))&&(i[N]||(i[N]={anchored_to:w,referenced_from:[]}));}let y=null;if(b.tagName==="w:fldSimple"){let k=(b.getAttribute("w:instr")||"").trim().split(/\s+/);k.length>1&&k[0]==="REF"&&(y=k[1]);}else if(b.tagName==="w:instrText"){let k=(b.textContent||"").trim().split(/\s+/);k.length>1&&k[0]==="REF"&&(y=k[1]);}y&&s.push([y,w]);}}for(let[p,_]of s)i[p]&&i[p].referenced_from.push(_);let o=[],a=Object.keys(t);if(a.length>0){let p=a.sort((b,y)=>y.length-b.length),_=g(b=>b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRegExp"),w=p.map(_).join("|"),v=new RegExp(`(?<!["\u201C])\\b(${w})\\b(?![\u201D"])`,"g");for(let b of e.matchAll(v)){let y=b[1];t[y]&&t[y].count++;}for(let b of a)t[b].count===0&&(delete t[b],r.has(b)||o.push(`[Warning] Unused Definition: '${b}' is defined but never used.`));}for(let p of r)o.push(`[Error] Duplicate Definition: '${p}' is defined multiple times.`);let l=new Set(["The","This","That","Such","A","An","Any","All","Some","No","Every","Each","As","In","Of","For","To","On","By","With"]),u=/\b[A-Z][a-zA-Z]*(?:\s+[A-Z][a-zA-Z]*)*\b/g,c=new Set(e.match(u)||[]),d=new Set(Object.keys(t)),f={};for(let p of d){let _=p[0].toLowerCase();f[_]||(f[_]=[]),f[_].push(p);}let h=Object.create(null);for(let p of c){let _=p.trim(),w=_.split(/\s+/);for(;w.length>0;){let y=w[0],N=y.charAt(0).toUpperCase()+y.slice(1).toLowerCase();if(l.has(N))w.shift();else break}if(_=w.join(" "),_.length<4||d.has(_))continue;let v=_[0].toLowerCase(),b=f[v]||[];if(_.length>5)for(let[y,N]of Object.entries(f))y!==v&&(b=b.concat(N));for(let y of b){if(Math.abs(_.length-y.length)>2||_===y+"s"||_===y+"es"||y===_+"s"||y===_+"es")continue;let N=_c(_,y,2);N===0||N>2||y.length<=5&&(N>1||_[0].toLowerCase()!==y[0].toLowerCase())||(h[y]||(h[y]=[]),h[y].includes(_)||h[y].push(_));}}for(let[p,_]of Object.entries(h)){_.sort();let w=_.map(v=>`'${v}'`).join(", ");o.push(`[Info] Possible Typos for '${p}': Found ${w}`);}function m(p){return p.startsWith("[Error]")?0:p.startsWith("[Warning]")?1:2}return g(m,"diag_sort_key"),o.sort((p,_)=>{let w=m(p),v=m(_);return w!==v?w-v:p.localeCompare(_)}),[t,o,i]}g(bc,"extract_all_domain_metadata");function xc(n){let e=[],t=n.pkg.getPartByPath("word/settings.xml");if(!t)return e;let r=g(o=>{if(!o.hasAttribute("w:val"))return true;let a=(o.getAttribute("w:val")||"").toLowerCase();return a!=="0"&&a!=="false"&&a!=="off"},"isTruthy2"),i=ee(t._element,"removePersonalInformation");i.length>0&&r(i[0])&&e.push("[Warning] Privacy flag `removePersonalInformation` is enabled in word/settings.xml. Microsoft Word will strip the `w:author`, `w:initials`, and `w:date` attributes from every tracked change and comment the next time this document is opened and saved. Edits made by this agent will lose attribution, breaking audit trails and any multi-turn workflow that relies on identifying prior edits.");let s=ee(t._element,"removeDateAndTime");return s.length>0&&r(s[0])&&e.push("[Warning] Privacy flag `removeDateAndTime` is enabled in word/settings.xml. Microsoft Word will strip the `w:date` attribute from every tracked change and comment the next time this document is opened and saved. Timestamps on this agent's edits will be lost on the next Word save."),e}g(xc,"extract_document_settings_warnings");function Nc(n,e){try{let t=Yc(n),r=_s(n);return Qc(t,r,'Read with mode="fields" for the full field ledger.')}catch{return []}}g(Nc,"content_controls_appendix_section");function kc(n,e){let[t,r,i]=bc(n,e),s=xc(n),o=[`
86
86
 
87
87
  ---`,"","<!-- READONLY_BOUNDARY_START -->","# Document Structure (Read-Only)","The content below is metadata describing the document's reference structure. Do not include this section in any tracked changes or edits \u2014 it is for your context only and will be discarded on write."],a=false;if(s.length>0){a=true,o.push(`
88
88
  ## Document Settings`);for(let u of s)o.push(`- ${u}`);}let l=Nc(n);if(l.length>0&&(a=true,o.push(""),o.push(...l)),Object.keys(t).length>0){a=true,o.push(`
@@ -117,7 +117,7 @@ ${s}`);}let i=true;for(let s of We(n))if(s.constructor.name==="FootnoteItem"){le
117
117
  Did you mean the literal "${r}"? It appears in the document (\u2026${a}\u2026). If you used a regex, drop the ^/$ anchors \u2014 they match the start/end of the entire document, not a line.`}return ""}static _PREVIEW_WRAPPER_PAIRS=[["{--","--}"],["{++","++}"],["{==","==}"],["{>>","<<}"]];static _tidy_preview_context(e,t){e=e.replace(/\{>>[\s\S]*?<<\}/g,"");for(let[r,i]of Z._PREVIEW_WRAPPER_PAIRS)if(t==="before"){let s=0,o=0,a=0;for(;a<e.length;)e.startsWith(r,a)?(s+=1,a+=r.length):e.startsWith(i,a)?(s===0?o=a+i.length:s-=1,a+=i.length):a+=1;e=e.substring(o);}else {let s=[],o=0;for(;o<e.length;)e.startsWith(r,o)?(s.push(o),o+=r.length):e.startsWith(i,o)?(s.length>0&&s.pop(),o+=i.length):o+=1;s.length>0&&(e=e.substring(0,s[0]));}return t==="before"?e=e.replace(/^[-+=<>]{0,2}\}/,""):e=e.replace(/\{[-+=<>]{0,2}$/,""),e}_capture_preview_context(e){if(e.type!=="modify")return;let t=e._resolved_start_idx;if(t==null)return;let i=(e._active_mapper_ref||this.mapper).full_text;if(!i)return;let s=(e.target_text||"").length,o=i.substring(Math.max(0,t-Ae),t),a=i.substring(t+s,t+s+Ae);e._preview_context=[Z._tidy_preview_context(o,"before"),Z._tidy_preview_context(a,"after")];}_capture_parent_preview_context(e){if(!e||e.type!=="modify"||e._preview_context||!e._preview_span)return;let[t,r]=e._preview_span,s=(e._preview_mapper_ref||this.mapper).full_text;if(!s)return;let o=s.substring(Math.max(0,t-Ae),t),a=s.substring(t+r,t+r+Ae);e._preview_context=[Z._tidy_preview_context(o,"before"),Z._tidy_preview_context(a,"after")];}_build_full_match_preview(e){let[t,r]=e._preview_context,i=e._preview_matched_text||"",s=e._preview_new_text!==void 0&&e._preview_new_text!==null?e._preview_new_text:e.new_text||"",[o,a]=this._parse_markdown_style(i),[l,u]=this._parse_markdown_style(s);a&&a.startsWith("Heading")&&(t=t+i.substring(0,i.length-o.length),i=o),u&&u.startsWith("Heading")&&(s=l);let[c,d]=rt(i,s),f=i.substring(c,i.length-d),h=s.substring(c,s.length-d);t=t+i.substring(0,c),d&&(r=i.substring(i.length-d)+r),f=de(f,tt),h=de(h,tt);let m;if(!f&&!h){let _=de(i,tt),w=_?`{==${_}==}`:"";m=`${t.substring(0,t.length-i.length)}${w}${r}`;}else {let _=f?`{--${f}--}`:"",w=h?`{++${h}++}`:"";m=`${t}${_}${w}${r}`;}let p=m;return p=p.replace(/\{>>[\s\S]*?<<\}/g,""),p=p.replace(/\{--[\s\S]*?--\}/g,""),p=p.replace(/\{\+\+([\s\S]*?)\+\+\}/g,"$1"),[m,p]}static _report_new_text(e){return e&&e.type==="insert_row"&&Array.isArray(e.cells)?e.cells.join(" | "):e&&e.new_text||""}_build_postapply_previews(e){let t=new Set((e._minted_change_ids||[]).map(w=>String(w))),r=new Set((e._minted_comment_ids||[]).map(w=>String(w)));if(t.size===0&&r.size===0)return null;let i=this.mapper;i.full_text||i._build_map();let s=i.full_text;if(!s)return null;let o=[];for(let w of i.spans)(w.ins_id&&t.has(String(w.ins_id))||w.del_id&&t.has(String(w.del_id))||r.size>0&&w.comment_ids&&w.comment_ids.some(b=>r.has(String(b))))&&o.push([w.start,w.end]);if(o.length===0)return null;let a=/\{>>[\s\S]*?<<\}/g,l=[],u;for(;(u=a.exec(s))!==null;)l.push([u.index,u.index+u[0].length]);let c=s,d=g(w=>w,"to_visible");if(l.length>0){let w=[],v=0;for(let[b,y]of l)w.push(s.substring(v,b)),v=y;w.push(s.substring(v)),c=w.join(""),d=g(b=>{let y=0;for(let[N,k]of l)if(b>=k)y+=k-N;else if(b>N){y+=b-N;break}else break;return b-y},"to_visible");}o.sort((w,v)=>w[0]-v[0]);let f=[];for(let[w,v]of o){let b=d(w),y=d(v),N=Math.max(0,b-Ae),k=Math.min(c.length,y+Ae),x=f.length>0?f[f.length-1]:null;x&&N<=x[1]?x[1]=Math.max(x[1],k):f.push([N,k]);}let h=[];for(let[w,v]of f){let b=c.substring(w,v);b=Z._tidy_preview_context(b,"before"),b=Z._tidy_preview_context(b,"after"),h.push(b);}let m=h.join(`
118
118
  \u2026
119
119
  `),p=m;p=p.replace(/\{>>[\s\S]*?<<\}/g,""),p=p.replace(/\{--[\s\S]*?--\}/g,""),p=p.replace(/\{\+\+([\s\S]*?)\+\+\}/g,"$1"),p=p.replace(/\{==([\s\S]*?)==\}/g,"$1");let _=tt*2+4*Ae;return [de(m,_),de(p,_)]}_build_edit_context_previews(e){if(e.type!=="modify")return [null,null];let t=this._build_postapply_previews(e);if(t)return t;if(e._preview_span&&e._preview_context)return this._build_full_match_preview(e);e._resolved_proxy_edit&&(e=e._resolved_proxy_edit);let r=e._resolved_start_idx;if(r==null)return [null,null];let i=e.target_text||"",s=e.new_text||"",[o,a]=this._parse_markdown_style(i);if(a&&a.startsWith("Heading")){let b=i.length-o.length;r+=b,i=o;}let[l,u]=this._parse_markdown_style(s);u&&u.startsWith("Heading")&&(s=l);let c=i.length,d,f;if(e._preview_context)[d,f]=e._preview_context;else {let y=(e._active_mapper_ref||this.mapper).full_text;if(!y)return [null,null];d=Z._tidy_preview_context(y.substring(Math.max(0,r-Ae),r),"before"),f=Z._tidy_preview_context(y.substring(r+c,r+c+Ae),"after");}let h=de(i,tt),m=de(s,tt),p=h?`{--${h}--}`:"",_=m?`{++${m}++}`:"",w=`${d}${p}${_}${f}`,v=w;return v=v.replace(/\{>>.*?<<\}/gs,""),v=v.replace(/\{--.*?--\}/gs,""),v=v.replace(/\{\+\+(.*?)\+\+\}/gs,"$1"),[w,v]}_revision_roots(){let e=[this.doc.element];for(let t of this.doc.pkg.parts)t!==this.doc.part&&t.contentType.includes("wordprocessingml")&&t.contentType.endsWith("+xml")&&e.push(t._element);return e}_story_roots(){let e=[[this.doc.element,Mn(this.doc.part.partname)]];for(let t of this.doc.pkg.parts)t!==this.doc.part&&Cu.includes(t.contentType)&&e.push([t._element,Mn(t.partname)]);return e}_scan_existing_ids(){let e=0;for(let t of this._revision_roots())for(let r of ["w:ins","w:del","w:pPrChange"]){let i=R(t,r);for(let s of i){let o=parseInt(s.getAttribute("w:id")||"0",10);!isNaN(o)&&o>e&&(e=o);}}return e}_field_entries(){let e=this.mapper.full_text;if(this._field_entries_cache&&this._field_entries_cache[0]===e)return this._field_entries_cache[1];let t=Gc(this.doc,e);return this._field_entries_cache=[e,t],t}_resolve_set_field_targets(e){return Zc(this._field_entries(),e.field,e.match_mode||"strict")}_sdt_info_for_ordinal(e){let t=this.mapper._sdt_infos;if(!t)return null;for(let r of t.values())if(r.ordinal===e)return r;return null}_cc_content_range(e){this._field_label_at(0);for(let[t,r,i]of this._cc_anchor_pairs??[])if(i===e)return [t,r];return null}_invalidate_projection_caches(){this.mapper._build_map(),this._cc_anchor_pairs=null,this._field_entries_cache=null,this._field_entries_cache=null;}_empty_control_fill_host(e,t){let r=e?.full_text??"";if(!r)return null;let i=new Map,s=/\{#(\/?)cc:(\d+)(?: [^}]*)?\}/g,o;for(;(o=s.exec(r))!==null;){let a=Number(o[2]);if(o[1]){let l=i.get(a);if(i.delete(a),l!==void 0&&l===o.index&&o.index===t){let u=this._sdt_info_for_ordinal(a);return u?(u.showingPlaceholder&&fi(u)&&(this._cc_anchor_pairs=null,this._field_entries_cache=null,this._field_entries_cache=null),it(u.element)):null}}else i.set(a,o.index+o[0].length);}return null}_apply_checkbox_set_field(e,t,r){let i=_i(e.value);if(i===null){let h=`CC:${t.ordinal} is a checkbox; '${e.value}' is neither checked nor unchecked. Use true/false (also accepted: x, [x], 1, 0, yes, no).`;return e._applied_status=false,e._error_msg=h,this.skipped_details.push(`- ${h}`),false}let s=lu(r),[o,a]=ou(r,i),l=this.doc.part._element.ownerDocument,u=s?s.cloneNode(true):l.createElement("w:r");for(let h of Array.from(u.getElementsByTagName("w:t")))h.parentNode?.removeChild(h);let c=l.createElement("w:t");if(c.appendChild(l.createTextNode(o)),u.appendChild(c),a){let h=O(u,"w:rPr");h||(h=l.createElement("w:rPr"),u.insertBefore(h,u.firstChild));for(let p of Array.from(h.getElementsByTagName("w:rFonts")))p.parentNode?.removeChild(p);let m=l.createElement("w:rFonts");for(let p of ["w:ascii","w:hAnsi","w:eastAsia","w:cs"])m.setAttribute(p,a);h.insertBefore(m,h.firstChild);}let d=this._create_track_change_tag("w:ins","",this._getNextId());d.appendChild(u);let f=s?s.parentNode:null;if(f){f.insertBefore(d,s);let h=this._create_track_change_tag("w:del","",this._getNextId()),m=s.cloneNode(true);for(let p of Array.from(m.getElementsByTagName("w:t"))){let _=l.createElement("w:delText");for(;p.firstChild;)_.appendChild(p.firstChild);for(let w=0;w<p.attributes.length;w++)_.setAttribute(p.attributes[w].name,p.attributes[w].value);p.parentNode?.replaceChild(_,p);}h.appendChild(m),f.replaceChild(h,s);}else {let h=it(r.element);if(!h)return false;h.appendChild(d);}return au(r,i),e._applied_status=true,e._occurrences_modified=(e._occurrences_modified||0)+1,true}_resolve_set_field(e,t){let r;try{r=this._resolve_set_field_targets(e);}catch(u){e._applied_status=false,e._error_msg=u?.message??String(u),this.skipped_details.push(`- ${e._error_msg}`);return}let i=g(u=>{let c=this._sdt_info_for_ordinal(u.ordinal);return c?c.cls:u.cls_word},"clsOf");for(let u of r){let c=this._sdt_info_for_ordinal(u.ordinal),d=hi(i(u),u.ordinal);if(!d&&c&&(d=pi(c,u.ordinal,e.value)),d){e._applied_status=false,e._error_msg=d,this.skipped_details.push(`- ${d}`);return}}let s=false;for(let u of r){let c=this._sdt_info_for_ordinal(u.ordinal);c?.showingPlaceholder&&fi(c)&&(s=true);}s&&this._invalidate_projection_caches();let o=new Map,a=new Map;for(let u of r){let c=this._sdt_info_for_ordinal(u.ordinal);if(c){if(c.cls==="dropdown"||c.cls==="combobox"){let[d,f]=Is(c,e.value);if(f){let h=`CC:${u.ordinal}: ${f}`;e._applied_status=false,e._error_msg=h,this.skipped_details.push(`- ${h}`);return}o.set(u.ordinal,d),c.cls==="combobox"&&!cu(c,d)&&a.set(u.ordinal,`'${d}' is not in the option list`);}else if(c.cls==="date"){let d=Xn(e.value);if(!d){let m=`CC:${u.ordinal} is a date control; '${e.value}' is not a date. Use the canonical YYYY-MM-DD form (e.g. 2026-03-01).`;e._applied_status=false,e._error_msg=m,this.skipped_details.push(`- ${m}`);return}let[f,h]=fu(d,c.dateFormat);o.set(u.ordinal,f),h&&a.set(u.ordinal,`the control's date format '${c.dateFormat}' is not supported in v1; wrote the canonical ${f}`);}}}let l=r.filter(u=>i(u)==="checkbox");if(l.length){let u=true;for(let c of l){let d=this._sdt_info_for_ordinal(c.ordinal);(!d||!this._apply_checkbox_set_field(e,c,d))&&(u=false);}u&&this._invalidate_projection_caches();return}for(let u of r){let c=this._cc_content_range(u.ordinal);if(!c){let v=`CC:${u.ordinal} has no editable content span, so set_field cannot write to it. Run read_docx with mode='fields' to see what this control is.`;e._applied_status=false,e._error_msg=v,this.skipped_details.push(`- ${v}`);return}let[d,f]=c,h=this.mapper.full_text.slice(d,f),m=o.get(u.ordinal)??e.value,p=this._sdt_info_for_ordinal(u.ordinal),_={type:"modify",target_text:h,new_text:m,comment:e.comment??null};if(_._internal_op=h?m?"MODIFICATION":"DELETION":"INSERTION",_._resolved_start_idx=d,_._active_mapper_ref=this.mapper,_._parent_edit_ref=e,!h&&p&&(_._insert_host_el=it(p.element)),p){if(p.cls==="dropdown"||p.cls==="combobox")uu(p,m);else if(p.cls==="date"){let v=Xn(e.value);v&&hu(p,v);}if(p.bound){let v=mu(this.doc,p.storeItemId),b=!!v&&vu(v,p.bindingXpath,m,p.prefixMappings),y=a.get(u.ordinal),N=y?`; ${y}`:"";a.set(u.ordinal,b?`bound store ${p.bindingXpath} updated to match${N}`:`WARNING: this field is bound to ${p.bindingXpath} but the data store could not be resolved, so only the visible text was updated. If the store is restored later, Word will overwrite this edit from it.${N}`);}if(p.temporary){_._unwrap_sdt_after=p.element;let v=a.get(u.ordinal),b="this control was temporary and has been unwrapped, as Word does on any edit";a.set(u.ordinal,v?`${v}; ${b}`:b);}}let w=a.get(u.ordinal);w&&(e._warning=e._warning?`${e._warning}; ${w}`:w),(e._resolved_start_idx===void 0||e._resolved_start_idx===null)&&(e._resolved_start_idx=d,e._resolved_proxy_edit=_),t.push([_,m]);}}_field_label_at(e){if(this._cc_anchor_pairs===null){let a=[],l=this.mapper.full_text,u=new Map,c=/\{#(\/?)cc:(\d+)(?: [^}]*)?\}/g,d;for(;(d=c.exec(l))!==null;){let f=Number(d[2]);if(d[1]){let h=u.get(f);h!==void 0&&(u.delete(f),a.push([h,d.index,f]));}else u.set(f,d.index+d[0].length);}this._cc_anchor_pairs=a;}let t=null;for(let[a,l,u]of this._cc_anchor_pairs)a<=e&&e<=l&&(t===null||l-a<t[1]-t[0])&&(t=[a,l,u]);if(t===null)return "";let r=t[2],i=null,s=this.mapper._sdt_infos;if(s){for(let a of s.values())if(a.ordinal===r){i=a;break}}let o=`CC:${r}`;return i?.alias&&(o+=` "${i.alias}"`),i?.tag&&(o+=` (tag: ${i.tag})`),o}_get_heading_path_and_page(e,t,r){let i=1;for(let u=0;u<r.length&&e>=r[u];u++)i=u+1;let o=t.substring(0,e).split(`
120
- `),a=[],l=999;for(let u=o.length-1;u>=0;u--){let d=o[u].match(/^(#{1,6})\s+(.*)/);if(d){let f=d[1].length;if(f<l){let h=d[2].replace(/\*\*|__|[*_]/g,"").replace(/\{#[^}]+\}/g,"").trim();if(h.length>80&&(h=h.substring(0,80)+"..."),a.unshift(h),l=f,f===1)break}}}return [a.join(" > "),i]}accept_all_revisions(e=false){let t=this._revision_roots(),r=0,i=0,s=0;for(let f of t){r+=R(f,"w:ins").length,i+=R(f,"w:del").length;for(let h of ["w:rPrChange","w:pPrChange","w:sectPrChange"])s+=R(f,h).length;}let o=this._comment_authors(),a=new Set(Object.keys(o));this.removed_comment_notes=[];for(let f of t){let h=R(f,"w:ins");for(let _ of h){this._clean_wrapping_comments(_);let w=_.parentNode;if(w){if(w.tagName==="w:trPr"){w.removeChild(_);continue}for(;_.firstChild;)w.insertBefore(_.firstChild,_);w.removeChild(_);}}let m=R(f,"w:p");for(let _ of m){let w=O(_,"w:pPr");if(w){let v=O(w,"w:rPr"),b=v?O(v,"w:del"):null;if(v&&b){let y=false;for(let N of ["w:t","w:tab","w:br"]){for(let k of R(_,N)){if(N==="w:t"&&!k.textContent)continue;let x=false,P=k.parentNode;for(;P&&P!==_;){if(P.tagName==="w:del"){x=true;break}P=P.parentNode;}if(!x){y=true;break}}if(y)break}y||this._is_last_paragraph_in_cell(_)?v.removeChild(b):(this._clean_wrapping_comments(_),this._delete_comments_in_element(_),_.parentNode&&_.parentNode.removeChild(_));}}}let p=R(f,"w:del");for(let _ of p){this._clean_wrapping_comments(_),this._delete_comments_in_element(_);let w=_.parentNode;if(w)if(w.tagName==="w:trPr"){let v=w.parentNode;v&&v.parentNode&&v.parentNode.removeChild(v);}else w.removeChild(_);}for(let _ of R(f,"w:pPrChange"))_.parentNode?.removeChild(_);}if(e)for(let f of t){for(let m of ["w:commentRangeStart","w:commentRangeEnd"])for(let p of R(f,m))p.parentNode?.removeChild(p);let h=R(f,"w:commentReference");for(let m of h){let p=m.parentNode;p&&((p.tagName==="w:r"||p.tagName.endsWith(":r"))&&Array.from(p.childNodes).filter(w=>w.nodeType===1&&w.tagName!=="w:rPr"&&w.tagName!=="rPr").length<=1?p.parentNode?.removeChild(p):p.removeChild(m));}}let l=this.doc.pkg,u=new Set;for(let f of l.parts)if(e&&f.partname.toLowerCase().includes("comments")){u.add(f.partname);let h=f.partname.startsWith("/")?f.partname:"/"+f.partname,m=f.partname.startsWith("/")?f.partname.substring(1):f.partname;u.add(h),u.add(m);}if(u.size>0){for(let h of l.parts)if(h.partname.endsWith(".rels")){let m=R(h._element,"Relationship"),p=[];for(let _ of m)if((_.getAttribute("Target")||"").toLowerCase().includes("comments")){p.push(_);let v=h.partname.replace("/_rels/","/").replace(".rels",""),b=l.getPartByPath(v);if(b){let y=_.getAttribute("Id");y&&b.rels.delete(y);}}for(let _ of p)_.parentNode?.removeChild(_);}let f=l.getPartByPath("[Content_Types].xml");if(f){let h=R(f._element,"Override"),m=[];for(let p of h){let _=p.getAttribute("PartName")||"";(u.has(_)||_.toLowerCase().includes("comments"))&&m.push(p);}for(let p of m)p.parentNode?.removeChild(p);}l.parts=l.parts.filter(h=>!h.partname.toLowerCase().includes("comments"));for(let h of Object.keys(l.unzipped))h.toLowerCase().includes("comments")&&delete l.unzipped[h];}let c=new Set(this._existing_comment_ids()),d=Array.from(a).filter(f=>!c.has(f)).sort((f,h)=>{let m=/^\d+$/.test(f)?parseInt(f,10):0,p=/^\d+$/.test(h)?parseInt(h,10):0;return m-p||f.localeCompare(h)});return this.removed_comment_notes=d.map(f=>`Com:${f} (by ${o[f]??"Unknown"})`),{accepted_insertions:r,accepted_deletions:i,accepted_formatting:s,removed_comments:d.length}}reject_all_revisions(){let e=this._revision_roots();for(let t of e){for(let o of R(t,"w:pPrChange"))this._revert_ppr_change(o);let r=R(t,"w:ins");for(let o of r){let a=o.parentNode;if(a)if(this._clean_wrapping_comments(o),this._delete_comments_in_element(o),a.tagName==="w:trPr"){let l=a.parentNode;l&&l.parentNode&&l.parentNode.removeChild(l);}else a.removeChild(o);}let i=R(t,"w:p");for(let o of i){let a=O(o,"w:pPr");if(a){let l=O(a,"w:rPr"),u=l?O(l,"w:del"):null;l&&u&&l.removeChild(u);}}let s=R(t,"w:del");for(let o of s){let a=o.parentNode;if(!a)continue;if(a.tagName==="w:trPr"){a.removeChild(o);continue}let l=Array.from(o.getElementsByTagName("w:delText"));for(let u of l){let c=o.ownerDocument.createElement("w:t");c.textContent=u.textContent,u.hasAttribute("xml:space")&&c.setAttribute("xml:space","preserve"),u.parentNode?.replaceChild(c,u);}for(;o.firstChild;)a.insertBefore(o.firstChild,o);a.removeChild(o);}}}_revert_ppr_change(e){let t=e.parentNode;if(!t||t.tagName!=="w:pPr")return;let r=t.parentNode;if(!r)return;let i=O(e,"w:pPr");if(i){let s=i.cloneNode(true);Array.from(s.childNodes).some(a=>a.nodeType===1)?r.replaceChild(s,t):r.removeChild(t);}else r.removeChild(t);}_revert_props_change(e){let t=e.parentNode;if(!t)return;let r=Array.from(e.childNodes).find(s=>s.nodeType===1);t.removeChild(e);let i=Au[t.tagName];for(let s of Array.from(t.childNodes)){if(s.nodeType!==1)continue;let o=s;o.tagName==="w:rPr"&&(O(o,"w:ins")||O(o,"w:del"))||i?.has(o.tagName)||t.removeChild(s);}if(r)for(let s of Array.from(r.childNodes))s.nodeType===1&&t.appendChild(s.cloneNode(true));}_getNextId(){return this.current_id++,this.current_id.toString()}_create_track_change_tag(e,t="",r=null){let s=this.doc.part._element.ownerDocument.createElement(e),o=r!==null?r:this._getNextId();return s.setAttribute("w:id",o),s.setAttribute("w:author",t||this.author),s.setAttribute("w:date",this.timestamp),s.setAttribute("w16du:dateUtc",this.timestamp),s}_set_text_content(e,t){e.textContent=t,t.trim()!==t&&e.setAttribute("xml:space","preserve");}_comment_anchor_in_main_story(e){let t=e;for(;t.parentNode&&t.parentNode.nodeType===1;)t=t.parentNode;return t.tagName==="w:document"}_skip_comment_outside_main_story(e,t){if(this._comment_anchor_in_main_story(e))return false;let r=e;for(;r.parentNode&&r.parentNode.nodeType===1;)r=r.parentNode;let i={"w:ftr":"footer","w:hdr":"header","w:footnotes":"footnote","w:endnotes":"endnote"}[r.tagName]||"non-body",s=`- Warning: the comment "${t.substring(0,60)}" was NOT attached: Word does not support comments inside a ${i} part, and writing one produces a document other applications cannot open. The tracked change itself was applied.`;return this.skipped_details.push(s),true}_attach_comment(e,t,r,i){if(!i||!e||!t||!r||this._skip_comment_outside_main_story(e,i))return null;let s=this.comments_manager.addComment(this.author,i),o=e.ownerDocument,a=o.createElement("w:commentRangeStart");a.setAttribute("w:id",s);let l=o.createElement("w:commentRangeEnd");l.setAttribute("w:id",s);let u=o.createElement("w:r"),c=o.createElement("w:rPr"),d=o.createElement("w:rStyle");d.setAttribute("w:val","CommentReference"),c.appendChild(d),u.appendChild(c);let f=o.createElement("w:commentReference");f.setAttribute("w:id",s),u.appendChild(f),e.insertBefore(a,t);let h=r.nextSibling;return h?(e.insertBefore(l,h),e.insertBefore(u,l.nextSibling)):(e.appendChild(l),e.appendChild(u)),s}_attach_comment_spanning(e,t,r,i,s){if(!s||!e||!r||this._skip_comment_outside_main_story(e,s)||this._skip_comment_outside_main_story(r,s))return;let o=this.comments_manager.addComment(this.author,s),a=e.ownerDocument,l=r.ownerDocument,u=a.createElement("w:commentRangeStart");u.setAttribute("w:id",o);let c=l.createElement("w:commentRangeEnd");c.setAttribute("w:id",o);let d=l.createElement("w:r"),f=l.createElement("w:rPr"),h=l.createElement("w:rStyle");h.setAttribute("w:val","CommentReference"),f.appendChild(h),d.appendChild(f);let m=l.createElement("w:commentReference");m.setAttribute("w:id",o),d.appendChild(m),e.insertBefore(u,t);let p=i.nextSibling;p?(r.insertBefore(c,p),r.insertBefore(d,c.nextSibling)):(r.appendChild(c),r.appendChild(d));}_is_native_heading_element(e){try{let t=this.doc.part||this.doc,[r,i]=lt(t);return sn({_element:e},r,i)}catch{return false}}_clone_pPr_scrubbing_headings(e,t=null){let r=e.cloneNode(true),i=O(r,"w:pStyle");if(i){let o=i.getAttribute("w:val");o&&(o.startsWith("Heading")||o==="Title"||o.replace(/\s+/g,"").startsWith("Heading")||t!==null&&this._is_native_heading_element(t))&&r.removeChild(i);}let s=O(r,"w:outlineLvl");return s&&r.removeChild(s),r}_track_insert_multiline(e,t,r,i,s=null,o=false,a=false){if(!e)return {first_node:null,last_p:null,last_ins:null,used_block_mode:false};let l=this.doc.part._element.ownerDocument,u=e.split(/[\r\n]+/),c=null;if(r!==null)c=r._element;else if(t!==null){let B=t._element;for(;B&&B.tagName!=="w:p";)B=B.parentNode;c=B;}let d=[],f=new Set(["w:r","w:ins","w:del"]),h=s&&s.parentNode?s:null,m=t!==null&&t._element.parentNode?t._element:null,p=h??m,_=a&&h===null&&m!==null;if(c!==null&&p!==null){let B=p;for(;B&&B.parentNode!==c;)if(B=B.parentNode,B===c){B=null;break}if(B){let $=_?B:B.nextSibling;for(;$;)$.nodeType===1&&f.has($.tagName)&&d.push($),$=$.nextSibling;}}else if(c!==null&&a){let B=c.firstChild;for(;B;)B.nodeType===1&&f.has(B.tagName)&&d.push(B),B=B.nextSibling;}for(;u.length>1&&u[u.length-1]===""&&d.length===0;)u.pop();if(u.length===0)return {first_node:null,last_p:null,last_ins:null,used_block_mode:false};let[w,v]=this._parse_markdown_style(u[0]),b=c!==null,y=/[\r\n]/.test(e),N=v!==null&&b&&y,k=null,x=null;N||(x=this._build_tracked_ins_for_line((w===u[0],u[0]),t,i,l,o),k=x);let P=N?u:u.slice(1);if(P.length===0)return {first_node:k,last_p:null,last_ins:x,used_block_mode:false};if(!c)return {first_node:k,last_p:null,last_ins:x,used_block_mode:false};let A=c.parentNode;if(!A)return {first_node:k,last_p:null,last_ins:x,used_block_mode:false};let C=g((B,$)=>{A.insertBefore(B,$.nextSibling);},"insertAfterEl"),T=null,M=null,j=c;for(let B=0;B<P.length;B++){let $=P[B],[I,E]=this._parse_markdown_style($),S=l.createElement("w:p");if(E)this._set_paragraph_style(S,E);else {let W=O(c,"w:pPr");W&&S.appendChild(this._clone_pPr_scrubbing_headings(W,c));}let D=O(S,"w:pPr");D||(D=l.createElement("w:pPr"),S.insertBefore(D,S.firstChild));let U=O(D,"w:rPr");U||(U=l.createElement("w:rPr"),D.appendChild(U));let z=this._create_track_change_tag("w:ins","",i);U.appendChild(z);let L=this._build_tracked_ins_for_line(I,t,i,l,o);L&&S.appendChild(L),C(S,j),j=S,T=S,M=L,k||(k=S);}if(!N&&T&&d.length>0)for(let B of d)B.parentNode?.removeChild(B),T.appendChild(B);return {first_node:k,last_p:T,last_ins:M,used_block_mode:N}}_build_tracked_ins_for_line(e,t,r,i,s=false){if(!e&&e!=="")return null;let o=this._create_track_change_tag("w:ins","",r),a=this._parse_inline_markdown(e);if(a.length===0)return null;for(let[l,u]of a){let c=i.createElement("w:r");if(t&&t._element){let f=O(t._element,"w:rPr");if(f){let h=f.cloneNode(true),m=["w:vanish","w:strike","w:dstrike","w:i","w:iCs"];s&&m.push("w:b","w:bCs");for(let p of m){let _=O(h,p);_&&h.removeChild(_);}c.appendChild(h);}}this._apply_run_props(c,u,false);let d=i.createElement("w:t");this._set_text_content(d,l),c.appendChild(d),o.appendChild(c);}return o}_parse_markdown_style(e){let t=e.trimStart();if(t.startsWith("#")){let i=0,s=t;for(;s.startsWith("#");)i++,s=s.substring(1);if(s.startsWith(" "))return [s.trim(),`Heading ${i}`]}if(t.startsWith("* ")||t.startsWith("- "))return [t.substring(2).trim(),"List Paragraph"];let r=t.match(/^1\.\s+/);return r?[t.substring(r[0].length).trim(),"List Number"]:[e,null]}_edit_declares_emphasis(e){for(let t of [e?.target_text,e?.new_text]){if(!t||!t.includes("**")&&!t.includes("_"))continue;if(this._parse_inline_markdown(t).some(([,i])=>i&&Object.keys(i).length>0))return true}return false}_parse_inline_markdown(e,t={}){if(!e)return [];let r=/(\*\*.*?\*\*)|(_.*?_)/,i=e.match(r);if(!i)return [[e,t]];let s=i.index,o=i[0],a=s+o.length,l=o.startsWith("**"),u=l?o.substring(2,o.length-2):o.substring(1,o.length-1),c=e.substring(0,s),d=e.substring(a),f=[];c&&f.push([c,t]);let h={...t};return l?h.bold=true:h.italic=true,f.push(...this._parse_inline_markdown(u,h)),f.push(...this._parse_inline_markdown(d,t)),f}_apply_run_props(e,t,r=false){if(!t){if(!r)return;t={};}let i=O(e,"w:rPr");if(!i&&(t.bold||t.italic||r)&&(i=e.ownerDocument.createElement("w:rPr"),e.appendChild(i)),i){let s=e.ownerDocument;if(t.bold){let o=O(i,"w:b");o||(o=s.createElement("w:b"),i.appendChild(o)),o.setAttribute("w:val","1");}else if(r){let o=O(i,"w:b");o&&i.removeChild(o);}if(t.italic){let o=O(i,"w:i");o||(o=s.createElement("w:i"),i.appendChild(o)),o.setAttribute("w:val","1");}else if(r){let o=O(i,"w:i");o&&i.removeChild(o);}}}_set_paragraph_style(e,t,r=null){let i=e.ownerDocument,s=O(e,"w:pPr");s&&e.removeChild(s);let o=i.createElement("w:pPr"),a=i.createElement("w:pStyle"),l=t.replace(/\s+/g,"");if(a.setAttribute("w:val",l),o.appendChild(a),l==="ListParagraph"){let u=this._ensure_bullet_num_id();if(u){let c=i.createElement("w:numPr"),d=i.createElement("w:ilvl");d.setAttribute("w:val","0");let f=i.createElement("w:numId");f.setAttribute("w:val",u),c.appendChild(d),c.appendChild(f),o.appendChild(c);}}if(r!==null){let u=this._create_track_change_tag("w:pPrChange","",r),c=s?s.cloneNode(true):i.createElement("w:pPr"),d=O(c,"w:pPrChange");d&&c.removeChild(d),u.appendChild(c),o.appendChild(u);}e.insertBefore(o,e.firstChild);}static _NUMBERING_CT="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml";static _NUMBERING_RT="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering";_ensure_bullet_num_id(){let e=this.doc.pkg,t="http://schemas.openxmlformats.org/wordprocessingml/2006/main",r='<w:lvl w:ilvl="0"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="\uF0B7"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="720" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/></w:rPr></w:lvl>',i=e.parts.find(C=>String(C.partname).replace(/^\//,"")==="word/numbering.xml");if(!i){let C=`<w:numbering xmlns:w="${t}"><w:abstractNum w:abstractNumId="0"><w:multiLevelType w:val="singleLevel"/>`+r+'</w:abstractNum><w:num w:numId="1"><w:abstractNumId w:val="0"/></w:num></w:numbering>';try{i=e.addPart("/word/numbering.xml",Z._NUMBERING_CT,C),this.doc.relateTo(i,Z._NUMBERING_RT);}catch{return null}return delete e._adeu_numbering_cache,"1"}let s=i._element,o=R(s,"w:abstractNum"),a=R(s,"w:num"),l=null;for(let C of o){let T=C.getAttribute("w:abstractNumId");if(T!==null){for(let M of R(C,"w:lvl")){if((M.getAttribute("w:ilvl")||"0")!=="0")continue;let j=O(M,"w:numFmt");j&&j.getAttribute("w:val")==="bullet"&&(l=T);break}if(l!==null)break}}let u=0;for(let C of a){let T=parseInt(C.getAttribute("w:numId")||"0",10);!isNaN(T)&&T>u&&(u=T);}let c=s.ownerDocument;if(l!==null){for(let M of a){let j=O(M,"w:abstractNumId");if(j&&j.getAttribute("w:val")===l){let B=M.getAttribute("w:numId");if(B&&B!=="0")return B}}let C=c.createElement("w:num");C.setAttribute("w:numId",String(u+1));let T=c.createElement("w:abstractNumId");return T.setAttribute("w:val",l),C.appendChild(T),s.appendChild(C),delete e._adeu_numbering_cache,String(u+1)}let d=-1;for(let C of o){let T=parseInt(C.getAttribute("w:abstractNumId")||"-1",10);!isNaN(T)&&T>d&&(d=T);}let f=c.createElement("w:abstractNum");f.setAttribute("w:abstractNumId",String(d+1));let h=c.createElement("w:multiLevelType");h.setAttribute("w:val","singleLevel"),f.appendChild(h);let m=c.createElement("w:lvl");m.setAttribute("w:ilvl","0");let p=c.createElement("w:start");p.setAttribute("w:val","1"),m.appendChild(p);let _=c.createElement("w:numFmt");_.setAttribute("w:val","bullet"),m.appendChild(_);let w=c.createElement("w:lvlText");w.setAttribute("w:val","\uF0B7"),m.appendChild(w);let v=c.createElement("w:lvlJc");v.setAttribute("w:val","left"),m.appendChild(v);let b=c.createElement("w:pPr"),y=c.createElement("w:ind");y.setAttribute("w:left","720"),y.setAttribute("w:hanging","360"),b.appendChild(y),m.appendChild(b);let N=c.createElement("w:rPr"),k=c.createElement("w:rFonts");k.setAttribute("w:ascii","Symbol"),k.setAttribute("w:hAnsi","Symbol"),k.setAttribute("w:hint","default"),N.appendChild(k),m.appendChild(N),f.appendChild(m);let x=a.find(C=>C.parentNode===s)||null;x?s.insertBefore(f,x):s.appendChild(f);let P=c.createElement("w:num");P.setAttribute("w:numId",String(u+1));let A=c.createElement("w:abstractNumId");return A.setAttribute("w:val",String(d+1)),P.appendChild(A),s.appendChild(P),delete e._adeu_numbering_cache,String(u+1)}_anchor_reply_comment(e,t){let r=this.doc.part._element.ownerDocument,i=R(this.doc.element,"w:commentRangeStart").filter(_=>_.getAttribute("w:id")===e);if(i.length===0)return;let s=i[0],o=r.createElement("w:commentRangeStart");o.setAttribute("w:id",t),nt(o,s);let a=R(this.doc.element,"w:commentRangeEnd").filter(_=>_.getAttribute("w:id")===e);if(a.length===0)return;let l=a[0],u=R(this.doc.element,"w:commentReference").filter(_=>_.getAttribute("w:id")===e),c=l;if(u.length>0){let _=u[0];_.parentNode&&_.parentNode.tagName==="w:r"&&(c=_.parentNode);}let d=r.createElement("w:commentRangeEnd");d.setAttribute("w:id",t),nt(d,c);let f=r.createElement("w:r"),h=r.createElement("w:rPr"),m=r.createElement("w:rStyle");m.setAttribute("w:val","CommentReference"),h.appendChild(m),f.appendChild(h);let p=r.createElement("w:commentReference");p.setAttribute("w:id",t),f.appendChild(p),nt(f,d);}_clean_wrapping_comments(e){let t=0,r=e;for(;;){let c=Ie(r);if(c&&(c.tagName==="w:ins"||c.tagName==="w:del"))r=c;else break}let i=e;for(;;){let c=Ce(i);if(c&&(c.tagName==="w:ins"||c.tagName==="w:del"))i=c;else break}let s=[],o=Ie(r);for(;o;)if(o.tagName==="w:commentRangeStart")s.push(o),o=Ie(o);else if(o.tagName==="w:rPr"||o.tagName==="w:pPr")o=Ie(o);else break;let a=[],l=Ce(i);for(;l;)if(l.tagName==="w:commentRangeEnd")a.push(l),l=Ce(l);else if(l.tagName==="w:r"&&R(l,"w:commentReference").length>0)a.push(l),l=Ce(l);else if(l.tagName==="w:commentReference")a.push(l),l=Ce(l);else break;let u=new Set;for(let c of a)if(c.tagName==="w:commentRangeEnd"){let d=c.getAttribute("w:id");d&&u.add(d);}else {let d=R(c,"w:commentReference")[0];if(!d&&c.tagName==="w:commentReference"&&(d=c),d){let f=d.getAttribute("w:id");f&&u.add(f);}}for(let c of s){let d=c.getAttribute("w:id");if(d&&u.has(d)){this.comments_manager.deleteComment(d),t++,c.parentNode&&c.parentNode.removeChild(c);for(let f of a){let h=null;if(f.tagName==="w:commentRangeEnd")h=f.getAttribute("w:id");else {let m=R(f,"w:commentReference")[0];!m&&f.tagName==="w:commentReference"&&(m=f),m&&(h=m.getAttribute("w:id"));}h===d&&f.parentNode&&f.parentNode.removeChild(f);}}}return t}_delete_comments_in_element(e){let t=0,r=R(e,"w:commentReference");for(let i of r){let s=i.getAttribute("w:id");if(s){this.comments_manager.deleteComment(s),t++;for(let o of ["w:commentRangeStart","w:commentRangeEnd"]){let a=R(this.doc.element,o);for(let l of a)l.getAttribute("w:id")===s&&l.parentNode&&l.parentNode.removeChild(l);}}}return t}_control_gate_context(e,t,r){let i=typeof e?.controls_intersecting=="function"?e.controls_intersecting(t,r):[],s=typeof e?.controls_at=="function"?e.controls_at(t):[],o=typeof e?.controls_at=="function"?e.controls_at(Math.max(t+r-1,t)):[];return [i,s,o]}_deletes_entire_control(e,t,r,i,s){if(s.trim()!=="")return false;let a=(e?.control_ranges??[]).find(f=>f[2]===t);if(!a)return false;let[l,u]=a,c=r<=l&&r+i>=u,d=r<l||r+i>u;return c&&d}_check_control_gates(e,t,r,i,s,o="",a="",l=null,u=false){let c=this.gate_overrides,d=Array.from(r?._sdt_infos?.values()??[]),[f,h,m]=this._control_gate_context(r,i,s);l!==null&&(f=l);let p=!!t.comment&&(t.new_text||"")===(t.target_text||""),_=oc(e,this.protection,{controls:f,isCommentOnly:p,overrides:c});if(_||!p&&(_=lc(e,this.protection,c),_)||(_=cc(e,t.target_text||"",d),_))return _;if(f.length===0)return null;if(!u&&(_=dc(e,f),_)||(_=uc(e,f,t.target_text||"",t.new_text||""),_)||(_=rc(e,f,c),_)||(_=ic(e,f,c),_))return _;for(let v of f)if(this._deletes_entire_control(r,v,i,s,a)&&(_=sc(e,[v],true,c),_))return _;if(o.includes(`
120
+ `),a=[],l=999;for(let u=o.length-1;u>=0;u--){let d=o[u].match(/^(#{1,6})\s+(.*)/);if(d){let f=d[1].length;if(f<l){let h=d[2].replace(/\*\*|__|[*_]/g,"").replace(/\{#[^}]+\}/g,"").trim();if(h.length>80&&(h=h.substring(0,80)+"..."),a.unshift(h),l=f,f===1)break}}}return [a.join(" > "),i]}accept_all_revisions(e=false){let t=this._revision_roots(),r=0,i=0,s=0;for(let f of t){r+=R(f,"w:ins").length,i+=R(f,"w:del").length;for(let h of ["w:rPrChange","w:pPrChange","w:sectPrChange"])s+=R(f,h).length;}let o=this._comment_authors(),a=new Set(Object.keys(o));this.removed_comment_notes=[];for(let f of t){let h=R(f,"w:ins");for(let _ of h){this._clean_wrapping_comments(_);let w=_.parentNode;if(w){if(w.tagName==="w:trPr"){w.removeChild(_);continue}for(;_.firstChild;)w.insertBefore(_.firstChild,_);w.removeChild(_);}}let m=R(f,"w:p");for(let _ of m){let w=O(_,"w:pPr");if(w){let v=O(w,"w:rPr"),b=v?O(v,"w:del"):null;if(v&&b){let y=false;for(let N of ["w:t","w:tab","w:br"]){for(let k of R(_,N)){if(N==="w:t"&&!k.textContent)continue;let x=false,P=k.parentNode;for(;P&&P!==_;){if(P.tagName==="w:del"){x=true;break}P=P.parentNode;}if(!x){y=true;break}}if(y)break}y||this._is_last_paragraph_in_cell(_)?v.removeChild(b):(this._clean_wrapping_comments(_),this._delete_comments_in_element(_),_.parentNode&&_.parentNode.removeChild(_));}}}let p=R(f,"w:del");for(let _ of p){this._clean_wrapping_comments(_),this._delete_comments_in_element(_);let w=_.parentNode;if(w)if(w.tagName==="w:trPr"){let v=w.parentNode;v&&v.parentNode&&v.parentNode.removeChild(v);}else w.removeChild(_);}for(let _ of R(f,"w:pPrChange"))_.parentNode?.removeChild(_);}if(e)for(let f of t){for(let m of ["w:commentRangeStart","w:commentRangeEnd"])for(let p of R(f,m))p.parentNode?.removeChild(p);let h=R(f,"w:commentReference");for(let m of h){let p=m.parentNode;p&&((p.tagName==="w:r"||p.tagName.endsWith(":r"))&&Array.from(p.childNodes).filter(w=>w.nodeType===1&&w.tagName!=="w:rPr"&&w.tagName!=="rPr").length<=1?p.parentNode?.removeChild(p):p.removeChild(m));}}let l=this.doc.pkg,u=new Set;for(let f of l.parts)if(e&&f.partname.toLowerCase().includes("comments")){u.add(f.partname);let h=f.partname.startsWith("/")?f.partname:"/"+f.partname,m=f.partname.startsWith("/")?f.partname.substring(1):f.partname;u.add(h),u.add(m);}if(u.size>0){for(let h of l.parts)if(h.partname.endsWith(".rels")){let m=R(h._element,"Relationship"),p=[];for(let _ of m)if((_.getAttribute("Target")||"").toLowerCase().includes("comments")){p.push(_);let v=h.partname.replace("/_rels/","/").replace(".rels",""),b=l.getPartByPath(v);if(b){let y=_.getAttribute("Id");y&&b.rels.delete(y);}}for(let _ of p)_.parentNode?.removeChild(_);}let f=l.getPartByPath("[Content_Types].xml");if(f){let h=R(f._element,"Override"),m=[];for(let p of h){let _=p.getAttribute("PartName")||"";(u.has(_)||_.toLowerCase().includes("comments"))&&m.push(p);}for(let p of m)p.parentNode?.removeChild(p);}l.parts=l.parts.filter(h=>!h.partname.toLowerCase().includes("comments"));for(let h of Object.keys(l.unzipped))h.toLowerCase().includes("comments")&&delete l.unzipped[h];}let c=new Set(this._existing_comment_ids()),d=Array.from(a).filter(f=>!c.has(f)).sort((f,h)=>{let m=/^\d+$/.test(f)?parseInt(f,10):0,p=/^\d+$/.test(h)?parseInt(h,10):0;return m-p||f.localeCompare(h)});return this.removed_comment_notes=d.map(f=>`Com:${f} (by ${o[f]??"Unknown"})`),{accepted_insertions:r,accepted_deletions:i,accepted_formatting:s,removed_comments:d.length}}reject_all_revisions(){let e=this._revision_roots();for(let t of e){for(let o of R(t,"w:pPrChange"))this._revert_ppr_change(o);let r=R(t,"w:ins");for(let o of r){let a=o.parentNode;if(a)if(this._clean_wrapping_comments(o),this._delete_comments_in_element(o),a.tagName==="w:trPr"){let l=a.parentNode;l&&l.parentNode&&l.parentNode.removeChild(l);}else a.removeChild(o);}let i=R(t,"w:p");for(let o of i){let a=O(o,"w:pPr");if(a){let l=O(a,"w:rPr"),u=l?O(l,"w:del"):null;l&&u&&l.removeChild(u);}}let s=R(t,"w:del");for(let o of s){let a=o.parentNode;if(!a)continue;if(a.tagName==="w:trPr"){a.removeChild(o);continue}let l=Array.from(o.getElementsByTagName("w:delText"));for(let u of l){let c=o.ownerDocument.createElement("w:t");c.textContent=u.textContent,u.hasAttribute("xml:space")&&c.setAttribute("xml:space","preserve"),u.parentNode?.replaceChild(c,u);}for(;o.firstChild;)a.insertBefore(o.firstChild,o);a.removeChild(o);}}}_revert_ppr_change(e){let t=e.parentNode;if(!t||t.tagName!=="w:pPr")return;let r=t.parentNode;if(!r)return;let i=O(e,"w:pPr");if(i){let s=i.cloneNode(true);Array.from(s.childNodes).some(a=>a.nodeType===1)?r.replaceChild(s,t):r.removeChild(t);}else r.removeChild(t);}_revert_props_change(e){let t=e.parentNode;if(!t)return;let r=Array.from(e.childNodes).find(s=>s.nodeType===1);t.removeChild(e);let i=Au[t.tagName];for(let s of Array.from(t.childNodes)){if(s.nodeType!==1)continue;let o=s;o.tagName==="w:rPr"&&(O(o,"w:ins")||O(o,"w:del"))||i?.has(o.tagName)||t.removeChild(s);}if(r)for(let s of Array.from(r.childNodes))s.nodeType===1&&t.appendChild(s.cloneNode(true));}_getNextId(){return this.current_id++,this.current_id.toString()}_create_track_change_tag(e,t="",r=null){let s=this.doc.part._element.ownerDocument.createElement(e),o=r!==null?r:this._getNextId();return s.setAttribute("w:id",o),s.setAttribute("w:author",t||this.author),s.setAttribute("w:date",this.timestamp),s.setAttribute("w16du:dateUtc",this.timestamp),s}_set_text_content(e,t){e.textContent=t,t.trim()!==t&&e.setAttribute("xml:space","preserve");}_comment_anchor_in_main_story(e){let t=e;for(;t.parentNode&&t.parentNode.nodeType===1;)t=t.parentNode;return t.tagName==="w:document"}_skip_comment_outside_main_story(e,t){if(this._comment_anchor_in_main_story(e))return false;let r=e;for(;r.parentNode&&r.parentNode.nodeType===1;)r=r.parentNode;let i={"w:ftr":"footer","w:hdr":"header","w:footnotes":"footnote","w:endnotes":"endnote"}[r.tagName]||"non-body",s=`- Warning: the comment "${t.substring(0,60)}" was NOT attached: Word does not support comments inside a ${i} part, and writing one produces a document other applications cannot open. The tracked change itself was applied.`;return this.skipped_details.push(s),true}_attach_comment(e,t,r,i){if(!i||!e||!t||!r||this._skip_comment_outside_main_story(e,i))return null;let s=this.comments_manager.addComment(this.author,i),o=e.ownerDocument,a=o.createElement("w:commentRangeStart");a.setAttribute("w:id",s);let l=o.createElement("w:commentRangeEnd");l.setAttribute("w:id",s);let u=o.createElement("w:r"),c=o.createElement("w:rPr"),d=o.createElement("w:rStyle");d.setAttribute("w:val","CommentReference"),c.appendChild(d),u.appendChild(c);let f=o.createElement("w:commentReference");f.setAttribute("w:id",s),u.appendChild(f),e.insertBefore(a,t);let h=r.nextSibling;return h?(e.insertBefore(l,h),e.insertBefore(u,l.nextSibling)):(e.appendChild(l),e.appendChild(u)),s}_attach_comment_spanning(e,t,r,i,s){if(!s||!e||!r||this._skip_comment_outside_main_story(e,s)||this._skip_comment_outside_main_story(r,s))return;let o=this.comments_manager.addComment(this.author,s),a=e.ownerDocument,l=r.ownerDocument,u=a.createElement("w:commentRangeStart");u.setAttribute("w:id",o);let c=l.createElement("w:commentRangeEnd");c.setAttribute("w:id",o);let d=l.createElement("w:r"),f=l.createElement("w:rPr"),h=l.createElement("w:rStyle");h.setAttribute("w:val","CommentReference"),f.appendChild(h),d.appendChild(f);let m=l.createElement("w:commentReference");m.setAttribute("w:id",o),d.appendChild(m),e.insertBefore(u,t);let p=i.nextSibling;p?(r.insertBefore(c,p),r.insertBefore(d,c.nextSibling)):(r.appendChild(c),r.appendChild(d));}_is_native_heading_element(e){try{let t=this.doc.part||this.doc,[r,i]=lt(t);return sn({_element:e},r,i)}catch{return false}}_clone_pPr_scrubbing_headings(e,t=null){let r=e.cloneNode(true),i=O(r,"w:pStyle");if(i){let o=i.getAttribute("w:val");o&&(o.startsWith("Heading")||o==="Title"||o.replace(/\s+/g,"").startsWith("Heading")||t!==null&&this._is_native_heading_element(t))&&r.removeChild(i);}let s=O(r,"w:outlineLvl");return s&&r.removeChild(s),r}_track_insert_multiline(e,t,r,i,s=null,o=false,a=false){if(!e)return {first_node:null,last_p:null,last_ins:null,used_block_mode:false};let l=this.doc.part._element.ownerDocument,u=e.split(/[\r\n]+/),c=null;if(r!==null)c=r._element;else if(t!==null){let B=t._element;for(;B&&B.tagName!=="w:p";)B=B.parentNode;c=B;}let d=[],f=new Set(["w:r","w:ins","w:del"]),h=s&&s.parentNode?s:null,m=t!==null&&t._element.parentNode?t._element:null,p=h??m,_=a&&h===null&&m!==null;if(c!==null&&p!==null){let B=p;for(;B&&B.parentNode!==c;)if(B=B.parentNode,B===c){B=null;break}if(B){let $=_?B:B.nextSibling;for(;$;)$.nodeType===1&&f.has($.tagName)&&d.push($),$=$.nextSibling;}}else if(c!==null&&a){let B=c.firstChild;for(;B;)B.nodeType===1&&f.has(B.tagName)&&d.push(B),B=B.nextSibling;}for(;u.length>1&&u[u.length-1]===""&&d.length===0;)u.pop();if(u.length===0)return {first_node:null,last_p:null,last_ins:null,used_block_mode:false};let[w,v]=this._parse_markdown_style(u[0]),b=c!==null,y=/[\r\n]/.test(e),N=v!==null&&b&&y,k=null,x=null;N||(x=this._build_tracked_ins_for_line((w===u[0],u[0]),t,i,l,o),k=x);let P=N?u:u.slice(1);if(P.length===0)return {first_node:k,last_p:null,last_ins:x,used_block_mode:false};if(!c)return {first_node:k,last_p:null,last_ins:x,used_block_mode:false};let A=c.parentNode;if(!A)return {first_node:k,last_p:null,last_ins:x,used_block_mode:false};let C=g((B,$)=>{A.insertBefore(B,$.nextSibling);},"insertAfterEl"),T=null,M=null,j=c;for(let B=0;B<P.length;B++){let $=P[B],[I,E]=this._parse_markdown_style($),S=l.createElement("w:p");if(E)this._set_paragraph_style(S,E);else {let W=O(c,"w:pPr");W&&S.appendChild(this._clone_pPr_scrubbing_headings(W,c));}let D=O(S,"w:pPr");D||(D=l.createElement("w:pPr"),S.insertBefore(D,S.firstChild));let U=O(D,"w:rPr");U||(U=l.createElement("w:rPr"),D.appendChild(U));let z=this._create_track_change_tag("w:ins","",i);U.appendChild(z);let L=this._build_tracked_ins_for_line(I,t,i,l,o);L&&S.appendChild(L),C(S,j),j=S,T=S,M=L,k||(k=S);}if(!N&&T&&d.length>0)for(let B of d)B.parentNode?.removeChild(B),T.appendChild(B);return {first_node:k,last_p:T,last_ins:M,used_block_mode:N}}_build_tracked_ins_for_line(e,t,r,i,s=false){if(!e&&e!=="")return null;let o=this._create_track_change_tag("w:ins","",r),a=this._parse_inline_markdown(e);if(a.length===0)return null;for(let[l,u]of a){let c=i.createElement("w:r");if(t&&t._element){let f=O(t._element,"w:rPr");if(f){let h=f.cloneNode(true),m=["w:vanish","w:strike","w:dstrike","w:i","w:iCs"];s&&m.push("w:b","w:bCs");for(let p of m){let _=O(h,p);_&&h.removeChild(_);}c.appendChild(h);}}this._apply_run_props(c,u,false);let d=i.createElement("w:t");this._set_text_content(d,l),c.appendChild(d),o.appendChild(c);}return o}_parse_markdown_style(e){let t=e.trimStart();if(t.startsWith("#")){let i=0,s=t;for(;s.startsWith("#");)i++,s=s.substring(1);if(s.startsWith(" "))return [s.trim(),`Heading ${i}`]}if(t.startsWith("* ")||t.startsWith("- "))return [t.substring(2).trim(),"List Paragraph"];let r=t.match(/^1\.\s+/);return r?[t.substring(r[0].length).trim(),"List Number"]:[e,null]}_edit_declares_emphasis(e){for(let t of [e?.target_text,e?.new_text]){if(!t||!t.includes("**")&&!t.includes("_"))continue;if(this._parse_inline_markdown(t).some(([,i])=>i&&Object.keys(i).length>0))return true}return false}_is_escaped(e,t){let r=0,i=t-1;for(;i>=0&&e[i]==="\\";)r++,i--;return r%2===1}_unescape_markdown(e){return e.replace(/\\([\\*_])/g,"$1")}_is_word_char(e){return /[\p{L}\p{N}_]/u.test(e)}_is_space(e){return e==="\uFEFF"?false:/^\s$/u.test(e)||e==="\x85"||e>=""&&e<=""}_prev_char(e,t){if(t<=0)return "";let r=e.charCodeAt(t-1);if(r>=56320&&r<=57343&&t-2>=0){let i=e.charCodeAt(t-2);if(i>=55296&&i<=56319)return e.slice(t-2,t)}return e[t-1]}_next_char(e,t){if(t>=e.length)return "";let r=e.charCodeAt(t);if(r>=55296&&r<=56319&&t+1<e.length){let i=e.charCodeAt(t+1);if(i>=56320&&i<=57343)return e.slice(t,t+2)}return e[t]}_find_next_emphasis(e){let t=e.length,r=0;for(;r<t;){if(r+1<t&&e.substring(r,r+2)==="**"&&!this._is_escaped(e,r)&&r+2<t&&e[r+2]!=="*"&&!this._is_space(this._next_char(e,r+2))){let i=r+2;for(;i+1<t;)if(e.substring(i,i+2)==="**"&&!this._is_escaped(e,i)){if(!this._is_space(this._prev_char(e,i))){let s=e.substring(r+2,i);if(s&&!/^[*]+$/.test(s))return [r,i+2,"bold",s]}i+=2;}else i++;}if(e[r]==="_"&&!this._is_escaped(e,r)){let i=r>0&&e[r-1]==="_",s=r+1<t&&e[r+1]==="_",o=r>0&&this._is_word_char(this._prev_char(e,r)),a=r+1===t||this._is_space(this._next_char(e,r+1));if(!i&&!s&&!o&&!a){let l=r+1;for(;l<t;){if(e[l]==="_"&&!this._is_escaped(e,l)){let u=this._is_space(this._prev_char(e,l)),c=e[l-1]==="_",d=l+1<t&&e[l+1]==="_",f=l+1<t&&this._is_word_char(this._next_char(e,l+1));if(!u&&!c&&!d&&!f){let h=e.substring(r+1,l);if(h&&!/^[_]+$/.test(h))return [r,l+1,"italic",h]}}l++;}}}r++;}return null}_parse_inline_markdown(e,t={}){if(!e)return [];let r=this._find_next_emphasis(e);if(!r)return [[this._unescape_markdown(e),t]];let[i,s,o,a]=r,l=e.substring(0,i),u=e.substring(s),c=[];l&&c.push([this._unescape_markdown(l),t]);let d={...t};return o==="bold"?d.bold=true:d.italic=true,c.push(...this._parse_inline_markdown(a,d)),c.push(...this._parse_inline_markdown(u,t)),c}_apply_run_props(e,t,r=false){if(!t){if(!r)return;t={};}let i=O(e,"w:rPr");if(!i&&(t.bold||t.italic||r)&&(i=e.ownerDocument.createElement("w:rPr"),e.appendChild(i)),i){let s=e.ownerDocument;if(t.bold){let o=O(i,"w:b");o||(o=s.createElement("w:b"),i.appendChild(o)),o.setAttribute("w:val","1");}else if(r){let o=O(i,"w:b");o&&i.removeChild(o);}if(t.italic){let o=O(i,"w:i");o||(o=s.createElement("w:i"),i.appendChild(o)),o.setAttribute("w:val","1");}else if(r){let o=O(i,"w:i");o&&i.removeChild(o);}}}_set_paragraph_style(e,t,r=null){let i=e.ownerDocument,s=O(e,"w:pPr");s&&e.removeChild(s);let o=i.createElement("w:pPr"),a=i.createElement("w:pStyle"),l=t.replace(/\s+/g,"");if(a.setAttribute("w:val",l),o.appendChild(a),l==="ListParagraph"){let u=this._ensure_bullet_num_id();if(u){let c=i.createElement("w:numPr"),d=i.createElement("w:ilvl");d.setAttribute("w:val","0");let f=i.createElement("w:numId");f.setAttribute("w:val",u),c.appendChild(d),c.appendChild(f),o.appendChild(c);}}if(r!==null){let u=this._create_track_change_tag("w:pPrChange","",r),c=s?s.cloneNode(true):i.createElement("w:pPr"),d=O(c,"w:pPrChange");d&&c.removeChild(d),u.appendChild(c),o.appendChild(u);}e.insertBefore(o,e.firstChild);}static _NUMBERING_CT="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml";static _NUMBERING_RT="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering";_ensure_bullet_num_id(){let e=this.doc.pkg,t="http://schemas.openxmlformats.org/wordprocessingml/2006/main",r='<w:lvl w:ilvl="0"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="\uF0B7"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="720" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/></w:rPr></w:lvl>',i=e.parts.find(C=>String(C.partname).replace(/^\//,"")==="word/numbering.xml");if(!i){let C=`<w:numbering xmlns:w="${t}"><w:abstractNum w:abstractNumId="0"><w:multiLevelType w:val="singleLevel"/>`+r+'</w:abstractNum><w:num w:numId="1"><w:abstractNumId w:val="0"/></w:num></w:numbering>';try{i=e.addPart("/word/numbering.xml",Z._NUMBERING_CT,C),this.doc.relateTo(i,Z._NUMBERING_RT);}catch{return null}return delete e._adeu_numbering_cache,"1"}let s=i._element,o=R(s,"w:abstractNum"),a=R(s,"w:num"),l=null;for(let C of o){let T=C.getAttribute("w:abstractNumId");if(T!==null){for(let M of R(C,"w:lvl")){if((M.getAttribute("w:ilvl")||"0")!=="0")continue;let j=O(M,"w:numFmt");j&&j.getAttribute("w:val")==="bullet"&&(l=T);break}if(l!==null)break}}let u=0;for(let C of a){let T=parseInt(C.getAttribute("w:numId")||"0",10);!isNaN(T)&&T>u&&(u=T);}let c=s.ownerDocument;if(l!==null){for(let M of a){let j=O(M,"w:abstractNumId");if(j&&j.getAttribute("w:val")===l){let B=M.getAttribute("w:numId");if(B&&B!=="0")return B}}let C=c.createElement("w:num");C.setAttribute("w:numId",String(u+1));let T=c.createElement("w:abstractNumId");return T.setAttribute("w:val",l),C.appendChild(T),s.appendChild(C),delete e._adeu_numbering_cache,String(u+1)}let d=-1;for(let C of o){let T=parseInt(C.getAttribute("w:abstractNumId")||"-1",10);!isNaN(T)&&T>d&&(d=T);}let f=c.createElement("w:abstractNum");f.setAttribute("w:abstractNumId",String(d+1));let h=c.createElement("w:multiLevelType");h.setAttribute("w:val","singleLevel"),f.appendChild(h);let m=c.createElement("w:lvl");m.setAttribute("w:ilvl","0");let p=c.createElement("w:start");p.setAttribute("w:val","1"),m.appendChild(p);let _=c.createElement("w:numFmt");_.setAttribute("w:val","bullet"),m.appendChild(_);let w=c.createElement("w:lvlText");w.setAttribute("w:val","\uF0B7"),m.appendChild(w);let v=c.createElement("w:lvlJc");v.setAttribute("w:val","left"),m.appendChild(v);let b=c.createElement("w:pPr"),y=c.createElement("w:ind");y.setAttribute("w:left","720"),y.setAttribute("w:hanging","360"),b.appendChild(y),m.appendChild(b);let N=c.createElement("w:rPr"),k=c.createElement("w:rFonts");k.setAttribute("w:ascii","Symbol"),k.setAttribute("w:hAnsi","Symbol"),k.setAttribute("w:hint","default"),N.appendChild(k),m.appendChild(N),f.appendChild(m);let x=a.find(C=>C.parentNode===s)||null;x?s.insertBefore(f,x):s.appendChild(f);let P=c.createElement("w:num");P.setAttribute("w:numId",String(u+1));let A=c.createElement("w:abstractNumId");return A.setAttribute("w:val",String(d+1)),P.appendChild(A),s.appendChild(P),delete e._adeu_numbering_cache,String(u+1)}_anchor_reply_comment(e,t){let r=this.doc.part._element.ownerDocument,i=R(this.doc.element,"w:commentRangeStart").filter(_=>_.getAttribute("w:id")===e);if(i.length===0)return;let s=i[0],o=r.createElement("w:commentRangeStart");o.setAttribute("w:id",t),nt(o,s);let a=R(this.doc.element,"w:commentRangeEnd").filter(_=>_.getAttribute("w:id")===e);if(a.length===0)return;let l=a[0],u=R(this.doc.element,"w:commentReference").filter(_=>_.getAttribute("w:id")===e),c=l;if(u.length>0){let _=u[0];_.parentNode&&_.parentNode.tagName==="w:r"&&(c=_.parentNode);}let d=r.createElement("w:commentRangeEnd");d.setAttribute("w:id",t),nt(d,c);let f=r.createElement("w:r"),h=r.createElement("w:rPr"),m=r.createElement("w:rStyle");m.setAttribute("w:val","CommentReference"),h.appendChild(m),f.appendChild(h);let p=r.createElement("w:commentReference");p.setAttribute("w:id",t),f.appendChild(p),nt(f,d);}_clean_wrapping_comments(e){let t=0,r=e;for(;;){let c=Ie(r);if(c&&(c.tagName==="w:ins"||c.tagName==="w:del"))r=c;else break}let i=e;for(;;){let c=Ce(i);if(c&&(c.tagName==="w:ins"||c.tagName==="w:del"))i=c;else break}let s=[],o=Ie(r);for(;o;)if(o.tagName==="w:commentRangeStart")s.push(o),o=Ie(o);else if(o.tagName==="w:rPr"||o.tagName==="w:pPr")o=Ie(o);else break;let a=[],l=Ce(i);for(;l;)if(l.tagName==="w:commentRangeEnd")a.push(l),l=Ce(l);else if(l.tagName==="w:r"&&R(l,"w:commentReference").length>0)a.push(l),l=Ce(l);else if(l.tagName==="w:commentReference")a.push(l),l=Ce(l);else break;let u=new Set;for(let c of a)if(c.tagName==="w:commentRangeEnd"){let d=c.getAttribute("w:id");d&&u.add(d);}else {let d=R(c,"w:commentReference")[0];if(!d&&c.tagName==="w:commentReference"&&(d=c),d){let f=d.getAttribute("w:id");f&&u.add(f);}}for(let c of s){let d=c.getAttribute("w:id");if(d&&u.has(d)){this.comments_manager.deleteComment(d),t++,c.parentNode&&c.parentNode.removeChild(c);for(let f of a){let h=null;if(f.tagName==="w:commentRangeEnd")h=f.getAttribute("w:id");else {let m=R(f,"w:commentReference")[0];!m&&f.tagName==="w:commentReference"&&(m=f),m&&(h=m.getAttribute("w:id"));}h===d&&f.parentNode&&f.parentNode.removeChild(f);}}}return t}_delete_comments_in_element(e){let t=0,r=R(e,"w:commentReference");for(let i of r){let s=i.getAttribute("w:id");if(s){this.comments_manager.deleteComment(s),t++;for(let o of ["w:commentRangeStart","w:commentRangeEnd"]){let a=R(this.doc.element,o);for(let l of a)l.getAttribute("w:id")===s&&l.parentNode&&l.parentNode.removeChild(l);}}}return t}_control_gate_context(e,t,r){let i=typeof e?.controls_intersecting=="function"?e.controls_intersecting(t,r):[],s=typeof e?.controls_at=="function"?e.controls_at(t):[],o=typeof e?.controls_at=="function"?e.controls_at(Math.max(t+r-1,t)):[];return [i,s,o]}_deletes_entire_control(e,t,r,i,s){if(s.trim()!=="")return false;let a=(e?.control_ranges??[]).find(f=>f[2]===t);if(!a)return false;let[l,u]=a,c=r<=l&&r+i>=u,d=r<l||r+i>u;return c&&d}_check_control_gates(e,t,r,i,s,o="",a="",l=null,u=false){let c=this.gate_overrides,d=Array.from(r?._sdt_infos?.values()??[]),[f,h,m]=this._control_gate_context(r,i,s);l!==null&&(f=l);let p=!!t.comment&&(t.new_text||"")===(t.target_text||""),_=oc(e,this.protection,{controls:f,isCommentOnly:p,overrides:c});if(_||!p&&(_=lc(e,this.protection,c),_)||(_=cc(e,t.target_text||"",d),_))return _;if(f.length===0)return null;if(!u&&(_=dc(e,f),_)||(_=uc(e,f,t.target_text||"",t.new_text||""),_)||(_=rc(e,f,c),_)||(_=ic(e,f,c),_))return _;for(let v of f)if(this._deletes_entire_control(r,v,i,s,a)&&(_=sc(e,[v],true,c),_))return _;if(o.includes(`
121
121
 
122
122
  `)&&!a.includes(`
123
123
 
@@ -1 +1 @@
1
- {"inputs":{"shims/module.js":{"bytes":224,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"cjs"},"../../node_modules/fflate/esm/index.mjs":{"bytes":91765,"imports":[{"path":"shims/module.js","kind":"import-statement","original":"module"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"../../node_modules/diff-match-patch/index.js":{"bytes":78052,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"cjs"},"../core/dist/index.js":{"bytes":603961,"imports":[{"path":"../../node_modules/fflate/esm/index.mjs","kind":"import-statement","original":"fflate"},{"path":"../../node_modules/diff-match-patch/index.js","kind":"import-statement","original":"diff-match-patch"},{"path":"../../node_modules/fflate/esm/index.mjs","kind":"import-statement","original":"fflate"},{"path":"../../node_modules/diff-match-patch/index.js","kind":"import-statement","original":"diff-match-patch"},{"path":"path","kind":"import-statement","external":true},{"path":"../../node_modules/fflate/esm/index.mjs","kind":"import-statement","original":"fflate"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/GenericFunctions.ts":{"bytes":20505,"imports":[{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/hydrateToolOutput.operation.ts":{"bytes":8418,"imports":[{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/extractMarkdown.operation.ts":{"bytes":5503,"imports":[{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/extractOutline.operation.ts":{"bytes":3088,"imports":[{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/applyEdits.operation.ts":{"bytes":15709,"imports":[{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/applyTextRevision.operation.ts":{"bytes":7550,"imports":[{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/generateDiff.operation.ts":{"bytes":10537,"imports":[{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/finalizeDocument.operation.ts":{"bytes":8501,"imports":[{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/index.ts":{"bytes":8092,"imports":[{"path":"nodes/Adeu/descriptions/extractMarkdown.operation.ts","kind":"import-statement","original":"./extractMarkdown.operation"},{"path":"nodes/Adeu/descriptions/extractOutline.operation.ts","kind":"import-statement","original":"./extractOutline.operation"},{"path":"nodes/Adeu/descriptions/applyEdits.operation.ts","kind":"import-statement","original":"./applyEdits.operation"},{"path":"nodes/Adeu/descriptions/applyTextRevision.operation.ts","kind":"import-statement","original":"./applyTextRevision.operation"},{"path":"nodes/Adeu/descriptions/generateDiff.operation.ts","kind":"import-statement","original":"./generateDiff.operation"},{"path":"nodes/Adeu/descriptions/finalizeDocument.operation.ts","kind":"import-statement","original":"./finalizeDocument.operation"},{"path":"nodes/Adeu/descriptions/hydrateToolOutput.operation.ts","kind":"import-statement","original":"./hydrateToolOutput.operation"}],"format":"esm"},"nodes/Adeu/Adeu.node.ts":{"bytes":7639,"imports":[{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"nodes/Adeu/descriptions/hydrateToolOutput.operation.ts","kind":"import-statement","original":"./descriptions/hydrateToolOutput.operation"},{"path":"nodes/Adeu/descriptions/index.ts","kind":"import-statement","original":"./descriptions"},{"path":"nodes/Adeu/descriptions/extractMarkdown.operation.ts","kind":"import-statement","original":"./descriptions/extractMarkdown.operation"},{"path":"nodes/Adeu/descriptions/extractOutline.operation.ts","kind":"import-statement","original":"./descriptions/extractOutline.operation"},{"path":"nodes/Adeu/descriptions/applyEdits.operation.ts","kind":"import-statement","original":"./descriptions/applyEdits.operation"},{"path":"nodes/Adeu/descriptions/applyTextRevision.operation.ts","kind":"import-statement","original":"./descriptions/applyTextRevision.operation"},{"path":"nodes/Adeu/descriptions/generateDiff.operation.ts","kind":"import-statement","original":"./descriptions/generateDiff.operation"},{"path":"nodes/Adeu/descriptions/finalizeDocument.operation.ts","kind":"import-statement","original":"./descriptions/finalizeDocument.operation"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"./GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/nodes/Adeu/Adeu.node.js":{"imports":[{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"n8n-workflow","kind":"import-statement","external":true}],"exports":["Adeu"],"entryPoint":"nodes/Adeu/Adeu.node.ts","inputs":{"shims/module.js":{"bytesInOutput":121},"../../node_modules/diff-match-patch/index.js":{"bytesInOutput":19270},"nodes/Adeu/Adeu.node.ts":{"bytesInOutput":4900},"nodes/Adeu/descriptions/hydrateToolOutput.operation.ts":{"bytesInOutput":5290},"nodes/Adeu/GenericFunctions.ts":{"bytesInOutput":9107},"../../node_modules/fflate/esm/index.mjs":{"bytesInOutput":13282},"../core/dist/index.js":{"bytesInOutput":261897},"nodes/Adeu/descriptions/extractMarkdown.operation.ts":{"bytesInOutput":3222},"nodes/Adeu/descriptions/extractOutline.operation.ts":{"bytesInOutput":1244},"nodes/Adeu/descriptions/applyEdits.operation.ts":{"bytesInOutput":10173},"nodes/Adeu/descriptions/applyTextRevision.operation.ts":{"bytesInOutput":4344},"nodes/Adeu/descriptions/generateDiff.operation.ts":{"bytesInOutput":5608},"nodes/Adeu/descriptions/finalizeDocument.operation.ts":{"bytesInOutput":5496},"nodes/Adeu/descriptions/index.ts":{"bytesInOutput":6032}},"bytes":350596}}}
1
+ {"inputs":{"shims/module.js":{"bytes":224,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"cjs"},"../../node_modules/fflate/esm/index.mjs":{"bytes":91765,"imports":[{"path":"shims/module.js","kind":"import-statement","original":"module"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"../../node_modules/diff-match-patch/index.js":{"bytes":78052,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"cjs"},"../core/dist/index.js":{"bytes":607836,"imports":[{"path":"../../node_modules/fflate/esm/index.mjs","kind":"import-statement","original":"fflate"},{"path":"../../node_modules/diff-match-patch/index.js","kind":"import-statement","original":"diff-match-patch"},{"path":"../../node_modules/fflate/esm/index.mjs","kind":"import-statement","original":"fflate"},{"path":"../../node_modules/diff-match-patch/index.js","kind":"import-statement","original":"diff-match-patch"},{"path":"path","kind":"import-statement","external":true},{"path":"../../node_modules/fflate/esm/index.mjs","kind":"import-statement","original":"fflate"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/GenericFunctions.ts":{"bytes":20505,"imports":[{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/hydrateToolOutput.operation.ts":{"bytes":8418,"imports":[{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/extractMarkdown.operation.ts":{"bytes":5503,"imports":[{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/extractOutline.operation.ts":{"bytes":3088,"imports":[{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/applyEdits.operation.ts":{"bytes":15709,"imports":[{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/applyTextRevision.operation.ts":{"bytes":7550,"imports":[{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/generateDiff.operation.ts":{"bytes":10537,"imports":[{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/finalizeDocument.operation.ts":{"bytes":8501,"imports":[{"path":"../core/dist/index.js","kind":"import-statement","original":"@adeu/core"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"../GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"nodes/Adeu/descriptions/index.ts":{"bytes":8092,"imports":[{"path":"nodes/Adeu/descriptions/extractMarkdown.operation.ts","kind":"import-statement","original":"./extractMarkdown.operation"},{"path":"nodes/Adeu/descriptions/extractOutline.operation.ts","kind":"import-statement","original":"./extractOutline.operation"},{"path":"nodes/Adeu/descriptions/applyEdits.operation.ts","kind":"import-statement","original":"./applyEdits.operation"},{"path":"nodes/Adeu/descriptions/applyTextRevision.operation.ts","kind":"import-statement","original":"./applyTextRevision.operation"},{"path":"nodes/Adeu/descriptions/generateDiff.operation.ts","kind":"import-statement","original":"./generateDiff.operation"},{"path":"nodes/Adeu/descriptions/finalizeDocument.operation.ts","kind":"import-statement","original":"./finalizeDocument.operation"},{"path":"nodes/Adeu/descriptions/hydrateToolOutput.operation.ts","kind":"import-statement","original":"./hydrateToolOutput.operation"}],"format":"esm"},"nodes/Adeu/Adeu.node.ts":{"bytes":7639,"imports":[{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"nodes/Adeu/descriptions/hydrateToolOutput.operation.ts","kind":"import-statement","original":"./descriptions/hydrateToolOutput.operation"},{"path":"nodes/Adeu/descriptions/index.ts","kind":"import-statement","original":"./descriptions"},{"path":"nodes/Adeu/descriptions/extractMarkdown.operation.ts","kind":"import-statement","original":"./descriptions/extractMarkdown.operation"},{"path":"nodes/Adeu/descriptions/extractOutline.operation.ts","kind":"import-statement","original":"./descriptions/extractOutline.operation"},{"path":"nodes/Adeu/descriptions/applyEdits.operation.ts","kind":"import-statement","original":"./descriptions/applyEdits.operation"},{"path":"nodes/Adeu/descriptions/applyTextRevision.operation.ts","kind":"import-statement","original":"./descriptions/applyTextRevision.operation"},{"path":"nodes/Adeu/descriptions/generateDiff.operation.ts","kind":"import-statement","original":"./descriptions/generateDiff.operation"},{"path":"nodes/Adeu/descriptions/finalizeDocument.operation.ts","kind":"import-statement","original":"./descriptions/finalizeDocument.operation"},{"path":"nodes/Adeu/GenericFunctions.ts","kind":"import-statement","original":"./GenericFunctions"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/nodes/Adeu/Adeu.node.js":{"imports":[{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"n8n-workflow","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"n8n-workflow","kind":"import-statement","external":true}],"exports":["Adeu"],"entryPoint":"nodes/Adeu/Adeu.node.ts","inputs":{"shims/module.js":{"bytesInOutput":121},"../../node_modules/diff-match-patch/index.js":{"bytesInOutput":19270},"nodes/Adeu/Adeu.node.ts":{"bytesInOutput":4900},"nodes/Adeu/descriptions/hydrateToolOutput.operation.ts":{"bytesInOutput":5290},"nodes/Adeu/GenericFunctions.ts":{"bytesInOutput":9107},"../../node_modules/fflate/esm/index.mjs":{"bytesInOutput":13282},"../core/dist/index.js":{"bytesInOutput":263355},"nodes/Adeu/descriptions/extractMarkdown.operation.ts":{"bytesInOutput":3222},"nodes/Adeu/descriptions/extractOutline.operation.ts":{"bytesInOutput":1244},"nodes/Adeu/descriptions/applyEdits.operation.ts":{"bytesInOutput":10173},"nodes/Adeu/descriptions/applyTextRevision.operation.ts":{"bytesInOutput":4344},"nodes/Adeu/descriptions/generateDiff.operation.ts":{"bytesInOutput":5608},"nodes/Adeu/descriptions/finalizeDocument.operation.ts":{"bytesInOutput":5496},"nodes/Adeu/descriptions/index.ts":{"bytesInOutput":6032}},"bytes":352054}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-adeu",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "n8n community node for Adeu — apply AI-driven tracked changes, generate diffs, and sanitize Microsoft Word (.docx) documents.",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -49,7 +49,7 @@
49
49
  "n8n-workflow": "*"
50
50
  },
51
51
  "devDependencies": {
52
- "@adeu/core": "^3.0.5",
52
+ "@adeu/core": "^3.0.6",
53
53
  "@n8n/eslint-plugin-community-nodes": "^0.32.0",
54
54
  "@types/node": "^26.4.0",
55
55
  "@typescript-eslint/parser": "^8.68.0",