mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-03-01 01:20:49 +03:00
6 lines
36 KiB
JavaScript
6 lines
36 KiB
JavaScript
![]() |
/*! QRious v2.3.0 | (C) 2017 Alasdair Mercer | GPL v3 License
|
||
|
Based on jsqrencode | (C) 2010 tz@execpc.com | GPL v3 License
|
||
|
*/
|
||
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("qrious",e):t.QRious=e()}(this,function(){"use strict";function t(t){return t&&t.__esModule?t.default:t}function e(t,e){return e={exports:{}},t(e,e.exports),e.exports}var n=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},r=function(t){return Object(n(t))},i={}.hasOwnProperty,s=function(t,e){return i.call(t,e)},o=e(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),u=o["__core-js_shared__"]||(o["__core-js_shared__"]={}),a=function(t){return u[t]||(u[t]={})},f=0,c=Math.random(),h=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++f+c).toString(36))},l=a("keys"),_=function(t){return l[t]||(l[t]=h(t))},v=_("IE_PROTO"),d=Object.prototype,p=Object.getPrototypeOf||function(t){return t=r(t),s(t,v)?t[v]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?d:null},y=e(function(t){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)}),g=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},k=function(t,e,n){if(g(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}},b=function(t){return"object"==typeof t?null!==t:"function"==typeof t},m=function(t){if(!b(t))throw TypeError(t+" is not an object!");return t},w=function(t){try{return!!t()}catch(t){return!0}},B=!w(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),O=o.document,M=b(O)&&b(O.createElement),S=function(t){return M?O.createElement(t):{}},E=!B&&!w(function(){return 7!=Object.defineProperty(S("div"),"a",{get:function(){return 7}}).a}),j=function(t,e){if(!b(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!b(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!b(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!b(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},A=Object.defineProperty,N=B?Object.defineProperty:function(t,e,n){if(m(t),e=j(e,!0),m(n),E)try{return A(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t},P={f:N},L=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},C=B?function(t,e,n){return P.f(t,e,L(1,n))}:function(t,e,n){return t[e]=n,t},T=function(t,e,n){var r,i,s,u=t&T.F,a=t&T.G,f=t&T.S,c=t&T.P,h=t&T.B,l=t&T.W,_=a?y:y[e]||(y[e]={}),v=_.prototype,d=a?o:f?o[e]:(o[e]||{}).prototype;a&&(n=e);for(r in n)(i=!u&&d&&void 0!==d[r])&&r in _||(s=i?d[r]:n[r],_[r]=a&&"function"!=typeof d[r]?n[r]:h&&i?k(s,o):l&&d[r]==s?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(s):c&&"function"==typeof s?k(Function.call,s):s,c&&((_.virtual||(_.virtual={}))[r]=s,t&T.R&&v&&!v[r]&&C(v,r,s)))};T.F=1,T.G=2,T.S=4,T.P=8,T.B=16,T.W=32,T.U=64,T.R=128;var x=T;!function(t,e){var n=(y.Object||{})[t]||Object[t],r={};r[t]=e(n),x(x.S+x.F*w(function(){n(1)}),"Object",r)}("getPrototypeOf",function(){return function(t){return p(r(t))}});var R=y.Object.getPrototypeOf,F=e(function(t){t.exports={default:R,__esModule:!0}}),I=t(F),z=e(function(t,e){e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}}),U=t(z);x(x.S+x.F*!B,"Object",{defineProperty:P.f});var D=y.Object,K=function(t,e,n){return D.defineProperty(t,e,n)},V=e(function(t){t.exports={default:K,__esModule:!0}}),q=e(function(t,e){e.__esModule=!0;var n=function(t){return t&&t.__esModule?t:{default:t}}(V);e.default=function(){function t(t,e){for(
|
||
|
this._setMask(8,n);for(var r=0;r<7;r++)this._setMask(8,r+t-7)}},{key:"_setMask",value:function(e,n){var r=t._getMaskBit(e,n);this._mask[r]=1}},{key:"_syncMask",value:function(){for(var t=this.width,e=0;e<t;e++)for(var n=0;n<=e;n++)this.buffer[n+t*e]&&this._setMask(n,e)}}]),t}(),an=function(t){function e(){return U(this,e),Ue(this,(e.__proto__||I(e)).apply(this,arguments))}return He(e,t),G(e,[{key:"draw",value:function(){this.element.src=this.qrious.toDataURL()}},{key:"reset",value:function(){this.element.src=""}},{key:"resize",value:function(){this.element.width=this.element.height=this.qrious.size}}]),e}(tn),fn=function(){function t(e,n,r,i){U(this,t),this._name=e,this._defaultValue=n,this._valueTransformer=r,this._fieldName="function"==typeof i?i(this):"_"+e}return G(t,[{key:"transform",value:function(t){var e=this._valueTransformer;return"function"==typeof e?e(t,this):t}},{key:"fieldName",get:function(){return this._fieldName}},{key:"name",get:function(){return this._name}},{key:"defaultValue",get:function(){return this._defaultValue}}]),t}(),cn=Wt.f,hn=function(t){return function(e){for(var n,r=tt(e),i=ct(r),s=i.length,o=0,u=[];s>o;)cn.call(r,n=i[o++])&&u.push(t?[n,r[n]]:r[n]);return u}}(!1);x(x.S,"Object",{values:function(t){return hn(t)}});var ln=y.Object.values,_n=e(function(t){t.exports={default:ln,__esModule:!0}}),vn=t(_n),dn=function(){function t(e){var n=this;U(this,t),this._options={},e.forEach(function(t){n._options[t.name]=t})}return G(t,null,[{key:"_get",value:function(t,e){return e[t.fieldName]}},{key:"_set",value:function(t,e,n){var r=t.fieldName,i=n[r],s=t.transform(null!=e?e:t.defaultValue);return n[r]=s,s!==i}}]),G(t,[{key:"applyDefaults",value:function(e){var n=this._options;for(var r in n)if(Qe.hasOwn(n,r)){var i=n[r];t._set(i,i.defaultValue,e)}}},{key:"exists",value:function(t){return null!=this._options[t]}},{key:"get",value:function(e,n){return t._get(this._options[e],n)}},{key:"getAll",value:function(e){var n=this._options,r={};for(var i in n)Qe.hasOwn(n,i)&&(r[i]=t._get(n[i],e));return r}},{key:"set",value:function(e,n,r){var i=this._options[e];if(!i)throw new Error("Invalid option: "+e);return t._set(i,n,r)}},{key:"setAll",value:function(t,e){if(!t)return!1;var n=!1;for(var r in t)Qe.hasOwn(t,r)&&this.set(r,t[r],e)&&(n=!0);return n}},{key:"options",get:function(){return vn(this._options)}}]),t}(),pn=function(){function t(){U(this,t),this._services={}}return G(t,[{key:"getService",value:function(t){var e=this._services[t];if(!e)throw new Error("Service is not being managed with name: "+t);return e}},{key:"setService",value:function(t,e){if(this._services[t])throw new Error("Service is already managed with name: "+t);e&&(this._services[t]=e)}}]),t}(),yn=new dn([new fn("background","white"),new fn("backgroundAlpha",1,Qe.abs),new fn("element"),new fn("foreground","black"),new fn("foregroundAlpha",1,Qe.abs),new fn("level","L",Qe.toUpperCase),new fn("mime","image/png"),new fn("padding",null,Qe.abs),new fn("size",100,Qe.abs),new fn("value","")]),gn=new pn,kn=function(){function t(e){U(this,t),yn.applyDefaults(this),yn.setAll(e,this);var n=yn.get("element",this),r=gn.getService("element"),i=n&&r.isCanvas(n)?n:r.createCanvas(),s=n&&r.isImage(n)?n:r.createImage();this._canvasRenderer=new en(this,i,!0),this._imageRenderer=new an(this,s,s===n),this.update()}return G(t,null,[{key:"use",value:function(t){gn.setService(t.getName(),t)}},{key:"DEFAULTS",get:function(){var t={};return yn.options.forEach(function(e){t[e.name]=e.defaultValue}),t}},{key:"VERSION",get:function(){return"2.3.0"}}]),G(t,[{key:"get",value:function(){return yn.getAll(this)}},{key:"set",value:function(t){yn.setAll(t,this)&&this.update()}},{key:"toDataURL",value:function(t){return this.canvas.toDataURL(t||this.mime)}},{key:"update",value:function(){var t=new un({level:this.level,value:this.value});this._canvasRenderer.render(t),this._imageRenderer.render(t)}},{key:"background",get:function(){return yn.get("background",this)},set:function(t){yn.set("background",t,this)&&this.update()}},{key:"backgroundAlpha",get:function(){return yn.get("
|