import{a as r,S as n,M as t}from"./_MapCache.js";import{i as u}from"./isSymbol.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=n?n.prototype:void 0,e=i?i.toString:void 0;function f(n){if("string"==typeof n)return n;if(r(n))return o(n,f)+"";if(u(n))return e?e.call(n):"";var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}var a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/;function s(n,t){if(r(n))return!1;var o=typeof n;return!("number"!=o&&"symbol"!=o&&"boolean"!=o&&null!=n&&!u(n))||c.test(n)||!a.test(n)||null!=t&&n in Object(t)}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 e=r.apply(this,t);return u.cache=i.set(o,e)||i,e};return u.cache=new(v.Cache||t),u}v.Cache=t;var l,p,d,y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,m=/\\(\\)?/g,b=(l=function(r){var n=[];return 46===r.charCodeAt(0)&&n.push(""),r.replace(y,(function(r,t,u,o){n.push(u?o.replace(m,"$1"):t||r)})),n},p=v(l,(function(r){return 500===d.size&&d.clear(),r})),d=p.cache,p);function g(r){return null==r?"":f(r)}function h(n,t){return r(n)?n:s(n,t)?[n]:b(g(n))}function w(r){if("string"==typeof r||u(r))return r;var n=r+"";return"0"==n&&1/r==-1/0?"-0":n}function j(r,n){for(var t=0,u=(n=h(n,r)).length;null!=r&&t<u;)r=r[w(n[t++])];return t&&t==u?r:void 0}function $(r,n,t){var u=null==r?void 0:j(r,n);return void 0===u?t:u}export{w as a,j as b,h as c,o as d,$ as g,s as i,g as t}