import{S as c,l as p}from"./_Uint8Array-BGESiCQL.js";import{t as l}from"./isSymbol-BGkTcW3U.js";import{n as v}from"./toString-DlRqgfqz.js";import{d,u as s,y as g}from"./isArrayLikeObject-BkJc8lDE.js";import{n as h}from"./get-6uJrSKbw.js";import{t as x}from"./_baseFlatten-C_qcB35v.js";import{r as y}from"./_baseEach-DKvBKtvu.js";import{t as S}from"./_baseMap-ypWFjvN8.js";function _(n,r){var t=n.length;for(n.sort(r);t--;)n[t]=n[t].value;return n}var b=_;function j(n,r){if(n!==r){var t=n!==void 0,u=n===null,o=n===n,i=l(n),m=r!==void 0,a=r===null,f=r===r,e=l(r);if(!a&&!e&&!i&&n>r||i&&m&&f&&!a&&!e||u&&m&&f||!t&&f||!o)return 1;if(!u&&!i&&!e&&n<r||e&&t&&o&&!u&&!i||a&&t&&o||!m&&o||!f)return-1}return 0}var k=j;function q(n,r,t){for(var u=-1,o=n.criteria,i=r.criteria,m=o.length,a=t.length;++u<m;){var f=k(o[u],i[u]);if(f)return u>=a?f:f*(t[u]=="desc"?-1:1)}return n.index-r.index}var w=q;function z(n,r,t){r=r.length?v(r,function(o){return c(o)?function(i){return h(i,o.length===1?o[0]:o)}:o}):[g];var u=-1;return r=v(r,p(y)),b(S(n,function(o,i,m){return{criteria:v(r,function(a){return a(o)}),index:++u,value:o}}),function(o,i){return w(o,i,t)})}var A=z,B=d(function(n,r){if(n==null)return[];var t=r.length;return t>1&&s(n,r[0],r[1])?r=[]:t>2&&s(r[0],r[1],r[2])&&(r=[r[0]]),A(n,x(r,1),[])});export{B as t};
