import{a9 as r,aa as n,ab as t,ac as a,ad as e,ae as i,af as u,y as o}from"./index-FKnJJang.js";import{a as f}from"./_baseEach-DIpKRMNf.js";import{b as s}from"./_baseMap-C7H3vESs.js";import{b as c}from"./transform-0ILWlX8T.js";function l(n,t){if(n!==t){var a=void 0!==n,e=null===n,i=n==n,u=r(n),o=void 0!==t,f=null===t,s=t==t,c=r(t);if(!f&&!c&&!u&&n>t||u&&o&&s&&!f&&!c||e&&o&&s||!a&&s||!i)return 1;if(!e&&!u&&!c&&n<t||c&&a&&i&&!e&&!u||f&&a&&i||!o&&i||!s)return-1}return 0}function v(r,u,o){u=u.length?n(u,(function(r){return t(r)?function(n){return a(n,1===r.length?r[0]:r)}:r})):[e];var c=-1;return u=n(u,i(f)),function(r,n){var t=r.length;for(r.sort(n);t--;)r[t]=r[t].value;return r}(s(r,(function(r,t,a){return{criteria:n(u,(function(n){return n(r)})),index:++c,value:r}})),(function(r,n){return function(r,n,t){for(var a=-1,e=r.criteria,i=n.criteria,u=e.length,o=t.length;++a<u;){var f=l(e[a],i[a]);if(f)return a>=o?f:f*("desc"==t[a]?-1:1)}return r.index-n.index}(r,n,o)}))}var m=c((function(r,n){if(null==r)return[];var t=n.length;return t>1&&u(r,n[0],n[1])?n=[]:t>2&&u(n[0],n[1],n[2])&&(n=[n[0]]),v(r,o(n),[])}));export{m as s};
