UNPKG

@newgenesis/vision

Version:

Professional bot and AI detection library with behavioral analysis, fingerprinting, and adaptive challenges

3 lines 427 kB
(function(){'use strict';/** @license MIT - Sentinel by NewGenesis (https://newgenesis.ai) */ var ew=Object.defineProperty;var u=(e,t)=>()=>(e&&(t=e(e=0)),t);var tw=(e,t)=>{for(var n in t)ew(e,n,{get:t[n],enumerable:true});};var rw,ow,iw,aw,zt,Sr=u(()=>{rw={one:{},two:{},three:{},four:{}},ow={one:{},two:{},three:{}},iw={},aw=[],zt={methods:rw,model:ow,compute:iw,hooks:aw};});var sw,lw,Di,ji=u(()=>{sw=e=>Object.prototype.toString.call(e)==="[object Array]",lw={compute:function(e){let{world:t}=this,n=t.compute;return typeof e=="string"&&n.hasOwnProperty(e)?n[e](this):sw(e)?e.forEach(r=>{t.compute.hasOwnProperty(r)?n[r](this):console.warn("no compute:",e);}):typeof e=="function"?e(this):console.warn("no compute:",e),this}},Di=lw;});var uw,cw,dw,hw,fw,pw,Si,Oi=u(()=>{uw=function(e){return this.fullPointer.forEach((n,r)=>{let o=this.update([n]);e(o,r);}),this},cw=function(e,t){let r=this.fullPointer.map((i,a)=>{let s=this.update([i]),l=e(s,a);return l===void 0?this.none():l});if(r.length===0)return t||this.update([]);if(r[0]!==void 0&&(typeof r[0]=="string"||typeof r[0]=="object"&&(r[0]===null||!r[0].isView)))return r;let o=[];return r.forEach(i=>{o=o.concat(i.fullPointer);}),this.toView(o)},dw=function(e){let t=this.fullPointer;return t=t.filter((r,o)=>{let i=this.update([r]);return e(i,o)}),this.update(t)},hw=function(e){let n=this.fullPointer.find((r,o)=>{let i=this.update([r]);return e(i,o)});return this.update([n])},fw=function(e){return this.fullPointer.some((n,r)=>{let o=this.update([n]);return e(o,r)})},pw=function(e=1){let t=this.fullPointer,n=Math.floor(Math.random()*t.length);return n+e>this.length&&(n=this.length-e,n=n<0?0:n),t=t.slice(n,n+e),this.update(t)},Si={forEach:uw,map:cw,filter:dw,find:hw,some:fw,random:pw};});var be,Hi,Fi=u(()=>{be={termList:function(){return this.methods.one.termList(this.docs)},terms:function(e){let t=this.match(".");return typeof e=="number"?t.eq(e):t},groups:function(e){if(e||e===0)return this.update(this._groups[e]||[]);let t={};return Object.keys(this._groups).forEach(n=>{t[n]=this.update(this._groups[n]);}),t},eq:function(e){let t=this.pointer;return t||(t=this.docs.map((n,r)=>[r])),t[e]?this.update([t[e]]):this.none()},first:function(){return this.eq(0)},last:function(){let e=this.fullPointer.length-1;return this.eq(e)},firstTerms:function(){return this.match("^.")},lastTerms:function(){return this.match(".$")},slice:function(e,t){let n=this.pointer||this.docs.map((r,o)=>[o]);return n=n.slice(e,t),this.update(n)},all:function(){return this.update().toView()},fullSentences:function(){let e=this.fullPointer.map(t=>[t[0]]);return this.update(e).toView()},none:function(){return this.update([])},isDoc:function(e){if(!e||!e.isView)return false;let t=this.fullPointer,n=e.fullPointer;return !t.length===n.length?false:t.every((r,o)=>n[o]?r[0]===n[o][0]&&r[1]===n[o][1]&&r[2]===n[o][2]:false)},wordCount:function(){return this.docs.reduce((e,t)=>(e+=t.filter(n=>n.text!=="").length,e),0)},isFull:function(){let e=this.pointer;if(!e)return true;if(e.length===0||e[0][0]!==0)return false;let t=0,n=0;return this.document.forEach(r=>t+=r.length),this.docs.forEach(r=>n+=r.length),t===n},getNth:function(e){return typeof e=="number"?this.eq(e):typeof e=="string"?this.if(e):this}};be.group=be.groups;be.fullSentence=be.fullSentences;be.sentence=be.fullSentences;be.lastTerm=be.lastTerms;be.firstTerm=be.firstTerms;Hi=be;});var Or,Gi,Mi=u(()=>{ji();Oi();Fi();Or=Object.assign({},Hi,Di,Si);Or.get=Or.eq;Gi=Or;});var Nn,Tn,zi=u(()=>{Sr();Mi();Nn=class e{constructor(t,n,r={}){[["document",t],["world",zt],["_groups",r],["_cache",null],["viewType","View"]].forEach(i=>{Object.defineProperty(this,i[0],{value:i[1],writable:true});}),this.ptrs=n;}get docs(){let t=this.document;return this.ptrs&&(t=zt.methods.one.getDoc(this.ptrs,this.document)),t}get pointer(){return this.ptrs}get methods(){return this.world.methods}get model(){return this.world.model}get hooks(){return this.world.hooks}get isView(){return true}get found(){return this.docs.length>0}get length(){return this.docs.length}get fullPointer(){let{docs:t,ptrs:n,document:r}=this;return (n||t.map((i,a)=>[a])).map(i=>{let[a,s,l,c,d]=i;return s=s||0,l=l||(r[a]||[]).length,r[a]&&r[a][s]&&(c=c||r[a][s].id,r[a][l-1]&&(d=d||r[a][l-1].id)),[a,s,l,c,d]})}update(t){let n=new e(this.document,t);if(this._cache&&t&&t.length>0){let r=[];t.forEach((o,i)=>{let[a,s,l]=o;o.length===1?r[i]=this._cache[a]:s===0&&this.document[a].length===l&&(r[i]=this._cache[a]);}),r.length>0&&(n._cache=r);}return n.world=this.world,n}toView(t){return new e(this.document,t||this.pointer)}fromText(t){let{methods:n}=this,r=n.one.tokenize.fromString(t,this.world),o=new e(r);return o.world=this.world,o.compute(["normal","freeze","lexicon"]),this.world.compute.preTagger&&o.compute("preTagger"),o.compute("unfreeze"),o}clone(){let t=this.document.slice(0);t=t.map(r=>r.map(o=>(o=Object.assign({},o),o.tags=new Set(o.tags),o)));let n=this.update(this.pointer);return n.document=t,n._cache=this._cache,n}};Object.assign(Nn.prototype,Gi);Tn=Nn;});var Vi,Li=u(()=>{Vi="14.14.4";});function $i(e,t){if(Bi(t))for(let n in t)Bi(t[n])?(e[n]||Object.assign(e,{[n]:{}}),$i(e[n],t[n])):Object.assign(e,{[n]:t[n]});return e}function mw(e,t){for(let n in t)e[n]=e[n]||{},Object.assign(e[n],t[n]);return e}var Bi,gw,bw,Ri,Wi=u(()=>{Bi=function(e){return e&&typeof e=="object"&&!Array.isArray(e)};gw=function(e,t){let n=e.two.models||{};Object.keys(t).forEach(r=>{t[r].pastTense&&(n.toPast&&(n.toPast.ex[r]=t[r].pastTense),n.fromPast&&(n.fromPast.ex[t[r].pastTense]=r)),t[r].presentTense&&(n.toPresent&&(n.toPresent.ex[r]=t[r].presentTense),n.fromPresent&&(n.fromPresent.ex[t[r].presentTense]=r)),t[r].gerund&&(n.toGerund&&(n.toGerund.ex[r]=t[r].gerund),n.fromGerund&&(n.fromGerund.ex[t[r].gerund]=r)),t[r].comparative&&(n.toComparative&&(n.toComparative.ex[r]=t[r].comparative),n.fromComparative&&(n.fromComparative.ex[t[r].comparative]=r)),t[r].superlative&&(n.toSuperlative&&(n.toSuperlative.ex[r]=t[r].superlative),n.fromSuperlative&&(n.fromSuperlative.ex[t[r].superlative]=r));});},bw=function(e,t,n,r){let{methods:o,model:i,compute:a,hooks:s}=t;e.methods&&mw(o,e.methods),e.model&&$i(i,e.model),e.irregulars&&gw(i,e.irregulars),e.compute&&Object.assign(a,e.compute),s&&(t.hooks=s.concat(e.hooks||[])),e.api&&e.api(n),e.lib&&Object.keys(e.lib).forEach(l=>r[l]=e.lib[l]),e.tags&&r.addTags(e.tags),e.words&&r.addWords(e.words),e.frozen&&r.addWords(e.frozen,true),e.mutate&&e.mutate(t,r);},Ri=bw;});var Ki,Ji=u(()=>{Ki=function(e){let t=typeof process>"u"||!process.env?self.env||{}:process.env;return t.DEBUG_TAGS=e==="tagger"||e===true?true:"",t.DEBUG_MATCH=e==="match"||e===true?true:"",t.DEBUG_CHUNKS=e==="chunker"||e===true?true:"",this};});var yw,Hr,vw,ww,xw,Fr,_i=u(()=>{yw=e=>Object.prototype.toString.call(e)==="[object Object]",Hr=function(e){return Object.prototype.toString.call(e)==="[object Array]"},vw=function(e){return e.map(t=>t.terms.map(n=>(Hr(n.tags)&&(n.tags=new Set(n.tags)),n)))},ww=function(e){return e.map(t=>t.map(n=>({text:n,normal:n,pre:"",post:" ",tags:new Set})))},xw=function(e,t,n){let{methods:r}=n,o=new t([]);if(o.world=n,typeof e=="number"&&(e=String(e)),!e)return o;if(typeof e=="string"){let i=r.one.tokenize.fromString(e,n);return new t(i)}if(yw(e)&&e.isView)return new t(e.document,e.ptrs);if(Hr(e)){if(Hr(e[0])){let a=ww(e);return new t(a)}let i=vw(e);return new t(i)}return o},Fr=xw;});var En,re,ee,Ui=u(()=>{zi();Sr();Li();Wi();Ji();_i();En=Object.assign({},zt),re=function(e,t){t&&re.addWords(t);let n=Fr(e,Tn,En);return e&&n.compute(En.hooks),n};Object.defineProperty(re,"_world",{value:En,writable:true});re.tokenize=function(e,t){let{compute:n}=this._world;t&&re.addWords(t);let r=Fr(e,Tn,En);return n.contractions&&r.compute(["alias","normal","machine","contractions"]),r};re.plugin=function(e){return Ri(e,this._world,Tn,this),this};re.extend=re.plugin;re.world=function(){return this._world};re.model=function(){return this._world.model};re.methods=function(){return this._world.methods};re.hooks=function(){return this._world.hooks};re.verbose=Ki;re.version=Vi;ee=re;});var Pw,qi,Qi=u(()=>{Pw=function(e){return e.map(n=>{let r=new Set;return n.forEach(o=>{o.normal!==""&&r.add(o.normal),o.switch&&r.add(`%${o.switch}%`),o.implicit&&r.add(o.implicit),o.machine&&r.add(o.machine),o.root&&r.add(o.root),o.alias&&o.alias.forEach(a=>r.add(a));let i=Array.from(o.tags);for(let a=0;a<i.length;a+=1)r.add("#"+i[a]);}),r})},qi=Pw;});var Xi,Yi=u(()=>{Qi();Xi={one:{cacheDoc:qi}};});var kw,Aw,Zi,ea=u(()=>{kw={cache:function(){return this._cache=this.methods.one.cacheDoc(this.document),this},uncache:function(){return this._cache=null,this}},Aw=function(e){Object.assign(e.prototype,kw);},Zi=Aw;});var ta,na=u(()=>{ta={cache:function(e){e._cache=e.methods.one.cacheDoc(e.document);}};});var ra,oa=u(()=>{Yi();ea();na();ra={api:Zi,compute:ta,methods:Xi};});var ia,aa=u(()=>{ia={toLowerCase:function(){return this.termList().forEach(e=>{e.text=e.text.toLowerCase();}),this},toUpperCase:function(){return this.termList().forEach(e=>{e.text=e.text.toUpperCase();}),this},toTitleCase:function(){return this.termList().forEach(e=>{e.text=e.text.replace(/^ *[a-z\u00C0-\u00FF]/,t=>t.toUpperCase());}),this},toCamelCase:function(){return this.docs.forEach(e=>{e.forEach((t,n)=>{n!==0&&(t.text=t.text.replace(/^ *[a-z\u00C0-\u00FF]/,r=>r.toUpperCase())),n!==e.length-1&&(t.post="");});}),this}};});var sa,Cw,Nw,ua,yt,la,Tw,ca,da,ha=u(()=>{sa=e=>/^\p{Lu}[\p{Ll}'’]/u.test(e)||/^\p{Lu}$/u.test(e),Cw=e=>e.replace(/^\p{Ll}/u,t=>t.toUpperCase()),Nw=e=>e.replace(/^\p{Lu}/u,t=>t.toLowerCase()),ua=(e,t,n)=>{if(n.forEach(r=>r.dirty=true),e){let r=[t,0].concat(n);Array.prototype.splice.apply(e,r);}return e},yt=function(e){let t=/ $/,n=/[-–—]/,r=e[e.length-1];r&&!t.test(r.post)&&!n.test(r.post)&&(r.post+=" ");},la=(e,t,n)=>{let r=/[-.?!,;:)–—'"]/g,o=e[t-1];if(!o)return;let i=o.post;if(r.test(i)){let a=i.match(r).join(""),s=n[n.length-1];s.post=a+s.post,o.post=o.post.replace(r,"");}},Tw=function(e,t,n){let r=e[t];if(t!==0||!sa(r.text))return;n[0].text=Cw(n[0].text);let o=e[t];o.tags.has("ProperNoun")||o.tags.has("Acronym")||sa(o.text)&&o.text.length>1&&(o.text=Nw(o.text));},ca=function(e,t,n,r){let[o,i,a]=t;i===0||a===r[o].length?yt(n):(yt(n),yt([e[t[1]]])),Tw(e,i,n),ua(e,i,n);},da=function(e,t,n,r){let[o,,i]=t,a=(r[o]||[]).length;i<a?(la(e,i,n),yt(n)):a===i&&(yt(e),la(e,i,n),r[o+1]&&(n[n.length-1].post+=" ")),ua(e,t[2],n),t[4]=n[n.length-1].id;};});var Vt,fa,Ew,In,Gr=u(()=>{Vt=0,fa=e=>(e=e.length<3?"0"+e:e,e.length<3?"0"+e:e),Ew=function(e){let[t,n]=e.index||[0,0];Vt+=1,Vt=Vt>46655?0:Vt,t=t>46655?0:t,n=n>1294?0:n;let r=fa(Vt.toString(36));r+=fa(t.toString(36));let o=n.toString(36);o=o.length<2?"0"+o:o,r+=o;let i=parseInt(Math.random()*36,10);return r+=i.toString(36),e.normal+"|"+r.toUpperCase()},In=Ew;});var pa,ma,Iw,Dw,ga,ot,ba,ya=u(()=>{ha();Gr();pa=function(e){e.has("@hasContraction")&&typeof e.contractions=="function"&&e.grow("@hasContraction").contractions().expand();},ma=e=>Object.prototype.toString.call(e)==="[object Array]",Iw=function(e){return e=e.map(t=>(t.id=In(t),t)),e},Dw=function(e,t){let{methods:n}=t;return typeof e=="string"?n.one.tokenize.fromString(e,t)[0]:typeof e=="object"&&e.isView?e.clone().docs[0]||[]:ma(e)?ma(e[0])?e[0]:e:[]},ga=function(e,t,n){let{document:r,world:o}=t;t.uncache();let i=t.fullPointer,a=t.fullPointer;t.forEach((l,c)=>{let d=l.fullPointer[0],[h]=d,p=r[h],b=Dw(e,o);b.length!==0&&(b=Iw(b),n?(pa(t.update([d]).firstTerm()),ca(p,d,b,r)):(pa(t.update([d]).lastTerm()),da(p,d,b,r)),r[h]&&r[h][d[1]]&&(d[3]=r[h][d[1]].id),a[c]=d,d[2]+=b.length,i[c]=d);});let s=t.toView(i);return t.ptrs=a,s.compute(["id","index","freeze","lexicon"]),s.world.compute.preTagger&&s.compute("preTagger"),s.compute("unfreeze"),s},ot={insertAfter:function(e){return ga(e,this,false)},insertBefore:function(e){return ga(e,this,true)}};ot.append=ot.insertAfter;ot.prepend=ot.insertBefore;ot.insert=ot.insertAfter;ba=ot;});var jw,Mr,Sw,Ow,Hw,Fw,Gw,va,wa=u(()=>{jw=/\$[0-9a-z]+/g,Mr={},Sw=e=>/^\p{Lu}[\p{Ll}'’]/u.test(e)||/^\p{Lu}$/u.test(e),Ow=e=>e.replace(/^\p{Ll}/u,t=>t.toUpperCase()),Hw=e=>e.replace(/^\p{Lu}/u,t=>t.toLowerCase()),Fw=function(e,t,n){return e.forEach(r=>{let o=t(r);r.replaceWith(o,n);}),e},Gw=function(e,t){if(typeof e!="string")return e;let n=t.groups();return e=e.replace(jw,r=>{let o=r.replace(/\$/,"");return n.hasOwnProperty(o)?n[o].text():r}),e};Mr.replaceWith=function(e,t={}){let n=this.fullPointer,r=this;if(this.uncache(),typeof e=="function")return Fw(r,e,t);let o=r.docs[0];if(!o)return r;let i=t.possessives&&o[o.length-1].tags.has("Possessive"),a=t.case&&Sw(o[0].text);e=Gw(e,r);let s=this.update(n);n=n.map(p=>p.slice(0,3));let l=(s.docs[0]||[]).map(p=>Array.from(p.tags)),c=s.docs[0][0].pre,d=s.docs[0][s.docs[0].length-1].post;if(typeof e=="string"&&(e=this.fromText(e).compute("id")),r.insertAfter(e),s.has("@hasContraction")&&r.contractions&&r.grow("@hasContraction+").contractions().expand(),r.delete(s),i){let p=r.docs[0],b=p[p.length-1];b.tags.has("Possessive")||(b.text+="'s",b.normal+="'s",b.tags.add("Possessive"));}if(c&&r.docs[0]&&(r.docs[0][0].pre=c),d&&r.docs[0]){let p=r.docs[0][r.docs[0].length-1];p.post.trim()||(p.post=d);}let h=r.toView(n).compute(["index","freeze","lexicon"]);if(h.world.compute.preTagger&&h.compute("preTagger"),h.compute("unfreeze"),t.tags&&h.terms().forEach((p,b)=>{p.tagSafe(l[b]);}),!h.docs[0]||!h.docs[0][0])return h;if(t.case){let p=a?Ow:Hw;h.docs[0][0].text=p(h.docs[0][0].text);}return h};Mr.replace=function(e,t,n){if(e&&!t)return this.replaceWith(e,n);let r=this.match(e);return r.found?(this.soften(),r.replaceWith(t,n)):this};va=Mr;});var Mw,zw,xa,Pa=u(()=>{Mw=function(e,t){let n=e.length-1,r=e[n],o=e[n-t];o&&r&&(o.post+=r.post,o.post=o.post.replace(/ +([.?!,;:])/,"$1"),o.post=o.post.replace(/[,;:]+([.?!])/,"$1"));},zw=function(e,t){t.forEach(n=>{let[r,o,i]=n,a=i-o;e[r]&&(i===e[r].length&&i>1&&Mw(e[r],a),e[r].splice(o,a));});for(let n=e.length-1;n>=0;n-=1)if(e[n].length===0&&(e.splice(n,1),n===e.length&&e[n-1])){let r=e[n-1],o=r[r.length-1];o&&(o.post=o.post.trimEnd());}return e},xa=zw;});var Vw,zr,ka,Aa=u(()=>{Pa();Vw=function(e,t){return e=e.map(n=>{let[r]=n;return t[r]&&t[r].forEach(o=>{let i=o[2]-o[1];n[1]<=o[1]&&n[2]>=o[2]&&(n[2]-=i);}),n}),e.forEach((n,r)=>{if(n[1]===0&&n[2]==0)for(let o=r+1;o<e.length;o+=1)e[o][0]-=1,e[o][0]<0&&(e[o][0]=0);}),e=e.filter(n=>n[2]-n[1]>0),e=e.map(n=>(n[3]=null,n[4]=null,n)),e},zr={remove:function(e){let{indexN:t}=this.methods.one.pointer;this.uncache();let n=this.all(),r=this;e&&(n=this,r=this.match(e));let o=!n.ptrs;r.has("@hasContraction")&&r.contractions&&r.grow("@hasContraction").contractions().expand();let i=n.fullPointer,a=r.fullPointer.reverse(),s=xa(this.document,a),l=t(a);return i=Vw(i,l),n.ptrs=i,n.document=s,n.compute("index"),o&&(n.ptrs=void 0),e?n.toView(i):(this.ptrs=[],n.none())}};zr.delete=zr.remove;ka=zr;});var Lt,Ca,Na=u(()=>{Lt={pre:function(e,t){return e===void 0&&this.found?this.docs[0][0].pre:(this.docs.forEach(n=>{let r=n[0];t===true?r.pre+=e:r.pre=e;}),this)},post:function(e,t){if(e===void 0){let n=this.docs[this.docs.length-1];return n[n.length-1].post}return this.docs.forEach(n=>{let r=n[n.length-1];t===true?r.post+=e:r.post=e;}),this},trim:function(){if(!this.found)return this;let e=this.docs,t=e[0][0];t.pre=t.pre.trimStart();let n=e[e.length-1],r=n[n.length-1];return r.post=r.post.trimEnd(),this},hyphenate:function(){return this.docs.forEach(e=>{e.forEach((t,n)=>{n!==0&&(t.pre=""),e[n+1]&&(t.post="-");});}),this},dehyphenate:function(){let e=/[-–—]/;return this.docs.forEach(t=>{t.forEach(n=>{e.test(n.post)&&(n.post=" ");});}),this},toQuotations:function(e,t){return e=e||'"',t=t||'"',this.docs.forEach(n=>{n[0].pre=e+n[0].pre;let r=n[n.length-1];r.post=t+r.post;}),this},toParentheses:function(e,t){return e=e||"(",t=t||")",this.docs.forEach(n=>{n[0].pre=e+n[0].pre;let r=n[n.length-1];r.post=t+r.post;}),this}};Lt.deHyphenate=Lt.dehyphenate;Lt.toQuotation=Lt.toQuotations;Ca=Lt;});var Lw,Bw,$w,Rw,Ww,Dn,Ta=u(()=>{Lw=(e,t)=>e.normal<t.normal?-1:e.normal>t.normal?1:0,Bw=(e,t)=>{let n=e.normal.trim().length,r=t.normal.trim().length;return n<r?1:n>r?-1:0},$w=(e,t)=>e.words<t.words?1:e.words>t.words?-1:0,Rw=(e,t)=>e[0]<t[0]?1:e[0]>t[0]?-1:e[1]>t[1]?1:-1,Ww=function(e){let t={};return e.forEach(n=>{t[n.normal]=t[n.normal]||0,t[n.normal]+=1;}),e.sort((n,r)=>{let o=t[n.normal],i=t[r.normal];return o<i?1:o>i?-1:0}),e},Dn={alpha:Lw,length:Bw,wordCount:$w,sequential:Rw,byFreq:Ww};});var Kw,Jw,_w,Uw,qw,Qw,Xw,Ea,Ia=u(()=>{Ta();Kw=new Set(["index","sequence","seq","sequential","chron","chronological"]),Jw=new Set(["freq","frequency","topk","repeats"]),_w=new Set(["alpha","alphabetical"]),Uw=function(e,t){let n=e.fullPointer;return n=n.sort((r,o)=>(r=e.update([r]),o=e.update([o]),t(r,o))),e.ptrs=n,e},qw=function(e){let{docs:t,pointer:n}=this;if(this.uncache(),typeof e=="function")return Uw(this,e);e=e||"alpha";let r=n||t.map((i,a)=>[a]),o=t.map((i,a)=>({index:a,words:i.length,normal:i.map(s=>s.machine||s.normal||"").join(" "),pointer:r[a]}));return Kw.has(e)&&(e="sequential"),_w.has(e)&&(e="alpha"),Jw.has(e)?(o=Dn.byFreq(o),this.update(o.map(i=>i.pointer))):typeof Dn[e]=="function"?(o=o.sort(Dn[e]),this.update(o.map(i=>i.pointer))):this},Qw=function(){let e=this.pointer||this.docs.map((t,n)=>[n]);return e=[].concat(e),e=e.reverse(),this._cache&&(this._cache=this._cache.reverse()),this.update(e)},Xw=function(){let e=new Set;return this.filter(n=>{let r=n.text("machine");return e.has(r)?false:(e.add(r),true)})},Ea={unique:Xw,reverse:Qw,sort:qw};});var Yw,Da,Zw,ja,Sa=u(()=>{Yw=e=>Object.prototype.toString.call(e)==="[object Array]",Da=function(e,t){if(e.length>0){let n=e[e.length-1],r=n[n.length-1];/ /.test(r.post)===false&&(r.post+=" ");}return e=e.concat(t),e},Zw=function(e,t){if(e.document===t.document){let r=e.fullPointer.concat(t.fullPointer);return e.toView(r).compute("index")}return t.fullPointer.forEach(r=>{r[0]+=e.document.length;}),e.document=Da(e.document,t.docs),e.all()},ja={concat:function(e){if(typeof e=="string"){let t=this.fromText(e);if(!this.found||!this.ptrs)this.document=this.document.concat(t.document);else {let n=this.fullPointer,r=n[n.length-1][0];this.document.splice(r,0,...t.document);}return this.all().compute("index")}if(typeof e=="object"&&e.isView)return Zw(this,e);if(Yw(e)){let t=Da(this.document,e);return this.document=t,this.all()}return this}};});var ex,tx,Oa,Ha=u(()=>{ex=function(){return this.ptrs=this.fullPointer,this},tx=function(){let e=this.ptrs;return !e||e.length<1?this:(e=e.map(t=>t.slice(0,3)),this.ptrs=e,this)},Oa={harden:ex,soften:tx};});var nx,rx,Fa,Ga=u(()=>{aa();ya();wa();Aa();Na();Ia();Sa();Ha();nx=Object.assign({},ia,ba,va,ka,Ca,Ea,ja,Oa),rx=function(e){Object.assign(e.prototype,nx);},Fa=rx;});var ox,Ma,za=u(()=>{Gr();ox={id:function(e){let t=e.docs;for(let n=0;n<t.length;n+=1)for(let r=0;r<t[n].length;r+=1){let o=t[n][r];o.id=o.id||In(o);}}},Ma=ox;});var Va,La=u(()=>{Ga();za();Va={api:Fa,compute:Ma};});var Ba,$a=u(()=>{Ba=[{word:"@",out:["at"]},{word:"arent",out:["are","not"]},{word:"alot",out:["a","lot"]},{word:"brb",out:["be","right","back"]},{word:"cannot",out:["can","not"]},{word:"dun",out:["do","not"]},{word:"can't",out:["can","not"]},{word:"shan't",out:["should","not"]},{word:"won't",out:["will","not"]},{word:"that's",out:["that","is"]},{word:"what's",out:["what","is"]},{word:"let's",out:["let","us"]},{word:"dunno",out:["do","not","know"]},{word:"gonna",out:["going","to"]},{word:"gotta",out:["have","got","to"]},{word:"gimme",out:["give","me"]},{word:"outta",out:["out","of"]},{word:"tryna",out:["trying","to"]},{word:"gtg",out:["got","to","go"]},{word:"im",out:["i","am"]},{word:"imma",out:["I","will"]},{word:"imo",out:["in","my","opinion"]},{word:"irl",out:["in","real","life"]},{word:"ive",out:["i","have"]},{word:"rn",out:["right","now"]},{word:"tbh",out:["to","be","honest"]},{word:"wanna",out:["want","to"]},{word:"c'mere",out:["come","here"]},{word:"c'mon",out:["come","on"]},{word:"shoulda",out:["should","have"]},{word:"coulda",out:["coulda","have"]},{word:"woulda",out:["woulda","have"]},{word:"musta",out:["must","have"]},{word:"tis",out:["it","is"]},{word:"twas",out:["it","was"]},{word:"y'know",out:["you","know"]},{word:"ne'er",out:["never"]},{word:"o'er",out:["over"]},{after:"ll",out:["will"]},{after:"ve",out:["have"]},{after:"re",out:["are"]},{after:"m",out:["am"]},{before:"c",out:["ce"]},{before:"m",out:["me"]},{before:"n",out:["ne"]},{before:"qu",out:["que"]},{before:"s",out:["se"]},{before:"t",out:["tu"]},{word:"shouldnt",out:["should","not"]},{word:"couldnt",out:["could","not"]},{word:"wouldnt",out:["would","not"]},{word:"hasnt",out:["has","not"]},{word:"wasnt",out:["was","not"]},{word:"isnt",out:["is","not"]},{word:"cant",out:["can","not"]},{word:"dont",out:["do","not"]},{word:"wont",out:["will","not"]},{word:"howd",out:["how","did"]},{word:"whatd",out:["what","did"]},{word:"whend",out:["when","did"]},{word:"whered",out:["where","did"]}];});var Ra,Wa=u(()=>{Ra={st:true,nd:true,rd:true,th:true,am:true,pm:true,max:true,"\xB0":true,s:true,e:true,er:true,\u00E8re:true,\u00E8me:true};});var Ka,Ja=u(()=>{$a();Wa();Ka={one:{contractions:Ba,numberSuffixes:Ra}};});var ix,jn,_a=u(()=>{ix=function(e,t,n){let[r,o]=t;!n||n.length===0||(n=n.map((i,a)=>(i.implicit=i.text,i.machine=i.text,i.pre="",i.post="",i.text="",i.normal="",i.index=[r,o+a],i)),n[0]&&(n[0].pre=e[r][o].pre,n[n.length-1].post=e[r][o].post,n[0].text=e[r][o].text,n[0].normal=e[r][o].normal),e[r].splice(o,1,...n));},jn=ix;});var ax,sx,lx,ux,cx,Ua,qa=u(()=>{ax=/'/,sx=new Set(["what","how","when","where","why"]),lx=new Set(["be","go","start","think","need"]),ux=new Set(["been","gone"]),cx=function(e,t){let n=e[t].normal.split(ax)[0];if(sx.has(n))return [n,"did"];if(e[t+1]){if(ux.has(e[t+1].normal))return [n,"had"];if(lx.has(e[t+1].normal))return [n,"would"]}return null},Ua=cx;});var dx,Qa,Xa=u(()=>{dx=function(e,t){return e[t].normal==="ain't"||e[t].normal==="aint"?null:[e[t].normal.replace(/n't/,""),"not"]},Qa=dx;});var Vr,hx,fx,px,mx,gx,Sn,Ya=u(()=>{Vr=/'/,hx=/(e|é|aison|sion|tion)$/,fx=/(age|isme|acle|ege|oire)$/,px=(e,t)=>{let n=e[t].normal.split(Vr)[1];return n&&n.endsWith("e")?["la",n]:["le",n]},mx=(e,t)=>{let n=e[t].normal.split(Vr)[1];return n&&hx.test(n)&&!fx.test(n)?["du",n]:n&&n.endsWith("s")?["des",n]:["de",n]},gx=(e,t)=>["je",e[t].normal.split(Vr)[1]],Sn={preJ:gx,preL:px,preD:mx};});var bx,yx,vx,wx,Za,es=u(()=>{bx=/^([0-9.]{1,4}[a-z]{0,2}) ?[-–—] ?([0-9]{1,4}[a-z]{0,2})$/i,yx=/^([0-9]{1,2}(:[0-9][0-9])?(am|pm)?) ?[-–—] ?([0-9]{1,2}(:[0-9][0-9])?(am|pm)?)$/i,vx=/^[0-9]{3}-[0-9]{4}$/,wx=function(e,t){let n=e[t],r=n.text.match(bx);return r!==null?n.tags.has("PhoneNumber")===true||vx.test(n.text)?null:[r[1],"to",r[2]]:(r=n.text.match(yx),r!==null?[r[1],"to",r[4]]:null)},Za=wx;});var xx,Px,ts,ns=u(()=>{xx=/^([+-]?[0-9][.,0-9]*)([a-z°²³µ/]+)$/,Px=function(e,t,n){let r=n.model.one.numberSuffixes||{},i=e[t].text.match(xx);if(i!==null){let a=i[2].toLowerCase().trim();return r.hasOwnProperty(a)?null:[i[1],a]}return null},ts=Px;});var rs,kx,os,is,as,Ax,Lr,Cx,Nx,ss,ls=u(()=>{_a();qa();Xa();Ya();es();ns();rs=/'/,kx=/^[0-9][^-–—]*[-–—].*?[0-9]/,os=function(e,t,n,r){let o=t.update();o.document=[e];let i=n+r;n>0&&(n-=1),e[i]&&(i+=1),o.ptrs=[[0,n,i]];},is={t:(e,t)=>Qa(e,t),d:(e,t)=>Ua(e,t)},as={j:(e,t)=>Sn.preJ(e,t),l:(e,t)=>Sn.preL(e,t),d:(e,t)=>Sn.preD(e,t)},Ax=function(e,t,n,r){for(let o=0;o<e.length;o+=1){let i=e[o];if(i.word===t.normal)return i.out;if(r!==null&&r===i.after)return [n].concat(i.out);if(n!==null&&n===i.before&&r&&r.length>2)return i.out.concat(r)}return null},Lr=function(e,t){let n=t.fromText(e.join(" "));return n.compute(["id","alias"]),n.docs[0]},Cx=function(e,t){for(let n=t+1;n<5&&e[n];n+=1)if(e[n].normal==="been")return ["there","has"];return ["there","is"]},Nx=e=>{let{world:t,document:n}=e,{model:r,methods:o}=t,i=r.one.contractions||[];n.forEach((a,s)=>{for(let l=a.length-1;l>=0;l-=1){let c=null,d=null;if(rs.test(a[l].normal)===true){let p=a[l].normal.split(rs);c=p[0],d=p[1];}let h=Ax(i,a[l],c,d);if(!h&&is.hasOwnProperty(d)&&(h=is[d](a,l,t)),!h&&as.hasOwnProperty(c)&&(h=as[c](a,l)),c==="there"&&d==="s"&&(h=Cx(a,l)),h){h=Lr(h,e),jn(n,[s,l],h),os(n[s],e,l,h.length);continue}if(kx.test(a[l].normal)){h=Za(a,l),h&&(h=Lr(h,e),jn(n,[s,l],h),o.one.setTag(h,"NumberRange",t),h[2]&&h[2].tags.has("Time")&&o.one.setTag([h[0]],"Time",t,null,"time-range"),os(n[s],e,l,h.length));continue}h=ts(a,l,t),h&&(h=Lr(h,e),jn(n,[s,l],h),o.one.setTag([h[1]],"Unit",t,null,"contraction-unit"));}});},ss=Nx;});var us,cs=u(()=>{ls();us={contractions:ss};});var Tx,ds,hs=u(()=>{Ja();cs();Tx={model:Ka,compute:us,hooks:["contractions"]},ds=Tx;});var fs,Ex,ps,ms=u(()=>{fs=function(e){let t=e.world,{model:n,methods:r}=e.world,o=r.one.setTag,{frozenLex:i}=n.one,a=n.one._multiCache||{};e.docs.forEach(s=>{for(let l=0;l<s.length;l+=1){let c=s[l],d=c.machine||c.normal;if(a[d]!==void 0&&s[l+1]){let h=l+a[d]-1;for(let p=h;p>l;p-=1){let b=s.slice(l,p+1),A=b.map(V=>V.machine||V.normal).join(" ");if(i.hasOwnProperty(A)===true){o(b,i[A],t,false,"1-frozen-multi-lexicon"),b.forEach(V=>V.frozen=true);continue}}}if(i[d]!==void 0&&i.hasOwnProperty(d)){o([c],i[d],t,false,"1-freeze-lexicon"),c.frozen=true;continue}}});},Ex=function(e){return e.docs.forEach(t=>{t.forEach(n=>{delete n.frozen;});}),e},ps={frozen:fs,freeze:fs,unfreeze:Ex};});var gs,bs,Ix,Br,ys=u(()=>{gs=e=>"\x1B[34m"+e+"\x1B[0m",bs=e=>"\x1B[3m\x1B[2m"+e+"\x1B[0m",Ix=function(e){e.docs.forEach(t=>{console.log(gs(` \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`)),t.forEach(n=>{let r=` ${bs("\u2502")} `,o=n.implicit||n.text||"-";n.frozen===true?r+=`${gs(o)} \u2744\uFE0F`:r+=bs(o),console.log(r);});});},Br=Ix;});var vs,ws=u(()=>{ms();ys();vs={compute:ps,mutate:e=>{let t=e.methods.one;t.termMethods.isFrozen=n=>n.frozen===true,t.debug.freeze=Br,t.debug.frozen=Br;},api:function(e){e.prototype.freeze=function(){return this.docs.forEach(t=>{t.forEach(n=>{n.frozen=true;});}),this},e.prototype.unfreeze=function(){this.compute("unfreeze");},e.prototype.isFrozen=function(){return this.match("@isFrozen+")};},hooks:["freeze"]};});var Dx,xs,Ps=u(()=>{Dx=function(e,t,n){let{model:r,methods:o}=n,i=o.one.setTag,a=r.one._multiCache||{},{lexicon:s}=r.one||{},l=e[t],c=l.machine||l.normal;if(a[c]!==void 0&&e[t+1]){let d=t+a[c]-1;for(let h=d;h>t;h-=1){let p=e.slice(t,h+1);if(p.length<=1)return false;let b=p.map(A=>A.machine||A.normal).join(" ");if(s.hasOwnProperty(b)===true){let A=s[b];return i(p,A,n,false,"1-multi-lexicon"),A&&A.length===2&&(A[0]==="PhrasalVerb"||A[1]==="PhrasalVerb")&&i([p[1]],"Particle",n,false,"1-phrasal-particle"),true}}return false}return null},xs=Dx;});var ks,jx,Sx,As,Cs=u(()=>{ks=/^(under|over|mis|re|un|dis|semi|pre|post)-?/,jx=new Set(["Verb","Infinitive","PastTense","Gerund","PresentTense","Adjective","Participle"]),Sx=function(e,t,n){let{model:r,methods:o}=n,i=o.one.setTag,{lexicon:a}=r.one,s=e[t],l=s.machine||s.normal;if(a[l]!==void 0&&a.hasOwnProperty(l))return i([s],a[l],n,false,"1-lexicon"),true;if(s.alias){let c=s.alias.find(d=>a.hasOwnProperty(d));if(c)return i([s],a[c],n,false,"1-lexicon-alias"),true}if(ks.test(l)===true){let c=l.replace(ks,"");if(a.hasOwnProperty(c)&&c.length>3&&jx.has(a[c]))return i([s],a[c],n,false,"1-lexicon-prefix"),true}return null},As=Sx;});var Ox,Ns,Ts=u(()=>{Ps();Cs();Ox=function(e){let t=e.world;e.docs.forEach(n=>{for(let r=0;r<n.length;r+=1)if(n[r].tags.size===0){let o=null;o=o||xs(n,r,t),o=o||As(n,r,t);}});},Ns={lexicon:Ox};});var Hx,Es,Is=u(()=>{Hx=function(e){let t={},n={};return Object.keys(e).forEach(r=>{let o=e[r];r=r.toLowerCase().trim(),r=r.replace(/'s\b/,"");let i=r.split(/ /);i.length>1&&(n[i[0]]===void 0||i.length>n[i[0]])&&(n[i[0]]=i.length),t[r]=t[r]||o;}),delete t[""],delete t[null],delete t[" "],{lex:t,_multi:n}},Es=Hx;});var Ds,js=u(()=>{Is();Ds={one:{expandLexicon:Es}};});var Fx,Ss,Os=u(()=>{Fx=function(e,t=false){let n=this.world(),{methods:r,model:o}=n;if(!e)return;if(Object.keys(e).forEach(s=>{typeof e[s]=="string"&&e[s].startsWith("#")&&(e[s]=e[s].replace(/^#/,""));}),t===true){let{lex:s,_multi:l}=r.one.expandLexicon(e,n);Object.assign(o.one._multiCache,l),Object.assign(o.one.frozenLex,s);return}if(r.two.expandLexicon){let{lex:s,_multi:l}=r.two.expandLexicon(e,n);Object.assign(o.one.lexicon,s),Object.assign(o.one._multiCache,l);}let{lex:i,_multi:a}=r.one.expandLexicon(e,n);Object.assign(o.one.lexicon,i),Object.assign(o.one._multiCache,a);},Ss={addWords:Fx};});var Gx,Hs,Fs=u(()=>{Ts();js();Os();Gx={one:{lexicon:{},_multiCache:{},frozenLex:{}}},Hs={model:Gx,methods:Ds,compute:Ns,lib:Ss,hooks:["lexicon"]};});var Mx,zx,On,$r=u(()=>{Mx=function(e,t){let{methods:n,model:r}=t;return n.one.tokenize.splitTerms(e,r).map(i=>n.one.tokenize.splitWhitespace(i,r)).map(i=>i.text.toLowerCase())},zx=function(e,t){let n=[{}],r=[null],o=[0],i=[],a=0;e.forEach(function(s){let l=0,c=Mx(s,t);for(let d=0;d<c.length;d++){let h=c[d];n[l]&&n[l].hasOwnProperty(h)?l=n[l][h]:(a++,n[l][h]=a,n[a]={},l=a,r[a]=null);}r[l]=[c.length];});for(let s in n[0])a=n[0][s],o[a]=0,i.push(a);for(;i.length;){let s=i.shift(),l=Object.keys(n[s]);for(let c=0;c<l.length;c+=1){let d=l[c],h=n[s][d];for(i.push(h),a=o[s];a>0&&!n[a].hasOwnProperty(d);)a=o[a];if(n.hasOwnProperty(a)){let p=n[a][d];o[h]=p,r[p]&&(r[h]=r[h]||[],r[h]=r[h].concat(r[p]));}else o[h]=0;}}return {goNext:n,endAs:r,failTo:o}},On=zx;});var Vx,Lx,Bx,Gs,Ms=u(()=>{Vx=function(e,t,n){let r=0,o=[];for(let i=0;i<e.length;i++){let a=e[i][n.form]||e[i].normal;for(;r>0&&(t.goNext[r]===void 0||!t.goNext[r].hasOwnProperty(a));)r=t.failTo[r]||0;if(t.goNext[r].hasOwnProperty(a)&&(r=t.goNext[r][a],t.endAs[r])){let s=t.endAs[r];for(let l=0;l<s.length;l++){let c=s[l],d=e[i-c+1],[h,p]=d.index;o.push([h,p,p+c,d.id]);}}}return o},Lx=function(e,t){for(let n=0;n<e.length;n+=1)if(t.has(e[n])===true)return false;return true},Bx=function(e,t,n){let r=[];n.form=n.form||"normal";let o=e.docs;if(!t.goNext||!t.goNext[0])return console.error("Compromise invalid lookup trie"),e.none();let i=Object.keys(t.goNext[0]);for(let a=0;a<o.length;a++){if(e._cache&&e._cache[a]&&Lx(i,e._cache[a])===true)continue;let s=o[a],l=Vx(s,t,n);l.length>0&&(r=r.concat(l));}return e.update(r)},Gs=Bx;});function zs(e){e.prototype.lookup=function(t,n={}){if(!t)return this.none();typeof t=="string"&&(t=[t]);let r=$x(t)?t:On(t,this.world),o=Gs(this,r,n);return o=o.settle(),o};}var $x,Vs=u(()=>{$r();Ms();$x=e=>Object.prototype.toString.call(e)==="[object Object]";});var Rr,Rx,Ls,Bs=u(()=>{Rr=(e,t)=>{for(let n=e.length-1;n>=0;n-=1)if(e[n]!==t)return e=e.slice(0,n+1),e;return e},Rx=function(e){return e.goNext=e.goNext.map(t=>{if(Object.keys(t).length!==0)return t}),e.goNext=Rr(e.goNext,void 0),e.failTo=Rr(e.failTo,0),e.endAs=Rr(e.endAs,null),e},Ls=Rx;});var Wr,$s,Rs=u(()=>{Vs();Bs();$r();Wr={buildTrie:function(e){let t=On(e,this.world());return Ls(t)}};Wr.compile=Wr.buildTrie;$s={api:zs,lib:Wr};});var Ws,Kr,vt,Ks,wt,xt,Js=u(()=>{Ws=function(e,t){return t&&e.forEach(n=>{let r=n[0];t[r]&&(n[0]=t[r][0],n[1]+=t[r][1],n[2]+=t[r][1]);}),e},Kr=function(e,t){let{ptrs:n,byGroup:r}=e;return n=Ws(n,t),Object.keys(r).forEach(o=>{r[o]=Ws(r[o],t);}),{ptrs:n,byGroup:r}},vt=function(e,t,n){let r=n.methods.one;return typeof e=="number"&&(e=String(e)),typeof e=="string"&&(e=r.killUnicode(e,n),e=r.parseMatch(e,t,n)),e},Ks=e=>Object.prototype.toString.call(e)==="[object Object]",wt=e=>e&&Ks(e)&&e.isView===true,xt=e=>e&&Ks(e)&&e.isNet===true;});var Wx,Kx,Jx,_x,Ux,_s,Us=u(()=>{Js();Wx=function(e,t,n){let r=this.methods.one;if(wt(e))return this.intersection(e);if(xt(e))return this.sweep(e,{tagger:false}).view.settle();e=vt(e,n,this.world);let o={regs:e,group:t},i=r.match(this.docs,o,this._cache),{ptrs:a,byGroup:s}=Kr(i,this.fullPointer),l=this.toView(a);return l._groups=s,l},Kx=function(e,t,n){let r=this.methods.one;if(wt(e))return this.intersection(e).eq(0);if(xt(e))return this.sweep(e,{tagger:false,matchOne:true}).view;e=vt(e,n,this.world);let o={regs:e,group:t,justOne:true},i=r.match(this.docs,o,this._cache),{ptrs:a,byGroup:s}=Kr(i,this.fullPointer),l=this.toView(a);return l._groups=s,l},Jx=function(e,t,n){let r=this.methods.one;if(wt(e))return this.intersection(e).fullPointer.length>0;if(xt(e))return this.sweep(e,{tagger:false}).view.found;e=vt(e,n,this.world);let o={regs:e,group:t,justOne:true};return r.match(this.docs,o,this._cache).ptrs.length>0},_x=function(e,t,n){let r=this.methods.one;if(wt(e))return this.filter(l=>l.intersection(e).found);if(xt(e)){let l=this.sweep(e,{tagger:false}).view.settle();return this.if(l)}e=vt(e,n,this.world);let o={regs:e,group:t,justOne:true},i=this.fullPointer,a=this._cache||[];i=i.filter((l,c)=>{let d=this.update([l]);return r.match(d.docs,o,a[c]).ptrs.length>0});let s=this.update(i);return this._cache&&(s._cache=i.map(l=>a[l[0]])),s},Ux=function(e,t,n){let{methods:r}=this,o=r.one;if(wt(e))return this.filter(s=>!s.intersection(e).found);if(xt(e)){let s=this.sweep(e,{tagger:false}).view.settle();return this.ifNo(s)}e=vt(e,n,this.world);let i=this._cache||[],a=this.filter((s,l)=>{let c={regs:e,group:t,justOne:true};return o.match(s.docs,c,i[l]).ptrs.length===0});return this._cache&&(a._cache=a.ptrs.map(s=>i[s[0]])),a},_s={matchOne:Kx,match:Wx,has:Jx,if:_x,ifNo:Ux};});var qx,Qx,Xx,Yx,Zx,qs,Qs=u(()=>{qx=function(e,t,n){let{indexN:r}=this.methods.one.pointer,o=[],i=r(this.fullPointer);Object.keys(i).forEach(s=>{let l=i[s].sort((c,d)=>c[1]>d[1]?1:-1)[0];l[1]>0&&o.push([l[0],0,l[1]]);});let a=this.toView(o);return e?a.match(e,t,n):a},Qx=function(e,t,n){let{indexN:r}=this.methods.one.pointer,o=[],i=r(this.fullPointer),a=this.document;Object.keys(i).forEach(l=>{let c=i[l].sort((p,b)=>p[1]>b[1]?-1:1)[0],[d,,h]=c;h<a[d].length&&o.push([d,h,a[d].length]);});let s=this.toView(o);return e?s.match(e,t,n):s},Xx=function(e,t,n){typeof e=="string"&&(e=this.world.methods.one.parseMatch(e,n,this.world)),e[e.length-1].end=true;let r=this.fullPointer;return this.forEach((o,i)=>{let a=o.before(e,t);if(a.found){let s=a.terms();r[i][1]-=s.length,r[i][3]=s.docs[0][0].id;}}),this.update(r)},Yx=function(e,t,n){typeof e=="string"&&(e=this.world.methods.one.parseMatch(e,n,this.world)),e[0].start=true;let r=this.fullPointer;return this.forEach((o,i)=>{let a=o.after(e,t);if(a.found){let s=a.terms();r[i][2]+=s.length,r[i][4]=null;}}),this.update(r)},Zx=function(e,t,n){return this.growRight(e,t,n).growLeft(e,t,n)},qs={before:qx,after:Qx,growLeft:Xx,growRight:Yx,grow:Zx};});var Xs,e2,Jr,_r,Pt,Ys,Zs=u(()=>{Xs=function(e,t){return [e[0],e[1],t[2]]},e2=function(e){return Object.prototype.toString.call(e)==="[object Array]"},Jr=(e,t,n)=>typeof e=="string"||e2(e)?t.match(e,n):e||t.none(),_r=function(e,t){let[n,r,o]=e;return t.document[n]&&t.document[n][r]&&(e[3]=e[3]||t.document[n][r].id,t.document[n][o-1]&&(e[4]=e[4]||t.document[n][o-1].id)),e},Pt={};Pt.splitOn=function(e,t){let{splitAll:n}=this.methods.one.pointer,r=Jr(e,this,t).fullPointer,o=n(this.fullPointer,r),i=[];return o.forEach(a=>{i.push(a.passthrough),i.push(a.before),i.push(a.match),i.push(a.after);}),i=i.filter(a=>a),i=i.map(a=>_r(a,this)),this.update(i)};Pt.splitBefore=function(e,t){let{splitAll:n}=this.methods.one.pointer,r=Jr(e,this,t).fullPointer,o=n(this.fullPointer,r);for(let a=0;a<o.length;a+=1)!o[a].after&&o[a+1]&&o[a+1].before&&o[a].match&&o[a].match[0]===o[a+1].before[0]&&(o[a].after=o[a+1].before,delete o[a+1].before);let i=[];return o.forEach(a=>{i.push(a.passthrough),i.push(a.before),a.match&&a.after?i.push(Xs(a.match,a.after)):i.push(a.match);}),i=i.filter(a=>a),i=i.map(a=>_r(a,this)),this.update(i)};Pt.splitAfter=function(e,t){let{splitAll:n}=this.methods.one.pointer,r=Jr(e,this,t).fullPointer,o=n(this.fullPointer,r),i=[];return o.forEach(a=>{i.push(a.passthrough),a.before&&a.match?i.push(Xs(a.before,a.match)):(i.push(a.before),i.push(a.match)),i.push(a.after);}),i=i.filter(a=>a),i=i.map(a=>_r(a,this)),this.update(i)};Pt.split=Pt.splitAfter;Ys=Pt;});var t2,el,n2,tl,nl=u(()=>{t2=function(e,t){return !e||!t||e[0]!==t[0]?false:e[2]===t[1]},el=function(e,t,n){let r=e.world,o=r.methods.one.parseMatch;t=t||".$",n=n||"^.";let i=o(t,{},r),a=o(n,{},r);i[i.length-1].end=true,a[0].start=true;let s=e.fullPointer,l=[s[0]];for(let c=1;c<s.length;c+=1){let d=l[l.length-1],h=s[c],p=e.update([d]),b=e.update([h]);t2(d,h)&&p.has(i)&&b.has(a)?l[l.length-1]=[d[0],d[1],h[2],d[3],h[4]]:l.push(h);}return e.update(l)},n2={joinIf:function(e,t){return el(this,e,t)},join:function(){return el(this)}},tl=n2;});var ye,r2,rl,ol=u(()=>{Us();Qs();Zs();nl();ye=Object.assign({},_s,qs,Ys,tl);ye.lookBehind=ye.before;ye.lookBefore=ye.before;ye.lookAhead=ye.after;ye.lookAfter=ye.after;ye.notIf=ye.ifNo;r2=function(e){Object.assign(e.prototype,ye);},rl=r2;});var o2,i2,a2,s2,il,al,l2,sl,ll=u(()=>{o2=/(?:^|\s)([![^]*(?:<[^<]*>)?\/.*?[^\\/]\/[?\]+*$~]*)(?:\s|$)/,i2=/([!~[^]*(?:<[^<]*>)?\([^)]+[^\\)]\)[?\]+*$~]*)(?:\s|$)/,a2=/ /g,s2=e=>/^[![^]*(<[^<]*>)?\(/.test(e)&&/\)[?\]+*$~]*$/.test(e),il=e=>/^[![^]*(<[^<]*>)?\//.test(e)&&/\/[?\]+*$~]*$/.test(e),al=function(e){return e=e.map(t=>t.trim()),e=e.filter(t=>t),e},l2=function(e){let t=e.split(o2),n=[];t.forEach(o=>{if(il(o)){n.push(o);return}n=n.concat(o.split(i2));}),n=al(n);let r=[];return n.forEach(o=>{s2(o)||il(o)?r.push(o):r=r.concat(o.split(a2));}),r=al(r),r},sl=l2;});var ul,cl,u2,dl,de,ae,kt,At,Bt,hl,fl,pl=u(()=>{ul=/\{([0-9]+)?(, *[0-9]*)?\}/,cl=/&&/,u2=new RegExp(/^<\s*(\S+)\s*>/),dl=e=>e.charAt(0).toUpperCase()+e.substring(1),de=e=>e.charAt(e.length-1),ae=e=>e.charAt(0),kt=e=>e.substring(1),At=e=>e.substring(0,e.length-1),Bt=function(e){return e=kt(e),e=At(e),e},hl=function(e,t){let n={};for(let r=0;r<2;r+=1){if(de(e)==="$"&&(n.end=true,e=At(e)),ae(e)==="^"&&(n.start=true,e=kt(e)),de(e)==="?"&&(n.optional=true,e=At(e)),(ae(e)==="["||de(e)==="]")&&(n.group=null,ae(e)==="["&&(n.groupStart=true),de(e)==="]"&&(n.groupEnd=true),e=e.replace(/^\[/,""),e=e.replace(/\]$/,""),ae(e)==="<")){let o=u2.exec(e);o.length>=2&&(n.group=o[1],e=e.replace(o[0],""));}if(de(e)==="+"&&(n.greedy=true,e=At(e)),e!=="*"&&de(e)==="*"&&e!=="\\*"&&(n.greedy=true,e=At(e)),ae(e)==="!"&&(n.negative=true,e=kt(e)),ae(e)==="~"&&de(e)==="~"&&e.length>2&&(e=Bt(e),n.fuzzy=true,n.min=t.fuzzy||.85,/\(/.test(e)===false))return n.word=e,n;if(ae(e)==="/"&&de(e)==="/")return e=Bt(e),t.caseSensitive&&(n.use="text"),n.regex=new RegExp(e),n;if(ul.test(e)===true&&(e=e.replace(ul,(o,i,a)=>(a===void 0?(n.min=Number(i),n.max=Number(i)):(a=a.replace(/, */,""),i===void 0?(n.min=0,n.max=Number(a)):(n.min=Number(i),n.max=Number(a||999))),n.greedy=true,n.min||(n.optional=true),""))),ae(e)==="("&&de(e)===")"){cl.test(e)?(n.choices=e.split(cl),n.operator="and"):(n.choices=e.split("|"),n.operator="or"),n.choices[0]=kt(n.choices[0]);let o=n.choices.length-1;n.choices[o]=At(n.choices[o]),n.choices=n.choices.map(i=>i.trim()),n.choices=n.choices.filter(i=>i),n.choices=n.choices.map(i=>i.split(/ /g).map(a=>hl(a,t))),e="";}if(ae(e)==="{"&&de(e)==="}"){if(e=Bt(e),n.root=e,/\//.test(e)){let o=n.root.split(/\//);n.root=o[0],n.pos=o[1],n.pos==="adj"&&(n.pos="Adjective"),n.pos=n.pos.charAt(0).toUpperCase()+n.pos.substr(1).toLowerCase(),o[2]!==void 0&&(n.sense=o[2]);}return n}if(ae(e)==="<"&&de(e)===">")return e=Bt(e),n.chunk=dl(e),n.greedy=true,n;if(ae(e)==="%"&&de(e)==="%")return e=Bt(e),n.switch=e,n}return ae(e)==="#"?(n.tag=kt(e),n.tag=dl(n.tag),n):ae(e)==="@"?(n.method=kt(e),n):e==="."?(n.anything=true,n):e==="*"?(n.anything=true,n.greedy=true,n.optional=true,n):(e&&(e=e.replace("\\*","*"),e=e.replace("\\.","."),t.caseSensitive?n.use="text":e=e.toLowerCase(),n.word=e),n)},fl=hl;});var c2,d2,ml,gl=u(()=>{c2=/[a-z0-9][-–—][a-z]/i,d2=function(e,t){let n=t.model.one.prefixes;for(let r=e.length-1;r>=0;r-=1){let o=e[r];if(o.word&&c2.test(o.word)){let i=o.word.split(/[-–—]/g);if(n.hasOwnProperty(i[0]))continue;i=i.filter(a=>a).reverse(),e.splice(r,1),i.forEach(a=>{let s=Object.assign({},o);s.word=a,e.splice(r,0,s);});}}return e},ml=d2;});var bl,yl,vl,h2,wl,xl=u(()=>{bl=function(e,t){let{all:n}=t.methods.two.transform.verb||{},r=e.root;return n?n(r,t.model):[]},yl=function(e,t){let{all:n}=t.methods.two.transform.noun||{};return n?n(e.root,t.model):[e.root]},vl=function(e,t){let{all:n}=t.methods.two.transform.adjective||{};return n?n(e.root,t.model):[e.root]},h2=function(e,t){return e=e.map(n=>{if(n.root)if(t.methods.two&&t.methods.two.transform){let r=[];n.pos?n.pos==="Verb"?r=r.concat(bl(n,t)):n.pos==="Noun"?r=r.concat(yl(n,t)):n.pos==="Adjective"&&(r=r.concat(vl(n,t))):(r=r.concat(bl(n,t)),r=r.concat(yl(n,t)),r=r.concat(vl(n,t))),r=r.filter(o=>o),r.length>0&&(n.operator="or",n.fastOr=new Set(r));}else n.machine=n.root,delete n.id,delete n.root;return n}),e},wl=h2;});var f2,p2,m2,g2,Pl,kl=u(()=>{f2=function(e){let t=0,n=null;for(let r=0;r<e.length;r++){let o=e[r];o.groupStart===true&&(n=o.group,n===null&&(n=String(t),t+=1)),n!==null&&(o.group=n),o.groupEnd===true&&(n=null);}return e},p2=function(e){return e.map(t=>{if(t.choices!==void 0){if(t.operator!=="or"||t.fuzzy===true)return t;t.choices.every(r=>{if(r.length!==1)return false;let o=r[0];return o.fuzzy===true||o.start||o.end?false:o.word!==void 0&&o.negative!==true&&o.optional!==true&&o.method!==true})===true&&(t.fastOr=new Set,t.choices.forEach(r=>{t.fastOr.add(r[0].word);}),delete t.choices);}return t})},m2=function(e){return e.map(t=>(t.fuzzy&&t.choices&&t.choices.forEach(n=>{n.length===1&&n[0].word&&(n[0].fuzzy=true,n[0].min=t.min);}),t))},g2=function(e){return e=f2(e),e=p2(e),e=m2(e),e},Pl=g2;});var b2,Al,Cl=u(()=>{ll();pl();gl();xl();kl();b2=function(e,t,n){if(e==null||e==="")return [];t=t||{},typeof e=="number"&&(e=String(e));let r=sl(e);return r=r.map(o=>fl(o,t)),r=ml(r,n),r=wl(r,n),r=Pl(r,t),r},Al=b2;});var y2,v2,Nl,Tl=u(()=>{y2=function(e,t){for(let n of t)if(e.has(n))return true;return false},v2=function(e,t){for(let n=0;n<e.length;n+=1){let r=e[n];if(!(r.optional===true||r.negative===true||r.fuzzy===true)){if(r.word!==void 0&&t.has(r.word)===false||r.tag!==void 0&&t.has("#"+r.tag)===false)return true;if(r.fastOr&&y2(r.fastOr,t)===false)return false}}return false},Nl=v2;});var w2,x2,El,Il=u(()=>{w2=function(e,t){let n=e.length,r=t.length;if(n===0)return r;if(r===0)return n;let o=(r>n?r:n)+1;if(Math.abs(n-r)>(o||100))return o||100;let i=[];for(let p=0;p<o;p++)i[p]=[p],i[p].length=o;for(let p=0;p<o;p++)i[0][p]=p;let a,s,l,c,d,h;for(let p=1;p<=n;++p)for(s=e[p-1],a=1;a<=r;++a){if(p===a&&i[p][a]>4)return n;l=t[a-1],c=s===l?0:1,d=i[p-1][a]+1,(h=i[p][a-1]+1)<d&&(d=h),(h=i[p-1][a-1]+c)<d&&(d=h),p>1&&a>1&&s===t[a-2]&&e[p-2]===l&&(h=i[p-2][a-2]+c)<d?i[p][a]=h:i[p][a]=d;}return i[n][r]},x2=function(e,t,n=3){if(e===t)return 1;if(e.length<n||t.length<n)return 0;let r=w2(e,t),o=Math.max(e.length,t.length);return 1-(o===0?0:r/o)},El=x2;});var P2,k2,Dl,jl,Ce,Ur,$t,qr=u(()=>{P2=/([\u0022\uFF02\u0027\u201C\u2018\u201F\u201B\u201E\u2E42\u201A\u00AB\u2039\u2035\u2036\u2037\u301D\u0060\u301F])/,k2=/([\u0022\uFF02\u0027\u201D\u2019\u00BB\u203A\u2032\u2033\u2034\u301E\u00B4])/,Dl=/^[-–—]$/,jl=/ [-–—]{1,3} /,Ce=(e,t)=>e.post.indexOf(t)!==-1,Ur={hasQuote:e=>P2.test(e.pre)||k2.test(e.post),hasComma:e=>Ce(e,","),hasPeriod:e=>Ce(e,".")===true&&Ce(e,"...")===false,hasExclamation:e=>Ce(e,"!"),hasQuestionMark:e=>Ce(e,"?")||Ce(e,"\xBF"),hasEllipses:e=>Ce(e,"..")||Ce(e,"\u2026"),hasSemicolon:e=>Ce(e,";"),hasColon:e=>Ce(e,":"),hasSlash:e=>/\//.test(e.text),hasHyphen:e=>Dl.test(e.post)||Dl.test(e.pre),hasDash:e=>jl.test(e.post)||jl.test(e.pre),hasContraction:e=>!!e.implicit,isAcronym:e=>e.tags.has("Acronym"),isKnown:e=>e.tags.size>0,isTitleCase:e=>/^\p{Lu}[a-z'\u00C0-\u00FF]/u.test(e.text),isUpperCase:e=>/^\p{Lu}+$/u.test(e.text)};Ur.hasQuotation=Ur.hasQuote;$t=Ur;});var Hn,A2,L,it=u(()=>{Il();qr();Hn=function(){},A2=function(e,t,n,r){if(t.anything===true)return true;if(t.start===true&&n!==0||t.end===true&&n!==r-1)return false;if(t.id!==void 0&&t.id===e.id)return true;if(t.word!==void 0)return t.use?t.word===e[t.use]:e.machine!==null&&e.machine===t.word||e.alias!==void 0&&e.alias.hasOwnProperty(t.word)||t.fuzzy===true&&(t.word===e.root||El(t.word,e.normal)>=t.min)||e.alias&&e.alias.some(o=>o===t.word)?true:t.word===e.text||t.word===e.normal;if(t.tag!==void 0)return e.tags.has(t.tag)===true;if(t.method!==void 0)return typeof $t[t.method]=="function"&&$t[t.method](e)===true;if(t.pre!==void 0)return e.pre&&e.pre.includes(t.pre);if(t.post!==void 0)return e.post&&e.post.includes(t.post);if(t.regex!==void 0){let o=e.normal;return t.use&&(o=e[t.use]),t.regex.test(o)}if(t.chunk!==void 0)return e.chunk===t.chunk;if(t.switch!==void 0)return e.switch===t.switch;if(t.machine!==void 0)return e.normal===t.machine||e.machine===t.machine||e.root===t.machine;if(t.sense!==void 0)return e.sense===t.sense;if(t.fastOr!==void 0){if(t.pos&&!e.tags.has(t.pos))return null;let o=e.root||e.implicit||e.machine||e.normal;return t.fastOr.has(o)||t.fastOr.has(e.text)}return t.choices!==void 0?t.operator==="and"?t.choices.every(o=>Hn(e,o,n,r)):t.choices.some(o=>Hn(e,o,n,r)):false};Hn=function(e,t,n,r){let o=A2(e,t,n,r);return t.negative===true?!o:o};L=Hn;});var Sl,Ol,Hl,Fn=u(()=>{it();Sl=function(e,t){let n=Object.assign({},e.regs[e.r],{start:false,end:false}),r=e.t;for(;e.t<e.terms.length;e.t+=1){if(t&&L(e.terms[e.t],t,e.start_i+e.t,e.phrase_length))return e.t;let o=e.t-r+1;if(n.max!==void 0&&o===n.max)return e.t;if(L(e.terms[e.t],n,e.start_i+e.t,e.phrase_length)===false)return n.min!==void 0&&o<n.min?null:e.t}return e.t},Ol=function(e,t){let n=e.t;if(!t)return e.terms.length;for(;n<e.terms.length;n+=1)if(L(e.terms[n],t,e.start_i+n,e.phrase_length)===true)return n;return null},Hl=function(e,t){if(e.end===true&&e.greedy===true&&t.start_i+t.t<t.phrase_length-1){let n=Object.assign({},e,{end:false});if(L(t.terms[t.t],n,t.start_i+t.t,t.phrase_length)===true)return true}return false};});var We,Rt=u(()=>{We=function(e,t){return e.groups[e.inGroup]||(e.groups[e.inGroup]={start:t,length:0}),e.groups[e.inGroup]};});var C2,Fl,Gl=u(()=>{Fn();Rt();C2=function(e){let{regs:t}=e,n=t[e.r],r=Ol(e,t[e.r+1]);if(r===null||r===0||n.min!==void 0&&r-e.t<n.min)return null;if(n.max!==void 0&&r-e.t>n.max)return e.t=e.t+n.max,true;if(e.hasGroup===true){let o=We(e,e.t);o.length=r-e.t;}return e.t=r,true},Fl=C2;});var N2,Qr,Ml,Xr=u(()=>{it();N2=function(e){return Object.prototype.toString.call(e)==="[object Array]"},Qr=function(e,t=0){let n=e.regs[e.r],r=false;for(let o=0;o<n.choices.length;o+=1){let i=n.choices[o];if(!N2(i))return false;if(r=i.every((a,s)=>{let l=0,c=e.t+s+t+l;if(e.terms[c]===void 0)return false;let d=L(e.terms[c],a,c+e.start_i,e.phrase_length);if(d===true&&a.greedy===true)for(let h=1;h<e.terms.length;h+=1){let p=e.terms[c+h];if(p)if(L(p,a,e.start_i+h,e.phrase_length)===true)l+=1;else break}return t+=l,d}),r){t+=i.length;break}}return r&&n.greedy===true?Qr(e,t):t},Ml=function(e){let t=0;return e.regs[e.r].choices.every(o=>{let i=o.every((a,s)=>{let l=e.t+s;return e.terms[l]===void 0?false:L(e.terms[l],a,l,e.phrase_length)});return i===true&&o.length>t&&(t=o.length),i})===true?t:false};});var T2,zl,Vl=u(()=>{Xr();Rt();T2=function(e){let{regs:t}=e,n=t[e.r],r=Qr(e);if(r){if(n.negative===true)return null;if(e.hasGroup===true){let o=We(e,e.t);o.length+=r;}if(n.end===true){let o=e.phrase_length;if(e.t+e.start_i+r!==o)return null}return e.t+=r,true}else if(!n.optional)return null;return true},zl=T2;});var E2,Ll,Bl=u(()=>{Xr();Rt();E2=function(e){let{regs:t}=e,n=t[e.r],r=Ml(e);if(r){if(n.negative===true)return null;if(e.hasGroup===true){let o=We(e,e.t);o.length+=r;}if(n.end===true){let o=e.phrase_length-1;if(e.t+e.start_i!==o)return null}return e.t+=r,true}else if(!n.optional)return null;return true},Ll=E2;});var I2,$l,Rl=u(()=>{it();I2=function(e,t,n){let r=0;for(let o=e.t;o<e.terms.length;o+=1){let i=L(e.terms[o],t,e.start_i+e.t,e.phrase_length);if(i||n&&(i=L(e.terms[o],n,e.start_i+e.t,e.phrase_length),i)||(r+=1,t.max!==void 0&&r===t.max))break}return r===0||t.min&&t.min>r?false:(e.t+=r,true)},$l=I2;});var D2,Wl,Kl=u(()=>{it();Rl();D2=function(e){let{regs:t}=e,n=t[e.r],r=Object.assign({},n);if(r.negative=false,L(e.terms[e.t],r,e.start_i+e.t,e.phrase_length))return false;if(n.optional){let i=t[e.r+1];i&&(L(e.terms[e.t],i,e.start_i+e.t,e.phrase_length)?e.r+=1:i.optional&&t[e.r+2]&&L(e.terms[e.t],t[e.r+2],e.start_i+e.t,e.phrase_length)&&(e.r+=2));}return n.greedy?$l(e,r,t[e.r+1]):(e.t+=1,true)},Wl=D2;});var j2,Jl,_l=u(()=>{it();j2=function(e){let{regs:t}=e,n=t[e.r],r=e.terms[e.t],o=L(r,t[e.r+1],e.start_i+e.t,e.phrase_length);if(n.negative||o){let i=e.terms[e.t+1];(!i||!L(i,t[e.r+1],e.start_i+e.t,e.phrase_length))&&(e.r+=1);}},Jl=j2;});var S2,Ul,ql=u(()=>{Fn();S2=function(e){let{regs:t,phrase_length:n}=e,r=t[e.r];return e.t=Sl(e,t[e.r+1]),e.t===null||r.min&&r.min>e.t||r.end===true&&e.start_i+e.t!==n?null:true},Ul=S2;});var O2,Ql,Xl=u(()=>{O2=function(e){let t=e.terms[e.t],n=e.regs[e.r];if(t.implicit&&e.terms[e.t+1]){if(!e.terms[e.t+1].implicit)return;n.word===t.normal&&(e.t+=1),n.method==="hasContraction"&&(e.t+=1);}},Ql=O2;});var H2,F2,Gn,Yl=u(()=>{Rt();_l();ql();Xl();H2=function(e,t){let n=e.regs[e.r],r=We(e,t);e.t>1&&n.greedy?r.length+=e.t-t:r.length++;},F2=function(e){let{regs:t}=e,n=t[e.r],r=e.terms[e.t],o=e.t;return n.optional&&t[e.r+1]&&n.negative?true:(n.optional&&t[e.r+1]&&Jl(e),r.implicit&&e.terms[e.t+1]&&Ql(e),e.t+=1,n.end===true&&e.t!==e.terms.length&&n.greedy!==true||n.greedy===true&&!Ul(e)?null:(e.hasGroup===true&&H2(e,o),true))},Gn=F2;});var G2,Wt,Yr=u(()=>{Gl();Vl();Bl();Kl();Yl();Fn();it();G2=function(e,t,n,r){if(e.length===0||t.length===0)return null;let o={t:0,terms:e,r:0,regs:t,groups:{},start_i:n,phrase_length:r,inGroup:null};for(;o.r<t.length;o.r+=1){let s=t[o.r];if(o.hasGroup=!!s.group,o.hasGroup===true?o.inGroup=s.group:o.inGroup=null,!o.terms[o.t]){if(t.slice(o.r).some(d=>!d.optional)===false)break;return null}if(s.anything===true&&s.greedy===true){if(!Fl(o))return null;continue}if(s.choices!==void 0&&s