1import{a4 as At,dD as Mt,l as jt,b as Bt,j as zt,E as Nt,f0 as Xt,y as Gt,I as G,K as Y,a0 as Ut,_ as Vt,Q as xt,R as B,U as k,V as W,ay as _t,ae as qt,ad as Qt,af as Tt,ag as Yt,ah as Jt,a5 as Kt,a6 as Zt}from"./index-W6wVap2t.js";import{u as te}from"./useTurntable.hook-Q86ylQaO.js";import{L as ee}from"./List-HhKo7KM5.js";import{D as ie}from"./Dialog-DYD_Eh3G.js";import"./index-BCN17hDz.js";import"./usePullRefresh-RACKvDFg.js";import"./assetIcons-CA9qCnSK.js";import"./close-INBhzs5V.js";var ne=!1;var D=function(){return D=Object.assign||function(s){for(var n,t=1,e=arguments.length;t<e;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(s[i]=n[i]);return s},D.apply(this,arguments)};var pt=function(s,n){return pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},pt(s,n)};function gt(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=s}pt(s,n),s.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var H=function(){return H=Object.assign||function(s){for(var n,t=1,e=arguments.length;t<e;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(s[i]=n[i]);return s},H.apply(this,arguments)};function M(s,n,t,e){return new(t||(t=Promise))((function(i,r){function h(a){try{c(e.next(a))}catch(l){r(l)}}function o(a){try{c(e.throw(a))}catch(l){r(l)}}function c(a){var l;a.done?i(a.value):(l=a.value,l instanceof t?l:new t((function(u){u(l)}))).then(h,o)}c((e=e.apply(s,[])).next())}))}function j(s,n){var t,e,i,r,h={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function o(c){return function(a){return(function(l){if(t)throw new TypeError("Generator is already executing.");for(;h;)try{if(t=1,e&&(i=2&l[0]?e.return:l[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,l[1])).done)return i;switch(e=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return h.label++,{value:l[1],done:!1};case 5:h.label++,e=l[1],l=[0];continue;case 7:l=h.ops.pop(),h.trys.pop();continue;default:if(!((i=(i=h.trys).length>0&&i[i.length-1])||l[0]!==6&&l[0]!==2)){h=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){h.label=l[1];break}if(l[0]===6&&h.label<i[1]){h.label=i[1],i=l;break}if(i&&h.label<i[2]){h.label=i[2],h.ops.push(l);break}i[2]&&h.ops.pop(),h.trys.pop();continue}l=n.call(s,h)}catch(u){l=[6,u],e=0}finally{t=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}})([c,a])}}}function J(s,n){for(var t=0,e=n.length,i=s.length;t<e;t++,i++)s[i]=n[t];return s}Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(s,n){if(this==null)throw new TypeError('"this" is null or not defined');var t=Object(this),e=t.length>>>0;if(e===0)return!1;for(var i,r,h=0|n,o=Math.max(h>=0?h:e-Math.abs(h),0);o<e;){if((i=t[o])===(r=s)||typeof i=="number"&&typeof r=="number"&&isNaN(i)&&isNaN(r))return!0;o++}return!1}}),String.prototype.includes||(String.prototype.includes=function(s,n){return typeof n!="number"&&(n=0),!(n+s.length>this.length)&&this.indexOf(s,n)!==-1}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(s){if(this==null)throw new TypeError('"this" is null or not defined');var n=Object(this),t=n.length>>>0;if(typeof s!="function")throw new TypeError("predicate must be a function");for(var e=arguments[1],i=0;i<t;){var r=n[i];if(s.call(e,r,i,n))return r;i++}}});var it=function(s){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];return n.some((function(e){return Object.prototype.toString.call(s).slice(8,-1).toLowerCase()===e}))},K=function(s,n){return Object.prototype.hasOwnProperty.call(s,n)},vt=function(s){return[].filter.call(s,(function(n){return n!==` 2`})).join("")},N=function(s){if(typeof s!="string"||(s=s.toLocaleLowerCase().trim())==="transparent")return!1;var n;return!(/^rgba/.test(s)&&((n=/([^\s,]+)\)$/.exec(s))===null?0:typeof n=="object"?NaN:typeof n=="number"?n:typeof n=="string"?n[n.length-1]==="%"?Number(n.slice(0,-1))/100:Number(n):NaN)===0)},Ot=function(s,n){var t,e=((t=s.padding)===null||t===void 0?void 0:t.split(" ").map((function(l){return n(l)})))||[0],i=0,r=0,h=0,o=0;switch(e.length){case 1:i=r=h=o=e[0];break;case 2:i=r=e[0],h=o=e[1];break;case 3:i=e[0],h=o=e[1],r=e[2];break;default:i=e[0],r=e[1],h=e[2],o=e[3]}var c={paddingTop:i,paddingBottom:r,paddingLeft:h,paddingRight:o};
2for(var a in c)c[a]=K(s,a)&&it(s[a],"string","number")?n(s[a]):c[a];return[i,r,h,o]},Et=function(s){var n=[],t=s.map((function(i){return Number(i)})).reduce((function(i,r){if(r>0){var h=i+r;return n.push(h),h}return n.push(NaN),i}),0),e=Math.random()*t;return n.findIndex((function(i){return e<=i}))},mt=function(s,n,t,e){e===void 0&&(e=1/0),e<=0&&(e=1/0);for(var i="",r=[],h=s.measureText("...").width,o=0;o<n.length;o++){i+=n[o];var c=s.measureText(i).width,a=t(r);if(e===r.length+1&&(c+=h),a<0)return r;if(c>a&&(r.push(i.slice(0,-1)),i=n[o]),e===r.length)return r[r.length-1]+="...",r}return i&&r.push(i),r.length||r.push(n),r},U=(function(){function s(){this.subs=[]}return s.prototype.addSub=function(n){this.subs.includes(n)||this.subs.push(n)},s.prototype.notify=function(){this.subs.forEach((function(n){n.update()}))},s})(),re="__proto__"in{};function It(s,n,t,e){Object.defineProperty(s,n,{value:t,enumerable:!1,writable:!0,configurable:!0})}var Wt=Array.prototype,lt=Object.create(Wt);["push","pop","shift","unshift","sort","splice","reverse"].forEach((function(s){lt[s]=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Wt[s].apply(this,n),i=this.__luckyOb__;return["push","unshift","splice"].includes(s)&&i.walk(this),i.dep.notify(),e}}));var oe=(function(){function s(n){this.dep=new U,It(n,"__luckyOb__",this),Array.isArray(n)&&(re?n.__proto__=lt:Object.getOwnPropertyNames(lt).forEach((function(t){It(n,t,lt[t])}))),this.walk(n)}return s.prototype.walk=function(n){Object.keys(n).forEach((function(t){Pt(n,t,n[t])}))},s})();function Lt(s){if(s&&typeof s=="object")return"__luckyOb__"in s?s.__luckyOb__:new oe(s)}function Pt(s,n,t){var e=new U,i=Object.getOwnPropertyDescriptor(s,n);if(!i||i.configurable!==!1){var r=i&&i.get,h=i&&i.set;r&&!h||arguments.length!==2||(t=s[n]);var o=Lt(t);Object.defineProperty(s,n,{get:function(){var c=r?r.call(s):t;return U.target&&(e.addSub(U.target),o&&o.dep.addSub(U.target)),c},set:function(c){c!==t&&(t=c,r&&!h||(h?h.call(s,c):t=c,o=Lt(c),e.notify()))}})}}var se=0,ae=(function(){function s(n,t,e,i){i===void 0&&(i={}),this.id=se++,this.$lucky=n,this.expr=t,this.deep=!!i.deep,this.getter=typeof t=="function"?t:(function(r){r+=".";for(var h=[],o="",c=0;c<r.length;c++){var a=r[c];if(/\[|\./.test(a))h.push(o),o="";else{if(/\W/.test(a))continue;o+=a}}return function(l){return h.reduce((function(u,f){return u[f]}),l)}})(t),this.cb=e,this.value=this.get()}return s.prototype.get=function(){U.target=this;var n=this.getter.call(this.$lucky,this.$lucky);return this.deep&&(function(t){var e=function(i){it(i,"array","object")&&Object.keys(i).forEac
2h((function(r){var h=i[r];e(h)}))};e(t)})(n),U.target=null,n},s.prototype.update=function(){var n=this.get(),t=this.value;this.value=n,this.cb.call(this.$lucky,n,t)},s})(),yt=(function(){function s(n,t){var e=this;this.version="1.7.21",this.htmlFontSize=16,this.rAF=function(){},this.boxWidth=0,this.boxHeight=0,typeof n=="string"?n={el:n}:n.nodeType===1&&(n={el:"",divElement:n}),n=n,this.config=n,this.data=t,n.flag||(n.flag="WEB"),n.el&&(n.divElement=document.querySelector(n.el)),n.divElement&&(n.canvasElement=document.createElement("canvas"),n.divElement.appendChild(n.canvasElement)),n.canvasElement&&(n.ctx=n.canvasElement.getContext("2d"),n.canvasElement.setAttribute("package","[email protected]"),n.canvasElement.addEventListener("click",(function(i){return e.handleClick(i)}))),this.ctx=n.ctx,this.initWindowFunction(),this.config.ctx||console.error("æ æ³è·åå° CanvasContext2D"),window&&typeof window.addEventListener=="function"&&window.addEventListener("resize",(function(i,r){var h=null;return function(){for(var o=this,c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];h||(h=setTimeout((function(){i.apply(o,c),clearTimeout(h),h=null}),r))}})((function(){return e.resize()}),300)),window&&typeof window.MutationObserver=="function"&&new window.MutationObserver((function(){e.resize()})).observe(document.documentElement,{attributes:!0})}return s.prototype.resize=function(){var n,t;(t=(n=this.config).beforeResize)===null||t===void 0||t.call(n),this.setHTMLFontSize(),this.setDpr(),this.resetWidthAndHeight(),this.zoomCanvas()},s.prototype.initLucky=function(){if(this.resize(),!this.boxWidth||!this.boxHeight)return console.error("æ æ³è·åå°å®½åº¦æé«åº¦")},s.prototype.handleClick=function(n){},s.prototype.setHTMLFontSize=function(){window&&(this.htmlFontSize=+window.getComputedStyle(document.documentElement).fontSize.slice(0,-2))},s.prototype.clearCanvas=function(){var n=[this.boxWidth,this.boxHeight],t=n[0],e=n[1];this.ctx.clearRect(-t,-e,2*t,2*e)},s.prototype.setDpr=function(){var n=this.config;n.dpr||(window?window.dpr=n.dpr=window.devicePixelRatio||1:n.dpr||console.error(n,"æªä¼ å
¥ dpr å¯è½ä¼å¯¼è´ç»å¶å¼å¸¸"))},s.prototype.resetWidthAndHeight=function(){var n=this.config,t=this.data,e=0,i=0;n.divElement&&(e=n.divElement.offsetWidth,i=n.divElement.offsetHeight),this.boxWidth=this.getLength(t.width||n.width)||e,this.boxHeight=this.getLength(t.height||n.height)||i,n.divElement&&(n.divElement.style.overflow="hidden",n.divElement.style.width=this.boxWidth+"px",n.divElement.style.height=this.boxHeight+"px")},s.prototype.zoomCanvas=function(){var n=this.config,t=this.ctx,e=n.canvasElement,i=n.dpr,r=[this.boxWidth*i,this.boxHeight*i],h=r[0],o=r[1];e&&(e.width=h,e.height=o,e.style.width=h+"px",e.style.height=o+"px",e.style["transform-origin"]="left top",e.style.transform="scale("+1/i+")",t.scale(i,i))},s.prototype.initWindowFunction=function(){var n=this.config;if(window)return this.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)},n.setTimeout=window.setTimeout,n.setInterval=window.setInterval,n.clearTimeout=window.clearTimeout,void(n.clearInterval=window.clearInterval);if(n.rAF)this.rAF=n.rAF;else if(n.setTimeout){var t=n.setTimeout;this.rAF=function(e){return t(e,16.7)}}else this.rAF=function(e){return setTimeout(e,16.7)}},s.prototype.loadImg=function(n,t,e){var i=this;return e===void 0&&(e="$resolve"),new Promise((function(r,h){if(n||h("=> '"+t.src+"' ä¸è½ä¸ºç©ºæä¸åæ³"),i.config.flag!=="WEB")return t[e]=r,void(t.$reject=h);var o=new Image;o.onload=function(){return r(o)},o.onerror=function(){return h("=> '"+t.src+"' å¾çå 载失败")},o.src=n}))},s.prototype.drawImage=function(n,t){for(var e,i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];var h=this.config,o=h.flag,c=h.dpr;if(["WEB","MP-WX"].includes(o))e=t;else{if(!["UNI-H5","UNI-MP","TARO-H5","TARO-MP"].includes(o))return console.error("ææä¹å¤ç flag, 该平å°å°æªå
¼å®¹!");e=t.path}if(!e.canvas)return i.length===8&&(i=i.map((function(u,f){return f<4?u*c:u}))),n.drawImage.apply(n,J([e],i));var a=e.canvas.getContext("2d");i=i.map((function(u){return u*c}));var l=a.getImageData.apply(a,i.slice(0,4));
2n.putImageData.apply(n,J([l],i.slice(4,6)))},s.prototype.computedWidthAndHeight=function(n,t,e,i){if(!t.width&&!t.height)return[n.width,n.height];if(t.width&&!t.height){var r=this.getLength(t.width,e);return[r,n.height*(r/n.width)]}if(!t.width&&t.height){var h=this.getLength(t.height,i);return[n.width*(h/n.height),h]}return[this.getLength(t.width,e),this.getLength(t.height,i)]},s.prototype.changeUnits=function(n,t){var e=this;t===void 0&&(t=1);var i=this.config;return Number(n.replace(/^([-]*[0-9.]*)([a-z%]*)$/,(function(r,h,o){var c={"%":function(l){return l*(t/100)},px:function(l){return 1*l},rem:function(l){return l*e.htmlFontSize},vw:function(l){return l/100*window.innerWidth}}[o];if(c)return c(h);var a=i.handleCssUnit||i.unitFunc;return a?a(h,o):h})))},s.prototype.getLength=function(n,t){return it(n,"number")?n:it(n,"string")?this.changeUnits(n,t):0},s.prototype.getOffsetX=function(n,t){return t===void 0&&(t=0),(t-n)/2},s.prototype.getOffscreenCanvas=function(n,t){if(!K(this,"_offscreenCanvas")&&(window&&window.document&&this.config.flag==="WEB"?this._offscreenCanvas=document.createElement("canvas"):this._offscreenCanvas=this.config.offscreenCanvas,!this._offscreenCanvas))return console.error("ç¦»å± Canvas æ æ³æ¸²æ!");var e=this.config.dpr,i=this._offscreenCanvas;i.width=(n||300)*e,i.height=(t||150)*e;var r=i.getContext("2d");return r.clearRect(0,0,n,t),r.scale(e,e),r.dpr=e,{_offscreenCanvas:i,_ctx:r}},s.prototype.$set=function(n,t,e){n&&typeof n=="object"&&Pt(n,t,e)},s.prototype.$computed=function(n,t,e){var i=this;Object.defineProperty(n,t,{get:function(){return e.call(i)}})},s.prototype.$watch=function(n,t,e){e===void 0&&(e={}),typeof t=="object"&&(t=(e=t).handler);var i=new ae(this,n,t,e);return e.immediate&&t.call(this,i.value),function(){}},s.version="1.7.21",s})(),X=function(s){return Math.PI/180*s},ht=function(s){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var e=n[0],i=n[1],r=n[2],h=n[3],o=n[4],c=Math.min(r,h),a=Math.PI;o>c/2&&(o=c/2),s.beginPath(),s.moveTo(e+o,i),s.lineTo(e+o,i),s.lineTo(e+r-o,i),s.arc(e+r-o,i+o,o,-a/2,0),s.lineTo(e+r,i+h-o),s.arc(e+r-o,i+h-o,o,0,a/2),s.lineTo(e+o,i+h),s.arc(e+o,i+h-o,o,a/2,a),s.lineTo(e,i+o),s.arc(e+o,i+o,o,a,-a/2),s.closePath()},wt=function(s,n,t,e){return s>=e&&(s=e),t*(s/=e)*s+n},Z=function(s,n,t,e){return s>=e&&(s=e),-t*(s/=e)*(s-2)+n},le=(function(s){function n(t,e){var i,r=s.call(this,t,{width:e.width,height:e.height})||this;return r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r.defaultStyle={},r._defaultConfig={},r._defaultStyle={},r.Radius=0,r.prizeRadius=0,r.prizeDeg=0,r.prizeAng=0,r.rotateDeg=0,r.maxBtnRadius=0,r.startTime=0,r.endTime=0,r.stopDeg=0,r.endDeg=0,r.FPS=16.6,r.step=0,r.ImageCache=new Map,r.initData(e),r.initWatch(),r.initComputed(),(i=t.beforeCreate)===null||i===void 0||i.call(r),r.init(),r}return gt(n,s),n.prototype.resize=function(){var t,e;s.prototype.resize.call(this),this.Radius=Math.min(this.boxWidth,this.boxHeight)/2,this.ctx.translate(this.Radius,this.Radius),this.draw(),(e=(t=this.config).afterResize)===null||e===void 0||e.call(t)},n.prototype.initLucky=function(){this.Radius=0,this.prizeRadius=0,this.prizeDeg=0,this.prizeAng=0,this.rotateDeg=0,this.maxBtnRadius=0,this.startTime=0,this.endTime=0,this.stopDeg=0,this.endDeg=0,this.FPS=16.6,this.prizeFlag=-1,this.step=0,s.prototype.initLucky.call(this)},n.prototype.initData=function(t){this.$set(this,"width",t.width||"300px"),this.$set(this,"height",t.height||"300px"),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)},n.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){return H({gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:0},t.defaultConfig)})),this.$computed(this,"_defaultStyle",(function(){return H({fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)}))},n.prototype.initWatch=function(){var t=this;this.$watch("width",(function(e){t.data.width=e,t.resize()})),this.$watch("height",(function(e){t.data.height=e,t.resize()})),this.$watch("blocks",(function(e){t.initImageCache()}),{deep:!0}),this.$watch("prizes",(function(e){t.initImageCache()}),{deep:!0}),this.$watch("buttons",(function(e){t.initImageCache()}),{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()}))},n.prototype.init=function(){var t,e;return M(this,void 0,void 0,(function(){var i;return j(this,(function(r){switch(r.label){case 0:return this.initLucky(),i=this.config,(t=i.beforeInit)===null||t===void 0||t.call(this),this.draw(),this.draw(),[4,this.initImageCache()];case 1:return r.sent(),(e=i.afterInit)===null||e===void 0||e.call(this),[2]}}))}))},n.prototype.initImageCache=function(){var t=this;return new Promise((function(e){var i={blocks:t.blocks.map((function(r){return r.imgs})),prizes:t.prizes.map((function(r){return r.imgs})),buttons:t.buttons.map((function(r){return r.imgs}))};
2Object.keys(i).forEach((function(r){var h=i[r],o=[];h&&h.forEach((function(c,a){c&&c.forEach((function(l,u){o.push(t.loadAndCacheImg(r,a,u))}))})),Promise.all(o).then((function(){t.draw(),e()}))}))}))},n.prototype.handleClick=function(t){var e,i=this.ctx;i.beginPath(),i.arc(0,0,this.maxBtnRadius,0,2*Math.PI,!1),i.isPointInPath(t.offsetX,t.offsetY)&&this.step===0&&((e=this.startCallback)===null||e===void 0||e.call(this,t))},n.prototype.loadAndCacheImg=function(t,e,i){return M(this,void 0,void 0,(function(){var r=this;return j(this,(function(h){return[2,new Promise((function(o,c){var a=r[t][e];if(a&&a.imgs){var l=a.imgs[i];l&&r.loadImg(l.src,l).then((function(u){return M(r,void 0,void 0,(function(){return j(this,(function(f){switch(f.label){case 0:return typeof l.formatter!="function"?[3,2]:[4,Promise.resolve(l.formatter.call(this,u))];case 1:u=f.sent(),f.label=2;case 2:return this.ImageCache.set(l.src,u),o(),[2]}}))}))})).catch((function(u){console.error(t+"["+e+"].imgs["+i+"] "+u),c()}))}}))]}))}))},n.prototype.drawBlock=function(t,e,i){var r=this,h=this.ctx;N(e.background)&&(h.beginPath(),h.fillStyle=e.background,h.arc(0,0,t,0,2*Math.PI,!1),h.fill()),e.imgs&&e.imgs.forEach((function(o,c){var a=r.ImageCache.get(o.src);if(a){var l=r.computedWidthAndHeight(a,o,2*t,2*t),u=l[0],f=l[1],v=[r.getOffsetX(u)+r.getLength(o.left,2*t),r.getLength(o.top,2*t)-t],g=v[0],d=v[1];h.save(),o.rotate&&h.rotate(X(r.rotateDeg)),r.drawImage(h,a,g,d,u,f),h.restore(
2)}}))},n.prototype.draw=function(){var t,e,i=this,r=this,h=r.config,o=r.ctx,c=r._defaultConfig,a=r._defaultStyle;(t=h.beforeDraw)===null||t===void 0||t.call(this,o),o.clearRect(-this.Radius,-this.Radius,2*this.Radius,2*this.Radius),this.prizeRadius=this.blocks.reduce((function(g,d,p){return i.drawBlock(g,d,p),g-i.getLength(d.padding&&d.padding.split(" ")[0])}),this.Radius),this.prizeDeg=360/this.prizes.length,this.prizeAng=X(this.prizeDeg);var l=this.prizeRadius*Math.sin(this.prizeAng/2)*2,u=X(this.rotateDeg-90+this.prizeDeg/2+c.offsetDegree),f=function(g,d){return i.getOffsetX(o.measureText(d).width)+i.getLength(g.left,l)},v=function(g,d,p){var y=g.lineHeight||a.lineHeight||g.fontSize||a.fontSize;return i.getLength(g.top,d)+(p+1)*i.getLength(y)};o.save(),this.prizes.forEach((function(g,d){var p=u+d*i.prizeAng,y=i.prizeRadius-i.maxBtnRadius,C=g.background||a.background;N(C)&&(o.fillStyle=C,(function(w,m,z,x,_,L){w.beginPath();var T,I,O=X(90/Math.PI/z*L),A=x+O,E=_-O;w.arc(0,0,z,A,E,!1),w.lineTo.apply(w,(T=(x+_)/2,I=L/2/Math.abs(Math.sin((x-_)/2)),[+(Math.cos(T)*I).toFixed(8),+(Math.sin(T)*I).toFixed(8)])),w.closePath()})(o,i.maxBtnRadius,i.prizeRadius,p-i.prizeAng/2,p+i.prizeAng/2,i.getLength(c.gutter)),o.fill());var b=Math.cos(p)*i.prizeRadius,S=Math.sin(p)*i.prizeRadius;o.translate(b,S),o.rotate(p+X(90)),g.imgs&&g.imgs.forEach((function(w,m){var z=i.ImageCache.get(w.src);if(z){var x=i.computedWidthAndHeight(z,w,i.prizeAng*i.prizeRadius,y),_=x[0],L=x[1],T=[i.getOffsetX(_)+i.getLength(w.left,l),i.getLength(w.top,y)],I=T[0],O=T[1];i.drawImage(o,z,I,O,_,L)}})),g.fonts&&g.fonts.forEach((function(w){var m=w.fontColor||a.fontColor,z=w.fontWeight||a.fontWeight,x=i.getLength(w.fontSize||a.fontSize),_=w.fontStyle||a.fontStyle,L=K(w,"wordWrap")?w.wordWrap:a.wordWrap,T=w.lengthLimit||a.lengthLimit,I=w.lineClamp||a.lineClamp;o.fillStyle=m,o.font=z+" "+(x>>0)+"px "+_;var O=String(w.text);(L?mt(o,vt(O),(function(A){var E=(i.prizeRadius-v(w,y,A.length))*Math.tan(i.prizeAng/2)*2-i.getLength(c.gutter);return i.getLength(T,E)}),I):O.split(` 3`)).filter((function(A){return!!A})).forEach((function(A,E){o.fillText(A,f(w,A),v(w,y,E))}))})),o.rotate(X(360)-p-X(90)),o.translate(-b,-S)})),o.restore(),this.buttons.forEach((function(g,d){var p=i.getLength(g.radius,i.prizeRadius);i.maxBtnRadius=Math.max(i.maxBtnRadius,p),N(g.background)&&(o.beginPath(),o.fillStyle=g.background,o.arc(0,0,p,0,2*Math.PI,!1),o.fill()),g.pointer&&N(g.background)&&(o.beginPath(),o.fillStyle=g.background,o.moveTo(-p,0),o.lineTo(p,0),o.lineTo(0,2*-p),o.closePath(),o.fill()),g.imgs&&g.imgs.forEach((function(y,C){var b=i.ImageCache.get(y.src);if(b){var S=i.computedWidthAndHeight(b,y,2*p,2*p),w=S[0],m=S[1],z=[i.getOffsetX(w)+i.getLength(y.left,p),i.getLength(y.top,p)],x=z[0],_=z[1];i.drawImage(o,b,x,_,w,m)}})),g.fonts&&g.fonts.forEach((function(y){var C=y.fontColor||a.fontColor,b=y.fontWeight||a.fontWeight,S=i.getLength(y.fontSize||a.fontSize),w=y.fontStyle||a.fontStyle;o.fillStyle=C,o.font=b+" "+(S>>0)+"px "+w,String(y.text).split(` 4`).forEach((function(m,z){o.fillText(m,f(y,m),v(y,p,z))}))}))})),(e=h.afterDraw)===null||e===void 0||e.call(this,o)},n.prototype.carveOnGunwaleOfAMovingBoat=function(){var t=this,e=t._defaultConfig,i=t.prizeFlag,r=t.prizeDeg,h=t.rotateDeg;this.endTime=Date.now();for(var o=this.stopDeg=h,c=e.speed,a=(Math.random()*r-r/2)*this.getLength(e.stopRange),l=0,u=0,f=0;++l;){var v=360*l-i*r-h-e.offsetDegree+a-r/2,g=Z(this.FPS,o,v,e.decelerationTime)-o;if(g>c){this.endDeg=c-u>g-c?v:f;break}f=v,u=g}},n.prototype.play=function(){var t,e;this.step===0&&(this.startTime=Date.now(),this.prizeFlag=void 0,this.step=1,(e=(t=this.config).afterStart)===null||e===void 0||e.call(t),this.run())},n.prototype.stop=function(t){if(this.step!==0&&this.step!==3){if(!t&&t!==0){var e=this.prizes.map((function(i){return i.range}));t=Et(e)}t<0?(this.step=0,this.prizeFlag=-1):(this.step=2,this.prizeFlag=t%this.prizes.length)}},n.prototype.run=function(t){var e;t===void 0&&(t=0);var i=this,r=i.rAF,h=i.step,o=i.prizeFlag,c=i._defaultConfig,a=c.accelerationTime,l=c.decelerationTime,u=c.speed;if(h!==0){if(o!==-1){h!==3||this.endDeg||this.carveOnGunwaleOfAMovingBoat();var f=Date.now()-this.startTime,v=Date.now()-this.endTime,g=this.rotateDeg;if(h===1||f<a){this.FPS=f/t;var d=wt(f,0,u,a);d===u&&(this.step=2),g+=d%360}else h===2?(g+=u%360,o!==void 0&&o>=0&&(this.step=3,this.stopDeg=0,this.endDeg=0)):h===3?(g=Z(v,this.stopDeg,this.endDeg,l),v>=l&&(this.step=0)):this.stop(-1);this.rotateDeg=g,this.draw(),r(this.run.bind(this,t+1))}}else(e=this.endCallback)===null||e===void 0||e.call(this,this.prizes.find((function(p,y){return y===o}))||{})},n.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr-this.Radius,e/i.dpr-this.Radius]},n})(yt);(function(s){function n(t,e){var i,r=s.call(this,t,{width:e.width,height:e.height})||this;return r.rows=3,r.cols=3,r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r.defaultStyle={},r.activeStyle={},r._defaultConfig={},r._defaultStyle={},r._activeStyle={},r.cellWidth=0,r.cellHeight=0,r.startTime=0,r.endTime=0,r.currIndex=0,r.stopIndex=0,r.endIndex=0,r.demo=!1,r.timer=0,r.FPS=16.6,r.step=0,r.prizeFlag=-1,r.cells=[],r.ImageCache=new Map,r.initData(e),r.initWatch(),r.initComputed(),(i=t.beforeCreate)===null||i===void 0||i.call(r),r.init(),r}return gt(n,s),n.prototype.resize=function(){var t,e;s.prototype.resize.call(this),this.draw(),(e=(t=this.config).afterResize)===null||e===void 0||e.call(t)},n.prototype.initLucky=function(){this.cellWidth=0,this.cellHeight=0,this.startTime=0,this.endTime=0,this.currIndex=0,this.stopIndex=0,this.endIndex=0,this.demo=!1,this.timer=0,this.FPS=16.6,this.prizeFlag=-1,this.step=0,s.prototype.initLucky.call(this)},n.prototype.initData=function(t){this.$set(this,"width",t.width||"300px"),this.$set(this,"height",t.height||"300px"),this.$set(this,"rows",Number(t.rows)||3),this.$set(this,"cols",Number(t.cols
4)||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)},n.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){var e=H({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 H({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 H({background:"#ffce98",shadow:""},t.activeStyle)}))},n.prototype.initWatch=function(){var t=this;this.$watch("width",(function(e){t.data.width=e,t.resize()})),this.$watch("height",(function(e){t.data.height=e,t.resize()})),this.$watch("blocks",(function(e){t.initImageCache()}),{deep:!0}),this.$watch("prizes",(function(e){t.initImageCache()}),{deep:!0}),this.$watch("buttons",(function(e){t.initImageCache()}),{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()}))},n.prototype.init=function(){var t,e;return M(this,void 0,void 0,(function(){var i;return j(this,(function(r){switch(r.label){case 0:return this.initLucky(),i=this.config,(t=i.beforeInit)===null||t===void 0||t.call(this),this.draw(),[4,this.initImageCache()];case 1:return r.sent(),(e=i.afterInit)===null||e===void 0||e.call(this),[2]}}))}))},n.prototype.initImageCache=function(){var t=this;return new Promise((function(e){var i=t.buttons.map((function(h){return h.imgs}));t.button&&i.push(t.button.imgs);var r={blocks:t.blocks.map((function(h){return h.imgs})),prizes:t.prizes.map((function(h){return h.imgs})),buttons:i};Object.keys(r).forEach((function(h){var o=r[h],c=[];o&&o.forEach((function(a,l){a&&a.forEach((function(u,f){c.push(t.loadAndCacheImg(h,l,f))}))})),Promise.all(c).then((function(){t.draw(),e()}))}))}))},n.prototype.handleClick=function(t){var e=this,i=this.ctx;J(J([],this.buttons),[this.button]).forEach((function(r){var h;if(r){var o=e.getGeometricProperty([r.x,r.y,r.col||1,r.row||1]),c=o[0],a=o[1],l=o[2],u=o[3];i.beginPath(),i.rect(c,a,l,u),i.isPointInPath(t.offsetX,t.offsetY)&&e.step===0&&(typeof r.callback=="function"&&r.callback.call(e,r),(h=e.startCallback)===null||h===void 0||h.call(e,t,r))}}))},n.prototype.loadAndCacheImg=function(t,e,i){return M(this,void 0,void 0,(function(){var r=this;return j(this,(function(h){return[2,new Promise((function(o,c){var a=r[t][e];if(t==="buttons"&&!r.buttons.length&&r.button&&(a=r.button),a&&a.imgs){var l=a.imgs[i];if(l){var u=[r.loadImg(l.src,l),l.activeSrc&&r.loadImg(l.activeSrc,l,"$activeResolve")];Promise.all(u).then((function(f){var v=f[0],g=f[1];return M(r,void 0,void 0,(function(){var d;return j(this,(function(p){switch(p.label){case 0:return typeof(d=l.formatter)!="function"?[3,3]:[4,Promise.resolve(d.call(this,v))];case 1:return v=p.sent(),g?[4,Promise.resolve(d.call(this,g))]:[3,3];case 2:g=p.sent(),p.label=3;case 3:return this.ImageCache.set(l.src,v),g&&this.ImageCache.set(l.activeSrc,g),o(),[2]}}))}))})).catch((function(f){console.error(t+"["+e+"].imgs["+i+"] "+f),c()}))}}}))]}))}))},n.prototype.draw=function(){var t,e,i=this,r=this,h=r.config,o=r.ctx,c=r._defaultConfig,a=r._defaultStyle,l=r._activeStyle;(t=h.beforeDraw)===null||t===void 0||t.call(this,o),o.clearRect(0,0,this.boxWidth,this.boxHeight),this.cells=J(J([],this.prizes),this.buttons),this.button&&this.cells.push(this.button),this.cells.forEac
4h((function(u){u.col=u.col||1,u.row=u.row||1})),this.prizeArea=this.blocks.reduce((function(u,f,v){var g=u.x,d=u.y,p=u.w,y=u.h,C=Ot(f,i.getLength.bind(i)),b=C[0],S=C[1],w=C[2],m=C[3],z=f.borderRadius?i.getLength(f.borderRadius):0,x=f.background;return N(x)&&(o.fillStyle=i.handleBackground(g,d,p,y,x),ht(o,g,d,p,y,z),o.fill()),f.imgs&&f.imgs.forEach((function(_,L){var T=i.ImageCache.get(_.src);if(T){var I=i.computedWidthAndHeight(T,_,p,y),O=I[0],A=I[1],E=[i.getOffsetX(O,p)+i.getLength(_.left,p),i.getLength(_.top,y)],R=E[0],V=E[1];i.drawImage(o,T,g+R,d+V,O,A)}})),{x:g+w,y:d+b,w:p-w-m,h:y-b-S}}),{x:0,y:0,w:this.boxWidth,h:this.boxHeight}),this.cellWidth=(this.prizeArea.w-c.gutter*(this.cols-1))/this.cols,this.cellHeight=(this.prizeArea.h-c.gutter*(this.rows-1))/this.rows,this.cells.forEach((function(u,f){var v=i.getGeometricProperty([u.x,u.y,u.col,u.row]),g=v[0],d=v[1],p=v[2],y=v[3],C=!1;(i.prizeFlag===void 0||i.prizeFlag>-1)&&(C=f===i.currIndex%i.prizes.length>>0);var b=C?l.background:u.background||a.background;if(N(b)){var S=(C?l.shadow:u.shadow||a.shadow).replace(/px/g,"").split(",")[0].split(" ").map((function(m,z){return z<3?Number(m):m}));S.length===4&&(o.shadowColor=S[3],o.shadowOffsetX=S[0]*h.dpr,o.shadowOffsetY=S[1]*h.dpr,o.shadowBlur=S[2],S[0]>0?p-=S[0]:(p+=S[0],g-=S[0]),S[1]>0?y-=S[1]:(y+=S[1],d-=S[1])),o.fillStyle=i.handleBackground(g,d,p,y,b);var w=i.getLength(u.borderRadius?u.borderRadius:a.borderRadius);ht(o,g,d,p,y,w),o.fill(),o.shadowColor="rgba(0, 0, 0, 0)",o.shadowOffsetX=0,o.shadowOffsetY=0,o.shadowBlur=0}f>=i.prizes.length&&(f-=i.prizes.length),u.imgs&&u.imgs.forEach((function(m,z){var x=i.ImageCache.get(m.src),_=i.ImageCache.get(m.activeSrc);if(x){var L=C&&_||x;if(L){var T=i.computedWidthAndHeight(L,m,p,y),I=T[0],O=T[1],A=[g+i.getOffsetX(I,p)+i.getLength(m.left,p),d+i.getLength(m.top,y)],E=A[0],R=A[1];i.drawImage(o,L,E,R,I,O)}}})),u.fonts&&u.fonts.forEach((function(m){var z=C&&l.fontStyle?l.fontStyle:m.fontStyle||a.fontStyle,x=C&&l.fontWeight?l.fontWeight:m.fontWeight||a.fontWeight,_=C&&l.fontSize?i.getLength(l.fontSize):i.getLength(m.fontSize||a.fontSize),L=C&&l.lineHeight?l.lineHeight:m.lineHeight||a.lineHeight||m.fontSize||a.fontSize,T=K(m,"wordWrap")?m.wordWrap:a.wordWrap,I=m.lengthLimit||a.lengthLimit,O=m.lineClamp||a.lineClamp;o.font=x+" "+(_>>0)+"px "+z,o.fillStyle=C&&l.fontColor?l.fontColor:m.fontColor||a.fontColor;var A=[],E=String(m.text);if(T){var R=i.getLength(I,p);A=mt(o,vt(E),(function(){return R}),O)}else A=E.split(` 5`);A.forEach((function(V,ct){o.fillText(V,g+i.getOffsetX(o.measureText(V).width,p)+i.getLength(m.left,p),d+i.getLength(m.top,y)+(ct+1)*i.getLength(L))}))}))})),(e=h.afterDraw)===null||e===void 0||e.call(this,o)},n.prototype.handleBackground=function(t,e,i,r,h){var o=this.ctx;return h.includes("linear-gradient")&&(h=(function(c,a,l,u,f,v){var g=/linear-gradient\((.+)\)/.exec(v)[1].split(",").map((function(b){return b.trim()})),d=g.shift(),p=[0,0,0,0];if(d.includes("deg")){var y=function(b){return Math.tan(b/180*Math.PI)};(d=d.slice(0,-3)%360)>=0&&d<45?p=[a,l+f,a+u,l+f-u*y(d-0)]:d>=45&&d<90?p=[a,l+f,a+u-f*y(d-45),l]:d>=90&&d<135?p=[a+u,l+f,a+u-f*y(d-90),l]:d>=135&&d<180?p=[a+u,l+f,a,l+u*y(d-135)]:d>=180&&d<225?p=[a+u,l,a,l+u*y(d-180)]:d>=225&&d<270?p=[a+u,l,a+f*y(d-225),l+f]:d>=270&&d<315?p=[a,l,a+f*y(d-270),l+f]:d>=315&&d<360&&(p=[a,l,a+u,l+f-u*y(d-315)])}else d.includes("top")?p=[a,l+f,a,l]:d.includes("bottom")?p=[a,l,a,l+f]:d.includes("left")?p=[a+u,l,a,l]:d.includes("right")&&(p=[a,l,a+u,l]);var C=c.createLinearGradient.apply(c,p.map((function(b){return b>>0})));return g.reduce((function(b,S,w){var m=S.split(" ");return m.length===1?b.addColorStop(w,m[0]):m.length===2&&b.addColorStop.apply(b,m),b}),C)})(o,t,e,i,r,h)),h},n.prototype.carveOnGunwaleOfAMovingBoat=function(){var t=this,e=t._defaultConfig,i=t.prizeFlag,r=t.currIndex;this.endTime=Date.now();for(var h=this.stopIndex=r,o=e.speed,c=0,a=0,l=0;++c;){var u=this.prizes.length*c+i-h,f=Z(this.FPS,h,u,e.decelerationTime)-h;if(f>o){this.endIndex=o-a>f-o?u:l;break}l=u,a=f}},n.prototype.play=function(){var t,e;this.step===0&&(this.startTime=Date.now(),this.prizeFlag=void 0,this.step=1,(e=(t=this.config).afterStart)===null||e===void 0||e.call(t),this.run())},n.prototype.stop=function(t){if(this.step!==0&&this.step!==3){if(!t&&t!==0){var e=this.prizes.map((function(i){return i.range}));t=Et(e)}t<0?(this.step=0,this.prizeFlag=-1):(this.step=2,this.prizeFlag=t%this.prizes.length)}},n.prototype.run=function(t){var e;t===void 0&&(t=0);var i=this,r=i.rAF,h=i.step,o=i.prizes,c=i.prizeFlag,a=i._defaultConfig,l=a.accelerationTime,u=a.decelerationTime,f=a.speed;if(h!==0){if(c!==-1){h!==3||this.endIndex||this.carveOnGunwaleOfAMovingBoat();var v=Date.now()-this.startTime,g=Date.now()-this.endTime,d=this.currIndex;if(h===1||v<l){this.FPS=v/t;var p=wt(v,.1,f-.1,l);p===f&&(this.step=2),d+=p%o.length}else h===2?(d+=f%o.length,c!==void 0&&c>=0&&(this.step=3,this.stopIndex=0,this.endIndex=0)):h===3?(d=Z(g,this.stopIndex,this.endIndex,u),g>=u&&(this.step=0)):this.stop(-1);this.currIndex=d,this.draw(),r(this.run.bind(this,t+1))}}else(e=this.endCallback)===null||e===void 0||e.call(this,this.prizes.find((function(y,C){return C===c}))||{})},n.prototype.getGeometricProperty=function(t){var e=t[0],i=t[1],r=t[2],h=r===void 0?1:r,o=t[3],c=o===void 0?1:o,a=this.cellWidth,l=this.cellHeight,u=this._defaultConfig.gutter,f=[this.prizeArea.x+(a+u)*e,this.prizeArea.y+(l+u)*i];return h&&c&&f.push(a*h+u*(h-1),l*c+u*(c-1)),f},n.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr,e/i.dpr]},n})(yt);(function(s){function n(t,e){var i,r=s.call(this,t,{width:e.width,height:e.height})||this;return r.blocks=[],r.prizes=[],r.slots=[],r.defaultConfig={},r._defaultConfig={},r.defaultStyle={},r._defaultStyle={},r.endCallback=function(){},r.cellWidth=0,r.cellHeight=0,r.cellAndSpacing=0,r.widthAndSpacing=0,r.heightAndSpacing=0,r.FPS=16.6,r.scroll=[],r.stopScroll=[],r.endScroll=[],r.startTime=0,r.endTime=0,r.step=0,r.prizeFlag=void 0,r.ImageCache=new Map,r.initData(e),r.initWatch(),r.initComputed(),(i=t.beforeCreate)===null||i===void 0||i.call(r),r.init(),r}return gt(n,s),n.prototype.resize=function(){var t,e;s.prototype.resize.call(this),this.draw(),(e=(t=this.config).afterResize)===null||e===void 0||e.call(t)},n.prototype.initLucky=function(){this.cellWidth=0,this.cellHeight=0,this.cellAndSpacing=0,this.widthAndSpacing=0,this.heightAndSpacing=0,this.FPS=16.6,this.scroll=[],this.stopScroll=[],this.endScroll=[],this.startTime=0,this.endTime=0,this.prizeFlag=void 0,this.step=0,s.prototype.initLucky.call(this)},n.prototype.initData=function(t){this.$set(this,"width",t.width||"300px"),this.$set(this,"height",t.height||"300px"),this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"slots",t.slots||[]),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"endCallback",t.end)},n.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){var e=H({mode:"vertical",rowSpacing:0,colSpacing:5,speed:20,direction:1,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return e.rowSpacing=t.getLength(e.rowSpacing),e.colSpacing=t.getLength(e.colSpacing),e})),this.$computed(this,"_defaultStyle",(function(){return H({borderRadius:0,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)}))},n.prototype.initWatch=function(){var t=this;this.$watch("width",(function(e){t.data.width=e,t.resize()})),this.$watch("height",(function(e){t.data.height=e,t.resize()})),this.$watch("blocks",(function(e){t.initImageCache()}),{deep:!0}),this.$watch("prizes",(function(e){t.initImageCache()}),{deep:!0}),this.$watch("slots",(function(e){t.drawOffscreenCanvas(),t.draw()}),{deep:!0}),this.$watch("defaultConfig",(function(){return t.draw()}),{deep:!0}),this.$watch("defaultStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("endCallback",(function(){return t.init()}))},n.prototype.init=function(){var t,e;return M(this,void 0,void 0,(function(){var i;return j(this,(function(r){switch(r.label){case 0:return this.initLucky(),i=this.config,(t=i.beforeInit)===null||t===void 0||t.call(this),this.drawOffscreenCanvas(),this.draw(),[4,this.initImageCache()];case 1:return r.sent(),(e=i.afterInit)===null||e===void 0||e.call(this),[2]}}))}))},n.prototype.initImageCache=function(){var t=this;return new Promise((function(e){var i={blocks:t.blocks.map((function(r){return r.imgs})),prizes:t.prizes.map((function(r){return r.imgs}))};
vendor: 4,208 bytes, lines 5-6
5Object.keys(i).forEach((function(r){var h=i[r],o=[];h&&h.forEach((function(c,a){c&&c.forEach((function(l,u){o.push(t.loadAndCacheImg(r,a,u))}))})),Promise.all(o).then((function(){t.drawOffscreenCanvas(),t.draw(),e()}))}))}))},n.prototype.loadAndCacheImg=function(t,e,i){return M(this,void 0,void 0,(function(){var r=this;return j(this,(function(h){return[2,new Promise((function(o,c){var a=r[t][e];if(a&&a.imgs){var l=a.imgs[i];l&&r.loadImg(l.src,l).then((function(u){return M(r,void 0,void 0,(function(){return j(this,(function(f){switch(f.label){case 0:return typeof l.formatter!="function"?[3,2]:[4,Promise.resolve(l.formatter.call(this,u))];case 1:u=f.sent(),f.label=2;case 2:return this.ImageCache.set(l.src,u),o(),[2]}}))}))})).catch((function(u){console.error(t+"["+e+"].imgs["+i+"] "+u),c()}))}}))]}))}))},n.prototype.drawOffscreenCanvas=function(){var t=this,e=this._defaultConfig,i=this._defaultStyle,r=this.drawBlocks(),h=r.w,o=r.h,c=this.prizes.length,a=this.displacementWidthOrHeight(),l=a.cellWidth,u=a.cellHeight,f=a.widthAndSpacing,v=a.heightAndSpacing,g=new Array(c).fill(void 0).map((function(S,w){return w})),d=0,p=0;this.slots.forEach((function(S,w){t.scroll[w]===void 0&&(t.scroll[w]=0),S.order=S.order||g;var m=S.order.length;d=Math.max(d,h+f*m),p=Math.max(p,o+v*m)}));var y=this.getOffscreenCanvas(d,p),C=y._offscreenCanvas,b=y._ctx;this._offscreenCanvas=C,this.slots.forEach((function(S,w){var m=l*w,z=u*w,x=0,_=(function($,q){for(var nt={},rt=[],F=0;F<$.length;F++)nt[F]=$[F];for(F=0;F<q.length;F++){var Q=nt[q[F]];Q&&(rt[F]=Q)}return rt})(t.prizes,S.order);if(_.length){_.forEach((function($,q){if($){S.order[q];var nt=f*q+e.colSpacing/2,rt=v*q+e.rowSpacing/2,F=t.displacement([m,rt,v],[nt,z,f]),Q=F[0],ut=F[1],$t=F[2];x+=$t;var bt=$.background||i.background;if(N(bt)){var Rt=t.getLength(K($,"borderRadius")?$.borderRadius:i.borderRadius);ht(b,Q,ut,l,l,Rt),b.fillStyle=bt,b.fill()}$.imgs&&$.imgs.forEach((function(P,St){var tt=t.ImageCache.get(P.src);if(tt){var ot=t.computedWidthAndHeight(tt,P,l,u),st=ot[0],ft=ot[1],at=[Q+t.getOffsetX(st,l)+t.getLength(P.left,l),ut+t.getLength(P.top,u)],dt=at[0],et=at[1];t.drawImage(b,tt,dt,et,st,ft)}})),$.fonts&&$.fonts.forEach((function(P){var St=P.fontStyle||i.fontStyle,tt=P.fontWeight||i.fontWeight,ot=t.getLength(P.fontSize||i.fontSize),st=P.lineHeight||i.lineHeight||P.fontSize||i.fontSize,ft=K(P,"wordWrap")?P.wordWrap:i.wordWrap,at=P.lengthLimit||i.lengthLimit,dt=P.lineClamp||i.lineClamp;b.font=tt+" "+(ot>>0)+"px "+St,b.fillStyle=P.fontColor||i.fontColor;var et=[],Ct=String(P.text);if(ft){var Dt=t.getLength(at,l);et=mt(b,vt(Ct),(function(){return Dt}),dt)}else et=Ct.split(` 6`);et.forEach((function(kt,Ht){b.fillText(kt,Q+t.getOffsetX(b.measureText(kt).width,l)+t.getLength(P.left,l),ut+t.getLength(P.top,u)+(Ht+1)*t.getLength(st))}))}))}}));for(var L=t.displacement([m,0,l,x],[0,z,x,u]),T=L[0],I=L[1],O=L[2],A=L[3],E=x;E<p+x;){var R=t.displacement([T,E],[E,I]),V=R[0],ct=R[1];t.drawImage(b,C,T,I,O,A,V,ct,O,A),E+=x}}}))},n.prototype.drawBlocks=function(){var t=this,e=this;e.config;var i=e.ctx;e._defaultConfig;var r=e._defaultStyle;return this.prizeArea=this.blocks.reduce((function(h,o,c){var a=h.x,l=h.y,u=h.w,f=h.h,v=Ot(o,t.getLength.bind(t)),g=v[0],d=v[1],p=v[2],y=v[3],C=o.borderRadius?t.getLength(o.borderRadius):0,b=o.background||r.background;return N(b)&&(ht(i,a,l,u,f,C),i.fillStyle=b,i.fill()),o.imgs&&o.imgs.forEach((function(S,w){var m=t.ImageCache.get(S.src);if(m){var z=t.computedWidthAndHeight(m,S,u,f),x=z[0],_=z[1],L=[t.getOffsetX(x,u)+t.getLength(S.left,u),t.getLength(S.top,f)],T=L[0],I=L[1];t.drawImage(i,m,a+T,l+I,x,_)}})),{x:a+p,y:l+g,w:u-p-y,h:f-g-d}}),{x:0,y:0,w:this.boxWidth,h:this.boxHeight})},n.prototype.draw=function(){var t,e=this,i=this,r=i.config,h=i.ctx;i._defaultConfig,i._defaultStyle,(t=r.beforeDraw)===null||t===void 0||t.call(this,h),h.clearRect(0,0,this.boxWidth,this.boxHeight);var o=this.drawBlocks(),c=o.x,a=o.y,l=o.w,u=o.h;if(this._offscreenCanvas){var f=this,v=f.cellWidth,g=f.cellHeight,d=f.cellAndSpacing,p=f.widthAndSpacing,y=f.heightAndSpacing;this.slots.forEach((function(C,b){var S=d*C.order.length,w=e.displacement(-(u-y)/2,-(l-p)/2),m=e.scroll[b]+w;m<0&&(m=m%S+S),m>S&&(m%=S);
6var z=e.displacement([v*b,m,v,u],[m,g*b,l,g]),x=z[0],_=z[1],L=z[2],T=z[3],I=e.displacement([c+p*b,a,v,u],[c,a+y*b,l,g]),O=I[0],A=I[1],E=I[2],R=I[3];e.drawImage(h,e._offscreenCanvas,x,_,L,T,O,A,E,R)}))}},n.prototype.carveOnGunwaleOfAMovingBoat=function(){var t=this,e=this,i=e._defaultConfig,r=e.prizeFlag,h=e.cellAndSpacing;this.endTime=Date.now(),this.slots.forEach((function(o,c){var a=o.order;if(a.length)for(var l=o.speed||i.speed,u=o.direction||i.direction,f=a.findIndex((function(C){return C===r[c]})),v=h*a.length,g=t.stopScroll[c]=t.scroll[c],d=0;++d;){var p=h*f+v*d*u-g,y=Z(t.FPS,g,p,i.decelerationTime)-g;if(Math.abs(y)>l){t.endScroll[c]=p;break}}}))},n.prototype.play=function(){var t,e;this.step===0&&(this.startTime=Date.now(),this.prizeFlag=void 0,this.step=1,(e=(t=this.config).afterStart)===null||e===void 0||e.call(t),this.run())},n.prototype.stop=function(t){var e;if(this.step!==0&&this.step!==3){if(typeof t=="number")this.prizeFlag=new Array(this.slots.length).fill(t);else{if(!it(t,"array"))return this.stop(-1),console.error("stop() æ æ³è¯å«çåæ°ç±»å "+typeof t);if(t.length!==this.slots.length)return this.stop(-1),console.error("stop(["+t+"]) åæ°é¿åº¦ç䏿£ç¡®");this.prizeFlag=t}!((e=this.prizeFlag)===null||e===void 0)&&e.includes(-1)?(this.prizeFlag=[],this.step=0):this.step=2}},n.prototype.run=function(t){var e,i,r=this;t===void 0&&(t=0);var h=this,o=h.rAF,c=h.step,a=h.prizeFlag,l=h._defaultConfig,u=h.cellAndSpacing,f=h.slots,v=l.accelerationTime,g=l.decelerationTime;if(this.step!==0||a?.length!==f.length){if(a===void 0||a.length){this.step!==3||this.endScroll.length||this.carveOnGunwaleOfAMovingBoat();var d=Date.now()-this.startTime,p=Date.now()-this.endTime;f.forEach((function(w,m){var z=w.order;if(z&&z.length){var x=u*z.length,_=Math.abs(w.speed||l.speed),L=w.direction||l.direction,T=0,I=r.scroll[m];if(c===1||d<v){r.FPS=d/t;var O=wt(d,0,_,v);O===_&&(r.step=2),T=(I+O*L)%x}else if(c===2)T=(I+_*L)%x,a?.length===f.length&&(r.step=3,r.stopScroll=[],r.endScroll=[]);else if(c===3&&p){var A=r.stopScroll[m],E=r.endScroll[m];T=Z(p,A,E,g),p>=g&&(r.step=0)}r.scroll[m]=T}})),this.draw(),o(this.run.bind(this,t+1))}}else{for(var y=a[0],C=0;C<f.length;C++){var b=f[C],S=a[C];if(!(!((e=b.order)===null||e===void 0)&&e.includes(S))||y!==S){y=-1;break}}(i=this.endCallback)===null||i===void 0||i.call(this,this.prizes.find((function(w,m){return m===y}))||void 0)}},n.prototype.displacement=function(t,e){return this._defaultConfig.mode==="horizontal"?e:t},n.prototype.displacementWidthOrHeight=function(){var t=this._defaultConfig.mode,e=this.slots.length,i=this._defaultConfig,r=i.colSpacing,h=i.rowSpacing,o=this.prizeArea||this.drawBlocks();o.x,o.y;var c,a,l=o.w,u=o.h,f=0,v=0;return t==="horizontal"?(v=this.cellHeight=(u-h*(e-1))/e,f=this.cellWidth=v):(f=this.cellWidth=(l-r*(e-1))/e,v=this.cellHeight=f),c=this.widthAndSpacing=this.cellWidth+r,a=this.heightAndSpacing=this.cellHeight+h,this.cellAndSpacing=t==="horizontal"?c:a,{cellWidth:f,cellHeight:v,widthAndSpacing:c,heightAndSpacing:a}},n})(yt);var he=function(s,n,t){n===void 0&&(n={});var e=n.props,i=n.domProps,r=n.on,h=(function(a,l){var u={};for(var f in a)Object.prototype.hasOwnProperty.call(a,f)&&l.indexOf(f)<0&&(u[f]=a[f]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function"){var v=0;for(f=Object.getOwnPropertySymbols(a);v<f.length;v++)l.indexOf(f[v])<0&&Object.prototype.propertyIsEnumerable.call(a,f[v])&&(u[f[v]]=a[f[v]])}return u})(n,["props","domProps","on"]),o=(function(a){return a?Object.entries(a).reduce((function(l,u){var f,v=u[0],g=u[1];return v="on"+(v=v.charAt(0).toUpperCase()+v.slice(1)),D(D({},l),((f={})[v]=g,f))}),{}):null})(r),c=D(D(D(D({},h),e),i),o);return Mt(s,c,t)},ce="@lucky-canvas/vue",ue=At({name:"LuckyWheel",props:{width:{type:[String,Number]},height:{type:[String,Number]},blocks:{type:Array,default:function(){return[]}},prizes:{type:Array,default:function(){return[]}},buttons:{type:Array,default:function(){return[]}},defaultStyle:{type:Object,default:function(){return{}}},defaultConfig:{type:Object,default:function(){return{}}}},emits:["start","end","success","error","finally"],watch:{blocks:function(s,n){this.lucky&&(this.lucky.blocks=s)},prizes:function(s,n){this.lucky&&(this.lucky.prizes=s)},buttons:function(s,n){this.lucky&&(this.lucky.buttons=s)}},data:function(){return{lucky:null}},mounted:function(){this.$refs.myLucky&&this.$refs.myLucky.setAttribute("package",ce+"@0.1.11");try{this.initLucky(),this.$emit("success")}catch(s){this.$emit("error",s)}finally{this.$emit("finally")}},methods:{initLucky:function(){var s=this;this.lucky=new le({flag:"WEB",width:String(this.width),height:String(this.height),divElement:this.$refs.myLucky,rAF:window.requestAnimationFrame,setTimeout:window.setTimeout,setInterval:window.setInterval,clearTimeout:window.clearTimeout,clearInterval:window.clearInterval},D(D({},this.$props),{start:function(n){s.$emit("start",n)},end:function(n){s.$emit("end",n)}}))},init:function(){this.lucky&&this.lucky.init()},play:function(){var s;(s=this.lucky)===null||s===void 0||s.play()},stop:function(s){var n;(n=this.lucky)===null||n===void 0||n.stop(s)}},render:function(){return he("div",{ref:"myLucky"})}});const fe="/assets/png/zp-D8vgYKZy.png",de="/assets/png/btn-BwnFkJZ9.png",pe=At({__name:"index",setup(s,{expose:n}){n();const t=jt(),{t:e}=Bt(),i=zt(),r=zt(null),{getTurntabl:h,store:o,pull:c,prizes:a,recordQuery:l,getTurntablAmount:u,onEnd:f,onStart:v,myLucky:g,onClick:d}
6=te(),p=[{padding:"0px",imgs:[{src:fe,width:"100%",height:"100%",rotate:!0}]}],y=[{radius:"30%",pointer:!0,imgs:[{src:de,top:-51,width:158/2,height:204/2}]}],C={1:e("amountReward"),2:e("physicalReward")},b=async w=>{t.push({name:w})};Nt(()=>{const w=i.value?.offsetWidth||350,m=i.value?.offsetHeight||350;r.value={width:w,height:m},h()});const S={router:t,t:e,content:i,wrap:r,getTurntabl:h,store:o,pull:c,prizes:a,recordQuery:l,getTurntablAmount:u,onEnd:f,onStart:v,myLucky:g,onClick:d,blocks:p,buttons:y,rewardType:C,goPage:b,get LuckyWheel(){return ue},get currency(){return Gt},List:ee,Dialog:ie,get getTurnTableRecord(){return Xt}};return Object.defineProperty(S,"__isScriptSetup",{enumerable:!1,value:!0}),S}}),ge="/assets/png/bg-CCVVUxJ6.png",ve={xmlns:"http://www.w3.org/2000/svg",width:"702",height:"59",fill:"none"};function me(s,n){return G(),Y("svg",ve,[...n[0]||(n[0]=[Ut('<path fill="url(#a)" d="M44 3.653V0h614v3.653c-7 0-31.35 0-39 4.11-8.5 4.567-13 7.764-24 28.314-9.508 17.763-25.5 22.529-31 22.833H139c-17 0-29.5-16.44-32.5-21.92s-6.495-13.695-17-24.203C79 2.283 54 3.653 44 3.653"></path><path fill="#FFBFA0" fill-rule="evenodd" d="M16 0C7.163 0 0 7.163 0 16v30.58l4-1.67V17.653c0-7.732 6.268-14 14-14h31.171L51 0zM686 0c8.837 0 16 7.163 16 16v30.58l-4-1.67V17.653c0-7.732-6.268-14-14-14h-31.171L651 0z" clip-rule="evenodd"></path><circle cx="22" cy="26.92" r="5" fill="#FFBFA0"></circle><circle cx="5" cy="5" r="5" fill="#FFBFA0" transform="matrix(-1 0 0 1 675 21.92)"></circle><defs><linearGradient id="a" x1="337" x2="337" y1="59.367" y2="0" gradientUnits="userSpaceOnUse"><stop stop-color="#FB2C2D"></stop><stop offset="1" stop-color="#F95959"></stop></linearGradient></defs>',5)])])}const ye={render:me},Ft=s=>(Kt("data-v-8eaaa6b6"),s=s(),Zt(),s),we={class:"turntable-page"},be=Ft(()=>k("div",{class:"turntable-page-header"},[k("img",{src:ge,alt:""})],-1)),Se={class:"turntable-wrap"},Ce={class:"turntable-back"},ke={class:"turntable-rule"},ze=Ft(()=>k("img",{class:"svg",src:ye,alt:""},null,-1)),xe={class:"turntable-item"},_e={class:"label"},Te={class:"wallet"},Ie={class:"turntable-item"},Le={class:"label"},Ae={class:"count"},Oe={class:"count-progress"},Ee={class:"turntable-main",ref:"content"},We={class:"turntable-entry"},Pe={class:"turntable-title"},Fe={class:"turntable-table"},$e={class:"turntable-table-titlebox"},Re={class:"turntable-table-title"},De={class:"turntable-table-title"},He={class:"turntable-table-title"},Me={class:"rewardType"},je={key:0,class:"rotateNum"},Be={key:1,class:"rotateNum"},Ne={style:{"text-align":"center"}},Xe={class:"rewardWin"};function Ge(s,n,t,e,i,r){const h=xt("NavBar"),o=xt("svg-icon");return G(),Y("div",we,[B(h,{title:s.$t("activityTurntable"),class:"white",placeholder:!1,"left-arrow":"",onClickLeft:e.onClick},null,8,["title","onClickLeft"]),be,k("div",Se,[k("div",Ce,[k("div",ke,[k("h3",null,W(s.$t("code9101")),1),ze]),k("div",xe,[k("span",_e,W(s.$t("depositMoney")),1),k("div",Te,[k("span",null,W(e.currency(e.store.amount)),1),k("span",{class:"re",onClick:n[0]||(n[0]=(...c)=>e.getTurntablAmount&&e.getTurntablAmount(...c))},[B(o,{name:"refresh"})])])]),k("div",Ie,[k("span",Le,W(s.$t("turntableCount")),1),k("div",Ae,[k("span",Oe,W(e.store.rotateCount),1),_t("/"+W(e.store.count),1)])])]),k("div",Ee,[e.wrap?(G(),qt(e.LuckyWheel,{key:0,ref:"myLucky",onStart:e.onStart,onEnd:e.onEnd,prizes:e.prizes,width:e.wrap.width,height:e.wrap.height,buttons:e.buttons,blocks:e.blocks,defaultConfig:{offsetDegree:-20,accelerationTime:1e3},defaultStyle:{lineHeight:15}},null,8,["onStart","onEnd","prizes","width","height"])):Qt("v-if",!0)],512),k("ul",We,[k("li",{class:"turntable-entry-item",onClick:n[1]||(n[1]=c=>e.goPage("Turntable-Introduce"))},[B(o,{name:"activityIntro"}),k("p",null,W(s.$t("activityIntroduce")),1)]),k("li",{class:"turntable-entry-item",onClick:n[2]||(n[2]=c=>e.goPage("Turntable-Detail"))},[B(o,{name:"activityDetail"}),k("p",null,W(s.$t("eventDetails")),1)]),k("li",{class:"turntable-entry-item",onClick:n[3]||(n[3]=c=>e.goPage("Turntable-Rules"))},[B(o,{name:"activityRule"}),k("p",null,W(s.$t("firstSaveRule")),1)])]),k("div",Pe,[B(o,{name:"historyHead"}),k("span",null,W(s.$t("record")),1)]),k("div",Fe,[k("div",$e,[k("div",Re,W(s.$t("turntableTime")),1),k("div",De,W(s.$t("winType")),1),k("div",He,W(s.$t("turntableWin")),1)]),B(e.List,{distance:300,api:e.getTurnTableRecord,list:e.store.turntableRecord,"onUpdate:list":n[4]||(n[4]=c=>e.store.turntableRecord=c),"page-query":e.recordQuery,"onUpdate:pageQuery":n[5]||(n[5]=c=>e.recordQuery=c),isAutoLoad:!0,ref:"pull"},{content:Tt(()=>[k("ul",null,[(G(!0),Y(Yt,null,Jt(e.store.turntableRecord,(c,a)=>(G(),Y("li",{key:a},[k("div",null,[k("p",null,W(c.drawTime),1)]),k("div",Me,W(e.rewardType[c.rewardType]),1
6),c.rewardType===1?(G(),Y("div",je,W(e.currency(c.rewardAmount)),1)):(G(),Y("div",Be,W(c.rewardSetting),1))]))),128))])]),_:1},8,["api","list","page-query"])])]),B(e.Dialog,{show:e.store.dialog,"onUpdate:show":n[6]||(n[6]=c=>e.store.dialog=c),"img-url":"succeed",onConfirm:n[7]||(n[7]=c=>e.store.dialog=!1),"show-cancel-btn":!1,confirmText:s.$t("sure"),title:s.$t("succTip1")},{title:Tt(()=>[k("div",Ne,[_t(W(s.$t("turntableWinTip")),1),k("span",Xe,W(e.store.result?.rewardType===1?e.currency(e.store.result?.rewardSetting):e.store.result?.rewardSetting),1)])]),_:1},8,["show","confirmText","title"])])}const ti=Vt(pe,[["render",Ge],["__scopeId","data-v-8eaaa6b6"],["__file","/home/jenkins/agent/workspace/AR093-Pages-india-jaiclub/src/views/activity/Turntable/index.vue"]]);export{ti as default};
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.