Comparing version 0.4.1 to 0.5.1
/** @license | ||
* fzf v0.4.1 | ||
* Copyright (c) 2021 Ajit | ||
* fzf v0.5.1 | ||
* Copyright (c) 2021-2022 Ajit | ||
* Licensed under BSD 3-Clause | ||
*/ | ||
const t={216:"O",223:"s",248:"o",273:"d",295:"h",305:"i",320:"l",322:"l",359:"t",383:"s",384:"b",385:"B",387:"b",390:"O",392:"c",393:"D",394:"D",396:"d",398:"E",400:"E",402:"f",403:"G",407:"I",409:"k",410:"l",412:"M",413:"N",414:"n",415:"O",421:"p",427:"t",429:"t",430:"T",434:"V",436:"y",438:"z",477:"e",485:"g",544:"N",545:"d",549:"z",564:"l",565:"n",566:"t",567:"j",570:"A",571:"C",572:"c",573:"L",574:"T",575:"s",576:"z",579:"B",580:"U",581:"V",582:"E",583:"e",584:"J",585:"j",586:"Q",587:"q",588:"R",589:"r",590:"Y",591:"y",592:"a",593:"a",595:"b",596:"o",597:"c",598:"d",599:"d",600:"e",603:"e",604:"e",605:"e",606:"e",607:"j",608:"g",609:"g",610:"G",613:"h",614:"h",616:"i",618:"I",619:"l",620:"l",621:"l",623:"m",624:"m",625:"m",626:"n",627:"n",628:"N",629:"o",633:"r",634:"r",635:"r",636:"r",637:"r",638:"r",639:"r",640:"R",641:"R",642:"s",647:"t",648:"t",649:"u",651:"v",652:"v",653:"w",654:"y",655:"Y",656:"z",657:"z",663:"c",665:"B",666:"e",667:"G",668:"H",669:"j",670:"k",671:"L",672:"q",686:"h",867:"a",868:"e",869:"i",870:"o",871:"u",872:"c",873:"d",874:"h",875:"m",876:"r",877:"t",878:"v",879:"x",7424:"A",7427:"B",7428:"C",7429:"D",7431:"E",7432:"e",7433:"i",7434:"J",7435:"K",7436:"L",7437:"M",7438:"N",7439:"O",7440:"O",7441:"o",7442:"o",7443:"o",7446:"o",7447:"o",7448:"P",7449:"R",7450:"R",7451:"T",7452:"U",7453:"u",7454:"u",7455:"m",7456:"V",7457:"W",7458:"Z",7522:"i",7523:"r",7524:"u",7525:"v",7834:"a",7835:"s",8305:"i",8341:"h",8342:"k",8343:"l",8344:"m",8345:"n",8346:"p",8347:"s",8348:"t",8580:"c"};for(let Q="̀".codePointAt(0);Q<="ͯ".codePointAt(0);++Q){const e=String.fromCodePoint(Q);for(const n of"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"){const r=(n+e).normalize().codePointAt(0);r>126&&(t[r]=n)}}const e={a:[7844,7863],e:[7870,7879],o:[7888,7907],u:[7912,7921]};for(const Q of Object.keys(e)){const n=Q.toUpperCase();for(let r=e[Q][0];r<=e[Q][1];++r)t[r]=r%2==0?n:Q}function n(e){if(e<192||e>8580)return e;const n=t[e];return void 0!==n?n.codePointAt(0):e}function r(t,e){return t>e?t:e}const o=t=>t.split("").map((t=>t.codePointAt(0))),s=t=>t.map((t=>String.fromCodePoint(t))).join(""),i=new Set(" \f\n\r\t\v \u2028\u2029 \ufeff".split("").map((t=>t.codePointAt(0))));for(let Q=" ".codePointAt(0);Q<=" ".codePointAt(0);Q++)i.add(Q);const l=t=>i.has(t),c=t=>{let e=0;for(const n of t){if(!l(n))break;e++}return e},a=t=>{let e=0;for(let n=t.length-1;n>=0&&l(t[n]);n--)e++;return e},u="".codePointAt(0),f="A".codePointAt(0),h="Z".codePointAt(0),d="a".codePointAt(0),g="z".codePointAt(0),p="0".codePointAt(0),m="9".codePointAt(0);function b(t,e,n){return n?t:e-t-1}var y,P;function w(t){return t?new Set:null}function z(t,e,n){if(null!==e&&e.i16.length>t+n){return[t+n,e.i16.subarray(t,t+n)]}return[t,new Int16Array(n)]}function A(t,e,n){if(null!==e&&e.i32.length>t+n){return[t+n,e.i32.subarray(t,t+n)]}return[t,new Int32Array(n)]}function L(t){return t>=d&&t<=g?1:t>=f&&t<=h?2:t>=p&&t<=m?4:0}function S(t){const e=String.fromCodePoint(t);return e!==e.toUpperCase()?1:e!==e.toLowerCase()?2:null!==e.match(/\p{Number}/gu)?4:null!==e.match(/\p{Letter}/gu)?3:0}function C(t){return t<=u?L(t):S(t)}function v(t,e){return 0===t&&0!==e?8:1===t&&2===e||4!==t&&4===e?7:0===e?8:0}function k(t,e,n,r){let o=t.slice(r),s=o.indexOf(n);if(0===s)return r;if(!e&&n>=d&&n<=g){s>0&&(o=o.slice(0,s));const t=o.indexOf(n-32);t>=0&&(s=t)}return s<0?-1:r+s}function x(t){for(const e of t)if(e>=128)return!1;return!0}function E(t,e,n){if(!x(t))return 0;if(!x(e))return-1;let r=0,o=0;for(let s=0;s<e.length;s++){if(o=k(t,n,e[s],o),o<0)return-1;0===s&&o>0&&(r=o-1),o++}return r}(P=y||(y={}))[P.NonWord=0]="NonWord",P[P.Lower=1]="Lower",P[P.Upper=2]="Upper",P[P.Letter=3]="Letter",P[P.Number=4]="Number";const N=(t,e,o,s,i,l,c)=>{const a=i.length;if(0===a)return[{start:0,end:0,score:0},w(l)];const f=s.length;if(null!==c&&f*a>c.i16.length)return O(t,e,o,s,i,l);const h=E(s,i,t);if(h<0)return[{start:-1,end:-1,score:0},null];let d=0,g=0,p=null,m=null,b=null,y=null;[d,p]=z(d,c,f),[d,m]=z(d,c,f),[d,b]=z(d,c,f),[g,y]=A(g,c,a);const[,P]=A(g,c,f);for(let n=0;n<P.length;n++)P[n]=s[n];let C=0,k=0,x=0,N=0;const F=i[0];let R=i[0],W=0,j=0,I=!1,q=P.subarray(h),U=p.subarray(h).subarray(0,q.length),B=m.subarray(h).subarray(0,q.length),M=b.subarray(h).subarray(0,q.length);for(let[w,z]of q.entries()){let s=null;z<=u?(s=L(z),t||2!==s||(z+=32)):(s=S(z),t||2!==s||(z=String.fromCodePoint(z).toLowerCase().codePointAt(0)),e&&(z=n(z))),q[w]=z;const l=v(j,s);if(M[w]=l,j=s,z===R&&(x<a&&(y[x]=h+w,x++,R=i[Math.min(x,a-1)]),N=h+w),z===F){const t=16+2*l;if(U[w]=t,B[w]=1,1===a&&(o&&t>C||!o&&t>=C)&&(C=t,k=h+w,o&&8===l))break;I=!1}else U[w]=r(I?W+-1:W+-3,0),B[w]=0,I=!0;W=U[w]}if(x!==a)return[{start:-1,end:-1,score:0},null];if(1===a){const t={start:k,end:k+1,score:C};if(!l)return[t,null];const e=new Set;return e.add(k),[t,e]}const D=y[0],G=N-D+1;let T=null;[d,T]=z(d,c,G*a);{const t=p.subarray(D,N+1);for(const[e,n]of t.entries())T[e]=n}let[,V]=z(d,c,G*a);{const t=m.subarray(D,N+1);for(const[e,n]of t.entries())V[e]=n}const J=y.subarray(1),Y=i.slice(1).slice(0,J.length);for(const[n,u]of J.entries()){let t=!1;const e=Y[n],s=n+1,i=s*G,l=P.subarray(u,N+1),c=b.subarray(u).subarray(0,l.length),f=V.subarray(i+u-D).subarray(0,l.length),h=V.subarray(i+u-D-1-G).subarray(0,l.length),d=T.subarray(i+u-D).subarray(0,l.length),g=T.subarray(i+u-D-1-G).subarray(0,l.length),p=T.subarray(i+u-D-1).subarray(0,l.length);p[0]=0;for(const[n,m]of l.entries()){const i=n+u;let l=0,y=0,P=0;if(y=t?p[n]+-1:p[n]+-3,e===m){l=g[n]+16;let t=c[n];P=h[n]+1,8===t?P=1:P>1&&(t=r(t,r(4,b[i-P+1]))),l+t<y?(l+=c[n],P=0):l+=t}f[n]=P,t=l<y;const w=r(r(l,y),0);s===a-1&&(o&&w>C||!o&&w>=C)&&(C=w,k=i),d[n]=w}}const Z=w(l);let H=D;if(l&&null!==Z){let t=a-1;H=k;let e=!0;for(;;){const n=t*G,r=H-D,o=T[n+r];let s=0,i=0;if(t>0&&H>=y[t]&&(s=T[n-G+r-1]),H>y[t]&&(i=T[n+r-1]),o>s&&(o>i||o===i&&e)){if(Z.add(H),0===t)break;t--}e=V[n+r]>1||n+G+r+1<V.length&&V[n+G+r+1]>0,H--}}return[{start:H,end:k+1,score:C},Z]};function F(t,e,o,s,i,l,c){let a=0,d=0,g=!1,p=0,m=0;const b=w(c);let y=0;i>0&&(y=C(o[i-1]));for(let P=i;P<l;P++){let i=o[P];const l=C(i);if(t||(i>=f&&i<=h?i+=32:i>u&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=n(i)),i===s[a]){c&&null!==b&&b.add(P),d+=16;let t=v(y,l);0===p?m=t:(8===t&&(m=t),t=r(r(t,m),4)),d+=0===a?2*t:t,g=!1,p++,a++}else d+=g?-1:-3,g=!0,p=0,m=0;y=l}return[d,b]}const O=(t,e,r,o,s,i,l)=>{if(0===s.length)return[{start:0,end:0,score:0},null];if(E(o,s,t)<0)return[{start:-1,end:-1,score:0},null];let c=0,a=-1,d=-1;const g=o.length,p=s.length;for(let m=0;m<g;m++){let i=o[b(m,g,r)];t||(i>=f&&i<=h?i+=32:i>u&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=n(i));if(i===s[b(c,p,r)]&&(a<0&&(a=m),c++,c===p)){d=m+1;break}}if(a>=0&&d>=0){c--;for(let e=d-1;e>=a;e--){let n=o[b(e,g,r)];t||(n>=f&&n<=h?n+=32:n>u&&(n=String.fromCodePoint(n).toLowerCase().codePointAt(0)));if(n===s[b(c,p,r)]&&(c--,c<0)){a=e;break}}if(!r){const t=a;a=g-d,d=g-t}const[n,l]=F(t,e,o,s,a,d,i);return[{start:a,end:d,score:n},l]}return[{start:-1,end:-1,score:0},null]},R=(t,e,r,o,s,i,l)=>{if(0===s.length)return[{start:0,end:0,score:0},null];const c=o.length,a=s.length;if(c<a)return[{start:-1,end:-1,score:0},null];if(E(o,s,t)<0)return[{start:-1,end:-1,score:0},null];let d=0,g=-1,p=0,m=-1;for(let w=0;w<c;w++){const i=b(w,c,r);let l=o[i];t||(l>=f&&l<=h?l+=32:l>u&&(l=String.fromCodePoint(l).toLowerCase().codePointAt(0))),e&&(l=n(l));const z=b(d,a,r);if(s[z]===l){if(0===z&&(y=o,p=0===(P=i)?8:v(C(y[P-1]),C(y[P]))),d++,d===a){if(p>m&&(g=w,m=p),8===p)break;w-=d-1,d=0,p=0}}else w-=d,d=0,p=0}var y,P;if(g>=0){let n=0,i=0;r?(n=g-a+1,i=g+1):(n=c-(g+1),i=c-(g-a+1));const[l]=F(t,e,o,s,n,i,!1);return[{start:n,end:i,score:l},null]}return[{start:-1,end:-1,score:0},null]};const W=(j=2048,{i16:new Int16Array(102400),i32:new Int32Array(j)});var j,I,q;(q=I||(I={}))[q.Fuzzy=0]="Fuzzy",q[q.Exact=1]="Exact",q[q.Prefix=2]="Prefix",q[q.Suffix=3]="Suffix",q[q.Equal=4]="Equal";const U={0:N,1:R,2:(t,e,r,o,s,i,a)=>{if(0===s.length)return[{start:0,end:0,score:0},null];let u=0;if(l(s[0])||(u=c(o)),o.length-u<s.length)return[{start:-1,end:-1,score:0},null];for(const[l,c]of s.entries()){let r=o[u+l];if(t||(r=String.fromCodePoint(r).toLowerCase().codePointAt(0)),e&&(r=n(r)),r!==c)return[{start:-1,end:-1,score:0},null]}const f=s.length,[h]=F(t,e,o,s,u,u+f,!1);return[{start:u,end:u+f,score:h},null]},3:(t,e,r,o,s,i,c)=>{let u=o.length;if(0!==s.length&&l(s[s.length-1])||(u-=a(o)),0===s.length)return[{start:u,end:u,score:0},null];const f=u-s.length;if(f<0)return[{start:-1,end:-1,score:0},null];for(const[l,a]of s.entries()){let r=o[l+f];if(t||(r=String.fromCodePoint(r).toLowerCase().codePointAt(0)),e&&(r=n(r)),r!==a)return[{start:-1,end:-1,score:0},null]}const h=u-s.length,d=u,[g]=F(t,e,o,s,h,d,!1);return[{start:h,end:d,score:g},null]},4:(t,e,r,o,i,u,f)=>{const h=i.length;if(0===h)return[{start:-1,end:-1,score:0},null];let d=0;l(i[0])||(d=c(o));let g=0;if(l(i[h-1])||(g=a(o)),o.length-d-g!=h)return[{start:-1,end:-1,score:0},null];let p=!0;if(e){const e=o;for(const[r,o]of i.entries()){let s=e[d+r];if(t||(s=String.fromCodePoint(s).toLowerCase().codePointAt(0)),n(o)!==n(s)){p=!1;break}}}else{let e=s(o).substring(d,o.length-g);t||(e=e.toLowerCase()),p=e===s(i)}return p?[{start:d,end:d+h,score:24*h+8},null]:[{start:-1,end:-1,score:0},null]}};function B(t,e,r,i){let l=!0;{const t=(i=i.trimLeft()).trimRight();i=t.endsWith("\\")&&" "===i[t.length]?t+" ":t}let c=!1,a=[];a=function(t,e,r,i){const l=(i=i.replace(/\\ /g,"\t")).split(/ +/),c=[];let a=[],u=!1,f=!1;for(const h of l){let i=0,l=!1,d=h.replace(/\t/g," ");const g=d.toLowerCase(),p="case-sensitive"===e||"smart-case"===e&&d!==g,m=r&&g===s(o(g).map(n));if(p||(d=g),t||(i=1),a.length>0&&!f&&"|"===d)u=!1,f=!0;else if(f=!1,d.startsWith("!")&&(l=!0,i=1,d=d.substring(1)),"$"!==d&&d.endsWith("$")&&(i=3,d=d.substring(0,d.length-1)),d.startsWith("'")?(i=t&&!l?1:0,d=d.substring(1)):d.startsWith("^")&&(i=3===i?4:2,d=d.substring(1)),d.length>0){u&&(c.push(a),a=[]);let t=o(d);m&&(t=t.map(n)),a.push({typ:i,inv:l,text:t,caseSensitive:p,normalize:m}),u=!0}}a.length>0&&c.push(a);return c}(t,e,r,i);t:for(const n of a)for(const[e,r]of n.entries())if(r.inv||(c=!0),(!l||e>0||r.inv||t&&0!==r.typ||!t&&1!==r.typ)&&(l=!1,c))break t;return{str:i,termSets:a,sortable:c,cacheable:l,fuzzy:t}}function M(t,e,n,r,o,s,i){for(const l of e){const[e,c]=t(n,r,o,l.text,s,!0,i);if(e.start>=0){const t=e.start+l.prefixLength,n=e.end+l.prefixLength;if(null!==c){const r=new Set;return c.forEach((t=>r.add(l.prefixLength+t))),[[t,n],e.score,r]}return[[t,n],e.score,c]}}return[[-1,-1],0,null]}function D(t,e,n,r){const o=[{text:t,prefixLength:0}],s=[];let i=0;const l=new Set;for(const c of e.termSets){let t=[0,0],e=0,a=!1;for(const s of c){let i=U[s.typ];s.typ===I.Fuzzy&&(i=n);const[c,u,f]=M(i,o,s.caseSensitive,s.normalize,r,s.text,W);if(c[0]>=0){if(s.inv)continue;if(t=c,e=u,a=!0,null!==f)f.forEach((t=>l.add(t)));else for(let t=c[0];t<c[1];++t)l.add(t);break}s.inv&&(t=[0,0],e=0,a=!0)}a&&(s.push(t),i+=e)}return{offsets:s,totalScore:i,allPos:l}}function G(t){const{queryRunes:e,caseSensitive:r}=((t,e,r)=>{let s=!1;switch(e){case"smart-case":t.toLowerCase()!==t&&(s=!0);break;case"case-sensitive":s=!0;break;case"case-insensitive":t=t.toLowerCase(),s=!1}let i=o(t);return r&&(i=i.map(n)),{queryRunes:i,caseSensitive:s}})(t,this.opts.casing,this.opts.normalize),s={};for(let n=0,o=this.runesList.length;n<o;++n){const t=this.runesList[n];if(e.length>t.length)continue;let[o,i]=this.algoFn(r,this.opts.normalize,this.opts.forward,t,e,!0,W);if(-1===o.start)continue;if(!1===this.opts.fuzzy){i=new Set;for(let t=o.start;t<o.end;++t)i.add(t)}const l=this.opts.sort?o.score:0;void 0===s[l]&&(s[l]=[]),s[l].push({item:this.items[n],...o,positions:null!=i?i:new Set})}return V(s,this.opts.limit)}function T(t){const e=B(Boolean(this.opts.fuzzy),this.opts.casing,this.opts.normalize,t),n={};for(const[r,o]of this.runesList.entries()){const t=D(o,e,this.algoFn,this.opts.forward);if(t.offsets.length!==e.termSets.length)continue;let s=-1,i=-1;t.allPos.size>0&&(s=Math.min(...t.allPos),i=Math.max(...t.allPos)+1);const l=this.opts.sort?t.totalScore:0;void 0===n[l]&&(n[l]=[]),n[l].push({score:t.totalScore,item:this.items[r],positions:t.allPos,start:s,end:i})}return V(n,this.opts.limit)}function V(t,e){const n=Object.keys(t).map((t=>parseInt(t,10))).sort(((t,e)=>e-t)),r=[];for(const o of n)if(r.push(...t[o]),r.length>=e)break;return r}const J={limit:1/0,selector:t=>t,casing:"smart-case",normalize:!0,fuzzy:"v2",match:G,tiebreakers:[],sort:!0,forward:!0};class Y{constructor(t,...e){switch(this.opts={...J,...e[0]},this.items=t,this.runesList=t.map((t=>o(this.opts.selector(t).normalize()))),this.algoFn=R,this.opts.fuzzy){case"v2":this.algoFn=N;break;case"v1":this.algoFn=O}}find(t){t=t.normalize();let e=this.opts.match.bind(this)(t);if(this.opts.sort)for(const n of this.opts.tiebreakers)e.sort(((t,e)=>t.score===e.score?n(t,e,this.opts):0));return Number.isFinite(this.opts.limit)&&e.splice(this.opts.limit),e}}function Z(t,e,n){return n.selector(t.item).length-n.selector(e.item).length}function H(t,e){return t.start-e.start}class K{constructor(t,...e){this.finder=new Y(t,...e),this.find=this.finder.find.bind(this.finder)}}export{K as Fzf,G as basicMatch,Z as byLengthAsc,H as byStartAsc,T as extendedMatch}; | ||
const t={216:"O",223:"s",248:"o",273:"d",295:"h",305:"i",320:"l",322:"l",359:"t",383:"s",384:"b",385:"B",387:"b",390:"O",392:"c",393:"D",394:"D",396:"d",398:"E",400:"E",402:"f",403:"G",407:"I",409:"k",410:"l",412:"M",413:"N",414:"n",415:"O",421:"p",427:"t",429:"t",430:"T",434:"V",436:"y",438:"z",477:"e",485:"g",544:"N",545:"d",549:"z",564:"l",565:"n",566:"t",567:"j",570:"A",571:"C",572:"c",573:"L",574:"T",575:"s",576:"z",579:"B",580:"U",581:"V",582:"E",583:"e",584:"J",585:"j",586:"Q",587:"q",588:"R",589:"r",590:"Y",591:"y",592:"a",593:"a",595:"b",596:"o",597:"c",598:"d",599:"d",600:"e",603:"e",604:"e",605:"e",606:"e",607:"j",608:"g",609:"g",610:"G",613:"h",614:"h",616:"i",618:"I",619:"l",620:"l",621:"l",623:"m",624:"m",625:"m",626:"n",627:"n",628:"N",629:"o",633:"r",634:"r",635:"r",636:"r",637:"r",638:"r",639:"r",640:"R",641:"R",642:"s",647:"t",648:"t",649:"u",651:"v",652:"v",653:"w",654:"y",655:"Y",656:"z",657:"z",663:"c",665:"B",666:"e",667:"G",668:"H",669:"j",670:"k",671:"L",672:"q",686:"h",867:"a",868:"e",869:"i",870:"o",871:"u",872:"c",873:"d",874:"h",875:"m",876:"r",877:"t",878:"v",879:"x",7424:"A",7427:"B",7428:"C",7429:"D",7431:"E",7432:"e",7433:"i",7434:"J",7435:"K",7436:"L",7437:"M",7438:"N",7439:"O",7440:"O",7441:"o",7442:"o",7443:"o",7446:"o",7447:"o",7448:"P",7449:"R",7450:"R",7451:"T",7452:"U",7453:"u",7454:"u",7455:"m",7456:"V",7457:"W",7458:"Z",7522:"i",7523:"r",7524:"u",7525:"v",7834:"a",7835:"s",8305:"i",8341:"h",8342:"k",8343:"l",8344:"m",8345:"n",8346:"p",8347:"s",8348:"t",8580:"c"};for(let at="̀".codePointAt(0);at<="ͯ".codePointAt(0);++at){const e=String.fromCodePoint(at);for(const n of"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"){const r=(n+e).normalize().codePointAt(0);r>126&&(t[r]=n)}}const e={a:[7844,7863],e:[7870,7879],o:[7888,7907],u:[7912,7921]};for(const at of Object.keys(e)){const n=at.toUpperCase();for(let r=e[at][0];r<=e[at][1];++r)t[r]=r%2==0?n:at}function n(e){if(e<192||e>8580)return e;const n=t[e];return void 0!==n?n.codePointAt(0):e}function r(t,e){return t>e?t:e}const s=t=>t.split("").map((t=>t.codePointAt(0))),o=t=>t.map((t=>String.fromCodePoint(t))).join(""),i=new Set(" \f\n\r\t\v \u2028\u2029 \ufeff".split("").map((t=>t.codePointAt(0))));for(let at=" ".codePointAt(0);at<=" ".codePointAt(0);at++)i.add(at);const l=t=>i.has(t),c=t=>{let e=0;for(const n of t){if(!l(n))break;e++}return e},a=t=>{let e=0;for(let n=t.length-1;n>=0&&l(t[n]);n--)e++;return e},u="".codePointAt(0),f="A".codePointAt(0),h="Z".codePointAt(0),d="a".codePointAt(0),g="z".codePointAt(0),m="0".codePointAt(0),p="9".codePointAt(0);function b(t,e,n){return n?t:e-t-1}var y,P;function w(t){return t?new Set:null}function z(t,e,n){if(null!==e&&e.i16.length>t+n){return[t+n,e.i16.subarray(t,t+n)]}return[t,new Int16Array(n)]}function L(t,e,n){if(null!==e&&e.i32.length>t+n){return[t+n,e.i32.subarray(t,t+n)]}return[t,new Int32Array(n)]}function S(t){return t>=d&&t<=g?1:t>=f&&t<=h?2:t>=m&&t<=p?4:0}function A(t){const e=String.fromCodePoint(t);return e!==e.toUpperCase()?1:e!==e.toLowerCase()?2:null!==e.match(/\p{Number}/gu)?4:null!==e.match(/\p{Letter}/gu)?3:0}function C(t){return t<=u?S(t):A(t)}function v(t,e){return 0===t&&0!==e?8:1===t&&2===e||4!==t&&4===e?7:0===e?8:0}function k(t,e,n,r){let s=t.slice(r),o=s.indexOf(n);if(0===o)return r;if(!e&&n>=d&&n<=g){o>0&&(s=s.slice(0,o));const t=s.indexOf(n-32);t>=0&&(o=t)}return o<0?-1:r+o}function x(t){for(const e of t)if(e>=128)return!1;return!0}function E(t,e,n){if(!x(t))return 0;if(!x(e))return-1;let r=0,s=0;for(let o=0;o<e.length;o++){if(s=k(t,n,e[o],s),s<0)return-1;0===o&&s>0&&(r=s-1),s++}return r}(P=y||(y={}))[P.NonWord=0]="NonWord",P[P.Lower=1]="Lower",P[P.Upper=2]="Upper",P[P.Letter=3]="Letter",P[P.Number=4]="Number";const N=(t,e,s,o,i,l,c)=>{const a=i.length;if(0===a)return[{start:0,end:0,score:0},w(l)];const f=o.length;if(null!==c&&f*a>c.i16.length)return O(t,e,s,o,i,l);const h=E(o,i,t);if(h<0)return[{start:-1,end:-1,score:0},null];let d=0,g=0,m=null,p=null,b=null,y=null;[d,m]=z(d,c,f),[d,p]=z(d,c,f),[d,b]=z(d,c,f),[g,y]=L(g,c,a);const[,P]=L(g,c,f);for(let n=0;n<P.length;n++)P[n]=o[n];let C=0,k=0,x=0,N=0;const F=i[0];let R=i[0],q=0,I=0,W=!1,j=P.subarray(h),M=m.subarray(h).subarray(0,j.length),B=p.subarray(h).subarray(0,j.length),U=b.subarray(h).subarray(0,j.length);for(let[w,z]of j.entries()){let o=null;z<=u?(o=S(z),t||2!==o||(z+=32)):(o=A(z),t||2!==o||(z=String.fromCodePoint(z).toLowerCase().codePointAt(0)),e&&(z=n(z))),j[w]=z;const l=v(I,o);if(U[w]=l,I=o,z===R&&(x<a&&(y[x]=h+w,x++,R=i[Math.min(x,a-1)]),N=h+w),z===F){const t=16+2*l;if(M[w]=t,B[w]=1,1===a&&(s&&t>C||!s&&t>=C)&&(C=t,k=h+w,s&&8===l))break;W=!1}else M[w]=r(W?q+-1:q+-3,0),B[w]=0,W=!0;q=M[w]}if(x!==a)return[{start:-1,end:-1,score:0},null];if(1===a){const t={start:k,end:k+1,score:C};if(!l)return[t,null];const e=new Set;return e.add(k),[t,e]}const T=y[0],D=N-T+1;let G=null;[d,G]=z(d,c,D*a);{const t=m.subarray(T,N+1);for(const[e,n]of t.entries())G[e]=n}let[,V]=z(d,c,D*a);{const t=p.subarray(T,N+1);for(const[e,n]of t.entries())V[e]=n}const J=y.subarray(1),Y=i.slice(1).slice(0,J.length);for(const[n,u]of J.entries()){let t=!1;const e=Y[n],o=n+1,i=o*D,l=P.subarray(u,N+1),c=b.subarray(u).subarray(0,l.length),f=V.subarray(i+u-T).subarray(0,l.length),h=V.subarray(i+u-T-1-D).subarray(0,l.length),d=G.subarray(i+u-T).subarray(0,l.length),g=G.subarray(i+u-T-1-D).subarray(0,l.length),m=G.subarray(i+u-T-1).subarray(0,l.length);m[0]=0;for(const[n,p]of l.entries()){const i=n+u;let l=0,y=0,P=0;if(y=t?m[n]+-1:m[n]+-3,e===p){l=g[n]+16;let t=c[n];P=h[n]+1,8===t?P=1:P>1&&(t=r(t,r(4,b[i-P+1]))),l+t<y?(l+=c[n],P=0):l+=t}f[n]=P,t=l<y;const w=r(r(l,y),0);o===a-1&&(s&&w>C||!s&&w>=C)&&(C=w,k=i),d[n]=w}}const Z=w(l);let H=T;if(l&&null!==Z){let t=a-1;H=k;let e=!0;for(;;){const n=t*D,r=H-T,s=G[n+r];let o=0,i=0;if(t>0&&H>=y[t]&&(o=G[n-D+r-1]),H>y[t]&&(i=G[n+r-1]),s>o&&(s>i||s===i&&e)){if(Z.add(H),0===t)break;t--}e=V[n+r]>1||n+D+r+1<V.length&&V[n+D+r+1]>0,H--}}return[{start:H,end:k+1,score:C},Z]};function F(t,e,s,o,i,l,c){let a=0,d=0,g=!1,m=0,p=0;const b=w(c);let y=0;i>0&&(y=C(s[i-1]));for(let P=i;P<l;P++){let i=s[P];const l=C(i);if(t||(i>=f&&i<=h?i+=32:i>u&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=n(i)),i===o[a]){c&&null!==b&&b.add(P),d+=16;let t=v(y,l);0===m?p=t:(8===t&&(p=t),t=r(r(t,p),4)),d+=0===a?2*t:t,g=!1,m++,a++}else d+=g?-1:-3,g=!0,m=0,p=0;y=l}return[d,b]}const O=(t,e,r,s,o,i,l)=>{if(0===o.length)return[{start:0,end:0,score:0},null];if(E(s,o,t)<0)return[{start:-1,end:-1,score:0},null];let c=0,a=-1,d=-1;const g=s.length,m=o.length;for(let p=0;p<g;p++){let i=s[b(p,g,r)];t||(i>=f&&i<=h?i+=32:i>u&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=n(i));if(i===o[b(c,m,r)]&&(a<0&&(a=p),c++,c===m)){d=p+1;break}}if(a>=0&&d>=0){c--;for(let e=d-1;e>=a;e--){let n=s[b(e,g,r)];t||(n>=f&&n<=h?n+=32:n>u&&(n=String.fromCodePoint(n).toLowerCase().codePointAt(0)));if(n===o[b(c,m,r)]&&(c--,c<0)){a=e;break}}if(!r){const t=a;a=g-d,d=g-t}const[n,l]=F(t,e,s,o,a,d,i);return[{start:a,end:d,score:n},l]}return[{start:-1,end:-1,score:0},null]},R=(t,e,r,s,o,i,l)=>{if(0===o.length)return[{start:0,end:0,score:0},null];const c=s.length,a=o.length;if(c<a)return[{start:-1,end:-1,score:0},null];if(E(s,o,t)<0)return[{start:-1,end:-1,score:0},null];let d=0,g=-1,m=0,p=-1;for(let w=0;w<c;w++){const i=b(w,c,r);let l=s[i];t||(l>=f&&l<=h?l+=32:l>u&&(l=String.fromCodePoint(l).toLowerCase().codePointAt(0))),e&&(l=n(l));const z=b(d,a,r);if(o[z]===l){if(0===z&&(y=s,m=0===(P=i)?8:v(C(y[P-1]),C(y[P]))),d++,d===a){if(m>p&&(g=w,p=m),8===m)break;w-=d-1,d=0,m=0}}else w-=d,d=0,m=0}var y,P;if(g>=0){let n=0,i=0;r?(n=g-a+1,i=g+1):(n=c-(g+1),i=c-(g-a+1));const[l]=F(t,e,s,o,n,i,!1);return[{start:n,end:i,score:l},null]}return[{start:-1,end:-1,score:0},null]};const q=(I=2048,{i16:new Int16Array(102400),i32:new Int32Array(I)});var I,W,j;(j=W||(W={}))[j.Fuzzy=0]="Fuzzy",j[j.Exact=1]="Exact",j[j.Prefix=2]="Prefix",j[j.Suffix=3]="Suffix",j[j.Equal=4]="Equal";const M={0:N,1:R,2:(t,e,r,s,o,i,a)=>{if(0===o.length)return[{start:0,end:0,score:0},null];let u=0;if(l(o[0])||(u=c(s)),s.length-u<o.length)return[{start:-1,end:-1,score:0},null];for(const[l,c]of o.entries()){let r=s[u+l];if(t||(r=String.fromCodePoint(r).toLowerCase().codePointAt(0)),e&&(r=n(r)),r!==c)return[{start:-1,end:-1,score:0},null]}const f=o.length,[h]=F(t,e,s,o,u,u+f,!1);return[{start:u,end:u+f,score:h},null]},3:(t,e,r,s,o,i,c)=>{let u=s.length;if(0!==o.length&&l(o[o.length-1])||(u-=a(s)),0===o.length)return[{start:u,end:u,score:0},null];const f=u-o.length;if(f<0)return[{start:-1,end:-1,score:0},null];for(const[l,a]of o.entries()){let r=s[l+f];if(t||(r=String.fromCodePoint(r).toLowerCase().codePointAt(0)),e&&(r=n(r)),r!==a)return[{start:-1,end:-1,score:0},null]}const h=u-o.length,d=u,[g]=F(t,e,s,o,h,d,!1);return[{start:h,end:d,score:g},null]},4:(t,e,r,s,i,u,f)=>{const h=i.length;if(0===h)return[{start:-1,end:-1,score:0},null];let d=0;l(i[0])||(d=c(s));let g=0;if(l(i[h-1])||(g=a(s)),s.length-d-g!=h)return[{start:-1,end:-1,score:0},null];let m=!0;if(e){const e=s;for(const[r,s]of i.entries()){let o=e[d+r];if(t||(o=String.fromCodePoint(o).toLowerCase().codePointAt(0)),n(s)!==n(o)){m=!1;break}}}else{let e=o(s).substring(d,s.length-g);t||(e=e.toLowerCase()),m=e===o(i)}return m?[{start:d,end:d+h,score:24*h+8},null]:[{start:-1,end:-1,score:0},null]}};function B(t,e,r,i){let l=!0;{const t=(i=i.trimLeft()).trimRight();i=t.endsWith("\\")&&" "===i[t.length]?t+" ":t}let c=!1,a=[];a=function(t,e,r,i){const l=(i=i.replace(/\\ /g,"\t")).split(/ +/),c=[];let a=[],u=!1,f=!1;for(const h of l){let i=0,l=!1,d=h.replace(/\t/g," ");const g=d.toLowerCase(),m="case-sensitive"===e||"smart-case"===e&&d!==g,p=r&&g===o(s(g).map(n));if(m||(d=g),t||(i=1),a.length>0&&!f&&"|"===d)u=!1,f=!0;else if(f=!1,d.startsWith("!")&&(l=!0,i=1,d=d.substring(1)),"$"!==d&&d.endsWith("$")&&(i=3,d=d.substring(0,d.length-1)),d.startsWith("'")?(i=t&&!l?1:0,d=d.substring(1)):d.startsWith("^")&&(i=3===i?4:2,d=d.substring(1)),d.length>0){u&&(c.push(a),a=[]);let t=s(d);p&&(t=t.map(n)),a.push({typ:i,inv:l,text:t,caseSensitive:m,normalize:p}),u=!0}}a.length>0&&c.push(a);return c}(t,e,r,i);t:for(const n of a)for(const[e,r]of n.entries())if(r.inv||(c=!0),(!l||e>0||r.inv||t&&0!==r.typ||!t&&1!==r.typ)&&(l=!1,c))break t;return{str:i,termSets:a,sortable:c,cacheable:l,fuzzy:t}}const U=(t,e,r)=>{let o=!1;switch(e){case"smart-case":t.toLowerCase()!==t&&(o=!0);break;case"case-sensitive":o=!0;break;case"case-insensitive":t=t.toLowerCase(),o=!1}let i=s(t);return r&&(i=i.map(n)),{queryRunes:i,caseSensitive:o}};function T(t,e,n,r,s,o,i){for(const l of e){const[e,c]=t(n,r,s,l.text,o,!0,i);if(e.start>=0){const t=e.start+l.prefixLength,n=e.end+l.prefixLength;if(null!==c){const r=new Set;return c.forEach((t=>r.add(l.prefixLength+t))),[[t,n],e.score,r]}return[[t,n],e.score,c]}}return[[-1,-1],0,null]}function D(t,e){const n=Object.keys(t).map((t=>parseInt(t,10))).sort(((t,e)=>e-t));let r=[];for(const s of n)if(r=r.concat(t[s]),r.length>=e)break;return r}function G(t,e,n){return r=>{const s=this.runesList[r];if(e.length>s.length)return;let[o,i]=this.algoFn(n,this.opts.normalize,this.opts.forward,s,e,!0,q);if(-1===o.start)return;if(!1===this.opts.fuzzy){i=new Set;for(let t=o.start;t<o.end;++t)i.add(t)}const l=this.opts.sort?o.score:0;void 0===t[l]&&(t[l]=[]),t[l].push({item:this.items[r],...o,positions:null!=i?i:new Set})}}function V(t,e){return n=>{const r=function(t,e,n,r){const s=[{text:t,prefixLength:0}],o=[];let i=0;const l=new Set;for(const c of e.termSets){let t=[0,0],e=0,a=!1;for(const o of c){let i=M[o.typ];o.typ===W.Fuzzy&&(i=n);const[c,u,f]=T(i,s,o.caseSensitive,o.normalize,r,o.text,q);if(c[0]>=0){if(o.inv)continue;if(t=c,e=u,a=!0,null!==f)f.forEach((t=>l.add(t)));else for(let t=c[0];t<c[1];++t)l.add(t);break}o.inv&&(t=[0,0],e=0,a=!0)}a&&(o.push(t),i+=e)}return{offsets:o,totalScore:i,allPos:l}}(this.runesList[n],e,this.algoFn,this.opts.forward);if(r.offsets.length!==e.termSets.length)return;let s=-1,o=-1;r.allPos.size>0&&(s=Math.min(...r.allPos),o=Math.max(...r.allPos)+1);const i=this.opts.sort?r.totalScore:0;void 0===t[i]&&(t[i]=[]),t[i].push({score:r.totalScore,item:this.items[n],positions:r.allPos,start:s,end:o})}}function J(t){const{queryRunes:e,caseSensitive:n}=U(t,this.opts.casing,this.opts.normalize),r={},s=G.bind(this)(r,e,n);for(let o=0,i=this.runesList.length;o<i;++o)s(o);return D(r,this.opts.limit)}function Y(t){const e=B(Boolean(this.opts.fuzzy),this.opts.casing,this.opts.normalize,t),n={},r=V.bind(this)(n,e);for(let s=0,o=this.runesList.length;s<o;++s)r(s);return D(n,this.opts.limit)}const Z="undefined"!=typeof require&&"undefined"==typeof window;function H(t,e,n,r){return new Promise(((s,o)=>{let i=0,l=Math.min(1e3,e);const c=()=>{if(t.cancelled)return o("search cancelled");for(;i<l;++i)n(i);l<e?(l=Math.min(l+1e3,e),Z?setImmediate(c):setTimeout(c)):s(r())};c()}))}function K(t,e){const{queryRunes:n,caseSensitive:r}=U(t,this.opts.casing,this.opts.normalize),s={};return H(e,this.runesList.length,G.bind(this)(s,n,r),(()=>D(s,this.opts.limit)))}function Q(t,e){const n=B(Boolean(this.opts.fuzzy),this.opts.casing,this.opts.normalize,t),r={};return H(e,this.runesList.length,V.bind(this)(r,n),(()=>D(r,this.opts.limit)))}const $={limit:1/0,selector:t=>t,casing:"smart-case",normalize:!0,fuzzy:"v2",tiebreakers:[],sort:!0,forward:!0};class X{constructor(t,...e){switch(this.opts={...$,...e[0]},this.items=t,this.runesList=t.map((t=>s(this.opts.selector(t).normalize()))),this.algoFn=R,this.opts.fuzzy){case"v2":this.algoFn=N;break;case"v1":this.algoFn=O}}}const _={...$,match:J};class tt extends X{constructor(t,...e){super(t,...e),this.opts={..._,...e[0]}}find(t){if(0===t.length||0===this.items.length)return this.items.slice(0,this.opts.limit).map(rt);return t=t.normalize(),st(this.opts.match.bind(this)(t),this.opts)}}const et={...$,match:K};class nt extends X{constructor(t,...e){super(t,...e),this.opts={...et,...e[0]},this.token={cancelled:!1}}async find(t){if(this.token.cancelled=!0,this.token={cancelled:!1},0===t.length||0===this.items.length)return this.items.slice(0,this.opts.limit).map(rt);return t=t.normalize(),st(await this.opts.match.bind(this)(t,this.token),this.opts)}}const rt=t=>({item:t,start:-1,end:-1,score:0,positions:new Set});function st(t,e){if(e.sort){const{selector:n}=e;t.sort(((t,r)=>{if(t.score===r.score)for(const s of e.tiebreakers){const e=s(t,r,n);if(0!==e)return e}return 0}))}return Number.isFinite(e.limit)&&t.splice(e.limit),t}function ot(t,e,n){return n(t.item).length-n(e.item).length}function it(t,e){return t.start-e.start}class lt{constructor(t,...e){this.finder=new tt(t,...e),this.find=this.finder.find.bind(this.finder)}}class ct{constructor(t,...e){this.finder=new nt(t,...e),this.find=this.finder.find.bind(this.finder)}}export{ct as AsyncFzf,lt as Fzf,K as asyncBasicMatch,Q as asyncExtendedMatch,J as basicMatch,ot as byLengthAsc,it as byStartAsc,Y as extendedMatch}; |
/** @license | ||
* fzf v0.4.1 | ||
* Copyright (c) 2021 Ajit | ||
* fzf v0.5.1 | ||
* Copyright (c) 2021-2022 Ajit | ||
* Licensed under BSD 3-Clause | ||
*/ | ||
var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,r)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,__spreadValues=(t,e)=>{for(var r in e||(e={}))__hasOwnProp.call(e,r)&&__defNormalProp(t,r,e[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(e))__propIsEnum.call(e,r)&&__defNormalProp(t,r,e[r]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).fzf={})}(this,(function(t){"use strict";const e={216:"O",223:"s",248:"o",273:"d",295:"h",305:"i",320:"l",322:"l",359:"t",383:"s",384:"b",385:"B",387:"b",390:"O",392:"c",393:"D",394:"D",396:"d",398:"E",400:"E",402:"f",403:"G",407:"I",409:"k",410:"l",412:"M",413:"N",414:"n",415:"O",421:"p",427:"t",429:"t",430:"T",434:"V",436:"y",438:"z",477:"e",485:"g",544:"N",545:"d",549:"z",564:"l",565:"n",566:"t",567:"j",570:"A",571:"C",572:"c",573:"L",574:"T",575:"s",576:"z",579:"B",580:"U",581:"V",582:"E",583:"e",584:"J",585:"j",586:"Q",587:"q",588:"R",589:"r",590:"Y",591:"y",592:"a",593:"a",595:"b",596:"o",597:"c",598:"d",599:"d",600:"e",603:"e",604:"e",605:"e",606:"e",607:"j",608:"g",609:"g",610:"G",613:"h",614:"h",616:"i",618:"I",619:"l",620:"l",621:"l",623:"m",624:"m",625:"m",626:"n",627:"n",628:"N",629:"o",633:"r",634:"r",635:"r",636:"r",637:"r",638:"r",639:"r",640:"R",641:"R",642:"s",647:"t",648:"t",649:"u",651:"v",652:"v",653:"w",654:"y",655:"Y",656:"z",657:"z",663:"c",665:"B",666:"e",667:"G",668:"H",669:"j",670:"k",671:"L",672:"q",686:"h",867:"a",868:"e",869:"i",870:"o",871:"u",872:"c",873:"d",874:"h",875:"m",876:"r",877:"t",878:"v",879:"x",7424:"A",7427:"B",7428:"C",7429:"D",7431:"E",7432:"e",7433:"i",7434:"J",7435:"K",7436:"L",7437:"M",7438:"N",7439:"O",7440:"O",7441:"o",7442:"o",7443:"o",7446:"o",7447:"o",7448:"P",7449:"R",7450:"R",7451:"T",7452:"U",7453:"u",7454:"u",7455:"m",7456:"V",7457:"W",7458:"Z",7522:"i",7523:"r",7524:"u",7525:"v",7834:"a",7835:"s",8305:"i",8341:"h",8342:"k",8343:"l",8344:"m",8345:"n",8346:"p",8347:"s",8348:"t",8580:"c"};for(let Z="̀".codePointAt(0);Z<="ͯ".codePointAt(0);++Z){const t=String.fromCodePoint(Z);for(const r of"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"){const n=(r+t).normalize().codePointAt(0);n>126&&(e[n]=r)}}const r={a:[7844,7863],e:[7870,7879],o:[7888,7907],u:[7912,7921]};for(const Z of Object.keys(r)){const t=Z.toUpperCase();for(let n=r[Z][0];n<=r[Z][1];++n)e[n]=n%2==0?t:Z}function n(t){if(t<192||t>8580)return t;const r=e[t];return void 0!==r?r.codePointAt(0):t}function o(t,e){return t>e?t:e}const s=t=>t.split("").map((t=>t.codePointAt(0))),i=t=>t.map((t=>String.fromCodePoint(t))).join(""),l=new Set(" \f\n\r\t\v \u2028\u2029 \ufeff".split("").map((t=>t.codePointAt(0))));for(let Z=" ".codePointAt(0);Z<=" ".codePointAt(0);Z++)l.add(Z);const a=t=>l.has(t),c=t=>{let e=0;for(const r of t){if(!a(r))break;e++}return e},u=t=>{let e=0;for(let r=t.length-1;r>=0&&a(t[r]);r--)e++;return e},f="".codePointAt(0),h="A".codePointAt(0),d="Z".codePointAt(0),p="a".codePointAt(0),g="z".codePointAt(0),b="0".codePointAt(0),m="9".codePointAt(0);function y(t,e,r){return r?t:e-t-1}const P=16;var _,w;function S(t){return t?new Set:null}function z(t,e,r){if(null!==e&&e.i16.length>t+r){return[t+r,e.i16.subarray(t,t+r)]}return[t,new Int16Array(r)]}function A(t,e,r){if(null!==e&&e.i32.length>t+r){return[t+r,e.i32.subarray(t,t+r)]}return[t,new Int32Array(r)]}function v(t){return t>=p&&t<=g?1:t>=h&&t<=d?2:t>=b&&t<=m?4:0}function L(t){const e=String.fromCodePoint(t);return e!==e.toUpperCase()?1:e!==e.toLowerCase()?2:null!==e.match(/\p{Number}/gu)?4:null!==e.match(/\p{Letter}/gu)?3:0}function C(t){return t<=f?v(t):L(t)}function O(t,e){return 0===t&&0!==e?8:1===t&&2===e||4!==t&&4===e?7:0===e?8:0}function x(t,e,r,n){let o=t.slice(n),s=o.indexOf(r);if(0===s)return n;if(!e&&r>=p&&r<=g){s>0&&(o=o.slice(0,s));const t=o.indexOf(r-32);t>=0&&(s=t)}return s<0?-1:n+s}function k(t){for(const e of t)if(e>=128)return!1;return!0}function j(t,e,r){if(!k(t))return 0;if(!k(e))return-1;let n=0,o=0;for(let s=0;s<e.length;s++){if(o=x(t,r,e[s],o),o<0)return-1;0===s&&o>0&&(n=o-1),o++}return n}(w=_||(_={}))[w.NonWord=0]="NonWord",w[w.Lower=1]="Lower",w[w.Upper=2]="Upper",w[w.Letter=3]="Letter",w[w.Number=4]="Number";const E=(t,e,r,s,i,l,a)=>{const c=i.length;if(0===c)return[{start:0,end:0,score:0},S(l)];const u=s.length;if(null!==a&&u*c>a.i16.length)return F(t,e,r,s,i,l);const h=j(s,i,t);if(h<0)return[{start:-1,end:-1,score:0},null];let d=0,p=0,g=null,b=null,m=null,y=null;[d,g]=z(d,a,u),[d,b]=z(d,a,u),[d,m]=z(d,a,u),[p,y]=A(p,a,c);const[,_]=A(p,a,u);for(let n=0;n<_.length;n++)_[n]=s[n];let w=0,C=0,x=0,k=0;const E=i[0];let N=i[0],I=0,M=0,R=!1,W=_.subarray(h),V=g.subarray(h).subarray(0,W.length),q=b.subarray(h).subarray(0,W.length),D=m.subarray(h).subarray(0,W.length);for(let[S,z]of W.entries()){let s=null;z<=f?(s=v(z),t||2!==s||(z+=32)):(s=L(z),t||2!==s||(z=String.fromCodePoint(z).toLowerCase().codePointAt(0)),e&&(z=n(z))),W[S]=z;const l=O(M,s);if(D[S]=l,M=s,z===N&&(x<c&&(y[x]=h+S,x++,N=i[Math.min(x,c-1)]),k=h+S),z===E){const t=P+2*l;if(V[S]=t,q[S]=1,1===c&&(r&&t>w||!r&&t>=w)&&(w=t,C=h+S,r&&8===l))break;R=!1}else V[S]=o(R?I+-1:I+-3,0),q[S]=0,R=!0;I=V[S]}if(x!==c)return[{start:-1,end:-1,score:0},null];if(1===c){const t={start:C,end:C+1,score:w};if(!l)return[t,null];const e=new Set;return e.add(C),[t,e]}const T=y[0],U=k-T+1;let B=null;[d,B]=z(d,a,U*c);{const t=g.subarray(T,k+1);for(const[e,r]of t.entries())B[e]=r}let[,G]=z(d,a,U*c);{const t=b.subarray(T,k+1);for(const[e,r]of t.entries())G[e]=r}const J=y.subarray(1),Y=i.slice(1).slice(0,J.length);for(const[n,f]of J.entries()){let t=!1;const e=Y[n],s=n+1,i=s*U,l=_.subarray(f,k+1),a=m.subarray(f).subarray(0,l.length),u=G.subarray(i+f-T).subarray(0,l.length),h=G.subarray(i+f-T-1-U).subarray(0,l.length),d=B.subarray(i+f-T).subarray(0,l.length),p=B.subarray(i+f-T-1-U).subarray(0,l.length),g=B.subarray(i+f-T-1).subarray(0,l.length);g[0]=0;for(const[n,b]of l.entries()){const i=n+f;let l=0,y=0,_=0;if(y=t?g[n]+-1:g[n]+-3,e===b){l=p[n]+P;let t=a[n];_=h[n]+1,8===t?_=1:_>1&&(t=o(t,o(4,m[i-_+1]))),l+t<y?(l+=a[n],_=0):l+=t}u[n]=_,t=l<y;const S=o(o(l,y),0);s===c-1&&(r&&S>w||!r&&S>=w)&&(w=S,C=i),d[n]=S}}const Z=S(l);let H=T;if(l&&null!==Z){let t=c-1;H=C;let e=!0;for(;;){const r=t*U,n=H-T,o=B[r+n];let s=0,i=0;if(t>0&&H>=y[t]&&(s=B[r-U+n-1]),H>y[t]&&(i=B[r+n-1]),o>s&&(o>i||o===i&&e)){if(Z.add(H),0===t)break;t--}e=G[r+n]>1||r+U+n+1<G.length&&G[r+U+n+1]>0,H--}}return[{start:H,end:C+1,score:w},Z]};function N(t,e,r,s,i,l,a){let c=0,u=0,p=!1,g=0,b=0;const m=S(a);let y=0;i>0&&(y=C(r[i-1]));for(let _=i;_<l;_++){let i=r[_];const l=C(i);if(t||(i>=h&&i<=d?i+=32:i>f&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=n(i)),i===s[c]){a&&null!==m&&m.add(_),u+=P;let t=O(y,l);0===g?b=t:(8===t&&(b=t),t=o(o(t,b),4)),u+=0===c?2*t:t,p=!1,g++,c++}else u+=p?-1:-3,p=!0,g=0,b=0;y=l}return[u,m]}const F=(t,e,r,o,s,i,l)=>{if(0===s.length)return[{start:0,end:0,score:0},null];if(j(o,s,t)<0)return[{start:-1,end:-1,score:0},null];let a=0,c=-1,u=-1;const p=o.length,g=s.length;for(let b=0;b<p;b++){let i=o[y(b,p,r)];t||(i>=h&&i<=d?i+=32:i>f&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=n(i));if(i===s[y(a,g,r)]&&(c<0&&(c=b),a++,a===g)){u=b+1;break}}if(c>=0&&u>=0){a--;for(let e=u-1;e>=c;e--){let n=o[y(e,p,r)];t||(n>=h&&n<=d?n+=32:n>f&&(n=String.fromCodePoint(n).toLowerCase().codePointAt(0)));if(n===s[y(a,g,r)]&&(a--,a<0)){c=e;break}}if(!r){const t=c;c=p-u,u=p-t}const[n,l]=N(t,e,o,s,c,u,i);return[{start:c,end:u,score:n},l]}return[{start:-1,end:-1,score:0},null]},I=(t,e,r,o,s,i,l)=>{if(0===s.length)return[{start:0,end:0,score:0},null];const a=o.length,c=s.length;if(a<c)return[{start:-1,end:-1,score:0},null];if(j(o,s,t)<0)return[{start:-1,end:-1,score:0},null];let u=0,p=-1,g=0,b=-1;for(let _=0;_<a;_++){const i=y(_,a,r);let l=o[i];t||(l>=h&&l<=d?l+=32:l>f&&(l=String.fromCodePoint(l).toLowerCase().codePointAt(0))),e&&(l=n(l));const w=y(u,c,r);if(s[w]===l){if(0===w&&(m=o,g=0===(P=i)?8:O(C(m[P-1]),C(m[P]))),u++,u===c){if(g>b&&(p=_,b=g),8===g)break;_-=u-1,u=0,g=0}}else _-=u,u=0,g=0}var m,P;if(p>=0){let n=0,i=0;r?(n=p-c+1,i=p+1):(n=a-(p+1),i=a-(p-c+1));const[l]=N(t,e,o,s,n,i,!1);return[{start:n,end:i,score:l},null]}return[{start:-1,end:-1,score:0},null]};const M=(R=2048,{i16:new Int16Array(102400),i32:new Int32Array(R)});var R,W,V;(V=W||(W={}))[V.Fuzzy=0]="Fuzzy",V[V.Exact=1]="Exact",V[V.Prefix=2]="Prefix",V[V.Suffix=3]="Suffix",V[V.Equal=4]="Equal";const q={0:E,1:I,2:(t,e,r,o,s,i,l)=>{if(0===s.length)return[{start:0,end:0,score:0},null];let u=0;if(a(s[0])||(u=c(o)),o.length-u<s.length)return[{start:-1,end:-1,score:0},null];for(const[a,c]of s.entries()){let r=o[u+a];if(t||(r=String.fromCodePoint(r).toLowerCase().codePointAt(0)),e&&(r=n(r)),r!==c)return[{start:-1,end:-1,score:0},null]}const f=s.length,[h]=N(t,e,o,s,u,u+f,!1);return[{start:u,end:u+f,score:h},null]},3:(t,e,r,o,s,i,l)=>{let c=o.length;if(0!==s.length&&a(s[s.length-1])||(c-=u(o)),0===s.length)return[{start:c,end:c,score:0},null];const f=c-s.length;if(f<0)return[{start:-1,end:-1,score:0},null];for(const[a,u]of s.entries()){let r=o[a+f];if(t||(r=String.fromCodePoint(r).toLowerCase().codePointAt(0)),e&&(r=n(r)),r!==u)return[{start:-1,end:-1,score:0},null]}const h=c-s.length,d=c,[p]=N(t,e,o,s,h,d,!1);return[{start:h,end:d,score:p},null]},4:(t,e,r,o,s,l,f)=>{const h=s.length;if(0===h)return[{start:-1,end:-1,score:0},null];let d=0;a(s[0])||(d=c(o));let p=0;if(a(s[h-1])||(p=u(o)),o.length-d-p!=h)return[{start:-1,end:-1,score:0},null];let g=!0;if(e){const e=o;for(const[r,o]of s.entries()){let s=e[d+r];if(t||(s=String.fromCodePoint(s).toLowerCase().codePointAt(0)),n(o)!==n(s)){g=!1;break}}}else{let e=i(o).substring(d,o.length-p);t||(e=e.toLowerCase()),g=e===i(s)}return g?[{start:d,end:d+h,score:24*h+8},null]:[{start:-1,end:-1,score:0},null]}};function D(t,e,r,o){let l=!0;{const t=(o=o.trimLeft()).trimRight();o=t.endsWith("\\")&&" "===o[t.length]?t+" ":t}let a=!1,c=[];c=function(t,e,r,o){const l=(o=o.replace(/\\ /g,"\t")).split(/ +/),a=[];let c=[],u=!1,f=!1;for(const h of l){let o=0,l=!1,d=h.replace(/\t/g," ");const p=d.toLowerCase(),g="case-sensitive"===e||"smart-case"===e&&d!==p,b=r&&p===i(s(p).map(n));if(g||(d=p),t||(o=1),c.length>0&&!f&&"|"===d)u=!1,f=!0;else if(f=!1,d.startsWith("!")&&(l=!0,o=1,d=d.substring(1)),"$"!==d&&d.endsWith("$")&&(o=3,d=d.substring(0,d.length-1)),d.startsWith("'")?(o=t&&!l?1:0,d=d.substring(1)):d.startsWith("^")&&(o=3===o?4:2,d=d.substring(1)),d.length>0){u&&(a.push(c),c=[]);let t=s(d);b&&(t=t.map(n)),c.push({typ:o,inv:l,text:t,caseSensitive:g,normalize:b}),u=!0}}c.length>0&&a.push(c);return a}(t,e,r,o);t:for(const n of c)for(const[e,r]of n.entries())if(r.inv||(a=!0),(!l||e>0||r.inv||t&&0!==r.typ||!t&&1!==r.typ)&&(l=!1,a))break t;return{str:o,termSets:c,sortable:a,cacheable:l,fuzzy:t}}function T(t,e,r,n,o,s,i){for(const l of e){const[e,a]=t(r,n,o,l.text,s,!0,i);if(e.start>=0){const t=e.start+l.prefixLength,r=e.end+l.prefixLength;if(null!==a){const n=new Set;return a.forEach((t=>n.add(l.prefixLength+t))),[[t,r],e.score,n]}return[[t,r],e.score,a]}}return[[-1,-1],0,null]}function U(t,e,r,n){const o=[{text:t,prefixLength:0}],s=[];let i=0;const l=new Set;for(const a of e.termSets){let t=[0,0],e=0,c=!1;for(const s of a){let i=q[s.typ];s.typ===W.Fuzzy&&(i=r);const[a,u,f]=T(i,o,s.caseSensitive,s.normalize,n,s.text,M);if(a[0]>=0){if(s.inv)continue;if(t=a,e=u,c=!0,null!==f)f.forEach((t=>l.add(t)));else for(let t=a[0];t<a[1];++t)l.add(t);break}s.inv&&(t=[0,0],e=0,c=!0)}c&&(s.push(t),i+=e)}return{offsets:s,totalScore:i,allPos:l}}function B(t){const{queryRunes:e,caseSensitive:r}=((t,e,r)=>{let o=!1;switch(e){case"smart-case":t.toLowerCase()!==t&&(o=!0);break;case"case-sensitive":o=!0;break;case"case-insensitive":t=t.toLowerCase(),o=!1}let i=s(t);return r&&(i=i.map(n)),{queryRunes:i,caseSensitive:o}})(t,this.opts.casing,this.opts.normalize),o={};for(let n=0,s=this.runesList.length;n<s;++n){const t=this.runesList[n];if(e.length>t.length)continue;let[s,i]=this.algoFn(r,this.opts.normalize,this.opts.forward,t,e,!0,M);if(-1===s.start)continue;if(!1===this.opts.fuzzy){i=new Set;for(let t=s.start;t<s.end;++t)i.add(t)}const l=this.opts.sort?s.score:0;void 0===o[l]&&(o[l]=[]),o[l].push(__spreadProps(__spreadValues({item:this.items[n]},s),{positions:null!=i?i:new Set}))}return G(o,this.opts.limit)}function G(t,e){const r=Object.keys(t).map((t=>parseInt(t,10))).sort(((t,e)=>e-t)),n=[];for(const o of r)if(n.push(...t[o]),n.length>=e)break;return n}const J={limit:1/0,selector:t=>t,casing:"smart-case",normalize:!0,fuzzy:"v2",match:B,tiebreakers:[],sort:!0,forward:!0};class Y{constructor(t,...e){switch(this.opts=__spreadValues(__spreadValues({},J),e[0]),this.items=t,this.runesList=t.map((t=>s(this.opts.selector(t).normalize()))),this.algoFn=I,this.opts.fuzzy){case"v2":this.algoFn=E;break;case"v1":this.algoFn=F}}find(t){t=t.normalize();let e=this.opts.match.bind(this)(t);if(this.opts.sort)for(const r of this.opts.tiebreakers)e.sort(((t,e)=>t.score===e.score?r(t,e,this.opts):0));return Number.isFinite(this.opts.limit)&&e.splice(this.opts.limit),e}}t.Fzf=class{constructor(t,...e){this.finder=new Y(t,...e),this.find=this.finder.find.bind(this.finder)}},t.basicMatch=B,t.byLengthAsc=function(t,e,r){return r.selector(t.item).length-r.selector(e.item).length},t.byStartAsc=function(t,e){return t.start-e.start},t.extendedMatch=function(t){const e=D(Boolean(this.opts.fuzzy),this.opts.casing,this.opts.normalize,t),r={};for(const[n,o]of this.runesList.entries()){const t=U(o,e,this.algoFn,this.opts.forward);if(t.offsets.length!==e.termSets.length)continue;let s=-1,i=-1;t.allPos.size>0&&(s=Math.min(...t.allPos),i=Math.max(...t.allPos)+1);const l=this.opts.sort?t.totalScore:0;void 0===r[l]&&(r[l]=[]),r[l].push({score:t.totalScore,item:this.items[n],positions:t.allPos,start:s,end:i})}return G(r,this.opts.limit)},Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"})); | ||
var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,n)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,__spreadValues=(t,e)=>{for(var n in e||(e={}))__hasOwnProp.call(e,n)&&__defNormalProp(t,n,e[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))__propIsEnum.call(e,n)&&__defNormalProp(t,n,e[n]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).fzf={})}(this,(function(t){"use strict";const e={216:"O",223:"s",248:"o",273:"d",295:"h",305:"i",320:"l",322:"l",359:"t",383:"s",384:"b",385:"B",387:"b",390:"O",392:"c",393:"D",394:"D",396:"d",398:"E",400:"E",402:"f",403:"G",407:"I",409:"k",410:"l",412:"M",413:"N",414:"n",415:"O",421:"p",427:"t",429:"t",430:"T",434:"V",436:"y",438:"z",477:"e",485:"g",544:"N",545:"d",549:"z",564:"l",565:"n",566:"t",567:"j",570:"A",571:"C",572:"c",573:"L",574:"T",575:"s",576:"z",579:"B",580:"U",581:"V",582:"E",583:"e",584:"J",585:"j",586:"Q",587:"q",588:"R",589:"r",590:"Y",591:"y",592:"a",593:"a",595:"b",596:"o",597:"c",598:"d",599:"d",600:"e",603:"e",604:"e",605:"e",606:"e",607:"j",608:"g",609:"g",610:"G",613:"h",614:"h",616:"i",618:"I",619:"l",620:"l",621:"l",623:"m",624:"m",625:"m",626:"n",627:"n",628:"N",629:"o",633:"r",634:"r",635:"r",636:"r",637:"r",638:"r",639:"r",640:"R",641:"R",642:"s",647:"t",648:"t",649:"u",651:"v",652:"v",653:"w",654:"y",655:"Y",656:"z",657:"z",663:"c",665:"B",666:"e",667:"G",668:"H",669:"j",670:"k",671:"L",672:"q",686:"h",867:"a",868:"e",869:"i",870:"o",871:"u",872:"c",873:"d",874:"h",875:"m",876:"r",877:"t",878:"v",879:"x",7424:"A",7427:"B",7428:"C",7429:"D",7431:"E",7432:"e",7433:"i",7434:"J",7435:"K",7436:"L",7437:"M",7438:"N",7439:"O",7440:"O",7441:"o",7442:"o",7443:"o",7446:"o",7447:"o",7448:"P",7449:"R",7450:"R",7451:"T",7452:"U",7453:"u",7454:"u",7455:"m",7456:"V",7457:"W",7458:"Z",7522:"i",7523:"r",7524:"u",7525:"v",7834:"a",7835:"s",8305:"i",8341:"h",8342:"k",8343:"l",8344:"m",8345:"n",8346:"p",8347:"s",8348:"t",8580:"c"};for(let ot="̀".codePointAt(0);ot<="ͯ".codePointAt(0);++ot){const t=String.fromCodePoint(ot);for(const n of"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"){const r=(n+t).normalize().codePointAt(0);r>126&&(e[r]=n)}}const n={a:[7844,7863],e:[7870,7879],o:[7888,7907],u:[7912,7921]};for(const ot of Object.keys(n)){const t=ot.toUpperCase();for(let r=n[ot][0];r<=n[ot][1];++r)e[r]=r%2==0?t:ot}function r(t){if(t<192||t>8580)return t;const n=e[t];return void 0!==n?n.codePointAt(0):t}function s(t,e){return t>e?t:e}const o=t=>t.split("").map((t=>t.codePointAt(0))),i=t=>t.map((t=>String.fromCodePoint(t))).join(""),l=new Set(" \f\n\r\t\v \u2028\u2029 \ufeff".split("").map((t=>t.codePointAt(0))));for(let ot=" ".codePointAt(0);ot<=" ".codePointAt(0);ot++)l.add(ot);const a=t=>l.has(t),c=t=>{let e=0;for(const n of t){if(!a(n))break;e++}return e},u=t=>{let e=0;for(let n=t.length-1;n>=0&&a(t[n]);n--)e++;return e},f="".codePointAt(0),h="A".codePointAt(0),d="Z".codePointAt(0),p="a".codePointAt(0),g="z".codePointAt(0),m="0".codePointAt(0),b="9".codePointAt(0);function y(t,e,n){return n?t:e-t-1}const P=16;var _,w;function z(t){return t?new Set:null}function S(t,e,n){if(null!==e&&e.i16.length>t+n){return[t+n,e.i16.subarray(t,t+n)]}return[t,new Int16Array(n)]}function L(t,e,n){if(null!==e&&e.i32.length>t+n){return[t+n,e.i32.subarray(t,t+n)]}return[t,new Int32Array(n)]}function A(t){return t>=p&&t<=g?1:t>=h&&t<=d?2:t>=m&&t<=b?4:0}function v(t){const e=String.fromCodePoint(t);return e!==e.toUpperCase()?1:e!==e.toLowerCase()?2:null!==e.match(/\p{Number}/gu)?4:null!==e.match(/\p{Letter}/gu)?3:0}function C(t){return t<=f?A(t):v(t)}function O(t,e){return 0===t&&0!==e?8:1===t&&2===e||4!==t&&4===e?7:0===e?8:0}function x(t,e,n,r){let s=t.slice(r),o=s.indexOf(n);if(0===o)return r;if(!e&&n>=p&&n<=g){o>0&&(s=s.slice(0,o));const t=s.indexOf(n-32);t>=0&&(o=t)}return o<0?-1:r+o}function k(t){for(const e of t)if(e>=128)return!1;return!0}function j(t,e,n){if(!k(t))return 0;if(!k(e))return-1;let r=0,s=0;for(let o=0;o<e.length;o++){if(s=x(t,n,e[o],s),s<0)return-1;0===o&&s>0&&(r=s-1),s++}return r}(w=_||(_={}))[w.NonWord=0]="NonWord",w[w.Lower=1]="Lower",w[w.Upper=2]="Upper",w[w.Letter=3]="Letter",w[w.Number=4]="Number";const E=(t,e,n,o,i,l,a)=>{const c=i.length;if(0===c)return[{start:0,end:0,score:0},z(l)];const u=o.length;if(null!==a&&u*c>a.i16.length)return N(t,e,n,o,i,l);const h=j(o,i,t);if(h<0)return[{start:-1,end:-1,score:0},null];let d=0,p=0,g=null,m=null,b=null,y=null;[d,g]=S(d,a,u),[d,m]=S(d,a,u),[d,b]=S(d,a,u),[p,y]=L(p,a,c);const[,_]=L(p,a,u);for(let r=0;r<_.length;r++)_[r]=o[r];let w=0,C=0,x=0,k=0;const E=i[0];let M=i[0],V=0,F=0,I=!1,R=_.subarray(h),q=g.subarray(h).subarray(0,R.length),W=m.subarray(h).subarray(0,R.length),B=b.subarray(h).subarray(0,R.length);for(let[z,S]of R.entries()){let o=null;S<=f?(o=A(S),t||2!==o||(S+=32)):(o=v(S),t||2!==o||(S=String.fromCodePoint(S).toLowerCase().codePointAt(0)),e&&(S=r(S))),R[z]=S;const l=O(F,o);if(B[z]=l,F=o,S===M&&(x<c&&(y[x]=h+z,x++,M=i[Math.min(x,c-1)]),k=h+z),S===E){const t=P+2*l;if(q[z]=t,W[z]=1,1===c&&(n&&t>w||!n&&t>=w)&&(w=t,C=h+z,n&&8===l))break;I=!1}else q[z]=s(I?V+-1:V+-3,0),W[z]=0,I=!0;V=q[z]}if(x!==c)return[{start:-1,end:-1,score:0},null];if(1===c){const t={start:C,end:C+1,score:w};if(!l)return[t,null];const e=new Set;return e.add(C),[t,e]}const T=y[0],D=k-T+1;let U=null;[d,U]=S(d,a,D*c);{const t=g.subarray(T,k+1);for(const[e,n]of t.entries())U[e]=n}let[,G]=S(d,a,D*c);{const t=m.subarray(T,k+1);for(const[e,n]of t.entries())G[e]=n}const J=y.subarray(1),Y=i.slice(1).slice(0,J.length);for(const[r,f]of J.entries()){let t=!1;const e=Y[r],o=r+1,i=o*D,l=_.subarray(f,k+1),a=b.subarray(f).subarray(0,l.length),u=G.subarray(i+f-T).subarray(0,l.length),h=G.subarray(i+f-T-1-D).subarray(0,l.length),d=U.subarray(i+f-T).subarray(0,l.length),p=U.subarray(i+f-T-1-D).subarray(0,l.length),g=U.subarray(i+f-T-1).subarray(0,l.length);g[0]=0;for(const[r,m]of l.entries()){const i=r+f;let l=0,y=0,_=0;if(y=t?g[r]+-1:g[r]+-3,e===m){l=p[r]+P;let t=a[r];_=h[r]+1,8===t?_=1:_>1&&(t=s(t,s(4,b[i-_+1]))),l+t<y?(l+=a[r],_=0):l+=t}u[r]=_,t=l<y;const z=s(s(l,y),0);o===c-1&&(n&&z>w||!n&&z>=w)&&(w=z,C=i),d[r]=z}}const Z=z(l);let H=T;if(l&&null!==Z){let t=c-1;H=C;let e=!0;for(;;){const n=t*D,r=H-T,s=U[n+r];let o=0,i=0;if(t>0&&H>=y[t]&&(o=U[n-D+r-1]),H>y[t]&&(i=U[n+r-1]),s>o&&(s>i||s===i&&e)){if(Z.add(H),0===t)break;t--}e=G[n+r]>1||n+D+r+1<G.length&&G[n+D+r+1]>0,H--}}return[{start:H,end:C+1,score:w},Z]};function M(t,e,n,o,i,l,a){let c=0,u=0,p=!1,g=0,m=0;const b=z(a);let y=0;i>0&&(y=C(n[i-1]));for(let _=i;_<l;_++){let i=n[_];const l=C(i);if(t||(i>=h&&i<=d?i+=32:i>f&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=r(i)),i===o[c]){a&&null!==b&&b.add(_),u+=P;let t=O(y,l);0===g?m=t:(8===t&&(m=t),t=s(s(t,m),4)),u+=0===c?2*t:t,p=!1,g++,c++}else u+=p?-1:-3,p=!0,g=0,m=0;y=l}return[u,b]}const N=(t,e,n,s,o,i,l)=>{if(0===o.length)return[{start:0,end:0,score:0},null];if(j(s,o,t)<0)return[{start:-1,end:-1,score:0},null];let a=0,c=-1,u=-1;const p=s.length,g=o.length;for(let m=0;m<p;m++){let i=s[y(m,p,n)];t||(i>=h&&i<=d?i+=32:i>f&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=r(i));if(i===o[y(a,g,n)]&&(c<0&&(c=m),a++,a===g)){u=m+1;break}}if(c>=0&&u>=0){a--;for(let e=u-1;e>=c;e--){let r=s[y(e,p,n)];t||(r>=h&&r<=d?r+=32:r>f&&(r=String.fromCodePoint(r).toLowerCase().codePointAt(0)));if(r===o[y(a,g,n)]&&(a--,a<0)){c=e;break}}if(!n){const t=c;c=p-u,u=p-t}const[r,l]=M(t,e,s,o,c,u,i);return[{start:c,end:u,score:r},l]}return[{start:-1,end:-1,score:0},null]},V=(t,e,n,s,o,i,l)=>{if(0===o.length)return[{start:0,end:0,score:0},null];const a=s.length,c=o.length;if(a<c)return[{start:-1,end:-1,score:0},null];if(j(s,o,t)<0)return[{start:-1,end:-1,score:0},null];let u=0,p=-1,g=0,m=-1;for(let _=0;_<a;_++){const i=y(_,a,n);let l=s[i];t||(l>=h&&l<=d?l+=32:l>f&&(l=String.fromCodePoint(l).toLowerCase().codePointAt(0))),e&&(l=r(l));const w=y(u,c,n);if(o[w]===l){if(0===w&&(b=s,g=0===(P=i)?8:O(C(b[P-1]),C(b[P]))),u++,u===c){if(g>m&&(p=_,m=g),8===g)break;_-=u-1,u=0,g=0}}else _-=u,u=0,g=0}var b,P;if(p>=0){let r=0,i=0;n?(r=p-c+1,i=p+1):(r=a-(p+1),i=a-(p-c+1));const[l]=M(t,e,s,o,r,i,!1);return[{start:r,end:i,score:l},null]}return[{start:-1,end:-1,score:0},null]};const F=(I=2048,{i16:new Int16Array(102400),i32:new Int32Array(I)});var I,R,q;(q=R||(R={}))[q.Fuzzy=0]="Fuzzy",q[q.Exact=1]="Exact",q[q.Prefix=2]="Prefix",q[q.Suffix=3]="Suffix",q[q.Equal=4]="Equal";const W={0:E,1:V,2:(t,e,n,s,o,i,l)=>{if(0===o.length)return[{start:0,end:0,score:0},null];let u=0;if(a(o[0])||(u=c(s)),s.length-u<o.length)return[{start:-1,end:-1,score:0},null];for(const[a,c]of o.entries()){let n=s[u+a];if(t||(n=String.fromCodePoint(n).toLowerCase().codePointAt(0)),e&&(n=r(n)),n!==c)return[{start:-1,end:-1,score:0},null]}const f=o.length,[h]=M(t,e,s,o,u,u+f,!1);return[{start:u,end:u+f,score:h},null]},3:(t,e,n,s,o,i,l)=>{let c=s.length;if(0!==o.length&&a(o[o.length-1])||(c-=u(s)),0===o.length)return[{start:c,end:c,score:0},null];const f=c-o.length;if(f<0)return[{start:-1,end:-1,score:0},null];for(const[a,u]of o.entries()){let n=s[a+f];if(t||(n=String.fromCodePoint(n).toLowerCase().codePointAt(0)),e&&(n=r(n)),n!==u)return[{start:-1,end:-1,score:0},null]}const h=c-o.length,d=c,[p]=M(t,e,s,o,h,d,!1);return[{start:h,end:d,score:p},null]},4:(t,e,n,s,o,l,f)=>{const h=o.length;if(0===h)return[{start:-1,end:-1,score:0},null];let d=0;a(o[0])||(d=c(s));let p=0;if(a(o[h-1])||(p=u(s)),s.length-d-p!=h)return[{start:-1,end:-1,score:0},null];let g=!0;if(e){const e=s;for(const[n,s]of o.entries()){let o=e[d+n];if(t||(o=String.fromCodePoint(o).toLowerCase().codePointAt(0)),r(s)!==r(o)){g=!1;break}}}else{let e=i(s).substring(d,s.length-p);t||(e=e.toLowerCase()),g=e===i(o)}return g?[{start:d,end:d+h,score:24*h+8},null]:[{start:-1,end:-1,score:0},null]}};function B(t,e,n,s){let l=!0;{const t=(s=s.trimLeft()).trimRight();s=t.endsWith("\\")&&" "===s[t.length]?t+" ":t}let a=!1,c=[];c=function(t,e,n,s){const l=(s=s.replace(/\\ /g,"\t")).split(/ +/),a=[];let c=[],u=!1,f=!1;for(const h of l){let s=0,l=!1,d=h.replace(/\t/g," ");const p=d.toLowerCase(),g="case-sensitive"===e||"smart-case"===e&&d!==p,m=n&&p===i(o(p).map(r));if(g||(d=p),t||(s=1),c.length>0&&!f&&"|"===d)u=!1,f=!0;else if(f=!1,d.startsWith("!")&&(l=!0,s=1,d=d.substring(1)),"$"!==d&&d.endsWith("$")&&(s=3,d=d.substring(0,d.length-1)),d.startsWith("'")?(s=t&&!l?1:0,d=d.substring(1)):d.startsWith("^")&&(s=3===s?4:2,d=d.substring(1)),d.length>0){u&&(a.push(c),c=[]);let t=o(d);m&&(t=t.map(r)),c.push({typ:s,inv:l,text:t,caseSensitive:g,normalize:m}),u=!0}}c.length>0&&a.push(c);return a}(t,e,n,s);t:for(const r of c)for(const[e,n]of r.entries())if(n.inv||(a=!0),(!l||e>0||n.inv||t&&0!==n.typ||!t&&1!==n.typ)&&(l=!1,a))break t;return{str:s,termSets:c,sortable:a,cacheable:l,fuzzy:t}}const T=(t,e,n)=>{let s=!1;switch(e){case"smart-case":t.toLowerCase()!==t&&(s=!0);break;case"case-sensitive":s=!0;break;case"case-insensitive":t=t.toLowerCase(),s=!1}let i=o(t);return n&&(i=i.map(r)),{queryRunes:i,caseSensitive:s}};function D(t,e,n,r,s,o,i){for(const l of e){const[e,a]=t(n,r,s,l.text,o,!0,i);if(e.start>=0){const t=e.start+l.prefixLength,n=e.end+l.prefixLength;if(null!==a){const r=new Set;return a.forEach((t=>r.add(l.prefixLength+t))),[[t,n],e.score,r]}return[[t,n],e.score,a]}}return[[-1,-1],0,null]}function U(t,e){const n=Object.keys(t).map((t=>parseInt(t,10))).sort(((t,e)=>e-t));let r=[];for(const s of n)if(r=r.concat(t[s]),r.length>=e)break;return r}function G(t,e,n){return r=>{const s=this.runesList[r];if(e.length>s.length)return;let[o,i]=this.algoFn(n,this.opts.normalize,this.opts.forward,s,e,!0,F);if(-1===o.start)return;if(!1===this.opts.fuzzy){i=new Set;for(let t=o.start;t<o.end;++t)i.add(t)}const l=this.opts.sort?o.score:0;void 0===t[l]&&(t[l]=[]),t[l].push(__spreadProps(__spreadValues({item:this.items[r]},o),{positions:null!=i?i:new Set}))}}function J(t,e){return n=>{const r=function(t,e,n,r){const s=[{text:t,prefixLength:0}],o=[];let i=0;const l=new Set;for(const a of e.termSets){let t=[0,0],e=0,c=!1;for(const o of a){let i=W[o.typ];o.typ===R.Fuzzy&&(i=n);const[a,u,f]=D(i,s,o.caseSensitive,o.normalize,r,o.text,F);if(a[0]>=0){if(o.inv)continue;if(t=a,e=u,c=!0,null!==f)f.forEach((t=>l.add(t)));else for(let t=a[0];t<a[1];++t)l.add(t);break}o.inv&&(t=[0,0],e=0,c=!0)}c&&(o.push(t),i+=e)}return{offsets:o,totalScore:i,allPos:l}}(this.runesList[n],e,this.algoFn,this.opts.forward);if(r.offsets.length!==e.termSets.length)return;let s=-1,o=-1;r.allPos.size>0&&(s=Math.min(...r.allPos),o=Math.max(...r.allPos)+1);const i=this.opts.sort?r.totalScore:0;void 0===t[i]&&(t[i]=[]),t[i].push({score:r.totalScore,item:this.items[n],positions:r.allPos,start:s,end:o})}}function Y(t){const{queryRunes:e,caseSensitive:n}=T(t,this.opts.casing,this.opts.normalize),r={},s=G.bind(this)(r,e,n);for(let o=0,i=this.runesList.length;o<i;++o)s(o);return U(r,this.opts.limit)}const Z="undefined"!=typeof require&&"undefined"==typeof window;function H(t,e,n,r){return new Promise(((s,o)=>{let i=0,l=Math.min(1e3,e);const a=()=>{if(t.cancelled)return o("search cancelled");for(;i<l;++i)n(i);l<e?(l=Math.min(l+1e3,e),Z?setImmediate(a):setTimeout(a)):s(r())};a()}))}function K(t,e){const{queryRunes:n,caseSensitive:r}=T(t,this.opts.casing,this.opts.normalize),s={};return H(e,this.runesList.length,G.bind(this)(s,n,r),(()=>U(s,this.opts.limit)))}const Q={limit:1/0,selector:t=>t,casing:"smart-case",normalize:!0,fuzzy:"v2",tiebreakers:[],sort:!0,forward:!0};class ${constructor(t,...e){switch(this.opts=__spreadValues(__spreadValues({},Q),e[0]),this.items=t,this.runesList=t.map((t=>o(this.opts.selector(t).normalize()))),this.algoFn=V,this.opts.fuzzy){case"v2":this.algoFn=E;break;case"v1":this.algoFn=N}}}const X=__spreadProps(__spreadValues({},Q),{match:Y});class tt extends ${constructor(t,...e){super(t,...e),this.opts=__spreadValues(__spreadValues({},X),e[0])}find(t){if(0===t.length||0===this.items.length)return this.items.slice(0,this.opts.limit).map(rt);return t=t.normalize(),st(this.opts.match.bind(this)(t),this.opts)}}const et=__spreadProps(__spreadValues({},Q),{match:K});class nt extends ${constructor(t,...e){super(t,...e),this.opts=__spreadValues(__spreadValues({},et),e[0]),this.token={cancelled:!1}}async find(t){if(this.token.cancelled=!0,this.token={cancelled:!1},0===t.length||0===this.items.length)return this.items.slice(0,this.opts.limit).map(rt);return t=t.normalize(),st(await this.opts.match.bind(this)(t,this.token),this.opts)}}const rt=t=>({item:t,start:-1,end:-1,score:0,positions:new Set});function st(t,e){if(e.sort){const{selector:n}=e;t.sort(((t,r)=>{if(t.score===r.score)for(const s of e.tiebreakers){const e=s(t,r,n);if(0!==e)return e}return 0}))}return Number.isFinite(e.limit)&&t.splice(e.limit),t}t.AsyncFzf=class{constructor(t,...e){this.finder=new nt(t,...e),this.find=this.finder.find.bind(this.finder)}},t.Fzf=class{constructor(t,...e){this.finder=new tt(t,...e),this.find=this.finder.find.bind(this.finder)}},t.asyncBasicMatch=K,t.asyncExtendedMatch=function(t,e){const n=B(Boolean(this.opts.fuzzy),this.opts.casing,this.opts.normalize,t),r={};return H(e,this.runesList.length,J.bind(this)(r,n),(()=>U(r,this.opts.limit)))},t.basicMatch=Y,t.byLengthAsc=function(t,e,n){return n(t.item).length-n(e.item).length},t.byStartAsc=function(t,e){return t.start-e.start},t.extendedMatch=function(t){const e=B(Boolean(this.opts.fuzzy),this.opts.casing,this.opts.normalize,t),n={},r=J.bind(this)(n,e);for(let s=0,o=this.runesList.length;s<o;++s)r(s);return U(n,this.opts.limit)},Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"})); |
@@ -0,0 +0,0 @@ import { Slab } from "./slab"; |
@@ -0,0 +0,0 @@ import { Rune } from "./runes"; |
@@ -0,0 +0,0 @@ import { AlgoFn } from "./algo"; |
@@ -1,14 +0,22 @@ | ||
import { Finder } from "./finder"; | ||
import type { ArrayElement, OptionsTuple, OptsToUse } from "./finder"; | ||
import type { Options } from "./types"; | ||
export type { Tiebreaker, FzfResultItem } from "./types"; | ||
import { SyncFinder, AsyncFinder } from "./finders"; | ||
import type { ArrayElement, SyncOptionsTuple, SyncOptsToUse, AsyncOptionsTuple, AsyncOptsToUse } from "./finders"; | ||
import type { SyncOptions, AsyncOptions } from "./types"; | ||
export type { FzfResultItem, Selector, Tiebreaker } from "./types"; | ||
export * from "./matchers"; | ||
export * from "./tiebreakers"; | ||
export declare type FzfOptions<U = string> = U extends string ? OptsToUse<U> : OptsToUse<U> & { | ||
selector: Options<U>["selector"]; | ||
export declare type FzfOptions<U = string> = U extends string ? SyncOptsToUse<U> : SyncOptsToUse<U> & { | ||
selector: SyncOptions<U>["selector"]; | ||
}; | ||
export declare class Fzf<L extends ReadonlyArray<any>> { | ||
private finder; | ||
find: Finder<L>["find"]; | ||
constructor(list: L, ...optionsTuple: OptionsTuple<ArrayElement<L>>); | ||
find: SyncFinder<L>["find"]; | ||
constructor(list: L, ...optionsTuple: SyncOptionsTuple<ArrayElement<L>>); | ||
} | ||
export declare type AsyncFzfOptions<U = string> = U extends string ? AsyncOptsToUse<U> : AsyncOptsToUse<U> & { | ||
selector: AsyncOptions<U>["selector"]; | ||
}; | ||
export declare class AsyncFzf<L extends ReadonlyArray<any>> { | ||
private finder; | ||
find: AsyncFinder<L>["find"]; | ||
constructor(list: L, ...optionsTuple: AsyncOptionsTuple<ArrayElement<L>>); | ||
} |
@@ -1,4 +0,6 @@ | ||
import { Finder } from "./finder"; | ||
import type { FzfResultItem } from "./types"; | ||
export declare function basicMatch<U>(this: Finder<ReadonlyArray<U>>, query: string): FzfResultItem<U>[]; | ||
export declare function extendedMatch<U>(this: Finder<ReadonlyArray<U>>, query: string): FzfResultItem<U>[]; | ||
import type { SyncFinder, AsyncFinder } from "./finders"; | ||
import { FzfResultItem, Token } from "./types"; | ||
export declare function basicMatch<U>(this: SyncFinder<ReadonlyArray<U>>, query: string): FzfResultItem<U>[]; | ||
export declare function extendedMatch<U>(this: SyncFinder<ReadonlyArray<U>>, query: string): FzfResultItem<U>[]; | ||
export declare function asyncBasicMatch<U>(this: AsyncFinder<ReadonlyArray<U>>, query: string, token: Token): Promise<FzfResultItem<U>[]>; | ||
export declare function asyncExtendedMatch<U>(this: AsyncFinder<ReadonlyArray<U>>, query: string, token: Token): Promise<FzfResultItem<U>[]>; |
import { Rune } from "./runes"; | ||
export declare function normalizeRune(rune: Rune): Rune; |
@@ -0,0 +0,0 @@ export declare type Int16 = Int16Array[0]; |
@@ -0,0 +0,0 @@ import { Rune } from "./runes"; |
@@ -0,0 +0,0 @@ import { Int32 } from "./numerics"; |
@@ -0,0 +0,0 @@ export interface Slab { |
@@ -1,3 +0,3 @@ | ||
import type { FzfResultItem, Options } from "./types"; | ||
export declare function byLengthAsc<U>(a: FzfResultItem<U>, b: FzfResultItem<U>, opts: Options<U>): number; | ||
import type { FzfResultItem, Selector } from "./types"; | ||
export declare function byLengthAsc<U>(a: FzfResultItem<U>, b: FzfResultItem<U>, selector: Selector<U>): number; | ||
export declare function byStartAsc<U>(a: FzfResultItem<U>, b: FzfResultItem<U>): number; |
import type { Result } from "./algo"; | ||
import type { Finder } from "./finder"; | ||
import type { SyncFinder, AsyncFinder } from "./finders"; | ||
export interface Token { | ||
cancelled: boolean; | ||
} | ||
export declare type Casing = "smart-case" | "case-sensitive" | "case-insensitive"; | ||
@@ -8,4 +11,5 @@ export interface FzfResultItem<U = string> extends Result { | ||
} | ||
export declare type Tiebreaker<U> = (a: FzfResultItem<U>, b: FzfResultItem<U>, options: Options<U>) => number; | ||
export interface Options<U> { | ||
export declare type Selector<U> = BaseOptions<U>["selector"]; | ||
export declare type Tiebreaker<U> = (a: FzfResultItem<U>, b: FzfResultItem<U>, selector: Selector<U>) => number; | ||
export interface BaseOptions<U> { | ||
/** | ||
@@ -15,3 +19,3 @@ * If `limit` is 32, top 32 items that matches your query will be returned. | ||
* | ||
* @defaultValue Infinity | ||
* @defaultValue `Infinity` | ||
*/ | ||
@@ -26,3 +30,3 @@ limit: number; | ||
* | ||
* @defaultValue "smart-case" | ||
* @defaultValue `"smart-case"` | ||
*/ | ||
@@ -39,3 +43,3 @@ casing: Casing; | ||
* | ||
* @defaultValue true | ||
* @defaultValue `true` | ||
*/ | ||
@@ -48,18 +52,6 @@ normalize: boolean; | ||
* | ||
* @defaultValue "v2" | ||
* @defaultValue `"v2"` | ||
*/ | ||
fuzzy: "v1" | "v2" | false; | ||
/** | ||
* A function that is responsible for matching list items with the query. | ||
* | ||
* We ship with two match functions - `basicMatch` and `extendedMatch`. | ||
* | ||
* If `extendedMatch` is used, you can add special patterns to narrow down your search. | ||
* To read about how they can be used, see [this section](https://github.com/junegunn/fzf/tree/7191ebb615f5d6ebbf51d598d8ec853a65e2274d#search-syntax). | ||
* For a quick glance, see [this piece](https://github.com/junegunn/fzf/blob/764316a53d0eb60b315f0bbcd513de58ed57a876/src/pattern.go#L12-L19). | ||
* | ||
* @defaultValue basicMatch | ||
*/ | ||
match: (this: Finder<ReadonlyArray<U>>, query: string) => FzfResultItem<U>[]; | ||
/** | ||
* A list of functions that act as fallback and help to | ||
@@ -69,4 +61,7 @@ * sort result entries when the score between two entries is tied. | ||
* Consider a tiebreaker to be a [JS array sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) | ||
* compare function with an added third argument which is this `options` itself. | ||
* compare function with an added third argument which is `options.selector`. | ||
* | ||
* If multiple tiebreakers are given, they are evaluated left to right until | ||
* one breaks the tie. | ||
* | ||
* Note that tiebreakers cannot be used if `sort=false`. | ||
@@ -78,8 +73,8 @@ * | ||
* | ||
* @defaultValue [] | ||
* @defaultValue `[]` | ||
* | ||
* @example | ||
* ```js | ||
* function byLengthAsc(a, b, options) { | ||
* return options.selector(a.item).length - options.selector(b.item).length; | ||
* function byLengthAsc(a, b, selector) { | ||
* return selector(a.item).length - selector(b.item).length; | ||
* } | ||
@@ -99,6 +94,8 @@ * | ||
* If `true`, result items will be sorted in descending order by their score. | ||
* If `false`, result won't be sorted and tiebreakers won't affect the sort | ||
* order either. | ||
* | ||
* @defaultValue true | ||
* If `false`, result items won't be sorted and tiebreakers won't affect the | ||
* sort order either. In this case, the items are returned in the same order | ||
* as they are in the input list. | ||
* | ||
* @defaultValue `true` | ||
*/ | ||
@@ -109,3 +106,3 @@ sort: boolean; | ||
* | ||
* @defaultValue true | ||
* @defaultValue `true` | ||
* | ||
@@ -123,1 +120,29 @@ * @example | ||
} | ||
export declare type SyncOptions<U> = BaseOptions<U> & { | ||
/** | ||
* A function that is responsible for matching list items with the query. | ||
* | ||
* We ship with two match functions - `basicMatch` and `extendedMatch`. | ||
* | ||
* If `extendedMatch` is used, you can add special patterns to narrow down your search. | ||
* To read about how they can be used, see [this section](https://github.com/junegunn/fzf/tree/7191ebb615f5d6ebbf51d598d8ec853a65e2274d#search-syntax). | ||
* For a quick glance, see [this piece](https://github.com/junegunn/fzf/blob/764316a53d0eb60b315f0bbcd513de58ed57a876/src/pattern.go#L12-L19). | ||
* | ||
* @defaultValue `basicMatch` | ||
*/ | ||
match: (this: SyncFinder<ReadonlyArray<U>>, query: string) => FzfResultItem<U>[]; | ||
}; | ||
export declare type AsyncOptions<U> = BaseOptions<U> & { | ||
/** | ||
* A function that is responsible for matching list items with the query. | ||
* | ||
* We ship with two match functions - `asyncBasicMatch` and `asyncExtendedMatch`. | ||
* | ||
* If `asyncExtendedMatch` is used, you can add special patterns to narrow down your search. | ||
* To read about how they can be used, see [this section](https://github.com/junegunn/fzf/tree/7191ebb615f5d6ebbf51d598d8ec853a65e2274d#search-syntax). | ||
* For a quick glance, see [this piece](https://github.com/junegunn/fzf/blob/764316a53d0eb60b315f0bbcd513de58ed57a876/src/pattern.go#L12-L19). | ||
* | ||
* @defaultValue `asyncBasicMatch` | ||
*/ | ||
match: (this: AsyncFinder<ReadonlyArray<U>>, query: string, token: Token) => Promise<FzfResultItem<U>[]>; | ||
}; |
{ | ||
"===== INFO =====": "", | ||
"name": "fzf", | ||
"version": "0.4.1", | ||
"version": "0.5.1", | ||
"description": "Do fuzzy matching using FZF algorithm in JavaScript", | ||
@@ -65,3 +65,2 @@ "license": "BSD-3-Clause", | ||
"autoprefixer": "^10.2.6", | ||
"comlink": "^4.3.1", | ||
"glob": "^7.1.7", | ||
@@ -68,0 +67,0 @@ "history": "^5.0.0", |
@@ -10,3 +10,3 @@ # FZF for JavaScript (Preview) | ||
[Docs](https://fzf.netlify.app) · [Demo](https://fzf.netlify.app/basic) · [GitHub](https://github.com/ajitid/fzf-for-js) · [NPM](https://www.npmjs.com/package/fzf) | ||
[Docs](https://fzf.netlify.app) · [Demo](https://fzf.netlify.app/docs/latest/basic) · [GitHub](https://github.com/ajitid/fzf-for-js) · [NPM](https://www.npmjs.com/package/fzf) | ||
@@ -13,0 +13,0 @@ Originally available as [a fuzzy finder for CLIs](https://github.com/junegunn/fzf), FZF for JavaScript is a port of FZF's main algorithm so it can be used in browser context. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
50373
30
421