@everymatrix/casino-engagement-suite-luckywheel 0.16.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel-a32131a3.js +1 -0
- package/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.entry.js +1 -1
- package/dist/casino-engagement-suite-luckywheel/index.esm.js +1 -1
- package/dist/cjs/{casino-engagement-suite-luckywheel-7ce4e5e1.js → casino-engagement-suite-luckywheel-19d41091.js} +17 -8
- package/dist/cjs/casino-engagement-suite-luckywheel.cjs.entry.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/collection/components/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.js +12 -9
- package/dist/collection/models/luckywheel.js +6 -0
- package/dist/esm/{casino-engagement-suite-luckywheel-58f82f53.js → casino-engagement-suite-luckywheel-a32131a3.js} +17 -8
- package/dist/esm/casino-engagement-suite-luckywheel.entry.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/types/models/luckywheel.d.ts +13 -0
- package/package.json +1 -1
- package/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel-58f82f53.js +0 -1
package/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel-a32131a3.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i,g as e}from"./index-48c42d04.js";var s,r,n,a,o,h,c,d,l,u;!function(t){t.ActiveTickets="ActiveTickets",t.ImplicitTickets="ImplicitTickets",t.RemainingTimes="RemainingTimes"}(s||(s={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(r||(r={})),function(t){t.fulfilled="fulfilled",t.drawn="drawn"}(n||(n={})),function(t){t.noPrize="noprize",t.luckywheel="luckywheel",t.bonus="bonus"}(a||(a={})),function(t){t.Arrow="Arrow",t.Partition="Partition"}(o||(o={})),function(t){t.DownFromTop="DownFromTop",t.UpFromCenter="UpFromCenter",t.DownFromCenter="DownFromCenter",t.UpFromBottom="UpFromBottom"}(h||(h={})),function(t){t.en="en",t.fr="fr",t.de="de",t.tr="tr"}(c||(c={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(d||(d={})),function(t){t.launch="launch",t.loop="loop",t.halt="halt"}(l||(l={})),function(t){t.quad="quad",t.cubic="cubic",t.quart="quart",t.quint="quint",t.expo="expo",t.sine="sine",t.circ="circ"}(u||(u={}));const g=(t,i)=>{Object.keys(i).map((e=>{t.setAttribute(e.split(/(?=[A-Z])/).map((t=>t.toLocaleLowerCase())).join("-"),i[e])}))},b=t=>new Promise((i=>{let e=document.createElementNS("http://www.w3.org/2000/svg","image");e.onload=()=>i(e),e.onerror=()=>i(e),e.href.baseVal=t})),p=t=>({x:t,y:t}),f=(t,i)=>({x:t.x+i.x,y:t.y+i.y}),m={Image:"",Name:"Thank you",PrizeText:"",PrizeImage:""},v=async(t,i)=>{let e=((t,i)=>{const e=t.map((t=>{const e={};return Object.keys(t).map((s=>{"object"==typeof t[s]&&t[s]&&(e["Image1"===s?"Image":s]=t[s][i]||t[s]["*"])})),e}));return(t=>{let i=0;return t.map((t=>{i+=Number(t.probability)})),i})(t)<1&&e.push(m),e})(t.Program.WheelOfFortune.Partitions,i);return e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?e.map((t=>{if(t.Image){const i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.href.baseVal=t.Image,Object.assign(Object.assign({},t),{Image:i})}return t})):await Promise.all(e.map((async t=>Object.assign(Object.assign({},t),await(async t=>t?{Image:await b(t)}:{})(t.Image))))),e},y={in:{quad:t=>Math.pow(t,2),cubic:t=>Math.pow(t,3),quart:t=>Math.pow(t,4),quint:t=>Math.pow(t,5),sine:t=>1-Math.cos(t*Math.PI/2),expo:t=>0===t?0:Math.pow(2,10*t-10),circ:t=>1-Math.sqrt(1-Math.pow(t,2))},out:{quad:t=>1-Math.pow(1-t,2),cubic:t=>1-Math.pow(1-t,3),quart:t=>1-Math.pow(1-t,4),quint:t=>1-Math.pow(1-t,5),sine:t=>Math.sin(t*Math.PI/2),expo:t=>1===t?1:1-Math.pow(2,-10*t),circ:t=>Math.sqrt(1-Math.pow(t-1,2))}},x={quad:2,cubic:3,quart:4,quint:5,sine:Math.PI/2,expo:Math.LN2,circ:1/0},w={in:{quad:t=>2*t,cubic:t=>3*t**2,quart:t=>4*t**3,quint:t=>5*t**4,sine:t=>Math.PI/2*Math.sin(Math.PI/2*t),expo:t=>10*Math.LN2*2**(10*t-10),circ:t=>-.5*(1-t**2)**-.5},out:{cubic:t=>3*t**2-6*t+3}},k=[{launchTurns:5,launchSpeed:.2,loopSpeed:15,haltTurns:2,haltSpeed:.16},{launchTurns:2,launchSpeed:.5,loopSpeed:20,haltTurns:2,haltSpeed:.22},{launchTurns:6,launchSpeed:1.38,loopSpeed:45,haltTurns:6,haltSpeed:.5}],P=t=>Object.keys(t).map((i=>t[i]));var M;!function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise"}(M||(M={}));class j{constructor({size:t,radius:i,options:e,themeIndex:s,contentdirection:r}){this.arrowmode=h.DownFromTop,this.convertDegToArc=t=>t*Math.PI/180,this.convertArcToDeg=t=>180*t/Math.PI%360,this.getArcDelta=t=>2*Math.PI/t,this.findDeg=(t,i)=>t*this.convertArcToDeg(this.getArcDelta(i)),this.angleTransform=t=>{switch(t){case h.DownFromTop:case h.UpFromCenter:return-Math.PI/2;case h.DownFromCenter:case h.UpFromBottom:return Math.PI/2}},this.contentdirection=r,this.center=t/2,this.ratio=t/375,this.options=e,this.length=e.length,this.themeIndex=s,this.radius=i}get sizeImage(){const t=t=>48*this.ratio*5/t;if(this.length<=3)return t(4);switch(this.length){case 8:case 7:return 24*this.ratio;case 6:return 36*this.ratio;case 5:return 48*this.ratio;case 4:return 56*this.ratio;default:return t(this.length)}}getSizeImageByPartition(t){return this.options[t].Name?this.sizeImage/2:this.sizeImage}getSvgImageProps(t,i=1.25){const e=this.getSizeImageByPartition(t);let s;return s=this.options[t].Name?this.radius-e/2-3*this.ratio:(this.radius-e/2)/Number(i)-3*this.ratio,Object.assign(Object.assign({},this.getPropsForPartitionInfo(t,this.getOffsetImage(e),s,d.outward)),{width:e,height:e})}getSvgTextProps(t,i){const e=this.getSizeImageByPartition(t);let s;return s=this.options[t].Image?this.radius-e-6*this.ratio:this.radius-6*this.ratio,Object.assign({},this.getPropsForPartitionInfo(t,this.offsetText,s,void 0,i))}getSvgTextPropsAdjustedByImage(t){const i=this.getSvgTextProps(t,this.options[t].Image?80:100);return Object.assign({},i)}get offsetText(){return{center:0,position:{x:0,y:0},transform:{x:0,y:0}}}getOffsetImage(t){return{center:0,position:{x:-1*t/2,y:-1*t/2},transform:{x:0,y:0}}}get direction(){return M.clockwise}getAngleSelf(t,i){return 360*t/this.length*this.direction+90*(void 0!==i?i:d[this.contentdirection])}getPartitionPositions(t,i,e){const s=this.angleTransform(this.arrowmode)+this.direction*t*2*Math.PI/this.length,r=((t,i,e)=>{const s=p(e);return{x:s.x+t*Math.cos(i),y:s.y+t*Math.sin(i)}})(i||this.radius-9*this.ratio,s,this.center+e.center);return{transformOrigin:f(r,e.transform),point:f(r,e.position)}}getPropsForPartitionInfo(t,i,e,s,r){const{point:n,transformOrigin:a}=this.getPartitionPositions(t,e,i);return Object.assign(Object.assign({},n),{style:{"font-size":13*this.ratio+"px",transform:`rotate(${this.getAngleSelf(t,s)}deg) translate(${"clockwise"===this.contentdirection?n.x:n.x-100}px, ${n.y-50}px)`,"transform-origin":`${o=a,Object.keys(o).map((t=>`${o[t]}px`)).join(" ")}`,height:`${r}px`,width:`${r}px`}});var o}getPartitionDraw(t){const i=p(this.center),e=p(this.radius),{point:s,pointNext:r}=((t,i,e,s)=>{const r=t=>((t,i,e,s)=>{const r=Math.PI/180*(360/i*(t-.5)-90),n=p(s),a=p(e);return{x:n.x+a.x*Math.cos(r),y:n.y+a.y*Math.sin(r)}})(t,i,e,s);return{point:r(t),pointNext:r(t+1)}})(t,this.length,this.radius,this.center);return{d:["M",...P(i),"L",...P(s),"A",...P(e),"0 0 1",...P(r),"Z"].join(" ")}}getDeg(t){return this.findDeg(this.length-t,this.length)}getSpinnerProps(){const t=p(this.center);return{"transform-origin":`${t.x} ${t.y}`}}}class O{constructor(t){this.deg=0,this.degTarget=void 0,this.step=void 0,this.easingType=u.cubic,this.param=k[2],this.halt=(t,i=(()=>{}))=>{this.shouldHalt=()=>{this.step=l.halt,this.cb=()=>{i(),this.setDeg(t,0)},this.degTarget=t+360*this.param.haltTurns,this.continueRepeat()}},this.continueRepeat=()=>setTimeout((()=>this.ticker()),30),this.ticker=()=>{const t=this.param.loopSpeed,i=t=>33*x[this.easingType]*t/this.param.loopSpeed,e=()=>{const t=360*this.param.launchTurns-this.deg,e=i(t);this.animateF(e,this.deg,t,y.in[this.easingType],w.in[this.easingType])},s=()=>{const t=i(this.degTarget);this.animateF(t,0,this.degTarget,y.out[this.easingType],w.out[this.easingType])},r=()=>{this.setDeg((this.deg+t)%360,x[this.easingType]),this.continueRepeat()};({[l.launch]:()=>{this.cb=()=>{this.step=l.loop,this.setDeg(t,x[this.easingType]),this.continueRepeat()},e()},[l.loop]:()=>{this.shouldHalt&&0===this.deg?this.shouldHalt():r()},[l.halt]:()=>{this.deg===360-t?s():r()}})[this.step]()},this.setDeg=(t,i)=>{this.deg=t,this.tick(t,i)},this.animateF=(t,i,e,s,r)=>{let n=null;const a=()=>{let o=(new Date).getTime();n||(n=o);const h=o-n,c=e*s(h/t)+i,d=Math.abs(r(h/t));this.setDeg(c,d),h<t?setTimeout((()=>a()),30):this.cb()};a()},this.animate=(t,i,e,s,r)=>{let n=null;window.cancelAnimationFrame(n);let a=null;const o=h=>{a||(a=h);const c=h-a,d=e*s(c/t)+i,l=Math.abs(r(c/t));this.setDeg(d,l),c<t?n=window.requestAnimationFrame(o):this.cb()};n=window.requestAnimationFrame(o)},this.tick=t.tick}launch(){this.shouldHalt=void 0,this.step=l.launch,this.ticker()}}const C=class{constructor(i){t(this,i),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.host.prepend(i)}),1)})).catch((t=>{console.log("Error ",t)}))},this.renderImage=(t,i)=>{const e=this.options[i].Image;g(e,this.settings.getSvgImageProps(i)),t.innerHTML=null,t.appendChild(e)},this.updateSpinable=()=>{if(this.luckywheel.Current){if(Number(this.luckywheel.Current.RemainingTimes)>0)return void(this.spinable=!0);window.postMessage({type:"ShowNoSpinLeftModal"})}this.spinable=!1},this.eventSpin=()=>{this.updateSpinable(),this.spinable&&!this.isSpinning&&(this.isSpinning=!0,this.spinContainer=this.svg.querySelector("g.PartitionsContainer"),this.spinner.launch(),window.postMessage({type:"SpinLuckyWheel",data:{lotteryProgramID:this.luckywheel.Program.Id}}))},this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.luckywheel=void 0,this.size="440",this.contentdirection="anticlockwise",this.limitStylingAppends=!1,this.isPartitionsCustomableReady=!1,this.isSpinning=!1,this.options=void 0,this.radius=.85*Number(this.size)/2,this.speed=0,this.settings=void 0,this.svg=void 0,this.spinContainer=void 0,this.spinable=void 0,this.spinner=void 0}handleEvent(t){const{type:i,data:e}=null==t?void 0:t.data;if("SpinLuckyWheelRes"===i&&this.isSpinning){const t=+e.Result.WheelOfFortunePartitionIndex||0;e.State===n.fulfilled?this.handleSpinResult(e,t):this.handleSpinError(t)}}handleSpinError(t){const i=this.settings.getDeg(t);this.spinner.halt(i,(()=>{this.isSpinning=!1,this.updateSpinable(),window.postMessage({type:"ShowLuckywheelRewardModal",data:{HasError:!0}})}))}handleSpinResult(t,i){if(this.luckywheel.Program.Id===t.LotteryProgramID){const e=this.settings.getDeg(i);this.spinner.halt(e,(()=>{var e;this.isSpinning=!1,this.updateSpinable();const s=this.luckywheel.Program.WheelOfFortune.Partitions[i],r=null===(e=t.Result.Outcomes)||void 0===e?void 0:e.some((t=>{var i;return(null===(i=t.Action)||void 0===i?void 0:i.Type)===a.noPrize}));window.postMessage({type:"ShowLuckywheelRewardModal",data:{PrizeText:(null==s?void 0:s.PrizeText[this.language])||(null==s?void 0:s.PrizeText["*"]),PrizeMessage:(null==s?void 0:s.Name[this.language])||(null==s?void 0:s.Name["*"]),NoPrize:r,HasError:!1}})}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}async componentWillLoad(){this.options=await v(this.luckywheel,c.en),this.settings=new j({size:this.size,radius:this.radius,options:this.options,themeIndex:1,contentdirection:this.contentdirection}),this.spinner=new O({tick:(t,i)=>{g(this.spinContainer,{style:[`transform: rotate(${t}deg)`,`height: ${this.size}px`,`width: ${this.size}px`].join(";")}),this.speed=.5*i}})}defineGeneralVariables(){return{"--length":`${this.options.length}`,"--radius":`${this.radius}`,"--ratio":""+Number(this.size)/480,"--size":`${this.size}`}}setSvgSize(t){if(!t||!this.size)return;const i=this.size.toString();t.getAttribute("width")!==i&&t.setAttribute("width",i),t.getAttribute("height")!==i&&t.setAttribute("height",i)}render(){const t={height:`${this.size}px`,width:`${this.size}px`};return i("div",{key:"342885d64dc5fe0b2c84dce47872290fe4ff5af7",class:`WheelContainer ${this.device}`,style:this.defineGeneralVariables()},i("svg",{key:"7746651ebfb823f7ad977a4e4e358bf1406c9f3e",width:this.size,height:this.size,ref:t=>{this.svg=t}},i("foreignObject",{key:"d48003ce06db60ddeb26849cc4a6ed5812810a24",ref:this.setSvgSize.bind(this),class:"Bottom Customable"},i("div",{key:"219b20301e0b756a235f411b147274294baee0ab",style:t})),i("g",Object.assign({key:"917ea15a1d6989913a1b23357ae455d576691625",class:"PartitionsContainer"},this.settings.getSpinnerProps()),i("g",{key:"035155a7a943190fda49b8a0a89596ce0aac2a10",class:"PartitionsBackgrounds"},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),"clip-path":`url(#clip${s})`,class:"PartitionBackground Customable",style:Object.assign({"--index":s.toString()},t)},i("div",{style:t}))))),i("g",{key:"74857a797cbc7466a7e49f50411092cefaeb11e8",class:"PartitionsBackgroundStrokes"},this.options.map(((t,e)=>i("path",Object.assign({class:"PartitionBackgroundStroke"},this.settings.getPartitionDraw(e),{width:this.size,height:this.size}))))),i("g",{key:"9f6735c888e79e248ee1115b476822075e0c49fe",class:"Partitions",style:{filter:this.speed>.3?`blur(${this.speed}px)`:""}},this.options.map(((t,e)=>[t.Image&&i("g",{class:`PartitionImage PartitionImage${e}`,ref:t=>this.renderImage(t,e)}),t.Name&&i("foreignObject",Object.assign({class:"PartitionText",ref:t=>{if(t){const i=this.options[e].Image?"80":"100";t.setAttribute("width",i),t.setAttribute("height",i)}}},this.settings.getSvgTextPropsAdjustedByImage(e)),i("div",{class:"PartitionTextEntityContainer"},i("p",{class:"PartitionTextEntity"+("clockwise"===this.settings.contentdirection?"":" Anticlockwise"),innerHTML:t.Name})))])))),i("g",{key:"c62b31497903ff7d034bd2b7de35434836cca0c4",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable1:!0}},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),class:"Partition1 Customable",style:{"--index":s.toString()}},i("div",{style:t}))))),i("g",{key:"c3484f6930d35f3e4ca08d014b3b021e47021d44",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable2:!0}},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),class:"Partition2 Customable",style:{"--index":s.toString()}},i("div",{style:t}))))),i("foreignObject",{key:"25a125820e8c14c780eb10bf662828c01dafb21c",ref:this.setSvgSize.bind(this),class:"Middle Customable",style:t},i("div",{key:"8c97c23afd581c7bb6510af3d8ebebdae885c6b9",style:t})),i("foreignObject",{key:"ed5f6284d6abf6d4fe7d54ca12d586f963a76386",ref:this.setSvgSize.bind(this),class:"Top Customable",style:t},i("div",{key:"41f23de3872cbadb73f89e2342567c739e174a22",style:t})),i("g",{key:"4949dd37d805c79a1a4363409aca17bb158956ea",class:{spinning:this.isSpinning,Center:!0}},i("foreignObject",{key:"4b5c25b029a45d92e17b244804d3873f70cc1fd6",ref:t=>{t&&(t.setAttribute("width","100"),t.setAttribute("height","100"))},style:{transform:`translate(${Number(this.size)/2-50}px, ${Number(this.size)/2-50}px)`}},i("div",{key:"bb7162a6527af2f2fd20d9dd17ce76c49dfe719c",style:{width:"100px",height:"100px",cursor:"pointer"},onClick:this.eventSpin}))),i("g",{key:"08e09c376e45a3d87d8c25487c1678fc6760822b"},this.options.map(((t,e)=>i("clipPath",{id:`clip${e}`},i("path",Object.assign({},this.settings.getPartitionDraw(e)))))))))}get host(){return e(this)}};C.style=':host{font-family:system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"}*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.LotteryProgramWof{background:var(--emw--color-contrast, #07072A);display:flex;align-items:center;flex-direction:column;padding:20px 0}main{max-width:600px;width:100%;display:flex;justify-content:space-around;min-height:200px}svg{transition:opacity 0.3s}.WheelContainer{text-align:center}.FortuneContainer{width:100%;display:flex;align-items:center;flex-direction:column}.Center{cursor:pointer;transition:filter;transition-duration:1s}.Center.disabled{filter:grayscale(80%)}.Center .CenterCircle{fill:#3CE4BB;stroke:rgb(150, 54, 88);stroke-width:2px;cursor:pointer;transition:fill;transition-duration:1s}.Center .CenterText{fill:#FFFFFF}.PointerPartition{opacity:0.3;fill:lightgoldenrodyellow;stroke:red;stroke-width:6px;stroke-dasharray:12}.Current{color:#FFFFFF}.PartitionText{color:#FFFFFF;font-style:normal;font-weight:700;text-anchor:end;text-shadow:0px 3px #000;dominant-baseline:central}.PartitionsShadow{background-blend-mode:multiply;mix-blend-mode:multiply}.PartitionTextEntityContainer{height:100%;display:flex;align-items:center}.PartitionTextEntity{width:100%}.PartitionTextEntity.Anticlockwise{text-align:end}foreignObject.Bottom div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-bg.svg");background-size:calc(var(--radius) * 2px + var(--ratio) * 20px);background-position:center}foreignObject.Middle div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-spin.svg"), url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-pointer.svg");background-position:center, center 5px}foreignObject.Top{mix-blend-mode:multiply}foreignObject.Top div{background-image:var(--img-theme-shadow);background-position:center;background-size:calc(var(--radius) * 2px)}foreignObject.Partition1 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc(var(--index) * 360deg / var(--length)))}foreignObject.Partition2 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc((var(--index) + 0.5) * 360deg / var(--length)))}foreignObject.PointerArea{mix-blend-mode:screen}foreignObject.PointerArea div{background-image:var(--img-theme-pointer-area);background-position:center -3px;background-size:51%}foreignObject.Partition1 div,foreignObject.Partition2 div{transform-origin:center}.PartitionsCustomable1 div,.PartitionsCustomable2 div{visibility:hidden}.PartitionsCustomable1 div.active,.PartitionsCustomable2 div.active{visibility:visible}foreignObject.Customable{overflow:visible}foreignObject.Customable div{background-repeat:no-repeat}.PartitionBackground div{background-size:calc(var(--radius) * 2 / var(--size) * 100%) calc(var(--radius) * 2 / var(--size) * 100%);background-position:center}.PartitionBackground:nth-child(2n) div{background:var(--emw--color-primary, #3F2E75)}.PartitionBackground:nth-child(2n+1) div{background:var(--emw--color-secondary, #9482CE)}.PartitionBackground div{transform-origin:center}.PartitionBackgroundStroke{fill:transparent;stroke:var(--emw--color-background-secondary, #251D3E);stroke-width:3px;stroke-dasharray:none}.PointerPartitionFrame{stroke:#FFDD64;fill:transparent;stroke-dasharray:var(--radius) calc(6.2831853072 / var(--length) * var(--radius));stroke-width:0px}.PointerPartitionFrame.active{stroke-width:3px}.WheelContainer.Mobile foreignObject.Middle div{background-size:95px, 38px}.PartitionText .PartitionTextEntityContainer .PartitionTextEntity{text-align:center;text-transform:uppercase;text-shadow:none;font-size:var(--emw--font-size-small, 14px);font-weight:900}';export{C}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{C as casino_engagement_suite_luckywheel}from"./casino-engagement-suite-luckywheel-
|
|
1
|
+
export{C as casino_engagement_suite_luckywheel}from"./casino-engagement-suite-luckywheel-a32131a3.js";import"./index-48c42d04.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{C as CasinoEngagementSuiteLuckywheel}from"./casino-engagement-suite-luckywheel-
|
|
1
|
+
export{C as CasinoEngagementSuiteLuckywheel}from"./casino-engagement-suite-luckywheel-a32131a3.js";import"./index-48c42d04.js";
|
|
@@ -19,6 +19,12 @@ var ELuckyWheelResultState;
|
|
|
19
19
|
ELuckyWheelResultState["fulfilled"] = "fulfilled";
|
|
20
20
|
ELuckyWheelResultState["drawn"] = "drawn";
|
|
21
21
|
})(ELuckyWheelResultState || (ELuckyWheelResultState = {}));
|
|
22
|
+
var ELuckyWheelActionTypes;
|
|
23
|
+
(function (ELuckyWheelActionTypes) {
|
|
24
|
+
ELuckyWheelActionTypes["noPrize"] = "noprize";
|
|
25
|
+
ELuckyWheelActionTypes["luckywheel"] = "luckywheel";
|
|
26
|
+
ELuckyWheelActionTypes["bonus"] = "bonus";
|
|
27
|
+
})(ELuckyWheelActionTypes || (ELuckyWheelActionTypes = {}));
|
|
22
28
|
|
|
23
29
|
var PointerMode;
|
|
24
30
|
(function (PointerMode) {
|
|
@@ -655,9 +661,11 @@ const CasinoEngagementSuiteLuckywheel = class {
|
|
|
655
661
|
if (this.luckywheel.Program.Id === data.LotteryProgramID) {
|
|
656
662
|
const partitionDegree = this.settings.getDeg(index);
|
|
657
663
|
this.spinner.halt(partitionDegree, () => {
|
|
664
|
+
var _a;
|
|
658
665
|
this.isSpinning = false;
|
|
659
666
|
this.updateSpinable();
|
|
660
667
|
const partition = this.luckywheel.Program.WheelOfFortune.Partitions[index];
|
|
668
|
+
const noPrize = (_a = data.Result.Outcomes) === null || _a === void 0 ? void 0 : _a.some((outcome) => { var _a; return ((_a = outcome.Action) === null || _a === void 0 ? void 0 : _a.Type) === ELuckyWheelActionTypes.noPrize; });
|
|
661
669
|
const prizeText = (partition === null || partition === void 0 ? void 0 : partition.PrizeText[this.language]) || (partition === null || partition === void 0 ? void 0 : partition.PrizeText['*']);
|
|
662
670
|
const prizeName = (partition === null || partition === void 0 ? void 0 : partition.Name[this.language]) || (partition === null || partition === void 0 ? void 0 : partition.Name['*']);
|
|
663
671
|
window.postMessage({
|
|
@@ -665,6 +673,7 @@ const CasinoEngagementSuiteLuckywheel = class {
|
|
|
665
673
|
data: {
|
|
666
674
|
PrizeText: prizeText,
|
|
667
675
|
PrizeMessage: prizeName,
|
|
676
|
+
NoPrize: noPrize,
|
|
668
677
|
HasError: false
|
|
669
678
|
}
|
|
670
679
|
});
|
|
@@ -719,13 +728,13 @@ const CasinoEngagementSuiteLuckywheel = class {
|
|
|
719
728
|
}
|
|
720
729
|
render() {
|
|
721
730
|
const foreignObjectAgentProps = { height: `${this.size}px`, width: `${this.size}px` };
|
|
722
|
-
return (index.h("div", { key: '
|
|
731
|
+
return (index.h("div", { key: '342885d64dc5fe0b2c84dce47872290fe4ff5af7', class: `WheelContainer ${this.device}`, style: this.defineGeneralVariables() }, index.h("svg", { key: '7746651ebfb823f7ad977a4e4e358bf1406c9f3e', width: this.size, height: this.size, ref: (el) => {
|
|
723
732
|
this.svg = el;
|
|
724
|
-
} }, index.h("foreignObject", { key: '
|
|
733
|
+
} }, index.h("foreignObject", { key: 'd48003ce06db60ddeb26849cc4a6ed5812810a24', ref: this.setSvgSize.bind(this), class: "Bottom Customable" }, index.h("div", { key: '219b20301e0b756a235f411b147274294baee0ab', style: foreignObjectAgentProps })), index.h("g", Object.assign({ key: '917ea15a1d6989913a1b23357ae455d576691625', class: "PartitionsContainer" }, this.settings.getSpinnerProps()), index.h("g", { key: '035155a7a943190fda49b8a0a89596ce0aac2a10', class: "PartitionsBackgrounds" }, this.options.map((_el, index$1) => {
|
|
725
734
|
return (index.h("foreignObject", { ref: this.setSvgSize.bind(this), "clip-path": `url(#clip${index$1})`, class: "PartitionBackground Customable", style: Object.assign({ '--index': index$1.toString() }, foreignObjectAgentProps) }, index.h("div", { style: foreignObjectAgentProps })));
|
|
726
|
-
})), index.h("g", { key: '
|
|
735
|
+
})), index.h("g", { key: '74857a797cbc7466a7e49f50411092cefaeb11e8', class: "PartitionsBackgroundStrokes" }, this.options.map((_el, index$1) => {
|
|
727
736
|
return (index.h("path", Object.assign({ class: "PartitionBackgroundStroke" }, this.settings.getPartitionDraw(index$1), { width: this.size, height: this.size })));
|
|
728
|
-
})), index.h("g", { key: '
|
|
737
|
+
})), index.h("g", { key: '9f6735c888e79e248ee1115b476822075e0c49fe', class: "Partitions", style: { filter: this.speed > 0.3 ? `blur(${this.speed}px)` : '' } }, this.options.map((el, index$1) => {
|
|
729
738
|
return [
|
|
730
739
|
el.Image && (index.h("g", { class: `PartitionImage PartitionImage${index$1}`, ref: (el) => this.renderImage(el, index$1) })),
|
|
731
740
|
el.Name && (index.h("foreignObject", Object.assign({ class: "PartitionText", ref: (el) => {
|
|
@@ -736,18 +745,18 @@ const CasinoEngagementSuiteLuckywheel = class {
|
|
|
736
745
|
}
|
|
737
746
|
} }, this.settings.getSvgTextPropsAdjustedByImage(index$1)), index.h("div", { class: "PartitionTextEntityContainer" }, index.h("p", { class: `PartitionTextEntity${this.settings.contentdirection === 'clockwise' ? '' : ' Anticlockwise'}`, innerHTML: el.Name }))))
|
|
738
747
|
];
|
|
739
|
-
}))), index.h("g", { key: '
|
|
748
|
+
}))), index.h("g", { key: 'c62b31497903ff7d034bd2b7de35434836cca0c4', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable1: true } }, this.options.map((_el, index$1) => {
|
|
740
749
|
return (index.h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition1 Customable", style: { '--index': index$1.toString() } }, index.h("div", { style: foreignObjectAgentProps })));
|
|
741
|
-
})), index.h("g", { key: '
|
|
750
|
+
})), index.h("g", { key: 'c3484f6930d35f3e4ca08d014b3b021e47021d44', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable2: true } }, this.options.map((_el, index$1) => {
|
|
742
751
|
return (index.h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition2 Customable", style: { '--index': index$1.toString() } }, index.h("div", { style: foreignObjectAgentProps })));
|
|
743
|
-
})), index.h("foreignObject", { key: '
|
|
752
|
+
})), index.h("foreignObject", { key: '25a125820e8c14c780eb10bf662828c01dafb21c', ref: this.setSvgSize.bind(this), class: "Middle Customable", style: foreignObjectAgentProps }, index.h("div", { key: '8c97c23afd581c7bb6510af3d8ebebdae885c6b9', style: foreignObjectAgentProps })), index.h("foreignObject", { key: 'ed5f6284d6abf6d4fe7d54ca12d586f963a76386', ref: this.setSvgSize.bind(this), class: "Top Customable", style: foreignObjectAgentProps }, index.h("div", { key: '41f23de3872cbadb73f89e2342567c739e174a22', style: foreignObjectAgentProps })), index.h("g", { key: '4949dd37d805c79a1a4363409aca17bb158956ea', class: { spinning: this.isSpinning, Center: true } }, index.h("foreignObject", { key: '4b5c25b029a45d92e17b244804d3873f70cc1fd6', ref: (el) => {
|
|
744
753
|
if (el) {
|
|
745
754
|
el.setAttribute('width', '100');
|
|
746
755
|
el.setAttribute('height', '100');
|
|
747
756
|
}
|
|
748
757
|
}, style: {
|
|
749
758
|
transform: `translate(${Number(this.size) / 2 - 100 / 2}px, ${Number(this.size) / 2 - 100 / 2}px)`
|
|
750
|
-
} }, index.h("div", { key: '
|
|
759
|
+
} }, index.h("div", { key: 'bb7162a6527af2f2fd20d9dd17ce76c49dfe719c', style: { width: '100px', height: '100px', cursor: 'pointer' }, onClick: this.eventSpin }))), index.h("g", { key: '08e09c376e45a3d87d8c25487c1678fc6760822b' }, this.options.map((_el, index$1) => {
|
|
751
760
|
return (index.h("clipPath", { id: `clip${index$1}` }, index.h("path", Object.assign({}, this.settings.getPartitionDraw(index$1)))));
|
|
752
761
|
})))));
|
|
753
762
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-
|
|
5
|
+
const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-19d41091.js');
|
|
6
6
|
require('./index-6096cc4b.js');
|
|
7
7
|
|
|
8
8
|
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-
|
|
5
|
+
const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-19d41091.js');
|
|
6
6
|
require('./index-6096cc4b.js');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
import { ELuckyWheelResultState } from "../../models/luckywheel";
|
|
2
|
+
import { ELuckyWheelActionTypes, ELuckyWheelResultState } from "../../models/luckywheel";
|
|
3
3
|
import { SvgCalc } from "../../utils/class.svgcalc";
|
|
4
4
|
import { Lang } from "../../utils/types";
|
|
5
5
|
import { getOptions, setProps } from "../../utils/utils";
|
|
@@ -112,9 +112,11 @@ export class CasinoEngagementSuiteLuckywheel {
|
|
|
112
112
|
if (this.luckywheel.Program.Id === data.LotteryProgramID) {
|
|
113
113
|
const partitionDegree = this.settings.getDeg(index);
|
|
114
114
|
this.spinner.halt(partitionDegree, () => {
|
|
115
|
+
var _a;
|
|
115
116
|
this.isSpinning = false;
|
|
116
117
|
this.updateSpinable();
|
|
117
118
|
const partition = this.luckywheel.Program.WheelOfFortune.Partitions[index];
|
|
119
|
+
const noPrize = (_a = data.Result.Outcomes) === null || _a === void 0 ? void 0 : _a.some((outcome) => { var _a; return ((_a = outcome.Action) === null || _a === void 0 ? void 0 : _a.Type) === ELuckyWheelActionTypes.noPrize; });
|
|
118
120
|
const prizeText = (partition === null || partition === void 0 ? void 0 : partition.PrizeText[this.language]) || (partition === null || partition === void 0 ? void 0 : partition.PrizeText['*']);
|
|
119
121
|
const prizeName = (partition === null || partition === void 0 ? void 0 : partition.Name[this.language]) || (partition === null || partition === void 0 ? void 0 : partition.Name['*']);
|
|
120
122
|
window.postMessage({
|
|
@@ -122,6 +124,7 @@ export class CasinoEngagementSuiteLuckywheel {
|
|
|
122
124
|
data: {
|
|
123
125
|
PrizeText: prizeText,
|
|
124
126
|
PrizeMessage: prizeName,
|
|
127
|
+
NoPrize: noPrize,
|
|
125
128
|
HasError: false
|
|
126
129
|
}
|
|
127
130
|
});
|
|
@@ -176,13 +179,13 @@ export class CasinoEngagementSuiteLuckywheel {
|
|
|
176
179
|
}
|
|
177
180
|
render() {
|
|
178
181
|
const foreignObjectAgentProps = { height: `${this.size}px`, width: `${this.size}px` };
|
|
179
|
-
return (h("div", { key: '
|
|
182
|
+
return (h("div", { key: '342885d64dc5fe0b2c84dce47872290fe4ff5af7', class: `WheelContainer ${this.device}`, style: this.defineGeneralVariables() }, h("svg", { key: '7746651ebfb823f7ad977a4e4e358bf1406c9f3e', width: this.size, height: this.size, ref: (el) => {
|
|
180
183
|
this.svg = el;
|
|
181
|
-
} }, h("foreignObject", { key: '
|
|
184
|
+
} }, h("foreignObject", { key: 'd48003ce06db60ddeb26849cc4a6ed5812810a24', ref: this.setSvgSize.bind(this), class: "Bottom Customable" }, h("div", { key: '219b20301e0b756a235f411b147274294baee0ab', style: foreignObjectAgentProps })), h("g", Object.assign({ key: '917ea15a1d6989913a1b23357ae455d576691625', class: "PartitionsContainer" }, this.settings.getSpinnerProps()), h("g", { key: '035155a7a943190fda49b8a0a89596ce0aac2a10', class: "PartitionsBackgrounds" }, this.options.map((_el, index) => {
|
|
182
185
|
return (h("foreignObject", { ref: this.setSvgSize.bind(this), "clip-path": `url(#clip${index})`, class: "PartitionBackground Customable", style: Object.assign({ '--index': index.toString() }, foreignObjectAgentProps) }, h("div", { style: foreignObjectAgentProps })));
|
|
183
|
-
})), h("g", { key: '
|
|
186
|
+
})), h("g", { key: '74857a797cbc7466a7e49f50411092cefaeb11e8', class: "PartitionsBackgroundStrokes" }, this.options.map((_el, index) => {
|
|
184
187
|
return (h("path", Object.assign({ class: "PartitionBackgroundStroke" }, this.settings.getPartitionDraw(index), { width: this.size, height: this.size })));
|
|
185
|
-
})), h("g", { key: '
|
|
188
|
+
})), h("g", { key: '9f6735c888e79e248ee1115b476822075e0c49fe', class: "Partitions", style: { filter: this.speed > 0.3 ? `blur(${this.speed}px)` : '' } }, this.options.map((el, index) => {
|
|
186
189
|
return [
|
|
187
190
|
el.Image && (h("g", { class: `PartitionImage PartitionImage${index}`, ref: (el) => this.renderImage(el, index) })),
|
|
188
191
|
el.Name && (h("foreignObject", Object.assign({ class: "PartitionText", ref: (el) => {
|
|
@@ -193,18 +196,18 @@ export class CasinoEngagementSuiteLuckywheel {
|
|
|
193
196
|
}
|
|
194
197
|
} }, this.settings.getSvgTextPropsAdjustedByImage(index)), h("div", { class: "PartitionTextEntityContainer" }, h("p", { class: `PartitionTextEntity${this.settings.contentdirection === 'clockwise' ? '' : ' Anticlockwise'}`, innerHTML: el.Name }))))
|
|
195
198
|
];
|
|
196
|
-
}))), h("g", { key: '
|
|
199
|
+
}))), h("g", { key: 'c62b31497903ff7d034bd2b7de35434836cca0c4', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable1: true } }, this.options.map((_el, index) => {
|
|
197
200
|
return (h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition1 Customable", style: { '--index': index.toString() } }, h("div", { style: foreignObjectAgentProps })));
|
|
198
|
-
})), h("g", { key: '
|
|
201
|
+
})), h("g", { key: 'c3484f6930d35f3e4ca08d014b3b021e47021d44', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable2: true } }, this.options.map((_el, index) => {
|
|
199
202
|
return (h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition2 Customable", style: { '--index': index.toString() } }, h("div", { style: foreignObjectAgentProps })));
|
|
200
|
-
})), h("foreignObject", { key: '
|
|
203
|
+
})), h("foreignObject", { key: '25a125820e8c14c780eb10bf662828c01dafb21c', ref: this.setSvgSize.bind(this), class: "Middle Customable", style: foreignObjectAgentProps }, h("div", { key: '8c97c23afd581c7bb6510af3d8ebebdae885c6b9', style: foreignObjectAgentProps })), h("foreignObject", { key: 'ed5f6284d6abf6d4fe7d54ca12d586f963a76386', ref: this.setSvgSize.bind(this), class: "Top Customable", style: foreignObjectAgentProps }, h("div", { key: '41f23de3872cbadb73f89e2342567c739e174a22', style: foreignObjectAgentProps })), h("g", { key: '4949dd37d805c79a1a4363409aca17bb158956ea', class: { spinning: this.isSpinning, Center: true } }, h("foreignObject", { key: '4b5c25b029a45d92e17b244804d3873f70cc1fd6', ref: (el) => {
|
|
201
204
|
if (el) {
|
|
202
205
|
el.setAttribute('width', '100');
|
|
203
206
|
el.setAttribute('height', '100');
|
|
204
207
|
}
|
|
205
208
|
}, style: {
|
|
206
209
|
transform: `translate(${Number(this.size) / 2 - 100 / 2}px, ${Number(this.size) / 2 - 100 / 2}px)`
|
|
207
|
-
} }, h("div", { key: '
|
|
210
|
+
} }, h("div", { key: 'bb7162a6527af2f2fd20d9dd17ce76c49dfe719c', style: { width: '100px', height: '100px', cursor: 'pointer' }, onClick: this.eventSpin }))), h("g", { key: '08e09c376e45a3d87d8c25487c1678fc6760822b' }, this.options.map((_el, index) => {
|
|
208
211
|
return (h("clipPath", { id: `clip${index}` }, h("path", Object.assign({}, this.settings.getPartitionDraw(index)))));
|
|
209
212
|
})))));
|
|
210
213
|
}
|
|
@@ -15,3 +15,9 @@ export var ELuckyWheelResultState;
|
|
|
15
15
|
ELuckyWheelResultState["fulfilled"] = "fulfilled";
|
|
16
16
|
ELuckyWheelResultState["drawn"] = "drawn";
|
|
17
17
|
})(ELuckyWheelResultState || (ELuckyWheelResultState = {}));
|
|
18
|
+
export var ELuckyWheelActionTypes;
|
|
19
|
+
(function (ELuckyWheelActionTypes) {
|
|
20
|
+
ELuckyWheelActionTypes["noPrize"] = "noprize";
|
|
21
|
+
ELuckyWheelActionTypes["luckywheel"] = "luckywheel";
|
|
22
|
+
ELuckyWheelActionTypes["bonus"] = "bonus";
|
|
23
|
+
})(ELuckyWheelActionTypes || (ELuckyWheelActionTypes = {}));
|
|
@@ -17,6 +17,12 @@ var ELuckyWheelResultState;
|
|
|
17
17
|
ELuckyWheelResultState["fulfilled"] = "fulfilled";
|
|
18
18
|
ELuckyWheelResultState["drawn"] = "drawn";
|
|
19
19
|
})(ELuckyWheelResultState || (ELuckyWheelResultState = {}));
|
|
20
|
+
var ELuckyWheelActionTypes;
|
|
21
|
+
(function (ELuckyWheelActionTypes) {
|
|
22
|
+
ELuckyWheelActionTypes["noPrize"] = "noprize";
|
|
23
|
+
ELuckyWheelActionTypes["luckywheel"] = "luckywheel";
|
|
24
|
+
ELuckyWheelActionTypes["bonus"] = "bonus";
|
|
25
|
+
})(ELuckyWheelActionTypes || (ELuckyWheelActionTypes = {}));
|
|
20
26
|
|
|
21
27
|
var PointerMode;
|
|
22
28
|
(function (PointerMode) {
|
|
@@ -653,9 +659,11 @@ const CasinoEngagementSuiteLuckywheel = class {
|
|
|
653
659
|
if (this.luckywheel.Program.Id === data.LotteryProgramID) {
|
|
654
660
|
const partitionDegree = this.settings.getDeg(index);
|
|
655
661
|
this.spinner.halt(partitionDegree, () => {
|
|
662
|
+
var _a;
|
|
656
663
|
this.isSpinning = false;
|
|
657
664
|
this.updateSpinable();
|
|
658
665
|
const partition = this.luckywheel.Program.WheelOfFortune.Partitions[index];
|
|
666
|
+
const noPrize = (_a = data.Result.Outcomes) === null || _a === void 0 ? void 0 : _a.some((outcome) => { var _a; return ((_a = outcome.Action) === null || _a === void 0 ? void 0 : _a.Type) === ELuckyWheelActionTypes.noPrize; });
|
|
659
667
|
const prizeText = (partition === null || partition === void 0 ? void 0 : partition.PrizeText[this.language]) || (partition === null || partition === void 0 ? void 0 : partition.PrizeText['*']);
|
|
660
668
|
const prizeName = (partition === null || partition === void 0 ? void 0 : partition.Name[this.language]) || (partition === null || partition === void 0 ? void 0 : partition.Name['*']);
|
|
661
669
|
window.postMessage({
|
|
@@ -663,6 +671,7 @@ const CasinoEngagementSuiteLuckywheel = class {
|
|
|
663
671
|
data: {
|
|
664
672
|
PrizeText: prizeText,
|
|
665
673
|
PrizeMessage: prizeName,
|
|
674
|
+
NoPrize: noPrize,
|
|
666
675
|
HasError: false
|
|
667
676
|
}
|
|
668
677
|
});
|
|
@@ -717,13 +726,13 @@ const CasinoEngagementSuiteLuckywheel = class {
|
|
|
717
726
|
}
|
|
718
727
|
render() {
|
|
719
728
|
const foreignObjectAgentProps = { height: `${this.size}px`, width: `${this.size}px` };
|
|
720
|
-
return (h("div", { key: '
|
|
729
|
+
return (h("div", { key: '342885d64dc5fe0b2c84dce47872290fe4ff5af7', class: `WheelContainer ${this.device}`, style: this.defineGeneralVariables() }, h("svg", { key: '7746651ebfb823f7ad977a4e4e358bf1406c9f3e', width: this.size, height: this.size, ref: (el) => {
|
|
721
730
|
this.svg = el;
|
|
722
|
-
} }, h("foreignObject", { key: '
|
|
731
|
+
} }, h("foreignObject", { key: 'd48003ce06db60ddeb26849cc4a6ed5812810a24', ref: this.setSvgSize.bind(this), class: "Bottom Customable" }, h("div", { key: '219b20301e0b756a235f411b147274294baee0ab', style: foreignObjectAgentProps })), h("g", Object.assign({ key: '917ea15a1d6989913a1b23357ae455d576691625', class: "PartitionsContainer" }, this.settings.getSpinnerProps()), h("g", { key: '035155a7a943190fda49b8a0a89596ce0aac2a10', class: "PartitionsBackgrounds" }, this.options.map((_el, index) => {
|
|
723
732
|
return (h("foreignObject", { ref: this.setSvgSize.bind(this), "clip-path": `url(#clip${index})`, class: "PartitionBackground Customable", style: Object.assign({ '--index': index.toString() }, foreignObjectAgentProps) }, h("div", { style: foreignObjectAgentProps })));
|
|
724
|
-
})), h("g", { key: '
|
|
733
|
+
})), h("g", { key: '74857a797cbc7466a7e49f50411092cefaeb11e8', class: "PartitionsBackgroundStrokes" }, this.options.map((_el, index) => {
|
|
725
734
|
return (h("path", Object.assign({ class: "PartitionBackgroundStroke" }, this.settings.getPartitionDraw(index), { width: this.size, height: this.size })));
|
|
726
|
-
})), h("g", { key: '
|
|
735
|
+
})), h("g", { key: '9f6735c888e79e248ee1115b476822075e0c49fe', class: "Partitions", style: { filter: this.speed > 0.3 ? `blur(${this.speed}px)` : '' } }, this.options.map((el, index) => {
|
|
727
736
|
return [
|
|
728
737
|
el.Image && (h("g", { class: `PartitionImage PartitionImage${index}`, ref: (el) => this.renderImage(el, index) })),
|
|
729
738
|
el.Name && (h("foreignObject", Object.assign({ class: "PartitionText", ref: (el) => {
|
|
@@ -734,18 +743,18 @@ const CasinoEngagementSuiteLuckywheel = class {
|
|
|
734
743
|
}
|
|
735
744
|
} }, this.settings.getSvgTextPropsAdjustedByImage(index)), h("div", { class: "PartitionTextEntityContainer" }, h("p", { class: `PartitionTextEntity${this.settings.contentdirection === 'clockwise' ? '' : ' Anticlockwise'}`, innerHTML: el.Name }))))
|
|
736
745
|
];
|
|
737
|
-
}))), h("g", { key: '
|
|
746
|
+
}))), h("g", { key: 'c62b31497903ff7d034bd2b7de35434836cca0c4', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable1: true } }, this.options.map((_el, index) => {
|
|
738
747
|
return (h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition1 Customable", style: { '--index': index.toString() } }, h("div", { style: foreignObjectAgentProps })));
|
|
739
|
-
})), h("g", { key: '
|
|
748
|
+
})), h("g", { key: 'c3484f6930d35f3e4ca08d014b3b021e47021d44', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable2: true } }, this.options.map((_el, index) => {
|
|
740
749
|
return (h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition2 Customable", style: { '--index': index.toString() } }, h("div", { style: foreignObjectAgentProps })));
|
|
741
|
-
})), h("foreignObject", { key: '
|
|
750
|
+
})), h("foreignObject", { key: '25a125820e8c14c780eb10bf662828c01dafb21c', ref: this.setSvgSize.bind(this), class: "Middle Customable", style: foreignObjectAgentProps }, h("div", { key: '8c97c23afd581c7bb6510af3d8ebebdae885c6b9', style: foreignObjectAgentProps })), h("foreignObject", { key: 'ed5f6284d6abf6d4fe7d54ca12d586f963a76386', ref: this.setSvgSize.bind(this), class: "Top Customable", style: foreignObjectAgentProps }, h("div", { key: '41f23de3872cbadb73f89e2342567c739e174a22', style: foreignObjectAgentProps })), h("g", { key: '4949dd37d805c79a1a4363409aca17bb158956ea', class: { spinning: this.isSpinning, Center: true } }, h("foreignObject", { key: '4b5c25b029a45d92e17b244804d3873f70cc1fd6', ref: (el) => {
|
|
742
751
|
if (el) {
|
|
743
752
|
el.setAttribute('width', '100');
|
|
744
753
|
el.setAttribute('height', '100');
|
|
745
754
|
}
|
|
746
755
|
}, style: {
|
|
747
756
|
transform: `translate(${Number(this.size) / 2 - 100 / 2}px, ${Number(this.size) / 2 - 100 / 2}px)`
|
|
748
|
-
} }, h("div", { key: '
|
|
757
|
+
} }, h("div", { key: 'bb7162a6527af2f2fd20d9dd17ce76c49dfe719c', style: { width: '100px', height: '100px', cursor: 'pointer' }, onClick: this.eventSpin }))), h("g", { key: '08e09c376e45a3d87d8c25487c1678fc6760822b' }, this.options.map((_el, index) => {
|
|
749
758
|
return (h("clipPath", { id: `clip${index}` }, h("path", Object.assign({}, this.settings.getPartitionDraw(index)))));
|
|
750
759
|
})))));
|
|
751
760
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as casino_engagement_suite_luckywheel } from './casino-engagement-suite-luckywheel-
|
|
1
|
+
export { C as casino_engagement_suite_luckywheel } from './casino-engagement-suite-luckywheel-a32131a3.js';
|
|
2
2
|
import './index-48c42d04.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel-
|
|
1
|
+
export { C as CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel-a32131a3.js';
|
|
2
2
|
import './index-48c42d04.js';
|
|
@@ -65,9 +65,22 @@ export interface ISpinLuckyWheelEventResult {
|
|
|
65
65
|
State: ELuckyWheelResultState;
|
|
66
66
|
Result: {
|
|
67
67
|
WheelOfFortunePartitionIndex: string;
|
|
68
|
+
Outcomes: ISpinOutcomes[];
|
|
68
69
|
};
|
|
69
70
|
}
|
|
71
|
+
export interface ISpinOutcomes {
|
|
72
|
+
Action: {
|
|
73
|
+
Type: ELuckyWheelActionTypes;
|
|
74
|
+
};
|
|
75
|
+
Completed: boolean;
|
|
76
|
+
Attempts: number;
|
|
77
|
+
}
|
|
70
78
|
export declare enum ELuckyWheelResultState {
|
|
71
79
|
fulfilled = "fulfilled",
|
|
72
80
|
drawn = "drawn"
|
|
73
81
|
}
|
|
82
|
+
export declare enum ELuckyWheelActionTypes {
|
|
83
|
+
noPrize = "noprize",
|
|
84
|
+
luckywheel = "luckywheel",
|
|
85
|
+
bonus = "bonus"
|
|
86
|
+
}
|
package/package.json
CHANGED
package/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel-58f82f53.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,g as e}from"./index-48c42d04.js";var s,r,n,a,o,h,c,d,l;!function(t){t.ActiveTickets="ActiveTickets",t.ImplicitTickets="ImplicitTickets",t.RemainingTimes="RemainingTimes"}(s||(s={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(r||(r={})),function(t){t.fulfilled="fulfilled",t.drawn="drawn"}(n||(n={})),function(t){t.Arrow="Arrow",t.Partition="Partition"}(a||(a={})),function(t){t.DownFromTop="DownFromTop",t.UpFromCenter="UpFromCenter",t.DownFromCenter="DownFromCenter",t.UpFromBottom="UpFromBottom"}(o||(o={})),function(t){t.en="en",t.fr="fr",t.de="de",t.tr="tr"}(h||(h={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(c||(c={})),function(t){t.launch="launch",t.loop="loop",t.halt="halt"}(d||(d={})),function(t){t.quad="quad",t.cubic="cubic",t.quart="quart",t.quint="quint",t.expo="expo",t.sine="sine",t.circ="circ"}(l||(l={}));const u=(t,i)=>{Object.keys(i).map((e=>{t.setAttribute(e.split(/(?=[A-Z])/).map((t=>t.toLocaleLowerCase())).join("-"),i[e])}))},g=t=>new Promise((i=>{let e=document.createElementNS("http://www.w3.org/2000/svg","image");e.onload=()=>i(e),e.onerror=()=>i(e),e.href.baseVal=t})),b=t=>({x:t,y:t}),f=(t,i)=>({x:t.x+i.x,y:t.y+i.y}),p={Image:"",Name:"Thank you",PrizeText:"",PrizeImage:""},m=async(t,i)=>{let e=((t,i)=>{const e=t.map((t=>{const e={};return Object.keys(t).map((s=>{"object"==typeof t[s]&&t[s]&&(e["Image1"===s?"Image":s]=t[s][i]||t[s]["*"])})),e}));return(t=>{let i=0;return t.map((t=>{i+=Number(t.probability)})),i})(t)<1&&e.push(p),e})(t.Program.WheelOfFortune.Partitions,i);return e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?e.map((t=>{if(t.Image){const i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.href.baseVal=t.Image,Object.assign(Object.assign({},t),{Image:i})}return t})):await Promise.all(e.map((async t=>Object.assign(Object.assign({},t),await(async t=>t?{Image:await g(t)}:{})(t.Image))))),e},v={in:{quad:t=>Math.pow(t,2),cubic:t=>Math.pow(t,3),quart:t=>Math.pow(t,4),quint:t=>Math.pow(t,5),sine:t=>1-Math.cos(t*Math.PI/2),expo:t=>0===t?0:Math.pow(2,10*t-10),circ:t=>1-Math.sqrt(1-Math.pow(t,2))},out:{quad:t=>1-Math.pow(1-t,2),cubic:t=>1-Math.pow(1-t,3),quart:t=>1-Math.pow(1-t,4),quint:t=>1-Math.pow(1-t,5),sine:t=>Math.sin(t*Math.PI/2),expo:t=>1===t?1:1-Math.pow(2,-10*t),circ:t=>Math.sqrt(1-Math.pow(t-1,2))}},y={quad:2,cubic:3,quart:4,quint:5,sine:Math.PI/2,expo:Math.LN2,circ:1/0},x={in:{quad:t=>2*t,cubic:t=>3*t**2,quart:t=>4*t**3,quint:t=>5*t**4,sine:t=>Math.PI/2*Math.sin(Math.PI/2*t),expo:t=>10*Math.LN2*2**(10*t-10),circ:t=>-.5*(1-t**2)**-.5},out:{cubic:t=>3*t**2-6*t+3}},w=[{launchTurns:5,launchSpeed:.2,loopSpeed:15,haltTurns:2,haltSpeed:.16},{launchTurns:2,launchSpeed:.5,loopSpeed:20,haltTurns:2,haltSpeed:.22},{launchTurns:6,launchSpeed:1.38,loopSpeed:45,haltTurns:6,haltSpeed:.5}],k=t=>Object.keys(t).map((i=>t[i]));var P;!function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise"}(P||(P={}));class M{constructor({size:t,radius:i,options:e,themeIndex:s,contentdirection:r}){this.arrowmode=o.DownFromTop,this.convertDegToArc=t=>t*Math.PI/180,this.convertArcToDeg=t=>180*t/Math.PI%360,this.getArcDelta=t=>2*Math.PI/t,this.findDeg=(t,i)=>t*this.convertArcToDeg(this.getArcDelta(i)),this.angleTransform=t=>{switch(t){case o.DownFromTop:case o.UpFromCenter:return-Math.PI/2;case o.DownFromCenter:case o.UpFromBottom:return Math.PI/2}},this.contentdirection=r,this.center=t/2,this.ratio=t/375,this.options=e,this.length=e.length,this.themeIndex=s,this.radius=i}get sizeImage(){const t=t=>48*this.ratio*5/t;if(this.length<=3)return t(4);switch(this.length){case 8:case 7:return 24*this.ratio;case 6:return 36*this.ratio;case 5:return 48*this.ratio;case 4:return 56*this.ratio;default:return t(this.length)}}getSizeImageByPartition(t){return this.options[t].Name?this.sizeImage/2:this.sizeImage}getSvgImageProps(t,i=1.25){const e=this.getSizeImageByPartition(t);let s;return s=this.options[t].Name?this.radius-e/2-3*this.ratio:(this.radius-e/2)/Number(i)-3*this.ratio,Object.assign(Object.assign({},this.getPropsForPartitionInfo(t,this.getOffsetImage(e),s,c.outward)),{width:e,height:e})}getSvgTextProps(t,i){const e=this.getSizeImageByPartition(t);let s;return s=this.options[t].Image?this.radius-e-6*this.ratio:this.radius-6*this.ratio,Object.assign({},this.getPropsForPartitionInfo(t,this.offsetText,s,void 0,i))}getSvgTextPropsAdjustedByImage(t){const i=this.getSvgTextProps(t,this.options[t].Image?80:100);return Object.assign({},i)}get offsetText(){return{center:0,position:{x:0,y:0},transform:{x:0,y:0}}}getOffsetImage(t){return{center:0,position:{x:-1*t/2,y:-1*t/2},transform:{x:0,y:0}}}get direction(){return P.clockwise}getAngleSelf(t,i){return 360*t/this.length*this.direction+90*(void 0!==i?i:c[this.contentdirection])}getPartitionPositions(t,i,e){const s=this.angleTransform(this.arrowmode)+this.direction*t*2*Math.PI/this.length,r=((t,i,e)=>{const s=b(e);return{x:s.x+t*Math.cos(i),y:s.y+t*Math.sin(i)}})(i||this.radius-9*this.ratio,s,this.center+e.center);return{transformOrigin:f(r,e.transform),point:f(r,e.position)}}getPropsForPartitionInfo(t,i,e,s,r){const{point:n,transformOrigin:a}=this.getPartitionPositions(t,e,i);return Object.assign(Object.assign({},n),{style:{"font-size":13*this.ratio+"px",transform:`rotate(${this.getAngleSelf(t,s)}deg) translate(${"clockwise"===this.contentdirection?n.x:n.x-100}px, ${n.y-50}px)`,"transform-origin":`${o=a,Object.keys(o).map((t=>`${o[t]}px`)).join(" ")}`,height:`${r}px`,width:`${r}px`}});var o}getPartitionDraw(t){const i=b(this.center),e=b(this.radius),{point:s,pointNext:r}=((t,i,e,s)=>{const r=t=>((t,i,e,s)=>{const r=Math.PI/180*(360/i*(t-.5)-90),n=b(s),a=b(e);return{x:n.x+a.x*Math.cos(r),y:n.y+a.y*Math.sin(r)}})(t,i,e,s);return{point:r(t),pointNext:r(t+1)}})(t,this.length,this.radius,this.center);return{d:["M",...k(i),"L",...k(s),"A",...k(e),"0 0 1",...k(r),"Z"].join(" ")}}getDeg(t){return this.findDeg(this.length-t,this.length)}getSpinnerProps(){const t=b(this.center);return{"transform-origin":`${t.x} ${t.y}`}}}class j{constructor(t){this.deg=0,this.degTarget=void 0,this.step=void 0,this.easingType=l.cubic,this.param=w[2],this.halt=(t,i=(()=>{}))=>{this.shouldHalt=()=>{this.step=d.halt,this.cb=()=>{i(),this.setDeg(t,0)},this.degTarget=t+360*this.param.haltTurns,this.continueRepeat()}},this.continueRepeat=()=>setTimeout((()=>this.ticker()),30),this.ticker=()=>{const t=this.param.loopSpeed,i=t=>33*y[this.easingType]*t/this.param.loopSpeed,e=()=>{const t=360*this.param.launchTurns-this.deg,e=i(t);this.animateF(e,this.deg,t,v.in[this.easingType],x.in[this.easingType])},s=()=>{const t=i(this.degTarget);this.animateF(t,0,this.degTarget,v.out[this.easingType],x.out[this.easingType])},r=()=>{this.setDeg((this.deg+t)%360,y[this.easingType]),this.continueRepeat()};({[d.launch]:()=>{this.cb=()=>{this.step=d.loop,this.setDeg(t,y[this.easingType]),this.continueRepeat()},e()},[d.loop]:()=>{this.shouldHalt&&0===this.deg?this.shouldHalt():r()},[d.halt]:()=>{this.deg===360-t?s():r()}})[this.step]()},this.setDeg=(t,i)=>{this.deg=t,this.tick(t,i)},this.animateF=(t,i,e,s,r)=>{let n=null;const a=()=>{let o=(new Date).getTime();n||(n=o);const h=o-n,c=e*s(h/t)+i,d=Math.abs(r(h/t));this.setDeg(c,d),h<t?setTimeout((()=>a()),30):this.cb()};a()},this.animate=(t,i,e,s,r)=>{let n=null;window.cancelAnimationFrame(n);let a=null;const o=h=>{a||(a=h);const c=h-a,d=e*s(c/t)+i,l=Math.abs(r(c/t));this.setDeg(d,l),c<t?n=window.requestAnimationFrame(o):this.cb()};n=window.requestAnimationFrame(o)},this.tick=t.tick}launch(){this.shouldHalt=void 0,this.step=d.launch,this.ticker()}}const O=class{constructor(i){t(this,i),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.host.prepend(i)}),1)})).catch((t=>{console.log("Error ",t)}))},this.renderImage=(t,i)=>{const e=this.options[i].Image;u(e,this.settings.getSvgImageProps(i)),t.innerHTML=null,t.appendChild(e)},this.updateSpinable=()=>{if(this.luckywheel.Current){if(Number(this.luckywheel.Current.RemainingTimes)>0)return void(this.spinable=!0);window.postMessage({type:"ShowNoSpinLeftModal"})}this.spinable=!1},this.eventSpin=()=>{this.updateSpinable(),this.spinable&&!this.isSpinning&&(this.isSpinning=!0,this.spinContainer=this.svg.querySelector("g.PartitionsContainer"),this.spinner.launch(),window.postMessage({type:"SpinLuckyWheel",data:{lotteryProgramID:this.luckywheel.Program.Id}}))},this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.luckywheel=void 0,this.size="440",this.contentdirection="anticlockwise",this.limitStylingAppends=!1,this.isPartitionsCustomableReady=!1,this.isSpinning=!1,this.options=void 0,this.radius=.85*Number(this.size)/2,this.speed=0,this.settings=void 0,this.svg=void 0,this.spinContainer=void 0,this.spinable=void 0,this.spinner=void 0}handleEvent(t){const{type:i,data:e}=null==t?void 0:t.data;if("SpinLuckyWheelRes"===i&&this.isSpinning){const t=+e.Result.WheelOfFortunePartitionIndex||0;e.State===n.fulfilled?this.handleSpinResult(e,t):this.handleSpinError(t)}}handleSpinError(t){const i=this.settings.getDeg(t);this.spinner.halt(i,(()=>{this.isSpinning=!1,this.updateSpinable(),window.postMessage({type:"ShowLuckywheelRewardModal",data:{HasError:!0}})}))}handleSpinResult(t,i){if(this.luckywheel.Program.Id===t.LotteryProgramID){const t=this.settings.getDeg(i);this.spinner.halt(t,(()=>{this.isSpinning=!1,this.updateSpinable();const t=this.luckywheel.Program.WheelOfFortune.Partitions[i];window.postMessage({type:"ShowLuckywheelRewardModal",data:{PrizeText:(null==t?void 0:t.PrizeText[this.language])||(null==t?void 0:t.PrizeText["*"]),PrizeMessage:(null==t?void 0:t.Name[this.language])||(null==t?void 0:t.Name["*"]),HasError:!1}})}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}async componentWillLoad(){this.options=await m(this.luckywheel,h.en),this.settings=new M({size:this.size,radius:this.radius,options:this.options,themeIndex:1,contentdirection:this.contentdirection}),this.spinner=new j({tick:(t,i)=>{u(this.spinContainer,{style:[`transform: rotate(${t}deg)`,`height: ${this.size}px`,`width: ${this.size}px`].join(";")}),this.speed=.5*i}})}defineGeneralVariables(){return{"--length":`${this.options.length}`,"--radius":`${this.radius}`,"--ratio":""+Number(this.size)/480,"--size":`${this.size}`}}setSvgSize(t){if(!t||!this.size)return;const i=this.size.toString();t.getAttribute("width")!==i&&t.setAttribute("width",i),t.getAttribute("height")!==i&&t.setAttribute("height",i)}render(){const t={height:`${this.size}px`,width:`${this.size}px`};return i("div",{key:"8f07f4b736611f24d8fdab3c648b682dd03010c8",class:`WheelContainer ${this.device}`,style:this.defineGeneralVariables()},i("svg",{key:"5a904e1a93aee08657391d09fa40dbfc83504892",width:this.size,height:this.size,ref:t=>{this.svg=t}},i("foreignObject",{key:"2f579e8195244078a65e4db7a6255af4e4fe517e",ref:this.setSvgSize.bind(this),class:"Bottom Customable"},i("div",{key:"d6ee2eae87c4b80ab9335a459fe597037d5321d1",style:t})),i("g",Object.assign({key:"661e946d154c399facffc6963bbb10544ef1b55e",class:"PartitionsContainer"},this.settings.getSpinnerProps()),i("g",{key:"591e8de5dd55dbd016669f7d144664b9c921d4df",class:"PartitionsBackgrounds"},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),"clip-path":`url(#clip${s})`,class:"PartitionBackground Customable",style:Object.assign({"--index":s.toString()},t)},i("div",{style:t}))))),i("g",{key:"ac2a4973a712841b81c4ff0609f5f3f5c8b17bf0",class:"PartitionsBackgroundStrokes"},this.options.map(((t,e)=>i("path",Object.assign({class:"PartitionBackgroundStroke"},this.settings.getPartitionDraw(e),{width:this.size,height:this.size}))))),i("g",{key:"afb0c09ec8e53ed97289c5bf186417c2078c4014",class:"Partitions",style:{filter:this.speed>.3?`blur(${this.speed}px)`:""}},this.options.map(((t,e)=>[t.Image&&i("g",{class:`PartitionImage PartitionImage${e}`,ref:t=>this.renderImage(t,e)}),t.Name&&i("foreignObject",Object.assign({class:"PartitionText",ref:t=>{if(t){const i=this.options[e].Image?"80":"100";t.setAttribute("width",i),t.setAttribute("height",i)}}},this.settings.getSvgTextPropsAdjustedByImage(e)),i("div",{class:"PartitionTextEntityContainer"},i("p",{class:"PartitionTextEntity"+("clockwise"===this.settings.contentdirection?"":" Anticlockwise"),innerHTML:t.Name})))])))),i("g",{key:"318d1aaaa95e1bf6ccaeab566b15b0384a78871c",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable1:!0}},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),class:"Partition1 Customable",style:{"--index":s.toString()}},i("div",{style:t}))))),i("g",{key:"fcce9008d0bb2b6adb0429039a7c2f6b9b865b92",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable2:!0}},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),class:"Partition2 Customable",style:{"--index":s.toString()}},i("div",{style:t}))))),i("foreignObject",{key:"ae85245cfd7f223ebc271ea3d1ca0021b35815c8",ref:this.setSvgSize.bind(this),class:"Middle Customable",style:t},i("div",{key:"08547a5324d4d4236f40efe0f70fb922418402ea",style:t})),i("foreignObject",{key:"8289900237296697f5b92e9400beda29a2ff14e7",ref:this.setSvgSize.bind(this),class:"Top Customable",style:t},i("div",{key:"a00da737a2ee5b7739538d9bed50b98b641e10eb",style:t})),i("g",{key:"30d8a96cac39340601e3aa82c864b7e394b57095",class:{spinning:this.isSpinning,Center:!0}},i("foreignObject",{key:"79de765f22964219e6ecf472220649e7b8836a78",ref:t=>{t&&(t.setAttribute("width","100"),t.setAttribute("height","100"))},style:{transform:`translate(${Number(this.size)/2-50}px, ${Number(this.size)/2-50}px)`}},i("div",{key:"de71247c015aefb6295318c78c37b17174fd1ac0",style:{width:"100px",height:"100px",cursor:"pointer"},onClick:this.eventSpin}))),i("g",{key:"3b81cbd53658e73f94729e950c445a93a68bf754"},this.options.map(((t,e)=>i("clipPath",{id:`clip${e}`},i("path",Object.assign({},this.settings.getPartitionDraw(e)))))))))}get host(){return e(this)}};O.style=':host{font-family:system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"}*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.LotteryProgramWof{background:var(--emw--color-contrast, #07072A);display:flex;align-items:center;flex-direction:column;padding:20px 0}main{max-width:600px;width:100%;display:flex;justify-content:space-around;min-height:200px}svg{transition:opacity 0.3s}.WheelContainer{text-align:center}.FortuneContainer{width:100%;display:flex;align-items:center;flex-direction:column}.Center{cursor:pointer;transition:filter;transition-duration:1s}.Center.disabled{filter:grayscale(80%)}.Center .CenterCircle{fill:#3CE4BB;stroke:rgb(150, 54, 88);stroke-width:2px;cursor:pointer;transition:fill;transition-duration:1s}.Center .CenterText{fill:#FFFFFF}.PointerPartition{opacity:0.3;fill:lightgoldenrodyellow;stroke:red;stroke-width:6px;stroke-dasharray:12}.Current{color:#FFFFFF}.PartitionText{color:#FFFFFF;font-style:normal;font-weight:700;text-anchor:end;text-shadow:0px 3px #000;dominant-baseline:central}.PartitionsShadow{background-blend-mode:multiply;mix-blend-mode:multiply}.PartitionTextEntityContainer{height:100%;display:flex;align-items:center}.PartitionTextEntity{width:100%}.PartitionTextEntity.Anticlockwise{text-align:end}foreignObject.Bottom div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-bg.svg");background-size:calc(var(--radius) * 2px + var(--ratio) * 20px);background-position:center}foreignObject.Middle div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-spin.svg"), url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-pointer.svg");background-position:center, center 5px}foreignObject.Top{mix-blend-mode:multiply}foreignObject.Top div{background-image:var(--img-theme-shadow);background-position:center;background-size:calc(var(--radius) * 2px)}foreignObject.Partition1 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc(var(--index) * 360deg / var(--length)))}foreignObject.Partition2 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc((var(--index) + 0.5) * 360deg / var(--length)))}foreignObject.PointerArea{mix-blend-mode:screen}foreignObject.PointerArea div{background-image:var(--img-theme-pointer-area);background-position:center -3px;background-size:51%}foreignObject.Partition1 div,foreignObject.Partition2 div{transform-origin:center}.PartitionsCustomable1 div,.PartitionsCustomable2 div{visibility:hidden}.PartitionsCustomable1 div.active,.PartitionsCustomable2 div.active{visibility:visible}foreignObject.Customable{overflow:visible}foreignObject.Customable div{background-repeat:no-repeat}.PartitionBackground div{background-size:calc(var(--radius) * 2 / var(--size) * 100%) calc(var(--radius) * 2 / var(--size) * 100%);background-position:center}.PartitionBackground:nth-child(2n) div{background:var(--emw--color-primary, #3F2E75)}.PartitionBackground:nth-child(2n+1) div{background:var(--emw--color-secondary, #9482CE)}.PartitionBackground div{transform-origin:center}.PartitionBackgroundStroke{fill:transparent;stroke:var(--emw--color-background-secondary, #251D3E);stroke-width:3px;stroke-dasharray:none}.PointerPartitionFrame{stroke:#FFDD64;fill:transparent;stroke-dasharray:var(--radius) calc(6.2831853072 / var(--length) * var(--radius));stroke-width:0px}.PointerPartitionFrame.active{stroke-width:3px}.WheelContainer.Mobile foreignObject.Middle div{background-size:95px, 38px}.PartitionText .PartitionTextEntityContainer .PartitionTextEntity{text-align:center;text-transform:uppercase;text-shadow:none;font-size:var(--emw--font-size-small, 14px);font-weight:900}';export{O as C}
|