laravelEcomm/public/Dashboard/vendors/jquery-asGradient/jquery-asGradient.min.js

10 lines
9.4 KiB
JavaScript
Raw Normal View History

2024-07-12 07:06:02 +00:00
/**
* jQuery asGradient v0.3.3
* https://github.com/amazingSurge/jquery-asGradient
*
* Copyright (c) amazingSurge
* Released under the LGPL-3.0 license
*/
!function(t,e){if("function"==typeof define&&define.amd)define("AsGradient",["exports","jquery","jquery-asColor"],e);else if("undefined"!=typeof exports)e(exports,require("jquery"),require("jquery-asColor"));else{var n={exports:{}};e(n.exports,t.jQuery,t.AsColor),t.AsGradient=n.exports}}(this,function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(){var t=window.navigator.userAgent,e="";return/MSIE/g.test(t)?e="-ms-":/Firefox/g.test(t)?e="-moz-":/(WebKit)/i.test(t)?e="-webkit-":/Opera/g.test(t)&&(e="-o-"),e}function s(t){var e={top:"bottom",right:"left",bottom:"top",left:"right","right top":"left bottom","top right":"bottom left","bottom right":"top left","right bottom":"left top","left bottom":"right top","bottom left":"top right","top left":"bottom right","left top":"right bottom"};return e.hasOwnProperty(t)?e[t]:t}function a(t){return/^(top|left|right|bottom)$/i.test(t)}Object.defineProperty(t,"__esModule",{value:!0});var u=r(e),l=r(n),p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),h={prefixes:["-webkit-","-moz-","-ms-","-o-"],forceStandard:!0,angleUseKeyword:!0,emptyString:"",degradationFormat:!1,cleanPosition:!0,color:{format:!1,hexUseName:!1,reduceAlpha:!0,shortenHex:!0,zeroAlphaAsTransparent:!1,invalidValue:{r:0,g:0,b:0,a:1}}};String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)});var c={"to top":0,"to right":90,"to bottom":180,"to left":270,"to right top":45,"to top right":45,"to bottom right":135,"to right bottom":135,"to left bottom":225,"to bottom left":225,"to top left":315,"to left top":315},v=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(c),g=function(){var t=/(?:rgba|rgb|hsla|hsl)\s*\([\s\d\.,%]+\)|#[a-z0-9]{3,6}|[a-z]+/i,e=/\d{1,3}%/i,n=/(?:to ){0,1}(?:(?:top|left|right|bottom)\s*){1,2}|\d+deg/i,r=new RegExp("("+t.source+")\\s*("+e.source+"){0,1}","i"),o=new RegExp(r.source,"gi"),i=new RegExp("(?:("+n.source+")){0,1}\\s*,{0,1}\\s*(.*?)\\s*","i");return{FULL:new RegExp("^(-webkit-|-moz-|-ms-|-o-){0,1}(linear|radial|repeating-linear)-gradient\\s*\\(\\s*("+i.source+")\\s*\\)$","i"),ANGLE:n,COLOR:t,POSITION:e,STOP:r,STOPS:o,PARAMETERS:new RegExp("^"+i.source+"$","i")}}(),d={matchString:function(t){var e=this.parseString(t);return!!(e&&e.value&&e.value.stops&&e.value.stops.length>1)},parseString:function(t){t=u.default.trim(t);var e=void 0;if(null!==(e=g.FULL.exec(t))){var n=this.parseParameters(e[3]);return{prefix:void 0===e[1]?null:e[1],type:e[2],value:n}}return!1},parseParameters:function(t){var e=void 0;if(null!==(e=g.PARAMETERS.exec(t))){var n=this.parseStops(e[2]);return{angle:void 0===e[1]?0:e[1],stops:n}}return!1},parseStops:function(t){var e=this,n=void 0,r=[];return null!==(n=t.match(g.STOPS))&&(u.default.each(n,function(t,n){var o=e.parseStop(n);o&&r.push(o)}),r)},formatStops:function(t,e){for(var n=void 0,r=[],o=[],i=[],s=void 0,a=0;a<t.length;a++)s=void 0===(n=t[a]).position||null===n.position?0===a?0:a===t.length-1?1:void 0:n.position,o.push(s),i.push(n.color.toString());o=function(t){for(var e=null,n=void 0,r=0;r<t.length;r++)if(isNaN(t[r])){if(null===e){e=r;continue}}else if(e){n=(t[r]-t[e-1])/(r-e+1);for(var o=e;o<r;o++)t[o]=t[e-1]+(o-e+1)*n;e=null}return t}(o);for(var u=0;u<t.length;u++)s=e&&(0===u&&0===o[u]||u===t.length-1&&1===o[u])?"":" "+this.formatPosition(o[u]),r.push(i[u]+s);return r.join(", ")},parseStop:function(t){var e=void 0;if(null!==(e=g.STOP.exec(t))){var n=this.parsePosition(e[2]);return{color:e[1],position:n}}return!1},parsePo
//# sourceMappingURL=jquery-asGradient.min.js.map