(function(t,s){typeof exports=="object"&&typeof module<"u"?s(exports):typeof define=="function"&&define.amd?define(["exports"],s):(t=typeof globalThis<"u"?globalThis:t||self,s(t.hatsugen={}))})(this,function(t){"use strict";const s=/^[^(\n]*\)\s.*/gm,u=")",c=(e,i)=>[...new Set([...e.matchAll(i)].map(([n])=>n))],d=(e,i)=>[...new Set(e.map(n=>n.split(i)).map(([n])=>n))],h=(e,i,n)=>e.map(a=>({sentence:a,nameId:i.indexOf(a.split(n)[0])+1})),l=(e,i,n)=>{if(e instanceof Element)e.innerHTML=e.innerHTML.replace(i,`${i}`);else throw new Error("node is not an instance of Element")},m=e=>document.evaluate(`//*[contains(text(),"${e}") or text()[contains(.,"${e}")]]`,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null),L=(e=s,i=u)=>{const n=c(document.body.innerText,e),a=d(n,i);h(n,a,i).forEach(({sentence:g,nameId:f})=>{const E=m(g);for(let o=0;o{L()}),t.DEFAULT_MATCHER=s,t.DEFAULT_REPLACER=u,t.HTMLHighlighter=L,t.enHighlight=l,t.getSetenceWithNameIdList=h,t.getUniqueNameList=d,t.getUniqueSentenceList=c,t.getXPath=m,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});