UNPKG

vue-luck-draw

Version:

一个支持 vue2 / vue3 的(大转盘抽奖 / 九宫格抽奖)luckydraw 插件

16 lines (14 loc) 63.7 kB
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vue-luck-draw"]=e():t["vue-luck-draw"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"0366":function(t,e,n){var r=n("1c0b");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};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)}}},"057f":function(t,e,n){var r=n("fc6a"),i=n("241c").f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(t){try{return i(t)}catch(e){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?c(t):i(r(t))}},"06cf":function(t,e,n){var r=n("83ab"),i=n("d1e7"),o=n("5c6c"),a=n("fc6a"),c=n("c04e"),u=n("5135"),s=n("0cfb"),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=c(e,!0),s)try{return f(t,e)}catch(n){}if(u(t,e))return o(!i.f.call(t,e),t[e])}},"0cfb":function(t,e,n){var r=n("83ab"),i=n("d039"),o=n("cc12");t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"159b":function(t,e,n){var r=n("da84"),i=n("fdbc"),o=n("17c2"),a=n("9112");for(var c in i){var u=r[c],s=u&&u.prototype;if(s&&s.forEach!==o)try{a(s,"forEach",o)}catch(f){s.forEach=o}}},"17c2":function(t,e,n){"use strict";var r=n("b727").forEach,i=n("a640"),o=n("ae40"),a=i("forEach"),c=o("forEach");t.exports=a&&c?[].forEach:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}},"1be4":function(t,e,n){var r=n("d066");t.exports=r("document","documentElement")},"1c0b":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},"1d80":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"1dde":function(t,e,n){var r=n("d039"),i=n("b622"),o=n("2d00"),a=i("species");t.exports=function(t){return o>=51||!r((function(){var e=[],n=e.constructor={};return n[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},"23cb":function(t,e,n){var r=n("a691"),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},"23e7":function(t,e,n){var r=n("da84"),i=n("06cf").f,o=n("9112"),a=n("6eeb"),c=n("ce4e"),u=n("e893"),s=n("94ca");t.exports=function(t,e){var n,f,l,h,d,p,g=t.target,v=t.global,b=t.stat;if(f=v?r:b?r[g]||c(g,{}):(r[g]||{}).prototype,f)for(l in e){if(d=e[l],t.noTargetGet?(p=i(f,l),h=p&&p.value):h=f[l],n=s(v?l:g+(b?".":"#")+l,t.forced),!n&&void 0!==h){if(typeof d===typeof h)continue;u(d,h)}(t.sham||h&&h.sham)&&o(d,"sham",!0),a(f,l,d,t)}}},"241c":function(t,e,n){var r=n("ca84"),i=n("7839"),o=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},"2d00":function(t,e,n){var r,i,o=n("da84"),a=n("342f"),c=o.process,u=c&&c.versions,s=u&&u.v8;s?(r=s.split("."),i=r[0]+r[1]):a&&(r=a.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/),r&&(i=r[1]))),t.exports=i&&+i},"32fc":function(t,e,n){t.exports=n("358c")},"342f":function(t,e,n){var r=n("d066");t.exports=r("navigator","userAgent")||""},"358c":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function c(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!((i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}function u(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,c=o.length;a<c;a++,i++)r[i]=o[a];return r}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)}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=e[i];if(t.call(r,o,i,e))return o;i++}}});var s=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.some((function(e){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()===e}))},f=function(t){return[].filter.call(t,(function(t){return"\n"!==t})).join("")},l=function(t){if("string"!=typeof t)return!1;if("transparent"===(t=t.toLocaleLowerCase().trim()))return!1;if(/^rgba/.test(t)){var e=/([^\s,]+)\)$/.exec(t);if(0===(null===(n=e)?0:"object"==typeof n?NaN:"number"==typeof n?n:"string"==typeof n?"%"===n[n.length-1]?Number(n.slice(0,-1))/100:Number(n):NaN))return!1}var n;return!0},h=function(){function t(){this.subs=[]}return t.prototype.addSub=function(t){this.subs.includes(t)||this.subs.push(t)},t.prototype.notify=function(){this.subs.forEach((function(t){t.update()}))},t}(),d="__proto__"in{};function p(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var g=Array.prototype,v=Object.create(g);["push","pop","shift","unshift","sort","splice","reverse"].forEach((function(t){v[t]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=g[t].apply(this,e),i=this.__luckyOb__;return["push","unshift","splice"].includes(t)&&i.walk(this),i.dep.notify(),r}}));var b=function(){function t(t){this.dep=new h,p(t,"__luckyOb__",this),Array.isArray(t)&&(d?t.__proto__=v:Object.getOwnPropertyNames(v).forEach((function(e){p(t,e,v[e])}))),this.walk(t)}return t.prototype.walk=function(t){Object.keys(t).forEach((function(e){m(t,e,t[e])}))},t}();function y(t){if(t&&"object"==typeof t)return"__luckyOb__"in t?t.__luckyOb__:new b(t)}function m(t,e,n){var r=new h,i=Object.getOwnPropertyDescriptor(t,e);if(!i||!1!==i.configurable){var o=i&&i.get,a=i&&i.set;o&&!a||2!==arguments.length||(n=t[e]);var c=y(n);Object.defineProperty(t,e,{get:function(){var e=o?o.call(t):n;return h.target&&(r.addSub(h.target),c&&c.dep.addSub(h.target)),e},set:function(e){e!==n&&(n=e,o&&!a||(a?a.call(t,e):n=e,c=y(e),r.notify()))}})}}var w=0,x=function(){function t(t,e,n,r){void 0===r&&(r={}),this.id=w++,this.$lucky=t,this.expr=e,this.deep=!!r.deep,this.getter="function"==typeof e?e:function(t){t+=".";for(var e=[],n="",r=0;r<t.length;r++){var i=t[r];if(/\[|\./.test(i))e.push(n),n="";else{if(/\W/.test(i))continue;n+=i}}return function(t){return e.reduce((function(t,e){return t[e]}),t)}}(e),this.cb=n,this.value=this.get()}return t.prototype.get=function(){h.target=this;var t=this.getter.call(this.$lucky,this.$lucky);return this.deep&&function(t){var e=function(t){s(t,"array","object")&&Object.keys(t).forEach((function(n){var r=t[n];e(r)}))};e(t)}(t),h.target=null,t},t.prototype.update=function(){var t=this.get(),e=this.value;this.value=t,this.cb.call(this.$lucky,t,e)},t}(),S=function(){function t(t){var e=this;this.htmlFontSize=16,this.rAF=function(){},this.boxWidth=0,this.boxHeight=0,this.setHTMLFontSize(),"string"==typeof t?t={el:t}:1===t.nodeType&&(t={el:"",divElement:t}),t=t,this.config=t,this.setDpr(),this.initWindowFunction(),t.flag||(t.flag="WEB"),Object.prototype.hasOwnProperty.call(t,"ob")||(t.ob=!0),t.el&&(t.divElement=document.querySelector(t.el)),t.divElement&&(t.canvasElement=document.createElement("canvas"),t.divElement.appendChild(t.canvasElement)),this.resetWidthAndHeight(),t.canvasElement&&(t.ctx=t.canvasElement.getContext("2d"),t.canvasElement.setAttribute("package","lucky-canvas@1.5.3"),t.canvasElement.addEventListener("click",(function(t){return e.handleClick(t)})),t.canvasElement.addEventListener("mousemove",(function(t){return e.handleMouseMove(t)})),t.canvasElement.addEventListener("mousedown",(function(t){return e.handleMouseDown(t)})),t.canvasElement.addEventListener("mouseup",(function(t){return e.handleMouseUp(t)}))),this.ctx=t.ctx,t.ctx?this.boxWidth&&this.boxHeight||console.error("无法获取到宽度或高度"):console.error("无法获取到 CanvasContext2D")}return t.prototype.init=function(t){this.setDpr(),this.setHTMLFontSize(),this.resetWidthAndHeight(),this.zoomCanvas()},t.prototype.handleClick=function(t){},t.prototype.handleMouseDown=function(t){},t.prototype.handleMouseUp=function(t){},t.prototype.handleMouseMove=function(t){},t.prototype.conversionAxis=function(t,e){return[0,0]},t.prototype.setDpr=function(){var t=this.config;t.dpr||(window?window.dpr=t.dpr=window.devicePixelRatio||1:t.dpr||console.error(t,"未传入 dpr 可能会导致绘制异常"))},t.prototype.setHTMLFontSize=function(){window&&(this.htmlFontSize=+window.getComputedStyle(document.documentElement).fontSize.slice(0,-2))},t.prototype.resetWidthAndHeight=function(){var t=this.config,e=0,n=0;t.divElement&&(e=t.divElement.offsetWidth,n=t.divElement.offsetHeight),this.boxWidth=this.getLength(t.width)||e,this.boxHeight=this.getLength(t.height)||n,t.divElement&&(t.divElement.style.overflow="hidden",t.divElement.style.width=this.boxWidth+"px",t.divElement.style.height=this.boxHeight+"px")},t.prototype.initWindowFunction=function(){var t=this.config;if(window)return this.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},t.setTimeout=window.setTimeout,t.setInterval=window.setInterval,t.clearTimeout=window.clearTimeout,void(t.clearInterval=window.clearInterval);if(t.rAF)this.rAF=t.rAF;else if(t.setTimeout){var e=t.setTimeout;this.rAF=function(t){return e(t,16.7)}}else this.rAF=function(t){return setTimeout(t,16.7)}},t.prototype.zoomCanvas=function(){var t=this.config,e=this.ctx,n=t.canvasElement,r=t.dpr,i=[this.boxWidth*r,this.boxHeight*r],o=i[0],a=i[1],c=function(t){return(t*r-t)/(t*r)*(r/2)*100};n&&(n.width=o,n.height=a,n.style.width=o+"px",n.style.height=a+"px",n.style.transform="scale("+1/r+") translate("+-c(o)+"%, "+-c(a)+"%)",e.scale(r,r))},t.prototype.loadImg=function(t,e,n){var r=this;return void 0===n&&(n="$resolve"),new Promise((function(i,o){if(t||o("=> '"+e.src+"' 不能为空或不合法"),"WEB"===r.config.flag){var a=new Image;a.src=t,a.onload=function(){return i(a)},a.onerror=function(){return o("=> '"+e.src+"' 图片加载失败")}}else e[n]=i}))},t.prototype.drawImage=function(t,e,n,r,i){var o,a=this.config,c=this.ctx;return["WEB","MP-WX"].includes(a.flag)?o=t:["UNI-H5","UNI-MP","TARO-H5","TARO-MP"].includes(a.flag)&&(o=t.path),c.drawImage(o,e,n,r,i)},t.prototype.getLength=function(t){return s(t,"number")?t:s(t,"string")?this.changeUnits(t):0},t.prototype.changeUnits=function(t,e){var n=this;return void 0===e&&(e=1),Number(t.replace(/^([-]*[0-9.]*)([a-z%]*)$/,(function(t,r,i){var o={"%":function(t){return t*(e/100)},px:function(t){return 1*t},rem:function(t){return t*n.htmlFontSize}}[i];if(o)return o(r);var a=n.config.unitFunc;return a?a(r,i):r})))},t.prototype.$set=function(t,e,n){t&&"object"==typeof t&&m(t,e,n)},t.prototype.$computed=function(t,e,n){var r=this;Object.defineProperty(t,e,{get:function(){return n.call(r)}})},t.prototype.$watch=function(t,e,n){void 0===n&&(n={}),"object"==typeof e&&(e=(n=e).handler);var r=new x(this,t,e,n);return n.immediate&&e.call(this,r.value),function(){}},t}(),k=function(t){return Math.PI/180*t},O=function(t,e){return[+(Math.cos(t)*e).toFixed(8),+(Math.sin(t)*e).toFixed(8)]},I=function(t,e){var n=-t/e;return[n,-n*t+e]},_=function(t,e,n,r,i,o){var a;if(void 0===o&&(o=!0),Math.abs(i-r).toFixed(8)>=k(180).toFixed(8)){var c=(i+r)/2;return o?(_(t,e,n,r,c,o),_(t,e,n,c,i,o)):(_(t,e,n,c,i,o),_(t,e,n,r,c,o)),!1}o||(r=(a=[i,r])[0],i=a[1]);var u=O(r,n),s=u[0],f=u[1],l=O(i,n),h=l[0],d=l[1],p=I(s,f),g=p[0],v=p[1],b=I(h,d),y=b[0],m=b[1],w=(m-v)/(g-y),x=(y*v-g*m)/(y-g);isNaN(w)&&(Math.abs(s)===+n.toFixed(8)&&(w=s),Math.abs(h)===+n.toFixed(8)&&(w=h)),g===1/0||g===-1/0?x=y*w+m:y!==1/0&&y!==-1/0||(x=g*w+v),e.lineTo(s,f),t.indexOf("MP")>0?e.quadraticCurveTo(w,x,h,d):e.arcTo(w,x,h,d,n)},T=function(t,e,n,r,i,o,a,c){n||(n=a);var u=k(90/Math.PI/r*a),s=k(90/Math.PI/n*a),f=i+u,l=o-u,h=i+s,d=o-s;e.beginPath(),e.fillStyle=c,e.moveTo.apply(e,O(f,r)),_(t,e,r,f,l,!0),d>h?_(t,e,n,h,d,!1):e.lineTo.apply(e,O((i+o)/2,a/2/Math.abs(Math.sin((i-o)/2)))),e.closePath(),e.fill()},E=function(t,e,n,r,i,o,a){var c=Math.min(r,i);o>c/2&&(o=c/2),t.beginPath(),t.fillStyle=a,t.moveTo(e+o,n),t.lineTo(e+o,n),t.lineTo(e+r-o,n),t.quadraticCurveTo(e+r,n,e+r,n+o),t.lineTo(e+r,n+i-o),t.quadraticCurveTo(e+r,n+i,e+r-o,n+i),t.lineTo(e+o,n+i),t.quadraticCurveTo(e,n+i,e,n+i-o),t.lineTo(e,n+o),t.quadraticCurveTo(e,n,e+o,n),t.closePath(),t.fill()},C={easeIn:function(t,e,n,r){return t>=r&&(t=r),n*(t/=r)*t+e},easeOut:function(t,e,n,r){return t>=r&&(t=r),-n*(t/=r)*(t-2)+e}},z={easeIn:function(t,e,n,r){return t>=r&&(t=r),-n*Math.cos(t/r*(Math.PI/2))+n+e},easeOut:function(t,e,n,r){return t>=r&&(t=r),n*Math.sin(t/r*(Math.PI/2))+e}},j={easeIn:function(t,e,n,r){return t>=r&&(t=r),0==t?e:n*Math.pow(2,10*(t/r-1))+e},easeOut:function(t,e,n,r){return t>=r&&(t=r),t==r?e+n:n*(1-Math.pow(2,-10*t/r))+e}},P={easeIn:function(t,e,n,r){return t>=r&&(t=r),-n*(Math.sqrt(1-(t/=r)*t)-1)+e},easeOut:function(t,e,n,r){return t>=r&&(t=r),n*Math.sqrt(1-(t=t/r-1)*t)+e}},$=Object.freeze({__proto__:null,quad:C,cubic:{easeIn:function(t,e,n,r){return t>=r&&(t=r),n*(t/=r)*t*t+e},easeOut:function(t,e,n,r){return t>=r&&(t=r),n*((t=t/r-1)*t*t+1)+e}},quart:{easeIn:function(t,e,n,r){return t>=r&&(t=r),n*(t/=r)*t*t*t+e},easeOut:function(t,e,n,r){return t>=r&&(t=r),-n*((t=t/r-1)*t*t*t-1)+e}},quint:{easeIn:function(t,e,n,r){return t>=r&&(t=r),n*(t/=r)*t*t*t*t+e},easeOut:function(t,e,n,r){return t>=r&&(t=r),n*((t=t/r-1)*t*t*t*t+1)+e}},sine:z,expo:j,circ:P}),A=function(t){function e(e,n){var r;void 0===n&&(n={});var i=t.call(this,e)||this;return i.blocks=[],i.prizes=[],i.buttons=[],i.defaultConfig={},i._defaultConfig={gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:.8},i.defaultStyle={},i._defaultStyle={fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",lineHeight:"",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},i.Radius=0,i.prizeRadius=0,i.prizeDeg=0,i.prizeRadian=0,i.rotateDeg=0,i.maxBtnRadius=0,i.startTime=0,i.endTime=0,i.stopDeg=0,i.endDeg=0,i.FPS=16.6,i.blockImgs=[[]],i.prizeImgs=[[]],i.btnImgs=[[]],e.ob&&(i.initData(n),i.initWatch()),i.initComputed(),null===(r=e.beforeCreate)||void 0===r||r.call(i),i.init({blockImgs:i.blocks.map((function(t){return t.imgs})),prizeImgs:i.prizes.map((function(t){return t.imgs})),btnImgs:i.buttons.map((function(t){return t.imgs}))}),i}return i(e,t),e.prototype.initData=function(t){this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},e.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){return o({gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:.8},t.defaultConfig)})),this.$computed(this,"_defaultStyle",(function(){return o({fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)}))},e.prototype.initWatch=function(){var t=this;this.$watch("blocks",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("prizes",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("buttons",(function(e){return t.init({btnImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("defaultConfig",(function(){return t.draw()}),{deep:!0}),this.$watch("defaultStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("startCallback",(function(){return t.init({})})),this.$watch("endCallback",(function(){return t.init({})}))},e.prototype.init=function(e){var n,r,i=this;t.prototype.init.call(this);var o=this.config,a=this.ctx;this.Radius=Math.min(this.boxWidth,this.boxHeight)/2,null===(n=o.beforeInit)||void 0===n||n.call(this),a.translate(this.Radius,this.Radius),this.draw(),this.draw(),Object.keys(e).forEach((function(t){var n=t,r={blockImgs:"blocks",prizeImgs:"prizes",btnImgs:"buttons"}[n],o=e[n];o&&o.forEach((function(t,e){t&&t.forEach((function(t,o){i.loadAndCacheImg(r,e,n,o,(function(){i.draw()}))}))}))})),null===(r=o.afterInit)||void 0===r||r.call(this)},e.prototype.handleClick=function(t){var e,n=this.ctx;n.beginPath(),n.arc(0,0,this.maxBtnRadius,0,2*Math.PI,!1),n.isPointInPath(t.offsetX,t.offsetY)&&(this.startTime||null===(e=this.startCallback)||void 0===e||e.call(this,t))},e.prototype.loadAndCacheImg=function(t,e,n,r,i){return a(this,void 0,void 0,(function(){var o,a,u=this;return c(this,(function(c){return(o=this[t][e])&&o.imgs&&(a=o.imgs[r])?(this[n][e]||(this[n][e]=[]),this.loadImg(a.src,a).then((function(t){u[n][e][r]=t,i.call(u)})).catch((function(n){console.error(t+"["+e+"].imgs["+r+"] "+n)})),[2]):[2]}))}))},e.prototype.computedWidthAndHeight=function(t,e,n,r){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var i=this.getWidth(e.width,n);return[i,t.height*(i/t.width)]}if(!e.width&&e.height){var o=this.getHeight(e.height,r);return[t.width*(o/t.height),o]}return[this.getWidth(e.width,n),this.getHeight(e.height,r)]},e.prototype.draw=function(){var t,e,n=this,r=this,i=r.config,o=r.ctx,a=r._defaultConfig,c=r._defaultStyle;null===(t=i.beforeDraw)||void 0===t||t.call(this,o),o.clearRect(-this.Radius,-this.Radius,2*this.Radius,2*this.Radius),this.prizeRadius=this.blocks.reduce((function(t,e,r){return l(e.background)&&(o.beginPath(),o.fillStyle=e.background,o.arc(0,0,t,0,2*Math.PI,!1),o.fill()),e.imgs&&e.imgs.forEach((function(e,i){if(n.blockImgs[r]){var a=n.blockImgs[r][i];if(a){var c=n.computedWidthAndHeight(a,e,2*t,2*t),u=c[0],s=c[1],f=[n.getOffsetX(u),n.getHeight(e.top,2*t)-t],l=f[0],h=f[1];o.save(),e.rotate&&o.rotate(k(n.rotateDeg)),n.drawImage(a,l,h,u,s),o.restore()}}})),t-n.getLength(e.padding&&e.padding.split(" ")[0])}),this.Radius),this.prizeDeg=360/this.prizes.length,this.prizeRadian=k(this.prizeDeg);var u=k(-90+this.rotateDeg+a.offsetDegree),s=function(t){return n.getOffsetX(o.measureText(t).width)},h=function(t,e,r){var i=t.lineHeight||c.lineHeight||t.fontSize||c.fontSize;return n.getHeight(t.top,e)+(r+1)*n.getLength(i)};o.save(),this.prizes.forEach((function(t,e){var r=u+e*n.prizeRadian,d=n.prizeRadius-n.maxBtnRadius,p=t.background||c.background;l(p)&&function(t,e,n,r,i,o,a,c){a?T(t,e,n,r,i,o,a,c):(e.beginPath(),e.fillStyle=c,e.moveTo(0,0),e.arc(0,0,r,i,o,!1),e.closePath(),e.fill())}(i.flag,o,n.maxBtnRadius,n.prizeRadius,r-n.prizeRadian/2,r+n.prizeRadian/2,n.getLength(a.gutter),p);var g=Math.cos(r)*n.prizeRadius,v=Math.sin(r)*n.prizeRadius;o.translate(g,v),o.rotate(r+k(90)),t.imgs&&t.imgs.forEach((function(t,r){if(n.prizeImgs[e]){var i=n.prizeImgs[e][r];if(i){var o=n.computedWidthAndHeight(i,t,n.prizeRadian*n.prizeRadius,d),a=o[0],c=o[1],u=[n.getOffsetX(a),n.getHeight(t.top,d)],s=u[0],f=u[1];n.drawImage(i,s,f,a,c)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||c.fontColor,r=t.fontWeight||c.fontWeight,i=n.getLength(t.fontSize||c.fontSize),u=t.fontStyle||c.fontStyle;o.fillStyle=e,o.font=r+" "+(i>>0)+"px "+u;var l=[],p=String(t.text);if(Object.prototype.hasOwnProperty.call(t,"wordWrap")?t.wordWrap:c.wordWrap){p=f(p);for(var g="",v=0;v<p.length;v++){g+=p[v];var b=o.measureText(g).width,y=(n.prizeRadius-h(t,d,l.length))*Math.tan(n.prizeRadian/2)*2-n.getLength(a.gutter);b>n.getWidth(t.lengthLimit||c.lengthLimit,y)&&(l.push(g.slice(0,-1)),g=p[v])}g&&l.push(g),l.length||l.push(p)}else l=p.split("\n");l.filter((function(t){return!!t})).forEach((function(e,n){o.fillText(e,s(e),h(t,d,n))}))})),o.rotate(k(360)-r-k(90)),o.translate(-g,-v)})),o.restore(),this.buttons.forEach((function(t,e){var r=n.getHeight(t.radius);n.maxBtnRadius=Math.max(n.maxBtnRadius,r),l(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.arc(0,0,r,0,2*Math.PI,!1),o.fill()),t.pointer&&l(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.moveTo(-r,0),o.lineTo(r,0),o.lineTo(0,2*-r),o.closePath(),o.fill()),t.imgs&&t.imgs.forEach((function(t,i){if(n.btnImgs[e]){var o=n.btnImgs[e][i];if(o){var a=n.computedWidthAndHeight(o,t,2*r,2*r),c=a[0],u=a[1],s=[n.getOffsetX(c),n.getHeight(t.top,r)],f=s[0],l=s[1];n.drawImage(o,f,l,c,u)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||c.fontColor,i=t.fontWeight||c.fontWeight,a=n.getLength(t.fontSize||c.fontSize),u=t.fontStyle||c.fontStyle;o.fillStyle=e,o.font=i+" "+(a>>0)+"px "+u,String(t.text).split("\n").forEach((function(e,n){o.fillText(e,s(e),h(t,r,n))}))}))})),null===(e=i.afterDraw)||void 0===e||e.call(this,o)},e.prototype.play=function(){this.startTime||(this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},e.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.rotateDeg=this.prizeDeg/2-this._defaultConfig.offsetDegree,this.draw())},e.prototype.run=function(t){void 0===t&&(t=0);var e=this,n=e.rAF,r=e.prizeFlag,i=e.prizeDeg,o=e.rotateDeg,a=e._defaultConfig,c=Date.now()-this.startTime;if(c>=a.accelerationTime&&void 0!==r){this.FPS=c/t,this.endTime=Date.now(),this.stopDeg=o;for(var u=(Math.random()*i-i/2)*this.getLength(a.stopRange),s=0;++s;){var f=360*s-r*i-o-a.offsetDegree+u;if($[a.speedFunction].easeOut(this.FPS,this.stopDeg,f,a.decelerationTime)-this.stopDeg>a.speed){this.endDeg=f;break}}return this.slowDown()}this.rotateDeg=(o+$[a.speedFunction].easeIn(c,0,a.speed,a.accelerationTime))%360,this.draw(),n(this.run.bind(this,t+1))},e.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,i=e.prizeFlag,a=e.stopDeg,c=e.endDeg,u=e._defaultConfig,s=Date.now()-this.endTime;if(-1!==i){if(s>=u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,o({},r.find((function(t,e){return e===i})))));this.rotateDeg=$[u.speedFunction].easeOut(s,a,c,u.decelerationTime)%360,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},e.prototype.getWidth=function(t,e){return void 0===e&&(e=this.prizeRadian*this.prizeRadius),s(t,"number")?t:s(t,"string")?this.changeUnits(t,e):0},e.prototype.getHeight=function(t,e){return void 0===e&&(e=this.prizeRadius),s(t,"number")?t:s(t,"string")?this.changeUnits(t,e):0},e.prototype.getOffsetX=function(t){return-t/2},e.prototype.conversionAxis=function(t,e){var n=this.config;return[t/n.dpr-this.Radius,e/n.dpr-this.Radius]},e}(S),L=function(t){function e(e,n){var r;void 0===n&&(n={});var i=t.call(this,e)||this;i.rows=3,i.cols=3,i.blocks=[],i.prizes=[],i.buttons=[],i.defaultConfig={},i._defaultConfig={gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},i.defaultStyle={},i._defaultStyle={borderRadius:20,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",lineHeight:"",background:"rgba(0,0,0,0)",shadow:"",wordWrap:!0,lengthLimit:"90%"},i.activeStyle={},i._activeStyle={background:"#ffce98",shadow:"",fontStyle:"",fontWeight:"",fontSize:"",lineHeight:"",fontColor:""},i.cellWidth=0,i.cellHeight=0,i.startTime=0,i.endTime=0,i.currIndex=0,i.stopIndex=0,i.endIndex=0,i.demo=!1,i.timer=0,i.FPS=16.6,i.prizeFlag=-1,i.cells=[],i.blockImgs=[[]],i.btnImgs=[[]],i.prizeImgs=[],e.ob&&(i.initData(n),i.initWatch()),i.initComputed(),null===(r=e.beforeCreate)||void 0===r||r.call(i);var o=i.buttons.map((function(t){return t.imgs}));return i.button&&o.push(i.button.imgs),i.init({blockImgs:i.blocks.map((function(t){return t.imgs})),prizeImgs:i.prizes.map((function(t){return t.imgs})),btnImgs:o}),i}return i(e,t),e.prototype.initData=function(t){this.$set(this,"rows",Number(t.rows)||3),this.$set(this,"cols",Number(t.cols)||3),this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"button",t.button),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"activeStyle",t.activeStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},e.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){var e=o({gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return e.gutter=t.getLength(e.gutter),e.speed=e.speed/40,e})),this.$computed(this,"_defaultStyle",(function(){return o({borderRadius:20,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",shadow:"",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)})),this.$computed(this,"_activeStyle",(function(){return o({background:"#ffce98",shadow:""},t.activeStyle)}))},e.prototype.initWatch=function(){var t=this;this.$watch("blocks",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("prizes",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("buttons",(function(e){var n=e.map((function(t){return t.imgs}));return t.button&&n.push(t.button.imgs),t.init({btnImgs:n})}),{deep:!0}),this.$watch("button",(function(){var e=t.buttons.map((function(t){return t.imgs}));return t.button&&e.push(t.button.imgs),t.init({btnImgs:e})}),{deep:!0}),this.$watch("rows",(function(){return t.init({})})),this.$watch("cols",(function(){return t.init({})})),this.$watch("defaultConfig",(function(){return t.draw()}),{deep:!0}),this.$watch("defaultStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("activeStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("startCallback",(function(){return t.init({})})),this.$watch("endCallback",(function(){return t.init({})}))},e.prototype.init=function(e){var n,r,i=this;t.prototype.init.call(this);var o=this,a=o.config;o.ctx,o.button,null===(n=a.beforeInit)||void 0===n||n.call(this),this.draw(),Object.keys(e).forEach((function(t){var n=t,r=e[n],o={blockImgs:"blocks",prizeImgs:"prizes",btnImgs:"buttons"}[n];r&&r.forEach((function(t,e){t&&t.forEach((function(t,r){i.loadAndCacheImg(o,e,n,r,(function(){i.draw()}))}))}))})),null===(r=a.afterInit)||void 0===r||r.call(this)},e.prototype.handleClick=function(t){var e=this,n=this.ctx;u(this.buttons,[this.button]).forEach((function(r){var i;if(r){var o=e.getGeometricProperty([r.x,r.y,r.col||1,r.row||1]),a=o[0],c=o[1],u=o[2],s=o[3];n.beginPath(),n.rect(a,c,u,s),n.isPointInPath(t.offsetX,t.offsetY)&&(e.startTime||null===(i=e.startCallback)||void 0===i||i.call(e,t))}}))},e.prototype.loadAndCacheImg=function(t,e,n,r,i){return a(this,void 0,void 0,(function(){var o,a,u,s=this;return c(this,(function(c){return o=this[t][e],"buttons"===t&&!this.buttons.length&&this.button&&(o=this.button),o&&o.imgs&&(a=o.imgs[r])?(this[n][e]||(this[n][e]=[]),u=[this.loadImg(a.src,a),a.activeSrc&&this.loadImg(a.activeSrc,a,"$activeResolve")],Promise.all(u).then((function(t){var o=t[0],a=t[1];s[n][e][r]={defaultImg:o,activeImg:a},i.call(s)})).catch((function(n){console.error(t+"["+e+"].imgs["+r+"] "+n)})),[2]):[2]}))}))},e.prototype.computedWidthAndHeight=function(t,e,n){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var r=this.getWidth(e.width,n.col);return[r,t.height*(r/t.width)]}if(!e.width&&e.height){var i=this.getHeight(e.height,n.row);return[t.width*(i/t.height),i]}return[this.getWidth(e.width,n.col),this.getHeight(e.height,n.row)]},e.prototype.draw=function(){var t,e,n=this,r=this,i=r.config,o=r.ctx,a=r._defaultConfig,c=r._defaultStyle,h=r._activeStyle;null===(t=i.beforeDraw)||void 0===t||t.call(this,o),o.clearRect(0,0,this.boxWidth,this.boxHeight),this.cells=u(this.prizes,this.buttons),this.button&&this.cells.push(this.button),this.cells.forEach((function(t){t.col=t.col||1,t.row=t.row||1})),this.prizeArea=this.blocks.reduce((function(t,e){var r=t.x,i=t.y,a=t.w,u=t.h,f=function(t){var e,n=(null===(e=t.padding)||void 0===e?void 0:e.replace(/px/g,"").split(" ").map((function(t){return~~t})))||[0],r=0,i=0,o=0,a=0;switch(n.length){case 1:r=i=o=a=n[0];break;case 2:r=i=n[0],o=a=n[1];break;case 3:r=n[0],o=a=n[1],i=n[2];break;default:r=n[0],i=n[1],o=n[2],a=n[3]}var c={paddingTop:r,paddingBottom:i,paddingLeft:o,paddingRight:a};for(var u in c)c[u]=Object.prototype.hasOwnProperty.call(t,u)&&s(t[u],"string","number")?~~String(t[u]).replace(/px/g,""):c[u];return[r,i,o,a]}(e),h=f[0],d=f[1],p=f[2],g=f[3],v=e.borderRadius?n.getLength(e.borderRadius):0,b=e.background||c.background;return l(b)&&E(o,r,i,a,u,v,n.handleBackground(r,i,a,u,b)),{x:r+p,y:i+h,w:a-p-g,h:u-h-d}}),{x:0,y:0,w:this.boxWidth,h:this.boxHeight}),this.cellWidth=(this.prizeArea.w-a.gutter*(this.cols-1))/this.cols,this.cellHeight=(this.prizeArea.h-a.gutter*(this.rows-1))/this.rows,this.cells.forEach((function(t,e){var r=n.getGeometricProperty([t.x,t.y,t.col,t.row]),a=r[0],u=r[1],s=r[2],d=r[3],p=!1;(void 0===n.prizeFlag||n.prizeFlag>-1)&&(p=e===n.currIndex%n.prizes.length>>0);var g=p?h.background:t.background||c.background;if(l(g)){var v=(p?h.shadow:t.shadow||c.shadow).replace(/px/g,"").split(",")[0].split(" ").map((function(t,e){return e<3?Number(t):t}));4===v.length&&(o.shadowColor=v[3],o.shadowOffsetX=v[0]*i.dpr,o.shadowOffsetY=v[1]*i.dpr,o.shadowBlur=v[2],v[0]>0?s-=v[0]:(s+=v[0],a-=v[0]),v[1]>0?d-=v[1]:(d+=v[1],u-=v[1])),E(o,a,u,s,d,n.getLength(t.borderRadius?t.borderRadius:c.borderRadius),n.handleBackground(a,u,s,d,g)),o.shadowColor="rgba(0, 0, 0, 0)",o.shadowOffsetX=0,o.shadowOffsetY=0,o.shadowBlur=0}var b="prizeImgs";e>=n.prizes.length&&(b="btnImgs",e-=n.prizes.length),t.imgs&&t.imgs.forEach((function(r,i){if(n[b][e]){var o=n[b][e][i];if(o){var c=p&&o.activeImg||o.defaultImg;if(c){var s=n.computedWidthAndHeight(c,r,t),f=s[0],l=s[1],h=[a+n.getOffsetX(f,t.col),u+n.getHeight(r.top,t.row)],d=h[0],g=h[1];n.drawImage(c,d,g,f,l)}}}})),t.fonts&&t.fonts.forEach((function(e){var r=p&&h.fontStyle?h.fontStyle:e.fontStyle||c.fontStyle,i=p&&h.fontWeight?h.fontWeight:e.fontWeight||c.fontWeight,s=p&&h.fontSize?n.getLength(h.fontSize):n.getLength(e.fontSize||c.fontSize),l=p&&h.lineHeight?h.lineHeight:e.lineHeight||c.lineHeight||e.fontSize||c.fontSize;o.font=i+" "+(s>>0)+"px "+r,o.fillStyle=p&&h.fontColor?h.fontColor:e.fontColor||c.fontColor;var d=[],g=String(e.text);if(Object.prototype.hasOwnProperty.call(e,"wordWrap")?e.wordWrap:c.wordWrap){g=f(g);for(var v="",b=0;b<g.length;b++)v+=g[b],o.measureText(v).width>n.getWidth(e.lengthLimit||c.lengthLimit,t.col)&&(d.push(v.slice(0,-1)),v=g[b]);v&&d.push(v),d.length||d.push(g)}else d=g.split("\n");d.forEach((function(r,i){o.fillText(r,a+n.getOffsetX(o.measureText(r).width,t.col),u+n.getHeight(e.top,t.row)+(i+1)*n.getLength(l))}))}))})),null===(e=i.afterDraw)||void 0===e||e.call(this,o)},e.prototype.handleBackground=function(t,e,n,r,i){var o=this.ctx;return i.includes("linear-gradient")&&(i=function(t,e,n,r,i,o){var a=/linear-gradient\((.+)\)/.exec(o)[1].split(",").map((function(t){return t.trim()})),c=a.shift(),u=[0,0,0,0];if(c.includes("deg")){var s=function(t){return Math.tan(t/180*Math.PI)};(c=c.slice(0,-3)%360)>=0&&c<45?u=[e,n+i,e+r,n+i-r*s(c-0)]:c>=45&&c<90?u=[e,n+i,e+r-i*s(c-45),n]:c>=90&&c<135?u=[e+r,n+i,e+r-i*s(c-90),n]:c>=135&&c<180?u=[e+r,n+i,e,n+r*s(c-135)]:c>=180&&c<225?u=[e+r,n,e,n+r*s(c-180)]:c>=225&&c<270?u=[e+r,n,e+i*s(c-225),n+i]:c>=270&&c<315?u=[e,n,e+i*s(c-270),n+i]:c>=315&&c<360&&(u=[e,n,e+r,n+i-r*s(c-315)])}else c.includes("top")?u=[e,n+i,e,n]:c.includes("bottom")?u=[e,n,e,n+i]:c.includes("left")?u=[e+r,n,e,n]:c.includes("right")&&(u=[e,n,e+r,n]);var f=t.createLinearGradient.apply(t,u.map((function(t){return t>>0})));return a.reduce((function(t,e,n){var r=e.split(" ");return 1===r.length?t.addColorStop(n,r[0]):2===r.length&&t.addColorStop.apply(t,r),t}),f)}(o,t,e,n,r,i)),i},e.prototype.play=function(){var t=this.config.clearInterval;this.startTime||(t(this.timer),this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},e.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.currIndex=0,this.draw())},e.prototype.run=function(t){void 0===t&&(t=0);var e=this,n=e.rAF,r=e.currIndex,i=e.prizes,o=e.prizeFlag,a=e.startTime,c=e._defaultConfig,u=Date.now()-a;if(u>=c.accelerationTime&&void 0!==o){this.FPS=u/t,this.endTime=Date.now(),this.stopIndex=r;for(var s=0;++s;){var f=i.length*s+o-(r>>0);if(C.easeOut(this.FPS,this.stopIndex,f,c.decelerationTime)-this.stopIndex>c.speed){this.endIndex=f;break}}return this.slowDown()}this.currIndex=(r+C.easeIn(u,.1,c.speed,c.accelerationTime))%i.length,this.draw(),n(this.run.bind(this,t+1))},e.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,i=e.prizeFlag,a=e.stopIndex,c=e.endIndex,u=e._defaultConfig,s=Date.now()-this.endTime;if(-1!==i){if(s>u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,o({},r.find((function(t,e){return e===i})))));this.currIndex=C.easeOut(s,a,c,u.decelerationTime)%r.length,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},e.prototype.walk=function(){var t=this,e=this.config,n=e.setInterval;(0,e.clearInterval)(this.timer),this.timer=n((function(){t.currIndex+=1,t.draw()}),1300)},e.prototype.getGeometricProperty=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=this.cellWidth,a=this.cellHeight,c=this._defaultConfig.gutter,u=[this.prizeArea.x+(o+c)*e,this.prizeArea.y+(a+c)*n];return r&&i&&u.push(o*r+c*(r-1),a*i+c*(i-1)),u},e.prototype.getWidth=function(t,e){return void 0===e&&(e=1),s(t,"number")?t:s(t,"string")?this.changeUnits(t,this.cellWidth*e+this._defaultConfig.gutter*(e-1)):0},e.prototype.getHeight=function(t,e){return void 0===e&&(e=1),s(t,"number")?t:s(t,"string")?this.changeUnits(t,this.cellHeight*e+this._defaultConfig.gutter*(e-1)):0},e.prototype.getOffsetX=function(t,e){return void 0===e&&(e=1),(this.cellWidth*e+this._defaultConfig.gutter*(e-1)-t)/2},e.prototype.conversionAxis=function(t,e){var n=this.config;return[t/n.dpr,e/n.dpr]},e}(S);e.LuckyGrid=L,e.LuckyWheel=A},"37e8":function(t,e,n){var r=n("83ab"),i=n("9bf2"),o=n("825a"),a=n("df75");t.exports=r?Object.defineProperties:function(t,e){o(t);var n,r=a(e),c=r.length,u=0;while(c>u)i.f(t,n=r[u++],e[n]);return t}},"3bbe":function(t,e,n){var r=n("861d");t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},4160:function(t,e,n){"use strict";var r=n("23e7"),i=n("17c2");r({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},"428f":function(t,e,n){var r=n("da84");t.exports=r},"44ad":function(t,e,n){var r=n("d039"),i=n("c6b6"),o="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?o.call(t,""):Object(t)}:Object},4930:function(t,e,n){var r=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},"4d64":function(t,e,n){var r=n("fc6a"),i=n("50c4"),o=n("23cb"),a=function(t){return function(e,n,a){var c,u=r(e),s=i(u.length),f=o(a,s);if(t&&n!=n){while(s>f)if(c=u[f++],c!=c)return!0}else for(;s>f;f++)if((t||f in u)&&u[f]===n)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},"4de4":function(t,e,n){"use strict";var r=n("23e7"),i=n("b727").filter,o=n("1dde"),a=n("ae40"),c=o("filter"),u=a("filter");r({target:"Array",proto:!0,forced:!c||!u},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},"50c4":function(t,e,n){var r=n("a691"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},5135:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},5692:function(t,e,n){var r=n("c430"),i=n("c6cd");(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,e,n){var r=n("d066"),i=n("241c"),o=n("7418"),a=n("825a");t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=o.f;return n?e.concat(n(t)):e}},5899:function(t,e){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},"58a8":function(t,e,n){var r=n("1d80"),i=n("5899"),o="["+i+"]",a=RegExp("^"+o+o+"*"),c=RegExp(o+o+"*$"),u=function(t){return function(e){var n=String(r(e));return 1&t&&(n=n.replace(a,"")),2&t&&(n=n.replace(c,"")),n}};t.exports={start:u(1),end:u(2),trim:u(3)}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"65f0":function(t,e,n){var r=n("861d"),i=n("e8b5"),o=n("b622"),a=o("species");t.exports=function(t,e){var n;return i(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)?r(n)&&(n=n[a],null===n&&(n=void 0)):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},"69f3":function(t,e,n){var r,i,o,a=n("7f9a"),c=n("da84"),u=n("861d"),s=n("9112"),f=n("5135"),l=n("f772"),h=n("d012"),d=c.WeakMap,p=function(t){return o(t)?i(t):r(t,{})},g=function(t){return function(e){var n;if(!u(e)||(n=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}};if(a){var v=new d,b=v.get,y=v.has,m=v.set;r=function(t,e){return m.call(v,t,e),e},i=function(t){return b.call(v,t)||{}},o=function(t){return y.call(v,t)}}else{var w=l("state");h[w]=!0,r=function(t,e){return s(t,w,e),e},i=function(t){return f(t,w)?t[w]:{}},o=function(t){return f(t,w)}}t.exports={set:r,get:i,has:o,enforce:p,getterFor:g}},"6eeb":function(t,e,n){var r=n("da84"),i=n("9112"),o=n("5135"),a=n("ce4e"),c=n("8925"),u=n("69f3"),s=u.get,f=u.enforce,l=String(String).split("String");(t.exports=function(t,e,n,c){var u=!!c&&!!c.unsafe,s=!!c&&!!c.enumerable,h=!!c&&!!c.noTargetGet;"function"==typeof n&&("string"!=typeof e||o(n,"name")||i(n,"name",e),f(n).source=l.join("string"==typeof e?e:"")),t!==r?(u?!h&&t[e]&&(s=!0):delete t[e],s?t[e]=n:i(t,e,n)):s?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&s(this).source||c(this)}))},7156:function(t,e,n){var r=n("861d"),i=n("d2bb");t.exports=function(t,e,n){var o,a;return i&&"function"==typeof(o=e.constructor)&&o!==n&&r(a=o.prototype)&&a!==n.prototype&&i(t,a),t}},7418:function(t,e){e.f=Object.getOwnPropertySymbols},"746f":function(t,e,n){var r=n("428f"),i=n("5135"),o=n("e538"),a=n("9bf2").f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});i(e,t)||a(e,t,{value:o.f(t)})}},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,e,n){var r=n("1d80");t.exports=function(t){return Object(r(t))}},"7c73":function(t,e,n){var r,i=n("825a"),o=n("37e8"),a=n("7839"),c=n("d012"),u=n("1be4"),s=n("cc12"),f=n("f772"),l=">",h="<",d="prototype",p="script",g=f("IE_PROTO"),v=function(){},b=function(t){return h+p+l+t+h+"/"+p+l},y=function(t){t.write(b("")),t.close();var e=t.parentWindow.Object;return t=null,e},m=function(){var t,e=s("iframe"),n="java"+p+":";return e.style.display="none",u.appendChild(e),e.src=String(n),t=e.contentWindow.document,t.open(),t.write(b("document.F=Object")),t.close(),t.F},w=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}w=r?y(r):m();var t=a.length;while(t--)delete w[d][a[t]];return w()};c[g]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(v[d]=i(t),n=new v,v[d]=null,n[g]=t):n=w(),void 0===e?n:o(n,e)}},"7f9a":function(t,e,n){var r=n("da84"),i=n("8925"),o=r.WeakMap;t.exports="function"===typeof o&&/native code/.test(i(o))},"825a":function(t,e,n){var r=n("861d");t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},"83ab":function(t,e,n){var r=n("d039");t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8418:function(t,e,n){"use strict";var r=n("c04e"),i=n("9bf2"),o=n("5c6c");t.exports=function(t,e,n){var a=r(e);a in t?i.f(t,a,o(0,n)):t[a]=n}},"861d":function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},8875:function(t,e,n){var r,i,o;(function(n,a){i=[],r=a,o="function"===typeof r?r.apply(e,i):r,void 0===o||(t.exports=o)})("undefined"!==typeof self&&self,(function(){function t(){var e=Object.getOwnPropertyDescriptor(document,"currentScript");if(!e&&"currentScript"in document&&document.currentScript)return document.currentScript;if(e&&e.get!==t&&document.currentScript)return document.currentScript;try{throw new Error}catch(d){var n,r,i,o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,a=/@([^@]*):(\d+):(\d+)\s*$/gi,c=o.exec(d.stack)||a.exec(d.stack),u=c&&c[1]||!1,s=c&&c[2]||!1,f=document.location.href.replace(document.location.hash,""),l=document.getElementsByTagName("script");u===f&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(s-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=n.replace(r,"$1").trim());for(var h=0;h<l.length;h++){if("interactive"===l[h].readyState)return l[h];if(l[h].src===u)return l[h];if(u===f&&l[h].innerHTML&&l[h].innerHTML.trim()===i)return l[h]}return null}}return t}))},8925:function(t,e,n){var r=n("c6cd"),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return i.call(t)}),t.exports=r.inspectSource},"90e3":function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+r).toString(36)}},9112:function(t,e,n){var r=n("83ab"),i=n("9bf2"),o=n("5c6c");t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},"94ca":function(t,e,n){var r=n("d039"),i=/#|\.prototype\./,o=function(t,e){var n=c[a(t)];return n==s||n!=u&&("function"==typeof e?r(e):!!e)},a=o.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=o.data={},u=o.NATIVE="N",s=o.POLYFILL="P";t.exports=o},"99af":function(t,e,n){"use strict";var r=n("23e7"),i=n("d039"),o=n("e8b5"),a=n("861d"),c=n("7b0b"),u=n("50c4"),s=n("8418"),f=n("65f0"),l=n("1dde"),h=n("b622"),d=n("2d00"),p=h("isConcatSpreadable"),g=9007199254740991,v="Maximum allowed index exceeded",b=d>=51||!i((function(){var t=[];return t[p]=!1,t.concat()[0]!==t})),y=l("concat"),m=function(t){if(!a(t))return!1;var e=t[p];return void 0!==e?!!e:o(t)},w=!b||!y;r({target:"Array",proto:!0,forced:w},{concat:function(t){var e,n,r,i,o,a=c(this),l=f(a,0),h=0;for(e=-1,r=arguments.length;e<r;e++)if(o=-1===e?a:arguments[e],m(o)){if(i=u(o.length),h+i>g)throw TypeError(v);for(n=0;n<i;n++,h++)n in o&&s(l,h,o[n])}else{if(h>=g)throw TypeError(v);s(l,h++,o)}return l.length=h,l}})},"9bf2":function(t,e,n){var r=n("83ab"),i=n("0cfb"),o=n("825a"),a=n("c04e"),c=Object.defineProperty;e.f=r?c:function(t,e,n){if(o(t),e=a(e,!0),o(n),i)try{return c(t,e,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},a4d3:function(t,e,n){"use strict";var r=n("23e7"),i=n("da84"),o=n("d066"),a=n("c430"),c=n("83ab"),u=n("4930"),s=n("fdbf"),f=n("d039"),l=n("5135"),h=n("e8b5"),d=n("861d"),p=n("825a"),g=n("7b0b"),v=n("fc6a"),b=n("c04e"),y=n("5c6c"),m=n("7c73"),w=n("df75"),x=n("241c"),S=n("057f"),k=n("7418"),O=n("06cf"),I=n("9bf2"),_=n("d1e7"),T=n("9112"),E=n("6eeb"),C=n("5692"),z=n("f772"),j=n("d012"),P=n("90e3"),$=n("b622"),A=n("e538"),L=n("746f"),W=n("d44e"),M=n("69f3"),D=n("b727").forEach,F=z("hidden"),R="Symbol",N="prototype",H=$("toPrimitive"),G=M.set,B=M.getterFor(R),q=Object[N],X=i.Symbol,V=o("JSON","stringify"),U=O.f,Y=I.f,J=S.f,K=_.f,Q=C("symbols"),Z=C("op-symbols"),tt=C("string-to-symbol-registry"),et=C("symbol-to-string-registry"),nt=C("wks"),rt=i.QObject,it=!rt||!rt[N]||!rt[N].findChild,ot=c&&f((function(){return 7!=m(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=U(q,e);r&&delete q[e],Y(t,e,n),r&&t!==q&&Y(q,e,r)}:Y,at=function(t,e){var n=Q[t]=m(X[N]);return G(n,{type:R,tag:t,description:e}),c||(n.description=e),n},ct=s?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof X},ut=function(t,e,n){t===q&&ut(Z,e,n),p(t);var r=b(e,!0);return p(n),l(Q,r)?(n.enumerable?(l(t,F)&&t[F][r]&&(t[F][r]=!1),n=m(n,{enumerable:y(0,!1)})):(l(t,F)||Y(t,F,y(1,{})),t[F][r]=!0),ot(t,r,n)):Y(t,r,n)},st=function(t,e){p(t);var n=v(e),r=w(n).concat(pt(n));return D(r,(function(e){c&&!lt.call(n,e)||ut(t,e,n[e])})),t},ft=function(t,e){return void 0===e?m(t):st(m(t),e)},lt=function(t){var e=b(t,!0),n=K.call(this,e);return!(this===q&&l(Q,e)&&!l(Z,e))&&(!(n||!l(this,e)||!l(Q,e)||l(this,F)&&this[F][e])||n)},ht=function(t,e){var n=v(t),r=b(e,!0);if(n!==q||!l(Q,r)||l(Z,r)){var i=U(n,r);return!i||!l(Q,r)||l(n,F)&&n[F][r]||(i.enumerable=!0),i}},dt=function(t){var e=J(v(t)),n=[];return D(e,(function(t){l(Q,t)||l(j,t)||n.push(t)})),n},pt=function(t){var e=t===q,n=J(e?Z:v(t)),r=[];return D(n,(function(t){!l(Q,t)||e&&!l(q,t)||r.push(Q[t])})),r};if(u||(X=function(){if(this instanceof X)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=P(t),n=function(t){this===q&&n.call(Z,t),l(this,F)&&l(this[F],e)&&(this[F][e]=!1),ot(this,e,y(1,t))};return c&&it&&ot(q,e,{configurable:!0,set:n}),at(e,t)},E(X[N],"toString",(function(){return B(this).tag})),E(X,"withoutSetter",(function(t){return at(P(t),t)})),_.f=lt,I.f=ut,O.f=ht,x.f=S.f=dt,k.f=pt,A.f=function(t){return at($(t),t)},c&&(Y(X[N],"description",{configurable:!0,get:function(){return B(this).description}}),a||E(q,"propertyIsEnumerable",lt,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:X}),D(w(nt),(function(t){L(t)})),r({target:R,stat:!0,forced:!u},{for:function(t){var e=String(t);if(l(tt,e))return tt[e];var n=X(e);return tt[e]=n,et[n]=e,n},keyFor:function(t){if(!ct(t))throw TypeError(t+" is not a symbol");if(l(et,t))return et[t]},useSetter:function(){it=!0},useSimple:function(){it=!1}}),r({target:"Object",stat:!0,forced:!u,sham:!c},{create:ft,defineProperty:ut,defineProperties:st,getOwnPropertyDescriptor:ht}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:dt,getOwnPropertySymbols:pt}),r({target:"Object",stat:!0,forced:f((function(){k.f(1)}))},{getOwnPropertySymbols:function(t){return k.f(g(t))}}),V){var gt=!u||f((function(){var t=X();return"[null]"!=V([t])||"{}"!=V({a:t})||"{}"!=V(Object(t))}));r({target:"JSON",stat:!0,forced:gt},{stringify:function(t,e,n){var r,i=[t],o=1;while(arguments.length>o)i.push(arguments[o++]);if(r=e,(d(e)||void 0!==t)&&!ct(t))return h(e)||(e=function(t,e){if("function"==typeof r&&(e=r.call(this,t,e)),!ct(e))return e}),i[1]=e,V.apply(null,i)}})}X[N][H]||T(X[N],H,X[N].valueOf),W(X,R),j[F]=!0},a640:function(t,e,n){"use strict";var r=n("d039");t.exports=fun