n8n-nodes-adeu 3.0.3 → 3.0.5
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.3";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.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=[`
|
|
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(`
|
|
@@ -150,7 +150,7 @@ ${s}`);}let i=true;for(let s of We(n))if(s.constructor.name==="FootnoteItem"){le
|
|
|
150
150
|
`)&&x.length===P.length){let C=[],T=u,M=false;for(let j=0;j<x.length;j++){let B=x[j],$=P[j];if(B!==$){let I=e.comment&&!M?e.comment:null,E=this._word_diff_sub_edits(B,$,T,I,false,o);E.some(S=>S.comment!==null&&S.comment!==void 0)&&(M=true);for(let S of E)S._split_group_id=u,C.push(S);}T+=B.length+2;}if(C.length>0){for(let j of C)l.push(j);continue}}if(!y&&N){l.push({type:"modify",target_text:"",new_text:N,comment:e.comment,_resolved_start_idx:k,_match_start_index:k,_internal_op:"INSERTION",_active_mapper_ref:o});continue}let A=this._word_diff_sub_edits(d,f,u,e.comment,false,o);for(let C of A)C._split_group_id=u,l.push(C);}return l.length===0?null:r==="all"||l.length>1?l:l[0]}_insert_and_split_ins(e,t,r,i=false){let s=e.parentNode;if(!s)return;let o=e.cloneNode(false),a=e.cloneNode(false),l=false;for(let u of Array.from(e.childNodes))e.removeChild(u),i&&u===t&&(l=true),l?a.appendChild(u):(o.appendChild(u),u===t&&(l=true));o.childNodes.length>0&&s.insertBefore(o,e),s.insertBefore(r,e),a.childNodes.length>0&&s.insertBefore(a,e),s.removeChild(e);}_apply_comment_only(e,t,r,i,s){let o=t.find_target_runs_by_index(r,i,s);if(o.length===0)return false;if(!e.comment)return true;let a=o[0]._element,l=o[o.length-1]._element,u=a;for(;u&&u.tagName!=="w:p";)u=u.parentNode;let c=l;for(;c&&c.tagName!=="w:p";)c=c.parentNode;if(!u||!c)return false;let d=g((m,p)=>{let _=m;for(;_.parentNode&&_.parentNode!==p;)_=_.parentNode;return _},"ascend_to_paragraph_child"),f=d(a,u),h=d(l,c);return u===c?this._attach_comment(u,f,h,e.comment):this._attach_comment_spanning(u,f,c,h,e.comment),true}_apply_single_edit_indexed(e,t,r){let i=e._internal_op,s=e._active_mapper_ref||this.mapper,o=e._resolved_start_idx!==void 0&&e._resolved_start_idx!==null?e._resolved_start_idx:e._match_start_index||0,a=e.target_text?e.target_text.length:0;i==null&&(!e.target_text&&e.new_text?i="INSERTION":e.target_text&&!e.new_text?i="DELETION":i="MODIFICATION");let l=this._edit_declares_emphasis(e),u=null;if(i==="STYLE_ONLY"||i==="STYLE_AND_TEXT"){let[y,N]=s.get_insertion_anchor(o,r),k=null;if(N)k=N._element;else if(y){let x=y._element;for(;x&&x.tagName!=="w:p";)x=x.parentNode;k=x;}if(k&&e._new_style&&(i==="STYLE_ONLY"?this._set_paragraph_style(k,e._new_style,this._getNextId()):u=k),i==="STYLE_ONLY"){if(e.comment){let x=s.find_target_runs_by_index(o,a,r);if(x.length>0){let P=x[0]._element,A=x[x.length-1]._element,C=P;for(;C&&C.tagName!=="w:p";)C=C.parentNode;let T=A;for(;T&&T.tagName!=="w:p";)T=T.parentNode;if(C&&T){let M=g(($,I)=>{let E=$;for(;E.parentNode&&E.parentNode!==I;)E=E.parentNode;return E},"ascend_to_paragraph_child"),j=M(P,C),B=M(A,T);C===T?this._attach_comment(C,j,B,e.comment):this._attach_comment_spanning(C,j,T,B,e.comment);}}}return true}e.target_text&&e.new_text?i="MODIFICATION":!e.target_text&&e.new_text?i="INSERTION":e.target_text&&!e.new_text?i="DELETION":i="COMMENT_ONLY";}let c=["DELETION","MODIFICATION"].includes(i)?(e._reserved_del_id??null)!==null?String(e._reserved_del_id):this._getNextId():null,d=["INSERTION","MODIFICATION"].includes(i)?(e._reserved_ins_id??null)!==null?String(e._reserved_ins_id):this._getNextId():null;if(u&&e._new_style&&this._set_paragraph_style(u,e._new_style,d??c??this._getNextId()),i==="COMMENT_ONLY")return this._apply_comment_only(e,s,o,a,r);if(i==="INSERTION"){let y=e.new_text||"",N=null,k=typeof s.part_boundary_at=="function"?s.part_boundary_at(o):null,x=!e.target_text&&(e._parent_edit_ref===void 0||e._parent_edit_ref===null);if(k!==null&&x){let[$,I]=k,E=s.part_kind_of($),S=s.part_kind_of(I);if(E==="body"&&S!=="body"){let D=s.spans.filter(U=>U.run!==null&&U.part_index===$);D.length>0&&(N=D[D.length-1]);}}let P,A;if(N!==null?(P=N.run,A=N.paragraph,y.startsWith(`
|
|
151
151
|
`)||(y=`
|
|
152
152
|
|
|
153
|
-
`+y)):e._insert_host_el?(P=null,A=null):[P,A]=s.get_insertion_anchor(o,r),!P&&!A&&!e._insert_host_el||Z._introduces_table_row_text(s,o,1,"",y))return false;let C=y,T=N===null&&/\n\s*$/.test(C),M=null;{let $=s.spans.filter(I=>I.paragraph!==null&&I.start===o);$.length>0&&$[0].paragraph&&(M=$[0].paragraph._element);}if(T&&M&&M.parentNode){let $=M.parentNode,I=this.doc.part._element.ownerDocument,E=C.split(/[\r\n]+/).filter(z=>z!==""),S=null,D=null,U=null;for(let z of E){let[L,W]=this._parse_markdown_style(z),X=I.createElement("w:p");if(W)this._set_paragraph_style(X,W);else {let xe=O(M,"w:pPr");xe&&X.appendChild(this._clone_pPr_scrubbing_headings(xe,M));}let q=O(X,"w:pPr");q||(q=I.createElement("w:pPr"),X.insertBefore(q,X.firstChild));let J=O(q,"w:rPr");J||(J=I.createElement("w:rPr"),q.appendChild(J)),J.appendChild(this._create_track_change_tag("w:ins","",d));let _e=this._build_tracked_ins_for_line(L,P,d,I,l);_e&&X.appendChild(_e),$.insertBefore(X,M),S||(S=X),D=X,U=_e;}if(S){if(e.comment&&D&&U){let z=g((W,X)=>{let q=W;for(;q.parentNode&&q.parentNode!==X;)q=q.parentNode;return q},"ascend"),L=R(S,"w:ins")[0]||S;this._attach_comment_spanning(S,z(L,S),D,z(U,D),e.comment);}return true}}let j=this._track_insert_multiline(y,P,A,d,null,l,o===0||P===null&&A!==null);if(!j.first_node)return false;if(j.first_node.tagName==="w:ins"){if(e._insert_host_el)e._insert_host_el.appendChild(j.first_node);else if(P){let $=P._element,I=$.parentNode;I&&I.tagName==="w:del"&&($=I,I=$.parentNode);let E=o===0;I&&I.tagName==="w:ins"?this._insert_and_split_ins(I,$,j.first_node,E):E&&I?I.insertBefore(j.first_node,$):nt(j.first_node,$);}else if(A){let $=A._element,I=$.firstChild;for(;I&&I.tagName==="w:pPr";)I=I.nextSibling;$.insertBefore(j.first_node,I);}}if(e.comment){let $=g((I,E)=>{let S=I;for(;S.parentNode&&S.parentNode!==E;)S=S.parentNode;return S},"ascend_to_paragraph_child");if(j.last_p&&j.last_ins){let I=j.first_node;for(;I&&I.tagName!=="w:p";)I=I.parentNode;if(I){let E=j.first_node;j.first_node.tagName==="w:p"&&(E=R(j.first_node,"w:ins")[0]||j.first_node);let S=$(E,I),D=$(j.last_ins,j.last_p);this._attach_comment_spanning(I,S,j.last_p,D,e.comment);}}else {let I=j.first_node;for(;I&&I.tagName!=="w:p";)I=I.parentNode;if(I){let E=j.first_node;j.first_node.tagName==="w:p"&&(E=R(j.first_node,"w:ins")[0]||j.first_node);let S=$(E,I);this._attach_comment(I,S,S,e.comment);}}}return true}if((i==="DELETION"||i==="MODIFICATION")&&a&&s.part_ranges.filter(y=>y[1]>y[0]).length>1){let y=new Set;for(let N of s.spans)N.run!==null&&N.end>o&&N.start<o+a&&y.add(N.part_index);if(y.size>1)return false}if((i==="DELETION"||i==="MODIFICATION")&&a){let y=this._apply_gate_refusal(s,o,a,e._parent_edit_ref?.type==="set_field");if(y)return e._error_msg||(e._error_msg=y),false}let f=s.find_target_runs_by_index(o,a,r),h=s.get_virtual_spans_in_range(o,a);if(f.length===0&&h.length===0)return false;let m=new Set;for(let y of f){let N=y._element.parentNode;for(;N&&N.tagName!=="w:p";)N=N.parentNode;N&&m.add(N);}let p=null,_=null;for(let y of f){let N=this._create_track_change_tag("w:del","",c),
|
|
153
|
+
`+y)):e._insert_host_el?(P=null,A=null):[P,A]=s.get_insertion_anchor(o,r),!P&&!A&&!e._insert_host_el||Z._introduces_table_row_text(s,o,1,"",y))return false;let C=y,T=N===null&&/\n\s*$/.test(C),M=null;{let $=s.spans.filter(I=>I.paragraph!==null&&I.start===o);$.length>0&&$[0].paragraph&&(M=$[0].paragraph._element);}if(T&&M&&M.parentNode){let $=M.parentNode,I=this.doc.part._element.ownerDocument,E=C.split(/[\r\n]+/).filter(z=>z!==""),S=null,D=null,U=null;for(let z of E){let[L,W]=this._parse_markdown_style(z),X=I.createElement("w:p");if(W)this._set_paragraph_style(X,W);else {let xe=O(M,"w:pPr");xe&&X.appendChild(this._clone_pPr_scrubbing_headings(xe,M));}let q=O(X,"w:pPr");q||(q=I.createElement("w:pPr"),X.insertBefore(q,X.firstChild));let J=O(q,"w:rPr");J||(J=I.createElement("w:rPr"),q.appendChild(J)),J.appendChild(this._create_track_change_tag("w:ins","",d));let _e=this._build_tracked_ins_for_line(L,P,d,I,l);_e&&X.appendChild(_e),$.insertBefore(X,M),S||(S=X),D=X,U=_e;}if(S){if(e.comment&&D&&U){let z=g((W,X)=>{let q=W;for(;q.parentNode&&q.parentNode!==X;)q=q.parentNode;return q},"ascend"),L=R(S,"w:ins")[0]||S;this._attach_comment_spanning(S,z(L,S),D,z(U,D),e.comment);}return true}}let j=this._track_insert_multiline(y,P,A,d,null,l,o===0||P===null&&A!==null);if(!j.first_node)return false;if(j.first_node.tagName==="w:ins"){if(e._insert_host_el)e._insert_host_el.appendChild(j.first_node);else if(P){let $=P._element,I=$.parentNode;I&&I.tagName==="w:del"&&($=I,I=$.parentNode);let E=o===0;I&&I.tagName==="w:ins"?this._insert_and_split_ins(I,$,j.first_node,E):E&&I?I.insertBefore(j.first_node,$):nt(j.first_node,$);}else if(A){let $=A._element,I=$.firstChild;for(;I&&I.tagName==="w:pPr";)I=I.nextSibling;$.insertBefore(j.first_node,I);}}if(e.comment){let $=g((I,E)=>{let S=I;for(;S.parentNode&&S.parentNode!==E;)S=S.parentNode;return S},"ascend_to_paragraph_child");if(j.last_p&&j.last_ins){let I=j.first_node;for(;I&&I.tagName!=="w:p";)I=I.parentNode;if(I){let E=j.first_node;j.first_node.tagName==="w:p"&&(E=R(j.first_node,"w:ins")[0]||j.first_node);let S=$(E,I),D=$(j.last_ins,j.last_p);this._attach_comment_spanning(I,S,j.last_p,D,e.comment);}}else {let I=j.first_node;for(;I&&I.tagName!=="w:p";)I=I.parentNode;if(I){let E=j.first_node;j.first_node.tagName==="w:p"&&(E=R(j.first_node,"w:ins")[0]||j.first_node);let S=$(E,I);this._attach_comment(I,S,S,e.comment);}}}return true}if((i==="DELETION"||i==="MODIFICATION")&&a&&s.part_ranges.filter(y=>y[1]>y[0]).length>1){let y=new Set;for(let N of s.spans)N.run!==null&&N.end>o&&N.start<o+a&&y.add(N.part_index);if(y.size>1)return false}if((i==="DELETION"||i==="MODIFICATION")&&a){let y=this._apply_gate_refusal(s,o,a,e._parent_edit_ref?.type==="set_field");if(y)return e._error_msg||(e._error_msg=y),false}let f=s.find_target_runs_by_index(o,a,r),h=s.get_virtual_spans_in_range(o,a);if(f.length===0&&h.length===0)return false;let m=new Set;for(let y of f){let N=y._element.parentNode;for(;N&&N.tagName!=="w:p";)N=N.parentNode;N&&m.add(N);}let p=null,_=null;for(let y of f){let N=_!==null&&y._element.previousSibling===_,k=N?_:this._create_track_change_tag("w:del","",p===null?c:null),x=y._element.cloneNode(true);Array.from(x.getElementsByTagName("w:t")).forEach(A=>{let C=x.ownerDocument.createElement("w:delText");C.textContent=A.textContent,A.hasAttribute("xml:space")&&C.setAttribute("xml:space","preserve"),x.replaceChild(C,A);}),k.appendChild(x),N?y._element.parentNode?.removeChild(y._element):y._element.parentNode?.replaceChild(k,y._element),p===null&&(p=k),_=k;}let w=null,v=null,b=null;if(i==="MODIFICATION"&&e.new_text&&_){let y=_;for(;y&&y.tagName!=="w:p";)y=y.parentNode;let N=y?new ne(y,null):null,k=f.length>0?f[f.length-1]:null,x=this._track_insert_multiline(e.new_text,k,N,d,_,l);if(x.first_node){if(x.first_node.tagName==="w:ins"){let A=_.parentNode;A&&A.tagName==="w:ins"?this._insert_and_split_ins(A,_,x.first_node):nt(x.first_node,_),w=x.first_node;}else w=x.last_ins;v=x.last_p,b=x.last_ins;}}if(i==="DELETION"||i==="MODIFICATION"){if(i==="MODIFICATION"&&f.length===0&&h.length>0&&e.new_text){let y=h[0];if(y.paragraph){let N=y.paragraph._element,k=R(N,"w:r"),x=k.length>0?new Re(k[k.length-1],y.paragraph):null,P=this._track_insert_multiline(e.new_text,x,y.paragraph,d,null,l);P.first_node&&N.appendChild(P.first_node);}}for(let y of [...h].reverse())if(y.paragraph){let N=y.paragraph._element,k=Ce(N);for(;k&&k.tagName!=="w:p";)k=Ce(k);if(k&&k.tagName==="w:p"){let x=!this._paragraph_has_visible_content(N),P=O(N,"w:pPr");if(x){let T=O(k,"w:pPr"),M=T?T.cloneNode(true):N.ownerDocument.createElement("w:pPr");if(P){let j=O(P,"w:sectPr");j&&!O(M,"w:sectPr")&&M.appendChild(j.cloneNode(true)),N.removeChild(P);}N.insertBefore(M,N.firstChild),P=M;}P||(P=N.ownerDocument.createElement("w:pPr"),N.insertBefore(P,N.firstChild));let A=O(P,"w:rPr");if(A||(A=N.ownerDocument.createElement("w:rPr"),P.appendChild(A)),!O(A,"w:del")){let T=this._create_track_change_tag("w:del");A.appendChild(T);}let C=Array.from(k.childNodes);for(let T of C)T.nodeType===1&&T.tagName==="w:pPr"||N.appendChild(T);k.parentNode&&k.parentNode.removeChild(k);}}}if(e.comment&&p!==null){let y,N;if(v&&b)y=b,N=v;else {let C=w!==null?w:_;for(y=C,N=C;N&&N.tagName!=="w:p";)N=N.parentNode;}let k=p;for(;k&&k.tagName!=="w:p";)k=k.parentNode;if(!k||!N)return true;let x=g((C,T)=>{let M=C;for(;M.parentNode&&M.parentNode!==T;)M=M.parentNode;return M},"ascend_to_paragraph_child"),P=x(p,k),A=x(y,N);k===N?this._attach_comment(k,P,A,e.comment):this._attach_comment_spanning(k,P,N,A,e.comment);}for(let y of m)if(!this._paragraph_has_visible_content(y)){let k=O(y,"w:pPr");k||(k=y.ownerDocument.createElement("w:pPr"),y.insertBefore(k,y.firstChild));let x=O(k,"w:rPr");if(x||(x=y.ownerDocument.createElement("w:rPr"),k.appendChild(x)),!O(x,"w:del")){let P=this._create_track_change_tag("w:del");x.appendChild(P);}}return true}},Su=["{++","{--","{~~","{==","{>>"],Iu=/^> \*\*File Path:\*\*[^\n]*\n+/,Ou=/^> \*\*Page (\d+) of (\d+)\*\*[^\n]*\n+(?:---\n+)?/,Du=/\n+---\n+> \*\*Continues on page (\d+) of (\d+)\.\*\*[^\n]*\s*$/,Ru=/\n+---\n+> \*\*Appendix available\.\*\*[^\n]*\s*$/,Mu=2e3,hn=class extends Error{static{g(this,"TextRevisionError");}constructor(n){super(n),this.name="TextRevisionError";}},ju=class extends hn{static{g(this,"TextRevisionVerificationError");}constructor(n,e,t,r,i){super(n),this.unverified_path=e,this.output_path=t,this.stats=r,this.unverified_bytes=i,this.name="TextRevisionVerificationError";}unverified_path;output_path;stats;unverified_bytes};function Bu(n){if(n&&n.trim())return n.trim();let e="".trim();return e||"Adeu AI (TS)"}g(Bu,"get_default_author");function Fu(n){if(Su.some(e=>n.includes(e)))throw new hn("Revised text contains CriticMarkup tokens ({++..++}, {--..--}, {~~..~>..~~}, {==..==}, {>>..<<}). `apply_text_revision` compares text against the document's CLEAN view, so CriticMarkup tokens would be diffed into the document as literal prose.")}g(Fu,"check_criticmarkup");function Lu(n){n=n.replace(Iu,"");let e=null,t=null,r=Ou.exec(n);r&&(e=parseInt(r[1],10),t=parseInt(r[2],10),n=n.slice(r[0].length)),n=n.replace(Ru,"");let i=Du.exec(n);return i&&(e===null&&(e=parseInt(i[1],10)-1),t===null&&(t=parseInt(i[2],10)),n=n.slice(0,i.index)),{text:n,page:e,total:t}}g(Lu,"strip_page_chrome");function Wu(n,e,t=false,r){if(t)return;let i=n.length,s=e.length;if(i===0)return;let o=(i-s)/i,a=i>=Mu?.5:.75;if(o<=a)return;let l=r?`'${r}'`:"The revised text";throw new hn(`${l} is ~${Math.floor(o*100)}% shorter than the document's clean text (${s.toLocaleString("en-US")} vs ${i.toLocaleString("en-US")} characters, threshold is >${Math.floor(a*100)}% deletion). Applying it would delete the majority of the document as tracked deletions.
|
|
154
154
|
If the text is a partial extract, re-extract the ENTIRE document with \`--page all --clean-view\` and edit that.
|
|
155
155
|
If the mass deletion is intentional, re-run with --allow-major-deletions (over MCP: allow_major_deletions=True).`)}g(Wu,"check_major_deletions");function Ms(n){return n=n.replace(/([^|])\s+\{#cell:[^}]+\}/g,"$1"),n=n.replace(/\{#cell:[^}]+\}/g,""),n}g(Ms,"strip_cell_anchors");function js(n){return Qe(n,true,false)}g(js,"_extract_clean_text_from_doc");function bi(n){return Ms(n.replace(/^#+\s*/gm,""))}g(bi,"_normalize_virtual_projection_text");var zu=new RegExp("\\p{C}|\\p{Z}","u");function xi(n){let e=n.includes("'")&&!n.includes('"')?'"':"'",t="";for(let r of n)if(r==="\\")t+="\\\\";else if(r===`
|
|
156
156
|
`)t+="\\n";else if(r==="\r")t+="\\r";else if(r===" ")t+="\\t";else if(r===e)t+=`\\${e}`;else if(r!==" "&&zu.test(r)){let i=r.codePointAt(0),[s,o]=i<256?["x",2]:i<65536?["u",4]:["U",8];t+=`\\${s}${i.toString(16).padStart(o,"0")}`;}else t+=r;return `${e}${t}${e}`}g(xi,"_repr");function Uu(n,e){let t=js(n),r=bi(t.trim()),i=bi(e.trim());if(r!==i){let s=Array.from(r),o=Array.from(i),a=0,l=Math.min(s.length,o.length);for(;a<l&&s[a]===o[a];)a++;let u=s.slice(a,a+40).join(""),c=o.slice(a,a+40).join("");return [false,`Post-apply verification failed: the applied document's clean text does not match the supplied text (first divergence at character ${a}: applied reads ${xi(u)}, supplied text reads ${xi(c)}). The document structure could not fully realize the requested text (e.g. headings or table cells cannot be deleted via text replacement).`]}return [true,null]}g(Uu,"verify_clean_text");function Hu(n){let e=path.dirname(n),t=path.basename(n),r=t.lastIndexOf("."),i=r===-1?t:t.slice(0,r);return i.endsWith("_redlined")||i.endsWith("_processed")?n:path.join(e,`${i}_redlined.docx`)}g(Hu,"_default_output_path");function Xu(n){let e=path.basename(n,path.extname(n));return path.join(path.dirname(n),`${e}.unverified.docx`)}g(Xu,"_unverified_path");async function Bs(n){let{doc:e,input_path:t,revised_text:r}=n,{text:i,page:s,total:o}=Lu(r),a=Ms(i);if(o!==null&&o>1)throw new hn(`Text revision looks like page ${s||"?"} of ${o} of a paginated extract \u2014 it contains only part of the document, and applying it would delete every page not present. Re-extract the ENTIRE document first with --page all --clean-view.`);Fu(a);let l=js(e);Wu(l,a,n.allow_major_deletions??false);let u=Ht(l,a),c=new fn(e,Bu(n.author)),d=c.process_batch(u),f=n.output_path?n.output_path:Hu(t),[h,m]=Uu(c.doc,a);if(!h){let _=Xu(f),w=await c.doc.save(),v=`${m} Nothing was written to '${f}'; a diagnostic copy was kept at '${_}' \u2014 it is NOT the requested document.`;if(d.verified=false,d.verification_error=v,d.error="verification_failed",d.edits_skipped=(d.edits_applied||0)+(d.edits_skipped||0),d.edits_applied=0,d.actions_skipped=(d.actions_applied||0)+(d.actions_skipped||0),d.actions_applied=0,d.output_path=null,d.unverified_output_path=_,d.edits)for(let b of d.edits)b.status="failed",b.error="Not applied: post-apply verification failed.",b.critic_markup=null,b.clean_text=null;throw new ju(v,_,f,d,w)}let p=await c.doc.save();return d.output_path=f,d.verified=true,{stats:d,output_path:f,out_bytes:p}}g(Bs,"apply_text_revision_core");var qu=class{static{g(this,"SanitizeReport");}filename;mode;author;tracked_changes_found=0;tracked_changes_accepted=0;tracked_changes_kept=0;change_lines=[];comments_removed=0;comments_kept=0;removed_comment_lines=[];kept_comment_lines=[];metadata_lines=[];structural_lines=[];warnings=[];status="clean";blocked_reason=null;constructor(n,e="full",t=null){this.filename=n,this.mode=e,this.author=t;}add_transform_lines(n){for(let e of n){let t=e.toLowerCase();t.includes("tracked change")||t.includes("insertion")||t.includes("deletion")||t.includes("accepted")?this.change_lines.push(e):t.includes("author")||t.includes("template")||t.includes("company")||t.includes("manager")||t.includes("metadata")||t.includes("timestamp")||t.includes("custom xml")||t.includes("custom propert")||t.includes("identifier")||t.includes("document variable")||t.includes("language")||t.includes("version")||t.includes("last modified by")||t.includes("revision count")||t.includes("last printed")||t.includes("description/comments")?this.metadata_lines.push(e):t.includes("comment")||t.includes("[open]")||t.includes("[resolved]")?t.includes("kept")||t.includes("visible")?this.kept_comment_lines.push(e):this.removed_comment_lines.push(e):t.includes("hyperlink")||t.includes("warning")?this.warnings.push(e):this.structural_lines.push(e);}}render(){let n="\u2550".repeat(50),e=[n,`Finalization Report: ${this.filename}`],t=[];if(this.mode==="keep-markup"&&t.push("--keep-markup"),this.author&&t.push(`--author "${this.author}"`),this.tracked_changes_accepted>0&&t.push("--accept-all"),t.length>0&&e.push(`Options: ${t.join(" ")}`),e.push(n),this.status==="blocked")return e.push(""),e.push(`BLOCKED: ${this.blocked_reason}`),e.push(n),e.join(`
|
|
@@ -174,7 +174,7 @@ ${xt}`,itemIndex:e})}return r==="TextRevisionVerificationError"?new n8nWorkflow.
|
|
|
174
174
|
|
|
175
175
|
No file is written by this node \u2014 ignore the paths named above; the input document is returned unchanged and no binary is produced. Structure such as headings, table rows, and footnotes cannot be removed by text replacement. Re-read the document with the Extract Markdown operation (Clean View on, Page 0), edit that exact text, and resend it in 'Revised Text'.`,itemIndex:e}):r==="TextRevisionError"?new n8nWorkflow.NodeApiError(this.getNode(),{message:t},{message:"The revised text was refused before anything was applied.",description:`${t}
|
|
176
176
|
|
|
177
|
-
Send the COMPLETE clean text of the document in 'Revised Text' \u2014 read it with the Extract Markdown operation using Clean View on and Page 0 \u2014 with no CriticMarkup tags. If the revision is genuinely meant to delete most of the document, switch 'Allow Major Deletions' on.`,itemIndex:e}):o.includes("invalid docx")||o.includes("missing word/document.xml")?new n8nWorkflow.NodeApiError(this.getNode(),{message:t},{message:"The document could not be opened.",description:"Verify the input binary is a valid .docx file (not .doc, .pdf, or another format).",itemIndex:e}):new n8nWorkflow.NodeApiError(this.getNode(),{message:t},{message:"Adeu engine error.",description:t,itemIndex:e})}g(qs,"mapAdeuErrorToNodeApiError");function Ku(n){if(!n||typeof n!="object")return false;let e=n;return typeof e.id=="string"&&typeof e.fileName=="string"&&typeof e.mimeType=="string"}g(Ku,"isStashedBinaryEntry");var Gs=[{displayName:"Static Data Key",name:"staticDataKey",type:"string",default:"adeu_last_redlined",required:true,placeholder:"e.g. adeu_last_redlined",description:"Key in workflow global static data to read the stashed binary metadata from (string). When the Apply Edits operation runs as an AI Agent tool, n8n's tool wrapper strips the binary from its output before any downstream node can see it. To work around that, Apply Edits writes the binary's storage id into workflow static data under 'adeu_last_redlined'. This operation reads that entry back, fetches the original buffer via getBinaryStream, and attaches a fresh IBinaryData onto the outgoing item. Leave the default unless you've customized the stash key on the Apply Edits side.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Output Binary Property",name:"outputBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property on the outgoing item that will hold the hydrated .docx (string, e.g. 'data'). Downstream nodes (e.g. Write Binary File, Gmail send) should be configured to read from this property name.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"On Missing",name:"onMissing",type:"options",default:"emit_empty",description:"What to do when no stashed binary entry is found under the configured key. 'Emit Empty' is the typical AI Agent path: emits an item with json.hydrated=false and no binary, so a downstream If node can gate any write step on whether the LLM actually called Apply Edits this turn. 'Throw' is for deterministic pipelines where the stash MUST be present and a missing entry indicates a workflow bug.",options:[{name:"Emit Empty",value:"emit_empty",description:"Emit a single item with JSON.hydrated=false and no binary. Downstream If on JSON.hydrated gates the write."},{name:"Throw",value:"throw",description:"Throw a NodeOperationError. Use when a missing stash indicates a workflow bug."}],displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Clear After Read",name:"clearAfterRead",type:"boolean",default:true,description:"Whether to delete the static data entry after a successful hydration so it does not leak across workflow runs. Set false if you want to inspect or re-read the entry from a later node in the same run.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Output Path Template",name:"outputPathTemplate",type:"string",default:"",placeholder:"e.g. C:\\Users\\Uzair\\.n8n-files\\{baseName}_{timestamp}.docx",description:"Optional template to compute the final write path on disk, returned on the output JSON as 'outputPath'. If set, you can configure downstream Write nodes to simply read '{{ $json.outputPath }}' with zero escaping risks. Supports these placeholders: '{baseName}' (filename with extension stripped), '{timestamp}' (current ISO 8601 timestamp with colons and dots replaced by dashes for Windows file compatibility), '{fileName}' (the stashed filename including extension), and '{ext}' (e.g., '.docx').",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}}];async function Js(n){let e=this.getNodeParameter("staticDataKey",n),t=this.getNodeParameter("outputBinaryPropertyName",n),r=this.getNodeParameter("onMissing",n),i=this.getNodeParameter("clearAfterRead",n),s=this.getWorkflowStaticData("global"),o=s[e];if(!Ku(o)){if(r==="throw")throw new n8nWorkflow.NodeOperationError(this.getNode(),`No stashed binary found under static data key "${e}".`,{description:"The Apply Edits operation writes a stash entry into workflow static data only when it runs as an AI Agent tool and produces a binary. Verify that Apply Edits was actually called by the agent this turn, that it ran successfully, and that the key matches the one used on the writing side.",itemIndex:n});return [{json:{hydrated:false},pairedItem:{item:n}}]}let{id:a,fileName:l,mimeType:u}=o,c;try{let p=await this.helpers.getBinaryStream(a);c=await this.helpers.binaryToBuffer(p);}catch(p){throw new n8nWorkflow.NodeOperationError(this.getNode(),`Failed to load stashed binary (id=${a}) from external storage.`,{description:`The stash entry under "${e}" points at binary id "${a}", but the underlying data could not be loaded. This usually means the binary has been garbage-collected (n8n's execution data retention may be too short) or external storage is unavailable. Underlying error: ${p.message}`,itemIndex:n})}let d=u||ve,f=await this.helpers.prepareBinaryData(c,l,d);i&&delete s[e];let h=this.getNodeParameter("outputPathTemplate",n,""),m;if(h.trim()!==""){let p=l.replace(/\.docx$/i,""),_=l.match(/\.docx$/i)?.[0]??".docx",w=new Date().toISOString().replace(/[:.]/g,"-").replace(/Z$/,"");m=h.replaceAll("{baseName}",p).replaceAll("{timestamp}",w).replaceAll("{fileName}",l).replaceAll("{ext}",_);}return [{json:{hydrated:true,fileName:l,sourceBinaryId:a,mimeType:d,...m!==void 0?{outputPath:m}:{}},binary:{[t]:f},pairedItem:{item:n}}]}g(Js,"executeHydrateToolOutput");var mr=ut("extractMarkdown"),Qs=[{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. Must be a valid .docx (not .doc, .pdf, or another format).",displayOptions:mr},{displayName:"Clean View",name:"cleanView",type:"boolean",default:false,description:"Whether to project the document as if all pending tracked changes were accepted (simulates Accept All). When false (default), all tracked changes are surfaced inline as CriticMarkup ({++ins++}, {--del--}, {>>comment<<}) so an AI can review and resolve them. Use false to review counterparty edits; use true to generate net-new redlines against a clean baseline.",displayOptions:mr},{displayName:"Include Appendix",name:"includeAppendix",type:"boolean",default:true,description:"Whether to include the Structural Appendix (defined terms, cross-reference anchors, and potential typos) at the end of the projection. True by default for rich LLM context.",displayOptions:mr},{displayName:"Page",name:"page",type:"number",default:0,typeOptions:{minValue:0},description:"Optional 1-based page number to return only one page of the projected document (integer, default 0). When 0 (default), the full Markdown body plus the Structural Appendix is returned in the 'markdown' field and pagination metadata is omitted. When >= 1, only that page is returned in the 'markdown' field and the JSON output includes pagination metadata: page, total_pages, has_next, has_prev, tracked_change_count. Pages are ~19,000-character chunks of the projected body with the Structural Appendix appended to each page. Use the extractOutline operation first to discover how many pages exist and what each page contains. If the requested page exceeds total_pages, an error is thrown.",displayOptions:{show:{resource:["document"],operation:["extractMarkdown"]}}}];async function Vs(n){let e=this.getNodeParameter("binaryPropertyName",n),t=this.getNodeParameter("cleanView",n),r=this.getNodeParameter("includeAppendix",n,true),i=this.getNodeParameter("page",n,0),o=this.getNodeParameter("documentSource",n,"fromInput")==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("sourceNodeName",n,""),binaryPropertyName:e,sourceBinaryId:this.getNodeParameter("sourceBinaryId",n,"")}:{mode:"fromInput",binaryPropertyName:e},{buffer:a,fileName:l}=await oe.call(this,n,o),u=await Je(a,t,r);if(!i||i===0)return [{json:{fileName:l,cleanView:t,markdown:u},pairedItem:{item:n}}];let[c,d]=st(u),f=ot(c,d);if(i>f.total_pages)throw new n8nWorkflow.NodeOperationError(this.getNode(),`Requested page ${i} exceeds total_pages (${f.total_pages}). Call extractOutline to discover the page count first.`,{itemIndex:n});let h=f.pages[i-1];return [{json:{fileName:l,cleanView:t,markdown:h.page_content,page:h.page,total_pages:h.total_pages,has_next:h.has_next,has_prev:h.has_prev,tracked_change_count:h.tracked_change_count},pairedItem:{item:n}}]}g(Vs,"executeExtractMarkdown");var Zs=[{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. Must be a valid .docx.",displayOptions:{show:{resource:["document"],operation:["extractOutline"]}}}];async function Ks(n){let e=this.getNodeParameter("binaryPropertyName",n),r=this.getNodeParameter("documentSource",n,"fromInput")==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("sourceNodeName",n,""),binaryPropertyName:e,sourceBinaryId:this.getNodeParameter("sourceBinaryId",n,"")}:{mode:"fromInput",binaryPropertyName:e},{buffer:i,fileName:s}=await oe.call(this,n,r),o=await ce.load(i),a=Qe(o,false,true,true),[l]=st(a.text),u=ot(l,""),c=ys(o,l,u.body_pages,u.body_page_offsets,a.paragraph_offsets);return [{json:{fileName:s,total_pages:u.total_pages,outline:c.map(d=>({level:d.level,text:d.text,page:d.page,end_page:d.end_page,style:d.style,has_table:d.has_table,footnote_ids:d.footnote_ids}))},pairedItem:{item:n}}]}g(Ks,"executeExtractOutline");var be={show:{resource:["document"],operation:["applyEdits"]}},eo=[{displayName:"Reasoning",name:"reasoning",type:"string",default:"",typeOptions:{rows:2},description:"Why these edits are being made. State your reasoning BEFORE the changes \u2014 what you intend to change and why \u2014 then produce the Changes (JSON) array. This field is captured for auditability and is NOT forwarded into the redline engine; its only purpose is to make the AI reason first, which improves edit quality. Safe to leave empty in deterministic (non-AI) pipelines.",displayOptions:be},{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. The file must be a valid .docx.",displayOptions:be},{displayName:"Output Binary Property",name:"outputBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property on the outgoing item that will hold the redlined .docx file (string, e.g. 'data'). If equal to the input property name, the original binary is overwritten on the outgoing item.",displayOptions:be},{displayName:"Author",name:"author",type:"string",default:"Adeu AI",placeholder:"e.g. AI Reviewer",description:"Author name attached to all tracked changes and comments produced by this operation (string, e.g. 'AI Reviewer'). Shows up in Word's review pane as the author of every redline and comment created in this batch.",displayOptions:be},{displayName:"Edits Source",name:"editsSource",type:"options",noDataExpression:true,default:"fromInputJson",description:"Where to read the list of DocumentChange objects from. Use 'Define Below' to read the array from the Changes (JSON) field on this node \u2014 this is the typical AI Agent path, since the LLM generates the array as a tool call argument that lands on that field via $fromAI(). Use 'From Input JSON' to read the array from a property on the upstream item's JSON, for deterministic pipelines where a non-AI node (HTTP Request, Code, etc.) has pre-populated it.",options:[{name:"Define Below",value:"defineBelow",description:"Read the array from the Changes (JSON) field on this node. Use for AI Agent workflows \u2014 the LLM populates that field via $fromAI() as a tool call argument."},{name:"From Input JSON",value:"fromInputJson",description:"Read the array from a property on the upstream item's JSON. Use for deterministic pipelines where a non-AI node has pre-populated the changes array."}],displayOptions:be},{displayName:"JSON Path on Input Item",name:"editsJsonPath",type:"string",default:"changes",required:true,placeholder:"e.g. data.changes",description:"Property path on the input item JSON whose value is the array of DocumentChange objects (string, dot-notation supported, e.g. 'changes' or 'data.changes'). Must resolve to an array; throws an error otherwise.",displayOptions:{show:{resource:["document"],operation:["applyEdits"],editsSource:["fromInputJson"]}}},{displayName:"Changes (JSON)",name:"editsJson",type:"string",default:`[
|
|
177
|
+
Send the COMPLETE clean text of the document in 'Revised Text' \u2014 read it with the Extract Markdown operation using Clean View on and Page 0 \u2014 with no CriticMarkup tags. If the revision is genuinely meant to delete most of the document, switch 'Allow Major Deletions' on.`,itemIndex:e}):o.includes("invalid docx")||o.includes("missing word/document.xml")?new n8nWorkflow.NodeApiError(this.getNode(),{message:t},{message:"The document could not be opened.",description:"Verify the input binary is a valid .docx file (not .doc, .pdf, or another format).",itemIndex:e}):new n8nWorkflow.NodeApiError(this.getNode(),{message:t},{message:"Adeu engine error.",description:t,itemIndex:e})}g(qs,"mapAdeuErrorToNodeApiError");function Ku(n){if(!n||typeof n!="object")return false;let e=n;return typeof e.id=="string"&&typeof e.fileName=="string"&&typeof e.mimeType=="string"}g(Ku,"isStashedBinaryEntry");var Gs=[{displayName:"Static Data Key",name:"staticDataKey",type:"string",default:"adeu_last_redlined",required:true,placeholder:"e.g. adeu_last_redlined",description:"Key in workflow global static data to read the stashed binary metadata from (string). When the Apply Edits operation runs as an AI Agent tool, n8n's tool wrapper strips the binary from its output before any downstream node can see it. To work around that, Apply Edits writes the binary's storage id into workflow static data under 'adeu_last_redlined'. This operation reads that entry back, fetches the original buffer via getBinaryStream, and attaches a fresh IBinaryData onto the outgoing item. Leave the default unless you've customized the stash key on the Apply Edits side.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Output Binary Property",name:"outputBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property on the outgoing item that will hold the hydrated .docx (string, e.g. 'data'). Downstream nodes (e.g. Write Binary File, Gmail send) should be configured to read from this property name.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"On Missing",name:"onMissing",type:"options",default:"emit_empty",description:"What to do when no stashed binary entry is found under the configured key. 'Emit Empty' is the typical AI Agent path: emits an item with json.hydrated=false and no binary, so a downstream If node can gate any write step on whether the LLM actually called Apply Edits this turn. 'Throw' is for deterministic pipelines where the stash MUST be present and a missing entry indicates a workflow bug.",options:[{name:"Emit Empty",value:"emit_empty",description:"Emit a single item with JSON.hydrated=false and no binary. Downstream If on JSON.hydrated gates the write."},{name:"Throw",value:"throw",description:"Throw a NodeOperationError. Use when a missing stash indicates a workflow bug."}],displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Clear After Read",name:"clearAfterRead",type:"boolean",default:true,description:"Whether to delete the static data entry after a successful hydration so it does not leak across workflow runs. Set false if you want to inspect or re-read the entry from a later node in the same run.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Output Path Template",name:"outputPathTemplate",type:"string",default:"",placeholder:"e.g. C:\\Users\\you\\.n8n-files\\{baseName}_{timestamp}.docx",description:"Optional template to compute the final write path on disk, returned on the output JSON as 'outputPath'. If set, you can configure downstream Write nodes to simply read '{{ $json.outputPath }}' with zero escaping risks. Supports these placeholders: '{baseName}' (filename with extension stripped), '{timestamp}' (current ISO 8601 timestamp with colons and dots replaced by dashes for Windows file compatibility), '{fileName}' (the stashed filename including extension), and '{ext}' (e.g., '.docx').",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}}];async function Js(n){let e=this.getNodeParameter("staticDataKey",n),t=this.getNodeParameter("outputBinaryPropertyName",n),r=this.getNodeParameter("onMissing",n),i=this.getNodeParameter("clearAfterRead",n),s=this.getWorkflowStaticData("global"),o=s[e];if(!Ku(o)){if(r==="throw")throw new n8nWorkflow.NodeOperationError(this.getNode(),`No stashed binary found under static data key "${e}".`,{description:"The Apply Edits operation writes a stash entry into workflow static data only when it runs as an AI Agent tool and produces a binary. Verify that Apply Edits was actually called by the agent this turn, that it ran successfully, and that the key matches the one used on the writing side.",itemIndex:n});return [{json:{hydrated:false},pairedItem:{item:n}}]}let{id:a,fileName:l,mimeType:u}=o,c;try{let p=await this.helpers.getBinaryStream(a);c=await this.helpers.binaryToBuffer(p);}catch(p){throw new n8nWorkflow.NodeOperationError(this.getNode(),`Failed to load stashed binary (id=${a}) from external storage.`,{description:`The stash entry under "${e}" points at binary id "${a}", but the underlying data could not be loaded. This usually means the binary has been garbage-collected (n8n's execution data retention may be too short) or external storage is unavailable. Underlying error: ${p.message}`,itemIndex:n})}let d=u||ve,f=await this.helpers.prepareBinaryData(c,l,d);i&&delete s[e];let h=this.getNodeParameter("outputPathTemplate",n,""),m;if(h.trim()!==""){let p=l.replace(/\.docx$/i,""),_=l.match(/\.docx$/i)?.[0]??".docx",w=new Date().toISOString().replace(/[:.]/g,"-").replace(/Z$/,"");m=h.replaceAll("{baseName}",p).replaceAll("{timestamp}",w).replaceAll("{fileName}",l).replaceAll("{ext}",_);}return [{json:{hydrated:true,fileName:l,sourceBinaryId:a,mimeType:d,...m!==void 0?{outputPath:m}:{}},binary:{[t]:f},pairedItem:{item:n}}]}g(Js,"executeHydrateToolOutput");var mr=ut("extractMarkdown"),Qs=[{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. Must be a valid .docx (not .doc, .pdf, or another format).",displayOptions:mr},{displayName:"Clean View",name:"cleanView",type:"boolean",default:false,description:"Whether to project the document as if all pending tracked changes were accepted (simulates Accept All). When false (default), all tracked changes are surfaced inline as CriticMarkup ({++ins++}, {--del--}, {>>comment<<}) so an AI can review and resolve them. Use false to review counterparty edits; use true to generate net-new redlines against a clean baseline.",displayOptions:mr},{displayName:"Include Appendix",name:"includeAppendix",type:"boolean",default:true,description:"Whether to include the Structural Appendix (defined terms, cross-reference anchors, and potential typos) at the end of the projection. True by default for rich LLM context.",displayOptions:mr},{displayName:"Page",name:"page",type:"number",default:0,typeOptions:{minValue:0},description:"Optional 1-based page number to return only one page of the projected document (integer, default 0). When 0 (default), the full Markdown body plus the Structural Appendix is returned in the 'markdown' field and pagination metadata is omitted. When >= 1, only that page is returned in the 'markdown' field and the JSON output includes pagination metadata: page, total_pages, has_next, has_prev, tracked_change_count. Pages are ~19,000-character chunks of the projected body with the Structural Appendix appended to each page. Use the extractOutline operation first to discover how many pages exist and what each page contains. If the requested page exceeds total_pages, an error is thrown.",displayOptions:{show:{resource:["document"],operation:["extractMarkdown"]}}}];async function Vs(n){let e=this.getNodeParameter("binaryPropertyName",n),t=this.getNodeParameter("cleanView",n),r=this.getNodeParameter("includeAppendix",n,true),i=this.getNodeParameter("page",n,0),o=this.getNodeParameter("documentSource",n,"fromInput")==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("sourceNodeName",n,""),binaryPropertyName:e,sourceBinaryId:this.getNodeParameter("sourceBinaryId",n,"")}:{mode:"fromInput",binaryPropertyName:e},{buffer:a,fileName:l}=await oe.call(this,n,o),u=await Je(a,t,r);if(!i||i===0)return [{json:{fileName:l,cleanView:t,markdown:u},pairedItem:{item:n}}];let[c,d]=st(u),f=ot(c,d);if(i>f.total_pages)throw new n8nWorkflow.NodeOperationError(this.getNode(),`Requested page ${i} exceeds total_pages (${f.total_pages}). Call extractOutline to discover the page count first.`,{itemIndex:n});let h=f.pages[i-1];return [{json:{fileName:l,cleanView:t,markdown:h.page_content,page:h.page,total_pages:h.total_pages,has_next:h.has_next,has_prev:h.has_prev,tracked_change_count:h.tracked_change_count},pairedItem:{item:n}}]}g(Vs,"executeExtractMarkdown");var Zs=[{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. Must be a valid .docx.",displayOptions:{show:{resource:["document"],operation:["extractOutline"]}}}];async function Ks(n){let e=this.getNodeParameter("binaryPropertyName",n),r=this.getNodeParameter("documentSource",n,"fromInput")==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("sourceNodeName",n,""),binaryPropertyName:e,sourceBinaryId:this.getNodeParameter("sourceBinaryId",n,"")}:{mode:"fromInput",binaryPropertyName:e},{buffer:i,fileName:s}=await oe.call(this,n,r),o=await ce.load(i),a=Qe(o,false,true,true),[l]=st(a.text),u=ot(l,""),c=ys(o,l,u.body_pages,u.body_page_offsets,a.paragraph_offsets);return [{json:{fileName:s,total_pages:u.total_pages,outline:c.map(d=>({level:d.level,text:d.text,page:d.page,end_page:d.end_page,style:d.style,has_table:d.has_table,footnote_ids:d.footnote_ids}))},pairedItem:{item:n}}]}g(Ks,"executeExtractOutline");var be={show:{resource:["document"],operation:["applyEdits"]}},eo=[{displayName:"Reasoning",name:"reasoning",type:"string",default:"",typeOptions:{rows:2},description:"Why these edits are being made. State your reasoning BEFORE the changes \u2014 what you intend to change and why \u2014 then produce the Changes (JSON) array. This field is captured for auditability and is NOT forwarded into the redline engine; its only purpose is to make the AI reason first, which improves edit quality. Safe to leave empty in deterministic (non-AI) pipelines.",displayOptions:be},{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. The file must be a valid .docx.",displayOptions:be},{displayName:"Output Binary Property",name:"outputBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property on the outgoing item that will hold the redlined .docx file (string, e.g. 'data'). If equal to the input property name, the original binary is overwritten on the outgoing item.",displayOptions:be},{displayName:"Author",name:"author",type:"string",default:"Adeu AI",placeholder:"e.g. AI Reviewer",description:"Author name attached to all tracked changes and comments produced by this operation (string, e.g. 'AI Reviewer'). Shows up in Word's review pane as the author of every redline and comment created in this batch.",displayOptions:be},{displayName:"Edits Source",name:"editsSource",type:"options",noDataExpression:true,default:"fromInputJson",description:"Where to read the list of DocumentChange objects from. Use 'Define Below' to read the array from the Changes (JSON) field on this node \u2014 this is the typical AI Agent path, since the LLM generates the array as a tool call argument that lands on that field via $fromAI(). Use 'From Input JSON' to read the array from a property on the upstream item's JSON, for deterministic pipelines where a non-AI node (HTTP Request, Code, etc.) has pre-populated it.",options:[{name:"Define Below",value:"defineBelow",description:"Read the array from the Changes (JSON) field on this node. Use for AI Agent workflows \u2014 the LLM populates that field via $fromAI() as a tool call argument."},{name:"From Input JSON",value:"fromInputJson",description:"Read the array from a property on the upstream item's JSON. Use for deterministic pipelines where a non-AI node has pre-populated the changes array."}],displayOptions:be},{displayName:"JSON Path on Input Item",name:"editsJsonPath",type:"string",default:"changes",required:true,placeholder:"e.g. data.changes",description:"Property path on the input item JSON whose value is the array of DocumentChange objects (string, dot-notation supported, e.g. 'changes' or 'data.changes'). Must resolve to an array; throws an error otherwise.",displayOptions:{show:{resource:["document"],operation:["applyEdits"],editsSource:["fromInputJson"]}}},{displayName:"Changes (JSON)",name:"editsJson",type:"string",default:`[
|
|
178
178
|
{
|
|
179
179
|
"type": "modify",
|
|
180
180
|
"target_text": "State of New York",
|
|
@@ -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":
|
|
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}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-adeu",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
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,8 +49,8 @@
|
|
|
49
49
|
"n8n-workflow": "*"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@adeu/core": "^3.0.
|
|
53
|
-
"@n8n/eslint-plugin-community-nodes": "^0.
|
|
52
|
+
"@adeu/core": "^3.0.5",
|
|
53
|
+
"@n8n/eslint-plugin-community-nodes": "^0.32.0",
|
|
54
54
|
"@types/node": "^26.4.0",
|
|
55
55
|
"@typescript-eslint/parser": "^8.68.0",
|
|
56
56
|
"copyfiles": "^2.4.1",
|