@synnaxlabs/pluto 0.47.0 → 0.47.1
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.
- package/dist/{Animated-Ck-9v2gm.cjs → Animated-Bq6z2XkH.cjs} +1 -1
- package/dist/{Animated-otpyxn5i.js → Animated-CEx4LoLs.js} +2 -2
- package/dist/{Animated-M9ynNzcI.js → Animated-CUFx-eAB.js} +3 -3
- package/dist/{Animated-BewuBtBY.cjs → Animated-NfnNvlbz.cjs} +1 -1
- package/dist/{Button-C3dvpk52.cjs → Button-BMeq9Z2I.cjs} +1 -1
- package/dist/{Button-BFoGC4WW.js → Button-CMRdj9Ti.js} +3 -3
- package/dist/{Dialog-CO4iLhHf.js → Dialog-Bi1Sf3oc.js} +1 -1
- package/dist/{Dialog-DwhFD4z2.cjs → Dialog-BnPvG5WQ.cjs} +1 -1
- package/dist/{Items-DNcTFEUJ.cjs → Items-CHAbP2ZL.cjs} +1 -1
- package/dist/{Items-G25zb57I.js → Items-Cmc6otoS.js} +4 -4
- package/dist/{Menu-D-uhqnfk.cjs → Menu-BImhHf24.cjs} +1 -1
- package/dist/{Menu-DqkB9vpH.js → Menu-CQ_GMgB9.js} +4 -4
- package/dist/{Provider-575hnWmi.cjs → Provider-BV7nN39a.cjs} +1 -1
- package/dist/{Provider--RxgAoVG.js → Provider-D0P_lzCo.js} +1 -1
- package/dist/{Tags-Dpu9kD_T.js → Tags-6IUFBvU-.js} +7 -7
- package/dist/{Tags-Dekr_hwk.cjs → Tags-DtnStTuF.cjs} +1 -1
- package/dist/{Text-BzTkWLeU.js → Text-BnUGzpJq.js} +35 -35
- package/dist/Text-DY08sSZe.cjs +1 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{external-CGRGVYRj.js → external-6RyUkYAB.js} +1 -1
- package/dist/{external-CeNR2kU9.js → external-6vmyay3h.js} +4 -4
- package/dist/{external-B7hb5HYU.js → external-BSjAne2q.js} +1 -1
- package/dist/{external-D9LndfvY.js → external-BTlfU938.js} +1 -1
- package/dist/{external-BVcgi9yX.cjs → external-BcZE443U.cjs} +1 -1
- package/dist/{external-DUoHSX0Q.js → external-Bo9Dyf8v.js} +2 -2
- package/dist/{external-BA6DRS2n.cjs → external-BrQU-ZN8.cjs} +1 -1
- package/dist/{external-DZSXelLG.js → external-CAcL3DJP.js} +3 -3
- package/dist/{external-B2Q-Yx8D.cjs → external-CMBnwYR4.cjs} +1 -1
- package/dist/{external-C_dsD7px.cjs → external-CSntN1is.cjs} +1 -1
- package/dist/{external-DEWhnbVF.cjs → external-CTrkvlmd.cjs} +1 -1
- package/dist/{external-C5ssXUvL.cjs → external-CTsR6bs9.cjs} +1 -1
- package/dist/{external-FIE7PzLB.cjs → external-Clec0nDH.cjs} +1 -1
- package/dist/{external-DrUtWpiV.js → external-CtiE4JLk.js} +5 -5
- package/dist/{external-BZwFEYop.js → external-D7EEjQaR.js} +3 -3
- package/dist/{external-B9a_p-VK.cjs → external-DDzR-j7b.cjs} +1 -1
- package/dist/{external-CraRr06G.js → external-DGNBXSAj.js} +7 -7
- package/dist/{external-CMiEiLpE.js → external-Daiy-vZ3.js} +6 -6
- package/dist/{external-g62tixOz.cjs → external-Ddn3rc_Q.cjs} +1 -1
- package/dist/{external-_LWHQroW.cjs → external-Dl0l3iHN.cjs} +1 -1
- package/dist/{external-C5W7VXIW.cjs → external-Eaj0hgzm.cjs} +1 -1
- package/dist/{external-x9Ylk2op.js → external-OzDazbiJ.js} +8 -8
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/{hooks-15yB7IKE.js → hooks-Bvv-S6WC.js} +1 -1
- package/dist/{hooks-D_-XdOAe.cjs → hooks-CoF3Fkrn.cjs} +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.js +5238 -5226
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/src/triggers/Provider.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/package.json +6 -6
- package/dist/Text-DECnk5vG.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Ce=require("./jsx-runtime-Dszzpdy0.cjs"),En=require("./Button-C3dvpk52.cjs"),ve=require("./css-HnNQMUzV.cjs"),vr=require("react"),SN=require("./Provider-575hnWmi.cjs"),Ta=require("./Text-DECnk5vG.cjs"),Ba=require("./Tags-Dekr_hwk.cjs"),TN=require("./Dialog-DwhFD4z2.cjs"),Pb=require("./Animated-Ck-9v2gm.cjs"),er=require("./Box-BvqALodh.cjs"),en=require("./Editable-BXFY3-UW.cjs");require("./types-D-yz1qsT.cjs");require("./provider-lNhTlIWj.cjs");const oc=require("./_commonjsHelpers-BH3jXuIh.cjs"),Tl=require("./Items-DNcTFEUJ.cjs"),MN=require("./useStaticData-BTwIe0Il.cjs");require("./eraser-Dm5Du4PL.cjs");require("./Haul-2Xa_nMgc.cjs");const kb=({format:e="dateTime",suppliedTZ:t="UTC",displayTZ:r="local",children:n,...a})=>Ce.jsxRuntimeExports.jsx(en.Text,{...a,children:new ve.r(n,t).toString(e,r)}),FN=(e,t,r)=>e==="preview"&&r===!0?"var(--pluto-primary-z)":t,Ob=({ref:e,className:t,value:r,ghost:n,disabled:a,onChange:i,inputType:o,size:s,variant:u="text",style:l,color:c,borderColor:f,borderWidth:m,bordered:d,rounded:p,background:h,textColor:g,onClick:b,...D})=>Ce.jsxRuntimeExports.jsx(En.Button,{el:"label",variant:u,className:ve.CSS(ve.CSS.BE("input",o),t),ghost:n,disabled:a,size:s,preventClick:!0,style:l,color:c,borderColor:f,borderWidth:m,bordered:d,rounded:p,background:h,textColor:FN(u,g,r),onClick:b,children:u!=="preview"?Ce.jsxRuntimeExports.jsxs(Ce.jsxRuntimeExports.Fragment,{children:[Ce.jsxRuntimeExports.jsx("input",{className:ve.CSS.BE("input",o,"input"),type:"checkbox",ref:e,checked:r,onChange:y=>{y.stopPropagation(),i?.(y.target.checked)},value:"",disabled:a,onClick:b,...D}),Ce.jsxRuntimeExports.jsx("span",{className:ve.CSS.BE("input",o,"indicator"),onClick:b})]}):r?"True":"False"}),PN=e=>Ce.jsxRuntimeExports.jsx(Ob,{...e,inputType:"checkbox"}),$b="cursor-style",ah=(e,t=document.head)=>{Bb();const r=document.createElement("style");r.innerHTML=`*{cursor: ${e} !important;}`,r.id=$b,t.appendChild(r)},Bb=()=>{const e=document.getElementById($b);e?.remove()},_b=e=>e.preventDefault(),kN=e=>e.stopPropagation(),ih=(e,t,r,n,a)=>{const{x:i,y:o}=n??ve.Q.construct(ve.jt.dims(a));if(ve.jt.width(t)>i&&ve.jt.width(t)>ve.jt.height(t)){const s=ve.jt.signedWidth(t)<0?i:-i;e+=(ve.jt.signedWidth(t)+s)*r.x,ah("ew-resize")}if(ve.jt.height(t)>o&&ve.jt.height(t)>ve.jt.width(t)){const s=ve.jt.signedHeight(t)<0?o:-o;e+=(ve.jt.signedHeight(t)+s)*r.y,ah("ns-resize")}return e},sc=({direction:e,className:t,dragScale:r={x:10,y:1},dragThreshold:n=15,dragDirection:a,onChange:i,value:o,resetValue:s,onDragEnd:u,...l})=>{const c=vr.useRef({dragging:!1,curr:o,prev:o}),f=vr.useRef(null);c.current.dragging||(c.current.prev=o);const m=vr.useMemo(()=>{const h=ve.Q.construct(r);return a==="x"?ve.Q.construct(h.x,0):a==="y"?ve.Q.construct(0,h.y):h},[r,a]),d=vr.useMemo(()=>n!=null?ve.Q.construct(n):null,[n]);SN.useVirtualCursorDragWebKit({ref:f,onMove:vr.useCallback(h=>{if(f.current==null)return;let g=c.current.prev;c.current.dragging=!0,g=ih(g,h,m,d,ve.jt.construct(f.current)),c.current.curr=g,i(g)},[i,m,d]),onEnd:vr.useCallback((h,g)=>{if(f.current==null)return;let b=c.current.prev;b=ih(b,h,m,d,ve.jt.construct(f.current)),c.current.prev=b,c.current.dragging=!1,Bb(),u?.(b),l.onBlur?.()},[l.onBlur,u,m,d])});const p=vr.useCallback(()=>{i(s??c.current.prev)},[i,s]);return Ce.jsxRuntimeExports.jsx(En.Button,{ref:f,variant:"outlined",className:ve.CSS(ve.CSS.BE("input","drag-btn"),e!=null&&ve.CSS.BEM("input","drag-btn","direction",e),t),tabIndex:-1,onDoubleClick:p,onClick:_b,contrast:0,textColor:9,...l,children:Ce.jsxRuntimeExports.jsx(Ta.Drag,{})})},ON={x:Number(ve.r.HOUR.valueOf()),y:Number(ve.r.days(.75).valueOf())},Ib=({value:e,onChange:t})=>{const r=new ve.r(e,"UTC");vr.useLayoutEffect(()=>{const i=r.sub(ve.r.utcOffset);if(i.remainder(ve.r.DAY).isZero)return;const o=i.sub(i.remainder(ve.r.DAY));t(Number(new ve.r(o,"local").valueOf()))},[e]);const n=i=>{let o;if(typeof i=="number")o=new ve.r(i,"UTC");else{if(i.length===0)return;o=new ve.r(i,"local")}t(Number(o.valueOf()))};return{value:r.toString("ISODate","local"),onChange:n}},$N=({ref:e,onChange:t,value:r,className:n,showDragHandle:a=!0,children:i,...o})=>{const{value:s,onChange:u}=Ib({value:r,onChange:t});return Ce.jsxRuntimeExports.jsxs(Ba.Text,{ref:e,value:s,className:ve.CSS(ve.CSS.B("input-date"),n),onChange:u,type:"date",...o,children:[a&&Ce.jsxRuntimeExports.jsx(sc,{value:r,onChange:u,dragScale:ON}),i]})};let BN={one:{},two:{},three:{},four:{}},_N={one:{},two:{},three:{}},IN={},zN=[];const zf={methods:BN,model:_N,compute:IN,hooks:zN},jN=e=>Object.prototype.toString.call(e)==="[object Array]",qN={compute:function(e){const{world:t}=this,r=t.compute;return typeof e=="string"&&r.hasOwnProperty(e)?r[e](this):jN(e)?e.forEach(n=>{t.compute.hasOwnProperty(n)?r[n](this):console.warn("no compute:",e)}):typeof e=="function"?e(this):console.warn("no compute:",e),this}},RN=function(e){return this.fullPointer.forEach((r,n)=>{let a=this.update([r]);e(a,n)}),this},LN=function(e,t){let n=this.fullPointer.map((i,o)=>{let s=this.update([i]),u=e(s,o);return u===void 0?this.none():u});if(n.length===0)return t||this.update([]);if(n[0]!==void 0&&(typeof n[0]=="string"||typeof n[0]=="object"&&(n[0]===null||!n[0].isView)))return n;let a=[];return n.forEach(i=>{a=a.concat(i.fullPointer)}),this.toView(a)},HN=function(e){let t=this.fullPointer;return t=t.filter((n,a)=>{let i=this.update([n]);return e(i,a)}),this.update(t)},GN=function(e){let r=this.fullPointer.find((n,a)=>{let i=this.update([n]);return e(i,a)});return this.update([r])},VN=function(e){return this.fullPointer.some((r,n)=>{let a=this.update([r]);return e(a,n)})},UN=function(e=1){let t=this.fullPointer,r=Math.floor(Math.random()*t.length);return r+e>this.length&&(r=this.length-e,r=r<0?0:r),t=t.slice(r,r+e),this.update(t)},WN={forEach:RN,map:LN,filter:HN,find:GN,some:VN,random:UN},Un={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(r=>{t[r]=this.update(this._groups[r])}),t},eq:function(e){let t=this.pointer;return t||(t=this.docs.map((r,n)=>[n])),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 r=this.pointer||this.docs.map((n,a)=>[a]);return r=r.slice(e,t),this.update(r)},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!1;let t=this.fullPointer,r=e.fullPointer;return!t.length===r.length?!1:t.every((n,a)=>r[a]?n[0]===r[a][0]&&n[1]===r[a][1]&&n[2]===r[a][2]:!1)},wordCount:function(){return this.docs.reduce((e,t)=>(e+=t.filter(r=>r.text!=="").length,e),0)},isFull:function(){let e=this.pointer;if(!e)return!0;if(e.length===0||e[0][0]!==0)return!1;let t=0,r=0;return this.document.forEach(n=>t+=n.length),this.docs.forEach(n=>r+=n.length),t===r},getNth:function(e){return typeof e=="number"?this.eq(e):typeof e=="string"?this.if(e):this}};Un.group=Un.groups;Un.fullSentence=Un.fullSentences;Un.sentence=Un.fullSentences;Un.lastTerm=Un.lastTerms;Un.firstTerm=Un.firstTerms;const jf=Object.assign({},Un,qN,WN);jf.get=jf.eq;class ni{constructor(t,r,n={}){[["document",t],["world",zf],["_groups",n],["_cache",null],["viewType","View"]].forEach(i=>{Object.defineProperty(this,i[0],{value:i[1],writable:!0})}),this.ptrs=r}get docs(){let t=this.document;return this.ptrs&&(t=zf.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!0}get found(){return this.docs.length>0}get length(){return this.docs.length}get fullPointer(){let{docs:t,ptrs:r,document:n}=this;return(r||t.map((i,o)=>[o])).map(i=>{let[o,s,u,l,c]=i;return s=s||0,u=u||(n[o]||[]).length,n[o]&&n[o][s]&&(l=l||n[o][s].id,n[o][u-1]&&(c=c||n[o][u-1].id)),[o,s,u,l,c]})}update(t){let r=new ni(this.document,t);if(this._cache&&t&&t.length>0){let n=[];t.forEach((a,i)=>{let[o,s,u]=a;a.length===1?n[i]=this._cache[o]:s===0&&this.document[o].length===u&&(n[i]=this._cache[o])}),n.length>0&&(r._cache=n)}return r.world=this.world,r}toView(t){return new ni(this.document,t||this.pointer)}fromText(t){const{methods:r}=this;let n=r.one.tokenize.fromString(t,this.world),a=new ni(n);return a.world=this.world,a.compute(["normal","freeze","lexicon"]),this.world.compute.preTagger&&a.compute("preTagger"),a.compute("unfreeze"),a}clone(){let t=this.document.slice(0);t=t.map(n=>n.map(a=>(a=Object.assign({},a),a.tags=new Set(a.tags),a)));let r=this.update(this.pointer);return r.document=t,r._cache=this._cache,r}}Object.assign(ni.prototype,jf);const JN="14.14.4",oh=function(e){return e&&typeof e=="object"&&!Array.isArray(e)};function zb(e,t){if(oh(t))for(const r in t)oh(t[r])?(e[r]||Object.assign(e,{[r]:{}}),zb(e[r],t[r])):Object.assign(e,{[r]:t[r]});return e}function KN(e,t){for(const r in t)e[r]=e[r]||{},Object.assign(e[r],t[r]);return e}const YN=function(e,t){let r=e.two.models||{};Object.keys(t).forEach(n=>{t[n].pastTense&&(r.toPast&&(r.toPast.ex[n]=t[n].pastTense),r.fromPast&&(r.fromPast.ex[t[n].pastTense]=n)),t[n].presentTense&&(r.toPresent&&(r.toPresent.ex[n]=t[n].presentTense),r.fromPresent&&(r.fromPresent.ex[t[n].presentTense]=n)),t[n].gerund&&(r.toGerund&&(r.toGerund.ex[n]=t[n].gerund),r.fromGerund&&(r.fromGerund.ex[t[n].gerund]=n)),t[n].comparative&&(r.toComparative&&(r.toComparative.ex[n]=t[n].comparative),r.fromComparative&&(r.fromComparative.ex[t[n].comparative]=n)),t[n].superlative&&(r.toSuperlative&&(r.toSuperlative.ex[n]=t[n].superlative),r.fromSuperlative&&(r.fromSuperlative.ex[t[n].superlative]=n))})},ZN=function(e,t,r,n){const{methods:a,model:i,compute:o,hooks:s}=t;e.methods&&KN(a,e.methods),e.model&&zb(i,e.model),e.irregulars&&YN(i,e.irregulars),e.compute&&Object.assign(o,e.compute),s&&(t.hooks=s.concat(e.hooks||[])),e.api&&e.api(r),e.lib&&Object.keys(e.lib).forEach(u=>n[u]=e.lib[u]),e.tags&&n.addTags(e.tags),e.words&&n.addWords(e.words),e.frozen&&n.addWords(e.frozen,!0),e.mutate&&e.mutate(t,n)},QN=function(e){const t=typeof process>"u"||!process.env?self.env||{}:process.env;return t.DEBUG_TAGS=e==="tagger"||e===!0?!0:"",t.DEBUG_MATCH=e==="match"||e===!0?!0:"",t.DEBUG_CHUNKS=e==="chunker"||e===!0?!0:"",this},XN=e=>Object.prototype.toString.call(e)==="[object Object]",qf=function(e){return Object.prototype.toString.call(e)==="[object Array]"},eA=function(e){return e.map(t=>t.terms.map(r=>(qf(r.tags)&&(r.tags=new Set(r.tags)),r)))},tA=function(e){return e.map(t=>t.map(r=>({text:r,normal:r,pre:"",post:" ",tags:new Set})))},jb=function(e,t,r){const{methods:n}=r;let a=new t([]);if(a.world=r,typeof e=="number"&&(e=String(e)),!e)return a;if(typeof e=="string"){let i=n.one.tokenize.fromString(e,r);return new t(i)}if(XN(e)&&e.isView)return new t(e.document,e.ptrs);if(qf(e)){if(qf(e[0])){let o=tA(e);return new t(o)}let i=eA(e);return new t(i)}return a};let Ml=Object.assign({},zf);const tt=function(e,t){t&&tt.addWords(t);let r=jb(e,ni,Ml);return e&&r.compute(Ml.hooks),r};Object.defineProperty(tt,"_world",{value:Ml,writable:!0});tt.tokenize=function(e,t){const{compute:r}=this._world;t&&tt.addWords(t);let n=jb(e,ni,Ml);return r.contractions&&n.compute(["alias","normal","machine","contractions"]),n};tt.plugin=function(e){return ZN(e,this._world,ni,this),this};tt.extend=tt.plugin;tt.world=function(){return this._world};tt.model=function(){return this._world.model};tt.methods=function(){return this._world.methods};tt.hooks=function(){return this._world.hooks};tt.verbose=QN;tt.version=JN;const rA=function(e){return e.map(r=>{let n=new Set;return r.forEach(a=>{a.normal!==""&&n.add(a.normal),a.switch&&n.add(`%${a.switch}%`),a.implicit&&n.add(a.implicit),a.machine&&n.add(a.machine),a.root&&n.add(a.root),a.alias&&a.alias.forEach(o=>n.add(o));let i=Array.from(a.tags);for(let o=0;o<i.length;o+=1)n.add("#"+i[o])}),n})},nA={one:{cacheDoc:rA}},aA={cache:function(){return this._cache=this.methods.one.cacheDoc(this.document),this},uncache:function(){return this._cache=null,this}},iA=function(e){Object.assign(e.prototype,aA)},oA={cache:function(e){e._cache=e.methods.one.cacheDoc(e.document)}},sA={api:iA,compute:oA,methods:nA},uA={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,r)=>{r!==0&&(t.text=t.text.replace(/^ *[a-z\u00C0-\u00FF]/,n=>n.toUpperCase())),r!==e.length-1&&(t.post="")})}),this}},sh=e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),lA=e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),cA=e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),qb=(e,t,r)=>{if(r.forEach(n=>n.dirty=!0),e){let n=[t,0].concat(r);Array.prototype.splice.apply(e,n)}return e},Mo=function(e){const t=/ $/,r=/[-–—]/;let n=e[e.length-1];n&&!t.test(n.post)&&!r.test(n.post)&&(n.post+=" ")},uh=(e,t,r)=>{const n=/[-.?!,;:)–—'"]/g;let a=e[t-1];if(!a)return;let i=a.post;if(n.test(i)){let o=i.match(n).join(""),s=r[r.length-1];s.post=o+s.post,a.post=a.post.replace(n,"")}},fA=function(e,t,r){let n=e[t];if(t!==0||!sh(n.text))return;r[0].text=lA(r[0].text);let a=e[t];a.tags.has("ProperNoun")||a.tags.has("Acronym")||sh(a.text)&&a.text.length>1&&(a.text=cA(a.text))},mA=function(e,t,r,n){let[a,i,o]=t;i===0||o===n[a].length?Mo(r):(Mo(r),Mo([e[t[1]]])),fA(e,i,r),qb(e,i,r)},dA=function(e,t,r,n){let[a,,i]=t,o=(n[a]||[]).length;i<o?(uh(e,i,r),Mo(r)):o===i&&(Mo(e),uh(e,i,r),n[a+1]&&(r[r.length-1].post+=" ")),qb(e,t[2],r),t[4]=r[r.length-1].id};let fs=0;const lh=e=>(e=e.length<3?"0"+e:e,e.length<3?"0"+e:e),Rb=function(e){let[t,r]=e.index||[0,0];fs+=1,fs=fs>46655?0:fs,t=t>46655?0:t,r=r>1294?0:r;let n=lh(fs.toString(36));n+=lh(t.toString(36));let a=r.toString(36);a=a.length<2?"0"+a:a,n+=a;let i=parseInt(Math.random()*36,10);return n+=i.toString(36),e.normal+"|"+n.toUpperCase()},ch=function(e){e.has("@hasContraction")&&typeof e.contractions=="function"&&e.grow("@hasContraction").contractions().expand()},fh=e=>Object.prototype.toString.call(e)==="[object Array]",hA=function(e){return e=e.map(t=>(t.id=Rb(t),t)),e},pA=function(e,t){const{methods:r}=t;return typeof e=="string"?r.one.tokenize.fromString(e,t)[0]:typeof e=="object"&&e.isView?e.clone().docs[0]||[]:fh(e)?fh(e[0])?e[0]:e:[]},mh=function(e,t,r){const{document:n,world:a}=t;t.uncache();let i=t.fullPointer,o=t.fullPointer;t.forEach((u,l)=>{let c=u.fullPointer[0],[f]=c,m=n[f],d=pA(e,a);d.length!==0&&(d=hA(d),r?(ch(t.update([c]).firstTerm()),mA(m,c,d,n)):(ch(t.update([c]).lastTerm()),dA(m,c,d,n)),n[f]&&n[f][c[1]]&&(c[3]=n[f][c[1]].id),o[l]=c,c[2]+=d.length,i[l]=c)});let s=t.toView(i);return t.ptrs=o,s.compute(["id","index","freeze","lexicon"]),s.world.compute.preTagger&&s.compute("preTagger"),s.compute("unfreeze"),s},Gi={insertAfter:function(e){return mh(e,this,!1)},insertBefore:function(e){return mh(e,this,!0)}};Gi.append=Gi.insertAfter;Gi.prepend=Gi.insertBefore;Gi.insert=Gi.insertAfter;const gA=/\$[0-9a-z]+/g,Km={},vA=e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),yA=e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),bA=e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),wA=function(e,t,r){return e.forEach(n=>{let a=t(n);n.replaceWith(a,r)}),e},xA=function(e,t){if(typeof e!="string")return e;let r=t.groups();return e=e.replace(gA,n=>{let a=n.replace(/\$/,"");return r.hasOwnProperty(a)?r[a].text():n}),e};Km.replaceWith=function(e,t={}){let r=this.fullPointer,n=this;if(this.uncache(),typeof e=="function")return wA(n,e,t);let a=n.docs[0];if(!a)return n;let i=t.possessives&&a[a.length-1].tags.has("Possessive"),o=t.case&&vA(a[0].text);e=xA(e,n);let s=this.update(r);r=r.map(m=>m.slice(0,3));let u=(s.docs[0]||[]).map(m=>Array.from(m.tags)),l=s.docs[0][0].pre,c=s.docs[0][s.docs[0].length-1].post;if(typeof e=="string"&&(e=this.fromText(e).compute("id")),n.insertAfter(e),s.has("@hasContraction")&&n.contractions&&n.grow("@hasContraction+").contractions().expand(),n.delete(s),i){let m=n.docs[0],d=m[m.length-1];d.tags.has("Possessive")||(d.text+="'s",d.normal+="'s",d.tags.add("Possessive"))}if(l&&n.docs[0]&&(n.docs[0][0].pre=l),c&&n.docs[0]){let m=n.docs[0][n.docs[0].length-1];m.post.trim()||(m.post=c)}let f=n.toView(r).compute(["index","freeze","lexicon"]);if(f.world.compute.preTagger&&f.compute("preTagger"),f.compute("unfreeze"),t.tags&&f.terms().forEach((m,d)=>{m.tagSafe(u[d])}),!f.docs[0]||!f.docs[0][0])return f;if(t.case){let m=o?yA:bA;f.docs[0][0].text=m(f.docs[0][0].text)}return f};Km.replace=function(e,t,r){if(e&&!t)return this.replaceWith(e,r);let n=this.match(e);return n.found?(this.soften(),n.replaceWith(t,r)):this};const DA=function(e,t){let r=e.length-1,n=e[r],a=e[r-t];a&&n&&(a.post+=n.post,a.post=a.post.replace(/ +([.?!,;:])/,"$1"),a.post=a.post.replace(/[,;:]+([.?!])/,"$1"))},NA=function(e,t){t.forEach(r=>{let[n,a,i]=r,o=i-a;e[n]&&(i===e[n].length&&i>1&&DA(e[n],o),e[n].splice(a,o))});for(let r=e.length-1;r>=0;r-=1)if(e[r].length===0&&(e.splice(r,1),r===e.length&&e[r-1])){let n=e[r-1],a=n[n.length-1];a&&(a.post=a.post.trimEnd())}return e},AA=function(e,t){return e=e.map(r=>{let[n]=r;return t[n]&&t[n].forEach(a=>{let i=a[2]-a[1];r[1]<=a[1]&&r[2]>=a[2]&&(r[2]-=i)}),r}),e.forEach((r,n)=>{if(r[1]===0&&r[2]==0)for(let a=n+1;a<e.length;a+=1)e[a][0]-=1,e[a][0]<0&&(e[a][0]=0)}),e=e.filter(r=>r[2]-r[1]>0),e=e.map(r=>(r[3]=null,r[4]=null,r)),e},Rf={remove:function(e){const{indexN:t}=this.methods.one.pointer;this.uncache();let r=this.all(),n=this;e&&(r=this,n=this.match(e));let a=!r.ptrs;n.has("@hasContraction")&&n.contractions&&n.grow("@hasContraction").contractions().expand();let i=r.fullPointer,o=n.fullPointer.reverse(),s=NA(this.document,o),u=t(o);return i=AA(i,u),r.ptrs=i,r.document=s,r.compute("index"),a&&(r.ptrs=void 0),e?r.toView(i):(this.ptrs=[],r.none())}};Rf.delete=Rf.remove;const Ps={pre:function(e,t){return e===void 0&&this.found?this.docs[0][0].pre:(this.docs.forEach(r=>{let n=r[0];t===!0?n.pre+=e:n.pre=e}),this)},post:function(e,t){if(e===void 0){let r=this.docs[this.docs.length-1];return r[r.length-1].post}return this.docs.forEach(r=>{let n=r[r.length-1];t===!0?n.post+=e:n.post=e}),this},trim:function(){if(!this.found)return this;let e=this.docs,t=e[0][0];t.pre=t.pre.trimStart();let r=e[e.length-1],n=r[r.length-1];return n.post=n.post.trimEnd(),this},hyphenate:function(){return this.docs.forEach(e=>{e.forEach((t,r)=>{r!==0&&(t.pre=""),e[r+1]&&(t.post="-")})}),this},dehyphenate:function(){const e=/[-–—]/;return this.docs.forEach(t=>{t.forEach(r=>{e.test(r.post)&&(r.post=" ")})}),this},toQuotations:function(e,t){return e=e||'"',t=t||'"',this.docs.forEach(r=>{r[0].pre=e+r[0].pre;let n=r[r.length-1];n.post=t+n.post}),this},toParentheses:function(e,t){return e=e||"(",t=t||")",this.docs.forEach(r=>{r[0].pre=e+r[0].pre;let n=r[r.length-1];n.post=t+n.post}),this}};Ps.deHyphenate=Ps.dehyphenate;Ps.toQuotation=Ps.toQuotations;const CA=(e,t)=>e.normal<t.normal?-1:e.normal>t.normal?1:0,EA=(e,t)=>{let r=e.normal.trim().length,n=t.normal.trim().length;return r<n?1:r>n?-1:0},SA=(e,t)=>e.words<t.words?1:e.words>t.words?-1:0,TA=(e,t)=>e[0]<t[0]?1:e[0]>t[0]?-1:e[1]>t[1]?1:-1,MA=function(e){let t={};return e.forEach(r=>{t[r.normal]=t[r.normal]||0,t[r.normal]+=1}),e.sort((r,n)=>{let a=t[r.normal],i=t[n.normal];return a<i?1:a>i?-1:0}),e},_c={alpha:CA,length:EA,wordCount:SA,sequential:TA,byFreq:MA},FA=new Set(["index","sequence","seq","sequential","chron","chronological"]),PA=new Set(["freq","frequency","topk","repeats"]),kA=new Set(["alpha","alphabetical"]),OA=function(e,t){let r=e.fullPointer;return r=r.sort((n,a)=>(n=e.update([n]),a=e.update([a]),t(n,a))),e.ptrs=r,e},$A=function(e){let{docs:t,pointer:r}=this;if(this.uncache(),typeof e=="function")return OA(this,e);e=e||"alpha";let n=r||t.map((i,o)=>[o]),a=t.map((i,o)=>({index:o,words:i.length,normal:i.map(s=>s.machine||s.normal||"").join(" "),pointer:n[o]}));return FA.has(e)&&(e="sequential"),kA.has(e)&&(e="alpha"),PA.has(e)?(a=_c.byFreq(a),this.update(a.map(i=>i.pointer))):typeof _c[e]=="function"?(a=a.sort(_c[e]),this.update(a.map(i=>i.pointer))):this},BA=function(){let e=this.pointer||this.docs.map((t,r)=>[r]);return e=[].concat(e),e=e.reverse(),this._cache&&(this._cache=this._cache.reverse()),this.update(e)},_A=function(){let e=new Set;return this.filter(r=>{let n=r.text("machine");return e.has(n)?!1:(e.add(n),!0)})},IA={unique:_A,reverse:BA,sort:$A},zA=e=>Object.prototype.toString.call(e)==="[object Array]",Lb=function(e,t){if(e.length>0){let r=e[e.length-1],n=r[r.length-1];/ /.test(n.post)===!1&&(n.post+=" ")}return e=e.concat(t),e},jA=function(e,t){if(e.document===t.document){let n=e.fullPointer.concat(t.fullPointer);return e.toView(n).compute("index")}return t.fullPointer.forEach(n=>{n[0]+=e.document.length}),e.document=Lb(e.document,t.docs),e.all()},qA={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 r=this.fullPointer,n=r[r.length-1][0];this.document.splice(n,0,...t.document)}return this.all().compute("index")}if(typeof e=="object"&&e.isView)return jA(this,e);if(zA(e)){let t=Lb(this.document,e);return this.document=t,this.all()}return this}},RA=function(){return this.ptrs=this.fullPointer,this},LA=function(){let e=this.ptrs;return!e||e.length<1?this:(e=e.map(t=>t.slice(0,3)),this.ptrs=e,this)},HA={harden:RA,soften:LA},GA=Object.assign({},uA,Gi,Km,Rf,Ps,IA,qA,HA),VA=function(e){Object.assign(e.prototype,GA)},UA={id:function(e){let t=e.docs;for(let r=0;r<t.length;r+=1)for(let n=0;n<t[r].length;n+=1){let a=t[r][n];a.id=a.id||Rb(a)}}},WA={api:VA,compute:UA},JA=[{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"]}],an=!0,KA={st:an,nd:an,rd:an,th:an,am:an,pm:an,max:an,"°":an,s:an,e:an,er:an,ère:an,ème:an},YA={one:{contractions:JA,numberSuffixes:KA}},Ic=function(e,t,r){let[n,a]=t;!r||r.length===0||(r=r.map((i,o)=>(i.implicit=i.text,i.machine=i.text,i.pre="",i.post="",i.text="",i.normal="",i.index=[n,a+o],i)),r[0]&&(r[0].pre=e[n][a].pre,r[r.length-1].post=e[n][a].post,r[0].text=e[n][a].text,r[0].normal=e[n][a].normal),e[n].splice(a,1,...r))},ZA=/'/,QA=new Set(["what","how","when","where","why"]),XA=new Set(["be","go","start","think","need"]),e3=new Set(["been","gone"]),t3=function(e,t){let r=e[t].normal.split(ZA)[0];if(QA.has(r))return[r,"did"];if(e[t+1]){if(e3.has(e[t+1].normal))return[r,"had"];if(XA.has(e[t+1].normal))return[r,"would"]}return null},r3=function(e,t){return e[t].normal==="ain't"||e[t].normal==="aint"?null:[e[t].normal.replace(/n't/,""),"not"]},Ym=/'/,n3=/(e|é|aison|sion|tion)$/,a3=/(age|isme|acle|ege|oire)$/,i3=(e,t)=>{let r=e[t].normal.split(Ym)[1];return r&&r.endsWith("e")?["la",r]:["le",r]},o3=(e,t)=>{let r=e[t].normal.split(Ym)[1];return r&&n3.test(r)&&!a3.test(r)?["du",r]:r&&r.endsWith("s")?["des",r]:["de",r]},s3=(e,t)=>["je",e[t].normal.split(Ym)[1]],zc={preJ:s3,preL:i3,preD:o3},u3=/^([0-9.]{1,4}[a-z]{0,2}) ?[-–—] ?([0-9]{1,4}[a-z]{0,2})$/i,l3=/^([0-9]{1,2}(:[0-9][0-9])?(am|pm)?) ?[-–—] ?([0-9]{1,2}(:[0-9][0-9])?(am|pm)?)$/i,c3=/^[0-9]{3}-[0-9]{4}$/,f3=function(e,t){let r=e[t],n=r.text.match(u3);return n!==null?r.tags.has("PhoneNumber")===!0||c3.test(r.text)?null:[n[1],"to",n[2]]:(n=r.text.match(l3),n!==null?[n[1],"to",n[4]]:null)},m3=/^([+-]?[0-9][.,0-9]*)([a-z°²³µ/]+)$/,d3=function(e,t,r){const n=r.model.one.numberSuffixes||{};let i=e[t].text.match(m3);if(i!==null){let o=i[2].toLowerCase().trim();return n.hasOwnProperty(o)?null:[i[1],o]}return null},dh=/'/,h3=/^[0-9][^-–—]*[-–—].*?[0-9]/,hh=function(e,t,r,n){let a=t.update();a.document=[e];let i=r+n;r>0&&(r-=1),e[i]&&(i+=1),a.ptrs=[[0,r,i]]},ph={t:(e,t)=>r3(e,t),d:(e,t)=>t3(e,t)},gh={j:(e,t)=>zc.preJ(e,t),l:(e,t)=>zc.preL(e,t),d:(e,t)=>zc.preD(e,t)},p3=function(e,t,r,n){for(let a=0;a<e.length;a+=1){let i=e[a];if(i.word===t.normal)return i.out;if(n!==null&&n===i.after)return[r].concat(i.out);if(r!==null&&r===i.before&&n&&n.length>2)return i.out.concat(n)}return null},jc=function(e,t){let r=t.fromText(e.join(" "));return r.compute(["id","alias"]),r.docs[0]},g3=function(e,t){for(let r=t+1;r<5&&e[r];r+=1)if(e[r].normal==="been")return["there","has"];return["there","is"]},v3=e=>{let{world:t,document:r}=e;const{model:n,methods:a}=t;let i=n.one.contractions||[];r.forEach((o,s)=>{for(let u=o.length-1;u>=0;u-=1){let l=null,c=null;if(dh.test(o[u].normal)===!0){let m=o[u].normal.split(dh);l=m[0],c=m[1]}let f=p3(i,o[u],l,c);if(!f&&ph.hasOwnProperty(c)&&(f=ph[c](o,u,t)),!f&&gh.hasOwnProperty(l)&&(f=gh[l](o,u)),l==="there"&&c==="s"&&(f=g3(o,u)),f){f=jc(f,e),Ic(r,[s,u],f),hh(r[s],e,u,f.length);continue}if(h3.test(o[u].normal)){f=f3(o,u),f&&(f=jc(f,e),Ic(r,[s,u],f),a.one.setTag(f,"NumberRange",t),f[2]&&f[2].tags.has("Time")&&a.one.setTag([f[0]],"Time",t,null,"time-range"),hh(r[s],e,u,f.length));continue}f=d3(o,u,t),f&&(f=jc(f,e),Ic(r,[s,u],f),a.one.setTag([f[1]],"Unit",t,null,"contraction-unit"))}})},y3={contractions:v3},b3={model:YA,compute:y3,hooks:["contractions"]},vh=function(e){const t=e.world,{model:r,methods:n}=e.world,a=n.one.setTag,{frozenLex:i}=r.one,o=r.one._multiCache||{};e.docs.forEach(s=>{for(let u=0;u<s.length;u+=1){let l=s[u],c=l.machine||l.normal;if(o[c]!==void 0&&s[u+1]){let f=u+o[c]-1;for(let m=f;m>u;m-=1){let d=s.slice(u,m+1),p=d.map(h=>h.machine||h.normal).join(" ");if(i.hasOwnProperty(p)===!0){a(d,i[p],t,!1,"1-frozen-multi-lexicon"),d.forEach(h=>h.frozen=!0);continue}}}if(i[c]!==void 0&&i.hasOwnProperty(c)){a([l],i[c],t,!1,"1-freeze-lexicon"),l.frozen=!0;continue}}})},w3=function(e){return e.docs.forEach(t=>{t.forEach(r=>{delete r.frozen})}),e},x3={frozen:vh,freeze:vh,unfreeze:w3},yh=e=>"\x1B[34m"+e+"\x1B[0m",bh=e=>"\x1B[3m\x1B[2m"+e+"\x1B[0m",wh=function(e){e.docs.forEach(t=>{console.log(yh(`
|
|
1
|
+
"use strict";const Ce=require("./jsx-runtime-Dszzpdy0.cjs"),En=require("./Button-BMeq9Z2I.cjs"),ve=require("./css-HnNQMUzV.cjs"),vr=require("react"),SN=require("./Provider-BV7nN39a.cjs"),Ta=require("./Text-DY08sSZe.cjs"),Ba=require("./Tags-DtnStTuF.cjs"),TN=require("./Dialog-BnPvG5WQ.cjs"),Pb=require("./Animated-Bq6z2XkH.cjs"),er=require("./Box-BvqALodh.cjs"),en=require("./Editable-BXFY3-UW.cjs");require("./types-D-yz1qsT.cjs");require("./provider-lNhTlIWj.cjs");const oc=require("./_commonjsHelpers-BH3jXuIh.cjs"),Tl=require("./Items-CHAbP2ZL.cjs"),MN=require("./useStaticData-BTwIe0Il.cjs");require("./eraser-Dm5Du4PL.cjs");require("./Haul-2Xa_nMgc.cjs");const kb=({format:e="dateTime",suppliedTZ:t="UTC",displayTZ:r="local",children:n,...a})=>Ce.jsxRuntimeExports.jsx(en.Text,{...a,children:new ve.r(n,t).toString(e,r)}),FN=(e,t,r)=>e==="preview"&&r===!0?"var(--pluto-primary-z)":t,Ob=({ref:e,className:t,value:r,ghost:n,disabled:a,onChange:i,inputType:o,size:s,variant:u="text",style:l,color:c,borderColor:f,borderWidth:m,bordered:d,rounded:p,background:h,textColor:g,onClick:b,...D})=>Ce.jsxRuntimeExports.jsx(En.Button,{el:"label",variant:u,className:ve.CSS(ve.CSS.BE("input",o),t),ghost:n,disabled:a,size:s,preventClick:!0,style:l,color:c,borderColor:f,borderWidth:m,bordered:d,rounded:p,background:h,textColor:FN(u,g,r),onClick:b,children:u!=="preview"?Ce.jsxRuntimeExports.jsxs(Ce.jsxRuntimeExports.Fragment,{children:[Ce.jsxRuntimeExports.jsx("input",{className:ve.CSS.BE("input",o,"input"),type:"checkbox",ref:e,checked:r,onChange:y=>{y.stopPropagation(),i?.(y.target.checked)},value:"",disabled:a,onClick:b,...D}),Ce.jsxRuntimeExports.jsx("span",{className:ve.CSS.BE("input",o,"indicator"),onClick:b})]}):r?"True":"False"}),PN=e=>Ce.jsxRuntimeExports.jsx(Ob,{...e,inputType:"checkbox"}),$b="cursor-style",ah=(e,t=document.head)=>{Bb();const r=document.createElement("style");r.innerHTML=`*{cursor: ${e} !important;}`,r.id=$b,t.appendChild(r)},Bb=()=>{const e=document.getElementById($b);e?.remove()},_b=e=>e.preventDefault(),kN=e=>e.stopPropagation(),ih=(e,t,r,n,a)=>{const{x:i,y:o}=n??ve.Q.construct(ve.jt.dims(a));if(ve.jt.width(t)>i&&ve.jt.width(t)>ve.jt.height(t)){const s=ve.jt.signedWidth(t)<0?i:-i;e+=(ve.jt.signedWidth(t)+s)*r.x,ah("ew-resize")}if(ve.jt.height(t)>o&&ve.jt.height(t)>ve.jt.width(t)){const s=ve.jt.signedHeight(t)<0?o:-o;e+=(ve.jt.signedHeight(t)+s)*r.y,ah("ns-resize")}return e},sc=({direction:e,className:t,dragScale:r={x:10,y:1},dragThreshold:n=15,dragDirection:a,onChange:i,value:o,resetValue:s,onDragEnd:u,...l})=>{const c=vr.useRef({dragging:!1,curr:o,prev:o}),f=vr.useRef(null);c.current.dragging||(c.current.prev=o);const m=vr.useMemo(()=>{const h=ve.Q.construct(r);return a==="x"?ve.Q.construct(h.x,0):a==="y"?ve.Q.construct(0,h.y):h},[r,a]),d=vr.useMemo(()=>n!=null?ve.Q.construct(n):null,[n]);SN.useVirtualCursorDragWebKit({ref:f,onMove:vr.useCallback(h=>{if(f.current==null)return;let g=c.current.prev;c.current.dragging=!0,g=ih(g,h,m,d,ve.jt.construct(f.current)),c.current.curr=g,i(g)},[i,m,d]),onEnd:vr.useCallback((h,g)=>{if(f.current==null)return;let b=c.current.prev;b=ih(b,h,m,d,ve.jt.construct(f.current)),c.current.prev=b,c.current.dragging=!1,Bb(),u?.(b),l.onBlur?.()},[l.onBlur,u,m,d])});const p=vr.useCallback(()=>{i(s??c.current.prev)},[i,s]);return Ce.jsxRuntimeExports.jsx(En.Button,{ref:f,variant:"outlined",className:ve.CSS(ve.CSS.BE("input","drag-btn"),e!=null&&ve.CSS.BEM("input","drag-btn","direction",e),t),tabIndex:-1,onDoubleClick:p,onClick:_b,contrast:0,textColor:9,...l,children:Ce.jsxRuntimeExports.jsx(Ta.Drag,{})})},ON={x:Number(ve.r.HOUR.valueOf()),y:Number(ve.r.days(.75).valueOf())},Ib=({value:e,onChange:t})=>{const r=new ve.r(e,"UTC");vr.useLayoutEffect(()=>{const i=r.sub(ve.r.utcOffset);if(i.remainder(ve.r.DAY).isZero)return;const o=i.sub(i.remainder(ve.r.DAY));t(Number(new ve.r(o,"local").valueOf()))},[e]);const n=i=>{let o;if(typeof i=="number")o=new ve.r(i,"UTC");else{if(i.length===0)return;o=new ve.r(i,"local")}t(Number(o.valueOf()))};return{value:r.toString("ISODate","local"),onChange:n}},$N=({ref:e,onChange:t,value:r,className:n,showDragHandle:a=!0,children:i,...o})=>{const{value:s,onChange:u}=Ib({value:r,onChange:t});return Ce.jsxRuntimeExports.jsxs(Ba.Text,{ref:e,value:s,className:ve.CSS(ve.CSS.B("input-date"),n),onChange:u,type:"date",...o,children:[a&&Ce.jsxRuntimeExports.jsx(sc,{value:r,onChange:u,dragScale:ON}),i]})};let BN={one:{},two:{},three:{},four:{}},_N={one:{},two:{},three:{}},IN={},zN=[];const zf={methods:BN,model:_N,compute:IN,hooks:zN},jN=e=>Object.prototype.toString.call(e)==="[object Array]",qN={compute:function(e){const{world:t}=this,r=t.compute;return typeof e=="string"&&r.hasOwnProperty(e)?r[e](this):jN(e)?e.forEach(n=>{t.compute.hasOwnProperty(n)?r[n](this):console.warn("no compute:",e)}):typeof e=="function"?e(this):console.warn("no compute:",e),this}},RN=function(e){return this.fullPointer.forEach((r,n)=>{let a=this.update([r]);e(a,n)}),this},LN=function(e,t){let n=this.fullPointer.map((i,o)=>{let s=this.update([i]),u=e(s,o);return u===void 0?this.none():u});if(n.length===0)return t||this.update([]);if(n[0]!==void 0&&(typeof n[0]=="string"||typeof n[0]=="object"&&(n[0]===null||!n[0].isView)))return n;let a=[];return n.forEach(i=>{a=a.concat(i.fullPointer)}),this.toView(a)},HN=function(e){let t=this.fullPointer;return t=t.filter((n,a)=>{let i=this.update([n]);return e(i,a)}),this.update(t)},GN=function(e){let r=this.fullPointer.find((n,a)=>{let i=this.update([n]);return e(i,a)});return this.update([r])},VN=function(e){return this.fullPointer.some((r,n)=>{let a=this.update([r]);return e(a,n)})},UN=function(e=1){let t=this.fullPointer,r=Math.floor(Math.random()*t.length);return r+e>this.length&&(r=this.length-e,r=r<0?0:r),t=t.slice(r,r+e),this.update(t)},WN={forEach:RN,map:LN,filter:HN,find:GN,some:VN,random:UN},Un={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(r=>{t[r]=this.update(this._groups[r])}),t},eq:function(e){let t=this.pointer;return t||(t=this.docs.map((r,n)=>[n])),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 r=this.pointer||this.docs.map((n,a)=>[a]);return r=r.slice(e,t),this.update(r)},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!1;let t=this.fullPointer,r=e.fullPointer;return!t.length===r.length?!1:t.every((n,a)=>r[a]?n[0]===r[a][0]&&n[1]===r[a][1]&&n[2]===r[a][2]:!1)},wordCount:function(){return this.docs.reduce((e,t)=>(e+=t.filter(r=>r.text!=="").length,e),0)},isFull:function(){let e=this.pointer;if(!e)return!0;if(e.length===0||e[0][0]!==0)return!1;let t=0,r=0;return this.document.forEach(n=>t+=n.length),this.docs.forEach(n=>r+=n.length),t===r},getNth:function(e){return typeof e=="number"?this.eq(e):typeof e=="string"?this.if(e):this}};Un.group=Un.groups;Un.fullSentence=Un.fullSentences;Un.sentence=Un.fullSentences;Un.lastTerm=Un.lastTerms;Un.firstTerm=Un.firstTerms;const jf=Object.assign({},Un,qN,WN);jf.get=jf.eq;class ni{constructor(t,r,n={}){[["document",t],["world",zf],["_groups",n],["_cache",null],["viewType","View"]].forEach(i=>{Object.defineProperty(this,i[0],{value:i[1],writable:!0})}),this.ptrs=r}get docs(){let t=this.document;return this.ptrs&&(t=zf.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!0}get found(){return this.docs.length>0}get length(){return this.docs.length}get fullPointer(){let{docs:t,ptrs:r,document:n}=this;return(r||t.map((i,o)=>[o])).map(i=>{let[o,s,u,l,c]=i;return s=s||0,u=u||(n[o]||[]).length,n[o]&&n[o][s]&&(l=l||n[o][s].id,n[o][u-1]&&(c=c||n[o][u-1].id)),[o,s,u,l,c]})}update(t){let r=new ni(this.document,t);if(this._cache&&t&&t.length>0){let n=[];t.forEach((a,i)=>{let[o,s,u]=a;a.length===1?n[i]=this._cache[o]:s===0&&this.document[o].length===u&&(n[i]=this._cache[o])}),n.length>0&&(r._cache=n)}return r.world=this.world,r}toView(t){return new ni(this.document,t||this.pointer)}fromText(t){const{methods:r}=this;let n=r.one.tokenize.fromString(t,this.world),a=new ni(n);return a.world=this.world,a.compute(["normal","freeze","lexicon"]),this.world.compute.preTagger&&a.compute("preTagger"),a.compute("unfreeze"),a}clone(){let t=this.document.slice(0);t=t.map(n=>n.map(a=>(a=Object.assign({},a),a.tags=new Set(a.tags),a)));let r=this.update(this.pointer);return r.document=t,r._cache=this._cache,r}}Object.assign(ni.prototype,jf);const JN="14.14.4",oh=function(e){return e&&typeof e=="object"&&!Array.isArray(e)};function zb(e,t){if(oh(t))for(const r in t)oh(t[r])?(e[r]||Object.assign(e,{[r]:{}}),zb(e[r],t[r])):Object.assign(e,{[r]:t[r]});return e}function KN(e,t){for(const r in t)e[r]=e[r]||{},Object.assign(e[r],t[r]);return e}const YN=function(e,t){let r=e.two.models||{};Object.keys(t).forEach(n=>{t[n].pastTense&&(r.toPast&&(r.toPast.ex[n]=t[n].pastTense),r.fromPast&&(r.fromPast.ex[t[n].pastTense]=n)),t[n].presentTense&&(r.toPresent&&(r.toPresent.ex[n]=t[n].presentTense),r.fromPresent&&(r.fromPresent.ex[t[n].presentTense]=n)),t[n].gerund&&(r.toGerund&&(r.toGerund.ex[n]=t[n].gerund),r.fromGerund&&(r.fromGerund.ex[t[n].gerund]=n)),t[n].comparative&&(r.toComparative&&(r.toComparative.ex[n]=t[n].comparative),r.fromComparative&&(r.fromComparative.ex[t[n].comparative]=n)),t[n].superlative&&(r.toSuperlative&&(r.toSuperlative.ex[n]=t[n].superlative),r.fromSuperlative&&(r.fromSuperlative.ex[t[n].superlative]=n))})},ZN=function(e,t,r,n){const{methods:a,model:i,compute:o,hooks:s}=t;e.methods&&KN(a,e.methods),e.model&&zb(i,e.model),e.irregulars&&YN(i,e.irregulars),e.compute&&Object.assign(o,e.compute),s&&(t.hooks=s.concat(e.hooks||[])),e.api&&e.api(r),e.lib&&Object.keys(e.lib).forEach(u=>n[u]=e.lib[u]),e.tags&&n.addTags(e.tags),e.words&&n.addWords(e.words),e.frozen&&n.addWords(e.frozen,!0),e.mutate&&e.mutate(t,n)},QN=function(e){const t=typeof process>"u"||!process.env?self.env||{}:process.env;return t.DEBUG_TAGS=e==="tagger"||e===!0?!0:"",t.DEBUG_MATCH=e==="match"||e===!0?!0:"",t.DEBUG_CHUNKS=e==="chunker"||e===!0?!0:"",this},XN=e=>Object.prototype.toString.call(e)==="[object Object]",qf=function(e){return Object.prototype.toString.call(e)==="[object Array]"},eA=function(e){return e.map(t=>t.terms.map(r=>(qf(r.tags)&&(r.tags=new Set(r.tags)),r)))},tA=function(e){return e.map(t=>t.map(r=>({text:r,normal:r,pre:"",post:" ",tags:new Set})))},jb=function(e,t,r){const{methods:n}=r;let a=new t([]);if(a.world=r,typeof e=="number"&&(e=String(e)),!e)return a;if(typeof e=="string"){let i=n.one.tokenize.fromString(e,r);return new t(i)}if(XN(e)&&e.isView)return new t(e.document,e.ptrs);if(qf(e)){if(qf(e[0])){let o=tA(e);return new t(o)}let i=eA(e);return new t(i)}return a};let Ml=Object.assign({},zf);const tt=function(e,t){t&&tt.addWords(t);let r=jb(e,ni,Ml);return e&&r.compute(Ml.hooks),r};Object.defineProperty(tt,"_world",{value:Ml,writable:!0});tt.tokenize=function(e,t){const{compute:r}=this._world;t&&tt.addWords(t);let n=jb(e,ni,Ml);return r.contractions&&n.compute(["alias","normal","machine","contractions"]),n};tt.plugin=function(e){return ZN(e,this._world,ni,this),this};tt.extend=tt.plugin;tt.world=function(){return this._world};tt.model=function(){return this._world.model};tt.methods=function(){return this._world.methods};tt.hooks=function(){return this._world.hooks};tt.verbose=QN;tt.version=JN;const rA=function(e){return e.map(r=>{let n=new Set;return r.forEach(a=>{a.normal!==""&&n.add(a.normal),a.switch&&n.add(`%${a.switch}%`),a.implicit&&n.add(a.implicit),a.machine&&n.add(a.machine),a.root&&n.add(a.root),a.alias&&a.alias.forEach(o=>n.add(o));let i=Array.from(a.tags);for(let o=0;o<i.length;o+=1)n.add("#"+i[o])}),n})},nA={one:{cacheDoc:rA}},aA={cache:function(){return this._cache=this.methods.one.cacheDoc(this.document),this},uncache:function(){return this._cache=null,this}},iA=function(e){Object.assign(e.prototype,aA)},oA={cache:function(e){e._cache=e.methods.one.cacheDoc(e.document)}},sA={api:iA,compute:oA,methods:nA},uA={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,r)=>{r!==0&&(t.text=t.text.replace(/^ *[a-z\u00C0-\u00FF]/,n=>n.toUpperCase())),r!==e.length-1&&(t.post="")})}),this}},sh=e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),lA=e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),cA=e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),qb=(e,t,r)=>{if(r.forEach(n=>n.dirty=!0),e){let n=[t,0].concat(r);Array.prototype.splice.apply(e,n)}return e},Mo=function(e){const t=/ $/,r=/[-–—]/;let n=e[e.length-1];n&&!t.test(n.post)&&!r.test(n.post)&&(n.post+=" ")},uh=(e,t,r)=>{const n=/[-.?!,;:)–—'"]/g;let a=e[t-1];if(!a)return;let i=a.post;if(n.test(i)){let o=i.match(n).join(""),s=r[r.length-1];s.post=o+s.post,a.post=a.post.replace(n,"")}},fA=function(e,t,r){let n=e[t];if(t!==0||!sh(n.text))return;r[0].text=lA(r[0].text);let a=e[t];a.tags.has("ProperNoun")||a.tags.has("Acronym")||sh(a.text)&&a.text.length>1&&(a.text=cA(a.text))},mA=function(e,t,r,n){let[a,i,o]=t;i===0||o===n[a].length?Mo(r):(Mo(r),Mo([e[t[1]]])),fA(e,i,r),qb(e,i,r)},dA=function(e,t,r,n){let[a,,i]=t,o=(n[a]||[]).length;i<o?(uh(e,i,r),Mo(r)):o===i&&(Mo(e),uh(e,i,r),n[a+1]&&(r[r.length-1].post+=" ")),qb(e,t[2],r),t[4]=r[r.length-1].id};let fs=0;const lh=e=>(e=e.length<3?"0"+e:e,e.length<3?"0"+e:e),Rb=function(e){let[t,r]=e.index||[0,0];fs+=1,fs=fs>46655?0:fs,t=t>46655?0:t,r=r>1294?0:r;let n=lh(fs.toString(36));n+=lh(t.toString(36));let a=r.toString(36);a=a.length<2?"0"+a:a,n+=a;let i=parseInt(Math.random()*36,10);return n+=i.toString(36),e.normal+"|"+n.toUpperCase()},ch=function(e){e.has("@hasContraction")&&typeof e.contractions=="function"&&e.grow("@hasContraction").contractions().expand()},fh=e=>Object.prototype.toString.call(e)==="[object Array]",hA=function(e){return e=e.map(t=>(t.id=Rb(t),t)),e},pA=function(e,t){const{methods:r}=t;return typeof e=="string"?r.one.tokenize.fromString(e,t)[0]:typeof e=="object"&&e.isView?e.clone().docs[0]||[]:fh(e)?fh(e[0])?e[0]:e:[]},mh=function(e,t,r){const{document:n,world:a}=t;t.uncache();let i=t.fullPointer,o=t.fullPointer;t.forEach((u,l)=>{let c=u.fullPointer[0],[f]=c,m=n[f],d=pA(e,a);d.length!==0&&(d=hA(d),r?(ch(t.update([c]).firstTerm()),mA(m,c,d,n)):(ch(t.update([c]).lastTerm()),dA(m,c,d,n)),n[f]&&n[f][c[1]]&&(c[3]=n[f][c[1]].id),o[l]=c,c[2]+=d.length,i[l]=c)});let s=t.toView(i);return t.ptrs=o,s.compute(["id","index","freeze","lexicon"]),s.world.compute.preTagger&&s.compute("preTagger"),s.compute("unfreeze"),s},Gi={insertAfter:function(e){return mh(e,this,!1)},insertBefore:function(e){return mh(e,this,!0)}};Gi.append=Gi.insertAfter;Gi.prepend=Gi.insertBefore;Gi.insert=Gi.insertAfter;const gA=/\$[0-9a-z]+/g,Km={},vA=e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),yA=e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),bA=e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),wA=function(e,t,r){return e.forEach(n=>{let a=t(n);n.replaceWith(a,r)}),e},xA=function(e,t){if(typeof e!="string")return e;let r=t.groups();return e=e.replace(gA,n=>{let a=n.replace(/\$/,"");return r.hasOwnProperty(a)?r[a].text():n}),e};Km.replaceWith=function(e,t={}){let r=this.fullPointer,n=this;if(this.uncache(),typeof e=="function")return wA(n,e,t);let a=n.docs[0];if(!a)return n;let i=t.possessives&&a[a.length-1].tags.has("Possessive"),o=t.case&&vA(a[0].text);e=xA(e,n);let s=this.update(r);r=r.map(m=>m.slice(0,3));let u=(s.docs[0]||[]).map(m=>Array.from(m.tags)),l=s.docs[0][0].pre,c=s.docs[0][s.docs[0].length-1].post;if(typeof e=="string"&&(e=this.fromText(e).compute("id")),n.insertAfter(e),s.has("@hasContraction")&&n.contractions&&n.grow("@hasContraction+").contractions().expand(),n.delete(s),i){let m=n.docs[0],d=m[m.length-1];d.tags.has("Possessive")||(d.text+="'s",d.normal+="'s",d.tags.add("Possessive"))}if(l&&n.docs[0]&&(n.docs[0][0].pre=l),c&&n.docs[0]){let m=n.docs[0][n.docs[0].length-1];m.post.trim()||(m.post=c)}let f=n.toView(r).compute(["index","freeze","lexicon"]);if(f.world.compute.preTagger&&f.compute("preTagger"),f.compute("unfreeze"),t.tags&&f.terms().forEach((m,d)=>{m.tagSafe(u[d])}),!f.docs[0]||!f.docs[0][0])return f;if(t.case){let m=o?yA:bA;f.docs[0][0].text=m(f.docs[0][0].text)}return f};Km.replace=function(e,t,r){if(e&&!t)return this.replaceWith(e,r);let n=this.match(e);return n.found?(this.soften(),n.replaceWith(t,r)):this};const DA=function(e,t){let r=e.length-1,n=e[r],a=e[r-t];a&&n&&(a.post+=n.post,a.post=a.post.replace(/ +([.?!,;:])/,"$1"),a.post=a.post.replace(/[,;:]+([.?!])/,"$1"))},NA=function(e,t){t.forEach(r=>{let[n,a,i]=r,o=i-a;e[n]&&(i===e[n].length&&i>1&&DA(e[n],o),e[n].splice(a,o))});for(let r=e.length-1;r>=0;r-=1)if(e[r].length===0&&(e.splice(r,1),r===e.length&&e[r-1])){let n=e[r-1],a=n[n.length-1];a&&(a.post=a.post.trimEnd())}return e},AA=function(e,t){return e=e.map(r=>{let[n]=r;return t[n]&&t[n].forEach(a=>{let i=a[2]-a[1];r[1]<=a[1]&&r[2]>=a[2]&&(r[2]-=i)}),r}),e.forEach((r,n)=>{if(r[1]===0&&r[2]==0)for(let a=n+1;a<e.length;a+=1)e[a][0]-=1,e[a][0]<0&&(e[a][0]=0)}),e=e.filter(r=>r[2]-r[1]>0),e=e.map(r=>(r[3]=null,r[4]=null,r)),e},Rf={remove:function(e){const{indexN:t}=this.methods.one.pointer;this.uncache();let r=this.all(),n=this;e&&(r=this,n=this.match(e));let a=!r.ptrs;n.has("@hasContraction")&&n.contractions&&n.grow("@hasContraction").contractions().expand();let i=r.fullPointer,o=n.fullPointer.reverse(),s=NA(this.document,o),u=t(o);return i=AA(i,u),r.ptrs=i,r.document=s,r.compute("index"),a&&(r.ptrs=void 0),e?r.toView(i):(this.ptrs=[],r.none())}};Rf.delete=Rf.remove;const Ps={pre:function(e,t){return e===void 0&&this.found?this.docs[0][0].pre:(this.docs.forEach(r=>{let n=r[0];t===!0?n.pre+=e:n.pre=e}),this)},post:function(e,t){if(e===void 0){let r=this.docs[this.docs.length-1];return r[r.length-1].post}return this.docs.forEach(r=>{let n=r[r.length-1];t===!0?n.post+=e:n.post=e}),this},trim:function(){if(!this.found)return this;let e=this.docs,t=e[0][0];t.pre=t.pre.trimStart();let r=e[e.length-1],n=r[r.length-1];return n.post=n.post.trimEnd(),this},hyphenate:function(){return this.docs.forEach(e=>{e.forEach((t,r)=>{r!==0&&(t.pre=""),e[r+1]&&(t.post="-")})}),this},dehyphenate:function(){const e=/[-–—]/;return this.docs.forEach(t=>{t.forEach(r=>{e.test(r.post)&&(r.post=" ")})}),this},toQuotations:function(e,t){return e=e||'"',t=t||'"',this.docs.forEach(r=>{r[0].pre=e+r[0].pre;let n=r[r.length-1];n.post=t+n.post}),this},toParentheses:function(e,t){return e=e||"(",t=t||")",this.docs.forEach(r=>{r[0].pre=e+r[0].pre;let n=r[r.length-1];n.post=t+n.post}),this}};Ps.deHyphenate=Ps.dehyphenate;Ps.toQuotation=Ps.toQuotations;const CA=(e,t)=>e.normal<t.normal?-1:e.normal>t.normal?1:0,EA=(e,t)=>{let r=e.normal.trim().length,n=t.normal.trim().length;return r<n?1:r>n?-1:0},SA=(e,t)=>e.words<t.words?1:e.words>t.words?-1:0,TA=(e,t)=>e[0]<t[0]?1:e[0]>t[0]?-1:e[1]>t[1]?1:-1,MA=function(e){let t={};return e.forEach(r=>{t[r.normal]=t[r.normal]||0,t[r.normal]+=1}),e.sort((r,n)=>{let a=t[r.normal],i=t[n.normal];return a<i?1:a>i?-1:0}),e},_c={alpha:CA,length:EA,wordCount:SA,sequential:TA,byFreq:MA},FA=new Set(["index","sequence","seq","sequential","chron","chronological"]),PA=new Set(["freq","frequency","topk","repeats"]),kA=new Set(["alpha","alphabetical"]),OA=function(e,t){let r=e.fullPointer;return r=r.sort((n,a)=>(n=e.update([n]),a=e.update([a]),t(n,a))),e.ptrs=r,e},$A=function(e){let{docs:t,pointer:r}=this;if(this.uncache(),typeof e=="function")return OA(this,e);e=e||"alpha";let n=r||t.map((i,o)=>[o]),a=t.map((i,o)=>({index:o,words:i.length,normal:i.map(s=>s.machine||s.normal||"").join(" "),pointer:n[o]}));return FA.has(e)&&(e="sequential"),kA.has(e)&&(e="alpha"),PA.has(e)?(a=_c.byFreq(a),this.update(a.map(i=>i.pointer))):typeof _c[e]=="function"?(a=a.sort(_c[e]),this.update(a.map(i=>i.pointer))):this},BA=function(){let e=this.pointer||this.docs.map((t,r)=>[r]);return e=[].concat(e),e=e.reverse(),this._cache&&(this._cache=this._cache.reverse()),this.update(e)},_A=function(){let e=new Set;return this.filter(r=>{let n=r.text("machine");return e.has(n)?!1:(e.add(n),!0)})},IA={unique:_A,reverse:BA,sort:$A},zA=e=>Object.prototype.toString.call(e)==="[object Array]",Lb=function(e,t){if(e.length>0){let r=e[e.length-1],n=r[r.length-1];/ /.test(n.post)===!1&&(n.post+=" ")}return e=e.concat(t),e},jA=function(e,t){if(e.document===t.document){let n=e.fullPointer.concat(t.fullPointer);return e.toView(n).compute("index")}return t.fullPointer.forEach(n=>{n[0]+=e.document.length}),e.document=Lb(e.document,t.docs),e.all()},qA={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 r=this.fullPointer,n=r[r.length-1][0];this.document.splice(n,0,...t.document)}return this.all().compute("index")}if(typeof e=="object"&&e.isView)return jA(this,e);if(zA(e)){let t=Lb(this.document,e);return this.document=t,this.all()}return this}},RA=function(){return this.ptrs=this.fullPointer,this},LA=function(){let e=this.ptrs;return!e||e.length<1?this:(e=e.map(t=>t.slice(0,3)),this.ptrs=e,this)},HA={harden:RA,soften:LA},GA=Object.assign({},uA,Gi,Km,Rf,Ps,IA,qA,HA),VA=function(e){Object.assign(e.prototype,GA)},UA={id:function(e){let t=e.docs;for(let r=0;r<t.length;r+=1)for(let n=0;n<t[r].length;n+=1){let a=t[r][n];a.id=a.id||Rb(a)}}},WA={api:VA,compute:UA},JA=[{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"]}],an=!0,KA={st:an,nd:an,rd:an,th:an,am:an,pm:an,max:an,"°":an,s:an,e:an,er:an,ère:an,ème:an},YA={one:{contractions:JA,numberSuffixes:KA}},Ic=function(e,t,r){let[n,a]=t;!r||r.length===0||(r=r.map((i,o)=>(i.implicit=i.text,i.machine=i.text,i.pre="",i.post="",i.text="",i.normal="",i.index=[n,a+o],i)),r[0]&&(r[0].pre=e[n][a].pre,r[r.length-1].post=e[n][a].post,r[0].text=e[n][a].text,r[0].normal=e[n][a].normal),e[n].splice(a,1,...r))},ZA=/'/,QA=new Set(["what","how","when","where","why"]),XA=new Set(["be","go","start","think","need"]),e3=new Set(["been","gone"]),t3=function(e,t){let r=e[t].normal.split(ZA)[0];if(QA.has(r))return[r,"did"];if(e[t+1]){if(e3.has(e[t+1].normal))return[r,"had"];if(XA.has(e[t+1].normal))return[r,"would"]}return null},r3=function(e,t){return e[t].normal==="ain't"||e[t].normal==="aint"?null:[e[t].normal.replace(/n't/,""),"not"]},Ym=/'/,n3=/(e|é|aison|sion|tion)$/,a3=/(age|isme|acle|ege|oire)$/,i3=(e,t)=>{let r=e[t].normal.split(Ym)[1];return r&&r.endsWith("e")?["la",r]:["le",r]},o3=(e,t)=>{let r=e[t].normal.split(Ym)[1];return r&&n3.test(r)&&!a3.test(r)?["du",r]:r&&r.endsWith("s")?["des",r]:["de",r]},s3=(e,t)=>["je",e[t].normal.split(Ym)[1]],zc={preJ:s3,preL:i3,preD:o3},u3=/^([0-9.]{1,4}[a-z]{0,2}) ?[-–—] ?([0-9]{1,4}[a-z]{0,2})$/i,l3=/^([0-9]{1,2}(:[0-9][0-9])?(am|pm)?) ?[-–—] ?([0-9]{1,2}(:[0-9][0-9])?(am|pm)?)$/i,c3=/^[0-9]{3}-[0-9]{4}$/,f3=function(e,t){let r=e[t],n=r.text.match(u3);return n!==null?r.tags.has("PhoneNumber")===!0||c3.test(r.text)?null:[n[1],"to",n[2]]:(n=r.text.match(l3),n!==null?[n[1],"to",n[4]]:null)},m3=/^([+-]?[0-9][.,0-9]*)([a-z°²³µ/]+)$/,d3=function(e,t,r){const n=r.model.one.numberSuffixes||{};let i=e[t].text.match(m3);if(i!==null){let o=i[2].toLowerCase().trim();return n.hasOwnProperty(o)?null:[i[1],o]}return null},dh=/'/,h3=/^[0-9][^-–—]*[-–—].*?[0-9]/,hh=function(e,t,r,n){let a=t.update();a.document=[e];let i=r+n;r>0&&(r-=1),e[i]&&(i+=1),a.ptrs=[[0,r,i]]},ph={t:(e,t)=>r3(e,t),d:(e,t)=>t3(e,t)},gh={j:(e,t)=>zc.preJ(e,t),l:(e,t)=>zc.preL(e,t),d:(e,t)=>zc.preD(e,t)},p3=function(e,t,r,n){for(let a=0;a<e.length;a+=1){let i=e[a];if(i.word===t.normal)return i.out;if(n!==null&&n===i.after)return[r].concat(i.out);if(r!==null&&r===i.before&&n&&n.length>2)return i.out.concat(n)}return null},jc=function(e,t){let r=t.fromText(e.join(" "));return r.compute(["id","alias"]),r.docs[0]},g3=function(e,t){for(let r=t+1;r<5&&e[r];r+=1)if(e[r].normal==="been")return["there","has"];return["there","is"]},v3=e=>{let{world:t,document:r}=e;const{model:n,methods:a}=t;let i=n.one.contractions||[];r.forEach((o,s)=>{for(let u=o.length-1;u>=0;u-=1){let l=null,c=null;if(dh.test(o[u].normal)===!0){let m=o[u].normal.split(dh);l=m[0],c=m[1]}let f=p3(i,o[u],l,c);if(!f&&ph.hasOwnProperty(c)&&(f=ph[c](o,u,t)),!f&&gh.hasOwnProperty(l)&&(f=gh[l](o,u)),l==="there"&&c==="s"&&(f=g3(o,u)),f){f=jc(f,e),Ic(r,[s,u],f),hh(r[s],e,u,f.length);continue}if(h3.test(o[u].normal)){f=f3(o,u),f&&(f=jc(f,e),Ic(r,[s,u],f),a.one.setTag(f,"NumberRange",t),f[2]&&f[2].tags.has("Time")&&a.one.setTag([f[0]],"Time",t,null,"time-range"),hh(r[s],e,u,f.length));continue}f=d3(o,u,t),f&&(f=jc(f,e),Ic(r,[s,u],f),a.one.setTag([f[1]],"Unit",t,null,"contraction-unit"))}})},y3={contractions:v3},b3={model:YA,compute:y3,hooks:["contractions"]},vh=function(e){const t=e.world,{model:r,methods:n}=e.world,a=n.one.setTag,{frozenLex:i}=r.one,o=r.one._multiCache||{};e.docs.forEach(s=>{for(let u=0;u<s.length;u+=1){let l=s[u],c=l.machine||l.normal;if(o[c]!==void 0&&s[u+1]){let f=u+o[c]-1;for(let m=f;m>u;m-=1){let d=s.slice(u,m+1),p=d.map(h=>h.machine||h.normal).join(" ");if(i.hasOwnProperty(p)===!0){a(d,i[p],t,!1,"1-frozen-multi-lexicon"),d.forEach(h=>h.frozen=!0);continue}}}if(i[c]!==void 0&&i.hasOwnProperty(c)){a([l],i[c],t,!1,"1-freeze-lexicon"),l.frozen=!0;continue}}})},w3=function(e){return e.docs.forEach(t=>{t.forEach(r=>{delete r.frozen})}),e},x3={frozen:vh,freeze:vh,unfreeze:w3},yh=e=>"\x1B[34m"+e+"\x1B[0m",bh=e=>"\x1B[3m\x1B[2m"+e+"\x1B[0m",wh=function(e){e.docs.forEach(t=>{console.log(yh(`
|
|
2
2
|
┌─────────`)),t.forEach(r=>{let n=` ${bh("│")} `,a=r.implicit||r.text||"-";r.frozen===!0?n+=`${yh(a)} ❄️`:n+=bh(a),console.log(n)})})},D3={compute:x3,mutate:e=>{const t=e.methods.one;t.termMethods.isFrozen=r=>r.frozen===!0,t.debug.freeze=wh,t.debug.frozen=wh},api:function(e){e.prototype.freeze=function(){return this.docs.forEach(t=>{t.forEach(r=>{r.frozen=!0})}),this},e.prototype.unfreeze=function(){this.compute("unfreeze")},e.prototype.isFrozen=function(){return this.match("@isFrozen+")}},hooks:["freeze"]},N3=function(e,t,r){const{model:n,methods:a}=r,i=a.one.setTag,o=n.one._multiCache||{},{lexicon:s}=n.one||{};let u=e[t],l=u.machine||u.normal;if(o[l]!==void 0&&e[t+1]){let c=t+o[l]-1;for(let f=c;f>t;f-=1){let m=e.slice(t,f+1);if(m.length<=1)return!1;let d=m.map(p=>p.machine||p.normal).join(" ");if(s.hasOwnProperty(d)===!0){let p=s[d];return i(m,p,r,!1,"1-multi-lexicon"),p&&p.length===2&&(p[0]==="PhrasalVerb"||p[1]==="PhrasalVerb")&&i([m[1]],"Particle",r,!1,"1-phrasal-particle"),!0}}return!1}return null},xh=/^(under|over|mis|re|un|dis|semi|pre|post)-?/,A3=new Set(["Verb","Infinitive","PastTense","Gerund","PresentTense","Adjective","Participle"]),C3=function(e,t,r){const{model:n,methods:a}=r,i=a.one.setTag,{lexicon:o}=n.one;let s=e[t],u=s.machine||s.normal;if(o[u]!==void 0&&o.hasOwnProperty(u))return i([s],o[u],r,!1,"1-lexicon"),!0;if(s.alias){let l=s.alias.find(c=>o.hasOwnProperty(c));if(l)return i([s],o[l],r,!1,"1-lexicon-alias"),!0}if(xh.test(u)===!0){let l=u.replace(xh,"");if(o.hasOwnProperty(l)&&l.length>3&&A3.has(o[l]))return i([s],o[l],r,!1,"1-lexicon-prefix"),!0}return null},E3=function(e){const t=e.world;e.docs.forEach(r=>{for(let n=0;n<r.length;n+=1)if(r[n].tags.size===0){let a=null;a=a||N3(r,n,t),a=a||C3(r,n,t)}})},S3={lexicon:E3},T3=function(e){let t={},r={};return Object.keys(e).forEach(n=>{let a=e[n];n=n.toLowerCase().trim(),n=n.replace(/'s\b/,"");let i=n.split(/ /);i.length>1&&(r[i[0]]===void 0||i.length>r[i[0]])&&(r[i[0]]=i.length),t[n]=t[n]||a}),delete t[""],delete t[null],delete t[" "],{lex:t,_multi:r}},M3={one:{expandLexicon:T3}},F3=function(e,t=!1){const r=this.world(),{methods:n,model:a}=r;if(!e)return;if(Object.keys(e).forEach(s=>{typeof e[s]=="string"&&e[s].startsWith("#")&&(e[s]=e[s].replace(/^#/,""))}),t===!0){let{lex:s,_multi:u}=n.one.expandLexicon(e,r);Object.assign(a.one._multiCache,u),Object.assign(a.one.frozenLex,s);return}if(n.two.expandLexicon){let{lex:s,_multi:u}=n.two.expandLexicon(e,r);Object.assign(a.one.lexicon,s),Object.assign(a.one._multiCache,u)}let{lex:i,_multi:o}=n.one.expandLexicon(e,r);Object.assign(a.one.lexicon,i),Object.assign(a.one._multiCache,o)},P3={addWords:F3},k3={one:{lexicon:{},_multiCache:{},frozenLex:{}}},O3={model:k3,methods:M3,compute:S3,lib:P3,hooks:["lexicon"]},$3=function(e,t){const{methods:r,model:n}=t;return r.one.tokenize.splitTerms(e,n).map(i=>r.one.tokenize.splitWhitespace(i,n)).map(i=>i.text.toLowerCase())},Hb=function(e,t){let r=[{}],n=[null],a=[0],i=[],o=0;e.forEach(function(s){let u=0,l=$3(s,t);for(let c=0;c<l.length;c++){let f=l[c];r[u]&&r[u].hasOwnProperty(f)?u=r[u][f]:(o++,r[u][f]=o,r[o]={},u=o,n[o]=null)}n[u]=[l.length]});for(let s in r[0])o=r[0][s],a[o]=0,i.push(o);for(;i.length;){let s=i.shift(),u=Object.keys(r[s]);for(let l=0;l<u.length;l+=1){let c=u[l],f=r[s][c];for(i.push(f),o=a[s];o>0&&!r[o].hasOwnProperty(c);)o=a[o];if(r.hasOwnProperty(o)){let m=r[o][c];a[f]=m,n[m]&&(n[f]=n[f]||[],n[f]=n[f].concat(n[m]))}else a[f]=0}}return{goNext:r,endAs:n,failTo:a}},B3=function(e,t,r){let n=0,a=[];for(let i=0;i<e.length;i++){let o=e[i][r.form]||e[i].normal;for(;n>0&&(t.goNext[n]===void 0||!t.goNext[n].hasOwnProperty(o));)n=t.failTo[n]||0;if(t.goNext[n].hasOwnProperty(o)&&(n=t.goNext[n][o],t.endAs[n])){let s=t.endAs[n];for(let u=0;u<s.length;u++){let l=s[u],c=e[i-l+1],[f,m]=c.index;a.push([f,m,m+l,c.id])}}}return a},_3=function(e,t){for(let r=0;r<e.length;r+=1)if(t.has(e[r])===!0)return!1;return!0},I3=function(e,t,r){let n=[];r.form=r.form||"normal";let a=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 o=0;o<a.length;o++){if(e._cache&&e._cache[o]&&_3(i,e._cache[o])===!0)continue;let s=a[o],u=B3(s,t,r);u.length>0&&(n=n.concat(u))}return e.update(n)},z3=e=>Object.prototype.toString.call(e)==="[object Object]";function j3(e){e.prototype.lookup=function(t,r={}){if(!t)return this.none();typeof t=="string"&&(t=[t]);let n=z3(t)?t:Hb(t,this.world),a=I3(this,n,r);return a=a.settle(),a}}const qc=(e,t)=>{for(let r=e.length-1;r>=0;r-=1)if(e[r]!==t)return e=e.slice(0,r+1),e;return e},q3=function(e){return e.goNext=e.goNext.map(t=>{if(Object.keys(t).length!==0)return t}),e.goNext=qc(e.goNext,void 0),e.failTo=qc(e.failTo,0),e.endAs=qc(e.endAs,null),e},Lf={buildTrie:function(e){const t=Hb(e,this.world());return q3(t)}};Lf.compile=Lf.buildTrie;const R3={api:j3,lib:Lf},Dh=function(e,t){return t&&e.forEach(r=>{let n=r[0];t[n]&&(r[0]=t[n][0],r[1]+=t[n][1],r[2]+=t[n][1])}),e},Gb=function(e,t){let{ptrs:r,byGroup:n}=e;return r=Dh(r,t),Object.keys(n).forEach(a=>{n[a]=Dh(n[a],t)}),{ptrs:r,byGroup:n}},Gs=function(e,t,r){const n=r.methods.one;return typeof e=="number"&&(e=String(e)),typeof e=="string"&&(e=n.killUnicode(e,r),e=n.parseMatch(e,t,r)),e},Vb=e=>Object.prototype.toString.call(e)==="[object Object]",Vs=e=>e&&Vb(e)&&e.isView===!0,Us=e=>e&&Vb(e)&&e.isNet===!0,L3=function(e,t,r){const n=this.methods.one;if(Vs(e))return this.intersection(e);if(Us(e))return this.sweep(e,{tagger:!1}).view.settle();e=Gs(e,r,this.world);let a={regs:e,group:t},i=n.match(this.docs,a,this._cache),{ptrs:o,byGroup:s}=Gb(i,this.fullPointer),u=this.toView(o);return u._groups=s,u},H3=function(e,t,r){const n=this.methods.one;if(Vs(e))return this.intersection(e).eq(0);if(Us(e))return this.sweep(e,{tagger:!1,matchOne:!0}).view;e=Gs(e,r,this.world);let a={regs:e,group:t,justOne:!0},i=n.match(this.docs,a,this._cache),{ptrs:o,byGroup:s}=Gb(i,this.fullPointer),u=this.toView(o);return u._groups=s,u},G3=function(e,t,r){const n=this.methods.one;if(Vs(e))return this.intersection(e).fullPointer.length>0;if(Us(e))return this.sweep(e,{tagger:!1}).view.found;e=Gs(e,r,this.world);let a={regs:e,group:t,justOne:!0};return n.match(this.docs,a,this._cache).ptrs.length>0},V3=function(e,t,r){const n=this.methods.one;if(Vs(e))return this.filter(u=>u.intersection(e).found);if(Us(e)){let u=this.sweep(e,{tagger:!1}).view.settle();return this.if(u)}e=Gs(e,r,this.world);let a={regs:e,group:t,justOne:!0},i=this.fullPointer,o=this._cache||[];i=i.filter((u,l)=>{let c=this.update([u]);return n.match(c.docs,a,o[l]).ptrs.length>0});let s=this.update(i);return this._cache&&(s._cache=i.map(u=>o[u[0]])),s},U3=function(e,t,r){const{methods:n}=this,a=n.one;if(Vs(e))return this.filter(s=>!s.intersection(e).found);if(Us(e)){let s=this.sweep(e,{tagger:!1}).view.settle();return this.ifNo(s)}e=Gs(e,r,this.world);let i=this._cache||[],o=this.filter((s,u)=>{let l={regs:e,group:t,justOne:!0};return a.match(s.docs,l,i[u]).ptrs.length===0});return this._cache&&(o._cache=o.ptrs.map(s=>i[s[0]])),o},W3={matchOne:H3,match:L3,has:G3,if:V3,ifNo:U3},J3=function(e,t,r){const{indexN:n}=this.methods.one.pointer;let a=[],i=n(this.fullPointer);Object.keys(i).forEach(s=>{let u=i[s].sort((l,c)=>l[1]>c[1]?1:-1)[0];u[1]>0&&a.push([u[0],0,u[1]])});let o=this.toView(a);return e?o.match(e,t,r):o},K3=function(e,t,r){const{indexN:n}=this.methods.one.pointer;let a=[],i=n(this.fullPointer),o=this.document;Object.keys(i).forEach(u=>{let l=i[u].sort((m,d)=>m[1]>d[1]?-1:1)[0],[c,,f]=l;f<o[c].length&&a.push([c,f,o[c].length])});let s=this.toView(a);return e?s.match(e,t,r):s},Y3=function(e,t,r){typeof e=="string"&&(e=this.world.methods.one.parseMatch(e,r,this.world)),e[e.length-1].end=!0;let n=this.fullPointer;return this.forEach((a,i)=>{let o=a.before(e,t);if(o.found){let s=o.terms();n[i][1]-=s.length,n[i][3]=s.docs[0][0].id}}),this.update(n)},Z3=function(e,t,r){typeof e=="string"&&(e=this.world.methods.one.parseMatch(e,r,this.world)),e[0].start=!0;let n=this.fullPointer;return this.forEach((a,i)=>{let o=a.after(e,t);if(o.found){let s=o.terms();n[i][2]+=s.length,n[i][4]=null}}),this.update(n)},Q3=function(e,t,r){return this.growRight(e,t,r).growLeft(e,t,r)},X3={before:J3,after:K3,growLeft:Y3,growRight:Z3,grow:Q3},Ub=function(e,t){return[e[0],e[1],t[2]]},eC=function(e){return Object.prototype.toString.call(e)==="[object Array]"},Zm=(e,t,r)=>typeof e=="string"||eC(e)?t.match(e,r):e||t.none(),Qm=function(e,t){let[r,n,a]=e;return t.document[r]&&t.document[r][n]&&(e[3]=e[3]||t.document[r][n].id,t.document[r][a-1]&&(e[4]=e[4]||t.document[r][a-1].id)),e},jo={};jo.splitOn=function(e,t){const{splitAll:r}=this.methods.one.pointer;let n=Zm(e,this,t).fullPointer,a=r(this.fullPointer,n),i=[];return a.forEach(o=>{i.push(o.passthrough),i.push(o.before),i.push(o.match),i.push(o.after)}),i=i.filter(o=>o),i=i.map(o=>Qm(o,this)),this.update(i)};jo.splitBefore=function(e,t){const{splitAll:r}=this.methods.one.pointer;let n=Zm(e,this,t).fullPointer,a=r(this.fullPointer,n);for(let o=0;o<a.length;o+=1)!a[o].after&&a[o+1]&&a[o+1].before&&a[o].match&&a[o].match[0]===a[o+1].before[0]&&(a[o].after=a[o+1].before,delete a[o+1].before);let i=[];return a.forEach(o=>{i.push(o.passthrough),i.push(o.before),o.match&&o.after?i.push(Ub(o.match,o.after)):i.push(o.match)}),i=i.filter(o=>o),i=i.map(o=>Qm(o,this)),this.update(i)};jo.splitAfter=function(e,t){const{splitAll:r}=this.methods.one.pointer;let n=Zm(e,this,t).fullPointer,a=r(this.fullPointer,n),i=[];return a.forEach(o=>{i.push(o.passthrough),o.before&&o.match?i.push(Ub(o.before,o.match)):(i.push(o.before),i.push(o.match)),i.push(o.after)}),i=i.filter(o=>o),i=i.map(o=>Qm(o,this)),this.update(i)};jo.split=jo.splitAfter;const tC=function(e,t){return!e||!t||e[0]!==t[0]?!1:e[2]===t[1]},Nh=function(e,t,r){const n=e.world,a=n.methods.one.parseMatch;t=t||".$",r=r||"^.";let i=a(t,{},n),o=a(r,{},n);i[i.length-1].end=!0,o[0].start=!0;let s=e.fullPointer,u=[s[0]];for(let l=1;l<s.length;l+=1){let c=u[u.length-1],f=s[l],m=e.update([c]),d=e.update([f]);tC(c,f)&&m.has(i)&&d.has(o)?u[u.length-1]=[c[0],c[1],f[2],c[3],f[4]]:u.push(f)}return e.update(u)},rC={joinIf:function(e,t){return Nh(this,e,t)},join:function(){return Nh(this)}},Wn=Object.assign({},W3,X3,jo,rC);Wn.lookBehind=Wn.before;Wn.lookBefore=Wn.before;Wn.lookAhead=Wn.after;Wn.lookAfter=Wn.after;Wn.notIf=Wn.ifNo;const nC=function(e){Object.assign(e.prototype,Wn)},aC=/(?:^|\s)([![^]*(?:<[^<]*>)?\/.*?[^\\/]\/[?\]+*$~]*)(?:\s|$)/,iC=/([!~[^]*(?:<[^<]*>)?\([^)]+[^\\)]\)[?\]+*$~]*)(?:\s|$)/,oC=/ /g,sC=e=>/^[![^]*(<[^<]*>)?\(/.test(e)&&/\)[?\]+*$~]*$/.test(e),Ah=e=>/^[![^]*(<[^<]*>)?\//.test(e)&&/\/[?\]+*$~]*$/.test(e),Ch=function(e){return e=e.map(t=>t.trim()),e=e.filter(t=>t),e},uC=function(e){let t=e.split(aC),r=[];t.forEach(a=>{if(Ah(a)){r.push(a);return}r=r.concat(a.split(iC))}),r=Ch(r);let n=[];return r.forEach(a=>{sC(a)||Ah(a)?n.push(a):n=n.concat(a.split(oC))}),n=Ch(n),n},Eh=/\{([0-9]+)?(, *[0-9]*)?\}/,Sh=/&&/,lC=new RegExp(/^<\s*(\S+)\s*>/),Th=e=>e.charAt(0).toUpperCase()+e.substring(1),gn=e=>e.charAt(e.length-1),on=e=>e.charAt(0),Eo=e=>e.substring(1),So=e=>e.substring(0,e.length-1),ms=function(e){return e=Eo(e),e=So(e),e},Wb=function(e,t){let r={};for(let n=0;n<2;n+=1){if(gn(e)==="$"&&(r.end=!0,e=So(e)),on(e)==="^"&&(r.start=!0,e=Eo(e)),gn(e)==="?"&&(r.optional=!0,e=So(e)),(on(e)==="["||gn(e)==="]")&&(r.group=null,on(e)==="["&&(r.groupStart=!0),gn(e)==="]"&&(r.groupEnd=!0),e=e.replace(/^\[/,""),e=e.replace(/\]$/,""),on(e)==="<")){const a=lC.exec(e);a.length>=2&&(r.group=a[1],e=e.replace(a[0],""))}if(gn(e)==="+"&&(r.greedy=!0,e=So(e)),e!=="*"&&gn(e)==="*"&&e!=="\\*"&&(r.greedy=!0,e=So(e)),on(e)==="!"&&(r.negative=!0,e=Eo(e)),on(e)==="~"&&gn(e)==="~"&&e.length>2&&(e=ms(e),r.fuzzy=!0,r.min=t.fuzzy||.85,/\(/.test(e)===!1))return r.word=e,r;if(on(e)==="/"&&gn(e)==="/")return e=ms(e),t.caseSensitive&&(r.use="text"),r.regex=new RegExp(e),r;if(Eh.test(e)===!0&&(e=e.replace(Eh,(a,i,o)=>(o===void 0?(r.min=Number(i),r.max=Number(i)):(o=o.replace(/, */,""),i===void 0?(r.min=0,r.max=Number(o)):(r.min=Number(i),r.max=Number(o||999))),r.greedy=!0,r.min||(r.optional=!0),""))),on(e)==="("&&gn(e)===")"){Sh.test(e)?(r.choices=e.split(Sh),r.operator="and"):(r.choices=e.split("|"),r.operator="or"),r.choices[0]=Eo(r.choices[0]);let a=r.choices.length-1;r.choices[a]=So(r.choices[a]),r.choices=r.choices.map(i=>i.trim()),r.choices=r.choices.filter(i=>i),r.choices=r.choices.map(i=>i.split(/ /g).map(o=>Wb(o,t))),e=""}if(on(e)==="{"&&gn(e)==="}"){if(e=ms(e),r.root=e,/\//.test(e)){let a=r.root.split(/\//);r.root=a[0],r.pos=a[1],r.pos==="adj"&&(r.pos="Adjective"),r.pos=r.pos.charAt(0).toUpperCase()+r.pos.substr(1).toLowerCase(),a[2]!==void 0&&(r.sense=a[2])}return r}if(on(e)==="<"&&gn(e)===">")return e=ms(e),r.chunk=Th(e),r.greedy=!0,r;if(on(e)==="%"&&gn(e)==="%")return e=ms(e),r.switch=e,r}return on(e)==="#"?(r.tag=Eo(e),r.tag=Th(r.tag),r):on(e)==="@"?(r.method=Eo(e),r):e==="."?(r.anything=!0,r):e==="*"?(r.anything=!0,r.greedy=!0,r.optional=!0,r):(e&&(e=e.replace("\\*","*"),e=e.replace("\\.","."),t.caseSensitive?r.use="text":e=e.toLowerCase(),r.word=e),r)},cC=/[a-z0-9][-–—][a-z]/i,fC=function(e,t){let r=t.model.one.prefixes;for(let n=e.length-1;n>=0;n-=1){let a=e[n];if(a.word&&cC.test(a.word)){let i=a.word.split(/[-–—]/g);if(r.hasOwnProperty(i[0]))continue;i=i.filter(o=>o).reverse(),e.splice(n,1),i.forEach(o=>{let s=Object.assign({},a);s.word=o,e.splice(n,0,s)})}}return e},Mh=function(e,t){let{all:r}=t.methods.two.transform.verb||{},n=e.root;return r?r(n,t.model):[]},Fh=function(e,t){let{all:r}=t.methods.two.transform.noun||{};return r?r(e.root,t.model):[e.root]},Ph=function(e,t){let{all:r}=t.methods.two.transform.adjective||{};return r?r(e.root,t.model):[e.root]},mC=function(e,t){return e=e.map(r=>{if(r.root)if(t.methods.two&&t.methods.two.transform){let n=[];r.pos?r.pos==="Verb"?n=n.concat(Mh(r,t)):r.pos==="Noun"?n=n.concat(Fh(r,t)):r.pos==="Adjective"&&(n=n.concat(Ph(r,t))):(n=n.concat(Mh(r,t)),n=n.concat(Fh(r,t)),n=n.concat(Ph(r,t))),n=n.filter(a=>a),n.length>0&&(r.operator="or",r.fastOr=new Set(n))}else r.machine=r.root,delete r.id,delete r.root;return r}),e},dC=function(e){let t=0,r=null;for(let n=0;n<e.length;n++){const a=e[n];a.groupStart===!0&&(r=a.group,r===null&&(r=String(t),t+=1)),r!==null&&(a.group=r),a.groupEnd===!0&&(r=null)}return e},hC=function(e){return e.map(t=>{if(t.choices!==void 0){if(t.operator!=="or"||t.fuzzy===!0)return t;t.choices.every(n=>{if(n.length!==1)return!1;let a=n[0];return a.fuzzy===!0||a.start||a.end?!1:a.word!==void 0&&a.negative!==!0&&a.optional!==!0&&a.method!==!0})===!0&&(t.fastOr=new Set,t.choices.forEach(n=>{t.fastOr.add(n[0].word)}),delete t.choices)}return t})},pC=function(e){return e.map(t=>(t.fuzzy&&t.choices&&t.choices.forEach(r=>{r.length===1&&r[0].word&&(r[0].fuzzy=!0,r[0].min=t.min)}),t))},gC=function(e){return e=dC(e),e=hC(e),e=pC(e),e},vC=function(e,t,r){if(e==null||e==="")return[];t=t||{},typeof e=="number"&&(e=String(e));let n=uC(e);return n=n.map(a=>Wb(a,t)),n=fC(n,r),n=mC(n,r),n=gC(n),n},yC=function(e,t){for(let r of t)if(e.has(r))return!0;return!1},bC=function(e,t){for(let r=0;r<e.length;r+=1){let n=e[r];if(!(n.optional===!0||n.negative===!0||n.fuzzy===!0)){if(n.word!==void 0&&t.has(n.word)===!1||n.tag!==void 0&&t.has("#"+n.tag)===!1)return!0;if(n.fastOr&&yC(n.fastOr,t)===!1)return!1}}return!1},wC=function(e,t){let r=e.length,n=t.length;if(r===0)return n;if(n===0)return r;let a=(n>r?n:r)+1;if(Math.abs(r-n)>(a||100))return a||100;let i=[];for(let m=0;m<a;m++)i[m]=[m],i[m].length=a;for(let m=0;m<a;m++)i[0][m]=m;let o,s,u,l,c,f;for(let m=1;m<=r;++m)for(s=e[m-1],o=1;o<=n;++o){if(m===o&&i[m][o]>4)return r;u=t[o-1],l=s===u?0:1,c=i[m-1][o]+1,(f=i[m][o-1]+1)<c&&(c=f),(f=i[m-1][o-1]+l)<c&&(c=f),m>1&&o>1&&s===t[o-2]&&e[m-2]===u&&(f=i[m-2][o-2]+l)<c?i[m][o]=f:i[m][o]=c}return i[r][n]},xC=function(e,t,r=3){if(e===t)return 1;if(e.length<r||t.length<r)return 0;const n=wC(e,t);let a=Math.max(e.length,t.length);return 1-(a===0?0:n/a)},DC=/([\u0022\uFF02\u0027\u201C\u2018\u201F\u201B\u201E\u2E42\u201A\u00AB\u2039\u2035\u2036\u2037\u301D\u0060\u301F])/,NC=/([\u0022\uFF02\u0027\u201D\u2019\u00BB\u203A\u2032\u2033\u2034\u301E\u00B4])/,kh=/^[-–—]$/,Oh=/ [-–—]{1,3} /,ta=(e,t)=>e.post.indexOf(t)!==-1,ks={hasQuote:e=>DC.test(e.pre)||NC.test(e.post),hasComma:e=>ta(e,","),hasPeriod:e=>ta(e,".")===!0&&ta(e,"...")===!1,hasExclamation:e=>ta(e,"!"),hasQuestionMark:e=>ta(e,"?")||ta(e,"¿"),hasEllipses:e=>ta(e,"..")||ta(e,"…"),hasSemicolon:e=>ta(e,";"),hasColon:e=>ta(e,":"),hasSlash:e=>/\//.test(e.text),hasHyphen:e=>kh.test(e.post)||kh.test(e.pre),hasDash:e=>Oh.test(e.post)||Oh.test(e.pre),hasContraction:e=>!!e.implicit,isAcronym:e=>e.tags.has("Acronym"),isKnown:e=>e.tags.size>0,isTitleCase:e=>new RegExp("^\\p{Lu}[a-z'\\u00C0-\\u00FF]","u").test(e.text),isUpperCase:e=>new RegExp("^\\p{Lu}+$","u").test(e.text)};ks.hasQuotation=ks.hasQuote;let br=function(){};const AC=function(e,t,r,n){if(t.anything===!0)return!0;if(t.start===!0&&r!==0||t.end===!0&&r!==n-1)return!1;if(t.id!==void 0&&t.id===e.id)return!0;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===!0&&(t.word===e.root||xC(t.word,e.normal)>=t.min)||e.alias&&e.alias.some(a=>a===t.word)?!0:t.word===e.text||t.word===e.normal;if(t.tag!==void 0)return e.tags.has(t.tag)===!0;if(t.method!==void 0)return typeof ks[t.method]=="function"&&ks[t.method](e)===!0;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 a=e.normal;return t.use&&(a=e[t.use]),t.regex.test(a)}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 a=e.root||e.implicit||e.machine||e.normal;return t.fastOr.has(a)||t.fastOr.has(e.text)}return t.choices!==void 0?t.operator==="and"?t.choices.every(a=>br(e,a,r,n)):t.choices.some(a=>br(e,a,r,n)):!1};br=function(e,t,r,n){let a=AC(e,t,r,n);return t.negative===!0?!a:a};const CC=function(e,t){let r=Object.assign({},e.regs[e.r],{start:!1,end:!1}),n=e.t;for(;e.t<e.terms.length;e.t+=1){if(t&&br(e.terms[e.t],t,e.start_i+e.t,e.phrase_length))return e.t;let a=e.t-n+1;if(r.max!==void 0&&a===r.max)return e.t;if(br(e.terms[e.t],r,e.start_i+e.t,e.phrase_length)===!1)return r.min!==void 0&&a<r.min?null:e.t}return e.t},EC=function(e,t){let r=e.t;if(!t)return e.terms.length;for(;r<e.terms.length;r+=1)if(br(e.terms[r],t,e.start_i+r,e.phrase_length)===!0)return r;return null},SC=function(e,t){if(e.end===!0&&e.greedy===!0&&t.start_i+t.t<t.phrase_length-1){let r=Object.assign({},e,{end:!1});if(br(t.terms[t.t],r,t.start_i+t.t,t.phrase_length)===!0)return!0}return!1},uc=function(e,t){return e.groups[e.inGroup]||(e.groups[e.inGroup]={start:t,length:0}),e.groups[e.inGroup]},TC=function(e){let{regs:t}=e,r=t[e.r],n=EC(e,t[e.r+1]);if(n===null||n===0||r.min!==void 0&&n-e.t<r.min)return null;if(r.max!==void 0&&n-e.t>r.max)return e.t=e.t+r.max,!0;if(e.hasGroup===!0){const a=uc(e,e.t);a.length=n-e.t}return e.t=n,!0},MC=function(e){return Object.prototype.toString.call(e)==="[object Array]"},Jb=function(e,t=0){let r=e.regs[e.r],n=!1;for(let a=0;a<r.choices.length;a+=1){let i=r.choices[a];if(!MC(i))return!1;if(n=i.every((o,s)=>{let u=0,l=e.t+s+t+u;if(e.terms[l]===void 0)return!1;let c=br(e.terms[l],o,l+e.start_i,e.phrase_length);if(c===!0&&o.greedy===!0)for(let f=1;f<e.terms.length;f+=1){let m=e.terms[l+f];if(m)if(br(m,o,e.start_i+f,e.phrase_length)===!0)u+=1;else break}return t+=u,c}),n){t+=i.length;break}}return n&&r.greedy===!0?Jb(e,t):t},FC=function(e){let t=0;return e.regs[e.r].choices.every(a=>{let i=a.every((o,s)=>{let u=e.t+s;return e.terms[u]===void 0?!1:br(e.terms[u],o,u,e.phrase_length)});return i===!0&&a.length>t&&(t=a.length),i})===!0?t:!1},PC=function(e){const{regs:t}=e;let r=t[e.r],n=Jb(e);if(n){if(r.negative===!0)return null;if(e.hasGroup===!0){const a=uc(e,e.t);a.length+=n}if(r.end===!0){let a=e.phrase_length;if(e.t+e.start_i+n!==a)return null}return e.t+=n,!0}else if(!r.optional)return null;return!0},kC=function(e){const{regs:t}=e;let r=t[e.r],n=FC(e);if(n){if(r.negative===!0)return null;if(e.hasGroup===!0){const a=uc(e,e.t);a.length+=n}if(r.end===!0){let a=e.phrase_length-1;if(e.t+e.start_i!==a)return null}return e.t+=n,!0}else if(!r.optional)return null;return!0},OC=function(e,t,r){let n=0;for(let a=e.t;a<e.terms.length;a+=1){let i=br(e.terms[a],t,e.start_i+e.t,e.phrase_length);if(i||r&&(i=br(e.terms[a],r,e.start_i+e.t,e.phrase_length),i)||(n+=1,t.max!==void 0&&n===t.max))break}return n===0||t.min&&t.min>n?!1:(e.t+=n,!0)},$C=function(e){const{regs:t}=e;let r=t[e.r],n=Object.assign({},r);if(n.negative=!1,br(e.terms[e.t],n,e.start_i+e.t,e.phrase_length))return!1;if(r.optional){let i=t[e.r+1];i&&(br(e.terms[e.t],i,e.start_i+e.t,e.phrase_length)?e.r+=1:i.optional&&t[e.r+2]&&br(e.terms[e.t],t[e.r+2],e.start_i+e.t,e.phrase_length)&&(e.r+=2))}return r.greedy?OC(e,n,t[e.r+1]):(e.t+=1,!0)},BC=function(e){const{regs:t}=e;let r=t[e.r],n=e.terms[e.t],a=br(n,t[e.r+1],e.start_i+e.t,e.phrase_length);if(r.negative||a){let i=e.terms[e.t+1];(!i||!br(i,t[e.r+1],e.start_i+e.t,e.phrase_length))&&(e.r+=1)}},_C=function(e){const{regs:t,phrase_length:r}=e;let n=t[e.r];return e.t=CC(e,t[e.r+1]),e.t===null||n.min&&n.min>e.t||n.end===!0&&e.start_i+e.t!==r?null:!0},IC=function(e){let t=e.terms[e.t],r=e.regs[e.r];if(t.implicit&&e.terms[e.t+1]){if(!e.terms[e.t+1].implicit)return;r.word===t.normal&&(e.t+=1),r.method==="hasContraction"&&(e.t+=1)}},zC=function(e,t){let r=e.regs[e.r];const n=uc(e,t);e.t>1&&r.greedy?n.length+=e.t-t:n.length++},Rc=function(e){const{regs:t}=e;let r=t[e.r],n=e.terms[e.t],a=e.t;return r.optional&&t[e.r+1]&&r.negative?!0:(r.optional&&t[e.r+1]&&BC(e),n.implicit&&e.terms[e.t+1]&&IC(e),e.t+=1,r.end===!0&&e.t!==e.terms.length&&r.greedy!==!0||r.greedy===!0&&!_C(e)?null:(e.hasGroup===!0&&zC(e,a),!0))},Xm=function(e,t,r,n){if(e.length===0||t.length===0)return null;let a={t:0,terms:e,r:0,regs:t,groups:{},start_i:r,phrase_length:n,inGroup:null};for(;a.r<t.length;a.r+=1){let s=t[a.r];if(a.hasGroup=!!s.group,a.hasGroup===!0?a.inGroup=s.group:a.inGroup=null,!a.terms[a.t]){if(t.slice(a.r).some(c=>!c.optional)===!1)break;return null}if(s.anything===!0&&s.greedy===!0){if(!TC(a))return null;continue}if(s.choices!==void 0&&s.operator==="or"){if(!PC(a))return null;continue}if(s.choices!==void 0&&s.operator==="and"){if(!kC(a))return null;continue}if(s.anything===!0){if(s.negative&&s.anything||!Rc(a))return null;continue}if(SC(s,a)===!0){if(!Rc(a))return null;continue}if(s.negative){if(!$C(a))return null;continue}if(br(a.terms[a.t],s,a.start_i+a.t,a.phrase_length)===!0){if(!Rc(a))return null;continue}if(s.optional!==!0)return null}let i=[null,r,a.t+r];if(i[1]===i[2])return null;let o={};return Object.keys(a.groups).forEach(s=>{let u=a.groups[s],l=r+u.start;o[s]=[null,l,l+u.length]}),{pointer:i,groups:o}},jC=function(e,t){let r=[],n={};return e.length===0?{ptrs:r,byGroup:n}:(typeof t=="number"&&(t=String(t)),t?e.forEach(a=>{a.groups[t]&&r.push(a.groups[t])}):e.forEach(a=>{r.push(a.pointer),Object.keys(a.groups).forEach(i=>{n[i]=n[i]||[],n[i].push(a.groups[i])})}),{ptrs:r,byGroup:n})},qC=function(e,t,r){return e=e.filter(n=>{let[a,i,o]=n.pointer,s=r[a].slice(i,o);for(let u=0;u<s.length;u+=1){let l=s.slice(u);if(Xm(l,t,u,s.length)!==null)return!1}return!0}),e},Kb=function(e,t){return e.pointer[0]=t,Object.keys(e.groups).forEach(r=>{e.groups[r][0]=t}),e},RC=function(e,t,r){let n=Xm(e,t,0,e.length);return n?(n=Kb(n,r),n):null},LC=function(e,t,r){r=r||[];let{regs:n,group:a,justOne:i}=t,o=[];if(!n||n.length===0)return{ptrs:[],byGroup:{}};const s=n.filter(u=>u.optional!==!0&&u.negative!==!0).length;e:for(let u=0;u<e.length;u+=1){let l=e[u];if(!(r[u]&&bC(n,r[u]))){if(n[0].start===!0){let c=RC(l,n,u);c&&o.push(c);continue}for(let c=0;c<l.length;c+=1){let f=l.slice(c);if(f.length<s)break;let m=Xm(f,n,c,l.length);if(m){if(m=Kb(m,u),o.push(m),i===!0)break e;let d=m.pointer[2];Math.abs(d-1)>c&&(c=Math.abs(d-1))}}}}return n[n.length-1].end===!0&&(o=o.filter(u=>{let l=u.pointer[0];return e[l].length===u.pointer[2]})),t.notIf&&(o=qC(o,t.notIf,e)),o=jC(o,a),o.ptrs.forEach(u=>{let[l,c,f]=u;u[3]=e[l][c].id,u[4]=e[l][f-1].id}),o},HC={one:{termMethods:ks,parseMatch:vC,match:LC}},GC={parseMatch:function(e,t){const r=this.world();let n=r.methods.one.killUnicode;return n&&(e=n(e,r)),r.methods.one.parseMatch(e,t,r)}},VC={api:nC,methods:HC,lib:GC},UC=/^\../,WC=/^#./,JC=e=>(e=e.replace(/&/g,"&"),e=e.replace(/</g,"<"),e=e.replace(/>/g,">"),e=e.replace(/"/g,"""),e=e.replace(/'/g,"'"),e),KC=function(e){let t="",r="</span>";return e=JC(e),UC.test(e)?t=`<span class="${e.replace(/^\./,"")}"`:WC.test(e)?t=`<span id="${e.replace(/^#/,"")}"`:(t=`<${e}`,r=`</${e}>`),t+=">",{start:t,end:r}},YC=function(e,t){let r={},n={};return Object.keys(t).forEach(a=>{let i=t[a],o=KC(a);typeof i=="string"&&(i=e.match(i)),i.docs.forEach(s=>{if(s.every(c=>c.implicit))return;let u=s[0].id;r[u]=r[u]||[],r[u].push(o.start);let l=s[s.length-1].id;n[l]=n[l]||[],n[l].push(o.end)})}),{starts:r,ends:n}},ZC=function(e){let{starts:t,ends:r}=YC(this,e),n="";return this.docs.forEach(a=>{for(let i=0;i<a.length;i+=1){let o=a[i];t.hasOwnProperty(o.id)&&(n+=t[o.id].join("")),n+=o.pre||"",n+=o.text||"",r.hasOwnProperty(o.id)&&(n+=r[o.id].join("")),n+=o.post||""}}),n},QC={html:ZC},Yb=/[,:;)\]*.?~!\u0022\uFF02\u201D\u2019\u00BB\u203A\u2032\u2033\u2034\u301E\u00B4—-]+$/,Hf=/^[(['"*~\uFF02\u201C\u2018\u201F\u201B\u201E\u2E42\u201A\u00AB\u2039\u2035\u2036\u2037\u301D\u0060\u301F]+/,XC=/[,:;)('"\u201D\]]/,eE=/^[-–—]$/,tE=/ /,Fi=function(e,t,r=!0){let n="";return e.forEach(a=>{let i=a.pre||"",o=a.post||"";t.punctuation==="some"&&(i=i.replace(Hf,""),eE.test(o)&&(o=" "),o=o.replace(XC,""),o=o.replace(/\?!+/,"?"),o=o.replace(/!+/,"!"),o=o.replace(/\?+/,"?"),o=o.replace(/\.{2,}/,""),a.tags.has("Abbreviation")&&(o=o.replace(/\./,""))),t.whitespace==="some"&&(i=i.replace(/\s/,""),o=o.replace(/\s+/," ")),t.keepPunct||(i=i.replace(Hf,""),o==="-"?o=" ":o=o.replace(Yb,""));let s=a[t.form||"text"]||a.normal||"";t.form==="implicit"&&(s=a.implicit||a.text),t.form==="root"&&a.implicit&&(s=a.root||a.implicit||a.normal),(t.form==="machine"||t.form==="implicit"||t.form==="root")&&a.implicit&&(!o||!tE.test(o))&&(o+=" "),n+=i+s+o}),r===!1&&(n=n.trim()),t.lowerCase===!0&&(n=n.toLowerCase()),n},rE=function(e,t){let r="";if(!e||!e[0]||!e[0][0])return r;for(let n=0;n<e.length;n+=1)r+=Fi(e[n],t,!0);if(t.keepSpace||(r=r.trim()),t.keepEndPunct===!1){e[0][0].tags.has("Emoticon")||(r=r.replace(Hf,""));let n=e[e.length-1];n[n.length-1].tags.has("Emoticon")||(r=r.replace(Yb,"")),r.endsWith("'")&&!r.endsWith("s'")&&(r=r.replace(/'/,""))}return t.cleanWhitespace===!0&&(r=r.trim()),r},oi={text:{form:"text"},normal:{whitespace:"some",punctuation:"some",case:"some",unicode:"some",form:"normal"},machine:{keepSpace:!1,whitespace:"some",punctuation:"some",case:"none",unicode:"some",form:"machine"},root:{keepSpace:!1,whitespace:"some",punctuation:"some",case:"some",unicode:"some",form:"root"},implicit:{form:"implicit"}};oi.clean=oi.normal;oi.reduced=oi.root;let Zb=[],Bi=0;for(;Bi<64;)Zb[Bi]=0|Math.sin(++Bi%Math.PI)*4294967296;const ed=function(e){let t,r,n,a=[t=1732584193,r=4023233417,~t,~r],i=[],o=decodeURI(encodeURI(e))+"",s=o.length;for(e=--s/4+2|15,i[--e]=s*8;~s;)i[s>>2]|=o.charCodeAt(s)<<8*s--;for(Bi=o=0;Bi<e;Bi+=16){for(s=a;o<64;s=[n=s[3],t+((n=s[0]+[t&r|~t&n,n&t|~n&r,t^r^n,r^(t|~n)][s=o>>4]+Zb[o]+~~i[Bi|[o,5*o+1,3*o+5,7*o][s]&15])<<(s=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*s+o++%4])|n>>>-s),t,r])t=s[1]|0,r=s[2];for(o=4;o;)a[--o]+=s[o]}for(e="";o<32;)e+=(a[o>>3]>>(1^o++)*4&15).toString(16);return e},nE={text:!0,terms:!0};let $h={case:"none",unicode:"some",form:"machine",punctuation:"some"};const Lc=function(e,t){return Object.assign({},e,t)},_a={text:e=>Fi(e,{keepPunct:!0},!1),normal:e=>Fi(e,Lc(oi.normal,{keepPunct:!0}),!1),implicit:e=>Fi(e,Lc(oi.implicit,{keepPunct:!0}),!1),machine:e=>Fi(e,$h,!1),root:e=>Fi(e,Lc($h,{form:"root"}),!1),hash:e=>ed(Fi(e,{keepPunct:!0},!1)),offset:e=>{let t=_a.text(e).length;return{index:e[0].offset.index,start:e[0].offset.start,length:t}},terms:e=>e.map(t=>{let r=Object.assign({},t);return r.tags=Array.from(t.tags),r}),confidence:(e,t,r)=>t.eq(r).confidence(),syllables:(e,t,r)=>t.eq(r).syllables(),sentence:(e,t,r)=>t.eq(r).fullSentence().text(),dirty:e=>e.some(t=>t.dirty===!0)};_a.sentences=_a.sentence;_a.clean=_a.normal;_a.reduced=_a.root;const aE=function(e,t){return t=t||{},typeof t=="string"&&(t={}),t=Object.assign({},nE,t),t.offset&&e.compute("offset"),e.docs.map((r,n)=>{let a={};return Object.keys(t).forEach(i=>{t[i]&&_a[i]&&(a[i]=_a[i](r,e,n))}),a})},Gf={json:function(e){let t=aE(this,e);return typeof e=="number"?t[e]:t}};Gf.data=Gf.json;const iE=()=>typeof window<"u"&&window.document,oE=function(e){let t=this.methods.one.debug||{};return e&&t.hasOwnProperty(e)?(t[e](this),this):iE()?(t.clientSide(this),this):(t.tags(this),this)},sE=function(e){let t=e.pre||"",r=e.post||"";return t+e.text+r},uE=function(e,t){let r={};return Object.keys(t).forEach(n=>{e.match(n).fullPointer.forEach(i=>{r[i[3]]={fn:t[n],end:i[2]}})}),r},Qb=function(e,t){let r=uE(e,t),n="";return e.docs.forEach((a,i)=>{for(let o=0;o<a.length;o+=1){let s=a[o];if(r.hasOwnProperty(s.id)){let{fn:u,end:l}=r[s.id],c=e.update([[i,o,l]]);n+=a[o].pre||"",n+=u(c),o=l-1,n+=a[o].post||""}else n+=sE(s)}}),n},lE=e=>Object.prototype.toString.call(e)==="[object Object]",cE=function(e){let t={};return e.forEach(n=>{t[n]=t[n]||0,t[n]+=1}),Object.keys(t).map(n=>({normal:n,count:t[n]})).sort((n,a)=>n.count>a.count?-1:0)},fE=function(e){if(lE(e))return Qb(this,e);if(e==="text")return this.text();if(e==="normal")return this.text("normal");if(e==="root")return this.text("root");if(e==="machine"||e==="reduced")return this.text("machine");if(e==="hash"||e==="md5")return ed(this.text());if(e==="json")return this.json();if(e==="offset"||e==="offsets")return this.compute("offset"),this.json({offset:!0});if(e==="array")return this.docs.map(r=>r.reduce((n,a)=>n+a.pre+a.text+a.post,"").trim()).filter(r=>r);if(e==="freq"||e==="frequency"||e==="topk")return cE(this.json({normal:!0}).map(t=>t.normal));if(e==="terms"){let t=[];return this.docs.forEach(r=>{let n=r.map(a=>a.text);n=n.filter(a=>a),t=t.concat(n)}),t}return e==="tags"?this.docs.map(t=>t.reduce((r,n)=>(r[n.implicit||n.normal]=Array.from(n.tags),r),{})):e==="debug"?this.debug():this.text()},mE={debug:oE,out:fE,wrap:function(e){return Qb(this,e)}},dE=e=>Object.prototype.toString.call(e)==="[object Object]",hE={text:function(e){let t={};if(e&&typeof e=="string"&&oi.hasOwnProperty(e)?t=Object.assign({},oi[e]):e&&dE(e)&&(t=Object.assign({},e)),t.keepSpace===void 0&&!this.isFull()&&(t.keepSpace=!1),t.keepEndPunct===void 0&&this.pointer){let r=this.pointer[0];r&&r[1]?t.keepEndPunct=!1:t.keepEndPunct=!0}return t.keepPunct===void 0&&(t.keepPunct=!0),t.keepSpace===void 0&&(t.keepSpace=!0),rE(this.docs,t)}},pE=Object.assign({},mE,hE,Gf,QC),gE=function(e){Object.assign(e.prototype,pE)},vE=function(e){console.log("%c -=-=- ","background-color:#6699cc;"),e.forEach(t=>{console.groupCollapsed(t.text());let n=t.docs[0].map(a=>{let i=a.text||"-";a.implicit&&(i="["+a.implicit+"]");let o="["+Array.from(a.tags).join(", ")+"]";return{text:i,tags:o}});console.table(n,["text","tags"]),console.groupEnd()})},da="\x1B[0m",ln={green:e=>"\x1B[32m"+e+da,red:e=>"\x1B[31m"+e+da,blue:e=>"\x1B[34m"+e+da,magenta:e=>"\x1B[35m"+e+da,cyan:e=>"\x1B[36m"+e+da,yellow:e=>"\x1B[33m"+e+da,black:e=>"\x1B[30m"+e+da,dim:e=>"\x1B[2m"+e+da,i:e=>"\x1B[3m"+e+da},yE=function(e,t){return t.one.tagSet&&(e=e.map(r=>{if(!t.one.tagSet.hasOwnProperty(r))return r;const n=t.one.tagSet[r].color||"blue";return ln[n](r)})),e.join(", ")},bE=function(e){let{docs:t,model:r}=e;t.length===0&&console.log(ln.blue(`
|
|
3
3
|
──────`)),t.forEach(n=>{console.log(ln.blue(`
|
|
4
4
|
┌─────────`)),n.forEach(a=>{let i=[...a.tags||[]],o=a.text||"-";a.sense&&(o=`{${a.normal}/${a.sense}}`),a.implicit&&(o="["+a.implicit+"]"),o=ln.yellow(o);let s="'"+o+"'";if(a.reference){let l=e.update([a.reference]).text("normal");s+=` - ${ln.dim(ln.i("["+l+"]"))}`}s=s.padEnd(18);let u=ln.blue(" │ ")+ln.i(s)+" - "+yE(i,r);console.log(u)})}),console.log(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./css-HnNQMUzV.cjs"),h=require("./jsx-runtime-Dszzpdy0.cjs"),F=require("./Animated-
|
|
1
|
+
"use strict";const i=require("./css-HnNQMUzV.cjs"),h=require("./jsx-runtime-Dszzpdy0.cjs"),F=require("./Animated-NfnNvlbz.cjs"),G=require("./Text-DY08sSZe.cjs"),v=require("./Tags-DtnStTuF.cjs");require("./Button-BMeq9Z2I.cjs");require("./Box-BvqALodh.cjs");const z=require("./Items-CHAbP2ZL.cjs"),K=require("./Animated-Bq6z2XkH.cjs"),f=require("react"),k=require("./Editable-BXFY3-UW.cjs"),U=require("./types-D-yz1qsT.cjs");require("./Provider-BV7nN39a.cjs");require("./provider-lNhTlIWj.cjs");require("react-dom");require("./Haul-2Xa_nMgc.cjs");const Y=require("./hooks-CoF3Fkrn.cjs"),w=(e,n)=>n.includes(e.key),b=({nodes:e,expanded:n,sort:t,depth:s=0})=>{const r={keys:[],nodes:[]};return t!=null&&e.sort(t),e.forEach(o=>{const l=w(o,n);if(r.keys.push(o.key),r.nodes.push({depth:s,expanded:l,hasChildren:o.children!=null}),l&&o.children!=null){const{keys:c,nodes:p}=b({nodes:o.children,expanded:n,sort:t,depth:s+1});r.keys.push(...c),r.nodes.push(...p)}}),r},J=({tree:e,destination:n,keys:t})=>(t=i.a.toArray(t),n==null?[...T({tree:e,keys:t}),...e.filter(r=>!t.includes(r.key))]:(t.forEach(s=>{const r=a({tree:e,key:s});r!=null&&(A({tree:e,keys:s}),M({tree:e,destination:n,additions:r}))}),e)),A=({tree:e,keys:n,parent:t})=>{if(n=i.a.toArray(n),t!==void 0){if(t===null)return e.filter(r=>!n.includes(r.key));const s=a({tree:e,key:t});return s==null||(s.children=s.children?.filter(r=>!n.includes(r.key))),e}return n.forEach(s=>{const r=e.findIndex(o=>o.key===s);if(r!==-1)e.splice(r,1);else{const o=E({tree:e,key:s});o!=null&&(o.children=o.children?.filter(l=>l.key!==s))}}),e},M=({tree:e,destination:n,additions:t,throwOnMissing:s=!0})=>{t=i.a.toArray(t);const r=i.c.by(t,c=>c.key,!1),o=r.map(c=>c.key);if(n==null)return[...r,...e.filter(c=>!o.includes(c.key))];const l=a({tree:e,key:n});if(l==null){if(s)throw new Error(`Could not find node with key ${n}`);return e}return l.children??=[],l.children=[...r,...l.children.filter(c=>!o.includes(c.key))],e},Q=({tree:e,key:n,updater:t,throwOnMissing:s=!0})=>{const r=a({tree:e,key:n});if(r==null){if(s)throw new Error(`Could not find node with key ${n}`);return e}const o=E({tree:e,key:n});if(o!=null){const l=o.children?.findIndex(c=>c.key===n);l!=null&&l!==-1&&o.children?.splice(l,1,t(r))}else e.splice(e.findIndex(l=>l.key===n),1,t(r));return e},V=({tree:e,parent:n,updater:t,throwOnMissing:s=!0})=>{const r=a({tree:e,key:n});if(r==null){if(s)throw new Error(`Could not find node with key ${n}`);return e}return r.children=t(r.children??[]),e},a=({tree:e,key:n,depth:t=0})=>{for(let s=0;s<e.length;s++){const r=e[s];if(r.key===n)return r;if(r.children!=null){const o=a({tree:r.children,key:n,depth:t+1});if(o!=null)return o}}return null},T=({tree:e,keys:n})=>{const t=[];for(const s of n){const r=a({tree:e,key:s});r!=null&&t.push(r)}return t},E=({tree:e,key:n})=>{for(const t of e)if(t.children!=null){if(t.children.some(r=>r.key===n))return t;const s=E({tree:t.children,key:n});if(s!=null)return s}return null},P=e=>e.map(n=>({...n,children:n.children!=null?P(n.children):void 0})),L=(...e)=>{const n=[];return e.forEach(t=>{n.push(t),t.children!=null&&n.push(...L(...t.children))}),n},W=(e,n)=>{const t={keys:[],nodes:[]};return e.keys.forEach((s,r)=>{n(s,e.nodes[r].depth)&&(t.keys.push(s),t.nodes.push(e.nodes[r]))}),t},X=e=>{const n=Math.min(...e.nodes.map(t=>t.depth));return e.keys.filter((t,s)=>e.nodes[s].depth===n)},Z=(e,n)=>{const t=n.keys.findIndex(s=>s===e);return n.nodes[t].depth},$=(e,n)=>{const t=e.keys.findIndex(s=>s===n);return e.nodes[t]},D=f.createContext(null),ee=()=>K.useRequiredContext(D),ne=e=>{const{shape:n}=ee();return n.nodes[e]},te=({shape:e,children:n})=>{const t=f.useMemo(()=>({shape:e}),[e]);return h.jsxRuntimeExports.jsx(D.Provider,{value:t,children:n})},re=({children:e,style:n,className:t,loading:s,useMargin:r=!1,offsetMultiplier:o=2.5,...l})=>{const{index:c}=l,{expanded:p,depth:m,hasChildren:S}=ne(c);return h.jsxRuntimeExports.jsxs(v.ListItem,{className:i.CSS(i.CSS.BE("tree","item"),m!==0&&i.CSS.M("show-rules"),r&&i.CSS.M("margin"),t),style:{[i.CSS.var("tree-item-offset")]:`${m*o+1.5}rem`,...n},gap:"small",align:"center",...l,children:[S&&h.jsxRuntimeExports.jsx(F.Animated,{className:i.CSS.BE("tree","expansion-indicator"),enabled:p,enabledLoc:"bottom",disabledLoc:"right"},"caret"),e,s&&h.jsxRuntimeExports.jsx(G.Loading,{})]})},se="tree-item",oe=[["Shift"]],le=({onExpand:e,nodes:n,initialExpanded:t=[],selected:s,onSelectedChange:r,sort:o})=>{const[l,c,p]=k.useCombinedStateAndRef(t),[m,S]=U.usePassthrough({initial:[],value:s,onChange:r}),g=f.useMemo(()=>b({nodes:n,expanded:l,sort:o}),[n,l,o]),_=k.useSyncedRef(n),q=k.useSyncedRef(g),R=Y.useHeldRef({triggers:oe}),j=f.useCallback((u,{clicked:d})=>{if(S(x=>u.length===0&&x.length>0?x.slice(0,1):u),d==null||R.current.held)return;const y=$(q.current,d);if(y==null||!y.hasChildren)return;const N=p.current,I=N.some(x=>x===d)?"contract":"expand";let C;I==="contract"?C=N.filter(x=>x!==d):C=[...N,d],c(C),e?.({current:C,action:I,clicked:d})},[e,_,c,S]),H=f.useCallback(u=>{c(d=>i.c.unique([...d,u])),e?.({current:l,action:"expand",clicked:u})},[c]),O=f.useCallback((...u)=>{c(d=>d.filter(y=>!u.includes(y))),u.forEach(d=>{e?.({current:l,action:"contract",clicked:d})})},[c]),B=f.useCallback(()=>c([]),[c]);return{selected:m,expanded:l,contract:O,expand:H,clearExpanded:B,shape:g,onSelect:j}},ce=({shape:e,children:n,selected:t,onSelect:s,getItem:r,subscribe:o,className:l,contract:c,expand:p,expanded:m,className:S,clearExpanded:g,showRules:_=!1,virtual:q=!1,...R})=>{const{keys:j}=e;return h.jsxRuntimeExports.jsx(te,{shape:e,children:h.jsxRuntimeExports.jsx(v.Frame,{multiple:!0,value:t,replaceOnSingle:!0,data:j,onChange:s,getItem:r,subscribe:o,itemHeight:27,virtual:q,children:h.jsxRuntimeExports.jsx(z.Items,{full:"y",className:i.CSS(i.CSS.B("tree"),l,_&&i.CSS.M("show-rules")),...R,displayItems:1/0,children:n})})})},ie=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:se,Item:re,Tree:ce,deepCopy:P,filterShape:W,findNode:a,findNodeParent:E,findNodes:T,flatten:b,getAllNodesOfMinDepth:X,getDepth:Z,getDescendants:L,getNodeShape:$,moveNode:J,removeNode:A,setNode:M,shouldExpand:w,updateNode:Q,updateNodeChildren:V,use:le},Symbol.toStringTag,{value:"Module"}));exports.external=ie;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./jsx-runtime-Dszzpdy0.cjs"),e=require("./css-HnNQMUzV.cjs"),c=require("./Box-BvqALodh.cjs"),d=require("./Button-
|
|
1
|
+
"use strict";const o=require("./jsx-runtime-Dszzpdy0.cjs"),e=require("./css-HnNQMUzV.cjs"),c=require("./Box-BvqALodh.cjs"),d=require("./Button-BMeq9Z2I.cjs"),l=require("react"),j=require("./Editable-BXFY3-UW.cjs"),m=require("./types-D-yz1qsT.cjs"),C=({children:s=[],...t})=>o.jsxRuntimeExports.jsx(c.Box$1,{x:!0,gap:"small",align:"center",className:e.CSS.BE("header","actions"),...t,children:s}),x=l.createContext({divided:!1,level:"h1"}),u=()=>l.use(x),p=({className:s,level:t="p",divided:r=!1,bordered:n=!0,padded:a=!1,...i})=>{const S=l.useMemo(()=>({level:t,divided:r}),[t,r]);return o.jsxRuntimeExports.jsx(x,{value:S,children:o.jsxRuntimeExports.jsx(c.Box$1,{el:"header",x:!0,align:"center",justify:"between",className:e.CSS(e.CSS.B("header"),n&&e.CSS.bordered("bottom"),r&&e.CSS.BM("header","divided"),a&&e.CSS.BM("header","padded"),s),...i})})},B=({children:s="",className:t,onClick:r,...n})=>{const{level:a}=u();return o.jsxRuntimeExports.jsx(d.Button,{variant:"text",size:m.LEVEL_COMPONENT_SIZES[a],onClick:r,className:e.CSS(e.CSS.B("header-button-title"),t),sharp:!0,...n,children:s})},E=({className:s,level:t,...r})=>{const{level:n}=u();return o.jsxRuntimeExports.jsx(j.Text,{className:e.CSS(e.CSS.BE("header","text"),s),level:t??n,gap:1.5,...r})},h=Object.freeze(Object.defineProperty({__proto__:null,Actions:C,ButtonTitle:B,Header:p,Title:E,useContext:u},Symbol.toStringTag,{value:"Module"}));exports.external=h;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { h as k, c as A, C as i } from "./css-D6ZBcSwh.js";
|
|
2
2
|
import { j as f } from "./jsx-runtime-OVHDjVDe.js";
|
|
3
|
-
import { A as z } from "./Animated-
|
|
4
|
-
import { L as K } from "./Text-
|
|
5
|
-
import { L as U, F as Y } from "./Tags-
|
|
6
|
-
import "./Button-
|
|
3
|
+
import { A as z } from "./Animated-CEx4LoLs.js";
|
|
4
|
+
import { L as K } from "./Text-BnUGzpJq.js";
|
|
5
|
+
import { L as U, F as Y } from "./Tags-6IUFBvU-.js";
|
|
6
|
+
import "./Button-CMRdj9Ti.js";
|
|
7
7
|
import "./Box-D5Qv__kr.js";
|
|
8
|
-
import { a as J } from "./Items-
|
|
9
|
-
import { f as Q } from "./Animated-
|
|
8
|
+
import { a as J } from "./Items-Cmc6otoS.js";
|
|
9
|
+
import { f as Q } from "./Animated-CUFx-eAB.js";
|
|
10
10
|
import { createContext as V, useMemo as L, useCallback as g } from "react";
|
|
11
11
|
import { d as W, c as R } from "./Editable-CxgdRDPb.js";
|
|
12
12
|
import { b as X } from "./types-BNX_Jj6k.js";
|
|
13
|
-
import "./Provider
|
|
13
|
+
import "./Provider-D0P_lzCo.js";
|
|
14
14
|
import "./provider-C8In649C.js";
|
|
15
15
|
import "react-dom";
|
|
16
16
|
import "./Haul-BuI0PZpo.js";
|
|
17
|
-
import { b as Z } from "./hooks-
|
|
17
|
+
import { b as Z } from "./hooks-Bvv-S6WC.js";
|
|
18
18
|
const M = (e, n) => n.includes(e.key), v = ({
|
|
19
19
|
nodes: e,
|
|
20
20
|
expanded: n,
|
package/dist/header.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-Eaj0hgzm.cjs");exports.Header=e.external;
|
package/dist/header.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as x, j as m } from "./css-D6ZBcSwh.js";
|
|
2
2
|
import { useCallback as b, useEffect as q, useState as C } from "react";
|
|
3
3
|
import { u as H } from "./Editable-CxgdRDPb.js";
|
|
4
|
-
import { p as k, u as M, a as j, f as d, d as y } from "./Text-
|
|
4
|
+
import { p as k, u as M, a as j, f as d, d as y } from "./Text-BnUGzpJq.js";
|
|
5
5
|
import { q as v } from "./deep-DRVLw7iw.js";
|
|
6
6
|
const R = ({
|
|
7
7
|
triggers: n,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const h=require("./css-HnNQMUzV.cjs"),d=require("react"),b=require("./Editable-BXFY3-UW.cjs"),i=require("./Text-
|
|
1
|
+
"use strict";const h=require("./css-HnNQMUzV.cjs"),d=require("react"),b=require("./Editable-BXFY3-UW.cjs"),i=require("./Text-DY08sSZe.cjs"),x=require("./deep-DtdcJG4q.cjs"),q=({triggers:n,callback:u,region:c,loose:r,double:t,regionMustBeElement:l})=>{const{listen:e}=i.useContext();let a;n!=null&&n?.length>0&&typeof n[0]=="string"?a=[n]:a=n;const g=i.useMemoCompare(()=>a,([s],[f])=>s==null&&f==null?!0:s==null||f==null?!1:x.q.primitiveArrays(s.flat(),f.flat())===x.q.EQUAL,[a]);d.useEffect(()=>{if(!(g==null||g.length===0))return e(s=>{const f=i.filter(g,s.prev,{loose:r,double:t}),R=i.filter(g,s.next,{loose:r,double:t}),m=i.diff(R,f);let o=m[0];const p=m[1];if(o.length===0&&p.length===0)return;o=k(s.target,s.cursor,o,c,l);const v={target:s.target,cursor:s.cursor};o.length>0&&u?.({...v,stage:"start",triggers:o,prevTriggers:s.prev}),p.length>0&&u?.({...v,stage:"end",triggers:p,prevTriggers:s.prev})})},[u,g,e,r,c,t,l])},k=(n,u,c,r,t)=>{if(r==null)return c;if(r.current==null)return[];const l=h.jt.construct(r.current);return c.filter(e=>t??e.some(g=>g.includes("Mouse"))?h.jt.contains(l,u)&&n===r.current:h.jt.contains(l,u))},H=({triggers:n,loose:u})=>{const[c,r]=b.useStateRef({triggers:[],held:!1});return q({triggers:n,callback:d.useCallback(t=>{r(l=>{let e;return t.stage==="start"?e=h.c.unique([...l.triggers,...t.triggers]):e=i.purge(l.triggers,t.triggers),{triggers:e,held:e.length>0}})},[]),loose:u}),c},T=({triggers:n,loose:u})=>{const[c,r]=d.useState({triggers:[],held:!1});return q({triggers:n,callback:d.useCallback(t=>{r(l=>{let e;return t.stage==="start"?e=h.c.unique([...l.triggers,...t.triggers]):e=i.purge(l.triggers,t.triggers),{triggers:e,held:e.length>0}})},[]),loose:u}),c};exports.use=q;exports.useHeld=T;exports.useHeldRef=H;
|