var e=(function(e){if(e==null)return a;if(typeof e==`function`)return i(e);if(typeof e==`object`)return Array.isArray(e)?t(e):n(e);if(typeof e==`string`)return r(e);throw Error(`Expected function, string, or object as test`)});function t(t){let n=[],r=-1;for(;++r<t.length;)n[r]=e(t[r]);return i(a);function a(...e){let t=-1;for(;++t<n.length;)if(n[t].apply(this,e))return!0;return!1}}function n(e){let t=e;return i(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function r(e){return i(t);function t(t){return t&&t.type===e}}function i(e){return t;function t(t,n,r){return!!(o(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function a(){return!0}function o(e){return typeof e==`object`&&!!e&&`type`in e}function s(e){return e}var c=[],l=`skip`;function u(t,n,r,i){let a;typeof n==`function`&&typeof r!=`function`?(i=r,r=n):a=n;let o=e(a),l=i?-1:1;u(t,void 0,[])();function u(e,t,a){let f=e&&typeof e==`object`?e:{};if(typeof f.type==`string`){let t=typeof f.tagName==`string`?f.tagName:typeof f.name==`string`?f.name:void 0;Object.defineProperty(p,"name",{value:`node (`+s(e.type+(t?`<`+t+`>`:``))+`)`})}return p;function p(){let s=c,f,p,m;if((!n||o(e,t,a[a.length-1]||void 0))&&(s=d(r(e,a)),s[0]===!1))return s;if(`children`in e&&e.children){let t=e;if(t.children&&s[0]!==`skip`)for(p=(i?t.children.length:-1)+l,m=a.concat(t);p>-1&&p<t.children.length;){let e=t.children[p];if(f=u(e,p,m)(),f[0]===!1)return f;p=typeof f[1]==`number`?f[1]:p+l}}return s}}}function d(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?c:[e]}export{u as n,e as r,l as t};