@gomusdev/web-components 3.8.3 → 3.9.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.
@@ -11803,7 +11803,8 @@ function createUITicket(apiTicket, options) {
11803
11803
  normal: "day",
11804
11804
  annual: "annual"
11805
11805
  }[apiTicket.ticket_type],
11806
- shop_order: apiTicket.shop_order ?? 0
11806
+ shop_order: apiTicket.shop_order ?? 0,
11807
+ content: void 0
11807
11808
  };
11808
11809
  }
11809
11810
  function initUITimeslotTickets(tickets, selectedTime = "") {
@@ -13544,6 +13545,12 @@ var Shop = class {
13544
13545
  query: assign({ per_page: 100 }, params ?? {})
13545
13546
  });
13546
13547
  }
13548
+ ticketsContent(ticketIds) {
13549
+ return this.fetchAndCache("/api/v4/tickets/content", `ticketsContent-${JSON.stringify(ticketIds)}`, "data", {
13550
+ cache: 300,
13551
+ query: assign({ "ticket_ids[]": ticketIds }, { per_page: 100 })
13552
+ });
13553
+ }
13547
13554
  signIn(params) {
13548
13555
  return this.apiPost(SIGN_IN_ENDPOINT, {
13549
13556
  body: params,
@@ -15194,8 +15201,8 @@ function option(value) {
15194
15201
  var root$46 = /* @__PURE__ */ from_html(`<s class="go-cart-item-price-original"> </s> <span class="go-cart-item-price-discounted"> </span>`, 1);
15195
15202
  var root_1$14 = /* @__PURE__ */ from_html(`<span class="go-cart-item-price-discounted"> </span>`);
15196
15203
  var root_2$10 = /* @__PURE__ */ from_html(`<span> </span>`);
15197
- var root_3$6 = /* @__PURE__ */ from_html(`<option> </option>`);
15198
- var root_4$3 = /* @__PURE__ */ from_html(`<select class="go-cart-item-select"></select>`);
15204
+ var root_3$7 = /* @__PURE__ */ from_html(`<option> </option>`);
15205
+ var root_4$4 = /* @__PURE__ */ from_html(`<select class="go-cart-item-select"></select>`);
15199
15206
  var root_5$2 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove">⨉</button></li>`);
15200
15207
  var root_6$2 = /* @__PURE__ */ from_html(`<article class="go-cart-item-content"><ul><li class="go-cart-item-title-container"><!></li> <li class="go-cart-item-price"><!></li> <li class="go-cart-item-count"><!></li> <!> <li class="go-cart-item-sum"> </li></ul></article>`);
15201
15208
  function Item$1($$anchor, $$props) {
@@ -15317,9 +15324,9 @@ function Item$1($$anchor, $$props) {
15317
15324
  append($$anchor, span_2);
15318
15325
  };
15319
15326
  var alternate_1 = ($$anchor) => {
15320
- var select = root_4$3();
15327
+ var select = root_4$4();
15321
15328
  each(select, 21, () => generateQuantityOptions(get$2(capacity).min, get$2(capacity).max, { floor: 1 }), (q) => q.value, ($$anchor, q) => {
15322
- var option = root_3$6();
15329
+ var option = root_3$7();
15323
15330
  var text_4 = child(option, true);
15324
15331
  reset(option);
15325
15332
  var option_value = {};
@@ -30304,8 +30311,8 @@ var rest_excludes = new Set([
30304
30311
  var root$15 = /* @__PURE__ */ from_html(`<span class="go-field-star" aria-hidden="true">*</span>`);
30305
30312
  var root_1$7 = /* @__PURE__ */ from_html(` <!>`, 1);
30306
30313
  var root_2$6 = /* @__PURE__ */ from_html(`<label><!></label> <input/>`, 1);
30307
- var root_3$5 = /* @__PURE__ */ from_html(`<label><!></label> <textarea></textarea>`, 1);
30308
- var root_4$2 = /* @__PURE__ */ from_html(`<figure role="status" aria-live="polite"><img class="go-file-preview"/> <figcaption class="go-file-preview-caption"> </figcaption></figure>`);
30314
+ var root_3$6 = /* @__PURE__ */ from_html(`<label><!></label> <textarea></textarea>`, 1);
30315
+ var root_4$3 = /* @__PURE__ */ from_html(`<figure role="status" aria-live="polite"><img class="go-file-preview"/> <figcaption class="go-file-preview-caption"> </figcaption></figure>`);
30309
30316
  var root_5$1 = /* @__PURE__ */ from_html(`<label><!></label> <input/> <!>`, 1);
30310
30317
  var root_6$1 = /* @__PURE__ */ from_html(`<label><input/> <span class="go-checkbox-label"><!></span></label>`);
30311
30318
  var root_7$1 = /* @__PURE__ */ from_html(`<img src="" alt=""/> <option> </option>`, 1);
@@ -30356,7 +30363,7 @@ function InputAndLabel($$anchor, $$props) {
30356
30363
  append($$anchor, fragment_1);
30357
30364
  };
30358
30365
  const textarea = ($$anchor) => {
30359
- var fragment_2 = root_3$5();
30366
+ var fragment_2 = root_3$6();
30360
30367
  var label_2 = first_child(fragment_2);
30361
30368
  labelText(child(label_2));
30362
30369
  reset(label_2);
@@ -30399,7 +30406,7 @@ function InputAndLabel($$anchor, $$props) {
30399
30406
  }), void 0, void 0, void 0, void 0, true);
30400
30407
  var node_4 = sibling(input_2, 2);
30401
30408
  var consequent_1 = ($$anchor) => {
30402
- var figure = root_4$2();
30409
+ var figure = root_4$3();
30403
30410
  var img = child(figure);
30404
30411
  var figcaption = sibling(img, 2);
30405
30412
  var text_1 = child(figcaption, true);
@@ -30716,7 +30723,7 @@ create_custom_element(InputAndLabel, {
30716
30723
  var root$14 = /* @__PURE__ */ from_html(`<span> </span>`);
30717
30724
  var root_1$6 = /* @__PURE__ */ from_html(`<li> </li>`);
30718
30725
  var root_2$5 = /* @__PURE__ */ from_html(`<ul class="go-field-errors"></ul>`);
30719
- var root_3$4 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
30726
+ var root_3$5 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
30720
30727
  function Field($$anchor, $$props) {
30721
30728
  push($$props, true);
30722
30729
  let key = prop($$props, "key", 7), required = prop($$props, "required", 7, false), labelClass = prop($$props, "labelClass", 7), inputClass = prop($$props, "inputClass", 7);
@@ -30774,7 +30781,7 @@ function Field($$anchor, $$props) {
30774
30781
  flushSync();
30775
30782
  }
30776
30783
  };
30777
- var fragment = root_3$4();
30784
+ var fragment = root_3$5();
30778
30785
  var node = first_child(fragment);
30779
30786
  InputAndLabel(node, {
30780
30787
  get describedByIds() {
@@ -30874,7 +30881,7 @@ customElements.define("go-all-fields", create_custom_element(AllFields, {}, [],
30874
30881
  var root$12 = /* @__PURE__ */ from_html(`<p aria-hidden="true"> </p>`);
30875
30882
  var root_1$5 = /* @__PURE__ */ from_html(`<li> </li>`);
30876
30883
  var root_2$4 = /* @__PURE__ */ from_html(`<ul class="go-error-feedback-api-errors"></ul>`);
30877
- var root_3$3 = /* @__PURE__ */ from_html(`<div><p aria-live="assertive" class="sr-only"><!></p> <!> <!></div>`);
30884
+ var root_3$4 = /* @__PURE__ */ from_html(`<div><p aria-live="assertive" class="sr-only"><!></p> <!> <!></div>`);
30878
30885
  function ErrorsFeedback($$anchor, $$props) {
30879
30886
  push($$props, true);
30880
30887
  const _details = getDetails$1($$props.$$host);
@@ -30895,7 +30902,7 @@ function ErrorsFeedback($$anchor, $$props) {
30895
30902
  $$props.$$host.classList.toggle("go-feedback", true);
30896
30903
  $$props.$$host.setAttribute("data-num-errors", get$2(numErrors).toString());
30897
30904
  });
30898
- var div = root_3$3();
30905
+ var div = root_3$4();
30899
30906
  var p = child(div);
30900
30907
  var node = child(p);
30901
30908
  var consequent = ($$anchor) => {
@@ -32436,6 +32443,33 @@ var FILTER_NAMES = [
32436
32443
  //#region src/components/ticketSelection/filters/_helpers.ts
32437
32444
  var TWO_HOURS_MS = 7200 * 1e3;
32438
32445
  /**
32446
+ * When a segment opts into content attributes (with-content), batch-fetch
32447
+ * tickets/content for the given tickets and merge each entry's `content` onto
32448
+ * the matching ticket by id (mirrors the legacy `ticket.content = item.content`).
32449
+ * Mutates the tickets in place; call before adding them to the preCart so the
32450
+ * content is present on first render. No-op — and no request — when the segment
32451
+ * hasn't enabled the feature or there are no tickets to enrich.
32452
+ *
32453
+ * Best-effort: the content is an optional, additive sidecar, so a failed or
32454
+ * absent fetch degrades to "no info buttons" and must never empty the ticket
32455
+ * list (see audit finding IB-01). Note this does NOT cover a hung request — a
32456
+ * never-settling fetch is a separate core-infra concern (IB-05).
32457
+ */
32458
+ async function enrichTicketsWithContent(segment, tickets) {
32459
+ if (!segment.withContent) return;
32460
+ const ids = tickets.map((t) => t.id).filter((id) => typeof id === "number");
32461
+ if (!ids.length) return;
32462
+ try {
32463
+ const entries = await shop.asyncFetch(() => shop.ticketsContent(ids)) ?? [];
32464
+ const byId = new Map(entries.map((e) => [e.id, e.content]));
32465
+ for (const ticket of tickets) {
32466
+ if (typeof ticket.id !== "number") continue;
32467
+ const content = byId.get(ticket.id);
32468
+ if (content) ticket.content = content;
32469
+ }
32470
+ } catch {}
32471
+ }
32472
+ /**
32439
32473
  * Load quotas fetched by a filter's loadTimeslots into the shared quota store and
32440
32474
  * record which ticket ids this selection loaded for its picker. timeslotsOn() reads
32441
32475
  * tsd.timeslotTicketIds, so only these tickets' slots render — a foreign
@@ -32511,6 +32545,7 @@ var REGISTRY = {
32511
32545
  }));
32512
32546
  shop.capacityManager.addQuotas(quotas);
32513
32547
  const uiTickets = initUITimeslotTickets(filterAvailabletickets(tickets, tsd.selectedTime), tsd.selectedTime);
32548
+ await enrichTicketsWithContent(segment, uiTickets);
32514
32549
  for (const ticket of uiTickets) segment.preCart.addItem(createCartItem(ticket, { time: tsd.selectedTime }));
32515
32550
  }
32516
32551
  },
@@ -32542,6 +32577,7 @@ var REGISTRY = {
32542
32577
  const firstQuota = Object.values(quotas)[0];
32543
32578
  const timeslot = firstQuota ? Object.keys(firstQuota.capacities)[0] : void 0;
32544
32579
  const uiTickets = initUITimeslotTickets(filterAvailabletickets(tickets, timeslot), timeslot);
32580
+ await enrichTicketsWithContent(segment, uiTickets);
32545
32581
  for (const ticket of uiTickets) segment.preCart.addItem(createCartItem(ticket, { time: timeslot }));
32546
32582
  }
32547
32583
  },
@@ -32563,7 +32599,9 @@ var REGISTRY = {
32563
32599
  "by_ticket_ids[]": tsd.ticketIds,
32564
32600
  "by_ticket_group_ids[]": segment.ticketGroupIds ?? tsd.ticketGroupIds
32565
32601
  }));
32566
- for (const t of Object.values(tickets)) segment.preCart.addItem(createCartItem(createUITicket(t)));
32602
+ const uiTickets = Object.values(tickets).map((t) => createUITicket(t));
32603
+ await enrichTicketsWithContent(segment, uiTickets);
32604
+ for (const ticket of uiTickets) segment.preCart.addItem(createCartItem(ticket));
32567
32605
  }
32568
32606
  },
32569
32607
  "event:admission": {
@@ -32602,6 +32640,7 @@ var REGISTRY = {
32602
32640
  }));
32603
32641
  shop.capacityManager.addQuotas(quotas);
32604
32642
  const uiTickets = initUITimeslotTickets(filterAvailabletickets(tickets, tsd.selectedTime), tsd.selectedTime);
32643
+ await enrichTicketsWithContent(segment, uiTickets);
32605
32644
  for (const ticket of uiTickets) segment.preCart.addItem(createCartItem(ticket, { time: tsd.selectedTime }));
32606
32645
  }
32607
32646
  },
@@ -32634,6 +32673,7 @@ var REGISTRY = {
32634
32673
  const firstQuota = Object.values(quotas)[0];
32635
32674
  const time = firstQuota ? Object.keys(firstQuota.capacities)[0] : void 0;
32636
32675
  const uiTickets = initUITimeslotTickets(filterAvailabletickets(tickets, time), time);
32676
+ await enrichTicketsWithContent(segment, uiTickets);
32637
32677
  for (const t of uiTickets) segment.preCart.addItem(createCartItem(t, { time }));
32638
32678
  }
32639
32679
  },
@@ -32682,6 +32722,7 @@ var REGISTRY = {
32682
32722
  }));
32683
32723
  shop.capacityManager.addQuotas(quotas);
32684
32724
  const uiTickets = initUITimeslotTickets(filterAvailabletickets(tickets, tsd.selectedTime), tsd.selectedTime);
32725
+ await enrichTicketsWithContent(segment, uiTickets);
32685
32726
  for (const t of uiTickets) segment.preCart.addItem(createCartItem(t, { time: tsd.selectedTime }));
32686
32727
  }
32687
32728
  },
@@ -32749,6 +32790,7 @@ var REGISTRY = {
32749
32790
  }));
32750
32791
  shop.capacityManager.addQuotas(quotas);
32751
32792
  const uiTickets = initUITimeslotTickets(filterAvailabletickets(tickets, date.start_time), date.start_time);
32793
+ await enrichTicketsWithContent(segment, uiTickets);
32752
32794
  for (const ticket of uiTickets) segment.preCart.addItem(createCartItem(ticket, { time: date.start_time }));
32753
32795
  }
32754
32796
  }
@@ -32794,6 +32836,7 @@ var REGISTRY = {
32794
32836
  const firstQuota = Object.values(quotas)[0];
32795
32837
  const time = firstQuota ? Object.keys(firstQuota.capacities)[0] : date.start_time;
32796
32838
  const uiTickets = initUITimeslotTickets(filterAvailabletickets(tickets, time), time);
32839
+ await enrichTicketsWithContent(segment, uiTickets);
32797
32840
  for (const t of uiTickets) segment.preCart.addItem(createCartItem(t, { time }));
32798
32841
  }
32799
32842
  }
@@ -32837,6 +32880,7 @@ var REGISTRY = {
32837
32880
  }));
32838
32881
  shop.capacityManager.addQuotas(quotas);
32839
32882
  const uiTickets = initUITimeslotTickets(filterAvailabletickets(tickets, date.start_time), date.start_time);
32883
+ await enrichTicketsWithContent(segment, uiTickets);
32840
32884
  for (const t of uiTickets) segment.preCart.addItem(createCartItem(t, { time: date.start_time }));
32841
32885
  }
32842
32886
  }
@@ -33286,7 +33330,7 @@ customElements.define("go-order", create_custom_element(Order, { token: {
33286
33330
  var root$9 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <span class="go-cart-item-time" data-testid="cart-item-time"> </span>`, 1);
33287
33331
  var root_1$4 = /* @__PURE__ */ from_html(`<br/> <span class="go-order-item-quantities"> </span>`, 1);
33288
33332
  var root_2$3 = /* @__PURE__ */ from_html(`<a aria-label="iCal link"> </a>`);
33289
- var root_3$2 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-order-breakdown-count">1</li> <li class="go-order-breakdown-product"><span class="go-order-item-title"> </span> <!> <!> <a class="go-ticket-download" target="_blank" rel="noopener noreferrer"> </a></li> <li class="go-order-breakdown-item-price"> </li> <li class="go-order-breakdown-passbook"></li> <li class="go-order-breakdown-ical"><!></li></ul></article></li>`);
33333
+ var root_3$3 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-order-breakdown-count">1</li> <li class="go-order-breakdown-product"><span class="go-order-item-title"> </span> <!> <!> <a class="go-ticket-download" target="_blank" rel="noopener noreferrer"> </a></li> <li class="go-order-breakdown-item-price"> </li> <li class="go-order-breakdown-passbook"></li> <li class="go-order-breakdown-ical"><!></li></ul></article></li>`);
33290
33334
  function Event$1($$anchor, $$props) {
33291
33335
  push($$props, true);
33292
33336
  let item = prop($$props, "item", 7), orderDetails = prop($$props, "orderDetails", 7);
@@ -33306,7 +33350,7 @@ function Event$1($$anchor, $$props) {
33306
33350
  flushSync();
33307
33351
  }
33308
33352
  };
33309
- var li = root_3$2();
33353
+ var li = root_3$3();
33310
33354
  var article = child(li);
33311
33355
  var ul = child(article);
33312
33356
  var li_1 = sibling(child(ul), 2);
@@ -33391,8 +33435,8 @@ create_custom_element(Event$1, {
33391
33435
  var root$8 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date"> </span> <span class="go-cart-item-time"> </span>`, 1);
33392
33436
  var root_1$3 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date"> </span>`);
33393
33437
  var root_2$2 = /* @__PURE__ */ from_html(`<!> <br/> <a class="go-ticket-download" target="_blank" rel="noopener noreferrer"> </a>`, 1);
33394
- var root_3$1 = /* @__PURE__ */ from_html(`<br/> <a class="go-ticket-personalization"> </a>`, 1);
33395
- var root_4$1 = /* @__PURE__ */ from_html(`<a aria-label="passbook link"><img alt="apple wallet icon"/></a>`);
33438
+ var root_3$2 = /* @__PURE__ */ from_html(`<br/> <a class="go-ticket-personalization"> </a>`, 1);
33439
+ var root_4$2 = /* @__PURE__ */ from_html(`<a aria-label="passbook link"><img alt="apple wallet icon"/></a>`);
33396
33440
  var root_5 = /* @__PURE__ */ from_html(`<a aria-label="iCal link"> </a>`);
33397
33441
  var root_6 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-order-breakdown-count"></li> <li class="go-order-breakdown-product"><span class="go-order-item-title"> </span> <!></li> <li class="go-order-breakdown-item-price"> </li> <li class="go-order-breakdown-passbook"><!></li> <li class="go-order-breakdown-ical"><!></li></ul></article></li>`);
33398
33442
  var root_7 = /* @__PURE__ */ from_html(`<a class="go-ticket-download" target="_blank" rel="noopener noreferrer"> </a>`);
@@ -33478,7 +33522,7 @@ function TicketSale($$anchor, $$props) {
33478
33522
  append($$anchor, fragment_2);
33479
33523
  };
33480
33524
  var alternate = ($$anchor) => {
33481
- var fragment_4 = root_3$1();
33525
+ var fragment_4 = root_3$2();
33482
33526
  var a_1 = sibling(first_child(fragment_4), 2);
33483
33527
  var text_5 = child(a_1, true);
33484
33528
  reset(a_1);
@@ -33499,7 +33543,7 @@ function TicketSale($$anchor, $$props) {
33499
33543
  var li_4 = sibling(li_3, 2);
33500
33544
  var node_4 = child(li_4);
33501
33545
  var consequent_3 = ($$anchor) => {
33502
- var a_2 = root_4$1();
33546
+ var a_2 = root_4$2();
33503
33547
  var img = child(a_2);
33504
33548
  reset(a_2);
33505
33549
  template_effect(() => {
@@ -34085,6 +34129,13 @@ var SegmentDetails = class {
34085
34129
  set museumIds(value) {
34086
34130
  set(this.#museumIds, value, true);
34087
34131
  }
34132
+ #withContent = /* @__PURE__ */ state(false);
34133
+ get withContent() {
34134
+ return get$2(this.#withContent);
34135
+ }
34136
+ set withContent(value) {
34137
+ set(this.#withContent, value, true);
34138
+ }
34088
34139
  constructor(filters, tsdWrapper) {
34089
34140
  this.filters = filters === void 0 ? void 0 : Array.isArray(filters) ? filters : [filters];
34090
34141
  this.#ticketSelectionDetails = /* @__PURE__ */ user_derived(() => tsdWrapper.value);
@@ -34115,7 +34166,7 @@ var getSegmentDetails = createGetDetails(KEY);
34115
34166
  //#region src/components/ticketSelection/subcomponents/tickets/subcomponents/segment/TicketSegment.svelte
34116
34167
  function TicketSegment($$anchor, $$props) {
34117
34168
  push($$props, true);
34118
- const filters = prop($$props, "filters", 7), dateId = prop($$props, "dateId", 7), query = prop($$props, "query", 7), limit = prop($$props, "limit", 7), ticketGroupIds = prop($$props, "ticketGroupIds", 7), languageIds = prop($$props, "languageIds", 7), catchWordIds = prop($$props, "catchWordIds", 7), museumIds = prop($$props, "museumIds", 7);
34169
+ const filters = prop($$props, "filters", 7), dateId = prop($$props, "dateId", 7), query = prop($$props, "query", 7), limit = prop($$props, "limit", 7), ticketGroupIds = prop($$props, "ticketGroupIds", 7), languageIds = prop($$props, "languageIds", 7), catchWordIds = prop($$props, "catchWordIds", 7), museumIds = prop($$props, "museumIds", 7), withContent = prop($$props, "withContent", 7);
34119
34170
  function parseFilters(value) {
34120
34171
  if (!value) return void 0;
34121
34172
  const out = value.split(",").map((s) => s.trim()).filter(Boolean);
@@ -34134,6 +34185,7 @@ function TicketSegment($$anchor, $$props) {
34134
34185
  details.languageIds = parseIds(languageIds());
34135
34186
  details.catchWordIds = parseIds(catchWordIds());
34136
34187
  details.museumIds = parseIds(museumIds());
34188
+ details.withContent = Boolean(withContent());
34137
34189
  });
34138
34190
  user_effect(() => {
34139
34191
  details.dateId;
@@ -34144,6 +34196,7 @@ function TicketSegment($$anchor, $$props) {
34144
34196
  details.catchWordIds;
34145
34197
  details.query;
34146
34198
  details.limit;
34199
+ details.withContent;
34147
34200
  tsd?.filters;
34148
34201
  tsd?.selectedTimeslot;
34149
34202
  tsd?.selectedTime;
@@ -34218,6 +34271,13 @@ function TicketSegment($$anchor, $$props) {
34218
34271
  set museumIds($$value) {
34219
34272
  museumIds($$value);
34220
34273
  flushSync();
34274
+ },
34275
+ get withContent() {
34276
+ return withContent();
34277
+ },
34278
+ set withContent($$value) {
34279
+ withContent($$value);
34280
+ flushSync();
34221
34281
  }
34222
34282
  });
34223
34283
  }
@@ -34261,6 +34321,11 @@ customElements.define("go-ticket-segment", create_custom_element(TicketSegment,
34261
34321
  attribute: "museum-ids",
34262
34322
  reflect: true,
34263
34323
  type: "String"
34324
+ },
34325
+ withContent: {
34326
+ attribute: "with-content",
34327
+ reflect: true,
34328
+ type: "Boolean"
34264
34329
  }
34265
34330
  }, [], ["details"]));
34266
34331
  //#endregion
@@ -36131,9 +36196,12 @@ var purify = createDOMPurify();
36131
36196
  //#endregion
36132
36197
  //#region src/components/ticketSelection/subcomponents/tickets/subcomponents/segment/Item.svelte
36133
36198
  var root$3 = /* @__PURE__ */ from_html(`<span class="go-tickets-item-title-event-title"> </span> <span class="go-tickets-item-title-product-title"> </span>`, 1);
36134
- var root_1$2 = /* @__PURE__ */ from_html(`<option> </option>`);
36135
- var root_2$1 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-tickets-item-title"><!></li> <li class="go-tickets-item-description" data-go-tickets-description=""></li> <li class="go-tickets-item-price" data-go-tickets-price=""> </li> <li class="go-tickets-item-quality" data-go-tickets-quality=""><select class="go-tickets-item-select"></select></li></ul></article></li>`);
36199
+ var root_1$2 = /* @__PURE__ */ from_html(`<li class="go-tickets-item-info"><button type="button" data-testid="ticket-info-toggle"></button></li>`);
36200
+ var root_2$1 = /* @__PURE__ */ from_html(`<li class="go-ticket-additional-info" data-testid="ticket-additional-info"> </li>`);
36201
+ var root_3$1 = /* @__PURE__ */ from_html(`<option> </option>`);
36202
+ var root_4$1 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-tickets-item-title"><!></li> <!> <li class="go-tickets-item-description" data-go-tickets-description=""></li> <!> <li class="go-tickets-item-price" data-go-tickets-price=""> </li> <li class="go-tickets-item-quality" data-go-tickets-quality=""><select class="go-tickets-item-select"></select></li></ul></article></li>`);
36136
36203
  function Item($$anchor, $$props) {
36204
+ const uid = props_id();
36137
36205
  push($$props, true);
36138
36206
  const scaled_title = ($$anchor) => {
36139
36207
  var fragment = root$3();
@@ -36157,6 +36225,9 @@ function Item($$anchor, $$props) {
36157
36225
  };
36158
36226
  let item = prop($$props, "item", 7), details = prop($$props, "details", 7);
36159
36227
  let capacity = /* @__PURE__ */ state(void 0);
36228
+ let infoExpanded = /* @__PURE__ */ state(false);
36229
+ const reductionReason = /* @__PURE__ */ user_derived(() => item().product?.content?.reduction_reason);
36230
+ const infoPanelId = `go-ticket-info-${uid}`;
36160
36231
  user_effect(() => {
36161
36232
  details().preCart.items.map((i) => i.quantity);
36162
36233
  untrack(() => {
@@ -36186,55 +36257,87 @@ function Item($$anchor, $$props) {
36186
36257
  };
36187
36258
  var fragment_2 = comment();
36188
36259
  var node = first_child(fragment_2);
36189
- var consequent = ($$anchor) => {
36190
- var li = root_2$1();
36260
+ var consequent_2 = ($$anchor) => {
36261
+ var li = root_4$1();
36191
36262
  var article = child(li);
36192
36263
  var ul = child(article);
36193
36264
  var li_1 = child(ul);
36194
36265
  var node_1 = child(li_1);
36195
36266
  titleSnippet(node_1);
36196
36267
  reset(li_1);
36197
- var li_2 = sibling(li_1, 2);
36198
- html$2(li_2, () => purify.sanitize(item().product.description), true);
36199
- reset(li_2);
36200
- var li_3 = sibling(li_2, 2);
36201
- var text_3 = child(li_3, true);
36268
+ var node_2 = sibling(li_1, 2);
36269
+ var consequent = ($$anchor) => {
36270
+ var li_2 = root_1$2();
36271
+ var button = child(li_2);
36272
+ reset(li_2);
36273
+ template_effect(($0) => {
36274
+ set_class(button, 1, clsx(["go-ticket-info-icon", get$2(infoExpanded) && "is-active"]));
36275
+ set_attribute(button, "aria-expanded", get$2(infoExpanded));
36276
+ set_attribute(button, "aria-controls", infoPanelId);
36277
+ set_attribute(button, "aria-label", $0);
36278
+ }, [() => shop.t("ticket.list.additionalInfo")]);
36279
+ delegated("click", button, () => set(infoExpanded, !get$2(infoExpanded)));
36280
+ append($$anchor, li_2);
36281
+ };
36282
+ if_block(node_2, ($$render) => {
36283
+ if (get$2(reductionReason)) $$render(consequent);
36284
+ });
36285
+ var li_3 = sibling(node_2, 2);
36286
+ html$2(li_3, () => purify.sanitize(item().product.description), true);
36202
36287
  reset(li_3);
36203
- var li_4 = sibling(li_3, 2);
36204
- var select = child(li_4);
36288
+ var node_3 = sibling(li_3, 2);
36289
+ var consequent_1 = ($$anchor) => {
36290
+ var li_4 = root_2$1();
36291
+ var text_3 = child(li_4, true);
36292
+ reset(li_4);
36293
+ template_effect(($0) => {
36294
+ set_attribute(li_4, "id", infoPanelId);
36295
+ set_attribute(li_4, "hidden", !get$2(infoExpanded));
36296
+ set_text(text_3, $0);
36297
+ }, [() => shop.t(get$2(reductionReason))]);
36298
+ append($$anchor, li_4);
36299
+ };
36300
+ if_block(node_3, ($$render) => {
36301
+ if (get$2(reductionReason)) $$render(consequent_1);
36302
+ });
36303
+ var li_5 = sibling(node_3, 2);
36304
+ var text_4 = child(li_5, true);
36305
+ reset(li_5);
36306
+ var li_6 = sibling(li_5, 2);
36307
+ var select = child(li_6);
36205
36308
  each(select, 21, () => generateQuantityOptions(get$2(capacity).min, get$2(capacity).max), (q) => q.value, ($$anchor, q) => {
36206
- var option = root_1$2();
36207
- var text_4 = child(option, true);
36309
+ var option = root_3$1();
36310
+ var text_5 = child(option, true);
36208
36311
  reset(option);
36209
36312
  var option_value = {};
36210
36313
  template_effect(() => {
36211
36314
  set_selected(option, item().quantity === get$2(q).value);
36212
- set_text(text_4, get$2(q).label);
36315
+ set_text(text_5, get$2(q).label);
36213
36316
  if (option_value !== (option_value = get$2(q).value)) option.value = (option.__value = get$2(q).value) ?? "";
36214
36317
  });
36215
36318
  append($$anchor, option);
36216
36319
  });
36217
36320
  reset(select);
36218
- reset(li_4);
36321
+ reset(li_6);
36219
36322
  reset(ul);
36220
36323
  reset(article);
36221
36324
  reset(li);
36222
36325
  template_effect(($0) => {
36223
36326
  set_class(article, 1, clsx(["go-tickets-item", get$2(capacity).bookedOut && "is-booked-out"]));
36224
36327
  set_attribute(article, "data-testid", item().uuid);
36225
- set_text(text_3, item().price_formatted);
36328
+ set_text(text_4, item().price_formatted);
36226
36329
  set_attribute(select, "aria-label", $0);
36227
36330
  }, [() => shop.t("cart.content.table.edit")]);
36228
36331
  delegated("change", select, (e) => update(item(), e.target, details()?.ticketSelectionDetails));
36229
36332
  append($$anchor, li);
36230
36333
  };
36231
36334
  if_block(node, ($$render) => {
36232
- if (get$2(capacity) && !get$2(capacity).unavailable) $$render(consequent);
36335
+ if (get$2(capacity) && !get$2(capacity).unavailable) $$render(consequent_2);
36233
36336
  });
36234
36337
  append($$anchor, fragment_2);
36235
36338
  return pop($$exports);
36236
36339
  }
36237
- delegate(["change"]);
36340
+ delegate(["click", "change"]);
36238
36341
  create_custom_element(Item, {
36239
36342
  item: {},
36240
36343
  details: {}