@everymatrix/lottery-program-wof 1.14.0 → 1.14.2

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.
@@ -161,6 +161,45 @@
161
161
  e.initCustomEvent(type, bubbles, cancelable, detail);
162
162
  return e;
163
163
  }
164
+ class HtmlTag {
165
+ constructor(is_svg = false) {
166
+ this.is_svg = false;
167
+ this.is_svg = is_svg;
168
+ this.e = this.n = null;
169
+ }
170
+ c(html) {
171
+ this.h(html);
172
+ }
173
+ m(html, target, anchor = null) {
174
+ if (!this.e) {
175
+ if (this.is_svg)
176
+ this.e = svg_element(target.nodeName);
177
+ /** #7364 target for <template> may be provided as #document-fragment(11) */
178
+ else
179
+ this.e = element((target.nodeType === 11 ? 'TEMPLATE' : target.nodeName));
180
+ this.t = target.tagName !== 'TEMPLATE' ? target : target.content;
181
+ this.c(html);
182
+ }
183
+ this.i(anchor);
184
+ }
185
+ h(html) {
186
+ this.e.innerHTML = html;
187
+ this.n = Array.from(this.e.nodeName === 'TEMPLATE' ? this.e.content.childNodes : this.e.childNodes);
188
+ }
189
+ i(anchor) {
190
+ for (let i = 0; i < this.n.length; i += 1) {
191
+ insert(this.t, this.n[i], anchor);
192
+ }
193
+ }
194
+ p(html) {
195
+ this.d();
196
+ this.h(html);
197
+ this.i(this.a);
198
+ }
199
+ d() {
200
+ this.n.forEach(detach);
201
+ }
202
+ }
164
203
  function attribute_to_object(attributes) {
165
204
  const result = {};
166
205
  for (const attribute of attributes) {
@@ -4865,9 +4904,9 @@
4865
4904
  let t3;
4866
4905
  let t4;
4867
4906
  let div_style_value;
4868
- let if_block0 = (/*mode*/ ctx[1] === 'normal' || /*mode*/ ctx[1] === 'init-failed') && create_if_block_6(ctx);
4869
- let if_block1 = /*mode*/ ctx[1] === 'spin-failed' && create_if_block_5$1(ctx);
4870
- let if_block2 = /*mode*/ ctx[1] === 'show-next' && create_if_block_4$1(ctx);
4907
+ let if_block0 = (/*mode*/ ctx[1] === 'normal' || /*mode*/ ctx[1] === 'init-failed') && create_if_block_7(ctx);
4908
+ let if_block1 = /*mode*/ ctx[1] === 'spin-failed' && create_if_block_6(ctx);
4909
+ let if_block2 = /*mode*/ ctx[1] === 'show-next' && create_if_block_5$1(ctx);
4871
4910
  let if_block3 = /*mode*/ ctx[1] === 'gift' && create_if_block_3$1(ctx);
4872
4911
  let if_block4 = /*mode*/ ctx[1] === 'nogift' && create_if_block_2$1(ctx);
4873
4912
  let if_block5 = /*mode*/ ctx[1] !== 'init-failed' && create_if_block_1$4(ctx);
@@ -4896,7 +4935,7 @@
4896
4935
  /*isShown*/ ctx[3] ? 'opacity: 1' : ''
4897
4936
  ].join(';'));
4898
4937
 
4899
- add_location(div, file$6, 58, 0, 2010);
4938
+ add_location(div, file$6, 58, 0, 2090);
4900
4939
  },
4901
4940
  m: function mount(target, anchor) {
4902
4941
  insert_dev(target, div, anchor);
@@ -4918,7 +4957,7 @@
4918
4957
  if (if_block0) {
4919
4958
  if_block0.p(ctx, dirty);
4920
4959
  } else {
4921
- if_block0 = create_if_block_6(ctx);
4960
+ if_block0 = create_if_block_7(ctx);
4922
4961
  if_block0.c();
4923
4962
  if_block0.m(div, t0);
4924
4963
  }
@@ -4931,7 +4970,7 @@
4931
4970
  if (if_block1) {
4932
4971
  if_block1.p(ctx, dirty);
4933
4972
  } else {
4934
- if_block1 = create_if_block_5$1(ctx);
4973
+ if_block1 = create_if_block_6(ctx);
4935
4974
  if_block1.c();
4936
4975
  if_block1.m(div, t1);
4937
4976
  }
@@ -4944,7 +4983,7 @@
4944
4983
  if (if_block2) {
4945
4984
  if_block2.p(ctx, dirty);
4946
4985
  } else {
4947
- if_block2 = create_if_block_4$1(ctx);
4986
+ if_block2 = create_if_block_5$1(ctx);
4948
4987
  if_block2.c();
4949
4988
  if_block2.m(div, t2);
4950
4989
  }
@@ -5026,7 +5065,7 @@
5026
5065
  }
5027
5066
 
5028
5067
  // (71:2) {#if mode === 'normal' || mode === 'init-failed'}
5029
- function create_if_block_6(ctx) {
5068
+ function create_if_block_7(ctx) {
5030
5069
  let p;
5031
5070
  let t;
5032
5071
 
@@ -5034,7 +5073,7 @@
5034
5073
  c: function create() {
5035
5074
  p = element("p");
5036
5075
  t = text(/*modeValue*/ ctx[2]);
5037
- add_location(p, file$6, 71, 2, 2294);
5076
+ add_location(p, file$6, 71, 2, 2374);
5038
5077
  },
5039
5078
  m: function mount(target, anchor) {
5040
5079
  insert_dev(target, p, anchor);
@@ -5050,7 +5089,7 @@
5050
5089
 
5051
5090
  dispatch_dev("SvelteRegisterBlock", {
5052
5091
  block,
5053
- id: create_if_block_6.name,
5092
+ id: create_if_block_7.name,
5054
5093
  type: "if",
5055
5094
  source: "(71:2) {#if mode === 'normal' || mode === 'init-failed'}",
5056
5095
  ctx
@@ -5060,7 +5099,7 @@
5060
5099
  }
5061
5100
 
5062
5101
  // (75:2) {#if mode === 'spin-failed'}
5063
- function create_if_block_5$1(ctx) {
5102
+ function create_if_block_6(ctx) {
5064
5103
  let p;
5065
5104
  let t_value = /*$_*/ ctx[10]('wof.SpinFailed') + "";
5066
5105
  let t;
@@ -5069,7 +5108,7 @@
5069
5108
  c: function create() {
5070
5109
  p = element("p");
5071
5110
  t = text(t_value);
5072
- add_location(p, file$6, 75, 2, 2355);
5111
+ add_location(p, file$6, 75, 2, 2435);
5073
5112
  },
5074
5113
  m: function mount(target, anchor) {
5075
5114
  insert_dev(target, p, anchor);
@@ -5085,7 +5124,7 @@
5085
5124
 
5086
5125
  dispatch_dev("SvelteRegisterBlock", {
5087
5126
  block,
5088
- id: create_if_block_5$1.name,
5127
+ id: create_if_block_6.name,
5089
5128
  type: "if",
5090
5129
  source: "(75:2) {#if mode === 'spin-failed'}",
5091
5130
  ctx
@@ -5095,7 +5134,7 @@
5095
5134
  }
5096
5135
 
5097
5136
  // (79:2) {#if mode === 'show-next'}
5098
- function create_if_block_4$1(ctx) {
5137
+ function create_if_block_5$1(ctx) {
5099
5138
  let p;
5100
5139
 
5101
5140
  let raw_value = /*$_*/ ctx[10]('wof.ShowNext', {
@@ -5105,7 +5144,7 @@
5105
5144
  const block = {
5106
5145
  c: function create() {
5107
5146
  p = element("p");
5108
- add_location(p, file$6, 79, 2, 2425);
5147
+ add_location(p, file$6, 79, 2, 2505);
5109
5148
  },
5110
5149
  m: function mount(target, anchor) {
5111
5150
  insert_dev(target, p, anchor);
@@ -5122,7 +5161,7 @@
5122
5161
 
5123
5162
  dispatch_dev("SvelteRegisterBlock", {
5124
5163
  block,
5125
- id: create_if_block_4$1.name,
5164
+ id: create_if_block_5$1.name,
5126
5165
  type: "if",
5127
5166
  source: "(79:2) {#if mode === 'show-next'}",
5128
5167
  ctx
@@ -5136,39 +5175,63 @@
5136
5175
  let p0;
5137
5176
  let img;
5138
5177
  let img_src_value;
5139
- let t;
5178
+ let t0;
5179
+ let t1;
5140
5180
  let p1;
5141
- let raw_value = /*$_*/ ctx[10]('wof.Congratulation', { values: { prize: /*prize*/ ctx[5] } }) + "";
5181
+
5182
+ function select_block_type(ctx, dirty) {
5183
+ if (/*modeValue*/ ctx[2].prizeText) return create_if_block_4$1;
5184
+ return create_else_block$2;
5185
+ }
5186
+
5187
+ let current_block_type = select_block_type(ctx);
5188
+ let if_block = current_block_type(ctx);
5142
5189
 
5143
5190
  const block = {
5144
5191
  c: function create() {
5145
5192
  p0 = element("p");
5146
5193
  img = element("img");
5147
- t = space();
5194
+ t0 = space();
5195
+ if_block.c();
5196
+ t1 = space();
5148
5197
  p1 = element("p");
5149
5198
  if (!src_url_equal(img.src, img_src_value = /*prizeSrc*/ ctx[4])) attr_dev(img, "src", img_src_value);
5150
5199
  attr_dev(img, "alt", "");
5151
5200
  attr_dev(img, "class", "GiftImage");
5152
- add_location(img, file$6, 84, 4, 2527);
5153
- add_location(p0, file$6, 83, 2, 2519);
5154
- add_location(p1, file$6, 86, 2, 2582);
5201
+ add_location(img, file$6, 84, 4, 2607);
5202
+ add_location(p0, file$6, 83, 2, 2599);
5203
+ add_location(p1, file$6, 91, 2, 2802);
5155
5204
  },
5156
5205
  m: function mount(target, anchor) {
5157
5206
  insert_dev(target, p0, anchor);
5158
5207
  append_dev(p0, img);
5159
- insert_dev(target, t, anchor);
5208
+ insert_dev(target, t0, anchor);
5209
+ if_block.m(target, anchor);
5210
+ insert_dev(target, t1, anchor);
5160
5211
  insert_dev(target, p1, anchor);
5161
- p1.innerHTML = raw_value;
5162
5212
  },
5163
5213
  p: function update(ctx, dirty) {
5164
5214
  if (dirty & /*prizeSrc*/ 16 && !src_url_equal(img.src, img_src_value = /*prizeSrc*/ ctx[4])) {
5165
5215
  attr_dev(img, "src", img_src_value);
5166
5216
  }
5167
5217
 
5168
- if (dirty & /*$_, prize*/ 1056 && raw_value !== (raw_value = /*$_*/ ctx[10]('wof.Congratulation', { values: { prize: /*prize*/ ctx[5] } }) + "")) p1.innerHTML = raw_value; },
5218
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
5219
+ if_block.p(ctx, dirty);
5220
+ } else {
5221
+ if_block.d(1);
5222
+ if_block = current_block_type(ctx);
5223
+
5224
+ if (if_block) {
5225
+ if_block.c();
5226
+ if_block.m(t1.parentNode, t1);
5227
+ }
5228
+ }
5229
+ },
5169
5230
  d: function destroy(detaching) {
5170
5231
  if (detaching) detach_dev(p0);
5171
- if (detaching) detach_dev(t);
5232
+ if (detaching) detach_dev(t0);
5233
+ if_block.d(detaching);
5234
+ if (detaching) detach_dev(t1);
5172
5235
  if (detaching) detach_dev(p1);
5173
5236
  }
5174
5237
  };
@@ -5184,7 +5247,74 @@
5184
5247
  return block;
5185
5248
  }
5186
5249
 
5187
- // (90:2) {#if mode === 'nogift'}
5250
+ // (89:4) {:else}
5251
+ function create_else_block$2(ctx) {
5252
+ let html_tag;
5253
+ let raw_value = /*$_*/ ctx[10]('wof.Congratulation', { values: { prize: /*prize*/ ctx[5] } }) + "";
5254
+ let html_anchor;
5255
+
5256
+ const block = {
5257
+ c: function create() {
5258
+ html_tag = new HtmlTag(false);
5259
+ html_anchor = empty();
5260
+ html_tag.a = html_anchor;
5261
+ },
5262
+ m: function mount(target, anchor) {
5263
+ html_tag.m(raw_value, target, anchor);
5264
+ insert_dev(target, html_anchor, anchor);
5265
+ },
5266
+ p: function update(ctx, dirty) {
5267
+ if (dirty & /*$_, prize*/ 1056 && raw_value !== (raw_value = /*$_*/ ctx[10]('wof.Congratulation', { values: { prize: /*prize*/ ctx[5] } }) + "")) html_tag.p(raw_value);
5268
+ },
5269
+ d: function destroy(detaching) {
5270
+ if (detaching) detach_dev(html_anchor);
5271
+ if (detaching) html_tag.d();
5272
+ }
5273
+ };
5274
+
5275
+ dispatch_dev("SvelteRegisterBlock", {
5276
+ block,
5277
+ id: create_else_block$2.name,
5278
+ type: "else",
5279
+ source: "(89:4) {:else}",
5280
+ ctx
5281
+ });
5282
+
5283
+ return block;
5284
+ }
5285
+
5286
+ // (87:4) {#if modeValue.prizeText}
5287
+ function create_if_block_4$1(ctx) {
5288
+ let t_value = /*modeValue*/ ctx[2].prizeText + "";
5289
+ let t;
5290
+
5291
+ const block = {
5292
+ c: function create() {
5293
+ t = text(t_value);
5294
+ },
5295
+ m: function mount(target, anchor) {
5296
+ insert_dev(target, t, anchor);
5297
+ },
5298
+ p: function update(ctx, dirty) {
5299
+ if (dirty & /*modeValue*/ 4 && t_value !== (t_value = /*modeValue*/ ctx[2].prizeText + "")) set_data_dev(t, t_value);
5300
+ },
5301
+ d: function destroy(detaching) {
5302
+ if (detaching) detach_dev(t);
5303
+ }
5304
+ };
5305
+
5306
+ dispatch_dev("SvelteRegisterBlock", {
5307
+ block,
5308
+ id: create_if_block_4$1.name,
5309
+ type: "if",
5310
+ source: "(87:4) {#if modeValue.prizeText}",
5311
+ ctx
5312
+ });
5313
+
5314
+ return block;
5315
+ }
5316
+
5317
+ // (97:2) {#if mode === 'nogift'}
5188
5318
  function create_if_block_2$1(ctx) {
5189
5319
  let p0;
5190
5320
  let img;
@@ -5202,9 +5332,9 @@
5202
5332
  if (!src_url_equal(img.src, img_src_value = /*modeValue*/ ctx[2].image)) attr_dev(img, "src", img_src_value);
5203
5333
  attr_dev(img, "alt", "");
5204
5334
  attr_dev(img, "class", "GiftImage");
5205
- add_location(img, file$6, 91, 4, 2688);
5206
- add_location(p0, file$6, 90, 2, 2680);
5207
- add_location(p1, file$6, 93, 2, 2750);
5335
+ add_location(img, file$6, 98, 4, 2859);
5336
+ add_location(p0, file$6, 97, 2, 2851);
5337
+ add_location(p1, file$6, 100, 2, 2921);
5208
5338
  },
5209
5339
  m: function mount(target, anchor) {
5210
5340
  insert_dev(target, p0, anchor);
@@ -5230,14 +5360,14 @@
5230
5360
  block,
5231
5361
  id: create_if_block_2$1.name,
5232
5362
  type: "if",
5233
- source: "(90:2) {#if mode === 'nogift'}",
5363
+ source: "(97:2) {#if mode === 'nogift'}",
5234
5364
  ctx
5235
5365
  });
5236
5366
 
5237
5367
  return block;
5238
5368
  }
5239
5369
 
5240
- // (97:2) {#if mode !== 'init-failed'}
5370
+ // (104:2) {#if mode !== 'init-failed'}
5241
5371
  function create_if_block_1$4(ctx) {
5242
5372
  let div;
5243
5373
  let button;
@@ -5252,8 +5382,8 @@
5252
5382
  button = element("button");
5253
5383
  t = text(t_value);
5254
5384
  attr_dev(button, "class", "MessagePanelButton");
5255
- add_location(button, file$6, 98, 4, 2832);
5256
- add_location(div, file$6, 97, 2, 2822);
5385
+ add_location(button, file$6, 105, 4, 3003);
5386
+ add_location(div, file$6, 104, 2, 2993);
5257
5387
  },
5258
5388
  m: function mount(target, anchor) {
5259
5389
  insert_dev(target, div, anchor);
@@ -5279,7 +5409,7 @@
5279
5409
  block,
5280
5410
  id: create_if_block_1$4.name,
5281
5411
  type: "if",
5282
- source: "(97:2) {#if mode !== 'init-failed'}",
5412
+ source: "(104:2) {#if mode !== 'init-failed'}",
5283
5413
  ctx
5284
5414
  });
5285
5415
 
@@ -5505,8 +5635,10 @@
5505
5635
  : modeValue.name) || 'prize');
5506
5636
  }
5507
5637
 
5508
- if ($$self.$$.dirty & /*giftimagesrc, modeValue*/ 32772) {
5509
- $$invalidate(4, prizeSrc = giftimagesrc || (modeValue === null || modeValue === void 0
5638
+ if ($$self.$$.dirty & /*modeValue, giftimagesrc*/ 32772) {
5639
+ $$invalidate(4, prizeSrc = (modeValue === null || modeValue === void 0
5640
+ ? void 0
5641
+ : modeValue.prizeImage) || giftimagesrc || (modeValue === null || modeValue === void 0
5510
5642
  ? void 0
5511
5643
  : modeValue.image) || img$g);
5512
5644
  }
@@ -6239,20 +6371,24 @@
6239
6371
  let options = partitions.map((_partition, index) => {
6240
6372
  const partitionLang = {};
6241
6373
  Object.keys(_partition).map((_key) => {
6242
- if (['name', 'image1', 'image2', 'image3'].includes(_key)) {
6374
+ if (['name', 'image1', 'image2', 'image3', 'prizeText', 'prizeImage'].includes(_key)) {
6243
6375
  partitionLang[_key] = _partition[_key][lang] || _partition[_key]['*'];
6244
6376
  }
6245
6377
  });
6246
6378
  const option = {
6247
6379
  image: partitionLang['image1'],
6248
- name: partitionLang['name']
6380
+ name: partitionLang['name'],
6381
+ prizeText: partitionLang['prizeText'],
6382
+ prizeImage: partitionLang['prizeImage'],
6249
6383
  };
6250
6384
  return option;
6251
6385
  });
6252
6386
  if (getSumProbability(partitions) < 1) {
6253
6387
  options.push({
6254
6388
  image: img$f,
6255
- name: 'Thank you'
6389
+ name: 'Thank you',
6390
+ prizeText: '',
6391
+ prizeImage: '',
6256
6392
  });
6257
6393
  }
6258
6394
  return options;
@@ -6314,13 +6450,16 @@
6314
6450
  };
6315
6451
  }
6316
6452
  else {
6453
+ const modeValue = {
6454
+ index,
6455
+ prizeText: options[index].prizeText,
6456
+ prizeImage: options[index].prizeImage,
6457
+ name: options[index].name,
6458
+ image: options[index].prizeImage || ((_f = (_e = options[index].image) === null || _e === void 0 ? void 0 : _e.href) === null || _f === void 0 ? void 0 : _f.baseVal)
6459
+ };
6317
6460
  message = {
6318
6461
  mode: 'gift',
6319
- modeValue: {
6320
- index,
6321
- name: options[index].name,
6322
- image: (_f = (_e = options[index].image) === null || _e === void 0 ? void 0 : _e.href) === null || _f === void 0 ? void 0 : _f.baseVal
6323
- },
6462
+ modeValue
6324
6463
  };
6325
6464
  }
6326
6465
  return {