PageSourceSearch

https://cdn6.zappter.com/assets/prod/2f6a7feecef4523a61577c2618d3ceaf.js?9.1.760

js zappter.com collected 2026-10-01 14:18:06 UTC 14,027 bytes, 1 lines download raw bytes

1!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Grapick=t():e.Grapick=t()}("undefined"!=typeof self?self:this,function(){return function(n){function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}var r={};return i.m=n,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([function(e,t,n){"use strict";function i(e,t,n){t=t.split(/\s+/);for(var i=0;i<t.length;++i)e.addEventListener(t[i],n)}function r(e,t,n){t=t.split(/\s+/);for(var i=0;i<t.length;++i)e.removeEventListener(t[i],n)}Object.defineProperty(t,"__esModule",{value:!0}),t.on=i,t.off=r;t.isFunction=function(e){return"function"==typeof e},t.isDef=function(e){return void 0!==e},t.getPointerEvent=function(e){return e.touches&&e.touches[0]||e}},function(e,t,n){"use strict";var i=n(2),r=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=function(e){return new r.default(e)}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),o=n(3),c=i(o),h=n(4),f=i(h),d=n(0),v=function(e,t){return e.position-t.position},p=function(e){return e+"-gradient("},g=function(e){function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,o);var n=l(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));e=Object.assign({},e);var t={pfx:"grp",el:".grp",colorEl:"",min:0,max:100,direction:"90deg",type:"linear",height:"30px",width:"100%",emptyColor:"#000",onValuePos:function(e){return parseInt(e)}};for(var i in t)i in e||(e[i]=t[i]);var r=e.el;if(!((r="string"==typeof r?document.querySelector(r):r)instanceof HTMLElement))throw"Element not found, given "+r;return n.el=r,n.handlers=[],n.options=e,n.on("handler:color:change",function(e,t){return n.change(t)}),n.on("handler:position:change",function(e,t){return n.change(t)}),n.on("handler:remove",function(e){return n.change(1)}),n.on("handler:add",function(e){return n.change(1)}),n.render(),n}return r(o,e),s(o,[{key:"destroy",value:function(){var n=this;this.clear(),this.e={},["el","handlers","options","colorPicker"].forEach(function(e){return n[e]=0}),["previewEl","wrapperEl","sandEl"].forEach(function(e){var t=n[e];t&&t.parentNode&&t.parentNode.removeChild(t),delete n[e]})}},{key:"setColorPicker",value:function(e){this.colorPicker=e}},{key:"getValue",value:function(e,t){var n=this.getColorValue(),i=e||this.getType(),r=["top","left","bottom","right","center"],o=t||this.getDirection();return["linear","repeating-linear"].indexOf(i)>=0&&r.indexOf(o)>=0&&(o="center"===o?"to right":"to "+o),["radial","repeating-radial"].indexOf(i)>=0&&r.indexOf(o)>=0&&(o="circle at "+o),n?i+"-gradient("+o+", "+n+")":""}},{key:"getSafeValue",value:function(e,t){var n=this.previewEl,i=this.getValue(e,t);if(!this.sandEl&&(this.sandEl=document.createElement("div")),!n||!i)return"";for(var r=this.sandEl.style,o=[i].concat(u(this.getPrefixedValues(e,t))),a=void 0,l=0;l<o.length&&(a=o[l],r.backgroundImage=a,r.backgroundImage!=a);l++);return r.backgroundImage}},{key:"setValue",value:function(){var r=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.type,e=this.direction,i=t.indexOf("(")+1,a=t.lastIndexOf(")"),l=t.substring(i,a),u=l.split(/,(?![^(]*\)) /);if(this.clear(o),!l)return void this.updatePreview();u.length>2&&(e=u.shift());var s=void 0;["repeating-linear","repeating-radial","linear","radial"].forEach(function(e){t.indexOf(p(e))>-1&&!s&&(s=1,n=e)}),this.setDirection(e,o),this.setType(n,o),u.forEach(function(e){var t=e.split(" "),n=parseFloat(t.pop()),i=t.join("");r.addHandler(n,i,0,o)}),this.updatePreview()}},{key:"getColorValue",value:function(){var e=this.handlers;return e.sort(v),e=1==e.length?[e[0],e[0]]:e,e.map(function(e){return e.getValue()}).join(", ")}},{key:"getPrefixedValues",value:function(e,t){var n=this.getValue(e,t);return["-moz-","-webkit-","-o-","-ms-"].map(function(e){return""+e+n})}},{key:"change",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};
1this.updatePreview(),!t.silent&&this.emit("change",e)}},{key:"setDirection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.options.direction=e;var n=t.complete,i=void 0===n?1:n;this.change(i,t)}},{key:"getDirection",value:function(){return this.options.direction}},{key:"setType",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.options.type=e;var n=t.complete,i=void 0===n?1:n;this.change(i,t)}},{key:"getType",value:function(){return this.options.type}},{key:"addHandler",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=new f.default(this,e,t,n,i);return!i.silent&&this.emit("handler:add",r),r}},{key:"getHandler",value:function(e){return this.handlers[e]}},{key:"getHandlers",value:function(){return this.handlers}},{key:"clear",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.handlers,n=t.length-1;n>=0;n--)t[n].remove(e)}},{key:"getSelected",value:function(){for(var e=this.getHandlers(),t=0;t<e.length;t++){var n=e[t];if(n.isSelected())return n}return null}},{key:"updatePreview",value:function(){var e=this.previewEl;e&&(e.style.backgroundImage=this.getValue("linear","to right"))}},{key:"initEvents",value:function(){var v=this,p=this.previewEl;p&&(0,d.on)(p,"click",function(e){var t=v.options,n=t.min,i=t.max,r={w:p.clientWidth,h:p.clientHeight},o=e.offsetX-p.clientLeft,a=e.offsetY-p.clientTop,l=o/r.w*100;if(!(l>i||l<n||a>r.h||a<0)){var u=document.createElement("canvas"),s=u.getContext("2d");u.width=r.w,u.height=r.h;var c=s.createLinearGradient(0,0,r.w,r.h);v.getHandlers().forEach(function(e){return c.addColorStop(e.position/100,e.color)}),s.fillStyle=c,s.fillRect(0,0,u.width,u.height),u.style.background="black";var h=u.getContext("2d").getImageData(o,a,1,1).data,f="rgba("+h[0]+", "+h[1]+", "+h[2]+", "+h[3]+")",d="rgba(0, 0, 0, 0)"==f?t.emptyColor:f;v.addHandler(l,d)}})}},{key:"render",value:function(){var e=this.options,t=this.el,n=e.pfx,i=e.height,r=e.width;if(t){var o=n+"-wrapper",a=n+"-preview";t.innerHTML='\n      <div class="'+o+'">\n        <div class="'+a+'"></div>\n      </div>\n    ';var l=t.querySelector("."+o),u=t.querySelector("."+a),s=l.style;s.position="relative",this.wrapperEl=l,this.previewEl=u,i&&(s.height=i),r&&(s.width=r),this.initEvents(),this.updatePreview()}}}]),o}(c.default);t.default=g},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),o=function(){function e(){i(this,e)}return r(e,[{key:"on",value:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n}),this}},{key:"once",value:function(e,t,n){function i(){r.off(e,i),t.apply(n,arguments)}var r=this;return i._=t,this.on(e,i,n)}},{key:"emit",value:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,r=n.length;for(i;i<r;i++)n[i].fn.apply(n[i].ctx,t);return this}},{key:"off",value:function(e,t){var n=this.e||(this.e={}),i=n[e],r=[];if(i&&t)for(var o=0,a=i.length;o<a;o++)i[o].fn!==t&&i[o].fn._!==t&&r.push(i[o]);return r.length?n[e]=r:delete n[e],this}}]),e}();t.default=o},function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),w=n(0),r=function(){function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"black",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};a(this,o),e.getHandlers().push(this),this.gp=e,this.position=t,this.color=n,this.selected=0,this.render(),i&&this.select(r)}return i(o,[{key:"toJSON",value:function(){return{position:this.position,selected:this.selected,color:this.color}}},{key:"setColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;
1this.color=e,this.emit("handler:color:change",this,t)}},{key:"setPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.getEl();this.position=e,n&&(n.style.left=e+"%"),this.emit("handler:position:change",this,t)}},{key:"getColor",value:function(){return this.color}},{key:"getPosition",value:function(){var e=this.position,t=this.gp,n=t.options.onValuePos;return(0,w.isFunction)(n)?n(e):e}},{key:"isSelected",value:function(){return!!this.selected}},{key:"getValue",value:function(){return this.getColor()+" "+this.getPosition()+"%"}},{key:"select",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.getEl(),n=this.gp.getHandlers();!e.keepSelect&&n.forEach(function(e){return e.deselect()}),this.selected=1;var i=this.getSelectedCls();t&&(t.className+=" "+i),this.emit("handler:select",this)}},{key:"deselect",value:function(){var e=this.getEl();this.selected=0;var t=this.getSelectedCls();e&&(e.className=e.className.replace(t,"").trim()),this.emit("handler:deselect",this)}},{key:"getSelectedCls",value:function(){return this.gp.options.pfx+"-handler-selected"}},{key:"remove",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.cpFn,i=this.getEl(),r=this.gp.getHandlers(),o=r.splice(r.indexOf(this),1)[0];return i&&i.parentNode.removeChild(i),!e.silent&&this.emit("handler:remove",o),(0,w.isFunction)(n)&&n(this),["el","gp"].forEach(function(e){return t[e]=0}),o}},{key:"getEl",value:function(){return this.el}},{key:"initEvents",value:function(){var i=this,e=this.getEl(),n=this.gp.previewEl,t=this.gp.options,r=t.min,o=t.max,a=e.querySelector("[data-toggle=handler-close]"),l=e.querySelector("[data-toggle=handler-color-c]"),u=e.querySelector("[data-toggle=handler-color-wrap]"),s=e.querySelector("[data-toggle=handler-color]"),c=e.querySelector("[data-toggle=handler-drag]"),h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.target.value;i.setColor(n,t),u&&(u.style.backgroundColor=n)};if(l&&(0,w.on)(l,"click",function(e){return e.stopPropagation()}),a&&(0,w.on)(a,"click",function(e){e.stopPropagation(),i.remove()}),s&&((0,w.on)(s,"change",h),(0,w.on)(s,"input",function(e){return h(e,0)})),c){var f=0,d=0,v=0,p={},g={},y={},m=function(e){var t=(0,w.getPointerEvent)(e);v=1,y.x=t.clientX-g.x,y.y=t.clientY-g.y,f=100*y.x,f/=p.w,f=d+f,f=f<r?r:f,f=f>o?o:f,i.setPosition(f,0),i.emit("handler:drag",i,f),(0,w.isDef)(e.button)&&0===e.which&&k(e)},k=function e(t){(0,w.off)(document,"touchmove mousemove",m),(0,w.off)(document,"touchend mouseup",e),v&&(v=0,i.setPosition(f),i.emit("handler:drag:end",i,f))},b=function(e){if(!(0,w.isDef)(e.button)||0===e.button){i.select();var t=(0,w.getPointerEvent)(e);d=i.position,p.w=n.clientWidth,p.h=n.clientHeight,g.x=t.clientX,g.y=t.clientY,(0,w.on)(document,"touchmove mousemove",m),(0,w.on)(document,"touchend mouseup",k),i.emit("handler:drag:start",i)}};(0,w.on)(c,"touchstart mousedown",b),(0,w.on)(c,"click",function(e){return e.stopPropagation()})}}},{key:"emit",value:function(){var e;(e=this.gp).emit.apply(e,arguments)}},{key:"render",value:function(){var e=this.gp,t=e.options,n=e.previewEl,i=e.colorPicker,r=t.pfx,o=t.colorEl,a=this.getColor();if(n){var l=document.createElement("div"),u=l.style,s=r+"-handler";return l.className=s,l.innerHTML='\n      <div class="'+s+'-close-c">\n        <div class="'+s+'-close" data-toggle="handler-close">&Cross;</div>\n      </div>\n      <div class="'+s+'-drag" data-toggle="handler-drag"></div>\n      <div class="'+s+'-cp-c" data-toggle="handler-color-c">\n        '+(o||'\n          <div class="'+s+'-cp-wrap" data-toggle="handler-color-wrap" style="background-color: '+a+'">\n            <input type="color" data-toggle="handler-color" value="'+a+'">\n          </div>')+"\n      </div>\n    ",u.position="absolute",u.top=0,u.left=this.position+"%",n.appendChild(l),this.el=l,this.initEvents(),this.cpFn=i&&i(this),l}}}]),o}();t.default=r}])});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.