-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolyfills.00100100.js
More file actions
2 lines (2 loc) · 4.32 KB
/
polyfills.00100100.js
File metadata and controls
2 lines (2 loc) · 4.32 KB
1
2
/*! For detailed credits and licence information see https://github.com/financial-times/polyfill-library */
!function(t,e){function r(t,e){var r=arguments.length>2?arguments[2]:[];if(!1===o(t))throw new TypeError(Object.prototype.toString.call(t)+"is not a function.");return t.apply(e,r)}function n(t,e){return t[e]}function o(t){return"function"==typeof t}function i(t){if(null==t)throw TypeError(Object.prototype.toString.call(t)+" is not coercible to Object.");return t}function a(t){return Boolean(t)}function c(t){var e=Number(t);return isNaN(e)?0:1/e==1/0||1/e==-1/0||e===1/0||e===-1/0?e:(e<0?-1:1)*Math.floor(Math.abs(e))}function u(t){var e=c(t);return e<=0?0:Math.min(e,Math.pow(2,53)-1)}function f(t){if(null==t)throw TypeError();return Object(t)}function l(t,e){var r,n=(r=e,f(t)[r]);if(null!=n){if(!1===o(n))throw new TypeError("Method not callable: "+e);return n}}function s(e){switch(typeof e){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";default:return null===e?"null":"Symbol"in t&&(e instanceof t.Symbol||e.constructor===t.Symbol)?"symbol":"object"}}function b(e){if("object"!==s(e))return!1;var r="Symbol"in t&&"match"in t.Symbol?n(e,t.Symbol.match):void 0;if(void 0!==r)return a(r);try{var o=e.lastIndex;return e.lastIndex=0,RegExp.prototype.exec.call(e),!0}catch(t){}finally{e.lastIndex=o}return!1}function p(t,e){if("string"===e)var i=["toString","valueOf"];else i=["valueOf","toString"];for(var a=0;a<i.length;++a){var c=n(t,i[a]);if(o(c)){var u=r(c,t);if("object"!==s(u))return u}}throw new TypeError("Cannot convert to primitive.")}function y(e){switch(s(e)){case"symbol":throw new TypeError("Cannot convert a Symbol value to a string");case"object":return y(function(e){var n=arguments.length>1?arguments[1]:void 0;if("object"===s(e)){if(arguments.length<2)var o="default";else n===String?o="string":n===Number&&(o="number");var i="function"==typeof t.Symbol&&"symbol"==typeof t.Symbol.toPrimitive?l(e,t.Symbol.toPrimitive):void 0;if(void 0!==i){var a=r(i,e,[o]);if("object"!==s(a))return a;throw new TypeError("Cannot convert exotic object to primitive.")}return"default"===o&&(o="number"),p(e,o)}return e}(e,String));default:return String(e)}}var v,h,d;function w(t,e,r){var n={value:r,writable:!0,enumerable:!1,configurable:!0};Object.defineProperty(t,e,n)}"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(v=Object.defineProperty,h=Object.prototype.hasOwnProperty.call(Object.prototype,"__defineGetter__"),d="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,e,r){if(v&&(t===window||t===document||t===Element.prototype||t instanceof Element))return v(t,e,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var n=String(e),o="value"in r||"writable"in r,i="get"in r&&typeof r.get,a="set"in r&&typeof r.set;if(i){if("function"!==i)throw new TypeError("Getter must be a function");if(!h)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(o)throw new TypeError(d);Object.__defineGetter__.call(t,n,r.get)}else t[n]=r.value;if(a){if("function"!==a)throw new TypeError("Setter must be a function");if(!h)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(o)throw new TypeError(d);Object.__defineSetter__.call(t,n,r.set)}return"value"in r&&(t[n]=r.value),t}),"findIndex"in Array.prototype||w(Array.prototype,"findIndex",(function(t){var e=f(this),i=u(n(e,"length"));if(!1===o(t))throw new TypeError(t+" is not a function");for(var c=arguments.length>1?arguments[1]:void 0,l=0;l<i;){var s=y(l),b=n(e,s),p=a(r(t,c,[b,l,e]));if(p)return l;l+=1}return-1})),"endsWith"in String.prototype||w(String.prototype,"endsWith",(function(t){"use strict";var e=arguments.length>1?arguments[1]:void 0,r=i(this),n=y(r),o=b(t);if(o)throw new TypeError("First argument to String.prototype.endsWith must not be a regular expression");var a=y(t),u=n.length,f=void 0===e?u:c(e),l=Math.min(Math.max(f,0),u),s=a.length,p=l-s;return!(p<0)&&n.substr(p,s)===a}))}("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{});