@ynput/ayon-frontend-shared 0.3.35 → 0.3.36
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/_virtual/index.cjs12.js +1 -1
- package/dist/_virtual/index.cjs13.js +1 -1
- package/dist/_virtual/index.cjs15.js +1 -1
- package/dist/_virtual/index.cjs18.js +1 -1
- package/dist/_virtual/index.cjs19.js +1 -1
- package/dist/_virtual/index.cjs22.js +1 -1
- package/dist/_virtual/index.cjs23.js +1 -1
- package/dist/_virtual/index.cjs24.js +1 -1
- package/dist/_virtual/index.cjs4.js +1 -1
- package/dist/_virtual/index.cjs6.js +1 -1
- package/dist/_virtual/index.cjs9.js +1 -1
- package/dist/_virtual/index.es12.js +5 -2
- package/dist/_virtual/index.es12.js.map +1 -1
- package/dist/_virtual/index.es13.js +5 -2
- package/dist/_virtual/index.es13.js.map +1 -1
- package/dist/_virtual/index.es14.js +2 -2
- package/dist/_virtual/index.es15.js +2 -2
- package/dist/_virtual/index.es16.js +2 -2
- package/dist/_virtual/index.es17.js +2 -2
- package/dist/_virtual/index.es18.js +2 -2
- package/dist/_virtual/index.es19.js +2 -2
- package/dist/_virtual/index.es22.js +3 -3
- package/dist/_virtual/index.es23.js +5 -5
- package/dist/_virtual/index.es24.js +5 -5
- package/dist/_virtual/index.es4.js +2 -5
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es6.js +2 -2
- package/dist/_virtual/index.es7.js +2 -2
- package/dist/_virtual/index.es9.js +2 -5
- package/dist/_virtual/index.es9.js.map +1 -1
- package/dist/node_modules/match-sorter/dist/match-sorter.esm.cjs.js +1 -1
- package/dist/node_modules/match-sorter/dist/match-sorter.esm.cjs.js.map +1 -1
- package/dist/node_modules/match-sorter/dist/match-sorter.esm.es.js +1 -1
- package/dist/node_modules/rehype/node_modules/unified/lib/index.cjs.js +1 -1
- package/dist/node_modules/rehype/node_modules/unified/lib/index.es.js +2 -2
- package/dist/node_modules/rehype/node_modules/vfile/lib/index.cjs.js +1 -1
- package/dist/node_modules/rehype/node_modules/vfile/lib/index.es.js +1 -1
- package/dist/node_modules/rehype-parse/lib/index.cjs.js +1 -1
- package/dist/node_modules/rehype-parse/lib/index.es.js +1 -1
- package/dist/node_modules/remove-accents/index.cjs.js +1 -1
- package/dist/node_modules/remove-accents/index.cjs.js.map +1 -1
- package/dist/node_modules/remove-accents/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/error-codes/dist/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/error-codes/dist/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime/dist/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime/dist/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.cjs.js.map +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/remote/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/remote/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/shared/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/shared/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/type/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/type/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/hooks/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/hooks/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.cjs.js.map +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.cjs.js.map +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/sdk/dist/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/sdk/dist/index.es.js +1 -1
- package/dist/shared/node_modules/prop-types/index.cjs.js +1 -1
- package/dist/shared/node_modules/prop-types/index.es.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js.map +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.es.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js.map +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/Transition.es.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js.map +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.es.js +1 -1
- package/dist/shared/src/containers/DetailsPanel/containers/FeedWrapper.cjs.js +1 -1
- package/dist/shared/src/containers/DetailsPanel/containers/FeedWrapper.cjs.js.map +1 -1
- package/dist/shared/src/containers/DetailsPanel/containers/FeedWrapper.es.js +7 -7
- package/dist/shared/src/containers/DetailsPanel/containers/FeedWrapper.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const e=require("./_commonjsHelpers.cjs.js"),r=require("../shared/node_modules/prop-types/index.cjs.js");var s=r.__require();const o=e.getDefaultExportFromCjs(s);module.exports=o;
|
|
2
2
|
//# sourceMappingURL=index.cjs12.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const e=require("./_commonjsHelpers.cjs.js"),r=require("../node_modules/remove-accents/index.cjs.js");var s=r.__require();const t=e.getDefaultExportFromCjs(s);module.exports=t;
|
|
2
2
|
//# sourceMappingURL=index.cjs13.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=index.cjs15.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
|
2
2
|
//# sourceMappingURL=index.cjs18.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
|
|
2
2
|
//# sourceMappingURL=index.cjs19.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const e=require("./_commonjsHelpers.cjs.js"),r=require("../node_modules/is-buffer/index.cjs.js");var s=r.__require();const t=e.getDefaultExportFromCjs(s);module.exports=t;
|
|
2
2
|
//# sourceMappingURL=index.cjs22.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("./_commonjsHelpers.cjs.js"),r=require("../node_modules/
|
|
1
|
+
"use strict";const e=require("./_commonjsHelpers.cjs.js"),r=require("../node_modules/extend/index.cjs.js");var t=r.__require();const s=e.getDefaultExportFromCjs(t);module.exports=s;
|
|
2
2
|
//# sourceMappingURL=index.cjs23.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const r=require("./_commonjsHelpers.cjs.js"),e=require("../node_modules/parse5/lib/parser/index.cjs.js");var s=e.__require();const t=r.getDefaultExportFromCjs(s);module.exports=t;
|
|
2
2
|
//# sourceMappingURL=index.cjs24.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=index.cjs4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=index.cjs6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
|
|
2
2
|
//# sourceMappingURL=index.cjs9.js.map
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import { __require as o } from "../shared/node_modules/prop-types/index.es.js";
|
|
3
|
+
var p = /* @__PURE__ */ o();
|
|
4
|
+
const s = /* @__PURE__ */ r(p);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
s as default
|
|
4
7
|
};
|
|
5
8
|
//# sourceMappingURL=index.es12.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es12.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es12.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import { __require as r } from "../node_modules/remove-accents/index.es.js";
|
|
3
|
+
var o = r();
|
|
4
|
+
const s = /* @__PURE__ */ e(o);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
s as default
|
|
4
7
|
};
|
|
5
8
|
//# sourceMappingURL=index.es13.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es13.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es13.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.es.js";
|
|
2
|
-
import { __require as e } from "../node_modules/
|
|
3
|
-
var
|
|
4
|
-
const s = /* @__PURE__ */ r(
|
|
2
|
+
import { __require as e } from "../node_modules/is-buffer/index.es.js";
|
|
3
|
+
var f = e();
|
|
4
|
+
const s = /* @__PURE__ */ r(f);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import { __require as r } from "../node_modules/extend/index.es.js";
|
|
3
|
+
var t = r();
|
|
4
|
+
const a = /* @__PURE__ */ e(t);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index.es23.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.es.js";
|
|
2
|
+
import { __require as e } from "../node_modules/parse5/lib/parser/index.es.js";
|
|
3
|
+
var o = e();
|
|
4
|
+
const s = /* @__PURE__ */ r(o);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index.es24.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as r } from "../node_modules/remove-accents/index.es.js";
|
|
3
|
-
var o = r();
|
|
4
|
-
const s = /* @__PURE__ */ e(o);
|
|
1
|
+
var r = {};
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
r as __exports
|
|
7
4
|
};
|
|
8
5
|
//# sourceMappingURL=index.es4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es4.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es4.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as o } from "../shared/node_modules/prop-types/index.es.js";
|
|
3
|
-
var p = /* @__PURE__ */ o();
|
|
4
|
-
const s = /* @__PURE__ */ r(p);
|
|
1
|
+
var e = {};
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
e as __exports
|
|
7
4
|
};
|
|
8
5
|
//# sourceMappingURL=index.es9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es9.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es9.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../../../_virtual/index.cjs13.js");const d={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},V=(n,e)=>String(n.rankedValue).localeCompare(String(e.rankedValue));function p(n,e,t){t===void 0&&(t={});const{keys:l,threshold:i=d.MATCHES,baseSort:a=V,sorter:o=f=>f.sort((r,c)=>N(r,c,a))}=t,s=n.reduce(u,[]);return o(s).map(f=>{let{item:r}=f;return r});function u(f,r,c){const I=T(r,l,e,t),{rank:A,keyThreshold:h=i}=I;return A>=h&&f.push({...I,item:r,index:c}),f}}p.rankings=d;function T(n,e,t,l){if(!e){const a=n;return{rankedValue:a,rank:k(a,t,l),keyIndex:-1,keyThreshold:l.threshold}}return x(n,e).reduce((a,o,s)=>{let{rank:u,rankedValue:f,keyIndex:r,keyThreshold:c}=a,{itemValue:I,attributes:A}=o,h=k(I,t,l),C=f;const{minRanking:y,maxRanking:g,threshold:O}=A;return h<y&&h>=d.MATCHES?h=y:h>g&&(h=g),h>u&&(u=h,r=s,c=O,C=I),{rankedValue:C,rank:u,keyIndex:r,keyThreshold:c}},{rankedValue:n,rank:d.NO_MATCH,keyIndex:-1,keyThreshold:l.threshold})}function k(n,e,t){return n=m(n,t),e=m(e,t),e.length>n.length?d.NO_MATCH:n===e?d.CASE_SENSITIVE_EQUAL:(n=n.toLowerCase(),e=e.toLowerCase(),n===e?d.EQUAL:n.startsWith(e)?d.STARTS_WITH:n.includes(` ${e}`)?d.WORD_STARTS_WITH:n.includes(e)?d.CONTAINS:e.length===1?d.NO_MATCH:E(n).includes(e)?d.ACRONYM:H(n,e))}function E(n){let e="";return n.split(" ").forEach(l=>{l.split("-").forEach(a=>{e+=a.substr(0,1)})}),e}function H(n,e){let t=0;function l(r,c,I){for(let A=I,h=c.length;A<h;A++)if(c[A]===r)return t+=1,A+1;return-1}let i=0;function a(r){const c=1/r,I=t/e.length,A=(e.length-i)/e.length;return d.MATCHES+I*c*A}let o=0,s=0,u=0;for(let r=0,c=e.length;r<c;r++){const I=e[r];if(u=l(I,n,s),u>-1)s=u,r===0&&(o=s);else{if(i>0||e.length<=3)return d.NO_MATCH;i+=1}}const f=s-o;return a(f)}function N(n,e,t){const{rank:a,keyIndex:o}=n,{rank:s,keyIndex:u}=e;return a===s?o===u?t(n,e):o<u?-1:1:a>s?-1:1}function m(n,e){let{keepDiacritics:t}=e;return n=`${n}`,t||(n=b(n)),n}function _(n,e){typeof e=="object"&&(e=e.key);let t;if(typeof e=="function")t=e(n);else if(n==null)t=null;else if(Object.hasOwnProperty.call(n,e))t=n[e];else{if(e.includes("."))return M(e,n);t=null}return t==null?[]:Array.isArray(t)?t:[String(t)]}function M(n,e){const t=n.split(".");let l=[e];for(let i=0,a=t.length;i<a;i++){const o=t[i];let s=[];for(let u=0,f=l.length;u<f;u++){const r=l[u];if(r!=null)if(Object.hasOwnProperty.call(r,o)){const c=r[o];c!=null&&s.push(c)}else o==="*"&&(s=s.concat(r))}l=s}return Array.isArray(l[0])?[].concat(...l):l}function x(n,e){const t=[];for(let l=0,i=e.length;l<i;l++){const a=e[l],o=F(a),s=_(n,a);for(let u=0,f=s.length;u<f;u++)t.push({itemValue:s[u],attributes:o})}return t}const S={maxRanking:1/0,minRanking:-1/0};function F(n){return typeof n=="string"?S:{...S,...n}}exports.defaultBaseSortFn=V;exports.matchSorter=p;exports.rankings=d;
|
|
2
2
|
//# sourceMappingURL=match-sorter.esm.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"match-sorter.esm.cjs.js","sources":["../../../../../node_modules/match-sorter/dist/match-sorter.esm.js"],"sourcesContent":["import removeAccents from 'remove-accents';\n\n/**\n * @name match-sorter\n * @license MIT license.\n * @copyright (c) 2020 Kent C. Dodds\n * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)\n */\nconst rankings = {\n CASE_SENSITIVE_EQUAL: 7,\n EQUAL: 6,\n STARTS_WITH: 5,\n WORD_STARTS_WITH: 4,\n CONTAINS: 3,\n ACRONYM: 2,\n MATCHES: 1,\n NO_MATCH: 0\n};\nconst defaultBaseSortFn = (a, b) => String(a.rankedValue).localeCompare(String(b.rankedValue));\n\n/**\n * Takes an array of items and a value and returns a new array with the items that match the given value\n * @param {Array} items - the items to sort\n * @param {String} value - the value to use for ranking\n * @param {Object} options - Some options to configure the sorter\n * @return {Array} - the new sorted array\n */\nfunction matchSorter(items, value, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n keys,\n threshold = rankings.MATCHES,\n baseSort = defaultBaseSortFn,\n sorter = matchedItems => matchedItems.sort((a, b) => sortRankedValues(a, b, baseSort))\n } = options;\n const matchedItems = items.reduce(reduceItemsToRanked, []);\n return sorter(matchedItems).map(_ref => {\n let {\n item\n } = _ref;\n return item;\n });\n function reduceItemsToRanked(matches, item, index) {\n const rankingInfo = getHighestRanking(item, keys, value, options);\n const {\n rank,\n keyThreshold = threshold\n } = rankingInfo;\n if (rank >= keyThreshold) {\n matches.push({\n ...rankingInfo,\n item,\n index\n });\n }\n return matches;\n }\n}\nmatchSorter.rankings = rankings;\n\n/**\n * Gets the highest ranking for value for the given item based on its values for the given keys\n * @param {*} item - the item to rank\n * @param {Array} keys - the keys to get values from the item for the ranking\n * @param {String} value - the value to rank against\n * @param {Object} options - options to control the ranking\n * @return {{rank: Number, keyIndex: Number, keyThreshold: Number}} - the highest ranking\n */\nfunction getHighestRanking(item, keys, value, options) {\n if (!keys) {\n // if keys is not specified, then we assume the item given is ready to be matched\n const stringItem = item;\n return {\n // ends up being duplicate of 'item' in matches but consistent\n rankedValue: stringItem,\n rank: getMatchRanking(stringItem, value, options),\n keyIndex: -1,\n keyThreshold: options.threshold\n };\n }\n const valuesToRank = getAllValuesToRank(item, keys);\n return valuesToRank.reduce((_ref2, _ref3, i) => {\n let {\n rank,\n rankedValue,\n keyIndex,\n keyThreshold\n } = _ref2;\n let {\n itemValue,\n attributes\n } = _ref3;\n let newRank = getMatchRanking(itemValue, value, options);\n let newRankedValue = rankedValue;\n const {\n minRanking,\n maxRanking,\n threshold\n } = attributes;\n if (newRank < minRanking && newRank >= rankings.MATCHES) {\n newRank = minRanking;\n } else if (newRank > maxRanking) {\n newRank = maxRanking;\n }\n if (newRank > rank) {\n rank = newRank;\n keyIndex = i;\n keyThreshold = threshold;\n newRankedValue = itemValue;\n }\n return {\n rankedValue: newRankedValue,\n rank,\n keyIndex,\n keyThreshold\n };\n }, {\n rankedValue: item,\n rank: rankings.NO_MATCH,\n keyIndex: -1,\n keyThreshold: options.threshold\n });\n}\n\n/**\n * Gives a rankings score based on how well the two strings match.\n * @param {String} testString - the string to test against\n * @param {String} stringToRank - the string to rank\n * @param {Object} options - options for the match (like keepDiacritics for comparison)\n * @returns {Number} the ranking for how well stringToRank matches testString\n */\nfunction getMatchRanking(testString, stringToRank, options) {\n testString = prepareValueForComparison(testString, options);\n stringToRank = prepareValueForComparison(stringToRank, options);\n\n // too long\n if (stringToRank.length > testString.length) {\n return rankings.NO_MATCH;\n }\n\n // case sensitive equals\n if (testString === stringToRank) {\n return rankings.CASE_SENSITIVE_EQUAL;\n }\n\n // Lower casing before further comparison\n testString = testString.toLowerCase();\n stringToRank = stringToRank.toLowerCase();\n\n // case insensitive equals\n if (testString === stringToRank) {\n return rankings.EQUAL;\n }\n\n // starts with\n if (testString.startsWith(stringToRank)) {\n return rankings.STARTS_WITH;\n }\n\n // word starts with\n if (testString.includes(` ${stringToRank}`)) {\n return rankings.WORD_STARTS_WITH;\n }\n\n // contains\n if (testString.includes(stringToRank)) {\n return rankings.CONTAINS;\n } else if (stringToRank.length === 1) {\n // If the only character in the given stringToRank\n // isn't even contained in the testString, then\n // it's definitely not a match.\n return rankings.NO_MATCH;\n }\n\n // acronym\n if (getAcronym(testString).includes(stringToRank)) {\n return rankings.ACRONYM;\n }\n\n // will return a number between rankings.MATCHES and\n // rankings.MATCHES + 1 depending on how close of a match it is.\n return getClosenessRanking(testString, stringToRank);\n}\n\n/**\n * Generates an acronym for a string.\n *\n * @param {String} string the string for which to produce the acronym\n * @returns {String} the acronym\n */\nfunction getAcronym(string) {\n let acronym = '';\n const wordsInString = string.split(' ');\n wordsInString.forEach(wordInString => {\n const splitByHyphenWords = wordInString.split('-');\n splitByHyphenWords.forEach(splitByHyphenWord => {\n acronym += splitByHyphenWord.substr(0, 1);\n });\n });\n return acronym;\n}\n\n/**\n * Returns a score based on how spread apart the\n * characters from the stringToRank are within the testString.\n * A number close to rankings.MATCHES represents a loose match. A number close\n * to rankings.MATCHES + 1 represents a tighter match.\n * @param {String} testString - the string to test against\n * @param {String} stringToRank - the string to rank\n * @returns {Number} the number between rankings.MATCHES and\n * rankings.MATCHES + 1 for how well stringToRank matches testString\n */\nfunction getClosenessRanking(testString, stringToRank) {\n let matchingInOrderCharCount = 0;\n function findMatchingCharacter(matchChar, string, index) {\n for (let j = index, J = string.length; j < J; j++) {\n const stringChar = string[j];\n if (stringChar === matchChar) {\n matchingInOrderCharCount += 1;\n return j + 1;\n }\n }\n return -1;\n }\n let skipped = 0;\n function getRanking(spread) {\n const spreadPercentage = 1 / spread;\n const inOrderPercentage = matchingInOrderCharCount / stringToRank.length;\n const matchPercentage = (stringToRank.length - skipped) / stringToRank.length;\n const ranking = rankings.MATCHES + inOrderPercentage * spreadPercentage * matchPercentage;\n return ranking;\n }\n let firstIndex = 0;\n let charNumber = 0;\n let nextCharNumber = 0;\n for (let i = 0, I = stringToRank.length; i < I; i++) {\n const matchChar = stringToRank[i];\n nextCharNumber = findMatchingCharacter(matchChar, testString, charNumber);\n const found = nextCharNumber > -1;\n if (found) {\n charNumber = nextCharNumber;\n if (i === 0) {\n firstIndex = charNumber;\n }\n } else if (skipped > 0 || stringToRank.length <= 3) {\n // if search term is short, require finding all characters\n return rankings.NO_MATCH;\n } else {\n skipped += 1;\n }\n }\n const spread = charNumber - firstIndex;\n return getRanking(spread);\n}\n\n/**\n * Sorts items that have a rank, index, and keyIndex\n * @param {Object} a - the first item to sort\n * @param {Object} b - the second item to sort\n * @return {Number} -1 if a should come first, 1 if b should come first, 0 if equal\n */\nfunction sortRankedValues(a, b, baseSort) {\n const aFirst = -1;\n const bFirst = 1;\n const {\n rank: aRank,\n keyIndex: aKeyIndex\n } = a;\n const {\n rank: bRank,\n keyIndex: bKeyIndex\n } = b;\n const same = aRank === bRank;\n if (same) {\n if (aKeyIndex === bKeyIndex) {\n // use the base sort function as a tie-breaker\n return baseSort(a, b);\n } else {\n return aKeyIndex < bKeyIndex ? aFirst : bFirst;\n }\n } else {\n return aRank > bRank ? aFirst : bFirst;\n }\n}\n\n/**\n * Prepares value for comparison by stringifying it, removing diacritics (if specified)\n * @param {String} value - the value to clean\n * @param {Object} options - {keepDiacritics: whether to remove diacritics}\n * @return {String} the prepared value\n */\nfunction prepareValueForComparison(value, _ref4) {\n let {\n keepDiacritics\n } = _ref4;\n // value might not actually be a string at this point (we don't get to choose)\n // so part of preparing the value for comparison is ensure that it is a string\n value = `${value}`; // toString\n if (!keepDiacritics) {\n value = removeAccents(value);\n }\n return value;\n}\n\n/**\n * Gets value for key in item at arbitrarily nested keypath\n * @param {Object} item - the item\n * @param {Object|Function} key - the potentially nested keypath or property callback\n * @return {Array} - an array containing the value(s) at the nested keypath\n */\nfunction getItemValues(item, key) {\n if (typeof key === 'object') {\n key = key.key;\n }\n let value;\n if (typeof key === 'function') {\n value = key(item);\n } else if (item == null) {\n value = null;\n } else if (Object.hasOwnProperty.call(item, key)) {\n value = item[key];\n } else if (key.includes('.')) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n return getNestedValues(key, item);\n } else {\n value = null;\n }\n\n // because `value` can also be undefined\n if (value == null) {\n return [];\n }\n if (Array.isArray(value)) {\n return value;\n }\n return [String(value)];\n}\n\n/**\n * Given path: \"foo.bar.baz\"\n * And item: {foo: {bar: {baz: 'buzz'}}}\n * -> 'buzz'\n * @param path a dot-separated set of keys\n * @param item the item to get the value from\n */\nfunction getNestedValues(path, item) {\n const keys = path.split('.');\n let values = [item];\n for (let i = 0, I = keys.length; i < I; i++) {\n const nestedKey = keys[i];\n let nestedValues = [];\n for (let j = 0, J = values.length; j < J; j++) {\n const nestedItem = values[j];\n if (nestedItem == null) continue;\n if (Object.hasOwnProperty.call(nestedItem, nestedKey)) {\n const nestedValue = nestedItem[nestedKey];\n if (nestedValue != null) {\n nestedValues.push(nestedValue);\n }\n } else if (nestedKey === '*') {\n // ensure that values is an array\n nestedValues = nestedValues.concat(nestedItem);\n }\n }\n values = nestedValues;\n }\n if (Array.isArray(values[0])) {\n // keep allowing the implicit wildcard for an array of strings at the end of\n // the path; don't use `.flat()` because that's not available in node.js v10\n const result = [];\n return result.concat(...values);\n }\n // Based on our logic it should be an array of strings by now...\n // assuming the user's path terminated in strings\n return values;\n}\n\n/**\n * Gets all the values for the given keys in the given item and returns an array of those values\n * @param item - the item from which the values will be retrieved\n * @param keys - the keys to use to retrieve the values\n * @return objects with {itemValue, attributes}\n */\nfunction getAllValuesToRank(item, keys) {\n const allValues = [];\n for (let j = 0, J = keys.length; j < J; j++) {\n const key = keys[j];\n const attributes = getKeyAttributes(key);\n const itemValues = getItemValues(item, key);\n for (let i = 0, I = itemValues.length; i < I; i++) {\n allValues.push({\n itemValue: itemValues[i],\n attributes\n });\n }\n }\n return allValues;\n}\nconst defaultKeyAttributes = {\n maxRanking: Infinity,\n minRanking: -Infinity\n};\n/**\n * Gets all the attributes for the given key\n * @param key - the key from which the attributes will be retrieved\n * @return object containing the key's attributes\n */\nfunction getKeyAttributes(key) {\n if (typeof key === 'string') {\n return defaultKeyAttributes;\n }\n return {\n ...defaultKeyAttributes,\n ...key\n };\n}\n\n/*\neslint\n no-continue: \"off\",\n*/\n\nexport { defaultBaseSortFn, matchSorter, rankings };\n"],"names":["rankings","defaultBaseSortFn","a","b","matchSorter","items","value","options","keys","threshold","baseSort","sorter","matchedItems","sortRankedValues","reduceItemsToRanked","_ref","item","matches","index","rankingInfo","getHighestRanking","rank","keyThreshold","stringItem","getMatchRanking","getAllValuesToRank","_ref2","_ref3","i","rankedValue","keyIndex","itemValue","attributes","newRank","newRankedValue","minRanking","maxRanking","testString","stringToRank","prepareValueForComparison","getAcronym","getClosenessRanking","string","acronym","wordInString","splitByHyphenWord","matchingInOrderCharCount","findMatchingCharacter","matchChar","j","J","skipped","getRanking","spread","spreadPercentage","inOrderPercentage","matchPercentage","firstIndex","charNumber","nextCharNumber","I","aRank","aKeyIndex","bRank","bKeyIndex","_ref4","keepDiacritics","removeAccents","getItemValues","key","getNestedValues","path","values","nestedKey","nestedValues","nestedItem","nestedValue","allValues","getKeyAttributes","itemValues","defaultKeyAttributes"],"mappings":"mIAQK,MAACA,EAAW,CACf,qBAAsB,EACtB,MAAO,EACP,YAAa,EACb,iBAAkB,EAClB,SAAU,EACV,QAAS,EACT,QAAS,EACT,SAAU,CACZ,EACMC,EAAoB,CAACC,EAAGC,IAAM,OAAOD,EAAE,WAAW,EAAE,cAAc,OAAOC,EAAE,WAAW,CAAC,EAS7F,SAASC,EAAYC,EAAOC,EAAOC,EAAS,CACtCA,IAAY,SACdA,EAAU,CAAA,GAEZ,KAAM,CACJ,KAAAC,EACA,UAAAC,EAAYT,EAAS,QACrB,SAAAU,EAAWT,EACX,OAAAU,EAASC,GAAgBA,EAAa,KAAK,CAACV,EAAGC,IAAMU,EAAiBX,EAAGC,EAAGO,CAAQ,CAAC,CACzF,EAAMH,EACEK,EAAeP,EAAM,OAAOS,EAAqB,CAAA,CAAE,EACzD,OAAOH,EAAOC,CAAY,EAAE,IAAIG,GAAQ,CACtC,GAAI,CACF,KAAAC,CACN,EAAQD,EACJ,OAAOC,CACT,CAAC,EACD,SAASF,EAAoBG,EAASD,EAAME,EAAO,CACjD,MAAMC,EAAcC,EAAk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EAAG,IAAK,CAC3C,MAAMa,EAAYjE,EAAK,CAAC,EACxB,IAAIkE,EAAe,CAAA,EACnB,QAASzB,EAAI,EAAGC,EAAIsB,EAAO,OAAQvB,EAAIC,EAAGD,IAAK,CAC7C,MAAM0B,EAAaH,EAAOvB,CAAC,EAC3B,GAAI0B,GAAc,KAClB,GAAI,OAAO,eAAe,KAAKA,EAAYF,CAAS,EAAG,CACrD,MAAMG,EAAcD,EAAWF,CAAS,EACpCG,GAAe,MACjBF,EAAa,KAAKE,CAAW,CAEjC,MAAWH,IAAc,MAEvBC,EAAeA,EAAa,OAAOC,CAAU,EAEjD,CACAH,EAASE,CACX,CACA,OAAI,MAAM,QAAQF,EAAO,CAAC,CAAC,EAGV,CAAA,EACD,OAAO,GAAGA,CAAM,EAIzBA,CACT,CAQA,SAAS/C,EAAmBT,EAAMR,EAAM,CACtC,MAAMqE,EAAY,CAAA,EAClB,QAAS5B,EAAI,EAAGC,EAAI1C,EAAK,OAAQyC,EAAIC,EAAGD,IAAK,CAC3C,MAAMoB,EAAM7D,EAAKyC,CAAC,EACZjB,EAAa8C,EAAiBT,CAAG,EACjCU,EAAaX,EAAcpD,EAAMqD,CAAG,EAC1C,QAASzC,EAAI,EAAGgC,EAAImB,EAAW,OAAQnD,EAAIgC,EAAGhC,IAC5CiD,EAAU,KAAK,CACb,UAAWE,EAAWnD,CAAC,EACvB,WAAAI,CACR,CAAO,CAEL,CACA,OAAO6C,CACT,CACA,MAAMG,EAAuB,CAC3B,WAAY,IACZ,WAAY,IACd,EAMA,SAASF,EAAiBT,EAAK,CAC7B,OAAI,OAAOA,GAAQ,SACVW,EAEF,CACL,GAAGA,EACH,GAAGX,CACP,CACA","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"match-sorter.esm.cjs.js","sources":["../../../../../node_modules/match-sorter/dist/match-sorter.esm.js"],"sourcesContent":["import removeAccents from 'remove-accents';\n\n/**\n * @name match-sorter\n * @license MIT license.\n * @copyright (c) 2020 Kent C. Dodds\n * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)\n */\nconst rankings = {\n CASE_SENSITIVE_EQUAL: 7,\n EQUAL: 6,\n STARTS_WITH: 5,\n WORD_STARTS_WITH: 4,\n CONTAINS: 3,\n ACRONYM: 2,\n MATCHES: 1,\n NO_MATCH: 0\n};\nconst defaultBaseSortFn = (a, b) => String(a.rankedValue).localeCompare(String(b.rankedValue));\n\n/**\n * Takes an array of items and a value and returns a new array with the items that match the given value\n * @param {Array} items - the items to sort\n * @param {String} value - the value to use for ranking\n * @param {Object} options - Some options to configure the sorter\n * @return {Array} - the new sorted array\n */\nfunction matchSorter(items, value, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n keys,\n threshold = rankings.MATCHES,\n baseSort = defaultBaseSortFn,\n sorter = matchedItems => matchedItems.sort((a, b) => sortRankedValues(a, b, baseSort))\n } = options;\n const matchedItems = items.reduce(reduceItemsToRanked, []);\n return sorter(matchedItems).map(_ref => {\n let {\n item\n } = _ref;\n return item;\n });\n function reduceItemsToRanked(matches, item, index) {\n const rankingInfo = getHighestRanking(item, keys, value, options);\n const {\n rank,\n keyThreshold = threshold\n } = rankingInfo;\n if (rank >= keyThreshold) {\n matches.push({\n ...rankingInfo,\n item,\n index\n });\n }\n return matches;\n }\n}\nmatchSorter.rankings = rankings;\n\n/**\n * Gets the highest ranking for value for the given item based on its values for the given keys\n * @param {*} item - the item to rank\n * @param {Array} keys - the keys to get values from the item for the ranking\n * @param {String} value - the value to rank against\n * @param {Object} options - options to control the ranking\n * @return {{rank: Number, keyIndex: Number, keyThreshold: Number}} - the highest ranking\n */\nfunction getHighestRanking(item, keys, value, options) {\n if (!keys) {\n // if keys is not specified, then we assume the item given is ready to be matched\n const stringItem = item;\n return {\n // ends up being duplicate of 'item' in matches but consistent\n rankedValue: stringItem,\n rank: getMatchRanking(stringItem, value, options),\n keyIndex: -1,\n keyThreshold: options.threshold\n };\n }\n const valuesToRank = getAllValuesToRank(item, keys);\n return valuesToRank.reduce((_ref2, _ref3, i) => {\n let {\n rank,\n rankedValue,\n keyIndex,\n keyThreshold\n } = _ref2;\n let {\n itemValue,\n attributes\n } = _ref3;\n let newRank = getMatchRanking(itemValue, value, options);\n let newRankedValue = rankedValue;\n const {\n minRanking,\n maxRanking,\n threshold\n } = attributes;\n if (newRank < minRanking && newRank >= rankings.MATCHES) {\n newRank = minRanking;\n } else if (newRank > maxRanking) {\n newRank = maxRanking;\n }\n if (newRank > rank) {\n rank = newRank;\n keyIndex = i;\n keyThreshold = threshold;\n newRankedValue = itemValue;\n }\n return {\n rankedValue: newRankedValue,\n rank,\n keyIndex,\n keyThreshold\n };\n }, {\n rankedValue: item,\n rank: rankings.NO_MATCH,\n keyIndex: -1,\n keyThreshold: options.threshold\n });\n}\n\n/**\n * Gives a rankings score based on how well the two strings match.\n * @param {String} testString - the string to test against\n * @param {String} stringToRank - the string to rank\n * @param {Object} options - options for the match (like keepDiacritics for comparison)\n * @returns {Number} the ranking for how well stringToRank matches testString\n */\nfunction getMatchRanking(testString, stringToRank, options) {\n testString = prepareValueForComparison(testString, options);\n stringToRank = prepareValueForComparison(stringToRank, options);\n\n // too long\n if (stringToRank.length > testString.length) {\n return rankings.NO_MATCH;\n }\n\n // case sensitive equals\n if (testString === stringToRank) {\n return rankings.CASE_SENSITIVE_EQUAL;\n }\n\n // Lower casing before further comparison\n testString = testString.toLowerCase();\n stringToRank = stringToRank.toLowerCase();\n\n // case insensitive equals\n if (testString === stringToRank) {\n return rankings.EQUAL;\n }\n\n // starts with\n if (testString.startsWith(stringToRank)) {\n return rankings.STARTS_WITH;\n }\n\n // word starts with\n if (testString.includes(` ${stringToRank}`)) {\n return rankings.WORD_STARTS_WITH;\n }\n\n // contains\n if (testString.includes(stringToRank)) {\n return rankings.CONTAINS;\n } else if (stringToRank.length === 1) {\n // If the only character in the given stringToRank\n // isn't even contained in the testString, then\n // it's definitely not a match.\n return rankings.NO_MATCH;\n }\n\n // acronym\n if (getAcronym(testString).includes(stringToRank)) {\n return rankings.ACRONYM;\n }\n\n // will return a number between rankings.MATCHES and\n // rankings.MATCHES + 1 depending on how close of a match it is.\n return getClosenessRanking(testString, stringToRank);\n}\n\n/**\n * Generates an acronym for a string.\n *\n * @param {String} string the string for which to produce the acronym\n * @returns {String} the acronym\n */\nfunction getAcronym(string) {\n let acronym = '';\n const wordsInString = string.split(' ');\n wordsInString.forEach(wordInString => {\n const splitByHyphenWords = wordInString.split('-');\n splitByHyphenWords.forEach(splitByHyphenWord => {\n acronym += splitByHyphenWord.substr(0, 1);\n });\n });\n return acronym;\n}\n\n/**\n * Returns a score based on how spread apart the\n * characters from the stringToRank are within the testString.\n * A number close to rankings.MATCHES represents a loose match. A number close\n * to rankings.MATCHES + 1 represents a tighter match.\n * @param {String} testString - the string to test against\n * @param {String} stringToRank - the string to rank\n * @returns {Number} the number between rankings.MATCHES and\n * rankings.MATCHES + 1 for how well stringToRank matches testString\n */\nfunction getClosenessRanking(testString, stringToRank) {\n let matchingInOrderCharCount = 0;\n function findMatchingCharacter(matchChar, string, index) {\n for (let j = index, J = string.length; j < J; j++) {\n const stringChar = string[j];\n if (stringChar === matchChar) {\n matchingInOrderCharCount += 1;\n return j + 1;\n }\n }\n return -1;\n }\n let skipped = 0;\n function getRanking(spread) {\n const spreadPercentage = 1 / spread;\n const inOrderPercentage = matchingInOrderCharCount / stringToRank.length;\n const matchPercentage = (stringToRank.length - skipped) / stringToRank.length;\n const ranking = rankings.MATCHES + inOrderPercentage * spreadPercentage * matchPercentage;\n return ranking;\n }\n let firstIndex = 0;\n let charNumber = 0;\n let nextCharNumber = 0;\n for (let i = 0, I = stringToRank.length; i < I; i++) {\n const matchChar = stringToRank[i];\n nextCharNumber = findMatchingCharacter(matchChar, testString, charNumber);\n const found = nextCharNumber > -1;\n if (found) {\n charNumber = nextCharNumber;\n if (i === 0) {\n firstIndex = charNumber;\n }\n } else if (skipped > 0 || stringToRank.length <= 3) {\n // if search term is short, require finding all characters\n return rankings.NO_MATCH;\n } else {\n skipped += 1;\n }\n }\n const spread = charNumber - firstIndex;\n return getRanking(spread);\n}\n\n/**\n * Sorts items that have a rank, index, and keyIndex\n * @param {Object} a - the first item to sort\n * @param {Object} b - the second item to sort\n * @return {Number} -1 if a should come first, 1 if b should come first, 0 if equal\n */\nfunction sortRankedValues(a, b, baseSort) {\n const aFirst = -1;\n const bFirst = 1;\n const {\n rank: aRank,\n keyIndex: aKeyIndex\n } = a;\n const {\n rank: bRank,\n keyIndex: bKeyIndex\n } = b;\n const same = aRank === bRank;\n if (same) {\n if (aKeyIndex === bKeyIndex) {\n // use the base sort function as a tie-breaker\n return baseSort(a, b);\n } else {\n return aKeyIndex < bKeyIndex ? aFirst : bFirst;\n }\n } else {\n return aRank > bRank ? aFirst : bFirst;\n }\n}\n\n/**\n * Prepares value for comparison by stringifying it, removing diacritics (if specified)\n * @param {String} value - the value to clean\n * @param {Object} options - {keepDiacritics: whether to remove diacritics}\n * @return {String} the prepared value\n */\nfunction prepareValueForComparison(value, _ref4) {\n let {\n keepDiacritics\n } = _ref4;\n // value might not actually be a string at this point (we don't get to choose)\n // so part of preparing the value for comparison is ensure that it is a string\n value = `${value}`; // toString\n if (!keepDiacritics) {\n value = removeAccents(value);\n }\n return value;\n}\n\n/**\n * Gets value for key in item at arbitrarily nested keypath\n * @param {Object} item - the item\n * @param {Object|Function} key - the potentially nested keypath or property callback\n * @return {Array} - an array containing the value(s) at the nested keypath\n */\nfunction getItemValues(item, key) {\n if (typeof key === 'object') {\n key = key.key;\n }\n let value;\n if (typeof key === 'function') {\n value = key(item);\n } else if (item == null) {\n value = null;\n } else if (Object.hasOwnProperty.call(item, key)) {\n value = item[key];\n } else if (key.includes('.')) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n return getNestedValues(key, item);\n } else {\n value = null;\n }\n\n // because `value` can also be undefined\n if (value == null) {\n return [];\n }\n if (Array.isArray(value)) {\n return value;\n }\n return [String(value)];\n}\n\n/**\n * Given path: \"foo.bar.baz\"\n * And item: {foo: {bar: {baz: 'buzz'}}}\n * -> 'buzz'\n * @param path a dot-separated set of keys\n * @param item the item to get the value from\n */\nfunction getNestedValues(path, item) {\n const keys = path.split('.');\n let values = [item];\n for (let i = 0, I = keys.length; i < I; i++) {\n const nestedKey = keys[i];\n let nestedValues = [];\n for (let j = 0, J = values.length; j < J; j++) {\n const nestedItem = values[j];\n if (nestedItem == null) continue;\n if (Object.hasOwnProperty.call(nestedItem, nestedKey)) {\n const nestedValue = nestedItem[nestedKey];\n if (nestedValue != null) {\n nestedValues.push(nestedValue);\n }\n } else if (nestedKey === '*') {\n // ensure that values is an array\n nestedValues = nestedValues.concat(nestedItem);\n }\n }\n values = nestedValues;\n }\n if (Array.isArray(values[0])) {\n // keep allowing the implicit wildcard for an array of strings at the end of\n // the path; don't use `.flat()` because that's not available in node.js v10\n const result = [];\n return result.concat(...values);\n }\n // Based on our logic it should be an array of strings by now...\n // assuming the user's path terminated in strings\n return values;\n}\n\n/**\n * Gets all the values for the given keys in the given item and returns an array of those values\n * @param item - the item from which the values will be retrieved\n * @param keys - the keys to use to retrieve the values\n * @return objects with {itemValue, attributes}\n */\nfunction getAllValuesToRank(item, keys) {\n const allValues = [];\n for (let j = 0, J = keys.length; j < J; j++) {\n const key = keys[j];\n const attributes = getKeyAttributes(key);\n const itemValues = getItemValues(item, key);\n for (let i = 0, I = itemValues.length; i < I; i++) {\n allValues.push({\n itemValue: itemValues[i],\n attributes\n });\n }\n }\n return allValues;\n}\nconst defaultKeyAttributes = {\n maxRanking: Infinity,\n minRanking: -Infinity\n};\n/**\n * Gets all the attributes for the given key\n * @param key - the key from which the attributes will be retrieved\n * @return object containing the key's attributes\n */\nfunction getKeyAttributes(key) {\n if (typeof key === 'string') {\n return defaultKeyAttributes;\n }\n return {\n ...defaultKeyAttributes,\n ...key\n };\n}\n\n/*\neslint\n no-continue: \"off\",\n*/\n\nexport { defaultBaseSortFn, matchSorter, rankings };\n"],"names":["rankings","defaultBaseSortFn","a","b","matchSorter","items","value","options","keys","threshold","baseSort","sorter","matchedItems","sortRankedValues","reduceItemsToRanked","_ref","item","matches","index","rankingInfo","getHighestRanking","rank","keyThreshold","stringItem","getMatchRanking","getAllValuesToRank","_ref2","_ref3","i","rankedValue","keyIndex","itemValue","attributes","newRank","newRankedValue","minRanking","maxRanking","testString","stringToRank","prepareValueForComparison","getAcronym","getClosenessRanking","string","acronym","wordInString","splitByHyphenWord","matchingInOrderCharCount","findMatchingCharacter","matchChar","j","J","skipped","getRanking","spread","spreadPercentage","inOrderPercentage","matchPercentage","firstIndex","charNumber","nextCharNumber","I","aRank","aKeyIndex","bRank","bKeyIndex","_ref4","keepDiacritics","removeAccents","getItemValues","key","getNestedValues","path","values","nestedKey","nestedValues","nestedItem","nestedValue","allValues","getKeyAttributes","itemValues","defaultKeyAttributes"],"mappings":"oIAQK,MAACA,EAAW,CACf,qBAAsB,EACtB,MAAO,EACP,YAAa,EACb,iBAAkB,EAClB,SAAU,EACV,QAAS,EACT,QAAS,EACT,SAAU,CACZ,EACMC,EAAoB,CAACC,EAAGC,IAAM,OAAOD,EAAE,WAAW,EAAE,cAAc,OAAOC,EAAE,WAAW,CAAC,EAS7F,SAASC,EAAYC,EAAOC,EAAOC,EAAS,CACtCA,IAAY,SACdA,EAAU,CAAA,GAEZ,KAAM,CACJ,KAAAC,EACA,UAAAC,EAAYT,EAAS,QACrB,SAAAU,EAAWT,EACX,OAAAU,EAASC,GAAgBA,EAAa,KAAK,CAACV,EAAGC,IAAMU,EAAiBX,EAAGC,EAAGO,CAAQ,CAAC,CACzF,EAAMH,EACEK,EAAeP,EAAM,OAAOS,EAAqB,CAAA,CAAE,EACzD,OAAOH,EAAOC,CAAY,EAAE,IAAIG,GAAQ,CACtC,GAAI,CACF,KAAAC,CACN,EAAQD,EACJ,OAAOC,CACT,CAAC,EACD,SAASF,EAAoBG,EAASD,EAAME,EAAO,CACjD,MAAMC,EAAcC,EAAkBJ,EAAMR,EAAMF,EAAOC,CAAO,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E,EAAK,CAAC,EACxB,IAAIkE,EAAe,CAAA,EACnB,QAASzB,EAAI,EAAGC,EAAIsB,EAAO,OAAQvB,EAAIC,EAAGD,IAAK,CAC7C,MAAM0B,EAAaH,EAAOvB,CAAC,EAC3B,GAAI0B,GAAc,KAClB,GAAI,OAAO,eAAe,KAAKA,EAAYF,CAAS,EAAG,CACrD,MAAMG,EAAcD,EAAWF,CAAS,EACpCG,GAAe,MACjBF,EAAa,KAAKE,CAAW,CAEjC,MAAWH,IAAc,MAEvBC,EAAeA,EAAa,OAAOC,CAAU,EAEjD,CACAH,EAASE,CACX,CACA,OAAI,MAAM,QAAQF,EAAO,CAAC,CAAC,EAGV,CAAA,EACD,OAAO,GAAGA,CAAM,EAIzBA,CACT,CAQA,SAAS/C,EAAmBT,EAAMR,EAAM,CACtC,MAAMqE,EAAY,CAAA,EAClB,QAAS5B,EAAI,EAAGC,EAAI1C,EAAK,OAAQyC,EAAIC,EAAGD,IAAK,CAC3C,MAAMoB,EAAM7D,EAAKyC,CAAC,EACZjB,EAAa8C,EAAiBT,CAAG,EACjCU,EAAaX,EAAcpD,EAAMqD,CAAG,EAC1C,QAASzC,EAAI,EAAGgC,EAAImB,EAAW,OAAQnD,EAAIgC,EAAGhC,IAC5CiD,EAAU,KAAK,CACb,UAAWE,EAAWnD,CAAC,EACvB,WAAAI,CACR,CAAO,CAEL,CACA,OAAO6C,CACT,CACA,MAAMG,EAAuB,CAC3B,WAAY,IACZ,WAAY,IACd,EAMA,SAASF,EAAiBT,EAAK,CAC7B,OAAI,OAAOA,GAAQ,SACVW,EAEF,CACL,GAAGA,EACH,GAAGX,CACP,CACA","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../../../../bail/index.cjs.js"),B=require("../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../../../../bail/index.cjs.js"),B=require("../../../../../_virtual/index.cjs22.js"),z=require("../../../../../_virtual/index.cjs23.js"),E=require("../../../../is-plain-obj/index.cjs.js"),D=require("../../../../trough/lib/index.cjs.js"),M=require("../../vfile/lib/index.cjs.js"),Y=$().freeze(),A={}.hasOwnProperty;function $(){const t=D.trough(),s=[];let a={},w,h=-1;return n.data=j,n.Parser=void 0,n.Compiler=void 0,n.freeze=q,n.attachers=s,n.use=I,n.parse=O,n.stringify=V,n.run=F,n.runSync=N,n.process=L,n.processSync=U,n;function n(){const e=$();let r=-1;for(;++r<s.length;)e.use(...s[r]);return e.data(z(!0,{},a)),e}function j(e,r){return typeof e=="string"?arguments.length===2?(P("data",w),a[e]=r,n):A.call(a,e)&&a[e]||null:e?(P("data",w),a=e,n):a}function q(){if(w)return n;for(;++h<s.length;){const[e,...r]=s[h];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=e.call(n,...r);typeof i=="function"&&t.use(i)}return w=!0,h=Number.POSITIVE_INFINITY,n}function I(e,...r){let i;if(P("use",w),e!=null)if(typeof e=="function")d(e,...r);else if(typeof e=="object")Array.isArray(e)?y(e):p(e);else throw new TypeError("Expected usable value, not `"+e+"`");return i&&(a.settings=Object.assign(a.settings||{},i)),n;function u(o){if(typeof o=="function")d(o);else if(typeof o=="object")if(Array.isArray(o)){const[f,...c]=o;d(f,...c)}else p(o);else throw new TypeError("Expected usable value, not `"+o+"`")}function p(o){y(o.plugins),o.settings&&(i=Object.assign(i||{},o.settings))}function y(o){let f=-1;if(o!=null)if(Array.isArray(o))for(;++f<o.length;){const c=o[f];u(c)}else throw new TypeError("Expected a list of plugins, not `"+o+"`")}function d(o,f){let c=-1,l;for(;++c<s.length;)if(s[c][0]===o){l=s[c];break}l?(E(l[1])&&E(f)&&(f=z(!0,l[1],f)),l[1]=f):s.push([...arguments])}}function O(e){n.freeze();const r=g(e),i=n.Parser;return m("parse",i),C(i,"parse")?new i(String(r),r).parse():i(String(r),r)}function V(e,r){n.freeze();const i=g(r),u=n.Compiler;return x("stringify",u),b(e),C(u,"compile")?new u(e,i).compile():u(e,i)}function F(e,r,i){if(b(e),n.freeze(),!i&&typeof r=="function"&&(i=r,r=void 0),!i)return new Promise(u);u(null,i);function u(p,y){t.run(e,g(r),d);function d(o,f,c){f=f||e,o?y(o):p?p(f):i(null,f,c)}}}function N(e,r){let i,u;return n.run(e,r,p),T("runSync","run",u),i;function p(y,d){S.bail(y),i=d,u=!0}}function L(e,r){if(n.freeze(),m("process",n.Parser),x("process",n.Compiler),!r)return new Promise(i);i(null,r);function i(u,p){const y=g(e);n.run(n.parse(y),y,(o,f,c)=>{if(o||!f||!c)d(o);else{const l=n.stringify(f,c);l==null||(H(l)?c.value=l:c.result=l),d(o,c)}});function d(o,f){o||!f?p(o):u?u(f):r(null,f)}}}function U(e){let r;n.freeze(),m("processSync",n.Parser),x("processSync",n.Compiler);const i=g(e);return n.process(i,u),T("processSync","process",r),i;function u(p){r=!0,S.bail(p)}}}function C(t,s){return typeof t=="function"&&t.prototype&&(_(t.prototype)||s in t.prototype)}function _(t){let s;for(s in t)if(A.call(t,s))return!0;return!1}function m(t,s){if(typeof s!="function")throw new TypeError("Cannot `"+t+"` without `Parser`")}function x(t,s){if(typeof s!="function")throw new TypeError("Cannot `"+t+"` without `Compiler`")}function P(t,s){if(s)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function b(t){if(!E(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function T(t,s,a){if(!a)throw new Error("`"+t+"` finished async. Use `"+s+"` instead")}function g(t){return G(t)?t:new M.VFile(t)}function G(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function H(t){return typeof t=="string"||B(t)}exports.unified=Y;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bail as z } from "../../../../bail/index.es.js";
|
|
2
|
-
import Y from "../../../../../_virtual/index.
|
|
3
|
-
import C from "../../../../../_virtual/index.
|
|
2
|
+
import Y from "../../../../../_virtual/index.es22.js";
|
|
3
|
+
import C from "../../../../../_virtual/index.es23.js";
|
|
4
4
|
import x from "../../../../is-plain-obj/index.es.js";
|
|
5
5
|
import { trough as _ } from "../../../../trough/lib/index.es.js";
|
|
6
6
|
import { VFile as q } from "../../vfile/lib/index.es.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../../../_virtual/index.cjs22.js"),i=require("./minpath.browser.cjs.js"),d=require("./minproc.browser.cjs.js"),c=require("./minurl.browser.cjs.js"),m=require("./minurl.shared.cjs.js"),l=require("../../vfile-message/lib/index.cjs.js"),a=["history","path","basename","stem","extname","dirname"];class g{constructor(t){let e;t?typeof t=="string"||w(t)?e={value:t}:m.isUrl(t)?e={path:t}:e=t:e={},this.data={},this.messages=[],this.history=[],this.cwd=d.proc.cwd(),this.value,this.stored,this.result,this.map;let r=-1;for(;++r<a.length;){const h=a[r];h in e&&e[h]!==void 0&&e[h]!==null&&(this[h]=h==="history"?[...e[h]]:e[h])}let s;for(s in e)a.includes(s)||(this[s]=e[s])}get path(){return this.history[this.history.length-1]}set path(t){m.isUrl(t)&&(t=c.urlToPath(t)),p(t,"path"),this.path!==t&&this.history.push(t)}get dirname(){return typeof this.path=="string"?i.path.dirname(this.path):void 0}set dirname(t){u(this.basename,"dirname"),this.path=i.path.join(t||"",this.basename)}get basename(){return typeof this.path=="string"?i.path.basename(this.path):void 0}set basename(t){p(t,"basename"),o(t,"basename"),this.path=i.path.join(this.dirname||"",t)}get extname(){return typeof this.path=="string"?i.path.extname(this.path):void 0}set extname(t){if(o(t,"extname"),u(this.dirname,"extname"),t){if(t.charCodeAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=i.path.join(this.dirname,this.stem+(t||""))}get stem(){return typeof this.path=="string"?i.path.basename(this.path,this.extname):void 0}set stem(t){p(t,"stem"),o(t,"stem"),this.path=i.path.join(this.dirname||"",t+(this.extname||""))}toString(t){return(this.value||"").toString(t||void 0)}message(t,e,r){const s=new l.VFileMessage(t,e,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}info(t,e,r){const s=this.message(t,e,r);return s.fatal=null,s}fail(t,e,r){const s=this.message(t,e,r);throw s.fatal=!0,s}}function o(n,t){if(n&&n.includes(i.path.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+i.path.sep+"`")}function p(n,t){if(!n)throw new Error("`"+t+"` cannot be empty")}function u(n,t){if(!n)throw new Error("Setting `"+t+"` requires `path` to be set too")}function w(n){return f(n)}exports.VFile=g;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import d from "../../../../../_virtual/index.
|
|
1
|
+
import d from "../../../../../_virtual/index.es22.js";
|
|
2
2
|
import { path as i } from "./minpath.browser.es.js";
|
|
3
3
|
import { proc as u } from "./minproc.browser.es.js";
|
|
4
4
|
import { urlToPath as l } from "./minurl.browser.es.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const w=require("../../../_virtual/index.
|
|
1
|
+
"use strict";const w=require("../../../_virtual/index.cjs24.js"),A=require("./errors.cjs.js"),E=require("../../hast-util-from-parse5/lib/index.cjs.js"),I="https://html.spec.whatwg.org/multipage/parsing.html#parse-error-",L={2:!0,1:!1,0:null};function j(r){const o=this.data("settings"),n=Object.assign({},o,r);Object.assign(this,{Parser:h});function h(a,l){const b=n.fragment?"parseFragment":"parse",C=n.emitParseErrors?x:null,O=new w({sourceCodeLocationInfo:!0,onParseError:C,scriptingEnabled:!1});return E.fromParse5(O[b](a),{space:n.space,file:l,verbose:n.verbose});function x(e){const c=e.code,u=y(c),i=n[u],f=i??!0,p=typeof f=="number"?f:f?1:0,P={line:e.startLine,column:e.startCol,offset:e.startOffset},q={line:e.endLine,column:e.endCol,offset:e.endOffset};if(p){const t=A.errors[u]||{reason:"",description:"",url:""},s=l.message(g(t.reason),{start:P,end:q});s.source="parse-error",s.ruleId=c,s.fatal=L[p],s.note=g(t.description),s.url="url"in t&&t.url===!1?null:I+c}function g(t){return t.replace(/%c(?:-(\d+))?/g,(s,d)=>{const v=d?-Number.parseInt(d,10):0,m=a.charAt(e.startOffset+v);return m==="`"?"` ` `":m}).replace(/%x/g,()=>"0x"+a.charCodeAt(e.startOffset).toString(16).toUpperCase())}}}}function y(r){return r.replace(/-[a-z]/g,o=>o.charAt(1).toUpperCase())}module.exports=j;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import A from "../../../_virtual/index.
|
|
1
|
+
import A from "../../../_virtual/index.es24.js";
|
|
2
2
|
import { errors as E } from "./errors.es.js";
|
|
3
3
|
import { fromParse5 as I } from "../../hast-util-from-parse5/lib/index.es.js";
|
|
4
4
|
const L = "https://html.spec.whatwg.org/multipage/parsing.html#parse-error-", j = { 2: !0, 1: !1, 0: null };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../_virtual/index.cjs19.js");var t;function O(){if(t)return o.__module.exports;t=1;var a={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C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ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},r=Object.keys(a).join("|"),A=new RegExp(r,"g"),i=new RegExp(r,"");function c(e){return a[e]}var u=function(e){return e.replace(A,c)},n=function(e){return!!e.match(i)};return o.__module.exports=u,o.__module.exports.has=n,o.__module.exports.remove=u,o.__module.exports}exports.__require=O;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|