UNPKG

@kelvininc/ui-components

Version:
1 lines 1.69 kB
import{i as r}from"./p-DfPM2t43.js";import{i as n}from"./p-CqZa0G50.js";import{M as t}from"./p-DVju43gQ.js";import{S as u}from"./p-Dkd2PDJ-.js";function o(r,n){for(var t=-1,u=null==r?0:r.length,o=Array(u);++t<u;)o[t]=n(r[t],t,r);return o}var i=u?u.prototype:void 0,f=i?i.toString:void 0;function e(t){if("string"==typeof t)return t;if(r(t))return o(t,e)+"";if(n(t))return f?f.call(t):"";var u=t+"";return"0"==u&&1/t==-1/0?"-0":u}var a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/;function s(t,u){if(r(t))return!1;var o=typeof t;return!("number"!=o&&"symbol"!=o&&"boolean"!=o&&null!=t&&!n(t))||c.test(t)||!a.test(t)||null!=u&&t in Object(u)}function v(r,n){if("function"!=typeof r||null!=n&&"function"!=typeof n)throw new TypeError("Expected a function");var u=function(){var t=arguments,o=n?n.apply(this,t):t[0],i=u.cache;if(i.has(o))return i.get(o);var f=r.apply(this,t);return u.cache=i.set(o,f)||i,f};return u.cache=new(v.Cache||t),u}v.Cache=t;var l,p,m,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,y=/\\(\\)?/g,g=(l=function(r){var n=[];return 46===r.charCodeAt(0)&&n.push(""),r.replace(d,(function(r,t,u,o){n.push(u?o.replace(y,"$1"):t||r)})),n},p=v(l,(function(r){return 500===m.size&&m.clear(),r})),m=p.cache,p);function j(n,t){return r(n)?n:s(n,t)?[n]:g(function(r){return null==r?"":e(r)}(n))}function b(r){if("string"==typeof r||n(r))return r;var t=r+"";return"0"==t&&1/r==-1/0?"-0":t}function w(r,n){for(var t=0,u=(n=j(n,r)).length;null!=r&&t<u;)r=r[b(n[t++])];return t&&t==u?r:void 0}function D(r,n,t){var u=null==r?void 0:w(r,n);return void 0===u?t:u}export{o as a,w as b,j as c,D as g,s as i,b as t}