1"use strict"; 2(function() { 3 "use strict"; 4 const t$5 = globalThis, e$b = t$5.ShadowRoot && (void 0 === t$5.ShadyCSS || t$5.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$7 = /* @__PURE__ */ Symbol(), o$d = /* @__PURE__ */ new WeakMap(); 5 let n$8 = class n { 6 constructor(t2, e2, o2) { 7 if (this._$cssResult$ = true, o2 !== s$7) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); 8 this.cssText = t2, this.t = e2; 9 } 10 get styleSheet() { 11 let t2 = this.o; 12 const s2 = this.t; 13 if (e$b && void 0 === t2) { 14 const e2 = void 0 !== s2 && 1 === s2.length; 15 e2 && (t2 = o$d.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && o$d.set(s2, t2)); 16 } 17 return t2; 18 } 19 toString() { 20 return this.cssText; 21 } 22 }; 23 const r$9 = (t2) => new n$8("string" == typeof t2 ? t2 : t2 + "", void 0, s$7), i$9 = (t2, ...e2) => { 24 const o2 = 1 === t2.length ? t2[0] : e2.reduce((e3, s2, o3) => e3 + ((t3) => { 25 if (true === t3._$cssResult$) return t3.cssText; 26 if ("number" == typeof t3) return t3; 27 throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); 28 })(s2) + t2[o3 + 1], t2[0]); 29 return new n$8(o2, t2, s$7); 30 }, S$1 = (s2, o2) => { 31 if (e$b) s2.adoptedStyleSheets = o2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); 32 else for (const e2 of o2) { 33 const o3 = document.createElement("style"), n2 = t$5.litNonce; 34 void 0 !== n2 && o3.setAttribute("nonce", n2), o3.textContent = e2.cssText, s2.appendChild(o3); 35 } 36 }, c$5 = e$b ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { 37 let e2 = ""; 38 for (const s2 of t3.cssRules) e2 += s2.cssText; 39 return r$9(e2); 40 })(t2) : t2; 41 const { is: i$8, defineProperty: e$a, getOwnPropertyDescriptor: h$5, getOwnPropertyNames: r$8, getOwnPropertySymbols: o$c, getPrototypeOf: n$7 } = Object, a$2 = globalThis, c$4 = a$2.trustedTypes, l$2 = c$4 ? c$4.emptyScript : "", p$2 = a$2.reactiveElementPolyfillSupport, d$3 = (t2, s2) => t2, u$3 = { toAttribute(t2, s2) { 42 switch (s2) { 43 case Boolean: 44 t2 = t2 ? l$2 : null; 45 break; 46 case Object: 47 case Array: 48 t2 = null == t2 ? t2 : JSON.stringify(t2); 49 } 50 return t2; 51 }, fromAttribute(t2, s2) { 52 let i2 = t2; 53 switch (s2) { 54 case Boolean: 55 i2 = null !== t2; 56 break; 57 case Number: 58 i2 = null === t2 ? null : Number(t2); 59 break; 60 case Object: 61 case Array: 62 try { 63 i2 = JSON.parse(t2); 64 } catch (t3) { 65 i2 = null; 66 } 67 } 68 return i2; 69 } }, f$3 = (t2, s2) => !i$8(t2, s2), b$2 = { attribute: true, type: String, converter: u$3, reflect: false, useDefault: false, hasChanged: f$3 }; 70 Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), a$2.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); 71 let y$1 = class y extends HTMLElement { 72 static addInitializer(t2) { 73 this._$Ei(), (this.l ??= []).push(t2); 74 } 75 static get observedAttributes() { 76 return this.finalize(), this._$Eh && [...this._$Eh.keys()]; 77 } 78 static createProperty(t2, s2 = b$2) { 79 if (s2.state && (s2.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t2) && ((s2 = Object.create(s2)).wrapped = true), this.elementProperties.set(t2, s2), !s2.noAccessor) { 80 const i2 = /* @__PURE__ */ Symbol(), h2 = this.getPropertyDescriptor(t2, i2, s2); 81 void 0 !== h2 && e$a(this.prototype, t2, h2); 82 } 83 } 84 static getPropertyDescriptor(t2, s2, i2) { 85 const { get: e2, set: r2 } = h$5(this.prototype, t2) ?? { get() { 86 return this[s2]; 87 }, set(t3) { 88 this[s2] = t3; 89 } }; 90 return { get: e2, set(s3) { 91 const h2 = e2?.call(this); 92 r2?.call(this, s3), this.requestUpdate(t2, h2, i2); 93 }, configurable: true, enumerable: true }; 94 } 95 static getPropertyOptions(t2) { 96 return this.elementProperties.get(t2) ?? b$2; 97 } 98 static _$Ei() { 99 if (this.hasOwnProperty(d$3("elementProperties"))) return; 100 const t2 = n$7(this); 101 t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); 102 } 103 static finalize() { 104 if (this.hasOwnProperty(d$3("finalized"))) return; 105 if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$3("properties"))) { 106 const t3 = this.properties, s2 = [...r$8(t3), ...o$c(t3)]; 107 for (const i2 of s2) this.createProperty(i2, t3[i2]); 108 } 109 const t2 = this[Symbol.metadata]; 110 if (null !== t2) { 111 const s2 = litPropertyMetadata.get(t2); 112 if (void 0 !== s2) for (const [t3, i2] of s2) this.elementProperties.set(t3, i2); 113 } 114 this._$Eh = /* @__PURE__ */ new Map(); 115 for (const [t3, s2] of this.elementProperties) { 116 const i2 = this._$Eu(t3, s2); 117 void 0 !== i2 && this._$Eh.set(i2, t3); 118 } 119 this.elementStyles = this.finalizeStyles(this.styles); 120 } 121 static finalizeStyles(s2) { 122 const i2 = []; 123 if (Array.isArray(s2)) { 124 const e2 = new Set(s2.flat(1 / 0).reverse()); 125 for (const s3 of e2) i2.unshift(c$5(s3)); 126 } else void 0 !== s2 && i2.push(c$5(s2)); 127 return i2; 128 } 129 static _$Eu(t2, s2) { 130 const i2 = s2.attribute; 131 return false === i2 ? void 0 : "string" == typeof i2 ? i2 : "string" == typeof t2 ? t2.toLowerCase() : void 0; 132 } 133 constructor() { 134 super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); 135 } 136 _$Ev() { 137 this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); 138 } 139 addController(t2) { 140 (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); 141 } 142 removeController(t2) { 143 this._$EO?.delete(t2); 144 } 145 _$E_() { 146 const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; 147 for (const i2 of s2.keys()) this.hasOwnProperty(i2) && (t2.set(i2, this[i2]), delete this[i2]); 148 t2.size > 0 && (this._$Ep = t2); 149 } 150 createRenderRoot() { 151 const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); 152 return S$1(t2, this.constructor.elementStyles), t2; 153 } 154 connectedCallback() { 155 this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); 156 } 157 enableUpdating(t2) { 158 } 159 disconnectedCallback() { 160 this._$EO?.forEach((t2) => t2.hostDisconnected?.()); 161 } 162 attributeChangedCallback(t2, s2, i2) { 163 this._$AK(t2, i2); 164 } 165 _$ET(t2, s2) { 166 const i2 = this.constructor.elementProperties.get(t2), e2 = this.constructor._$Eu(t2, i2); 167 if (void 0 !== e2 && true === i2.reflect) { 168 const h2 = (void 0 !== i2.converter?.toAttribute ? i2.converter : u$3).toAttribute(s2, i2.type); 169 this._$Em = t2, null == h2 ? this.removeAttribute(e2) : this.setAttribute(e2, h2), this._$Em = null; 170 } 171 } 172 _$AK(t2, s2) { 173 const i2 = this.constructor, e2 = i2._$Eh.get(t2); 174 if (void 0 !== e2 && this._$Em !== e2) { 175 const t3 = i2.getPropertyOptions(e2), h2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u$3; 176 this._$Em = e2; 177 const r2 = h2.fromAttribute(s2, t3.type); 178 this[e2] = r2 ?? this._$Ej?.get(e2) ?? r2, this._$Em = null; 179 } 180 } 181 requestUpdate(t2, s2, i2, e2 = false, h2) { 182 if (void 0 !== t2) { 183 const r2 = this.constructor; 184 if (false === e2 && (h2 = this[t2]), i2 ??= r2.getPropertyOptions(t2), !((i2.hasChanged ?? f$3)(h2, s2) || i2.useDefault && i2.reflect && h2 === this._$Ej?.get(t2) && !this.hasAttribute(r2._$Eu(t2, i2)))) return; 185 this.C(t2, s2, i2); 186 } 187 false === this.isUpdatePending && (this._$ES = this._$EP()); 188 } 189 C(t2, s2, { useDefault: i2, reflect: e2, wrapped: h2 }, r2) { 190 i2 && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t2) && (this._$Ej.set(t2, r2 ?? s2 ?? this[t2]), true !== h2 || void 0 !== r2) || (this._$AL.has(t2) || (this.hasUpdated || i2 || (s2 = void 0), this._$AL.set(t2, s2)), true === e2 && this._$Em !== t2 && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t2)); 191 } 192 async _$EP() { 193 this.isUpdatePending = true;
vendor: 10,403 bytes, lines 194-413
194 try { 195 await this._$ES; 196 } catch (t3) { 197 Promise.reject(t3); 198 } 199 const t2 = this.scheduleUpdate(); 200 return null != t2 && await t2, !this.isUpdatePending; 201 } 202 scheduleUpdate() { 203 return this.performUpdate(); 204 } 205 performUpdate() { 206 if (!this.isUpdatePending) return; 207 if (!this.hasUpdated) { 208 if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { 209 for (const [t4, s3] of this._$Ep) this[t4] = s3; 210 this._$Ep = void 0; 211 } 212 const t3 = this.constructor.elementProperties; 213 if (t3.size > 0) for (const [s3, i2] of t3) { 214 const { wrapped: t4 } = i2, e2 = this[s3]; 215 true !== t4 || this._$AL.has(s3) || void 0 === e2 || this.C(s3, void 0, i2, e2); 216 } 217 } 218 let t2 = false; 219 const s2 = this._$AL; 220 try { 221 t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EM(); 222 } catch (s3) { 223 throw t2 = false, this._$EM(), s3; 224 } 225 t2 && this._$AE(s2); 226 } 227 willUpdate(t2) { 228 } 229 _$AE(t2) { 230 this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); 231 } 232 _$EM() { 233 this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; 234 } 235 get updateComplete() { 236 return this.getUpdateComplete(); 237 } 238 getUpdateComplete() { 239 return this._$ES; 240 } 241 shouldUpdate(t2) { 242 return true; 243 } 244 update(t2) { 245 this._$Eq &&= this._$Eq.forEach((t3) => this._$ET(t3, this[t3])), this._$EM(); 246 } 247 updated(t2) { 248 } 249 firstUpdated(t2) { 250 } 251 }; 252 y$1.elementStyles = [], y$1.shadowRootOptions = { mode: "open" }, y$1[d$3("elementProperties")] = /* @__PURE__ */ new Map(), y$1[d$3("finalized")] = /* @__PURE__ */ new Map(), p$2?.({ ReactiveElement: y$1 }), (a$2.reactiveElementVersions ??= []).push("2.1.2"); 253 const t$4 = globalThis, i$7 = (t2) => t2, s$6 = t$4.trustedTypes, e$9 = s$6 ? s$6.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, h$4 = "$lit$", o$b = `lit$${Math.random().toFixed(9).slice(2)}$`, n$6 = "?" + o$b, r$7 = `<${n$6}>`, l$1 = document, c$3 = () => l$1.createComment(""), a$1 = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, u$2 = Array.isArray, d$2 = (t2) => u$2(t2) || "function" == typeof t2?.[Symbol.iterator], f$2 = "[ \n\f\r]", v$2 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, _ = /-->/g, m$1 = />/g, p$1 = RegExp(`>|${f$2}(?:([^\\s"'>=/]+)(${f$2}*=${f$2}*(?:[^ 254\f\r"'\`<>=]|("|')|))|$)`, "g"), g$1 = /'/g, $ = /"/g, y = /^(?:script|style|textarea|title)$/i, x$1 = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), b$1 = x$1(1), E = /* @__PURE__ */ Symbol.for("lit-noChange"), A$1 = /* @__PURE__ */ Symbol.for("lit-nothing"), C = /* @__PURE__ */ new WeakMap(), P = l$1.createTreeWalker(l$1, 129); 255 function V(t2, i2) { 256 if (!u$2(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); 257 return void 0 !== e$9 ? e$9.createHTML(i2) : i2; 258 } 259 const N$1 = (t2, i2) => { 260 const s2 = t2.length - 1, e2 = []; 261 let n2, l2 = 2 === i2 ? "<svg>" : 3 === i2 ? "<math>" : "", c2 = v$2; 262 for (let i3 = 0; i3 < s2; i3++) { 263 const s3 = t2[i3]; 264 let a2, u2, d2 = -1, f2 = 0; 265 for (; f2 < s3.length && (c2.lastIndex = f2, u2 = c2.exec(s3), null !== u2); ) f2 = c2.lastIndex, c2 === v$2 ? "!--" === u2[1] ? c2 = _ : void 0 !== u2[1] ? c2 = m$1 : void 0 !== u2[2] ? (y.test(u2[2]) && (n2 = RegExp("</" + u2[2], "g")), c2 = p$1) : void 0 !== u2[3] && (c2 = p$1) : c2 === p$1 ? ">" === u2[0] ? (c2 = n2 ?? v$2, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? p$1 : '"' === u2[3] ? $ : g$1) : c2 === $ || c2 === g$1 ? c2 = p$1 : c2 === _ || c2 === m$1 ? c2 = v$2 : (c2 = p$1, n2 = void 0); 266 const x2 = c2 === p$1 && t2[i3 + 1].startsWith("/>") ? " " : ""; 267 l2 += c2 === v$2 ? s3 + r$7 : d2 >= 0 ? (e2.push(a2), s3.slice(0, d2) + h$4 + s3.slice(d2) + o$b + x2) : s3 + o$b + (-2 === d2 ? i3 : x2); 268 } 269 return [V(t2, l2 + (t2[s2] || "<?>") + (2 === i2 ? "</svg>" : 3 === i2 ? "</math>" : "")), e2]; 270 }; 271 class S { 272 constructor({ strings: t2, _$litType$: i2 }, e2) { 273 let r2; 274 this.parts = []; 275 let l2 = 0, a2 = 0; 276 const u2 = t2.length - 1, d2 = this.parts, [f2, v2] = N$1(t2, i2); 277 if (this.el = S.createElement(f2, e2), P.currentNode = this.el.content, 2 === i2 || 3 === i2) { 278 const t3 = this.el.content.firstChild; 279 t3.replaceWith(...t3.childNodes); 280 } 281 for (; null !== (r2 = P.nextNode()) && d2.length < u2; ) { 282 if (1 === r2.nodeType) { 283 if (r2.hasAttributes()) for (const t3 of r2.getAttributeNames()) if (t3.endsWith(h$4)) { 284 const i3 = v2[a2++], s2 = r2.getAttribute(t3).split(o$b), e3 = /([.?@])?(.*)/.exec(i3); 285 d2.push({ type: 1, index: l2, name: e3[2], strings: s2, ctor: "." === e3[1] ? I : "?" === e3[1] ? L : "@" === e3[1] ? z : H }), r2.removeAttribute(t3); 286 } else t3.startsWith(o$b) && (d2.push({ type: 6, index: l2 }), r2.removeAttribute(t3)); 287 if (y.test(r2.tagName)) { 288 const t3 = r2.textContent.split(o$b), i3 = t3.length - 1; 289 if (i3 > 0) { 290 r2.textContent = s$6 ? s$6.emptyScript : ""; 291 for (let s2 = 0; s2 < i3; s2++) r2.append(t3[s2], c$3()), P.nextNode(), d2.push({ type: 2, index: ++l2 }); 292 r2.append(t3[i3], c$3()); 293 } 294 } 295 } else if (8 === r2.nodeType) if (r2.data === n$6) d2.push({ type: 2, index: l2 }); 296 else { 297 let t3 = -1; 298 for (; -1 !== (t3 = r2.data.indexOf(o$b, t3 + 1)); ) d2.push({ type: 7, index: l2 }), t3 += o$b.length - 1; 299 } 300 l2++; 301 } 302 } 303 static createElement(t2, i2) { 304 const s2 = l$1.createElement("template"); 305 return s2.innerHTML = t2, s2; 306 } 307 } 308 function M$1(t2, i2, s2 = t2, e2) { 309 if (i2 === E) return i2; 310 let h2 = void 0 !== e2 ? s2._$Co?.[e2] : s2._$Cl; 311 const o2 = a$1(i2) ? void 0 : i2._$litDirective$; 312 return h2?.constructor !== o2 && (h2?._$AO?.(false), void 0 === o2 ? h2 = void 0 : (h2 = new o2(t2), h2._$AT(t2, s2, e2)), void 0 !== e2 ? (s2._$Co ??= [])[e2] = h2 : s2._$Cl = h2), void 0 !== h2 && (i2 = M$1(t2, h2._$AS(t2, i2.values), h2, e2)), i2; 313 } 314 class R { 315 constructor(t2, i2) { 316 this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2; 317 } 318 get parentNode() { 319 return this._$AM.parentNode; 320 } 321 get _$AU() { 322 return this._$AM._$AU; 323 } 324 u(t2) { 325 const { el: { content: i2 }, parts: s2 } = this._$AD, e2 = (t2?.creationScope ?? l$1).importNode(i2, true); 326 P.currentNode = e2; 327 let h2 = P.nextNode(), o2 = 0, n2 = 0, r2 = s2[0]; 328 for (; void 0 !== r2; ) { 329 if (o2 === r2.index) { 330 let i3; 331 2 === r2.type ? i3 = new k(h2, h2.nextSibling, this, t2) : 1 === r2.type ? i3 = new r2.ctor(h2, r2.name, r2.strings, this, t2) : 6 === r2.type && (i3 = new Z(h2, this, t2)), this._$AV.push(i3), r2 = s2[++n2]; 332 } 333 o2 !== r2?.index && (h2 = P.nextNode(), o2++); 334 } 335 return P.currentNode = l$1, e2; 336 } 337 p(t2) { 338 let i2 = 0; 339 for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++; 340 } 341 } 342 class k { 343 get _$AU() { 344 return this._$AM?._$AU ?? this._$Cv; 345 } 346 constructor(t2, i2, s2, e2) { 347 this.type = 2, this._$AH = A$1, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cv = e2?.isConnected ?? true; 348 } 349 get parentNode() { 350 let t2 = this._$AA.parentNode; 351 const i2 = this._$AM; 352 return void 0 !== i2 && 11 === t2?.nodeType && (t2 = i2.parentNode), t2; 353 } 354 get startNode() { 355 return this._$AA; 356 } 357 get endNode() { 358 return this._$AB; 359 } 360 _$AI(t2, i2 = this) { 361 t2 = M$1(this, t2, i2), a$1(t2) ? t2 === A$1 || null == t2 || "" === t2 ? (this._$AH !== A$1 && this._$AR(), this._$AH = A$1) : t2 !== this._$AH && t2 !== E && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : d$2(t2) ? this.k(t2) : this._(t2); 362 } 363 O(t2) { 364 return this._$AA.parentNode.insertBefore(t2, this._$AB); 365 } 366 T(t2) { 367 this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); 368 } 369 _(t2) { 370 this._$AH !== A$1 && a$1(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(l$1.createTextNode(t2)), this._$AH = t2; 371 } 372 $(t2) { 373 const { values: i2, _$litType$: s2 } = t2, e2 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = S.createElement(V(s2.h, s2.h[0]), this.options)), s2); 374 if (this._$AH?._$AD === e2) this._$AH.p(i2); 375 else { 376 const t3 = new R(e2, this), s3 = t3.u(this.options); 377 t3.p(i2), this.T(s3), this._$AH = t3; 378 } 379 } 380 _$AC(t2) { 381 let i2 = C.get(t2.strings); 382 return void 0 === i2 && C.set(t2.strings, i2 = new S(t2)), i2; 383 } 384 k(t2) { 385 u$2(this._$AH) || (this._$AH = [], this._$AR()); 386 const i2 = this._$AH; 387 let s2, e2 = 0; 388 for (const h2 of t2) e2 === i2.length ? i2.push(s2 = new k(this.O(c$3()), this.O(c$3()), this, this.options)) : s2 = i2[e2], s2._$AI(h2), e2++; 389 e2 < i2.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i2.length = e2); 390 } 391 _$AR(t2 = this._$AA.nextSibling, s2) { 392 for (this._$AP?.(false, true, s2); t2 !== this._$AB; ) { 393 const s3 = i$7(t2).nextSibling; 394 i$7(t2).remove(), t2 = s3; 395 } 396 } 397 setConnected(t2) { 398 void 0 === this._$AM && (this._$Cv = t2, this._$AP?.(t2)); 399 } 400 } 401 class H { 402 get tagName() { 403 return this.element.tagName; 404 } 405 get _$AU() { 406 return this._$AM._$AU; 407 } 408 constructor(t2, i2, s2, e2, h2) { 409 this.type = 1, this._$AH = A$1, this._$AN = void 0, this.element = t2, this.name = i2, this._$AM = e2, this.options = h2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = A$1; 410 } 411 _$AI(t2, i2 = this, s2, e2) { 412 const h2 = this.strings; 413 let o2 = false;
414 if (void 0 === h2) t2 = M$1(this, t2, i2, 0), o2 = !a$1(t2) || t2 !== this._$AH && t2 !== E, o2 && (this._$AH = t2); 415 else { 416 const e3 = t2; 417 let n2, r2; 418 for (t2 = h2[0], n2 = 0; n2 < h2.length - 1; n2++) r2 = M$1(this, e3[s2 + n2], i2, n2), r2 === E && (r2 = this._$AH[n2]), o2 ||= !a$1(r2) || r2 !== this._$AH[n2], r2 === A$1 ? t2 = A$1 : t2 !== A$1 && (t2 += (r2 ?? "") + h2[n2 + 1]), this._$AH[n2] = r2; 419 } 420 o2 && !e2 && this.j(t2); 421 } 422 j(t2) { 423 t2 === A$1 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); 424 } 425 } 426 class I extends H { 427 constructor() { 428 super(...arguments), this.type = 3; 429 } 430 j(t2) { 431 this.element[this.name] = t2 === A$1 ? void 0 : t2; 432 } 433 } 434 class L extends H { 435 constructor() { 436 super(...arguments), this.type = 4; 437 } 438 j(t2) { 439 this.element.toggleAttribute(this.name, !!t2 && t2 !== A$1); 440 } 441 } 442 class z extends H { 443 constructor(t2, i2, s2, e2, h2) { 444 super(t2, i2, s2, e2, h2), this.type = 5; 445 } 446 _$AI(t2, i2 = this) { 447 if ((t2 = M$1(this, t2, i2, 0) ?? A$1) === E) return; 448 const s2 = this._$AH, e2 = t2 === A$1 && s2 !== A$1 || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h2 = t2 !== A$1 && (s2 === A$1 || e2); 449 e2 && this.element.removeEventListener(this.name, this, s2), h2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; 450 } 451 handleEvent(t2) { 452 "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); 453 } 454 } 455 class Z { 456 constructor(t2, i2, s2) { 457 this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i2, this.options = s2; 458 } 459 get _$AU() { 460 return this._$AM._$AU; 461 } 462 _$AI(t2) { 463 M$1(this, t2); 464 } 465 } 466 const j$2 = { I: k }, B = t$4.litHtmlPolyfillSupport; 467 B?.(S, k), (t$4.litHtmlVersions ??= []).push("3.3.3"); 468 const D = (t2, i2, s2) => { 469 const e2 = s2?.renderBefore ?? i2; 470 let h2 = e2._$litPart$; 471 if (void 0 === h2) { 472 const t3 = s2?.renderBefore ?? null; 473 e2._$litPart$ = h2 = new k(i2.insertBefore(c$3(), t3), t3, void 0, s2 ?? {}); 474 } 475 return h2._$AI(t2), h2; 476 }; 477 const s$5 = globalThis; 478 let i$6 = class i extends y$1 { 479 constructor() { 480 super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; 481 } 482 createRenderRoot() { 483 const t2 = super.createRenderRoot(); 484 return this.renderOptions.renderBefore ??= t2.firstChild, t2; 485 } 486 update(t2) { 487 const r2 = this.render(); 488 this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = D(r2, this.renderRoot, this.renderOptions); 489 } 490 connectedCallback() { 491 super.connectedCallback(), this._$Do?.setConnected(true); 492 } 493 disconnectedCallback() { 494 super.disconnectedCallback(), this._$Do?.setConnected(false); 495 } 496 render() { 497 return E; 498 } 499 }; 500 i$6._$litElement$ = true, i$6["finalized"] = true, s$5.litElementHydrateSupport?.({ LitElement: i$6 }); 501 const o$a = s$5.litElementPolyfillSupport; 502 o$a?.({ LitElement: i$6 }); 503 (s$5.litElementVersions ??= []).push("4.2.2"); 504 const t$3 = (t2) => (e2, o2) => { 505 void 0 !== o2 ? o2.addInitializer(() => { 506 customElements.define(t2, e2); 507 }) : customElements.define(t2, e2); 508 }; 509 const o$9 = { attribute: true, type: String, converter: u$3, reflect: false, hasChanged: f$3 }, r$6 = (t2 = o$9, e2, r2) => { 510 const { kind: n2, metadata: i2 } = r2; 511 let s2 = globalThis.litPropertyMetadata.get(i2); 512 if (void 0 === s2 && globalThis.litPropertyMetadata.set(i2, s2 = /* @__PURE__ */ new Map()), "setter" === n2 && ((t2 = Object.create(t2)).wrapped = true), s2.set(r2.name, t2), "accessor" === n2) { 513 const { name: o2 } = r2; 514 return { set(r3) { 515 const n3 = e2.get.call(this); 516 e2.set.call(this, r3), this.requestUpdate(o2, n3, t2, true, r3); 517 }, init(e3) { 518 return void 0 !== e3 && this.C(o2, void 0, t2, e3), e3; 519 } }; 520 } 521 if ("setter" === n2) { 522 const { name: o2 } = r2; 523 return function(r3) { 524 const n3 = this[o2]; 525 e2.call(this, r3), this.requestUpdate(o2, n3, t2, true, r3); 526 }; 527 } 528 throw Error("Unsupported decorator location: " + n2); 529 }; 530 function n$5(t2) { 531 return (e2, o2) => "object" == typeof o2 ? r$6(t2, e2, o2) : ((t3, e3, o3) => { 532 const r2 = e3.hasOwnProperty(o3); 533 return e3.constructor.createProperty(o3, t3), r2 ? Object.getOwnPropertyDescriptor(e3, o3) : void 0; 534 })(t2, e2, o2); 535 } 536 function r$5(r2) { 537 return n$5({ ...r2, state: true, attribute: false }); 538 } 539 const e$8 = (e2, t2, c2) => (c2.configurable = true, c2.enumerable = true, Reflect.decorate && "object" != typeof t2 && Object.defineProperty(e2, t2, c2), c2); 540 function e$7(e2, r2) { 541 return (n2, s2, i2) => { 542 const o2 = (t2) => t2.renderRoot?.querySelector(e2) ?? null; 543 return e$8(n2, s2, { get() { 544 return o2(this); 545 } }); 546 }; 547 } 548 let e$6; 549 function r$4(r2) { 550 return (n2, o2) => e$8(n2, o2, { get() { 551 return (this.renderRoot ?? (e$6 ??= document.createDocumentFragment())).querySelectorAll(r2); 552 } }); 553 } 554 function o$8(o2) { 555 return (e2, n2) => { 556 const { slot: r2, selector: s2 } = o2 ?? {}, c2 = "slot" + (r2 ? `[name=${r2}]` : ":not([name])"); 557 return e$8(e2, n2, { get() { 558 const t2 = this.renderRoot?.querySelector(c2), e3 = t2?.assignedElements(o2) ?? []; 559 return void 0 === s2 ? e3 : e3.filter((t3) => t3.matches(s2)); 560 } }); 561 }; 562 } 563 function n$4(n2) { 564 return (o2, r2) => { 565 const { slot: e2 }
565 = n2 ?? {}, s2 = "slot" + (e2 ? `[name=${e2}]` : ":not([name])"); 566 return e$8(o2, r2, { get() { 567 const t2 = this.renderRoot?.querySelector(s2); 568 return t2?.assignedNodes(n2) ?? []; 569 } }); 570 }; 571 } 572 let HTML$1 = class HTML2 { 573 /** 574 * retourne la langue de la page courante telle que défini via l'attribut lang de la balise html 575 */ 576 static getLanguage() { 577 const documentLanguage = document.documentElement.lang; 578 const selectedLanguage = localStorage.getItem("SonicSelectedLanguage"); 579 return selectedLanguage || documentLanguage; 580 } 581 static getCookies() { 582 return document.cookie.split(";").reduce((previous, current2) => { 583 const eqIdx = current2.indexOf("="); 584 previous[current2.substring(0, eqIdx).trim()] = current2.substring(eqIdx + 1); 585 return previous; 586 }, {}); 587 } 588 /** 589 * Ancêtre suivant dans l'arbre composé : slot de projection, sinon parentNode / shadow host. 590 * Nécessaire pour trouver un scroller/clipper dans le shadow d'un ancêtre (ex. #modal.custom-scroll). 591 */ 592 static nextComposedAncestor(node) { 593 if (node instanceof Element && node.assignedSlot) { 594 return node.assignedSlot; 595 } 596 const parent = node.parentNode || node.host; 597 return parent || null; 598 } 599 static everyAncestors(node, callback) { 600 while (node) { 601 const result = callback(node); 602 if (!result) 603 return; 604 node = node.parentNode || node.host; 605 } 606 } 607 static overflowMatches(style, values) { 608 return values.includes(style.overflowY) || values.includes(style.overflowX); 609 } 610 static findAncestorByOverflow(node, overflowValues) { 611 let current2 = node; 612 while (current2) { 613 if (current2 instanceof Element && current2.nodeType === 1) { 614 const style = window.getComputedStyle(current2); 615 if (HTML2.overflowMatches(style, overflowValues)) { 616 return current2; 617 } 618 } 619 current2 = HTML2.nextComposedAncestor(current2); 620 } 621 return null; 622 } 623 /** 624 * Ancêtre qui clippe (inclut overflow:hidden) â ex. clamp de sonic-pop. 625 * Reconnaît aussi overflow:overlay (.custom-scroll) et traverse les slots. 626 */ 627 static getScrollableAncestor(node) { 628 return HTML2.findAncestorByOverflow(node, [ 629 "auto", 630 "scroll", 631 "hidden", 632 "overlay" 633 ]); 634 } 635 /** 636 * Ancêtre réellement scrollable (pas overflow:hidden) â ex. restore scroll Safari de sonic-queue. 637 */ 638 static getScrollingAncestor(node) { 639 return HTML2.findAncestorByOverflow(node, ["auto", "scroll", "overlay"]); 640 } 641 /** Noms d'attribut DOM à tester (Lit reflect â minuscules, ex. serviceURL â serviceurl). */ 642 static scopeAttributeNames(attributeName) { 643 const lower = attributeName.toLowerCase(); 644 return lower === attributeName ? [attributeName] : [attributeName, lower]; 645 } 646 static readScopeAttributeOnElement(element, attributeName) { 647 for (const attrName of HTML2.scopeAttributeNames(attributeName)) { 648 if (element.hasAttribute(attrName)) { 649 return element.getAttribute(attrName) ?? ""; 650 } 651 } 652 return null; 653 } 654 /** 655 * Va de parent en parent en partant de node pour trouver un attribut. 656 * @param attributeName nom de l'attribut 657 * @returns valeur de l'attribut ou null si l'attribut n'est pas trouvé 658 */ 659 static getAncestorAttributeValue(node, attributeName) { 660 if (!node) 661 return null; 662 let current2 = node; 663 while (current2) { 664 if (current2 instanceof HTMLElement) { 665 const value = HTML2.readScopeAttributeOnElement(current2, attributeName); 666 if (value != null) { 667 return value; 668 } 669 } 670 const parent = current2.parentNode || current2.host; 671 if (!parent) 672 break; 673 current2 = parent; 674 } 675 return null; 676 } 677 /** 678 * Petite fonction utilitaire pour retourner la configuration a passer à l'utilitaire API 679 * Utilisée pour la configuration du wording / de la traduction ainsi que par le mixin fetcher par exemple 680 */ 681 static getApiConfiguration(node) { 682 const token = HTML2.getAncestorAttributeValue(node, "token"); 683 const addHTTPResponse = HTML2.getAncestorAttributeValue(node, "addHTTPResponse") != null; 684 const serviceURL = HTML2.getAncestorAttributeValue(node, "serviceURL"); 685 let userName = null; 686 let password2 = null; 687 const tokenProvider = HTML2.getAncestorAttributeValue(node, "tokenProvider"); 688 const authToken = HTML2.getAncestorAttributeValue(node, "eventsApiToken"); 689 if (!token) { 690 userName = HTML2.getAncestorAttributeValue(node, "userName"); 691 password2 = HTML2.getAncestorAttributeValue(node, "password"); 692 } 693 const credentials = HTML2.getAncestorAttributeValue(node, "credentials") || void 0; 694 const cache = node.getAttribute("cache"); 695 const blockUntilDone = node.hasAttribute("blockUntilDone");
696 const keepAlive = node.hasAttribute("keepAlive"); 697 return { 698 serviceURL, 699 token, 700 userName, 701 password: password2, 702 authToken, 703 tokenProvider, 704 addHTTPResponse, 705 credentials, 706 cache, 707 blockUntilDone, 708 keepAlive 709 }; 710 } 711 /** 712 * Va de parent en parent en partant de node pour trouver un attribut 713 * @param attributeName nom de l'attribut 714 * @returns valeur de l'attribut ou null si l'attribut n'est pas trouvé 715 */ 716 static getClosestElement(node, selector) { 717 while (!(node.nodeName && node.nodeName.toLowerCase() === selector)) { 718 const newNode = node.parentNode || node.host; 719 if (!newNode) 720 break; 721 node = node.parentNode || node.host; 722 } 723 if (!node.nodeName) { 724 return null; 725 } 726 return node; 727 } 728 /** 729 * Va de parent en parent en partant de node pour trouver un attribut 730 * @param attributeName nom de l'attribut 731 * @returns valeur de l'attribut ou null si l'attribut n'est pas trouvé 732 */ 733 static getClosestForm(node) { 734 return HTML2.getClosestElement(node, "form"); 735 } 736 /** 737 * Parcourt les ancêtres (parentNode / shadow host) et collecte ceux dont le tagName 738 * correspond à l'un des noms fournis (comparaison insensible à la casse). 739 * @param node Ãlément de départ 740 * @param tagNames Noms de balises à rechercher (ex: ['sonic-subscriber', 'sonic-sdui']) 741 * @returns Tableau des ancêtres correspondants 742 */ 743 static getAncestorsByTagNames(node, tagNames) { 744 const normalized = new Set(tagNames.map((t2) => t2.toLowerCase())); 745 const result = []; 746 let current2 = node.parentNode || node.host; 747 while (current2) { 748 if (current2 instanceof Element && normalized.has(current2.tagName.toLowerCase())) { 749 result.push(current2); 750 } 751 current2 = current2.parentNode || current2.host; 752 } 753 return result; 754 } 755 /** 756 * Parcourt les ancêtres (parentNode / shadow host) et collecte ceux qui matchent 757 * l'un des sélecteurs CSS fournis (element.matches(selector)). 758 * @param node Ãlément de départ 759 * @param selectors Sélecteurs CSS (ex: ['sonic-subscriber', 'sonic-sdui', 'div.container']) 760 * @returns Tableau des ancêtres correspondants 761 */ 762 static getAncestorsBySelectors(node, selectors) { 763 const result = []; 764 let current2 = node.parentNode || node.host; 765 while (current2) { 766 if (current2 instanceof Element) { 767 for (const selector of selectors) { 768 try { 769 if (current2.matches(selector)) { 770 result.push(current2); 771 break; 772 } 773 } catch { 774 } 775 } 776 } 777 current2 = current2.parentNode || current2.host; 778 } 779 return result; 780 } 781 /** 782 * Lance le chargement d'un js et retourne une promise qui resoud à true lorsque le chargement à réussi et à false, sinon. 783 * */ 784 static async loadJS(src) { 785 const p2 = new Promise(async (resolve) => { 786 const script = document.createElement("script"); 787 script.src = src; 788 script.onload = () => resolve(true); 789 script.onerror = () => resolve(true); 790 document.head.appendChild(script); 791 }); 792 return p2; 793 } 794 /** 795 * Lance le chargement d'un css et retourne une promise qui resoud à true lorsque le chargement à réussi et à false, sinon. 796 * */ 797 static async loadCSS(src) { 798 const p2 = new Promise(async (resolve) => { 799 const cssnode = document.createElement("link"); 800 cssnode.type = "text/css"; 801 cssnode.rel = "stylesheet"; 802 cssnode.href = src; 803 cssnode.onload = () => resolve(true); 804 cssnode.onerror = () => resolve(true); 805 document.head.appendChild(cssnode); 806 }); 807 return p2; 808 } 809 }; 810 const detecHTMLLanguageChange = (handler) => { 811 const htmlElement = document.documentElement; 812 const observer = new MutationObserver((mutationsList) => { 813 for (let mutation of mutationsList) { 814 if (mutation.type === "attributes" && mutation.attributeName === "lang") { 815 handler(); 816 } 817 } 818 }); 819 const config = { 820 attributes: true, 821 // Watch for attribute changes 822 attributeFilter: ["lang"] 823 // Only watch for changes to the lang attribute 824 }; 825 observer.observe(htmlElement, config); 826 }; 827 let Objects$1 = class Objects2 {
828 /** 829 * Effectue une comparaison d'égalité non profonde entre deux objets. 830 */ 831 /*eslint-disable @typescript-eslint/no-explicit-any*/ 832 static shallowEqual(object1, object2, useStrictComparaison = true) { 833 const keys1 = Object.keys(object1); 834 const keys2 = Object.keys(object2); 835 if (keys1.length !== keys2.length && useStrictComparaison) { 836 return false; 837 } 838 for (const key of keys1) { 839 const val1 = object1[key]; 840 const val2 = object2[key]; 841 const areEqual = useStrictComparaison ? val1 !== val2 : val1 != val2; 842 if (areEqual) { 843 return false; 844 } 845 } 846 return true; 847 } 848 /*eslint-enable @typescript-eslint/no-explicit-any*/ 849 /** 850 * Effectue une comparaison d'égalité profonde entre deux objets. 851 */ 852 /*eslint-disable @typescript-eslint/no-explicit-any*/ 853 static deepEqual(object1, object2, useStrictComparaison = true) { 854 const keys1 = Object.keys(object1); 855 const keys2 = Object.keys(object2); 856 if (keys1.length !== keys2.length && useStrictComparaison) { 857 return false; 858 } 859 for (const key of keys1) { 860 const val1 = object1[key]; 861 const val2 = object2[key]; 862 const areObjects = Objects2.isObject(val1) && Objects2.isObject(val2); 863 const areEqual = useStrictComparaison ? val1 !== val2 : val1 != val2; 864 if (areObjects && !Objects2.deepEqual(val1, val2) || !areObjects && areEqual) { 865 return false; 866 } 867 } 868 return true; 869 } 870 /*eslint-enable @typescript-eslint/no-explicit-any*/ 871 /** 872 * @returns true si l'objet est un objet ou un tableau (qui est un objet). mais false si null (car sinon typeof null "object") 873 */ 874 static isObject(object2) { 875 return object2 != null && typeof object2 === "object"; 876 } 877 /** 878 * @returns true si l'argument est null ou undefined 879 */ 880 static isUndefindOrNull(object2) { 881 return object2 === null || object2 === void 0; 882 } 883 static isEmpty(object2) { 884 if (Objects2.isUndefindOrNull(object2)) 885 return true; 886 return Object.keys(object2).length === 0; 887 } 888 /** 889 * traverse l'objet pour obtenir la valeur a l'adresse donnée via le tableau de clés pathArray. 890 * Si extendValues = true, les propriétés des objets parents sont copiées au fur et a mesure de la descente dans la hierarchie, avant l'assignation des propriétés de l'objet lui même. 891 */ 892 /*eslint-disable @typescript-eslint/no-explicit-any*/ 893 static traverse(obj, pathArray, extendValues = false) { 894 for (const key of pathArray) { 895 const newObj = obj[key]; 896 if (newObj === void 0) { 897 return void 0; 898 } 899 if (extendValues && Objects2.isObject(newObj)) { 900 obj = Object.assign(Array.isArray(newObj) ? [] : {}, obj, newObj); 901 } else { 902 obj = obj[key]; 903 } 904 } 905 return obj; 906 } 907 static traverseDotNotation(obj, path, extendValues = false) { 908 return Objects2.traverse(obj, path.split("."), extendValues); 909 } 910 /*eslint-enable @typescript-eslint/no-explicit-any*/ 911 static getURLSearchArray(sourceObject, prefix = "") { 912 let arr = []; 913 for (let key in sourceObject) { 914 const value = sourceObject[key]; 915 if (prefix) 916 key = prefix + "[" + key + "]"; 917 if (Objects2.isObject(value)) { 918 arr = [ 919 ...arr, 920 ...this.getURLSearchArray(value, key) 921 ]; 922 } else { 923 arr.push(`${key}=${value}`); 924 } 925 } 926 return arr; 927 } 928 static getURLSearchString(sourceObject) { 929 return Objects2.getURLSearchArray(sourceObject, "").join("&"); 930 } 931 }; 932 const traverseDotNotation = Objects$1.traverseDotNotation; 933 class DataProviderKeyImpl { 934 constructor(path) { 935 this.path = path; 936 } 937 toString() { 938 return this.path; 939 } 940 } 941 function createDataProviderKeyProxy(key) { 942 return new Proxy(key, { 943 get(target, prop) { 944 if (prop === "path") 945 return target.path; 946 if (prop === "toString") 947 return target.toString.bind(target); 948 if (prop === Symbol.toStringTag) 949 return "DataProviderKey"; 950 if (typeof prop === "symbol") 951 return target[prop]; 952 const newPath = target.path ? `${target.path}.${String(prop)}` : String(prop); 953 return createDataProviderKeyProxy(new DataProviderKeyImpl(newPath)); 954 } 955 }); 956 } 957 const DYNAMIC_PUBLISHER_PATH = /\$\{|\{\$/; 958 function isDynamicPublisherPath(path) { 959 return DYNAMIC_PUBLISHER_PATH.test(path); 960 } 961 function resolveStaticPublisherPath(input) { 962 const path = typeof input === "string" ? input : input.path; 963 if (isDynamicPublisherPath(path)) { 964 throw new Error("Static publisher path required for get/set/dp. Use @subscribe, @publish, or @handle for dynamic DataProviderKey paths."); 965 } 966 return path; 967 } 968 const DataProviderKey = function(path) { 969 if (!(this instanceof DataProviderKey)) { 970 return new DataProviderKey(path); 971 } 972 return createDataProviderKeyProxy(new DataProviderKeyImpl(path)); 973 }; 974 let Utils$1 = class Utils { 975 static async queueTaskPromise() { 976 return new Promise((resolve) => { 977 window.queueMicrotask(() => resolve(null)); 978 }); 979 } 980 static async delayPromise(timeoutMs) { 981 return new Promise((resolve) => { 982 setTimeout(resolve, timeoutMs); 983 }); 984 } 985 }; 986 let SONIC_PREFIX$1 = "sonic"; 987 { 988 SONIC_PREFIX$1 = "sonic"; 989 } 990 let prefixUpperCamelCase = SONIC_PREFIX$1.replace(/-([a-z])/g, (g2) => g2[1].toUpperCase()); 991 const sonicClassPrefix = prefixUpperCamelCase.charAt(0).toUpperCase() + prefixUpperCamelCase.slice(1); 992 const DP_OPTION_KEYS = /* @__PURE__ */ new Set([ 993 "localStorageMode", 994 "expirationDelayMs", 995 "invalidateOnPageShow" 996 ]); 997 function isDpOptions(value) { 998 if (value == null || typeof value !== "object" || Array.isArray(value)) { 999 return false;
1000 } 1001 return Object.keys(value).some((key) => DP_OPTION_KEYS.has(key)); 1002 } 1003 function isLeaf(value) { 1004 return Object.prototype.hasOwnProperty.call(value, "__value"); 1005 } 1006 function isComplex(value) { 1007 return typeof value === "object" && value !== null; 1008 } 1009 let SONIC_PREFIX = "sonic"; 1010 const localStorageDataKey = "publisher-proxies-data"; 1011 class PublisherProxy { 1012 constructor(target, parentProxPub, parentKey) { 1013 this._proxies_ = /* @__PURE__ */ new Map(); 1014 this._is_savable_ = false; 1015 this._expiration_delay_ = 1e3 * 60 * 60 * 12; 1016 this._invalidate_on_page_show_ = false; 1017 this._invalidateListeners_ = /* @__PURE__ */ new Set(); 1018 this._formInvalidateListeners_ = /* @__PURE__ */ new Set(); 1019 this._assignListeners_ = /* @__PURE__ */ new Set(); 1020 this._mutationListeners_ = /* @__PURE__ */ new Set(); 1021 this._fillListeners_ = /* @__PURE__ */ new Set(); 1022 this._templateFillListeners_ = /* @__PURE__ */ new Set(); 1023 this._lockInternalMutationPublishing_ = false; 1024 this._instanceCounter_ = 0; 1025 this._assignmentId_ = 0; 1026 this._value_ = target; 1027 this.parent = parentProxPub || null; 1028 this._parentKey_ = parentKey; 1029 this.root = this; 1030 this._instanceCounter_ = 0; 1031 while (this.root.parent) { 1032 this.root = this.root.parent; 1033 } 1034 } 1035 /** 1036 * Supprime le proxy et ses sous proxy 1037 * Supprime les écouteurs associés 1038 */ 1039 delete() { 1040 for (const key in this._proxies_.keys()) { 1041 if (key == "_parent_") 1042 continue; 1043 this._proxies_.get(key)?.delete(); 1044 } 1045 this._invalidateListeners_.clear(); 1046 this._formInvalidateListeners_.clear(); 1047 this._assignListeners_.clear(); 1048 this._mutationListeners_.clear(); 1049 this._fillListeners_.clear(); 1050 this._templateFillListeners_.clear(); 1051 this._proxies_.clear(); 1052 PublisherProxy.instances.delete(this._instanceCounter_); 1053 } 1054 /** 1055 * Utile pour savoir si quelque chose est en écoute d'une modification sur le proxy via une des methodes associées 1056 */ 1057 hasListener() { 1058 return this._templateFillListeners_.size > 0 || this._assignListeners_.size > 0 || this._invalidateListeners_.size > 0 || this._formInvalidateListeners_.size > 0 || this._mutationListeners_.size > 0 || this._fillListeners_.size > 0; 1059 } 1060 _publishInternalMutation_(lockInternalMutationsTransmission = false) { 1061 this._mutationListeners_.forEach((handler) => handler()); 1062 if (this._is_savable_ && !PublisherManager.changed) { 1063 PublisherManager.changed = true; 1064 PublisherManager.saveId++; 1065 const saveId = PublisherManager.saveId; 1066 setTimeout(() => PublisherManager.getInstance().saveToLocalStorage(saveId), 1e3); 1067 } 1068 if (lockInternalMutationsTransmission) 1069 return; 1070 if (this.parent) { 1071 this.parent._publishInternalMutation_(); 1072 } 1073 } 1074 async _publishAssignement_(lockInternalMutationsTransmission = false) { 1075 this._assignmentId_++; 1076 const currentId = this._assignmentId_; 1077 if (currentId !== this._assignmentId_) 1078 return; 1079 const newValue = this.get(); 1080 this._assignListeners_.forEach((handler) => { 1081 handler(newValue); 1082 }); 1083 this._publishInternalMutation_(lockInternalMutationsTransmission); 1084 } 1085 _publishInvalidation_() { 1086 this._invalidateListeners_.forEach((handler) => handler()); 1087 } 1088 _publishFormInvalidation_() { 1089 this._formInvalidateListeners_.forEach((handler) => handler()); 1090 } 1091 _publishDynamicFilling_(key, value) { 1092 this._fillListeners_.forEach((handler) => { 1093 if (handler[key] !== value) 1094 handler[key] = value; 1095 }); 1096 this._publishTemplateFilling_(key, value); 1097 } 1098 _publishTemplateFilling_(key, value) { 1099 this._templateFillListeners_.forEach((handler) => { 1100 const desc = Object.getOwnPropertyDescriptor(handler, key); 1101 if (desc && !desc.set && !desc.writable) 1102 return; 1103 if (handler.propertyMap && handler.propertyMap[key]) { 1104 key = handler.propertyMap[key]; 1105 } 1106 if (typeof handler[key] != "undefined" && handler[key] !== value) { 1107 handler[key] = value; 1108 } 1109 }); 1110 } 1111 /** 1112 * Appel la fonction "handler" (passée en paramettre) lorsque la valeur gérée par le proxy change par assignation 1113 * hanlder reçois alors la nouvelle valeur interne du proxy en paramètre 1114 */ 1115 onAssign(handler, directHandlerCall = true) { 1116 if (typeof handler != "function") 1117 return; 1118 if (this._assignListeners_.has(handler)) 1119 return; 1120 this._assignListeners_.add(handler); 1121 if (directHandlerCall) 1122 handler(this.get()); 1123 } 1124 /** 1125 * Stop les appels de la fonction "handler" (passée en paramettre) lorsque la valeur gérée par le proxy change par assignation 1126 */ 1127 offAssign(handler) { 1128 this._assignListeners_.delete(handler); 1129 } 1130 /** 1131 * Appel la fonction "handler" (passée en paramettre) lorsque la donnée est flaggée comme invalide 1132 */ 1133 onInvalidate(handler) { 1134 if (typeof handler != "function") 1135 return; 1136 this._invalidateListeners_.add(handler); 1137 } 1138 /** 1139 * Stop les appels de la fonction "handler" (passée en paramettre) lorsque la donnée est flaggée comme invalide 1140 */ 1141 offInvalidate(handler) { 1142 if (typeof handler != "function") 1143 return; 1144 this._invalidateListeners_.delete(handler); 1145 } 1146 /** 1147 * Flag les données comme étant invalides 1148 */ 1149 invalidate() { 1150 this._publishInvalidation_(); 1151 } 1152 /** 1153 * Appel la fonction "handler" (passée en paramettre) lorsque la donnée est flaggée comme invalide 1154 */ 1155 onFormInvalidate(handler) { 1156 if (typeof handler != "function") 1157 return; 1158 this._formInvalidateListeners_.add(handler); 1159 } 1160 /** 1161 * Stop les appels de la fonction "handler" (passée en paramettre) lorsque la donnée est flaggée comme invalide 1162 */ 1163 offFormInvalidate(handler) { 1164 if (typeof handler != "function") 1165 return; 1166 this._formInvalidateListeners_.delete(handler); 1167 } 1168 invalidateForm() { 1169 this._publishFormInvalidation_(); 1170 } 1171 /** 1172 * Appel la fonction "handler" (passée en paramettre) lorsque quelque chose change la valeur gérée par le proxy quelque soit la profondeur de la donnée 1173 * 1174 */ 1175 onInternalMutation(handler) { 1176 if (typeof handler != "function") 1177 return; 1178 this._mutationListeners_.add(handler); 1179 handler(); 1180 } 1181 /** 1182 * Stop les Appels de la fonction "handler" (passée en paramettre) lorsque quelque chose change la valeur gérée par le proxy quelque soit la profondeur de la donnée 1183 */ 1184 offInternalMutation(handler) { 1185 if (typeof handler != "function") 1186 return; 1187 this._mutationListeners_.delete(handler); 1188 } 1189 /** 1190 * Maintient le remplissage de l'objet / tableau "handler" passé en paramètre avec les valeurs du proxy 1191 * Remplit uniquement les valeurs déjà présentes dans l'objet / tableau passé en paramètre 1192 */ 1193 startTemplateFilling(handler) { 1194 this._templateFillListeners_.add(handler); 1195 if (typeof this._value_ != "object") 1196 return; 1197 for (const z2 in this._value_) { 1198 let valueKey = z2; 1199 const value = this._value_[z2]; 1200 if (handler.propertyMap && handler.propertyMap[z2]) { 1201 valueKey = handler.propertyMap[z2]; 1202 } 1203 if (typeof handler[z2] != "undefined" && handler[z2] !== value) { 1204 handler[valueKey] = value; 1205 } 1206 } 1207 } 1208 /** 1209 * Arrête de maintenir le remplissage de l'objet / tableau "handler" passé en paramètre avec les valeurs du proxy 1210 */ 1211 stopTemplateFilling(handler) { 1212 this._templateFillListeners_.delete(handler); 1213 } 1214 /** 1215 * Maintient le remplissage de l'objet / tableau "handler" passé en paramètre avec les valeurs du proxy 1216 * Remplit toute valeur qu'elle soit présente ou pas initialement dans l'objet 1217 */ 1218 startDynamicFilling(handler) { 1219 this._fillListeners_.add(handler); 1220 for (const z2 in this._value_) { 1221 const value = this._value_[z2]; 1222 if (handler[z2] !== value) 1223 handler[z2] = value; 1224 } 1225 } 1226 /* 1227 * Arrête de maintenir le remplissage de l'objet / tableau "handler" passé en paramètre avec les valeurs du proxy 1228 */ 1229 stopDynamicFilling(handler) { 1230 this._fillListeners_.delete(handler); 1231 } 1232 /** 1233 * Assigne une nouvelle valeur au proxy ce qui déclenche la transmission de la donnée en fonction des "écouteurs" associés 1234 */ 1235 set(newValue, lockInternalMutationsTransmission = false) { 1236 if (this._value_ === newValue) 1237 return true; 1238 if (isComplex(this._value_) && isComplex(newValue) && newValue && isLeaf(this._value_) && isLeaf(newValue) && this._value_.__value === newValue.__value || !isComplex(newValue) && newValue === this._value_.__value) { 1239 return true; 1240 } 1241 this._value_ = isComplex(newValue) ? newValue : { __value: newValue }; 1242 this._cachedGet_ = void 0; 1243 const isLeafNewValue = isLeaf(this._value_); 1244 if (this._parentKey_ && this.parent) { 1245 const valueTosetInParent = isLeaf(this._value_) ? this._value_.__value : this._value_; 1246 if (this.parent?.get() == null && this.parent?.get() == void 0) { 1247 if (!isNaN(Number(this._parentKey_))) { 1248 const parent = [];
1249 parent[Number(this._parentKey_)] = valueTosetInParent; 1250 this.parent.set(parent); 1251 } else { 1252 this.parent.set({ [this._parentKey_]: valueTosetInParent }); 1253 } 1254 } else { 1255 this.parent._value_[this._parentKey_] = valueTosetInParent; 1256 } 1257 } 1258 if (isLeafNewValue) { 1259 this._proxies_.forEach((_subProxy, key) => { 1260 if (key != "_parent_") { 1261 _subProxy.set(null); 1262 this._publishDynamicFilling_(key, null); 1263 } 1264 }); 1265 this._publishAssignement_(lockInternalMutationsTransmission); 1266 if (this.parent && this._parentKey_) { 1267 this.parent._publishDynamicFilling_(this._parentKey_, this._value_.__value); 1268 } 1269 return true; 1270 } 1271 for (const key in this._value_) { 1272 const currentValue = this._value_[key]; 1273 if (currentValue === void 0) 1274 delete this._value_[key]; 1275 } 1276 this._proxies_.forEach((_subProxy, key) => { 1277 const currentValue = this._value_[key]; 1278 if (key != "_parent_") { 1279 if (currentValue === void 0 && currentValue !== null && isNaN(Number(key))) { 1280 _subProxy.set(null); 1281 this._publishDynamicFilling_(key, null); 1282 } 1283 } 1284 }); 1285 this._publishAssignement_(); 1286 if (this.parent && this._parentKey_) 1287 this.parent._publishDynamicFilling_(this._parentKey_, this._value_); 1288 if (isComplex(this._value_)) { 1289 for (const key in this._value_) { 1290 const v2 = newValue[key]; 1291 const isVComplex = isComplex(v2); 1292 const valueV = isVComplex ? v2 : { __value: v2 }; 1293 if (!this._proxies_.has(key)) { 1294 this._publishDynamicFilling_(key, v2); 1295 continue; 1296 } 1297 this._proxies_.get(key)?.set(valueV, true); 1298 this._publishDynamicFilling_(key, v2); 1299 } 1300 } 1301 return true; 1302 } 1303 get() { 1304 trackModifiedPublisher(this); 1305 if (this._cachedGet_ !== void 0) 1306 return this._cachedGet_; 1307 if (Object.prototype.hasOwnProperty.call(this._value_, "__value")) { 1308 const v2 = this._value_.__value; 1309 return this._cachedGet_ = v2 != void 0 ? v2 : null; 1310 } 1311 return this._cachedGet_ = this._value_ != void 0 ? this._value_ : null; 1312 } 1313 /** 1314 * retourner le webcomponent auquel le proxy est associé 1315 */ 1316 get $tag() { 1317 if (!this._instanceCounter_) { 1318 PublisherProxy.instancesCounter++; 1319 this._instanceCounter_ = PublisherProxy.instancesCounter; 1320 } 1321 PublisherProxy.instances.set(this._instanceCounter_, this); 1322 const str = "<" + SONIC_PREFIX + '-publisher-proxy publisher="' + this._instanceCounter_ + '"></' + SONIC_PREFIX + "-publisher-proxy>"; 1323 return str; 1324 } 1325 } 1326 PublisherProxy.instances = /* @__PURE__ */ new Map(); 1327 PublisherProxy.instancesCounter = 0; 1328 const modifiedCollectore = []; 1329 function trackModifiedPublisher(proxy) { 1330 if (modifiedCollectore.length > 0) 1331 modifiedCollectore[0].add(proxy); 1332 } 1333 function collectModifiedPublisher() { 1334 modifiedCollectore.unshift(/* @__PURE__ */ new Set()); 1335 } 1336 function getModifiedPublishers() { 1337 return modifiedCollectore.shift(); 1338 } 1339 class PublisherManager { 1340 constructor() { 1341 this.enabledLocaStorageProxies = []; 1342 this.publishers = /* @__PURE__ */ new Map(); 1343 this.localStorageData = {}; 1344 this.isLocalStrorageReady = null; 1345 this.initialisedData = []; 1346 if (PublisherManager.instance != null) 1347 throw "Singleton / use getInstance"; 1348 PublisherManager.instance = this; 1349 this.isLocalStrorageReady = this.cleanStorageData(); 1350 PublisherManager.initPageShowHandler(); 1351 } 1352 static initPageShowHandler() { 1353 if (PublisherManager.pageShowHandlerInitialized) 1354 return; 1355 PublisherManager.pageShowHandlerInitialized = true; 1356 window.addEventListener("pageshow", (e2) => { 1357 if (e2.persisted) 1358 PublisherManager.getInstance().invalidateAll(); 1359 }); 1360 } 1361 invalidateAll() {
1362 this.publishers.forEach((publisher) => { 1363 if (!publisher._invalidate_on_page_show_) { 1364 return; 1365 } 1366 publisher.invalidate(); 1367 }); 1368 } 1369 async cleanStorageData() { 1370 return new Promise((resolve) => { 1371 const doiIt = async () => { 1372 try { 1373 let compressedData = localStorage.getItem(localStorageDataKey); 1374 let localStorageJSON = null; 1375 if (compressedData) 1376 localStorageJSON = await this.decompress(compressedData, "gzip"); 1377 if (localStorageJSON) { 1378 try { 1379 this.localStorageData = JSON.parse(localStorageJSON); 1380 } catch (e2) { 1381 this.localStorageData = {}; 1382 } 1383 } else { 1384 compressedData = await this.compress("{}", "gzip"); 1385 localStorage.setItem(localStorageDataKey, compressedData); 1386 this.localStorageData = {}; 1387 } 1388 const expirationDelay = 1e3 * 60 * 60 * 12; 1389 for (const key in this.localStorageData) { 1390 const item = this.localStorageData[key]; 1391 const expires = (/* @__PURE__ */ new Date()).getTime() - (item.expirationDelayMs || expirationDelay); 1392 if (item.lastModifiationMS < expires) { 1393 delete this.localStorageData[key]; 1394 } 1395 } 1396 resolve(true); 1397 } catch (e2) { 1398 window.requestAnimationFrame(() => { 1399 resolve(false); 1400 }); 1401 console.warn("no publisher cache in this browser"); 1402 } 1403 }; 1404 doiIt(); 1405 }); 1406 } 1407 /** 1408 * PublisherManager est un singleton 1409 */ 1410 static getInstance(id) { 1411 if (id) { 1412 const pm = PublisherManager.instances.get(id); 1413 if (pm) { 1414 return pm; 1415 } else { 1416 console.warn("No PublisherManager instance registered with id:", id, "creating new one"); 1417 return new PublisherManager(); 1418 } 1419 } 1420 if (PublisherManager.instance == null) 1421 return new PublisherManager(); 1422 return PublisherManager.instance; 1423 } 1424 /** 1425 * shortcut static pour obtenir un publisher vias sont id/adresse sans taper getInstance. 1426 * Si le publisher n'existe pas, il est créé. 1427 */ 1428 static get(id, options) { 1429 return PublisherManager.getInstance().get(id, options); 1430 } 1431 /** 1432 * Obtenir un publisher vias sont id/adresse 1433 * Si le publisher n'existe pas, il est créé. 1434 */ 1435 async setLocalData(publisher, id) { 1436 await this.isLocalStrorageReady; 1437 publisher.set(this.localStorageData[id + "¤lang_" + HTML$1.getLanguage()]?.data || publisher.get()); 1438 } 1439 get(id, options) { 1440 const hasLocalStorage = options?.localStorageMode === "enabled"; 1441 const invalidateOnPageShow = options?.invalidateOnPageShow === true; 1442 if (!this.publishers.has(id)) { 1443 const data = {}; 1444 const publisher2 = createPublisher(data); 1445 this.set(id, publisher2); 1446 } 1447 const publisher = this.publishers.get(id); 1448 if (hasLocalStorage && this.initialisedData.indexOf(id) === -1) { 1449 if (options?.expirationDelayMs) { 1450 publisher._expiration_delay_ = options.expirationDelayMs; 1451 } 1452 publisher._is_savable_ = true; 1453 this.initialisedData.push(id); 1454 this.setLocalData(publisher, id); 1455 } 1456 if (invalidateOnPageShow) { 1457 publisher._invalidate_on_page_show_ = invalidateOnPageShow; 1458 } 1459 return this.publishers.get(id); 1460 } 1461 /** 1462 * Remplace un publisher pour l'id fourni par un autre. 1463 * L'autre publisher n'est pas supprimé. 1464 */ 1465 set(id, publisher) { 1466 this.publishers.set(id, publisher); 1467 } 1468 /** 1469 * @warning 1470 * !!!!! ATTENTION !!!!! 1471 * Il est fort à aprier que vous ne voulez pas utiliser cette methode 1472 * Il s'agit d'une supression complete 1473 * * du publisher de la liste 1474 * * des bindings 1475 * * de même que ses sous publishers 1476 * 1477 * UTILISEZ PLUTÃT la méthode publisher.set({}) pour réinitialiser un publisher sans perdre les ecouteurs 1478 */ 1479 delete(id) { 1480 if (!this.publishers.has(id)) 1481 return false;
1482 this.publishers.delete(id); 1483 return true; 1484 } 1485 async saveToLocalStorage(saveId = 0) { 1486 if (saveId !== PublisherManager.saveId && saveId % 10 != 0) 1487 return; 1488 try { 1489 if (!PublisherManager.changed || PublisherManager.saving) 1490 return; 1491 PublisherManager.saving = true; 1492 PublisherManager.changed = false; 1493 const keys2 = Array.from(this.publishers.keys()); 1494 let hasChanged = false; 1495 for (const key of keys2) { 1496 const publisher = this.publishers.get(key); 1497 if (!publisher?._is_savable_) 1498 continue; 1499 const data = publisher?.get(); 1500 if (!data) 1501 continue; 1502 this.localStorageData[key + "¤lang_" + HTML$1.getLanguage()] = { 1503 lastModifiationMS: (/* @__PURE__ */ new Date()).getTime(), 1504 expirationDelayMs: publisher._expiration_delay_, 1505 data 1506 }; 1507 hasChanged = true; 1508 } 1509 if (hasChanged) { 1510 const compressedData = await this.compress(JSON.stringify(this.localStorageData), "gzip"); 1511 localStorage.setItem(localStorageDataKey, compressedData); 1512 } 1513 PublisherManager.saving = false; 1514 if (PublisherManager.changed) { 1515 PublisherManager.saveId++; 1516 const saveId2 = PublisherManager.saveId; 1517 setTimeout(() => this.saveToLocalStorage(saveId2), 1e3); 1518 } 1519 } catch (e2) { 1520 PublisherManager.saving = false; 1521 } 1522 } 1523 async compress(string, encoding) { 1524 const byteArray = new TextEncoder().encode(string); 1525 const win = window; 1526 const cs = new win.CompressionStream(encoding); 1527 const writer = cs.writable.getWriter(); 1528 writer.write(byteArray); 1529 writer.close(); 1530 const result = await new Response(cs.readable).arrayBuffer(); 1531 const arrayBufferView = new Uint8Array(result); 1532 let str = ""; 1533 for (let i2 = 0; i2 < arrayBufferView.length; i2++) { 1534 str += String.fromCharCode(arrayBufferView[i2]); 1535 } 1536 return btoa(str); 1537 } 1538 async decompress(str, encoding) { 1539 const decodedString = atob(str); 1540 const arrayBufferViewFromLocalStorage = Uint8Array.from(decodedString, (c2) => c2.charCodeAt(0)); 1541 const byteArray = arrayBufferViewFromLocalStorage.buffer; 1542 const win = window; 1543 const cs = new win.DecompressionStream(encoding); 1544 const writer = cs.writable.getWriter(); 1545 writer.write(byteArray); 1546 writer.close(); 1547 const result = await new Response(cs.readable).arrayBuffer(); 1548 return new TextDecoder().decode(result); 1549 } 1550 } 1551 PublisherManager.buildDate = "Wed Sep 16 2026 12:26:38 GMT+0200 (Central European Summer Time)"; 1552 PublisherManager.changed = false; 1553 PublisherManager.saving = false; 1554 PublisherManager.saveId = 0; 1555 PublisherManager.instance = null; 1556 PublisherManager.instances = /* @__PURE__ */ new Map(); 1557 PublisherManager.pageShowHandlerInitialized = false; 1558 if (typeof window !== "undefined") { 1559 const win = window; 1560 win[sonicClassPrefix + "PublisherManager"] = win[sonicClassPrefix + "PublisherManager"] || PublisherManager; 1561 } 1562 const internalProps = /* @__PURE__ */ new Set([ 1563 "invalidate", 1564 "onInvalidate", 1565 "offInvalidate", 1566 "invalidateForm", 1567 "onFormInvalidate", 1568 "offFormInvalidate", 1569 "onAssign", 1570 "offAssign", 1571 "startDynamicFilling", 1572 "stopDynamicFilling", 1573 "startTemplateFilling", 1574 "stopTemplateFilling", 1575 "onInternalMutation", 1576 "offInternalMutation", 1577 "set", 1578 "get", 1579 "$tag", 1580 "_cachedGet_", 1581 "_templateFillListeners_", 1582 "_fillListeners_", 1583 "_assignListeners_", 1584 "_invalidateListeners_", 1585 "_formInvalidateListeners_", 1586 "_publishInternalMutation_", 1587 "hasListener", 1588 "delete", 1589 "_mutationListeners_", 1590 "_publishDynamicFilling_", 1591 "_publishInvalidation_", 1592 "_publishFormInvalidation_", 1593 "_publishTemplateFilling_", 1594 "_publishAssignement_", 1595 "_proxies_", 1596 "parent", 1597 "_parentKey_", 1598 "_value_", 1599 "_is_savable_", 1600 "_expiration_delay_", 1601 "_lockInternalMutationPublishing_", 1602 "_instanceCounter_", 1603 "_assignmentId_", 1604 "_invalidate_on_page_show_" 1605 ]); 1606 function createPublisherHandler(publisherInstance, getProxy) { 1607 return { 1608 /** 1609 * Lorsque l'on écrit monConteneur = publisher.maClef ou monConteneur = publisher["maClef"] monConteneur contient : 1610 * Les methodes de PublisherProxy (onAssign... : voir liste dans kle tableaus si dessous), si la clef est une méthode de PublisherProxy,, 1611 * Sinon un autre proxy qui a comme valeur interne la valeur corespondante à la clef dans l'objet. 1612 */ 1613 get: function(_publisherInstance, sKey) { 1614 if (typeof sKey === "string" && internalProps.has(sKey)) 1615 return publisherInstance[sKey]; 1616 if (sKey == Symbol.toPrimitive) { 1617 return () => getProxy().get(); 1618 } 1619 if (!publisherInstance._proxies_.has(sKey)) { 1620 const vValue = publisherInstance._value_[sKey]; 1621 const newPublisher = createPublisher(isComplex(vValue) ? vValue : { __value: vValue }, publisherInstance, sKey); 1622 newPublisher._proxies_.set("_parent_", getProxy()); 1623 publisherInstance._proxies_.set(sKey, newPublisher); 1624 } 1625 return publisherInstance._proxies_.get(sKey); 1626 }, 1627 /** 1628 * Lorsque l'on écrit publisher.maClef = value ou publisher["maClef"] = value, on assigne la valeur à la clef dans l'objet interne. 1629 * Les gestionnairs associés sopnt déclenchés en conséquence de manière profonde et remontante si nécessaire. 1630 */ 1631 set: function(_publisherInstance, sKey, vValue) { 1632 if (sKey == "_value_") { 1633 publisherInstance._value_ = vValue; 1634 return true; 1635 } 1636 if (sKey == "_cachedGet_") { 1637 publisherInstance._cachedGet_ = vValue; 1638 return true; 1639 } 1640 if (sKey == "_assignmentId_") { 1641 publisherInstance._assignmentId_ = vValue; 1642 return true; 1643 } 1644 if (sKey == "_is_savable_") { 1645 publisherInstance._is_savable_ = vValue; 1646 return true; 1647 } 1648 if (sKey == "_expiration_delay_") { 1649 publisherInstance._expiration_delay_ = vValue; 1650 return true; 1651 } 1652 if (sKey == "_invalidate_on_page_show_") { 1653 publisherInstance._invalidate_on_page_show_ = vValue; 1654 return true; 1655 } 1656 if (sKey == "_instanceCounter_") { 1657 publisherInstance._instanceCounter_ = vValue; 1658 return true; 1659 } 1660 if (!publisherInstance._proxies_.has(sKey)) { 1661 const newPublisher = createPublisher({}, publisherInstance, sKey); 1662 newPublisher._proxies_.set("_parent_", getProxy()); 1663 publisherInstance._proxies_.set(sKey, newPublisher); 1664 } 1665 const prevValue = publisherInstance._value_[sKey]; 1666 if (prevValue !== vValue) { 1667 publisherInstance._value_[sKey] = vValue; 1668 publisherInstance._publishDynamicFilling_(sKey, vValue); 1669 publisherInstance._proxies_.get(sKey)?.set(isComplex(vValue) ? vValue : { __value: vValue }); 1670 } 1671 return true; 1672 }, 1673 /** 1674 * Autres propriétés classiques d'un objet implémentées par le proxy 1675 */ 1676 deleteProperty: function(_publisherInstance, sKey) { 1677 publisherInstance._publishDynamicFilling_(sKey, null); 1678 publisherInstance._proxies_.get(sKey)?.set(null); 1679 return delete publisherInstance._value_[sKey]; 1680 }, 1681 // enumerate: function (publisherInstance, sKey): CoreJSType { 1682 // return publisherInstance._value_.keys(); 1683 // }, 1684 has: function(_publisherInstance, sKey) { 1685 return sKey in publisherInstance._value_ && sKey != "_lockInternalMutationPublishing_"; 1686 }, 1687 defineProperty: function(_publisherInstance, sKey, oDesc) { 1688 if (oDesc && "value" in oDesc) { 1689 publisherInstance._value_[sKey] = oDesc.value; 1690 } 1691 return true; 1692 }, 1693 getOwnPropertyDescriptor: function(_publisherInstance, sKey) { 1694 return { 1695 enumerable: true, 1696 configurable: true 1697 }; 1698 }, 1699 ownKeys: function(_publisherInstance) { 1700 if (publisherInstance._value_.__value) 1701 return Object.keys(publisherInstance._value_.__value); 1702 return Object.keys(publisherInstance._value_); 1703 } 1704 }; 1705 } 1706 function createPublisher(target, parentProxPub = null, parentKey) { 1707 const instance = new PublisherProxy(target, parentProxPub, parentKey); 1708 let proxy = null; 1709 const handler = createPublisherHandler(instance, () => proxy); 1710 proxy = new Proxy(instance, handler); 1711 return proxy; 1712 } 1713 class PublisherWebComponent extends HTMLElement { 1714 constructor() { 1715 super(); 1716 this.publisherId = ""; 1717 this.onAssign = (value) => { 1718 this.innerHTML = value.toString(); 1719 }; 1720 } 1721 connectedCallback() { 1722 this.publisherId = this.getAttribute("publisher") || ""; 1723 this.publisher = PublisherProxy.instances.get(parseInt(this.publisherId)); 1724 this.publisher?.onAssign(this.onAssign); 1725 } 1726 disconnectedCallback() { 1727 this.publisher?.offAssign(this.onAssign); 1728 } 1729 } 1730 try {
1731 customElements.define(SONIC_PREFIX + "-publisher-proxy", PublisherWebComponent); 1732 } catch (e2) { 1733 } 1734 const getObservables = (observable, options) => { 1735 if (typeof observable === "function") { 1736 const func = observable; 1737 collectModifiedPublisher(); 1738 func(); 1739 return getModifiedPublishers(); 1740 } 1741 if (typeof observable === "string") { 1742 const split = observable.split("."); 1743 const dataProvider2 = split.shift() || ""; 1744 let publisher = PublisherManager.get(dataProvider2, options); 1745 publisher = Objects$1.traverse(publisher, split); 1746 const set2 = /* @__PURE__ */ new Set(); 1747 set2.add(publisher); 1748 return set2; 1749 } 1750 return /* @__PURE__ */ new Set([observable]); 1751 }; 1752 function get$2(id) { 1753 const path = resolveStaticPublisherPath(id); 1754 return getObservables(path).values().next().value?.get(); 1755 } 1756 function deepee(id, _defaultValue, options) { 1757 const path = resolveStaticPublisherPath(id); 1758 const value = getObservables(path, options).values().next().value; 1759 return value; 1760 } 1761 function dp$1(id, second) { 1762 if (isDpOptions(second)) 1763 return deepee(id, void 0, second); 1764 return deepee(id); 1765 } 1766 function set$1(id, value) { 1767 const path = resolveStaticPublisherPath(id); 1768 getObservables(path).values().next().value?.set(value); 1769 } 1770 function extractTypedApiResult(processed) { 1771 if (processed == null || typeof processed !== "object") { 1772 return processed; 1773 } 1774 if (Array.isArray(processed)) { 1775 return processed; 1776 } 1777 const copy = { ...processed }; 1778 delete copy._sonic_http_response_; 1779 return copy; 1780 } 1781 class API { 1782 set token(token) { 1783 this._token = token; 1784 if (!token) { 1785 API.tokens.delete(this.serviceURL); 1786 return; 1787 } 1788 if (API.invalidTokens.includes(token)) 1789 return; 1790 API.tokens.set(this.serviceURL, token); 1791 } 1792 get token() { 1793 return API.invalidTokens.includes(this._token) ? API.tokens.get(this.serviceURL) : this._token; 1794 } 1795 handleInvalidToken(token) { 1796 if (!token) 1797 return; 1798 if (API.invalidTokens.includes(token)) 1799 return; 1800 API.invalidTokens.push(token); 1801 this.token = null; 1802 } 1803 constructor(config) { 1804 this.addHTTPResponse = false; 1805 this.cache = "default"; 1806 this.isServiceSimulated = false; 1807 this.blockUntilDone = false; 1808 this.keepAlive = false; 1809 this.serviceURL = config.serviceURL; 1810 this.blockUntilDone = config.blockUntilDone || false; 1811 if (this.serviceURL == "publisher://") { 1812 this.isServiceSimulated = true; 1813 } 1814 if (!this.serviceURL) 1815 this.serviceURL = document.location.origin; 1816 this.userName = config.userName; 1817 this.password = config.password; 1818 if (config.token) 1819 this.token = config.token; 1820 this.tokenProvider = config.tokenProvider; 1821 this.authToken = config.authToken; 1822 this.addHTTPResponse = config.addHTTPResponse || false; 1823 this.credentials = config.credentials; 1824 this.cache = config.cache || "default"; 1825 this.keepAlive = config.keepAlive || false; 1826 } 1827 async handleResult(fetchResult, lastCall) { 1828 API.firstCallDoneFlags.set(this.serviceURL, "done"); 1829 this.lastResult = fetchResult; 1830 const contentType = fetchResult.headers.get("content-type")?.toLowerCase(); 1831 const httpCode = fetchResult.status; 1832 let result = {}; 1833 if (!contentType || contentType.indexOf("text/") == 0) { 1834 const str = await fetchResult.text(); 1835 result = { text: str }; 1836 } else { 1837 try { 1838 result = await fetchResult.json(); 1839 } catch (e2) { 1840 result = {}; 1841 } 1842 } 1843 if (this.addHTTPResponse && Objects$1.isObject(result)) { 1844 result._sonic_http_response_ = fetchResult; 1845 } 1846 if (httpCode === 498 && !API.failledTokenUpdates.has(this.serviceURL)) { 1847 this.handleInvalidToken(this.token); 1848 if (lastCall.apiMethod === "get") { 1849 result = await this[lastCall.apiMethod](lastCall.path, lastCall.additionalHeaders); 1850 } else { 1851 result = await this[lastCall.apiMethod](lastCall.path, lastCall.data, lastCall.method, lastCall.additionalHeaders); 1852 } 1853 } 1854 const apiPublisher = dp$1("sonic-api"); 1855 apiPublisher.lastResponse.set({ 1856 http: fetchResult, 1857 processed: result 1858 }); 1859 return result; 1860 } 1861 /** 1862 * Basic auth 1863 */ 1864 async auth() { 1865 if (this.token) 1866 return; 1867 if (API.tokens.has(this.serviceURL)) { 1868 this.token = API.tokens.get(this.serviceURL); 1869 return; 1870 } 1871 if (!this.tokenProvider) 1872 return; 1873 let headers = {}; 1874 if (this.userName && this.password) { 1875 headers = { 1876 Authorization: "Basic " + window.btoa(unescape(encodeURIComponent(this.userName + ":" + this.password))) 1877 }; 1878 } else if (this.authToken) { 1879 headers = { 1880 Authorization: "Bearer " + this.authToken 1881 }; 1882 } 1883 const serviceURL = new URL(this.serviceURL); 1884 const serviceHost = serviceURL.protocol + "//" + serviceURL.host; 1885 const result = await fetch(this.computeURL(this.tokenProvider, { 1886 serviceHost 1887 }), { 1888 headers, 1889 credentials: this.credentials, 1890 keepalive: this.keepAlive 1891 });
1892 try { 1893 const json = await result.json(); 1894 const newToken = json.token; 1895 if (newToken) { 1896 this.token = json.token; 1897 } else { 1898 API.failledTokenUpdates.set(this.serviceURL, true); 1899 } 1900 } catch (e2) { 1901 API.failledTokenUpdates.set(this.serviceURL, true); 1902 } 1903 } 1904 /** 1905 * avec localget, on ne passe pas par le système de token 1906 * on recupère path sans les searchparams nommée pathWithoutSearchParams 1907 * on cherche dans PublisherManager.get(pathWithoutSearchParams).get() les données qui matchent les searchparams présents dans path 1908 * on retourne les données selon le même format que le retour de get 1909 * 1910 * @todo netttoyer 1911 */ 1912 async localGet(dataProvider, searchString) { 1913 const publisher = PublisherManager.get(dataProvider); 1914 const searchParams = new URLSearchParams(searchString.split("?")[1] || ""); 1915 const dataObject = publisher.get(); 1916 let data = []; 1917 if (!Array.isArray(dataObject)) { 1918 data = [dataObject]; 1919 } else { 1920 data = dataObject; 1921 } 1922 const result = []; 1923 let limit = Number.POSITIVE_INFINITY; 1924 let offset = 0; 1925 let limitOffsetparams = 0; 1926 if (searchParams.has("limit")) { 1927 limit = parseInt(searchParams.get("limit") || "0"); 1928 limitOffsetparams++; 1929 } 1930 if (searchParams.has("offset")) { 1931 offset = parseInt(searchParams.get("offset") || "0"); 1932 limitOffsetparams++; 1933 } 1934 if (limitOffsetparams > 0) { 1935 searchParams.delete("limit"); 1936 searchParams.delete("offset"); 1937 } 1938 if (searchParams.size === 0) 1939 return data.slice(offset, offset + limit); 1940 for (const [key, value] of searchParams.entries()) { 1941 const values = value.split(",").map((s2) => s2.trim()); 1942 for (const v2 of values) { 1943 for (const item of data) { 1944 if (typeof item !== "object") { 1945 if (!isNaN(+item)) { 1946 if (item === value) { 1947 result.push(item); 1948 } 1949 } else if (item.toString().toLowerCase().includes(value.toLowerCase())) { 1950 result.push(item); 1951 } 1952 } else { 1953 const record = item; 1954 if (!record[key]) 1955 continue; 1956 if (!isNaN(+record[key])) { 1957 if (record[key] === v2) { 1958 result.push(item); 1959 } 1960 } else { 1961 if (record[key]?.toString().toLowerCase().includes(v2.toLowerCase())) { 1962 result.push(item); 1963 } 1964 } 1965 } 1966 } 1967 } 1968 } 1969 return result.slice(offset, offset + limit); 1970 } 1971 /** 1972 * firstCallDone is a function that returns a promise that is resolved when the first call to the API is done for each serviceURL whatever api instance is used 1973 */ 1974 firstCallDone() { 1975 return new Promise((resolve) => { 1976 if (!API.firstCallDoneFlags.has(this.serviceURL)) { 1977 API.firstCallDoneFlags.set(this.serviceURL, "loading"); 1978 resolve(true); 1979 } else { 1980 const loop = () => { 1981 if (![void 0, "loading"].includes(API.firstCallDoneFlags.get(this.serviceURL))) { 1982 resolve(true); 1983 } else { 1984 window.requestAnimationFrame(loop); 1985 } 1986 }; 1987 loop(); 1988 } 1989 }); 1990 } 1991 async get(path, additionalHeaders) { 1992 await this.firstCallDone(); 1993 if (this.blockUntilDone) { 1994 API.firstCallDoneFlags.set(this.serviceURL, "loading"); 1995 } 1996 const regExp = /dataProvider\((.*?)\)(.*?)$/; 1997 if (regExp.test(path)) { 1998 const match = path.match(regExp); 1999 if (!match) 2000 throw new Error("dataProvider path is not valid"); 2001 return await this.localGet(match[1], match[2]); 2002 } 2003 const lastCall = { 2004 apiMethod: "get", 2005 path, 2006 additionalHeaders 2007 }; 2008 const headers = await this.createHeaders(additionalHeaders); 2009 const url = this.computeURL(path); 2010 const mapKey = JSON.stringify({ 2011 url, 2012 headers 2013 }); 2014 if (!API.loadingGetPromises.has(mapKey)) { 2015 const promise = new Promise(async (resolve) => { 2016 try { 2017 const result2 = await fetch(url, { 2018 headers, 2019 credentials: this.credentials, 2020 cache: this.cache, 2021 keepalive: this.keepAlive 2022 }); 2023 const handledResult = await this.handleResult(result2, lastCall); 2024 resolve(handledResult); 2025 } catch (e2) { 2026 resolve(null); 2027 } 2028 }); 2029 API.loadingGetPromises.set(mapKey, promise); 2030 } 2031 const result = await API.loadingGetPromises.get(mapKey); 2032 API.loadingGetPromises.delete(mapKey); 2033 return result; 2034 } 2035 /** 2036 * Sâappuie sur `get()` puis reformate la réponse : `Request` équivalent à lâappel, 2037 * `Response` renseignée par `lastResult` après un GET HTTP (via `handleResult`),
2038 * `result` = corps métier typé `T` (sans `_sonic_http_response_` à la racine). 2039 * Pour `dataProvider(...)`, pas de `response` (pas de fetch). 2040 */ 2041 async getDetailed(path, additionalHeaders) { 2042 const isDataProvider = /dataProvider\((.*?)\)(.*?)$/.test(path); 2043 const processed = await this.get(path, additionalHeaders); 2044 if (processed == null) { 2045 return void 0; 2046 } 2047 const result = extractTypedApiResult(processed); 2048 const url = this.computeURL(path); 2049 if (isDataProvider) { 2050 return { 2051 request: new Request(url, { method: "GET" }), 2052 result 2053 }; 2054 } 2055 const headers = await this.createHeaders(additionalHeaders); 2056 const request = new Request(url, { 2057 method: "GET", 2058 headers: new Headers(headers), 2059 credentials: this.credentials, 2060 cache: this.cache, 2061 keepalive: this.keepAlive 2062 }); 2063 return { 2064 request, 2065 response: this.lastResult, 2066 result 2067 }; 2068 } 2069 /** 2070 * Sâappuie sur `post()` puis reformate la réponse : `Request` avec body JSON, 2071 * `Response` via `lastResult`, `result` typé `T`. 2072 */ 2073 async sendDetailed(path, body, method, additionalHeaders) { 2074 const processed = await this.send(path, body, method, additionalHeaders); 2075 if (processed == null) { 2076 return void 0; 2077 } 2078 const result = extractTypedApiResult(processed); 2079 const url = this.computeURL(path); 2080 const headers = await this.createHeaders({ 2081 Accept: "application/json", 2082 "Content-Type": "application/json", 2083 ...additionalHeaders 2084 }); 2085 const request = new Request(url, { 2086 method, 2087 headers: new Headers(headers), 2088 credentials: this.credentials, 2089 body: JSON.stringify(body), 2090 keepalive: this.keepAlive 2091 }); 2092 return { 2093 request, 2094 response: this.lastResult, 2095 result 2096 }; 2097 } 2098 async postDetailed(path, body, additionalHeaders) { 2099 return this.sendDetailed(path, body, "POST", additionalHeaders); 2100 } 2101 async putDetailed(path, body, additionalHeaders) { 2102 return this.sendDetailed(path, body, "PUT", additionalHeaders); 2103 } 2104 async patchDetailed(path, body, additionalHeaders) { 2105 return this.sendDetailed(path, body, "PATCH", additionalHeaders); 2106 } 2107 /** 2108 * Création du header, avec authentification si besoin 2109 * ajout du language via le header accept-language qui contient le langue du navigateur 2110 */ 2111 async createHeaders(additionalHeaders) { 2112 await this.auth(); 2113 const headers = {}; 2114 if (this.token) 2115 headers.Authorization = "Bearer " + this.token; 2116 headers["Accept-Language"] = HTML$1.getLanguage(); 2117 if (additionalHeaders) { 2118 Object.assign(headers, additionalHeaders); 2119 } 2120 return headers; 2121 } 2122 /** 2123 * Concatène le serviceURL et le endpoint donné en paramètre 2124 */ 2125 computeURL(path, query = {}) { 2126 let url = ""; 2127 if (path.startsWith("http")) 2128 url = path; 2129 else 2130 url = this.serviceURL + "/" + path; 2131 if (!url.startsWith("http")) 2132 url = window.location.origin + url; 2133 const computedUrl = new URL(url); 2134 for (const key in query) { 2135 computedUrl.searchParams.set(key, query[key]); 2136 } 2137 return computedUrl.toString().replace(/([^(https?:)])\/{2,}/g, "$1/"); 2138 } 2139 /* 2140 * Envoie des données au endPoint passé en paramètre. par défaut en POST 2141 */ 2142 async send(path, data, method = "POST", additionalHeaders) { 2143 const lastCall = { 2144 apiMethod: "send", 2145 path, 2146 additionalHeaders, 2147 method, 2148 data 2149 }; 2150 const headers = await this.createHeaders(additionalHeaders); 2151 headers["Accept"] = "application/json"; 2152 headers["Content-Type"] = "application/json"; 2153 const result = await fetch(this.computeURL(path), { 2154 headers, 2155 credentials: this.credentials, 2156 method, 2157 body: JSON.stringify(data), 2158 keepalive: this.keepAlive 2159 }); 2160 return await this.handleResult(result, lastCall); 2161 } 2162 /** 2163 * Agit comme une soumission de formulaire, mais attends un json en réponse 2164 */ 2165 async submitFormData(path, data, method = "POST", additionalHeaders) { 2166 const lastCall = { 2167 apiMethod: "submitFormData", 2168 path, 2169 additionalHeaders, 2170 method, 2171 data 2172 }; 2173 const headers = await this.createHeaders(additionalHeaders); 2174 headers["Accept"] = "application/json"; 2175 const formData = new FormData(); 2176 const dynamicData = data; 2177 for (const z2 in dynamicData) 2178 formData.set(z2, dynamicData[z2]); 2179 const result = await fetch(this.computeURL(path), { 2180 headers, 2181 credentials: this.credentials, 2182 method, 2183 body: formData, 2184 keepalive: this.keepAlive 2185 }); 2186 return await this.handleResult(result, lastCall); 2187 } 2188 /** 2189 * Appel send en utilisant le méthode PUT 2190 */ 2191 async put(path, data, additionalHeaders) { 2192 return this.send(path, data, "PUT", additionalHeaders); 2193 } 2194 /** 2195 * Appel send en utilisant le méthode POST 2196 */ 2197 async post(path, data, additionalHeaders) { 2198 return this.send(path, data, "POST", additionalHeaders); 2199 } 2200 /** 2201 * Appel send en utilisant le méthode PATCH 2202 */ 2203 async patch(path, data, additionalHeaders) { 2204 return this.send(path, data, "PATCH", additionalHeaders); 2205 } 2206 /** 2207 * Appel send en utilisant le méthode delete 2208 */ 2209 async delete(path, data, additionalHeaders) { 2210 return this.send(path, data, "delete", additionalHeaders); 2211 } 2212 } 2213 API.loadingGetPromises = /* @__PURE__ */ new Map(); 2214 API.tokens = /* @__PURE__ */ new Map(); 2215 API.invalidTokens = []; 2216 API.failledTokenUpdates = /* @__PURE__ */ new Map(); 2217 API.firstCallDoneFlags = /* @__PURE__ */ new Map(); 2218 let logIsConf = false;
2219 let logEndPoint = "log"; 2220 let logConfiguration = HTML$1.getApiConfiguration(document.body || document.documentElement); 2221 let logsToSend = []; 2222 let logsSendId = 0; 2223 const log = async (message, variables) => { 2224 if (!logIsConf) { 2225 return; 2226 } 2227 logsToSend.push({ 2228 message, 2229 variables: variables ? variables : {} 2230 }); 2231 logsSendId++; 2232 const id = logsSendId; 2233 window.queueMicrotask(() => { 2234 if (id !== logsSendId) 2235 return; 2236 const sendedLogs = [...logsToSend]; 2237 logsToSend = []; 2238 const api2 = new API(logConfiguration); 2239 return api2.post(logEndPoint, { logs: sendedLogs }); 2240 }); 2241 }; 2242 let errorCount = 0; 2243 const configLog = (newConfig, endPoint = "log") => { 2244 logEndPoint = endPoint; 2245 logConfiguration = newConfig; 2246 logIsConf = true; 2247 window.addEventListener("error", (event) => { 2248 if (errorCount > 3) 2249 return; 2250 errorCount++; 2251 let href = ""; 2252 try { 2253 href = window.location.href; 2254 } catch (e2) { 2255 href = "unknown"; 2256 } 2257 const errorDetails = { 2258 eventType: "error", 2259 page: href, 2260 filename: event.filename || "unknown", 2261 lineno: event.lineno || null, 2262 colno: event.colno || null, 2263 stack: event.error?.stack || "Stack not available", 2264 isCrossOrigin: event.message === "Script error." 2265 }; 2266 log(event.message || "Script error.", errorDetails); 2267 return false; 2268 }); 2269 window.addEventListener("unhandledrejection", (event) => { 2270 if (errorCount > 3) 2271 return; 2272 errorCount++; 2273 let href = ""; 2274 try { 2275 href = window.location.href; 2276 } catch (e2) { 2277 href = "unknown"; 2278 } 2279 const errorDetails = { 2280 eventType: "unhandledrejection", 2281 page: href, 2282 code: event.reason?.code || "none", 2283 stack: event.reason?.stack || "Stack not available", 2284 timestamp: (/* @__PURE__ */ new Date()).toISOString() 2285 }; 2286 log(event.reason?.message || "Unknown rejection reason.", errorDetails); 2287 }); 2288 }; 2289 let Format$1 = class Format { 2290 /** 2291 * Passe le premier caractère de la chaine en majuscule 2292 */ 2293 static ucFirst(str) { 2294 if (typeof str != "string") 2295 return str; 2296 return str.charAt(0).toUpperCase() + str.substring(1); 2297 } 2298 static minutesDuration(minutes, locale = "", unitDisplay = "long") { 2299 if (!locale) 2300 locale = HTML$1.getLanguage(); 2301 const divMod = (n2, m2) => [Math.floor(n2 / m2), n2 % m2]; 2302 function timeUnitFormatter(locale2, unit, unitDisplay2) { 2303 return new Intl.NumberFormat(locale2, { style: "unit", unit, unitDisplay: unitDisplay2 }).format; 2304 } 2305 const [hrs, mins] = divMod(minutes, 60); 2306 const list = []; 2307 if (hrs) 2308 list.push(timeUnitFormatter(locale, "hour", unitDisplay)(hrs)); 2309 if (mins) 2310 list.push(timeUnitFormatter(locale, "minute", unitDisplay)(mins)); 2311 return new Intl.ListFormat(locale, { 2312 style: "long", 2313 type: "conjunction" 2314 }).format(list); 2315 } 2316 /** 2317 * Retourne le résultat de l'évaluation de la chaine fournie 2318 */ 2319 static js(value) { 2320 try { 2321 return Function("return " + value)(); 2322 } catch (e2) { 2323 return ""; 2324 } 2325 } 2326 }; 2327 let DataBindObserver$1 = class DataBindObserver2 { 2328 static disable() { 2329 if (!this.enabled) 2330 return; 2331 this.enabled = false; 2332 Array.from(DataBindObserver2.observedElements.keys()).forEach((k2) => DataBindObserver2.unObserve(k2)); 2333 } 2334 static observe(element) { 2335 if (!element) 2336 return; 2337 if (!DataBindObserver2.enabled) 2338 return; 2339 if (DataBindObserver2.observedElements.has(element)) 2340 return; 2341 const obs = new MutationObserver(DataBindObserver2.onMutation); 2342 const opt = {}; 2343 opt.childList = true; 2344 opt.subtree = true; 2345 opt.attributes = true; 2346 opt.attributeFilter = ["data-bind"]; 2347 obs.observe(element, opt); 2348 element.querySelectorAll("[data-bind]").forEach((e2) => DataBindObserver2.addPublisherListeners(e2)); 2349 DataBindObserver2.observedElements.set(element, obs); 2350 } 2351 /** 2352 * Arrêter à observer un élément html. 2353 */ 2354 static unObserve(element) { 2355 if (!element) 2356 return; 2357 const observer = this.observedElements.get(element); 2358 if (!observer) 2359 return; 2360 observer.disconnect(); 2361 element.querySelectorAll("[data-bind]").forEach((e2) => DataBindObserver2.removePublisherListeners(e2)); 2362 } 2363 static onAdded(elt) { 2364 if (elt.hasAttribute && elt.hasAttribute("data-bind")) 2365 DataBindObserver2.addPublisherListeners(elt); 2366 if (elt.querySelectorAll) 2367 elt.querySelectorAll("[data-bind]").forEach((e2) => DataBindObserver2.addPublisherListeners(e2)); 2368 else
2369 elt.childNodes.forEach((elt2) => DataBindObserver2.onAdded(elt2)); 2370 } 2371 static onRemoved(elt) { 2372 if (elt.hasAttribute && elt.hasAttribute("data-bind")) 2373 DataBindObserver2.removePublisherListeners(elt); 2374 if (elt.querySelectorAll) 2375 elt.querySelectorAll("[data-bind]").forEach((e2) => DataBindObserver2.removePublisherListeners(e2)); 2376 else 2377 elt.childNodes.forEach((elt2) => DataBindObserver2.onRemoved(elt2)); 2378 } 2379 /** 2380 * Callback appelé par le MutationObserver 2381 */ 2382 static onMutation(list) { 2383 for (const l2 of list) { 2384 switch (l2.type) { 2385 case "attributes": 2386 DataBindObserver2.addPublisherListeners(l2.target); 2387 break; 2388 case "childList": 2389 l2.addedNodes.forEach((elt) => { 2390 DataBindObserver2.onAdded(elt); 2391 }); 2392 l2.removedNodes.forEach((elt) => { 2393 DataBindObserver2.onRemoved(elt); 2394 }); 2395 break; 2396 } 2397 } 2398 } 2399 /** 2400 * La liaison avec le publisher supprimée ici. 2401 */ 2402 static removePublisherListeners(target) { 2403 const conf = DataBindObserver2.publisherListeners.get(target); 2404 if (!conf) 2405 return; 2406 DataBindObserver2.publisherListeners.delete(target); 2407 conf.forEach((currentConf) => { 2408 currentConf.publisher?.offAssign(currentConf.onAssign); 2409 }); 2410 } 2411 /** 2412 * 2413 * Cette fonction prend l'expression fournie et trouves toutes les occurences du type $.clef1.clef2.clef3 ou $a.b par exemple. 2414 * Les occurences sont ensuite mises dans un table de la forme [["clef1", "clef2", "clef3"],["a", "b"],...] 2415 * Note : si une clef contien un point, on peut l'échapper en écrivant par exemple "$a.b.c\.d\.e" pour cibler value dans {a:{b:{"c.d.e":value}}} 2416 * Propriétés du retour (du type BindedVariablesDescriptor) : 2417 * * expression : l'expression initiale sans les échappements 2418 * * variables : le tableau d'"adresses" de variables décrit ci-dessus 2419 */ 2420 static getVariablesDescriptor(expression) { 2421 let variables = expression.match(/(\$(?:\w+\\?\.?)+)/g); 2422 if (!variables) 2423 variables = [expression]; 2424 else 2425 variables = variables.map((v2) => v2.replace("$", "")); 2426 variables = variables.filter((v2) => v2.length > 0); 2427 return { 2428 expression: expression.replace("\\", ""), 2429 //TODO Supression des échappements uniquement suivis de "." 2430 variables: variables.map((v2) => v2.split(/\b\.\b/).map((e2) => e2.replace("\\", ""))) 2431 }; 2432 } 2433 /** 2434 * Extrait des "DataBindItems" a partir d'un élément html. 2435 * Pour chaque attribut dont le nom commence par ::, un dataBindItem est créé. 2436 * * Proriété "propertyToUpdate" du DataBindItem : 2437 * Le nom de l'attribut modifié en transformant La notation en hyphen ("-") en KamelCase. 2438 * un cas spécial est créé pour *-html qui retourne *HTML par exemple inner-html devient innerHTML 2439 * Cela représente la propriété à mettre à jour sur l'élément lors de la modification d'une des variables liées dans le publicheur. 2440 * * Propriété "bindedVariablesDescriptor" du DataBindItem : voir la fonction getVariablesDescriptor 2441 */ 2442 static getDataBindItems(element) { 2443 if (!("attributes" in element)) 2444 return []; 2445 return Array.from(element.attributes).filter((attribute) => attribute.name.indexOf("::") == 0).map((e2) => { 2446 const name = e2.name.substring(2); 2447 return { 2448 propertyToUpdate: name.replace(/-((html)|\w)/g, (match) => match.substring(1).toUpperCase()), 2449 bindedVariablesDescriptor: DataBindObserver2.getVariablesDescriptor(e2.value) 2450 }; 2451 }); 2452 } 2453 /** 2454 * Cette fonction récuperer le (sous) publisher a l'adresse donnée. 2455 * Si l'une des clef de l'adresse est _self_, on garde le publisher courant et on passe à la suite. 2456 * Ceci est un cas spécial, c'est pour ça qu'on utilisa pes Objects.traverse. 2457 * Il y a toujours un publisher quelque soit l'adresse ce qui permet de cibler des valeurs qui n'existent pas encore 2458 */ 2459 static getSubPublisher(pub, pathArray) { 2460 if (!pathArray) 2461 return pub; 2462 for (const key of pathArray) { 2463 if (key == "_self_") 2464 continue; 2465 if (!pub) 2466 return null; 2467 pub = pub[key]; 2468 } 2469 return pub; 2470 } 2471 /** 2472 * La liaison avec le publisher est faite ici. 2473 * TODO Sans doute factoriser 2474 */ 2475 static addPublisherListeners(target) { 2476 DataBindObserver2.removePublisherListeners(target); 2477 const dataProviderId = HTML$1.getAncestorAttributeValue(target.parentNode || target.host || target, "dataProvider"); 2478 if (!dataProviderId) 2479 return; 2480 const publisher = PublisherManager.getInstance().get(dataProviderId); 2481 const dataBindItems = DataBindObserver2.getDataBindItems(target); 2482 const conf = [];
2483 dataBindItems.forEach((dataBindItem) => { 2484 const bindedVariablesDescriptor = dataBindItem.bindedVariablesDescriptor; 2485 const propertyToUpdate = dataBindItem.propertyToUpdate; 2486 for (const value of bindedVariablesDescriptor.variables) { 2487 const publisherPathArray = value; 2488 let pub = publisher; 2489 pub = DataBindObserver2.getSubPublisher(publisher, publisherPathArray); 2490 const rec = target; 2491 const currentConf = { 2492 publisher: pub, 2493 onAssign: () => { 2494 const values = bindedVariablesDescriptor.variables.map((dataPath) => { 2495 return DataBindObserver2.getSubPublisher(publisher, dataPath)?.get(); 2496 }); 2497 let expression = bindedVariablesDescriptor.expression; 2498 let hasUndeterminatedValue = false; 2499 if (values.length == 1 && bindedVariablesDescriptor.variables[0].join(".") == expression.substring(1)) { 2500 let value2 = values[0]; 2501 if (value2 === null) { 2502 value2 = ""; 2503 } 2504 rec[propertyToUpdate] = value2; 2505 return; 2506 } 2507 for (let i2 = 0; i2 < values.length; i2++) { 2508 let value2 = values[i2]; 2509 const variable = bindedVariablesDescriptor.variables[i2]; 2510 if (value2 === null) { 2511 hasUndeterminatedValue = true; 2512 value2 = void 0; 2513 } 2514 expression = expression.replace("$" + variable.join("."), value2); 2515 } 2516 if (expression.indexOf("|") != -1) { 2517 const funcDelimiterIdx = expression.indexOf("|"); 2518 if (funcDelimiterIdx == 0) { 2519 expression = Format$1.js(expression.substring(1)); 2520 } else { 2521 const funcName = expression.substring(0, funcDelimiterIdx); 2522 const funcArgs = expression.substring(funcDelimiterIdx + 1); 2523 const fmtFunc = Format$1[funcName]; 2524 expression = hasUndeterminatedValue ? "" : fmtFunc ? fmtFunc(funcArgs) : expression; 2525 } 2526 } else { 2527 expression = hasUndeterminatedValue ? "" : expression; 2528 } 2529 rec[propertyToUpdate] = expression; 2530 } 2531 }; 2532 pub?.onAssign(currentConf.onAssign); 2533 conf.push(currentConf); 2534 } 2535 }); 2536 DataBindObserver2.publisherListeners.set(target, conf); 2537 } 2538 }; 2539 DataBindObserver$1.observedElements = /* @__PURE__ */ new Map(); 2540 DataBindObserver$1.enabled = true; 2541 DataBindObserver$1.publisherListeners = /* @__PURE__ */ new Map(); 2542 DataBindObserver$1.observe(document.documentElement); 2543 if (!window.SonicDataBindObserver) 2544 window.SonicDataBindObserver = DataBindObserver$1; 2545 const { I: t$2 }
2545 = j$2, i$5 = (o2) => o2, l = (o2, t2) => void 0 !== o2?._$litType$, d$1 = (o2) => null != o2?._$litType$?.h, r$3 = (o2) => void 0 === o2.strings, s$4 = () => document.createComment(""), v$1 = (o2, n2, e2) => { 2546 const l2 = o2._$AA.parentNode, d2 = void 0 === n2 ? o2._$AB : n2._$AA; 2547 if (void 0 === e2) { 2548 const i2 = l2.insertBefore(s$4(), d2), n3 = l2.insertBefore(s$4(), d2); 2549 e2 = new t$2(i2, n3, o2, o2.options); 2550 } else { 2551 const t2 = e2._$AB.nextSibling, n3 = e2._$AM, c2 = n3 !== o2; 2552 if (c2) { 2553 let t3; 2554 e2._$AQ?.(o2), e2._$AM = o2, void 0 !== e2._$AP && (t3 = o2._$AU) !== n3._$AU && e2._$AP(t3); 2555 } 2556 if (t2 !== d2 || c2) { 2557 let o3 = e2._$AA; 2558 for (; o3 !== t2; ) { 2559 const t3 = i$5(o3).nextSibling; 2560 i$5(l2).insertBefore(o3, d2), o3 = t3; 2561 } 2562 } 2563 } 2564 return e2; 2565 }, u$1 = (o2, t2, i2 = o2) => (o2._$AI(t2, i2), o2), m = {}, p = (o2, t2 = m) => o2._$AH = t2, M = (o2) => o2._$AH, h$3 = (o2) => { 2566 o2._$AR(), o2._$AA.remove(); 2567 }, j$1 = (o2) => { 2568 o2._$AR(); 2569 }; 2570 const t$1 = { ATTRIBUTE: 1, CHILD: 2 }, e$5 = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 }); 2571 let i$4 = class i { 2572 constructor(t2) { 2573 } 2574 get _$AU() { 2575 return this._$AM._$AU; 2576 } 2577 _$AT(t2, e2, i2) { 2578 this._$Ct = t2, this._$AM = e2, this._$Ci = i2; 2579 } 2580 _$AS(t2, e2) { 2581 return this.update(t2, e2); 2582 } 2583 update(t2, e2) { 2584 return this.render(...e2); 2585 } 2586 }; 2587 const s$3 = (i2, t2) => { 2588 const e2 = i2._$AN; 2589 if (void 0 === e2) return false; 2590 for (const i3 of e2) i3._$AO?.(t2, false), s$3(i3, t2); 2591 return true; 2592 }, o$7 = (i2) => { 2593 let t2, e2; 2594 do { 2595 if (void 0 === (t2 = i2._$AM)) break; 2596 e2 = t2._$AN, e2.delete(i2), i2 = t2; 2597 } while (0 === e2?.size); 2598 }, r$2 = (i2) => { 2599 for (let t2; t2 = i2._$AM; i2 = t2) { 2600 let e2 = t2._$AN; 2601 if (void 0 === e2) t2._$AN = e2 = /* @__PURE__ */ new Set(); 2602 else if (e2.has(i2)) break; 2603 e2.add(i2), c$2(t2); 2604 } 2605 }; 2606 function h$2(i2) { 2607 void 0 !== this._$AN ? (o$7(this), this._$AM = i2, r$2(this)) : this._$AM = i2; 2608 } 2609 function n$3(i2, t2 = false, e2 = 0) { 2610 const r2 = this._$AH, h2 = this._$AN; 2611 if (void 0 !== h2 && 0 !== h2.size) if (t2) if (Array.isArray(r2)) for (let i3 = e2; i3 < r2.length; i3++) s$3(r2[i3], false), o$7(r2[i3]); 2612 else null != r2 && (s$3(r2, false), o$7(r2)); 2613 else s$3(this, i2); 2614 } 2615 const c$2 = (i2) => { 2616 i2.type == t$1.CHILD && (i2._$AP ??= n$3, i2._$AQ ??= h$2); 2617 }; 2618 let f$1 = class f extends i$4 { 2619 constructor() { 2620 super(...arguments), this._$AN = void 0; 2621 } 2622 _$AT(i2, t2, e2) { 2623 super._$AT(i2, t2, e2), r$2(this), this.isConnected = i2._$AU; 2624 } 2625 _$AO(i2, t2 = true) { 2626 i2 !== this.isConnected && (this.isConnected = i2, i2 ? this.reconnected?.() : this.disconnected?.()), t2 && (s$3(this, i2), o$7(this)); 2627 } 2628 setValue(t2) { 2629 if (r$3(this._$Ct)) this._$Ct._$AI(t2, this); 2630 else { 2631 const i2 = [...this._$Ct._$AH]; 2632 i2[this._$Ci] = t2, this._$Ct._$AI(i2, this, 0); 2633 } 2634 } 2635 disconnected() { 2636 } 2637 reconnected() { 2638 } 2639 }; 2640 let e$4 = class e extends i$4 { 2641 constructor(i2) { 2642 if (super(i2), this.it = A$1, i2.type !== t$1.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings"); 2643 } 2644 render(r2) { 2645 if (r2 === A$1 || null == r2) return this._t = void 0, this.it = r2; 2646 if (r2 === E) return r2; 2647 if ("string" != typeof r2) throw Error(this.constructor.directiveName + "() called with a non-string value"); 2648 if (r2 === this.it) return this._t; 2649 this.it = r2; 2650 const s2 = [r2]; 2651 return s2.raw = s2, this._t = { _$litType$: this.constructor.resultType, strings: s2, values: [] }; 2652 } 2653 }; 2654 e$4.directiveName = "unsafeHTML", e$4.resultType = 1; 2655 const o$6 = e$5(e$4); 2656 const apiCalls = /* @__PURE__ */ new Map(); 2657 const getApiCall = (node) => { 2658 if (!node) 2659 return null; 2660 const configuration = HTML$1.getApiConfiguration(node); 2661 const wordingProvider = HTML$1.getAncestorAttributeValue(node, "w
2661ordingProvider"); 2662 const wordingVersionProvider = HTML$1.getAncestorAttributeValue(node, "wordingVersionProvider"); 2663 const searchedKey = { 2664 apiConfiguration: configuration, 2665 wordingProvider, 2666 wordingVersionProvider 2667 }; 2668 let apiCall = null; 2669 for (const [key, value] of apiCalls) { 2670 if (Objects$1.deepEqual(key, searchedKey)) { 2671 apiCall = value; 2672 break; 2673 } 2674 } 2675 if (!apiCall) { 2676 const api2 = new API(configuration); 2677 apiCall = { 2678 api: api2, 2679 keysToTranslate: /* @__PURE__ */ new Set(), 2680 translatedKeys: /* @__PURE__ */ new Set(), 2681 wordingProvider, 2682 callIndex: 0, 2683 wordingVersionProvider, 2684 apiCallKey: searchedKey 2685 }; 2686 apiCalls.set(searchedKey, apiCall); 2687 } 2688 return apiCall; 2689 }; 2690 const loadingString = ""; 2691 const isWordingReady = (key) => { 2692 const value = WordingDirective.publisher["wording_" + key].get(); 2693 return value !== loadingString && value != null; 2694 }; 2695 class WordingDirective extends f$1 { 2696 unsubscribe() { 2697 WordingDirective.publisher["wording_" + this.key].offAssign(this.onAssign); 2698 } 2699 /* eslint-disable @typescript-eslint/no-explicit-any*/ 2700 constructor(partInfo) { 2701 super(partInfo); 2702 this.useUnsafeHTML = false; 2703 this.onAssign = (v2) => { 2704 const value = this.useUnsafeHTML ? o$6(v2) : v2; 2705 this.setValue(value); 2706 }; 2707 this.node = partInfo.options.host; 2708 } 2709 /* eslint-enable @typescript-eslint/no-explicit-any*/ 2710 render(key, useUnsafeHTML = false) { 2711 this.useUnsafeHTML = useUnsafeHTML; 2712 if (this.key !== key) { 2713 this.key = key; 2714 if (this.isConnected) { 2715 this.subscribe(key); 2716 } 2717 } 2718 return E; 2719 } 2720 static async callApi(node, key, relaunch = true, usedApiCall) { 2721 await PublisherManager.getInstance().isLocalStrorageReady; 2722 if (WordingDirective.firstCall) { 2723 WordingDirective.firstCall = false; 2724 detecHTMLLanguageChange(WordingDirective.reloadWordings); 2725 const keys2 = Object.keys(WordingDirective.publisher.get()); 2726 for (const key2 of keys2) { 2727 if (WordingDirective.publisher.get()[key2] === loadingString) { 2728 delete WordingDirective.publisher[key2]; 2729 } 2730 } 2731 } 2732 if (node) { 2733 const wordingVersionProvider = HTML$1.getAncestorAttributeValue(node, "wordingVersionProvider"); 2734 if (wordingVersionProvider) { 2735 dp$1(wordingVersionProvider).onAssign(WordingDirective.handleVersionProvider(node)); 2736 } 2737 } 2738 let hasWordingForKey = WordingDirective.publisher.get()["wording_" + key] != null; 2739 const apiCall = usedApiCall || getApiCall(node); 2740 if (!apiCall) 2741 return; 2742 if (hasWordingForKey && key !== "") { 2743 apiCall.translatedKeys.add(key); 2744 return; 2745 } 2746 apiCall.callIndex++; 2747 const callIndex = apiCall.callIndex; 2748 const wordingProvider = apiCall.wordingProvider ?? ""; 2749 if (!wordingProvider && relaunch) { 2750 window.setTimeout(async () => { 2751 WordingDirective.callApi(null, key, false, apiCall); 2752 }, 1e3); 2753 return; 2754 } 2755 const api2 = apiCall.api; 2756 window.queueMicrotask(async () => { 2757 hasWordingForKey = WordingDirective.publisher["wording_" + key].get() != null; 2758 if (!hasWordingForKey && key !== "") { 2759 apiCall.keysToTranslate.add(key); 2760 WordingDirective.publisher["wording_" + key].set(loadingString); 2761 } 2762 if (callIndex !== apiCall.callIndex) 2763 return; 2764 const wordings = Array.from(apiCall.keysToTranslate); 2765 if (!wordings.length) 2766 return; 2767 const splittedUrl = wordingProvider.split("?"); 2768 const locationURL = splittedUrl.shift(); 2769 const queryString = (splittedUrl.length > 0 ? splittedUrl.join("?") + "&" : "") + "labels[]=" + wordings.join("&labels[]="); 2770 const calledURL = locationURL + "?" + queryString; 2771 apiCall.translatedKeys = /* @__PURE__ */ new Set([ 2772 ...apiCall.translatedKeys, 2773 ...apiCall.keysToTranslate 2774 ]); 2775 apiCall.keysToTranslate.clear(); 2776 const result = await api2.get(calledURL); 2777 for (const key2 in result) { 2778 WordingDirective.publisher["wording_" + key2].set(result[key2]); 2779 } 2780 }); 2781 } 2782 static reloadWordings() { 2783 for (const apiCall of apiCalls.values()) { 2784 apiCall.keysToTranslate = new Set(apiCall.translatedKeys); 2785 if (apiCall.keysToTranslate.size > 0) { 2786 WordingDirective.callApi(null, "", false, apiCall); 2787 } 2788 } 2789 } 2790 //check if the wording version has changed 2791 static handleVersionProvider(node) { 2792 const apiCall = getApiCall(node); 2793 const defaultReturn = (_v) => { 2794 }; 2795 if (!apiCall) 2796 return defaultReturn; 2797 if (WordingDirective.versionProviderHandlers.has(apiCall)) { 2798 return WordingDirective.versionProviderHandlers.get(apiCall) || defaultReturn; 2799 } 2800 const versionProviderHandler = function(version2) { 2801 const wordingVersionProvider = apiCall.wordingVersionProvider; 2802 if (!wordingVersionProvider) 2803 return; 2804 const currentVersions = WordingDirective.publisher.get().__wording_versions__ ?? []; 2805 if (version2 == null) 2806 return; 2807 const currentVersionData = currentVersions.find((v2) => v2.serviceURL === apiCall.api.serviceURL) || { 2808 serviceURL: apiCall.api.serviceURL, 2809 version: 0 2810 }; 2811 if (!currentVersions.includes(currentVersionData)) 2812 currentVersions.push(currentVersionData); 2813 if (version2 === currentVersionData.version) { 2814 return; 2815 } 2816 currentVersionData.version = version2; 2817 WordingDirective.publisher.set({ __wording_versions__: currentVersions }); 2818 WordingDirective.reloadWordings(); 2819 }; 2820 WordingDirective.versionProviderHandlers.set(apiCall, versionProviderHandler); 2821 return versionProviderHandler; 2822 } 2823 // Subscribes to the key, calling the directive's asynchronous 2824 // setValue API each time the value changes 2825 subscribe(key) { 2826 this.unsubscribe(); 2827 WordingDirective.publisher["wording_" + key].onAssign(this.onAssign); 2828 WordingDirective.callApi(this.node, key); 2829 } 2830 // When the directive is disconnected from the DOM, unsubscribe to ensure 2831 // the directive instance can be garbage collected 2832 disconnected() { 2833 this.unsubscribe(); 2834 } 2835 // If the subtree the directive is in was disconnected and subsequently 2836 // re-connected, re-subscribe to make the directive operable again 2837 reconnected() { 2838 if (!this.key) 2839 return; 2840 this.subscribe(this.key); 2841 } 2842 } 2843 WordingDirective.publisher = PublisherManager.get("sonic-wording", { 2844 localStorageMode: "enabled" 2845 }); 2846 WordingDirective.firstCall = true; 2847 WordingDirective.versionProviderHandlers = /* @__PURE__ */ new Map(); 2848 const wording = e$5(WordingDirective); 2849 const unsafeWording = (key) => wording(key, true); 2850 const t = wording; 2851 var __decorate$_ = function(decorators, target, key, desc) { 2852 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 2853 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 2854 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 2855 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 2856 }; 2857 let keepDebugOnMouseOut = false;
2858 let debugs = /* @__PURE__ */ new Set(); 2859 const Subscriber$1 = (superClass, type) => { 2860 class SubscriberElement extends superClass { 2861 constructor(...args) { 2862 super(); 2863 this.collectDependenciesVersion = 0; 2864 this.displayContents = false; 2865 this.noAutoFill = false; 2866 this.forceAutoFill = false; 2867 this.renderOnPropsInternalChange = false; 2868 this.noShadowDom = null; 2869 this.propertyMap = null; 2870 this.title = ""; 2871 this.dataProvider = null; 2872 this.bindPublisher = null; 2873 this._props = null; 2874 this.shouldRenderLazy = true; 2875 this.defferedDebug = null; 2876 this.debug = null; 2877 this.onAssign = (v2) => { 2878 this.props = v2; 2879 }; 2880 } 2881 /** 2882 * va de parent en parent pour trouver un attribut 2883 * @param attributeName nom de l'attribut 2884 * @returns true si l'attribut est trouvé 2885 */ 2886 hasAncestorAttribute(attributeName) { 2887 return this.getAncestorAttributeValue(attributeName) != null; 2888 } 2889 /** 2890 * Va de parent en parent pour trouver un attribut 2891 * @param attributeName nom de l'attribut 2892 * @returns valeur de l'attribut ou null si l'attribut n'est pas trouvé 2893 */ 2894 getAncestorAttributeValue(attributeName) { 2895 return HTML$1.getAncestorAttributeValue(this, attributeName); 2896 } 2897 get props() { 2898 if (this._props !== null || !this.publisher) 2899 return this._props; 2900 return this.publisher.get(); 2901 } 2902 set props(value) { 2903 if (typeof value == "string" && ["{", "["].includes(value.trim().charAt(0))) { 2904 value = JSON.parse(value); 2905 } 2906 if (value == this._props) 2907 return; 2908 this._props = value; 2909 if (this.publisher && this.publisher.get() != value) { 2910 this.publisher.set(value); 2911 } 2912 this.requestUpdate(); 2913 } 2914 updated(_changedProperties) { 2915 super.updated(_changedProperties); 2916 const ref = this.shadowRoot || this; 2917 const children = [...ref.children].filter((child) => child.tagName != "STYLE"); 2918 const display = this.displayContents ? "contents" : children.length == 0 ? "none" : null; 2919 if (display) 2920 this.style.display = display; 2921 else 2922 this.style.removeProperty("display"); 2923 } 2924 connectedCallback() { 2925 SubscriberElement.instanceCounter++; 2926 if (this.hasAttribute("lazyRendering")) { 2927 const options = { 2928 root: null, 2929 // rootMargin: Math.max(window.innerWidth, window.innerHeight) + "px", 2930 threshold: 0.9 2931 }; 2932 let firstView = true; 2933 const iObserver = new IntersectionObserver((entries) => { 2934 for (const e2 of entries) { 2935 if (firstView && e2.isIntersecting) { 2936 firstView = false; 2937 iObserver.disconnect(); 2938 this.initWording(); 2939 this.shouldRenderLazy = false; 2940 this.startPublisher(); 2941 break; 2942 } 2943 } 2944 }, options); 2945 iObserver.observe(this); 2946 } else { 2947 this.initWording(); 2948 this.shouldRenderLazy = false; 2949 } 2950 this.initPublisher(); 2951 this.addDebugger(); 2952 super.connectedCallback(); 2953 } 2954 disconnectedCallback() { 2955 this.removeDebugger(); 2956 super.disconnectedCallback(); 2957 if (this.publisher) { 2958 this.publisher.stopTemplateFilling(this); 2959 this.publisher.offInternalMutation(this.requestUpdate); 2960 } 2961 WordingDirective.publisher.stopTemplateFilling(this); 2962 if (this.onAssign) 2963 this.publisher?.offAssign(this.onAssign); 2964 } 2965 addDebugger() { 2966 if (this.hasAttribute("debug") && !this.defferedDebug) { 2967 if (!this.debug) { 2968 this.debug = document.createElement("div"); 2969 const style = this.debug.style; 2970 style.position = "fixed"; 2971 style.top = "0"; 2972 style.right = "0"; 2973 style.margin = "auto"; 2974 style.borderRadius = ".7rem"; 2975 style.backgroundColor = "#0f1729"; 2976 style.color = "#c5d4f9"; 2977 style.padding = "16px 16px"; 2978 style.margin = "16px 16px"; 2979 style.boxShadow = "0 10px 30px -18px rgba(0,0,0,.3)"; 2980 style.overflowY = "auto"; 2981 style.zIndex = "99999999"; 2982 style.maxHeight = "calc(100vh - 32px)"; 2983 style.fontFamily = "Consolas, monospace"; 2984 style.maxWidth = "min(50vw,25rem)"; 2985 style.fontSize = "12px"; 2986 style.minWidth = "300px"; 2987 style.overflowWrap = "break-word"; 2988 style.resize = "vertical"; 2989 } 2990 this.addEventListener("click", (e2) => { 2991 if (!e2.ctrlKey) 2992 return; 2993 e2.preventDefault(); 2994 keepDebugOnMouseOut = !keepDebugOnMouseOut; 2995 }); 2996 if (this.dataProvider) { 2997 window[this.dataProvider] = this.publisher; 2998 } 2999 this.addEventListener("mouseover", () => { 3000 if (!keepDebugOnMouseOut) 3001 this.removeDebugger(); 3002 document.body.appendChild(this.debug); 3003 debugs.add(this.debug); 3004 }); 3005 this.addEventListener("mouseout", () => { 3006 if (!keepDebugOnMouseOut) 3007 this.removeDebugger(); 3008 }); 3009 this.publisher?.onInternalMutation(() => { 3010 this.debug.innerHTML = `ð¤ DataProvider : "<b style="font-weight:bold;color:#fff;">${this.dataProvider}</b>"<br> 3011 <div style="font-size:10px;border-top:1px dashed;margin-top:5px;padding-left:23px;opacity:.6;padding-top:5px;"> 3012 Variable disponible dans la console<br> 3013 ctrl + Clique : épingler / désépingler 3014 </div> 3015 <pre style="margin-top:10px;background:transparent;padding:0;font-size:inherit;color:inherit;">${JSON.stringify(this.publisher?.get(), null, " ")}</pre>`; 3016 }); 3017 } 3018 } 3019 removeDebugger() {
3020 debugs.forEach((debug) => { 3021 if (document.body.contains(debug)) 3022 document.body.removeChild(debug); 3023 }); 3024 debugs = /* @__PURE__ */ new Set(); 3025 } 3026 /** 3027 * Petite fonction utilitaire pour retourner la configuration a passer à l'utilitaire API 3028 * Utilisée pour la configuration du wording / de la traduction ainsi que par le mixin fetcher par exemple 3029 * A voir si on le bouge dans un utilitaire 3030 */ 3031 getApiConfiguration() { 3032 return HTML$1.getApiConfiguration(this); 3033 } 3034 /** 3035 * Initialise le remplisage automatique des traductions / du wording 3036 * Un publisher spécifique est créé pour le composant à l'adresse "sonic-wording" 3037 * Le composant recherche la valeur de l'attribute "wordingProvider" que contient le point d'accès à l'api de traduction / libellés 3038 * Il utilise ce service et le publisher créé pour remplir automatiquement toutes les propriétés préfixées avec "wording_". 3039 */ 3040 async initWording() { 3041 const propNames = Object.getOwnPropertyNames(this.constructor.prototype); 3042 for (const p2 of propNames) { 3043 if (p2.indexOf("wording_") == 0) { 3044 WordingDirective.callApi(this, p2.substring(8)); 3045 } 3046 } 3047 WordingDirective.publisher.startTemplateFilling(this); 3048 } 3049 /** 3050 * 3051 * Fonction native de lit surchargée pour la gestion du mode noShadowDom 3052 * Le comportement de data binding est également créé ici va l'utilitaire DataBindObserver 3053 */ 3054 createRenderRoot() { 3055 if (this.noShadowDom === "" || this.getAttribute("noShadowDom") === "") { 3056 return this; 3057 } 3058 const shadowRoot = super.createRenderRoot(); 3059 DataBindObserver$1.observe(shadowRoot); 3060 return shadowRoot; 3061 } 3062 initPublisher() { 3063 if (!document) 3064 return; 3065 if (this.publisher) { 3066 this.publisher.stopTemplateFilling(this); 3067 this.publisher.offInternalMutation(this.requestUpdate); 3068 if (this.onAssign) 3069 this.publisher.offAssign(this.onAssign); 3070 } 3071 const mng = PublisherManager.getInstance(); 3072 if (!this.dataProvider) 3073 this.dataProvider = this.getAncestorAttributeValue("dataProvider"); 3074 let publisherId = this.dataProvider; 3075 if (!publisherId && this._props) { 3076 this.dataProvider = publisherId = "__subscriber__" + SubscriberElement.instanceCounter; 3077 } 3078 if (publisherId) { 3079 if (this.bindPublisher) { 3080 mng.set(publisherId, this.bindPublisher()); 3081 } 3082 let pub = mng.get(publisherId, { 3083 localStorageMode: this.getAttribute("localStorage") || "disabled", 3084 invalidateOnPageShow: this.hasAttribute("invalidateOnPageShow") 3085 }); 3086 this.dataProvider = publisherId; 3087 if (this.hasAttribute("subDataProvider")) { 3088 const dataPath = this.getAttribute("subDataProvider"); 3089 this.dataProvider = publisherId + "/" + dataPath; 3090 pub = Objects$1.traverse(pub, dataPath.split(".")); 3091 mng.set(this.dataProvider, pub); 3092 this.publisher = pub; 3093 } 3094 this.publisher = pub; 3095 } 3096 if (this.hasAttribute("lazyRendering")) { 3097 return; 3098 } else { 3099 this.startPublisher(); 3100 } 3101 } 3102 startPublisher() { 3103 if (this.publisher) { 3104 if (this._props) { 3105 this.publisher.set(this._props); 3106 } 3107 if (!this.noAutoFill) 3108 this.publisher.startTemplateFilling(this); 3109 if (this.renderOnPropsInternalChange) 3110 this.publisher.onInternalMutation(this.requestUpdate); 3111 this.publisher.onAssign(this.onAssign); 3112 } 3113 } 3114 } 3115 SubscriberElement.instanceCounter = 0; 3116 __decorate$_([ 3117 n$5({ type: Number }) 3118 ], SubscriberElement.prototype, "collectDependenciesVersion", void 0); 3119 __decorate$_([ 3120 n$5({ type: Boolean }) 3121 ], SubscriberElement.prototype, "displayContents", void 0); 3122 __decorate$_([ 3123 n$5({ type: Boolean }) 3124 ], SubscriberElement.prototype, "noAutoFill", void 0); 3125 __decorate$_([ 3126 n$5({ type: Boolean }) 3127 ], SubscriberElement.prototype, "forceAutoFill", void 0); 3128 __decorate$_([ 3129 n$5({ type: Object }) 3130 ], SubscriberElement.prototype, "propertyMap", void 0); 3131 __decorate$_([ 3132 n$5({ type: String, attribute: "data-title" }) 3133 ], SubscriberElement.prototype, "title", void 0); 3134 __decorate$_([ 3135 n$5({ reflect: true }) 3136 ], SubscriberElement.prototype, "dataProvider", void 0); 3137 __decorate$_([ 3138 n$5() 3139 ], SubscriberElement.prototype, "bindPublisher", void 0); 3140 __decorate$_([ 3141 n$5() 3142 ], SubscriberElement.prototype, "props", null); 3143 __decorate$_([ 3144 r$5() 3145 ], SubscriberElement.prototype, "shouldRenderLazy", void 0); 3146 return SubscriberElement; 3147 }; 3148 const u = (e2, s2, t2) => { 3149 const r2 = /* @__PURE__ */ new Map(); 3150 for (let l2 = s2; l2 <= t2; l2++) r2.set(e2[l2], l2); 3151 return r2; 3152 }, c$1 = e$5(class extends i$4 { 3153 constructor(e2) { 3154 if (super(e2), e2.type !== t$1.CHILD) throw Error("repeat() can only be used in text expressions"); 3155 } 3156 dt(e2, s2, t2) { 3157 let r2; 3158 void 0 === t2 ? t2 = s2 : void 0 !== s2 && (r2 = s2); 3159 const l2 = [], o2 = []; 3160 let i2 = 0; 3161 for (const s3 of e2) l2[i2] = r2 ? r2(s3, i2) : i2, o2[i2] = t2(s3, i2), i2++; 3162 return { values: o2, keys: l2 }; 3163 } 3164 render(e2, s2, t2) { 3165 return this.dt(e2, s2, t2).values; 3166 } 3167 update(s2, [t2, r2, c2]) { 3168 const d2 = M(s2), { values: p$12, keys: a2 } = this.dt(t2, r2, c2); 3169 if (!Array.isArray(d2)) return this.ut = a2, p$12; 3170 const h2 = this.ut ??= [], v2 = []; 3171 let m2, y2, x2 = 0, j2 = d2.length - 1, k2 = 0, w2 = p$12.length - 1; 3172 for (; x2 <= j2 && k2 <= w2; ) if (null === d2[x2]) x2++; 3173 else if (null === d2[j2]) j2--; 3174 else if (h2[x2] === a2[k2]) v2[k2] = u$1(d2[x2], p$12[k2]), x2++, k2++; 3175 else if (h2[j2] === a2[w2]) v2[w2] = u$1(d2[j2], p$12[w2]), j2--, w2--; 3176 else if (h2[x2] === a2[w2]) v2[w2] = u$1(d2[x2], p$12[w2]), v$1(s2, v2[w2 + 1], d2[x2]), x2
3176++, w2--; 3177 else if (h2[j2] === a2[k2]) v2[k2] = u$1(d2[j2], p$12[k2]), v$1(s2, d2[x2], d2[j2]), j2--, k2++; 3178 else if (void 0 === m2 && (m2 = u(a2, k2, w2), y2 = u(h2, x2, j2)), m2.has(h2[x2])) if (m2.has(h2[j2])) { 3179 const e2 = y2.get(a2[k2]), t3 = void 0 !== e2 ? d2[e2] : null; 3180 if (null === t3) { 3181 const e3 = v$1(s2, d2[x2]); 3182 u$1(e3, p$12[k2]), v2[k2] = e3; 3183 } else v2[k2] = u$1(t3, p$12[k2]), v$1(s2, d2[x2], t3), d2[e2] = null; 3184 k2++; 3185 } else h$3(d2[j2]), j2--; 3186 else h$3(d2[x2]), x2++; 3187 for (; k2 <= w2; ) { 3188 const e2 = v$1(s2, v2[w2 + 1]); 3189 u$1(e2, p$12[k2]), v2[k2++] = e2; 3190 } 3191 for (; x2 <= j2; ) { 3192 const e2 = d2[x2++]; 3193 null !== e2 && h$3(e2); 3194 } 3195 return this.ut = a2, p(s2, v2), E; 3196 } 3197 }); 3198 const i$3 = /* @__PURE__ */ new WeakMap(); 3199 let o$5 = 0; 3200 const r$1 = /* @__PURE__ */ new Map(), n$2 = /* @__PURE__ */ new WeakSet(), a = () => new Promise((t2) => requestAnimationFrame(t2)), f = [{ opacity: 0 }], v = [{ opacity: 0 }, { opacity: 1 }], g = (t2, i2) => { 3201 const s2 = t2 - i2; 3202 return 0 === s2 ? void 0 : s2; 3203 }, w = (t2, i2) => { 3204 const s2 = t2 / i2; 3205 return 1 === s2 ? void 0 : s2; 3206 }, N = { left: (t2, i2) => { 3207 const s2 = g(t2, i2); 3208 return { value: s2, transform: null == s2 || isNaN(s2) ? void 0 : `translateX(${s2}px)` }; 3209 }, top: (t2, i2) => { 3210 const s2 = g(t2, i2); 3211 return { value: s2, transform: null == s2 || isNaN(s2) ? void 0 : `translateY(${s2}px)` }; 3212 }, width: (t2, i2) => { 3213 let s2; 3214 0 === i2 && (i2 = 1, s2 = { width: "1px" }); 3215 const e2 = w(t2, i2); 3216 return { value: e2, overrideFrom: s2, transform: null == e2 || isNaN(e2) ? void 0 : `scaleX(${e2})` }; 3217 }, height: (t2, i2) => { 3218 let s2; 3219 0 === i2 && (i2 = 1, s2 = { height: "1px" }); 3220 const e2 = w(t2, i2); 3221 return { value: e2, overrideFrom: s2, transform: null == e2 || isNaN(e2) ? void 0 : `scaleY(${e2})` }; 3222 } }, A = { duration: 333, easing: "ease-in-out" }, b = ["left", "top", "width", "height", "opacity", "color", "background"], j = /* @__PURE__ */ new WeakMap(); 3223 class x extends f$1 { 3224 constructor(t2) { 3225 if (super(t2), this.t = false, this.i = null, this.o = null, this.h = true, this.shouldLog = false, t2.type === t$1.CHILD) throw Error("The `animate` directive must be used in attribute position."); 3226 this.createFinished(); 3227 } 3228 createFinished() { 3229 this.resolveFinished?.(), this.finished = new Promise((t2) => { 3230 this.l = t2; 3231 }); 3232 } 3233 async resolveFinished() { 3234 this.l?.(), this.l = void 0; 3235 } 3236 render(i2) { 3237 return A$1; 3238 } 3239 getController() { 3240 return i$3.get(this.u); 3241 } 3242 isDisabled() { 3243 return this.options.disabled || this.getController()?.disabled; 3244 } 3245 update(t2, [i2]) { 3246 const s2 = void 0 === this.u; 3247 return s2 && (this.u = t2.options?.host, this.u.addController(this), this.u.updateComplete.then((t3) => this.t = true), this.element = t2.element, j.set(this.element, this)), this.optionsOrCallback = i2, (s2 || "function" != typeof i2) && this.m(i2), this.render(i2); 3248 } 3249 m(t2) { 3250 t2 = t2 ?? {}; 3251 const i2 = this.getController(); 3252 void 0 !== i2 && ((t2 = { ...i2.defaultOptions, ...t2 }).keyframeOptions = { ...i2.defaultOptions.keyframeOptions, ...t2.keyframeOptions }), t2.properties ??= b, this.options = t2; 3253 } 3254 p() { 3255 const t2 = {}, i2 = this.element.getBoundingClientRect(), s2 = getComputedStyle(this.element); 3256 return this.options.properties.forEach((e2) => { 3257 const h2 = i2[e2] ?? (N[e2] ? void 0 : s2[e2]), o2 = Number(h2); 3258 t2[e2] = isNaN(o2) ? h2 + "" : o2; 3259 }), t2; 3260 } 3261 v() { 3262 let t2, i2 = true; 3263 return this.options.guard && (t2 = this.options.guard(), i2 = ((t3, i3) => { 3264 if (Array.isArray(t3)) { 3265 if (Array.isArray(i3) && i3.length === t3.length && t3.every((t4, s2) => t4 === i3[s2])) return false; 3266 } else if (i3 === t3) return false; 3267 return true; 3268 })(t2, this._)), this.h = this.t && !this.isDisabled() && !this.isAnimating() && i2 && this.element.isConnected, this.h && (this._ = Array.isArray(t2) ? Array.from(t2) : t2), this.h; 3269 } 3270 hostUpdate() { 3271 "function" == typeof this.optionsOrCallback && this.m(this.optionsOrCallback()), this.v() && (this.A = this.p(), this.i = this.i ?? this.element.parentNode, this.o = this.element.nextSibling); 3272 } 3273 async hostUpdated() { 3274 if (!this.h || !this.element.isConnected || this.options.skipInitial && !this.isHostRendered) return; 3275 let t2; 3276 this.prepare(), await a; 3277 const i2 = this.P(), s2 = this.V(this.options.keyframeOptions, i2), e2 = this.p(); 3278 if (void 0 !== this.A) { 3279 const { from: s3, to: h2 } = this.O(this.A, e2, i2); 3280 this.log("measured", [this.A, e2, s3, h2]), t2 = this.calculateKeyframes(s3, h2); 3281 } else { 3282 const s3 = r$1.get(this.options.inId); 3283 if (s3) { 3284 r$1.delete(this.options.inId); 3285 const { from: h2, to: n2 } = this.O(s3, e2, i2); 3286 t2 = this.calculateKeyframes(h2, n2), t2 = this.options.in ? [{ ...this.options.in[0], ...t2[0] }, ...this.options.in.slice(1), t2[1]] : t2, o$5++, t2.forEach((t3) => t3.zIndex = o$5); 3287 } else this.options.in && (t2 = [...this.options.in, {}]); 3288 } 3289 this.animate(t2, s2); 3290 } 3291 resetStyles() { 3292 void 0 !== this.j && (this.element.setAttribute("style", this.j ?? ""), this.j = void 0); 3293 } 3294 commitStyles() { 3295 this.j = this.element.getAttribute("style"), this.webAnimation?.commitStyles(), this.webAnimation?.cancel(); 3296 } 3297 reconnected() { 3298 } 3299 async disconnected() { 3300 if (!this.h) return; 3301 if (void 0 !== this.options.id && r$1.set(this.options.id, this.A), void 0 === this.options.out) return; 3302 if (this.prepare(), await a(), this.i?.isConnected) { 3303 const t3 = this.o && this.o.parentNode === this.i ? this.o : null; 3304 if (this.i.insertBefore(this.element, t3), this.options.stabilizeOut) { 3305 const t4 = this.p(); 3306 this.log("stabilizing out"); 3307 const i2 = this.A.left - t4.left, s2 = this.A.top - t4.top; 3308 !("static" === getComputedStyle(this.element).position) || 0 === i2 && 0 === s2 || (this.element.style.position = "relative"), 0 !== i2 && (this.element.style.left = i2 + "px"), 0 !== s2 && (this.element.style.top = s2 + "px"); 3309 } 3310 } 3311 const t2 = this.V(this.options.keyframeOptions); 3312 await this.animate(this.options.out, t2), this.element.remove(); 3313 } 3314 prepare() { 3315 this.createFinished(); 3316 } 3317 start() { 3318 this.options.onStart?.(this); 3319 } 3320 didFinish(t2) { 3321 t2 && this.options.onComplete?.(this), this.A = void 0, this.animatingProperties = void 0, this.frames = void 0, this.resolveFinished(); 3322 } 3323 P() { 3324 const t2 = []; 3325 for (let i2 = this.element.parentNode; i2; i2 = i2?.parentNode) { 3326 const s2 = j.get(i2); 3327 s2 && !s2.isDisabled() && s2 && t2.push(s2); 3328 } 3329 return t2; 3330 } 3331 get isHostRendered() { 3332 const t2 = n$2.has(this.u); 3333 return t2 || this.u.updateComplete.then(() => { 3334 n$2.add(this.u); 3335 }), t2; 3336 } 3337 V(t2, i2 = this.P()) { 3338 const s2 = { ...A }; 3339 return i2.forEach((t3) => Object.assign(s2, t3.options.keyframeOptions)), Object.assign(s2, t2), s2; 3340 } 3341 O(t2, i2, s2) { 3342 t2 = { ...t2 }, i2 = { ...i2 }; 3343 const e2 = s2.map((t3) => t3.animatingProperties).filter((t3) => void 0 !== t3); 3344 let h2 = 1, o2 = 1; 3345 return e2.length > 0 && (e2.forEach((t3) => { 3346 t3.width && (h2 /= t3.width), t3.height && (o2 /= t3.height); 3347 }), void 0 !== t2.left && void 0 !== i2.left && (t2.left = h2 * t2.left, i2.left = h2 * i2.left), void 0 !== t2.top && void 0 !== i2.top && (t2.top = o2 * t2.top, i2.top = o2 * i2.top)), { from: t2, to: i2 }; 3348 } 3349 calculateKeyframes(t2, i2, s2 = false) { 3350 const e2 = {}, h2 = {}; 3351 let o2 = false;
3352 const r2 = {}; 3353 for (const s3 in i2) { 3354 const n2 = t2[s3], a2 = i2[s3]; 3355 if (s3 in N) { 3356 const t3 = N[s3]; 3357 if (void 0 === n2 || void 0 === a2) continue; 3358 const i3 = t3(n2, a2); 3359 void 0 !== i3.transform && (r2[s3] = i3.value, o2 = true, e2.transform = `${e2.transform ?? ""} ${i3.transform}`, void 0 !== i3.overrideFrom && Object.assign(e2, i3.overrideFrom)); 3360 } else n2 !== a2 && void 0 !== n2 && void 0 !== a2 && (o2 = true, e2[s3] = n2, h2[s3] = a2); 3361 } 3362 return e2.transformOrigin = h2.transformOrigin = s2 ? "center center" : "top left", this.animatingProperties = r2, o2 ? [e2, h2] : void 0; 3363 } 3364 async animate(t2, i2 = this.options.keyframeOptions) { 3365 this.start(), this.frames = t2; 3366 let s2 = false; 3367 if (!this.isAnimating() && !this.isDisabled() && (this.options.onFrames && (this.frames = t2 = this.options.onFrames(this), this.log("modified frames", t2)), void 0 !== t2)) { 3368 this.log("animate", [t2, i2]), s2 = true, this.webAnimation = this.element.animate(t2, i2); 3369 const e2 = this.getController(); 3370 e2?.add(this); 3371 try { 3372 await this.webAnimation.finished; 3373 } catch (t3) { 3374 } 3375 e2?.remove(this); 3376 } 3377 return this.didFinish(s2), s2; 3378 } 3379 isAnimating() { 3380 return "running" === this.webAnimation?.playState || this.webAnimation?.pending; 3381 } 3382 log(t2, i2) { 3383 this.shouldLog && !this.isDisabled() && console.log(t2, this.options.id, i2); 3384 } 3385 } 3386 const F = e$5(x); 3387 const core = { "cancel": '<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.75827 17.2426L12.0009 12M17.2435 6.75736L12.0009 12M12.0009 12L6.75827 6.75736M12.0009 12L17.2435 17.2426" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n', "check-circled-outline": '<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7 12.5L10 15.5L17 8.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n', "check": '<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M5 13L9 17L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n', "emoji-puzzled": '<svg width="24px" height="24px" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" ><path d="M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.5 15.5s1.5-2 4.5-2 4.5 2 4.5 2M3 4c0-2.754 4-2.754 4 0 0 1.967-2 1.64-2 4M5 11.01l.01-.011" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.5 9a.5.5 0 110-1 .5.5 0 010 1zM10.5 9a.5.5 0 110-1 .5.5 0 010 1z" fill="#000" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>', "info-empty": '<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12 11.5V16.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 7.51L12.01 7.49889" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n', "loader": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-loader"><line x1="12" y1="2" x2="12" y2="6"></line><line x1="12" y1="18" x2="12" y2="22"></line><line x1="4.93" y1="4.93" x2="7.76" y2="7.76"></line><line x1="16.24" y1="16.24" x2="19.07" y2="19.07"></line><line x1="2" y1="12" x2="6" y2="12"></line><line x1="18" y1="12" x2="22" y2="12"></line><line x1="4.93" y1="19.07" x2="7.76" y2="16.24"></line><line x1="16.24" y1="7.76" x2="19.07" y2="4.93"></line></svg>
3387', "minus-small": '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">\n <path stroke-linecap="round" stroke-linejoin="round" d="M18 12H6" />\n</svg>\n', "more-horiz": '<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M18 12.5C18.2761 12.5 18.5 12.2761 18.5 12C18.5 11.7239 18.2761 11.5 18 11.5C17.7239 11.5 17.5 11.7239 17.5 12C17.5 12.2761 17.7239 12.5 18 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 12.5C12.2761 12.5 12.5 12.2761 12.5 12C12.5 11.7239 12.2761 11.5 12 11.5C11.7239 11.5 11.5 11.7239 11.5 12C11.5 12.2761 11.7239 12.5 12 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M6 12.5C6.27614 12.5 6.5 12.2761 6.5 12C6.5 11.7239 6.27614 11.5 6 11.5C5.72386 11.5 5.5 11.7239 5.5 12C5.5 12.2761 5.72386 12.5 6 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n', "more-vert": '<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12 12.5C12.2761 12.5 12.5 12.2761 12.5 12C12.5 11.7239 12.2761 11.5 12 11.5C11.7239 11.5 11.5 11.7239 11.5 12C11.5 12.2761 11.7239 12.5 12 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 18.5C12.2761 18.5 12.5 18.2761 12.5 18C12.5 17.7239 12.2761 17.5 12 17.5C11.7239 17.5 11.5 17.7239 11.5 18C11.5 18.2761 11.7239 18.5 12 18.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 6.5C12.2761 6.5 12.5 6.27614 12.5 6C12.5 5.72386 12.2761 5.5 12 5.5C11.7239 5.5 11.5 5.72386 11.5 6C11.5 6.27614 11.7239 6.5 12 6.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n', "nav-arrow-down": '<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6 9L12 15L18 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n', "warning-circled-outline": '<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12 7L12 13" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 17.01L12.01 16.9989" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n' }; 3388 const icons = { 3389 core 3390 }; 3391 const loadingGetPromises = /* @__PURE__ */ new Map(); 3392 const libraries = { 3393 heroicons: { 3394 url: "https://cdn.jsdelivr.net/npm/[email protected]/24/$prefix/$name.svg", 3395 defaultPrefix: "outline" 3396 }, 3397 iconoir: { 3398 url: "https://cdnjs.cloudflare.com/ajax/libs/iconoir/5.1.4/icons/$name.svg" 3399 }, 3400 feathers: { 3401 url: "https://cdn.jsdelivr.net/npm/[email protected]/dist/icons/$name.svg" 3402 }, 3403 lucide: { 3404 url: "https://cdn.jsdelivr.net/npm/[email protected]/icons/$name.svg" 3405 }, 3406 material: { 3407 url: "https://cdn.jsdelivr.net/npm/@material-icons/[email protected]/svg/$name/$prefix.svg", 3408 defaultPrefix: "regular" 3409 }, 3410 fontAwesome: { 3411 url: "https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/svgs/$prefix/$name.svg", 3412 defaultPrefix: "regular" 3413 }, 3414 custom: { url: "", defaultPrefix: "" } 3415 }; 3416 function resolveCustomLibraryConfig(params) { 3417 let url = params.customLibraryPath; 3418 let defaultPrefix = params.customLibraryDefaultPrefix; 3419 if (url == null) { 3420 const globalEl = document.querySelector("[customIconLibraryPath]"); 3421 url = globalEl?.getAttribute("customIconLibraryPath") ?? ""; 3422 if (defaultPrefix == null) { 3423 defaultPrefix = globalEl?.getAttribute("customIconDefaultPrefix") ?? document.querySelector("[customIconDefaultPrefix]")?.getAttribute("customIconDefaultPrefix") ?? ""; 3424 } 3425 } 3426 return { 3427 url: url || "", 3428 defaultPrefix: defaultPrefix || "" 3429 }; 3430 } 3431 function resolveLibraryItem(library, params) { 3432 if (!(library in libraries)) 3433 return null; 3434 if (library !== "custom") { 3435 return libraries[library]; 3436 }
3437 return resolveCustomLibraryConfig(params); 3438 } 3439 const iconCachStr = sessionStorage.getItem("sonicIconsCache"); 3440 const iconCache = iconCachStr ? JSON.parse(iconCachStr) : { icons: {}, names: [] }; 3441 const iconCacheMaxSize = 100; 3442 class Icons { 3443 } 3444 Icons.default = { 3445 get: async (params) => { 3446 const library = params.library; 3447 if (!params.name) 3448 return ""; 3449 const name = params.name; 3450 const iconsAsRecord = icons; 3451 if (!library) { 3452 return o$6(iconsAsRecord["core"][params.name] || ""); 3453 } 3454 const libraryItem = resolveLibraryItem(library, params); 3455 if (libraryItem) { 3456 if (library === "custom" && !libraryItem.url) { 3457 return ""; 3458 } 3459 const prefix = params.prefix || libraryItem.defaultPrefix || ""; 3460 const libIcons = iconsAsRecord[library] || {}; 3461 iconsAsRecord[library] = libIcons; 3462 const libIconsKey = library === "custom" ? `${libraryItem.url}|${prefix}-${name}` : `${prefix}-${name}`; 3463 if (libIcons[libIconsKey]) 3464 return o$6(libIcons[libIconsKey]); 3465 const url = (libraryItem.url || "").replace("$prefix", prefix).replace("$name", name); 3466 if (iconCache.icons[url]) { 3467 const cached = iconCache.icons[url]; 3468 const isSvgCached = /^\s*<svg[\s>]/i.test(cached || ""); 3469 if (isSvgCached) { 3470 libIcons[libIconsKey] = cached; 3471 return o$6(cached); 3472 } 3473 delete iconCache.icons[url]; 3474 } 3475 if (!loadingGetPromises.has(url)) { 3476 const promise = new Promise(async (resolve) => { 3477 try { 3478 const result2 = await fetch(url); 3479 if (!result2.ok) { 3480 resolve(""); 3481 return; 3482 } 3483 try { 3484 const contentType = result2.headers.get("content-type") || ""; 3485 if (!contentType.includes("image/svg+xml") && !contentType.includes("svg")) { 3486 resolve(""); 3487 return; 3488 } 3489 const text = await result2.text(); 3490 const isSvg = /^\s*<svg[\s>]/i.test(text); 3491 resolve(isSvg ? text : ""); 3492 } catch (e2) { 3493 resolve(""); 3494 } 3495 } catch (error) { 3496 log("concorde icon loading error", params); 3497 resolve(""); 3498 } 3499 }); 3500 loadingGetPromises.set(url, promise); 3501 } 3502 const result = await loadingGetPromises.get(url); 3503 loadingGetPromises.delete(url); 3504 libIcons[libIconsKey] = result || ""; 3505 if (result && /^\s*<svg[\s>]/i.test(result)) { 3506 iconCache.icons[url] = result; 3507 iconCache.names.push(url); 3508 } 3509 if (iconCache.names.length > iconCacheMaxSize) { 3510 const key = iconCache.names.shift(); 3511 delete iconCache.icons[key]; 3512 } 3513 sessionStorage.setItem("sonicIconsCache", JSON.stringify(iconCache)); 3514 return result ? o$6(result) : ""; 3515 } 3516 return o$6(iconsAsRecord["core"][params.name] || ""); 3517 } 3518 }; 3519 function onBeforeConnected(callback) { 3520 if (!this.__beforeConnectedCallbackCalls__) { 3521 this.__beforeConnectedCallbackCalls__ = /* @__PURE__ */ new Set(); 3522 } 3523 this.__beforeConnectedCallbackCalls__.add(callback); 3524 } 3525 function onConnected(callback) { 3526 if (!this.__connectedCallbackCalls__) { 3527 this.__connectedCallbackCalls__ = /* @__PURE__ */ new Set(); 3528 } 3529 this.__connectedCallbackCalls__.add(callback); 3530 } 3531 function onDisconnected(callback) { 3532 if (!this.__disconnectedCallbackCalls__) { 3533 this.__disconnectedCallbackCalls__ = /* @__PURE__ */ new Set(); 3534 } 3535 this.__disconnectedCallbackCalls__.add(callback); 3536 } 3537 function setSubscribable(target) { 3538 if (target.__is__setSubscribable__) 3539 return; 3540 target.__is__setSubscribable__ = true; 3541 target.__onBeforeConnected__ = onBeforeConnected; 3542 target.__onConnected__ = onConnected; 3543 target.__onDisconnected__ = onDisconnected; 3544 const originalConnectedCallback = target.connectedCallback; 3545 target.connectedCallback = function() { 3546 if (this.__beforeConnectedCallbackCalls__) { 3547 this.__beforeConnectedCallbackCalls__.forEach((callback) => callback(this)); 3548 } 3549 originalConnectedCallback?.call(this); 3550 if (this.__connectedCallbackCalls__) { 3551 this.__connectedCallbackCalls__.forEach((callback) => callback(this)); 3552 } 3553 }; 3554 const originalDisconnectedCallback = target.disconnectedCallback; 3555 target.disconnectedCallback = function() { 3556 originalDisconnectedCallback?.call(this); 3557 if (this.__disconnectedCallbackCalls__) { 3558 this.__disconnectedCallbackCalls__.forEach((callback) => callback(this)); 3559 } 3560 }; 3561 } 3562 function cleanPlaceholder(value) { 3563 return value.trim().replace(/^this\./, ""); 3564 } 3565 function getValueFromExpression(component, expression) { 3566 if (!expression) 3567 return void 0;
3568 const segments2 = expression.split(".").filter(Boolean); 3569 if (segments2.length === 0) 3570 return void 0; 3571 let current2 = component; 3572 for (const segment of segments2) { 3573 if (current2 === void 0 || current2 === null || typeof current2 !== "object") { 3574 return void 0; 3575 } 3576 current2 = current2[segment]; 3577 } 3578 return current2; 3579 } 3580 function isPlaceholderUnresolved(resolved, options) { 3581 if (resolved === void 0 || resolved === null) 3582 return true; 3583 if (options?.skipEmptyPlaceholder && resolved === "") 3584 return true; 3585 return false; 3586 } 3587 function resolveDynamicPath(component, template, options) { 3588 let missing = false; 3589 const replaceValue = (_match, expression) => { 3590 const cleaned = cleanPlaceholder(expression); 3591 const resolved = getValueFromExpression(component, cleaned); 3592 if (isPlaceholderUnresolved(resolved, options)) { 3593 missing = true; 3594 return ""; 3595 } 3596 return `${resolved}`; 3597 }; 3598 const resolvedPath = template.replace(/\$\{([^}]+)\}/g, replaceValue).replace(/\{\$([^}]+)\}/g, replaceValue).trim(); 3599 if (missing || !resolvedPath.length) { 3600 return { ready: false, path: null }; 3601 } 3602 const segments2 = resolvedPath.split(".").filter(Boolean); 3603 if (segments2.length === 0 || !segments2[0]) { 3604 return { ready: false, path: null }; 3605 } 3606 return { ready: true, path: resolvedPath }; 3607 } 3608 function extractDynamicDependencies(path) { 3609 const patterns = [/\$\{([^}]+)\}/g, /\{\$([^}]+)\}/g]; 3610 const deps = /* @__PURE__ */ new Set(); 3611 for (const pattern of patterns) { 3612 let match; 3613 while ((match = pattern.exec(path)) !== null) { 3614 const cleaned = (match[1] || "").trim().replace(/^this\./, ""); 3615 if (!cleaned) 3616 continue; 3617 const [root] = cleaned.split("."); 3618 if (root) 3619 deps.add(root); 3620 } 3621 } 3622 return Array.from(deps); 3623 } 3624 function hasPath(obj) { 3625 return typeof obj === "object" && obj !== null && "path" in obj && typeof obj.path === "string"; 3626 } 3627 const observedPropertiesByComponent = /* @__PURE__ */ new WeakMap(); 3628 const componentsBeingPolled = /* @__PURE__ */ new Set(); 3629 let animationFrameId = null; 3630 const MAX_NOTIFICATION_PASSES_PER_FRAME = 8; 3631 function getObservedProperties(component) { 3632 let observedProperties = observedPropertiesByComponent.get(component); 3633 if (!observedProperties) { 3634 observedProperties = /* @__PURE__ */ new Map(); 3635 observedPropertiesByComponent.set(component, observedProperties); 3636 } 3637 return observedProperties; 3638 } 3639 function findHandlersForChangedProperties(component, observedProperties) { 3640 const handlersToRun = /* @__PURE__ */ new Set(); 3641 for (const [propertyName, observed] of observedProperties) { 3642 const currentValue = getValueFromExpression(component, propertyName); 3643 if (!Object.is(observed.lastValue, currentValue)) { 3644 observed.lastValue = currentValue; 3645 observed.onChangeHandlers.forEach((handler) => handlersToRun.add(handler)); 3646 } 3647 } 3648 return handlersToRun; 3649 } 3650 function notifyObservedPropertyChanges() { 3651 animationFrameId = null; 3652 let pass = 0; 3653 let propertiesChangedThisFrame = true; 3654 while (propertiesChangedThisFrame && pass < MAX_NOTIFICATION_PASSES_PER_FRAME) { 3655 propertiesChangedThisFrame = false; 3656 pass += 1; 3657 for (const component of componentsBeingPolled) { 3658 const observedProperties = observedPropertiesByComponent.get(component); 3659 if (!observedProperties || observedProperties.size === 0) 3660 continue; 3661 const handlersToRun = findHandlersForChangedProperties(component, observedProperties); 3662 if (handlersToRun.size === 0) 3663 continue; 3664 propertiesChangedThisFrame = true; 3665 handlersToRun.forEach((handler) => handler()); 3666 } 3667 } 3668 if (propertiesChangedThisFrame) { 3669 console.warn("[concorde] dynamic property watch: limite de passes atteinte, boucle infinie probable"); 3670 } 3671 if (componentsBeingPolled.size > 0) { 3672 scheduleObservedPropertyChanges(); 3673 } 3674 } 3675 function scheduleObservedPropertyChanges() { 3676 if (animationFrameId !== null) 3677 return; 3678 animationFrameId = requestAnimationFrame(notifyObservedPropertyChanges); 3679 } 3680 function cancelScheduledObservedPropertyChangesIfIdle() { 3681 if (componentsBeingPolled.size === 0 && animationFrameId !== null) { 3682 cancelAnimationFrame(animationFrameId); 3683 animationFrameId = null; 3684 } 3685 } 3686 function observeDynamicProperty(_legacyWatcherStoreKey, _legacyHookedStoreKey, component, dependencyPropertyName, onDependencyChange) { 3687 const propertyName = String(dependencyPropertyName); 3688 const observedProperties = getObservedProperties(component); 3689 let observed = observedProperties.get(propertyName); 3690 if (!observed) { 3691 observed = {
3692 lastValue: getValueFromExpression(component, propertyName), 3693 onChangeHandlers: /* @__PURE__ */ new Set() 3694 }; 3695 observedProperties.set(propertyName, observed); 3696 } 3697 observed.onChangeHandlers.add(onDependencyChange); 3698 componentsBeingPolled.add(component); 3699 scheduleObservedPropertyChanges(); 3700 return () => { 3701 const currentObservedProperties = observedPropertiesByComponent.get(component); 3702 if (!currentObservedProperties) 3703 return; 3704 const currentObserved = currentObservedProperties.get(propertyName); 3705 if (!currentObserved) 3706 return; 3707 currentObserved.onChangeHandlers.delete(onDependencyChange); 3708 if (currentObserved.onChangeHandlers.size === 0) { 3709 currentObservedProperties.delete(propertyName); 3710 } 3711 if (currentObservedProperties.size === 0) { 3712 observedPropertiesByComponent.delete(component); 3713 componentsBeingPolled.delete(component); 3714 cancelScheduledObservedPropertyChangesIfIdle(); 3715 } 3716 }; 3717 } 3718 const bindDynamicWatchKeys = { 3719 watcherStore: /* @__PURE__ */ Symbol("__bindDynamicWatcherStore__"), 3720 hooked: /* @__PURE__ */ Symbol("__bindDynamicWillUpdateHooked__") 3721 }; 3722 const publishDynamicWatchKeys = { 3723 watcherStore: "__publishDynamicWatcherStore__", 3724 hooked: "__publishDynamicWillUpdateHooked__" 3725 }; 3726 const getDynamicWatchKeys = { 3727 watcherStore: "__getDynamicWatcherStore__", 3728 hooked: "__getDynamicWillUpdateHooked__" 3729 }; 3730 const onAssignDynamicWatchKeys = { 3731 watcherStore: /* @__PURE__ */ Symbol("__onAssignDynamicWatcherStore__"), 3732 hooked: /* @__PURE__ */ Symbol("__onAssignDynamicWillUpdateHooked__") 3733 }; 3734 let Arrays$1 = class Arrays2 { 3735 /** 3736 * Vérifie si les deux tableaux ont le même contenu 3737 */ 3738 static areEqual(array1, array2) { 3739 if (array1.length === array2.length) { 3740 return array1.every((element, index) => { 3741 if (element === array2[index]) { 3742 return true; 3743 } 3744 return false; 3745 }); 3746 } 3747 return false; 3748 } 3749 /** 3750 * Fournie une fonction to1D qui transforme un tableau 2D en un tableau 1D par concaténation 3751 */ 3752 /*eslint-disable @typescript-eslint/no-explicit-any*/ 3753 static from2d(source) { 3754 return { 3755 to1D: () => { 3756 let result = []; 3757 source.forEach((elt) => result = result.concat(elt)); 3758 return this.from(result); 3759 } 3760 }; 3761 } 3762 /*eslint-enable @typescript-eslint/no-explicit-any*/ 3763 /** 3764 * Fournie des méthodes pour manipuler un tableau 3765 * A l'écriture cela permet d'avoir des phrases du type: 3766 * let data = Arrays.from(mon tableau) 3767 * puis data.everyItem().has().same().value().forkey("key"); 3768 * Peu mieux faire. ou voir a remplacer un jour par loadHash par exemple. 3769 **/ 3770 /*eslint-disable @typescript-eslint/no-explicit-any*/ 3771 static from(source) { 3772 return { 3773 /**Obtenir le tableau final*/ 3774 get: () => source || [], 3775 everyItem: () => { 3776 return { 3777 has: () => { 3778 return { 3779 same: () => { 3780 return { 3781 value: () => { 3782 return { 3783 forKey: (key) => { 3784 if (source.length < 1) 3785 return true; 3786 const first = (source[0] || {})[key]; 3787 return source.every((item) => (item || {})[key] == first); 3788 } 3789 }; 3790 } 3791 }; 3792 } 3793 }; 3794 }, 3795 value: () => { 3796 return { 3797 forKey: (key) => { 3798 return Arrays2.from(source.map((item) => item[key])); 3799 } 3800 }; 3801 }, 3802 copy: () => { 3803 return { 3804 fromKey: (atKey) => { 3805 return { 3806 toKey: (toKey) => { 3807 source.forEach((item) => { 3808 item[toKey] = Array.isArray(item[atKey]) ? [...item[atKey]] : typeof item[atKey] === "object" && item[atKey] != null ? { ...item[atKey] } : item[atKey]; 3809 }); 3810 } 3811 }; 3812 } 3813 }; 3814 } 3815 }; 3816 }, 3817 map: (f2) => Arrays2.from(source.map(f2)), 3818 filter: (f2) => Arrays2.from(source.filter(f2)), 3819 find: (f2) => source.find(f2), 3820 some: (f2) => source.some(f2), 3821 every: (f2) => source.every(f2), 3822 group: () => { 3823 return { 3824 byKey: (key) => { 3825 const result = [];
3826 const keys2 = /* @__PURE__ */ new Map(); 3827 for (const item of source) { 3828 const value = item[key]; 3829 if (!keys2.has(value)) { 3830 const idx = result.length; 3831 keys2.set(value, idx); 3832 const pushable = { items: [] }; 3833 pushable[key] = value; 3834 result.push(pushable); 3835 } 3836 result[keys2.get(value)].items.push(item); 3837 } 3838 return Arrays2.from(result); 3839 } 3840 }; 3841 }, 3842 without: () => { 3843 return { 3844 duplicates: () => { 3845 return { 3846 forKey: (key) => { 3847 const set2 = [...new Set(source.map((item) => item[key]))]; 3848 return Arrays2.from(set2.map((value) => source.find((item) => item[key] == value))); 3849 } 3850 }; 3851 }, 3852 itemsIn: (toRemoveFromSource) => { 3853 return { 3854 havingSameValue: () => { 3855 return { 3856 forKey: (key) => { 3857 const areValuesDifferentForKey = (compared1, key2) => (compared2) => compared1[key2] != compared2[key2]; 3858 return Arrays2.from(source.filter((elt) => toRemoveFromSource.every(areValuesDifferentForKey(elt, key)))); 3859 } 3860 }; 3861 } 3862 }; 3863 } 3864 }; 3865 } 3866 }; 3867 } 3868 }; 3869 let LocationHandler$1 = class LocationHandler2 { 3870 static listen() { 3871 if (!LocationHandler2.listening) { 3872 return; 3873 } 3874 const newURL = document.location?.href.replace(document.location.origin, ""); 3875 if (LocationHandler2.prevURL && LocationHandler2.prevURL != newURL) { 3876 LocationHandler2.prevURL = newURL; 3877 LocationHandler2.listeners.forEach((listener) => { 3878 listener.location = newURL; 3879 }); 3880 } 3881 window.requestAnimationFrame(LocationHandler2.listen); 3882 } 3883 /** 3884 * Arrête l'écoute des changements de location pour le listener fournit 3885 */ 3886 static offChange(listener) { 3887 const idx = LocationHandler2.listeners.indexOf(listener); 3888 if (idx == -1) 3889 return; 3890 LocationHandler2.listeners.splice(idx, 1); 3891 if (LocationHandler2.listeners.length == 0) 3892 LocationHandler2.listening = false; 3893 } 3894 /** 3895 * Ecoute les changements de location et l'assigne à la propriété location de chaque listener 3896 */ 3897 static onChange(listener) { 3898 if (!LocationHandler2.listening) { 3899 LocationHandler2.listening = true; 3900 LocationHandler2.listen(); 3901 } 3902 LocationHandler2.listeners.push(listener); 3903 listener.location = this.prevURL; 3904 } 3905 /** 3906 * 3907 * @param component HTMLElement 3908 * Recupère la proprité to ou href de l'élément et lance la navigation 3909 * Si l'attribut pushState est présent la naviguation se fait via un pushState 3910 * Si l'attribut replaceState est présent la naviguation se fait via un replaceState 3911 * Voir link et button pour les exemples d'implémentation 3912 **/ 3913 static changeFromComponent(component) { 3914 const goBack = component.goBack; 3915 const referrer = document.referrer; 3916 if (goBack !== null && goBack !== void 0) { 3917 const origin = document.location.origin; 3918 const urlDest = (goBack || origin).toString(); 3919 const isHTTP = referrer.indexOf("http") == 0; 3920 const isNotSameOrigin = isHTTP ? new URL(referrer).origin != origin : false; 3921 const isReferrerEmpty = referrer == ""; 3922 const isFirstPage = history.length < 3; 3923 const isFallbackNoReferer = isReferrerEmpty && isFirstPage; 3924 const isNotSameURL = urlDest != document.location.href; 3925 const goToURLDest = isNotSameOrigin && isNotSameURL || isFallbackNoReferer; 3926 if (goToURLDest) { 3927 const state = history.state || {}; 3928 state.concorde = state.concorde || {}; 3929 state.concorde.hasDoneHistoryBack = true; 3930 history.pushState(state, document.title); 3931 history.back(); 3932 document.location.replace(urlDest); 3933 } else { 3934 history.back(); 3935 } 3936 return; 3937 } 3938 let to = component.getAttribute("to") || ""; 3939 if (!to) 3940 to = component.href?.toString() || ""; 3941 if (!to) 3942 return; 3943 if (to.indexOf("#") == 0) { 3944 document.location.hash = to.substring(1); 3945 return; 3946 } 3947 const url = new URL(to, document.location.href); 3948 const split = url.pathname.split("/"); 3949 const newPathName = []; 3950 let prevSp = ""; 3951 for (const sp of split) { 3952 if (sp != prevSp) 3953 newPathName.push(sp); 3954 prevSp = sp; 3955 } 3956 to = "/" + newPathName.join("/") + url.search + (url.hash ? +url.hash : ""); 3957 if (component.hasAttribute("pushState")) { 3958 history.pushState(null, "", to); 3959 } else if (component.hasAttribute("replaceState")) { 3960 history.replaceState(null, "", to); 3961 } else 3962 document.location.href = to; 3963 } 3964 /** 3965 * 3966 * @param component ActivableLink 3967 * Ajoute l'attribut "active" à l'élément si l'url correspond à la location en donction du mode d'activation 3968 */ 3969 static updateComponentActiveState(component) { 3970 if (component.autoActive == "disabled") { 3971 return; 3972 } 3973 const href = component.href?.toString() || ""; 3974 if (component.href && href.indexOf("http") != 0) { 3975 const url1 = new URL(href, document.location.href); 3976 const url2 = new URL(component.location || "", document.location.origin); 3977 let isActive = false;
3978 if (component.autoActive == "strict") { 3979 isActive = url1.pathname == url2.pathname && url1.hash == url2.hash && url1.search == url2.search; 3980 } else if (component.autoActive == "strict-path-only") { 3981 isActive = url1.pathname == url2.pathname && url1.hash == url2.hash; 3982 } else { 3983 isActive = url2.href.indexOf(url1.href) == 0; 3984 } 3985 if (isActive) 3986 component.setAttribute("active", "true"); 3987 else 3988 component.removeAttribute("active"); 3989 } 3990 } 3991 }; 3992 LocationHandler$1.listeners = []; 3993 LocationHandler$1.listening = false; 3994 LocationHandler$1.prevURL = document.location?.href.replace(document.location.origin, ""); 3995 function getDefaultExportFromCjs(x2) { 3996 return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2; 3997 } 3998 var urlPattern$1 = { exports: {} }; 3999 var urlPattern = urlPattern$1.exports; 4000 var hasRequiredUrlPattern; 4001 function requireUrlPattern() { 4002 if (hasRequiredUrlPattern) return urlPattern$1.exports; 4003 hasRequiredUrlPattern = 1; 4004 (function(module, exports) { 4005 var slice = [].slice; 4006 (function(root, factory) { 4007 if (exports !== null) { 4008 return module.exports = factory(); 4009 } else { 4010 return root.UrlPattern = factory(); 4011 } 4012 })(urlPattern, function() { 4013 var P2, UrlPattern2, astNodeContainsSegmentsForProvidedParams, astNodeToNames, astNodeToRegexString, baseAstNodeToRegexString, concatMap, defaultOptions, escapeForRegex, getParam, keysAndValuesToObject, newParser, regexGroupCount, stringConcatMap, stringify; 4014 escapeForRegex = function(string) { 4015 return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); 4016 }; 4017 concatMap = function(array, f2) { 4018 var i2, length, results; 4019 results = []; 4020 i2 = -1; 4021 length = array.length; 4022 while (++i2 < length) { 4023 results = results.concat(f2(array[i2])); 4024 } 4025 return results; 4026 }; 4027 stringConcatMap = function(array, f2) { 4028 var i2, length, result; 4029 result = ""; 4030 i2 = -1; 4031 length = array.length; 4032 while (++i2 < length) { 4033 result += f2(array[i2]); 4034 } 4035 return result; 4036 }; 4037 regexGroupCount = function(regex2) { 4038 return new RegExp(regex2.toString() + "|").exec("").length - 1; 4039 }; 4040 keysAndValuesToObject = function(keys2, values) { 4041 var i2, key, length, object2, value; 4042 object2 = {}; 4043 i2 = -1; 4044 length = keys2.length; 4045 while (++i2 < length) { 4046 key = keys2[i2]; 4047 value = values[i2]; 4048 if (value == null) { 4049 continue; 4050 } 4051 if (object2[key] != null) { 4052 if (!Array.isArray(object2[key])) { 4053 object2[key] = [object2[key]]; 4054 } 4055 object2[key].push(value); 4056 } else { 4057 object2[key] = value; 4058 } 4059 } 4060 return object2; 4061 }; 4062 P2 = {}; 4063 P2.Result = function(value, rest) { 4064 this.value = value; 4065 this.rest = rest; 4066 }; 4067 P2.Tagged = function(tag, value) { 4068 this.tag = tag; 4069 this.value = value; 4070 }; 4071 P2.tag = function(tag, parser) { 4072 return function(input) { 4073 var result, tagged; 4074 result = parser(input); 4075 if (result == null) { 4076 return; 4077 } 4078 tagged = new P2.Tagged(tag, result.value); 4079 return new P2.Result(tagged, result.rest); 4080 }; 4081 }; 4082 P2.regex = function(regex2) { 4083 return function(input) { 4084 var matches, result; 4085 matches = regex2.exec(input); 4086 if (matches == null) { 4087 return; 4088 } 4089 result = matches[0]; 4090 return new P2.Result(result, input.slice(result.length)); 4091 }; 4092 }; 4093 P2.sequence = function() { 4094 var parsers; 4095 parsers = 1 <= arguments.length ? slice.call(arguments, 0) : []; 4096 return function(input) { 4097 var i2, length, parser, rest, result, values; 4098 i2 = -1; 4099 length = parsers.length; 4100 values = []; 4101 rest = input; 4102 while (++i2 < length) { 4103 parser = parsers[i2]; 4104 result = parser(rest); 4105 if (result == null) { 4106 return; 4107 } 4108 values.push(result.value); 4109 rest = result.rest; 4110 } 4111 return new P2.Result(values, rest); 4112 }; 4113 }; 4114 P2.pick = function() { 4115 var indexes, parsers; 4116 indexes = arguments[0], parsers = 2 <= arguments.length ? slice.call(arguments, 1) : []; 4117 return function(input) { 4118 var array, result; 4119 result = P2.sequence.apply(P2, parsers)(input); 4120 if (result == null) { 4121 return; 4122 } 4123 array = result.value; 4124 result.value = array[indexes]; 4125 return result; 4126 }; 4127 }; 4128 P2.string = function(string) { 4129 var length; 4130 length = string.length; 4131 return function(input) { 4132 if (input.slice(0, length) === string) { 4133 return new P2.Result(string, input.slice(length)); 4134 } 4135 }; 4136 }; 4137 P2.lazy = function(fn) { 4138 var cached; 4139 cached = null; 4140 return function(input) { 4141 if (cached == null) { 4142 cached = fn(); 4143 } 4144 return cached(input); 4145 }; 4146 }; 4147 P2.baseMany = function(parser, end, stringResult, atLeastOneResultRequired, input) { 4148 var endResult, parserResult, rest, results; 4149 rest = input; 4150 results = stringResult ? "" : []; 4151 while (true) { 4152 if (end != null) { 4153 endResult = end(rest); 4154 if (endResult != null) { 4155 break; 4156 } 4157 } 4158 parserResult = parser(rest); 4159 if (parserResult == null) { 4160 break; 4161 } 4162 if (stringResult) { 4163 results += parserResult.value; 4164 } else { 4165 results.push(parserResult.value); 4166 } 4167 rest = parserResult.rest; 4168 } 4169 if (atLeastOneResultRequired && results.length === 0) { 4170 return; 4171 } 4172 return new P2.Result(results, rest); 4173 }; 4174 P2.many1 = function(parser) { 4175 return function(input) { 4176 return P2.baseMany(parser, null, false, true, input); 4177 }; 4178 }; 4179 P2.concatMany1Till = function(parser, end) { 4180 return function(input) { 4181 return P2.baseMany(parser, end, true, true, input); 4182 }; 4183 }; 4184 P2.firstChoice = function() { 4185 var parsers; 4186 parsers = 1 <= arguments.length ? slice.call(arguments, 0) : []; 4187 return function(input) { 4188 var i2, length, parser, result; 4189 i2 = -1; 4190 length = parsers.length; 4191 while (++i2 < length) { 4192 parser = parsers[i2]; 4193 result = parser(input); 4194 if (result != null) { 4195 return result; 4196 } 4197 } 4198 }; 4199 }; 4200 newParser = function(options) { 4201 var U; 4202 U = {}; 4203 U.wildcard = P2.tag("wildcard", P2.string(options.wildcardChar)); 4204 U.optional = P2.tag("optional", P2.pick(1, P2.string(options.optionalSegmentStartChar), P2.lazy(function() { 4205 return U.pattern; 4206 }), P2.string(options.optionalSegmentEndChar))); 4207 U.name = P2.regex(new RegExp("^[" + options.segmentNameCharset + "]+")); 4208 U.named = P2.tag("named", P2.pick(1, P2.string(options.segmentNameStartChar), P2.lazy(function() { 4209 return U.name; 4210 }))); 4211 U.escapedChar = P2.pick(1, P2.string(options.escapeChar), P2.regex(/^./)); 4212 U["static"] = P2.tag("static", P2.concatMany1Till(P2.firstChoice(P2.lazy(function() { 4213 return U.escapedChar; 4214 }), P2.regex(/^./)), P2.firstChoice(P2.string(options.segmentNameStartChar), P2.string(options.optionalSegmentStartChar), P2.string(options.optionalSegmentEndChar), U.wildcard))); 4215 U.token = P2.lazy(function() { 4216 return P2.firstChoice(U.wildcard, U.optional, U.named, U["static"]); 4217 }); 4218 U.pattern = P2.many1(P2.lazy(function() { 4219 return U.token; 4220 })); 4221 return U; 4222 }; 4223 defaultOptions = { 4224 escapeChar: "\\", 4225 segmentNameStartChar: ":", 4226 segmentValueCharset: "a-zA-Z0-9-_~ %", 4227 segmentNameCharset: "a-zA-Z0-9", 4228 optionalSegmentStartChar: "(", 4229 optionalSegmentEndChar: ")", 4230 wildcardChar: "*" 4231 }; 4232 baseAstNodeToRegexString = function(astNode, segmentValueCharset) { 4233 if (Array.isArray(astNode)) { 4234 return stringConcatMap(astNode, function(node) { 4235 return baseAstNodeToRegexString(node, segmentValueCharset); 4236 }); 4237 } 4238 switch (astNode.tag) { 4239 case "wildcard": 4240 return "(.*?)"; 4241 case "named": 4242 return "([" + segmentValueCharset + "]+)"; 4243 case "static": 4244 return escapeForRegex(astNode.value); 4245 case "optional": 4246 return "(?:" + baseAstNodeToRegexString(astNode.value, segmentValueCharset) + ")?"; 4247 } 4248 }; 4249 astNodeToRegexString = function(astNode, segmentValueCharset) { 4250 if (segmentValueCharset == null) { 4251 segmentValueCharset = defaultOptions.segmentValueCharset; 4252 } 4253 return "^" + baseAstNodeToRegexString(astNode, segmentValueCharset) + "$"; 4254 }; 4255 astNodeToNames = function(astNode) { 4256 if (Array.isArray(astNode)) { 4257 return concatMap(astNode, astNodeToNames); 4258 } 4259 switch (astNode.tag) { 4260 case "wildcard": 4261 return ["_"]; 4262 case "named": 4263 return [astNode.value]; 4264 case "static": 4265 return []; 4266 case "optional": 4267 return astNodeToNames(astNode.value); 4268 } 4269 }; 4270 getParam = function(params, key, nextIndexes, sideEffects) { 4271 var index, maxIndex, result, value; 4272 if (sideEffects == null) { 4273 sideEffects = false;
4274 } 4275 value = params[key]; 4276 if (value == null) { 4277 if (sideEffects) { 4278 throw new Error("no values provided for key `" + key + "`"); 4279 } else { 4280 return; 4281 } 4282 } 4283 index = nextIndexes[key] || 0; 4284 maxIndex = Array.isArray(value) ? value.length - 1 : 0; 4285 if (index > maxIndex) { 4286 if (sideEffects) { 4287 throw new Error("too few values provided for key `" + key + "`"); 4288 } else { 4289 return; 4290 } 4291 } 4292 result = Array.isArray(value) ? value[index] : value; 4293 if (sideEffects) { 4294 nextIndexes[key] = index + 1; 4295 } 4296 return result; 4297 }; 4298 astNodeContainsSegmentsForProvidedParams = function(astNode, params, nextIndexes) { 4299 var i2, length; 4300 if (Array.isArray(astNode)) { 4301 i2 = -1; 4302 length = astNode.length; 4303 while (++i2 < length) { 4304 if (astNodeContainsSegmentsForProvidedParams(astNode[i2], params, nextIndexes)) { 4305 return true; 4306 } 4307 } 4308 return false; 4309 } 4310 switch (astNode.tag) { 4311 case "wildcard": 4312 return getParam(params, "_", nextIndexes, false) != null; 4313 case "named": 4314 return getParam(params, astNode.value, nextIndexes, false) != null; 4315 case "static": 4316 return false; 4317 case "optional": 4318 return astNodeContainsSegmentsForProvidedParams(astNode.value, params, nextIndexes); 4319 } 4320 }; 4321 stringify = function(astNode, params, nextIndexes) { 4322 if (Array.isArray(astNode)) { 4323 return stringConcatMap(astNode, function(node) { 4324 return stringify(node, params, nextIndexes); 4325 }); 4326 } 4327 switch (astNode.tag) { 4328 case "wildcard": 4329 return getParam(params, "_", nextIndexes, true); 4330 case "named": 4331 return getParam(params, astNode.value, nextIndexes, true); 4332 case "static": 4333 return astNode.value; 4334 case "optional": 4335 if (astNodeContainsSegmentsForProvidedParams(astNode.value, params, nextIndexes)) { 4336 return stringify(astNode.value, params, nextIndexes); 4337 } else { 4338 return ""; 4339 } 4340 } 4341 }; 4342 UrlPattern2 = function(arg1, arg2) { 4343 var groupCount, options, parsed, parser, withoutWhitespace; 4344 if (arg1 instanceof UrlPattern2) { 4345 this.isRegex = arg1.isRegex; 4346 this.regex = arg1.regex; 4347 this.ast = arg1.ast; 4348 this.names = arg1.names; 4349 return; 4350 } 4351 this.isRegex = arg1 instanceof RegExp; 4352 if (!("string" === typeof arg1 || this.isRegex)) { 4353 throw new TypeError("argument must be a regex or a string"); 4354 } 4355 if (this.isRegex) { 4356 this.regex = arg1; 4357 if (arg2 != null) { 4358 if (!Array.isArray(arg2)) { 4359 throw new Error("if first argument is a regex the second argument may be an array of group names but you provided something else"); 4360 } 4361 groupCount = regexGroupCount(this.regex); 4362 if (arg2.length !== groupCount) { 4363 throw new Error("regex contains " + groupCount + " groups but array of group names contains " + arg2.length); 4364 } 4365 this.names = arg2; 4366 } 4367 return; 4368 } 4369 if (arg1 === "") { 4370 throw new Error("argument must not be the empty string"); 4371 } 4372 withoutWhitespace = arg1.replace(/\s+/g, ""); 4373 if (withoutWhitespace !== arg1) { 4374 throw new Error("argument must not contain whitespace"); 4375 } 4376 options = { 4377 escapeChar: (arg2 != null ? arg2.escapeChar : void 0) || defaultOptions.escapeChar, 4378 segmentNameStartChar: (arg2 != null ? arg2.segmentNameStartChar : void 0) || defaultOptions.segmentNameStartChar, 4379 segmentNameCharset: (arg2 != null ? arg2.segmentNameCharset : void 0) || defaultOptions.segmentNameCharset, 4380 segmentValueCharset: (arg2 != null ? arg2.segmentValueCharset : void 0) || defaultOptions.segmentValueCharset, 4381 optionalSegmentStartChar: (arg2 != null ? arg2.optionalSegmentStartChar : void 0) || defaultOptions.optionalSegmentStartChar, 4382 optionalSegmentEndChar: (arg2 != null ? arg2.optionalSegmentEndChar : void 0) || defaultOptions.optionalSegmentEndChar, 4383 wildcardChar: (arg2 != null ? arg2.wildcardChar : void 0) || defaultOptions.wildcardChar 4384 }; 4385 parser = newParser(options); 4386 parsed = parser.pattern(arg1); 4387 if (parsed == null) { 4388 throw new Error("couldn't parse pattern"); 4389 } 4390 if (parsed.rest !== "") { 4391 throw new Error("could only partially parse pattern"); 4392 } 4393 this.ast = parsed.value; 4394 this.regex = new RegExp(astNodeToRegexString(this.ast, options.segmentValueCharset)); 4395 this.names = astNodeToNames(this.ast); 4396 }; 4397 UrlPattern2.prototype.match = function(url) { 4398 var groups, match; 4399 match = this.regex.exec(url); 4400 if (match == null) { 4401 return null; 4402 } 4403 groups = match.slice(1); 4404 if (this.names) { 4405 return keysAndValuesToObject(this.names, groups); 4406 } else { 4407 return groups; 4408 } 4409 }; 4410 UrlPattern2.prototype.stringify = function(params) { 4411 if (params == null) { 4412 params = {}; 4413 } 4414 if (this.isRegex) { 4415 throw new Error("can't stringify patterns generated from a regex"); 4416 } 4417 if (params !== Object(params)) { 4418 throw new Error("argument must be an object or undefined"); 4419 } 4420 return stringify(this.ast, params, {}); 4421 }; 4422 UrlPattern2.escapeForRegex = escapeForRegex; 4423 UrlPattern2.concatMap = concatMap; 4424 UrlPattern2.stringConcatMap = stringConcatMap; 4425 UrlPattern2.regexGroupCount = regexGroupCount; 4426 UrlPattern2.keysAndValuesToObject = keysAndValuesToObject; 4427 UrlPattern2.P = P2; 4428 UrlPattern2.newParser = newParser; 4429 UrlPattern2.defaultOptions = defaultOptions; 4430 UrlPattern2.astNodeToRegexString = astNodeToRegexString; 4431 UrlPattern2.astNodeToNames = astNodeToNames; 4432 UrlPattern2.getParam = getParam; 4433 UrlPattern2.astNodeContainsSegmentsForProvidedParams = astNodeContainsSegmentsForProvidedParams; 4434 UrlPattern2.stringify = stringify; 4435 return UrlPattern2; 4436 }); 4437 }
4437)(urlPattern$1, urlPattern$1.exports); 4438 return urlPattern$1.exports; 4439 } 4440 var urlPatternExports = requireUrlPattern(); 4441 const UrlPattern = /* @__PURE__ */ getDefaultExportFromCjs(urlPatternExports); 4442 class Endpoint { 4443 constructor(path) { 4444 this.path = Endpoint.normalizePath(path); 4445 } 4446 /** Même path quâ`Endpoint` ; le 2áµ générique `U` est propagé sur la clé publisher. */ 4447 getDataProviderKey() { 4448 return new DataProviderKey(this.path); 4449 } 4450 /** 4451 * Trim, refuse le path vide, enlève les `/` en tête (path relatif au `serviceURL`), 4452 * et fusionne les `/` successifs en un seul. 4453 * Pour une URL absolue (`http://` / `https://`), normalise surtout le pathname (pas de `//` redondants). 4454 */ 4455 static normalizePath(path) { 4456 const t2 = String(path).trim(); 4457 if (!t2) { 4458 throw new RangeError("Endpoint: path cannot be empty"); 4459 } 4460 if (/^https?:\/\//i.test(t2)) { 4461 let u2; 4462 try { 4463 u2 = new URL(t2); 4464 } catch { 4465 throw new RangeError("Endpoint: invalid absolute URL"); 4466 } 4467 u2.pathname = u2.pathname.replace(/\/+/g, "/"); 4468 return u2.href; 4469 } 4470 const q = t2.indexOf("?"); 4471 const hash = t2.indexOf("#"); 4472 let end = t2.length; 4473 if (q >= 0) 4474 end = Math.min(end, q); 4475 if (hash >= 0) 4476 end = Math.min(end, hash); 4477 let base = t2.slice(0, end); 4478 const tail = t2.slice(end); 4479 base = base.replace(/^\/+/, ""); 4480 base = base.replace(/\/+/g, "/"); 4481 if (!base && tail) { 4482 throw new RangeError("Endpoint: path cannot be empty"); 4483 } 4484 return base + tail; 4485 } 4486 /** Utile avant construction dynamique. */ 4487 static isNonEmpty(path) { 4488 return String(path).trim().length > 0; 4489 } 4490 /** 4491 * Indique un path local du type `dataProvider(id)â¦` reconnu par `API.get`. 4492 */ 4493 static looksLikeDataProviderPath(path) { 4494 return /^\s*dataProvider\s*\(/i.test(String(path)); 4495 } 4496 toString() { 4497 return this.path; 4498 } 4499 } 4500 const SCROLL_SETTLE_MS = 150; 4501 const RESTORE_EPS = 10; 4502 const JUMP_EPS = 200; 4503 const STICKY_RESTORE_FRAMES = 16; 4504 const states = /* @__PURE__ */ new WeakMap(); 4505 let installed = false; 4506 function isSafariScrollEngine() { 4507 if (typeof navigator === "undefined") 4508 return false; 4509 return /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 4510 } 4511 function read(root) { 4512 if (root === window) { 4513 return { x: window.scrollX, y: window.scrollY }; 4514 } 4515 const el = root; 4516 return { x: el.scrollLeft, y: el.scrollTop }; 4517 } 4518 function write(root, x2, y2) { 4519 if (root === window) { 4520 window.scrollTo(x2, y2); 4521 return; 4522 } 4523 const el = root; 4524 if (typeof el.scrollTo === "function") { 4525 el.scrollTo(x2, y2); 4526 } else { 4527 el.scrollLeft = x2; 4528 el.scrollTop = y2; 4529 } 4530 } 4531 function maxScrollY(root) { 4532 if (root === window) { 4533 const doc = document.documentElement; 4534 return Math.max(0, doc.scrollHeight - window.innerHeight); 4535 } 4536 const el = root; 4537 return Math.max(0, el.scrollHeight - el.clientHeight); 4538 } 4539 function getState(root) { 4540 let s2 = states.get(root); 4541 if (!s2) { 4542 const pos = read(root); 4543 s2 = { 4544 x: pos.x, 4545 y: pos.y, 4546 restoring: false, 4547 watching: false, 4548 userEngaged: false, 4549 raf: 0, 4550 stickyFrames: 0 4551 }; 4552 states.set(root, s2); 4553 } 4554 return s2; 4555 } 4556 function markUserEngaged(root) { 4557 getState(root).userEngaged = true; 4558 } 4559 function armScrollSettle(root) { 4560 const s2 = getState(root); 4561 clearTimeout(s2.settleTimer); 4562 s2.settleTimer = setTimeout(() => { 4563 s2.userEngaged = false; 4564 s2.settleTimer = void 0; 4565 }, SCROLL_SETTLE_MS); 4566 } 4567 function looksLikePhantomDrop(currentY, storedY) { 4568 return storedY - currentY >= JUMP_EPS; 4569 } 4570 function captureScrollRoot(root) { 4571 if (!isSafariScrollEngine()) 4572 return; 4573 const s2 = getState(root); 4574 if (s2.restoring) 4575 return; 4576 const pos = read(root); 4577 if (looksLikePhantomDrop(pos.y, s2.y)) { 4578 stickyRestore(root); 4579 return; 4580 } 4581 s2.x = pos.x; 4582 s2.y = pos.y; 4583 } 4584 function restoreScrollRoot(root) { 4585 if (!isSafariScrollEngine()) 4586 return; 4587 const s2 = getState(root); 4588 const maxY = maxScrollY(root); 4589 const targetX = s2.x; 4590 const targetY = maxY > 0 ? Math.min(s2.y, maxY) : s2.y; 4591 const { x: x2, y: y2 } = read(root); 4592 if (Math.abs(targetX - x2) <= RESTORE_EPS && Math.abs(targetY - y2) <= RESTORE_EPS) { 4593 return; 4594 } 4595 s2.restoring = true; 4596 try { 4597 write(root, targetX, targetY); 4598 } finally { 4599 requestAnimationFrame(() => { 4600 s2.restoring = false;
4601 }); 4602 } 4603 } 4604 function resetScrollRoot(root, position = { x: 0, y: 0 }) { 4605 if (!isSafariScrollEngine()) 4606 return; 4607 const s2 = getState(root); 4608 if (position === "current") { 4609 const pos = read(root); 4610 s2.x = pos.x; 4611 s2.y = pos.y; 4612 return; 4613 } 4614 s2.x = position.x ?? 0; 4615 s2.y = position.y ?? 0; 4616 } 4617 function stickyRestore(root) { 4618 const s2 = getState(root); 4619 s2.stickyFrames = STICKY_RESTORE_FRAMES; 4620 if (s2.raf) 4621 return; 4622 const tick = () => { 4623 s2.raf = 0; 4624 restoreScrollRoot(root); 4625 if (s2.stickyFrames > 0) { 4626 s2.stickyFrames--; 4627 s2.raf = requestAnimationFrame(tick); 4628 } 4629 }; 4630 s2.raf = requestAnimationFrame(tick); 4631 } 4632 function scheduleRestore(root) { 4633 stickyRestore(root); 4634 } 4635 function watchScrollRoot(root) { 4636 if (!isSafariScrollEngine()) 4637 return; 4638 const s2 = getState(root); 4639 if (s2.watching) 4640 return; 4641 s2.watching = true; 4642 const target = root === window ? window : root; 4643 const onScroll = () => { 4644 if (s2.restoring) 4645 return; 4646 const { y: y2 } = read(root); 4647 if (looksLikePhantomDrop(y2, s2.y)) { 4648 stickyRestore(root); 4649 return; 4650 } 4651 if (s2.userEngaged) { 4652 captureScrollRoot(root); 4653 armScrollSettle(root); 4654 return; 4655 } 4656 captureScrollRoot(root); 4657 }; 4658 const isGestureForThisRoot = (e2) => nearestScrollRootFromEvent(e2) === root; 4659 const onUserIntent = (e2) => { 4660 if (!isGestureForThisRoot(e2)) 4661 return; 4662 captureScrollRoot(root); 4663 markUserEngaged(root); 4664 }; 4665 const onUserIntentEnd = (e2) => { 4666 if (!isGestureForThisRoot(e2)) 4667 return; 4668 armScrollSettle(root); 4669 }; 4670 const onWheel = (e2) => { 4671 if (!isGestureForThisRoot(e2)) 4672 return; 4673 captureScrollRoot(root); 4674 markUserEngaged(root); 4675 armScrollSettle(root); 4676 }; 4677 target.addEventListener("scroll", onScroll, { passive: true }); 4678 target.addEventListener("touchstart", onUserIntent, { passive: true }); 4679 target.addEventListener("touchend", onUserIntentEnd, { passive: true }); 4680 target.addEventListener("touchcancel", onUserIntentEnd, { passive: true }); 4681 target.addEventListener("wheel", onWheel, { passive: true }); 4682 target.addEventListener("pointerdown", onUserIntent, { passive: true }); 4683 target.addEventListener("pointerup", onUserIntentEnd, { passive: true }); 4684 target.addEventListener("pointercancel", onUserIntentEnd, { passive: true }); 4685 const pos = read(root); 4686 s2.x = pos.x; 4687 s2.y = pos.y; 4688 if (root === window) { 4689 const ro2 = new ResizeObserver(() => scheduleRestore(window)); 4690 ro2.observe(document.documentElement); 4691 s2.resizeObserver = ro2; 4692 return; 4693 } 4694 const el = root; 4695 const ro = new ResizeObserver(() => scheduleRestore(el)); 4696 ro.observe(el); 4697 for (const child of Array.from(el.children)) { 4698 ro.observe(child); 4699 } 4700 s2.resizeObserver = ro; 4701 const onDomChange = () => scheduleRestore(el); 4702 const mo = new MutationObserver((mutations) => { 4703 for (const mutation of mutations) { 4704 if (mutation.type !== "childList") 4705 continue; 4706 for (const node of Array.from(mutation.addedNodes)) { 4707 if (node instanceof Element) 4708 ro.observe(node); 4709 } 4710 } 4711 onDomChange(); 4712 }); 4713 mo.observe(el, { childList: true, subtree: true, characterData: true }); 4714 const rootNode = el.getRootNode(); 4715 if (rootNode instanceof ShadowRoot && rootNode.host) { 4716 mo.observe(rootNode.host, { 4717 childList: true, 4718 subtree: true, 4719 characterData: true 4720 }); 4721 } 4722 s2.mutationObserver = mo; 4723 } 4724 function nearestScrollRootFromEvent(e2) { 4725 for (const node of e2.composedPath()) { 4726 if (node === window || node === document) 4727 continue; 4728 if (node instanceof HTMLElement && isScrollContainer(node)) { 4729 return node; 4730 } 4731 } 4732 return window; 4733 } 4734 function isScrollContainer(el) { 4735 if (!(el instanceof HTMLElement)) 4736 return false; 4737 if (el === document.documentElement || el === document.body) 4738 return false;
4739 const oy = getComputedStyle(el).overflowY; 4740 return oy === "auto" || oy === "scroll" || oy === "overlay"; 4741 } 4742 function discoverFromEvent(e2) { 4743 for (const node of e2.composedPath()) { 4744 if (node === window || node === document) 4745 continue; 4746 if (node instanceof HTMLElement && isScrollContainer(node)) { 4747 watchScrollRoot(node); 4748 } 4749 } 4750 const engageRoot = nearestScrollRootFromEvent(e2); 4751 watchScrollRoot(engageRoot); 4752 if (e2.type === "wheel") { 4753 captureScrollRoot(engageRoot); 4754 markUserEngaged(engageRoot); 4755 armScrollSettle(engageRoot); 4756 } else if (e2.type === "touchstart" || e2.type === "pointerdown") { 4757 captureScrollRoot(engageRoot); 4758 markUserEngaged(engageRoot); 4759 } 4760 } 4761 function watchScrollContainersInTree(root) { 4762 if (root instanceof Element && root.classList?.contains("custom-scroll")) { 4763 watchScrollRoot(root); 4764 } 4765 root.querySelectorAll?.(".custom-scroll").forEach((el) => { 4766 if (el instanceof HTMLElement) 4767 watchScrollRoot(el); 4768 }); 4769 } 4770 function observeShadowRoot(shadow) { 4771 watchScrollContainersInTree(shadow); 4772 const mo = new MutationObserver((mutations) => { 4773 for (const mutation of mutations) { 4774 for (const node of Array.from(mutation.addedNodes)) { 4775 if (node instanceof Element) 4776 watchScrollContainersInTree(node); 4777 } 4778 } 4779 }); 4780 mo.observe(shadow, { childList: true, subtree: true }); 4781 } 4782 function walkExistingShadows(node) { 4783 node.querySelectorAll?.("*").forEach((el) => { 4784 if (el.shadowRoot) { 4785 observeShadowRoot(el.shadowRoot); 4786 walkExistingShadows(el.shadowRoot); 4787 } 4788 }); 4789 } 4790 function patchAttachShadow() { 4791 const proto = Element.prototype; 4792 if (proto.__safariScrollGuardPatched) 4793 return; 4794 proto.__safariScrollGuardPatched = true; 4795 const nativeAttachShadow = proto.attachShadow; 4796 proto.attachShadow = function attachShadowPatched(init) { 4797 const shadow = nativeAttachShadow.call(this, init); 4798 observeShadowRoot(shadow); 4799 return shadow; 4800 }; 4801 } 4802 function installSafariScrollGuard() { 4803 if (typeof window === "undefined" || installed) 4804 return; 4805 installed = true; 4806 if (!isSafariScrollEngine()) 4807 return; 4808 watchScrollRoot(window); 4809 patchAttachShadow(); 4810 const opts = { capture: true, passive: true }; 4811 window.addEventListener("wheel", discoverFromEvent, opts); 4812 window.addEventListener("touchstart", discoverFromEvent, opts); 4813 window.addEventListener("pointerdown", discoverFromEvent, opts); 4814 const scan = () => { 4815 watchScrollContainersInTree(document); 4816 walkExistingShadows(document); 4817 }; 4818 if (document.readyState === "loading") { 4819 document.addEventListener("DOMContentLoaded", scan, { once: true }); 4820 } else { 4821 scan(); 4822 } 4823 const mo = new MutationObserver((mutations) => { 4824 for (const mutation of mutations) { 4825 for (const node of Array.from(mutation.addedNodes)) { 4826 if (!(node instanceof Element)) 4827 continue; 4828 watchScrollContainersInTree(node); 4829 if (node.shadowRoot) 4830 observeShadowRoot(node.shadowRoot); 4831 walkExistingShadows(node); 4832 } 4833 } 4834 }); 4835 mo.observe(document.documentElement, { childList: true, subtree: true }); 4836 } 4837 const Utils = Utils$1; 4838 const Arrays = Arrays$1; 4839 const DataBindObserver = DataBindObserver$1; 4840 const Format = Format$1; 4841 const HTML = HTML$1; 4842 const LocationHandler = LocationHandler$1; 4843 const Objects = Objects$1; 4844 const api = API; 4845 const URLPattern = UrlPattern; 4846 installSafariScrollGuard(); 4847 window["concorde-utils"] = window["concorde-utils"] || {}; 4848 window["concorde-utils"] = { 4849 Utils, 4850 Arrays, 4851 DataBindObserver, 4852 Format, 4853 HTML, 4854 LocationHandler, 4855 Objects, 4856 PublisherManager, 4857 api, 4858 URLPattern, 4859 Endpoint, 4860 DataProviderKey 4861 }; 4862 function getPublisherFromPath(path) { 4863 const segments2 = path.split(".").filter((segment) => segment.length > 0); 4864 if (segments2.length === 0) 4865 return null; 4866 const dataProvider = segments2.shift() || ""; 4867 if (!dataProvider) 4868 return null; 4869 let publisher = PublisherManager.get(dataProvider); 4870 if (!publisher) 4871 return null; 4872 publisher = Objects.traverse(publisher, segments2); 4873 return publisher; 4874 } 4875 function bindImpl(path, options) { 4876 const reflect = options?.reflect ?? false; 4877 const pathOptions = { 4878 skipEmptyPlaceholder: options?.skipEmptyPlaceholder 4879 }; 4880 const dynamicDependencies = extractDynamicDependencies(path); 4881 const isDynamicPath = dynamicDependencies.length > 0; 4882 return function(target, propertyKey) { 4883 if (!target) 4884 return; 4885 setSubscribable(target); 4886 const stateKey = `__bind_state_${propertyKey}`; 4887 const publisherKey = `__bind_${propertyKey}_publisher__`; 4888 const isUpdatingFromPublisherKey = reflect ? `__bind_${propertyKey}_updating_from_publisher__` : null; 4889 if (reflect) { 4890 const existingDescriptor = Object.getOwnPropertyDescriptor(target, propertyKey); 4891 const internalValueKey = `__bind_${propertyKey}_value__`; 4892 const reflectUpdateFlagKey = `__bind_${propertyKey}_updating_from_publisher__`; 4893 const initialValue = existingDescriptor && !existingDescriptor.get && !existingDescriptor.set ? existingDescriptor.value : void 0; 4894 Object.defineProperty(target, propertyKey, { 4895 get() { 4896 if (existingDescriptor?.get) { 4897 return existingDescriptor.get.call(this); 4898 } 4899 if (!Object.prototype.hasOwnProperty.call(this, internalValueKey) && initialValue !== void 0) { 4900 this[internalValueKey] = initialValue; 4901 } 4902 return this[internalValueKey]; 4903 }, 4904 set(newValue) { 4905 if (existingDescriptor?.set) { 4906 existingDescriptor.set.call(this, newValue); 4907 } else { 4908 this[internalValueKey] = newValue; 4909 } 4910 if (!this[reflectUpdateFlagKey] && this[publisherKey]) { 4911 this[publisherKey].set(newValue); 4912 } 4913 }, 4914 enumerable: existingDescriptor?.enumerable ?? true, 4915 configurable: existingDescriptor?.configurable ?? true 4916 }); 4917 } 4918 target.__onConnected__((component) => { 4919 const state = component[stateKey] || (component[stateKey] = { 4920 cleanupWatchers: [], 4921 unsubscribePublisher: null, 4922 currentPath: null 4923 }); 4924 if (state.unsubscribePublisher) { 4925 state.unsubscribePublisher(); 4926 state.unsubscribePublisher = null; 4927 }
4928 state.cleanupWatchers.forEach((cleanup) => cleanup()); 4929 state.cleanupWatchers = []; 4930 state.currentPath = null; 4931 const subscribeToPath = (resolvedPath) => { 4932 if (!resolvedPath) { 4933 if (state.unsubscribePublisher) { 4934 state.unsubscribePublisher(); 4935 state.unsubscribePublisher = null; 4936 } 4937 state.currentPath = null; 4938 component[publisherKey] = null; 4939 return; 4940 } 4941 if (resolvedPath === state.currentPath) { 4942 return; 4943 } 4944 if (state.unsubscribePublisher) { 4945 state.unsubscribePublisher(); 4946 state.unsubscribePublisher = null; 4947 } 4948 const publisher = getPublisherFromPath(resolvedPath); 4949 if (!publisher) { 4950 state.currentPath = null; 4951 component[publisherKey] = null; 4952 return; 4953 } 4954 const onAssign2 = (value) => { 4955 if (reflect && isUpdatingFromPublisherKey) { 4956 component[isUpdatingFromPublisherKey] = true; 4957 } 4958 component[propertyKey] = value; 4959 if (reflect && isUpdatingFromPublisherKey) { 4960 component[isUpdatingFromPublisherKey] = false; 4961 } 4962 }; 4963 publisher.onAssign(onAssign2); 4964 state.unsubscribePublisher = () => { 4965 publisher.offAssign(onAssign2); 4966 if (component[publisherKey] === publisher) { 4967 component[publisherKey] = null; 4968 } 4969 }; 4970 state.currentPath = resolvedPath; 4971 component[publisherKey] = publisher; 4972 }; 4973 const refreshSubscription = () => { 4974 if (isDynamicPath) { 4975 const resolution = resolveDynamicPath(component, path, pathOptions); 4976 if (!resolution.ready) { 4977 subscribeToPath(null); 4978 return; 4979 } 4980 subscribeToPath(resolution.path); 4981 return; 4982 } 4983 subscribeToPath(path); 4984 }; 4985 if (isDynamicPath) { 4986 for (const dependency of dynamicDependencies) { 4987 const unsubscribe = observeDynamicProperty(bindDynamicWatchKeys.watcherStore, bindDynamicWatchKeys.hooked, component, dependency, () => refreshSubscription()); 4988 state.cleanupWatchers.push(unsubscribe); 4989 } 4990 } 4991 refreshSubscription(); 4992 }); 4993 target.__onDisconnected__((component) => { 4994 const state = component[stateKey]; 4995 if (!state) 4996 return; 4997 if (state.unsubscribePublisher) { 4998 state.unsubscribePublisher(); 4999 state.unsubscribePublisher = null; 5000 } 5001 state.cleanupWatchers.forEach((cleanup) => cleanup()); 5002 state.cleanupWatchers = []; 5003 state.currentPath = null; 5004 component[publisherKey] = null; 5005 }); 5006 }; 5007 } 5008 function bind$1(pathOrKey, options) { 5009 const path = hasPath(pathOrKey) ? pathOrKey.path : pathOrKey; 5010 return bindImpl(path, options); 5011 } 5012 function publish(key, options) { 5013 const path = key.path; 5014 const pathOptions = { 5015 skipEmptyPlaceholder: options?.skipEmptyPlaceholder 5016 }; 5017 const dynamicDependencies = extractDynamicDependencies(path); 5018 return function(target, propertyKey) { 5019 setSubscribable(target); 5020 const publisherKey = `__publish_${propertyKey}_publisher__`; 5021 const internalValueKey = `__publish_${propertyKey}_value__`; 5022 const existingDescriptor = Object.getOwnPropertyDescriptor(target, propertyKey); 5023 const initialValue = existingDescriptor && !existingDescriptor.get && !existingDescriptor.set ? existingDescriptor.value : void 0; 5024 Object.defineProperty(target, propertyKey, { 5025 get() { 5026 if (existingDescriptor?.get) { 5027 return existingDescriptor.get.call(this); 5028 } 5029 if (!Object.prototype.hasOwnProperty.call(this, internalValueKey) && initialValue !== void 0) { 5030 this[internalValueKey] = initialValue; 5031 } 5032 return this[internalValueKey]; 5033 }, 5034 set(newValue) { 5035 if (existingDescriptor?.set) { 5036 existingDescriptor.set.call(this, newValue); 5037 } else { 5038 this[internalValueKey] = newValue; 5039 } 5040 const publisher = this[publisherKey]; 5041 if (publisher) { 5042 publisher.set(newValue); 5043 } 5044 }, 5045 enumerable: existingDescriptor?.enumerable ?? true, 5046 configurable: existingDescriptor?.configurable ?? true 5047 }); 5048 target.__onConnected__((component) => { 5049 const comp = component; 5050 const stateKey = `__publish_state_${propertyKey}`; 5051 const state = comp[stateKey] || (comp[stateKey] = { 5052 cleanupWatchers: [] 5053 }); 5054 const updatePublisher = () => { 5055 let resolvedPath; 5056 if (dynamicDependencies.length) { 5057 const resolution = resolveDynamicPath(component, path, pathOptions); 5058 resolvedPath = resolution.ready ? resolution.path : null; 5059 } else { 5060 resolvedPath = path; 5061 } 5062 const publisher = resolvedPath ? getPublisherFromPath(resolvedPath) : void 0; 5063 comp[publisherKey] = publisher ?? null; 5064 if (publisher && propertyKey in component) { 5065 const currentValue = comp[propertyKey]; 5066 if (currentValue !== void 0) { 5067 publisher.set(currentValue); 5068 } 5069 } 5070 };
5071 state.cleanupWatchers.forEach((cleanup) => cleanup()); 5072 state.cleanupWatchers = []; 5073 if (dynamicDependencies.length) { 5074 for (const dependency of dynamicDependencies) { 5075 state.cleanupWatchers.push(observeDynamicProperty(publishDynamicWatchKeys.watcherStore, publishDynamicWatchKeys.hooked, comp, dependency, updatePublisher)); 5076 } 5077 } 5078 updatePublisher(); 5079 }); 5080 target.__onDisconnected__((component) => { 5081 const comp = component; 5082 const stateKey = `__publish_state_${propertyKey}`; 5083 const state = comp[stateKey]; 5084 if (state?.cleanupWatchers) { 5085 state.cleanupWatchers.forEach((cleanup) => cleanup()); 5086 } 5087 comp[publisherKey] = void 0; 5088 }); 5089 }; 5090 } 5091 function subscribe$1(key) { 5092 return bind$1(key); 5093 } 5094 var Skip; 5095 (function(Skip2) { 5096 Skip2["Nullish"] = "nullish"; 5097 Skip2["EmptyString"] = "emptyString"; 5098 Skip2["EmptyObject"] = "emptyObject"; 5099 Skip2["EmptyArray"] = "emptyArray"; 5100 })(Skip || (Skip = {})); 5101 const SKIP_PREDICATES = { 5102 [Skip.Nullish]: (v2) => v2 === null || v2 === void 0, 5103 [Skip.EmptyString]: (v2) => v2 === "", 5104 [Skip.EmptyObject]: (v2) => typeof v2 === "object" && v2 !== null && !Array.isArray(v2) && Object.keys(v2).length === 0, 5105 [Skip.EmptyArray]: (v2) => Array.isArray(v2) && v2.length === 0 5106 }; 5107 function isSkipped(value, kinds) { 5108 return kinds.some((kind) => SKIP_PREDICATES[kind](value)); 5109 } 5110 function shouldDispatch(currentValues, expectedCount, options) { 5111 if (!options.dispatchWhenUndefined) { 5112 const definedCount = currentValues.slice(0, expectedCount).filter((v2) => v2 !== null && v2 !== void 0).length; 5113 if (definedCount !== expectedCount) 5114 return false; 5115 } 5116 if (options.skip && options.skip.length > 0) { 5117 for (let i2 = 0; i2 < expectedCount; i2++) { 5118 if (isSkipped(currentValues[i2], options.skip)) 5119 return false; 5120 } 5121 } 5122 return true; 5123 } 5124 function onAssign$1(...values) { 5125 return createOnAssign({}, values); 5126 } 5127 function createOnAssign(options, values) { 5128 const pathConfigs = values.map((path) => { 5129 const dynamicDependencies = extractDynamicDependencies(path); 5130 return { 5131 originalPath: path, 5132 dynamicDependencies, 5133 isDynamic: dynamicDependencies.length > 0 5134 }; 5135 }); 5136 const pathOptions = { 5137 skipEmptyPlaceholder: options.skipEmptyPlaceholder 5138 }; 5139 return function(target, _propertyKey, descriptor) { 5140 setSubscribable(target); 5141 const stateKey = `__onAssign_state_${_propertyKey}__`; 5142 let callback; 5143 target.__onConnected__((component) => { 5144 const state = component[stateKey] || (component[stateKey] = { 5145 cleanupWatchers: [], 5146 configurations: [] 5147 }); 5148 state.cleanupWatchers.forEach((cleanup) => cleanup()); 5149 state.cleanupWatchers = []; 5150 state.configurations.forEach((conf) => { 5151 if (conf.unsubscribePublisher) { 5152 conf.unsubscribePublisher(); 5153 } 5154 }); 5155 state.configurations = []; 5156 const onAssignValues = []; 5157 const confs = []; 5158 for (let i2 = 0; i2 < values.length; i2++) { 5159 const pathConfig = pathConfigs[i2]; 5160 const callbacks = /* @__PURE__ */ new Set(); 5161 const onAssign2 = (assignedValue) => { 5162 onAssignValues[i2] = assignedValue; 5163 if (shouldDispatch(onAssignValues, values.length, options)) { 5164 callbacks.forEach((callback2) => callback2(...onAssignValues)); 5165 } 5166 }; 5167 confs.push({ 5168 publisher: null, 5169 onAssign: onAssign2, 5170 callbacks, 5171 unsubscribePublisher: null, 5172 pathConfig, 5173 index: i2 5174 }); 5175 } 5176 const subscribeToPath = (conf, resolvedPath) => { 5177 if (conf.unsubscribePublisher) { 5178 conf.unsubscribePublisher(); 5179 conf.unsubscribePublisher = null; 5180 } 5181 onAssignValues[conf.index] = null; 5182 conf.publisher = null; 5183 if (!resolvedPath) { 5184 return; 5185 } 5186 const publisher = getPublisherFromPath(resolvedPath); 5187 if (!publisher) { 5188 return; 5189 } 5190 publisher.onAssign(conf.onAssign); 5191 conf.unsubscribePublisher = () => { 5192 publisher.offAssign(conf.onAssign); 5193 if (conf.publisher === publisher) { 5194 conf.publisher = null; 5195 } 5196 }; 5197 conf.publisher = publisher; 5198 }; 5199 const refreshSubscriptions = () => { 5200 for (const conf of confs) { 5201 if (conf.pathConfig.isDynamic) { 5202 const resolution = resolveDynamicPath(component, conf.pathConfig.originalPath, pathOptions); 5203 if (!resolution.ready) { 5204 subscribeToPath(conf, null); 5205 continue; 5206 } 5207 subscribeToPath(conf, resolution.path); 5208 } else { 5209 subscribeToPath(conf, conf.pathConfig.originalPath); 5210 } 5211 } 5212 }; 5213 for (const conf of confs) { 5214 if (conf.pathConfig.isDynamic) { 5215 for (const dependency of conf.pathConfig.dynamicDependencies) { 5216 const unsubscribe = observeDynamicProperty(onAssignDynamicWatchKeys.watcherStore, onAssignDynamicWatchKeys.hooked, component, dependency, () => refreshSubscriptions());
5217 state.cleanupWatchers.push(unsubscribe); 5218 } 5219 } 5220 } 5221 callback = descriptor.value.bind(component); 5222 for (const conf of confs) { 5223 conf.callbacks.add(callback); 5224 } 5225 refreshSubscriptions(); 5226 state.configurations = confs; 5227 }); 5228 target.__onDisconnected__((component) => { 5229 const state = component[stateKey]; 5230 if (!state) 5231 return; 5232 state.cleanupWatchers.forEach((cleanup) => cleanup()); 5233 state.cleanupWatchers = []; 5234 state.configurations.forEach((conf) => { 5235 if (conf.unsubscribePublisher) { 5236 conf.unsubscribePublisher(); 5237 } 5238 conf.callbacks.delete(callback); 5239 }); 5240 state.configurations = []; 5241 }); 5242 }; 5243 } 5244 function isDataProviderKey(value) { 5245 return Object.prototype.toString.call(value) === "[object DataProviderKey]"; 5246 } 5247 function handle$1(...args) { 5248 const last = args[args.length - 1]; 5249 const hasOptions = last !== void 0 && !isDataProviderKey(last); 5250 const options = hasOptions ? last : {}; 5251 const keys2 = hasOptions ? args.slice(0, -1) : args; 5252 const paths = keys2.map((key) => key.path); 5253 return createOnAssign({ 5254 dispatchWhenUndefined: !options.waitForAllDefined, 5255 skip: options.skip, 5256 skipEmptyPlaceholder: options.skipEmptyPlaceholder 5257 }, paths); 5258 } 5259 function autoSubscribe() { 5260 return function(target, propertyKey, descriptor) { 5261 let renderId = 0; 5262 const originalMethod = descriptor.value; 5263 const originalDisconnectedCallback = target.constructor.prototype.disconnectedCallback; 5264 target.constructor.prototype.disconnectedCallback = function() { 5265 originalDisconnectedCallback?.apply(this); 5266 this.__removeAutoSubscribe__(); 5267 }; 5268 const originalConnectedCallback = target.connectedCallback; 5269 target.connectedCallback = function() { 5270 originalConnectedCallback?.call(this); 5271 this[propertyKey](); 5272 }; 5273 descriptor.value = function(...args) { 5274 let publishers = /* @__PURE__ */ new Set(); 5275 const onAssign2 = () => { 5276 renderId++; 5277 const id = renderId; 5278 window.queueMicrotask(() => { 5279 if (id !== renderId) 5280 return; 5281 this[propertyKey](); 5282 }); 5283 }; 5284 publishers.forEach((publisher) => { 5285 publisher.offAssign(onAssign2); 5286 }); 5287 collectModifiedPublisher(); 5288 const result = originalMethod.apply(this, args); 5289 publishers = getModifiedPublishers() || /* @__PURE__ */ new Set(); 5290 publishers.forEach((publisher) => { 5291 publisher.onAssign(onAssign2, false); 5292 }); 5293 this.__removeAutoSubscribe__ = () => { 5294 publishers.forEach((publisher) => { 5295 publisher.offAssign(onAssign2); 5296 }); 5297 }; 5298 return result; 5299 }; 5300 }; 5301 } 5302 function autoFill(values) { 5303 return function(target) { 5304 setSubscribable(target); 5305 for (const value of values) { 5306 const split = value.split("."); 5307 if (split.length === 0) { 5308 continue; 5309 } 5310 const dataProvider = split.shift() || ""; 5311 let publisher = PublisherManager.get(dataProvider); 5312 publisher = Objects.traverse(publisher, split); 5313 target.__onConnected__((component) => { 5314 publisher.startTemplateFilling(component); 5315 }); 5316 target.__onDisconnected__(() => { 5317 }); 5318 } 5319 }; 5320 } 5321 function walkAncestorElements(node) { 5322 const elements = []; 5323 let current2 = node; 5324 while (current2) { 5325 if (current2 instanceof Element) { 5326 elements.push(current2); 5327 } 5328 const parent = current2.parentNode || (current2.host ?? null); 5329 current2 = parent; 5330 } 5331 return elements; 5332 } 5333 function attachAncestorChainObservers(subscription, onMutation) { 5334 const observers = []; 5335 let disconnected = false; 5336 const attributeFilter = HTML$1.scopeAttributeNames(subscription.attributeName); 5337 const reconnect = () => { 5338 for (const observer of observers) { 5339 observer.disconnect(); 5340 } 5341 observers.length = 0; 5342 if (disconnected) 5343 return; 5344 for (const element of walkAncestorElements(subscription.component)) {
5345 const observer = new MutationObserver((records) => { 5346 if (disconnected) 5347 return; 5348 if (records.some((record) => record.type === "childList")) { 5349 reconnect(); 5350 } 5351 onMutation(); 5352 }); 5353 observer.observe(element, { 5354 attributes: true, 5355 attributeFilter, 5356 childList: true, 5357 subtree: false 5358 }); 5359 observers.push(observer); 5360 } 5361 }; 5362 reconnect(); 5363 return () => { 5364 disconnected = true; 5365 for (const observer of observers) { 5366 observer.disconnect(); 5367 } 5368 observers.length = 0; 5369 }; 5370 } 5371 function syncAncestorAttributeValue(component, attributeName, propertyKey, options) { 5372 const record = component; 5373 const value = HTML$1.getAncestorAttributeValue(component, attributeName); 5374 if (!options.assignNull && value === null) 5375 return; 5376 if (!Object.is(record[propertyKey], value)) { 5377 record[propertyKey] = value; 5378 } 5379 } 5380 class AncestorAttributeObserver { 5381 /** 5382 * Enregistre un composant en mode `{ dynamic: true }`. 5383 * Le `unsubscribe` retourné doit être appelé au `disconnectedCallback`. 5384 */ 5385 static subscribe(component, attributeName, propertyKey, syncOptions = { assignNull: true }) { 5386 const subscription = { 5387 component, 5388 attributeName, 5389 propertyKey, 5390 syncOptions, 5391 disconnectObservers: null 5392 }; 5393 subscription.disconnectObservers = attachAncestorChainObservers(subscription, () => { 5394 if (!AncestorAttributeObserver.subscriptions.has(subscription)) 5395 return; 5396 AncestorAttributeObserver.pendingRefresh.add(subscription); 5397 AncestorAttributeObserver.scheduleRefresh(); 5398 }); 5399 AncestorAttributeObserver.subscriptions.add(subscription); 5400 return () => { 5401 AncestorAttributeObserver.unsubscribe(subscription); 5402 }; 5403 } 5404 /** Coupe les observateurs et retire l'abonnement (pas de fuite après disconnect). */ 5405 static unsubscribe(subscription) { 5406 if (!AncestorAttributeObserver.subscriptions.has(subscription)) 5407 return; 5408 subscription.disconnectObservers?.(); 5409 subscription.disconnectObservers = null; 5410 AncestorAttributeObserver.subscriptions.delete(subscription); 5411 AncestorAttributeObserver.pendingRefresh.delete(subscription); 5412 if (AncestorAttributeObserver.subscriptions.size === 0) { 5413 AncestorAttributeObserver.cancelScheduledRefresh(); 5414 } 5415 } 5416 static scheduleRefresh() { 5417 if (AncestorAttributeObserver.pendingRefresh.size === 0) 5418 return; 5419 if (AncestorAttributeObserver.animationFrameId !== null) 5420 return; 5421 AncestorAttributeObserver.animationFrameId = requestAnimationFrame(() => { 5422 AncestorAttributeObserver.flushRefresh(); 5423 }); 5424 } 5425 static cancelScheduledRefresh() { 5426 if (AncestorAttributeObserver.animationFrameId !== null) { 5427 cancelAnimationFrame(AncestorAttributeObserver.animationFrameId); 5428 AncestorAttributeObserver.animationFrameId = null; 5429 } 5430 AncestorAttributeObserver.pendingRefresh.clear(); 5431 } 5432 static flushRefresh() { 5433 AncestorAttributeObserver.animationFrameId = null; 5434 const subscriptions = Array.from(AncestorAttributeObserver.pendingRefresh); 5435 AncestorAttributeObserver.pendingRefresh.clear(); 5436 for (const subscription of subscriptions) { 5437 if (!AncestorAttributeObserver.subscriptions.has(subscription)) 5438 continue; 5439 if (!subscription.component.isConnected) 5440 continue; 5441 syncAncestorAttributeValue(subscription.component, subscription.attributeName, subscription.propertyKey, subscription.syncOptions); 5442 } 5443 } 5444 } 5445 AncestorAttributeObserver.subscriptions = /* @__PURE__ */ new Set(); 5446 AncestorAttributeObserver.pendingRefresh = /* @__PURE__ */ new Set(); 5447 AncestorAttributeObserver.animationFrameId = null; 5448 function ancestorAttribute$1(attributeName, options) { 5449 const dynamic = options?.dynamic ?? false; 5450 const assignNull = dynamic; 5451 return function(target, propertyKey) { 5452 if (!target) 5453 return; 5454 setSubscribable(target); 5455 target.__onBeforeConnected__((component) => { 5456 syncAncestorAttributeValue(component, attributeName, propertyKey, { 5457 assignNull 5458 }); 5459 }); 5460 if (!dynamic) 5461 return; 5462 let unsubscribe = null; 5463 target.__onConnected__((component) => { 5464 unsubscribe = AncestorAttributeObserver.subscribe(component, attributeName, propertyKey, { assignNull: true }); 5465 }); 5466 target.__onDisconnected__(() => { 5467 unsubscribe?.(); 5468 unsubscribe = null; 5469 }); 5470 }; 5471 } 5472 var __decorate$Z = function(decorators, target, key, desc) { 5473 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 5474 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 5475 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 5476 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 5477 }; 5478 const property = (options) => { 5479 const result = n$5(options); 5480 return result; 5481 }; 5482 const tagName$2R = "sonic-icon"; 5483 let Icon = class Icon extends i$6 { 5484 constructor() { 5485 super(...arguments); 5486 this.iconText = ""; 5487 this.name = ""; 5488 this.prefix = ""; 5489 this.library = ""; 5490 this.customIconLibraryPath = null; 5491 this.customIconDefaultPrefix = null; 5492 } 5493 async updateIcon() { 5494 this.iconText = await Icons.default.get({ 5495 name: this.name, 5496 prefix: this.prefix, 5497 library: this.library, 5498 customLibraryPath: this.customIconLibraryPath, 5499 customLibraryDefaultPrefix: this.customIconDefaultPrefix 5500 }); 5501 } 5502 connectedCallback() { 5503 this.setAttribute("aria-hidden", "true"); 5504 super.connectedCallback(); 5505 } 5506 willUpdate(changedProperties) { 5507 if (changedProperties.has("name") || changedProperties.has("prefix") || changedProperties.has("library") || this.library === "custom" && (changedProperties.has("customIconLibraryPath") || changedProperties.has("customIconDefaultPrefix"))) { 5508 this.updateIcon(); 5509 } 5510 super.willUpdate(changedProperties); 5511 } 5512 render() { 5513 if (!this.iconText) { 5514 return A$1; 5515 } 5516 return this.iconText; 5517 } 5518 }; 5519 Icon.styles = i$9` 5520 :host { 5521 line-height: 0.1em; 5522 width: fit-content; 5523 height: fit-content; 5524 vertical-align: -0.125em; 5525 flex-shrink: 0; 5526 } 5527 5528 svg { 5529 height: var(--_sc-icon-size, 1em); 5530 width: calc(var(--_sc-icon-size, 1em) * 1.4); 5531 overflow: visible; 5532 } 5533 5534 svg:not([fill="none"]) { 5535 fill: currentColor; 5536 } 5537 5538 svg[fill="none"] { 5539 stroke-width: 2; 5540 } 5541 5542 :host([size="2xs"]) svg { 5543 --_sc-icon-size: 0.625em; 5544 } 5545 5546 :host([size="xs"]) svg { 5547 --_sc-icon-size: 0.75em; 5548 } 5549 5550 :host([size="sm"]) svg { 5551 --_sc-icon-size: 0.875em; 5552 } 5553 5554 :host([size="lg"]) svg { 5555 --_sc-icon-size: 1.25em; 5556 } 5557 5558 :host([size="xl"]) svg { 5559 --_sc-icon-size: 1.5em; 5560 } 5561 5562 :host([size="2xl"]) svg { 5563 --_sc-icon-size: 2em; 5564 } 5565 5566 :host([size="3xl"]) svg { 5567 --_sc-icon-size: 2.8em; 5568 } 5569 `; 5570 __decorate$Z([ 5571 r$5() 5572 ], Icon.prototype, "iconText", void 0); 5573 __decorate$Z([
5574 property({ type: String }) 5575 ], Icon.prototype, "name", void 0); 5576 __decorate$Z([ 5577 property({ type: String }) 5578 ], Icon.prototype, "prefix", void 0); 5579 __decorate$Z([ 5580 property({ type: String }) 5581 ], Icon.prototype, "library", void 0); 5582 __decorate$Z([ 5583 ancestorAttribute$1("customIconLibraryPath", { dynamic: true }), 5584 r$5() 5585 ], Icon.prototype, "customIconLibraryPath", void 0); 5586 __decorate$Z([ 5587 ancestorAttribute$1("customIconDefaultPrefix", { dynamic: true }), 5588 r$5() 5589 ], Icon.prototype, "customIconDefaultPrefix", void 0); 5590 Icon = __decorate$Z([ 5591 t$3(tagName$2R) 5592 ], Icon); 5593 const o$4 = (o2) => o2 ?? A$1; 5594 const n$1 = "important", i$2 = " !" + n$1, o$3 = e$5(class extends i$4 { 5595 constructor(t2) { 5596 if (super(t2), t2.type !== t$1.ATTRIBUTE || "style" !== t2.name || t2.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute."); 5597 } 5598 render(t2) { 5599 return Object.keys(t2).reduce((e2, r2) => { 5600 const s2 = t2[r2]; 5601 return null == s2 ? e2 : e2 + `${r2 = r2.includes("-") ? r2 : r2.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s2};`; 5602 }, ""); 5603 } 5604 update(e2, [r2]) { 5605 const { style: s2 } = e2.element; 5606 if (void 0 === this.ft) return this.ft = new Set(Object.keys(r2)), this.render(r2); 5607 for (const t2 of this.ft) null == r2[t2] && (this.ft.delete(t2), t2.includes("-") ? s2.removeProperty(t2) : s2[t2] = null); 5608 for (const t2 in r2) { 5609 const e3 = r2[t2]; 5610 if (null != e3) { 5611 this.ft.add(t2); 5612 const r3 = "string" == typeof e3 && e3.endsWith(i$2); 5613 t2.includes("-") || r3 ? s2.setProperty(t2, r3 ? e3.slice(0, -11) : e3, r3 ? n$1 : "") : s2[t2] = e3; 5614 } 5615 } 5616 return E; 5617 } 5618 }); 5619 installSafariScrollGuard(); 5620 const customScroll = i$9` 5621 .custom-scroll { 5622 overflow: auto !important; 5623 overflow-y: overlay !important; 5624 } 5625 5626 @media (hover: hover) { 5627 .custom-scroll::-webkit-scrollbar {
5628 width: 0.5rem; 5629 height: 0.5rem; 5630 border: solid 0.15rem transparent; 5631 border-radius: var(--sc-rounded); 5632 background: transparent; 5633 } 5634 5635 .custom-scroll::-webkit-scrollbar-thumb { 5636 box-shadow: inset 0 0 2rem 2rem 5637 var(--sc-scrollbar-bg, var(--sc-base-400, var(--sc-base-content, #000))); 5638 border-radius: var(--sc-rounded); 5639 border: solid 0.15rem transparent; 5640 } 5641 } 5642`; 5643 var __decorate$Y = function(decorators, target, key, desc) { 5644 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 5645 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 5646 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 5647 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 5648 }; 5649 const icon$1 = { 5650 warning: "warning-circled-outline", 5651 success: "check-circled-outline", 5652 error: "warning-circled-outline", 5653 info: "info-empty" 5654 }; 5655 const tagName$2Q = "sonic-toast-item"; 5656 let SonicToastItem = class SonicToastItem extends i$6 { 5657 constructor() { 5658 super(...arguments); 5659 this.title = ""; 5660 this.id = ""; 5661 this.text = ""; 5662 this.status = ""; 5663 this.ghost = false; 5664 this.preserve = false; 5665 this.dismissForever = false; 5666 this.maxHeight = "10rem"; 5667 this.visible = true; 5668 this._titleId = ""; 5669 } 5670 // @queryAssignedElements({flatten: true, slot: main"}) 5671 // textSlot!: HTMLElement[]; 5672 /** 5673 * Retourne le rôle ARIA approprié selon le statut du toast 5674 * - "alert" pour les erreurs (messages critiques) - implique déjà aria-live="assertive" 5675 * - "status" pour les autres (messages informatifs) 5676 */ 5677 getAriaRole() { 5678 return this.status === "error" ? "alert" : "status"; 5679 } 5680 /** 5681 * Retourne la valeur aria-live appropriée selon le statut 5682 * - null pour les erreurs car role="alert" implique déjà aria-live="assertive" 5683 * - "polite" pour les autres (peut attendre) 5684 */ 5685 getAriaLive() { 5686 return this.status === "error" ? null : "polite"; 5687 } 5688 /** 5689 * Génère et mémorise un ID unique pour le titre du toast 5690 */ 5691 getTitleId() { 5692 if (this._titleId) { 5693 return this._titleId; 5694 } 5695 this._titleId = this.id ? `toast-title-${this.id}` : `toast-title-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`; 5696 return this._titleId; 5697 } 5698 /** 5699 * Génère un label ARIA descriptif pour le bouton de fermeture 5700 */ 5701 getCloseButtonLabel() { 5702 const statusLabels = { 5703 error: "Fermer le message d'erreur", 5704 warning: "Fermer l'avertissement", 5705 success: "Fermer le message de succès", 5706 info: "Fermer l'information" 5707 }; 5708 const statusLabel = this.status ? statusLabels[this.status] || "Fermer la notification" : "Fermer la notification"; 5709 return statusLabel; 5710 } 5711 render() { 5712 if (this.dismissForever) { 5713 const dismissed = localStorage.getItem("sonic-toast-dismissed") || "{}"; 5714 const dismissedObj = JSON.parse(dismissed); 5715 if (dismissedObj[this.id]) { 5716 return A$1; 5717 } 5718 } 5719 if (!this.visible) { 5720 return A$1; 5721 } 5722 const titleId = this.title ? this.getTitleId() : void 0; 5723 const ariaLabel = !this.title && this.text ? this.text.length > 100 ? this.text.substring(0, 100).replace(/\s+\S*$/, "") + "..." : this.text : void 0; 5724 const ariaLive = this.getAriaLive(); 5725 return b$1`<div 5726 class="sonic-toast ${this.status} ${this.ghost ? "ghost" : ""}" 5727 role=${this.getAriaRole()} 5728 aria-live=${ariaLive || A$1} 5729 aria-atomic="true" 5730 aria-label=${ariaLabel || A$1} 5731 > 5732 <button 5733 aria-label=${this.getCloseButtonLabel()} 5734 class="sonic-toast-close" 5735 @click=${() => this.hide()} 5736 > 5737 <sonic-icon name="cancel" size="lg"></sonic-icon> 5738 </button> 5739 <div 5740 class="sonic-toast-content custom-scroll" 5741 style="max-height: ${this.maxHeight} ;" 5742 > 5743 ${this.status && b$1`<sonic-icon 5744 name=${icon$1[this.status]} 5745 class="sonic-toast-icon" 5746 size="2xl" 5747 aria-hidden="true" 5748 ></sonic-icon>`} 5749 5750 <div class="sonic-toast-text"> 5751 ${this.title ? b$1`<div class="sonic-toast-title" id=${titleId}> 5752 ${this.title} 5753 </div>` : ""} 5754 ${this.text ? o$6(this.text) : ""} 5755 <slot></slot> 5756 </div> 5757 5758 ${!this.preserve ? this.autoHide() : ""} 5759 </div> 5760 </div>`; 5761 } 5762 hide() { 5763 if (!HTML.getClosestElement(this, "sonic-toast")) { 5764 this.visible = false;
5765 } 5766 if (this.dismissForever) { 5767 const dismissed = localStorage.getItem("sonic-toast-dismissed") || "{}"; 5768 const dismissedObj = JSON.parse(dismissed); 5769 dismissedObj[this.id] = true; 5770 localStorage.setItem("sonic-toast-dismissed", JSON.stringify(dismissedObj)); 5771 } 5772 this.dispatchEvent(new CustomEvent("hide", { bubbles: true })); 5773 } 5774 show() { 5775 this.visible = true; 5776 } 5777 autoHide() { 5778 setTimeout(() => { 5779 this.hide(); 5780 }, 6e3); 5781 } 5782 }; 5783 SonicToastItem.styles = [ 5784 customScroll, 5785 i$9` 5786 * { 5787 box-sizing: border-box; 5788 } 5789 :host { 5790 display: block; 5791 pointer-events: auto; 5792 position: relative; 5793 --sc-toast-status-color: transparent; 5794 --sc-toast-color: var(--sc-base-content, #000); 5795 --sc-toast-bg: var(--sc-base, #fff); 5796 --sc-toast-rounded: var(--sc-rounded-md); 5797 --sc-toast-shadow: var(--sc-shadow-lg); 5798 } 5799 5800 .fixed-area { 5801 position: fixed; 5802 bottom: 1.25rem; 5803 right: 1.25rem; 5804 z-index: 10000; 5805 display: flex; 5806 flex-direction: column-reverse; 5807 } 5808 5809 .sonic-toast { 5810 position: relative; 5811 pointer-events: auto; 5812 overflow: hidden; 5813 line-height: 1.25; 5814 color: var(--sc-toast-color); 5815 box-shadow: var(--sc-toast-shadow); 5816 border-radius: var(--sc-toast-rounded); 5817 background: var(--sc-toast-bg); 5818 } 5819 5820 .sonic-toast-content { 5821 padding: 1em 2.5rem 1em 1em; 5822 display: flex; 5823 gap: 0.5rem; 5824 overflow: auto; 5825 position: relative; 5826 } 5827 5828 .sonic-toast-text { 5829 align-self: center; 5830 margin-top: auto; 5831 margin-bottom: auto; 5832 max-width: 70ch; 5833 line-height: 1.2; 5834 } 5835 5836 ::slotted(a:not(.btn)), 5837 .sonic-toast-text a { 5838 color: inherit !important; 5839 text-decoration: underline !important; 5840 text-underline-offset: 0.15rem; 5841 } 5842 5843 ::slotted(:is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6)), 5844 .sonic-toast-text :is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6) { 5845 margin: 0 0 0.3em !important; 5846 } 5847 5848 ::slotted(li), 5849 .sonic-toast-text li { 5850 margin-bottom: 0.15em !important; 5851 } 5852 5853 ::slotted(:is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6):last-child), 5854 .sonic-toast-text 5855 > :is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6):last-child { 5856 margin-bottom: 0 !important; 5857 } 5858 5859 /*BUTTON CLOSE*/ 5860 .sonic-toast-close { 5861 all: unset; 5862 position: absolute; 5863 z-index: 4; 5864 pointer-events: initial; 5865 right: 0.5em; 5866 top: 0.5em; 5867 width: 1.5rem; 5868 height: 1.5rem; 5869 cursor: pointer; 5870 display: inline-flex; 5871 align-items: center; 5872 justify-content: center; 5873 border-radius: 50%; 5874 text-align: center; 5875 opacity: 0.5; 5876 background: rgba(0, 0, 0, 0); 5877 } 5878 5879 .sonic-toast-close:focus, 5880 .sonic-toast-close:hover { 5881 opacity: 1; 5882 background: rgba(0, 0, 0, 0.075); 5883 } 5884 5885 .sonic-toast-close svg { 5886 width: 1rem; 5887 height: 1rem; 5888 object-fit: contain; 5889 object-position: center center; 5890 } 5891 5892 /*Title*/ 5893 .sonic-toast-title { 5894 font-weight: bold; 5895 font-size: 1.15rem; 5896 margin: 0.15em 0 0.25em; 5897 line-height: 1.2; 5898 } 5899 5900 /*STATUS*/ 5901 .success { 5902 --sc-toast-status-color: var( 5903 --sc-success, 5904 var(--sc-base-content, #000) 5905 ); 5906 } 5907 5908 .error { 5909 --sc-toast-status-color: var(--sc-danger, var(--sc-base-content, #000)); 5910 } 5911 5912 .warning { 5913 --sc-toast-status-color: var( 5914 --sc-warning, 5915 var(--sc-base-content, #000) 5916 ); 5917 } 5918 5919 .info { 5920 --sc-toast-status-color: var(--sc-info, var(--sc-base-content, #000)); 5921 } 5922 5923 .success, 5924 .error, 5925 .info, 5926 .warning { 5927 border-top: 3px solid var(--sc-toast-status-color, currentColor); 5928 } 5929 5930 .sonic-toast:before { 5931 content: ""; 5932 display: block; 5933 position: absolute; 5934 left: 0; 5935 top: 0; 5936 right: 0; 5937 bottom: 0; 5938 opacity: 0.05; 5939 pointer-events: none; 5940 transition: 0.2s; 5941 border-radius: var(--sc-toast-rounded); 5942 background-color: var(--sc-toast-status-color); 5943 } 5944 5945 .sonic-toast:hover:before { 5946 opacity: 0.025; 5947 } 5948 5949 .info .sonic-toast-icon, 5950 .error .sonic-toast-icon, 5951 .success .sonic-toast-icon, 5952 .warning .sonic-toast-icon { 5953 color: var(--sc-toast-status-color, currentColor); 5954 } 5955 5956 .sonic-toast-icon { 5957 position: sticky; 5958 top: 0; 5959 } 5960 5961 .ghost { 5962 opacity: 0.85; 5963 pointer-events: none; 5964 } 5965 ` 5966 ]; 5967 __decorate$Y([ 5968 n$5({ type: String }) 5969 ], SonicToastItem.prototype, "title", void 0); 5970 __decorate$Y([ 5971 n$5({ type: String }) 5972 ], SonicToastItem.prototype, "id", void 0); 5973 __decorate$Y([ 5974 n$5({ type: String }) 5975 ], SonicToastItem.prototype, "text", void 0); 5976 __decorate$Y([ 5977 n$5({ type: String }) 5978 ], SonicToastItem.prototype, "status", void 0); 5979 __decorate$Y([ 5980 n$5({ type: Boolean }) 5981 ], SonicToastItem.prototype, "ghost", void 0); 5982 __decorate$Y([ 5983 n$5({ type: Boolean }) 5984 ], SonicToastItem.prototype, "preserve", void 0); 5985 __decorate$Y([ 5986 n$5({ type: Boolean }) 5987 ], SonicToastItem.prototype, "dismissForever", void 0); 5988 __decorate$Y([ 5989 n$5({ type: String }) 5990 ], SonicToastItem.prototype, "maxHeight", void 0); 5991 __decorate$Y([ 5992 r$5() 5993 ], SonicToastItem.prototype, "visible", void 0); 5994 __decorate$Y([ 5995 r$5() 5996 ], SonicToastItem.prototype, "_titleId", void 0); 5997 SonicToastItem = __decorate$Y([ 5998 t$3(tagName$2Q) 5999 ], SonicToastItem); 6000 const coreVariables = i$9` 6001 :host { 6002 /* POLICES */ 6003 /* 6004 --sc-font-family-base: "Inter var", "Inter", -apple-system, system-ui, 6005 BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, 6006 sans-serif; 6007 --sc-font-weight-base: 400; 6008 --sc-font-style-base: normal; 6009 6010 --sc-headings-font-family: var(--sc-font-family-base, sans-serif); 6011 --sc-headings-font-style: var(--sc-font-style-base, normal); 6012 --sc-headings-line-height: 1.1; 6013 --sc-headings-font-weight: 700; 6014 */ 6015 6016 /* ROUNDED*/ 6017 --sc-rounded-sm: calc(var(--sc-rounded, 0px) * 0.5); 6018 --sc-rounded: 0.375rem; 6019 --sc-rounded-md: calc(var(--sc-rounded, 0px) * 1.8); 6020 --sc-rounded-lg: calc(var(--sc-rounded, 0px) * 3); 6021 --sc-rounded-xl: calc(var(--sc-rounded, 0px) * 7); 6022 6023 /* BOUTONS */ 6024 /* 6025 --sc-btn-font-family: var(--sc-font-family-base, sans-serif); * 6026 --sc-btn-font-weight: 500; 6027 */ 6028 6029 /* Placeholder */ 6030 /*--sc-placeholder-bg: rgba(17, 24, 39, 0.05); */ 6031
6032 /* 4 for rounded full*/ 6033 --sc-btn-rounded-intensity: 1.4; 6034 --sc-rounded-size-intensity: calc((1em - 1rem) * 0.4); 6035 --sc-btn-rounded: calc( 6036 (var(--sc-rounded, 0px) + var(--sc-rounded-size-intensity)) * 6037 var(--sc-btn-rounded-intensity) 6038 ); 6039 6040 /* OMBRES */ 6041 --sc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 6042 0 1px 2px -1px rgb(0 0 0 / 0.1); 6043 --sc-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 6044 0 2px 4px -2px rgb(0 0 0 / 0.1); 6045 --sc-shadow-lg: 0 10px 15px 0px rgb(0 0 0 / 0.1), 6046 0 4px 6px -4px rgb(0 0 0 / 0.1); 6047 --sc-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 6048 0 8px 10px -6px rgb(0 0 0 / 0.1); 6049 --sc-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25); 6050 6051 /* Forms */ 6052 --sc-border-width: max(1px, 0.12rem); 6053 --sc-border-color: var(--sc-base-100, var(--sc-base-content, #000)); 6054 /*--sc-form-height: 2.5em; */ /*ok*/ 6055 --sc-form-border-width: var(--sc-border-width); 6056 --sc-input-bg: var(--sc-base-100, rgba(0, 0, 0, 0.07)); 6057 --sc-input-border-color: var(--sc-input-bg); 6058 --sc-input-rounded-intensity: 1.4; 6059 --sc-input-rounded: calc( 6060 (var(--sc-rounded, 0px) + var(--sc-rounded-size-intensity)) * 6061 var(--sc-input-rounded-intensity) 6062 ); 6063 /*formulaires*/ 6064 --sc-input-color: var(--sc-base-content, #000); 6065 6066 /* CONTRAST */ 6067 /* -- ex : Text on images */ 6068 --sc-contrast-content: #fff; 6069 --sc-contrast: #000000; 6070 } 6071`; 6072 const light = i$9` 6073 :host([theme="light"]) { 6074 /*Boutons*/ 6075 --sc-primary: var(--sc-base-800); 6076 --sc-info: #2563eb; 6077 --sc-danger: #f43f5e; 6078 --sc-warning: #f97316; 6079 --sc-success: #14b8a6; 6080 6081 --sc-primary-content: var(--sc-base, #fff); 6082 --sc-info-content: var(--sc-base, #fff); 6083 --sc-danger-content: var(--sc-base, #fff); 6084 --sc-warning-content: var(--sc-base, #fff); 6085 --sc-success-content: var(--sc-base, #fff); 6086 6087 /*Bases*/ 6088 --sc-base: #fff; 6089 --sc-base-50: #f8fafc; 6090 --sc-base-100: #f1f5f9; 6091 --sc-base-200: #e2e8f0; 6092 --sc-base-300: #cbd5e1; 6093 --sc-base-400: #94a3b8; 6094 --sc-base-500: #64748b; 6095 --sc-base-600: #475569; 6096 --sc-base-700: #334155; 6097 --sc-base-800: #1e293b; 6098 --sc-base-900: #0f172a; 6099 --sc-base-content: var(--sc-base-700); 6100 } 6101`; 6102 const darkCss = i$9` 6103 --sc-primary: var(--sc-dark-primary, var(--sc-base-700)); 6104 --sc-info: var(--sc-dark-info, #3abff8); 6105 --sc-danger: var(--sc-dark-danger, #f87272); 6106 --sc-warning: var(--sc-dark-warning, #fbbd23); 6107 --sc-success: var(--sc-dark-success, #36d399); 6108 6109 --sc-primary-content: var(--sc-dark-primary-content, #002b3d); 6110 --sc-info-content: var(--sc-dark-info-content, #002b3d); 6111 --sc-danger-content: var(--sc-dark-danger-content, #382800); 6112 --sc-warning-content: var(--sc-dark-warning-content, #382800); 6113 --sc-success-content: var(--sc-dark-success-content, #003320); 6114 6115 --sc-base: var(--sc-dark-base, #1d2634); 6116 --sc-base-50: var(--sc-dark-base-50, #1f2937); 6117 --sc-base-100: var(--sc-dark-base-100, #252c36); 6118 --sc-base-200: var(--sc-dark-base-200, #2c3543); 6119 --sc-base-300: var(--sc-dark-base-300, #38414e); 6120 --sc-base-400: var(--sc-dark-base-400, #515964); 6121 --sc-base-500: var(--sc-dark-base-500, #828891); 6122 --sc-base-600: var(--sc-dark-base-600, #b4b8be); 6123 --sc-base-700: var(--sc-dark-base-700, #cdd0d5); 6124 --sc-base-800: var(--sc-dark-base-800, #d9dce0); 6125 --sc-base-900: var(--sc-dark-base-900, #e5e7eb); 6126 --sc-base-content: var(--sc-dark-base-content, #e5e7eb); 6127`; 6128 const dark = i$9` 6129 :host([theme="dark"]) { 6130 ${darkCss} 6131 } 6132 6133 @media (prefers-color-scheme: dark) { 6134 :host([theme="auto"]) { 6135 ${darkCss} 6136 } 6137 } 6138`; 6139 var __decorate$X = function(decorators, target, key, desc) { 6140 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 6141 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 6142 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 6143 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 6144 }; 6145 var Theme_1; 6146 const tagName$2P = "sonic-theme"; 6147 let Theme = Theme_1 = class Theme extends i$6 { 6148 constructor() { 6149 super(); 6150 this.background = false;
6151 this.color = false; 6152 this.font = false; 6153 Theme_1.instance = this; 6154 } 6155 /** 6156 * retourne le conteneur de tout ce qui pop : popups / modale / tooltip? / dropdown / ... 6157 */ 6158 static getPopContainer() { 6159 return Theme_1.instance || document.body; 6160 } 6161 connectedCallback() { 6162 super.connectedCallback(); 6163 window.addEventListener("message", (e2) => this.receiveMessage(e2), false); 6164 window.dispatchEvent(new CustomEvent("SonicThemeReady")); 6165 this.postCSSVars(); 6166 } 6167 postCSSVars() { 6168 const stylesheets = document.styleSheets; 6169 const ssLength = stylesheets.length; 6170 const fontUrls = []; 6171 for (let i2 = 0; i2 < ssLength; i2++) { 6172 const ss = stylesheets[i2]; 6173 if (ss.href && (ss.href.includes("googleapis") || ss.href.includes("typekit.net"))) 6174 fontUrls.push(ss.href); 6175 } 6176 const theme = { 6177 variables: this.getCssVariables(), 6178 fonts: fontUrls 6179 }; 6180 PublisherManager.get("sonic-theme")?.set(theme); 6181 document.querySelectorAll("iframe").forEach((elt) => elt.contentWindow?.postMessage({ 6182 type: "SonicTheme", 6183 ...theme 6184 }, "*")); 6185 } 6186 receiveMessage(event) { 6187 const data = event.data; 6188 if (!data.type || data.type != "GetSonicTheme") 6189 return; 6190 this.postCSSVars(); 6191 } 6192 getCssVariables() { 6193 const names = []; 6194 const stylesheets = [ 6195 ...Theme_1.styles.map((s2) => s2.styleSheet), 6196 ...Array.from(document.styleSheets) 6197 ]; 6198 for (const stylesheet of stylesheets) { 6199 try { 6200 if (!stylesheet) 6201 continue; 6202 const rules = stylesheet.cssRules; 6203 for (const rule of rules) { 6204 if (!("style" in rule)) 6205 continue; 6206 const style2 = rule.style; 6207 for (const name of style2) { 6208 if (names.includes(name) || name.indexOf("--sc") !== 0) 6209 continue; 6210 names.push(name); 6211 } 6212 } 6213 } catch (e2) { 6214 console.warn("Erreur lors de la récupération des variables CSS"); 6215 } 6216 } 6217 const style = window.getComputedStyle(this); 6218 const result = {}; 6219 names.forEach((name) => result[name] = style.getPropertyValue(name)); 6220 return result; 6221 } 6222 render() { 6223 return b$1`<slot></slot>`; 6224 } 6225 }; 6226 Theme.styles = [ 6227 light, 6228 dark, 6229 coreVariables, 6230 i$9` 6231 :host([color]) { 6232 color: var(--sc-base-content, #000); 6233 } 6234 6235 :host([font]) { 6236 font-family: var(--sc-font-family-base, sans-serif); 6237 font-weight: var(--sc-font-weight-base, 400); 6238 font-style: var(--sc-font-style-base, normal); 6239 } 6240 ::slotted(.sonic-pop-content) { 6241 max-width: 100vw; 6242 background-color: var(--sc-base, #fff); 6243 position: fixed; 6244 z-index: 99999; 6245 display: block; 6246 transform: translateY(1rem) scale(0.95); 6247 pointer-events: none; 6248 transition-duration: 0.15s; 6249 transition-timing-function: ease; 6250 6251 transition-property: scale, opacity; 6252 border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em); 6253 } 6254 6255 ::slotted(.sonic-pop-content).is-open:not(.is-empty) { 6256 transform: translateY(0) scale(1); 6257 opacity: 1; 6258 pointer-events: auto; 6259 transition-property: scale, opacity; 6260 transition-timing-function: cubic-bezier(0.25, 0.25, 0.42, 1.225); 6261 } 6262 ` 6263 ]; 6264 __decorate$X([ 6265 n$5({ type: String, reflect: true }) 6266 ], Theme.prototype, "theme", void 0); 6267 __decorate$X([ 6268 n$5({ type: Boolean, reflect: true }) 6269 ], Theme.prototype, "background", void 0); 6270 __decorate$X([ 6271 n$5({ type: Boolean, reflect: true }) 6272 ], Theme.prototype, "color", void 0); 6273 __decorate$X([ 6274 n$5({ type: Boolean, reflect: true }) 6275 ], Theme.prototype, "font", void 0); 6276 Theme = Theme_1 = __decorate$X([ 6277 t$3(tagName$2P) 6278 ], Theme); 6279 var __decorate$W = function(decorators, target, key, desc) { 6280 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 6281 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 6282 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 6283 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 6284 }; 6285 var SonicToast_1; 6286 const tagName$2O = "sonic-toast"; 6287 let SonicToast = SonicToast_1 = class SonicToast extends i$6 { 6288 constructor() { 6289 super(...arguments); 6290 this.toasts = []; 6291 } 6292 createRenderRoot() { 6293 return this; 6294 } 6295 render() { 6296 const isIframe = !(window.parent == window); 6297 let styles2 = { 6298 pointerEvents: "none", 6299 gap: "1rem", 6300 display: "flex", 6301 margin: this.toasts.length ? "1rem" : "0" 6302 }; 6303 if (!isIframe) { 6304 styles2 = { 6305 ...styles2, 6306 margin: "0", 6307 width: "calc(100% - 2.5rem)", 6308 position: "fixed", 6309 bottom: "1.25rem", 6310 right: "1.25rem", 6311 zIndex: "10000", 6312 maxWidth: "64ch", 6313 flexDirection: "column-reverse" 6314 }; 6315 } 6316 SonicToast_1.handleExistingToastDelegation(); 6317 if (!this.toasts) 6318 return A$1; 6319 return b$1`<div style=${o$3(styles2)}> 6320 ${c$1(this.toasts, (item) => item.id, (item) => b$1` 6321 <sonic-toast-item
6322 maxHeight=${isIframe ? "none" : "10rem"} 6323 status=${o$4(item.status)} 6324 title=${o$4(item.title)} 6325 ?ghost=${item.ghost} 6326 ?dismissForever=${item.dismissForever} 6327 ?preserve=${item.preserve} 6328 id=${o$4(item.id)} 6329 @hide=${() => this.removeItem(item)} 6330 ${F({ 6331 keyframeOptions: { 6332 duration: 250, 6333 easing: `cubic-bezier(0.250, 0.250, 0.420, 1.225)` 6334 }, 6335 in: [ 6336 { 6337 transform: "translateY(0) scale(1.25)", 6338 boxShadow: "0 0 0 rgba(0,0,0,0)", 6339 opacity: 0 6340 } 6341 ], 6342 out: [ 6343 { 6344 transform: "scale(.90) ", 6345 opacity: 0, 6346 duration: 3e3, 6347 easing: `ease-in-out` 6348 } 6349 ], 6350 stabilizeOut: true 6351 })} 6352 > 6353 <!-- Le texte est passé dans le slot et non pas en propriété pour contrer des problèmatiques de shadow-dom et d'appel exterieur (exemple: fancybox) --> 6354 ${item.text ? o$6(item.text) : ""} 6355 </sonic-toast-item> 6356 `)} 6357 </div>`; 6358 } 6359 static removeAll() { 6360 if (SonicToast_1.delegateToasts) { 6361 SonicToast_1.handleExistingToastDelegation(); 6362 window.parent.postMessage({ type: "removeAllToasts" }, "*"); 6363 return; 6364 } 6365 const toastComponent = SonicToast_1.getInstance(); 6366 if (!toastComponent) 6367 return; 6368 toastComponent.toasts = toastComponent.toasts.filter((item) => item.ghost); 6369 } 6370 static removeItemsByStatus(status) { 6371 if (SonicToast_1.delegateToasts) { 6372 SonicToast_1.handleExistingToastDelegation(); 6373 window.parent.postMessage({ type: "removeItemsByStatus", status }, "*"); 6374 return; 6375 } 6376 const toastComponent = SonicToast_1.getInstance(); 6377 if (!toastComponent) 6378 return; 6379 toastComponent.toasts = toastComponent.toasts.filter((toast) => toast.status !== status); 6380 } 6381 // retire les items qui ne sont pas en preserve 6382 static removeTemporaryItems() { 6383 if (SonicToast_1.delegateToasts) { 6384 SonicToast_1.handleExistingToastDelegation(); 6385 window.parent.postMessage({ type: "removeTemporaryItems" }, "*"); 6386 return; 6387 } 6388 const toastComponent = SonicToast_1.getInstance(); 6389 if (!toastComponent) 6390 return; 6391 toastComponent.toasts = toastComponent.toasts.filter((item) => item.preserve); 6392 } 6393 static getInstance() { 6394 if (SonicToast_1.instance) 6395 return SonicToast_1.instance; 6396 SonicToast_1.instance = document.createElement("sonic-toast"); 6397 Theme.getPopContainer().prepend(SonicToast_1.instance); 6398 return SonicToast_1.instance; 6399 } 6400 static add(conf) { 6401 if (SonicToast_1.delegateToasts) { 6402 SonicToast_1.handleExistingToastDelegation(); 6403 window.parent.postMessage({ type: "addToast", toast: conf }, "*"); 6404 return; 6405 } 6406 const toastComponent = SonicToast_1.getInstance(); 6407 const nextId = conf.id ?? (/* @__PURE__ */ new Date()).valueOf(); 6408 const interactiveRegExp = new RegExp("</a>|</.*?button>|</.*?input>|</.*?textarea>|</.*?select>"); 6409 const hasInteractive = interactiveRegExp.test(conf.text); 6410 const currentToast = { 6411 id: nextId, 6412 text: conf.text, 6413 title: conf.title, 6414 status: conf.status, 6415 preserve: hasInteractive ? true : conf.preserve, 6416 ghost: conf.ghost, 6417 dismissForever: conf.dismissForever 6418 }; 6419 if (conf.dismissForever && conf.id) { 6420 const dismissed = localStorage.getItem("sonic-toast-dismissed") || "{}"; 6421 const dismissedObj = JSON.parse(dismissed); 6422 if (dismissedObj[conf.id]) { 6423 return null; 6424 } 6425 } 6426 if (toastComponent?.toasts.length) { 6427 const toastA = { ...currentToast }; 6428 for (const toast of toastComponent.toasts) { 6429 const toastB = { ...toast }; 6430 toastA.id = toastB.id = 0; 6431 if ( 6432 /*!currentToast.preserve && */ 6433 Objects$1.shallowEqual(toastA, toastB) 6434 ) { 6435 return null; 6436 } 6437 } 6438 } 6439 if (toastComponent) { 6440 toastComponent.toasts = [...toastComponent.toasts, currentToast]; 6441 } 6442 return currentToast; 6443 } 6444 static handleExistingToastDelegation() { 6445 if (!this.delegateToasts) 6446 return; 6447 const toastComponent = SonicToast_1.getInstance(); 6448 window.parent.postMessage({ type: "addToasts", toasts: toastComponent.toasts }, "*"); 6449 toastComponent.toasts = []; 6450 } 6451 static removeItem(toastToRemove) { 6452 if (SonicToast_1.delegateToasts) { 6453 SonicToast_1.handleExistingToastDelegation(); 6454 window.parent.postMessage({ type: "removeToast", toast: toastToRemove }, "*"); 6455 return; 6456 } 6457 const toastComponent = SonicToast_1.getInstance(); 6458 if (!toastComponent) 6459 return; 6460 toastComponent.removeItem(toastToRemove); 6461 } 6462 // Remove Toast 6463 removeItem(toastToRemove) { 6464 if (!toastToRemove) 6465 return; 6466 this.toasts = this.toasts.filter((toast) => { 6467 toast = { ...toast }; 6468 delete toast.id; 6469 return !Objects$1.shallowEqual(toast, toastToRemove, false); 6470 }); 6471 } 6472 }; 6473 SonicToast.delegateToasts = false;
6474 __decorate$W([ 6475 n$5({ type: Array }) 6476 ], SonicToast.prototype, "toasts", void 0); 6477 SonicToast = SonicToast_1 = __decorate$W([ 6478 t$3(tagName$2O) 6479 ], SonicToast); 6480 if (typeof window !== "undefined") { 6481 window[sonicClassPrefix + "Toast"] = window[sonicClassPrefix + "Toast"] || SonicToast; 6482 } 6483 function handleIframeContexts() { 6484 const onPostMessage = (e2) => { 6485 if (e2.data.type == "querySonicToastAvailability") { 6486 e2.source.postMessage({ type: "sonicToastAvailable" }, "*"); 6487 } 6488 if (e2.data.type == "removeItemsByStatus") { 6489 SonicToast.removeItemsByStatus(e2.data.status); 6490 } 6491 if (e2.data.type == "removeTemporaryItems") { 6492 SonicToast.removeTemporaryItems(); 6493 } 6494 if (e2.data.type == "sonicToastAvailable") { 6495 SonicToast.delegateToasts = true; 6496 SonicToast.handleExistingToastDelegation(); 6497 } 6498 if (e2.data.type == "addToasts") { 6499 SonicToast.getInstance().toasts = [ 6500 ...SonicToast.getInstance().toasts, 6501 ...e2.data.toasts 6502 ]; 6503 } 6504 if (e2.data.type == "removeAllToasts") { 6505 SonicToast.removeAll(); 6506 } 6507 if (e2.data.type == "removeToast") { 6508 SonicToast.removeItem(e2.data.toast); 6509 } 6510 if (e2.data.type == "addToast") { 6511 SonicToast.add(e2.data.toast); 6512 } 6513 }; 6514 const isIframe = !(window.parent == window); 6515 window.addEventListener("message", onPostMessage, false); 6516 if (isIframe) { 6517 window.parent.postMessage({ type: "querySonicToastAvailability" }, "*"); 6518 } 6519 if (!isIframe) { 6520 for (const iframe of document.querySelectorAll("iframe")) { 6521 iframe.contentWindow?.postMessage({ type: "sonicToastAvailable" }, "*"); 6522 } 6523 } 6524 } 6525 handleIframeContexts(); 6526 var __decorate$V = function(decorators, target, key, desc) { 6527 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 6528 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 6529 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 6530 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 6531 }; 6532 const tagName$2N = "sonic-toast-message-subscriber"; 6533 let MessageSubscriber = class MessageSubscriber extends Subscriber$1(i$6) { 6534 constructor() { 6535 super(...arguments); 6536 this._messages = []; 6537 } 6538 get messages() { 6539 return this._messages; 6540 } 6541 set messages(value) { 6542 this._messages = value; 6543 if (!this.messages) 6544 return; 6545 value.forEach((message) => { 6546 if (message.type == "public") 6547 SonicToast.add({ text: message.content || "", status: message.status }); 6548 }); 6549 } 6550 render() { 6551 return A$1; 6552 } 6553 }; 6554 __decorate$V([ 6555 n$5({ type: Array }) 6556 ], MessageSubscriber.prototype, "messages", null); 6557 MessageSubscriber = __decorate$V([ 6558 t$3(tagName$2N) 6559 ], MessageSubscriber); 6560 var __decorate$U = function(decorators, target, key, desc) { 6561 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 6562 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 6563 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 6564 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 6565 }; 6566 const keyboardLoops = /* @__PURE__ */ new Map(); 6567 const Form$2 = (superClass) => { 6568 class FormElement2 extends superClass { 6569 constructor(...args) { 6570 super(); 6571 this.touched = false; 6572 this.error = false; 6573 this.autofocus = false; 6574 this.required = false; 6575 this.forceAutoFill = false; 6576 this.disabled = false; 6577 this.formDataProvider = ""; 6578 this._name = ""; 6579 this._value = ""; 6580 this.onValueAssign = (value) => { 6581 this.setValueFromPublisher(value); 6582 }; 6583 this.onFormValueAssign = async (value) => { 6584 this.setFormValueFromPublisher(value); 6585 }; 6586 this.onFormDataInValidate = () => { 6587 const formPublisher = this.getFormPublisher(); 6588 if (!(formPublisher && formPublisher.isFormValid.get())) { 6589 return; 6590 } 6591 this.validateFormElement(); 6592 }; 6593 } 6594 get name() { 6595 return this._name; 6596 } 6597 set name(value) { 6598 if (this.hasAttribute("name") && !this.forceAutoFill) 6599 value = this.getAttribute("name"); 6600 this._name = value; 6601 this.requestUpdate(); 6602 } 6603 validateFormElement() { 6604 } 6605 unsetOnDisconnect() { 6606 return this.hasAttribute("unsetOnDisconnect"); 6607 } 6608 updateDataValue() { 6609 const name = this.getAttribute("name"); 6610 if (name) { 6611 const formPublisher = this.getFormPublisher(); 6612 if (formPublisher) { 6613 this.setFormPublisherValue(this.getValueForFormPublisher()); 6614 this.setFormValueFromPublisher(this.getFormPublisherValue()); 6615 } 6616 } 6617 } 6618 getFormPublisher() { 6619 if (!this.formDataProvider) 6620 this.formDataProvider = this.getAncestorAttributeValue("formDataProvider"); 6621 if (this.formDataProvider) { 6622 return PublisherManager.get(this.formDataProvider); 6623 } 6624 return null; 6625 } 6626 setFormPublisherValue(value) { 6627 const formPublisher = this.getFormPublisher(); 6628 if (formPublisher) { 6629 traverseDotNotation(formPublisher, this.name).set(value); 6630 } 6631 } 6632 getFormPublisherValue() { 6633 const formPublisher = this.getFormPublisher(); 6634 if (formPublisher) { 6635 return traverseDotNotation(formPublisher, this.name).get(); 6636 } 6637 return null; 6638 } 6639 /** 6640 * Mise en forme de la valeur fournie au formPublisher associé au composant 6641 * Destinée à être surchargée si besoin (cf Form-checkable) 6642 */ 6643 getValueForFormPublisher() { 6644 return this.value; 6645 } 6646 /** 6647 * Mise à jour de la valeur interne du composant en fonction de la valeur venant du publisher associé au composant 6648 * Destinée à être surchargée si besoin (cf Form-checkable) 6649 */ 6650 setValueFromPublisher(value) { 6651 this.value = value; 6652 } 6653 /** 6654 * Mise à jour de la valeur interne du composant en fonction de la valeur venant du formPublisher associé au composant 6655 * Destinée à être surchargée si besoin (cf Form-checkable) 6656 */ 6657 setFormValueFromPublisher(value) { 6658 this.value = value; 6659 } 6660 get value() { 6661 return this._value; 6662 } 6663 set value(value) { 6664 if (value == null) 6665 value = ""; 6666 if (Objects$1.isObject(value) && Object.prototype.hasOwnProperty.call(value, "__value") && value._value == void 0) 6667 value = ""; 6668 if (this._value == value) { 6669 return; 6670 } 6671 this._value = value; 6672 this.updateDataValue(); 6673 this.requestUpdate(); 6674 } 6675 initPublisher() { 6676 let formPublisher = this.getFormPublisher(); 6677 const value = this.hasAncestorAttribute("initFromPublisher") && this._name && this.getFormPublisherValue() ? this.getFormPublisherValue() : this.getAttribute("value"); 6678 if (this._name && this.publisher) 6679 traverseDotNotation(this.publisher, this._name).offAssign(this.onValueAssign); 6680 if (this._name && formPublisher) 6681 traverseDotNotation(formPublisher, this._name).offAssign(this.onFormValueAssign); 6682 super.initPublisher(); 6683 if (!this.name) 6684 this._name = this.getAttribute("name"); 6685 if (!this.value) 6686 this._value = this.getAttribute("value"); 6687 if (this.publisher && this._name) { 6688 traverseDotNotation(this.publisher, this._name).onAssign(this.onValueAssign); 6689 } 6690 formPublisher = this.getFormPublisher(); 6691 if (this._name && formPublisher) { 6692 traverseDotNotation(formPublisher, this._name).onAssign(this.onFormValueAssign); 6693 formPublisher.onFormInvalidate(this.onFormDataInValidate); 6694 } 6695 this.updateDataValue(); 6696 if (value) 6697 this.value = value; 6698 } 6699 handleBlur() { 6700 this.touched = true; 6701 } 6702 handleChange(e2) { 6703 this.value = e2.target.value; 6704 const event = new Event("change"); 6705 this.dispatchEvent(event); 6706 } 6707 /** 6708 * Ajoute un comportement de navigation au clavier pour les éléments de formulaire 6709 * data-keyboard-nav peut contenir plusieurs valeurs qui identifient les boucles de navigation auquelles est attaché cet élément. 6710 * Les valeurs sont séparées par des espaces. 6711 * En appuyant sur la touche "Down", le composant va se déplacer dans la boucle de navigation correspondante en suivant le flux. 6712 * En appuyant sur la touche "Up", le déplacement inverse est effectué. 6713 */ 6714 addKeyboardNavigation() {
6715 const keyboardLoopIds = this.getAncestorAttributeValue("data-keyboard-nav"); 6716 if (!keyboardLoopIds) 6717 return; 6718 const split = keyboardLoopIds.split(" "); 6719 const keyboardLoopId = split[0]; 6720 if (!keyboardLoopId) 6721 return; 6722 for (const keyboardLoopId2 of split) { 6723 if (!keyboardLoops.has(keyboardLoopId2)) { 6724 keyboardLoops.set(keyboardLoopId2, []); 6725 } 6726 const keyboardLoop2 = keyboardLoops.get(keyboardLoopId2); 6727 if (keyboardLoop2?.indexOf(this) == -1) { 6728 keyboardLoop2.push(this); 6729 } 6730 } 6731 const keyboardLoop = keyboardLoops.get(keyboardLoopId); 6732 this.addEventListener("keydown", (e2) => { 6733 const keyboardEvent = e2; 6734 if (!["ArrowDown", "ArrowUp"].includes(keyboardEvent.key)) 6735 return; 6736 const selector = "input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])"; 6737 const loop = keyboardLoop?.filter((el) => { 6738 const child = el.shadowRoot?.querySelector(selector); 6739 if (!child) 6740 return false; 6741 const cpStyle = window.getComputedStyle(child); 6742 return cpStyle.display !== "none" && cpStyle.display !== "" && cpStyle.pointerEvents != "none" && cpStyle.visibility !== "hidden" && child.getBoundingClientRect().width > 0; 6743 }); 6744 let next = null; 6745 if (keyboardEvent.key == "ArrowDown" && loop) { 6746 const index = loop.indexOf(this); 6747 if (index == loop.length - 1) { 6748 next = loop[0]; 6749 } else { 6750 next = loop[index + 1]; 6751 } 6752 } else if (keyboardEvent.key == "ArrowUp" && loop) { 6753 const index = loop.indexOf(this); 6754 if (index == 0) { 6755 next = loop[loop.length - 1]; 6756 } else { 6757 next = loop[index - 1]; 6758 } 6759 } 6760 const elt = next?.shadowRoot?.querySelector(selector); 6761 if (elt && elt.focus) { 6762 elt.focus(); 6763 e2.preventDefault(); 6764 e2.stopPropagation(); 6765 } 6766 }); 6767 } 6768 focus() { 6769 const inputElement = this.shadowRoot?.querySelector("[data-form-element], button"); 6770 inputElement?.focus(); 6771 } 6772 connectedCallback() { 6773 this.formDataProvider = this.getAncestorAttributeValue("formDataProvider"); 6774 super.connectedCallback(); 6775 this.addKeyboardNavigation(); 6776 } 6777 unset() { 6778 this.value = null; 6779 } 6780 disconnectedCallback() { 6781 if (this.unsetOnDisconnect()) { 6782 this.unset(); 6783 } 6784 super.disconnectedCallback(); 6785 if (this._name && this.publisher) 6786 traverseDotNotation(this.publisher, this._name).offAssign(this.onValueAssign); 6787 const formPublisher = this.getFormPublisher(); 6788 if (this._name && formPublisher) { 6789 traverseDotNotation(formPublisher, this._name).offAssign(this.onFormValueAssign); 6790 formPublisher.offFormInvalidate(this.onFormDataInValidate); 6791 } 6792 } 6793 } 6794 __decorate$U([ 6795 n$5({ type: Boolean, reflect: true }) 6796 ], FormElement2.prototype, "touched", void 0); 6797 __decorate$U([ 6798 n$5({ type: Boolean }) 6799 ], FormElement2.prototype, "error", void 0); 6800 __decorate$U([ 6801 n$5({ type: Boolean }) 6802 ], FormElement2.prototype, "autofocus", void 0); 6803 __decorate$U([ 6804 n$5({ type: Boolean }) 6805 ], FormElement2.prototype, "required", void 0); 6806 __decorate$U([ 6807 n$5({ type: Boolean }) 6808 ], FormElement2.prototype, "forceAutoFill", void 0); 6809 __decorate$U([ 6810 n$5({ type: Boolean, reflect: true }) 6811 ], FormElement2.prototype, "disabled", void 0); 6812 __decorate$U([ 6813 n$5({ type: String, attribute: "data-aria-label" }) 6814 ], FormElement2.prototype, "ariaLabel", void 0); 6815 __decorate$U([ 6816 n$5({ type: String, attribute: "data-aria-labelledby" }) 6817 ], FormElement2.prototype, "ariaLabelledby", void 0); 6818 __decorate$U([ 6819 n$5()
6820 ], FormElement2.prototype, "name", null); 6821 __decorate$U([ 6822 n$5() 6823 ], FormElement2.prototype, "value", null); 6824 return FormElement2; 6825 }; 6826 var __decorate$T = function(decorators, target, key, desc) { 6827 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 6828 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 6829 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 6830 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 6831 }; 6832 const Form$1 = (superClass) => { 6833 class FormCheckable2 extends superClass { 6834 constructor() { 6835 super(...arguments); 6836 this._value = ""; 6837 this.forceAutoFill = false; 6838 this.unique = null; 6839 this.radio = null; 6840 this._checked = null; 6841 this.updateAllChecked = () => { 6842 const name = this.getAttribute("name"); 6843 const checkAllPublisher = this.getCheckAllPublisher(); 6844 const formPublisher = this.getFormPublisher(); 6845 if (!checkAllPublisher?.hasCheckAll.get()) { 6846 return; 6847 } 6848 if (!this.checksAll() && checkAllPublisher && formPublisher && name) { 6849 if (!this.getFormPublisherValue()?.length) { 6850 checkAllPublisher.checkMode.set("noneChecked"); 6851 return; 6852 } else if (this.checked === null) { 6853 checkAllPublisher.checkMode.set("someUnchecked"); 6854 } else if (checkAllPublisher.checkMode.get() == "noneChecked" || checkAllPublisher.checkMode.get() == null) { 6855 checkAllPublisher.checkMode.set("someUnchecked"); 6856 } 6857 const currentValues = this.getFormPublisherValue(); 6858 const allValues = checkAllPublisher.values.get(); 6859 if (allValues && allValues.length) { 6860 let checkedCount = allValues.length; 6861 for (const p2 of allValues) { 6862 if (currentValues.indexOf(p2) == -1) { 6863 checkedCount -= 1; 6864 } 6865 } 6866 if (checkedCount == allValues.length) { 6867 checkAllPublisher.checkMode.set("allChecked"); 6868 } 6869 if (checkedCount == 0) { 6870 checkAllPublisher.checkMode.set("noneChecked"); 6871 } 6872 } 6873 if (allValues.indexOf(this.value) == -1 && this.unsetOnDisconnect()) { 6874 this.checked = null; 6875 } 6876 } 6877 }; 6878 this.onChecksAllRequest = (value) => { 6879 this.removeAttribute("allChecked"); 6880 this.removeAttribute("indeterminate"); 6881 if (value == "allChecked") { 6882 this.checked = true; 6883 this.setAttribute("allChecked", ""); 6884 } 6885 if (value == "noneChecked") { 6886 this.checked = null; 6887 } 6888 if (value == "someUnchecked") { 6889 if (this.checksAll()) 6890 this.checked = "indeterminate"; 6891 this.setAttribute("indeterminate", ""); 6892 } 6893 }; 6894 } 6895 get value() { 6896 return this._value; 6897 } 6898 set value(newValue) { 6899 if (this.value == newValue) 6900 return; 6901 if (this.hasAttribute("value") && !this.forceAutoFill) 6902 newValue = this.getAttribute("value"); 6903 if (this._value == newValue) 6904 return; 6905 if (newValue == null) 6906 return; 6907 this._value = newValue; 6908 if (!this.value) 6909 return; 6910 const formPublisher = this.getFormPublisher(); 6911 if (formPublisher && this.name) { 6912 let currentValue = this.getFormPublisherValue(); 6913 if (this.radio || this.unique) { 6914 this.checked = currentValue == newValue ? true : null; 6915 } 6916 if (!Array.isArray(currentValue)) { 6917 currentValue = []; 6918 } 6919 if (currentValue.indexOf(newValue) != -1) 6920 this.checked = true; 6921 } 6922 if (this.checked == true) 6923 this.updateDataValue(); 6924 this.requestUpdate(); 6925 } 6926 get checked() { 6927 return this._checked; 6928 } 6929 set checked(checked) { 6930 this.setCheckedValue(checked); 6931 if (this.checksAll()) { 6932 const checkAllPublisher = this.getCheckAllPublisher(); 6933 if (checkAllPublisher) { 6934 if (this.checked === true) 6935 checkAllPublisher.checkMode.set("allChecked"); 6936 else if (this.checked === null) { 6937 checkAllPublisher.checkMode.set("noneChecked"); 6938 const formPublisher = this.getFormPublisher(); 6939 if (formPublisher) { 6940 this.setFormPublisherValue([]); 6941 } 6942 } 6943 } 6944 } 6945 this.requestUpdate(); 6946 } 6947 validateFormElement() { 6948 const input = this.shadowRoot?.querySelector("input"); 6949 if (!input || input.checkValidity()) 6950 return; 6951 const formPublisher = this.getFormPublisher(); 6952 if (formPublisher) { 6953 const value = this.getFormPublisherValue(); 6954 if ((this.unique || this.radio) && value !== null && value !== void 0 && value.toString().length > 0) 6955 return; 6956 formPublisher.isFormValid = false;
6957 input.reportValidity(); 6958 } 6959 } 6960 checksAll() { 6961 return this.hasAttribute("checksAll"); 6962 } 6963 setCheckedValue(checked) { 6964 if (this._checked == checked) 6965 return; 6966 this._checked = checked; 6967 this.updateDataValue(); 6968 this.requestUpdate(); 6969 setTimeout(() => this.updateAllChecked(), 1); 6970 } 6971 handleChange() { 6972 const newCheckedValue = this.checked === true ? !this.radio ? null : true : true; 6973 this.checked = newCheckedValue; 6974 const event = new Event("change"); 6975 this.dispatchEvent(event); 6976 } 6977 /** 6978 * Voir la mixin FormElement 6979 * Le comportement est ici modifié fonction de son mode (checkbox, radio, unique) 6980 */ 6981 getValueForFormPublisher() { 6982 let currentValue = this.getFormPublisherValue(); 6983 if (this.radio) { 6984 return this.checked === true && this.value != null ? this.value : currentValue; 6985 } 6986 if (this.unique) { 6987 return this.checked === true && this.value != null ? this.value : null; 6988 } 6989 if (!Array.isArray(currentValue)) { 6990 currentValue = []; 6991 } 6992 const currentValueArray = currentValue.slice(0); 6993 const idx = currentValueArray.indexOf(this.value); 6994 if (this.checked === true && idx === -1 && !this.checksAll()) 6995 currentValueArray.push(this.value); 6996 if (this.checked === null && idx !== -1) { 6997 currentValueArray.splice(idx, 1); 6998 } 6999 return currentValueArray; 7000 } 7001 /** 7002 * Voir la mixin FormElement 7003 * Le comportement est modifié de la manière suivante : 7004 * L'état du composant (checked) est mis à jour en fonction de la valeur fournie par le publisher associé au composant / en fonction de sont mode (radio, unique) 7005 */ 7006 setFormValueFromPublisher(value) { 7007 if (this.unique || this.radio) { 7008 this.checked = this.value == value ? true : null; 7009 return; 7010 } 7011 if (!Array.isArray(value)) 7012 value = []; 7013 if (this.checksAll()) { 7014 return; 7015 } 7016 this.checked = value.indexOf(this.value) !== -1 ? true : null; 7017 } 7018 getCheckAllPublisher() { 7019 if (!this.formDataProvider) 7020 this.formDataProvider = this.getAncestorAttributeValue("formDataProvider"); 7021 const formDataProvider = this.formDataProvider; 7022 const name = this.getAttribute("name"); 7023 if (!formDataProvider || !name) { 7024 return null; 7025 } 7026 return PublisherManager.get(formDataProvider + "/" + name + "/_available_values_"); 7027 } 7028 unset() { 7029 this.checked = null; 7030 } 7031 disconnectedCallback() { 7032 super.disconnectedCallback(); 7033 const checkAllPublisher = this.getCheckAllPublisher(); 7034 if (checkAllPublisher) { 7035 checkAllPublisher.checkMode.offAssign(this.onChecksAllRequest); 7036 if (!this.checksAll()) { 7037 const values = checkAllPublisher.values.get().slice(0); 7038 const idx = values.indexOf(this.value); 7039 if (idx != -1) { 7040 values.splice(idx, 1); 7041 checkAllPublisher.values.set(values); 7042 } 7043 } 7044 } 7045 setTimeout(() => this.updateAllChecked(), 1); 7046 } 7047 connectedCallback() { 7048 super.connectedCallback(); 7049 const formPublisher = this.getFormPublisher(); 7050 if (formPublisher && this.name) { 7051 const publisherValueForName = this.getFormPublisherValue(); 7052 if (publisherValueForName && Array.isArray(publisherValueForName) && publisherValueForName.indexOf(this.value) !== -1) { 7053 this.checked = true; 7054 } 7055 } 7056 const checkAllPublisher = this.getCheckAllPublisher(); 7057 if (checkAllPublisher) { 7058 checkAllPublisher.checkMode.onAssign(this.onChecksAllRequest); 7059 if (this.checksAll()) { 7060 checkAllPublisher.hasCheckAll.set(true); 7061 } 7062 if (!checkAllPublisher.values.get()) { 7063 checkAllPublisher.values.set([]); 7064 } 7065 if (!this.checksAll()) { 7066 checkAllPublisher.values.set([ 7067 ...checkAllPublisher.values.get(), 7068 this.value 7069 ]); 7070 } 7071 } 7072 if (!this.hasAttribute("checked")) { 7073 return; 7074 } 7075 if (!this.publisher || this.publisher.get().checked !== false) { 7076 setTimeout(() => this.checked = true, 1); 7077 } 7078 } 7079 } 7080 __decorate$T([ 7081 n$5() 7082 ], FormCheckable2.prototype, "value", null); 7083 __decorate$T([ 7084 n$5() 7085 ], FormCheckable2.prototype, "forceAutoFill", void 0); 7086 __decorate$T([ 7087 n$5({ type: Boolean }) 7088 ], FormCheckable2.prototype, "unique", void 0); 7089 __decorate$T([ 7090 n$5({ type: Boolean }) 7091 ], FormCheckable2.prototype, "radio", void 0); 7092 __decorate$T([ 7093 n$5() 7094 ], FormCheckable2.prototype, "checked", null); 7095 return FormCheckable2; 7096 }; 7097 const fontSize = i$9` 7098 /*SIZES*/ 7099 :host { 7100 --sc-_fs: 1rem; 7101 --sc-_lh: 1.15; 7102 font-size: var(--sc-_fs); 7103 line-height: var(--sc-_lh); 7104 } 7105 7106 :host([size="2xs"]) { 7107 --sc-_fs: 0.625rem; 7108 } 7109 :host([size="xs"]) { 7110 --sc-_fs: 0.75rem; 7111 } 7112 :host([size="sm"]) { 7113 --sc-_fs: 0.875rem; 7114 } 7115 :host([size="md"]) { 7116 --sc-_fs: 1rem; 7117 } 7118 :host([size="lg"]) { 7119 --sc-_fs: 1.125rem; 7120 } 7121 :host([size="xl"]) { 7122 --sc-_fs: 1.25rem; 7123 } 7124 :host([size="2xl"]) { 7125 --sc-_fs: 1.5rem; 7126 } 7127 :host([size="inherit"]) { 7128 --sc-_fs: 1em; 7129 } 7130`; 7131 var __decorate$S = function(decorators, target, key, desc) { 7132 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 7133 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 7134 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 7135 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 7136 }; 7137 const tagName$2M = "sonic-button"; 7138 let Button = class Button extends Form$1(Form$2(Subscriber$1(i$6))) { 7139 constructor() { 7140 super(...arguments); 7141 this.type = "default"; 7142 this.variant = "default"; 7143 this.shape = "default"; 7144 this.direction = "row"; 7145 this.alignItems = "center"; 7146 this.justify = "center"; 7147 this.minWidth = "0"; 7148 this.icon = false;
7149 this.download = null; 7150 this.autoActive = "partial"; 7151 this.loading = false; 7152 this.hasPrefix = false; 7153 this.hasSuffix = false; 7154 this._href = ""; 7155 this.goBack = null; 7156 this.pushState = false; 7157 this.active = false; 7158 this.autoRepeat = false; 7159 this.pointerDownTime = 0; 7160 this.lastRepeatTime = 0; 7161 this.isRepeating = false; 7162 this.handleRepeatend = () => { 7163 window.removeEventListener("pointerup", this.handleRepeatend); 7164 window.removeEventListener("blur", this.handleRepeatend); 7165 if (this.autoRepeat) { 7166 this.isRepeating = false; 7167 } 7168 }; 7169 this.location = ""; 7170 } 7171 set href(value) { 7172 this._href = value; 7173 const str = this._href.toString(); 7174 if (str && str.indexOf("http") != 0) { 7175 LocationHandler$1.onChange(this); 7176 } else 7177 LocationHandler$1.offChange(this); 7178 this.requestUpdate(); 7179 } 7180 get href() { 7181 return this._href; 7182 } 7183 handleNavigation(e2) { 7184 e2.preventDefault(); 7185 LocationHandler$1.changeFromComponent(this); 7186 } 7187 handleChange(e2) { 7188 if (e2?.type == "click" && this.autoRepeat) 7189 return; 7190 super.handleChange(); 7191 if (this.pushState || this.goBack !== null) { 7192 e2?.preventDefault(); 7193 e2?.stopPropagation(); 7194 LocationHandler$1.changeFromComponent(this); 7195 } 7196 if (this.hasAttribute("reset")) { 7197 const resetDataProvider = this.getAttribute("reset"); 7198 const formPublisher = resetDataProvider ? PublisherManager.get(resetDataProvider) : this.getFormPublisher(); 7199 if (formPublisher) 7200 formPublisher.set({}); 7201 } 7202 } 7203 handleRepeatStart(e2) { 7204 if (this.autoRepeat) { 7205 this.handleChange(e2); 7206 this.pointerDownTime = Date.now(); 7207 this.isRepeating = true; 7208 this.repeat(); 7209 } 7210 window.addEventListener("pointerup", this.handleRepeatend); 7211 window.addEventListener("blur", this.handleRepeatend); 7212 } 7213 repeat() { 7214 if (!this.isRepeating) 7215 return; 7216 if (this.hasAttribute("disabled")) { 7217 this.isRepeating = false; 7218 return; 7219 } 7220 window.requestAnimationFrame(this.repeat.bind(this)); 7221 if (Date.now() - this.pointerDownTime < 500) 7222 return; 7223 if (Date.now() - this.lastRepeatTime < 100) 7224 return; 7225 this.handleChange(); 7226 this.lastRepeatTime = Date.now(); 7227 } 7228 connectedCallback() { 7229 super.connectedCallback(); 7230 } 7231 setCheckedValue(checked) { 7232 if (this.name) { 7233 if (checked) 7234 this.setAttribute("active", "true"); 7235 else 7236 this.removeAttribute("active"); 7237 if (checked == this._checked) 7238 return; 7239 super.setCheckedValue(checked); 7240 } 7241 } 7242 disconnectedCallback() { 7243 LocationHandler$1.offChange(this); 7244 super.disconnectedCallback(); 7245 } 7246 willUpdate(changedProperties) { 7247 if (changedProperties.has("href") || changedProperties.has("autoActive")) { 7248 LocationHandler$1.updateComponentActiveState(this); 7249 } 7250 if (changedProperties.has("location")) { 7251 LocationHandler$1.updateComponentActiveState(this); 7252 } 7253 } 7254 render() { 7255 const btnStyles = { 7256 flexDirection: this.direction, 7257 alignItems: this.alignItems, 7258 justifyContent: this.justify, 7259 align: this.align, 7260 minWidth: this.minWidth 7261 }; 7262 const btn = b$1` 7263 <button 7264 part="button" 7265 class=${this.hasPrefix || this.hasSuffix ? "has-prefix-or-suffix" : ""} 7266 style=${o$3(btnStyles)} 7267 aria-controls=${o$4(this.ariaControls)} 7268 aria-expanded=${o$4(this.sonicAriaExpanded)} 7269 aria-label=${o$4(this.ariaLabel)} 7270 aria-labelledby=${o$4(this.ariaLabelledby)} 7271 ?disabled=${this.disabled} 7272 @click=${this.handleChange} 7273 @pointerdown=${this.handleRepeatStart} 7274 > 7275 <slot 7276 @slotchange=${this.onSlotChange} 7277 part="prefix" 7278 name="prefix" 7279 ></slot> 7280 <slot part="main" class="main-slot"></slot> 7281 <slot 7282 @slotchange=${this.onSlotChange} 7283 part="suffix" 7284 name="suffix" 7285 ></slot> 7286 ${this.loading == true ? b$1`<sonic-icon name="loader" class="loader"></sonic-icon>` : ""} 7287 </button> 7288 `; 7289 return this.href ? b$1`<a 7290 href="${this.href}" 7291 download=${o$4(this.download)} 7292 target=${o$4(this.target)} 7293 aria-label=${o$4(this.ariaLabel)} 7294 aria-labelledby=${o$4(this.ariaLabelledby)} 7295 @click=${this.pushState || this.goBack !== null ? this.handleNavigation : null} 7296 >${btn}</a 7297 >` : b$1`${btn}`; 7298 } 7299 onSlotChange() { 7300 this.hasPrefix = !!this.prefixes?.length; 7301 this.hasSuffix = !!this.suffixes?.length; 7302 } 7303 }; 7304 Button.styles = [ 7305 fontSize, 7306 i$9` 7307 * { 7308 box-sizing: border-box; 7309 } 7310 :host { 7311 --sc-btn-gap: 0.35em; 7312 --sc-btn-py: 0.25em; 7313 --sc-btn-px: 1.1em; 7314 --sc-btn-fs: var(--sc-_fs, 1rem); 7315 --sc-btn-ff: var( 7316 --sc-btn-font-family, 7317 var(--sc-font-family-base, sans-serif) 7318 ); 7319 --sc-btn-fw: var(--sc-btn-font-weight, 500); 7320 7321 --sc-btn-height: var(--sc-form-height, 2.5em); 7322 --btn-color: var(--sc-btn-color, var(--sc-base-content, #000)); 7323 --btn-bg: var(--sc-btn-bg, var(--sc-base-100, rgba(0, 0, 0, 0.07))); 7324 7325 --sc-btn-border-style: solid; 7326 --sc-btn-border-width: var(--sc-form-border-width); 7327 --sc-btn-border-color: transparent; 7328 7329 --btn-outline-bg-hover: var( 7330 --sc-btn-outline-bg-hover, 7331 var(--sc-base-100, rgba(0, 0, 0, 0.07)) 7332 ); 7333 --sc-btn-ghost-bg-hover: var(--sc-base-100, rgba(0, 0, 0, 0.07)); 7334 7335 --sc-btn-active-color: var(--sc-base, #fff); 7336 --sc-btn-hover-filter: brightness(0.98); 7337 --sc-btn-active-filter: brightness(0.97); 7338 --sc-btn-active-bg: var(--sc-base-content, #000); 7339 7340 /* min permet une sécurité si btn-rounded 999px par exemple */ 7341 --sc-item-rounded-tr: min( 7342 calc(var(--sc-form-height, 2.5em) / 2), 7343 var(--sc-btn-rounded) 7344 ); 7345 --sc-item-rounded-tl: min( 7346 calc(var(--sc-form-height, 2.5em) / 2), 7347 var(--sc-btn-rounded) 7348 ); 7349 --sc-item-rounded-bl: min( 7350 calc(var(--sc-form-height, 2.5em) / 2), 7351 var(--sc-btn-rounded) 7352 ); 7353 --sc-item-rounded-br: min( 7354 calc(var(--sc-form-height, 2.5em) / 2), 7355 var(--sc-btn-rounded) 7356 ); 7357 7358 display: inline-flex; 7359 vertical-align: middle; 7360 box-sizing: border-box; 7361 -webkit-print-color-adjust: exact; 7362 } 7363 7364 :host a { 7365 display: contents; 7366 color: unset; 7367 } 7368 7369 :host button { 7370 display: flex; 7371 flex: 1; 7372 box-sizing: border-box; 7373 align-items: center; 7374 justify-content: center; 7375 7376 font-family: var(--sc-btn-ff); 7377 font-weight: var(--sc-btn-fw); 7378 font-size: var(--sc-btn-fs); 7379 7380 cursor: pointer; 7381 text-align: center; 7382 line-height: 1.1; 7383 border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) 7384 var(--sc-item-rounded-br) var(--sc-item-rounded-bl); 7385 7386 background: var(--btn-bg); 7387 color: var(--btn-color); 7388 7389 padding-top: var(--sc-btn-py); 7390 padding-bottom: var(--sc-btn-py); 7391 padding-left: var(--sc-btn-px); 7392 padding-right: var(--sc-btn-px); 7393 7394 border: var(--sc-btn-border-width) var(--sc-btn-border-style) 7395 var(--sc-btn-border-color); 7396 min-height: var(--sc-btn-height); 7397 } 7398 7399 :host button.has-prefix-or-suffix { 7400 gap: var(--sc-btn-gap); 7401 } 7402 7403 :host button:focus-visible, 7404 :host button:hover { 7405 filter: var(--sc-btn-hover-filter); 7406 } 7407 7408 :host button:active { 7409 filter: var(--sc-btn-active-filter); 7410 } 7411 7412 /*TYPES*/ 7413 :host([type="default"]) button { 7414 --btn-color: var(--sc-base-content, #000); 7415 --btn-bg: var(--sc-base-100, rgba(0, 0, 0, 0.07)); 7416 } 7417 7418 :host([type="primary"]) button { 7419 --btn-color: var(--sc-primary-content, var(--sc-base, #fff)); 7420 --btn-bg: var(--sc-primary, var(--sc-base-content, #000)); 7421 } 7422 :host([type="warning"]) button { 7423 --btn-color: var(--sc-warning-content, var(--sc-base, #fff)); 7424 --btn-bg: var(--sc-warning, var(--sc-base-content, #000)); 7425 } 7426 :host([type="danger"]) button { 7427 --btn-color: var(--sc-danger-content, var(--sc-base, #fff)); 7428 --btn-bg: var(--sc-danger, var(--sc-base-content, #000)); 7429 } 7430 :host([type="info"]) button { 7431 --btn-color: var(--sc-info-content, var(--sc-base, #fff)); 7432 --btn-bg: var(--sc-info, var(--sc-base-content, #000)); 7433 } 7434 :host([type="success"]) button { 7435 --btn-color: var(--sc-success-content, var(--sc-base, #fff)); 7436 --btn-bg: var(--sc-success, var(--sc-base-content, #000)); 7437 } 7438 :host([type="neutral"]) button { 7439 --btn-color: var(--sc-base, #fff); 7440 --btn-bg: var(--sc-base-content, #000); 7441 } 7442 :host([type="custom"]) button { 7443 --btn-color: var(--sc-btn-custom-color); 7444 --btn-bg: var(--sc-btn-custom-bg); 7445 } 7446 7447 /*UNSTYLED*/ 7448 :host([variant="unstyled"]) { 7449 display: inline-flex; 7450 } 7451 7452 :host([variant="unstyled"]) button { 7453 all: unset; 7454 cursor: pointer; 7455 width: 100%; 7456 flex: 1; 7457 box-sizing: border-box; 7458 --sc-btn-height: auto; 7459 } 7460 7461 /*GESTION DU FOCUS*/ 7462 :host(:not([disabled])) button:focus-visible { 7463 box-shadow: 0 0 0 0.18rem var(--sc-base-300, rgba(0, 0, 0, 0.18)); 7464 border-color: var(--sc-base-300, rgba(0, 0, 0, 0.18)) !important; 7465 outline: none; 7466 } 7467 7468 /*GHOST*/ 7469 :host([variant="ghost"][type]) button { 7470 color: var(--btn-bg); 7471 background: transparent; 7472 } 7473 7474 :host([variant="ghost"][type="default"]) button { 7475 color: var(--btn-color); 7476 background: transparent; 7477 } 7478 7479 /*:host([variant="ghost"]) button:focus-visible,*/ 7480 :host([variant="ghost"]) button:hover { 7481 background: var(--sc-btn-ghost-bg-hover); 7482 filter: none; 7483 } 7484 7485 :host([active][variant="ghost"]) button { 7486 background: var(--sc-btn-ghost-bg-hover); 7487 filter: none; 7488 } 7489 7490 :host([active][variant="ghost"]) button:hover { 7491 filter: var(--sc-btn-hover-filter); 7492 } 7493 7494 /*OUTLINE*/ 7495 :host([variant="outline"][type]) button { 7496 border-color: var(--btn-bg); 7497 color: var(--btn-bg); 7498 background: transparent; 7499 } 7500 7501 :host([variant="outline"][type="default"]) button { 7502 border-color: var(--sc-base-content, #000); 7503 color: var(--sc-base-content, #000); 7504 background: transparent; 7505 } 7506 7507 /*:host([variant="outline"]) button:focus-visible,*/ 7508 :host([variant="outline"]) button:hover { 7509 background: var(--btn-outline-bg-hover); 7510 } 7511 7512 /*OUTLINE*/ 7513 :host([variant="link"]:not([size])) { 7514 vertical-align: baseline; 7515 margin-left: 0.25em; 7516 margin-right: 0.25em; 7517 } 7518 7519 :host([variant="link"]:not([size])) { 7520 font-size: inherit; 7521 } 7522 7523 :host([variant="link"]) button { 7524 text-decoration: underline; 7525 padding: 0; 7526 background: none; 7527 border: none; 7528 font-size: inherit; 7529 min-height: 0; 7530 color: inherit; 7531 } 7532 7533 :host([variant="link"][type]) button { 7534 color: var(--btn-bg); 7535 } 7536 :host([variant="link"][type="default"]) button { 7537 color: inherit; 7538 } 7539 7540 :host([variant="link"]) button:focus-visible, 7541 :host([variant="link"]) button:hover { 7542 text-decoration: none; 7543 } 7544 7545 /* Alignement */ 7546 :host([align="left"]) button { 7547 text-align: left !important; 7548 } 7549 7550 :host([align="right"]) button { 7551 text-align: right; 7552 } 7553 7554 /*SHAPE*/ 7555 :host([shape="circle"]) button { 7556 border-radius: 50%; 7557 } 7558 :host([shape="circle"]) .main-slot { 7559 line-height: 1; 7560 } 7561 7562 :host([shape="circle"]) button, 7563 :host([shape="square"]) button { 7564 width: var(--sc-btn-height); 7565 height: var(--sc-btn-height); 7566 /*overflow: hidden;*/ /* fix bug #42622 */ 7567 padding: 0; 7568 align-items: center; 7569 justify-content: 0; 7570 text-align: center !important; 7571 } 7572 7573 :host([shape="block"]), 7574 :host([shape="block"]) button { 7575 width: 100%; 7576 } 7577 7578 :host([disabled]) { 7579 opacity: 0.3; 7580 pointer-events: none; 7581 user-select: none; 7582 } 7583 7584 /*ACTIVE*/ 7585 7586 :host([active]:not([variant="ghost"]):not([variant="unstyled"])) button { 7587 background: var(--sc-btn-active-bg); 7588 color: var(--sc-btn-active-color); 7589 border-color: var(--sc-btn-active-bg); 7590 } 7591 7592 .main-slot { 7593 flex-grow: 1; 7594 min-width: 0; 7595 display: block; 7596 } 7597
7598 :host([minWidth]:not([shape="block"])) .main-slot { 7599 flex-grow: 0; 7600 } 7601 7602 slot[name="suffix"], 7603 slot[name="prefix"] { 7604 flex-shrink: 0; 7605 min-width: 0; 7606 } 7607 7608 /*ALIGNEMENT DES ICONES 7609 permet de tous les avoir alignés dans un menu 7610 */ 7611 ::slotted(sonic-icon) { 7612 min-width: 1em; 7613 text-align: center; 7614 } 7615 7616 /*BOUTON Avec icone seulement*/ 7617 :host([icon]) ::slotted(:only-child), 7618 :host([icon]) ::slotted(sonic-icon) { 7619 font-size: 1.2em; 7620 vertical-align: middle; 7621 } 7622 7623 /*Tooltip ne joue pas sur le layout*/ 7624 sonic-tooltip { 7625 display: contents; 7626 } 7627 7628 /*OUTLINE*/ 7629 :host(:not([active])) ::slotted([swap="on"]) { 7630 display: none !important; 7631 } 7632 7633 :host([active]) ::slotted([swap="off"]) { 7634 display: none !important; 7635 } 7636 7637 /*Loading*/ 7638 :host([loading]) { 7639 pointer-events: none; 7640 position: relative; 7641 } 7642 7643 :host([loading]) slot { 7644 opacity: 0 !important; 7645 pointer-events: none; 7646 } 7647 /*Loading*/ 7648 :host([loading]) .loader { 7649 position: absolute; 7650 top: 50%; 7651 left: 50%; 7652 transform: translate(-50%, -50%); 7653 display: flex; 7654 align-items: center; 7655 justify-content: center; 7656 line-height: 0; 7657 height: var(--sc-btn-ff); 7658 width: var(--sc-btn-ff); 7659 animation: rotation 2s infinite linear; 7660 } 7661 7662 @keyframes rotation { 7663 from { 7664 transform-origin: 50% 50%; 7665 transform: translate(-50%, -50%) rotate(0deg); 7666 } 7667 to { 7668 transform-origin: 50% 50%; 7669 transform: translate(-50%, -50%) rotate(359deg); 7670 } 7671 } 7672 ` 7673 ]; 7674 __decorate$S([ 7675 n$5({ type: String, reflect: true }) 7676 ], Button.prototype, "type", void 0); 7677 __decorate$S([ 7678 n$5({ type: String, reflect: true }) 7679 ], Button.prototype, "variant", void 0); 7680 __decorate$S([ 7681 n$5({ type: String, reflect: true }) 7682 ], Button.prototype, "size", void 0); 7683 __decorate$S([ 7684 n$5({ type: String, reflect: true }) 7685 ], Button.prototype, "shape", void 0); 7686 __decorate$S([ 7687 n$5({ type: String }) 7688 ], Button.prototype, "direction", void 0); 7689 __decorate$S([ 7690 n$5({ type: String, reflect: true }) 7691 ], Button.prototype, "alignItems", void 0); 7692 __decorate$S([ 7693 n$5({ type: String }) 7694 ], Button.prototype, "justify", void 0); 7695 __decorate$S([ 7696 n$5({ type: String, reflect: true }) 7697 ], Button.prototype, "align", void 0); 7698 __decorate$S([ 7699 n$5({ type: String }) 7700 ], Button.prototype, "minWidth", void 0); 7701 __decorate$S([ 7702 n$5({ type: Boolean, reflect: true }) 7703 ], Button.prototype, "icon", void 0); 7704 __decorate$S([ 7705 n$5({ type: String }) 7706 ], Button.prototype, "download", void 0); 7707 __decorate$S([ 7708 n$5({ type: String }) 7709 ], Button.prototype, "autoActive", void 0); 7710 __decorate$S([ 7711 n$5({ type: Boolean, reflect: true }) 7712 ], Button.prototype, "loading", void 0); 7713 __decorate$S([ 7714 r$5() 7715 ], Button.prototype, "hasPrefix", void 0); 7716 __decorate$S([ 7717 r$5() 7718 ], Button.prototype, "hasSuffix", void 0); 7719 __decorate$S([ 7720 o$8({ flatten: true, slot: "prefix" }) 7721 ], Button.prototype, "prefixes", void 0); 7722 __decorate$S([ 7723 o$8({ flatten: true, slot: "suffix" }) 7724 ], Button.prototype, "suffixes", void 0); 7725 __decorate$S([ 7726 n$5({ type: String }) 7727 ], Button.prototype, "target", void 0); 7728 __decorate$S([ 7729 n$5({ type: String }) 7730 ], Button.prototype, "href", null); 7731 __decorate$S([ 7732 n$5({ type: String }) 7733 ], Button.prototype, "goBack", void 0); 7734 __decorate$S([ 7735 n$5({ type: Boolean }) 7736 ], Button.prototype, "pushState", void 0); 7737 __decorate$S([ 7738 n$5({ type: Boolean, reflect: true }) 7739 ], Button.prototype, "active", void 0); 7740 __decorate$S([ 7741 n$5({ type: Boolean, reflect: true }) 7742 ], Button.prototype, "autoRepeat", void 0); 7743 __decorate$S([ 7744 n$5({ type: String, attribute: "data-aria-controls" }) 7745 ], Button.prototype, "ariaControls", void 0); 7746 __decorate$S([ 7747 n$5({ type: Boolean, attribute: "data-aria-expanded" }) 7748 ], Button.prototype, "sonicAriaExpanded", void 0); 7749 __decorate$S([ 7750 r$5() 7751 ], Button.prototype, "location", void 0); 7752 Button = __decorate$S([ 7753 t$3(tagName$2M) 7754 ], Button); 7755 var __decorate$R = function(decorators, target, key, desc) { 7756 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 7757 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 7758 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 7759 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 7760 }; 7761 const fetchersInError = /* @__PURE__ */ new Set(); 7762 const invalidateFetchersInError = () => { 7763 const fetchersInErrorCopy = new Set(fetchersInError); 7764 fetchersInError.clear(); 7765 for (const fetcher of fetchersInErrorCopy) { 7766 fetcher.refetch(); 7767 } 7768 }; 7769 const errorsListeners = /* @__PURE__ */ new Set(); 7770 const onFetchError = (errorListener) => { 7771 errorsListeners.add(errorListener); 7772 }; 7773 const offFetchError = (errorListener) => { 7774 errorsListeners.delete(errorListener); 7775 }; 7776 const dispatchFetchError = (apiResponse) => { 7777 for (const listener of errorsListeners) { 7778 listener(apiResponse); 7779 } 7780 }; 7781 const fetchComponents = /* @__PURE__ */ new Set(); 7782 let languageChangeRequestId = 0; 7783 detecHTMLLanguageChange(async () => { 7784 languageChangeRequestId++; 7785 const currentRequestId = languageChangeRequestId; 7786 const fetchers = Array.from(fetchComponents); 7787 while (fetchers.length > 0) { 7788 if (currentRequestId != languageChangeRequestId) 7789 return; 7790 const fourFetchers = fetchers.splice(0, 4); 7791 await Promise.all(fourFetchers.map((fetcher) => fetcher.refetch())); 7792 } 7793 }); 7794 const Fetcher$1 = (superClass, propsType) => { 7795 class FetcherElement extends superClass { 7796 constructor(...args) { 7797 super(); 7798 this.api = null; 7799 this.key = ""; 7800 this.isFirstLoad = true; 7801 this.isLoading = false;
7802 this.iObserver = null; 7803 this.isFetchEnabled = true; 7804 this.fetchedData = null; 7805 this._endPoint = ""; 7806 this.noErrorsRecordings = false; 7807 this.requestId = 0; 7808 this.refetchEveryMs = 0; 7809 this._isFetching = false; 7810 this._mustRefetch = false; 7811 this.dataProvider = ""; 7812 } 7813 get props() { 7814 return super.props; 7815 } 7816 set props(value) { 7817 super.props = value; 7818 } 7819 set endPoint(value) { 7820 this._endPoint = value; 7821 if (this.isConnected) 7822 this._fetchData(); 7823 } 7824 get endPoint() { 7825 return this._endPoint; 7826 } 7827 handleStartFetching() { 7828 if (this._isFetching) { 7829 this._mustRefetch = true; 7830 return "fetching"; 7831 } 7832 this._isFetching = true; 7833 return "okToFetch"; 7834 } 7835 handleEndFetching() { 7836 this._isFetching = false; 7837 if (this._mustRefetch) { 7838 this._mustRefetch = false; 7839 this._fetchData(); 7840 } 7841 } 7842 refetch() { 7843 return this._fetchData(); 7844 } 7845 /** 7846 * 7847 * C'est ici que les données sont chargées via l'utilitaire API 7848 * Elles sont ensuite injectées dans le publisher en accord avec la cible définie dans la propriété key 7849 * Un Toast est affiché si le chargement échoue 7850 */ 7851 async _fetchData() { 7852 this.requestUpdate(); 7853 if (!this.isFetchEnabled) 7854 return; 7855 this.api = new API(this.getApiConfiguration()); 7856 if (!this.api) 7857 return; 7858 this.dispatchEvent(new CustomEvent("loading", { detail: this })); 7859 if (this.getAttribute("localStorage") === "enabled") { 7860 await PublisherManager.getInstance().isLocalStrorageReady; 7861 } 7862 if (!this.isConnected) 7863 return; 7864 const headerData = PublisherManager.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get(); 7865 this.isLoading = true; 7866 if (Objects$1.isObject(this.props) && Object.keys(this.props || {}).length > 0 && this.isFirstLoad) { 7867 window.requestAnimationFrame(() => { 7868 this.dispatchEvent(new CustomEvent("load", { detail: this })); 7869 this.isFirstLoad = false; 7870 this.isLoading = false; 7871 }); 7872 } 7873 const fetchStatus = this.handleStartFetching(); 7874 if (fetchStatus === "fetching") { 7875 return; 7876 } 7877 let data = null; 7878 try { 7879 data = await this.api.get(this.endPoint || this.dataProvider || "", headerData); 7880 } catch (_error) { 7881 } 7882 this.handleEndFetching(); 7883 this.fetchedData = data; 7884 if (this.api.lastResult && !this.api.lastResult.ok) { 7885 if (!this.noErrorsRecordings) { 7886 fetchersInError.add(this); 7887 } 7888 dispatchFetchError(this.api.lastResult); 7889 } 7890 if (!this.isConnected) { 7891 return; 7892 } 7893 if (!data) { 7894 this.isLoading = false; 7895 if (this.refetchEveryMs && this.isConnected) { 7896 this.refetchTimeOutId = setTimeout(() => this._fetchData(), this.refetchEveryMs); 7897 } 7898 return; 7899 } else if (data._sonic_http_response_ && !data._sonic_http_response_.ok && Object.keys(data).length === 1) { 7900 SonicToast.add({ text: "Network Error", status: "error" }); 7901 } 7902 if (this.key) { 7903 const response = data._sonic_http_response_; 7904 const path = this.key.split("."); 7905 data = Objects$1.traverse(data, path, this.hasAttribute("preserveOtherKeys")); 7906 if (data && Objects$1.isObject(data) && response) 7907 data._sonic_http_response_ = response; 7908 } 7909 this.props = data; 7910 this.dispatchEvent(new CustomEvent("load", { detail: this })); 7911 this.isFirstLoad = false; 7912 this.isLoading = false; 7913 if (this.refetchEveryMs && this.isConnected) { 7914 this.refetchTimeOutId = setTimeout(() => this._fetchData(), this.refetchEveryMs); 7915 } 7916 } 7917 disconnectedCallback() { 7918 super.disconnectedCallback(); 7919 fetchComponents.delete(this); 7920 this.publisher?.offInvalidate(this.onInvalidate); 7921 clearTimeout(this.refetchTimeOutId); 7922 this.isFirstLoad = false;
7923 } 7924 connectedCallback() { 7925 this.lazyLoad = this.lazyLoad !== void 0 ? this.lazyLoad : this.hasAttribute("lazyload"); 7926 fetchComponents.add(this); 7927 super.connectedCallback(); 7928 if (!this.isFetchEnabled) { 7929 return; 7930 } 7931 this.key = this.key != "" ? this.key : this.getAttribute("key"); 7932 if (this.props) { 7933 this.publisher.set(this.props); 7934 } 7935 this.onInvalidate = () => this._fetchData(); 7936 this.publisher?.onInvalidate(this.onInvalidate); 7937 if (!this.lazyLoad) { 7938 this._fetchData(); 7939 } else { 7940 this.handleLazyLoad(); 7941 } 7942 } 7943 handleLazyLoad() { 7944 if (!this.lazyLoad) { 7945 return; 7946 } 7947 const boundsRatio = parseFloat(this.getAttribute("lazyBoundsRatio") || "1"); 7948 const options = { 7949 root: null, 7950 rootMargin: Math.max(window.innerWidth * boundsRatio, window.innerHeight * boundsRatio) + "px", 7951 threshold: 0.9 7952 }; 7953 this.iObserver = new IntersectionObserver((entries) => this.onIntersection(entries), options); 7954 const root = this.shadowRoot ? this.shadowRoot : this; 7955 let elt = [...root.children].filter((e2) => e2.nodeName.toLowerCase() != "style")[0]; 7956 if (elt?.nodeName.toLocaleLowerCase() == "slot") 7957 elt = [...elt.children].filter((e2) => e2.nodeName.toLowerCase() != "style")[0]; 7958 if (!elt || elt.nodeName.toLocaleLowerCase() == "template") { 7959 elt = document.createElement("div"); 7960 const style = elt.style; 7961 style.pointerEvents = "none"; 7962 style.width = "1px"; 7963 style.height = "1px"; 7964 this.lazyLoadPlaceHolder = elt; 7965 this.appendChild(elt); 7966 } 7967 if (elt) { 7968 this.iObserver.observe(elt); 7969 } else if (this.isFirstLoad) { 7970 this._fetchData(); 7971 } 7972 } 7973 onIntersection(entries) { 7974 for (const e2 of entries) { 7975 if (e2.isIntersecting && this.isFirstLoad) { 7976 this._fetchData(); 7977 this.lazyLoadPlaceHolder?.remove(); 7978 this.lazyLoadPlaceHolder = void 0; 7979 this.iObserver?.disconnect(); 7980 break; 7981 } 7982 } 7983 } 7984 } 7985 __decorate$R([ 7986 n$5() 7987 ], FetcherElement.prototype, "noErrorsRecordings", void 0); 7988 __decorate$R([ 7989 n$5() 7990 ], FetcherElement.prototype, "props", null); 7991 __decorate$R([ 7992 n$5({ type: String }) 7993 ], FetcherElement.prototype, "endPoint", null); 7994 __decorate$R([ 7995 n$5() 7996 ], FetcherElement.prototype, "requestId", void 0); 7997 __decorate$R([ 7998 n$5({ type: Number }) 7999 ], FetcherElement.prototype, "refetchEveryMs", void 0); 8000 return FetcherElement; 8001 }; 8002 var __decorate$Q = function(decorators, target, key, desc) { 8003 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 8004 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 8005 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 8006 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 8007 }; 8008 const Form = (superClass) => { 8009 class FormInput2 extends superClass { 8010 constructor(...args) { 8011 super(); 8012 this.forceAutoFill = false; 8013 this._type = "text"; 8014 this.status = "default"; 8015 } 8016 validateFormElement() { 8017 const input = this.shadowRoot?.querySelector("input"); 8018 if (!input || input.checkValidity()) 8019 return; 8020 const formPublisher = this.getFormPublisher(); 8021 if (formPublisher) 8022 formPublisher.isFormValid = false; 8023 input.reportValidity(); 8024 } 8025 set type(value) { 8026 if (this.hasAttribute("type") && !this.forceAutoFill) 8027 value = this.getAttribute("type"); 8028 this._type = value; 8029 this.requestUpdate(); 8030 } 8031 get type() { 8032 return this._type; 8033 } 8034 get description() { 8035 return this._description; 8036 } 8037 set description(value) { 8038 if (this.hasAttribute("description") && !this.forceAutoFill) 8039 value = this.getAttribute("description"); 8040 this._description = value; 8041 this.requestUpdate(); 8042 } 8043 get label() { 8044 return this._label; 8045 } 8046 set label(value) { 8047 if (this.hasAttribute("label") && !this.forceAutoFill) 8048 value = this.getAttribute("label"); 8049 this._label = value; 8050 this.requestUpdate(); 8051 } 8052 } 8053 __decorate$Q([ 8054 n$5() 8055 ], FormInput2.prototype, "forceAutoFill", void 0); 8056 __decorate$Q([ 8057 n$5({ type: String }) 8058 ], FormInput2.prototype, "type", null); 8059 __decorate$Q([ 8060 n$5() 8061 ], FormInput2.prototype, "description", null); 8062 __decorate$Q([ 8063 n$5() 8064 ], FormInput2.prototype, "label", null); 8065 __decorate$Q([ 8066 n$5({ type: String, reflect: true }) 8067 ], FormInput2.prototype, "status", void 0); 8068 __decorate$Q([ 8069 n$5({ type: Number }) 8070 ], FormInput2.prototype, "tabindex", void 0); 8071 __decorate$Q([ 8072 n$5({ type: String }) 8073 ], FormInput2.prototype, "autocomplete", void 0); 8074 return FormInput2; 8075 }; 8076 var __decorate$P = function(decorators, target, key, desc) { 8077 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 8078 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 8079 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 8080 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 8081 }; 8082 const TemplatesContainer$1 = (superClass) => { 8083 class TemplatesContainerElement extends superClass { 8084 constructor() { 8085 super(...arguments); 8086 this.templates = null; 8087 this.templateValueAttribute = "data-value"; 8088 this.templateList = []; 8089 this.templateParts = {}; 8090 this.templatePartsList = []; 8091 } 8092 connectedCallback() { 8093 const templates = this.templates || [...this.querySelectorAll("template")]; 8094 for (const t2 of templates) { 8095 if (t2.hasAttribute(this.templateValueAttribute)) { 8096 this.templateParts[t2.getAttribute(this.templateValueAttribute)] = t2; 8097 this.templatePartsList.push(t2); 8098 } 8099 if (t2.hasAttribute("skeleton")) { 8100 this.templateParts["skeleton"] = t2; 8101 } 8102 if (t2.hasAttribute("no-result")) { 8103 this.templateParts["no-result"] = t2; 8104 } 8105 if (t2.hasAttribute("no-item")) { 8106 this.templateParts["no-item"] = t2; 8107 } 8108 } 8109 this.templateList = templates.filter((t2) => !t2.getAttribute("data-value")); 8110 if (this.templateList.length == 0) 8111 this.templateList = templates; 8112 super.connectedCallback(); 8113 } 8114 } 8115 __decorate$P([ 8116 n$5({ type: Array }) 8117 ], TemplatesContainerElement.prototype, "templates", void 0); 8118 return TemplatesContainerElement; 8119 }; 8120 const Fetcher = Fetcher$1; 8121 const FormCheckable = Form$1; 8122 const FormElement = Form$2; 8123 const FormInput = Form; 8124 const Subscriber = Subscriber$1; 8125 const TemplatesContainer = TemplatesContainer$1; 8126 window["concorde-mixins"] = window["concorde-mixins"] || {}; 8127 window["concorde-mixins"] = { 8128 Fetcher, 8129 FormCheckable, 8130 FormElement, 8131 FormInput, 8132 Subscriber, 8133 TemplatesContainer 8134 }; 8135 const o$2 = e$5(class extends i$4 { 8136 constructor(t2) { 8137 if (super(t2), t2.type !== t$1.CHILD) throw Error("templateContent can only be used in child bindings"); 8138 } 8139 render(r2) { 8140 return this.vt === r2 ? E : (this.vt = r2, document.importNode(r2.content, true)); 8141 } 8142 }); 8143 var __decorate$O = function(decorators, target, key, desc) { 8144 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 8145 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 8146 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 8147 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 8148 }; 8149 const tagName$2L = "sonic-fetch"; 8150 let Fetch = class Fetch extends Fetcher$1(Subscriber$1(TemplatesContainer(i$6))) { 8151 renderLoader() { 8152 if (!(this.isLoading && this.loader !== void 0)) 8153 return A$1; 8154 const loader = this.loader === true || this.loader === "" ? "fixed" : this.loader; 8155 return b$1`<sonic-loader mode=${loader}></sonic-loader>`; 8156 } 8157 renderSkeleton() { 8158 const template = this.templateParts["skeleton"]; 8159 if (!(this.isLoading && template)) 8160 return A$1; 8161 return o$2(template); 8162 } 8163 render() { 8164 return b$1` 8165 ${this.renderSkeleton()} ${this.renderLoader()} 8166 ${!this.isLoading ? b$1`<slot></slot>` : A$1} 8167 `; 8168 } 8169 }; 8170 Fetch.styles = [ 8171 i$9` 8172 :host { 8173 display: contents; 8174 } 8175 ` 8176 ]; 8177 __decorate$O([ 8178 n$5() 8179 ], Fetch.prototype, "loader", void 0); 8180 Fetch = __decorate$O([ 8181 t$3(tagName$2L) 8182 ], Fetch); 8183 class Route {
8184 constructor(name) { 8185 this.route = ""; 8186 if (!name) { 8187 return; 8188 } 8189 this.route = Routes.get(name); 8190 } 8191 extract() { 8192 const pattern = new URLPattern("(/)*" + this.route); 8193 const currentUrl = document.location.pathname + document.location.hash; 8194 const matches = pattern.match(currentUrl); 8195 return matches; 8196 } 8197 /** 8198 * @deprecated 8199 * @see matchesCurrentPath 8200 * @returns {boolean} 8201 */ 8202 matchesLocation() { 8203 return this.matchesCurrentPath(); 8204 } 8205 matchesCurrentPath() { 8206 return this.extract() !== null; 8207 } 8208 removeQuery() { 8209 const url = new URL(this.route, window.location.origin); 8210 url.search = ""; 8211 this.route = url.href.replace(window.location.origin, ""); 8212 return this; 8213 } 8214 withoutQuery() { 8215 return this.clone().removeQuery(); 8216 } 8217 clone() { 8218 const clonedRoute = new Route(); 8219 clonedRoute.route = this.route; 8220 return clonedRoute; 8221 } 8222 fill(properties) { 8223 this.route = new URLPattern(this.route).stringify(properties); 8224 return this; 8225 } 8226 query(query) { 8227 const url = new URL(this.route, window.location.origin); 8228 Object.entries(query).forEach(([key, value]) => { 8229 url.searchParams.set(key, value); 8230 }); 8231 this.route = url.href.replace(window.location.origin, ""); 8232 return this; 8233 } 8234 hash(hash) { 8235 const url = new URL(this.route, window.location.origin); 8236 url.hash = hash; 8237 this.route = url.href.replace(window.location.origin, ""); 8238 return this; 8239 } 8240 appendPath(pathname) { 8241 if (!pathname) { 8242 return this; 8243 } 8244 const url = new URL(this.route, window.location.origin); 8245 url.pathname = url.pathname.replace(/\/$/, ""); 8246 if (!pathname.startsWith("/")) { 8247 pathname = "/" + pathname; 8248 } 8249 url.pathname += pathname; 8250 this.route = url.href.replace(window.location.origin, ""); 8251 return this; 8252 } 8253 toString() { 8254 return this.route; 8255 } 8256 valueOf() { 8257 return this.route; 8258 } 8259 hasHash() { 8260 const url = new URL(this.route, window.location.origin); 8261 return url.hash !== ""; 8262 } 8263 getHash() { 8264 const url = new URL(this.route, window.location.origin); 8265 return url.hash; 8266 } 8267 hasSameBaseAs(route2) { 8268 if (!route2) { 8269 return false; 8270 } 8271 const url = new URL(this.route, window.location.origin); 8272 const url2 = new URL(route2.route, window.location.origin); 8273 return url.origin + url.pathname === url2.origin + url2.pathname; 8274 } 8275 goTo() { 8276 window.location.href = this.route; 8277 } 8278 } 8279 class Routes { 8280 static register(routes, baseUrlOrOpt = "", prefix = "") { 8281 const newRoutes = {}; 8282 Object.keys(routes).forEach((key) => { 8283 const name = key; 8284 let route2 = routes[name]; 8285 let baseUrl = ""; 8286 if (baseUrlOrOpt) { 8287 if (typeof baseUrlOrOpt === "string") { 8288 baseUrl = baseUrlOrOpt; 8289 } else { 8290 baseUrl = baseUrlOrOpt.baseUrl || ""; 8291 prefix = prefix || baseUrlOrOpt.prefix || ""; 8292 } 8293 } 8294 if (baseUrl && !route2.includes(baseUrl)) { 8295 route2 = baseUrl + "/" + route2; 8296 route2 = route2?.replace(/\/+/g, "/"); 8297 route2 = route2?.replace(/\/#/g, "#"); 8298 } 8299 newRoutes[prefix + name] = route2; 8300 }); 8301 Routes.routes = { ...Routes.routes, ...newRoutes }; 8302 } 8303 static get(name, args) { 8304 const routes = Routes.routes; 8305 let route2 = routes[name] || ""; 8306 if (args?.propertyMap) { 8307 route2 = new URLPattern(route2).stringify(args.propertyMap); 8308 } 8309 const url = new URL(route2, route2.startsWith("#") ? window.location.href : window.location.origin); 8310 if (args?.query) { 8311 Object.entries(args.query).forEach(([key, value]) => { 8312 url.searchParams.set(key, value); 8313 }); 8314 } 8315 if (args?.hash) { 8316 url.hash = args.hash; 8317 } 8318 return url.href.replace(window.location.origin, ""); 8319 } 8320 static fillURLPattern(route2, properties) { 8321 return new URLPattern(route2).stringify(properties); 8322 } 8323 } 8324 Routes.routes = {}; 8325 const route = (name) => { 8326 return new Route(name); 8327 }; 8328 const defaultAppRoutesBase = { 8329 // route implémentables 8330 home: "/", 8331 cart: "#sonic-cart", 8332 // panier 8333 agenda: "#sonic-agenda", 8334 // agenda 8335 giftcards: "#sonic-modal/giftcards", 8336 // cartes cadeaux 8337 carpooling: "#sonic-carpooling", 8338 // covoiturage 8339 // routes auto-implémentées 8340 account: "#sonic-account", 8341 // baseURL pour le account 8342 subscription: "#sonic-modal/subscription", 8343 campaign: "#sonic-campaign", 8344 checkout: "#sonic-cart/checkout", 8345 "checkout.end": "#sonic-purchase-process-completion", 8346 event: "#sonic-modal/event/:slug", 8347 orderRecover: "#sonic-modal/order-recover", 8348 promo: "#sonic-modal/promo", 8349 // code promo 8350 infosPrices: "#sonic-modal/infos-prices", 8351 // Tarifs 8352 refund: "#sonic-modal/refund", 8353 // Demande de remboursement 8354 seatmap: "#sonic-seatmap/:slug", 8355 // Sélection de place sur un plan 8356 freeup: "#sonic-modal/freeup", 8357 // Libérer sa place gratuite 8358 askProAccount: "#sonic-modal/ask-pro-account", 8359 // Demande de compte pro 8360 customList: "#sonic-list/:slug", 8361 // liste spécifique 8362 changePassword: "#sonic-modal/change-password", 8363 // changer de mot de passe 8364 waitingList: "#sonic-waiting-list/(:id)", 8365 // liste d'attente 8366 shop: "#sonic-modal/shop", 8367 merch: "#sonic-modal/shop/:slug", 8368 store: "#sonic-modal/store", 8369 // achat Rapide (à venir) 8370 customAgenda: "#sonic-custom-agenda/:slug", 8371 accreditationsDirectory: "#sonic-modal/accreditations-directory", 8372 reservationRequest: "#sonic-modal/reservation-request/(:id)" 8373 // demande de réservation 8374 }; 8375 const accountRoutes = { 8376 home: "#sonic-account/home", 8377 create: "#sonic-account/create-account", 8378 tickets: "#sonic-account/tickets", 8379 purchases: "#sonic-account/purchases", 8380 edit: "#sonic-account/edit", 8381 editPassword: "#sonic-account/edit-password", 8382 missingPassword: "#sonic-account/missing-password", 8383 trips: "#sonic-account/trips", 8384 reservationRequests: "#sonic-account/reservation-requests", 8385 reservations: "#sonic-account/reservations", 8386 waitingLists: "#sonic-account/waiting-lists" 8387 }; 8388 const defaultAppRoutes = defaultAppRoutesBase; 8389 const appRoute = route;
8390 let s$2 = class s extends Event { 8391 constructor(s2, t2, e2, o2) { 8392 super("context-request", { bubbles: true, composed: true }), this.context = s2, this.contextTarget = t2, this.callback = e2, this.subscribe = o2 ?? false; 8393 } 8394 }; 8395 function n(n2) { 8396 return n2; 8397 } 8398 let s$1 = class s { 8399 constructor(t2, s2, i2, h2) { 8400 if (this.subscribe = false, this.provided = false, this.value = void 0, this.t = (t3, s3) => { 8401 this.unsubscribe && (this.unsubscribe !== s3 && (this.provided = false, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = t3, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = true, this.callback && this.callback(t3, s3)), this.unsubscribe = s3; 8402 }, this.host = t2, void 0 !== s2.context) { 8403 const t3 = s2; 8404 this.context = t3.context, this.callback = t3.callback, this.subscribe = t3.subscribe ?? false; 8405 } else this.context = s2, this.callback = i2, this.subscribe = h2 ?? false; 8406 this.host.addController(this); 8407 } 8408 hostConnected() { 8409 this.dispatchRequest(); 8410 } 8411 hostDisconnected() { 8412 this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0); 8413 } 8414 dispatchRequest() { 8415 this.host.dispatchEvent(new s$2(this.context, this.host, this.t, this.subscribe)); 8416 } 8417 }; 8418 class s { 8419 get value() { 8420 return this.o; 8421 } 8422 set value(s2) { 8423 this.setValue(s2); 8424 } 8425 setValue(s2, t2 = false) { 8426 const i2 = t2 || !Object.is(s2, this.o); 8427 this.o = s2, i2 && this.updateObservers(); 8428 } 8429 constructor(s2) { 8430 this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => { 8431 for (const [s3, { disposer: t2 }] of this.subscriptions) s3(this.o, t2); 8432 }, void 0 !== s2 && (this.value = s2); 8433 } 8434 addCallback(s2, t2, i2) { 8435 if (!i2) return void s2(this.value); 8436 this.subscriptions.has(s2) || this.subscriptions.set(s2, { disposer: () => { 8437 this.subscriptions.delete(s2); 8438 }, consumerHost: t2 }); 8439 const { disposer: h2 } = this.subscriptions.get(s2); 8440 s2(this.value, h2); 8441 } 8442 clearCallbacks() { 8443 this.subscriptions.clear(); 8444 } 8445 } 8446 let e$3 = class e extends Event { 8447 constructor(t2, s2) { 8448 super("context-provider", { bubbles: true, composed: true }), this.context = t2, this.contextTarget = s2; 8449 } 8450 }; 8451 let i$1 = class i extends s { 8452 constructor(s2, e2, i2) { 8453 super(void 0 !== e2.context ? e2.initialValue : i2), this.onContextRequest = (t2) => { 8454 if (t2.context !== this.context) return; 8455 const s3 = t2.contextTarget ?? t2.composedPath()[0]; 8456 s3 !== this.host && (t2.stopPropagation(), this.addCallback(t2.callback, s3, t2.subscribe)); 8457 }, this.onProviderRequest = (s3) => { 8458 if (s3.context !== this.context) return; 8459 if ((s3.contextTarget ?? s3.composedPath()[0]) === this.host) return; 8460 const e3 = /* @__PURE__ */ new Set(); 8461 for (const [s4, { consumerHost: i3 }] of this.subscriptions) e3.has(s4) || (e3.add(s4), i3.dispatchEvent(new s$2(this.context, i3, s4, true))); 8462 s3.stopPropagation(); 8463 }, this.host = s2, void 0 !== e2.context ? this.context = e2.context : this.context = e2, this.attachListeners(), this.host.addController?.(this); 8464 } 8465 attachListeners() { 8466 this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest); 8467 } 8468 hostConnected() { 8469 this.host.dispatchEvent(new e$3(this.context, this.host)); 8470 } 8471 }; 8472 function e$2({ context: e2 }) { 8473 return (n2, i2) => { 8474 const r2 = /* @__PURE__ */ new WeakMap(); 8475 if ("object" == typeof i2) return { get() { 8476 return n2.get.call(this); 8477 }, set(t2) { 8478 return r2.get(this).setValue(t2), n2.set.call(this, t2); 8479 }, init(n3) { 8480 return r2.set(this, new i$1(this, { context: e2, initialValue: n3 })), n3; 8481 } }; 8482 { 8483 n2.constructor.addInitializer(((n3) => { 8484 r2.set(n3, new i$1(n3, { context: e2 })); 8485 })); 8486 const o2 = Object.getOwnPropertyDescriptor(n2, i2); 8487 let s2; 8488 if (void 0 === o2) { 8489 const t2 = /* @__PURE__ */ new WeakMap(); 8490 s2 = { get() { 8491 return t2.get(this); 8492 }, set(e3) { 8493 r2.get(this).setValue(e3), t2.set(this, e3); 8494 }, configurable: true, enumerable: true }; 8495 } else { 8496 const t2 = o2.set; 8497 s2 = { ...o2, set(e3) { 8498 r2.get(this).setValue(e3), t2?.call(this, e3); 8499 } }; 8500 } 8501 return void Object.defineProperty(n2, i2, s2); 8502 } 8503 }; 8504 } 8505 function c({ context: c2, subscribe: e2 }) { 8506 return (o2, n2) => { 8507 "object" == typeof n2 ? n2.addInitializer((function() { 8508 new s$1(this, { context: c2, callback: (t2) => { 8509 o2.set.call(this, t2); 8510 }, subscribe: e2 }); 8511 })) : o2.constructor.addInitializer(((o3) => {
8512 new s$1(o3, { context: c2, callback: (t2) => { 8513 o3[n2] = t2; 8514 }, subscribe: e2 }); 8515 })); 8516 }; 8517 } 8518 const appType = n("appType"); 8519 const staticMode = n("staticMode"); 8520 const APP_TAG_SELECTOR = "sonic-counter-app, sonic-tickets-app, access-control-app"; 8521 function asSearchableHost(component) { 8522 if (component instanceof HTMLElement || component instanceof ShadowRoot) { 8523 return component; 8524 } 8525 return null; 8526 } 8527 function readApiConfigurationFromPublisher(publisher) { 8528 if (!publisher || typeof publisher.get !== "function") 8529 return null; 8530 const raw = publisher.get(); 8531 if (!raw || typeof raw !== "object") 8532 return null; 8533 if (!("serviceURL" in raw)) 8534 return null; 8535 return raw; 8536 } 8537 function resolveScopedConfiguration(component) { 8538 const host = asSearchableHost(component); 8539 if (!host) 8540 return null; 8541 return HTML$1.getApiConfiguration(host); 8542 } 8543 function isScopedConfigurationReady(config) { 8544 return typeof config?.serviceURL === "string" && config.serviceURL.length > 0; 8545 } 8546 const SCOPE_WATCH_ATTRIBUTES = [ 8547 "serviceURL", 8548 "serviceurl", 8549 "token", 8550 "credentials", 8551 "tokenProvider", 8552 "tokenprovider", 8553 "userName", 8554 "username", 8555 "password", 8556 "eventsApiToken", 8557 "eventsapitoken" 8558 ]; 8559 function isLitHost(component) { 8560 return component instanceof HTMLElement && typeof component.updateComplete !== "undefined"; 8561 } 8562 function createAnimationFrameCoalescedRunner(run) { 8563 let frameId = null; 8564 return () => { 8565 if (frameId !== null) 8566 return; 8567 frameId = requestAnimationFrame(() => { 8568 frameId = null; 8569 run(); 8570 }); 8571 }; 8572 } 8573 function scheduleAfterHostReady(component, callback) { 8574 if (isLitHost(component)) { 8575 let cancelled = false; 8576 void component.updateComplete.then(() => { 8577 if (!cancelled) 8578 callback(); 8579 }); 8580 return () => { 8581 cancelled = true; 8582 }; 8583 } 8584 callback(); 8585 return () => { 8586 }; 8587 } 8588 function watchScopedConfiguration(component, onReady) { 8589 const host = asSearchableHost(component); 8590 if (!host) 8591 return () => { 8592 }; 8593 let settled = false; 8594 const tryNotify = () => { 8595 if (settled) 8596 return; 8597 if (!isScopedConfigurationReady(resolveScopedConfiguration(component))) { 8598 return; 8599 } 8600 settled = true; 8601 onReady(); 8602 }; 8603 tryNotify(); 8604 if (settled) 8605 return () => { 8606 }; 8607 const cleanups = []; 8608 const rafId = requestAnimationFrame(() => tryNotify()); 8609 cleanups.push(() => cancelAnimationFrame(rafId)); 8610 queueMicrotask(() => tryNotify()); 8611 const observer = new MutationObserver(() => tryNotify()); 8612 let node = host; 8613 while (node) { 8614 if (node instanceof Element) { 8615 observer.observe(node, { 8616 attributes: true, 8617 attributeFilter: [...SCOPE_WATCH_ATTRIBUTES] 8618 }); 8619 } 8620 node = node.parentNode || node.host; 8621 } 8622 cleanups.push(() => observer.disconnect()); 8623 return () => { 8624 settled = true; 8625 cleanups.forEach((cleanup) => cleanup()); 8626 }; 8627 } 8628 function detachConfigPublisher(state) { 8629 if (state.configPublisher && state.configMutationHandler) { 8630 state.configPublisher.offInternalMutation(state.configMutationHandler); 8631 } 8632 state.configPublisher = null; 8633 state.configMutationHandler = null; 8634 } 8635 function get$1(endpoint, configurationKeyOrOptions, maybeOptions) { 8636 const pathTemplate = endpoint.path; 8637 const configurationKey = isGetOptions(configurationKeyOrOptions) ? void 0 : configurationKeyOrOptions; 8638 const options = isGetOptions(configurationKeyOrOptions) ? configurationKeyOrOptions : maybeOptions; 8639 const pathOptions = { 8640 skipEmptyPlaceholder: options?.skipEmptyPlaceholder 8641 }; 8642 const configurationKeyPath = configurationKey?.path; 8643 const triggerKeyPath = options?.triggerKey?.path; 8644 const endpointDynamicDependencies = extractDynamicDependencies(pathTemplate); 8645 const configKeyDynamicDependencies = configurationKeyPath ? extractDynamicDependencies(configurationKeyPath) : []; 8646 const triggerKeyDynamicDependencies = triggerKeyPath ? extractDynamicDependencies(triggerKeyPath) : []; 8647 const mergedDynamicDependencies = [ 8648 .../* @__PURE__ */ new Set([ 8649 ...endpointDynamicDependencies, 8650 ...configKeyDynamicDependencies, 8651 ...triggerKeyDynamicDependencies 8652 ]) 8653 ]; 8654 const isDynamicPath = endpointDynamicDependencies.length > 0; 8655 const usesPublisherConfig = Boolean(configurationKeyPath); 8656 const refetchEveryMs = options?.refetchEveryMs ?? 0; 8657 return function(target, propertyKey) { 8658 if (!target) 8659 return; 8660 setSubscribable(target); 8661 const stateKey = `__get_state_${propertyKey}`; 8662 target.__onConnected__((component) => { 8663 const comp = component; 8664 let state = comp[stateKey]; 8665 if (!state) { 8666 state = { 8667 cleanupWatchers: [], 8668 requestGeneration: 0, 8669 configPublisher: null, 8670 configMutationHandler: null, 8671 scopeWatchCleanup: null, 8672 triggerPublisher: null, 8673 triggerInvalidateHandler: null, 8674 refetchTimeoutId: null, 8675 refetchEveryMs 8676 }; 8677 comp[stateKey] = state; 8678 }
8679 state.cleanupWatchers.forEach((cleanup) => cleanup()); 8680 state.cleanupWatchers = []; 8681 state.requestGeneration++; 8682 state.refetchEveryMs = refetchEveryMs; 8683 clearRefetch(state); 8684 const scheduleRefetch = () => { 8685 clearRefetch(state); 8686 if (!state.refetchEveryMs || state.refetchEveryMs <= 0) 8687 return; 8688 state.refetchTimeoutId = setTimeout(() => { 8689 state.refetchTimeoutId = null; 8690 runFetch(); 8691 }, state.refetchEveryMs); 8692 }; 8693 const runFetch = () => { 8694 const resolution = isDynamicPath ? resolveDynamicPath(component, pathTemplate, pathOptions) : { ready: true, path: pathTemplate }; 8695 if (!resolution.ready || !resolution.path) { 8696 comp[propertyKey] = void 0; 8697 scheduleRefetch(); 8698 return; 8699 } 8700 let config = null; 8701 if (usesPublisherConfig && configurationKeyPath) { 8702 const configRes = resolveDynamicPath(component, configurationKeyPath, pathOptions); 8703 if (!configRes.ready || !configRes.path) { 8704 comp[propertyKey] = void 0; 8705 scheduleRefetch(); 8706 return; 8707 } 8708 const configPublisher = getPublisherFromPath(configRes.path); 8709 config = readApiConfigurationFromPublisher(configPublisher); 8710 } else { 8711 config = resolveScopedConfiguration(component); 8712 } 8713 if (!isScopedConfigurationReady(config)) { 8714 if (!usesPublisherConfig && !state.scopeWatchCleanup) { 8715 const scopeWatch = watchScopedConfiguration(component, runFetch); 8716 state.scopeWatchCleanup = scopeWatch; 8717 state.cleanupWatchers.push(() => { 8718 scopeWatch(); 8719 state.scopeWatchCleanup = null; 8720 }); 8721 } 8722 scheduleRefetch(); 8723 return; 8724 } 8725 const generation = ++state.requestGeneration; 8726 const api2 = new API(config); 8727 void api2.getDetailed(resolution.path).then((payload) => { 8728 if (generation !== state.requestGeneration) 8729 return; 8730 comp[propertyKey] = payload; 8731 scheduleRefetch(); 8732 }); 8733 }; 8734 const scheduleFetch = createAnimationFrameCoalescedRunner(runFetch); 8735 const rebindTriggerPublisher = () => { 8736 detachTriggerPublisher(state); 8737 if (!triggerKeyPath) 8738 return; 8739 const triggerResolution = resolveDynamicPath(component, triggerKeyPath, pathOptions); 8740 if (!triggerResolution.ready || !triggerResolution.path) { 8741 return; 8742 } 8743 const publisher = getPublisherFromPath(triggerResolution.path); 8744 if (!publisher) 8745 return; 8746 const invalidateHandler = () => scheduleFetch(); 8747 publisher.onInvalidate(invalidateHandler); 8748 state.triggerPublisher = publisher; 8749 state.triggerInvalidateHandler = invalidateHandler; 8750 }; 8751 const rebindPublisherConfig = () => { 8752 if (!usesPublisherConfig || !configurationKeyPath) 8753 return; 8754 detachConfigPublisher(state); 8755 const configRes = resolveDynamicPath(component, configurationKeyPath, pathOptions); 8756 if (!configRes.ready || !configRes.path) { 8757 comp[propertyKey] = void 0; 8758 return; 8759 } 8760 const publisher = getPublisherFromPath(configRes.path); 8761 if (!publisher) { 8762 comp[propertyKey] = void 0; 8763 return; 8764 } 8765 const mutationHandler = () => scheduleFetch(); 8766 publisher.onInternalMutation(mutationHandler); 8767 state.configPublisher = publisher; 8768 state.configMutationHandler = mutationHandler; 8769 }; 8770 const rebindAll = () => { 8771 rebindTriggerPublisher(); 8772 rebindPublisherConfig(); 8773 if (!usesPublisherConfig) { 8774 scheduleFetch(); 8775 } 8776 }; 8777 if (usesPublisherConfig || triggerKeyDynamicDependencies.length) { 8778 for (const dependency of mergedDynamicDependencies) { 8779 const unsubscribe = observeDynamicProperty(getDynamicWatchKeys.watcherStore, getDynamicWatchKeys.hooked, component, dependency, () =>
8779 rebindAll()); 8780 state.cleanupWatchers.push(unsubscribe); 8781 } 8782 rebindAll(); 8783 } else { 8784 const startScopedFetch = () => { 8785 if (isDynamicPath) { 8786 for (const dependency of endpointDynamicDependencies) { 8787 const unsubscribe = observeDynamicProperty(getDynamicWatchKeys.watcherStore, getDynamicWatchKeys.hooked, component, dependency, () => scheduleFetch()); 8788 state.cleanupWatchers.push(unsubscribe); 8789 } 8790 } 8791 rebindTriggerPublisher(); 8792 runFetch(); 8793 }; 8794 state.cleanupWatchers.push(scheduleAfterHostReady(component, startScopedFetch)); 8795 } 8796 }); 8797 target.__onDisconnected__((component) => { 8798 const comp = component; 8799 const state = comp[stateKey]; 8800 if (!state) 8801 return; 8802 detachConfigPublisher(state); 8803 detachTriggerPublisher(state); 8804 clearRefetch(state); 8805 state.cleanupWatchers.forEach((cleanup) => cleanup()); 8806 state.cleanupWatchers = []; 8807 state.requestGeneration++; 8808 comp[propertyKey] = void 0; 8809 }); 8810 }; 8811 } 8812 function isGetOptions(value) { 8813 if (!value || typeof value !== "object") 8814 return false; 8815 return "skipEmptyPlaceholder" in value || "refetchEveryMs" in value || "triggerKey" in value; 8816 } 8817 function isApiSendOptions(value) { 8818 if (!value || typeof value !== "object") 8819 return false; 8820 return "refetchEveryMs" in value || "skipIfBodyMissing" in value || "autoPostOnBodyMutation" in value || "skipEmptyPlaceholder" in value || "triggerKey" in value; 8821 } 8822 function detachBodyPublisher(state) { 8823 if (state.bodyPublisher && state.bodyMutationHandler) { 8824 state.bodyPublisher.offInternalMutation(state.bodyMutationHandler); 8825 } 8826 state.bodyPublisher = null; 8827 state.bodyMutationHandler = null; 8828 } 8829 function detachTriggerPublisher(state) { 8830 if (state.triggerPublisher && state.triggerInvalidateHandler) { 8831 state.triggerPublisher.offInvalidate(state.triggerInvalidateHandler); 8832 } 8833 state.triggerPublisher = null; 8834 state.triggerInvalidateHandler = null; 8835 } 8836 function clearRefetch(state) { 8837 if (state.refetchTimeoutId) { 8838 clearTimeout(state.refetchTimeoutId); 8839 state.refetchTimeoutId = null; 8840 } 8841 } 8842 function readBodyFromPublisher(publisher) { 8843 if (!publisher || typeof publisher.get !== "function") 8844 return void 0; 8845 return publisher.get(); 8846 } 8847 function createApiSendDecorator(method, callDetailed) { 8848 return function(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions) { 8849 const pathTemplate = endpoint.path; 8850 const bodyKeyPath = bodyKey.path; 8851 const configurationKey = isApiSendOptions(configurationKeyOrOptions) ? void 0 : configurationKeyOrOptions; 8852 const options = isApiSendOptions(configurationKeyOrOptions) ? configurationKeyOrOptions : maybeOptions; 8853 const configurationKeyPath = configurationKey?.path; 8854 const triggerKeyPath = options?.triggerKey?.path; 8855 const endpointDynamicDependencies = extractDynamicDependencies(pathTemplate); 8856 const bodyKeyDynamicDependencies = extractDynamicDependencies(bodyKeyPath); 8857 const configKeyDynamicDependencies = configurationKeyPath ? extractDynamicDependencies(configurationKeyPath) : []; 8858 const triggerKeyDynamicDependencies = triggerKeyPath ? extractDynamicDependencies(triggerKeyPath) : []; 8859 const mergedDynamicDependencies = [ 8860 .../* @__PURE__ */ new Set([ 8861 ...endpointDynamicDependencies, 8862 ...bodyKeyDynamicDependencies, 8863 ...configKeyDynamicDependencies, 8864 ...triggerKeyDynamicDependencies 8865 ]) 8866 ]; 8867 const isDynamicPath = endpointDynamicDependencies.length > 0; 8868 const usesPublisherConfig = Boolean(configurationKeyPath); 8869 const refetchEveryMs = options?.refetchEveryMs ?? 0; 8870 const skipIfBodyMissing = options?.skipIfBodyMissing ?? true; 8871 const autoPostOnBodyMutation = options?.autoPostOnBodyMutation ?? true; 8872 const pathOptions = { 8873 skipEmptyPlaceholder: options?.skipEmptyPlaceholder 8874 }; 8875 const stateKeyPrefix = `__${method.toLowerCase()}_state_`; 8876 return function(target, propertyKey) { 8877 if (!target) 8878 return; 8879 setSubscribable(target); 8880 const stateKey = `${stateKeyPrefix}${propertyKey}`; 8881 target.__onConnected__((component) => { 8882 const comp = component; 8883 let state = comp[stateKey]; 8884 if (!state) { 8885 state = { 8886 cleanupWatchers: [], 8887 requestGeneration: 0, 8888 configPublisher: null, 8889 configMutationHandler: null, 8890 scopeWatchCleanup: null, 8891 bodyPublisher: null, 8892 bodyMutationHandler: null, 8893 triggerPublisher: null, 8894 triggerInvalidateHandler: null, 8895 refetchTimeoutId: null, 8896 refetchEveryMs, 8897 skipIfBodyMissing, 8898 autoPostOnBodyMutation 8899 }; 8900 comp[stateKey] = state; 8901 }
8902 state.cleanupWatchers.forEach((cleanup) => cleanup()); 8903 state.cleanupWatchers = []; 8904 state.requestGeneration++; 8905 state.refetchEveryMs = refetchEveryMs; 8906 state.skipIfBodyMissing = skipIfBodyMissing; 8907 state.autoPostOnBodyMutation = autoPostOnBodyMutation; 8908 clearRefetch(state); 8909 const scheduleRefetch = () => { 8910 clearRefetch(state); 8911 if (!state.refetchEveryMs || state.refetchEveryMs <= 0) 8912 return; 8913 state.refetchTimeoutId = setTimeout(() => { 8914 state.refetchTimeoutId = null; 8915 runSend(); 8916 }, state.refetchEveryMs); 8917 }; 8918 const runSend = () => { 8919 const resolution = isDynamicPath ? resolveDynamicPath(component, pathTemplate, pathOptions) : { ready: true, path: pathTemplate }; 8920 if (!resolution.ready || !resolution.path) { 8921 comp[propertyKey] = void 0; 8922 scheduleRefetch(); 8923 return; 8924 } 8925 const bodyResolution = resolveDynamicPath(component, bodyKeyPath, pathOptions); 8926 if (!bodyResolution.ready || !bodyResolution.path) { 8927 comp[propertyKey] = void 0; 8928 scheduleRefetch(); 8929 return; 8930 } 8931 const bodyPublisher = getPublisherFromPath(bodyResolution.path); 8932 const body = readBodyFromPublisher(bodyPublisher); 8933 if (state.skipIfBodyMissing && (body === null || body === void 0)) { 8934 scheduleRefetch(); 8935 return; 8936 } 8937 let config = null; 8938 if (usesPublisherConfig && configurationKeyPath) { 8939 const configRes = resolveDynamicPath(component, configurationKeyPath, pathOptions); 8940 if (!configRes.ready || !configRes.path) { 8941 comp[propertyKey] = void 0; 8942 scheduleRefetch(); 8943 return; 8944 } 8945 const configPublisher = getPublisherFromPath(configRes.path); 8946 config = readApiConfigurationFromPublisher(configPublisher); 8947 } else { 8948 config = resolveScopedConfiguration(component); 8949 } 8950 if (!isScopedConfigurationReady(config)) { 8951 if (!usesPublisherConfig && !state.scopeWatchCleanup) { 8952 const scopeWatch = watchScopedConfiguration(component, runSend); 8953 state.scopeWatchCleanup = scopeWatch; 8954 state.cleanupWatchers.push(() => { 8955 scopeWatch(); 8956 state.scopeWatchCleanup = null; 8957 }); 8958 } 8959 scheduleRefetch(); 8960 return; 8961 } 8962 const generation = ++state.requestGeneration; 8963 const api2 = new API(config); 8964 void callDetailed(api2, resolution.path, body).then((payload) => { 8965 if (generation !== state.requestGeneration) 8966 return; 8967 comp[propertyKey] = payload; 8968 scheduleRefetch(); 8969 }); 8970 }; 8971 const scheduleSend = createAnimationFrameCoalescedRunner(runSend); 8972 const rebindBodyPublisher = () => { 8973 detachBodyPublisher(state); 8974 if (!state.autoPostOnBodyMutation) { 8975 return; 8976 } 8977 const bodyResolution = resolveDynamicPath(component, bodyKeyPath, pathOptions); 8978 if (!bodyResolution.ready || !bodyResolution.path) { 8979 return; 8980 } 8981 const publisher = getPublisherFromPath(bodyResolution.path); 8982 if (!publisher) 8983 return; 8984 const mutationHandler = () => scheduleSend(); 8985 publisher.onInternalMutation(mutationHandler); 8986 state.bodyPublisher = publisher; 8987 state.bodyMutationHandler = mutationHandler; 8988 }; 8989 const rebindTriggerPublisher = () => { 8990 detachTriggerPublisher(state); 8991 if (!triggerKeyPath) 8992 return; 8993 const triggerResolution = resolveDynamicPath(component, triggerKeyPath, pathOptions); 8994 if (!triggerResolution.ready || !triggerResolution.path) { 8995 return; 8996 } 8997 const publisher = getPublisherFromPath(triggerResolution.path); 8998 if (!publisher) 8999 return; 9000 const invalidateHandler = () =>
9000 scheduleSend(); 9001 publisher.onInvalidate(invalidateHandler); 9002 state.triggerPublisher = publisher; 9003 state.triggerInvalidateHandler = invalidateHandler; 9004 }; 9005 const rebindPublisherConfig = () => { 9006 if (!usesPublisherConfig || !configurationKeyPath) 9007 return; 9008 detachConfigPublisher(state); 9009 const configRes = resolveDynamicPath(component, configurationKeyPath, pathOptions); 9010 if (!configRes.ready || !configRes.path) { 9011 comp[propertyKey] = void 0; 9012 return; 9013 } 9014 const publisher = getPublisherFromPath(configRes.path); 9015 if (!publisher) { 9016 comp[propertyKey] = void 0; 9017 return; 9018 } 9019 const mutationHandler = () => scheduleSend(); 9020 publisher.onInternalMutation(mutationHandler); 9021 state.configPublisher = publisher; 9022 state.configMutationHandler = mutationHandler; 9023 }; 9024 const rebindAll = () => { 9025 rebindBodyPublisher(); 9026 rebindTriggerPublisher(); 9027 rebindPublisherConfig(); 9028 if (state.autoPostOnBodyMutation) { 9029 scheduleSend(); 9030 } 9031 }; 9032 if (usesPublisherConfig || bodyKeyDynamicDependencies.length || triggerKeyDynamicDependencies.length) { 9033 for (const dependency of mergedDynamicDependencies) { 9034 const unsubscribe = observeDynamicProperty(getDynamicWatchKeys.watcherStore, getDynamicWatchKeys.hooked, component, dependency, () => rebindAll()); 9035 state.cleanupWatchers.push(unsubscribe); 9036 } 9037 rebindAll(); 9038 } else { 9039 const startScopedSend = () => { 9040 if (isDynamicPath) { 9041 for (const dependency of endpointDynamicDependencies) { 9042 const unsubscribe = observeDynamicProperty(getDynamicWatchKeys.watcherStore, getDynamicWatchKeys.hooked, component, dependency, () => scheduleSend()); 9043 state.cleanupWatchers.push(unsubscribe); 9044 } 9045 } 9046 rebindBodyPublisher(); 9047 rebindTriggerPublisher(); 9048 if (state.autoPostOnBodyMutation) { 9049 scheduleSend(); 9050 } 9051 }; 9052 state.cleanupWatchers.push(scheduleAfterHostReady(component, startScopedSend)); 9053 } 9054 }); 9055 target.__onDisconnected__((component) => { 9056 const comp = component; 9057 const state = comp[stateKey]; 9058 if (!state) 9059 return; 9060 detachConfigPublisher(state); 9061 detachBodyPublisher(state); 9062 detachTriggerPublisher(state); 9063 clearRefetch(state); 9064 state.cleanupWatchers.forEach((cleanup) => cleanup()); 9065 state.cleanupWatchers = []; 9066 state.requestGeneration++; 9067 comp[propertyKey] = void 0; 9068 }); 9069 }; 9070 }; 9071 } 9072 function post(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions) { 9073 return createApiSendDecorator("POST", (api2, path, body) => api2.postDetailed(path, body))(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions); 9074 } 9075 function put(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions) { 9076 return createApiSendDecorator("PUT", (api2, path, body) => api2.putDetailed(path, body))(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions); 9077 } 9078 function patch(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions) { 9079 return createApiSendDecorator("PATCH", (api2, path, body) => api2.patchDetailed(path, body))(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions); 9080 } 9081 const CONNECTED = "sonic-connected"; 9082 const READY_TIMEOUT_MS = 5e3; 9083 const CONNECTED_SYMBOL = /* @__PURE__ */ Symbol.for("sonic-connected"); 9084 function isWebComponent(element) { 9085 return element.tagName.includes("-"); 9086 } 9087 function waitForAncestorReady(ancestor, timeoutMs = READY_TIMEOUT_MS) { 9088 if (!isWebComponent(ancestor)) 9089 return Promise.resolve(); 9090 if (ancestor[CONNECTED_SYMBOL]) 9091 return Promise.resolve(); 9092 return new Promise((resolve) => { 9093 const handler = () => { 9094 ancestor[CONNECTED_SYMBOL] = true; 9095 ancestor.removeEventListener(CONNECTED, handler); 9096 resolve(); 9097 }; 9098 ancestor.addEventListener(CONNECTED, handler); 9099 setTimeout(() => { 9100 ancestor.removeEventListener(CONNECTED, handler); 9101 resolve(); 9102 }, timeoutMs); 9103 }); 9104 } 9105 function awaitConnectedAncestors$1(...selectors) { 9106 return function(constructor) { 9107 if (!selectors.length) 9108 return constructor; 9109 const originalConnectedCallback = constructor.prototype.connectedCallback; 9110 constructor.prototype.connectedCallback = function() { 9111 const ancestors = HTML$1.getAncestorsBySelectors(this, selectors); 9112 const webComponentAncestors = ancestors.filter(isWebComponent); 9113 const whenDefinedPromises = [ 9114 ...new Set(webComponentAncestors.map((a2) => a2.tagName.toLowerCase())) 9115 ].map((tag) => customElements.whenDefined(tag)); 9116 const readyPromises = ancestors.map((a2) => waitForAncestorReady(a2)); 9117 Promise.all([...whenDefinedPromises, ...readyPromises]).then(() => { 9118 originalConnectedCallback?.call(this); 9119 }); 9120 }; 9121 return constructor; 9122 }; 9123 } 9124 function dispatchConnectedEvent$1() { 9125 return function(constructor) { 9126 const original = constructor.prototype.connectedCallback; 9127 constructor.prototype.connectedCallback = function() { 9128 original?.call(this); 9129 this[CONNECTED_SYMBOL] = true; 9130 this.dispatchEvent(new CustomEvent(CONNECTED, { bubbles: true })); 9131 }; 9132 return constructor; 9133 }; 9134 } 9135 const bind = bind$1; 9136 const onAssign = onAssign$1; 9137 const handle = handle$1; 9138 const ancestorAttribute = ancestorAttribute$1; 9139 const awaitConnectedAncestors = awaitConnectedAncestors$1; 9140 const dispatchConnectedEvent = dispatchConnectedEvent$1; 9141 window["concorde-decorator-subscriber"] = window["concorde-decorator-subscriber"] || {}; 9142 window["concorde-decorator-subscriber"] = { 9143 bind: bind$1, 9144 publish, 9145 subscribe: subscribe$1, 9146 onAssing: onAssign$1, 9147 handle: handle$1, 9148 ancestorAttribute: ancestorAttribute$1, 9149 autoSubscribe, 9150 autoFill, 9151 get: get$1, 9152 post, 9153 put, 9154 patch 9155 }; 9156 var __defProp$3O = Object.defineProperty; 9157 var __getOwnPropDesc$3R = Object.getOwnPropertyDescriptor; 9158 var __decorateClass$3S = (decorators, target, key, kind) => { 9159 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3R(target, key) : target; 9160 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 9161 if (decorator = decorators[i2]) 9162 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 9163 if (kind && result) __defProp$3O(target, key, result); 9164 return result; 9165 }; 9166 const tagName$2K = "sonic-app-link"; 9167 let SonicAppLink = class extends Button { 9168 constructor() { 9169 super(...arguments); 9170 this.query = {}; 9171 this.isEnabled = true; 9172 } 9173 connectedCallback() { 9174 if (!this.hasAttribute("variant")) { 9175 this.variant = "unstyled"; 9176 } 9177 super.connectedCallback(); 9178 } 9179 willUpdate(changedProperties) { 9180 if (this.to) { 9181 const app_route = appRoute(this.to); 9182 app_route.fill({ slug: this.slug, id: this.id, hash: this.hash }); 9183 this.handleEventId(this.to); 9184 app_route.query(this.query); 9185 this.href = app_route.toString(); 9186 } 9187 if ((this.modulesSettings || this.currentAdminPermissions) && this.to) {
9188 this.isEnabled = this.checkIfAccess(this.to); 9189 } 9190 super.willUpdate(changedProperties); 9191 } 9192 handleEventId(route2) { 9193 if (!route2 || route2 !== "event") return; 9194 const isShowContext = typeof this.props === "object" && this.props && "sessions" in this.props; 9195 const toShow = this.toShow || isShowContext; 9196 if (toShow) return; 9197 const id = this.slug?.split("-")[0] || this.id; 9198 if (id) { 9199 this.query = { 9200 ...this.query, 9201 session: id 9202 }; 9203 } 9204 } 9205 updated(changedProperties) { 9206 if (changedProperties.has("active")) { 9207 if (this.active) { 9208 this._slottedItems.forEach((item) => { 9209 item.classList.add(this.slotActiveClass || "active"); 9210 if (this.slotActiveAttribute) { 9211 item.setAttribute(this.slotActiveAttribute, ""); 9212 } 9213 }); 9214 } else { 9215 this._slottedItems.forEach((item) => { 9216 item.classList.remove(this.slotActiveClass || "active"); 9217 if (this.slotActiveAttribute) { 9218 item.removeAttribute(this.slotActiveAttribute); 9219 } 9220 }); 9221 } 9222 } 9223 } 9224 isCurrentRoute() { 9225 const isCurrentPath = appRoute(this.to).matchesCurrentPath(); 9226 return isCurrentPath; 9227 } 9228 checkIfAccess(route2) { 9229 if (this.modulesSettings) { 9230 const module = this.modulesSettings[route2]; 9231 if (this.appType === "counter" && module?.adminAccess === false) { 9232 return false; 9233 } else if (this.appType === "customer" && module?.access === false) { 9234 return false; 9235 } 9236 } 9237 if (this.currentAdminPermissions) { 9238 let mainRoute = route2.split(".")[0]; 9239 let subRoute = this.to?.split(".")[1] || "view"; 9240 const permission = this.currentAdminPermissions?.[mainRoute]?.[subRoute]; 9241 if (permission === false) { 9242 return false; 9243 } 9244 } 9245 return true; 9246 } 9247 render() { 9248 if (!this.isEnabled || !this.href || this.hideIfCurrentRoute && this.isCurrentRoute()) { 9249 if (this.alwaysDisplay && !this.isEnabled) { 9250 this.style.removeProperty("display"); 9251 this.style.pointerEvents = "none"; 9252 } else { 9253 this.style.display = "none "; 9254 } 9255 } 9256 return super.render(); 9257 } 9258 }; 9259 __decorateClass$3S([ 9260 n$5({ type: String }) 9261 ], SonicAppLink.prototype, "to", 2); 9262 __decorateClass$3S([ 9263 n$5({ type: String }) 9264 ], SonicAppLink.prototype, "slotActiveClass", 2); 9265 __decorateClass$3S([ 9266 n$5({ type: String }) 9267 ], SonicAppLink.prototype, "slotActiveAttribute", 2); 9268 __decorateClass$3S([ 9269 n$5({ type: String }) 9270 ], SonicAppLink.prototype, "slug", 2); 9271 __decorateClass$3S([ 9272 n$5({ type: String }) 9273 ], SonicAppLink.prototype, "hash", 2); 9274 __decorateClass$3S([ 9275 n$5({ type: Boolean }) 9276 ], SonicAppLink.prototype, "hideIfCurrentRoute", 2); 9277 __decorateClass$3S([ 9278 n$5({ type: Boolean }) 9279 ], SonicAppLink.prototype, "toShow", 2); 9280 __decorateClass$3S([ 9281 n$5({ type: Boolean }) 9282 ], SonicAppLink.prototype, "alwaysDisplay", 2); 9283 __decorateClass$3S([ 9284 n$5({ type: Object }) 9285 ], SonicAppLink.prototype, "query", 2); 9286 __decorateClass$3S([ 9287 bind$1("admin/current.data.permissions"), 9288 r$5() 9289 ], SonicAppLink.prototype, "currentAdminPermissions", 2); 9290 __decorateClass$3S([ 9291 bind$1("settings.modules"), 9292 r$5() 9293 ], SonicAppLink.prototype, "modulesSettings", 2); 9294 __decorateClass$3S([ 9295 c({ context: appType, subscribe: true }) 9296 ], SonicAppLink.prototype, "appType", 2); 9297 __decorateClass$3S([ 9298 o$8({ flatten: true }) 9299 ], SonicAppLink.prototype, "_slottedItems", 2); 9300 __decorateClass$3S([ 9301 r$5() 9302 ], SonicAppLink.prototype, "isEnabled", 2); 9303 SonicAppLink = __decorateClass$3S([ 9304 t$3(tagName$2K), 9305 awaitConnectedAncestors(APP_TAG_SELECTOR) 9306 ], SonicAppLink); 9307 var __decorate$N = function(decorators, target, key, desc) { 9308 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 9309 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 9310 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 9311 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 9312 }; 9313 const tagName$2J = "sonic-modal-actions"; 9314 let ModalActions = class ModalActions extends i$6 { 9315 firstUpdated(changedProperties) { 9316 this.buttons?.forEach((btn) => { 9317 if (btn.hasAttribute("hideModal")) { 9318 btn.addEventListener("click", () => { 9319 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 9320 parentModal?.hide(); 9321 }); 9322 } 9323 }); 9324 super.firstUpdated(changedProperties); 9325 } 9326 render() { 9327 return b$1`<slot></slot>`; 9328 } 9329 }; 9330 ModalActions.styles = [ 9331 i$9` 9332 :host { 9333 display: flex; 9334 gap: 0.5rem; 9335 margin-top: auto; 9336 padding-top: 1.5rem; 9337 } 9338 ` 9339 ]; 9340 __decorate$N([ 9341 o$8({ selector: "sonic-button" }) 9342 ], ModalActions.prototype, "buttons", void 0); 9343 ModalActions = __decorate$N([ 9344 t$3(tagName$2J) 9345 ], ModalActions); 9346 var __decorate$M = function(decorators, target, key, desc) { 9347 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 9348 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 9349 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 9350 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 9351 }; 9352 const tagName$2I = "sonic-modal-close"; 9353 let ModalClose = class ModalClose extends i$6 { 9354 constructor() { 9355 super(...arguments); 9356 this.translation = { 9357 fr: "Fermer la fenêtre", 9358 en: "Close window", 9359 de: "Fenster schlieÃen", 9360 nl: "Venster sluiten", 9361 es: "Cerrar" 9362 }; 9363 } 9364 connectedCallback() { 9365 super.connectedCallback(); 9366 this.lang = document.documentElement.lang?.split("-")[0] ?? "fr"; 9367 } 9368 render() { 9369 return b$1`<sonic-button 9370 noAutoFill 9371 data-aria-label=${this.translation[this.lang]} 9372 reset=${o$4(this.reset)} 9373 shape="circle" 9374 @click=${this.handleClick} 9375 type=${o$4(this.type)} 9376 ><sonic-icon name="cancel" size="lg"></sonic-icon 9377 ></sonic-button>`; 9378 } 9379 handleClick() { 9380 const parentModal = HTML$1.getClosestElement(this, "sonic-modal"); 9381 parentModal.hide(); 9382 } 9383 }; 9384 __decorate$M([ 9385 n$5() 9386 ], ModalClose.prototype, "translation", void 0); 9387 __decorate$M([ 9388 n$5() 9389 ], ModalClose.prototype, "reset", void 0); 9390 __decorate$M([ 9391 n$5() 9392 ], ModalClose.prototype, "type", void 0); 9393 ModalClose = __decorate$M([ 9394 t$3(tagName$2I) 9395 ], ModalClose); 9396 var __decorate$L = function(decorators, target, key, desc) { 9397 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 9398 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 9399 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 9400 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 9401 }; 9402 const tagName$2H = "sonic-modal-content"; 9403 let ModalContent = class ModalContent extends i$6 { 9404 render() { 9405 return b$1`<slot></slot>`; 9406 } 9407 }; 9408 ModalContent.styles = [ 9409 i$9` 9410 :host { 9411 display: block; 9412 width: 100%; 9413 } 9414 ` 9415 ]; 9416 ModalContent = __decorate$L([ 9417 t$3(tagName$2H) 9418 ], ModalContent); 9419 var __decorate$K = function(decorators, target, key, desc) { 9420 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 9421 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 9422 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 9423 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 9424 }; 9425 const tagName$2G = "sonic-modal-subtitle"; 9426 let ModalSubTitle = class ModalSubTitle extends i$6 { 9427 render() { 9428 return b$1`<slot></slot>`; 9429 } 9430 }; 9431 ModalSubTitle.styles = [ 9432 i$9` 9433 :host { 9434 font-size: 1.25rem; 9435 display: block; 9436 line-height: var(--sc-headings-line-height, 1.1); 9437 font-family: var( 9438 --sc-headings-font-family, 9439 var(--sc-font-family-base, sans-serif) 9440 ); 9441 font-weight: var(--sc-headings-font-weight, 700); 9442 font-style: var(--sc-headings-font-style, normal); 9443 } 9444 ` 9445 ]; 9446 ModalSubTitle = __decorate$K([ 9447 t$3(tagName$2G) 9448 ], ModalSubTitle); 9449 var __decorate$J = function(decorators, target, key, desc) { 9450 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 9451 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 9452 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 9453 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 9454 }; 9455 const tagName$2F = "sonic-modal-title"; 9456 let ModalTitle = class ModalTitle extends i$6 { 9457 render() { 9458 return b$1`<slot></slot>`; 9459 } 9460 }; 9461 ModalTitle.styles = [ 9462 i$9` 9463 :host { 9464 font-weight: bold; 9465 font-size: 1.5rem; 9466 display: block; 9467 line-height: var(--sc-headings-line-height, 1.1); 9468 font-family: var( 9469 --sc-headings-font-family, 9470 var(--sc-font-family-base, sans-serif) 9471 ); 9472 font-weight: var(--sc-headings-font-weight, 700); 9473 font-style: var(--sc-headings-font-style, normal); 9474 } 9475 ` 9476 ]; 9477 ModalTitle = __decorate$J([ 9478 t$3(tagName$2F) 9479 ], ModalTitle); 9480 const styleSheetCache = /* @__PURE__ */ new WeakMap(); 9481 function cssResultToStyleSheet(styleResult) { 9482 const cachedStyleSheet = styleSheetCache.get(styleResult); 9483 if (cachedStyleSheet) 9484 return cachedStyleSheet; 9485 const styleSheet = new CSSStyleSheet(); 9486 styleSheet.replaceSync(styleResult.cssText); 9487 styleSheetCache.set(styleResult, styleSheet); 9488 return styleSheet; 9489 } 9490 function isCSSResult(value) { 9491 return value instanceof n$8; 9492 } 9493 function normalizeStyleSheets(styleSheet) { 9494 if (!styleSheet) 9495 return []; 9496 const styleSheets = Array.isArray(styleSheet) ? styleSheet : [styleSheet]; 9497 return styleSheets.flatMap((sheet) => { 9498 if (Array.isArray(sheet)) { 9499 return normalizeStyleSheets(sheet); 9500 } 9501 if (sheet instanceof CSSStyleSheet) { 9502 return [sheet]; 9503 } 9504 if (isCSSResult(sheet)) { 9505 return [cssResultToStyleSheet(sheet)]; 9506 } 9507 return []; 9508 }); 9509 }
9510 var __decorate$I = function(decorators, target, key, desc) { 9511 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 9512 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 9513 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 9514 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 9515 }; 9516 var Modal_1; 9517 const tagName$2E = "sonic-modal"; 9518 let Modal = Modal_1 = class Modal extends Subscriber$1(i$6) { 9519 constructor() { 9520 super(...arguments); 9521 this.forceAction = false; 9522 this.noCloseButton = false; 9523 this.removeOnHide = false; 9524 this.removeHashOnHide = false; 9525 this.align = "left"; 9526 this.maxWidth = "min(100vw, 40rem)"; 9527 this.maxHeight = "90vh"; 9528 this.width = "100%"; 9529 this.height = "fit-content"; 9530 this.effect = "slide"; 9531 this.fullScreen = false; 9532 this.visible = false; 9533 this.closeOnLocationChange = false; 9534 this.location = ""; 9535 this._animationState = "hidden"; 9536 this._adoptedStyleSheets = []; 9537 this._animationConfig = { 9538 quartOut: "cubic-bezier(0.165, 0.84, 0.44, 1)", 9539 quadOut: "cubic-bezier(0.25, 0.46, 0.45, 0.94)", 9540 linear: "linear", 9541 translateY: "translateY(2.5rem)", 9542 durationIn: 300, 9543 durationOut: 300 9544 }; 9545 } 9546 static create(options) { 9547 const modal = document.createElement(tagName$2E); 9548 modal.options = options; 9549 if (options.removeHashOnHide === true) 9550 modal.setAttribute("removeHashOnHide", "true"); 9551 if (options.removeOnHide === true) 9552 modal.setAttribute("removeOnHide", "true"); 9553 if (options.closeOnLocationChange === true) 9554 modal.setAttribute("closeOnLocationChange", "true"); 9555 if (options.maxWidth) 9556 modal.maxWidth = options?.maxWidth; 9557 if (options.width) 9558 modal.width = options?.width; 9559 if (options.maxHeight) 9560 modal.maxHeight = options?.maxHeight; 9561 if (options.height) 9562 modal.height = options?.height; 9563 if (options.forceAction) 9564 modal.forceAction = true; 9565 if (options.fullScreen) 9566 modal.fullScreen = options?.fullScreen; 9567 if (options.effect) 9568 modal.effect = options?.effect; 9569 if (options.noCloseButton) 9570 modal.noCloseButton = true; 9571 if (options.closeButtonType) 9572 modal.closeButtonType = options?.closeButtonType; 9573 if (options.styleSheet) 9574 modal.styleSheet = options?.styleSheet; 9575 if (options.paddingX) 9576 modal.paddingX = options?.paddingX; 9577 if (options.paddingY) 9578 modal.paddingY = options?.paddingY; 9579 if (options.zIndex) 9580 modal.zIndex = options?.zIndex; 9581 const container = Theme.getPopContainer(); 9582 container.appendChild(modal); 9583 modal.updateComplete.then(() => { 9584 modal.show(); 9585 }); 9586 return modal; 9587 } 9588 connectedCallback() { 9589 Modal_1.modals.push(this); 9590 LocationHandler$1.onChange(this); 9591 super.connectedCallback(); 9592 } 9593 disconnectedCallback() { 9594 LocationHandler$1.offChange(this); 9595 Modal_1.modals.splice(Modal_1.modals.indexOf(this), 1); 9596 this.removeEventListener("keydown", this.handleEscape); 9597 super.disconnectedCallback(); 9598 } 9599 firstUpdated() { 9600 this.addEventListener("keydown", this.handleEscape); 9601 } 9602 willUpdate(_changedProperties) { 9603 if (this.closeOnLocationChange && _changedProperties.has("location")) { 9604 const previousLocation = _changedProperties.get("location"); 9605 if (previousLocation && this.location && this.location !== previousLocation) { 9606 setTimeout(() => { 9607 this.hide(); 9608 }, 50); 9609 } 9610 } 9611 if (_changedProperties.has("zIndex")) { 9612 this.style.setProperty("--sc_z-index", this.zIndex || "990"); 9613 } 9614 if (_changedProperties.has("paddingX")) { 9615 this.style.setProperty("--sc-modal-px", this.paddingX || ""); 9616 } 9617 if (_changedProperties.has("paddingY")) { 9618 this.style.setProperty("--sc-modal-py", this.paddingY || ""); 9619 } 9620 super.willUpdate(_changedProperties); 9621 } 9622 updated(_changedProperties) { 9623 const changedToVisible = !_changedProperties.get("visible") && this.visible; 9624 const changedToHidden = _changedProperties.get("visible") && !this.visible; 9625 if (changedToVisible && this._animationState === "hidden") { 9626 this.show(); 9627 } else if (changedToHidden && this._animationState === "visible") { 9628 this.hide(); 9629 } 9630 if (_changedProperties.has("styleSheet")) { 9631 this.syncAdoptedStyleSheets(); 9632 } 9633 } 9634 // SI c'est en modal 9635 // handleModalClick(e: MouseEvent): void { 9636 // const isBackdropClick = e.target === e.currentTarget; 9637 // if ( 9638 // isBackdropClick && 9639 // !this.forceAction && 9640 // this._animationState === "visible" 9641 // ) { 9642 // this.hide(); 9643 // } 9644 // } 9645 handleOverlayClick(_e) { 9646 if (!this.forceAction && this._animationState === "visible") { 9647 this.hide(); 9648 } 9649 } 9650 render() { 9651 const modalStyles = { 9652 maxWidth: this.maxWidth, 9653 maxHeight: this.maxHeight, 9654 width: this.width, 9655 height: this.height, 9656 pointerEvents: this._animationState !== "hidden" ? "auto" : "none" 9657 }; 9658 const overlayStyles = { 9659 display: this.fullScreen ? "none" : "block", 9660 pointerEvents: this._animationState === "visible" ? "auto" : "none" 9661 }; 9662 return b$1` 9663 <div 9664 id="backdrop" 9665 @click=${this.handleOverlayClick}
9666 style=${o$3(overlayStyles)} 9667 ></div> 9668 <dialog 9669 id="modal" 9670 part="modal" 9671 class="custom-scroll" 9672 aria-modal="true" 9673 style=${o$3(modalStyles)} 9674 > 9675 ${this._animationState !== "hidden" ? b$1`<div id="modal-content"> 9676 ${!this.forceAction && !this.noCloseButton ? b$1`<sonic-modal-close 9677 class="${this._animationState == "visible" ? "animate-in" : "animate-out"}" 9678 type=${o$4(this.closeButtonType)} 9679 ></sonic-modal-close>` : A$1} 9680 ${this.modalFragment("title")} ${this.modalFragment("subtitle")} 9681 ${this.modalFragment("content")} ${this.modalFragment("actions")} 9682 <slot></slot> 9683 </div>` : A$1} 9684 </dialog> 9685 `; 9686 } 9687 syncAdoptedStyleSheets() { 9688 if (!(this.renderRoot instanceof ShadowRoot)) 9689 return; 9690 const nextStyleSheets = normalizeStyleSheets(this.styleSheet); 9691 const currentStyleSheets = this.renderRoot.adoptedStyleSheets.filter((sheet) => !this._adoptedStyleSheets.includes(sheet)); 9692 this.renderRoot.adoptedStyleSheets = [ 9693 ...currentStyleSheets, 9694 ...nextStyleSheets 9695 ]; 9696 this._adoptedStyleSheets = nextStyleSheets; 9697 } 9698 modalFragment(optionKey) { 9699 const optionValue = this.options?.[optionKey]; 9700 if (!optionValue) 9701 return A$1; 9702 let output; 9703 if (optionValue instanceof Object) { 9704 output = optionValue; 9705 } else { 9706 output = o$6(optionValue); 9707 } 9708 switch (optionKey) { 9709 case "title": 9710 return b$1`<sonic-modal-title>${output}</sonic-modal-title>`; 9711 case "subtitle": 9712 return b$1`<sonic-modal-subtitle>${output}</sonic-modal-subtitle>`; 9713 case "content": 9714 return b$1`<sonic-modal-content>${output}</sonic-modal-content>`; 9715 case "actions": 9716 return b$1`<sonic-modal-actions>${output}</sonic-modal-actions>`; 9717 default: 9718 return A$1; 9719 } 9720 } 9721 // Show the modal 9722 async show() { 9723 this._modalElement.show(); 9724 this._animationState = "in"; 9725 await this.animation("in"); 9726 this._animationState = "visible"; 9727 this.visible = true; 9728 this.dispatchEvent(new CustomEvent("show")); 9729 this._modalElement.focus(); 9730 } 9731 // Hide the modal 9732 async hide() { 9733 this._animationState = "out"; 9734 this.dispatchEvent(new CustomEvent("hide")); 9735 await this.animation("out"); 9736 this._modalElement.close(); 9737 this._animationState = "hidden"; 9738 this.visible = false; 9739 if (this.hasAttribute("resetDataProviderOnHide")) { 9740 PublisherManager.get(this.getAttribute("resetDataProviderOnHide")).set({}); 9741 } 9742 if (this.removeHashOnHide) { 9743 window.history.replaceState({}, "", window.location.pathname); 9744 } 9745 if (this.removeOnHide) { 9746 this.remove(); 9747 } 9748 this.dispatchEvent(new CustomEvent("hidden")); 9749 } 9750 // Hide and remove the modal 9751 async dispose() { 9752 await this.hide(); 9753 this.remove(); 9754 } 9755 // Hide and remove all modals 9756 static disposeAll() { 9757 Modal_1.modals.forEach((modal) => { 9758 modal.dispose(); 9759 }); 9760 } 9761 // Hide the last visible modal 9762 handleEscape(e2) { 9763 if (e2.key === "Escape") { 9764 e2.preventDefault(); 9765 const visibleModals = Modal_1.modals.filter((modal) => modal._animationState !== "hidden" && !modal.forceAction); 9766 if (visibleModals.length > 0) { 9767 const lastVisibleModal = visibleModals[visibleModals.length - 1]; 9768 lastVisibleModal.hide(); 9769 } 9770 } 9771 } 9772 // ------------------------ 9773 // ANIMATIONS 9774 // ------------------------ 9775 animation(direction) { 9776 return new Promise((resolve) => { 9777 const { quartOut, linear, translateY, durationIn, durationOut, quadOut } = this._animationConfig; 9778 const element = this._modalElement; 9779 if (!element) 9780 return resolve(); 9781 const isEntering = direction === "in"; 9782 const duration = isEntering ? durationIn : durationOut;
9783 const delay = !this.fullScreen && isEntering ? 100 : 0; 9784 if (!this.fullScreen) { 9785 if (isEntering) { 9786 this.style.setProperty("--sc_backdrop-opacity", "0.8"); 9787 } else { 9788 setTimeout(() => { 9789 this.style.setProperty("--sc_backdrop-opacity", "0"); 9790 }, 150); 9791 } 9792 } 9793 const animations = []; 9794 if (this.effect === "slide") { 9795 animations.push(element.animate([ 9796 { transform: isEntering ? translateY : "translateY(0)" }, 9797 { transform: isEntering ? "translateY(0)" : translateY } 9798 ], { 9799 duration, 9800 easing: isEntering ? quartOut : quadOut, 9801 fill: "both", 9802 delay 9803 })); 9804 animations.push(element.animate([{ opacity: isEntering ? 0 : 1 }, { opacity: isEntering ? 1 : 0 }], { 9805 duration, 9806 easing: linear, 9807 fill: "both", 9808 delay 9809 })); 9810 } 9811 Promise.all(animations.map((anim) => anim.finished)).then(() => resolve()); 9812 }); 9813 } 9814 }; 9815 Modal.styles = [ 9816 customScroll, 9817 i$9` 9818 :host { 9819 --sc-modal-py: 2.5rem; 9820 --sc-modal-px: 1.5rem; 9821 9822 --sc_backdrop-bg: var( 9823 --sc_overlay-bg, 9824 var(--sc-base-200, rgba(0, 0, 0, 0.12)) 9825 ); 9826 --sc_backdrop-opacity: 0; 9827 --sc_rounded: var(--sc-rounded-lg); 9828 --sc_z-index: 990; 9829 } 9830 9831 * { 9832 box-sizing: border-box; 9833 } 9834 9835 #modal { 9836 background: var(--sc-base, #fff); 9837 color: var(--sc-base-content, #000); 9838 width: 100%; 9839 box-shadow: var(--sc-shadow-lg); 9840 border-radius: var(--sc_rounded) var(--sc_rounded); 9841 transform: translateZ(0); 9842 border: none; 9843 outline: none; 9844 height: fit-content; 9845 padding: 0; 9846 pointer-events: none; 9847 transition: none !important; 9848 opacity: 0; 9849 position: fixed; 9850 inset: 0; 9851 z-index: var(--sc_z-index); 9852 } 9853 9854 #backdrop { 9855 opacity: var(--sc_backdrop-opacity, 0); 9856 background: var(--sc_backdrop-bg); 9857 transition: opacity 0.15s linear; 9858 inset: 0; 9859 position: fixed; 9860 z-index: var(--sc_z-index); 9861 } 9862 9863 #modal-content { 9864 display: flex; 9865 flex-direction: column; 9866 min-height: 10rem; 9867 line-height: 1.25; 9868 padding: var(--sc-modal-py) var(--sc-modal-px); 9869 } 9870 9871 @media (max-width: 767.5px) { 9872 #modal { 9873 max-width: none !important; 9874 margin: auto 0 0 !important; 9875 width: 100% !important; 9876 border-radius: var(--sc_rounded) var(--sc_rounded) 0 0 !important; 9877 } 9878 } 9879 9880 :host([fullScreen]) { 9881 --sc_rounded: 0; 9882 } 9883 :host([fullScreen]) #modal { 9884 width: 100% !important; 9885 height: 100% !important; 9886 max-width: none !important; 9887 max-height: none !important; 9888 transform: none !important; 9889 } 9890 9891 /* Layout des éléments slottés */ 9892 ::slotted(sonic-modal-title), 9893 sonic-modal-title { 9894 margin-bottom: 1.2rem; 9895 } 9896 ::slotted(sonic-modal-subtitle), 9897 sonic-modal-subtitle { 9898 margin-bottom: 1.2rem; 9899 margin-top: -1rem; 9900 } 9901 9902 :host([align="left"]) ::slotted(sonic-modal-title), 9903 :host([align="left"]) sonic-modal-title { 9904 padding-right: 1em; 9905 } 9906 9907 :host([align="left"]) #modal-content { 9908 text-align: left; 9909 align-items: flex-start; 9910 } 9911 9912 :host([align="center"]) #modal-content { 9913 text-align: center; 9914 align-items: center; 9915 } 9916 9917 :host([align="right"]) #modal-content { 9918 text-align: right; 9919 align-items: flex-end; 9920 } 9921 9922 /* Close button */ 9923 ::slotted(sonic-modal-close), 9924 sonic-modal-close { 9925 --sc_top: 0.25rem; 9926 --sc_x: 0.25rem; 9927 position: sticky; 9928 display: block; 9929 top: var(--sc_top); 9930 margin-left: auto; 9931 margin-bottom: -1rem; 9932 margin-top: calc(-1 * var(--sc-modal-py) - 0.25rem); 9933 margin-right: calc(-1 * var(--sc-modal-px) + 0.25rem); 9934 z-index: 20; 9935 opacity: 0; 9936 transform: scale(0); 9937 transition: 9938 transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), 9939 opacity 0.1s linear; 9940 transform-origin: center center; 9941 display: flex; 9942 align-items: center; 9943 justify-content: center; 9944 } 9945 :host([align="right"]) ::slotted(sonic-modal-close), 9946 :host([align="right"]) sonic-modal-close { 9947 right: auto; 9948 margin-right: auto; 9949 margin-left: calc(-1 * var(--sc-modal-px) + 0.25rem); 9950 } 9951 9952 /* Border radius */ 9953 :host([rounded="none"]) #modal { 9954 --sc-img-radius: 0 !important; 9955 } 9956 9957 sonic-modal-close.animate-in { 9958 transform: scale(1); 9959 opacity: 1 !important; 9960 transition-delay: 0.2s; 9961 } 9962 sonic-modal-close.animate-out { 9963 opacity: 0 !important; 9964 transition-delay: 0s !important; 9965 transform: scale(0) !important; 9966 transition: 0.2s linear !important; 9967 } 9968 ` 9969 ]; 9970 Modal.modals = []; 9971 __decorate$I([ 9972 n$5({ type: Boolean }) 9973 ], Modal.prototype, "forceAction", void 0); 9974 __decorate$I([ 9975 n$5({ type: Boolean }) 9976 ], Modal.prototype, "noCloseButton", void 0); 9977 __decorate$I([ 9978 n$5({ type: Boolean }) 9979 ], Modal.prototype, "removeOnHide", void 0); 9980 __decorate$I([ 9981 n$5({ type: Boolean }) 9982 ], Modal.prototype, "removeHashOnHide", void 0); 9983 __decorate$I([ 9984 n$5({ type: String, reflect: true }) 9985 ], Modal.prototype, "align", void 0); 9986 __decorate$I([ 9987 n$5({ type: String }) 9988 ], Modal.prototype, "paddingX", void 0); 9989 __decorate$I([ 9990 n$5({ type: String }) 9991 ], Modal.prototype, "paddingY", void 0); 9992 __decorate$I([ 9993 n$5({ type: String }) 9994 ], Modal.prototype, "maxWidth", void 0); 9995 __decorate$I([ 9996 n$5({ type: String }) 9997 ], Modal.prototype, "maxHeight", void 0); 9998 __decorate$I([ 9999 n$5({ type: String }) 10000 ], Modal.prototype, "zIndex", void 0); 10001 __decorate$I([ 10002 n$5({ type: String }) 10003 ], Modal.prototype, "width", void 0); 10004 __decorate$I([ 10005 n$5({ type: String }) 10006 ], Modal.prototype, "height", void 0); 10007 __decorate$I([ 10008 n$5({ type: String }) 10009 ], Modal.prototype, "effect", void 0); 10010 __decorate$I([ 10011 n$5({ attribute: false }) 10012 ], Modal.prototype, "styleSheet", void 0); 10013 __decorate$I([ 10014 n$5({ type: Object }) 10015 ], Modal.prototype, "options", void 0); 10016 __decorate$I([ 10017 n$5({ type: Boolean, reflect: true }) 10018 ], Modal.prototype, "fullScreen", void 0); 10019 __decorate$I([ 10020 n$5({ type: Boolean, reflect: true }) 10021 ], Modal.prototype, "visible", void 0); 10022 __decorate$I([ 10023 n$5({ type: String }) 10024 ], Modal.prototype, "closeButtonType", void 0); 10025 __decorate$I([ 10026 e$7("#modal") 10027 ], Modal.prototype, "_modalElement", void 0); 10028 __decorate$I([ 10029 n$5({ type: Boolean }) 10030 ], Modal.prototype, "closeOnLocationChange", void 0); 10031 __decorate$I([ 10032 r$5() 10033 ], Modal.prototype, "location", void 0); 10034 __decorate$I([ 10035 r$5() 10036 ], Modal.prototype, "_animationState", void 0);
10037 Modal = Modal_1 = __decorate$I([ 10038 t$3(tagName$2E) 10039 ], Modal); 10040 if (typeof window !== "undefined") { 10041 window.SonicModal = Modal; 10042 } 10043 var __defProp$3N = Object.defineProperty; 10044 var __getOwnPropDesc$3Q = Object.getOwnPropertyDescriptor; 10045 var __decorateClass$3R = (decorators, target, key, kind) => { 10046 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3Q(target, key) : target; 10047 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 10048 if (decorator = decorators[i2]) 10049 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 10050 if (kind && result) __defProp$3N(target, key, result); 10051 return result; 10052 }; 10053 const tagName$2D = "sonic-prefer-website-message"; 10054 let SonicPreferWebsiteMessage = class extends Subscriber$1(i$6) { 10055 constructor() { 10056 super(...arguments); 10057 this.continueNavigation = false; 10058 } 10059 connectedCallback() { 10060 const ignorePreferWebsiteDate = localStorage.getItem("ignorePreferWebsiteDate"); 10061 if (ignorePreferWebsiteDate) { 10062 const currentDate = /* @__PURE__ */ new Date(); 10063 const timestamp = currentDate.getTime(); 10064 const timeDifference = timestamp - parseInt(ignorePreferWebsiteDate); 10065 const timeDifferenceInHours = timeDifference / (1e3 * 3600); 10066 if (timeDifferenceInHours < 12) { 10067 this.continueNavigation = true; 10068 } 10069 } 10070 super.connectedCallback(); 10071 } 10072 setContinueNavigation() { 10073 this.continueNavigation = true; 10074 const currentDate = /* @__PURE__ */ new Date(); 10075 const timestamp = currentDate.getTime(); 10076 localStorage.setItem("ignorePreferWebsiteDate", timestamp.toString()); 10077 } 10078 render() { 10079 return b$1`<sonic-modal 10080 align="center" 10081 forceAction 10082 @hidden=${this.setContinueNavigation} 10083 ?visible=${!this.continueNavigation} 10084 maxWidth="30rem" 10085 > 10086 <sonic-modal-content class="message-content">${t("message_billetterie_limitee", true)}</sonic-modal-content> 10087 <sonic-modal-actions> 10088 <sonic-button variant="ghost" size="sm" hideModal> ${t("continue_here")}</sonic-button> 10089 </sonic-modal-actions> 10090 </sonic-modal>`; 10091 } 10092 }; 10093 SonicPreferWebsiteMessage.styles = [ 10094 i$9` 10095 .message-content { 10096 text-align: center; 10097 padding: 2rem 0 0; 10098 font-size: 1.3rem; 10099 width: 100%; 10100 } 10101 .message-content p { 10102 margin: 0.25em 0; 10103 } 10104 .message-content a { 10105 text-decoration: none; 10106 border: 2px solid; 10107 border-radius: var(--sc-btn-radius); 10108 font-weight: bold; 10109 padding: 0.25em 0.5em; 10110 margin: 0.25em auto; 10111 color: inherit; 10112 display: block; 10113 width: fit-content; 10114 } 10115 .message-content a:only-child { 10116 display: block; 10117 } 10118 ` 10119 ]; 10120 __decorateClass$3R([ 10121 bind$1("settings.prefer_website"), 10122 n$5({ type: Boolean }) 10123 ], SonicPreferWebsiteMessage.prototype, "preferWebsite", 2); 10124 __decorateClass$3R([ 10125 r$5() 10126 ], SonicPreferWebsiteMessage.prototype, "continueNavigation", 2); 10127 SonicPreferWebsiteMessage = __decorateClass$3R([ 10128 t$3(tagName$2D) 10129 ], SonicPreferWebsiteMessage); 10130 class ObserveDirective extends f$1 { 10131 /* eslint-disable @typescript-eslint/no-explicit-any*/ 10132 constructor(partInfo) { 10133 super(partInfo); 10134 this.observables = /* @__PURE__ */ new Set(); 10135 this.cleanupWatchers = []; 10136 this.onAssign = (v2) => { 10137 this.setValue(v2); 10138 }; 10139 this.node = partInfo.options?.host; 10140 } 10141 /* eslint-enable @typescript-eslint/no-explicit-any*/ 10142 teardownWatchers() { 10143 this.cleanupWatchers.forEach((cleanup) => cleanup()); 10144 this.cleanupWatchers = []; 10145 } 10146 normalizeInput(input) { 10147 return hasPath(input) ? input.path : input; 10148 } 10149 render(input) { 10150 const path = this.normalizeInput(input); 10151 const pathChanged = this.pathTemplate !== path; 10152 if (pathChanged) { 10153 this.pathTemplate = path; 10154 this.teardownWatchers(); 10155 } 10156 if (pathChanged || !this.resolvedPath) { 10157 queueMicrotask(() => { 10158 if (!this.isConnected || !this.pathTemplate) 10159 return; 10160 this.setupSubscription(); 10161 }); 10162 } 10163 return E; 10164 } 10165 setupSubscription() { 10166 const host = this.node; 10167 const path = this.pathTemplate; 10168 if (!host || !path) 10169 return; 10170 this.teardownWatchers(); 10171 const dependencies = extractDynamicDependencies(path); 10172 if (dependencies.length > 0) { 10173 for (const dependency of dependencies) { 10174 this.cleanupWatchers.push(observeDynamicProperty(bindDynamicWatchKeys.watcherStore, bindDynamicWatchKeys.hooked, host, dependency, () => this.refreshSubscription())); 10175 } 10176 } 10177 this.refreshSubscription(); 10178 } 10179 refreshSubscription() { 10180 const host = this.node; 10181 const path = this.pathTemplate; 10182 if (!path) 10183 return; 10184 const isDynamic = extractDynamicDependencies(path).length > 0; 10185 let resolved = path; 10186 if (isDynamic) { 10187 if (!host) { 10188 resolved = null; 10189 } else { 10190 const resolution = resolveDynamicPath(host, path); 10191 resolved = resolution.ready ? resolution.path : null; 10192 } 10193 } 10194 if (resolved === this.resolvedPath) 10195 return; 10196 if (!resolved) { 10197 this.unsubscribe(); 10198 this.resolvedPath = void 0; 10199 this.setValue(void 0); 10200 return; 10201 } 10202 this.resolvedPath = resolved; 10203 this.subscribe(resolved); 10204 } 10205 subscribe(observable) { 10206 this.unsubscribe(); 10207 this.onAssign = (v2) => { 10208 this.setValue(v2); 10209 }; 10210 this.observables = getObservables(observable);
10211 this.observables.forEach((publisher) => { 10212 publisher.onAssign(this.onAssign); 10213 }); 10214 } 10215 unsubscribe() { 10216 this.observables.forEach((publisher) => publisher.offAssign(this.onAssign)); 10217 this.observables.clear(); 10218 } 10219 disconnected() { 10220 this.teardownWatchers(); 10221 this.unsubscribe(); 10222 this.resolvedPath = void 0; 10223 } 10224 reconnected() { 10225 if (!this.pathTemplate) 10226 return; 10227 this.setupSubscription(); 10228 } 10229 } 10230 const dir = e$5(ObserveDirective); 10231 const subscribe = dir; 10232 const sub = dir; 10233 const get = get$2; 10234 const dp = dp$1; 10235 const set = set$1; 10236 const tailwindImport = i$9`*, ::before, ::after { 10237 --tw-border-spacing-x: 0; 10238 --tw-border-spacing-y: 0; 10239 --tw-translate-x: 0; 10240 --tw-translate-y: 0; 10241 --tw-rotate: 0; 10242 --tw-skew-x: 0; 10243 --tw-skew-y: 0; 10244 --tw-scale-x: 1; 10245 --tw-scale-y: 1; 10246 --tw-pan-x: ; 10247 --tw-pan-y: ; 10248 --tw-pinch-zoom: ; 10249 --tw-scroll-snap-strictness: proximity; 10250 --tw-gradient-from-position: ; 10251 --tw-gradient-via-position: ; 10252 --tw-gradient-to-position: ; 10253 --tw-ordinal: ; 10254 --tw-slashed-zero: ; 10255 --tw-numeric-figure: ; 10256 --tw-numeric-spacing: ; 10257 --tw-numeric-fraction: ; 10258 --tw-ring-inset: ; 10259 --tw-ring-offset-width: 0px; 10260 --tw-ring-offset-color: #fff; 10261 --tw-ring-color: rgb(59 130 246 / 0.5); 10262 --tw-ring-offset-shadow: 0 0 #0000; 10263 --tw-ring-shadow: 0 0 #0000; 10264 --tw-shadow: 0 0 #0000; 10265 --tw-shadow-colored: 0 0 #0000; 10266 --tw-blur: ; 10267 --tw-brightness: ; 10268 --tw-contrast: ; 10269 --tw-grayscale: ; 10270 --tw-hue-rotate: ; 10271 --tw-invert: ; 10272 --tw-saturate: ; 10273 --tw-sepia: ; 10274 --tw-drop-shadow: ; 10275 --tw-backdrop-blur: ; 10276 --tw-backdrop-brightness: ; 10277 --tw-backdrop-contrast: ; 10278 --tw-backdrop-grayscale: ; 10279 --tw-backdrop-hue-rotate: ; 10280 --tw-backdrop-invert: ; 10281 --tw-backdrop-opacity: ; 10282 --tw-backdrop-saturate: ; 10283 --tw-backdrop-sepia: ; 10284 --tw-contain-size: ; 10285 --tw-contain-layout: ; 10286 --tw-contain-paint: ; 10287 --tw-contain-style: ; 10288} 10289 10290::backdrop { 10291 --tw-border-spacing-x: 0; 10292 --tw-border-spacing-y: 0; 10293 --tw-translate-x: 0; 10294 --tw-translate-y: 0; 10295 --tw-rotate: 0; 10296 --tw-skew-x: 0; 10297 --tw-skew-y: 0; 10298 --tw-scale-x: 1; 10299 --tw-scale-y: 1; 10300 --tw-pan-x: ; 10301 --tw-pan-y: ; 10302 --tw-pinch-zoom: ; 10303 --tw-scroll-snap-strictness: proximity; 10304 --tw-gradient-from-position: ; 10305 --tw-gradient-via-position: ; 10306 --tw-gradient-to-position: ; 10307 --tw-ordinal: ; 10308 --tw-slashed-zero: ; 10309 --tw-numeric-figure: ; 10310 --tw-numeric-spacing: ; 10311 --tw-numeric-fraction: ; 10312 --tw-ring-inset: ; 10313 --tw-ring-offset-width: 0px; 10314 --tw-ring-offset-color: #fff; 10315 --tw-ring-color: rgb(59 130 246 / 0.5); 10316 --tw-ring-offset-shadow: 0 0 #0000; 10317 --tw-ring-shadow: 0 0 #0000; 10318 --tw-shadow: 0 0 #0000; 10319 --tw-shadow-colored: 0 0 #0000; 10320 --tw-blur: ; 10321 --tw-brightness: ; 10322 --tw-contrast: ; 10323 --tw-grayscale: ; 10324 --tw-hue-rotate: ; 10325 --tw-invert: ; 10326 --tw-saturate: ; 10327 --tw-sepia: ; 10328 --tw-drop-shadow: ; 10329 --tw-backdrop-blur: ; 10330 --tw-backdrop-brightness: ; 10331 --tw-backdrop-contrast: ; 10332 --tw-backdrop-grayscale: ; 10333 --tw-backdrop-hue-rotate: ; 10334 --tw-backdrop-invert: ; 10335 --tw-backdrop-opacity: ; 10336 --tw-backdrop-saturate: ; 10337 --tw-backdrop-sepia: ; 10338 --tw-contain-size: ; 10339 --tw-contain-layout: ; 10340 --tw-contain-paint: ; 10341 --tw-contain-style: ; 10342}/* 10343! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com 10344*//* 103451. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) 103462. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) 10347*/ 10348 10349*, 10350::before, 10351::after { 10352 box-sizing: border-box; /* 1 */ 10353 border-width: 0; /* 2 */ 10354 border-style: solid; /* 2 */ 10355 border-color: currentColor
vendor: 7,266 bytes, lines 10355-10734
10355; /* 2 */ 10356} 10357 10358::before, 10359::after { 10360 --tw-content: ''; 10361} 10362 10363/* 103641. Use a consistent sensible line-height in all browsers. 103652. Prevent adjustments of font size after orientation changes in iOS. 103663. Use a more readable tab size. 103674. Use the user's configured \`sans\` font-family by default. 103685. Use the user's configured \`sans\` font-feature-settings by default. 103696. Use the user's configured \`sans\` font-variation-settings by default. 103707. Disable tap highlights on iOS 10371*/ 10372 10373html, 10374:host { 10375 line-height: 1.5; /* 1 */ 10376 -webkit-text-size-adjust: 100%; /* 2 */ 10377 -moz-tab-size: 4; /* 3 */ 10378 -o-tab-size: 4; 10379 tab-size: 4; /* 3 */ 10380 font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */ 10381 font-feature-settings: normal; /* 5 */ 10382 font-variation-settings: normal; /* 6 */ 10383 -webkit-tap-highlight-color: transparent; /* 7 */ 10384} 10385 10386/* 103871. Remove the margin in all browsers. 103882. Inherit line-height from \`html\` so users can set them as a class directly on the \`html\` element. 10389*/ 10390 10391body { 10392 margin: 0; /* 1 */ 10393 line-height: inherit; /* 2 */ 10394} 10395 10396/* 103971. Add the correct height in Firefox. 103982. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) 103993. Ensure horizontal rules are visible by default. 10400*/ 10401 10402hr { 10403 height: 0; /* 1 */ 10404 color: inherit; /* 2 */ 10405 border-top-width: 1px; /* 3 */ 10406} 10407 10408/* 10409Add the correct text decoration in Chrome, Edge, and Safari. 10410*/ 10411 10412abbr:where([title]) { 10413 -webkit-text-decoration: underline dotted; 10414 text-decoration: underline dotted; 10415} 10416 10417/* 10418Remove the default font size and weight for headings. 10419*/ 10420 10421h1, 10422h2, 10423h3, 10424h4, 10425h5, 10426h6 { 10427 font-size: inherit; 10428 font-weight: inherit; 10429} 10430 10431/* 10432Reset links to optimize for opt-in styling instead of opt-out. 10433*/ 10434 10435a { 10436 color: inherit; 10437 text-decoration: inherit; 10438} 10439 10440/* 10441Add the correct font weight in Edge and Safari. 10442*/ 10443 10444b, 10445strong { 10446 font-weight: bolder; 10447} 10448 10449/* 104501. Use the user's configured \`mono\` font-family by default. 104512. Use the user's configured \`mono\` font-feature-settings by default. 104523. Use the user's configured \`mono\` font-variation-settings by default. 104534. Correct the odd \`em\` font sizing in all browsers. 10454*/ 10455 10456code, 10457kbd, 10458samp, 10459pre { 10460 font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */ 10461 font-feature-settings: normal; /* 2 */ 10462 font-variation-settings: normal; /* 3 */ 10463 font-size: 1em; /* 4 */ 10464} 10465 10466/* 10467Add the correct font size in all browsers. 10468*/ 10469 10470small { 10471 font-size: 80%; 10472} 10473 10474/* 10475Prevent \`sub\` and \`sup\` elements from affecting the line height in all browsers. 10476*/ 10477 10478sub, 10479sup { 10480 font-size: 75%; 10481 line-height: 0; 10482 position: relative; 10483 vertical-align: baseline; 10484} 10485 10486sub { 10487 bottom: -0.25em; 10488} 10489 10490sup { 10491 top: -0.5em; 10492} 10493 10494/* 104951. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) 104962. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) 104973. Remove gaps between table borders by default. 10498*/ 10499 10500table { 10501 text-indent: 0; /* 1 */ 10502 border-color: inherit; /* 2 */ 10503 border-collapse: collapse; /* 3 */ 10504} 10505 10506/* 105071. Change the font styles in all browsers. 105082. Remove the margin in Firefox and Safari. 105093. Remove default padding in all browsers. 10510*/ 10511 10512button, 10513input, 10514optgroup, 10515select, 10516textarea { 10517 font-family: inherit; /* 1 */ 10518 font-feature-settings: inherit; /* 1 */ 10519 font-variation-settings: inherit; /* 1 */ 10520 font-size: 100%; /* 1 */ 10521 font-weight: inherit; /* 1 */ 10522 line-height: inherit; /* 1 */ 10523 letter-spacing: inherit; /* 1 */ 10524 color: inherit; /* 1 */ 10525 margin: 0; /* 2 */ 10526 padding: 0; /* 3 */ 10527} 10528 10529/* 10530Remove the inheritance of text transform in Edge and Firefox. 10531*/ 10532 10533button, 10534select { 10535 text-transform: none; 10536} 10537 10538/* 105391. Correct the inability to style clickable types in iOS and Safari. 105402. Remove default button styles. 10541*/ 10542 10543button, 10544input:where([type='button']), 10545input:where([type='reset']), 10546input:where([type='submit']) { 10547 -webkit-appearance: button; /* 1 */ 10548 background-color: transparent; /* 2 */ 10549 background-image: none; /* 2 */ 10550} 10551 10552/* 10553Use the modern Firefox focus style for all focusable elements. 10554*/ 10555 10556:-moz-focusring { 10557 outline: auto; 10558} 10559 10560/* 10561Remove the additional \`:invalid\` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) 10562*/ 10563 10564:-moz-ui-invalid { 10565 box-shadow: none; 10566} 10567 10568/* 10569Add the correct vertical alignment in Chrome and Firefox. 10570*/ 10571 10572progress { 10573 vertical-align: baseline; 10574} 10575 10576/* 10577Correct the cursor style of increment and decrement buttons in Safari. 10578*/ 10579 10580::-webkit-inner-spin-button, 10581::-webkit-outer-spin-button { 10582 height: auto; 10583} 10584 10585/* 105861. Correct the odd appearance in Chrome and Safari. 105872. Correct the outline style in Safari. 10588*/ 10589 10590[type='search'] { 10591 -webkit-appearance: textfield; /* 1 */ 10592 outline-offset: -2px; /* 2 */ 10593} 10594 10595/* 10596Remove the inner padding in Chrome and Safari on macOS. 10597*/ 10598 10599::-webkit-search-decoration { 10600 -webkit-appearance: none; 10601} 10602 10603/* 106041. Correct the inability to style clickable types in iOS and Safari. 106052. Change font properties to \`inherit\` in Safari. 10606*/ 10607 10608::-webkit-file-upload-button { 10609 -webkit-appearance: button; /* 1 */ 10610 font: inherit; /* 2 */ 10611} 10612 10613/* 10614Add the correct display in Chrome and Safari. 10615*/ 10616 10617summary { 10618 display: list-item; 10619} 10620 10621/* 10622Removes the default spacing and border for appropriate elements. 10623*/ 10624 10625blockquote, 10626dl, 10627dd, 10628h1, 10629h2, 10630h3, 10631h4, 10632h5, 10633h6, 10634hr, 10635figure, 10636p, 10637pre { 10638 margin: 0; 10639} 10640 10641fieldset { 10642 margin: 0; 10643 padding: 0; 10644} 10645 10646legend { 10647 padding: 0; 10648} 10649 10650ol, 10651ul, 10652menu { 10653 list-style: none; 10654 margin: 0; 10655 padding: 0; 10656} 10657 10658/* 10659Reset default styling for dialogs. 10660*/ 10661dialog { 10662 padding: 0; 10663} 10664 10665/* 10666Prevent resizing textareas horizontally by default. 10667*/ 10668 10669textarea { 10670 resize: vertical; 10671} 10672 10673/* 106741. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) 106752. Set the default placeholder color to the user's configured gray 400 color. 10676*/ 10677 10678input::-moz-placeholder, textarea::-moz-placeholder { 10679 opacity: 1; /* 1 */ 10680 color: #9ca3af; /* 2 */ 10681} 10682 10683input::placeholder, 10684textarea::placeholder { 10685 opacity: 1; /* 1 */ 10686 color: #9ca3af; /* 2 */ 10687} 10688 10689/* 10690Set the default cursor for buttons. 10691*/ 10692 10693button, 10694[role="button"] { 10695 cursor: pointer; 10696} 10697 10698/* 10699Make sure disabled buttons don't get the pointer cursor. 10700*/ 10701:disabled { 10702 cursor: default; 10703} 10704 10705/* 107061. Make replaced elements \`display: block\` by default. (https://github.com/mozdevs/cssremedy/issues/14) 107072. Add \`vertical-align: middle\` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) 10708 This can trigger a poorly considered lint error in some tools but is included by design. 10709*/ 10710 10711img, 10712svg, 10713video, 10714canvas, 10715audio, 10716iframe, 10717embed, 10718object { 10719 display: block; /* 1 */ 10720 vertical-align: middle; /* 2 */ 10721} 10722 10723/* 10724Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) 10725*/ 10726 10727img, 10728video { 10729 max-width: 100%; 10730 height: auto; 10731} 10732 10733/* Make elements with the HTML hidden attribute stay hidden by default */ 10734[hidden]
10734:where(:not([hidden="until-found"])) { 10735 display: none; 10736} 10737 :host { 10738 line-height: 1.2; 10739 font-family: var(--sc-font-family-base), sans-serif; 10740 } 10741.\\!container { 10742 width: 100% !important; 10743} 10744.container { 10745 width: 100%; 10746} 10747@media (min-width: 640px) { 10748 10749 .\\!container { 10750 max-width: 640px !important; 10751 } 10752 10753 .container { 10754 max-width: 640px; 10755 } 10756} 10757@media (min-width: 768px) { 10758 10759 .\\!container { 10760 max-width: 768px !important; 10761 } 10762 10763 .container { 10764 max-width: 768px; 10765 } 10766} 10767@media (min-width: 1024px) { 10768 10769 .\\!container { 10770 max-width: 1024px !important; 10771 } 10772 10773 .container { 10774 max-width: 1024px; 10775 } 10776} 10777@media (min-width: 1280px) { 10778 10779 .\\!container { 10780 max-width: 1280px !important; 10781 } 10782 10783 .container { 10784 max-width: 1280px; 10785 } 10786} 10787@media (min-width: 1536px) { 10788 10789 .\\!container { 10790 max-width: 1536px !important; 10791 } 10792 10793 .container { 10794 max-width: 1536px; 10795 } 10796} 10797.prose { 10798 color: var(--tw-prose-body); 10799 max-width: 65ch; 10800} 10801.prose :where(p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10802 margin-top: 1em; 10803 margin-bottom: 1em; 10804} 10805.prose :where([class~="lead"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10806 color: var(--tw-prose-lead); 10807 font-size: 1.25em; 10808 line-height: 1.6; 10809 margin-top: 1.2em; 10810 margin-bottom: 1.2em; 10811} 10812.prose :where(a):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10813 color: var(--tw-prose-links); 10814 text-decoration: underline; 10815 font-weight: 500; 10816} 10817.prose :where(strong):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10818 color: var(--tw-prose-bold); 10819 font-weight: 600; 10820} 10821.prose :where(a strong):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10822 color: inherit; 10823} 10824.prose :where(blockquote strong):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10825 color: inherit; 10826} 10827.prose :where(thead th strong):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10828 color: inherit; 10829} 10830.prose :where(ol):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10831 list-style-type: decimal; 10832 padding-inline-start: 1.625em; 10833 margin-top: 1em; 10834 margin-bottom: 1em; 10835} 10836.prose :where(ol[type="A"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10837 list-style-type: upper-alpha; 10838} 10839.prose :where(ol[type="a"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10840 list-style-type: lower-alpha; 10841} 10842.prose :where(ol[type="A" s]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10843 list-style-type: upper-alpha; 10844} 10845.prose :where(ol[type="a" s]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10846 list-style-type: lower-alpha; 10847} 10848.prose :where(ol[type="I"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10849 list-style-type: upper-roman; 10850} 10851.prose :where(ol[type="i"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10852 list-style-type: lower-roman; 10853} 10854.prose :where(ol[type="I" s]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10855 list-style-type: upper-roman; 10856} 10857.prose :where(ol[type="i" s]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10858 list-style-type: lower-roman; 10859} 10860.prose :where(ol[type="1"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10861 list-style-type: decimal; 10862} 10863.prose :where(ul):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10864 list-style-type: disc; 10865 padding-inline-start: 1.625em; 10866 margin-top: 1em; 10867 margin-bottom: 1em; 10868} 10869.prose :where(ol > li):not(:where([class~="not-prose"],[class~="not-prose"] *))::marker { 10870 font-weight: 400; 10871 color: var(--tw-prose-counters); 10872} 10873.prose :where(ul > li):not(:where([class~="not-prose"],[class~="not-prose"] *))::marker { 10874 color: var(--tw-prose-bullets); 10875} 10876.prose :where(dt):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10877 color: var(--tw-prose-headings); 10878 font-weight: 600; 10879 margin-top: 1.25em; 10880} 10881.prose :where(hr):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10882 border-color: var(--tw-prose-hr); 10883 border-top-width: 1px; 10884 margin-top: 3em; 10885 margin-bottom: 3em; 10886} 10887.prose :where(blockquote):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10888 font-weight: 500; 10889 font-style: italic; 10890 color: var(--tw-prose-quotes); 10891 border-inline-start-width: 0.25rem; 10892 border-inline-start-color: var(--tw-prose-quote-borders); 10893 quotes: "\\201C""\\201D""\\2018""\\2019"; 10894 margin-top: 1.6em; 10895 margin-bottom: 1.6em; 10896 padding-inline-start: 1em; 10897} 10898.prose :where(blockquote p:first-of-type):not(:where([class~="not-prose"],[class~="not-prose"] *))::before { 10899 content: open-quote; 10900} 10901.prose :where(blockquote p:last-of-type):not(:where([class~="not-prose"],[class~="not-prose"] *))::after {
10902 content: close-quote; 10903} 10904.prose :where(h1):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10905 color: var(--tw-prose-headings); 10906 font-weight: 800; 10907 font-size: 2.25em; 10908 margin-top: 0; 10909 margin-bottom: 0.8888889em; 10910 line-height: 1.1111111; 10911} 10912.prose :where(h1 strong):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10913 font-weight: 900; 10914 color: inherit; 10915} 10916.prose :where(h2):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10917 color: var(--tw-prose-headings); 10918 font-weight: 700; 10919 font-size: 1.5em; 10920 margin-top: 2em; 10921 margin-bottom: 1em; 10922 line-height: 1.3333333; 10923} 10924.prose :where(h2 strong):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10925 font-weight: 800; 10926 color: inherit; 10927} 10928.prose :where(h3):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10929 color: var(--tw-prose-headings); 10930 font-weight: 600; 10931 font-size: 1.25em; 10932 margin-top: 1.6em; 10933 margin-bottom: 0.6em; 10934 line-height: 1.6; 10935} 10936.prose :where(h3 strong):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10937 font-weight: 700; 10938 color: inherit; 10939} 10940.prose :where(h4):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10941 color: var(--tw-prose-headings); 10942 font-weight: 600; 10943 margin-top: 1.5em; 10944 margin-bottom: 0.5em; 10945 line-height: 1.5; 10946} 10947.prose :where(h4 strong):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10948 font-weight: 700; 10949 color: inherit; 10950} 10951.prose :where(img):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10952 margin-top: 2em; 10953 margin-bottom: 2em; 10954} 10955.prose :where(picture):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10956 display: block; 10957 margin-top: 2em; 10958 margin-bottom: 2em; 10959} 10960.prose :where(video):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10961 margin-top: 2em; 10962 margin-bottom: 2em; 10963} 10964.prose :where(kbd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10965 font-weight: 500; 10966 font-family: inherit; 10967 color: var(--tw-prose-kbd); 10968 box-shadow: 0 0 0 1px var(--tw-prose-kbd-shadows), 0 3px 0 var(--tw-prose-kbd-shadows); 10969 font-size: 0.875em; 10970 border-radius: 0.3125rem; 10971 padding-top: 0.1875em; 10972 padding-inline-end: 0.375em; 10973 padding-bottom: 0.1875em; 10974 padding-inline-start: 0.375em; 10975} 10976.prose :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10977 color: var(--tw-prose-code); 10978 font-weight: 600; 10979 font-size: 0.875em; 10980} 10981.prose :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *))::before { 10982 content: "\`"; 10983} 10984.prose :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *))::after { 10985 content: "\`"; 10986} 10987.prose :where(a code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10988 color: inherit; 10989} 10990.prose :where(h1 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10991 color: inherit; 10992} 10993.prose :where(h2 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10994 color: inherit; 10995 font-size: 0.875em; 10996} 10997.prose :where(h3 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 10998 color: inherit; 10999 font-size: 0.9em; 11000} 11001.prose :where(h4 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11002 color: inherit; 11003} 11004.prose :where(blockquote code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11005 color: inherit; 11006} 11007.prose :where(thead th code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11008 color: inherit; 11009} 11010.prose :where(pre):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11011 color: var(--tw-prose-pre-code); 11012 background-color: var(--tw-prose-pre-bg); 11013 overflow-x: auto; 11014 font-weight: 400; 11015 font-size: 0.875em; 11016 line-height: 1.7142857; 11017 margin-top: 1.7142857em; 11018 margin-bottom: 1.7142857em; 11019 border-radius: 0.375rem; 11020 padding-top: 0.8571429em; 11021 padding-inline-end: 1.1428571em; 11022 padding-bottom: 0.8571429em; 11023 padding-inline-start: 1.1428571em; 11024} 11025.prose :where(pre code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11026 background-color: transparent; 11027 border-width: 0; 11028 border-radius: 0; 11029 padding: 0; 11030 font-weight: inherit; 11031 color: inherit; 11032 font-size: inherit; 11033 font-family: inherit; 11034 line-height: inherit; 11035} 11036.prose :where(pre code):not(:where([class~="not-prose"],[class~="not-prose"] *))::before { 11037 content: none; 11038} 11039.prose :where(pre code):not(:where([class~="not-prose"],[class~="not-prose"] *))::after {
11040 content: none; 11041} 11042.prose :where(table):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11043 width: 100%; 11044 table-layout: auto; 11045 margin-top: 2em; 11046 margin-bottom: 2em; 11047 font-size: 0.875em; 11048 line-height: 1.7142857; 11049} 11050.prose :where(thead):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11051 border-bottom-width: 1px; 11052 border-bottom-color: var(--tw-prose-th-borders); 11053} 11054.prose :where(thead th):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11055 color: var(--tw-prose-headings); 11056 font-weight: 600; 11057 vertical-align: bottom; 11058 padding-inline-end: 0.5714286em; 11059 padding-bottom: 0.5714286em; 11060 padding-inline-start: 0.5714286em; 11061} 11062.prose :where(tbody tr):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11063 border-bottom-width: 1px; 11064 border-bottom-color: var(--tw-prose-td-borders); 11065} 11066.prose :where(tbody tr:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11067 border-bottom-width: 0; 11068} 11069.prose :where(tbody td):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11070 vertical-align: baseline; 11071} 11072.prose :where(tfoot):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11073 border-top-width: 1px; 11074 border-top-color: var(--tw-prose-th-borders); 11075} 11076.prose :where(tfoot td):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11077 vertical-align: top; 11078} 11079.prose :where(th, td):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11080 text-align: start; 11081} 11082.prose :where(figure > *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11083 margin-top: 0; 11084 margin-bottom: 0; 11085} 11086.prose :where(figcaption):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11087 color: var(--tw-prose-captions); 11088 font-size: 0.875em; 11089 line-height: 1.4285714; 11090 margin-top: 0.8571429em; 11091} 11092.prose { 11093 --tw-prose-body: var(--sc-base-content); 11094 --tw-prose-headings: var(--sc-base-900); 11095 --tw-prose-lead: var(--sc-base-content); 11096 --tw-prose-links: var(--sc-base-900); 11097 --tw-prose-bold: var(--sc-base-content); 11098 --tw-prose-counters: var(--sc-base-500); 11099 --tw-prose-bullets: var(--sc-base-300); 11100 --tw-prose-hr: var(--sc-base-200); 11101 --tw-prose-quotes: var(--sc-base-content); 11102 --tw-prose-quote-borders: var(--sc-base-200); 11103 --tw-prose-captions: var(--sc-base-500); 11104 --tw-prose-kbd: #111827; 11105 --tw-prose-kbd-shadows: rgb(17 24 39 / 10%); 11106 --tw-prose-code: var(--sc-base-900); 11107 --tw-prose-pre-code: var(--sc-base-200); 11108 --tw-prose-pre-bg: var(--sc-base-800); 11109 --tw-prose-th-borders: var(--sc-base-300); 11110 --tw-prose-td-borders: var(--sc-base-200); 11111 --tw-prose-invert-body: var(--sc-base-300); 11112 --tw-prose-invert-headings: var(--sc-base); 11113 --tw-prose-invert-lead: var(--sc-base-400); 11114 --tw-prose-invert-links: var(--sc-base); 11115 --tw-prose-invert-bold: var(--sc-base); 11116 --tw-prose-invert-counters: var(--sc-base-400); 11117 --tw-prose-invert-bullets: var(--sc-base-600); 11118 --tw-prose-invert-hr: var(--sc-base-700); 11119 --tw-prose-invert-quotes: var(--sc-base-100); 11120 --tw-prose-invert-quote-borders: var(--sc-base-700); 11121 --tw-prose-invert-captions: var(--sc-base-400); 11122 --tw-prose-invert-kbd: #fff; 11123 --tw-prose-invert-kbd-shadows: rgb(255 255 255 / 10%); 11124 --tw-prose-invert-code: var(--sc-base); 11125 --tw-prose-invert-pre-code: var(--sc-base-300); 11126 --tw-prose-invert-pre-bg: var(--sc-base-900); 11127 --tw-prose-invert-th-borders: var(--sc-base-600); 11128 --tw-prose-invert-td-borders: var(--sc-base-700); 11129 font-size: 1rem; 11130 line-height: 1.75; 11131} 11132.prose :where(picture > img):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11133 margin-top: 0; 11134 margin-bottom: 0; 11135} 11136.prose :where(li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11137 margin-top: 0.5em; 11138 margin-bottom: 0.5em; 11139 list-style-type: disc; 11140} 11141.prose :where(ol > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11142 padding-inline-start: 0.375em; 11143} 11144.prose :where(ul > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11145 padding-inline-start: 0.375em; 11146} 11147.prose :where(.prose > ul > li p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11148 margin-top: 0.75em; 11149 margin-bottom: 0.75em; 11150} 11151.prose :where(.prose > ul > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11152 margin-top: 1.25em; 11153} 11154.prose :where(.prose > ul > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11155 margin-bottom: 1.25em; 11156} 11157.prose :where(.prose > ol > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11158 margin-top: 1.25em; 11159} 11160.prose :where(.prose > ol > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11161 margin-bottom: 1.25em; 11162} 11163.prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11164 margin-top: 0.75em; 11165 margin-bottom: 0.75em; 11166} 11167.prose :where(dl):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11168 margin-top: 1.25em; 11169 margin-bottom: 1.25em; 11170}
11171.prose :where(dd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11172 margin-top: 0.5em; 11173 padding-inline-start: 1.625em; 11174} 11175.prose :where(hr + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11176 margin-top: 0; 11177} 11178.prose :where(h2 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11179 margin-top: 0; 11180} 11181.prose :where(h3 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11182 margin-top: 0; 11183} 11184.prose :where(h4 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11185 margin-top: 0; 11186} 11187.prose :where(thead th:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11188 padding-inline-start: 0; 11189} 11190.prose :where(thead th:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11191 padding-inline-end: 0; 11192} 11193.prose :where(tbody td, tfoot td):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11194 padding-top: 0.5714286em; 11195 padding-inline-end: 0.5714286em; 11196 padding-bottom: 0.5714286em; 11197 padding-inline-start: 0.5714286em; 11198} 11199.prose :where(tbody td:first-child, tfoot td:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11200 padding-inline-start: 0; 11201} 11202.prose :where(tbody td:last-child, tfoot td:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11203 padding-inline-end: 0; 11204} 11205.prose :where(figure):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11206 margin-top: 2em; 11207 margin-bottom: 2em; 11208} 11209.prose :where(.prose > :first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11210 margin-top: 0; 11211} 11212.prose :where(.prose > :last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11213 margin-bottom: 0; 11214} 11215.prose { 11216 line-height: 1.5; 11217} 11218.prose :where(strong a):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11219 font-weight: bolder; 11220} 11221.prose :where(iframe[src*="youtu"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11222 border-radius: var(--sc-rounded-md); 11223} 11224.prose-sm { 11225 font-size: 0.875rem; 11226 line-height: 1.7142857; 11227} 11228.prose-sm :where(p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11229 margin-top: 1.1428571em; 11230 margin-bottom: 1.1428571em; 11231} 11232.prose-sm :where([class~="lead"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11233 font-size: 1.2857143em; 11234 line-height: 1.5555556; 11235 margin-top: 0.8888889em; 11236 margin-bottom: 0.8888889em; 11237} 11238.prose-sm :where(blockquote):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11239 margin-top: 1.3333333em; 11240 margin-bottom: 1.3333333em; 11241 padding-inline-start: 1.1111111em; 11242} 11243.prose-sm :where(h1):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11244 font-size: 2.1428571em; 11245 margin-top: 0; 11246 margin-bottom: 0.8em; 11247 line-height: 1.2; 11248} 11249.prose-sm :where(h2):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11250 font-size: 1.4285714em; 11251 margin-top: 1.6em; 11252 margin-bottom: 0.8em; 11253 line-height: 1.4; 11254} 11255.prose-sm :where(h3):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11256 font-size: 1.2857143em; 11257 margin-top: 1.5555556em; 11258 margin-bottom: 0.4444444em; 11259 line-height: 1.5555556; 11260} 11261.prose-sm :where(h4):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11262 margin-top: 1.4285714em; 11263 margin-bottom: 0.5714286em; 11264 line-height: 1.4285714; 11265} 11266.prose-sm :where(img):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11267 margin-top: 1.7142857em; 11268 margin-bottom: 1.7142857em; 11269} 11270.prose-sm :where(picture):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11271 margin-top: 1.7142857em; 11272 margin-bottom: 1.7142857em; 11273} 11274.prose-sm :where(picture > img):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11275 margin-top: 0; 11276 margin-bottom: 0; 11277} 11278.prose-sm :where(video):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11279 margin-top: 1.7142857em; 11280 margin-bottom: 1.7142857em; 11281} 11282.prose-sm :where(kbd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11283 font-size: 0.8571429em; 11284 border-radius: 0.3125rem; 11285 padding-top: 0.1428571em; 11286 padding-inline-end: 0.3571429em; 11287 padding-bottom: 0.1428571em; 11288 padding-inline-start: 0.3571429em; 11289} 11290.prose-sm :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11291 font-size: 0.8571429em; 11292} 11293.prose-sm :where(h2 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11294 font-size: 0.9em; 11295} 11296.prose-sm :where(h3 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11297 font-size: 0.8888889em; 11298} 11299.prose-sm :where(pre):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11300 font-size: 0.8571429em; 11301 line-height: 1.6666667; 11302 margin-top: 1.6666667em; 11303 margin-bottom: 1.6666667em; 11304 border-radius: 0.25rem; 11305 padding-top: 0.6666667em; 11306 padding-inline-end: 1em; 11307 padding-bottom: 0.6666667em; 11308 padding-inline-start: 1em; 11309} 11310.prose-sm :where(ol):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11311 margin-top: 1.1428571em; 11312 margin-bottom: 1.1428571em; 11313 padding-inline-start: 1.5714286em; 11314} 11315.prose-sm :where(ul):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11316 margin-top: 1.1428571em; 11317 margin-bottom: 1.1428571em; 11318 padding-inline-start: 1.5714286em; 11319} 11320.prose-sm :where(li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11321 margin-top: 0.2857143em; 11322 margin-bottom: 0.2857143em; 11323} 11324.prose-sm :where(ol > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11325 padding-inline-start: 0.4285714em; 11326} 11327.prose-sm :where(ul > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11328 padding-inline-start: 0.4285714em; 11329} 11330.prose-sm :where(.prose-sm > ul > li p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11331 margin-top: 0.5714286em; 11332 margin-bottom: 0.5714286em; 11333} 11334.prose-sm :where(.prose-sm > ul > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11335 margin-top: 1.1428571em; 11336} 11337.prose-sm :where(.prose-sm > ul > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11338 margin-bottom: 1.1428571em; 11339} 11340.prose-sm :where(.prose-sm > ol > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11341 margin-top: 1.1428571em; 11342} 11343.prose-sm :where(.prose-sm > ol > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11344 margin-bottom: 1.1428571em; 11345} 11346.prose-sm :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11347 margin-top: 0.5714286em; 11348 margin-bottom: 0.5714286em; 11349} 11350.prose-sm :where(dl):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11351 margin-top: 1.1428571em; 11352 margin-bottom: 1.1428571em; 11353} 11354.prose-sm :where(dt):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11355 margin-top: 1.1428571em; 11356}
11357.prose-sm :where(dd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11358 margin-top: 0.2857143em; 11359 padding-inline-start: 1.5714286em; 11360} 11361.prose-sm :where(hr):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11362 margin-top: 2.8571429em; 11363 margin-bottom: 2.8571429em; 11364} 11365.prose-sm :where(hr + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11366 margin-top: 0; 11367} 11368.prose-sm :where(h2 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11369 margin-top: 0; 11370} 11371.prose-sm :where(h3 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11372 margin-top: 0; 11373} 11374.prose-sm :where(h4 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11375 margin-top: 0; 11376} 11377.prose-sm :where(table):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11378 font-size: 0.8571429em; 11379 line-height: 1.5; 11380} 11381.prose-sm :where(thead th):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11382 padding-inline-end: 1em; 11383 padding-bottom: 0.6666667em; 11384 padding-inline-start: 1em; 11385} 11386.prose-sm :where(thead th:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11387 padding-inline-start: 0; 11388} 11389.prose-sm :where(thead th:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11390 padding-inline-end: 0; 11391} 11392.prose-sm :where(tbody td, tfoot td):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11393 padding-top: 0.6666667em; 11394 padding-inline-end: 1em; 11395 padding-bottom: 0.6666667em; 11396 padding-inline-start: 1em; 11397} 11398.prose-sm :where(tbody td:first-child, tfoot td:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11399 padding-inline-start: 0; 11400} 11401.prose-sm :where(tbody td:last-child, tfoot td:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11402 padding-inline-end: 0; 11403} 11404.prose-sm :where(figure):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11405 margin-top: 1.7142857em; 11406 margin-bottom: 1.7142857em; 11407} 11408.prose-sm :where(figure > *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11409 margin-top: 0; 11410 margin-bottom: 0; 11411} 11412.prose-sm :where(figcaption):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11413 font-size: 0.8571429em; 11414 line-height: 1.3333333; 11415 margin-top: 0.6666667em; 11416} 11417.prose-sm :where(.prose-sm > :first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11418 margin-top: 0; 11419} 11420.prose-sm :where(.prose-sm > :last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11421 margin-bottom: 0; 11422} 11423.prose-slate { 11424 --tw-prose-body: #334155; 11425 --tw-prose-headings: #0f172a; 11426 --tw-prose-lead: #475569; 11427 --tw-prose-links: #0f172a; 11428 --tw-prose-bold: #0f172a; 11429 --tw-prose-counters: #64748b; 11430 --tw-prose-bullets: #cbd5e1; 11431 --tw-prose-hr: #e2e8f0; 11432 --tw-prose-quotes: #0f172a; 11433 --tw-prose-quote-borders: #e2e8f0; 11434 --tw-prose-captions: #64748b; 11435 --tw-prose-kbd: #0f172a; 11436 --tw-prose-kbd-shadows: rgb(15 23 42 / 10%); 11437 --tw-prose-code: #0f172a; 11438 --tw-prose-pre-code: #e2e8f0; 11439 --tw-prose-pre-bg: #1e293b; 11440 --tw-prose-th-borders: #cbd5e1; 11441 --tw-prose-td-borders: #e2e8f0; 11442 --tw-prose-invert-body: #cbd5e1; 11443 --tw-prose-invert-headings: #fff; 11444 --tw-prose-invert-lead: #94a3b8; 11445 --tw-prose-invert-links: #fff; 11446 --tw-prose-invert-bold: #fff; 11447 --tw-prose-invert-counters: #94a3b8; 11448 --tw-prose-invert-bullets: #475569; 11449 --tw-prose-invert-hr: #334155; 11450 --tw-prose-invert-quotes: #f1f5f9; 11451 --tw-prose-invert-quote-borders: #334155; 11452 --tw-prose-invert-captions: #94a3b8; 11453 --tw-prose-invert-kbd: #fff; 11454 --tw-prose-invert-kbd-shadows: rgb(255 255 255 / 10%); 11455 --tw-prose-invert-code: #fff; 11456 --tw-prose-invert-pre-code: #cbd5e1; 11457 --tw-prose-invert-pre-bg: rgb(0 0 0 / 50%); 11458 --tw-prose-invert-th-borders: #475569; 11459 --tw-prose-invert-td-borders: #334155; 11460} 11461.prose-tight { 11462 line-height: 1.25; 11463} 11464.prose-tight :where(p, ul, ol, pre):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11465 line-height: 1.25; 11466 margin: 0 0 0.5em; 11467} 11468.prose-tight :where(li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11469 margin-bottom: 0.5em; 11470 list-style-type: disc; 11471} 11472.prose-tight :where(a):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 11473 text-decoration: underline; 11474} 11475.sr-only { 11476 position: absolute; 11477 width: 1px; 11478 height: 1px; 11479 padding: 0; 11480 margin: -1px; 11481 overflow: hidden; 11482 clip: rect(0, 0, 0, 0); 11483 white-space: nowrap; 11484 border-width: 0; 11485} 11486.not-sr-only { 11487 position: static; 11488 width: auto; 11489 height: auto; 11490 padding: 0; 11491 margin: 0; 11492 overflow: visible; 11493 clip: auto; 11494 white-space: normal; 11495} 11496.pointer-events-none { 11497 pointer-events: none; 11498} 11499.pointer-events-auto { 11500 pointer-events: auto; 11501} 11502.visible { 11503 visibility: visible; 11504} 11505.static { 11506 position: static; 11507} 11508.fixed { 11509 position: fixed; 11510} 11511.absolute { 11512 position: absolute; 11513} 11514.relative { 11515 position: relative; 11516} 11517.sticky { 11518 position: sticky; 11519} 11520.inset-0 { 11521 inset: 0px; 11522} 11523.-bottom-1 { 11524 bottom: -0.25rem; 11525} 11526.-bottom-2 { 11527 bottom: -0.5rem; 11528} 11529.-bottom-\\[4px\\] { 11530 bottom: -4px; 11531} 11532.-left-1 { 11533 left: -0.25rem; 11534} 11535.-left-2 { 11536 left: -0.5rem; 11537} 11538.-left-\\[\\.7em\\] { 11539 left: -.7em; 11540} 11541.-left-\\[3px\\] { 11542 left: -3px; 11543} 11544.-right-1 { 11545 right: -0.25rem; 11546} 11547.-right-2 { 11548 right: -0.5rem; 11549} 11550.-top-1 { 11551 top: -0.25rem; 11552} 11553.-top-2 { 11554 top: -0.5rem; 11555} 11556.-top-\\[\\.1em\\] { 11557 top: -.1em; 11558} 11559.-top-\\[2px\\] { 11560 top: -2px; 11561} 11562.-top-\\[3px\\] { 11563 top: -3px; 11564} 11565.bottom-0 { 11566 bottom: 0px; 11567} 11568.bottom-1 { 11569 bottom: 0.25rem; 11570} 11571.bottom-2 { 11572 bottom: 0.5rem; 11573} 11574.bottom-3 { 11575 bottom: 0.75rem; 11576} 11577.bottom-4 { 11578 bottom: 1rem; 11579} 11580.bottom-\\[-2px\\] { 11581 bottom: -2px; 11582} 11583.left-0 { 11584 left: 0px; 11585} 11586.left-1 { 11587 left: 0.25rem; 11588} 11589.left-1\\/2 { 11590 left: 50%; 11591} 11592.left-2 { 11593 left: 0.5rem; 11594} 11595.left-3 { 11596 left: 0.75rem; 11597} 11598.left-4 { 11599 left: 1rem; 11600} 11601.left-\\[-2px\\] { 11602 left: -2px; 11603} 11604.left-\\[\\.3em\\] { 11605 left: .3em; 11606} 11607.left-full { 11608 left: 100%; 11609} 11610.right-0 { 11611 right: 0px; 11612} 11613.right-1 { 11614 right: 0.25rem; 11615} 11616.right-2 { 11617 right: 0.5rem; 11618} 11619.right-3 { 11620 right: 0.75rem; 11621} 11622.right-4 { 11623 right: 1rem; 11624} 11625.right-\\[\\.10em\\] { 11626 right: .10em; 11627} 11628.top-0 { 11629 top: 0px; 11630} 11631.top-1 { 11632 top: 0.25rem; 11633} 11634.top-1\\/2 { 11635 top: 50%; 11636} 11637.top-2 { 11638 top: 0.5rem; 11639} 11640.top-3 { 11641 top: 0.75rem; 11642} 11643.top-4 {
11644 top: 1rem; 11645} 11646.top-5 { 11647 top: 1.25rem; 11648} 11649.top-8 { 11650 top: 2rem; 11651} 11652.top-\\[--sticky-top-offset\\] { 11653 top: var(--sticky-top-offset); 11654} 11655.top-\\[-\\.3em\\] { 11656 top: -.3em; 11657} 11658.top-\\[-1px\\] { 11659 top: -1px; 11660} 11661.top-\\[\\.10em\\] { 11662 top: .10em; 11663} 11664.top-\\[100\\%\\] { 11665 top: 100%; 11666} 11667.top-\\[1rem\\] { 11668 top: 1rem; 11669} 11670.top-\\[4\\.2rem\\] { 11671 top: 4.2rem; 11672} 11673.top-\\[70px\\] { 11674 top: 70px; 11675} 11676.\\!z-\\[2000\\] { 11677 z-index: 2000 !important; 11678} 11679.z-0 { 11680 z-index: 0; 11681} 11682.z-10 { 11683 z-index: 10; 11684} 11685.z-20 { 11686 z-index: 20; 11687} 11688.z-40 { 11689 z-index: 40; 11690} 11691.z-50 { 11692 z-index: 50; 11693} 11694.z-\\[0\\] { 11695 z-index: 0; 11696} 11697.z-\\[10\\] { 11698 z-index: 10; 11699} 11700.z-\\[1\\] { 11701 z-index: 1; 11702} 11703.z-\\[2\\] { 11704 z-index: 2; 11705} 11706.z-\\[3\\] { 11707 z-index: 3; 11708} 11709.z-\\[980\\] { 11710 z-index: 980; 11711} 11712.order-first { 11713 order: -9999; 11714} 11715.col-\\[1\\/-1\\] { 11716 grid-column: 1/-1; 11717} 11718.col-span-1 { 11719 grid-column: span 1 / span 1; 11720} 11721.col-span-2 { 11722 grid-column: span 2 / span 2; 11723} 11724.col-span-full { 11725 grid-column: 1 / -1; 11726} 11727.col-start-1 { 11728 grid-column-start: 1; 11729} 11730.col-start-2 { 11731 grid-column-start: 2; 11732} 11733.row-span-2 { 11734 grid-row: span 2 / span 2; 11735} 11736.row-start-1 { 11737 grid-row-start: 1; 11738} 11739.clear-both { 11740 clear: both; 11741} 11742.m-0 { 11743 margin: 0px; 11744} 11745.m-1 { 11746 margin: 0.25rem; 11747} 11748.-mx-1 { 11749 margin-left: -0.25rem; 11750 margin-right: -0.25rem; 11751} 11752.-mx-3 { 11753 margin-left: -0.75rem; 11754 margin-right: -0.75rem; 11755} 11756.-mx-5 { 11757 margin-left: -1.25rem; 11758 margin-right: -1.25rem; 11759} 11760.-mx-\\[--sc-modal-px\\] { 11761 margin-left: calc(var(--sc-modal-px) * -1); 11762 margin-right: calc(var(--sc-modal-px) * -1); 11763} 11764.-mx-\\[\\.2em\\] { 11765 margin-left: -.2em; 11766 margin-right: -.2em; 11767} 11768.-mx-\\[var\\(--sc-modal-px\\)\\] { 11769 margin-left: calc(var(--sc-modal-px) * -1); 11770 margin-right: calc(var(--sc-modal-px) * -1); 11771} 11772.-mx-cgx { 11773 margin-left: calc(var(--sc-container-gutter-x) * -1); 11774 margin-right: calc(var(--sc-container-gutter-x) * -1); 11775} 11776.-my-1 { 11777 margin-top: -0.25rem; 11778 margin-bottom: -0.25rem; 11779} 11780.-my-\\[\\.5em\\] { 11781 margin-top: -.5em; 11782 margin-bottom: -.5em; 11783} 11784.mx-1 { 11785 margin-left: 0.25rem; 11786 margin-right: 0.25rem; 11787} 11788.mx-2 { 11789 margin-left: 0.5rem; 11790 margin-right: 0.5rem; 11791} 11792.mx-4 { 11793 margin-left: 1rem; 11794 margin-right: 1rem; 11795} 11796.mx-auto { 11797 margin-left: auto; 11798 margin-right: auto; 11799} 11800.my-0 { 11801 margin-top: 0px; 11802 margin-bottom: 0px; 11803} 11804.my-1 { 11805 margin-top: 0.25rem; 11806 margin-bottom: 0.25rem; 11807} 11808.my-12 { 11809 margin-top: 3rem; 11810 margin-bottom: 3rem; 11811} 11812.my-2 { 11813 margin-top: 0.5rem; 11814 margin-bottom: 0.5rem; 11815} 11816.my-20 { 11817 margin-top: 5rem; 11818 margin-bottom: 5rem; 11819} 11820.my-3 { 11821 margin-top: 0.75rem; 11822 margin-bottom: 0.75rem; 11823} 11824.my-4 { 11825 margin-top: 1rem; 11826 margin-bottom: 1rem; 11827} 11828.my-5 { 11829 margin-top: 1.25rem; 11830 margin-bottom: 1.25rem; 11831} 11832.my-6 { 11833 margin-top: 1.5rem; 11834 margin-bottom: 1.5rem; 11835} 11836.my-8 { 11837 margin-top: 2rem; 11838 margin-bottom: 2rem; 11839} 11840.my-\\[\\.5rem\\] { 11841 margin-top: .5rem; 11842 margin-bottom: .5rem; 11843} 11844.my-\\[2em\\] { 11845 margin-top: 2em; 11846 margin-bottom: 2em; 11847} 11848.my-\\[2px\\] { 11849 margin-top: 2px; 11850 margin-bottom: 2px; 11851} 11852.my-auto { 11853 margin-top: auto; 11854 margin-bottom: auto; 11855} 11856.-mb-12 { 11857 margin-bottom: -3rem; 11858} 11859.-mb-2 { 11860 margin-bottom: -0.5rem; 11861} 11862.-mb-\\[\\.5em\\] { 11863 margin-bottom: -.5em; 11864} 11865.-mb-\\[2px\\] { 11866 margin-bottom: -2px; 11867} 11868.-mb-\\[var\\(--sc-modal-py\\)\\] { 11869 margin-bottom: calc(var(--sc-modal-py) * -1); 11870} 11871.-ml-0\\.5 { 11872 margin-left: -0.125rem; 11873} 11874.-ml-1 { 11875 margin-left: -0.25rem; 11876} 11877.-ml-2 { 11878 margin-left: -0.5rem; 11879} 11880.-ml-\\[\\.4em\\] { 11881 margin-left: -.4em; 11882} 11883.-ml-\\[\\.5em\\] { 11884 margin-left: -.5em; 11885} 11886.-ml-\\[calc\\(var\\(--sc-container-gutter-x\\)\\/2\\)\\] { 11887 margin-left: calc(calc(var(--sc-container-gutter-x) / 2) * -1); 11888} 11889.-mr-2 { 11890 margin-right: -0.5rem; 11891} 11892.-mr-\\[\\.5em\\] { 11893 margin-right: -.5em; 11894} 11895.-mr-cgx { 11896 margin-right: calc(var(--sc-container-gutter-x) * -1); 11897} 11898.-mt-1 { 11899 margin-top: -0.25rem; 11900} 11901.-mt-2 { 11902 margin-top: -0.5rem; 11903} 11904.-mt-3 { 11905 margin-top: -0.75rem; 11906} 11907.-mt-5 { 11908 margin-top: -1.25rem; 11909} 11910.-mt-6 { 11911 margin-top: -1.5rem; 11912} 11913.-mt-\\[\\.15em\\] { 11914 margin-top: -.15em; 11915} 11916.-mt-cgy { 11917 margin-top: calc(var(--sc-container-gutter-y) * -1); 11918} 11919.mb-0 { 11920 margin-bottom: 0px; 11921} 11922.mb-0\\.5 { 11923 margin-bottom: 0.125rem; 11924} 11925.mb-1 { 11926 margin-bottom: 0.25rem; 11927} 11928.mb-10 { 11929 margin-bottom: 2.5rem; 11930} 11931.mb-12 { 11932 margin-bottom: 3rem; 11933} 11934.mb-2 { 11935 margin-bottom: 0.5rem; 11936} 11937.mb-20 { 11938 margin-bottom: 5rem; 11939} 11940.mb-3 { 11941 margin-bottom: 0.75rem; 11942} 11943.mb-4 { 11944 margin-bottom: 1rem; 11945} 11946.mb-5 { 11947 margin-bottom: 1.25rem; 11948} 11949.mb-6 { 11950 margin-bottom: 1.5rem; 11951} 11952.mb-7 { 11953 margin-bottom: 1.75rem; 11954} 11955.mb-8 { 11956 margin-bottom: 2rem; 11957} 11958.mb-\\[\\.2em\\] { 11959 margin-bottom: .2em; 11960} 11961.mb-\\[\\.3em\\] { 11962 margin-bottom: .3em; 11963} 11964.mb-\\[\\.5em\\] { 11965 margin-bottom: .5em; 11966} 11967.mb-\\[\\.75em\\] { 11968 margin-bottom: .75em; 11969} 11970.mb-\\[12px\\] { 11971 margin-bottom: 12px; 11972} 11973.mb-\\[15px\\] { 11974 margin-bottom: 15px; 11975} 11976.mb-\\[16px\\] { 11977 margin-bottom: 16px; 11978} 11979.mb-\\[1px\\] { 11980 margin-bottom: 1px; 11981} 11982.mb-\\[20px\\] { 11983 margin-bottom: 20px; 11984} 11985.mb-\\[2px\\] { 11986 margin-bottom: 2px; 11987} 11988.mb-\\[2rem\\] { 11989 margin-bottom: 2rem; 11990} 11991.mb-\\[3px\\] { 11992 margin-bottom: 3px; 11993} 11994.mb-\\[4px\\] { 11995 margin-bottom: 4px; 11996} 11997.mb-\\[5px\\] { 11998 margin-bottom: 5px; 11999} 12000.mb-\\[6px\\] { 12001 margin-bottom: 6px; 12002} 12003.mb-auto { 12004 margin-bottom: auto; 12005} 12006.ml-1 { 12007 margin-left: 0.25rem; 12008} 12009.ml-1\\.5 { 12010 margin-left: 0.375rem; 12011} 12012.ml-2 { 12013 margin-left: 0.5rem; 12014} 12015.ml-3 { 12016 margin-left: 0.75rem; 12017} 12018.ml-4 { 12019 margin-left: 1rem; 12020} 12021.ml-5 { 12022 margin-left: 1.25rem; 12023} 12024.ml-\\[\\.5em\\] { 12025 margin-left: .5em; 12026} 12027.ml-\\[\\.6em\\] { 12028 margin-left: .6em; 12029} 12030.ml-auto { 12031 margin-left: auto; 12032} 12033.mr-0\\.5 { 12034 margin-right: 0.125rem; 12035} 12036.mr-1 { 12037 margin-right: 0.25rem; 12038} 12039.mr-2 { 12040 margin-right: 0.5rem; 12041} 12042.mr-3 { 12043 margin-right: 0.75rem; 12044} 12045.mr-4 { 12046 margin-right: 1rem; 12047} 12048.mr-5 { 12049 margin-right: 1.25rem; 12050} 12051.mr-\\[\\.25em\\] { 12052 margin-right: .25em; 12053} 12054.mr-\\[\\.35em\\] { 12055 margin-right: .35em; 12056} 12057.mr-\\[\\.85em\\] { 12058 margin-right: .85em; 12059} 12060.mr-\\[2rem\\] { 12061 margin-right: 2rem; 12062} 12063.mr-auto { 12064 margin-right: auto; 12065} 12066.mt-0 { 12067 margin-top: 0px; 12068} 12069.mt-0\\.5 { 12070 margin-top: 0.125rem; 12071} 12072.mt-1 { 12073 margin-top: 0.25rem; 12074} 12075.mt-10 { 12076 margin-top: 2.5rem; 12077} 12078.mt-12 { 12079 margin-top: 3rem; 12080} 12081.mt-2 { 12082 margin-top: 0.5rem; 12083} 12084.mt-3 { 12085 margin-top: 0.75rem; 12086} 12087.mt-4 { 12088 margin-top: 1rem; 12089} 12090.mt-5 { 12091 margin-top: 1.25rem; 12092} 12093.mt-6 { 12094 margin-top: 1.5rem; 12095} 12096.mt-7 { 12097 margin-top: 1.75rem; 12098} 12099.mt-8 { 12100 margin-top: 2rem; 12101} 12102.mt-9 { 12103 margin-top: 2.25rem; 12104} 12105.mt-\\[\\.1em\\] { 12106 margin-top: .1em; 12107} 12108.mt-\\[\\.25em\\] { 12109 margin-top: .25em; 12110} 12111.mt-\\[\\.2em\\] { 12112 margin-top: .2em; 12113} 12114.mt-\\[\\.35rem\\] { 12115 margin-top: .35rem; 12116} 12117.mt-\\[\\.5em\\] { 12118 margin-top: .5em; 12119} 12120.mt-\\[1\\.5rem\\] { 12121 margin-top: 1.5rem; 12122} 12123.mt-\\[15px\\] { 12124 margin-top: 15px; 12125} 12126.mt-\\[1px\\] {
12127 margin-top: 1px; 12128} 12129.mt-\\[5px\\] { 12130 margin-top: 5px; 12131} 12132.mt-auto { 12133 margin-top: auto; 12134} 12135.mt-px { 12136 margin-top: 1px; 12137} 12138.box-border { 12139 box-sizing: border-box; 12140} 12141.line-clamp-2 { 12142 overflow: hidden; 12143 display: -webkit-box; 12144 -webkit-box-orient: vertical; 12145 -webkit-line-clamp: 2; 12146} 12147.line-clamp-3 { 12148 overflow: hidden; 12149 display: -webkit-box; 12150 -webkit-box-orient: vertical; 12151 -webkit-line-clamp: 3; 12152} 12153.block { 12154 display: block; 12155} 12156.inline-block { 12157 display: inline-block; 12158} 12159.inline { 12160 display: inline; 12161} 12162.flex { 12163 display: flex; 12164} 12165.inline-flex { 12166 display: inline-flex; 12167} 12168.table { 12169 display: table; 12170} 12171.grid { 12172 display: grid; 12173} 12174.contents { 12175 display: contents; 12176} 12177.hidden { 12178 display: none; 12179} 12180.aspect-\\[1\\/1\\] { 12181 aspect-ratio: 1/1; 12182} 12183.aspect-\\[3\\/2\\] { 12184 aspect-ratio: 3/2; 12185} 12186.aspect-square { 12187 aspect-ratio: 1 / 1; 12188} 12189.size-10 { 12190 width: 2.5rem; 12191 height: 2.5rem; 12192} 12193.size-3 { 12194 width: 0.75rem; 12195 height: 0.75rem; 12196} 12197.size-4 { 12198 width: 1rem; 12199 height: 1rem; 12200} 12201.size-5 { 12202 width: 1.25rem; 12203 height: 1.25rem; 12204} 12205.size-6 { 12206 width: 1.5rem; 12207 height: 1.5rem; 12208} 12209.size-\\[10rem\\] { 12210 width: 10rem; 12211 height: 10rem; 12212} 12213.size-\\[13px\\] { 12214 width: 13px; 12215 height: 13px; 12216} 12217.size-\\[15rem\\] { 12218 width: 15rem; 12219 height: 15rem; 12220} 12221.size-\\[4\\.4rem\\] { 12222 width: 4.4rem; 12223 height: 4.4rem; 12224} 12225.size-\\[5rem\\] { 12226 width: 5rem; 12227 height: 5rem; 12228} 12229.size-\\[6rem\\] { 12230 width: 6rem; 12231 height: 6rem; 12232} 12233.size-\\[8rem\\] { 12234 width: 8rem; 12235 height: 8rem; 12236} 12237.size-full { 12238 width: 100%; 12239 height: 100%; 12240} 12241.h-0 { 12242 height: 0px; 12243} 12244.h-10 { 12245 height: 2.5rem; 12246} 12247.h-2 { 12248 height: 0.5rem; 12249} 12250.h-20 { 12251 height: 5rem; 12252} 12253.h-28 { 12254 height: 7rem; 12255} 12256.h-3 { 12257 height: 0.75rem; 12258} 12259.h-4 { 12260 height: 1rem; 12261} 12262.h-5 { 12263 height: 1.25rem; 12264} 12265.h-6 { 12266 height: 1.5rem; 12267} 12268.h-7 { 12269 height: 1.75rem; 12270} 12271.h-8 { 12272 height: 2rem; 12273} 12274.h-9 { 12275 height: 2.25rem; 12276} 12277.h-\\[--sc-header-height\\] { 12278 height: var(--sc-header-height); 12279} 12280.h-\\[\\.80em\\] { 12281 height: .80em; 12282} 12283.h-\\[13px\\] { 12284 height: 13px; 12285} 12286.h-\\[16px\\] { 12287 height: 16px; 12288} 12289.h-\\[1em\\] { 12290 height: 1em; 12291} 12292.h-\\[1px\\] { 12293 height: 1px; 12294} 12295.h-\\[2em\\] { 12296 height: 2em; 12297} 12298.h-\\[2px\\] { 12299 height: 2px; 12300} 12301.h-\\[33\\.3333334vh\\] { 12302 height: 33.3333334vh; 12303} 12304.h-\\[4px\\] { 12305 height: 4px; 12306} 12307.h-\\[7px\\] { 12308 height: 7px; 12309} 12310.h-\\[var\\(--sc-border-width\\)\\] { 12311 height: var(--sc-border-width); 12312} 12313.h-auto { 12314 height: auto; 12315} 12316.h-fit { 12317 height: -moz-fit-content; 12318 height: fit-content; 12319} 12320.h-full { 12321 height: 100%; 12322} 12323.h-screen { 12324 height: 100vh; 12325} 12326.max-h-60 { 12327 max-height: 15rem; 12328} 12329.max-h-72 { 12330 max-height: 18rem; 12331} 12332.max-h-80 { 12333 max-height: 20rem; 12334} 12335.max-h-96 { 12336 max-height: 24rem; 12337} 12338.max-h-\\[10rem\\] { 12339 max-height: 10rem; 12340} 12341.max-h-\\[11rem\\] { 12342 max-height: 11rem; 12343} 12344.max-h-\\[18rem\\] { 12345 max-height: 18rem; 12346} 12347.max-h-\\[20rem\\] { 12348 max-height: 20rem; 12349} 12350.max-h-\\[40vh\\] { 12351 max-height: 40vh; 12352} 12353.max-h-\\[45vh\\] { 12354 max-height: 45vh; 12355} 12356.max-h-\\[50vh\\] { 12357 max-height: 50vh; 12358} 12359.max-h-\\[60vh\\] { 12360 max-height: 60vh; 12361} 12362.max-h-\\[calc\\(100vh_-_4\\.2rem\\)\\] { 12363 max-height: calc(100vh - 4.2rem); 12364} 12365.max-h-\\[calc\\(80vh-100px\\)\\] { 12366 max-height: calc(80vh - 100px); 12367} 12368.max-h-full { 12369 max-height: 100%; 12370} 12371.min-h-0 { 12372 min-height: 0px; 12373} 12374.min-h-10 { 12375 min-height: 2.5rem; 12376} 12377.min-h-12 { 12378 min-height: 3rem; 12379} 12380.min-h-14 { 12381 min-height: 3.5rem; 12382} 12383.min-h-16 { 12384 min-height: 4rem; 12385} 12386.min-h-24 { 12387 min-height: 6rem; 12388} 12389.min-h-6 { 12390 min-height: 1.5rem; 12391} 12392.min-h-\\[1\\.15em\\] { 12393 min-height: 1.15em; 12394} 12395.min-h-\\[1\\.1em\\] { 12396 min-height: 1.1em; 12397} 12398.min-h-\\[1\\.25rem\\] { 12399 min-height: 1.25rem; 12400} 12401.min-h-\\[1\\.5rem\\] { 12402 min-height: 1.5rem; 12403} 12404.min-h-\\[1\\.7rem\\] { 12405 min-height: 1.7rem; 12406} 12407.min-h-\\[1\\.8rem\\] { 12408 min-height: 1.8rem; 12409} 12410.min-h-\\[100vh\\] { 12411 min-height: 100vh; 12412} 12413.min-h-\\[15rem\\] { 12414 min-height: 15rem; 12415} 12416.min-h-\\[17rem\\] { 12417 min-height: 17rem; 12418} 12419.min-h-\\[18\\.5rem\\] { 12420 min-height: 18.5rem; 12421} 12422.min-h-\\[1em\\] { 12423 min-height: 1em; 12424} 12425.min-h-\\[1px\\] { 12426 min-height: 1px; 12427} 12428.min-h-\\[2\\.1em\\] { 12429 min-height: 2.1em; 12430} 12431.min-h-\\[2\\.5em\\] { 12432 min-height: 2.5em; 12433} 12434.min-h-\\[2\\.8rem\\] { 12435 min-height: 2.8rem; 12436} 12437.min-h-\\[3\\.8rem\\] { 12438 min-height: 3.8rem; 12439} 12440.min-h-\\[300px\\] { 12441 min-height: 300px; 12442} 12443.min-h-\\[32rem\\] { 12444 min-height: 32rem; 12445} 12446.min-h-\\[3rem\\] { 12447 min-height: 3rem; 12448} 12449.min-h-\\[40rem\\] { 12450 min-height: 40rem; 12451} 12452.min-h-\\[40vh\\] { 12453 min-height: 40vh; 12454} 12455.min-h-\\[4rem\\] { 12456 min-height: 4rem; 12457} 12458.min-h-\\[5rem\\] { 12459 min-height: 5rem; 12460} 12461.min-h-\\[6rem\\] { 12462 min-height: 6rem; 12463} 12464.min-h-\\[7\\.5rem\\] { 12465 min-height: 7.5rem; 12466} 12467.min-h-\\[8\\.1rem\\] { 12468 min-height: 8.1rem; 12469} 12470.min-h-\\[8rem\\] { 12471 min-height: 8rem; 12472} 12473.min-h-full { 12474 min-height: 100%; 12475} 12476.w-1 { 12477 width: 0.25rem; 12478} 12479.w-1\\/2 { 12480 width: 50%; 12481} 12482.w-1\\/3 { 12483 width: 33.333333%; 12484} 12485.w-10 { 12486 width: 2.5rem; 12487} 12488.w-10\\/12 { 12489 width: 83.333333%; 12490} 12491.w-12 { 12492 width: 3rem; 12493} 12494.w-16 { 12495 width: 4rem; 12496} 12497.w-2\\/3 { 12498 width: 66.666667%; 12499} 12500.w-20 { 12501 width: 5rem; 12502} 12503.w-28 { 12504 width: 7rem; 12505} 12506.w-3 { 12507 width: 0.75rem; 12508} 12509.w-32 { 12510 width: 8rem; 12511} 12512.w-4\\/5 { 12513 width: 80%; 12514} 12515.w-5 { 12516 width: 1.25rem; 12517} 12518.w-56 { 12519 width: 14rem; 12520} 12521.w-6 { 12522 width: 1.5rem; 12523} 12524.w-8 { 12525 width: 2rem; 12526} 12527.w-80 { 12528 width: 20rem; 12529} 12530.w-9 { 12531 width: 2.25rem; 12532} 12533.w-\\[--_event-width\\] { 12534 width: var(--_event-width); 12535} 12536.w-\\[1\\.6rem\\] { 12537 width: 1.6rem; 12538} 12539.w-\\[10rem\\] { 12540 width: 10rem; 12541} 12542.w-\\[11ch\\] { 12543 width: 11ch; 12544} 12545.w-\\[12rem\\] { 12546 width: 12rem; 12547} 12548.w-\\[13px\\] { 12549 width: 13px; 12550} 12551.w-\\[13rem\\] { 12552 width: 13rem; 12553} 12554.w-\\[14rem\\] { 12555 width: 14rem; 12556} 12557.w-\\[17rem\\] { 12558 width: 17rem; 12559} 12560.w-\\[18rem\\] { 12561 width: 18rem; 12562} 12563.w-\\[19rem\\] { 12564 width: 19rem; 12565} 12566.w-\\[1em\\] { 12567 width: 1em; 12568} 12569.w-\\[2\\.2rem\\] { 12570 width: 2.2rem; 12571} 12572.w-\\[20rem\\] { 12573 width: 20rem; 12574} 12575.w-\\[2em\\] { 12576 width: 2em; 12577} 12578.w-\\[2rem\\] { 12579 width: 2rem; 12580} 12581.w-\\[30\\%\\] { 12582 width: 30%; 12583} 12584.w-\\[3rem\\] { 12585 width: 3rem; 12586} 12587.w-\\[4\\.45rem\\] { 12588 width: 4.45rem; 12589} 12590.w-\\[4rem\\] { 12591 width: 4rem; 12592} 12593.w-\\[5rem\\] { 12594 width: 5rem; 12595} 12596.w-\\[6\\.5rem\\] { 12597 width: 6.5rem; 12598} 12599.w-\\[60\\%\\] { 12600 width: 60%; 12601} 12602.w-\\[70px\\] { 12603 width: 70px; 12604} 12605.w-\\[7px\\] { 12606 width: 7px; 12607} 12608.w-\\[7rem\\] { 12609 width: 7rem; 12610} 12611.w-\\[80vw\\] { 12612 width: 80vw; 12613} 12614.w-\\[max\\(60\\%\\2c 20rem\\)\\] { 12615 width: max(60%, 20rem); 12616} 12617.w-\\[max\\(60\\%\\2c 25rem\\)\\] { 12618 width: max(60%, 25rem); 12619} 12620.w-\\[min\\(90vw\\2c 22rem\\)\\] { 12621 width: min(90vw, 22rem); 12622} 12623.w-auto { 12624 width: auto; 12625} 12626.w-full { 12627 width: 100%; 12628} 12629.w-min { 12630 width: -moz-min-content; 12631 width: min-content; 12632} 12633.min-w-0 { 12634 min-width: 0px; 12635} 12636.min-w-40 { 12637 min-width: 10rem; 12638} 12639.min-w-60 { 12640 min-width: 15rem; 12641} 12642.min-w-64 { 12643 min-width: 16rem; 12644} 12645.min-w-72 { 12646 min-width: 18rem; 12647} 12648.min-w-\\[\\.5rem\\] { 12649 min-width: .5rem; 12650} 12651.min-w-\\[1\\.7rem\\] { 12652 min-width: 1.7rem; 12653} 12654.min-w-\\[10rem\\] { 12655 min-width: 10rem; 12656} 12657.min-w-\\[12rem\\] { 12658 min-width: 12rem; 12659} 12660.min-w-\\[13rem\\] { 12661 min-width: 13rem; 12662} 12663.min-w-\\[14\\.5ch\\] { 12664 min-width: 14.5ch; 12665} 12666.min-w-\\[14rem\\] { 12667 min-width: 14rem; 12668} 12669.min-w-\\[15rem\\] { 12670 min-width: 15rem; 12671} 12672.min-w-\\[1ch\\] { 12673 min-width: 1ch; 12674} 12675.min-w-\\[24rem\\] { 12676 min-width: 24rem; 12677} 12678.min-w-\\[25ch\\] { 12679 min-width: 25ch; 12680} 12681.min-w-\\[2ch\\] { 12682 min-width: 2ch; 12683} 12684.min-w-\\[3\\.2rem\\] { 12685 min-width: 3.2rem; 12686} 12687.min-w-\\[30ch\\] { 12688 min-width: 30ch; 12689} 12690.min-w-\\[3ch\\] { 12691 min-width: 3ch; 12692} 12693.min-w-\\[4\\.5rem\\] { 12694 min-width: 4.5rem; 12695} 12696.min-w-\\[4rem\\] { 12697 min-width: 4rem; 12698} 12699.min-w-\\[5\\.7rem\\] { 12700 min-width: 5.7rem; 12701} 12702.min-w-\\[5\\.8ch\\] { 12703 min-width: 5.8ch; 12704} 12705.min-w-\\[5ch\\] { 12706 min-width: 5ch; 12707} 12708.min-w-\\[5em\\] { 12709 min-width: 5em; 12710} 12711.min-w-\\[5rem\\] { 12712 min-width: 5rem; 12713} 12714.min-w-\\[6ch\\] { 12715 min-width: 6ch; 12716} 12717.min-w-\\[7\\.5rem\\] { 12718 min-width: 7.5rem; 12719} 12720.min-w-\\[7ch\\] { 12721 min-width: 7ch; 12722} 12723.min-w-\\[min\\(7\\.8ch\\2c _4\\.5em\\)\\] { 12724 min-width: min(7.8ch, 4.5em); 12725} 12726.max-w-40 { 12727 max-width: 10rem; 12728} 12729.max-w-48 { 12730 max-width: 12rem; 12731} 12732.max-w-60 { 12733 max-width: 15rem; 12734} 12735.max-w-96 { 12736 max-width: 24rem; 12737} 12738.max-w-\\[10ch\\] { 12739 max-width: 10ch; 12740} 12741.max-w-\\[10em\\] { 12742 max-width: 10em; 12743} 12744.max-w-\\[10rem\\] { 12745 max-width: 10rem; 12746} 12747.max-w-\\[120px\\] { 12748 max-width: 120px; 12749} 12750.max-w-\\[12ch\\] { 12751 max-width: 12ch; 12752} 12753.max-w-\\[12rem\\] { 12754 max-width: 12rem; 12755} 12756.max-w-\\[13ch\\] { 12757 max-width: 13ch; 12758} 12759.max-w-\\[13rem\\] { 12760 max-width: 13rem; 12761} 12762.max-w-\\[150px\\] { 12763 max-width: 150px; 12764} 12765.max-w-\\[15ch\\] { 12766 max-width: 15ch; 12767} 12768.max-w-\\[16rem\\] { 12769 max-width: 16rem; 12770} 12771.max-w-\\[18ch\\] { 12772 max-width: 18ch; 12773} 12774.max-w-\\[18rem\\] { 12775 max-width: 18rem; 12776} 12777.max-w-\\[19rem\\] { 12778 max-width: 19rem; 12779} 12780.max-w-\\[20ch\\] { 12781 max-width: 20ch; 12782} 12783.max-w-\\[20rem\\] { 12784 max-width: 20rem; 12785} 12786.max-w-\\[22ch\\] { 12787 max-width: 22ch; 12788} 12789.max-w-\\[23ch\\] { 12790 max-width: 23ch; 12791} 12792.max-w-\\[23rem\\] { 12793 max-width: 23rem; 12794} 12795.max-w-\\[24rem\\] { 12796 max-width: 24rem; 12797} 12798.max-w-\\[250px\\] { 12799 max-width: 250px; 12800} 12801.max-w-\\[25rem\\] { 12802 max-width: 25rem; 12803} 12804.max-w-\\[260px\\] { 12805 max-width: 260px; 12806} 12807.max-w-\\[26rem\\] { 12808 max-width: 26rem; 12809} 12810.max-w-\\[28ch\\] { 12811 max-width: 28ch; 12812} 12813.max-w-\\[29ch\\] { 12814 max-width: 29ch; 12815} 12816.max-w-\\[300px\\] { 12817 max-width: 300px; 12818} 12819.max-w-\\[30ch\\] { 12820 max-width: 30ch; 12821} 12822.max-w-\\[30rem\\] { 12823 max-width: 30rem; 12824} 12825.max-w-\\[32rem\\] { 12826 max-width: 32rem; 12827} 12828.max-w-\\[34ch\\] { 12829 max-width: 34ch; 12830} 12831.max-w-\\[35rem\\] { 12832 max-width: 35rem; 12833}
12834.max-w-\\[36rem\\] { 12835 max-width: 36rem; 12836} 12837.max-w-\\[400px\\] { 12838 max-width: 400px; 12839} 12840.max-w-\\[40ch\\] { 12841 max-width: 40ch; 12842} 12843.max-w-\\[40rem\\] { 12844 max-width: 40rem; 12845} 12846.max-w-\\[450px\\] { 12847 max-width: 450px; 12848} 12849.max-w-\\[5\\.7rem\\] { 12850 max-width: 5.7rem; 12851} 12852.max-w-\\[50ch\\] { 12853 max-width: 50ch; 12854} 12855.max-w-\\[50rem\\] { 12856 max-width: 50rem; 12857} 12858.max-w-\\[55rem\\] { 12859 max-width: 55rem; 12860} 12861.max-w-\\[60rem\\] { 12862 max-width: 60rem; 12863} 12864.max-w-\\[64ch\\] { 12865 max-width: 64ch; 12866} 12867.max-w-\\[64rem\\] { 12868 max-width: 64rem; 12869} 12870.max-w-\\[70ch\\] { 12871 max-width: 70ch; 12872} 12873.max-w-\\[80ch\\] { 12874 max-width: 80ch; 12875} 12876.max-w-\\[80rem\\] { 12877 max-width: 80rem; 12878} 12879.max-w-\\[80vw\\] { 12880 max-width: 80vw; 12881} 12882.max-w-\\[85ch\\] { 12883 max-width: 85ch; 12884} 12885.max-w-\\[8rem\\] { 12886 max-width: 8rem; 12887} 12888.max-w-\\[90\\%\\] { 12889 max-width: 90%; 12890} 12891.max-w-full { 12892 max-width: 100%; 12893} 12894.max-w-none { 12895 max-width: none; 12896} 12897.max-w-prose { 12898 max-width: 65ch; 12899} 12900.max-w-sm { 12901 max-width: 24rem; 12902} 12903.flex-1 { 12904 flex: 1 1 0%; 12905} 12906.flex-shrink { 12907 flex-shrink: 1; 12908} 12909.flex-shrink-0 { 12910 flex-shrink: 0; 12911} 12912.shrink-0 { 12913 flex-shrink: 0; 12914} 12915.flex-grow { 12916 flex-grow: 1; 12917} 12918.flex-grow-0 { 12919 flex-grow: 0; 12920} 12921.grow { 12922 flex-grow: 1; 12923} 12924.origin-center { 12925 transform-origin: center; 12926} 12927.-translate-x-1\\/2 { 12928 --tw-translate-x: -50%; 12929 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12930} 12931.-translate-y-1 { 12932 --tw-translate-y: -0.25rem; 12933 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12934} 12935.-translate-y-1\\/2 { 12936 --tw-translate-y: -50%; 12937 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12938} 12939.-translate-y-3\\/4 { 12940 --tw-translate-y: -75%; 12941 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12942} 12943.-translate-y-4 { 12944 --tw-translate-y: -1rem; 12945 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12946} 12947.-translate-y-\\[\\.05em\\] { 12948 --tw-translate-y: -.05em; 12949 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12950} 12951.translate-x-1 { 12952 --tw-translate-x: 0.25rem; 12953 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12954} 12955.translate-x-\\[\\.1em\\] { 12956 --tw-translate-x: .1em; 12957 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12958} 12959.translate-x-\\[1px\\] { 12960 --tw-translate-x: 1px; 12961 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12962} 12963.translate-y-\\[-1px\\] { 12964 --tw-translate-y: -1px; 12965 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12966} 12967.translate-y-\\[-50\\%\\] { 12968 --tw-translate-y: -50%; 12969 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12970} 12971.translate-y-full { 12972 --tw-translate-y: 100%; 12973 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12974} 12975.-rotate-45 { 12976 --tw-rotate: -45deg; 12977 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12978} 12979.rotate-90 { 12980 --tw-rotate: 90deg; 12981 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12982} 12983.scale-0 { 12984 --tw-scale-x: 0; 12985 --tw-scale-y: 0; 12986 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12987} 12988.scale-100 { 12989 --tw-scale-x: 1; 12990 --tw-scale-y: 1; 12991 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12992} 12993.scale-110 { 12994 --tw-scale-x: 1.1; 12995 --tw-scale-y: 1.1; 12996 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 12997} 12998.scale-50 { 12999 --tw-scale-x: .5; 13000 --tw-scale-y: .5; 13001 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 13002} 13003.scale-\\[\\.90\\] { 13004 --tw-scale-x: .90; 13005 --tw-scale-y: .90; 13006 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 13007} 13008.scale-\\[\\.97\\] { 13009 --tw-scale-x: .97; 13010 --tw-scale-y: .97; 13011 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 13012} 13013.scale-\\[50\\%\\] { 13014 --tw-scale-x: 50%; 13015 --tw-scale-y: 50%; 13016 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 13017} 13018.scale-x-0 { 13019 --tw-scale-x: 0; 13020 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 13021} 13022.scale-x-100 { 13023 --tw-scale-x: 1; 13024 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 13025} 13026.transform { 13027 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 13028} 13029.animate-\\[pulse\\.5s_ease-in-out_infinite_\\.5s\\] { 13030 animation: pulse.5s ease-in-out infinite .5s; 13031} 13032@keyframes heartbeat { 13033 13034 0% { 13035 transform: scale(1); 13036 } 13037 13038 14% { 13039 transform: scale(1.3); 13040 } 13041 13042 28% { 13043 transform: scale(1); 13044 } 13045 13046 42% { 13047 transform: scale(1.3); 13048 } 13049 13050 70% { 13051 transform: scale(1); 13052 } 13053} 13054.animate-heartbeat { 13055 animation: heartbeat 1.15s ease-in-out infinite; 13056} 13057@keyframes pulse { 13058 13059 50% { 13060 opacity: .5; 13061 } 13062} 13063.animate-pulse { 13064 animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; 13065} 13066@keyframes spin { 13067 13068 to { 13069 transform: rotate(360deg); 13070 } 13071} 13072.animate-spin { 13073 animation: spin 1s linear infinite; 13074} 13075.cursor-default { 13076 cursor: default; 13077} 13078.cursor-pointer { 13079 cursor: pointer; 13080} 13081.select-none { 13082 -webkit-user-select: none; 13083 -moz-user-select: none; 13084 user-select: none; 13085} 13086.resize { 13087 resize: both; 13088} 13089.list-inside { 13090 list-style-position: inside; 13091} 13092.list-decimal { 13093 list-style-type: decimal; 13094} 13095.list-disc { 13096 list-style-type: disc; 13097} 13098.break-inside-avoid { 13099 -moz-column-break-inside: avoid; 13100 break-inside: avoid; 13101} 13102.grid-cols-1 { 13103 grid-template-columns: repeat(1, minmax(0, 1fr)); 13104} 13105.grid-cols-2 { 13106 grid-template-columns: repeat(2, minmax(0, 1fr)); 13107} 13108.grid-cols-3 { 13109 grid-template-columns: repeat(3, minmax(0, 1fr)); 13110} 13111.grid-cols-\\[2\\.25rem_2\\.25rem\\] { 13112 grid-template-columns: 2.25rem 2.25rem; 13113} 13114.grid-cols-\\[2\\.5rem_minmax\\(0\\2c 1fr\\)\\] { 13115 grid-template-columns: 2.5rem minmax(0,1fr); 13116} 13117.grid-cols-\\[2\\.7rem_minmax\\(0\\2c 1fr\\)\\] { 13118 grid-template-columns: 2.7rem minmax(0,1fr); 13119} 13120.grid-cols-\\[3\\.2rem_minmax\\(0\\2c 1fr\\)\\] { 13121 grid-template-columns: 3.2rem minmax(0,1fr); 13122} 13123.grid-cols-\\[4rem_minmax\\(0\\2c 1fr\\)\\] { 13124 grid-template-columns: 4rem minmax(0,1fr); 13125} 13126.grid-cols-\\[5\\.2rem_minmax\\(0\\2c 1fr\\)\\] { 13127 grid-template-columns: 5.2rem minmax(0,1fr); 13128} 13129.grid-cols-\\[5\\.5rem_auto\\] { 13130 grid-template-columns: 5.5rem auto; 13131} 13132.grid-cols-\\[5rem_auto\\] { 13133 grid-template-columns: 5rem auto; 13134} 13135.grid-cols-\\[6rem_minmax\\(0\\2c 1fr\\)\\] { 13136 grid-template-columns: 6rem minmax(0,1fr); 13137} 13138.grid-cols-\\[8rem\\2c 1fr\\] { 13139 grid-template-columns: 8rem 1fr; 13140} 13141.grid-cols-\\[auto\\2c 1fr\\] { 13142 grid-template-columns: auto 1fr; 13143} 13144.grid-cols-\\[auto\\2c _minmax\\(0\\2c 1fr\\)\\2c _auto\\] { 13145 grid-template-columns: auto minmax(0,1fr) auto; 13146} 13147.grid-cols-\\[max\\(6rem\\2c _13\\%\\)_1fr\\] { 13148 grid-template-columns: max(6rem, 13%) 1fr; 13149} 13150.grid-cols-\\[minmax\\(0\\2c 1fr\\)_auto\\] { 13151 grid-template-columns: minmax(0,1fr) auto; 13152} 13153.grid-cols-\\[minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 1\\.5fr\\)\\] { 13154 grid-template-columns: minmax(0,1fr) minmax(0,1.5fr); 13155} 13156.grid-cols-\\[minmax\\(0\\2c 2fr\\)_90px_minmax\\(0\\2c 3fr\\)_60px\\] { 13157 grid-template-columns: minmax(0,2fr) 90px minmax(0,3fr) 60px; 13158} 13159.grid-cols-\\[minmax\\(0\\2c 3fr\\)_minmax\\(0\\2c 1\\.5fr\\)_6rem\\] { 13160 grid-template-columns: minmax(0,3fr) minmax(0,1.5fr) 6rem; 13161} 13162.grid-cols-\\[minmax\\(0\\2c _3fr\\)_1fr\\] { 13163 grid-template-columns: minmax(0, 3fr) 1fr; 13164} 13165.grid-cols-\\[minmax\\(10rem\\2c 15rem\\)_minmax\\(0\\2c 1fr\\)\\] { 13166 grid-template-columns: minmax(10rem,15rem) minmax(0,1fr); 13167} 13168.grid-cols-\\[minmax\\(15rem\\2c 1fr\\)_minmax\\(0\\2c 2\\.5fr\\)\\] { 13169 grid-template-columns: minmax(15rem,1fr) minmax(0,2.5fr); 13170} 13171.grid-cols-\\[minmax\\(35\\%\\2c 1fr\\)_auto_minmax\\(0\\2c max-content\\)\\] { 13172 grid-template-columns: minmax(35%,1fr) auto minmax(0,max-content); 13173} 13174.grid-cols-\\[minmax\\(4\\.5rem\\2c 7rem\\)_minmax\\(7rem\\2c 10rem\\)_minmax\\(0\\2c 1\\.2fr\\)_minmax\\(4\\.5rem\\2c 6\\.5rem\\)_4\\.75rem\\] { 13175 grid-template-columns: minmax(4.5rem,7rem) minmax(7rem,10rem) minmax(0,1.2fr) minmax(4.5rem,6.5rem) 4.75rem; 13176} 13177.grid-cols-\\[repeat\\(auto-fill\\2c minmax\\(200px\\2c 1fr\\)\\)\\] { 13178 grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); 13179} 13180.grid-cols-\\[repeat\\(auto-fill\\2c minmax\\(260px\\2c 1fr\\)\\)\\] { 13181 grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); 13182} 13183.grid-cols-\\[repeat\\(auto-fit\\2c minmax\\(min\\(100\\%\\2c 10rem\\)\\2c 1fr\\)\\)\\] { 13184 grid-template-columns: repeat(auto-fit,minmax(min(100%, 10rem),1fr)); 13185} 13186.grid-cols-\\[repeat\\(auto-fit\\2c minmax\\(min\\(100\\%\\2c 15rem\\)\\2c 1fr\\)\\)\\] { 13187 grid-template-columns: repeat(auto-fit,minmax(min(100%, 15rem),1fr)); 13188} 13189.grid-cols-\\[repeat\\(auto-fit\\2c minmax\\(min\\(100\\%\\2c 16rem\\)\\2c 1fr\\)\\)\\] { 13190 grid-template-columns: repeat(auto-fit,minmax(min(100%, 16rem),1fr)); 13191} 13192.grid-rows-\\[0fr\\] { 13193 grid-template-rows: 0fr; 13194} 13195.grid-rows-\\[1fr\\] { 13196 grid-template-rows: 1fr; 13197} 13198.grid-rows-\\[max-content_1fr\\] { 13199 grid-template-rows: max-content 1fr; 13200} 13201.flex-row { 13202 flex-direction: row; 13203} 13204.flex-row-reverse { 13205 flex-direction: row-reverse; 13206} 13207.flex-col { 13208 flex-direction: column; 13209} 13210.flex-wrap { 13211 flex-wrap: wrap; 13212} 13213.flex-nowrap { 13214 flex-wrap: nowrap; 13215} 13216.items-start { 13217 align-items: flex-start; 13218} 13219.items-end { 13220 align-items: flex-end; 13221} 13222.items-center { 13223 align-items: center; 13224} 13225.items-baseline { 13226 align-items: baseline; 13227} 13228.items-stretch { 13229 align-items: stretch; 13230} 13231.justify-start { 13232 justify-content: flex-start; 13233} 13234.justify-end { 13235 justify-content: flex-end; 13236} 13237.justify-center { 13238 justify-content: center; 13239} 13240.justify-between { 13241 justify-content: space-between; 13242} 13243.gap-0 { 13244 gap: 0px; 13245} 13246.gap-0\\.5 { 13247 gap: 0.125rem; 13248} 13249.gap-1 { 13250 gap: 0.25rem; 13251} 13252.gap-1\\.5 { 13253 gap: 0.375rem; 13254} 13255.gap-10 { 13256 gap: 2.5rem; 13257} 13258.gap-12 { 13259 gap: 3rem; 13260} 13261.gap-16 { 13262 gap: 4rem; 13263} 13264.gap-2 { 13265 gap: 0.5rem; 13266} 13267.gap-2\\.5 { 13268 gap: 0.625rem; 13269} 13270.gap-3 { 13271 gap: 0.75rem; 13272} 13273.gap-4 {
13274 gap: 1rem; 13275} 13276.gap-5 { 13277 gap: 1.25rem; 13278} 13279.gap-6 { 13280 gap: 1.5rem; 13281} 13282.gap-7 { 13283 gap: 1.75rem; 13284} 13285.gap-8 { 13286 gap: 2rem; 13287} 13288.gap-\\[\\.15em\\] { 13289 gap: .15em; 13290} 13291.gap-\\[\\.25em\\] { 13292 gap: .25em; 13293} 13294.gap-\\[\\.2em\\] { 13295 gap: .2em; 13296} 13297.gap-\\[\\.35em\\] { 13298 gap: .35em; 13299} 13300.gap-\\[\\.3em\\] { 13301 gap: .3em; 13302} 13303.gap-\\[\\.4em\\] { 13304 gap: .4em; 13305} 13306.gap-\\[\\.5em\\] { 13307 gap: .5em; 13308} 13309.gap-\\[\\.75em\\] { 13310 gap: .75em; 13311} 13312.gap-\\[0\\.35em\\] { 13313 gap: 0.35em; 13314} 13315.gap-\\[1px\\] { 13316 gap: 1px; 13317} 13318.gap-\\[2px\\] { 13319 gap: 2px; 13320} 13321.gap-\\[2rem\\] { 13322 gap: 2rem; 13323} 13324.gap-\\[3px\\] { 13325 gap: 3px; 13326} 13327.gap-x-1 { 13328 -moz-column-gap: 0.25rem; 13329 column-gap: 0.25rem; 13330} 13331.gap-x-10 { 13332 -moz-column-gap: 2.5rem; 13333 column-gap: 2.5rem; 13334} 13335.gap-x-12 { 13336 -moz-column-gap: 3rem; 13337 column-gap: 3rem; 13338} 13339.gap-x-2 { 13340 -moz-column-gap: 0.5rem; 13341 column-gap: 0.5rem; 13342} 13343.gap-x-3 { 13344 -moz-column-gap: 0.75rem; 13345 column-gap: 0.75rem; 13346} 13347.gap-x-4 { 13348 -moz-column-gap: 1rem; 13349 column-gap: 1rem; 13350} 13351.gap-x-5 { 13352 -moz-column-gap: 1.25rem; 13353 column-gap: 1.25rem; 13354} 13355.gap-x-6 { 13356 -moz-column-gap: 1.5rem; 13357 column-gap: 1.5rem; 13358} 13359.gap-x-8 { 13360 -moz-column-gap: 2rem; 13361 column-gap: 2rem; 13362} 13363.gap-x-9 { 13364 -moz-column-gap: 2.25rem; 13365 column-gap: 2.25rem; 13366} 13367.gap-x-\\[\\.35em\\] { 13368 -moz-column-gap: .35em; 13369 column-gap: .35em; 13370} 13371.gap-x-\\[\\.3em\\] { 13372 -moz-column-gap: .3em; 13373 column-gap: .3em; 13374} 13375.gap-x-\\[\\.5em\\] { 13376 -moz-column-gap: .5em; 13377 column-gap: .5em; 13378} 13379.gap-x-\\[\\.8em\\] { 13380 -moz-column-gap: .8em; 13381 column-gap: .8em; 13382} 13383.gap-x-\\[0\\.35em\\] { 13384 -moz-column-gap: 0.35em; 13385 column-gap: 0.35em; 13386} 13387.gap-x-\\[13px\\] { 13388 -moz-column-gap: 13px; 13389 column-gap: 13px; 13390} 13391.gap-x-\\[14px\\] { 13392 -moz-column-gap: 14px; 13393 column-gap: 14px; 13394} 13395.gap-x-\\[1em\\] { 13396 -moz-column-gap: 1em; 13397 column-gap: 1em; 13398} 13399.gap-x-\\[2\\.5rem\\] { 13400 -moz-column-gap: 2.5rem; 13401 column-gap: 2.5rem; 13402} 13403.gap-y-1 { 13404 row-gap: 0.25rem; 13405} 13406.gap-y-2 { 13407 row-gap: 0.5rem; 13408} 13409.gap-y-3 { 13410 row-gap: 0.75rem; 13411} 13412.gap-y-4 { 13413 row-gap: 1rem; 13414} 13415.gap-y-5 { 13416 row-gap: 1.25rem; 13417} 13418.gap-y-6 { 13419 row-gap: 1.5rem; 13420} 13421.gap-y-8 { 13422 row-gap: 2rem; 13423} 13424.gap-y-\\[\\.15em\\] { 13425 row-gap: .15em; 13426} 13427.gap-y-\\[\\.2em\\] { 13428 row-gap: .2em; 13429} 13430.gap-y-\\[\\.3em\\] { 13431 row-gap: .3em; 13432} 13433.gap-y-\\[0\\.125em\\] { 13434 row-gap: 0.125em; 13435} 13436.space-y-1 > :not([hidden]) ~ :not([hidden]) { 13437 --tw-space-y-reverse: 0; 13438 margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse))); 13439 margin-bottom: calc(0.25rem * var(--tw-space-y-reverse)); 13440} 13441.space-y-2 > :not([hidden]) ~ :not([hidden]) { 13442 --tw-space-y-reverse: 0; 13443 margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse))); 13444 margin-bottom: calc(0.5rem * var(--tw-space-y-reverse)); 13445} 13446.space-y-3 > :not([hidden]) ~ :not([hidden]) { 13447 --tw-space-y-reverse: 0; 13448 margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse))); 13449 margin-bottom: calc(0.75rem * var(--tw-space-y-reverse)); 13450} 13451.divide-x > :not([hidden]) ~ :not([hidden]) { 13452 --tw-divide-x-reverse: 0; 13453 border-right-width: calc(var(--sc-border-width) * var(--tw-divide-x-reverse)); 13454 border-left-width: calc(var(--sc-border-width) * calc(1 - var(--tw-divide-x-reverse))); 13455} 13456.divide-x-\\[1px\\] > :not([hidden]) ~ :not([hidden]) { 13457 --tw-divide-x-reverse: 0; 13458 border-right-width: calc(1px * var(--tw-divide-x-reverse)); 13459 border-left-width: calc(1px * calc(1 - var(--tw-divide-x-reverse))); 13460} 13461.divide-neutral-200 > :not([hidden]) ~ :not([hidden]) { 13462 border-color: var(--sc-base-200); 13463} 13464.self-auto { 13465 align-self: auto; 13466} 13467.self-start { 13468 align-self: flex-start; 13469} 13470.self-end { 13471 align-self: flex-end; 13472} 13473.self-center { 13474 align-self: center; 13475} 13476.self-stretch { 13477 align-self: stretch; 13478} 13479.justify-self-start { 13480 justify-self: start; 13481} 13482.justify-self-end { 13483 justify-self: end; 13484} 13485.justify-self-center { 13486 justify-self: center; 13487} 13488.overflow-auto { 13489 overflow: auto; 13490} 13491.overflow-hidden { 13492 overflow: hidden; 13493} 13494.overflow-clip { 13495 overflow: clip; 13496} 13497.\\!overflow-y-auto { 13498 overflow-y: auto !important; 13499} 13500.overflow-y-auto { 13501 overflow-y: auto; 13502} 13503.overflow-x-hidden { 13504 overflow-x: hidden; 13505} 13506.truncate { 13507 overflow: hidden; 13508 text-overflow: ellipsis; 13509 white-space: nowrap; 13510} 13511.text-ellipsis { 13512 text-overflow: ellipsis; 13513} 13514.whitespace-normal { 13515 white-space: normal; 13516} 13517.whitespace-nowrap { 13518 white-space: nowrap; 13519} 13520.whitespace-pre-line { 13521 white-space: pre-line; 13522} 13523.text-wrap { 13524 text-wrap: wrap; 13525} 13526.text-nowrap { 13527 text-wrap: nowrap; 13528} 13529.text-balance { 13530 text-wrap: balance; 13531} 13532.text-pretty { 13533 text-wrap: pretty; 13534} 13535.break-words { 13536 overflow-wrap: break-word; 13537} 13538.rounded { 13539 border-radius: var(--sc-rounded); 13540} 13541.rounded-\\[--sc-btn-rounded\\] { 13542 border-radius: var(--sc-btn-rounded); 13543} 13544.rounded-\\[\\.3rem\\] { 13545 border-radius: .3rem; 13546} 13547.rounded-\\[var\\(--sc-rounded\\)\\] { 13548 border-radius: var(--sc-rounded); 13549} 13550.rounded-full { 13551 border-radius: 9999px; 13552} 13553.rounded-lg { 13554 border-radius: var(--sc-rounded-lg); 13555} 13556.rounded-md { 13557 border-radius: var(--sc-rounded-md); 13558} 13559.rounded-sm { 13560 border-radius: var(--sc-rounded-sm); 13561} 13562.rounded-b-lg { 13563 border-bottom-right-radius: var(--sc-rounded-lg); 13564 border-bottom-left-radius: var(--sc-rounded-lg); 13565} 13566.rounded-b-md { 13567 border-bottom-right-radius: var(--sc-rounded-md); 13568 border-bottom-left-radius: var(--sc-rounded-md); 13569} 13570.rounded-t-lg { 13571 border-top-left-radius: var(--sc-rounded-lg); 13572 border-top-right-radius: var(--sc-rounded-lg); 13573} 13574.rounded-t-md { 13575 border-top-left-radius: var(--sc-rounded-md); 13576 border-top-right-radius: var(--sc-rounded-md); 13577} 13578.rounded-bl-lg { 13579 border-bottom-left-radius: var(--sc-rounded-lg); 13580} 13581.rounded-br-md { 13582 border-bottom-right-radius: var(--sc-rounded-md); 13583} 13584.rounded-tr-md { 13585 border-top-right-radius: var(--sc-rounded-md); 13586} 13587.border { 13588 border-width: var(--sc-border-width); 13589} 13590.border-0 { 13591 border-width: 0px; 13592} 13593.border-2 { 13594 border-width: 2px; 13595} 13596.border-b { 13597 border-bottom-width: var(--sc-border-width); 13598} 13599.border-b-\\[\\.3rem\\] { 13600 border-bottom-width: .3rem; 13601} 13602.border-b-\\[1px\\] { 13603 border-bottom-width: 1px; 13604} 13605.border-l { 13606 border-left-width: var(--sc-border-width); 13607} 13608.border-l-4 { 13609 border-left-width: 4px; 13610} 13611.border-l-\\[1px\\] { 13612 border-left-width: 1px; 13613} 13614.border-r { 13615 border-right-width: var(--sc-border-width); 13616} 13617.border-r-0 { 13618 border-right-width: 0px; 13619} 13620.border-r-4 { 13621 border-right-width: 4px; 13622} 13623.border-t { 13624 border-top-width: var(--sc-border-width); 13625} 13626.border-t-\\[1px\\] { 13627 border-top-width: 1px; 13628} 13629.border-solid { 13630 border-style: solid; 13631} 13632.border-dashed { 13633 border-style: dashed; 13634} 13635.border-dotted { 13636 border-style: dotted; 13637} 13638.border-\\[\\#c77dff\\] { 13639 --tw-border-opacity: 1; 13640 border-color: rgb(199 125 255 / var(--tw-border-opacity, 1)); 13641} 13642.border-\\[var\\(--sc-input-border-color\\2c var\\(--sc-base-content\\2c \\#000\\)\\)\\] { 13643 border-color: var(--sc-input-border-color,var(--sc-base-content,#000)); 13644} 13645.border-content { 13646 border-color: var(--sc-base-content); 13647} 13648.border-current { 13649 border-color: currentColor; 13650} 13651.border-neutral-0 { 13652 border-color: var(--sc-base); 13653} 13654.border-neutral-100 { 13655 border-color: var(--sc-base-100); 13656} 13657.border-neutral-200 { 13658 border-color: var(--sc-base-200); 13659} 13660.border-neutral-300 { 13661 border-color: var(--sc-base-300); 13662} 13663.border-neutral-50 { 13664 border-color: var(--sc-base-50); 13665} 13666.border-neutral-500 { 13667 border-color: var(--sc-base-500); 13668} 13669.border-neutral-900 { 13670 border-color: var(--sc-base-900); 13671} 13672.border-success { 13673 border-color: var(--sc-success); 13674} 13675.border-transparent { 13676 border-color: transparent; 13677} 13678.border-b-neutral-100 { 13679 border-bottom-color: var(--sc-base-100); 13680} 13681.border-b-neutral-300 { 13682 border-bottom-color: var(--sc-base-300); 13683} 13684.border-l-danger { 13685 border-left-color: var(--sc-danger); 13686} 13687.border-l-transparent { 13688 border-left-color: transparent; 13689} 13690.border-t-neutral-100 { 13691 border-top-color: var(--sc-base-100); 13692} 13693.border-t-neutral-200 { 13694 border-top-color: var(--sc-base-200); 13695} 13696.bg-\\[\\#1e1e1e\\] { 13697 --tw-bg-opacity: 1; 13698 background-color: rgb(30 30 30 / var(--tw-bg-opacity, 1)); 13699} 13700.bg-\\[\\#222\\] { 13701 --tw-bg-opacity: 1; 13702 background-color: rgb(34 34 34 / var(--tw-bg-opacity, 1)); 13703} 13704.bg-\\[color-mix\\(in_srgb\\2c _var\\(--sc-danger\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 13705 background-color: color-mix(in srgb, var(--sc-danger) 15%, var(--sc-base)); 13706} 13707.bg-\\[color-mix\\(in_srgb\\2c _var\\(--sc-info\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 13708 background-color: color-mix(in srgb, var(--sc-info) 15%, var(--sc-base)); 13709} 13710.bg-\\[color-mix\\(in_srgb\\2c _var\\(--sc-success\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 13711 background-color: color-mix(in srgb, var(--sc-success) 15%, var(--sc-base)); 13712} 13713.bg-\\[color-mix\\(in_srgb\\2c _var\\(--sc-warning\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 13714 background-color: color-mix(in srgb, var(--sc-warning) 15%, var(--sc-base)); 13715} 13716.bg-\\[var\\(--sc-base\\)\\] { 13717 background-color: var(--sc-base); 13718} 13719.bg-\\[yellow\\] { 13720 --tw-bg-opacity: 1; 13721 background-color: rgb(255 255 0 / var(--tw-bg-opacity, 1)); 13722} 13723.bg-content { 13724 background-color: var(--sc-base-content); 13725} 13726.bg-contrast { 13727 background-color: var(--sc-contrast); 13728} 13729.bg-current { 13730 background-color: currentColor; 13731} 13732.bg-danger { 13733 background-color: var(--sc-danger); 13734} 13735.bg-info { 13736 background-color: var(--sc-info); 13737} 13738.bg-neutral-0 { 13739 background-color: var(--sc-base); 13740} 13741.bg-neutral-100 { 13742 background-color: var(--sc-base-100); 13743} 13744.bg-neutral-200 { 13745 background-color: var(--sc-base-200); 13746} 13747.bg-neutral-300 { 13748 background-color: var(--sc-base-300); 13749} 13750.bg-neutral-50 { 13751 background-color: var(--sc-base-50); 13752} 13753.bg-success { 13754 background-color: var(--sc-success); 13755} 13756.bg-warning { 13757 background-color: var(--sc-warning); 13758} 13759.bg-gradient-to-br { 13760 background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); 13761} 13762.bg-gradient-to-r { 13763 background-image: linear-gradient(to right, var(--tw-gradient-stops)); 13764} 13765.bg-gradient-to-t { 13766 background-image: linear-gradient(to top, var(--tw-gradient-stops)); 13767} 13768.from-\\[\\#e10057\\] { 13769 --tw-gradient-from: #e10057 var(--tw-gradient-from-position); 13770 --tw-gradient-to: rgb(225 0 87 / 0) var(--tw-gradient-to-position); 13771 --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); 13772} 13773.from-\\[rgba\\(0\\2c 0\\2c 0\\2c \\.25\\)\\] { 13774 --tw-gradient-from: rgba(0,0,0,.25) var(--tw-gradient-from-position); 13775 --tw-gradient-to: rgba(0, 0, 0, 0) var(--tw-gradient-to-position); 13776 --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); 13777} 13778.to-\\[\\#4f0090\\] { 13779 --tw-gradient-to: #4f0090 var(--tw-gradient-to-position); 13780} 13781.to-\\[rgba\\(0\\2c 0\\2c 0\\2c 0\\)\\] { 13782 --tw-gradient-to: rgba(0,0,0,0) var(--tw-gradient-to-position); 13783} 13784.fill-current { 13785 fill: currentColor; 13786} 13787.object-contain { 13788 -o-object-fit: contain; 13789 object-fit: contain; 13790} 13791.object-cover { 13792 -o-object-fit: cover; 13793 object-fit: cover; 13794} 13795.object-center { 13796 -o-object-position: center; 13797 object-position: center; 13798} 13799.p-0 { 13800 padding: 0px; 13801} 13802.p-1 { 13803 padding: 0.25rem; 13804} 13805.p-2 { 13806 padding: 0.5rem; 13807} 13808.p-2\\.5 { 13809 padding: 0.625rem; 13810} 13811.p-3 { 13812 padding: 0.75rem; 13813} 13814.p-4 { 13815 padding: 1rem; 13816} 13817.p-5 { 13818 padding: 1.25rem; 13819} 13820.p-6 { 13821 padding: 1.5rem; 13822} 13823.p-8 { 13824 padding: 2rem; 13825} 13826.p-\\[10px\\] { 13827 padding: 10px; 13828} 13829.p-\\[12px\\] { 13830 padding: 12px; 13831} 13832.p-\\[15px\\] { 13833 padding: 15px; 13834} 13835.p-\\[2px\\] { 13836 padding: 2px; 13837} 13838.p-\\[clamp\\(0\\.5rem\\2c 5\\%\\2c 1\\.5rem\\)\\] { 13839 padding: clamp(0.5rem, 5%, 1.5rem); 13840} 13841.p-cgx { 13842 padding: var(--sc-container-gutter-x); 13843} 13844.px-0 { 13845 padding-left: 0px; 13846 padding-right: 0px; 13847} 13848.px-1 { 13849 padding-left: 0.25rem; 13850 padding-right: 0.25rem; 13851} 13852.px-10 { 13853 padding-left: 2.5rem; 13854 padding-right: 2.5rem; 13855} 13856.px-2 { 13857 padding-left: 0.5rem; 13858 padding-right: 0.5rem; 13859} 13860.px-2\\.5 { 13861 padding-left: 0.625rem; 13862 padding-right: 0.625rem; 13863} 13864.px-3 { 13865 padding-left: 0.75rem; 13866 padding-right: 0.75rem; 13867} 13868.px-4 { 13869 padding-left: 1rem; 13870 padding-right: 1rem; 13871} 13872.px-5 { 13873 padding-left: 1.25rem; 13874 padding-right: 1.25rem; 13875} 13876.px-6 { 13877 padding-left: 1.5rem; 13878 padding-right: 1.5rem; 13879} 13880.px-8 { 13881 padding-left: 2rem; 13882 padding-right: 2rem; 13883} 13884.px-\\[\\.35em\\] { 13885 padding-left: .35em; 13886 padding-right: .35em; 13887} 13888.px-\\[5vw\\] { 13889 padding-left: 5vw; 13890 padding-right: 5vw; 13891} 13892.px-cgx { 13893 padding-left: var(--sc-container-gutter-x); 13894 padding-right: var(--sc-container-gutter-x); 13895} 13896.py-0 { 13897 padding-top: 0px; 13898 padding-bottom: 0px; 13899} 13900.py-1 { 13901 padding-top: 0.25rem; 13902 padding-bottom: 0.25rem; 13903} 13904.py-1\\.5 { 13905 padding-top: 0.375rem; 13906 padding-bottom: 0.375rem; 13907} 13908.py-12 { 13909 padding-top: 3rem; 13910 padding-bottom: 3rem; 13911} 13912.py-16 { 13913 padding-top: 4rem; 13914 padding-bottom: 4rem; 13915} 13916.py-2 { 13917 padding-top: 0.5rem; 13918 padding-bottom: 0.5rem; 13919} 13920.py-3 { 13921 padding-top: 0.75rem; 13922 padding-bottom: 0.75rem; 13923} 13924.py-4 { 13925 padding-top: 1rem; 13926 padding-bottom: 1rem; 13927} 13928.py-5 { 13929 padding-top: 1.25rem; 13930 padding-bottom: 1.25rem; 13931} 13932.py-6 { 13933 padding-top: 1.5rem; 13934 padding-bottom: 1.5rem; 13935} 13936.py-8 { 13937 padding-top: 2rem; 13938 padding-bottom: 2rem; 13939} 13940.py-\\[--sc-header-gy\\] { 13941 padding-top: var(--sc-header-gy); 13942 padding-bottom: var(--sc-header-gy); 13943} 13944.py-\\[1px\\] { 13945 padding-top: 1px; 13946 padding-bottom: 1px; 13947} 13948.py-\\[2em\\] { 13949 padding-top: 2em; 13950 padding-bottom: 2em; 13951} 13952.py-\\[2px\\] { 13953 padding-top: 2px; 13954 padding-bottom: 2px; 13955} 13956.py-\\[3px\\] { 13957 padding-top: 3px; 13958 padding-bottom: 3px; 13959} 13960.py-\\[4px\\] { 13961 padding-top: 4px; 13962 padding-bottom: 4px; 13963} 13964.py-\\[max\\(1\\.5\\%\\2c \\.5rem\\)\\] { 13965 padding-top: max(1.5%, .5rem); 13966 padding-bottom: max(1.5%, .5rem); 13967} 13968.py-cgy { 13969 padding-top: var(--sc-container-gutter-y); 13970 padding-bottom: var(--sc-container-gutter-y); 13971} 13972.pb-1 { 13973 padding-bottom: 0.25rem; 13974} 13975.pb-2 { 13976 padding-bottom: 0.5rem; 13977} 13978.pb-20 { 13979 padding-bottom: 5rem; 13980} 13981.pb-3 { 13982 padding-bottom: 0.75rem; 13983} 13984.pb-4 { 13985 padding-bottom: 1rem; 13986} 13987.pb-5 { 13988 padding-bottom: 1.25rem; 13989} 13990.pb-6 { 13991 padding-bottom: 1.5rem; 13992} 13993.pb-8 { 13994 padding-bottom: 2rem; 13995} 13996.pl-1 { 13997 padding-left: 0.25rem; 13998} 13999.pl-2 { 14000 padding-left: 0.5rem; 14001} 14002.pl-3 { 14003 padding-left: 0.75rem; 14004} 14005.pl-4 { 14006 padding-left: 1rem; 14007} 14008.pl-5 { 14009 padding-left: 1.25rem; 14010} 14011.pl-6 { 14012 padding-left: 1.5rem; 14013} 14014.pl-cgx { 14015 padding-left: var(--sc-container-gutter-x); 14016} 14017.pr-1 { 14018 padding-right: 0.25rem; 14019} 14020.pr-12 { 14021 padding-right: 3rem; 14022} 14023.pr-2 { 14024 padding-right: 0.5rem; 14025} 14026.pr-3 { 14027 padding-right: 0.75rem; 14028} 14029.pr-4 { 14030 padding-right: 1rem; 14031} 14032.pr-5 { 14033 padding-right: 1.25rem; 14034} 14035.pr-6 { 14036 padding-right: 1.5rem; 14037} 14038.pr-8 { 14039 padding-right: 2rem; 14040} 14041.pr-\\[var\\(--publication-size\\)\\] { 14042 padding-right: var(--publication-size); 14043} 14044.pt-1 { 14045 padding-top: 0.25rem; 14046} 14047.pt-2 { 14048 padding-top: 0.5rem; 14049} 14050.pt-3 { 14051 padding-top: 0.75rem; 14052} 14053.pt-4 { 14054 padding-top: 1rem; 14055} 14056.pt-5 { 14057 padding-top: 1.25rem; 14058} 14059.pt-8 { 14060 padding-top: 2rem; 14061} 14062.pt-\\[\\.1em\\] { 14063 padding-top: .1em; 14064} 14065.text-left { 14066 text-align: left; 14067} 14068.text-center { 14069 text-align: center; 14070} 14071.text-right { 14072 text-align: right; 14073} 14074.align-baseline { 14075 vertical-align: baseline; 14076} 14077.align-middle { 14078 vertical-align: middle; 14079} 14080.font-headings { 14081 font-family: var(--sc-headings-font-family); 14082} 14083.font-mono { 14084 font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 14085} 14086.font-monospace { 14087 font-family: var(--sc-font-family-monospace, monospace); 14088} 14089.text-2xl { 14090 font-size: 1.5rem; 14091} 14092.text-2xs { 14093 font-size: 0.70rem; 14094} 14095.text-3xl { 14096 font-size: 1.875rem; 14097} 14098.text-4xl { 14099 font-size: 2.25rem; 14100} 14101.text-6xl { 14102 font-size: 3.75rem; 14103} 14104.text-\\[\\.75em\\] { 14105 font-size: .75em; 14106} 14107.text-\\[\\.78rem\\] { 14108 font-size: .78rem; 14109} 14110.text-\\[\\.7em\\] { 14111 font-size: .7em; 14112} 14113.text-\\[\\.82em\\] { 14114 font-size: .82em; 14115} 14116.text-\\[\\.85em\\] { 14117 font-size: .85em; 14118} 14119.text-\\[\\.85rem\\] { 14120 font-size: .85rem; 14121} 14122.text-\\[\\.8em\\] { 14123 font-size: .8em; 14124} 14125.text-\\[\\.8rem\\] { 14126 font-size: .8rem; 14127} 14128.text-\\[\\.9em\\] { 14129 font-size: .9em; 14130} 14131.text-\\[\\.9rem\\] { 14132 font-size: .9rem; 14133} 14134.text-\\[1\\.125em\\] { 14135 font-size: 1.125em; 14136} 14137.text-\\[1\\.15em\\] { 14138 font-size: 1.15em; 14139} 14140.text-\\[1\\.1em\\] { 14141 font-size: 1.1em; 14142} 14143.text-\\[1\\.2em\\] { 14144 font-size: 1.2em; 14145} 14146.text-\\[1\\.35rem\\] { 14147 font-size: 1.35rem; 14148} 14149.text-\\[1\\.3em\\] { 14150 font-size: 1.3em; 14151} 14152.text-\\[1\\.5em\\] { 14153 font-size: 1.5em; 14154} 14155.text-\\[1\\.5rem\\] { 14156 font-size: 1.5rem; 14157} 14158.text-\\[1\\.6em\\] { 14159 font-size: 1.6em; 14160} 14161.text-\\[1\\.8em\\] { 14162 font-size: 1.8em; 14163} 14164.text-\\[10px\\] { 14165 font-size: 10px; 14166} 14167.text-\\[11px\\] { 14168 font-size: 11px; 14169} 14170.text-\\[1em\\] { 14171 font-size: 1em; 14172} 14173.text-\\[2\\.25em\\] { 14174 font-size: 2.25em; 14175} 14176.text-\\[2\\.2em\\] { 14177 font-size: 2.2em; 14178} 14179.text-\\[40cqw\\] { 14180 font-size: 40cqw; 14181} 14182.text-\\[4rem\\] { 14183 font
14183-size: 4rem; 14184} 14185.text-\\[max\\(\\.65rem\\2c 10px\\)\\] { 14186 font-size: max(.65rem, 10px); 14187} 14188.text-\\[max\\(12px\\2c \\.8em\\)\\] { 14189 font-size: max(12px, .8em); 14190} 14191.text-\\[max\\(16px\\2c 1em\\)\\] { 14192 font-size: max(16px, 1em); 14193} 14194.text-base { 14195 font-size: 1rem; 14196} 14197.text-lg { 14198 font-size: 1.125rem; 14199} 14200.text-sm { 14201 font-size: 0.875rem; 14202} 14203.text-xl { 14204 font-size: 1.25rem; 14205} 14206.text-xs { 14207 font-size: 0.75rem; 14208} 14209.font-bold { 14210 font-weight: 700; 14211} 14212.font-extrabold { 14213 font-weight: 800; 14214} 14215.font-headings { 14216 font-weight: var(--sc-headings-font-weight); 14217} 14218.font-medium { 14219 font-weight: 500; 14220} 14221.font-normal { 14222 font-weight: 400; 14223} 14224.font-semibold { 14225 font-weight: 600; 14226} 14227.uppercase { 14228 text-transform: uppercase; 14229} 14230.lowercase { 14231 text-transform: lowercase; 14232} 14233.capitalize { 14234 text-transform: capitalize; 14235} 14236.normal-case { 14237 text-transform: none; 14238} 14239.italic { 14240 font-style: italic; 14241} 14242.leading-\\[1\\.1\\] { 14243 line-height: 1.1; 14244} 14245.leading-none { 14246 line-height: 1; 14247} 14248.leading-relaxed { 14249 line-height: 1.625; 14250} 14251.leading-snug { 14252 line-height: 1.375; 14253} 14254.leading-tight { 14255 line-height: 1.25; 14256} 14257.leading-tighter { 14258 line-height: 1.15; 14259} 14260.tracking-normal { 14261 letter-spacing: 0em; 14262} 14263.tracking-tight { 14264 letter-spacing: -0.025em; 14265} 14266.tracking-tighter { 14267 letter-spacing: -0.05em; 14268} 14269.tracking-wide { 14270 letter-spacing: 0.025em; 14271} 14272.tracking-wider { 14273 letter-spacing: 0.05em; 14274} 14275.tracking-widest { 14276 letter-spacing: 0.1em; 14277} 14278.text-\\[\\#222222\\] { 14279 --tw-text-opacity: 1; 14280 color: rgb(34 34 34 / var(--tw-text-opacity, 1)); 14281} 14282.text-\\[\\#4fc1ff\\] { 14283 --tw-text-opacity: 1; 14284 color: rgb(79 193 255 / var(--tw-text-opacity, 1)); 14285} 14286.text-\\[\\#9cdcfe\\] { 14287 --tw-text-opacity: 1; 14288 color: rgb(156 220 254 / var(--tw-text-opacity, 1)); 14289} 14290.text-\\[\\#b5cea8\\] { 14291 --tw-text-opacity: 1; 14292 color: rgb(181 206 168 / var(--tw-text-opacity, 1)); 14293} 14294.text-\\[\\#c586c0\\] { 14295 --tw-text-opacity: 1; 14296 color: rgb(197 134 192 / var(--tw-text-opacity, 1)); 14297} 14298.text-\\[\\#ce9178\\] { 14299 --tw-text-opacity: 1; 14300 color: rgb(206 145 120 / var(--tw-text-opacity, 1)); 14301} 14302.text-\\[\\#f92672\\] { 14303 --tw-text-opacity: 1; 14304 color: rgb(249 38 114 / var(--tw-text-opacity, 1)); 14305} 14306.text-\\[color-mix\\(in_srgb\\2c _var\\(--sc-danger\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 14307 color: color-mix(in srgb, var(--sc-danger) 15%, var(--sc-base)); 14308} 14309.text-\\[color-mix\\(in_srgb\\2c _var\\(--sc-info\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 14310 color: color-mix(in srgb, var(--sc-info) 15%, var(--sc-base)); 14311} 14312.text-\\[tomato\\] { 14313 --tw-text-opacity: 1; 14314 color: rgb(255 99 71 / var(--tw-text-opacity, 1)); 14315} 14316.text-\\[var\\(--sc-base-content\\2c \\#000\\)\\] { 14317 color: var(--sc-base-content,#000); 14318} 14319.text-content { 14320 color: var(--sc-base-content); 14321} 14322.text-contrast-content { 14323 color: var(--sc-contrast-content); 14324} 14325.text-current { 14326 color: currentColor; 14327} 14328.text-danger { 14329 color: var(--sc-danger); 14330} 14331.text-danger-content { 14332 color: var(--sc-danger-content); 14333} 14334.text-info { 14335 color: var(--sc-info); 14336} 14337.text-info-content { 14338 color: var(--sc-info-content); 14339} 14340.text-neutral-0 { 14341 color: var(--sc-base); 14342} 14343.text-neutral-200 { 14344 color: var(--sc-base-200); 14345} 14346.text-neutral-300 { 14347 color: var(--sc-base-300); 14348} 14349.text-neutral-400 { 14350 color: var(--sc-base-400); 14351} 14352.text-neutral-500 { 14353 color: var(--sc-base-500); 14354} 14355.text-neutral-600 { 14356 color: var(--sc-base-600); 14357} 14358.text-neutral-700 { 14359 color: var(--sc-base-700); 14360} 14361.text-neutral-800 { 14362 color: var(--sc-base-800); 14363} 14364.text-neutral-900 { 14365 color: var(--sc-base-900); 14366} 14367.text-primary { 14368 color: var(--sc-primary); 14369} 14370.text-success { 14371 color: var(--sc-success); 14372} 14373.text-success-content { 14374 color: var(--sc-success-content); 14375} 14376.text-warning { 14377 color: var(--sc-warning); 14378} 14379.underline { 14380 text-decoration-line: underline; 14381} 14382.no-underline { 14383 text-decoration-line: none; 14384} 14385.underline-offset-2 { 14386 text-underline-offset: 2px; 14387} 14388.opacity-0 { 14389 opacity: 0; 14390} 14391.opacity-100 { 14392 opacity: 1; 14393} 14394.opacity-20 { 14395 opacity: 0.2; 14396} 14397.opacity-30 { 14398 opacity: 0.3; 14399} 14400.opacity-40 { 14401 opacity: 0.4; 14402} 14403.opacity-50 { 14404 opacity: 0.5; 14405} 14406.opacity-60 { 14407 opacity: 0.6; 14408} 14409.opacity-75 { 14410 opacity: 0.75; 14411} 14412.opacity-80 { 14413 opacity: 0.8; 14414} 14415.opacity-\\[\\.1\\] { 14416 opacity: .1; 14417} 14418.mix-blend-multiply { 14419 mix-blend-mode: multiply; 14420} 14421.shadow { 14422 --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
14423 --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); 14424 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14425} 14426.shadow-\\[0_-1rem_1rem_-1rem_rgba\\(0\\2c 0\\2c 0\\2c 0\\.1\\)\\] { 14427 --tw-shadow: 0 -1rem 1rem -1rem rgba(0,0,0,0.1); 14428 --tw-shadow-colored: 0 -1rem 1rem -1rem var(--tw-shadow-color); 14429 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14430} 14431.shadow-\\[0_-4px_16px_rgba\\(0\\2c 0\\2c 0\\2c 0\\.08\\)\\] { 14432 --tw-shadow: 0 -4px 16px rgba(0,0,0,0.08); 14433 --tw-shadow-colored: 0 -4px 16px var(--tw-shadow-color); 14434 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14435} 14436.shadow-\\[0_0_0_2px_var\\(--sc-base\\)\\] { 14437 --tw-shadow: 0 0 0 2px var(--sc-base); 14438 --tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color); 14439 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14440} 14441.shadow-\\[0_40px_50px_-70px_rgb\\(0_0_0_\\/_0\\.35\\)\\] { 14442 --tw-shadow: 0 40px 50px -70px rgb(0 0 0 / 0.35);
14443 --tw-shadow-colored: 0 40px 50px -70px var(--tw-shadow-color); 14444 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14445} 14446.shadow-lg { 14447 --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 14448 --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); 14449 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14450} 14451.shadow-md { 14452 --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); 14453 --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color); 14454 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14455} 14456.shadow-sm { 14457 --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 14458 --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color); 14459 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14460} 14461.outline { 14462 outline-style: solid; 14463} 14464.blur { 14465 --tw-blur: blur(8px); 14466 filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); 14467} 14468.blur-2xl { 14469 --tw-blur: blur(40px); 14470 filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); 14471} 14472.drop-shadow-lg { 14473 --tw-drop-shadow: drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1)); 14474 filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); 14475} 14476.drop-shadow-md { 14477 --tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06)); 14478 filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); 14479} 14480.invert { 14481 --tw-invert: invert(100%); 14482 filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); 14483} 14484.\\!filter { 14485 filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important; 14486} 14487.filter { 14488 filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); 14489} 14490.backdrop-blur { 14491 --tw-backdrop-blur: blur(8px); 14492 backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); 14493} 14494.transition { 14495 transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; 14496 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14497 transition-duration: 150ms; 14498} 14499.transition-\\[boxShadow_\\.2s\\] { 14500 transition-property: boxShadow .2s; 14501 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14502 transition-duration: 150ms; 14503} 14504.transition-all { 14505 transition-property: all; 14506 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14507 transition-duration: 150ms; 14508} 14509.transition-colors { 14510 transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; 14511 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14512 transition-duration: 150ms; 14513} 14514.transition-opacity { 14515 transition-property: opacity; 14516 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14517 transition-duration: 150ms; 14518} 14519.transition-transform { 14520 transition-property: transform; 14521 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14522 transition-duration: 150ms; 14523} 14524.delay-200 { 14525 transition-delay: 200ms; 14526} 14527.delay-\\[160ms\\] { 14528 transition-delay: 160ms; 14529} 14530.delay-\\[80ms\\] { 14531 transition-delay: 80ms; 14532} 14533.duration-100 { 14534 transition-duration: 100ms; 14535} 14536.duration-200 { 14537 transition-duration: 200ms; 14538} 14539.duration-300 { 14540 transition-duration: 300ms; 14541} 14542.duration-500 { 14543 transition-duration: 500ms; 14544} 14545.duration-75 { 14546 transition-duration: 75ms; 14547} 14548.duration-\\[400ms\\] { 14549 transition-duration: 400ms; 14550} 14551.ease-\\[cubic-bezier\\(0\\.16\\2c 0\\.69\\2c 0\\.54\\2c 1\\.15\\)\\] { 14552 transition-timing-function: cubic-bezier(0.16,0.69,0.54,1.15); 14553} 14554.ease-in-out { 14555 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14556} 14557.ease-linear { 14558 transition-timing-function: linear; 14559} 14560.ease-out { 14561 transition-timing-function: cubic-bezier(0, 0, 0.2, 1); 14562} 14563.will-change-transform { 14564 will-change: transform; 14565} 14566.\\@container { 14567 container-type: inline-size; 14568} 14569.\\[display\\:none\\] { 14570 display: none; 14571} 14572 14573.prose-xs svg[height="24"][width="24"], 14574.prose-sm svg[height="24"][width="24"], 14575.prose svg[height="24"][width="24"] { 14576 width: 1em; 14577 display: inline-block; 14578 height: 1em; 14579 vertical-align: -0.25em; 14580} 14581 14582@media (min-width: 1024px) { 14583 14584 .lg\\:prose-lg { 14585 font-size: 1.125rem; 14586 line-height: 1.7777778; 14587 } 14588 14589 .lg\\:prose-lg :where(p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14590 margin-top: 1.3333333em; 14591 margin-bottom: 1.3333333em; 14592 } 14593 14594 .lg\\:prose-lg :where([class~="lead"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14595 font-size: 1.2222222em; 14596 line-height: 1.4545455; 14597 margin-top: 1.0909091em; 14598 margin-bottom: 1.0909091em; 14599 } 14600 14601 .lg\\:prose-lg :where(blockquote):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14602 margin-top: 1.6666667em; 14603 margin-bottom: 1.6666667em; 14604 padding-inline-start: 1em; 14605 } 14606 14607 .lg\\:prose-lg :where(h1):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14608 font-size: 2.6666667em; 14609 margin-top: 0; 14610 margin-bottom: 0.8333333em; 14611 line-height: 1; 14612 } 14613 14614 .lg\\:prose-lg :where(h2):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14615 font-size: 1.6666667em; 14616 margin-top: 1.8666667em; 14617 margin-bottom: 1.0666667em; 14618 line-height: 1.3333333; 14619 } 14620 14621 .lg\\:prose-lg :where(h3):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14622 font-size: 1.3333333em; 14623 margin-top: 1.6666667em; 14624 margin-bottom: 0.6666667em; 14625 line-height: 1.5; 14626 } 14627 14628 .lg\\:prose-lg :where(h4):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14629 margin-top: 1.7777778em; 14630 margin-bottom: 0.4444444em; 14631 line-height: 1.5555556; 14632 } 14633 14634 .lg\\:prose-lg :where(img):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14635 margin-top: 1.7777778em; 14636 margin-bottom: 1.7777778em; 14637 } 14638 14639 .lg\\:prose-lg :where(picture):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14640 margin-top: 1.7777778em; 14641 margin-bottom: 1.7777778em; 14642 } 14643 14644 .lg\\:prose-lg :where(picture > img):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14645 margin-top: 0; 14646 margin-bottom: 0; 14647 } 14648 14649 .lg\\:prose-lg :where(video):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14650 margin-top: 1.7777778em; 14651 margin-bottom: 1.7777778em; 14652 } 14653 14654 .lg\\:prose-lg :where(kbd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14655 font-size: 0.8888889em; 14656 border-radius: 0.3125rem; 14657 padding-top: 0.2222222em; 14658 padding-inline-end: 0.4444444em; 14659 padding-bottom: 0.2222222em; 14660 padding-inline-start: 0.4444444em; 14661 } 14662 14663 .lg\\:prose-lg :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14664 font-size: 0.8888889em; 14665 } 14666 14667 .lg\\:prose-lg :where(h2 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14668 font-size: 0.8666667em; 14669 } 14670 14671 .lg\\:prose-lg :where(h3 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14672 font-size: 0.875em; 14673 } 14674 14675 .lg\\:prose-lg :where(pre):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14676 font-size: 0.8888889em; 14677 line-height: 1.75; 14678 margin-top: 2em; 14679 margin-bottom: 2em; 14680 border-radius: 0.375rem; 14681 padding-top: 1em; 14682 padding-inline-end: 1.5em; 14683 padding-bottom: 1em; 14684 padding-inline-start: 1.5em; 14685 } 14686 14687 .lg\\:prose-lg :where(ol):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14688 margin-top: 1.3333333em; 14689 margin-bottom: 1.3333333em; 14690 padding-inline-start: 1.5555556em; 14691 } 14692 14693 .lg\\:prose-lg :where(ul):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14694 margin-top: 1.3333333em; 14695 margin-bottom: 1.3333333em; 14696 padding-inline-start: 1.5555556em; 14697 } 14698 14699 .lg\\:prose-lg :where(li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14700 margin-top: 0.6666667em; 14701 margin-bottom: 0.6666667em; 14702 } 14703 14704 .lg\\:prose-lg :where(ol > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14705 padding-inline-start: 0.4444444em; 14706 } 14707 14708 .lg\\:prose-lg :where(ul > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14709 padding-inline-start: 0.4444444em; 14710 } 14711 14712 .lg\\:prose-lg :where(.lg\\:prose-lg > ul > li p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14713 margin-top: 0.8888889em; 14714 margin-bottom: 0.8888889em; 14715 } 14716 14717 .lg\\:prose-lg :where(.lg\\:prose-lg > ul > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14718 margin-top: 1.3333333em; 14719 } 14720 14721 .lg\\:prose-lg :where(.lg\\:prose-lg > ul > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14722 margin-bottom: 1.3333333em; 14723 } 14724 14725 .lg\\:prose-lg :where(.lg\\:prose-lg > ol > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14726 margin-top: 1.3333333em; 14727 } 14728 14729 .lg\\:prose-lg :where(.lg\\:prose-lg > ol > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14730 margin-bottom: 1.3333333em; 14731 } 14732 14733 .lg\\:prose-lg :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14734 margin-top: 0.8888889em; 14735 margin-bottom: 0.8888889em; 14736 } 14737 14738 .lg\\:prose-lg :where(dl):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14739 margin-top: 1.3333333em; 14740 margin-bottom: 1.3333333em; 14741 } 14742 14743 .lg\\:prose-lg :where(dt):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14744 margin-top: 1.3333333em; 14745 } 14746
14747 .lg\\:prose-lg :where(dd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14748 margin-top: 0.6666667em; 14749 padding-inline-start: 1.5555556em; 14750 } 14751 14752 .lg\\:prose-lg :where(hr):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14753 margin-top: 3.1111111em; 14754 margin-bottom: 3.1111111em; 14755 } 14756 14757 .lg\\:prose-lg :where(hr + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14758 margin-top: 0; 14759 } 14760 14761 .lg\\:prose-lg :where(h2 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14762 margin-top: 0; 14763 } 14764 14765 .lg\\:prose-lg :where(h3 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14766 margin-top: 0; 14767 } 14768 14769 .lg\\:prose-lg :where(h4 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14770 margin-top: 0; 14771 } 14772 14773 .lg\\:prose-lg :where(table):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14774 font-size: 0.8888889em; 14775 line-height: 1.5; 14776 } 14777 14778 .lg\\:prose-lg :where(thead th):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14779 padding-inline-end: 0.75em; 14780 padding-bottom: 0.75em; 14781 padding-inline-start: 0.75em; 14782 } 14783 14784 .lg\\:prose-lg :where(thead th:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14785 padding-inline-start: 0; 14786 } 14787 14788 .lg\\:prose-lg :where(thead th:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14789 padding-inline-end: 0; 14790 } 14791 14792 .lg\\:prose-lg :where(tbody td, tfoot td):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14793 padding-top: 0.75em; 14794 padding-inline-end: 0.75em; 14795 padding-bottom: 0.75em; 14796 padding-inline-start: 0.75em; 14797 } 14798 14799 .lg\\:prose-lg :where(tbody td:first-child, tfoot td:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14800 padding-inline-start: 0; 14801 } 14802 14803 .lg\\:prose-lg :where(tbody td:last-child, tfoot td:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14804 padding-inline-end: 0; 14805 } 14806 14807 .lg\\:prose-lg :where(figure):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14808 margin-top: 1.7777778em; 14809 margin-bottom: 1.7777778em; 14810 } 14811 14812 .lg\\:prose-lg :where(figure > *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14813 margin-top: 0; 14814 margin-bottom: 0; 14815 } 14816 14817 .lg\\:prose-lg :where(figcaption):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14818 font-size: 0.8888889em; 14819 line-height: 1.5; 14820 margin-top: 1em; 14821 } 14822 14823 .lg\\:prose-lg :where(.lg\\:prose-lg > :first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14824 margin-top: 0; 14825 } 14826 14827 .lg\\:prose-lg :where(.lg\\:prose-lg > :last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14828 margin-bottom: 0; 14829 } 14830} 14831 14832.before\\:content-\\[\\'\\25B8_\\'\\]::before { 14833 --tw-content: '⸠'; 14834 content: var(--tw-content); 14835} 14836 14837.hover\\:scale-110:hover { 14838 --tw-scale-x: 1.1; 14839 --tw-scale-y: 1.1; 14840 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 14841} 14842 14843.hover\\:scale-\\[\\.95\\]:hover { 14844 --tw-scale-x: .95; 14845 --tw-scale-y: .95; 14846 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 14847} 14848 14849.hover\\:scale-\\[103\\%\\]:hover { 14850 --tw-scale-x: 103%; 14851 --tw-scale-y: 103%; 14852 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 14853} 14854 14855.hover\\:border-neutral-200:hover { 14856 border-color: var(--sc-base-200); 14857} 14858 14859.hover\\:border-neutral-300:hover { 14860 border-color: var(--sc-base-300); 14861} 14862 14863.hover\\:border-neutral-400:hover { 14864 border-color: var(--sc-base-400); 14865} 14866 14867.hover\\:border-neutral-600:hover { 14868 border-color: var(--sc-base-600); 14869} 14870 14871.hover\\:bg-\\[rgba\\(0\\2c 0\\2c 0\\2c \\.02\\)\\]:hover { 14872 background-color: rgba(0,0,0,.02); 14873} 14874 14875.hover\\:bg-neutral-100:hover { 14876 background-color: var(--sc-base-100); 14877} 14878 14879.hover\\:bg-neutral-50:hover { 14880 background-color: var(--sc-base-50); 14881} 14882 14883.hover\\:bg-transparent:hover { 14884 background-color: transparent; 14885} 14886 14887.hover\\:text-current:hover {
14888 color: currentColor; 14889} 14890 14891.hover\\:text-neutral-600:hover { 14892 color: var(--sc-base-600); 14893} 14894 14895.hover\\:text-neutral-700:hover { 14896 color: var(--sc-base-700); 14897} 14898 14899.hover\\:text-neutral-800:hover { 14900 color: var(--sc-base-800); 14901} 14902 14903.hover\\:text-primary:hover { 14904 color: var(--sc-primary); 14905} 14906 14907.hover\\:underline:hover { 14908 text-decoration-line: underline; 14909} 14910 14911.hover\\:no-underline:hover { 14912 text-decoration-line: none; 14913} 14914 14915.hover\\:opacity-100:hover { 14916 opacity: 1; 14917} 14918 14919.hover\\:opacity-60:hover { 14920 opacity: 0.6; 14921} 14922 14923.hover\\:opacity-85:hover { 14924 opacity: 0.85; 14925} 14926 14927.hover\\:shadow:hover { 14928 --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); 14929 --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); 14930 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14931} 14932 14933.hover\\:shadow-\\[0_0_0_1px_rgba\\(0\\2c 0\\2c 0\\2c \\.02\\)\\]:hover { 14934 --tw-shadow: 0 0 0 1px rgba(0,0,0,.02); 14935 --tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color); 14936 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-sha
14936dow); 14937} 14938 14939.hover\\:shadow-\\[0_0_0_2px_var\\(--sc-base-50\\)\\]:hover { 14940 --tw-shadow: 0 0 0 2px var(--sc-base-50); 14941 --tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color); 14942 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14943} 14944 14945.hover\\:shadow-\\[0px_0px_0_3px_\\#ffb71d\\]:hover { 14946 --tw-shadow: 0px 0px 0 3px #ffb71d; 14947 --tw-shadow-colored: 0px 0px 0 3px var(--tw-shadow-color); 14948 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14949} 14950 14951.hover\\:shadow-lg:hover { 14952 --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 14953 --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); 14954 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14955} 14956 14957.hover\\:shadow-xl:hover { 14958 --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); 14959 --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-sha
14959dow-color); 14960 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14961} 14962 14963.focus\\:border-2:focus { 14964 border-width: 2px; 14965} 14966 14967.focus\\:border-neutral-300:focus { 14968 border-color: var(--sc-base-300); 14969} 14970 14971.focus\\:border-neutral-900:focus { 14972 border-color: var(--sc-base-900); 14973} 14974 14975.focus\\:opacity-100:focus { 14976 opacity: 1; 14977} 14978 14979.group:focus-within .group-focus-within\\:scale-110 { 14980 --tw-scale-x: 1.1; 14981 --tw-scale-y: 1.1; 14982 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 14983} 14984 14985.group:focus-within .group-focus-within\\:opacity-100 { 14986 opacity: 1; 14987} 14988 14989.group:hover .group-hover\\:inline-flex { 14990 display: inline-flex; 14991} 14992 14993.group:hover .group-hover\\:hidden { 14994 display: none; 14995} 14996 14997.group:hover .group-hover\\:scale-110 { 14998 --tw-scale-x: 1.1; 14999 --tw-scale-y: 1.1; 15000 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 15001} 15002 15003.group:hover .group-hover\\:scale-\\[1\\.15\\] { 15004 --tw-scale-x: 1.15; 15005 --tw-scale-y: 1.15; 15006 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 15007} 15008 15009.group:hover .group-hover\\:scale-\\[1\\.1\\] { 15010 --tw-scale-x: 1.1; 15011 --tw-scale-y: 1.1; 15012 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 15013} 15014 15015.group:hover .group-hover\\:border { 15016 border-width: var(--sc-border-width); 15017} 15018 15019.group:hover .group-hover\\:border-\\[\\#4f0090\\] { 15020 --tw-border-opacity: 1; 15021 border-color: rgb(79 0 144 / var(--tw-border-opacity, 1)); 15022} 15023 15024.group:hover .group-hover\\:border-\\[\\#ff9b85\\] { 15025 --tw-border-opacity: 1; 15026 border-color: rgb(255 155 133 / var(--tw-border-opacity, 1)); 15027} 15028 15029.group:hover .group-hover\\:border-neutral-200 { 15030 border-color: var(--sc-base-200); 15031} 15032 15033.group:hover .group-hover\\:text-neutral-500 { 15034 color: var(--sc-base-500); 15035} 15036 15037.group:hover .group-hover\\:underline { 15038 text-decoration-line: underline; 15039} 15040 15041.group:hover .group-hover\\:opacity-0 { 15042 opacity: 0; 15043} 15044 15045.group:hover .group-hover\\:opacity-100 { 15046 opacity: 1; 15047} 15048 15049.group:hover .group-hover\\:opacity-70 { 15050 opacity: 0.7; 15051} 15052 15053.group:focus .group-focus\\:border-neutral-300 { 15054 border-color: var(--sc-base-300); 15055} 15056 15057@container (min-width: 20rem) { 15058 15059 .\\@xs\\:left-5 { 15060 left: 1.25rem; 15061 } 15062 15063 .\\@xs\\:top-5 { 15064 top: 1.25rem; 15065 } 15066 15067 .\\@xs\\:inline-block { 15068 display: inline-block; 15069 } 15070 15071 .\\@xs\\:p-5 { 15072 padding: 1.25rem; 15073 } 15074 15075 .\\@xs\\:text-xl { 15076 font-size: 1.25rem; 15077 } 15078 15079 .\\@xs\\:leading-tight { 15080 line-height: 1.25; 15081 } 15082} 15083 15084@container (min-width: 24rem) { 15085 15086 .\\@sm\\:left-6 { 15087 left: 1.5rem; 15088 } 15089 15090 .\\@sm\\:top-6 { 15091 top: 1.5rem; 15092 } 15093 15094 .\\@sm\\:w-\\[12rem\\] { 15095 width: 12rem; 15096 } 15097 15098 .\\@sm\\:grid-cols-2 { 15099 grid-template-columns: repeat(2, minmax(0, 1fr)); 15100 } 15101 15102 .\\@sm\\:flex-row { 15103 flex-direction: row; 15104 } 15105 15106 .\\@sm\\:gap-2 { 15107 gap: 0.5rem; 15108 } 15109 15110 .\\@sm\\:rounded-lg { 15111 border-radius: var(--sc-rounded-lg); 15112 } 15113 15114 .\\@sm\\:border { 15115 border-width: var(--sc-border-width); 15116 } 15117 15118 .\\@sm\\:p-3 { 15119 padding: 0.75rem; 15120 } 15121 15122 .\\@sm\\:p-4 { 15123 padding: 1rem; 15124 } 15125 15126 .\\@sm\\:p-5 { 15127 padding: 1.25rem; 15128 } 15129 15130 .\\@sm\\:p-6 { 15131 padding: 1.5rem; 15132 } 15133 15134 .\\@sm\\:text-2xl { 15135 font-size: 1.5rem; 15136 } 15137 15138 .\\@sm\\:text-\\[4\\.75rem\\] { 15139 font-size: 4.75rem; 15140 } 15141 15142 .\\@sm\\:text-base { 15143 font-size: 1rem; 15144 } 15145 15146 .\\@sm\\:text-sm { 15147 font-size: 0.875rem; 15148 } 15149 15150 .\\@sm\\:leading-none { 15151 line-height: 1; 15152 } 15153 15154 .\\@sm\\:leading-tight { 15155 line-height: 1.25; 15156 } 15157 15158 .\\@sm\\:hover\\:border-neutral-300:hover { 15159 border-color: var(--sc-base-300); 15160 } 15161 15162 .\\@sm\\:focus\\:border-neutral-300:focus { 15163 border-color: var(--sc-base-300); 15164 } 15165} 15166 15167@container (min-width: 28rem) { 15168 15169 .\\@md\\:right-3 { 15170 right: 0.75rem; 15171 } 15172 15173 .\\@md\\:top-3 { 15174 top: 0.75rem; 15175 } 15176 15177 .\\@md\\:row-span-1 {
15178 grid-row: span 1 / span 1; 15179 } 15180 15181 .\\@md\\:block { 15182 display: block; 15183 } 15184 15185 .\\@md\\:inline-block { 15186 display: inline-block; 15187 } 15188 15189 .\\@md\\:flex { 15190 display: flex; 15191 } 15192 15193 .\\@md\\:hidden { 15194 display: none; 15195 } 15196 15197 .\\@md\\:w-1\\/3 { 15198 width: 33.333333%; 15199 } 15200 15201 .\\@md\\:w-1\\/4 { 15202 width: 25%; 15203 } 15204 15205 .\\@md\\:w-20 { 15206 width: 5rem; 15207 } 15208 15209 .\\@md\\:w-auto { 15210 width: auto; 15211 } 15212 15213 .\\@md\\:grid-cols-3 { 15214 grid-template-columns: repeat(3, minmax(0, 1fr)); 15215 } 15216 15217 .\\@md\\:grid-cols-\\[1fr\\2c 2\\.5rem\\] { 15218 grid-template-columns: 1fr 2.5rem; 15219 } 15220 15221 .\\@md\\:grid-cols-\\[6rem\\2c 1fr\\2c 2\\.5rem\\] { 15222 grid-template-columns: 6rem 1fr 2.5rem; 15223 } 15224 15225 .\\@md\\:grid-cols-\\[minmax\\(0\\2c 1fr\\)_10rem\\] { 15226 grid-template-columns: minmax(0,1fr) 10rem; 15227 } 15228 15229 .\\@md\\:grid-cols-\\[minmax\\(0\\2c _12rem\\)\\2c _minmax\\(0\\2c _3fr\\)\\] { 15230 grid-template-columns: minmax(0, 12rem) minmax(0, 3fr); 15231 } 15232 15233 .\\@md\\:gap-4 { 15234 gap: 1rem; 15235 } 15236 15237 .\\@md\\:border-l { 15238 border-left-width: var(--sc-border-width); 15239 } 15240 15241 .\\@md\\:border-l-neutral-200 { 15242 border-left-color: var(--sc-base-200); 15243 } 15244 15245 .\\@md\\:p-4 { 15246 padding: 1rem; 15247 } 15248 15249 .\\@md\\:p-6 { 15250 padding: 1.5rem; 15251 } 15252 15253 .\\@md\\:px-0 { 15254 padding-left: 0px; 15255 padding-right: 0px; 15256 } 15257 15258 .\\@md\\:py-2 { 15259 padding-top: 0.5rem; 15260 padding-bottom: 0.5rem; 15261 } 15262 15263 .\\@md\\:pl-3 { 15264 padding-left: 0.75rem; 15265 } 15266 15267 .\\@md\\:text-\\[\\.9rem\\] { 15268 font-size: .9rem; 15269 } 15270 15271 .\\@md\\:text-\\[1\\.05rem\\] { 15272 font-size: 1.05rem; 15273 } 15274 15275 .\\@md\\:text-base { 15276 font-size: 1rem; 15277 } 15278 15279 .\\@md\\:text-sm { 15280 font-size: 0.875rem; 15281 } 15282 15283 .\\@md\\:leading-none { 15284 line-height: 1; 15285 } 15286 15287 .\\@md\\:leading-tight { 15288 line-height: 1.25; 15289 } 15290} 15291 15292@container (min-width: 32rem) { 15293 15294 .\\@lg\\:col-start-1 { 15295 grid-column-start: 1; 15296 } 15297 15298 .\\@lg\\:ml-1 { 15299 margin-left: 0.25rem; 15300 } 15301 15302 .\\@lg\\:mt-0 { 15303 margin-top: 0px; 15304 } 15305 15306 .\\@lg\\:block { 15307 display: block; 15308 } 15309 15310 .\\@lg\\:inline-block { 15311 display: inline-block; 15312 } 15313 15314 .\\@lg\\:flex { 15315 display: flex; 15316 } 15317 15318 .\\@lg\\:grid { 15319 display: grid; 15320 } 15321 15322 .\\@lg\\:min-h-\\[2rem\\] { 15323 min-height: 2rem; 15324 } 15325 15326 .\\@lg\\:w-\\[12rem\\] { 15327 width: 12rem; 15328 } 15329 15330 .\\@lg\\:min-w-20 { 15331 min-width: 5rem; 15332 } 15333 15334 .\\@lg\\:min-w-\\[3ch\\] { 15335 min-width: 3ch; 15336 } 15337 15338 .\\@lg\\:min-w-\\[6ch\\] { 15339 min-width: 6ch; 15340 } 15341 15342 .\\@lg\\:min-w-\\[8\\.5ch\\] { 15343 min-width: 8.5ch; 15344 } 15345 15346 .\\@lg\\:grid-cols-2 { 15347 grid-template-columns: repeat(2, minmax(0, 1fr)); 15348 } 15349 15350 .\\@lg\\:grid-cols-3 { 15351 grid-template-columns: repeat(3, minmax(0, 1fr)); 15352 } 15353 15354 .\\@lg\\:grid-cols-5 { 15355 grid-template-columns: repeat(5, minmax(0, 1fr)); 15356 } 15357 15358 .\\@lg\\:flex-row { 15359 flex-direction: row; 15360 } 15361 15362 .\\@lg\\:flex-col { 15363 flex-direction: column; 15364 } 15365 15366 .\\@lg\\:flex-nowrap { 15367 flex-wrap: nowrap; 15368 } 15369 15370 .\\@lg\\:items-end { 15371 align-items: flex-end; 15372 } 15373 15374 .\\@lg\\:justify-center { 15375 justify-content: center; 15376 } 15377 15378 .\\@lg\\:gap-2 { 15379 gap: 0.5rem; 15380 } 15381 15382 .\\@lg\\:gap-x-3 { 15383 -moz-column-gap: 0.75rem; 15384 column-gap: 0.75rem; 15385 } 15386 15387 .\\@lg\\:px-4 { 15388 padding-left: 1rem; 15389 padding-right: 1rem; 15390 } 15391 15392 .\\@lg\\:pb-2 { 15393 padding-bottom: 0.5rem; 15394 } 15395 15396 .\\@lg\\:pr-2 { 15397 padding-right: 0.5rem; 15398 } 15399 15400 .\\@lg\\:text-left { 15401 text-align: left; 15402 } 15403 15404 .\\@lg\\:text-3xl { 15405 font-size: 1.875rem; 15406 } 15407 15408 .\\@lg\\:text-lg { 15409 font-size: 1.125rem; 15410 } 15411 15412 .\\@lg\\:text-sm { 15413 font-size: 0.875rem; 15414 } 15415 15416 .\\@lg\\:text-xs { 15417 font-size: 0.75rem; 15418 } 15419 15420 .\\@lg\\:leading-tight { 15421 line-height: 1.25; 15422 } 15423} 15424 15425@container (min-width: 36rem) { 15426 15427 .\\@xl\\:col-\\[2\\/-1\\] { 15428 grid-column: 2/-1; 15429 } 15430 15431 .\\@xl\\:col-auto { 15432 grid-column: auto; 15433 } 15434 15435 .\\@xl\\:col-span-1 { 15436 grid-column: span 1 / span 1; 15437 } 15438 15439 .\\@xl\\:col-span-2 { 15440 grid-column: span 2 / span 2; 15441 } 15442 15443 .\\@xl\\:mb-5 { 15444 margin-bottom: 1.25rem; 15445 } 15446 15447 .\\@xl\\:block { 15448 display: block; 15449 } 15450 15451 .\\@xl\\:inline-block { 15452 display: inline-block; 15453 } 15454 15455 .\\@xl\\:flex { 15456 display: flex; 15457 } 15458 15459 .\\@xl\\:grid { 15460 display: grid; 15461 } 15462 15463 .\\@xl\\:hidden { 15464 display: none; 15465 } 15466 15467 .\\@xl\\:w-14 { 15468 width: 3.5rem; 15469 } 15470 15471 .\\@xl\\:w-\\[15rem\\] { 15472 width: 15rem; 15473 } 15474 15475 .\\@xl\\:max-w-60 { 15476 max-width: 15rem; 15477 } 15478 15479 .\\@xl\\:max-w-\\[30rem\\] { 15480 max-width: 30rem; 15481 } 15482 15483 .\\@xl\\:grid-cols-2 { 15484 grid-template-columns: repeat(2, minmax(0, 1fr)); 15485 } 15486 15487 .\\@xl\\:grid-cols-3 { 15488 grid-template-columns: repeat(3, minmax(0, 1fr)); 15489 } 15490 15491 .\\@xl\\:grid-cols-\\[4rem\\2c 7\\.5rem\\2c 1fr\\2c 2\\.5rem\\] { 15492 grid-template-columns: 4rem 7.5rem 1fr 2.5rem; 15493 } 15494 15495 .\\@xl\\:grid-cols-\\[7\\.5rem\\2c 1fr\\2c 2\\.5rem\\] { 15496 grid-template-columns: 7.5rem 1fr 2.5rem; 15497 } 15498 15499 .\\@xl\\:grid-cols-\\[max\\(6rem\\2c _13\\%\\)_minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 1fr\\)\\] { 15500 grid-template-columns: max(6rem, 13%) minmax(0,1fr) minmax(0,1fr); 15501 } 15502 15503 .\\@xl\\:grid-cols-\\[minmax\\(0\\2c _12rem\\)\\2c _minmax\\(0\\2c _1fr\\)\\] { 15504 grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); 15505 } 15506 15507 .\\@xl\\:grid-rows-4 { 15508 grid-template-rows: repeat(4, minmax(0, 1fr)); 15509 } 15510 15511 .\\@xl\\:flex-row { 15512 flex-direction: row; 15513 } 15514 15515 .\\@xl\\:items-center {
15516 align-items: center; 15517 } 15518 15519 .\\@xl\\:gap-4 { 15520 gap: 1rem; 15521 } 15522 15523 .\\@xl\\:gap-6 { 15524 gap: 1.5rem; 15525 } 15526 15527 .\\@xl\\:gap-x-4 { 15528 -moz-column-gap: 1rem; 15529 column-gap: 1rem; 15530 } 15531 15532 .\\@xl\\:gap-y-7 { 15533 row-gap: 1.75rem; 15534 } 15535 15536 .\\@xl\\:border-none { 15537 border-style: none; 15538 } 15539 15540 .\\@xl\\:p-4 { 15541 padding: 1rem; 15542 } 15543 15544 .\\@xl\\:pl-3 { 15545 padding-left: 0.75rem; 15546 } 15547 15548 .\\@xl\\:pr-2 { 15549 padding-right: 0.5rem; 15550 } 15551 15552 .\\@xl\\:pt-0 { 15553 padding-top: 0px; 15554 } 15555 15556 .\\@xl\\:text-2xl { 15557 font-size: 1.5rem; 15558 } 15559 15560 .\\@xl\\:text-base { 15561 font-size: 1rem; 15562 } 15563 15564 .\\@xl\\:text-lg { 15565 font-size: 1.125rem; 15566 } 15567 15568 .\\@xl\\:text-sm { 15569 font-size: 0.875rem; 15570 } 15571 15572 .\\@xl\\:text-xl { 15573 font-size: 1.25rem; 15574 } 15575 15576 .\\@xl\\:leading-tight { 15577 line-height: 1.25; 15578 } 15579} 15580 15581@container (min-width: 42rem) { 15582 15583 .\\@2xl\\:mt-2 { 15584 margin-top: 0.5rem; 15585 } 15586 15587 .\\@2xl\\:block { 15588 display: block; 15589 } 15590 15591 .\\@2xl\\:flex { 15592 display: flex; 15593 } 15594 15595 .\\@2xl\\:hidden { 15596 display: none; 15597 } 15598 15599 .\\@2xl\\:grid-cols-2 { 15600 grid-template-columns: repeat(2, minmax(0, 1fr)); 15601 } 15602 15603 .\\@2xl\\:grid-cols-3 { 15604 grid-template-columns: repeat(3, minmax(0, 1fr)); 15605 } 15606 15607 .\\@2xl\\:grid-cols-\\[minmax\\(0\\2c _12rem\\)\\2c _minmax\\(0\\2c _1fr\\)\\] { 15608 grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); 15609 } 15610 15611 .\\@2xl\\:flex-nowrap { 15612 flex-wrap: nowrap; 15613 } 15614 15615 .\\@2xl\\:pl-6 { 15616 padding-left: 1.5rem; 15617 } 15618 15619 .\\@2xl\\:text-2xl { 15620 font-size: 1.5rem; 15621 } 15622 15623 .\\@2xl\\:text-xl { 15624 font-size: 1.25rem; 15625 } 15626} 15627 15628@container (min-width: 48rem) { 15629 15630 .\\@3xl\\:mb-3 { 15631 margin-bottom: 0.75rem; 15632 } 15633 15634 .\\@3xl\\:block { 15635 display: block; 15636 } 15637 15638 .\\@3xl\\:flex { 15639 display: flex; 15640 } 15641 15642 .\\@3xl\\:hidden { 15643 display: none; 15644 } 15645 15646 .\\@3xl\\:grid-cols-2 { 15647 grid-template-columns: repeat(2, minmax(0, 1fr)); 15648 } 15649 15650 .\\@3xl\\:grid-cols-3 { 15651 grid-template-columns: repeat(3, minmax(0, 1fr)); 15652 } 15653 15654 .\\@3xl\\:grid-cols-4 { 15655 grid-template-columns: repeat(4, minmax(0, 1fr)); 15656 } 15657 15658 .\\@3xl\\:grid-cols-\\[8\\.4rem_10rem_1fr_auto\\] { 15659 grid-template-columns: 8.4rem 10rem 1fr auto; 15660 } 15661 15662 .\\@3xl\\:grid-rows-2 { 15663 grid-template-rows: repeat(2, minmax(0, 1fr)); 15664 } 15665 15666 .\\@3xl\\:flex-row { 15667 flex-direction: row; 15668 } 15669 15670 .\\@3xl\\:justify-normal { 15671 justify-content: normal; 15672 } 15673 15674 .\\@3xl\\:gap-x-12 { 15675 -moz-column-gap: 3rem; 15676 column-gap: 3rem; 15677 } 15678 15679 .\\@3xl\\:gap-x-8 { 15680 -moz-column-gap: 2rem; 15681 column-gap: 2rem; 15682 } 15683 15684 .\\@3xl\\:gap-y-12 { 15685 row-gap: 3rem; 15686 } 15687 15688 .\\@3xl\\:pr-3 { 15689 padding-right: 0.75rem; 15690 } 15691 15692 .\\@3xl\\:text-3xl { 15693 font-size: 1.875rem; 15694 } 15695 15696 .\\@3xl\\:leading-tight { 15697 line-height: 1.25; 15698 } 15699} 15700 15701@container (min-width: 56rem) { 15702 15703 .\\@4xl\\:block { 15704 display: block; 15705 } 15706 15707 .\\@4xl\\:hidden { 15708 display: none; 15709 } 15710 15711 .\\@4xl\\:grid-cols-2 { 15712 grid-template-columns: repeat(2, minmax(0, 1fr)); 15713 } 15714 15715 .\\@4xl\\:grid-cols-\\[minmax\\(0\\2c 2fr\\)_minmax\\(0\\2c 1\\.2fr\\)\\] { 15716 grid-template-columns: minmax(0,2fr) minmax(0,1.2fr); 15717 } 15718 15719 .\\@4xl\\:gap-12 { 15720 gap: 3rem; 15721 } 15722} 15723 15724@container (min-width: 64rem) { 15725 15726 .\\@5xl\\:col-span-2 { 15727 grid-column: span 2 / span 2; 15728 } 15729 15730 .\\@5xl\\:block { 15731 display: block; 15732 } 15733 15734 .\\@5xl\\:flex { 15735 display: flex; 15736 } 15737 15738 .\\@5xl\\:grid-cols-2 { 15739 grid-template-columns: repeat(2, minmax(0, 1fr)); 15740 } 15741 15742 .\\@5xl\\:grid-cols-3 { 15743 grid-template-columns: repeat(3, minmax(0, 1fr)); 15744 } 15745 15746 .\\@5xl\\:grid-cols-\\[8\\.4rem_20rem_1fr_auto\\] { 15747 grid-template-columns: 8.4rem 20rem 1fr auto; 15748 } 15749 15750 .\\@5xl\\:grid-cols-\\[minmax\\(0\\2c 2fr\\)_minmax\\(0\\2c 1fr\\)\\] { 15751 grid-template-columns: minmax(0,2fr) minmax(0,1fr); 15752 } 15753 15754 .\\@5xl\\:grid-cols-\\[minmax\\(0\\2c _12rem\\)\\2c _auto\\2c _minmax\\(0\\2c _1fr\\)\\] { 15755 grid-template-columns: minmax(0, 12rem) auto minmax(0, 1fr); 15756 } 15757 15758 .\\@5xl\\:gap-7 { 15759 gap: 1.75rem; 15760 } 15761 15762 .\\@5xl\\:pl-4 { 15763 padding-left: 1rem; 15764 } 15765} 15766 15767@container (min-width: 72rem) { 15768 15769 .\\@6xl\\:grid-cols-3 { 15770 grid-template-columns: repeat(3, minmax(0, 1fr)); 15771 } 15772 15773 .\\@6xl\\:grid-cols-4 { 15774 grid-template-columns: repeat(4, minmax(0, 1fr)); 15775 } 15776} 15777 15778@container (min-width: 80rem) { 15779 15780 .\\@7xl\\:block { 15781 display: block; 15782 } 15783 15784 .\\@7xl\\:grid-cols-3 { 15785 grid-template-columns: repeat(3, minmax(0, 1fr)); 15786 } 15787} 15788 15789@container (min-width: 660px) { 15790 15791 .\\@\\[660px\\]\\:block { 15792 display: block; 15793 } 15794 15795 .\\@\\[660px\\]\\:gap-\\[13px\\] { 15796 gap: 13px; 15797 } 15798 15799 .\\@\\[660px\\]\\:gap-\\[14px\\] { 15800 gap: 14px; 15801 } 15802 15803 .\\@\\[660px\\]\\:p-\\[13px\\] { 15804 padding: 13px; 15805 } 15806 15807 .\\@\\[660px\\]\\:p-\\[14px\\] { 15808 padding: 14px; 15809 } 15810 15811 .\\@\\[660px\\]\\:px-0 { 15812 padding-left: 0px; 15813 padding-right: 0px; 15814 } 15815 15816 .\\@\\[660px\\]\\:py-1 { 15817 padding-top: 0.25rem; 15818 padding-bottom: 0.25rem; 15819 } 15820 15821 .\\@\\[660px\\]\\:text-\\[1\\.15em\\] { 15822 font-size: 1.15em; 15823 } 15824 15825 .\\@\\[660px\\]\\:text-\\[1em\\] { 15826 font-size: 1em; 15827 } 15828} 15829 15830@container (min-width: 1500px) { 15831 15832 .\\@\\[1500px\\]\\:grid-cols-2 { 15833 grid-template-columns: repeat(2, minmax(0, 1fr)); 15834 } 15835} 15836 15837@media (min-width: 640px) { 15838 15839 .sm\\:grid-cols-2 { 15840 grid-template-columns: repeat(2, minmax(0, 1fr)); 15841 } 15842 15843 .sm\\:flex-row { 15844 flex-direction: row; 15845 } 15846 15847 .sm\\:items-center {
15848 align-items: center; 15849 } 15850 15851 .sm\\:justify-between { 15852 justify-content: space-between; 15853 } 15854} 15855 15856@media (min-width: 768px) { 15857 15858 .md\\:mb-2 { 15859 margin-bottom: 0.5rem; 15860 } 15861 15862 .md\\:block { 15863 display: block; 15864 } 15865 15866 .md\\:w-auto { 15867 width: auto; 15868 } 15869 15870 .md\\:grid-cols-2 { 15871 grid-template-columns: repeat(2, minmax(0, 1fr)); 15872 } 15873 15874 .md\\:grid-cols-\\[1fr_9\\.75rem\\] { 15875 grid-template-columns: 1fr 9.75rem; 15876 } 15877 15878 .md\\:flex-row { 15879 flex-direction: row; 15880 } 15881 15882 .md\\:rounded-md { 15883 border-radius: var(--sc-rounded-md); 15884 } 15885 15886 .md\\:border { 15887 border-width: var(--sc-border-width); 15888 } 15889 15890 .md\\:px-2 { 15891 padding-left: 0.5rem; 15892 padding-right: 0.5rem; 15893 } 15894 15895 .md\\:pb-0 { 15896 padding-bottom: 0px; 15897 } 15898 15899 .md\\:pt-2 { 15900 padding-top: 0.5rem; 15901 } 15902 15903 .md\\:text-3xl { 15904 font-size: 1.875rem; 15905 } 15906 15907 .md\\:text-4xl { 15908 font-size: 2.25rem; 15909 } 15910 15911 .md\\:text-5xl { 15912 font-size: 3rem; 15913 } 15914 15915 .md\\:text-sm { 15916 font-size: 0.875rem; 15917 } 15918 15919 .md\\:leading-\\[1\\.1\\] { 15920 line-height: 1.1; 15921 } 15922} 15923 15924@media (min-width: 1024px) { 15925 15926 .lg\\:sticky { 15927 position: sticky; 15928 } 15929 15930 .lg\\:col-span-2 { 15931 grid-column: span 2 / span 2; 15932 } 15933 15934 .lg\\:col-span-4 { 15935 grid-column: span 4 / span 4; 15936 } 15937 15938 .lg\\:-mx-0 { 15939 margin-left: -0px; 15940 margin-right: -0px; 15941 } 15942 15943 .lg\\:mx-2 { 15944 margin-left: 0.5rem; 15945 margin-right: 0.5rem; 15946 } 15947 15948 .lg\\:my-2 { 15949 margin-top: 0.5rem; 15950 margin-bottom: 0.5rem; 15951 } 15952 15953 .lg\\:-mr-\\[calc\\(var\\(--sc-container-gutter-x\\)_-_var\\(--sc-container-gutter-y\\)\\)\\] { 15954 margin-right: calc(calc(var(--sc-container-gutter-x) - var(--sc-container-gutter-y)) * -1); 15955 } 15956 15957 .lg\\:-mt-0 { 15958 margin-top: -0px; 15959 } 15960 15961 .lg\\:mb-12 { 15962 margin-bottom: 3rem; 15963 } 15964 15965 .lg\\:mb-2 { 15966 margin-bottom: 0.5rem; 15967 } 15968 15969 .lg\\:mb-3 { 15970 margin-bottom: 0.75rem; 15971 } 15972 15973 .lg\\:mb-5 { 15974 margin-bottom: 1.25rem; 15975 } 15976 15977 .lg\\:mb-\\[2\\.5rem\\] { 15978 margin-bottom: 2.5rem; 15979 } 15980 15981 .lg\\:mr-3 { 15982 margin-right: 0.75rem; 15983 } 15984 15985 .lg\\:mt-16 { 15986 margin-top: 4rem; 15987 } 15988 15989 .lg\\:mt-8 { 15990 margin-top: 2rem; 15991 } 15992 15993 .lg\\:block { 15994 display: block; 15995 } 15996 15997 .lg\\:flex { 15998 display: flex; 15999 } 16000 16001 .lg\\:grid { 16002 display: grid; 16003 } 16004 16005 .lg\\:contents { 16006 display: contents; 16007 } 16008 16009 .lg\\:hidden { 16010 display: none; 16011 } 16012 16013 .lg\\:aspect-\\[16\\/9\\] { 16014 aspect-ratio: 16/9; 16015 } 16016 16017 .lg\\:h-\\[calc\\(100vh-4rem\\)\\] { 16018 height: calc(100vh - 4rem); 16019 } 16020 16021 .lg\\:h-full { 16022 height: 100%; 16023 } 16024 16025 .lg\\:max-h-\\[50vh\\] { 16026 max-height: 50vh; 16027 } 16028 16029 .lg\\:min-h-\\[calc\\(100vh_-_11rem\\)\\] { 16030 min-height: calc(100vh - 11rem); 16031 } 16032 16033 .lg\\:w-\\[25rem\\] { 16034 width: 25rem; 16035 } 16036 16037 .lg\\:w-auto { 16038 width: auto; 16039 } 16040 16041 .lg\\:min-w-\\[10rem\\] { 16042 min-width: 10rem; 16043 } 16044 16045 .lg\\:min-w-\\[11rem\\] { 16046 min-width: 11rem; 16047 } 16048 16049 .lg\\:min-w-\\[30rem\\] { 16050 min-width: 30rem; 16051 } 16052 16053 .lg\\:max-w-\\[15rem\\] { 16054 max-width: 15rem; 16055 } 16056 16057 .lg\\:max-w-\\[19ch\\] { 16058 max-width: 19ch; 16059 } 16060 16061 .lg\\:max-w-\\[25rem\\] { 16062 max-width: 25rem; 16063 } 16064 16065 .lg\\:max-w-\\[32rem\\] { 16066 max-width: 32rem; 16067 } 16068 16069 .lg\\:grow-0 { 16070 flex-grow: 0; 16071 } 16072 16073 .lg\\:grid-cols-2 { 16074 grid-template-columns: repeat(2, minmax(0, 1fr)); 16075 } 16076 16077 .lg\\:grid-cols-3 { 16078 grid-template-columns: repeat(3, minmax(0, 1fr)); 16079 } 16080 16081 .lg\\:grid-cols-4 { 16082 grid-template-columns: repeat(4, minmax(0, 1fr)); 16083 } 16084 16085 .lg\\:grid-cols-\\[1fr\\2c _2fr\\] { 16086 grid-template-columns: 1fr 2fr; 16087 } 16088 16089 .lg\\:grid-cols-\\[2fr_1fr\\] { 16090 grid-template-columns: 2fr 1fr; 16091 } 16092 16093 .lg\\:grid-cols-\\[minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 1\\.2fr\\)\\] { 16094 grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); 16095 } 16096 16097 .lg\\:grid-cols-\\[minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 1\\.5fr\\)\\] { 16098 grid-template-columns: minmax(0,1fr) minmax(0,1.5fr); 16099 } 16100 16101 .lg\\:grid-cols-\\[minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 10fr\\)\\] { 16102 grid-template-columns: minmax(0,1fr) minmax(0,10fr); 16103 } 16104 16105 .lg\\:grid-cols-\\[minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 1fr\\)\\] { 16106 grid-template-columns: minmax(0,1fr) minmax(0,1fr); 16107 } 16108 16109 .lg\\:grid-cols-\\[minmax\\(0\\2c 3fr\\)_minmax\\(0\\2c 1fr\\)\\] { 16110 grid-template-columns: minmax(0,3fr) minmax(0,1fr); 16111 } 16112 16113 .lg\\:grid-cols-\\[minmax\\(0\\2c 4fr\\)_16\\.2rem\\] { 16114 grid-template-columns: minmax(0,4fr) 16.2rem; 16115 } 16116 16117 .lg\\:grid-cols-\\[minmax\\(0\\2c 5fr\\)_minmax\\(0\\2c _1\\.75fr\\)\\] { 16118 grid-template-columns: minmax(0,5fr) minmax(0, 1.75fr); 16119 } 16120 16121 .lg\\:grid-cols-\\[minmax\\(0\\2c _3fr\\)_minmax\\(0\\2c _2fr\\)\\] { 16122 grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); 16123 } 16124 16125 .lg\\:grid-cols-\\[minmax\\(0\\2c _5fr\\)_minmax\\(0\\2c _3\\.5fr\\)_minmax\\(0\\2c _3fr\\)_minmax\\(0\\2c _1\\.8fr\\)_minmax\\(0\\2c _1\\.8fr\\)\\] { 16126 grid-template-columns: minmax(0, 5fr) minmax(0, 3.5fr) minmax(0, 3fr) minmax(0, 1.8fr) minmax(0, 1.8fr); 16127 } 16128 16129 .lg\\:flex-row { 16130 flex-direction: row; 16131 } 16132 16133 .lg\\:gap-4 { 16134 gap: 1rem; 16135 } 16136 16137 .lg\\:gap-5 { 16138 gap: 1.25rem; 16139 } 16140 16141 .lg\\:gap-x-14 { 16142 -moz-column-gap: 3.5rem; 16143 column-gap: 3.5rem; 16144 } 16145 16146 .lg\\:gap-x-5 { 16147 -moz-column-gap: 1.25rem; 16148 column-gap: 1.25rem; 16149 } 16150 16151 .lg\\:gap-y-8 { 16152 row-gap: 2rem; 16153 } 16154 16155 .lg\\:divide-x > :not([hidden]) ~ :not([hidden]) { 16156 --tw-divide-x-reverse: 0; 16157 border-right-width: calc(var(--sc-border-width) * var(--tw-divide-x-reverse)); 16158 border-left-width: calc(var(--sc-border-width) * calc(1 - var(--tw-divide-x-reverse))); 16159 } 16160 16161 .lg\\:divide-neutral-200 > :not([hidden]) ~ :not([hidden]) { 16162 border-color: var(--sc-base-200); 16163 } 16164 16165 .lg\\:border-l { 16166 border-left-width: var(--sc-border-width); 16167 } 16168 16169 .lg\\:px-20 { 16170 padding-left: 5rem; 16171 padding-right: 5rem; 16172 } 16173 16174 .lg\\:px-3 { 16175 padding-left: 0.75rem; 16176 padding-right: 0.75rem; 16177 } 16178 16179 .lg\\:px-6 { 16180 padding-left: 1.5rem; 16181 padding-right: 1.5rem; 16182 } 16183 16184 .lg\\:px-\\[--sc-modal-px\\] { 16185 padding-left: var(--sc-modal-px); 16186 padding-right: var(--sc-modal-px); 16187 } 16188 16189 .lg\\:py-2 { 16190 padding-top: 0.5rem; 16191 padding-bottom: 0.5rem; 16192 } 16193 16194 .lg\\:pl-4 { 16195 padding-left: 1rem; 16196 } 16197 16198 .lg\\:pl-6 { 16199 padding-left: 1.5rem; 16200 } 16201 16202 .lg\\:pl-7 { 16203 padding-left: 1.75rem; 16204 } 16205 16206 .lg\\:text-2xl { 16207 font-size: 1.5rem; 16208 } 16209 16210 .lg\\:text-3xl { 16211 font-size: 1.875rem; 16212 } 16213 16214 .lg\\:text-4xl { 16215 font-size: 2.25rem; 16216 } 16217 16218 .lg\\:text-5xl { 16219 font-size: 3rem; 16220 } 16221 16222 .lg\\:text-7xl { 16223 font-size: 4.5rem; 16224 } 16225 16226 .lg\\:text-\\[1rem\\] { 16227 font-size: 1rem; 16228 } 16229 16230 .lg\\:text-base { 16231 font-size: 1rem; 16232 } 16233 16234 .lg\\:text-sm { 16235 font-size: 0.875rem; 16236 } 16237 16238 .lg\\:text-xl { 16239 font-size: 1.25rem; 16240 } 16241 16242 .lg\\:text-xs { 16243 font-size: 0.75rem; 16244 } 16245 16246 .lg\\:leading-\\[1\\.1\\] { 16247 line-height: 1.1; 16248 } 16249 16250 .lg\\:leading-none { 16251 line-height: 1; 16252 } 16253 16254 .lg\\:leading-tight { 16255 line-height: 1.25; 16256 } 16257} 16258 16259@media (min-width: 1280px) { 16260 16261 .xl\\:block { 16262 display: block; 16263 } 16264 16265 .xl\\:grid-cols-3 { 16266 grid-template-columns: repeat(3, minmax(0, 1fr)); 16267 } 16268 16269 .xl\\:grid-cols-5 { 16270 grid-template-columns: repeat(5, minmax(0, 1fr)); 16271 } 16272 16273 .xl\\:grid-cols-\\[40\\%\\2c 1fr\\] { 16274 grid-template-columns: 40% 1fr; 16275 } 16276 16277 .xl\\:grid-cols-\\[minmax\\(0\\2c 3fr\\)_35rem\\] { 16278 grid-template-columns: minmax(0,3fr) 35rem; 16279 } 16280 16281 .xl\\:grid-cols-\\[minmax\\(0\\2c _1fr\\)_minmax\\(0\\2c _1\\.5fr\\)\\] { 16282 grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); 16283 } 16284 16285 .xl\\:text-3xl { 16286 font-size: 1.875rem; 16287 } 16288 16289 .xl\\:text-8xl { 16290 font-size: 6rem; 16291 } 16292 16293 .xl\\:text-xl { 16294 font-size: 1.25rem; 16295 } 16296 16297 .xl\\:leading-tight { 16298 line-height: 1.25; 16299 } 16300} 16301 16302@media (min-width: 1536px) { 16303 16304 .\\32xl\\:gap-x-10 { 16305 -moz-column-gap: 2.5rem; 16306 column-gap: 2.5rem; 16307 } 16308} 16309 16310@media print { 16311 16312 .print\\:block { 16313 display: block; 16314 } 16315 16316 .print\\:inline-block { 16317 display: inline-block; 16318 } 16319 16320 .print\\:flex { 16321 display: flex; 16322 } 16323 16324 .print\\:grid { 16325 display: grid; 16326 } 16327 16328 .print\\:hidden { 16329 display: none; 16330 } 16331 16332 .print\\:w-full { 16333 width: 100%; 16334 } 16335 16336 .print\\:max-w-\\[25\\%\\] { 16337 max-width: 25%; 16338 } 16339 16340 .print\\:shrink-0 { 16341 flex-shrink: 0; 16342 } 16343 16344 .print\\:flex-grow { 16345 flex-grow: 1; 16346 } 16347 16348 .print\\:grow { 16349 flex-grow: 1; 16350 } 16351 16352 .print\\:basis-3\\/12 { 16353 flex-basis: 25%; 16354 } 16355 16356 .print\\:basis-5\\/12 { 16357 flex-basis: 41.666667%; 16358 } 16359 16360 .print\\:grid-cols-\\[minmax\\(0\\2c _3fr\\)_minmax\\(0\\2c _2fr\\)\\] { 16361 grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); 16362 } 16363 16364 .print\\:gap-\\[1rem\\] { 16365 gap: 1rem; 16366 } 16367 16368 .print\\:gap-x-\\[2rem\\] { 16369 -moz-column-gap: 2rem; 16370 column-gap: 2rem; 16371 } 16372 16373 .print\\:self-start {
16374 align-self: flex-start; 16375 } 16376 16377 .print\\:opacity-100 { 16378 opacity: 1; 16379 } 16380} 16381 16382.\\[\\&\\.open\\]\\:before\\:content-\\[\\'\\25BE_\\'\\].open::before { 16383 --tw-content: 'â¾ '; 16384 content: var(--tw-content); 16385} 16386 16387.\\[\\&\\:first-child\\]\\:hidden:first-child { 16388 display: none; 16389} 16390 16391.\\[\\&\\:hover\\]\\:border-neutral-800:hover { 16392 border-color: var(--sc-base-800); 16393} 16394 16395.\\[\\&\\:not\\(\\[alwaysExpanded\\]\\)\\]\\:hover\\:cursor-pointer:hover:not([alwaysExpanded]) { 16396 cursor: pointer; 16397} 16398 16399.\\[\\&\\>p\\:not\\(\\:last-child\\)\\]\\:mb-2>p:not(:last-child) { 16400 margin-bottom: 0.5rem; 16401} 16402 16403.\\[\\&\\>p\\]\\:mb-2>p { 16404 margin-bottom: 0.5rem; 16405} 16406 16407.\\[\\&\\[active\\]\\]\\:pointer-events-none[active] { 16408 pointer-events: none; 16409} 16410 16411.\\[\\&\\[active\\]\\]\\:border-neutral-800[active] { 16412 border-color: var(--sc-base-800); 16413} 16414 16415.\\[\\&\\[active\\]\\]\\:font-bold[active] { 16416 font-weight: 700; 16417} 16418 16419.\\[\\&\\[active\\]\\]\\:text-content[active] { 16420 color: var(--sc-base-content); 16421} 16422 16423.\\[\\&\\[active\\]\\]\\:text-primary[active] { 16424 color: var(--sc-primary); 16425} 16426 16427.\\[\\&\\[active\\]\\]\\:underline[active] { 16428 text-decoration-line: underline; 16429} 16430 16431.\\[\\&\\[active\\]\\]\\:shadow-\\[0_0_0_2px_var\\(--sc-base-800\\)\\][active] { 16432 --tw-shadow: 0 0 0 2px var(--sc-base-800);
16433 --tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color); 16434 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 16435} 16436 16437.\\[\\&_\\*\\]\\:fill-current * { 16438 fill: currentColor; 16439} 16440 16441.\\[\\&_\\*\\]\\:fill-neutral-0 * { 16442 fill: var(--sc-base); 16443} 16444 16445.\\[\\&_\\.hour\\]\\:font-normal .hour { 16446 font-weight: 400; 16447} 16448 16449.\\[\\&_\\.literal\\]\\:font-normal .literal { 16450 font-weight: 400; 16451} 16452 16453.\\[\\&_\\.minute\\]\\:font-normal .minute { 16454 font-weight: 400; 16455} 16456 16457.\\[\\&_a\\]\\:underline a { 16458 text-decoration-line: underline; 16459} 16460`; 16461 const tailwind = i$9` 16462 ${r$9(tailwindImport)} 16463`; 16464 const inline = i$9` 16465 :host([align="left"]) .sonic-loader--inline { 16466 margin-left: 0; 16467 } 16468 16469 :host([align="right"]) .sonic-loader--inline { 16470 margin-left: auto; 16471 margin-right: 0; 16472 } 16473 .sonic-loader--inline { 16474 display: block; 16475 position: relative; 16476 width: 80px; 16477 height: 24px; 16478 margin: auto; 16479 z-index: 20; 16480 } 16481 .sonic-loader--inline div { 16482 position: absolute; 16483 top: 5px; 16484 width: 13px; 16485 height: 13px; 16486 border-radius: 50%; 16487 background: var(--sc-_loader-bg); 16488 animation-timing-function: cubic-bezier(0, 1, 1, 0); 16489 } 16490 .sonic-loader--inline div:nth-child(1) { 16491 left: 8px; 16492 animation: lds-ellipsis1 0.6s infinite; 16493 } 16494 .sonic-loader--inline div:nth-child(2) { 16495 left: 8px; 16496 animation: lds-ellipsis2 0.6s infinite; 16497 } 16498 .sonic-loader--inline div:nth-child(3) { 16499 left: 32px; 16500 animation: lds-ellipsis2 0.6s infinite; 16501 } 16502 .sonic-loader--inline div:nth-child(4) { 16503 left: 56px; 16504 animation: lds-ellipsis3 0.6s infinite; 16505 } 16506 16507 @keyframes lds-ellipsis1 { 16508 0% { 16509 transform: scale(0); 16510 } 16511 100% { 16512 transform: scale(1); 16513 } 16514 } 16515 @keyframes lds-ellipsis3 { 16516 0% { 16517 transform: scale(1); 16518 } 16519 100% { 16520 transform: scale(0); 16521 } 16522 } 16523 @keyframes lds-ellipsis2 { 16524 0% { 16525 transform: translate(0, 0); 16526 } 16527 100% { 16528 transform: translate(24px, 0); 16529 } 16530 } 16531`; 16532 const fixed = i$9` 16533 @keyframes sonic-loader--fixed { 16534 0% { 16535 transform: scale(0); 16536 opacity: 0; 16537 } 16538 5% { 16539 opacity: 1; 16540 } 16541 70% { 16542 opacity: 90%; 16543 } 16544 100% { 16545 transform: scale(1); 16546 opacity: 0; 16547 } 16548 } 16549 16550 .sonic-loader--fixed { 16551 position: fixed; 16552 top: 50%; 16553 left: 50%; 16554 transform: transateY(-50%) translateX(-50%); 16555 z-index: 999; 16556 } 16557 16558 .sonic-loader--fixed > div:nth-child(2) { 16559 animation-delay: -0.5s; 16560 } 16561 .sonic-loader--fixed > div:nth-child(3) { 16562 animation-delay: -0.2s; 16563 } 16564 16565 .sonic-loader--fixed > div:nth-child(4) { 16566 display: none !important; 16567 } 16568 .sonic-loader--fixed > div { 16569 background-color: var(--sc-_loader-bg); 16570 width: 5rem; 16571 height: 5rem; 16572 border-radius: 100%; 16573 margin: 2px; 16574 animation-fill-mode: both; 16575 position: absolute; 16576 top: 0px; 16577 opacity: 0; 16578 margin: 0; 16579 top: -2.5rem; 16580 left: -2.5rem; 16581 width: 5rem; 16582 height: 5rem; 16583 animation: sonic-loader--fixed 1s 0s linear infinite; 16584 } 16585`; 16586 var __decorate$H = function(decorators, target, key, desc) { 16587 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 16588 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 16589 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 16590 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 16591 }; 16592 var Loader_1; 16593 const tagName$2C = "sonic-loader"; 16594 let Loader = Loader_1 = class Loader extends i$6 { 16595 constructor() { 16596 super(...arguments); 16597 this.mode = "fixed"; 16598 this.noDelay = false; 16599 } 16600 static show(conf) { 16601 if (!Loader_1.loader) 16602 Loader_1.loader = document.createElement("sonic-loader"); 16603 const loader = Loader_1.loader; 16604 if (!conf) 16605 conf = {}; 16606 if (conf.mode) 16607 loader.setAttribute("mode", conf.mode); 16608 if (conf.noDelay) 16609 loader.setAttribute("noDelay", ""); 16610 if (!conf.container) { 16611 conf.container = Theme.getPopContainer(); 16612 conf.mode = "fixed"; 16613 } 16614 conf.container.appendChild(loader); 16615 Loader_1.callCounter++; 16616 } 16617 static hide() { 16618 Loader_1.callCounter--; 16619 if (Loader_1.callCounter > 0) 16620 return; 16621 if (Loader_1.loader) 16622 Loader_1.loader.remove(); 16623 } 16624 render() { 16625 return b$1`<div 16626 class="sonic-loader sonic-loader--${this.mode} ${this.noDelay ? "sonic-loader--nodelay" : ""} " 16627 > 16628 <div></div> 16629 <div></div> 16630 <div></div> 16631 <div></div> 16632 </div>`; 16633 } 16634 }; 16635 Loader.styles = [ 16636 inline, 16637 fixed, 16638 i$9` 16639 :host { 16640 --sc-_loader-bg: var(--sc-primary, currentColor); 16641 pointer-events: none; 16642 } 16643 16644 :host([currentColor]) { 16645 --sc-_loader-bg: currentColor; 16646 } 16647 16648 .sonic-loader { 16649 opacity: 0; 16650 animation: showLoader 0.5s 0.5s forwards; 16651 } 16652 .sonic-loader--inline, 16653 .sonic-loader--nodelay { 16654 animation-delay: 0s; 16655 } 16656 16657 @keyframes showLoader { 16658 0% { 16659 opacity: 0; 16660 } 16661 16662 100% { 16663 opacity: 1; 16664 } 16665 } 16666 ` 16667 ]; 16668 Loader.callCounter = 0; 16669 __decorate$H([ 16670 n$5({ type: String }) 16671 ], Loader.prototype, "mode", void 0); 16672 __decorate$H([ 16673 n$5({ type: Boolean }) 16674 ], Loader.prototype, "noDelay", void 0); 16675 Loader = Loader_1 = __decorate$H([ 16676 t$3(tagName$2C) 16677 ], Loader); 16678 var __decorate$G = function(decorators, target, key, desc) { 16679 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 16680 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 16681 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 16682 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 16683 }; 16684 const tagName$2B = "sonic-if"; 16685 let SonicIF = class SonicIF extends i$6 { 16686 constructor() { 16687 super(...arguments); 16688 this.condition = false;
16689 } 16690 render() { 16691 if (!this.condition) 16692 return A$1; 16693 return b$1` <slot></slot> `; 16694 } 16695 }; 16696 SonicIF.styles = i$9` 16697 :host { 16698 display: contents; 16699 } 16700 `; 16701 __decorate$G([ 16702 n$5({ type: Boolean }) 16703 ], SonicIF.prototype, "condition", void 0); 16704 SonicIF = __decorate$G([ 16705 t$3(tagName$2B) 16706 ], SonicIF); 16707 var __decorate$F = function(decorators, target, key, desc) { 16708 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 16709 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 16710 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 16711 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 16712 }; 16713 const icon = { 16714 warning: "warning-circled-outline", 16715 success: "check-circled-outline", 16716 error: "warning-circled-outline", 16717 info: "info-empty", 16718 default: "info-empty" 16719 }; 16720 const tagName$2A = "sonic-alert"; 16721 let Alert = class Alert extends i$6 { 16722 constructor() { 16723 super(...arguments); 16724 this.label = ""; 16725 this.noIcon = false; 16726 this.text = ""; 16727 this.id = (/* @__PURE__ */ new Date()).getTime().toString(); 16728 this.dismissible = false; 16729 this.background = false; 16730 this.status = "default"; 16731 this.dismissForever = false; 16732 } 16733 connectedCallback() { 16734 if (this.dismissForever) { 16735 const dismissed = localStorage.getItem("sonic-alert-dismissed") || "{}"; 16736 const dismissedObj = JSON.parse(dismissed); 16737 if (dismissedObj[this.id]) { 16738 this.remove(); 16739 } 16740 } 16741 super.connectedCallback(); 16742 } 16743 render() { 16744 return b$1` 16745 <slot name="icon" class="${this.noIcon ? "hidden" : ""}" 16746 >${!this.noIcon ? b$1`<div> 16747 ${this.status && b$1`<sonic-icon name=${icon[this.status]}></sonic-icon>`} 16748 </div>` : A$1}</slot 16749 > 16750 <div class="content"> 16751 ${this.label ? b$1`<span class="label">${o$6(this.label)}</span>` : A$1} 16752 <div>${this.text}<slot></slot></div> 16753 </div> 16754 ${this.dismissible ? b$1`<sonic-button 16755 @click=${this.close} 16756 class="close-btn" 16757 variant="unstyled" 16758 shape="circle" 16759 icon 16760 > 16761 <sonic-icon name="cancel"></sonic-icon> 16762 </sonic-button>` : A$1} 16763 `; 16764 } 16765 close() { 16766 this.remove(); 16767 if (this.dismissForever) { 16768 const dismissed = localStorage.getItem("sonic-alert-dismissed") || "{}"; 16769 const dismissedObj = JSON.parse(dismissed); 16770 dismissedObj[this.id] = true; 16771 localStorage.setItem("sonic-alert-dismissed", JSON.stringify(dismissedObj)); 16772 } 16773 } 16774 }; 16775 Alert.styles = [ 16776 fontSize, 16777 i$9` 16778 :host { 16779 --sc_color: var(--sc-base-content, #000); 16780 --sc_rounded: var(--sc-rounded); 16781 --sc_fw: var(--sc-font-weight-base, 400); 16782 --sc_fst: var(--sc-font-style-base, normal); 16783 --sc_label-fw: bold; 16784 16785 font-weight: var(--sc_fw); 16786 font-style: var(--sc_fst); 16787 color: var(--sc_color); 16788 position: relative; 16789 display: flex; 16790 gap: 0.4em; 16791 border-radius: var(--sc_rounded); 16792 } 16793 16794 .label { 16795 font-weight: var(--sc_label-fw); 16796 margin-bottom: 0.15em; 16797 display: block; 16798 } 16799 16800 :host([status="warning"]) { 16801 --sc_color: var(--sc-warning, var(--sc-base-content, #000)); 16802 } 16803 :host([status="error"]) { 16804 --sc_color: var(--sc-danger, var(--sc-base-content, #000)); 16805 } 16806 :host([status="info"]) { 16807 --sc_color: var(--sc-info, var(--sc-base-content, #000)); 16808 } 16809 :host([status="success"]) { 16810 --sc_color: var(--sc-success, var(--sc-base-content, #000)); 16811 } 16812 16813 /*background*/ 16814 :host([dismissible]), 16815 :host([background]) { 16816 background: var(--sc-base, #fff); 16817 padding: 0.8em 1.15em; 16818 } 16819 :host([dismissible]):before, 16820 :host([background]):before { 16821 background-color: currentColor; 16822 content: ""; 16823 display: block; 16824 position: absolute; 16825 left: 0; 16826 top: 0; 16827 right: 0; 16828 bottom: 0; 16829 opacity: 0.08; 16830 border-radius: var(--sc_rounded); 16831 pointer-events: none; 16832 } 16833 16834 .content { 16835 z-index: 2; 16836 position: relative; 16837 flex: 1; 16838 } 16839 16840 slot { 16841 display: block; 16842 } 16843 16844 .hidden { 16845 display: none !important; 16846 } 16847 16848 /*Rounded*/ 16849 :host([size="2xs"]), 16850 :host([size="xs"]), 16851 :host([size="sm"]) { 16852 --sc_rounded: var(--sc-rounded-sm); 16853 } 16854 16855 /*Dismissible*/ 16856 :host([dismissible]) { 16857 padding-right: 3rem; 16858 } 16859 :host([dismissible]) .close-btn { 16860 position: absolute; 16861 top: 0.4rem; 16862 right: 0.3rem; 16863 } 16864 ` 16865 ]; 16866 __decorate$F([ 16867 n$5({ type: String }) 16868 ], Alert.prototype, "label", void 0); 16869 __decorate$F([ 16870 n$5({ type: Boolean, reflect: true }) 16871 ], Alert.prototype, "noIcon", void 0); 16872 __decorate$F([ 16873 n$5({ type: String }) 16874 ], Alert.prototype, "text", void 0); 16875 __decorate$F([ 16876 n$5({ type: String }) 16877 ], Alert.prototype, "id", void 0); 16878 __decorate$F([ 16879 n$5({ type: String, reflect: true }) 16880 ], Alert.prototype, "size", void 0); 16881 __decorate$F([ 16882 n$5({ type: Boolean, reflect: true }) 16883 ], Alert.prototype, "dismissible", void 0); 16884 __decorate$F([ 16885 n$5({ type: Boolean, reflect: true }) 16886 ], Alert.prototype, "background", void 0); 16887 __decorate$F([ 16888 n$5({ type: String, reflect: true }) 16889 ], Alert.prototype, "status", void 0); 16890 __decorate$F([ 16891 n$5({ type: Boolean, reflect: true }) 16892 ], Alert.prototype, "dismissForever", void 0); 16893 Alert = __decorate$F([ 16894 t$3(tagName$2A) 16895 ], Alert); 16896 var __defProp$3M = Object.defineProperty; 16897 var __getOwnPropDesc$3P = Object.getOwnPropertyDescriptor; 16898 var __decorateClass$3Q = (decorators, target, key, kind) => { 16899 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3P(target, key) : target; 16900 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 16901 if (decorator = decorators[i2]) 16902 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 16903 if (kind && result) __defProp$3M(target, key, result); 16904 return result; 16905 }; 16906 let SonicLogo = class extends Subscriber$1(i$6) { 16907 constructor() { 16908 super(...arguments); 16909 this.noLink = false;
16910 this.src = ""; 16911 this.ratio_auto_360 = ""; 16912 this.href = "/"; 16913 } 16914 async onThemeUpdate(url) { 16915 if (url) { 16916 sessionStorage.setItem("SonicDefaultLogoSrc", url); 16917 this.defaultLogoSrc = url; 16918 } 16919 } 16920 connectedCallback() { 16921 this.href = appRoute("home").toString(); 16922 this.logoSrc = this.getAncestorAttributeValue("logoSrc") || ""; 16923 if (!this.logoSrc && sessionStorage.getItem("SonicDefaultLogoSrc") !== null) { 16924 this.logoSrc = sessionStorage.getItem("SonicDefaultLogoSrc") || ""; 16925 } 16926 super.connectedCallback(); 16927 } 16928 logo(src) { 16929 return b$1`<img loading="eager" src=${o$4(src)} class="logo" alt="logo - ${this.editor_name}" /> `; 16930 } 16931 render() { 16932 const logoSrc = this.logoSrc || this.ratio_auto_360 || this.src || this.defaultLogoSrc; 16933 if (!logoSrc) return b$1`<sonic-fetch dataProvider="theme"></sonic-fetch>`; 16934 if (this.noLink || !this.href) { 16935 return this.logo(logoSrc); 16936 } 16937 return b$1`<a href="${this.href}">${this.logo(logoSrc)}</a> `; 16938 } 16939 }; 16940 SonicLogo.styles = [ 16941 tailwind, 16942 i$9` 16943 :host() { 16944 display: flex; 16945 width: 100%; 16946 position: relative; 16947 } 16948 .logo { 16949 display: block; 16950 width: 100%; 16951 height: 100%; 16952 object-fit: contain; 16953 object-position: left center; 16954 } 16955 ` 16956 ]; 16957 __decorateClass$3Q([ 16958 n$5({ type: Boolean }) 16959 ], SonicLogo.prototype, "noLink", 2); 16960 __decorateClass$3Q([ 16961 n$5({ type: String }) 16962 ], SonicLogo.prototype, "src", 2); 16963 __decorateClass$3Q([ 16964 n$5({ type: String }) 16965 ], SonicLogo.prototype, "ratio_auto_360", 2); 16966 __decorateClass$3Q([ 16967 n$5({ type: String }) 16968 ], SonicLogo.prototype, "href", 2); 16969 __decorateClass$3Q([ 16970 n$5({ type: String }) 16971 ], SonicLogo.prototype, "logoSrc", 2); 16972 __decorateClass$3Q([ 16973 onAssign$1("theme.logos.logo_billetterie.ratio_auto_360") 16974 ], SonicLogo.prototype, "onThemeUpdate", 1); 16975 __decorateClass$3Q([ 16976 n$5({ type: String }) 16977 ], SonicLogo.prototype, "defaultLogoSrc", 2); 16978 __decorateClass$3Q([ 16979 bind$1("settings.infos.editor_name"), 16980 n$5({ type: String }) 16981 ], SonicLogo.prototype, "editor_name", 2); 16982 SonicLogo = __decorateClass$3Q([ 16983 t$3("sonic-theme-logo") 16984 ], SonicLogo); 16985 var __defProp$3L = Object.defineProperty; 16986 var __getOwnPropDesc$3O = Object.getOwnPropertyDescriptor; 16987 var __decorateClass$3P = (decorators, target, key, kind) => { 16988 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3O(target, key) : target; 16989 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 16990 if (decorator = decorators[i2]) 16991 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 16992 if (kind && result) __defProp$3L(target, key, result); 16993 return result; 16994 }; 16995 const tagName$2z = "sonic-waiting-line"; 16996 let SonicWaitingLine = class extends Fetcher$1(Subscriber$1(i$6)) { 16997 constructor() { 16998 super(...arguments); 16999 this.wording_waiting_line_allowed_text = ""; 17000 this.wording_waiting_line_expired_text = ""; 17001 this.wording_waiting_line_allowed_text_time_warning = ""; 17002 this.wording_waiting_line_estimated_waiting_time_long = ""; 17003 this.wording_waiting_line_people_before_you = ""; 17004 this.status = ""; 17005 this.open = false; 17006 this.position = 0; 17007 this.remaining_time_sec = 0; 17008 this.message = ""; 17009 this.hasBeenAllowed = false; 17010 this.allowedWording = ""; 17011 this.timeWarningWording = ""; 17012 this.showPageReloadedInfo = false; 17013 this.remaining_time_sec_ref = 0; 17014 this.remainingCounterStartTime = 0; 17015 this.remainingCounterStarted = false; 17016 this.onReload = (e2) => { 17017 if (!["waiting", "", null].includes(this.status)) { 17018 return; 17019 } 17020 sessionStorage.setItem("waiting-line-F5", "true"); 17021 e2.preventDefault(); 17022 }; 17023 this._endPoint = "waiting-line"; 17024 this.hasError = false; 17025 this.previousProps = null; 17026 } 17027 setDefaults() { 17028 this.refetchEveryMs = 1e4; 17029 this.setAttribute("key", "data"); 17030 this.setAttribute("dataProvider", "waiting_line_infos"); 17031 } 17032 handleUserReloadingPage() { 17033 if (sessionStorage.getItem("waiting-line-F5")) { 17034 sessionStorage.removeItem("waiting-line-F5"); 17035 this.showPageReloadedInfo = true; 17036 } 17037 window.addEventListener("beforeunload", this.onReload); 17038 } 17039 connectedCallback() { 17040 this.handleUserReloadingPage(); 17041 this.setDefaults(); 17042 super.connectedCallback(); 17043 } 17044 disconnectedCallback() { 17045 window.removeEventListener("beforeunload", this.onReload); 17046 super.disconnectedCallback(); 17047 } 17048 async updateTimeWarning(status, remaining_time_sec, wording2) { 17049 if (status != "waiting") return; 17050 await Utils.queueTaskPromise(); 17051 const minutes = Math.ceil((remaining_time_sec || 600) / 60); 17052 this.timeWarningWording = wording2.replace("%s", Format.minutesDuration(minutes)); 17053 } 17054 async onStatusUpdate(status) { 17055 await Utils.queueTaskPromise(); 17056 this.startCountDownIfNeeded(status); 17057 this.handleExpiredStatusOnLoad(status); 17058 if (status == "entered") { 17059 sessionStorage.setItem("waiting-line-previously-entered", "true"); 17060 } else { 17061 window.requestAnimationFrame(() => sessionStorage.removeItem("waiting-line-previously-entered")); 17062 } 17063 } 17064 handleExpiredStatusOnLoad(status) { 17065 if (status == "expired" && !this.hasBeenAllowed) { 17066 this.publisher.status = "waiting"; 17067 } 17068 } 17069 startCountDownIfNeeded(status) { 17070 this.stopCountDown(); 17071 if (status == "allowed") { 17072 this.hasBeenAllowed = true; 17073 this.startCountDown(); 17074 } 17075 } 17076 async udpateCountDown() { 17077 if (!this.remainingCounterStarted) return; 17078 this.remaining_time_sec = this.remaining_time_sec_ref - Math.floor((Date.now() - this.remainingCounterStartTime) / 1e3); 17079 const minutes = Math.ceil(this.remaining_time_sec / 60); 17080 this.allowedWording = this.wording_waiting_line_allowed_text.replace("%s", Format.minutesDuration(minutes)); 17081 if (this.remaining_time_sec <= 0) { 17082 this.publisher.status = "expired"; 17083 } 17084 await Utils.delayPromise(1e3); 17085 this.udpateCountDown(); 17086 } 17087 startCountDown() { 17088 if (this.remainingCounterStarted) return; 17089 this.remainingCounterStarted = true; 17090 this.remaining_time_sec_ref = this.remaining_time_sec; 17091 this.remainingCounterStartTime = Date.now(); 17092 this.udpateCountDown(); 17093 } 17094 async stopCountDown() { 17095 if (!this.remainingCounterStarted) return; 17096 this.remainingCounterStarted = false;
17097 this.remaining_time_sec = 0; 17098 await super._fetchData(); 17099 } 17100 set endPoint(_2) { 17101 return; 17102 } 17103 get endPoint() { 17104 if (this.status == "entered") { 17105 return `${this._endPoint}?change_status_request=entered`; 17106 } 17107 if (this.status == "expired" && this.hasBeenAllowed) { 17108 return `${this._endPoint}?change_status_request=expired`; 17109 } 17110 return this._endPoint; 17111 } 17112 shouldfetchData() { 17113 return (["waiting", "", "expired"].includes(this.status) || this.hasError) && !this.isLoading; 17114 } 17115 willBeFetchedLater() { 17116 if (!sessionStorage.getItem("waiting-line-dont-fetch-before-ms") || !this.showPageReloadedInfo) return false; 17117 const fetchDelayMs = parseInt(sessionStorage.getItem("waiting-line-dont-fetch-before-ms") || "0") - Date.now(); 17118 if (fetchDelayMs < 0) return false; 17119 sessionStorage.removeItem("waiting-line-dont-fetch-before-ms"); 17120 setTimeout(async () => { 17121 this._fetchData(); 17122 }, fetchDelayMs); 17123 return true; 17124 } 17125 async _fetchData() { 17126 if (this.willBeFetchedLater()) return; 17127 if (!this.shouldfetchData()) return; 17128 const ms = Date.now(); 17129 this.hasError = false; 17130 const status = this.status; 17131 const result = await super._fetchData(); 17132 await Utils.queueTaskPromise(); 17133 this.hasError = this.status === null; 17134 if (this.hasError && ["waiting", "expired"].includes(status) && this.previousProps) { 17135 this.publisher.set({ ...this.previousProps }); 17136 } 17137 this.previousProps = this.publisher.get(); 17138 let minTime = 1e4; 17139 if (this.hasError) { 17140 minTime = 3e4; 17141 } else { 17142 this.showPageReloadedInfo = false; 17143 } 17144 const responseTime = Date.now() - ms; 17145 const maxTime = 6e4; 17146 this.refetchEveryMs = Math.min(maxTime, Math.max(minTime + Math.random() * 1e3, responseTime * 3)); 17147 this.showPageReloadedInfo = false; 17148 sessionStorage.setItem("waiting-line-dont-fetch-before-ms", (Date.now() + this.refetchEveryMs).toString()); 17149 return result; 17150 } 17151 async enter() { 17152 this.publisher.status = "entered"; 17153 await super._fetchData(); 17154 if (!dp("settings").get().is_online && this.open) { 17155 window.location.reload(); 17156 return; 17157 } 17158 this.dispatchEvent(new CustomEvent("enter")); 17159 } 17160 refreshPage() { 17161 window.location.reload(); 17162 } 17163 getFallbackErrorLabel() { 17164 const language = HTML.getLanguage(); 17165 if (language == "fr") { 17166 return b$1`Veuillez patienter.`; 17167 } 17168 return b$1`Please wait.`; 17169 } 17170 renderWaiting() { 17171 if (this.status != "waiting" && !(this.showPageReloadedInfo && this.status === "") && this.status !== null) { 17172 return A$1; 17173 } 17174 if (this.open && (this.status == "waiting" && this.position == 0 || this.status == null) && !this.showPageReloadedInfo) { 17175 return b$1` 17176 <sonic-modal-content> 17177 <div class="flex gap-3 items-center mt-5"> 17178 <div class="flex items-center shrink-0 flex-col w-[70px] pt-1"> 17179 <sonic-icon name="hourglass-half" library="custom" size="2xl"></sonic-icon> 17180 <sonic-loader mode="inline" class="pointer-events-none origin-center scale-[50%]"></sonic-loader> 17181 </div> 17182 <div> 17183 <div class="text-lg">${this.getFallbackErrorLabel()}</div> 17184 </div> 17185 </div> 17186 </sonic-modal-content> 17187 `; 17188 } 17189 const openOrNoStatus = this.open || this.status == ""; 17190 return b$1` <sonic-modal-title class="mb-2">${t("waiting_line_title")}</sonic-modal-title> 17191 <sonic-modal-content> 17192 <sonic-if .condition=${this.open}> 17193 ${t("waiting_line_text")} 17194 <div class="mt-2">${this.timeWarningWording}</div> 17195 </sonic-if> 17196 ${this.renderMessage()} 17197 17198 <sonic-if .condition=${openOrNoStatus}> 17199 <div class="flex gap-3 items-center mt-5"> 17200 <div class="flex items-center shrink-0 flex-col w-[70px] pt-1"> 17201 <sonic-icon name="hourglass-half" library="custom" size="2xl"></sonic-icon> 17202 <sonic-loader mode="inline" class="pointer-events-none origin-center scale-[50%]"></sonic-loader> 17203 </div> 17204 <div> 17205 <sonic-if .condition=${this.position > 0}> 17206 <div class="text-lg"> 17207 ${this.wording_waiting_line_people_before_you.replace("%s", this.position.toString())} 17208 </div> 17209 </sonic-if> 17210 <sonic-if .condition=${this.showPageReloadedInfo}> 17211 <div class="text-lg">${t("waiting_line_page_reload_info")}</div> 17212 </sonic-if> 17213 </div> 17214 </div> 17215 </sonic-if> 17216 </sonic-modal-content>`; 17217 } 17218 /** TODO Ajouter au différents états */ 17219 renderMessage() { 17220 if (!this.message) return A$1; 17221 if (this.open) { 17222 return b$1` 17223 <sonic-alert status="info" background class="mt-3 [&>
17223p:not(:last-child)]:mb-2 text-pretty" 17224 >${o$6(this.message)}</sonic-alert 17225 > 17226 `; 17227 } 17228 return b$1` <div class="mt-2 [&>p]:mb-2 text-lg">${o$6(this.message)}</div> `; 17229 } 17230 renderAllowed() { 17231 if (this.status != "allowed") return A$1; 17232 return b$1`<sonic-modal-title class="mb-2"> 17233 <sonic-icon library="custom" name="face-laugh-beam"></sonic-icon> ${t( 17234 "waiting_line_allowed_title" 17235 )}</sonic-modal-title 17236 ><sonic-modal-content> ${this.allowedWording} ${this.renderMessage()} </sonic-modal-content> 17237 <div class="w-full mt-8"> 17238 <sonic-button @click=${this.enter} type="success" shape="block" class="w-full"> 17239 <sonic-icon library="custom" name="arrow-right"></sonic-icon> 17240 ${t("waiting_line_allowed_btn")}</sonic-button 17241 > 17242 </div>`; 17243 } 17244 renderExpired() { 17245 if (this.status != "expired") return A$1; 17246 return b$1`<sonic-modal-title class="mb-2"> 17247 <sonic-icon library="custom" name="face-grimace"></sonic-icon> ${t( 17248 "waiting_line_expired_title" 17249 )}</sonic-modal-title 17250 ><sonic-modal-content> 17251 ${this.wording_waiting_line_expired_text.replace( 17252 "%s", 17253 Format.minutesDuration(Math.ceil(this.remaining_time_sec_ref / 60)) 17254 )} 17255 ${this.renderMessage()} 17256 </sonic-modal-content> 17257 <div class="w-full mt-8"> 17258 <sonic-button variant="outline" type="neutral" shape="block" @click=${this.refreshPage}> 17259 <sonic-icon library="custom" name="rotate-right"></sonic-icon> 17260 ${t("waiting_line_expired_btn")}</sonic-button 17261 > 17262 </div>`; 17263 } 17264 render() { 17265 if (["entered", ""].includes(this.status) && !this.showPageReloadedInfo) return A$1; 17266 return b$1`<sonic-modal forceAction visible width="30rem"> 17267 <sonic-theme-logo noLink class="max-w-[8rem] -mt-2 mb-5"></sonic-theme-logo> 17268 ${this.renderWaiting()} 17269 <!-- --> 17270 ${this.renderAllowed()} 17271 <!-- --> 17272 ${this.renderExpired()} 17273 </sonic-modal>`; 17274 } 17275 }; 17276 SonicWaitingLine.styles = [tailwind]; 17277 __decorateClass$3P([ 17278 r$5() 17279 ], SonicWaitingLine.prototype, "wording_waiting_line_allowed_text", 2); 17280 __decorateClass$3P([ 17281 r$5() 17282 ], SonicWaitingLine.prototype, "wording_waiting_line_expired_text", 2); 17283 __decorateClass$3P([ 17284 r$5() 17285 ], SonicWaitingLine.prototype, "wording_waiting_line_allowed_text_time_warning", 2); 17286 __decorateClass$3P([ 17287 r$5() 17288 ], SonicWaitingLine.prototype, "wording_waiting_line_estimated_waiting_time_long", 2); 17289 __decorateClass$3P([ 17290 r$5() 17291 ], SonicWaitingLine.prototype, "wording_waiting_line_people_before_you", 2); 17292 __decorateClass$3P([ 17293 r$5() 17294 ], SonicWaitingLine.prototype, "status", 2); 17295 __decorateClass$3P([ 17296 r$5() 17297 ], SonicWaitingLine.prototype, "open", 2); 17298 __decorateClass$3P([ 17299 r$5() 17300 ], SonicWaitingLine.prototype, "position", 2); 17301 __decorateClass$3P([ 17302 r$5() 17303 ], SonicWaitingLine.prototype, "remaining_time_sec", 2); 17304 __decorateClass$3P([ 17305 r$5() 17306 ], SonicWaitingLine.prototype, "message", 2); 17307 __decorateClass$3P([ 17308 r$5() 17309 ], SonicWaitingLine.prototype, "hasBeenAllowed", 2); 17310 __decorateClass$3P([ 17311 r$5() 17312 ], SonicWaitingLine.prototype, "allowedWording", 2); 17313 __decorateClass$3P([ 17314 r$5() 17315 ], SonicWaitingLine.prototype, "timeWarningWording", 2); 17316 __decorateClass$3P([ 17317 r$5() 17318 ], SonicWaitingLine.prototype, "showPageReloadedInfo", 2); 17319 __decorateClass$3P([ 17320 r$5() 17321 ], SonicWaitingLine.prototype, "remaining_time_sec_ref", 2); 17322 __decorateClass$3P([ 17323 onAssign$1( 17324 "waiting_line_infos.status", 17325 "waiting_line_infos.remaining_time_sec", 17326 "sonic-wording.wording_waiting_line_allowed_text_time_warning" 17327 ) 17328 ], SonicWaitingLine.prototype, "updateTimeWarning", 1); 17329 __decorateClass$3P([ 17330 onAssign$1("waiting_line_infos.status") 17331 ], SonicWaitingLine.prototype, "onStatusUpdate", 1); 17332 __decorateClass$3P([ 17333 n$5({ type: String }) 17334 ], SonicWaitingLine.prototype, "endPoint", 1); 17335 SonicWaitingLine = __decorateClass$3P([ 17336 t$3(tagName$2z) 17337 ], SonicWaitingLine); 17338 const DP_PINNED_ITEM = "pinnedItem"; 17339 const pinContext = n("pinCounter"); 17340 const QUOTA_ID_OUT_OF_CONTINGENT = 1; 17341 const OTHER_OWNERS_TAB_ID = "other_owners"; 17342 function isOutOfContingentQuotaId(quotaId) { 17343 return Number(quotaId) === QUOTA_ID_OUT_OF_CONTINGENT; 17344 } 17345 function isOtherOwnersTabId(selectedId) { 17346 return selectedId === OTHER_OWNERS_TAB_ID; 17347 } 17348 const isLargeContext = n("isLargeContext"); 17349 const selectedSubscriptionIdContext = n("selectedSubscriptionId"); 17350 const preferredQuotaIdContext = n("preferredQuotaId"); 17351 var PlacementType = /* @__PURE__ */ ((PlacementType2) => { 17352 PlacementType2["AUTO"] = "auto"; 17353 PlacementType2["MANUAL"] = "manual"; 17354 return PlacementType2; 17355 })(PlacementType || {}); 17356 const QUICK_SELECT_DISPLAY_DP = "quickSelectPreferences"; 17357 const QUICK_SELECT_PLACEMENT_DP = "quickSelectPlacementPreferences"; 17358 const QUICK_SELECT_DISPLAY_IS_CONDENSED = `${QUICK_SELECT_DISPLAY_DP}.isCondensed`;
17359 const QUICK_SELECT_PLACEMENT_TYPE = `${QUICK_SELECT_PLACEMENT_DP}.placement_type`; 17360 const quickSelectDisplayFormKey = new DataProviderKey( 17361 "${formDataProvider}" 17362 ); 17363 const showOtherOwnersContext = n("showOtherOwners"); 17364 const SEATMAP_PLACEMENT_PREFERENCES_DP = "seatmapPlacementPreferences"; 17365 const CLIENT_PREFERENCE_STORAGE_KEYS = [ 17366 QUICK_SELECT_DISPLAY_DP, 17367 QUICK_SELECT_PLACEMENT_DP, 17368 SEATMAP_PLACEMENT_PREFERENCES_DP 17369 ]; 17370 const COUNTER_PREFERENCE_STORAGE_KEYS = [DP_PINNED_ITEM, ...CLIENT_PREFERENCE_STORAGE_KEYS]; 17371 function clearPreferences(scope = "client") { 17372 const keys2 = scope === "counter" ? COUNTER_PREFERENCE_STORAGE_KEYS : CLIENT_PREFERENCE_STORAGE_KEYS; 17373 keys2.forEach((key) => localStorage.removeItem(key)); 17374 } 17375 const logout = (component) => { 17376 clearPreferences("client"); 17377 const homeUrl = appRoute("home"); 17378 const api2 = new API(HTML$1.getApiConfiguration(component)); 17379 api2.get("/user/logout", {}).then(() => window.location.replace(homeUrl.toString())); 17380 }; 17381 var __defProp$3K = Object.defineProperty; 17382 var __getOwnPropDesc$3N = Object.getOwnPropertyDescriptor; 17383 var __decorateClass$3O = (decorators, target, key, kind) => { 17384 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3N(target, key) : target; 17385 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 17386 if (decorator = decorators[i2]) 17387 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 17388 if (kind && result) __defProp$3K(target, key, result); 17389 return result; 17390 }; 17391 const tagName$2y = "sonic-administrator-force-logout"; 17392 let SonicAdministratorForceLayout = class extends Subscriber$1(i$6) { 17393 constructor() { 17394 super(...arguments); 17395 this.isGuichet = false; 17396 } 17397 connectedCallback() { 17398 this.isGuichet = this.hasAncestorAttribute("is_guichet"); 17399 super.connectedCallback(); 17400 } 17401 render() { 17402 if (!this.isAdmin || this.isGuichet) return A$1; 17403 return b$1`<sonic-modal forceAction visible maxWidth="30rem"> 17404 <sonic-icon library="custom" name="hand" size="3xl" prefix="light" class="mb-2"></sonic-icon> 17405 <sonic-modal-title>Vous êtes connecté en tant qu'administrateur ou au guichet</sonic-modal-title> 17406 <sonic-modal-content>Il est obligatoire de vous déconnecter pour continuer !</sonic-modal-content> 17407 17408 <sonic-modal-actions> 17409 <sonic-button type="danger" @click=${() => logout(this)} hideModal> 17410 <sonic-icon library="custom" name="circle-xmark"></sonic-icon> 17411 Se déconnecter</sonic-button 17412 > 17413 </sonic-modal-actions> 17414 </sonic-modal>`; 17415 } 17416 }; 17417 SonicAdministratorForceLayout.styles = [ 17418 tailwind, 17419 i$9` 17420 .message-content { 17421 text-align: center; 17422 padding: 2rem 0 0; 17423 font-size: 1.3rem; 17424 width: 100%; 17425 } 17426 .message-content p { 17427 margin: 0.25em 0; 17428 } 17429 .message-content a { 17430 text-decoration: none; 17431 border: 2px solid; 17432 border-radius: var(--sc-btn-radius); 17433 font-weight: bold; 17434 padding: 0.25em 0.5em; 17435 margin: 0.25em auto; 17436 color: inherit; 17437 display: block; 17438 width: fit-content; 17439 } 17440 .message-content a:only-child { 17441 display: block; 17442 } 17443 ` 17444 ]; 17445 __decorateClass$3O([ 17446 bind$1("user.data.is_admin"), 17447 n$5({ type: Boolean }) 17448 ], SonicAdministratorForceLayout.prototype, "isAdmin", 2); 17449 __decorateClass$3O([ 17450 n$5({ type: Boolean }) 17451 ], SonicAdministratorForceLayout.prototype, "isGuichet", 2); 17452 SonicAdministratorForceLayout = __decorateClass$3O([ 17453 t$3(tagName$2y) 17454 ], SonicAdministratorForceLayout); 17455 var __decorate$E = function(decorators, target, key, desc) { 17456 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 17457 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 17458 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 17459 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 17460 }; 17461 const tagName$2x = "sonic-states"; 17462 let SonicStates = class SonicStates extends Subscriber$1(TemplatesContainer$1(i$6)) { 17463 constructor() { 17464 super(...arguments); 17465 this.state = ""; 17466 this.inverted = false;
17467 this.statePath = ""; 17468 this.onStateAssign = (value) => { 17469 this.state = value; 17470 this.requestUpdate(); 17471 }; 17472 } 17473 connectedCallback() { 17474 this.noShadowDom = ""; 17475 super.connectedCallback(); 17476 if (this.hasAttribute("data-path")) { 17477 this.statePath = this.getAttribute("data-path"); 17478 } 17479 if (this.statePath) { 17480 this.statePublisher = this.publisher; 17481 const split = this.statePath.split("."); 17482 for (const s2 of split) { 17483 this.statePublisher = this.statePublisher[s2]; 17484 } 17485 this.statePublisher.onAssign(this.onStateAssign); 17486 } 17487 } 17488 disconnectedCallback() { 17489 if (this.statePath) { 17490 this.statePublisher?.offAssign(this.onStateAssign); 17491 } 17492 super.disconnectedCallback(); 17493 } 17494 handleStates(state) { 17495 if (!this.states) 17496 return []; 17497 const templates = []; 17498 for (const [stateExpression, renderFn] of Object.entries(this.states)) { 17499 if (stateExpression === "fallback" || !renderFn) 17500 continue; 17501 const regexp = new RegExp(stateExpression); 17502 if (regexp.test(state)) { 17503 const params = regexp.exec(state) || [stateExpression]; 17504 params.shift(); 17505 templates.push(renderFn([...params])); 17506 } else { 17507 try { 17508 const pattern = new UrlPattern("(/)*" + stateExpression + "*"); 17509 if (pattern.match(state)) { 17510 const params = pattern.match(state) || {}; 17511 templates.push(renderFn(params)); 17512 } 17513 } catch (e2) { 17514 if (state.indexOf(stateExpression.replace(document.location.origin, "")) != -1) { 17515 templates.push(renderFn({})); 17516 } 17517 } 17518 } 17519 } 17520 if (templates.length == 0) { 17521 if (this.states?.fallback && this.isConnected) { 17522 templates.push(this.states.fallback()); 17523 } 17524 } 17525 return templates; 17526 } 17527 render() { 17528 let state = this.state; 17529 if (!Array.isArray(state) && Objects$1.isObject(state) || state === void 0) { 17530 state = ""; 17531 } 17532 const programmaticTemplates = this.handleStates(state); 17533 if (programmaticTemplates.length > 0) { 17534 return b$1`${programmaticTemplates}`; 17535 } 17536 const templates = []; 17537 for (const t2 of this.templatePartsList) { 17538 let path = t2.getAttribute(this.templateValueAttribute); 17539 let stateToMatch = state; 17540 if (this.inverted) { 17541 stateToMatch = path; 17542 path = state; 17543 } 17544 if (path == "") 17545 path = this.inverted ? ".*?" : "^$"; 17546 const regexp = new RegExp(path); 17547 if (regexp.test(stateToMatch + "")) { 17548 templates.push(t2); 17549 t2.removeAttribute("mode"); 17550 } else { 17551 const urlPattern2 = new UrlPattern(path); 17552 if (urlPattern2.names.length > 0 && urlPattern2.match(stateToMatch)) { 17553 t2.setAttribute("mode", "patternMatching"); 17554 templates.push(t2); 17555 } 17556 } 17557 } 17558 return b$1`${c$1(templates, (template, index) => { 17559 return index + (/* @__PURE__ */ new Date()).getTime(); 17560 }, (template) => { 17561 if (template?.hasAttribute("dataProviderExpression")) { 17562 const dataProviderExpression = template.getAttribute("dataProviderExpression"); 17563 let dataProvider = ""; 17564 let stateToMatch = state; 17565 let path = template.getAttribute(this.templateValueAttribute); 17566 if (this.inverted) { 17567 stateToMatch = path; 17568 path = state; 17569 } 17570 if (path == "") 17571 path = this.inverted ? "*" : "^$"; 17572 if (template.getAttribute("mode") == "patternMatching") { 17573 const matcher = new UrlPattern(path); 17574 const filler = new UrlPattern(dataProviderExpression); 17575 dataProvider = filler.stringify(matcher.match(stateToMatch)); 17576 } else { 17577 const regexp = new RegExp(path); 17578 const match = (stateToMatch + "").match(regexp); 17579 if (match) { 17580 dataProvider = match.shift()?.replace(regexp, dataProviderExpression); 17581 } 17582 } 17583 return b$1`<div 17584 style="display:contents" 17585 dataProvider="${dataProvider}" 17586 > 17587 ${o$2(template)} 17588 </div>`; 17589 } 17590 return o$2(template); 17591 })}`; 17592 } 17593 }; 17594 __decorate$E([ 17595 n$5() 17596 ], SonicStates.prototype, "state", void 0); 17597 __decorate$E([ 17598 n$5({ type: Boolean, reflect: true }) 17599 ], SonicStates.prototype, "inverted", void 0); 17600 __decorate$E([ 17601 n$5({ type: Object }) 17602 ], SonicStates.prototype, "states", void 0); 17603 SonicStates = __decorate$E([ 17604 t$3(tagName$2x) 17605 ], SonicStates); 17606 function* o$1(o2, f2) { 17607 if (void 0 !== o2) { 17608 let i2 = 0; 17609 for (const t2 of o2) yield f2(t2, i2++); 17610 } 17611 } 17612 var __decorate$D = function(decorators, target, key, desc) { 17613 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 17614 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 17615 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 17616 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 17617 }; 17618 const tagName$2w = "sonic-subscriber"; 17619 let SonicSubscriber = class SonicSubscriber extends Subscriber$1(i$6) { 17620 constructor() { 17621 super(...arguments); 17622 this.noAutofill = true; 17623 } 17624 connectedCallback() { 17625 this.noShadowDom = ""; 17626 super.connectedCallback(); 17627 } 17628 updated(changedProperties) { 17629 super.updated(changedProperties); 17630 if (this.children.length == 0) 17631 this.style.display = "none"; 17632 else 17633 this.style.display = "contents"; 17634 } 17635 render() { 17636 return b$1`<slot></slot> `; 17637 } 17638 }; 17639 SonicSubscriber = __decorate$D([ 17640 t$3(tagName$2w) 17641 ], SonicSubscriber); 17642 var __decorate$C = function(decorators, target, key, desc) { 17643 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 17644 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 17645 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 17646 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 17647 }; 17648 const tagName$2v = "sonic-list"; 17649 let List = class List extends Fetcher$1(Subscriber$1(TemplatesContainer$1(i$6))) { 17650 constructor() { 17651 super(...arguments); 17652 this.templateKey = "template"; 17653 this.idKey = "id"; 17654 this.limit = Number.POSITIVE_INFINITY; 17655 this.offset = 0; 17656 this.loadingSize = { width: 0, height: 0 }; 17657 } 17658 get items() { 17659 return this._items; 17660 } 17661 set items(value) { 17662 if (typeof value !== "function" && value !== void 0) 17663 return; 17664 this._items = value; 17665 this.requestUpdate(); 17666 } 17667 connectedCallback() { 17668 this.noShadowDom = ""; 17669 this.defferedDebug = this.hasAttribute("debug") || null; 17670 this.isFetchEnabled = this.hasAttribute("fetch"); 17671 if (this.isFetchEnabled) 17672 this.isLoading = true; 17673 super.connectedCallback(); 17674 } 17675 disconnectedCallback() { 17676 super.disconnectedCallback(); 17677 } 17678 renderLoader() { 17679 if (!(this.isLoading && this.loader !== void 0)) 17680 return A$1; 17681 const template = this.templateParts["skeleton"]; 17682 if (template) 17683 return A$1; 17684 const loader = this.loader === true || this.loader === "" ? "fixed" : this.loader; 17685 return b$1`<sonic-loader mode=${loader}></sonic-loader>`; 17686 } 17687 renderSkeleton() { 17688 if (this.skeleton) { 17689 return this.skeleton(); 17690 } 17691 const template = this.templateParts["skeleton"]; 17692 if (!(this.isLoading && template)) 17693 return A$1; 17694 return o$2(template); 17695 } 17696 renderSeparator() { 17697 if (this.separator) { 17698 return this.separator(); 17699 } 17700 const template = this.templateParts["separator"]; 17701 if (!template) 17702 return A$1; 17703 return o$2(template); 17704 } 17705 renderLoadingState() { 17706 return b$1`${this.renderSkeleton()} ${this.renderLoader()} `; 17707 } 17708 renderNoResultState() { 17709 return b$1` <div 17710 style="color: var(--sc-base-400); 17711 font-size: 1.5em; 17712 margin: 4rem 0; 17713 display: flex; 17714 gap: 0.5rem;" 17715 > 17716 <sonic-icon name="emoji-puzzled" size="lg"></sonic-icon 17717 ><span class="sonic-no-result-text" 17718 >${typeof this.props === "string" && this.props == "" ? "Aucun résultat" : this.props}</span 17719 > 17720 </div>`; 17721 } 17722 formatProps() { 17723 let props = this.props; 17724 if (props == null) { 17725 return null; 17726 } 17727 const response = props._sonic_http_response_; 17728 const extractValues = this.hasAttribute("extractValues"); 17729 if (!Array.isArray(props)) { 17730 if (extractValues) { 17731 props = Object.entries(props).map(([k2, v2]) => ({ key: k2, value: v2 })); 17732 } else { 17733 if (Objects$1.isObject(props) && Object.keys(props).length > 0 && (!response || response.ok)) 17734 props = [props]; 17735 else { 17736 props = []; 17737 } 17738 } 17739 } 17740 props = props.filter((e2) => e2 != null); 17741 if (response) 17742 props._sonic_http_response_ = response; 17743 return props; 17744 } 17745 updated(_changedProperties) { 17746 window.requestAnimationFrame(() => { 17747 if (!this.isLoading) { 17748 this.style.setProperty("--list-loader-height-display", "none"); 17749 return; 17750 } 17751 this.style.setProperty("--list-loader-height-display", "block"); 17752 this.loadingSize = this.getDisplayContentsSize(this); 17753 }); 17754 super.updated(_changedProperties); 17755 } 17756 getAllRenderableElements(root) { 17757 let elements = []; 17758 function collectElements(node) { 17759 if (node.nodeType === Node.ELEMENT_NODE) {
17760 const rect = node.getBoundingClientRect(); 17761 if (rect.width > 0 || rect.height > 0) { 17762 elements.push(node); 17763 } 17764 node.childNodes.forEach(collectElements); 17765 if (node.shadowRoot) { 17766 node.shadowRoot.childNodes.forEach(collectElements); 17767 } 17768 } 17769 } 17770 collectElements(root); 17771 return elements; 17772 } 17773 getDisplayContentsSize(element) { 17774 const elements = this.getAllRenderableElements(element); 17775 if (elements.length === 0) 17776 return { width: 0, height: 0 }; 17777 const rects = elements.map((el) => el.getBoundingClientRect()); 17778 const minX = Math.min(...rects.map((r2) => r2.left)); 17779 const maxX = Math.max(...rects.map((r2) => r2.right)); 17780 const minY = Math.min(...rects.map((r2) => r2.top)); 17781 const maxY = Math.max(...rects.map((r2) => r2.bottom)); 17782 return { width: maxX - minX, height: maxY - minY }; 17783 } 17784 render() { 17785 return b$1` 17786 ${this.renderContent()} 17787 <div 17788 style="grid-column: 1 / -1;min-height:${this.isLoading ? 0 : this.loadingSize.height}px; width:0;float:left;display: var(--list-loader-height-display);" 17789 ></div> 17790 `; 17791 } 17792 handleProgrammaticTemplates(item, metadata, key) { 17793 if (!this.items) 17794 return null; 17795 return b$1`<sonic-subscriber 17796 ?debug=${this.defferedDebug === true} 17797 .bindPublisher=${() => this.publisher[key]} 17798 .propertyMap?=${this.itemPropertyMap} 17799 dataProvider="${this.dataProvider}/list-item/${key}" 17800 > 17801 ${this.items(item, metadata)} 17802 </sonic-subscriber>`; 17803 } 17804 renderContent() { 17805 const isLoadingState = this.isLoading && !Array.isArray(this.props); 17806 if (isLoadingState) 17807 return this.renderLoadingState(); 17808 const isString = typeof this.props === "string"; 17809 if (isString) 17810 return this.renderNoResultState(); 17811 const propsIsBaddlyFormatted = !Objects$1.isObject(this.props); 17812 if (propsIsBaddlyFormatted) 17813 return b$1`<div></div>`; 17814 const props = this.formatProps(); 17815 if ((props?.length || 0) == 0) { 17816 if (this.noItems) { 17817 return this.noItems(); 17818 } 17819 this.templateParts["no-items"] = this.templateParts["no-items"] || this.templateParts["no-item"]; 17820 if (this.templateParts["no-items"]) { 17821 return o$2(this.templateParts["no-items"]); 17822 } 17823 } 17824 const templateCount = this.templateList.length; 17825 let counter = -1; 17826 const extractValues = this.hasAttribute("extractValues"); 17827 const separator = this.renderSeparator(); 17828 const length = props?.length || 0; 17829 const items = props?.slice(this.offset, this.offset + this.limit); 17830 return b$1` 17831 ${items?.map((item, index) => { 17832 if (item == null) 17833 return A$1; 17834 let key = index; 17835 let templatePart = null; 17836 if (typeof item == "object" && !Array.isArray(item)) { 17837 if (extractValues) 17838 key = item?.["key"]; 17839 const templatePartName = item[this.templateKey]; 17840 if (templatePartName && typeof templatePartName == "string") { 17841 templatePart = this.templateParts[templatePartName]; 17842 } 17843 } 17844 if (key == "_sonic_http_response_") 17845 return A$1; 17846 if (typeof key != "string" && typeof key != "number") 17847 return A$1; 17848 const isLastChild = index >= length - 1; 17849 const indexMod2 = index % 2; 17850 const childPublisher = this.publisher[key]; 17851 const metadata = { 17852 key, 17853 even: indexMod2 == 0, 17854 odd: indexMod2 == 1, 17855 onlyChild: length == 1, 17856 firstChild: index == 0, 17857 lastChild: isLastChild 17858 }; 17859 childPublisher._key_ = key + ""; 17860 childPublisher._metadata_ = { 17861 ...childPublisher._metadata_.get(), 17862 ...metadata 17863 }; 17864 const programmaticTemplate = this.handleProgrammaticTemplates(item, metadata, key); 17865 if (programmaticTemplate) { 17866 return b$1`${programmaticTemplate}${!isLastChild ? separator : A$1}`; 17867 } 17868 counter++; 17869 if (templatePart) 17870 counter = -1; 17871 return b$1` 17872 <sonic-subscriber 17873 ?debug=${this.defferedDebug === true} 17874 .bindPublisher=${function() { 17875 return childPublisher; 17876 }} 17877 .propertyMap?=${this.itemPropertyMap} 17878 dataProvider="${this.dataProvider}/list-item/${key}" 17879 > 17880 ${templatePart ? o$2(templatePart) : o$2(this.templateList[counter % templateCount])} 17881 </sonic-subscriber> 17882 ${!isLastChild ? separator : A$1} 17883 `; 17884 })} 17885 `; 17886 } 17887 }; 17888 __decorate$C([ 17889 n$5({ type: Object }) 17890 ], List.prototype, "itemPropertyMap", void 0); 17891 __decorate$C([ 17892 n$5({ type: String }) 17893 ], List.prototype, "templateKey", void 0); 17894 __decorate$C([ 17895 n$5({ type: String }) 17896 ], List.prototype, "idKey", void 0); 17897 __decorate$C([ 17898 n$5() 17899 ], List.prototype, "loader", void 0); 17900 __decorate$C([ 17901 n$5() 17902 ], List.prototype, "limit", void 0); 17903 __decorate$C([ 17904 n$5() 17905 ], List.prototype, "offset", void 0); 17906 __decorate$C([ 17907 n$5({ 17908 type: Function, 17909 attribute: false 17910 }) 17911 /**add a getter setter check if the value is a ListItems befor assignation */ 17912 ], List.prototype, "items", null); 17913 __decorate$C([ 17914 n$5({ type: Function, attribute: false }) 17915 ], List.prototype, "noItems", void 0); 17916 __decorate$C([ 17917 n$5({ type: Function, attribute: false }) 17918 ], List.prototype, "skeleton", void 0); 17919 __decorate$C([ 17920 n$5({ type: Function, attribute: false }) 17921 ], List.prototype, "separator", void 0); 17922 List = __decorate$C([ 17923 t$3(tagName$2v) 17924 ], List);
17925 var __decorate$B = function(decorators, target, key, desc) { 17926 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 17927 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 17928 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 17929 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 17930 }; 17931 var Queue_1; 17932 const tagName$2u = "sonic-queue"; 17933 let Queue = Queue_1 = class Queue extends Subscriber$1(i$6) { 17934 constructor() { 17935 super(...arguments); 17936 this.templates = null; 17937 this.items = null; 17938 this.noItems = null; 17939 this.skeleton = null; 17940 this.lastRequestTime = 0; 17941 this.key = ""; 17942 this.itemPropertyMap = null; 17943 this.cache = "default"; 17944 this.targetRequestDuration = 500; 17945 this.limit = 5; 17946 this.lazyBoundsRatio = 1; 17947 this.offset = 0; 17948 this.resultCount = 0; 17949 this.noLazyload = false; 17950 this.loader = "inline"; 17951 this.filteredFields = ""; 17952 this.instanceId = 0; 17953 this.localStorage = "disabled"; 17954 this.filterPublisher = null; 17955 this.filterTimeoutMs = 400; 17956 this.searchHash = ""; 17957 this.requestId = 0; 17958 this.isFirstRequest = true; 17959 this.updateFilteredContent = () => { 17960 const dataProvider = this.dataProviderExpression; 17961 const split = dataProvider.split("?"); 17962 split.shift(); 17963 const searchParams = new URLSearchParams(split.join("?")); 17964 const filterData = this.filterPublisher?.get(); 17965 const filteredFieldsArray = this.filteredFields.split(" "); 17966 for (const f2 in filterData) { 17967 let value = filterData[f2]; 17968 if (Array.isArray(value)) 17969 value = value.filter((v2) => v2 !== null); 17970 if (this.filteredFields && filteredFieldsArray.includes(f2) || value == null || value.toString() === "") 17971 continue; 17972 searchParams.set(f2, filterData[f2].toString()); 17973 } 17974 const searchHash = searchParams.toString(); 17975 if (searchHash == this.searchHash && !this.isFirstRequest) 17976 return; 17977 this.searchHash = searchHash; 17978 resetScrollRoot(this.resolveScrollRoot(), { x: 0, y: 0 }); 17979 for (const dataProvider2 of this.listDataProviders) { 17980 PublisherManager.getInstance().delete(dataProvider2); 17981 } 17982 this.listDataProviders = []; 17983 clearTimeout(this.filterTimeoutId); 17984 this.filterTimeoutId = setTimeout(async () => { 17985 const count = this.resultCount; 17986 this.props = null; 17987 this.requestId++; 17988 this.resultCount = count; 17989 await PublisherManager.getInstance().isLocalStrorageReady; 17990 window.requestAnimationFrame(() => this.next()); 17991 }, this.isFirstRequest ? 0 : this.filterTimeoutMs); 17992 this.isFirstRequest = false; 17993 }; 17994 this.scrollRoot = null; 17995 this.scrollSyncActive = false; 17996 this.mutationObserver = null; 17997 this.restoreGeneration = 0; 17998 this.dataProviderExpression = ""; 17999 this.invalidateOnPageShow = false; 18000 this.idKey = "id"; 18001 this.listDataProviders = []; 18002 this.nextHadEvent = false; 18003 } 18004 disconnectedCallback() { 18005 for (const dataProvider of this.listDataProviders) { 18006 PublisherManager.getInstance().delete(dataProvider); 18007 this.listDataProviders = []; 18008 } 18009 this.filterPublisher?.offInternalMutation(this.updateFilteredContent); 18010 this.props = null; 18011 this.limit = 5; 18012 this.offset = 0; 18013 this.resultCount = 0; 18014 this.searchHash = ""; 18015 this.requestId = 0; 18016 this.isFirstRequest = true; 18017 this.nextHadEvent = false; 18018 this.teardownScrollSync(); 18019 this.publisher.set({}); 18020 super.disconnectedCallback(); 18021 return; 18022 } 18023 async connectedCallback() { 18024 this.instanceId = Queue_1.instanceCounter++; 18025 this.localStorage = this.getAttribute("localStorage") || this.localStorage; 18026 this.filterTimeoutMs = parseInt(this.getAttribute("filterTimeoutMs") || "400"); 18027 this.removeAttribute("localStorage"); 18028 this.noShadowDom = ""; 18029 this.defferedDebug = this.hasAttribute("debug") || null; 18030 if (!this.dataProvider) 18031 this.dataProvider = this.dataProviderExpression || "sonic-queue-" + this.instanceId + "-" + Math.random().toString(36).substring(7); 18032 if (!this.dataProviderExpression) { 18033 this.dataProviderExpression = HTML.getAncestorAttributeValue(this.parentElement, "dataProvider") || ""; 18034 } 18035 this.ensureScrollSync(); 18036 super.connectedCallback(); 18037 this.publisher.set({}); 18038 this.key = this.getAttribute("key"); 18039 await PublisherManager.getInstance().isLocalStrorageReady; 18040 if (!this.templates) 18041 this.templates = Array.from(this.querySelectorAll("template")); 18042 this.lastRequestTime = (/* @__PURE__ */ new Date()).getTime(); 18043 this.configFilter(); 18044 } 18045 configFilter() { 18046 const dataFilterProvider = this.getAncestorAttributeValue("dataFilterProvider"); 18047 if (!dataFilterProvider) { 18048 this.next(); 18049 return; 18050 } 18051 this.filterPublisher = PublisherManager.getInstance().get(dataFilterProvider); 18052 this.filterPublisher?.onInternalMutation(this.updateFilteredContent); 18053 } 18054 resolveScrollRoot() {
18055 const ancestor = HTML.getScrollingAncestor(this); 18056 if (!ancestor || ancestor === document.documentElement || ancestor === document.body) { 18057 return window; 18058 } 18059 return ancestor; 18060 } 18061 isSafari() { 18062 return isSafariScrollEngine(); 18063 } 18064 ensureScrollSync() { 18065 if (!isSafariScrollEngine() || !this.isConnected) { 18066 return; 18067 } 18068 const root = this.resolveScrollRoot(); 18069 this.scrollRoot = root; 18070 watchScrollRoot(root); 18071 if (this.scrollSyncActive) { 18072 return; 18073 } 18074 this.scrollSyncActive = true; 18075 this.mutationObserver = new MutationObserver(() => { 18076 this.scheduleRestoreAfterChildren(); 18077 }); 18078 this.mutationObserver.observe(this, { 18079 childList: true, 18080 subtree: true, 18081 characterData: true 18082 }); 18083 } 18084 teardownScrollSync() { 18085 this.restoreGeneration++; 18086 this.mutationObserver?.disconnect(); 18087 this.mutationObserver = null; 18088 this.scrollSyncActive = false; 18089 this.scrollRoot = null; 18090 } 18091 /** 18092 * Attend la fin des updates Lit de la queue + sonic-list, puis 2 rAF (layout Safari). 18093 * Ne pas await updateComplete *dans* updated (deadlock) â on sort du cycle via void async. 18094 */ 18095 scheduleRestoreAfterChildren() { 18096 if (!isSafariScrollEngine() || !this.isConnected) { 18097 return; 18098 } 18099 const generation = ++this.restoreGeneration; 18100 void (async () => { 18101 await this.updateComplete; 18102 if (generation !== this.restoreGeneration || !this.isConnected) 18103 return; 18104 const lists = Array.from(this.querySelectorAll("sonic-list")); 18105 if (lists.length) { 18106 await Promise.all(lists.map((list) => list.updateComplete)); 18107 } 18108 if (generation !== this.restoreGeneration || !this.isConnected) 18109 return; 18110 await new Promise((r2) => requestAnimationFrame(() => r2())); 18111 await new Promise((r2) => requestAnimationFrame(() => r2())); 18112 if (generation !== this.restoreGeneration || !this.isConnected) 18113 return; 18114 const root = this.scrollRoot ?? this.resolveScrollRoot(); 18115 watchScrollRoot(root); 18116 restoreScrollRoot(root); 18117 })(); 18118 } 18119 updated(_changedProperties) { 18120 if (isSafariScrollEngine()) { 18121 this.ensureScrollSync(); 18122 const root = this.scrollRoot ?? this.resolveScrollRoot(); 18123 restoreScrollRoot(root); 18124 this.scheduleRestoreAfterChildren(); 18125 } 18126 super.updated(_changedProperties); 18127 } 18128 resetDuration() { 18129 this.lastRequestTime = (/* @__PURE__ */ new Date()).getTime(); 18130 } 18131 next(e2) { 18132 let offset = this.offset; 18133 const newTime = (/* @__PURE__ */ new Date()).getTime(); 18134 const requestDuration = newTime - this.lastRequestTime; 18135 if (!this.nextHadEvent && e2) { 18136 this.publisher.resultCount = 0; 18137 this.resultCount = 0; 18138 } 18139 this.nextHadEvent = !!e2; 18140 if (e2) { 18141 this.publisher.lastFetchedData = e2.detail.fetchedData; 18142 if (e2.detail.requestId < this.requestId) 18143 return; 18144 this.resultCount += e2.detail.props?.length || 0; 18145 if (!e2.detail.isFirstLoad || !e2.detail.props?.length || this.dataProviderExpression.indexOf("$offset") == -1) { 18146 this.publisher.resultCount = this.resultCount; 18147 return; 18148 } 18149 } 18150 if (!Array.isArray(this.props)) { 18151 const newProps2 = []; 18152 newProps2.resultCount = this.resultCount; 18153 newProps2.lastFetchedData = e2?.detail.fetchedData || {}; 18154 this.props = newProps2; 18155 } else { 18156 const props = this.props; 18157 const item = props[props.length - 1]; 18158 offset = parseInt(item.offset.toString()) + parseInt(item.limit.toString()); 18159 } 18160 if (requestDuration > 0 && e2 && !this.localStorage) { 18161 this.limit = Math.round(this.limit / requestDuration * this.targetRequestDuration); 18162 } 18163 if (this.limit < 1) 18164 this.limit = 1; 18165 if (this.limit > 15) 18166 this.limit = 15; 18167 let dataProvider = this.dataProviderExpression.replace("$offset", offset + "").replace("$limit", this.limit + ""); 18168 const split = dataProvider.split("?"); 18169 let endpoint = split.shift(); 18170 const searchParams = new URLSearchParams(split.join("?")); 18171 const filterData = this.filterPublisher?.get(); 18172 const filteredFieldsArray = this.filteredFields.split(" "); 18173 for (const f2 in filterData) { 18174 if (this.filteredFields && filteredFieldsArray.includes(f2) || filterData[f2] == null || filterData[f2] == "") 18175 continue; 18176 searchParams.set(f2, filterData[f2]); 18177 } 18178 if (!this.searchHash) 18179 this.searchHash = searchParams.toString(); 18180 endpoint = endpoint + "?" + searchParams.toString(); 18181 dataProvider = dataProvider + "_item_from_queue_" + this.instanceId; 18182 this.listDataProviders.push(dataProvider); 18183 const newProps = [ 18184 ...this.props, 18185 { 18186 id: searchParams.toString() + "/" + this.props.length, 18187 dataProvider, 18188 endPoint: endpoint, 18189 offset, 18190 limit: this.limit 18191 } 18192 ]; 18193 newProps.resultCount = this.resultCount; 18194 newProps.lastFetchedData = e2?.detail.fetchedData || {}; 18195 this.props = newProps; 18196 this.lastRequestTime = (/* @__PURE__ */ new Date()).getTime(); 18197 } 18198 render() { 18199 if (this.isSafari()) { 18200 this.scrollRoot = this.resolveScrollRoot(); 18201 this.ensureScrollSync(); 18202 } 18203 if (!Array.isArray(this.props)) { 18204 return A$1; 18205 } 18206 let lazyload = !this.noLazyload; 18207 if (this.props.length == 1) { 18208 lazyload = false;
18209 } 18210 this.style.display = "block"; 18211 return b$1` 18212 ${o$1(this.props, (item, index) => { 18213 const templates = index == 0 ? this.templates : this.templates?.filter((elt) => elt.getAttribute("data-value") != "no-item"); 18214 return b$1` 18215 <sonic-list 18216 fetch 18217 loader="${this.loader}" 18218 cache=${this.cache} 18219 displayContents 18220 lazyBoundsRatio=${this.lazyBoundsRatio} 18221 ?lazyload=${lazyload} 18222 ?invalidateOnPageShow=${this.invalidateOnPageShow} 18223 localStorage=${this.localStorage} 18224 requestId=${this.requestId} 18225 .itemPropertyMap=${this.itemPropertyMap} 18226 ?debug=${this.defferedDebug === true} 18227 @load=${this.next} 18228 key=${this.key} 18229 @loading=${this.resetDuration} 18230 dataProvider="${item.dataProvider}" 18231 endPoint="${item.endPoint}" 18232 idKey=${this.idKey} 18233 .templates=${templates} 18234 .items=${this.items} 18235 .noItems=${index == 0 ? this.noItems : void 0} 18236 .skeleton=${this.skeleton} 18237 > 18238 </sonic-list> 18239 `; 18240 })} 18241 `; 18242 } 18243 }; 18244 Queue.instanceCounter = 0; 18245 __decorate$B([ 18246 n$5({ type: Array }) 18247 ], Queue.prototype, "templates", void 0); 18248 __decorate$B([ 18249 n$5({ type: Function, attribute: false }) 18250 ], Queue.prototype, "items", void 0); 18251 __decorate$B([ 18252 n$5({ type: Function, attribute: false }) 18253 ], Queue.prototype, "noItems", void 0); 18254 __decorate$B([ 18255 n$5({ type: Function, attribute: false }) 18256 ], Queue.prototype, "skeleton", void 0); 18257 __decorate$B([ 18258 n$5({ type: Object }) 18259 ], Queue.prototype, "itemPropertyMap", void 0); 18260 __decorate$B([ 18261 n$5() 18262 ], Queue.prototype, "cache", void 0); 18263 __decorate$B([ 18264 n$5() 18265 ], Queue.prototype, "targetRequestDuration", void 0); 18266 __decorate$B([ 18267 n$5() 18268 ], Queue.prototype, "limit", void 0); 18269 __decorate$B([ 18270 n$5() 18271 ], Queue.prototype, "lazyBoundsRatio", void 0); 18272 __decorate$B([ 18273 n$5() 18274 ], Queue.prototype, "offset", void 0); 18275 __decorate$B([ 18276 n$5() 18277 ], Queue.prototype, "resultCount", void 0); 18278 __decorate$B([ 18279 n$5({ type: Boolean }) 18280 ], Queue.prototype, "noLazyload", void 0); 18281 __decorate$B([ 18282 n$5({ type: String }) 18283 ], Queue.prototype, "loader", void 0); 18284 __decorate$B([ 18285 n$5() 18286 ], Queue.prototype, "filteredFields", void 0); 18287 __decorate$B([ 18288 n$5({ type: String }) 18289 ], Queue.prototype, "dataProviderExpression", void 0); 18290 __decorate$B([ 18291 n$5({ type: Boolean }) 18292 ], Queue.prototype, "invalidateOnPageShow", void 0); 18293 __decorate$B([ 18294 n$5({ type: String }) 18295 ], Queue.prototype, "idKey", void 0); 18296 Queue = Queue_1 = __decorate$B([ 18297 t$3(tagName$2u) 18298 ], Queue); 18299 var __defProp$3J = Object.defineProperty; 18300 var __getOwnPropDesc$3M = Object.getOwnPropertyDescriptor; 18301 var __decorateClass$3N = (decorators, target, key, kind) => { 18302 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3M(target, key) : target; 18303 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18304 if (decorator = decorators[i2]) 18305 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18306 if (kind && result) __defProp$3J(target, key, result); 18307 return result; 18308 }; 18309 const tagName$2t = "sonic-no-result"; 18310 let SonicComponent$j = class SonicComponent extends Subscriber$1(i$6) { 18311 constructor() { 18312 super(...arguments); 18313 this.wording_aucun_resultats = ""; 18314 this.size = "xl"; 18315 this.align = "left"; 18316 } 18317 render() { 18318 return b$1`<div> 18319 <div class="flex gap-[.3em] ${this.align == "center" ? "justify-center text-center" : ""}"> 18320 <sonic-icon library="custom" name="face-thinking" size="lg"></sonic-icon> 18321 <div> 18322 <div>${this.text || this.wording_aucun_resultats}</div> 18323 <slot></slot> 18324 </div> 18325 </div> 18326 <slot name="suffix"></slot> 18327 </div> `; 18328 } 18329 }; 18330 SonicComponent$j.styles = [ 18331 tailwind, 18332 fontSize, 18333 i$9` 18334 :host { 18335 grid-column: 1 / -1; 18336 margin-top: 2em; 18337 margin-bottom: 2em; 18338 padding-left: 0.25em; 18339 display: block; 18340 color: var(--sc-base-400); 18341 } 18342 ` 18343 ]; 18344 __decorateClass$3N([ 18345 n$5({ type: String }) 18346 ], SonicComponent$j.prototype, "text", 2); 18347 __decorateClass$3N([ 18348 n$5({ type: String }) 18349 ], SonicComponent$j.prototype, "wording_aucun_resultats", 2); 18350 __decorateClass$3N([ 18351 n$5({ type: String, reflect: true }) 18352 ], SonicComponent$j.prototype, "size", 2); 18353 __decorateClass$3N([ 18354 n$5({ type: String }) 18355 ], SonicComponent$j.prototype, "align", 2); 18356 SonicComponent$j = __decorateClass$3N([ 18357 t$3(tagName$2t) 18358 ], SonicComponent$j); 18359 var __defProp$3I = Object.defineProperty; 18360 var __getOwnPropDesc$3L = Object.getOwnPropertyDescriptor; 18361 var __decorateClass$3M = (decorators, target, key, kind) => { 18362 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3L(target, key) : target; 18363 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18364 if (decorator = decorators[i2]) 18365 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18366 if (kind && result) __defProp$3I(target, key, result); 18367 return result; 18368 }; 18369 let Title = class extends Subscriber$1(i$6) { 18370 constructor() { 18371 super(...arguments); 18372 this.machineName = false;
18373 this.title = ""; 18374 this.over_title = ""; 18375 this.sub_title = ""; 18376 this.alt_title = ""; 18377 this.noOverTitle = false; 18378 } 18379 getTitle() { 18380 const altTitle = this.alt_title; 18381 return altTitle ? altTitle : this.title; 18382 } 18383 connectedCallback() { 18384 if (!this.hasAttribute("subDataProvider")) this.setAttribute("subDataProvider", "edito"); 18385 super.connectedCallback(); 18386 } 18387 render() { 18388 if (this.machineName) { 18389 return b$1`<div class="title">${this.title}</div> `; 18390 } 18391 return b$1` 18392 ${this.over_title && !this.noOverTitle ? b$1`<div class="surtitle">${this.over_title}</div>` : A$1} 18393 <div class="title">${o$6(this.getTitle())}</div> 18394 ${this.sub_title ? b$1`<div class="subtitle">${this.sub_title}</div>` : A$1} 18395 `; 18396 } 18397 }; 18398 Title.styles = [ 18399 fontSize, 18400 i$9` 18401 :host { 18402 line-height: 1.15; 18403 display: block; 18404 } 18405 18406 .surtitle { 18407 font-size: clamp(11px, 0.7em, 16px); 18408 margin-bottom: 0.35em; 18409 line-height: 1.15; 18410 font-family: var(--sc-font-family-base); 18411 font-weight: var(--sc-font-weight-base); 18412 } 18413 18414 .title { 18415 font-size: max(13px, 1em); 18416 max-width: 64ch; 18417 font-weight: bold; 18418 line-height: 1.15; 18419 text-wrap: pretty; 18420 /*margin-bottom: 0.15em;*/ 18421 } 18422 18423 .subtitle { 18424 font-size: max(11px, 0.8em); 18425 font-weight: bold; 18426 line-height: 1.15; 18427 text-wrap: pretty; 18428 } 18429 ` 18430 ]; 18431 __decorateClass$3M([ 18432 n$5({ type: String, reflect: true }) 18433 ], Title.prototype, "size", 2); 18434 __decorateClass$3M([ 18435 n$5({ type: Boolean, reflect: true }) 18436 ], Title.prototype, "machineName", 2); 18437 __decorateClass$3M([ 18438 n$5({ type: String }) 18439 ], Title.prototype, "title", 2); 18440 __decorateClass$3M([ 18441 n$5({ type: String }) 18442 ], Title.prototype, "over_title", 2); 18443 __decorateClass$3M([ 18444 n$5({ type: String }) 18445 ], Title.prototype, "sub_title", 2); 18446 __decorateClass$3M([ 18447 n$5({ type: String }) 18448 ], Title.prototype, "alt_title", 2); 18449 __decorateClass$3M([ 18450 n$5({ type: Boolean }) 18451 ], Title.prototype, "noOverTitle", 2); 18452 Title = __decorateClass$3M([ 18453 t$3("sonic-product-title") 18454 ], Title); 18455 var __defProp$3H = Object.defineProperty; 18456 var __getOwnPropDesc$3K = Object.getOwnPropertyDescriptor; 18457 var __decorateClass$3L = (decorators, target, key, kind) => { 18458 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3K(target, key) : target; 18459 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18460 if (decorator = decorators[i2]) 18461 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18462 if (kind && result) __defProp$3H(target, key, result); 18463 return result; 18464 }; 18465 let eventLink = class extends Button { 18466 constructor() { 18467 super(...arguments); 18468 this.slug = ""; 18469 this.hash = ""; 18470 this.multiple = null; 18471 } 18472 connectedCallback() { 18473 if (this.customHref) { 18474 this.href = this.customHref; 18475 } 18476 super.connectedCallback(); 18477 } 18478 willUpdate(changedProperties) { 18479 const id = this.id; 18480 let href = null; 18481 if (changedProperties.has("slug") || changedProperties.has("multiple")) { 18482 if (!this.customHref) { 18483 href = appRoute(this.subPath ? `event.${this.subPath}` : "event"); 18484 const isSessionLink = this.multiple === null; 18485 if (isSessionLink) href.query({ session: this.id }); 18486 href.fill({ id, slug: this.slug }); 18487 } 18488 } 18489 this.href = href?.toString() || this.href; 18490 super.willUpdate(changedProperties); 18491 } 18492 }; 18493 __decorateClass$3L([ 18494 n$5({ type: String }) 18495 ], eventLink.prototype, "slug", 2); 18496 __decorateClass$3L([ 18497 n$5({ type: String }) 18498 ], eventLink.prototype, "customHref", 2); 18499 __decorateClass$3L([ 18500 n$5({ type: String }) 18501 ], eventLink.prototype, "entity_type", 2); 18502 __decorateClass$3L([ 18503 n$5({ type: String }) 18504 ], eventLink.prototype, "hash", 2); 18505 __decorateClass$3L([ 18506 n$5({ type: String }) 18507 ], eventLink.prototype, "subPath", 2); 18508 __decorateClass$3L([ 18509 n$5({ type: Boolean }) 18510 ], eventLink.prototype, "multiple", 2); 18511 eventLink = __decorateClass$3L([ 18512 t$3("sonic-event-link") 18513 ], eventLink); 18514 const styles$3 = i$9` 18515 :host { 18516 display: inline-flex; 18517 align-items: center; 18518 gap:.35em; 18519 flex-wrap:wrap; 18520 } 18521 .city-name { 18522 font-weight: 600; 18523 } 18524 sonic-icon{ 18525 margin-right:.2em; 18526 } 18527`; 18528 var __defProp$3G = Object.defineProperty; 18529 var __getOwnPropDesc$3J = Object.getOwnPropertyDescriptor; 18530 var __decorateClass$3K = (decorators, target, key, kind) => { 18531 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3J(target, key) : target; 18532 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18533 if (decorator = decorators[i2]) 18534 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18535 if (kind && result) __defProp$3G(target, key, result); 18536 return result; 18537 }; 18538 let SonicLocation = class extends i$6 { 18539 constructor() { 18540 super(...arguments); 18541 this.displayCity = false;
18542 this.location_city_name = ""; 18543 this.location_name = ""; 18544 } 18545 render() { 18546 const showCity = this.location_city_name && this.displayCity; 18547 return b$1` 18548 <sonic-if ?condition=${showCity === true}> 18549 <span class="city-name"> ${this.location_city_name}</span> 18550 <sonic-if ?condition=${!!this.location_name}> ⢠</sonic-if> 18551 </sonic-if> 18552 <span>${this.location_name}</span> 18553 `; 18554 } 18555 }; 18556 SonicLocation.styles = [styles$3]; 18557 __decorateClass$3K([ 18558 n$5({ type: Boolean }) 18559 ], SonicLocation.prototype, "displayCity", 2); 18560 __decorateClass$3K([ 18561 n$5({ type: String }) 18562 ], SonicLocation.prototype, "location_city_name", 2); 18563 __decorateClass$3K([ 18564 n$5({ type: String }) 18565 ], SonicLocation.prototype, "location_name", 2); 18566 SonicLocation = __decorateClass$3K([ 18567 t$3("sonic-event-location") 18568 ], SonicLocation); 18569 var __defProp$3F = Object.defineProperty; 18570 var __getOwnPropDesc$3I = Object.getOwnPropertyDescriptor; 18571 var __decorateClass$3J = (decorators, target, key, kind) => { 18572 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3I(target, key) : target; 18573 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18574 if (decorator = decorators[i2]) 18575 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18576 if (kind && result) __defProp$3F(target, key, result); 18577 return result; 18578 }; 18579 let Hall = class extends /*Subscriber*/ 18580 i$6 { 18581 constructor() { 18582 super(...arguments); 18583 this.room_display_name = false; 18584 this.room_name = ""; 18585 this.room_placing_type_label = ""; 18586 this.room_free_placing_add_on_label = ""; 18587 this.noPlacement = false; 18588 } 18589 render() { 18590 const name = this.room_display_name == true ? b$1`<span class="inline">${this.room_name}</span>` : ""; 18591 const separator1 = this.room_name && this.room_display_name && this.room_placing_type_label ? " â " : ""; 18592 const separator2 = this.room_free_placing_add_on_label && (this.room_name && this.room_display_name || this.room_placing_type_label) ? " â " : ""; 18593 const firstPart = name ? b$1` ${name} ${separator1} ` : ``; 18594 if (this.noPlacement && name) return b$1`${name}`; 18595 return b$1`${firstPart}<span class="inline" 18596 >${this.room_placing_type_label} ${separator2} ${this.room_free_placing_add_on_label}</span 18597 >`; 18598 } 18599 }; 18600 Hall.styles = [tailwind]; 18601 __decorateClass$3J([ 18602 n$5({ type: Boolean }) 18603 ], Hall.prototype, "room_display_name", 2); 18604 __decorateClass$3J([ 18605 n$5({ type: String }) 18606 ], Hall.prototype, "room_name", 2); 18607 __decorateClass$3J([ 18608 n$5({ type: String }) 18609 ], Hall.prototype, "room_placing_type_label", 2); 18610 __decorateClass$3J([ 18611 n$5({ type: String }) 18612 ], Hall.prototype, "room_free_placing_add_on_label", 2); 18613 __decorateClass$3J([ 18614 n$5({ type: Boolean }) 18615 ], Hall.prototype, "noPlacement", 2); 18616 Hall = __decorateClass$3J([ 18617 t$3("sonic-event-hall") 18618 ], Hall); 18619 var __decorate$A = function(decorators, target, key, desc) { 18620 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 18621 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 18622 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 18623 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 18624 }; 18625 const tagName$2s = "sonic-tooltip"; 18626 let Tooltip = class Tooltip extends i$6 { 18627 constructor() { 18628 super(); 18629 this.label = ""; 18630 this.disabled = false; 18631 this.focusable = false; 18632 this.lastKeyWasTab = false; 18633 this.handleKeyDown = (e2) => { 18634 if (e2.key === "Tab") { 18635 this.lastKeyWasTab = true; 18636 } 18637 }; 18638 this.handleMouseDown = () => { 18639 this.lastKeyWasTab = false; 18640 this.classList.remove("keyboard-focus"); 18641 }; 18642 this.handleFocusIn = () => { 18643 if (this.lastKeyWasTab) { 18644 this.classList.add("keyboard-focus"); 18645 } 18646 this.lastKeyWasTab = false;
18647 }; 18648 this.handleFocusOut = () => { 18649 this.classList.remove("keyboard-focus"); 18650 this.lastKeyWasTab = false; 18651 }; 18652 this.boundHandleKeyDown = this.handleKeyDown.bind(this); 18653 this.boundHandleMouseDown = this.handleMouseDown.bind(this); 18654 } 18655 connectedCallback() { 18656 super.connectedCallback(); 18657 this.addEventListener("focusin", this.handleFocusIn); 18658 this.addEventListener("focusout", this.handleFocusOut); 18659 document.addEventListener("keydown", this.boundHandleKeyDown, true); 18660 document.addEventListener("mousedown", this.boundHandleMouseDown, true); 18661 } 18662 disconnectedCallback() { 18663 super.disconnectedCallback(); 18664 this.removeEventListener("focusin", this.handleFocusIn); 18665 this.removeEventListener("focusout", this.handleFocusOut); 18666 document.removeEventListener("keydown", this.boundHandleKeyDown, true); 18667 document.removeEventListener("mousedown", this.boundHandleMouseDown, true); 18668 } 18669 willUpdate(_changedProperties) { 18670 if (_changedProperties.has("disabled")) { 18671 const wasDisabledBefore = _changedProperties.get("disabled") === true; 18672 if (this.disabled) { 18673 this.setAttribute("tabindex", "-1"); 18674 this.classList.remove("keyboard-focus"); 18675 } else if (!this.disabled && wasDisabledBefore) { 18676 if (this.focusable) { 18677 this.setAttribute("tabindex", "0"); 18678 } else { 18679 this.removeAttribute("tabindex"); 18680 } 18681 } 18682 } 18683 if (_changedProperties.has("focusable")) { 18684 if (this.focusable && !this.disabled) { 18685 this.setAttribute("tabindex", "0"); 18686 } else if (!this.focusable && !this.disabled) { 18687 this.removeAttribute("tabindex"); 18688 } 18689 } 18690 super.willUpdate(_changedProperties); 18691 } 18692 render() { 18693 const disabledClass = this.disabled || this.label == "" ? "disabled" : ""; 18694 return b$1`<div 18695 data-tooltip-text="${this.label.trim().replace(" ", " ")}" 18696 class="tooltip ${disabledClass}" 18697 > 18698 <slot></slot> 18699 </div>`; 18700 } 18701 }; 18702 Tooltip.styles = [ 18703 i$9` 18704 :host { 18705 position: relative; 18706 display: inline-flex; 18707 align-items: center; 18708 text-align: center; 18709 --sc-tooltip-fw: var(--sc-font-weight-base, 400); 18710 --sc-tooltip-position: calc(100% + 0.25rem); 18711 } 18712 18713 .tooltip:before { 18714 position: absolute; 18715 content: attr(data-tooltip-text); 18716 font-size: 0.85rem; 18717 display: block; 18718 opacity: 0; 18719 pointer-events: none; 18720 background: var(--sc-base-content, #000); 18721 padding: 0.32rem 0.55rem; 18722 border-radius: var(--sc-rounded); 18723 color: var(--sc-base, #fff); 18724 z-index: 999; 18725 line-height: 1.1; 18726 width: max-content; 18727 max-width: 18rem; 18728 white-space: pre-line; 18729 font-weight: var(--sc-tooltip-fw); 18730 transition: 0.2s; 18731 scale: 0.9; 18732 will-change: opacity, transform; 18733 } 18734 18735 :host(:focus-visible) .tooltip:before, 18736 :host(.keyboard-focus) .tooltip:before, 18737 .tooltip:hover:before { 18738 opacity: 1; 18739 scale: 1; 18740 } 18741 18742 .disabled:before { 18743 opacity: 0 !important; 18744 scale: 0.9 !important; 18745 } 18746 18747 :host(:not([placement])) .tooltip:before, 18748 :host([placement="top"]) .tooltip:before { 18749 bottom: var(--sc-tooltip-position); 18750 left: 50%; 18751 transform: translateX(-50%); 18752 } 18753 18754 :host([placement="top-end"]) .tooltip:before { 18755 bottom: var(--sc-tooltip-position); 18756 right: 0; 18757 } 18758 :host([placement="top-start"]) .tooltip:before { 18759 bottom: var(--sc-tooltip-position); 18760 left: 0; 18761 } 18762 18763 :host([placement="bottom"]) .tooltip:before { 18764 top: var(--sc-tooltip-position); 18765 left: 50%; 18766 transform: translateX(-50%); 18767 } 18768 18769 :host([placement="bottom-start"]) .tooltip:before { 18770 top: var(--sc-tooltip-position); 18771 left: 0; 18772 } 18773 :host([placement="bottom-end"]) .tooltip:before { 18774 top: var(--sc-tooltip-position); 18775 right: 0; 18776 } 18777 18778 :host([placement="left"]) .tooltip:before { 18779 top: 50%; 18780 right: var(--sc-tooltip-position); 18781 transform: translateY(-50%); 18782 } 18783 18784 :host([placement="left-start"]) .tooltip:before { 18785 top: 0; 18786 right: var(--sc-tooltip-position); 18787 } 18788 18789 :host([placement="left-end"]) .tooltip:before { 18790 bottom: 0; 18791 right: var(--sc-tooltip-position); 18792 } 18793 18794 :host([placement="right"]) .tooltip:before { 18795 top: 50%; 18796 transform: translateY(-50%); 18797 left: var(--sc-tooltip-position); 18798 } 18799 18800 :host([placement="right-start"]) .tooltip:before { 18801 top: 0; 18802 left: var(--sc-tooltip-position); 18803 } 18804 18805 :host([placement="right-end"]) .tooltip:before { 18806 bottom: 0; 18807 left: var(--sc-tooltip-position); 18808 } 18809 ` 18810 ]; 18811 __decorate$A([ 18812 n$5({ type: String }) 18813 ], Tooltip.prototype, "label", void 0); 18814 __decorate$A([ 18815 n$5({ type: String, reflect: true }) 18816 ], Tooltip.prototype, "placement", void 0); 18817 __decorate$A([ 18818 n$5({ type: Boolean }) 18819 ], Tooltip.prototype, "disabled", void 0); 18820 __decorate$A([ 18821 n$5({ type: Boolean })
18822 ], Tooltip.prototype, "focusable", void 0); 18823 Tooltip = __decorate$A([ 18824 t$3(tagName$2s) 18825 ], Tooltip); 18826 var __defProp$3E = Object.defineProperty; 18827 var __getOwnPropDesc$3H = Object.getOwnPropertyDescriptor; 18828 var __decorateClass$3I = (decorators, target, key, kind) => { 18829 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3H(target, key) : target; 18830 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18831 if (decorator = decorators[i2]) 18832 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18833 if (kind && result) __defProp$3E(target, key, result); 18834 return result; 18835 }; 18836 let LocationHall = class extends Subscriber$1(i$6) { 18837 constructor() { 18838 super(...arguments); 18839 this.room = null; 18840 this.location = null; 18841 this.placing_type = null; 18842 this.placing_addon = null; 18843 this.noPlacement = false; 18844 this.noIcon = false; 18845 this.size = "inherit"; 18846 this.addressDisplay = "none"; 18847 this.hasAddress = false; 18848 this.mapLink = null; 18849 } 18850 getMapsLink(location2) { 18851 const address = this.getAddress(location2); 18852 const addressWithAddress2 = this.getAddress(location2, true); 18853 const encoded = encodeURIComponent(location2?.title + " " + address); 18854 const isIOS = /iPhone|iPad|iPod/.test(navigator.userAgent); 18855 return { 18856 label: isIOS ? t("LIB_search_in_maps_apple") : t("LIB_search_in_maps_google"), 18857 link: isIOS ? `http://maps.apple.com/?q=${encoded}` : `https://www.google.com/maps/search/?api=1&query=${encoded}`, 18858 addressFull: addressWithAddress2 18859 }; 18860 } 18861 getAddress(location2, withAddress2 = false) { 18862 if (!location2) return ""; 18863 if (withAddress2) { 18864 return `${location2.address} ${location2.address2} ${location2.postal_code} ${location2.city}`; 18865 } 18866 return `${location2.address} ${location2.postal_code} ${location2.city}`; 18867 } 18868 willUpdate(_changedProperties) { 18869 if (_changedProperties.has("location")) { 18870 this.hasAddress = !!(this.location?.address || this.location?.address2 || this.location?.city || this.location?.postal_code); 18871 this.mapLink = this.hasAddress ? this.getMapsLink(this.location) : null; 18872 } 18873 } 18874 handleClickMaps(e2) { 18875 e2.stopPropagation(); 18876 } 18877 render() { 18878 this.placing_type = this.placing_type || this.room; 18879 this.placing_addon = this.placing_addon || this.room; 18880 if (!(this.location?.city && this.room?.display_city || this.location?.title || this.room?.display_name && this.room?.title || this.placing_type?.placing_type_label || this.placing_addon?.free_placing_add_on_label)) { 18881 this.style.display = "none"; 18882 return A$1; 18883 } 18884 this.style.removeProperty("display"); 18885 return b$1` 18886 <div class="inline-flex gap-[.35em] "> 18887 ${!this.noIcon ? b$1` 18888 <div class="shrink-0"> 18889 <sonic-icon library="custom" name="location-dot" class="text-center"></sonic-icon> 18890 </div> 18891 ` : A$1} 18892 18893 <div class="self-center"> 18894 <slot name="prefix"></slot> 18895 <sonic-if .condition=${!!this.location}> ${this.renderLocation()} </sonic-if> 18896 <sonic-if 18897 .condition=${!!(this.room && this.room.display_name || this.placing_type || this.placing_addon?.free_placing_add_on_label)} 18898 > 18899 <sonic-if 18900 .condition=${!!((this.location?.city && this.room?.display_city || this.location?.title) && (this.room?.display_name && this.room?.title || this.placing_type?.placing_type_label || this.placing_addon?.free_placing_add_on_label))} 18901 > / </sonic-if 18902 > 18903 <sonic-event-hall 18904 ?noPlacement=${this.noPlacement} 18905 .room_display_name=${this.room?.display_name} 18906 room_name=${this.room?.title || ""} 18907 room_placing_type_label=${this.placing_type?.placing_type_label || ""} 18908 room_free_placing_add_on_label=${this.placing_addon?.free_placing_add_on_label || ""} 18909 ></sonic-event-hall> 18910 </sonic-if> 18911 18912 ${this.renderTextAddress()} 18913 </div> 18914 </div> 18915 `; 18916 } 18917 renderTextAddress() { 18918 return this.addressDisplay === "text" && this.hasAddress ? b$1` 18919 <div class=" text-neutral-500 "> 18920 <sonic-tooltip label=${this.mapLink?.label} class="text-left"> 18921 <a href=${this.mapLink?.link} target="_blank" class="hover:underline "> ${this.mapLink?.addressFull} </a> 18922 </sonic-tooltip> 18923 </div> 18924 ` : A$1; 18925 } 18926 renderLocation() { 18927 if (this.addressDisplay === "hoverLink" && this.hasAddress) { 18928 return b$1`<sonic-tooltip label="${this.mapLink?.addressFull} ${this.mapLink?.label}"> 18929 <a 18930 class="underline hover:no-underline" 18931 @click=${this.handleClickMaps} 18932 href=${this.mapLink?.link} 18933 target="_blank" 18934 > 18935 <sonic-event-location 18936 class="block" 18937 location_city_name=${this.location?.city || ""} 18938 location_name=${this.location?.title || ""} 18939 ?displayCity=${this.room?.display_city} 18940 ></sonic-event-location> 18941 </a> 18942 </sonic-tooltip>`; 18943 } else { 18944 return b$1` 18945 <sonic-event-location 18946 location_city_name=${this.location?.city || ""} 18947 location_name=${this.location?.title || ""} 18948 ?displayCity=${this.room?.display_city} 18949 ></sonic-event-location> 18950 `; 18951 } 18952 } 18953 }; 18954 LocationHall.styles = [tailwind, fontSize]; 18955 __decorateClass$3I([ 18956 n$5({ type: Object }) 18957 ], LocationHall.prototype, "room", 2); 18958 __decorateClass$3I([ 18959 n$5({ type: Object }) 18960 ], LocationHall.prototype, "location", 2); 18961 __decorateClass$3I([ 18962 n$5({ type: Object }) 18963 ], LocationHall.prototype, "placing_type", 2); 18964 __decorateClass$3I([ 18965 n$5({ type: Object }) 18966 ], LocationHall.prototype, "placing_addon", 2); 18967 __decorateClass$3I([ 18968 n$5({ type: Boolean }) 18969 ], LocationHall.prototype, "noPlacement", 2); 18970 __decorateClass$3I([ 18971 n$5({ type: Boolean }) 18972 ], LocationHall.prototype, "noIcon", 2); 18973 __decorateClass$3I([ 18974 n$5({ type: String, reflect: true }) 18975 ], LocationHall.prototype, "size", 2); 18976 __decorateClass$3I([ 18977 n$5({ type: String }) 18978 ], LocationHall.prototype, "addressDisplay", 2); 18979 __decorateClass$3I([ 18980 r$5() 18981 ], LocationHall.prototype, "hasAddress", 2); 18982 __decorateClass$3I([ 18983 r$5() 18984 ], LocationHall.prototype, "mapLink", 2); 18985 LocationHall = __decorateClass$3I([ 18986 t$3("sonic-event-location-hall") 18987 ], LocationHall); 18988 var __decorate$z = function(decorators, target, key, desc) { 18989 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 18990 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 18991 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 18992 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 18993 }; 18994 const tagName$2r = "sonic-image"; 18995 let Image = class Image extends i$6 { 18996 constructor() { 18997 super(...arguments); 18998 this.rounded = "none"; 18999 this.src = ""; 19000 this.alt = ""; 19001 this.loading = "lazy"; 19002 this.ratio = "auto"; 19003 this.objectPosition = "center center"; 19004 this.imageRendering = "auto"; 19005 this.cover = false;
19006 } 19007 firstUpdated(changedProperties) { 19008 if (this.transition) { 19009 const img = this.shadowRoot?.querySelector("img"); 19010 if (!img) 19011 return; 19012 img.onload = function() { 19013 img.classList.add("loaded"); 19014 }; 19015 } 19016 super.firstUpdated(changedProperties); 19017 } 19018 render() { 19019 const imgStyles = { 19020 aspectRatio: this.cover ? "auto" : this.ratio, 19021 imageRendering: this.imageRendering, 19022 objectPosition: this.objectPosition 19023 }; 19024 return b$1`<div part="image"> 19025 <picture part="picture" 19026 ><img 19027 part="img" 19028 src="${this.src}" 19029 loading="${this.loading}" 19030 alt="${this.alt}" 19031 style=${o$3(imgStyles)} 19032 /></picture> 19033 </div>`; 19034 } 19035 }; 19036 Image.styles = [ 19037 i$9` 19038 :host { 19039 --sc-img-radius: 0; 19040 --sc-img-bg: var(--sc-placeholder-bg, rgba(12, 12, 12, 0.05)); 19041 border-radius: var(--sc-img-radius); 19042 display: block; 19043 width: 100%; 19044 background: var(--sc-img-bg); 19045 } 19046 19047 img { 19048 width: 100%; 19049 vertical-align: middle; 19050 object-fit: cover; 19051 } 19052 19053 img[src=""] { 19054 visibility: hidden; 19055 } 19056 19057 /*Rounded*/ 19058 :host([rounded]) { 19059 --sc-img-radius: var(--sc-rounded); 19060 overflow: hidden; 19061 } 19062 :host([rounded="sm"]) { 19063 --sc-img-radius: var(--sc-rounded-sm); 19064 } 19065 19066 :host([rounded="md"]) { 19067 --sc-img-radius: var(--sc-rounded-md); 19068 } 19069 19070 :host([rounded="lg"]) { 19071 --sc-img-radius: var(--sc-rounded-lg); 19072 } 19073 :host([rounded="xl"]) { 19074 --sc-img-radius: var(--sc-rounded-xl); 19075 } 19076 19077 /*Cercle*/ 19078 :host([rounded="full"]) { 19079 --sc-img-radius: 50% !important; 19080 } 19081 :host([rounded="none"]) { 19082 --sc-img-radius: 0 !important; 19083 } 19084 19085 :host([cover]), 19086 :host([cover]) > div, 19087 :host([cover]) img { 19088 position: absolute !important; 19089 left: 0 !important; 19090 top: 0 !important; 19091 right: 0 !important; 19092 bottom: 0 !important; 19093 height: 100% !important; 19094 width: 100% !important; 19095 } 19096 19097 :host([transition]) img { 19098 opacity: 0; 19099 transition: 0.25s; 19100 } 19101 19102 :host([transition="fade-scale-out"]) img { 19103 scale: 1.08; 19104 transition: opacity 0.3s linear, 19105 scale 0.3s cubic-bezier(0.16, 1, 0.3, 1); 19106 } 19107 :host([transition]) img.loaded { 19108 opacity: 1; 19109 scale: 1; 19110 } 19111 ` 19112 ]; 19113 __decorate$z([ 19114 n$5({ type: String }) 19115 ], Image.prototype, "rounded", void 0); 19116 __decorate$z([ 19117 n$5({ type: String }) 19118 ], Image.prototype, "src", void 0); 19119 __decorate$z([ 19120 n$5({ type: String }) 19121 ], Image.prototype, "alt", void 0); 19122 __decorate$z([ 19123 n$5({ type: String }) 19124 ], Image.prototype, "loading", void 0); 19125 __decorate$z([ 19126 n$5({ type: String, reflect: true }) 19127 ], Image.prototype, "transition", void 0); 19128 __decorate$z([ 19129 n$5({ type: String }) 19130 ], Image.prototype, "ratio", void 0); 19131 __decorate$z([ 19132 n$5({ type: String }) 19133 ], Image.prototype, "objectPosition", void 0); 19134 __decorate$z([ 19135 n$5({ type: String }) 19136 ], Image.prototype, "imageRendering", void 0); 19137 __decorate$z([ 19138 n$5({ type: Boolean, reflect: true }) 19139 ], Image.prototype, "cover", void 0); 19140 Image = __decorate$z([ 19141 t$3(tagName$2r) 19142 ], Image); 19143 let h$1 = class h { 19144 constructor(t2, { target: s2, config: h2, callback: e2, skipInitial: r2 }) { 19145 this.t = /* @__PURE__ */ new Set(), this.o = false, this.i = false, this.h = t2, null !== s2 && this.t.add(s2 ?? t2), this.l = h2, this.o = r2 ?? this.o, this.callback = e2, window.ResizeObserver ? (this.u = new ResizeObserver((t3) => { 19146 this.handleChanges(t3), this.h.requestUpdate(); 19147 }), t2.addController(this)) : console.warn("ResizeController error: browser does not support ResizeObserver."); 19148 } 19149 handleChanges(t2) { 19150 this.value = this.callback?.(t2, this.u); 19151 } 19152 hostConnected() { 19153 for (const t2 of this.t) this.observe(t2); 19154 } 19155 hostDisconnected() { 19156 this.disconnect(); 19157 } 19158 async hostUpdated() { 19159 !this.o && this.i && this.handleChanges([]), this.i = false;
19160 } 19161 observe(t2) { 19162 this.t.add(t2), this.u.observe(t2, this.l), this.i = true, this.h.requestUpdate(); 19163 } 19164 unobserve(t2) { 19165 this.t.delete(t2), this.u.unobserve(t2); 19166 } 19167 disconnect() { 19168 this.u.disconnect(); 19169 } 19170 target(t2) { 19171 return e$1(this, t2); 19172 } 19173 }; 19174 const e$1 = e$5(class extends f$1 { 19175 constructor() { 19176 super(...arguments), this.observing = false; 19177 } 19178 render(t2, s2) { 19179 } 19180 update(t2, [s2, i2]) { 19181 this.controller = s2, this.part = t2, this.observe = i2, false === i2 ? (s2.unobserve(t2.element), this.observing = false) : false === this.observing && (s2.observe(t2.element), this.observing = true); 19182 } 19183 disconnected() { 19184 this.controller?.unobserve(this.part.element), this.observing = false; 19185 } 19186 reconnected() { 19187 false !== this.observe && false === this.observing && (this.controller?.observe(this.part.element), this.observing = true); 19188 } 19189 }); 19190 var __defProp$3D = Object.defineProperty; 19191 var __getOwnPropDesc$3G = Object.getOwnPropertyDescriptor; 19192 var __decorateClass$3H = (decorators, target, key, kind) => { 19193 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3G(target, key) : target; 19194 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 19195 if (decorator = decorators[i2]) 19196 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 19197 if (kind && result) __defProp$3D(target, key, result); 19198 return result; 19199 }; 19200 let ProductIllustration = class extends Subscriber$1(i$6) { 19201 constructor() { 19202 super(...arguments); 19203 this.cover = false; 19204 this.noFallback = false; 19205 this.noAnimation = false; 19206 this.ratio = "1 / 1"; 19207 this.transition = "fade"; 19208 this.picture = null; 19209 this.entity_type = null; 19210 this._resizeController = new h$1(this, {}); 19211 } 19212 willUpdate(_changedProperties) { 19213 super.willUpdate(_changedProperties); 19214 this._imgSrc = this.getSrc(); 19215 } 19216 getSrc() { 19217 const { 19218 ratio_1x1_120, 19219 ratio_1x1_360, 19220 ratio_1x1_640, 19221 ratio_1x1_1000, 19222 ratio_1x1_1920, 19223 src, 19224 ratio_auto_120, 19225 ratio_auto_360, 19226 ratio_auto_640, 19227 ratio_auto_1000, 19228 ratio_auto_1920 19229 } = this.picture || {}; 19230 if (this.picture?.is_animated && !this.noAnimation) { 19231 return src; 19232 } 19233 if (this.shouldPreserveAspectRatio()) { 19234 if (this.offsetWidth <= 120) { 19235 return ratio_auto_120 || ratio_auto_360 || src; 19236 } else if (this.offsetWidth <= 360) { 19237 return ratio_auto_360 || src; 19238 } else if (this.offsetWidth <= 640) { 19239 return ratio_auto_640 || src; 19240 } else if (this.offsetWidth <= 900) { 19241 return ratio_auto_1000 || src; 19242 } else { 19243 return ratio_auto_1920 || src; 19244 } 19245 } 19246 if (this.offsetWidth <= 120) { 19247 return ratio_1x1_120 || ratio_1x1_360 || src; 19248 } else if (this.offsetWidth <= 360) { 19249 return ratio_1x1_360 || src; 19250 } else if (this.offsetWidth <= 640) { 19251 return ratio_1x1_640 || src; 19252 } else if (this.offsetWidth <= 900) { 19253 return ratio_1x1_1000 || src; 19254 } else { 19255 return ratio_1x1_1920 || src; 19256 } 19257 } 19258 shouldPreserveAspectRatio() { 19259 return this.picture?.shouldPreserveAspectRatio && !this.picture?.is_default; 19260 } 19261 render() { 19262 const roundedClass = this.getRoundedClass(); 19263 const shadowClass = this.offsetWidth <= 640 ? "drop-shadow-md" : "drop-shadow-lg"; 19264 if (!this._imgSrc && !this.noFallback) { 19265 return this.renderFallback(); 19266 } 19267 if (this.shouldPreserveAspectRatio()) { 19268 return b$1` <div class="p-[clamp(0.5rem,5%,1.5rem)] relative aspect-[1/1] bg-neutral-50 ${roundedClass}"> 19269 <img src=${this._imgSrc} class="h-full w-full object-contain ${shadowClass}" /> 19270 </div>`; 19271 } 19272 return b$1` 19273 <sonic-image 19274 src=${this._imgSrc} 19275 class="w-full" 19276 ?cover=${this.cover} 19277 ratio=${this.ratio} 19278 rounded="${o$4(this.rounded)}" 19279 transition=${o$4(this.transition)} 19280 objectPosition=${o$4(this.objectPosition)} 19281 ></sonic-image> 19282 `; 19283 } 19284 getRoundedClass() { 19285 let roundedClass = ""; 19286 switch (this.rounded) { 19287 case "full": 19288 roundedClass = "rounded-full"; 19289 break; 19290 case "sm": 19291 roundedClass = "rounded-sm"; 19292 break; 19293 case "md": 19294 roundedClass = "rounded-md"; 19295 break; 19296 case "lg": 19297 roundedClass = "rounded-lg"; 19298 break; 19299 case "": 19300 roundedClass = "rounded"; 19301 break; 19302 default: 19303 roundedClass = ""; 19304 break; 19305 } 19306 return roundedClass; 19307 } 19308 renderFallback() { 19309 const roundedClass = this.getRoundedClass(); 19310 return b$1` 19311 <div
19312 class="${roundedClass} ${this.entity_type ? "bg-neutral-300" : "bg-neutral-100"} flex items-center justify-center text-neutral-0 object-cover w-full aspect-square @container" 19313 > 19314 ${this.entity_type ? b$1`<sonic-icon 19315 class="text-[40cqw]" 19316 library="custom" 19317 prefix="light" 19318 name=${iconFromEntityType(this.entity_type)} 19319 ></sonic-icon>` : A$1} 19320 </div> 19321 `; 19322 } 19323 }; 19324 ProductIllustration.styles = [ 19325 tailwind, 19326 i$9` 19327 :host { 19328 display: block; 19329 } 19330 ` 19331 ]; 19332 __decorateClass$3H([ 19333 n$5({ type: Boolean }) 19334 ], ProductIllustration.prototype, "cover", 2); 19335 __decorateClass$3H([ 19336 n$5({ type: Boolean }) 19337 ], ProductIllustration.prototype, "noFallback", 2); 19338 __decorateClass$3H([ 19339 n$5({ type: Boolean }) 19340 ], ProductIllustration.prototype, "noAnimation", 2); 19341 __decorateClass$3H([ 19342 n$5({ type: String }) 19343 ], ProductIllustration.prototype, "ratio", 2); 19344 __decorateClass$3H([ 19345 n$5({ type: String }) 19346 ], ProductIllustration.prototype, "rounded", 2); 19347 __decorateClass$3H([ 19348 n$5({ type: String }) 19349 ], ProductIllustration.prototype, "objectPosition", 2); 19350 __decorateClass$3H([ 19351 n$5({ type: String, reflect: true }) 19352 ], ProductIllustration.prototype, "transition", 2); 19353 __decorateClass$3H([ 19354 n$5({ type: Object }) 19355 ], ProductIllustration.prototype, "picture", 2); 19356 __decorateClass$3H([ 19357 r$5() 19358 ], ProductIllustration.prototype, "_imgSrc", 2); 19359 __decorateClass$3H([ 19360 n$5({ type: String }) 19361 ], ProductIllustration.prototype, "entity_type", 2); 19362 ProductIllustration = __decorateClass$3H([ 19363 t$3("sonic-product-illustration") 19364 ], ProductIllustration); 19365 const iconFromEntityType = (entityType) => { 19366 const iconNames = { 19367 subscribe: "id-card", 19368 giftcard: "gift-card", 19369 event: "ticket", 19370 additionalProduct: "circle-plus", 19371 extra: "circle-plus", 19372 merch: "bags-shopping", 19373 credit: "wallet" 19374 }; 19375 if (!entityType) return "ticket"; 19376 return iconNames[entityType]; 19377 }; 19378 var Publication = /* @__PURE__ */ ((Publication2) => { 19379 Publication2["Unpublished"] = "unpublished"; 19380 Publication2["Counter"] = "counter"; 19381 Publication2["OnlyVisible"] = "only_visible"; 19382 Publication2["OnSale"] = "on_sale"; 19383 return Publication2; 19384 })(Publication || {}); 19385 var QuoteTypeEnum = /* @__PURE__ */ ((QuoteTypeEnum2) => { 19386 QuoteTypeEnum2["Quote"] = "quote"; 19387 QuoteTypeEnum2["Proof"] = "proof"; 19388 return QuoteTypeEnum2; 19389 })(QuoteTypeEnum || {}); 19390 var PurchaseStatus = /* @__PURE__ */ ((PurchaseStatus2) => { 19391 PurchaseStatus2["All"] = "all"; 19392 PurchaseStatus2["Valid"] = "valid"; 19393 PurchaseStatus2["Deleted"] = "deleted"; 19394 PurchaseStatus2["Cancelled"] = "cancelled"; 19395 PurchaseStatus2["Refunded"] = "refunded"; 19396 PurchaseStatus2["RefundRequested"] = "refund_requested"; 19397 PurchaseStatus2["Exchanged"] = "exchanged"; 19398 PurchaseStatus2["FullyUsed"] = "fully_used"; 19399 PurchaseStatus2["AutoRefundPending"] = "auto_refund_pending"; 19400 PurchaseStatus2["Checked"] = "checked"; 19401 PurchaseStatus2["RefundedPartially"] = "refunded_partially"; 19402 PurchaseStatus2["Disabled"] = "disabled"; 19403 PurchaseStatus2["Neutralized"] = "neutralized"; 19404 PurchaseStatus2["Expired"] = "expired"; 19405 return PurchaseStatus2; 19406 })(PurchaseStatus || {}); 19407 var Feature = /* @__PURE__ */ ((Feature2) => { 19408 Feature2["Taxonomies"] = "taxonomies"; 19409 Feature2["Picture"] = "picture"; 19410 Feature2["Prices"] = "prices"; 19411 Feature2["Stock"] = "stock"; 19412 Feature2["Quotas"] = "quotas"; 19413 Feature2["Status"] = "status"; 19414 Feature2["Season"] = "season"; 19415 Feature2["Location"] = "location"; 19416 Feature2["Multisessions"] = "multisessions"; 19417 Feature2["Settings"] = "settings"; 19418 Feature2["Range"] = "range"; 19419 Feature2["Refund"] = "refund"; 19420 Feature2["Cancelable"] = "cancelable"; 19421 Feature2["Entity"] = "entity"; 19422 Feature2["Exchange"] = "exchange"; 19423 Feature2["PlacesCategories"] = "places_categories"; 19424 Feature2["Producers"] = "producers"; 19425 Feature2["Rules"] = "rules"; 19426 Feature2["OwnerForm"] = "owner_form"; 19427 return Feature2; 19428 })(Feature || {}); 19429 var InputType = /* @__PURE__ */ ((InputType2) => { 19430 InputType2["Text"] = "text"; 19431 InputType2["Select"] = "select"; 19432 InputType2["File"] = "file"; 19433 InputType2["Checkbox"] = "checkbox"; 19434 InputType2["Email"] = "email"; 19435 InputType2["Tel"] = "tel"; 19436 InputType2["Number"] = "number"; 19437 InputType2["Date"] = "date"; 19438 InputType2["Textarea"] = "textarea"; 19439 InputType2["Radio"] = "radio"; 19440 InputType2["Checkboxes"] = "checkboxes"; 19441 InputType2["Repeatable"] = "repeatable"; 19442 InputType2["TextSection"] = "text_section"; 19443 return InputType2; 19444 })(InputType || {}); 19445 var ReservationStatus = /* @__PURE__ */ ((ReservationStatus2) => { 19446 ReservationStatus2["Disabled"] = "disabled"; 19447 ReservationStatus2["Draft"] = "draft"; 19448 ReservationStatus2["Processed"] = "processed"; 19449 ReservationStatus2["Confirmed"] = "confirmed"; 19450 ReservationStatus2["Pending"] = "pending"; 19451 ReservationStatus2["PartiallyProcessed"] = "partially_processed"; 19452 ReservationStatus2["Deleted"] = "deleted"; 19453 ReservationStatus2["Expired"] = "expired"; 19454 ReservationStatus2["Processing"] = "processing"; 19455 ReservationStatus2["Error"] = "error"; 19456 ReservationStatus2["Todo"] = "todo"; 19457 ReservationStatus2["Submitted"] = "submitted"; 19458 ReservationStatus2["Incomplete"] = "incomplete"; 19459 ReservationStatus2["Declined"] = "declined"; 19460 ReservationStatus2["DeclinedForever"] = "declined_forever"; 19461 return ReservationStatus2; 19462 })(ReservationStatus || {}); 19463 var EntityType = /* @__PURE__ */ ((EntityType2) => { 19464 EntityType2["Subscribe"] = "subscribe"; 19465 EntityType2["Extra"] = "extra"; 19466 EntityType2["Giftcard"] = "giftcard"; 19467 EntityType2["Event"] = "event";
19468 EntityType2["AdditionalProduct"] = "additionalProduct"; 19469 EntityType2["Credit"] = "credit"; 19470 EntityType2["Merch"] = "merch"; 19471 return EntityType2; 19472 })(EntityType || {}); 19473 var CartType = /* @__PURE__ */ ((CartType2) => { 19474 CartType2["Cart"] = "cart"; 19475 CartType2["Split"] = "split"; 19476 CartType2["ReservationRequest"] = "reservation_request"; 19477 CartType2["WaitingLists"] = "waiting_lists"; 19478 CartType2["Reservation"] = "reservation"; 19479 CartType2["Order"] = "order"; 19480 return CartType2; 19481 })(CartType || {}); 19482 var __decorate$y = function(decorators, target, key, desc) { 19483 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 19484 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 19485 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 19486 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 19487 }; 19488 var SonicDate_1; 19489 const tagName$2q = "sonic-date"; 19490 detecHTMLLanguageChange(() => SonicDate.updateComponentsLanguage()); 19491 let SonicDate = SonicDate_1 = class SonicDate extends Subscriber$1(TemplatesContainer$1(i$6)) { 19492 constructor() { 19493 super(...arguments); 19494 this.pageLanguage = "fr"; 19495 this.duAu = []; 19496 this._wording_billet_periode_validite = ""; 19497 this.designMode = null; 19498 this.time_zone = null; 19499 this.date = null; 19500 this.date_string = null; 19501 this.start_date_string = null; 19502 this.end_date_string = null; 19503 this.start_date = 0; 19504 this.computedStartDate = 0; 19505 this.end_date = 0; 19506 this.computedEndDate = 0; 19507 this.hide_hours = false; 19508 this.era = ""; 19509 this.year = "numeric"; 19510 this.month = "short"; 19511 this.day = "2-digit"; 19512 this.weekday = "short"; 19513 this.hour = "2-digit"; 19514 this.hour12 = false; 19515 this.minute = "2-digit"; 19516 this.language = ""; 19517 this.renderIf = true; 19518 this.now = false; 19519 this.startDateObject = /* @__PURE__ */ new Date(); 19520 this.endDateObject = /* @__PURE__ */ new Date(); 19521 } 19522 static updateComponentsLanguage() { 19523 SonicDate_1.dateCompnents.forEach((component) => component.pageLanguage = HTML$1.getLanguage()); 19524 } 19525 get wording_billet_periode_validite() { 19526 return this._wording_billet_periode_validite; 19527 } 19528 set wording_billet_periode_validite(value) { 19529 if (!value) 19530 value = "Du %s au %s"; 19531 this._wording_billet_periode_validite = value; 19532 this.duAu = this.wording_billet_periode_validite?.split("%s").map((str) => str.trim()); 19533 this.duAu.pop(); 19534 this.requestUpdate(); 19535 } 19536 connectedCallback() { 19537 if (!this.hasAttribute("wording_billet_periode_validite")) 19538 this.wording_billet_periode_validite = "Du %s au %s"; 19539 this.pageLanguage = HTML$1.getLanguage(); 19540 SonicDate_1.dateCompnents.add(this); 19541 super.connectedCallback(); 19542 } 19543 disconnectedCallback() { 19544 super.disconnectedCallback(); 19545 SonicDate_1.dateCompnents.delete(this); 19546 } 19547 /** 19548 * Retourne un tableau des différentes parties de la date en fonction des options données, de la date de début et de fin. 19549 */ 19550 getDatesParts(start_date, end_date, options) { 19551 const start = this.startDateObject; 19552 start.setTime(start_date * 1e3); 19553 let parts = []; 19554 if (end_date > 0) { 19555 const end = this.endDateObject; 19556 end.setTime(end_date * 1e3); 19557 const isSameDay = start.toDateString() == end.toDateString(); 19558 if (!isSameDay || this.hide_hours) { 19559 delete options.hour; 19560 delete options.minute; 19561 } 19562 const format = new Intl.DateTimeFormat(this.language || this.pageLanguage, options); 19563 parts = format.formatRangeToParts(start, end); 19564 if (!isSameDay) { 19565 const to = parts.find((part) => part.type == "literal" && part.source == "shared" && part.value.trim().length > 0); 19566 if (to) { 19567 to.value = " " + this.duAu[1] + " "; 19568 to.type = "to"; 19569 } 19570 if (!this.designMode) 19571 parts.unshift({ 19572 type: "from", 19573 value: this.duAu[0] + " ", 19574 source: "shared" 19575 }); 19576 } 19577 } else { 19578 const format = new Intl.DateTimeFormat(this.language || this.pageLanguage, options); 19579 parts = format.formatToParts(start); 19580 } 19581 if (this.designMode) {
19582 parts.forEach((part) => part.value = part.value.replace(/,/g, " ")); 19583 } 19584 parts[0].value = Format$1.ucFirst(parts[0].value); 19585 return parts.filter((p2) => p2.hidden !== true); 19586 } 19587 dateStringToSeconds(dateString) { 19588 return new Date(dateString).getTime() / 1e3; 19589 } 19590 willUpdate(_changedProperties) { 19591 this.computedStartDate = 0; 19592 this.computedEndDate = 0; 19593 if (this.date_string) 19594 this.date = this.dateStringToSeconds(this.date_string); 19595 if (this.date) 19596 this.computedStartDate = this.date; 19597 if (this.start_date_string) 19598 this.computedStartDate = this.dateStringToSeconds(this.start_date_string); 19599 if (this.end_date_string) 19600 this.end_date = this.dateStringToSeconds(this.end_date_string); 19601 if (this.start_date) 19602 this.computedStartDate = this.start_date; 19603 if (!this.computedStartDate && !this.now && !this.end_date) 19604 return; 19605 if (!this.computedStartDate) 19606 this.computedStartDate = Date.now() / 1e3; 19607 if (this.end_date) 19608 this.computedEndDate = this.end_date; 19609 if (this.computedEndDate > 0 && this.computedEndDate < this.computedStartDate) { 19610 const copy = this.computedStartDate; 19611 this.computedStartDate = this.computedEndDate; 19612 this.computedEndDate = copy; 19613 } 19614 } 19615 render() { 19616 if (!this.renderIf) 19617 return A$1; 19618 if (!this.computedStartDate && !this.now && !this.computedEndDate) 19619 return A$1; 19620 const options = { 19621 year: this.year || "numeric", 19622 month: this.month || "short", 19623 day: this.day || "2-digit", 19624 hour12: this.hour12 || false 19625 }; 19626 if (this.weekday !== "hidden") 19627 options.weekday = this.weekday || "short"; 19628 if (this.hour !== "hidden") 19629 options.hour = this.hour || "2-digit"; 19630 if (this.minute !== "hidden") 19631 options.minute = this.minute || "2-digit"; 19632 if (this.era) 19633 options.era = this.era; 19634 if (this.time_zone) 19635 options.timeZone = this.time_zone; 19636 const parts = this.getDatesParts(this.computedStartDate, this.computedEndDate, options); 19637 return o$6(`${parts.map((part) => { 19638 const template = this.templateParts[part.type]; 19639 if (template) { 19640 const clone = document.importNode(template.content, true); 19641 const child = clone.children[0]; 19642 if (child.innerText.trim() == "") 19643 child.innerText = part.value; 19644 return child.outerHTML; 19645 } 19646 const span = document.createElement("span"); 19647 span.innerText = part.value; 19648 span.className = part.type; 19649 return `<span class="${part.type}">${part.value}</span>`; 19650 }).join("")}`); 19651 } 19652 }; 19653 SonicDate.dateCompnents = /* @__PURE__ */ new Set(); 19654 __decorate$y([ 19655 n$5() 19656 ], SonicDate.prototype, "wording_billet_periode_validite", null); 19657 __decorate$y([ 19658 n$5({ type: Boolean }) 19659 ], SonicDate.prototype, "designMode", void 0); 19660 __decorate$y([ 19661 n$5({ type: String }) 19662 ], SonicDate.prototype, "time_zone", void 0); 19663 __decorate$y([ 19664 n$5({ type: Number }) 19665 ], SonicDate.prototype, "date", void 0); 19666 __decorate$y([ 19667 n$5({ type: String }) 19668 ], SonicDate.prototype, "date_string", void 0); 19669 __decorate$y([ 19670 n$5({ type: String }) 19671 ], SonicDate.prototype, "start_date_string", void 0); 19672 __decorate$y([ 19673 n$5({ type: String }) 19674 ], SonicDate.prototype, "end_date_string", void 0); 19675 __decorate$y([ 19676 n$5({ type: Number }) 19677 ], SonicDate.prototype, "start_date", void 0); 19678 __decorate$y([ 19679 n$5({ type: Number }) 19680 ], SonicDate.prototype, "end_date", void 0); 19681 __decorate$y([ 19682 n$5({ type: Boolean }) 19683 ], SonicDate.prototype, "hide_hours", void 0); 19684 __decorate$y([ 19685 n$5({ type: String }) 19686 ], SonicDate.prototype, "era", void 0); 19687 __decorate$y([ 19688 n$5({ type: String }) 19689 ], SonicDate.prototype, "year", void 0); 19690 __decorate$y([ 19691 n$5({ type: String }) 19692 ], SonicDate.prototype, "month", void 0); 19693 __decorate$y([ 19694 n$5({ type: String }) 19695 ], SonicDate.prototype, "day", void 0); 19696 __decorate$y([ 19697 n$5({ type: String }) 19698 ], SonicDate.prototype, "weekday", void 0); 19699 __decorate$y([ 19700 n$5({ type: String }) 19701 ], SonicDate.prototype, "hour", void 0); 19702 __decorate$y([ 19703 n$5({ type: Boolean }) 19704 ], SonicDate.prototype, "hour12", void 0); 19705 __decorate$y([ 19706 n$5({ type: String }) 19707 ], SonicDate.prototype, "minute", void 0); 19708 __decorate$y([ 19709 n$5({ type: String }) 19710 ], SonicDate.prototype, "language", void 0); 19711 __decorate$y([ 19712 n$5({ type: Boolean }) 19713 ], SonicDate.prototype, "renderIf", void 0); 19714 __decorate$y([ 19715 n$5({ type: Boolean }) 19716 ], SonicDate.prototype, "now", void 0);
19717 SonicDate = SonicDate_1 = __decorate$y([ 19718 t$3(tagName$2q) 19719 ], SonicDate); 19720 var __decorate$x = function(decorators, target, key, desc) { 19721 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 19722 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 19723 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 19724 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 19725 }; 19726 const tagName$2p = "sonic-badge"; 19727 let Badge = class Badge extends i$6 { 19728 constructor() { 19729 super(...arguments); 19730 this.type = "default"; 19731 this.variant = "default"; 19732 this.ellipsis = false; 19733 } 19734 render() { 19735 return b$1` 19736 <slot name="prefix"></slot> 19737 <slot></slot> 19738 <slot name="suffix"></slot> 19739 `; 19740 } 19741 }; 19742 Badge.styles = [ 19743 fontSize, 19744 i$9` 19745 :host { 19746 --sc-badge-gap: 0.3em; 19747 --sc-badge-py: 0.35em; 19748 --sc-badge-px: 0.67em; 19749 19750 --sc-badge-color: var(--sc-base-content, #000); 19751 --sc-badge-bg: var(--sc-base-100, rgba(0, 0, 0, 0.07)); 19752 19753 /*--sc-badge-border-width: var(--sc-form-border-width, 0.1rem);*/ 19754 --sc-badge-border-width: 1px; 19755 --sc-badge-border-color: transparent; 19756 --sc-badge-border: var(--sc-badge-border-width) solid 19757 var(--sc-badge-border-color); 19758 19759 --sc-badge-rounded: 0.85em; 19760 --sc-badge-fw: var(--sc-font-weight-base, 400); 19761 19762 display: inline-flex; 19763 align-items: center; 19764 box-sizing: border-box; 19765 line-height: var(--sc-_lh); 19766 border-radius: var(--sc-badge-rounded); 19767 19768 background: var(--sc-badge-bg); 19769 color: var(--sc-badge-color); 19770 font-family: var(--sc-badge-ff, var(--sc-font-family-base, sans-serif)); 19771 font-weight: var(--sc-badge-fw); 19772 line-height: 1; 19773 19774 padding-top: var(--sc-badge-py); 19775 padding-bottom: var(--sc-badge-py); 19776 padding-left: var(--sc-badge-px); 19777 padding-right: var(--sc-badge-px); 19778 /**Round pour lissage px */ 19779 min-height: round(calc(var(--sc-badge-px) * 2), 1px); 19780 min-width: round(calc(var(--sc-badge-px) * 2), 1px); 19781 border: var(--sc-badge-border); 19782 -webkit-print-color-adjust: exact; 19783 } 19784 19785 /*TYPES*/ 19786 :host([type="primary"]) { 19787 --sc-badge-color: var(--sc-primary-content, var(--sc-base, #fff)); 19788 --sc-badge-bg: var(--sc-primary, var(--sc-base-content, #000)); 19789 } 19790 :host([type="warning"]) { 19791 --sc-badge-color: var(--sc-warning-content, var(--sc-base, #fff)); 19792 --sc-badge-bg: var(--sc-warning, var(--sc-base-content, #000)); 19793 } 19794 :host([type="danger"]) { 19795 --sc-badge-color: var(--sc-danger-content, var(--sc-base, #fff)); 19796 --sc-badge-bg: var(--sc-danger, var(--sc-base-content, #000)); 19797 } 19798 :host([type="info"]) { 19799 --sc-badge-color: var(--sc-info-content, var(--sc-base, #fff)); 19800 --sc-badge-bg: var(--sc-info, var(--sc-base-content, #000)); 19801 } 19802 :host([type="success"]) { 19803 --sc-badge-color: var(--sc-success-content, var(--sc-base, #fff)); 19804 --sc-badge-bg: var(--sc-success, var(--sc-base-content, #000)); 19805 } 19806 :host([type="neutral"]) { 19807 --sc-badge-color: var(--sc-base, #fff); 19808 --sc-badge-bg: var(--sc-base-content, #000); 19809 } 19810 19811 :host([contrast]), 19812 :host([type="contrast"]) { 19813 --sc-badge-color: var(--sc-contrast-content, #fff); 19814 --sc-badge-bg: var(--sc-contrast, #000); 19815 } 19816 19817 /*SIZE*/ 19818 :host { 19819 gap: var(--sc-badge-gap); 19820 } 19821 19822 :host([size="2xs"]), 19823 :host([size="xs"]), 19824 :host([size="sm"]) { 19825 --sc-badge-gap: 0.35em; 19826 } 19827 19828 :host([size="lg"]), 19829 :host([size="xl"]) { 19830 --sc-_lh: 1.2; 19831 --sc-badge-gap: 0.5em; 19832 } 19833 19834 /*OUTLINE*/ 19835 :host([variant="outline"][type]) { 19836 border-width: var(--sc-badge-border-width) !important; 19837 border-color: var(--sc-badge-bg); 19838 color: var(--sc-badge-bg); 19839 background: transparent; 19840 } 19841 19842 :host([variant="outline"][type="default"]) { 19843 border-color: var(--sc-base-content, #000); 19844 color: var(--sc-base-content, #000); 19845 background: transparent; 19846 } 19847 19848 /*GHOST*/ 19849 :host([variant="ghost"][type]) { 19850 color: var(--sc-badge-bg); 19851 background: transparent; 19852 padding: 0; 19853 } 19854 19855 @media (forced-colors: active) { 19856 :host([variant="ghost"][type]) { 19857 padding: var(--sc-badge-py) var(--sc-badge-px); 19858 } 19859 } 19860 19861 :host([variant="ghost"][type="default"]) { 19862 color: var(--sc-badge-color); 19863 background: transparent; 19864 } 19865 19866 :host([ellipsis]) { 19867 flex-wrap: nowrap; 19868 white-space: nowrap; 19869 max-width: 100%; 19870 } 19871 19872 :host([ellipsis]) slot { 19873 overflow: hidden; 19874 display: block; 19875 text-overflow: ellipsis; 19876 white-space: nowrap; 19877 max-width: 100%; 19878 } 19879 19880 slot[name="suffix"], 19881 slot[name="prefix"] { 19882 flex-shrink: 0; 19883 } 19884 ` 19885 ]; 19886 __decorate$x([ 19887 n$5({ type: String, reflect: true }) 19888 ], Badge.prototype, "type", void 0); 19889 __decorate$x([ 19890 n$5({ type: String, reflect: true }) 19891 ], Badge.prototype, "variant", void 0); 19892 __decorate$x([ 19893 n$5({ type: String, reflect: true }) 19894 ], Badge.prototype, "size", void 0); 19895 __decorate$x([ 19896 n$5({ type: Boolean, reflect: true }) 19897 ], Badge.prototype, "ellipsis", void 0); 19898 Badge = __decorate$x([ 19899 t$3(tagName$2p) 19900 ], Badge); 19901 var __defProp$3C = Object.defineProperty; 19902 var __getOwnPropDesc$3F = Object.getOwnPropertyDescriptor; 19903 var __decorateClass$3G = (decorators, target, key, kind) => { 19904 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3F(target, key) : target; 19905 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 19906 if (decorator = decorators[i2]) 19907 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 19908 if (kind && result) __defProp$3C(target, key, result); 19909 return result; 19910 }; 19911 let SonicRange = class extends Subscriber$1(i$6) { 19912 constructor() { 19913 super(...arguments); 19914 this.size = "xs"; 19915 this.variant = "outline"; 19916 this.range = null; 19917 this.ellipsis = false;
19918 } 19919 render() { 19920 if (!this.range) return A$1; 19921 return b$1` 19922 <sonic-badge variant=${this.variant} size=${this.size} ?ellipsis=${this.ellipsis}> 19923 Gamme : ${this.range?.title} 19924 </sonic-badge> 19925 `; 19926 } 19927 }; 19928 SonicRange.styles = [ 19929 i$9` 19930 :host([ellipsis]) { 19931 max-width: 100%; 19932 } 19933 ` 19934 ]; 19935 __decorateClass$3G([ 19936 n$5({ type: String }) 19937 ], SonicRange.prototype, "size", 2); 19938 __decorateClass$3G([ 19939 n$5({ type: String }) 19940 ], SonicRange.prototype, "variant", 2); 19941 __decorateClass$3G([ 19942 n$5({ type: Object }) 19943 ], SonicRange.prototype, "range", 2); 19944 __decorateClass$3G([ 19945 n$5({ type: Boolean, reflect: true }) 19946 ], SonicRange.prototype, "ellipsis", 2); 19947 SonicRange = __decorateClass$3G([ 19948 t$3("sonic-event-range") 19949 ], SonicRange); 19950 const styles$2 = i$9` 19951 :host { 19952 display: inline-flex; 19953 flex-wrap: wrap; 19954 gap: 0.25rem; 19955 } 19956 19957 .wording { 19958 display: block; 19959 } 19960 19961 .separator:last-child { 19962 display: none; 19963 } 19964`; 19965 var __defProp$3B = Object.defineProperty; 19966 var __getOwnPropDesc$3E = Object.getOwnPropertyDescriptor; 19967 var __decorateClass$3F = (decorators, target, key, kind) => { 19968 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3E(target, key) : target; 19969 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 19970 if (decorator = decorators[i2]) 19971 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 19972 if (kind && result) __defProp$3B(target, key, result); 19973 return result; 19974 }; 19975 const EventContext = (superClass, propsType) => { 19976 class EventContextElement extends superClass { 19977 constructor(...args) { 19978 super(); 19979 this.multisession = null; 19980 this._isGuichet = false; 19981 this.dataProvider = ""; 19982 } 19983 get isGuichet() { 19984 return this._isGuichet || (this._isGuichet = this.hasAncestorAttribute("is_guichet")); 19985 } 19986 set isGuichet(value) { 19987 this._isGuichet = value; 19988 } 19989 } 19990 __decorateClass$3F([ 19991 n$5({ type: Object }) 19992 ], EventContextElement.prototype, "multisession", 2); 19993 __decorateClass$3F([ 19994 n$5({ type: Boolean }) 19995 ], EventContextElement.prototype, "isGuichet", 1); 19996 return EventContextElement; 19997 }; 19998 var __defProp$3A = Object.defineProperty; 19999 var __getOwnPropDesc$3D = Object.getOwnPropertyDescriptor; 20000 var __decorateClass$3E = (decorators, target, key, kind) => { 20001 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3D(target, key) : target; 20002 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 20003 if (decorator = decorators[i2]) 20004 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 20005 if (kind && result) __defProp$3A(target, key, result); 20006 return result; 20007 }; 20008 let AditionalStatus = class extends EventContext(Fetcher$1(Subscriber$1(i$6))) { 20009 constructor() { 20010 super(...arguments); 20011 this.infos_status = {}; 20012 this.size = ""; 20013 this.separator = ""; 20014 this.warnAndDangerAsPill = false; 20015 this.keepOnlyKeys = null; 20016 this.ellipsis = false; 20017 this.hasForcedVisibility = false; 20018 this.enableRefetch = (data) => { 20019 }; 20020 } 20021 static getDisplayConfForStatus(key) { 20022 switch (key) { 20023 case "soon_on_sale": 20024 return { icon: "circle-info", type: "info", visibility: "public" }; 20025 case "remaining_places": 20026 return { icon: "circle-info", type: "info", visibility: "private" }; 20027 case "remaining_places_warning": 20028 return { icon: "triangle-exclamation", type: "warning", visibility: "public" }; 20029 case "waiting": 20030 case "deferred": 20031 return { icon: "triangle-exclamation", type: "warning", visibility: "public" }; 20032 case "almost_full_here": 20033 case "almost_full": 20034 return { icon: "triangle-exclamation", type: "warning", visibility: "public" }; 20035 case "full": 20036 case "full_here": 20037 return { icon: "circle-minus", type: "danger", visibility: "public" }; 20038 case "pro_need_login": 20039 return { icon: "circle-minus", type: "danger", visibility: "public" }; 20040 case "unauthorized": 20041 return { icon: "circle-minus", type: "danger", visibility: "public" }; 20042 case "canceled": 20043 return { icon: "ban", type: "danger", visibility: "public" }; 20044 case "only_visible": 20045 return { icon: "triangle-exclamation", type: "danger", visibility: "public" }; 20046 case "end_sale": 20047 return { icon: "", type: "danger", visibility: "public" }; 20048 case "forced_to_full": 20049 return { icon: "circle-minus", type: "danger", visibility: "private" }; 20050 case "full_in_no_quota": 20051 return { icon: "ban", type: "warning", visibility: "public" }; 20052 case "full_here_in_no_quota": 20053 return { icon: "ban", type: "warning", visibility: "public" }; 20054 default: 20055 return { icon: "", type: "danger", visibility: "private" }; 20056 } 20057 } 20058 connectedCallback() { 20059 if (!this.visibility) { 20060 this.visibility = "public"; 20061 } else { 20062 this.hasForcedVisibility = true; 20063 } 20064 this.isFetchEnabled = this.hasAttribute("fetch"); 20065 this.lazyLoad = true; 20066 if (this.isFetchEnabled) { 20067 this.propertyMap = { data: "infos_status" }; 20068 this.style.removeProperty("display"); 20069 } 20070 super.connectedCallback(); 20071 this.handleAutoRefetchActivation(); 20072 } 20073 getParentPublisher() { 20074 const dataProvider = HTML.getAncestorAttributeValue(this.parentElement, "dataProvider"); 20075 if (!dataProvider) return; 20076 return dp(dataProvider); 20077 } 20078 disconnectedCallback() { 20079 this.getParentPublisher()?.offAssign(this.enableRefetch); 20080 super.disconnectedCallback(); 20081 } 20082 willUpdate() { 20083 if (this.appType == "counter" && !this.variant) { 20084 this.variant = "ghost"; 20085 } 20086 if (this.appType == "counter" && !this.hasForcedVisibility) { 20087 this.visibility = "all"; 20088 } 20089 } 20090 handleAutoRefetchActivation() { 20091 const publisher = this.getParentPublisher(); 20092 publisher?.offAssign(this.enableRefetch); 20093 this.enableRefetch = (value) => { 20094 if (!value) return; 20095 if ("start_date" in value && "end_date" in value) { 20096 const startDate = value.start_date || 0; 20097 const endDate = value.end_date || startDate; 20098 const now = Date.now() / 1e3;
20099 const startDateExtended = startDate - 24 * 60 * 60; 20100 const endDateExtended = endDate + 24 * 60 * 60; 20101 if (endDateExtended - startDateExtended > 96 * 60 * 60) return; 20102 const msStr = "10000"; 20103 if (this.appType === "counter" && now > startDateExtended && now < endDateExtended && this.getAttribute("refetchEveryMs") !== msStr) { 20104 this.setAttribute("refetchEveryMs", msStr); 20105 this.publisher?.invalidate(); 20106 } else { 20107 this.removeAttribute("refetchEveryMs"); 20108 } 20109 } 20110 }; 20111 publisher?.onAssign(this.enableRefetch); 20112 } 20113 render() { 20114 let additionals = this.infos_status?.additionnals || []; 20115 additionals = additionals.filter((additional) => { 20116 return additional.key && (!this.keepOnlyKeys || this.keepOnlyKeys.includes(additional.key)); 20117 }); 20118 if (this.excludeKeys) { 20119 additionals = additionals.filter((additional) => { 20120 if (!additional.key) return false; 20121 return !this.excludeKeys?.includes(additional.key); 20122 }); 20123 } 20124 if (this.visibility && this.visibility != "all") { 20125 additionals = additionals.filter((elt) => { 20126 return AditionalStatus.getDisplayConfForStatus(elt.key).visibility == this.visibility; 20127 }); 20128 } 20129 if (additionals.length == 0) { 20130 this.style.display = "none"; 20131 this.style.position = "absolute"; 20132 this.style.pointerEvents = "none"; 20133 return b$1`<slot></slot>`; 20134 } 20135 this.style.removeProperty("display"); 20136 this.style.removeProperty("position"); 20137 this.style.removeProperty("pointer-events"); 20138 return b$1`<slot name="prefix"></slot> 20139 ${c$1( 20140 additionals, 20141 (additional) => additional.key, 20142 (additional) => { 20143 const displayConf = AditionalStatus.getDisplayConfForStatus(additional.key); 20144 const isForcedAsPill = this.warnAndDangerAsPill && (displayConf.type === "danger" || displayConf.type === "warning"); 20145 return b$1` 20146 <sonic-badge 20147 ?ellipsis=${this.ellipsis} 20148 type=${displayConf.type} 20149 .variant=${isForcedAsPill ? "default" : this.variant} 20150 .size=${this.size} 20151 class=${this.variant == "ghost" ? "font-medium" : ""} 20152 ${this.isFetchEnabled ? F({ 20153 in: v 20154 }) : A$1} 20155 > 20156 ${displayConf.icon ? b$1`<sonic-icon library="custom" name=${displayConf.icon} slot="prefix"></sonic-icon>` : A$1} 20157 ${o$6(additional.libelle)}</sonic-badge 20158 > 20159 ${this.separator ? b$1`<span class="separator">${this.separator}</span>` : A$1} 20160 `; 20161 } 20162 )} `; 20163 } 20164 }; 20165 AditionalStatus.styles = [tailwind, styles$2]; 20166 __decorateClass$3E([ 20167 n$5({ type: Object }) 20168 ], AditionalStatus.prototype, "infos_status", 2); 20169 __decorateClass$3E([ 20170 n$5({ type: String }) 20171 ], AditionalStatus.prototype, "variant", 2); 20172 __decorateClass$3E([ 20173 n$5({ type: String }) 20174 ], AditionalStatus.prototype, "size", 2); 20175 __decorateClass$3E([ 20176 n$5({ type: String }) 20177 ], AditionalStatus.prototype, "separator", 2); 20178 __decorateClass$3E([ 20179 n$5({ type: Boolean }) 20180 ], AditionalStatus.prototype, "warnAndDangerAsPill", 2); 20181 __decorateClass$3E([ 20182 n$5({ type: String }) 20183 ], AditionalStatus.prototype, "visibility", 2); 20184 __decorateClass$3E([ 20185 n$5({ type: Array }) 20186 ], AditionalStatus.prototype, "keepOnlyKeys", 2); 20187 __decorateClass$3E([ 20188 n$5({ type: Array }) 20189 ], AditionalStatus.prototype, "excludeKeys", 2); 20190 __decorateClass$3E([ 20191 c({ context: appType, subscribe: true }) 20192 ], AditionalStatus.prototype, "appType", 2); 20193 __decorateClass$3E([ 20194 n$5({ type: Boolean, reflect: true }) 20195 ], AditionalStatus.prototype, "ellipsis", 2); 20196 AditionalStatus = __decorateClass$3E([ 20197 t$3("sonic-event-additional-status") 20198 ], AditionalStatus); 20199 var __defProp$3z = Object.defineProperty; 20200 var __getOwnPropDesc$3C = Object.getOwnPropertyDescriptor; 20201 var __decorateClass$3D = (decorators, target, key, kind) => { 20202 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3C(target, key) : target; 20203 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 20204 if (decorator = decorators[i2]) 20205 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 20206 if (kind && result) __defProp$3z(target, key, result); 20207 return result; 20208 }; 20209 var AccessType = /* @__PURE__ */ ((AccessType2) => { 20210 AccessType2["CAMPAIGN"] = "campaign"; 20211 AccessType2["RESERVATION_REQUEST"] = "reservationRequest";
20212 AccessType2["CUSTOM_LIST"] = "customList"; 20213 AccessType2["WAITING_LIST"] = "waitingList"; 20214 return AccessType2; 20215 })(AccessType || {}); 20216 const appendAccessParams = (params, access) => { 20217 if (!access) return; 20218 if (access.customListSlug) params.append("list", access.customListSlug); 20219 if (access.campaignHash) params.append("campaign_hash", access.campaignHash); 20220 if (access.campaignId) params.append("campaign_id", access.campaignId.toString()); 20221 if (access.reservationRequestConfigId) 20222 params.append("reservation_request_config_id", access.reservationRequestConfigId.toString()); 20223 if (access.reservationRequestConfigHash) 20224 params.append("reservation_request_config_hash", access.reservationRequestConfigHash); 20225 if (access.isWaitingList) params.append("is_waiting_list", access.isWaitingList.toString()); 20226 }; 20227 const accessParamsToQueryObject = (access) => { 20228 if (!access) return {}; 20229 const { 20230 customListSlug, 20231 campaignHash, 20232 campaignId, 20233 reservationRequestConfigId, 20234 reservationRequestConfigHash, 20235 isWaitingList: isWaitingList2 20236 } = access; 20237 let query = {}; 20238 if (customListSlug) query.sonic_custom_list_slug = customListSlug; 20239 if (campaignHash) query.sonic_campaign_hash = campaignHash; 20240 if (campaignId) query.sonic_campaign_id = campaignId.toString(); 20241 if (reservationRequestConfigId) query.sonic_reservation_request_config_id = reservationRequestConfigId.toString(); 20242 if (reservationRequestConfigHash) query.sonic_reservation_request_config_hash = reservationRequestConfigHash; 20243 if (isWaitingList2) query.sonic_is_waiting_list = isWaitingList2.toString(); 20244 return query; 20245 }; 20246 const getAccessParamsFromUrl = (url) => { 20247 const urlParams = new URLSearchParams(window.location.search); 20248 return { 20249 customListSlug: urlParams.get("sonic_custom_list_slug") || void 0, 20250 campaignHash: urlParams.get("sonic_campaign_hash") || void 0, 20251 campaignId: urlParams.get("sonic_campaign_id") ? Number(urlParams.get("sonic_campaign_id")) : void 0, 20252 reservationRequestConfigId: urlParams.get("sonic_reservation_request_config_id") ? Number(urlParams.get("sonic_reservation_request_config_id")) : void 0, 20253 reservationRequestConfigHash: urlParams.get("sonic_reservation_request_config_hash") || void 0, 20254 isWaitingList: urlParams.get("sonic_is_waiting_list") === "true" ? true : void 0 20255 }; 20256 }; 20257 const getAccessType = (accessParams) => { 20258 if (accessParams?.campaignHash) return "campaign"; 20259 if (accessParams?.campaignId) return "campaign"; 20260 if (accessParams?.reservationRequestConfigId) return "reservationRequest";
20261 if (accessParams?.reservationRequestConfigHash) return "reservationRequest"; 20262 if (accessParams?.customListSlug) return "customList"; 20263 if (accessParams?.isWaitingList) return "waitingList"; 20264 return null; 20265 }; 20266 const hasAccessParams = (accessParams) => { 20267 return accessParams && Object.values(accessParams).some((value) => value !== void 0); 20268 }; 20269 const accessParamsContext = n("accessParamsContext"); 20270 const withAccessParams = (accessParams, content) => b$1`<sonic-access-params-provider .accessParams=${accessParams}>${content}</sonic-access-params-provider>`; 20271 let SonicAccessParamsProvider = class extends i$6 { 20272 render() { 20273 return b$1`<slot></slot>`; 20274 } 20275 }; 20276 __decorateClass$3D([ 20277 e$2({ context: accessParamsContext }), 20278 n$5({ type: Object }) 20279 ], SonicAccessParamsProvider.prototype, "accessParams", 2); 20280 SonicAccessParamsProvider = __decorateClass$3D([ 20281 t$3("sonic-access-params-provider") 20282 ], SonicAccessParamsProvider); 20283 var entityView = /* @__PURE__ */ ((entityView2) => { 20284 entityView2["prices"] = "prices"; 20285 entityView2["mini"] = "mini"; 20286 entityView2["essential"] = "essential"; 20287 entityView2["full"] = "full"; 20288 entityView2["status"] = "status"; 20289 return entityView2; 20290 })(entityView || {}); 20291 const entityTypeToEndpoint = { 20292 show: "shows", 20293 [EntityType.Event]: "sessions", 20294 [EntityType.Subscribe]: "subscription-types", 20295 [EntityType.Giftcard]: "giftcards", 20296 [EntityType.AdditionalProduct]: "additional_products", 20297 [EntityType.Extra]: "extras", 20298 [EntityType.Credit]: "credits", 20299 // c'est assez con, il n'y a pas encore de route pour voir la liste des crédits 20300 [EntityType.Merch]: "merchs" 20301 }; 20302 const entityViewToFeatures = { 20303 [ 20304 "prices" 20305 /* prices */ 20306 ]: [ 20307 Feature.Prices, 20308 Feature.Quotas, 20309 Feature.Range, 20310 Feature.Multisessions, 20311 Feature.PlacesCategories, 20312 Feature.Picture, 20313 Feature.Settings 20314 ], 20315 [ 20316 "mini" 20317 /* mini */ 20318 ]: [Feature.Picture, Feature.Taxonomies], 20319 [ 20320 "essential" 20321 /* essential */ 20322 ]: [ 20323 Feature.Location, 20324 Feature.Taxonomies, 20325 Feature.Picture, 20326 Feature.Settings, 20327 Feature.Multisessions 20328 ], 20329 [ 20330 "full" 20331 /* full */ 20332 ]: [ 20333 Feature.Location, 20334 Feature.Taxonomies, 20335 Feature.Picture, 20336 Feature.Settings, 20337 Feature.Multisessions, 20338 Feature.Prices, 20339 Feature.Stock, 20340 Feature.Quotas, 20341 Feature.Range, 20342 Feature.PlacesCategories, 20343 Feature.Status, 20344 Feature.Producers, 20345 Feature.Rules, 20346 Feature.OwnerForm 20347 ], 20348 [ 20349 "status" 20350 /* status */ 20351 ]: [Feature.Status] 20352 }; 20353 const entityEndPoint = (options) => { 20354 const { 20355 entityType, 20356 entityId, 20357 accessParams, 20358 features, 20359 next, 20360 view, 20361 isQueue, 20362 limit, 20363 featured, 20364 isWaitingList: isWaitingList2, 20365 hasWaitingListRequest, 20366 hasReservationRequest, 20367 forTreatment 20368 } = options; 20369 const urlParams = new URLSearchParams(); 20370 if (next) urlParams.append("next", "1"); 20371 if (view) { 20372 const viewFeatures = entityViewToFeatures[view]; 20373 if (viewFeatures) viewFeatures.forEach((feature) => urlParams.append("features[]", feature)); 20374 } 20375 if (options.customSearchParams) options.customSearchParams.forEach((value, key) => urlParams.append(key, value)); 20376 if (features) features.forEach((feature) => urlParams.append("features[]", feature)); 20377 if (featured) urlParams.append("featured", "1"); 20378 if (isWaitingList2) urlParams.append("is_waiting_list", "1"); 20379 if (hasWaitingListRequest) urlParams.append("has_waiting_list_request", "1"); 20380 if (hasReservationRequest) urlParams.append("has_reservation_request", "1"); 20381 if (forTreatment) urlParams.append("for_treatment", "1"); 20382 if (options.subscriptionTypeIds) 20383 options.subscriptionTypeIds.forEach((id) => urlParams.append("subscription_type_id[]", id.toString())); 20384 if (options.subscriptionPriceIds) 20385 options.subscriptionPriceIds.forEach((id) => urlParams.append("subscription_price_id[]", id.toString())); 20386 if (options.excludedIds) options.excludedIds.forEach((id) =>
20386 urlParams.append("excluded_ids[]", id.toString())); 20387 if (options.multisessionId) urlParams.append("multisession_id", options.multisessionId.toString()); 20388 appendAccessParams(urlParams, accessParams); 20389 if (view === "full" && entityType === "show") { 20390 urlParams.append( 20391 "view", 20392 "full" 20393 /* full */ 20394 ); 20395 } else if (view === "essential" && entityType === "show") { 20396 urlParams.append( 20397 "view", 20398 "essential" 20399 /* essential */ 20400 ); 20401 } 20402 const endpoint = entityTypeToEndpoint[entityType]; 20403 const queueParams = isQueue ? `&limit=$limit&offset=$offset` : ""; 20404 return `${endpoint}${entityId ? `/${entityId}` : ""}?${urlParams.toString()}${queueParams}${limit ? `&limit=${limit}` : ""}`; 20405 }; 20406 const entityStatusEndPoint = (options) => { 20407 const { entityType, entityId, accessParams } = options; 20408 const urlParams = new URLSearchParams(); 20409 appendAccessParams(urlParams, accessParams); 20410 const endpoint = entityTypeToEndpoint[entityType]; 20411 if (entityType === "show") { 20412 return `${endpoint}/${entityId}/status?${urlParams.toString()}`; 20413 } else { 20414 return entityEndPoint({ 20415 ...options, 20416 view: "status" 20417 /* status */ 20418 }); 20419 } 20420 }; 20421 const idFromSlug = (slug) => { 20422 return slug.split("-")[0]; 20423 }; 20424 var __defProp$3y = Object.defineProperty; 20425 var __getOwnPropDesc$3B = Object.getOwnPropertyDescriptor; 20426 var __decorateClass$3C = (decorators, target, key, kind) => { 20427 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3B(target, key) : target; 20428 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 20429 if (decorator = decorators[i2]) 20430 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 20431 if (kind && result) __defProp$3y(target, key, result); 20432 return result; 20433 }; 20434 var ProductDisplay = /* @__PURE__ */ ((ProductDisplay2) => { 20435 ProductDisplay2["Location"] = "location"; 20436 ProductDisplay2["Status"] = "status"; 20437 ProductDisplay2["Range"] = "range"; 20438 ProductDisplay2["LocationFull"] = "locationFull"; 20439 return ProductDisplay2; 20440 })(ProductDisplay || {}); 20441 let SonicProductSummary = class extends Subscriber$1( 20442 i$6 20443 ) { 20444 constructor() { 20445 super(...arguments); 20446 this.link = false; 20447 this.textOnly = false; 20448 this.noOverTitle = false; 20449 this.size = "md"; 20450 this.id = ""; 20451 this.hash = ""; 20452 this.fixedActions = false; 20453 this.hasAction = false; 20454 this.hasInfos = false; 20455 } 20456 // SWITCH LAYOUTS 20457 render() { 20458 const entityType = this.props?.entity_type; 20459 const entityId = this.props?.id; 20460 const entitySlug = this.props?.slug; 20461 if (!entityId) { 20462 return A$1; 20463 } 20464 if (this.link) { 20465 const enableLinkToEvent = entityType === EntityType.Event && entityId; 20466 const enableLinkToGiftcard = entityType === EntityType.Giftcard; 20467 const enableLinkToSubscribe = entityType === EntityType.Subscribe; 20468 const enableLinkToMerch = entityType === EntityType.Merch; 20469 if (enableLinkToEvent || enableLinkToMerch) { 20470 const to = enableLinkToEvent ? "event" : "merch"; 20471 return b$1`<sonic-app-link noAutoFill class="contents group" to=${to} .slug=${entitySlug} id=${entityId} 20472 >${this.renderContent()}</sonic-app-link 20473 >`; 20474 } 20475 if (enableLinkToSubscribe) { 20476 return b$1`<sonic-app-link class="contents" to="subscription">${this.renderContent()}</sonic-app-link>`; 20477 } 20478 if (enableLinkToGiftcard) { 20479 return b$1`<sonic-app-link class="contents" to="giftcards">${this.renderContent()}</sonic-app-link>`; 20480 } 20481 } 20482 return b$1`${this.renderContent()} `; 20483 } 20484 actionsChange() { 20485 this.hasAction = !!this.actionsElement?.length; 20486 } 20487 renderContent() { 20488 if (this.textOnly) { 20489 return b$1`<div class="@container">${this.renderText()}</div>`; 20490 } 20491 let gridClass; 20492 switch (this.size) { 20493 case "2xs": 20494 gridClass = "grid-cols-[2.7rem_minmax(0,1fr)] gap-2"; 20495 break; 20496 case "xs": 20497 gridClass = "grid-cols-[3.2rem_minmax(0,1fr)] gap-3"; 20498 break; 20499 case "sm": 20500 gridClass = "grid-cols-[4rem_minmax(0,1fr)] gap-3"; 20501 break; 20502 case "lg": 20503 gridClass = "grid-cols-[6rem_minmax(0,1fr)] gap-3"; 20504 break; 20505 default: 20506 gridClass = "grid-cols-[5.2rem_minmax(0,1fr)] gap-4"; 20507 break; 20508 } 20509 return b$1` 20510 <div class="@container grid ${gridClass} gap-4 items-center w-full"> 20511 ${this.headerImage()} ${this.renderText()} 20512 </div> 20513 `; 20514 } 20515 // CONTENUS TEXTE DES PRODUITS 20516 headerImage() { 20517 let rounded = ""; 20518 switch (this.size) { 20519 case "2xs": 20520 case "sm": 20521 case "xs": 20522 rounded = ""; 20523 break; 20524 default: 20525 rounded = "md"; 20526 break; 20527 } 20528 return b$1`<sonic-product-illustration
20529 rounded="${rounded}" 20530 class="self-start" 20531 .entity_type=${this.props?.entity_type} 20532 ></sonic-product-illustration>`; 20533 } 20534 infosChange() { 20535 this.hasInfos = !!this.infosElement?.length; 20536 } 20537 renderText() { 20538 let titleClass; 20539 let dateClass; 20540 let locationClass; 20541 switch (this.size) { 20542 case "2xs": 20543 dateClass = "text-[max(.65rem,10px)]"; 20544 titleClass = "text-xs"; 20545 locationClass = "text-xs"; 20546 break; 20547 case "xs": 20548 dateClass = "text-2xs"; 20549 titleClass = "text-sm"; 20550 locationClass = "text-xs"; 20551 break; 20552 case "sm": 20553 dateClass = "text-xs mb-1"; 20554 titleClass = "text-base"; 20555 locationClass = "text-xs"; 20556 break; 20557 case "lg": 20558 dateClass = "text-sm mb-1"; 20559 titleClass = "text-xl"; 20560 locationClass = "text-base"; 20561 break; 20562 default: 20563 dateClass = "text-xs mb-1"; 20564 titleClass = "text-lg"; 20565 locationClass = "text-sm"; 20566 break; 20567 } 20568 const displayStatus = this.featureDisplay?.includes( 20569 "status" 20570 /* Status */ 20571 ); 20572 const displayLocation = this.featureDisplay?.includes( 20573 "location" 20574 /* Location */ 20575 ) || this.featureDisplay?.includes( 20576 "locationFull" 20577 /* LocationFull */ 20578 ); 20579 const displayRange = this.featureDisplay?.includes( 20580 "range" 20581 /* Range */ 20582 ); 20583 const featuresWithoutLocation = this.featureDisplay?.filter( 20584 (feature) => feature !== "location" && feature !== "locationFull" 20585 /* LocationFull */ 20586 ); 20587 const hasFeatures = featuresWithoutLocation?.length; 20588 return b$1`<div class="w-full gap-x-4 ${this.fixedActions ? "flex" : ""} @lg:flex items-center @lg:flex-row "> 20589 <div class="flex-grow py-[2px] ${hasFeatures || this.hasInfos ? "max-w-[23rem]" : "max-w-full"}"> 20590 <sonic-date class="${dateClass} block uppercase "></sonic-date> 20591 <sonic-product-title 20592 class="${titleClass}" 20593 ?noOverTitle=${["2xs", "xs", "sm"].includes(this.size) || this.noOverTitle} 20594 ></sonic-product-title> 20595 <slot name="subTitle"></slot> 20596 ${displayLocation ? b$1`<sonic-event-location-hall 20597 ?noPlacement=${!this.featureDisplay?.includes( 20598 "locationFull" 20599 /* LocationFull */ 20600 )} 20601 class="${locationClass} block text-neutral-500 mt-1 " 20602 ></sonic-event-location-hall>` : A$1} 20603 </div> 20604 20605 <div 20606 class="flex text-2xs @lg:text-xs flex-wrap mt-1 gap-y-1 @lg:mt-0 @lg:flex-col @lg:flex-nowrap @lg:justify-center @lg:pr-2" 20607 > 20608 ${this.featureDisplay ? b$1` 20609 ${displayRange ? b$1`<sonic-event-range size="inherit"></sonic-event-range>` : A$1} 20610 ${this.id && displayStatus && this.props?.entity_type === EntityType.Event ? b$1`<sonic-event-additional-status 20611 fetch 20612 dataProvider="${entityEndPoint({ 20613 entityType: EntityType.Event, 20614 entityId: Number(this.id), 20615 accessParams: this.accessParams, 20616 view: entityView.status 20617 })}" 20618 size="inherit" 20619 class="flex flex-wrap gap-x-3 " 20620 variant="ghost" 20621 key="data" 20622 ></sonic-event-additional-status>` : A$1} 20623 ` : A$1} 20624 <slot name="infos" @slotchange=${this.infosChange}></slot> 20625 </div> 20626 <slot 20627 name="actions" 20628 class="ml-auto ${this.hasAction ? "block" : "hidden"}" 20629 @slotchange=${this.actionsChange} 20630 ></slot> 20631 </div>`; 20632 } 20633 }; 20634 SonicProductSummary.styles = [ 20635 tailwind, 20636 i$9` 20637 :host { 20638 display: block; 20639 } 20640 ` 20641 ]; 20642 __decorateClass$3C([ 20643 n$5({ type: Boolean }) 20644 ], SonicProductSummary.prototype, "link", 2); 20645 __decorateClass$3C([ 20646 n$5({ type: Boolean }) 20647 ], SonicProductSummary.prototype, "textOnly", 2); 20648 __decorateClass$3C([ 20649 n$5({ type: Boolean }) 20650 ], SonicProductSummary.prototype, "noOverTitle", 2); 20651 __decorateClass$3C([ 20652 n$5({ type: String }) 20653 ], SonicProductSummary.prototype, "size", 2); 20654 __decorateClass$3C([ 20655 n$5({ type: String, attribute: "data-id" }) 20656 ], SonicProductSummary.prototype, "id", 2); 20657 __decorateClass$3C([ 20658 n$5({ type: Array }) 20659 ], SonicProductSummary.prototype, "featureDisplay", 2); 20660 __decorateClass$3C([ 20661 n$5({ type: String }) 20662 ], SonicProductSummary.prototype, "hash", 2); 20663 __decorateClass$3C([ 20664 n$5({ type: Boolean }) 20665 ], SonicProductSummary.prototype, "fixedActions", 2); 20666 __decorateClass$3C([ 20667 c({ context: accessParamsContext, subscribe: true }), 20668 n$5({ type: Object }) 20669 ], SonicProductSummary.prototype, "accessParams", 2); 20670 __decorateClass$3C([ 20671 o$8({ selector: "*", slot: "actions" }) 20672 ], SonicProductSummary.prototype, "actionsElement", 2); 20673 __decorateClass$3C([ 20674 r$5() 20675 ], SonicProductSummary.prototype, "hasAction", 2); 20676 __decorateClass$3C([ 20677 o$8({ selector: "*", slot: "infos" }) 20678 ], SonicProductSummary.prototype, "infosElement", 2); 20679 __decorateClass$3C([ 20680 r$5() 20681 ], SonicProductSummary.prototype, "hasInfos", 2); 20682 SonicProductSummary = __decorateClass$3C([ 20683 t$3("sonic-product-summary") 20684 ], SonicProductSummary); 20685 var __decorate$w = function(decorators, target, key, desc) { 20686 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 20687 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 20688 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 20689 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 20690 };
20691 const tagName$2o = "sonic-divider"; 20692 let Divider = class Divider extends i$6 { 20693 constructor() { 20694 super(...arguments); 20695 this.label = ""; 20696 this.align = "center"; 20697 this.vertical = false; 20698 this.noMargin = false; 20699 this.dashed = false; 20700 this.dotted = false; 20701 } 20702 firstUpdated(changedProperties) { 20703 super.firstUpdated(changedProperties); 20704 if (this.label || this.slotNodes?.length) { 20705 this.divider?.classList.add("has-text"); 20706 } 20707 } 20708 render() { 20709 return b$1`<div part="divider"> 20710 <span class="text" 20711 >${o$6(this.label ? this.label : "")}<slot></slot 20712 ></span> 20713 </div>`; 20714 } 20715 }; 20716 Divider.styles = [ 20717 i$9` 20718 :host { 20719 --sc-divider-my: 0.5rem; 20720 --sc-divider-mx: 0; 20721 --sc-divider-border-width: max( 20722 1px, 20723 var(--sc-border-width, max(1px, 0.12rem)) 20724 ); 20725 --sc-divider-border-color: var(--sc-border-color); 20726 --sc-divider-border-style: solid; 20727 --sc-divider-color: currentColor; 20728 --sc-divider-ff: var(--sc-font-family-base, sans-serif); 20729 --sc-divider-fs: 1rem; 20730 --sc-divider-fw: var(--sc-font-weight-base, 400); 20731 --sc-divider-fst: var(--sc-font-style-base, normal); 20732 20733 margin: var(--sc-divider-my) var(--sc-divider-mx); 20734 font-size: var(--sc-divider-fs); 20735 font-style: var(--sc-divider-fst); 20736 font-family: var(--sc-divider-ff); 20737 font-weight: var(--sc-divider-fw); 20738 color: var(--sc-divider-color); 20739 display: block; 20740 } 20741 20742 /*SIZE*/ 20743 :host([size="2xs"]) { 20744 --sc-divider-my: 0.35rem; 20745 --sc-divider-fs: 0.68rem; 20746 } 20747 20748 :host([size="xs"]) { 20749 --sc-divider-my: 0.5rem; 20750 --sc-divider-fs: 0.75rem; 20751 } 20752 20753 :host([size="sm"]) { 20754 --sc-divider-my: 0.75rem; 20755 --sc-divider-fs: 0.875rem; 20756 } 20757 20758 :host([size="md"]) { 20759 --sc-divider-my: 1.25rem; 20760 } 20761 20762 :host([size="lg"]) { 20763 --sc-divider-my: 1.85rem; 20764 } 20765 20766 :host([size="xl"]) { 20767 --sc-divider-my: 2.25rem; 20768 } 20769 20770 :host([size="2xl"]) { 20771 --sc-divider-my: 3.35rem; 20772 } 20773 20774 div { 20775 display: flex; 20776 align-items: center; 20777 width: 100%; 20778 } 20779 20780 div::before, 20781 div::after { 20782 content: ""; 20783 flex-grow: 1; 20784 border-top: var(--sc-divider-border-width) 20785 var(--sc-divider-border-style) var(--sc-divider-border-color); 20786 width: 100%; 20787 opacity: var(--sc-divider-opacity, 1); 20788 } 20789 20790 /*ALIGNEMENT*/ 20791 :host([align="left"]) div:before { 20792 display: none; 20793 } 20794 20795 :host([align="right"]) div:after { 20796 display: none; 20797 } 20798 20799 :host([vertical]) { 20800 margin: var(--sc-divider-mx) var(--sc-divider-my); 20801 } 20802 20803 :host([vertical]) div { 20804 flex-direction: column; 20805 height: 100%; 20806 min-height: var(--sc-form-height, 2.5em); 20807 } 20808 20809 :host([vertical]) .has-text { 20810 gap: 0.25rem; 20811 } 20812 20813 :host([vertical]) div::before, 20814 :host([vertical]) div::after { 20815 border-top: none; 20816 border-left: var(--sc-divider-border-width) 20817 var(--sc-divider-border-style) var(--sc-divider-border-color); 20818 width: auto; 20819 height: 100%; 20820 opacity: var(--sc-divider-opacity, 1); 20821 } 20822 20823 :host([noMargin]) { 20824 margin: 0; 20825 } 20826 20827 /*TEXT*/ 20828 .text { 20829 flex-shrink: 0; 20830 line-height: 1.1; 20831 max-width: 80%; 20832 } 20833 20834 .no-text .text { 20835 display: none; 20836 } 20837 20838 .has-text { 20839 gap: 0.5rem; 20840 } 20841 20842 :host([dotted]) { 20843 --sc-divider-border-style: dotted; 20844 } 20845 :host([dashed]) { 20846 --sc-divider-border-style: dashed; 20847 } 20848 ` 20849 ]; 20850 __decorate$w([ 20851 n$4({ flatten: true }) 20852 ], Divider.prototype, "slotNodes", void 0); 20853 __decorate$w([ 20854 e$7("div") 20855 ], Divider.prototype, "divider", void 0); 20856 __decorate$w([ 20857 n$5({ type: String }) 20858 ], Divider.prototype, "label", void 0); 20859 __decorate$w([ 20860 n$5({ type: String, reflect: true }) 20861 ], Divider.prototype, "size", void 0); 20862 __decorate$w([ 20863 n$5({ type: String, reflect: true }) 20864 ], Divider.prototype, "align", void 0); 20865 __decorate$w([ 20866 n$5({ type: Boolean, reflect: true }) 20867 ], Divider.prototype, "vertical", void 0); 20868 __decorate$w([ 20869 n$5({ type: Boolean, reflect: true }) 20870 ], Divider.prototype, "noMargin", void 0); 20871 __decorate$w([ 20872 n$5({ type: Boolean, reflect: true }) 20873 ], Divider.prototype, "dashed", void 0); 20874 __decorate$w([ 20875 n$5({ type: Boolean, reflect: true }) 20876 ], Divider.prototype, "dotted", void 0); 20877 Divider = __decorate$w([ 20878 t$3(tagName$2o) 20879 ], Divider); 20880 const passwordToggle = i$9` 20881 .password-toggle { 20882 color: var(--sc-input-c); 20883 font-size: var(--sc-input-fs); 20884 cursor: pointer; 20885 margin-right: calc(-0.5 * var(--sc-input-px)); 20886 } 20887 20888 :host([inlineContent]) .has-suffix .password-toggle { 20889 margin-right: 0; 20890 } 20891`; 20892 const label = i$9` 20893 :host { 20894 --sc-label-fs: var(--sc-_fs, 1rem);
20895 --sc-label-fw: var(--sc-label-font-weight, 500); 20896 } 20897 label { 20898 font-size: var(--sc-label-fs); 20899 font-weight: var(--sc-label-fw); 20900 line-height: 1.2; 20901 } 20902 .form-label { 20903 margin-bottom: 0.22em; 20904 display: block; 20905 } 20906`; 20907 const description = i$9` 20908 .form-description { 20909 color: var(--sc-base-400, var(--sc-base-content, #000)); 20910 font-size: 0.85em; 20911 margin-top: 0.2em; 20912 display: block; 20913 } 20914`; 20915 const formControl = i$9` 20916 * { 20917 box-sizing: border-box; 20918 } 20919 20920 :host { 20921 --sc-input-height: var(--sc-form-height, 2.5em); 20922 --sc-input-c: var(--sc-input-color, var(--sc-base-content, #000)); 20923 --sc-input-b-width: var(--sc-form-border-width); 20924 --sc-input-b-color: var( 20925 --sc-input-border-color, 20926 var(--sc-base-content, #000) 20927 ); 20928 20929 --sc-item-rounded-tr: var(--sc-input-rounded); 20930 --sc-item-rounded-tl: var(--sc-input-rounded); 20931 --sc-item-rounded-bl: var(--sc-input-rounded); 20932 --sc-item-rounded-br: var(--sc-input-rounded); 20933 20934 --sc-input-fs: var(--sc-_fs, 1rem); 20935 --sc-input-ff: var( 20936 --sc-input-font-family, 20937 var(--sc-font-family-base, sans-serif) 20938 ); 20939 --sc-input-py: 0.55em; 20940 --sc-input-px: clamp(0.3em, 8%, 1.1em); 20941 20942 --sc-input-background: var(--sc-input-bg); 20943 --sc-input-addon-c: var(--sc-input-addon-color, var(--sc-base, #fff)); 20944 --sc-input-addon-bg: var(--sc-input-c); 20945 } 20946 20947 .form-element { 20948 display: block; 20949 flex-grow: 1; 20950 width: 100%; 20951 20952 line-height: 1.1; 20953 color: var(--sc-input-c); 20954 border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) 20955 var(--sc-item-rounded-br) var(--sc-item-rounded-bl); 20956 20957 font-family: var(--sc-input-ff); 20958 background-color: var(--sc-input-background); 20959 border: var(--sc-input-b-width) solid 20960 var(--sc-input-b-color, var(--sc-base-300, #aaa)); 20961 width: 100%; 20962 font-size: var(--sc-input-fs); 20963 20964 padding-top: var(--sc-input-py); 20965 padding-bottom: var(--sc-input-py); 20966 padding-left: var(--sc-input-px); 20967 padding-right: var(--sc-input-px); 20968 20969 transition: border-color 0.15s ease-in-out, color 0.15s ease-in-out, 20970 box-shadow 0.15s ease-in-out; 20971 min-height: var(--sc-input-height); 20972 } 20973 20974 .form-control { 20975 display: flex; 20976 width: 100%; 20977 } 20978 20979 /*Suffix*/ 20980 :host(:not([inlineContent])) .has-suffix slot[name="suffix"], 20981 :host(:not([inlineContent])) .has-prefix slot[name="prefix"] { 20982 min-width: var(--sc-input-height); 20983 box-sizing: border-box; 20984 display: flex; 20985 align-items: center; 20986 justify-content: center; 20987 line-height: 1.1; 20988 flex-shrink: 0; 20989 border: var(--sc-input-b-width) solid transparent; 20990 padding-left: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px))); 20991 padding-right: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px))); 20992 } 20993 20994 :host(:not([inlineContent])) slot[name="prefix"] { 20995 border-radius: var(--sc-item-rounded-tl) 0 0 var(--sc-item-rounded-bl); 20996 background-color: var(--sc-input-addon-bg); 20997 color: var(--sc-input-addon-c); 20998 /*margin-right: calc(-1 * var(--sc-input-b-width)); 20999 border: none;*/ 21000 } 21001 21002 :host(:not([inlineContent])) slot[name="suffix"] { 21003 border-radius: 0 var(--sc-item-rounded-tr) var(--sc-item-rounded-br) 0; 21004 background-color: var(--sc-input-addon-bg); 21005 color: var(--sc-input-addon-c); 21006 /*margin-left: calc(-1 * var(--sc-input-b-width)); 21007 border: none;*/ 21008 } 21009 21010 :host(:not([inlineContent])[disabled]) .has-suffix slot[name="suffix"], 21011 :host(:not([inlineContent])[disabled]) .has-prefix slot[name="prefix"] { 21012 opacity: 0.43; 21013 } 21014 21015 :host(:not([inlineContent])) .has-prefix .form-element { 21016 border-top-left-radius: 0; 21017 border-bottom-left-radius: 0; 21018 } 21019 21020 :host(:not([inlineContent])) .has-suffix .form-element { 21021 border-top-right-radius: 0; 21022 border-bottom-right-radius: 0; 21023 } 21024 21025 slot[name="suffix"]::slotted(sonic-icon), 21026 slot[name="prefix"]::slotted(sonic-icon) { 21027 font-size: 1.2em; 21028 } 21029 21030 /*InlineCONTENT */ 21031 21032 .form-element > slot, 21033 .form-element .form-element { 21034 all: unset; 21035 } 21036 21037 :host([inlineContent]) .form-element { 21038 display: flex; 21039 align-items: center; 21040 gap: 0.35em; 21041 min-height: var(--sc-form-height, 2.5em); 21042 } 21043 21044 :host([inlineContent]) .form-element .form-element { 21045 appearance: none; 21046 background: transparent; 21047 border: none; 21048 padding: 0; 21049 display: block; 21050 width: 50%; 21051 min-width: 0; 21052 flex: 1 1 auto; 21053 height: auto; 21054 min-height: auto; 21055 border-radius: 0; 21056 } 21057 :host([inlineContent]) slot[name="prefix"]::slotted(*), 21058 :host([inlineContent]) slot[name="suffix"]::slotted(*) { 21059 display: block; 21060 flex: 0 0 auto; 21061 max-width: 100%; 21062 max-width: 100%; 21063 white-space: nowrap; 21064 } 21065 21066 :host([inlineContent]) .has-suffix slot[name="suffix"] { 21067 margin-right: calc(-0.5 * var(--sc-input-px)); 21068 } 21069 :host([inlineContent]) .has-prefix slot[name="prefix"] { 21070 margin-left: calc(-0.5 * var(--sc-input-px)); 21071 } 21072 21073 :host([inlineContent]) slot[name="suffix"]::slotted(*) { 21074 margin-left: auto; 21075 } 21076 21077 :host([inlineContent]) .no-suffix slot[name="suffix"], 21078 :host([inlineContent]) .no-prefix slot[name="prefix"] { 21079 display: none; 21080 } 21081 21082 /* :host([inlineContent]) .input { 21083 21084 }*/ 21085 /*Disabled */ 21086 :host([disabled]) .form-control {
21087 cursor: not-allowed; 21088 } 21089 21090 :host([variant="ghost"]) .form-element { 21091 --sc-input-bg: transparent; 21092 } 21093 21094 /*Disbaled*/ 21095 :host([disabled]) .form-element { 21096 pointer-events: none; 21097 opacity: 0.43; 21098 /* border-color: transparent;*/ 21099 } 21100 :host([disabled]) .select-chevron { 21101 display: none; 21102 /* border-color: transparent;*/ 21103 } 21104 21105 /*PLACEHOLDER*/ 21106 ::placeholder { 21107 color: inherit; 21108 opacity: 0.6; 21109 } 21110 21111 :host([placehoderAsLabel]) ::placeholder { 21112 opacity: 1; 21113 } 21114 21115 :focus::placeholder { 21116 opacity: 0 !important; 21117 } 21118 21119 /*HOVER*/ 21120 :host(:not([disabled])) .form-element:hover, 21121 .form-element:focus-visible, 21122 .form-element:focus { 21123 background-color: hsl(from var(--sc-input-bg) h s calc(l * 0.97)); 21124 } 21125 21126 .form-label { 21127 margin-bottom: 0.22em; 21128 display: block; 21129 } 21130 21131 /*Utilitaires*/ 21132 .hidden { 21133 display: none; 21134 } 21135 .contents { 21136 display: contents; 21137 } 21138 21139 /*ERROR*/ 21140 :host([error]) { 21141 --sc-input-b-color: var(--sc-danger, var(--sc-base-content, #000)); 21142 } 21143 21144 :host input:visited { 21145 display: none; 21146 } 21147 21148 :host([touched][required]) :not(:focus):invalid { 21149 --sc-input-b-color: var(--sc-danger, var(--sc-base-content, #000)); 21150 --sc-input-c: var(--sc-danger, var(--sc-base-content, #000)); 21151 } 21152 21153 :host([touched][required]) :not(:focus):invalid + .select-chevron { 21154 --sc-input-c: var(--sc-danger, var(--sc-base-content, #000)); 21155 } 21156 21157 /*VALID*/ 21158 :host([touched][required]) :not([value=""]):not(:focus):valid { 21159 --sc-input-b-color: var(--sc-success, var(--sc-base-content, #000)); 21160 --sc-input-c: var(--sc-success, var(--sc-base-content, #000)); 21161 } 21162 21163 :host([touched][required]) :not(:focus):valid + .select-chevron { 21164 --sc-input-c: var(--sc-success, var(--sc-base-content, #000)); 21165 } 21166 /*active*/ 21167 :host([active]) { 21168 --sc-input-b-color: var(--sc-primary, var(--sc-base-content, #000)); 21169 --sc-input-c: var(--sc-primary, var(--sc-base-content, #000)); 21170 } 21171 :host([active]) .select-chevron { 21172 --sc-input-c: var(--sc-primary, var(--sc-base-content, #000)); 21173 } 21174 21175 /*Input COLOR*/ 21176 :host([type="color"]) .form-element { 21177 padding: 0; 21178 border: 0; 21179 min-width: var(--sc-input-height); 21180 } 21181 input[type="color"]::-webkit-color-swatch-wrapper { 21182 padding: 0; 21183 } 21184 input[type="color"]::-webkit-color-swatch { 21185 border: none; 21186 border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) 21187 var(--sc-item-rounded-br) var(--sc-item-rounded-bl); 21188 } 21189 21190 /*Input Image*/ 21191 :host([type="image"]) .form-element { 21192 padding: 0; 21193 border: none; 21194 } 21195 21196 /*Input reset & image*/ 21197 input[type="reset"], 21198 input[type="submit"] { 21199 cursor: pointer; 21200 } 21201 21202 /*Input search*/ 21203 :host([type="search"]) { 21204 appearance: none !important; 21205 } 21206 21207 input[type="search"]::-webkit-search-cancel-button { 21208 appearance: none; 21209 cursor: pointer; 21210 height: 0.65em; 21211 width: 0.65em; 21212 background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE2LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgd2lkdGg9IjEyMy4wNXB4IiBoZWlnaHQ9IjEyMy4wNXB4IiB2aWV3Qm94PSIwIDAgMTIzLjA1IDEyMy4wNSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTIzLjA1IDEyMy4wNTsiDQoJIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGc+DQoJPHBhdGggZD0iTTEyMS4zMjUsMTAuOTI1bC04LjUtOC4zOTljLTIuMy0yLjMtNi4xLTIuMy04LjUsMGwtNDIuNCw0Mi4zOTlMMTguNzI2LDEuNzI2Yy0yLjMwMS0yLjMwMS02LjEwMS0yLjMwMS04LjUsMGwtOC41LDguNQ0KCQljLTIuMzAxLDIuMy0yLjMwMSw2LjEsMCw4LjVsNDMuMSw0My4xbC00Mi4zLDQyLjVjLTIuMywyLjMtMi4zLDYuMSwwLDguNWw4LjUsOC41YzIuMywyLjMsNi4xLDIuMyw4LjUsMGw0Mi4zOTktNDIuNGw0Mi40LDQyLjQNCgkJYzIuMywyLjMsNi4xLDIuMyw4LjUsMGw4LjUtOC41YzIuMy0yLjMsMi4zLTYuMSwwLTguNWwtNDIuNS00Mi40bDQyLjQtNDIuMzk5QzEyMy42MjUsMTcuMTI1LDEyMy42MjUsMTMuMzI1LDEyMS4zMjUsMTAuOTI1eiIvPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPC9zdmc+DQo=); 21213 background-size: contain; 21214 background-repeat: no-repeat; 21215 } 21216 21217 /* Text align */ 21218 :host([align="center"]) .form-element { 21219 text-align: center; 21220 } 21221 :host([align="left"]) .form-element { 21222 text-align: left; 21223 } 21224 :host([align="right"]) .form-element { 21225 text-align: right; 21226 } 21227 21228 /* No arrows ion input Number */ 21229 :host([noAppearance]) input[type="number"]::-webkit-outer-spin-button, 21230 :host([noAppearance]) input[type="number"]::-webkit-inner-spin-button { 21231 -webkit-appearance: none; 21232 margin: 0; 21233 } 21234 21235 :host([noAppearance]) input[type="number"] { 21236 -moz-appearance: textfield !important; 21237 } 21238 21239 /*type color "default" | "success" | "error" | "warning" | "info" */ 21240 :host([status="success"]) { 21241 --sc-input-b-color: var(--sc-success, var(--sc-base-content, #000)); 21242 --sc-input-c: var(--sc-success, var(--sc-base-content, #000)); 21243 --sc-input-addon-bg: var(--sc-success, var(--sc-base-content, #000)); 21244 --sc-input-addon-color: var(--sc-success-content, var(--sc-base, #fff)); 21245 } 21246 :host([status="error"]) { 21247 --sc-input-b-color: var(--sc-danger, var(--sc-base-content, #000)); 21248 --sc-input-c: var(--sc-danger, var(--sc-base-content, #000)); 21249 --sc-input-addon-bg: var(--sc-danger, var(--sc-base-content, #000)); 21250 --sc-input-addon-color: var(--sc-danger-content, var(--sc-base, #fff)); 21251 } 21252 :host([status="warning"]) { 21253 --sc-input-b-color: var(--sc-warning); 21254 --sc-input-c: var(--sc-warning, var(--sc-base-content, #000)); 21255 --sc-input-addon-bg: var(--sc-warning, var(--sc-base-content, #000)); 21256 --sc-input-addon-color: var(--sc-warning-content, var(--sc-base, #fff)); 21257 } 21258 :host([status="info"]) { 21259 --sc-input-b-color: var(--sc-info, var(--sc-base-content, #000)); 21260 --sc-input-c: var(--sc-info, var(--sc-base-content, #000)); 21261 --sc-input-addon-bg: var(--sc-info, var(--sc-base-content, #000)); 21262 --sc-input-addon-color: var(--sc-info-content, var(--sc-base, #fff)); 21263 } 21264 :host([status="primary"]) { 21265 --sc-input-b-color: var(--sc-primary, var(--sc-base-content, #000)); 21266 --sc-input-c: var(--sc-primary, var(--sc-base-content, #000)); 21267 --sc-input-addon-bg: var(--sc-primary, var(--sc-base-content, #000)); 21268 --sc-input-addon-color: var(--sc-primary-content, var(--sc-base, #fff)); 21269 } 21270`; 21271 var __decorate$v = function(decorators, target, key, desc) { 21272 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 21273 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 21274 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 21275 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 21276 }; 21277 const tagName$2n = "sonic-group"; 21278 let Group = class Group extends i$6 { 21279 constructor() { 21280 super(...arguments); 21281 this.alignItems = "center"; 21282 this.hasDescription = false;
21283 this.hasLabel = false; 21284 } 21285 updated() { 21286 const children = this.querySelectorAll("sonic-input, sonic-button, sonic-select"); 21287 const nbChildren = children.length; 21288 if (nbChildren > 1) { 21289 children.forEach((item, index) => { 21290 const htmlElement = item; 21291 if (index === 0) { 21292 htmlElement.style.setProperty("--sc-item-rounded-tr", "0"); 21293 htmlElement.style.setProperty("--sc-item-rounded-br", "0"); 21294 } else if (index === nbChildren - 1) { 21295 htmlElement.style.setProperty("--sc-item-rounded-tl", "0"); 21296 htmlElement.style.setProperty("--sc-item-rounded-bl", "0"); 21297 } else { 21298 htmlElement.style.setProperty("--sc-item-rounded-tr", "0"); 21299 htmlElement.style.setProperty("--sc-item-rounded-br", "0"); 21300 htmlElement.style.setProperty("--sc-item-rounded-tl", "0"); 21301 htmlElement.style.setProperty("--sc-item-rounded-bl", "0"); 21302 } 21303 }); 21304 } 21305 } 21306 connectedCallback() { 21307 super.connectedCallback(); 21308 this.hasSlotOrProps(); 21309 } 21310 willUpdate(changedProperties) { 21311 this.hasSlotOrProps(); 21312 super.willUpdate(changedProperties); 21313 } 21314 hasSlotOrProps() { 21315 this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false; 21316 this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false; 21317 } 21318 render() { 21319 const slotStyle = { 21320 alignItems: this.alignItems 21321 }; 21322 return b$1`<span class="${this.hasLabel ? "form-label" : "hidden"}" 21323 >${this.label ? o$6( 21324 this.label 21325 /*+ labelStarSuffix*/ 21326 ) : ""}<slot 21327 name="label" 21328 @slotchange=${this.hasSlotOrProps} 21329 ></slot 21330 ></span> 21331 <slot class="main-slot" style=${o$3(slotStyle)}></slot> 21332 <slot 21333 name="description" 21334 @slotchange=${this.hasSlotOrProps} 21335 class="${this.hasDescription ? "form-description" : "hidden"}" 21336 > 21337 ${this.description ? b$1`${o$6(this.description)}` : ""} 21338 </slot>`; 21339 } 21340 }; 21341 Group.styles = [ 21342 fontSize, 21343 label, 21344 description, 21345 i$9` 21346 :host { 21347 display: inline-block; 21348 vertical-align: middle; 21349 } 21350 21351 .main-slot { 21352 width: 100%; 21353 display: flex; 21354 min-width: 0; 21355 } 21356 .hidden { 21357 display: none; 21358 } 21359 21360 ::slotted(sonic-button), 21361 ::slotted(sonic-input), 21362 ::slotted(sonic-select) { 21363 flex-grow: 1; 21364 } 21365 ` 21366 ]; 21367 __decorate$v([ 21368 n$5({ type: String }) 21369 ], Group.prototype, "alignItems", void 0); 21370 __decorate$v([ 21371 n$5({ type: String }) 21372 ], Group.prototype, "label", void 0); 21373 __decorate$v([ 21374 n$5({ type: String }) 21375 ], Group.prototype, "description", void 0); 21376 __decorate$v([ 21377 n$4({ slot: "label", flatten: true }) 21378 ], Group.prototype, "slotLabelNodes", void 0); 21379 __decorate$v([ 21380 n$4({ slot: "description", flatten: true }) 21381 ], Group.prototype, "slotDescriptionNodes", void 0); 21382 __decorate$v([ 21383 r$5() 21384 ], Group.prototype, "hasDescription", void 0); 21385 __decorate$v([ 21386 r$5() 21387 ], Group.prototype, "hasLabel", void 0); 21388 Group = __decorate$v([ 21389 t$3(tagName$2n) 21390 ], Group); 21391 const promoCodeModal = (promoCode) => { 21392 const { code, events, subscription_types } = promoCode; 21393 const eventIds = events?.join(","); 21394 const subscriptionIds = subscription_types?.join(","); 21395 let dataProvider = ""; 21396 let subtitle = t("LIB_code_promo_modal_subtitle"); 21397 if (eventIds) { 21398 dataProvider = `sessions?ids=${eventIds}&next=1&limit=$limit&offset=$offset&features[]=picture&features[]=location&features[]=range`; 21399 } else if (subscriptionIds) { 21400 subtitle = t("LIB_code_promo_modal_subtitle_subscription"); 21401 dataProvider = `subscription-types?ids=${subscriptionIds}`; 21402 } 21403 Modal.create({ 21404 maxHeight: "80svh", 21405 maxWidth: "70rem", 21406 width: "90%", 21407 title: b$1` 21408 ${t("LIB_code_promo")} : 21409 <span style="font-family: var(--sc-font-family-monospace, monospace); font-weight: 600; font-size: 1.25rem;" 21410 >${code}</span 21411 > 21412 `,
21413 content: b$1`<sonic-divider size="lg" align="left" style="margin-top:0">${subtitle}</sonic-divider 21414 ><sonic-queue 21415 dataProviderExpression=${dataProvider} 21416 fetch 21417 key="data" 21418 .noItems=${() => b$1`<sonic-no-result size="lg"></sonic-no-result>`} 21419 .items=${() => b$1`<sonic-product-summary 21420 link 21421 size="sm" 21422 featureDisplay='["status","location"]' 21423 @click=${(e2) => { 21424 const parentModal = HTML.getClosestElement(e2.target, "sonic-modal"); 21425 parentModal?.hide(); 21426 }} 21427 > 21428 <sonic-button slot="actions" shape="circle" class="hidden lg:block" 21429 ><sonic-icon library="custom" name="arrow-right"></sonic-icon 21430 ></sonic-button> 21431 </sonic-product-summary> 21432 <sonic-divider size="md"></sonic-divider> `} 21433 > 21434 </sonic-queue>` 21435 }).addEventListener("hidden", () => { 21436 dp("promo-active-code").invalidate(); 21437 }); 21438 }; 21439 var __defProp$3x = Object.defineProperty; 21440 var __getOwnPropDesc$3A = Object.getOwnPropertyDescriptor; 21441 var __decorateClass$3B = (decorators, target, key, kind) => { 21442 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3A(target, key) : target; 21443 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 21444 if (decorator = decorators[i2]) 21445 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 21446 if (kind && result) __defProp$3x(target, key, result); 21447 return result; 21448 }; 21449 const tagName$2m = "sonic-promo-active-code-item"; 21450 let SonicPromoActiveCodeItem = class extends i$6 { 21451 constructor() { 21452 super(...arguments); 21453 this.showItems = () => { 21454 if (!this.promoCode) return; 21455 this.hideParentToast(); 21456 promoCodeModal(this.promoCode); 21457 }; 21458 this.hideParentToast = () => { 21459 const parentToast = this.closest("sonic-toast-item"); 21460 if (parentToast) { 21461 parentToast.hide(); 21462 } 21463 }; 21464 this.removePromoCode = () => { 21465 if (!this.apiConf) return; 21466 const api2 = new API(this.apiConf); 21467 api2.delete("promotion-code", { 21468 promo_code_id: this.promoCode?.promo_code_id 21469 }).then(() => { 21470 this.hideParentToast(); 21471 setTimeout(() => { 21472 dp("promo-active-code").invalidate(); 21473 }, 1e3); 21474 }); 21475 }; 21476 } 21477 render() { 21478 if (!this.promoCode || !this.promoCode.promo_code_id) return; 21479 const hasSubscriptions = this.promoCode.subscription_types?.length; 21480 let seeMsg = t("LIB_code_promo_toast_msg"); 21481 if (hasSubscriptions) { 21482 seeMsg = t("LIB_code_promo_toast_msg_subscription"); 21483 } 21484 const removeMsg = t("LIB_code_promo_remove"); 21485 const { promo_code_id, code } = this.promoCode; 21486 return b$1` 21487 <div class="relative"> 21488 <sonic-button 21489 @click=${this.showItems} 21490 name="promo_code_id" 21491 value="${promo_code_id}" 21492 size="xs" 21493 variant="outline" 21494 noAutofill 21495 align="left" 21496 > 21497 <div slot="prefix" class="border-r pr-2 mr-2 "> 21498 <sonic-icon library="custom" name="circle-arrow-right" size="xl"></sonic-icon> 21499 </div> 21500 <div class="my-1"> 21501 <b class="font-mono uppercase">${code}</b> 21502 <div class="hidden md:block">${seeMsg}</div> 21503 </div> 21504 </sonic-button> 21505 21506 <sonic-button 21507 class="absolute -right-2 -top-2" 21508 title=${removeMsg} 21509 data-aria-label=${removeMsg} 21510 @click=${this.removePromoCode} 21511 size="2xs" 21512 shape="circle" 21513 name="promo_code_id" 21514 type="danger" 21515 value=${promo_code_id} 21516 noAutofill 21517 icon 21518 > 21519 <sonic-icon library="custom" name="trash-can"></sonic-icon> 21520 </sonic-button> 21521 </div> 21522 `; 21523 } 21524 }; 21525 SonicPromoActiveCodeItem.styles = [tailwind]; 21526 __decorateClass$3B([ 21527 r$5() 21528 ], SonicPromoActiveCodeItem.prototype, "_modal", 2); 21529 __decorateClass$3B([ 21530 n$5({ type: Object }) 21531 ], SonicPromoActiveCodeItem.prototype, "promoCode", 2); 21532 __decorateClass$3B([ 21533 n$5({ type: Object }) 21534 ], SonicPromoActiveCodeItem.prototype, "apiConf", 2); 21535 SonicPromoActiveCodeItem = __decorateClass$3B([ 21536 t$3(tagName$2m) 21537 ], SonicPromoActiveCodeItem); 21538 var __defProp$3w = Object.defineProperty; 21539 var __getOwnPropDesc$3z = Object.getOwnPropertyDescriptor; 21540 var __decorateClass$3A = (decorators, target, key, kind) => { 21541 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3z(target, key) : target; 21542 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 21543 if (decorator = decorators[i2]) 21544 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 21545 if (kind && result) __defProp$3w(target, key, result); 21546 return result; 21547 }; 21548 const tagName$2l = "sonic-promo-active-code"; 21549 let SonicPromoActiveCode = class extends Fetcher(Subscriber$1(i$6)) { 21550 constructor() { 21551 super(...arguments); 21552 this.wording_LIB_codes_promo_actives = ""; 21553 this.data = []; 21554 this.previousToast = null; 21555 } 21556 connectedCallback() { 21557 if (document.documentElement.matches(".iframe-context")) { 21558 return; 21559 } 21560 this.setAttribute("dataProvider", "promo-active-code"); 21561 this.setAttribute("endPoint", "promotion-code?actives=true"); 21562 super.connectedCallback(); 21563 } 21564 willUpdate(changedProperties) { 21565 if (changedProperties.has("data")) { 21566 if (this.data.length) { 21567 this.addToast(); 21568 } 21569 } 21570 super.willUpdate(changedProperties); 21571 } 21572 updateToast() { 21573 PublisherManager.get("promo-active-code").invalidate(); 21574 } 21575 addToast() { 21576 const apiConf = this.getApiConfiguration(); 21577 if (this.data.length) { 21578 const newToast = { 21579 text: ( 21580 /*html*/ 21581 ` 21582 <sonic-t style="font-weight:bold;" key="LIB_codes_promo_actives"></sonic-t> 21583 <div style="display:flex; align-items:center; flex-wrap:wrap; gap:.25rem 1rem; margin-top:.3rem;" > 21584 ${this.data.map( 21585 (promoCode) => ( 21586 /*html*/ 21587 ` 21588 <sonic-promo-active-code-item 21589 apiConf='${JSON.stringify(apiConf).replace(/'/g, "'")}' 21590 promoCode='${JSON.stringify(promoCode).replace(/'/g, "'")}'></sonic-promo-active-code-item>` 21591 ) 21592 ).join("")} 21593 </div>` 21594 ), 21595 status: "success", 21596 preserve: true 21597 }; 21598 if (this.previousToast) { 21599 SonicToast.removeItem(this.previousToast); 21600 } 21601 this.previousToast = newToast; 21602 SonicToast.add(newToast); 21603 } 21604 } 21605 render() { 21606 return A$1; 21607 } 21608 }; 21609 SonicPromoActiveCode.styles = [tailwind]; 21610 __decorateClass$3A([ 21611 n$5({ type: String }) 21612 ], SonicPromoActiveCode.prototype, "wording_LIB_codes_promo_actives", 2); 21613 __decorateClass$3A([ 21614 r$5() 21615 ], SonicPromoActiveCode.prototype, "data", 2); 21616 SonicPromoActiveCode = __decorateClass$3A([ 21617 t$3(tagName$2l) 21618 ], SonicPromoActiveCode); 21619 const decodeParam = (s2) => { 21620 let r2 = s2; 21621 for (let i2 = 0; i2 < 8; i2++) {
21622 try { 21623 const t2 = decodeURIComponent(r2.replace(/\+/g, " ")); 21624 if (t2 === r2) break; 21625 r2 = t2; 21626 } catch { 21627 break; 21628 } 21629 } 21630 return r2; 21631 }; 21632 const isSonicFillKey = (key) => { 21633 const k2 = decodeParam(key); 21634 return k2 === "sonic_fill[]" || /^sonic_fill\[\d+\]$/.test(k2); 21635 }; 21636 const handleRedirect = () => { 21637 const urlParams = new URLSearchParams(window.location.search); 21638 const sonic_to_raw = urlParams.get("sonic_to"); 21639 const sonic_to = sonic_to_raw != null ? decodeParam(sonic_to_raw) : null; 21640 const otherParams = new URLSearchParams(); 21641 const sonicFill = []; 21642 for (const [key, value] of urlParams) { 21643 if (isSonicFillKey(key)) { 21644 sonicFill.push(decodeParam(value)); 21645 } else if (key !== "sonic_to") { 21646 otherParams.append(key, value); 21647 } 21648 } 21649 if (sonic_to) { 21650 const routeName = sonic_to.split("(")[0]; 21651 let routeParams = sonic_to.split("(")[1]?.split(")")[0] || routeName; 21652 routeParams = routeParams.replace(/%20/g, " ").replace(/ /g, ""); 21653 let app_route = appRoute(routeName).toString(); 21654 const pattern = new URLPattern(app_route); 21655 if (app_route) { 21656 let baseUrl; 21657 pattern?.names.forEach((name) => { 21658 const value = routeParams.match(new RegExp(`${name}:(.*?)(,|$)`)); 21659 if (value) { 21660 app_route = app_route.replace(`:${name}`, value[1]); 21661 } 21662 }); 21663 app_route = app_route.replace("(:id)", ""); 21664 for (const param of sonicFill) { 21665 const colon = param.indexOf(":"); 21666 if (colon === -1) continue; 21667 const k2 = param.slice(0, colon); 21668 const v2 = param.slice(colon + 1); 21669 if (k2) app_route = app_route.replace(`:${k2}`, v2); 21670 } 21671 if (!app_route.startsWith("#")) { 21672 baseUrl = new URL(location.protocol + "//" + location.host + app_route); 21673 baseUrl.search = otherParams.toString(); 21674 window.location.href = baseUrl.toString(); 21675 } else { 21676 window.location.hash = app_route; 21677 } 21678 } 21679 } 21680 }; 21681 const goTo = (route2) => { 21682 appRoute(route2).goTo(); 21683 }; 21684 let defaultApiConf = { 21685 serviceURL: "", 21686 token: null, 21687 userName: "", 21688 password: "", 21689 authToken: "", 21690 tokenProvider: "" 21691 }; 21692 const setDefaultApiConf = (conf) => { 21693 defaultApiConf = conf; 21694 }; 21695 const getDefaultApiConfiguration = () => { 21696 return defaultApiConf; 21697 }; 21698 const getDefaultApi = () => { 21699 return new API(defaultApiConf); 21700 }; 21701 const dpKeys$1 = { 21702 Settings: "settings", 21703 CgvLink: "cgv_link", 21704 CustomerUi: "customer_ui", 21705 Infos: "infos", 21706 IsOnline: "is_online", 21707 IsAuthorizedIp: "is_authorized_ip", 21708 Maintenance: "maintenance", 21709 Wording: "wording", 21710 Langs: "langs", 21711 Modules: "modules", 21712 OnlinePaymentId: "online_payment_id", 21713 PromotionCode: "promotion_code", 21714 QuickPurchase: "quick_purchase", 21715 LoginEnabled: "login_enabled", 21716 PreferWebsite: "prefer_website", 21717 StoreUi: "store_ui", 21718 SendOrderMail: "send_order_mail", 21719 WecountLink: "wecount_link", 21720 Theme: "theme", 21721 UserForm: "user_form", 21722 Brand: "brand", 21723 Trackings: "trackings", 21724 TestMode: "test_mode", 21725 RefundForm: "refund_form" 21726 }; 21727 dp(dpKeys$1.Settings); 21728 dp(`settings.${dpKeys$1.CgvLink}`); 21729 dp(`settings.${dpKeys$1.CustomerUi}`); 21730 dp(`settings.${dpKeys$1.Infos}`); 21731 dp(`settings.${dpKeys$1.IsOnline}`); 21732 dp(`settings.${dpKeys$1.IsAuthorizedIp}`); 21733 dp(`settings.${dpKeys$1.Maintenance}`); 21734 dp(`settings.${dpKeys$1.Wording}`); 21735 dp(`settings.${dpKeys$1.Langs}`); 21736 dp(`settings.${dpKeys$1.Modules}`); 21737 dp(`settings.${dpKeys$1.OnlinePaymentId}`); 21738 dp(`settings.${dpKeys$1.PromotionCode}`); 21739 dp(`settings.${dpKeys$1.QuickPurchase}`); 21740 dp(`settings.${dpKeys$1.LoginEnabled}`); 21741 dp(`settings.${dpKeys$1.PreferWebsite}`); 21742 dp(`settings.${dpKeys$1.StoreUi}`); 21743 dp(`settings.${dpKeys$1.SendOrderMail}`); 21744 dp(`settings.${dpKeys$1.WecountLink}`); 21745 dp(`settings.${dpKeys$1.Theme}`); 21746 dp(`settings.${dpKeys$1.UserForm}`); 21747 dp(`settings.${dpKeys$1.Brand}`); 21748 dp(`settings.${dpKeys$1.Trackings}`); 21749 dp(`settings.${dpKeys$1.TestMode}`); 21750 dp(`settings.${dpKeys$1.RefundForm}`);
21751 const customerUiEventExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event"); 21752 customerUiEventExport.layout = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.layout"); 21753 customerUiEventExport.onLayout = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.layout"); 21754 customerUiEventExport.filterByCategory = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.filter_by_category"); 21755 customerUiEventExport.onFilterByCategory = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.filter_by_category"); 21756 customerUiEventExport.filterByDay = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.filter_by_day"); 21757 customerUiEventExport.onFilterByDay = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.filter_by_day"); 21758 const customerUiHomeExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home"); 21759 customerUiHomeExport.jumbotron = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.jumbotron"); 21760 customerUiHomeExport.onJumbotron = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.jumbotron"); 21761 customerUiHomeExport.featured = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.featured"); 21762 customerUiHomeExport.onFeatured = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.featured"); 21763 customerUiHomeExport.quickAccess = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.quick_access"); 21764 customerUiHomeExport.onQuickAccess = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.quick_access"); 21765 customerUiHomeExport.events = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.events"); 21766 customerUiHomeExport.onEvents = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.events"); 21767 const customerUiExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi); 21768 customerUiExport.event = customerUiEventExport; 21769 customerUiExport.onEvent = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event"); 21770 customerUiExport.home = customerUiHomeExport; 21771 customerUiExport.onHome = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home"); 21772 const storeUiEventExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event"); 21773 storeUiEventExport.layout = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.layout"); 21774 storeUiEventExport.onLayout = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.layout"); 21775 storeUiEventExport.filterByCategory = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.filter_by_category"); 21776 storeUiEventExport.onFilterByCategory = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.filter_by_category"); 21777 storeUiEventExport.filterByDay = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.filter_by_day"); 21778 storeUiEventExport.onFilterByDay = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.filter_by_day"); 21779 const storeUiHomeExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home"); 21780 storeUiHomeExport.jumbotron = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.jumbotron"); 21781 storeUiHomeExport.onJumbotron = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.jumbotron"); 21782 storeUiHomeExport.featured = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.featured"); 21783 storeUiHomeExport.onFeatured = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.featured"); 21784 storeUiHomeExport.quickAccess = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.quick_access"); 21785 storeUiHomeExport.onQuickAccess = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.quick_access"); 21786 storeUiHomeExport.events = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.events"); 21787 storeUiHomeExport.onEvents = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.events");
21788 const storeUiExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi); 21789 storeUiExport.event = storeUiEventExport; 21790 storeUiExport.onEvent = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event"); 21791 storeUiExport.home = storeUiHomeExport; 21792 storeUiExport.onHome = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home"); 21793 const infosAddressExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address"); 21794 infosAddressExport.street = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.street"); 21795 infosAddressExport.onStreet = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.street"); 21796 infosAddressExport.street2 = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.street_2"); 21797 infosAddressExport.onStreet2 = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.street_2"); 21798 infosAddressExport.phoneNumber = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.phone_number"); 21799 infosAddressExport.onPhoneNumber = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.phone_number"); 21800 infosAddressExport.zipCode = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.zip_code"); 21801 infosAddressExport.onZipCode = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.zip_code"); 21802 infosAddressExport.city = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.city"); 21803 infosAddressExport.onCity = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.city"); 21804 infosAddressExport.country = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.country"); 21805 infosAddressExport.onCountry = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.country");
21806 const infosExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos); 21807 infosExport.siteName = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".site_name"); 21808 infosExport.onSiteName = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".site_name"); 21809 infosExport.editorName = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".editor_name"); 21810 infosExport.onEditorName = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".editor_name"); 21811 infosExport.siret = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".siret"); 21812 infosExport.onSiret = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".siret"); 21813 infosExport.TVA = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".TVA"); 21814 infosExport.onTVA = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".TVA"); 21815 infosExport.emailContact = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".email_contact"); 21816 infosExport.onEmailContact = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".email_contact"); 21817 infosExport.address = infosAddressExport; 21818 infosExport.onAddress = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address"); 21819 infosExport.cgvLink = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".cgv_link"); 21820 infosExport.onCgvLink = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".cgv_link"); 21821 infosExport.metaDescription = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".meta_description"); 21822 infosExport.onMetaDescription = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".meta_description"); 21823 infosExport.website = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".website"); 21824 infosExport.onWebsite = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".website"); 21825 infosExport.storeUrl = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".store_url"); 21826 infosExport.onStoreUrl = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".store_url"); 21827 infosExport.legalTerms = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".legal_terms"); 21828 infosExport.onLegalTerms = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".legal_terms"); 21829 infosExport.zoneType = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".zone_type"); 21830 infosExport.onZoneType = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".zone_type"); 21831 infosExport.structureType = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".structure_type"); 21832 infosExport.onStructureType = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".structure_type"); 21833 infosExport.activityType = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".activity_type"); 21834 infosExport.onActivityType = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".activity_type"); 21835 infosExport.capacity = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".capacity"); 21836 infosExport.onCapacity = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".capacity"); 21837 infosExport.capacityType = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".capacity_type"); 21838 infosExport.onCapacityType = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".capacity_type"); 21839 const createModuleExport = (modulePath) => { 21840 const moduleExport = bind$1(modulePath); 21841 moduleExport.enabled = () => bind$1(modulePath + ".enabled"); 21842 moduleExport.onEnabled = () => onAssign$1(modulePath + ".enabled"); 21843 moduleExport.access = () => bind$1(modulePath + ".access"); 21844 moduleExport.onAccess = () => onAssign$1(modulePath + ".access"); 21845 moduleExport.adminAccess = () => bind$1(modulePath + ".adminAccess"); 21846 moduleExport.onAdminAccess = () => onAssign$1(modulePath + ".adminAccess"); 21847 moduleExport.url = () => bind$1(modulePath + ".url"); 21848 moduleExport.onUrl = () => onAssign$1(modulePath + ".url"); 21849 moduleExport.token = () => bind$1(modulePath + ".token"); 21850 moduleExport.onToken = () => onAssign$1(modulePath + ".token"); 21851 return moduleExport; 21852 }; 21853 const modulesBasePath = dpKeys$1.Settings + "." + dpKeys$1.Modules;
21854 const modulesExport = bind$1(modulesBasePath); 21855 modulesExport.agenda = createModuleExport(modulesBasePath + ".agenda"); 21856 modulesExport.onAgenda = () => onAssign$1(modulesBasePath + ".agenda"); 21857 modulesExport.giftcards = createModuleExport(modulesBasePath + ".giftcards"); 21858 modulesExport.onGiftcards = () => onAssign$1(modulesBasePath + ".giftcards"); 21859 modulesExport.carpooling = createModuleExport(modulesBasePath + ".carpooling"); 21860 modulesExport.onCarpooling = () => onAssign$1(modulesBasePath + ".carpooling"); 21861 modulesExport.shop = createModuleExport(modulesBasePath + ".shop"); 21862 modulesExport.onShop = () => onAssign$1(modulesBasePath + ".shop"); 21863 modulesExport.relatedEvents = createModuleExport(modulesBasePath + ".related_events"); 21864 modulesExport.onRelatedEvents = () => onAssign$1(modulesBasePath + ".related_events"); 21865 modulesExport.subscription = createModuleExport(modulesBasePath + ".subscription"); 21866 modulesExport.onSubscription = () => onAssign$1(modulesBasePath + ".subscription"); 21867 modulesExport.reelax = createModuleExport(modulesBasePath + ".reelax"); 21868 modulesExport.onReelax = () => onAssign$1(modulesBasePath + ".reelax"); 21869 modulesExport.waitingLine = createModuleExport(modulesBasePath + ".waiting_line"); 21870 modulesExport.onWaitingLine = () => onAssign$1(modulesBasePath + ".waiting_line"); 21871 modulesExport.queue = createModuleExport(modulesBasePath + ".queue"); 21872 modulesExport.onQueue = () => onAssign$1(modulesBasePath + ".queue"); 21873 modulesExport.promotion = createModuleExport(modulesBasePath + ".promotion"); 21874 modulesExport.onPromotion = () => onAssign$1(modulesBasePath + ".promotion"); 21875 modulesExport.additionalProducts = createModuleExport(modulesBasePath + ".additional_products"); 21876 modulesExport.onAdditionalProducts = () => onAssign$1(modulesBasePath + ".additional_products"); 21877 modulesExport.askProAccount = createModuleExport(modulesBasePath + ".ask_pro_account"); 21878 modulesExport.onAskProAccount = () => onAssign$1(modulesBasePath + ".ask_pro_account"); 21879 modulesExport.refundRequest = createModuleExport(modulesBasePath + ".refund_request"); 21880 modulesExport.onRefundRequest = () => onAssign$1(modulesBasePath + ".refund_request"); 21881 modulesExport.freeupTickets = createModuleExport(modulesBasePath + ".freeup_tickets"); 21882 modulesExport.onFreeupTickets = () => onAssign$1(modulesBasePath + ".freeup_tickets"); 21883 modulesExport.accreditationsDirectory = createModuleExport(modulesBasePath + ".accreditations_directory"); 21884 modulesExport.onAccreditationsDirectory = () => onAssign$1(modulesBasePath + ".accreditations_directory"); 21885 modulesExport.waitingList = createModuleExport(modulesBasePath + ".waiting_list"); 21886 modulesExport.onWaitingList = () => onAssign$1(modulesBasePath + ".waiting_list"); 21887 modulesExport.logsRoute = createModuleExport(modulesBasePath + ".logs_route"); 21888 modulesExport.onLogsRoute = () => onAssign$1(modulesBasePath + ".logs_route"); 21889 modulesExport.sliderTv = createModuleExport(modulesBasePath + ".slider_tv"); 21890 modulesExport.onSliderTv = () => onAssign$1(modulesBasePath + ".slider_tv"); 21891 modulesExport.customAgendas = createModuleExport(modulesBasePath + ".custom_agendas"); 21892 modulesExport.onCustomAgendas = () => onAssign$1(modulesBasePath + ".custom_agendas"); 21893 const modules = modulesExport; 21894 const brandExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Brand); 21895 brandExport.id = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".id"); 21896 brandExport.onId = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".id"); 21897 brandExport.title = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".title"); 21898 brandExport.onTitle = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".title"); 21899 brandExport.url = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".url"); 21900 brandExport.onUrl = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".url"); 21901 const refundFormExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.RefundForm); 21902 refundFormExport.enableIbanBicTxt = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.RefundForm + ".enable_iban_bic_txt"); 21903 refundFormExport.onEnableIbanBicTxt = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.RefundForm + ".enable_iban_bic_txt"); 21904 refundFormExport.enableIbanBicPdf = () =>
21904 bind$1(dpKeys$1.Settings + "." + dpKeys$1.RefundForm + ".enable_iban_bic_pdf"); 21905 refundFormExport.onEnableIbanBicPdf = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.RefundForm + ".enable_iban_bic_pdf"); 21906 const themeColorsExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors"); 21907 themeColorsExport.primary = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.primary"); 21908 themeColorsExport.onPrimary = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.primary"); 21909 themeColorsExport.primaryContent = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.primary_content"); 21910 themeColorsExport.onPrimaryContent = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.primary_content"); 21911 themeColorsExport.info = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.info"); 21912 themeColorsExport.onInfo = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.info"); 21913 themeColorsExport.danger = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.danger"); 21914 themeColorsExport.onDanger = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.danger"); 21915 themeColorsExport.warning = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.warning"); 21916 themeColorsExport.onWarning = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.warning"); 21917 themeColorsExport.success = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.success"); 21918 themeColorsExport.onSuccess = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.success"); 21919 themeColorsExport.base = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base"); 21920 themeColorsExport.onBase = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base"); 21921 themeColorsExport.base900 = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base_900"); 21922 themeColorsExport.onBase900 = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base_900"); 21923 themeColorsExport.baseContent = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base_content"); 21924 themeColorsExport.onBaseContent = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base_content"); 21925 const themeFontsExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts"); 21926 themeFontsExport.titleFont = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts.title_font"); 21927 themeFontsExport.onTitleFont = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts.title_font"); 21928 themeFontsExport.textFont = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts.text_font"); 21929 themeFontsExport.onTextFont = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts.text_font");
21930 const themeExtrasExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".extras"); 21931 themeExtrasExport.enableBorderRadius = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".extras.enable_border_radius"); 21932 themeExtrasExport.onEnableBorderRadius = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".extras.enable_border_radius"); 21933 const themeExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme); 21934 themeExport.colors = themeColorsExport; 21935 themeExport.onColors = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors"); 21936 themeExport.logos = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".logos"); 21937 themeExport.onLogos = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".logos"); 21938 themeExport.banners = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".banners"); 21939 themeExport.onBanners = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".banners"); 21940 themeExport.fonts = themeFontsExport; 21941 themeExport.onFonts = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts"); 21942 themeExport.tickets = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".tickets"); 21943 themeExport.onTickets = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".tickets"); 21944 themeExport.extras = themeExtrasExport; 21945 themeExport.onExtras = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".extras"); 21946 var __decorate$u = function(decorators, target, key, desc) { 21947 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 21948 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 21949 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 21950 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 21951 }; 21952 const tagName$2k = "sonic-submit"; 21953 let Submit = class Submit extends Subscriber$1(i$6) { 21954 constructor() { 21955 super(...arguments); 21956 this.submitResultKey = null; 21957 this.disabled = false; 21958 this.endPoint = null; 21959 this.name = ""; 21960 this.value = ""; 21961 this.api = null; 21962 this.clickTimeStamp = 0; 21963 this.submit = async (e2) => { 21964 if (this.disabled) 21965 return; 21966 if (e2 instanceof KeyboardEvent && !(e2.key === "Enter")) 21967 return; 21968 if (e2 instanceof MouseEvent) { 21969 e2.stopPropagation(); 21970 } 21971 const formPublisher = PublisherManager.getInstance().get(this.getAncestorAttributeValue("formDataProvider")); 21972 formPublisher.isFormValid.set(true); 21973 formPublisher.invalidateForm(); 21974 if (!formPublisher.isFormValid.get()) 21975 return; 21976 this.disabled = true; 21977 Loader.show(); 21978 formPublisher.isFormValid; 21979 const native = this.hasAttribute("native"); 21980 if (native) { 21981 this.submitNativeForm(); 21982 Loader.hide(); 21983 this.disabled = false; 21984 return; 21985 } 21986 const method = this.getAttribute("method")?.toLocaleLowerCase() || "post"; 21987 const sendAsFormData = this.hasAttribute("sendAsFormData"); 21988 const formData = formPublisher.get(); 21989 delete formData.isFormValid; 21990 const headesDataProvider = this.getAncestorAttributeValue("headersDataProvider"); 21991 const headerPublisher = headesDataProvider ? PublisherManager.getInstance().get(headesDataProvider) : null; 21992 let headerData = {}; 21993 if (headerPublisher) 21994 headerData = headerPublisher.get(); 21995 let result = null; 21996 const dataProvider = this.getAncestorAttributeValue("dataProvider"); 21997 const endPoint = this.endPoint || dataProvider; 21998 const sendData = async () => { 21999 const dataToSend = { ...formData }; 22000 delete dataToSend.needsCaptchaValidation; 22001 delete headerData.needsCaptchaValidation; 22002 if (sendAsFormData) { 22003 result = await this.api?.submitFormData(endPoint, dataToSend, method, headerData); 22004 } else { 22005 switch (method) { 22006 case "put": 22007 result = await this.api?.put(endPoint, dataToSend, headerData); 22008 break; 22009 case "patch": 22010 result = await this.api?.patch(endPoint, dataToSend, headerData); 22011 break; 22012 case "delete": 22013 result = await this.api?.delete(endPoint, dataToSend, headerData); 22014 break; 22015 case "get": 22016 const params = new URLSearchParams(); 22017 if (dataToSend) { 22018 for (const key in dataToSend) { 22019 params.append(key, dataToSend[key]); 22020 } 22021 } 22022 const paramString = "?" + params.toString(); 22023 result = await this.api?.get(endPoint + paramString, headerData); 22024 break; 22025 default: 22026 result = await this.api?.post(endPoint, dataToSend, headerData); 22027 break; 22028 } 22029 } 22030 Loader.hide(); 22031 if (!result) 22032 result = { 22033 messages: [{ content: "Network Error", status: "error" }] 22034 }; 22035 else if (result._sonic_http_response_ && !result._sonic_http_response_.ok && Object.keys(result).length === 1) 22036 result.messages = [{ content: "Network Error", status: "error" }]; 22037 const clearedDataProvider = this.getAncestorAttributeValue("clearedDataOnSuccess"); 22038 if (clearedDataProvider) { 22039 clearedDataProvider.split(" ").forEach((dataProvider2) => PublisherManager.get(dataProvider2).set({})); 22040 } 22041 const username_key = this.hasAttribute("usernameKey") ? this.getAttribute("usernameKey") : "username"; 22042 const password_key = this.hasAttribute("passwordKey") ? this.getAttribute("passwordKey") : "password"; 22043 if (this.api?.lastResult?.ok && dataToSend[username_key] && dataToSend[password_key]) { 22044 this.saveCredentials(dataToSend[username_key], dataToSend[password_key]); 22045 } 22046 if (this.submitResultKey) { 22047 result = Objects$1.traverse(result, this.submitResultKey.split("."), true); 22048 } 22049 const submitResultDataProvider = this.getAncestorAttributeValue("submitResultDataProvider"); 22050 if (submitResultDataProvider) 22051 PublisherManager.get(submitResultDataProvider).set(result); 22052 this.disabled = false;
22053 this.dispatchEvent(new CustomEvent("submit", { 22054 detail: result, 22055 bubbles: true, 22056 composed: true 22057 })); 22058 }; 22059 const captchaPublisher = ( 22060 // TODO Comprendre pourquoi header publisher 22061 headerPublisher?.needsCaptchaValidation.get() ? headerPublisher : formPublisher.needsCaptchaValidation.get() ? formPublisher : null 22062 ); 22063 if (captchaPublisher) { 22064 captchaPublisher.captchaToken.set("request_token"); 22065 const captchaAssign = (token) => { 22066 if (token != "request_token") { 22067 sendData(); 22068 captchaPublisher.captchaToken.offAssign(captchaAssign); 22069 } else { 22070 Loader.hide(); 22071 this.disabled = false; 22072 } 22073 }; 22074 captchaPublisher.captchaToken.onAssign(captchaAssign); 22075 } else { 22076 sendData(); 22077 } 22078 }; 22079 } 22080 connectedCallback() { 22081 if (this.hasAttribute("onClick")) { 22082 this.addEventListener("click", this.submit); 22083 } 22084 if (this.hasAttribute("onEnterKey")) { 22085 this.addEventListener("keydown", this.submit); 22086 } 22087 super.connectedCallback(); 22088 this.api = new API(this.getApiConfiguration()); 22089 } 22090 submitNativeForm() { 22091 const form2 = HTML.getClosestForm(this); 22092 if (!form2) 22093 return; 22094 const formDataProvider = this.getAncestorAttributeValue("formDataProvider"); 22095 const dataToSend = { ...PublisherManager.get(formDataProvider).get() }; 22096 delete dataToSend.needsCaptchaValidation; 22097 for (const name in dataToSend) { 22098 if (name == "isFormValid") 22099 continue; 22100 let control = form2.querySelector('input[name="' + name + '"], select[name="' + name + '"], textarea[name="' + name + '"]'); 22101 if (!control) { 22102 control = document.createElement("input"); 22103 control.type = "hidden"; 22104 control.name = name; 22105 form2.appendChild(control); 22106 } 22107 let value = dataToSend[name]; 22108 if (Array.isArray(value)) 22109 value = value.join(","); 22110 if (control.type === "checkbox" || control.type === "radio") { 22111 if (value) 22112 control.checked = true; 22113 } else { 22114 control.value = value; 22115 } 22116 } 22117 const submitButton = document.createElement("input"); 22118 submitButton.name = this.name; 22119 submitButton.style.display = "none"; 22120 submitButton.value = this.value; 22121 submitButton.type = "submit"; 22122 form2.appendChild(submitButton); 22123 if (submitButton) 22124 submitButton.click(); 22125 } 22126 async saveCredentials(username, password2) { 22127 if ("PasswordCredential" in window) { 22128 const credential = new window.PasswordCredential({ 22129 id: username, 22130 // name: "Carina Anand", // In case of a login, the name comes from the server. 22131 password: password2 22132 }); 22133 await navigator.credentials.store(credential); 22134 } 22135 } 22136 render() { 22137 return b$1`<div ?data-disabled=${this.disabled}><slot></slot></div>`; 22138 } 22139 }; 22140 Submit.styles = i$9` 22141 [data-disabled] { 22142 opacity: 0.3; 22143 pointer-events: none; 22144 user-select: none; 22145 } 22146 `; 22147 __decorate$u([ 22148 n$5({ type: String }) 22149 ], Submit.prototype, "submitResultKey", void 0); 22150 __decorate$u([ 22151 n$5({ type: Boolean }) 22152 ], Submit.prototype, "disabled", void 0); 22153 __decorate$u([ 22154 n$5({ type: String }) 22155 ], Submit.prototype, "endPoint", void 0); 22156 __decorate$u([ 22157 n$5() 22158 ], Submit.prototype, "name", void 0); 22159 __decorate$u([ 22160 n$5() 22161 ], Submit.prototype, "value", void 0); 22162 Submit = __decorate$u([ 22163 t$3(tagName$2k) 22164 ], Submit); 22165 var __decorate$t = function(decorators, target, key, desc) { 22166 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 22167 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 22168 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 22169 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 22170 }; 22171 const tagName$2j = "sonic-progress"; 22172 let Progress = class Progress extends i$6 { 22173 constructor() { 22174 super(...arguments); 22175 this.max = 100; 22176 this.invert = false;
22177 this.type = "default"; 22178 } 22179 render() { 22180 return b$1` 22181 <progress value=${o$4(this.value)} max=${this.max}></progress> 22182 <div class="slot-container"> 22183 <slot></slot> 22184 <slot name="remaining"></slot> 22185 </div> 22186 `; 22187 } 22188 }; 22189 Progress.styles = [ 22190 fontSize, 22191 i$9` 22192 :host { 22193 --sc-progress-bg: var( 22194 --sc-input-bg, 22195 var(--sc-base-100, rgba(0, 0, 0, 0.07)) 22196 ); 22197 --sc-progress-color: var(--sc-base-content, #000); 22198 --sc-progress-height: 0.6em; 22199 --sc-progress-fs: var(--sc-_fs, 1rem); 22200 --sc-progress-fw: 500; 22201 --sc-progress-rounded: var(--sc-rounded-lg); 22202 display: block; 22203 line-height: 1.2; 22204 font-weight: var(--sc-progress-fw); 22205 font-size: var(--sc-progress-fs); 22206 } 22207 22208 progress { 22209 display: block; 22210 position: relative; 22211 width: 100%; 22212 -webkit-appearance: none; 22213 appearance: none; 22214 overflow: hidden; 22215 border: none; 22216 height: var(--sc-progress-height); 22217 border-radius: var(--sc-progress-rounded); 22218 background-color: var(--sc-progress-bg); 22219 color: var(--sc-progress-color); 22220 } 22221 progress::-moz-progress-bar { 22222 background-color: var(--sc-progress-color); 22223 border-radius: var(--sc-progress-rounded); 22224 } 22225 22226 progress:not([value])::-moz-progress-bar { 22227 background-color: var(--sc-progress-bg); 22228 } 22229 22230 progress::-webkit-progress-bar { 22231 background-color: var(--sc-progress-bg); 22232 } 22233 progress::-webkit-progress-value { 22234 background-color: var(--sc-progress-color); 22235 border-radius: var(--sc-progress-rounded); 22236 } 22237 22238 /* Indeterminate */ 22239 progress:indeterminate:after { 22240 background-color: var(--sc-progress-color); 22241 content: ""; 22242 position: absolute; 22243 top: 0; 22244 bottom: 0; 22245 left: -40%; 22246 width: 33.333333%; 22247 border-radius: var(--sc-progress-rounded); 22248 animation: progress-loading 3s infinite ease-in-out; 22249 } 22250 22251 @keyframes progress-loading { 22252 50% { 22253 left: 107%; 22254 } 22255 } 22256 22257 /* COLOR TYPES */ 22258 :host([type="warning"]) { 22259 --sc-progress-color: var(--sc-warning, var(--sc-base-content, #000)); 22260 } 22261 :host([type="danger"]) { 22262 --sc-progress-color: var(--sc-danger, var(--sc-base-content, #000)); 22263 } 22264 :host([type="info"]) { 22265 --sc-progress-color: var(--sc-info, var(--sc-base-content, #000)); 22266 } 22267 :host([type="success"]) { 22268 --sc-progress-color: var(--sc-success, var(--sc-base-content, #000)); 22269 } 22270 22271 :host([type="invert"]) { 22272 --sc-progress-bg: rgba(190, 190, 190, 0.125); 22273 --sc-progress-color: var(--sc-base, #fff); 22274 } 22275 22276 :host([invert]) { 22277 --sc-progress-bg: rgba(190, 190, 190, 0.125); 22278 } 22279 22280 :host([type="default"][invert]) { 22281 --sc-progress-color: var(--sc-base, #fff); 22282 } 22283 22284 slot[name="remaining"] { 22285 font-weight: var(--sc-font-weight-base, 400); 22286 font-size: 0.85em; 22287 margin-top: 0.5em; 22288 } 22289 slot[name="remaining"]::slotted(*) { 22290 margin-left: auto; 22291 } 22292 22293 slot:not([name]) { 22294 color: var(--sc-progress-color); 22295 } 22296 22297 .slot-container { 22298 display: flex; 22299 justify-content: space-between; 22300 gap: 0.5em; 22301 margin-top: 0.15em; 22302 } 22303 ` 22304 ]; 22305 __decorate$t([ 22306 n$5({ type: Number }) 22307 ], Progress.prototype, "value", void 0); 22308 __decorate$t([ 22309 n$5({ type: Number }) 22310 ], Progress.prototype, "max", void 0); 22311 __decorate$t([ 22312 n$5({ type: Boolean }) 22313 ], Progress.prototype, "invert", void 0); 22314 __decorate$t([ 22315 n$5({ type: String, reflect: true }) 22316 ], Progress.prototype, "type", void 0); 22317 __decorate$t([ 22318 n$5({ type: String, reflect: true }) 22319 ], Progress.prototype, "size", void 0); 22320 Progress = __decorate$t([ 22321 t$3(tagName$2j) 22322 ], Progress); 22323 var endpoints$1 = /* @__PURE__ */ ((endpoints2) => { 22324 endpoints2["SessionQueueAuthorised"] = "queue/authorized"; 22325 endpoints2["SessionQueueConfig"] = "queue/front/config"; 22326 endpoints2["SessionQueue"] = "queue/session"; 22327 return endpoints2; 22328 })(endpoints$1 || {}); 22329 var dpKeys = /* @__PURE__ */ ((dpKeys2) => { 22330 dpKeys2["SessionQueue"] = "sessionQueue"; 22331 dpKeys2["SessionQueueAuthorised"] = "sessionQueueAuthorised"; 22332 dpKeys2["SessionQueueConfig"] = "sessionQueueConfig"; 22333 dpKeys2["IdleStatus"] = "idleStatus"; 22334 return dpKeys2; 22335 })(dpKeys || {}); 22336 const sessionQueueAuthorised$1 = dp$1( 22337 "sessionQueueAuthorised" 22338 /* SessionQueueAuthorised */ 22339 ); 22340 const sessionQueueConfig$1 = dp$1( 22341 "sessionQueueConfig" 22342 /* SessionQueueConfig */ 22343 ); 22344 const idleStatus$2 = dp$1( 22345 "idleStatus" 22346 /* IdleStatus */ 22347 );
22348 const sessionQueueAuthorisedExport = bind$1(dpKeys.SessionQueueAuthorised); 22349 sessionQueueAuthorisedExport.authorized = () => bind$1(dpKeys.SessionQueueAuthorised + ".authorized"); 22350 sessionQueueAuthorisedExport.onAuthorized = () => onAssign$1(dpKeys.SessionQueueAuthorised + ".authorized"); 22351 sessionQueueAuthorisedExport.redirection = () => bind$1(dpKeys.SessionQueueAuthorised + ".redirection"); 22352 sessionQueueAuthorisedExport.onRedirection = () => onAssign$1(dpKeys.SessionQueueAuthorised + ".redirection"); 22353 sessionQueueAuthorisedExport.token = () => bind$1(dpKeys.SessionQueueAuthorised + ".token"); 22354 sessionQueueAuthorisedExport.onToken = () => onAssign$1(dpKeys.SessionQueueAuthorised + ".token"); 22355 const sessionQueueAuthorised = sessionQueueAuthorisedExport; 22356 const onSessionQueueAuthorised = () => onAssign$1(dpKeys.SessionQueueAuthorised); 22357 const stillHereExport = bind$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere"); 22358 stillHereExport.show = () => bind$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere.show"); 22359 stillHereExport.onShow = () => onAssign$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere.show"); 22360 stillHereExport.countdownMs = () => bind$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere.countdownMs"); 22361 stillHereExport.onCountdownMs = () => onAssign$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere.countdownMs"); 22362 const onInactivityExport = bind$1(dpKeys.SessionQueueConfig + ".onInactivity"); 22363 onInactivityExport.stillHere = stillHereExport; 22364 onInactivityExport.onStillHere = () => onAssign$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere"); 22365 onInactivityExport.thresholdMs = () => bind$1(dpKeys.SessionQueueConfig + ".onInactivity.thresholdMs"); 22366 onInactivityExport.onThresholdMs = () => onAssign$1(dpKeys.SessionQueueConfig + ".onInactivity.thresholdMs"); 22367 const sessionQueueConfigExport = bind$1(dpKeys.SessionQueueConfig); 22368 sessionQueueConfigExport.onInactivity = onInactivityExport; 22369 sessionQueueConfigExport.ononInactivity = () => onAssign$1(dpKeys.SessionQueueConfig + ".onInactivity"); 22370 const sessionQueueConfig = sessionQueueConfigExport; 22371 const onSessionQueueConfig = () => onAssign$1(dpKeys.SessionQueueConfig); 22372 const idleStatusExport$1 = bind$1(dpKeys.IdleStatus); 22373 idleStatusExport$1.isIdle = () => bind$1(dpKeys.IdleStatus + ".isIdle"); 22374 idleStatusExport$1.onIsIdle = () => onAssign$1(dpKeys.IdleStatus + ".isIdle"); 22375 idleStatusExport$1.ratioBeforeSessionDelete = () => bind$1(dpKeys.IdleStatus + ".ratioBeforeSessionDelete"); 22376 idleStatusExport$1.onRatioBeforeSessionDelete = () => onAssign$1(dpKeys.IdleStatus + ".ratioBeforeSessionDelete"); 22377 idleStatusExport$1.sessionDeleteProgressType = () => bind$1(dpKeys.IdleStatus + ".sessionDeleteProgressType"); 22378 idleStatusExport$1.onSessionDeleteProgressType = () => onAssign$1(dpKeys.IdleStatus + ".sessionDeleteProgressType"); 22379 idleStatusExport$1.timeSinceLastInteractionMs = () => bind$1(dpKeys.IdleStatus + ".timeSinceLastInteractionMs"); 22380 idleStatusExport$1.onTimeSinceLastInteractionMs = () => onAssign$1(dpKeys.IdleStatus + ".timeSinceLastInteractionMs"); 22381 const idleStatus$1 = idleStatusExport$1; 22382 const idleStatusExport = { 22383 isIdle: () => subscribe(`${dpKeys.IdleStatus}.isIdle`), 22384 ratioBeforeSessionDelete: () => subscribe(`${dpKeys.IdleStatus}.ratioBeforeSessionDelete`), 22385 sessionDeleteProgressType: () => subscribe(`${dpKeys.IdleStatus}.sessionDeleteProgressType`) 22386 }; 22387 const idleStatus = idleStatusExport; 22388 const queueSession = { 22389 dpKeys, 22390 authorised: { 22391 dp: sessionQueueAuthorised$1, 22392 bind: sessionQueueAuthorised, 22393 onAssign: onSessionQueueAuthorised 22394 }, 22395 config: { 22396 dp: sessionQueueConfig$1, 22397 bind: sessionQueueConfig, 22398 onAssign: onSessionQueueConfig 22399 }, 22400 idle: { 22401 dp: idleStatus$2, 22402 bind: idleStatus$1, 22403 subscribe: idleStatus 22404 } 22405 }; 22406 const queueTokenHeaderName = "Sonic-Queue-Token"; 22407 const getEmbeddedToken = () => { 22408 const params = new URLSearchParams(document.location.search); 22409 const urlToken = params.get(queueTokenHeaderName); 22410 if (urlToken) { 22411 return urlToken; 22412 } 22413 const headers = document.head.querySelectorAll(`meta[name='${queueTokenHeaderName}']`); 22414 if (headers.length > 0) { 22415 return headers[0].getAttribute("content"); 22416 } 22417 return null; 22418 }; 22419 const reloadWithoutTokenInURL = () => { 22420 const params = new URLSearchParams(document.location.search); 22421 params.delete(queueTokenHeaderName); 22422 window.location.href = window.location.pathname + "?" + params.toString(); 22423 }; 22424 const expiredParamName = "queue-session-expired"; 22425 function clearExpiredQueueSessionFromLocation() { 22426 const params = new URLSearchParams(document.location.search); 22427 if (!params.has(expiredParamName)) { 22428 return; 22429 } 22430 localStorage.removeItem(queueTokenHeaderName); 22431 params.delete(expiredParamName); 22432 const url = new URL(window.location.href); 22433 url.search = params.toString(); 22434 history.replaceState(null, "", url.toString()); 22435 } 22436 const isCheckoutEnd = () => { 22437 const matches = appRoute("checkout.end").withoutQuery().matchesCurrentPath();
22438 const urlParams = new URLSearchParams(window.location.search); 22439 const hasSonicPurchaseId = (urlParams.get("sonic_purchase_id") || "") !== ""; 22440 const hasSonicTo = (urlParams.get("sonic_to") || "").trim() === "checkout.end"; 22441 return matches && hasSonicPurchaseId || hasSonicTo; 22442 }; 22443 const DEFAULT_DELETE_SESSION_DELAY_MS = 3e4; 22444 const COUNTDOWN_TICK_MS = 100; 22445 function progressTypeFromRatio(ratio) { 22446 if (ratio > 66) { 22447 return ""; 22448 } 22449 if (ratio > 33) { 22450 return "warning"; 22451 } 22452 return "danger"; 22453 } 22454 function createInactivitySessionCountdown(options) { 22455 let intervalId; 22456 let startTime; 22457 function stop() { 22458 if (intervalId !== void 0) { 22459 clearInterval(intervalId); 22460 intervalId = void 0; 22461 } 22462 startTime = void 0; 22463 } 22464 function start() { 22465 stop(); 22466 queueSession.idle.dp.ratioBeforeSessionDelete.set(100); 22467 queueSession.idle.dp.sessionDeleteProgressType.set("success"); 22468 startTime = Date.now(); 22469 intervalId = window.setInterval(() => { 22470 if (startTime === void 0) { 22471 return; 22472 } 22473 const elapsed = Date.now() - startTime; 22474 let delayMs = options.getDelayMs(); 22475 if (typeof delayMs !== "number") { 22476 delayMs = DEFAULT_DELETE_SESSION_DELAY_MS; 22477 } 22478 const ratio = Math.max(0, 100 - elapsed / delayMs * 100); 22479 queueSession.idle.dp.ratioBeforeSessionDelete.set(ratio); 22480 if (ratio <= 0) { 22481 stop(); 22482 options.onElapsed(); 22483 } 22484 }, COUNTDOWN_TICK_MS); 22485 } 22486 return { start, stop }; 22487 } 22488 async function deleteInactiveQueueSession(host) { 22489 try { 22490 const apiConfiguration = HTML$1.getApiConfiguration(host); 22491 const headersDataProvider = HTML$1.getAncestorAttributeValue(host, "headersDataProvider"); 22492 const headers = { ...dp(headersDataProvider).get() }; 22493 const api2 = new API(apiConfiguration); 22494 await api2.delete(endpoints$1.SessionQueue, {}, headers); 22495 } catch (error) { 22496 console.debug("Error deleting session:", error); 22497 } 22498 queueSession.authorised.dp.token.set(""); 22499 } 22500 var __defProp$3v = Object.defineProperty; 22501 var __getOwnPropDesc$3y = Object.getOwnPropertyDescriptor; 22502 var __decorateClass$3z = (decorators, target, key, kind) => { 22503 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3y(target, key) : target; 22504 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 22505 if (decorator = decorators[i2]) 22506 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 22507 if (kind && result) __defProp$3v(target, key, result); 22508 return result; 22509 }; 22510 const tagName$2i = "sonic-inactivity-detected"; 22511 const ratioBeforeSessionDelete = queueSession.idle.subscribe.ratioBeforeSessionDelete(); 22512 const sessionDeleteProgressType = queueSession.idle.subscribe.sessionDeleteProgressType(); 22513 let SonicInactivityDetected = class extends i$6 { 22514 constructor() { 22515 super(...arguments); 22516 this.deleteSessionDelayMs = DEFAULT_DELETE_SESSION_DELAY_MS; 22517 this.showReloadButton = false; 22518 this.isModalVisible = false; 22519 this.isIdle = false; 22520 this.headersDataProvider = null; 22521 this.countdown = createInactivitySessionCountdown({ 22522 getDelayMs: () => this.deleteSessionDelayMs, 22523 onElapsed: () => { 22524 void this.onCountdownElapsed(); 22525 } 22526 }); 22527 this.reload = () => { 22528 const embeddedToken = getEmbeddedToken(); 22529 if (embeddedToken !== null) { 22530 reloadWithoutTokenInURL(); 22531 } else { 22532 queueSession.authorised.dp.invalidate(); 22533 this.resetCountDown(); 22534 } 22535 this.hideModal(); 22536 }; 22537 } 22538 onIsIdleChange(isIdle) { 22539 if (isIdle) { 22540 queueSession.config.dp.invalidate(); 22541 } else { 22542 queueSession.config.dp.onInactivity.stillHere.show.set(false); 22543 } 22544 } 22545 onSessionQueueConfigChange(config) { 22546 if (config.onInactivity.stillHere.show == false) { 22547 this.resetCountDown(); 22548 } 22549 } 22550 onRatioChange(ratio) { 22551 queueSession.idle.dp.sessionDeleteProgressType.set(progressTypeFromRatio(ratio)); 22552 } 22553 onStillHereShowChange(show, isIdle) { 22554 if (show === true && isIdle === true) { 22555 this.showModal(); 22556 } else { 22557 this.hideModal(); 22558 } 22559 } 22560 connectedCallback() { 22561 this.headersDataProvider = HTML$1.getAncestorAttributeValue(this, "headersDataProvider"); 22562 super.connectedCallback(); 22563 } 22564 disconnectedCallback() { 22565 super.disconnectedCallback(); 22566 this.countdown.stop(); 22567 this.hideModal(); 22568 } 22569 showModal() { 22570 if (this.isModalVisible) { 22571 return; 22572 } 22573 this.isModalVisible = true; 22574 this.showReloadButton = false;
22575 this.countdown.start(); 22576 } 22577 hideModal() { 22578 this.isModalVisible = false; 22579 } 22580 resetCountDown() { 22581 this.countdown.stop(); 22582 queueSession.idle.dp.isIdle.set(false); 22583 queueSession.config.dp.onInactivity.stillHere.show.set(false); 22584 this.hideModal(); 22585 } 22586 async onCountdownElapsed() { 22587 await deleteInactiveQueueSession(this); 22588 this.showReloadButton = true; 22589 } 22590 getModalContent() { 22591 if (this.showReloadButton) { 22592 return A$1; 22593 } 22594 return b$1`<sonic-progress 22595 type="${sessionDeleteProgressType}" 22596 value="${ratioBeforeSessionDelete}" 22597 max="100" 22598 ></sonic-progress>`; 22599 } 22600 getModalActions() { 22601 if (this.showReloadButton) { 22602 return b$1`<sonic-button type="success" @click=${this.reload}> 22603 <sonic-icon library="custom" slot="prefix" name="arrows-rotate"></sonic-icon> 22604 ${t("waiting_line_expired_btn")} 22605 </sonic-button>`; 22606 } 22607 return b$1`<sonic-submit 22608 endpoint=${endpoints$1.SessionQueue} 22609 method="patch" 22610 onClick 22611 @click=${() => this.resetCountDown()} 22612 > 22613 <sonic-button type="success"> 22614 <sonic-icon library="custom" slot="prefix" name="thumbs-up"></sonic-icon> 22615 ${t("inactivity_modal_confirm")} 22616 </sonic-button> 22617 </sonic-submit>`; 22618 } 22619 render() { 22620 if (this.isIdle) { 22621 return b$1` 22622 <sonic-fetch 22623 endpoint=${endpoints$1.SessionQueueConfig} 22624 dataProvider=${queueSession.dpKeys.SessionQueueConfig} 22625 key="data" 22626 ></sonic-fetch> 22627 <sonic-modal 22628 zIndex="1000" 22629 headersDataProvider=${this.headersDataProvider} 22630 ?visible=${this.isModalVisible} 22631 maxWidth="32rem" 22632 forceAction 22633 > 22634 <sonic-modal-title 22635 ><sonic-icon 22636 library="custom" 22637 name=${this.showReloadButton ? "face-grimace" : "clock-rotate-left"} 22638 ></sonic-icon> 22639 ${t(this.showReloadButton ? "waiting_line_expired_title" : "inactivity_modal_title")} 22640 </sonic-modal-title> 22641 <sonic-modal-content>${this.getModalContent()}</sonic-modal-content> 22642 <sonic-modal-actions> ${this.getModalActions()} </sonic-modal-actions> 22643 </sonic-modal> 22644 `; 22645 } 22646 return A$1; 22647 } 22648 }; 22649 SonicInactivityDetected.styles = [tailwind]; 22650 __decorateClass$3z([ 22651 queueSession.config.bind.onInactivity.stillHere.countdownMs() 22652 ], SonicInactivityDetected.prototype, "deleteSessionDelayMs", 2); 22653 __decorateClass$3z([ 22654 r$5() 22655 ], SonicInactivityDetected.prototype, "showReloadButton", 2); 22656 __decorateClass$3z([ 22657 r$5() 22658 ], SonicInactivityDetected.prototype, "isModalVisible", 2); 22659 __decorateClass$3z([ 22660 queueSession.idle.bind.isIdle(), 22661 r$5() 22662 ], SonicInactivityDetected.prototype, "isIdle", 2); 22663 __decorateClass$3z([ 22664 queueSession.idle.bind.onIsIdle() 22665 ], SonicInactivityDetected.prototype, "onIsIdleChange", 1); 22666 __decorateClass$3z([ 22667 queueSession.config.onAssign() 22668 ], SonicInactivityDetected.prototype, "onSessionQueueConfigChange", 1); 22669 __decorateClass$3z([ 22670 queueSession.idle.bind.onRatioBeforeSessionDelete() 22671 ], SonicInactivityDetected.prototype, "onRatioChange", 1); 22672 __decorateClass$3z([ 22673 onAssign$1("sessionQueueConfig.onInactivity.stillHere.show", "idleStatus.isIdle") 22674 ], SonicInactivityDetected.prototype, "onStillHereShowChange", 1); 22675 SonicInactivityDetected = __decorateClass$3z([ 22676 t$3(tagName$2i) 22677 ], SonicInactivityDetected); 22678 var __defProp$3u = Object.defineProperty; 22679 var __getOwnPropDesc$3x = Object.getOwnPropertyDescriptor; 22680 var __decorateClass$3y = (decorators, target, key, kind) => { 22681 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3x(target, key) : target; 22682 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 22683 if (decorator = decorators[i2]) 22684 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 22685 if (kind && result) __defProp$3u(target, key, result); 22686 return result; 22687 }; 22688 const tagName$2h = "sonic-user-activity"; 22689 const DEFAULT_INACTIVITY_THRESHOLD_MS = 3e4; 22690 queueSession.idle.dp.isIdle.set(false); 22691 queueSession.idle.dp.ratioBeforeSessionDelete.set(100); 22692 queueSession.idle.dp.timeSinceLastInteractionMs.set(0); 22693 queueSession.config.dp.onInactivity.thresholdMs.set(DEFAULT_INACTIVITY_THRESHOLD_MS); 22694 let SonicUserActivity = class extends i$6 { 22695 constructor() { 22696 super(...arguments); 22697 this.inactivityThresholdMs = DEFAULT_INACTIVITY_THRESHOLD_MS; 22698 this.checkIntervalMs = 1e3; 22699 this.lastInteractionTime = Date.now(); 22700 this.location = ""; 22701 this.pendingCartMutation = false;
22702 this.handleCartMutation = () => { 22703 if (this.pendingCartMutation) return; 22704 this.pendingCartMutation = true; 22705 this.rafId = requestAnimationFrame(() => { 22706 this.pendingCartMutation = false; 22707 this.rafId = void 0; 22708 this.initializeDataProvider(); 22709 }); 22710 }; 22711 } 22712 onIsIdleChange(isIdle) { 22713 if (!isIdle) { 22714 this.lastInteractionTime = Date.now(); 22715 queueSession.idle.dp.timeSinceLastInteractionMs.set(0); 22716 } 22717 } 22718 onTimeSinceLastInteractionMsChange(_timeSinceLastInteraction) { 22719 this.updateRatioBeforeIdle(); 22720 } 22721 updateRatioBeforeIdle() { 22722 let inactivityThresholdMs = queueSession.config.dp.onInactivity.thresholdMs.get(); 22723 if (typeof inactivityThresholdMs !== "number") { 22724 inactivityThresholdMs = DEFAULT_INACTIVITY_THRESHOLD_MS; 22725 } 22726 const timeSinceLastInteractionMs = queueSession.idle.dp.timeSinceLastInteractionMs.get(); 22727 queueSession.idle.dp.ratioBeforeIdle.set( 22728 inactivityThresholdMs > 0 ? timeSinceLastInteractionMs / inactivityThresholdMs : 0 22729 ); 22730 } 22731 connectedCallback() { 22732 super.connectedCallback(); 22733 this.initializeDataProvider(); 22734 this.startTracking(); 22735 this.startChecking(); 22736 } 22737 disconnectedCallback() { 22738 super.disconnectedCallback(); 22739 this.stopTracking(); 22740 this.stopChecking(); 22741 } 22742 /** 22743 * Initialise le data provider avec les valeurs par défaut 22744 */ 22745 initializeDataProvider() { 22746 this.lastInteractionTime = Date.now(); 22747 queueSession.idle.dp.isIdle.set(false); 22748 queueSession.idle.dp.timeSinceLastInteractionMs.set(0); 22749 queueSession.idle.dp.ratioBeforeIdle.set(0); 22750 } 22751 /** 22752 * Démarre le suivi des interactions utilisateur 22753 */ 22754 startTracking() { 22755 LocationHandler$1.onChange(this); 22756 const cartProvider = HTML$1.getAncestorAttributeValue(this, "cartProvider"); 22757 if (cartProvider) { 22758 this.cartProvider = cartProvider || void 0; 22759 dp(cartProvider).onInternalMutation(this.handleCartMutation); 22760 } 22761 } 22762 /** 22763 * Arrête le suivi des interactions utilisateur 22764 */ 22765 stopTracking() { 22766 LocationHandler$1.offChange(this); 22767 if (this.cartProvider) { 22768 dp(this.cartProvider).offInternalMutation(this.handleCartMutation); 22769 } 22770 if (this.rafId !== void 0) { 22771 cancelAnimationFrame(this.rafId); 22772 this.rafId = void 0; 22773 } 22774 } 22775 /** 22776 * Démarre la vérification périodique de l'inactivité 22777 */ 22778 startChecking() { 22779 this.checkIntervalId = window.setInterval(() => this.checkInactivity(), this.checkIntervalMs); 22780 } 22781 /** 22782 * Arrête la vérification périodique 22783 */ 22784 stopChecking() { 22785 if (this.checkIntervalId) { 22786 clearInterval(this.checkIntervalId); 22787 this.checkIntervalId = void 0; 22788 } 22789 } 22790 /** 22791 * Vérifie l'état d'inactivité et met à jour le data provider 22792 */ 22793 checkInactivity() { 22794 const timeSinceLastInteraction = Date.now() - this.lastInteractionTime; 22795 queueSession.idle.dp.timeSinceLastInteractionMs.set(timeSinceLastInteraction); 22796 queueSession.idle.dp.isIdle.set(timeSinceLastInteraction >= this.inactivityThresholdMs); 22797 } 22798 willUpdate(changedProperties) { 22799 super.willUpdate(changedProperties); 22800 if (changedProperties.has("location")) { 22801 this.initializeDataProvider(); 22802 } 22803 if (changedProperties.has("inactivityThresholdMs")) { 22804 if (typeof this.inactivityThresholdMs !== "number") { 22805 this.inactivityThresholdMs = DEFAULT_INACTIVITY_THRESHOLD_MS; 22806 } 22807 queueSession.config.dp.onInactivity.thresholdMs.set(this.inactivityThresholdMs); 22808 } 22809 } 22810 render() { 22811 return b$1`<sonic-inactivity-detected></sonic-inactivity-detected>`; 22812 } 22813 }; 22814 SonicUserActivity.styles = [tailwind]; 22815 __decorateClass$3y([ 22816 queueSession.config.bind.onInactivity.thresholdMs(), 22817 n$5({ type: Number }) 22818 ], SonicUserActivity.prototype, "inactivityThresholdMs", 2); 22819 __decorateClass$3y([ 22820 n$5({ type: Number }) 22821 ], SonicUserActivity.prototype, "checkIntervalMs", 2); 22822 __decorateClass$3y([ 22823 r$5() 22824 ], SonicUserActivity.prototype, "lastInteractionTime", 2); 22825 __decorateClass$3y([ 22826 r$5() 22827 ], SonicUserActivity.prototype, "location", 2); 22828 __decorateClass$3y([ 22829 queueSession.idle.bind.onIsIdle() 22830 ], SonicUserActivity.prototype, "onIsIdleChange", 1); 22831 __decorateClass$3y([ 22832 queueSession.idle.bind.onTimeSinceLastInteractionMs() 22833 ], SonicUserActivity.prototype, "onTimeSinceLastInteractionMsChange", 1); 22834 SonicUserActivity = __decorateClass$3y([ 22835 t$3(tagName$2h) 22836 ], SonicUserActivity); 22837 var __getOwnPropDesc$3w = Object.getOwnPropertyDescriptor; 22838 var __decorateClass$3x = (decorators, target, key, kind) => { 22839 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3w(target, key) : target; 22840 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 22841 if (decorator = decorators[i2]) 22842 result = decorator(result) || result; 22843 return result; 22844 }; 22845 const tagName$2g = "sonic-user-leave"; 22846 let SonicUserLeave = class extends i$6 { 22847 constructor() { 22848 super(...arguments); 22849 this.hasSentBeacon = false;
22850 this.isInternalNavigation = false; 22851 this.INTERNAL_NAV_TIMEOUT_MS = 1e3; 22852 this.handleLinkClick = (event) => { 22853 const composedPath = event.composedPath(); 22854 for (const element of composedPath) { 22855 if (element instanceof HTMLAnchorElement) { 22856 if (this.isSameSite(element.href)) { 22857 this.markInternalNavigation(); 22858 } 22859 } 22860 } 22861 }; 22862 this.handleFormSubmit = (event) => { 22863 const form2 = event.target; 22864 if (form2 && form2.action) { 22865 if (this.isSameSite(form2.action)) { 22866 this.markInternalNavigation(); 22867 } 22868 } 22869 }; 22870 this.handlePopState = () => { 22871 this.markInternalNavigation(); 22872 }; 22873 this.handleBeforeUnload = () => { 22874 if (this.isInternalNavigation || document.visibilityState === "visible") { 22875 return; 22876 } 22877 this.sendLeaveBeacon(); 22878 }; 22879 } 22880 connectedCallback() { 22881 if (window.parent !== window) { 22882 return; 22883 } 22884 if (this.cleanupTimeoutId) { 22885 clearTimeout(this.cleanupTimeoutId); 22886 this.cleanupTimeoutId = void 0; 22887 } 22888 super.connectedCallback(); 22889 this.initializeAttributes(); 22890 this.setupLeaveDetection(); 22891 } 22892 disconnectedCallback() { 22893 super.disconnectedCallback(); 22894 this.cleanupTimeoutId = window.setTimeout(() => { 22895 this.cleanupLeaveDetection(); 22896 this.cleanupTimeoutId = void 0; 22897 }, 1e3); 22898 } 22899 /** 22900 * Initialise les attributs depuis les ancêtres 22901 */ 22902 initializeAttributes() { 22903 this.setAttribute("keepAlive", "true"); 22904 } 22905 /** 22906 * Vérifie si une URL est sur le même site que la page actuelle 22907 */ 22908 isSameSite(url) { 22909 try { 22910 const currentOrigin = window.location.origin; 22911 const targetUrl = new URL(url, window.location.href); 22912 return targetUrl.origin === currentOrigin; 22913 } catch { 22914 return false; 22915 } 22916 } 22917 /** 22918 * Marque qu'une navigation interne est en cours 22919 */ 22920 markInternalNavigation() { 22921 this.isInternalNavigation = true; 22922 if (this.internalNavigationTimeout) { 22923 clearTimeout(this.internalNavigationTimeout); 22924 } 22925 this.internalNavigationTimeout = window.setTimeout(() => { 22926 this.isInternalNavigation = false; 22927 }, this.INTERNAL_NAV_TIMEOUT_MS); 22928 } 22929 /** 22930 * Configure la détection de sortie de l'utilisateur via plusieurs événements 22931 */ 22932 setupLeaveDetection() { 22933 document.addEventListener("click", this.handleLinkClick, true); 22934 document.addEventListener("submit", this.handleFormSubmit, true); 22935 window.addEventListener("popstate", this.handlePopState); 22936 window.addEventListener("beforeunload", this.handleBeforeUnload); 22937 } 22938 /** 22939 * Nettoie les event listeners 22940 */ 22941 cleanupLeaveDetection() { 22942 if (this.cleanupTimeoutId) { 22943 clearTimeout(this.cleanupTimeoutId); 22944 this.cleanupTimeoutId = void 0; 22945 } 22946 document.removeEventListener("click", this.handleLinkClick, true); 22947 document.removeEventListener("submit", this.handleFormSubmit, true); 22948 window.removeEventListener("popstate", this.handlePopState); 22949 window.removeEventListener("beforeunload", this.handleBeforeUnload); 22950 if (this.internalNavigationTimeout) { 22951 clearTimeout(this.internalNavigationTimeout); 22952 } 22953 } 22954 /** 22955 * Envoie le beacon pour signaler que l'utilisateur a quitté 22956 */ 22957 async sendLeaveBeacon() { 22958 if (this.hasSentBeacon) { 22959 return; 22960 } 22961 this.hasSentBeacon = true; 22962 try { 22963 const apiConfiguration = HTML$1.getApiConfiguration(this); 22964 const headersDataProvider = HTML$1.getAncestorAttributeValue(this, "headersDataProvider"); 22965 const headers = { ...dp(headersDataProvider).get() }; 22966 const api2 = new API(apiConfiguration); 22967 await api2.delete(endpoints$1.SessionQueue, {}, headers); 22968 } catch (error) { 22969 console.debug("Erreur lors de l'envoi du beacon de sortie:", error); 22970 } 22971 } 22972 render() { 22973 return A$1; 22974 } 22975 }; 22976 SonicUserLeave.styles = [tailwind]; 22977 SonicUserLeave = __decorateClass$3x([ 22978 t$3(tagName$2g) 22979 ], SonicUserLeave); 22980 var __defProp$3t = Object.defineProperty; 22981 var __getOwnPropDesc$3v = Object.getOwnPropertyDescriptor; 22982 var __decorateClass$3w = (decorators, target, key, kind) => { 22983 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3v(target, key) : target; 22984 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 22985 if (decorator = decorators[i2]) 22986 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 22987 if (kind && result) __defProp$3t(target, key, result); 22988 return result; 22989 }; 22990 const tagName$2f = "sonic-stay-or-leave"; 22991 let SonicStayOrLeave = class extends i$6 { 22992 constructor() { 22993 super(...arguments); 22994 this.visible = false;
22995 this.stay = () => { 22996 this.visible = false; 22997 if (document.location.hash.toString().trim() === "#") { 22998 document.location.hash = ""; 22999 } else { 23000 document.location.hash = "#"; 23001 } 23002 }; 23003 } 23004 render() { 23005 return b$1` 23006 <sonic-modal ?visible=${this.visible} forceAction> 23007 <sonic-modal-title> 23008 <sonic-icon library="custom" name="flag"></sonic-icon> 23009 <span>${t("stay_or_leave_modal_title")}</span> 23010 </sonic-modal-title> 23011 <sonic-modal-content> 23012 <span>${t("stay_or_leave_modal_content", true)}</span> 23013 </sonic-modal-content> 23014 <sonic-modal-actions> 23015 <sonic-button type="primary" @click=${this.stay}> 23016 <sonic-icon library="custom" slot="prefix" name="arrows-rotate"></sonic-icon> 23017 ${t("stay_or_leave_modal_btn_stay")}</sonic-button 23018 > 23019 </sonic-modal-actions> 23020 </sonic-modal> 23021 `; 23022 } 23023 }; 23024 SonicStayOrLeave.styles = [tailwind]; 23025 __decorateClass$3w([ 23026 n$5({ type: Boolean }) 23027 ], SonicStayOrLeave.prototype, "visible", 2); 23028 SonicStayOrLeave = __decorateClass$3w([ 23029 t$3(tagName$2f) 23030 ], SonicStayOrLeave); 23031 const TITLE_KEY = "waiting_line_error_title"; 23032 const CONTENT_KEY = "waiting_line_error_content"; 23033 const WORDING_PATHS = { 23034 [TITLE_KEY]: "sonic-wording.wording_waiting_line_error_title", 23035 [CONTENT_KEY]: "sonic-wording.wording_waiting_line_error_content" 23036 }; 23037 const ERROR_WORDING_KEYS = [TITLE_KEY, CONTENT_KEY]; 23038 const FALLBACKS = { 23039 fr: { 23040 [TITLE_KEY]: "Accès temporairement restreint", 23041 [CONTENT_KEY]: "En raison d'une forte demande, l'accès à la billetterie est temporairement restreint. Veuillez nous en excuser, nous allons vérifier si vous pouvez accéder à la billetterie d'ici quelques secondes." 23042 }, 23043 en: { 23044 [TITLE_KEY]: "Access temporarily restricted", 23045 [CONTENT_KEY]: "Due to high demand, access to the ticket office is temporarily restricted. Please excuse us, we will check if you can access the ticket office in a few seconds." 23046 }, 23047 de: { 23048 [TITLE_KEY]: "Zugang vorübergehend eingeschränkt", 23049 [CONTENT_KEY]: "Aufgrund der hohen Nachfrage ist der Zugang zum Ticketverkauf vorübergehend eingeschränkt. Bitte entschuldigen Sie uns, wir werden prüfen, ob Sie in Kürze den Zugang zum Ticketverkauf erhalten." 23050 }, 23051 nl: { 23052 [TITLE_KEY]: "Tijdelijk beperkte toegang", 23053 [CONTENT_KEY]: "Vanwege de grote vraag is de toegang tot de kassa tijdelijk beperkt. We vragen u om ons te verontschuldigen, we zullen controleren of u in korte tijd toegang krijgt tot de kassa." 23054 } 23055 }; 23056 function getDocumentLang() { 23057 const lang = document.documentElement.lang?.split("-")[0] || "fr"; 23058 return lang in FALLBACKS ? lang : "fr"; 23059 } 23060 function prefetch(host) { 23061 for (const key of ERROR_WORDING_KEYS) { 23062 WordingDirective.callApi(host, key); 23063 } 23064 } 23065 function getWording(key) { 23066 const fallback = FALLBACKS[getDocumentLang()][key]; 23067 if (!isWordingReady(key)) { 23068 return fallback; 23069 } 23070 const value = get$2(WORDING_PATHS[key]); 23071 if (typeof value === "string" && value.length > 0) { 23072 return value; 23073 } 23074 return fallback; 23075 } 23076 const waitingLineErrorWording = { 23077 TITLE_KEY, 23078 CONTENT_KEY, 23079 prefetch, 23080 get: getWording 23081 }; 23082 const HTTP_SERVER_ERROR_MIN = 500; 23083 const ERROR_MODAL_AUTO_HIDE_MS = 2e4; 23084 const SLOW_AUTHORIZE_FEEDBACK_MS = 1e4; 23085 let restrictionModal = null; 23086 let restrictionModalRetryTimeout = null; 23087 function clearRestrictionModalRetryTimeout() { 23088 if (restrictionModalRetryTimeout !== null) {
23089 clearTimeout(restrictionModalRetryTimeout); 23090 restrictionModalRetryTimeout = null; 23091 } 23092 } 23093 function showRestrictionModal() { 23094 if (restrictionModal) { 23095 return; 23096 } 23097 const title = waitingLineErrorWording.get(waitingLineErrorWording.TITLE_KEY); 23098 const content = waitingLineErrorWording.get(waitingLineErrorWording.CONTENT_KEY); 23099 const restrictionModalOptions = { 23100 title: b$1` <sonic-icon library="custom" name="clock-rotate-left"></sonic-icon> 23101 <span>${title}</span>`, 23102 content: b$1`${o$6(content)}`, 23103 removeOnHide: true, 23104 noCloseButton: true, 23105 forceAction: true, 23106 maxWidth: "32rem" 23107 }; 23108 restrictionModal = Modal.create(restrictionModalOptions); 23109 } 23110 function hideRestrictionModal() { 23111 clearRestrictionModalRetryTimeout(); 23112 if (!restrictionModal) { 23113 return; 23114 } 23115 restrictionModal.hide(); 23116 restrictionModal = null; 23117 } 23118 function onRestrictionModalAutoRetry() { 23119 restrictionModalRetryTimeout = null; 23120 hideRestrictionModal(); 23121 invalidateFetchersInError(); 23122 } 23123 function scheduleRestrictionModalRetry() { 23124 clearRestrictionModalRetryTimeout(); 23125 restrictionModalRetryTimeout = setTimeout(onRestrictionModalAutoRetry, ERROR_MODAL_AUTO_HIDE_MS); 23126 } 23127 onFetchError((error) => { 23128 const isQueueAuthorisedServerError = error.status >= HTTP_SERVER_ERROR_MIN && error.url.includes(endpoints$1.SessionQueueAuthorised); 23129 if (!isQueueAuthorisedServerError) { 23130 return; 23131 } 23132 showRestrictionModal(); 23133 scheduleRestrictionModalRetry(); 23134 }); 23135 function clearSlowAuthorizeTimer(timerId) { 23136 if (timerId !== null) { 23137 clearTimeout(timerId); 23138 } 23139 return null; 23140 } 23141 function startSlowAuthorizeTimer(previousTimerId, shouldRun) { 23142 clearSlowAuthorizeTimer(previousTimerId); 23143 hideRestrictionModal(); 23144 if (!shouldRun) { 23145 return null; 23146 } 23147 return setTimeout(() => { 23148 showRestrictionModal(); 23149 }, SLOW_AUTHORIZE_FEEDBACK_MS); 23150 } 23151 var __defProp$3s = Object.defineProperty; 23152 var __getOwnPropDesc$3u = Object.getOwnPropertyDescriptor; 23153 var __decorateClass$3v = (decorators, target, key, kind) => { 23154 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3u(target, key) : target; 23155 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 23156 if (decorator = decorators[i2]) 23157 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 23158 if (kind && result) __defProp$3s(target, key, result); 23159 return result; 23160 }; 23161 clearExpiredQueueSessionFromLocation(); 23162 queueSession.authorised.dp.authorized.set(false); 23163 const tagName$2e = "sonic-queue-session"; 23164 let SonicQueueLine = class extends i$6 { 23165 constructor() { 23166 super(...arguments); 23167 this.slowAuthorizeTimerId = null; 23168 this.currentIsCheckoutEnd = false; 23169 this.previousIsCheckoutEnd = false; 23170 this.queueEnabled = false; 23171 this.queueToken = null; 23172 this.isWaiting = false; 23173 this.location = ""; 23174 this.bypassQueueAuthorize = false; 23175 } 23176 async updateQueueTokenResponse(response) { 23177 this.slowAuthorizeTimerId = clearSlowAuthorizeTimer(this.slowAuthorizeTimerId); 23178 hideRestrictionModal(); 23179 if (response.token) { 23180 localStorage.setItem(queueTokenHeaderName, response.token); 23181 this.queueToken = response.token; 23182 } 23183 if (this.bypassQueueAuthorize) { 23184 return; 23185 } 23186 if (this.queueEnabled !== true) { 23187 return; 23188 } 23189 if (!response.authorized && response.redirection) { 23190 window.location.href = response.redirection; 23191 } 23192 } 23193 connectedCallback() { 23194 super.connectedCallback(); 23195 queueSession.authorised.dp.token.set(localStorage.getItem(queueTokenHeaderName) || ""); 23196 LocationHandler$1.onChange(this); 23197 waitingLineErrorWording.prefetch(this); 23198 } 23199 disconnectedCallback() { 23200 super.disconnectedCallback(); 23201 LocationHandler$1.offChange(this); 23202 this.slowAuthorizeTimerId = clearSlowAuthorizeTimer(this.slowAuthorizeTimerId); 23203 } 23204 willUpdate(changedProperties) { 23205 const locationChanged = changedProperties.has("location"); 23206 const queueTokenChanged = changedProperties.has("queueToken"); 23207 const queueEnabledChanged = changedProperties.has("queueEnabled"); 23208 if (locationChanged) { 23209 this.bypassQueueAuthorize = isCheckoutEnd() || this.currentIsCheckoutEnd; 23210 this.previousIsCheckoutEnd = this.currentIsCheckoutEnd; 23211 this.currentIsCheckoutEnd = isCheckoutEnd(); 23212 queueSession.authorised.dp.invalidate(); 23213 } 23214 if (locationChanged || queueTokenChanged || queueEnabledChanged) { 23215 this.updateToken(); 23216 } 23217 if (locationChanged || queueEnabledChanged) { 23218 if (this.queueEnabled === true) { 23219 const headersDataProvider = HTML$1.getAncestorAttributeValue(this, "headersDataProvider"); 23220 this.slowAuthorizeTimerId = startSlowAuthorizeTimer( 23221 this.slowAuthorizeTimerId, 23222 Boolean(headersDataProvider) 23223 ); 23224 } else { 23225 this.slowAuthorizeTimerId = clearSlowAuthorizeTimer(this.slowAuthorizeTimerId); 23226 hideRestrictionModal(); 23227 } 23228 } 23229 super.willUpdate(changedProperties); 23230 } 23231 async updateToken() { 23232 if (this.queueEnabled !== true) { 23233 return; 23234 } 23235 const headersDataProvider = HTML$1.getAncestorAttributeValue(this, "headersDataProvider"); 23236 if (!headersDataProvider) { 23237 return; 23238 } 23239 const headersPublisher = dp$1(headersDataProvider); 23240 headersPublisher[queueTokenHeaderName].set(this.computeQueueToken() || ""); 23241 } 23242 computeQueueToken() { 23243 return getEmbeddedToken() ?? this.queueToken; 23244 } 23245 render() { 23246 if (this.queueEnabled !== true) { 23247 return A$1; 23248 } 23249 const headersDataProvider = HTML$1.getAncestorAttributeValue(this, "headersDataProvider"); 23250 if (!headersDataProvider) { 23251 return A$1; 23252 } 23253 return b$1`<sonic-fetch 23254 headersDataProvider=${headersDataProvider} 23255 blockUntilDone 23256 credentials="omit" 23257 endpoint=${endpoints$1.SessionQueueAuthorised} 23258 dataProvider=${queueSession.dpKeys.SessionQueueAuthorised} 23259 key="data" 23260 ></sonic-fetch> 23261 <sonic-stay-or-leave ?visible=${this.previousIsCheckoutEnd}></sonic-stay-or-leave> 23262 ${this.isWaiting === false ? b$1` <sonic-fetch 23263 endpoint=${endpoints$1.SessionQueueConfig} 23264 dataProvider=${queueSession.dpKeys.SessionQueueConfig} 23265 key="data" 23266 ></sonic-fetch> 23267 <sonic-user-activity></sonic-user-activity> 23268 <sonic-user-leave></sonic-user-leave>` : A$1} `; 23269 } 23270 }; 23271 SonicQueueLine.styles = [tailwind]; 23272 __decorateClass$3v([ 23273 queueSession.authorised.onAssign() 23274 ], SonicQueueLine.prototype, "updateQueueTokenResponse", 1); 23275 __decorateClass$3v([ 23276 r$5() 23277 ], SonicQueueLine.prototype, "currentIsCheckoutEnd", 2); 23278 __decorateClass$3v([ 23279 r$5() 23280 ], SonicQueueLine.prototype, "previousIsCheckoutEnd", 2); 23281 __decorateClass$3v([ 23282 modules.queue.enabled(), 23283 r$5() 23284 ], SonicQueueLine.prototype, "queueEnabled", 2); 23285 __decorateClass$3v([ 23286 r$5() 23287 ], SonicQueueLine.prototype, "queueToken", 2); 23288 __decorateClass$3v([ 23289 bind$1("sonicTicketApp.isWaiting"), 23290 r$5() 23291 ], SonicQueueLine.prototype, "isWaiting", 2); 23292 __decorateClass$3v([ 23293 r$5() 23294 ], SonicQueueLine.prototype, "location", 2); 23295 __decorateClass$3v([ 23296 r$5() 23297 ], SonicQueueLine.prototype, "bypassQueueAuthorize", 2); 23298 SonicQueueLine = __decorateClass$3v([ 23299 t$3(tagName$2e) 23300 ], SonicQueueLine); 23301 const headersName = "X-Cache-Control-Key"; 23302 const dataProviderPath = `ticketsAppHeadersProvider.${headersName}`;
23303 const sessionStoragePath = `ticketsApp.${dataProviderPath}`; 23304 let currentCacheKey = sessionStorage.getItem(sessionStoragePath); 23305 set(dataProviderPath, currentCacheKey); 23306 dp("sonic-api").lastResponse.http.onAssign((http) => { 23307 const cacheKey = http?.headers?.get(headersName); 23308 if (!cacheKey) return; 23309 if (cacheKey === currentCacheKey) return; 23310 currentCacheKey = cacheKey; 23311 sessionStorage.setItem(sessionStoragePath, cacheKey); 23312 set(dataProviderPath, cacheKey); 23313 }); 23314 function getCacheKey() { 23315 return sessionStorage.getItem(sessionStoragePath); 23316 } 23317 class AbstractTracking { 23318 constructor(tracking) { 23319 this.tracking = tracking; 23320 } 23321 createService() { 23322 } 23323 addJob(jobKey) { 23324 if (!window.tarteaucitron.job) { 23325 window.tarteaucitron.job = []; 23326 } 23327 if (!window.tarteaucitron.job.includes(jobKey)) { 23328 window.tarteaucitron.job.push(jobKey); 23329 } 23330 } 23331 initConfig() { 23332 window.tarteaucitron.user = { ...window.tarteaucitron.user, ...this.tracking.config ?? {} }; 23333 } 23334 loadService() { 23335 return new Promise((resolve) => resolve(true)); 23336 } 23337 } 23338 class AdWordsConversion extends AbstractTracking { 23339 trackingOnAllPages() { 23340 this.addJob("googleadwordsconversion"); 23341 } 23342 trackingOnCart() { 23343 } 23344 trackingOnPurchase(orderId, revenue) { 23345 if (window.tarteaucitron.state.googleadwordsconversion === true) { 23346 this.initConfig(); 23347 window.tarteaucitron.user.adwordsconversionOrderId = orderId; 23348 window.tarteaucitron.user.adwordsconversionValue = revenue; 23349 window.tarteaucitron.user.adwordsconversionCurrency = "EUR"; 23350 window.tarteaucitron.services.googleadwordsconversion.js(); 23351 } 23352 } 23353 } 23354 class CustomTracking extends AbstractTracking { 23355 createService() { 23356 window.tarteaucitron.services.custom_tracking = { 23357 key: "custom_tracking", 23358 type: "other", 23359 name: "Tracking personnalisé", 23360 needConsent: true, 23361 cookies: [], 23362 js: function() { 23363 const statusInfo = document.querySelector(".tarteaucitronStatusInfo"); 23364 let next = statusInfo?.nextSibling; 23365 while (next) { 23366 let toRemove = next; 23367 next = next.nextSibling; 23368 toRemove.remove(); 23369 } 23370 const userCode = window.tarteaucitron.user.custom_tracking; 23371 if (!userCode) return; 23372 const container = document.createElement("div"); 23373 container.innerHTML = userCode; 23374 const pixels = container.querySelectorAll("img"); 23375 pixels.forEach((oldPixel) => { 23376 const pixel = document.createElement("img"); 23377 for (let attr of oldPixel.attributes) { 23378 pixel.setAttribute(attr.name, attr.value); 23379 } 23380 pixel.style.display = "none"; 23381 document.body.appendChild(pixel); 23382 }); 23383 const div = container.querySelectorAll("div"); 23384 div.forEach((oldDiv) => { 23385 const div2 = document.createElement("div"); 23386 for (let attr of oldDiv.attributes) { 23387 div2.setAttribute(attr.name, attr.value); 23388 } 23389 div2.style.display = "none"; 23390 document.body.appendChild(div2); 23391 }); 23392 const scripts = container.querySelectorAll("script"); 23393 scripts.forEach((oldScript) => { 23394 const script = document.createElement("script"); 23395 for (let attr of oldScript.attributes) { 23396 script.setAttribute(attr.name, attr.value); 23397 } 23398 if (oldScript.text) { 23399 script.text = oldScript.text; 23400 } 23401 document.body.appendChild(script); 23402 }); 23403 }, 23404 fallback: function() { 23405 const statusInfo = document.querySelector(".tarteaucitronStatusInfo"); 23406 let next = statusInfo?.nextSibling; 23407 while (next) { 23408 let toRemove = next; 23409 next = next.nextSibling; 23410 toRemove.remove(); 23411 } 23412 } 23413 }; 23414 this.initConfig(); 23415 } 23416 trackingOnAllPages() { 23417 const onView = this?.tracking?.config?.["on_view"]; 23418 if (onView) { 23419 window.tarteaucitron.user.custom_tracking = onView; 23420 } 23421 this.addJob("custom_tracking"); 23422 } 23423 trackingOnCart(trackingCartItem) { 23424 const onCart = this.tracking.config?.["on_cart"]; 23425 if (!onCart) return; 23426 window.tarteaucitron.user.custom_tracking = onCart.replace(/\[PRODUCT_IDS]/g, String(trackingCartItem.item.entity_id)).replace(/\[PRODUCT_NAME]/g, trackingCartItem.title).replace(/\[PRODUCT_PRICE]/g, String(trackingCartItem.item.price?.amount ?? 0)).replace(/\[PRODUCT_QUANTITY]/g, String(trackingCartItem.item.quantity ?? 1)); 23427 window.tarteaucitron.services.custom_tracking.js(); 23428 } 23429 trackingOnPurchase(orderId, revenue) { 23430 const onPurchase = this.tracking.config?.["on_purchase"]; 23431 if (!onPurchase) return; 23432 window.tarteaucitron.user.custom_tracking = onPurchase.replace(/\[ORDER_ID]/g, orderId).replace(/\[REVENUE]/g, revenue); 23433 window.tarteaucitron.services.custom_tracking.js(); 23434 } 23435 } 23436 class GoogleAnalytics extends AbstractTracking { 23437 trackingOnAllPages() { 23438 const googleId = this.tracking.config?.googleAnalyticsId; 23439 const more = this.tracking.config?.googleAnalyticsMore; 23440 const type = this.getGoogleType(); 23441 if (!googleId || !type) { 23442 return; 23443 } 23444 switch (type) { 23445 case "GTM": 23446 window.tarteaucitron.user.googletagmanagerId = googleId; 23447 window.tarteaucitron.user.googletagmanagerMore = more; 23448 break; 23449 case "GA4": 23450 case "ADS": 23451 window.tarteaucitron.user.gtagUa = googleId; 23452 window.tarteaucitron.user.gtagMore = more; 23453 break; 23454 case "GAJS": 23455 window.tarteaucitron.user.gajsUa = googleId; 23456 window.tarteaucitron.user.gajsMore = more; 23457 break; 23458 } 23459 const service = this.getTarteAuCitronService(type); 23460 if (service) { 23461 this.addJob(service); 23462 } 23463 } 23464 trackingOnCart(trackingCartItem) { 23465 const type = this.getGoogleType(); 23466 if (!this.hasConsent(type)) { 23467 return; 23468 } 23469 const payload = { 23470 currency: "EUR", 23471 value: trackingCartItem.item.price?.amount ?? 0, 23472 items: [ 23473 { 23474 item_id: trackingCartItem.item.entity_id, 23475 item_name: trackingCartItem.title, 23476 price: trackingCartItem.item.price?.amount ?? 0, 23477 quantity: trackingCartItem.item.quantity 23478 } 23479 ] 23480 }; 23481 switch (type) { 23482 case "GTM": 23483 this.pushDataLayer("add_to_cart", payload); 23484 break; 23485 case "GA4": 23486 window.gtag("event", "add_to_cart", payload); 23487 break; 23488 case "ADS": 23489 break; 23490 case "GAJS": 23491 console.warn("Universal Analytics n'est plus supporté."); 23492 break; 23493 } 23494 } 23495 trackingOnPurchase(orderId, revenue) { 23496 const type = this.getGoogleType(); 23497 const conversionId = this.getAdsConversionId(); 23498 if (!conversionId) { 23499 return; 23500 } 23501 if (!this.hasConsent(type)) { 23502 return; 23503 } 23504 const value = Number(revenue) || 0; 23505 switch (type) { 23506 case "GTM": 23507 this.pushDataLayer("purchase", { 23508 transaction_id: orderId, 23509 value, 23510 currency: "EUR" 23511 }); 23512 break; 23513 case "GA4": 23514 window.gtag("event", "purchase", { 23515 transaction_id: orderId, 23516 value, 23517 currency: "EUR" 23518 }); 23519 break; 23520 case "ADS": 23521 window.gtag("event", "conversion", { 23522 send_to: conversionId, 23523 value, 23524 currency: "EUR", 23525 transaction_id: orderId 23526 }); 23527 break; 23528 case "GAJS": 23529 console.warn("Universal Analytics n'est plus supporté."); 23530 break; 23531 } 23532 } 23533 loadService() { 23534 return new Promise((resolve) => { 23535 const start = Date.now(); 23536 const timeout = 3e3; 23537 const timer = window.setInterval(() => { 23538 if (this.isReady()) { 23539 clearInterval(timer); 23540 resolve(true); 23541 return; 23542 } 23543 if (Date.now() - start >= timeout) { 23544 clearInterval(timer); 23545 console.warn(`${this.getGoogleType()}
23545 non prêt à temps`); 23546 resolve(false); 23547 } 23548 }, 50); 23549 }); 23550 } 23551 getGoogleType() { 23552 const googleId = this.tracking.config?.googleAnalyticsId; 23553 if (!googleId) { 23554 return; 23555 } 23556 if (googleId.startsWith("GTM-")) { 23557 return "GTM"; 23558 } 23559 if (googleId.startsWith("G-")) { 23560 return "GA4"; 23561 } 23562 if (googleId.startsWith("AW-")) { 23563 return "ADS"; 23564 } 23565 if (googleId.startsWith("UA-")) { 23566 return "GAJS"; 23567 } 23568 return void 0; 23569 } 23570 getTarteAuCitronService(type) { 23571 switch (type) { 23572 case "GTM": 23573 return "googletagmanager"; 23574 case "GA4": 23575 case "ADS": 23576 return "gtag"; 23577 case "GAJS": 23578 return "gajs"; 23579 default: 23580 return void 0; 23581 } 23582 } 23583 hasConsent(type) { 23584 const service = this.getTarteAuCitronService(type); 23585 return !!service && window.tarteaucitron.state[service] === true; 23586 } 23587 pushDataLayer(event, ecommerce) { 23588 window.dataLayer = window.dataLayer || []; 23589 window.dataLayer.push({ 23590 event, 23591 ecommerce 23592 }); 23593 } 23594 getAdsConversionId() { 23595 const id = this.tracking.config?.googleAnalyticsId; 23596 const label2 = this.tracking.config?.conversionLabel; 23597 if (!id) { 23598 return; 23599 } 23600 return label2 ? `${id}/${label2}` : id; 23601 } 23602 isReady() { 23603 switch (this.getGoogleType()) { 23604 case "GA4": 23605 case "ADS": 23606 return typeof window.gtag === "function"; 23607 case "GTM": 23608 return Array.isArray(window.dataLayer); 23609 case "GAJS": 23610 return typeof window.ga === "function"; 23611 default: 23612 return false; 23613 } 23614 } 23615 } 23616 class XandrConversion extends AbstractTracking { 23617 trackingOnAllPages() { 23618 this.addJob("xandrconversion"); 23619 } 23620 trackingOnCart() { 23621 } 23622 trackingOnPurchase(orderId, revenue) { 23623 const id = this.tracking.config?.["xandrconversionId"]; 23624 const seg = this.tracking.config?.["xandrconversionSeg"]; 23625 if (!id) { 23626 return; 23627 } 23628 const div = document.createElement("div"); 23629 div.className = "xandrconversion-canvas"; 23630 div.setAttribute("xandrconversionId", id); 23631 div.setAttribute("xandrconversionOrderId", orderId); 23632 div.setAttribute("xandrconversionValue", revenue); 23633 if (seg) { 23634 div.setAttribute("xandrconversionSeg", seg); 23635 } 23636 document.body.appendChild(div); 23637 window.tarteaucitron.services.xandrconversion?.js(); 23638 } 23639 } 23640 class Tradedoubler extends AbstractTracking { 23641 createService() { 23642 window.tarteaucitron.services.tradedoubler = { 23643 key: "tradedoubler", 23644 type: "ads", 23645 name: "Tradedoubler", 23646 needConsent: true, 23647 cookies: ["td_*", "tradedoubler"], 23648 uri: "https://www.tradedoubler.com/en/privacy-policy/", 23649 js: function() { 23650 const orderId = window.tarteaucitron.user.tradedoublerOrderId; 23651 const revenue = window.tarteaucitron.user.tradedoublerRevenue; 23652 const organization = window.tarteaucitron.user.tradedoublerOrganization; 23653 const event = window.tarteaucitron.user.tradedoublerEvent; 23654 if (!organization || !event) { 23655 return; 23656 } 23657 const img = document.createElement("img"); 23658 img.src = `https://tbs.tradedoubler.com/report?organization=${organization}&event=${event}&orderNumber=${orderId}&orderValue=${revenue}`; 23659 img.width = 1; 23660 img.height = 1; 23661 img.style.display = "none"; 23662 document.body.appendChild(img); 23663 } 23664 }; 23665 } 23666 trackingOnAllPages() { 23667 this.addJob("tradedoubler"); 23668 } 23669 trackingOnCart() { 23670 } 23671 trackingOnPurchase(orderId, revenue) { 23672 this.initConfig(); 23673 window.tarteaucitron.user.tradedoublerOrderId = orderId; 23674 window.tarteaucitron.user.tradedoublerRevenue = revenue; 23675 window.tarteaucitron.services.tradedoubler.js(); 23676 } 23677 } 23678 class XandrSegment extends AbstractTracking { 23679 trackingOnAllPages() { 23680 const add = this.tracking.config?.["xandrsegmentAdd"]; 23681 if (!add) { 23682 return; 23683 } 23684 const div = document.createElement("div"); 23685 div.className = "xandrsegment-canvas"; 23686 div.setAttribute("xandrsegmentAdd", add); 23687 document.body.appendChild(div); 23688 this.addJob("xandrsegment"); 23689 } 23690 trackingOnCart() { 23691 } 23692 trackingOnPurchase() { 23693 } 23694 } 23695 class AdWordsRemarketing extends AbstractTracking { 23696 trackingOnAllPages() { 23697 this.initConfig(); 23698 this.addJob("googleadwordsremarketing"); 23699 } 23700 trackingOnCart() { 23701 } 23702 trackingOnPurchase() { 23703 } 23704 } 23705 class PixelMeta extends AbstractTracking { 23706 trackingOnAllPages() { 23707 this.initConfig(); 23708 this.addJob("facebookpixel"); 23709 } 23710 trackingOnCart(trackingCartItem) { 23711 if (window.tarteaucitron.state.facebookpixel === true) { 23712 window.fbq("track", "AddToCart", { 23713 content_ids: [trackingCartItem.item.entity_id], 23714 content_name: trackingCartItem.title, 23715 value: trackingCartItem.item.price?.amount ?? 0, 23716 currency: "EUR", 23717 quantity: trackingCartItem.item.quantity 23718 }); 23719 } 23720 } 23721 trackingOnPurchase(orderId, revenue) { 23722 if (window.tarteaucitron.state.facebookpixel === true) { 23723 window.fbq("track", "Purchase", { 23724 order_id: orderId, 23725 value: revenue, 23726 currency: "EUR" 23727 }); 23728 } 23729 } 23730 } 23731 class Xandr extends AbstractTracking { 23732 trackingOnAllPages() { 23733 this.initConfig(); 23734 this.addJob("xandr"); 23735 } 23736 trackingOnCart() { 23737 } 23738 trackingOnPurchase() { 23739 } 23740 } 23741 class Matomo extends AbstractTracking { 23742 trackingOnAllPages() { 23743 this.initConfig(); 23744 this.addJob("matomocloud"); 23745 } 23746 trackingOnCart(trackingCartItem) { 23747 if (window.tarteaucitron.state.matomocloud === true) { 23748 window._paq.push([ 23749 "addEcommerceItem", 23750 trackingCartItem.item.entity_id, 23751 trackingCartItem.title, 23752 trackingCartItem.item.entity_type, 23753 trackingCartItem.item.price?.amount ?? 0, 23754 trackingCartItem.item.quantity 23755 ]); 23756 window._paq.push(["trackEcommerceCartUpdate", trackingCartItem.total]); 23757 } 23758 } 23759 trackingOnPurchase(orderId, revenue) { 23760 if (window.tarteaucitron.state.matomocloud === true) { 23761 window._paq.push(["trackEcommerceOrder", orderId, revenue]); 23762 } 23763 } 23764 } 23765 const InitTrackingEventKey = "tracking-manager-initialized"; 23766 class TrackingManager { 23767 constructor() { 23768 this.trackings = []; 23769 } 23770 async init(givenTrackings) { 23771 const isReady = await this.loadTAC(); 23772 if (isReady) {
23773 givenTrackings.forEach((tracking) => { 23774 const trackingService = this.getMappedTracking(tracking); 23775 if (trackingService) { 23776 this.trackings.push(trackingService); 23777 } 23778 }); 23779 if (this.trackings.length > 0 && Object.values(window.tarteaucitron.services).length > 0) { 23780 this.createService(); 23781 this.trackingOnAllPages(); 23782 await this.loadServices(); 23783 } 23784 } 23785 } 23786 static getTrackingManager(callback) { 23787 const tryManager = () => { 23788 const trackingManager = window?.__SonicTrackingManager; 23789 if (trackingManager) { 23790 callback(trackingManager); 23791 return true; 23792 } 23793 return false; 23794 }; 23795 if (!tryManager()) { 23796 const handler = (event) => { 23797 const trackingManager = event.detail; 23798 if (trackingManager) { 23799 callback(trackingManager); 23800 } 23801 window.removeEventListener(InitTrackingEventKey, handler); 23802 }; 23803 window.addEventListener(InitTrackingEventKey, handler); 23804 } 23805 } 23806 loadTAC() { 23807 return new Promise((resolve) => { 23808 const start = Date.now(); 23809 const timeout = 3e3; 23810 const t2 = setInterval(() => { 23811 const tac = window.tarteaucitron; 23812 if (tac?.services && Object.keys(tac.services).length) { 23813 clearInterval(t2); 23814 resolve(true); 23815 return; 23816 } 23817 if (Date.now() - start > timeout) { 23818 clearInterval(t2); 23819 console.warn("tarteaucitron non prêt à temps"); 23820 resolve(false); 23821 } 23822 }, 50); 23823 }); 23824 } 23825 getMappedTracking(tracking) { 23826 switch (tracking.trackingKey) { 23827 case "pixel_meta": 23828 return new PixelMeta(tracking); 23829 case "google_analytics": 23830 return new GoogleAnalytics(tracking); 23831 case "adwords_remarketing": 23832 return new AdWordsRemarketing(tracking); 23833 case "adwords_conversion": 23834 return new AdWordsConversion(tracking); 23835 case "xandr": 23836 return new Xandr(tracking); 23837 case "xandr_segment": 23838 return new XandrSegment(tracking); 23839 case "xandr_conversion": 23840 return new XandrConversion(tracking); 23841 case "tradedoubler": 23842 return new Tradedoubler(tracking); 23843 case "custom_tracking": 23844 return new CustomTracking(tracking); 23845 case "matomo": 23846 return new Matomo(tracking); 23847 default: 23848 console.warn(`Unknown tracking key: ${tracking.trackingKey}`); 23849 return; 23850 } 23851 } 23852 createService() { 23853 this.trackings.forEach((tracking) => tracking.createService()); 23854 } 23855 trackingOnAllPages() { 23856 this.trackings.forEach((tracking) => tracking.trackingOnAllPages()); 23857 } 23858 trackingOnPurchase(orderId, revenue) { 23859 this.trackings.forEach((tracking) => tracking.trackingOnPurchase(orderId, revenue)); 23860 } 23861 trackingOnCart(trackingCartItem) { 23862 this.trackings.forEach((tracking) => tracking.trackingOnCart(trackingCartItem)); 23863 } 23864 async loadServices() { 23865 for (const tracking of this.trackings) { 23866 await tracking.loadService(); 23867 } 23868 } 23869 } 23870 var __defProp$3r = Object.defineProperty; 23871 var __getOwnPropDesc$3t = Object.getOwnPropertyDescriptor; 23872 var __decorateClass$3u = (decorators, target, key, kind) => { 23873 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3t(target, key) : target; 23874 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 23875 if (decorator = decorators[i2]) 23876 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 23877 if (kind && result) __defProp$3r(target, key, result); 23878 return result; 23879 }; 23880 dp("waiting_line_infos").status.set(""); 23881 dp("sonicTicketApp").isWaiting.set(true); 23882 const tagName$2d = "sonic-tickets-app"; 23883 let SonicTicketApp = class extends Subscriber$1(i$6) { 23884 constructor() { 23885 super(...arguments); 23886 this.token = null; 23887 this.customRoutes = {}; 23888 this.wordingVersionProvider = "settings.wording.version"; 23889 this.headersDataProvider = "ticketsAppHeadersProvider"; 23890 this.serviceUrl = "/api/v2"; 23891 this.cartProvider = "cart/current"; 23892 this.credentials = "include"; 23893 this.theme = "light"; 23894 this.wordingProvider = "translate"; 23895 this.customIconLibraryPath = "https://cdn.supersoniks.com/concorde/icons/fontawesome/v6/$prefix/$name.svg"; 23896 this.customIconDefaultPrefix = "regular"; 23897 this.defaultFrontend = false;
23898 this.noFetchSettings = false; 23899 this.noFetchTheme = false; 23900 this.waitingLineStatus = ""; 23901 this.appType = "customer"; 23902 this.statusResetCounter = 0; 23903 this.onFetchError = (apiResponse) => { 23904 if (this.statusResetCounter > 5) { 23905 return; 23906 } 23907 const status = dp("waiting_line_infos").status.get(); 23908 if (apiResponse.status === 403 && this.hasWaitingLine && status != "") { 23909 dp("waiting_line_infos").status.set(""); 23910 this.statusResetCounter++; 23911 } 23912 }; 23913 } 23914 onWaitingLineStatus(status, enabled, queueEnabled, authorized) { 23915 const isWaiting = status != "entered" && enabled; 23916 const isQueued = queueEnabled === true && authorized === false; 23917 dp("sonicTicketApp").isWaiting.set(isWaiting || isQueued); 23918 } 23919 onLogRoute(value) { 23920 if (value === true) { 23921 configLog(HTML$1.getApiConfiguration(this)); 23922 } 23923 } 23924 connectedCallback() { 23925 onFetchError(this.onFetchError); 23926 const baseURL = this.customRoutes.home || defaultAppRoutes.home; 23927 Routes.register(defaultAppRoutes, baseURL); 23928 for (const key in this.customRoutes) { 23929 if (this.customRoutes[key] === null) delete this.customRoutes[key]; 23930 } 23931 Routes.register(this.customRoutes, baseURL); 23932 const customAccountBaseUrl = this.customRoutes["account"]; 23933 const hasCustomAccountBaseUrl = customAccountBaseUrl !== defaultAppRoutes.account; 23934 const accountBaseUrl = hasCustomAccountBaseUrl ? customAccountBaseUrl : defaultAppRoutes.home; 23935 Routes.register(accountRoutes, accountBaseUrl, "account."); 23936 if (this.storeUrl && !this.getAttribute("serviceURL")) { 23937 const urlWithoutLastSlash = this.storeUrl.replace(/\/$/, ""); 23938 this.serviceUrl = urlWithoutLastSlash + this.serviceUrl; 23939 } 23940 this.setAttribute("serviceUrl", this.serviceUrl); 23941 this.setAttribute( 23942 "cartProvider", 23943 new URL(document.location.href).searchParams.get("cartProvider") || this.cartProvider 23944 ); 23945 this.setAttribute("credentials", this.credentials); 23946 this.setAttribute("wordingProvider", this.wordingProvider); 23947 this.setAttribute("customIconLibraryPath", this.customIconLibraryPath); 23948 this.setAttribute("customIconDefaultPrefix", this.customIconDefaultPrefix); 23949 setDefaultApiConf({ 23950 serviceURL: this.serviceUrl, 23951 token: this.token, 23952 credentials: this.credentials, 23953 userName: "", 23954 password: "", 23955 authToken: "", 23956 tokenProvider: "" 23957 }); 23958 const appHome = appRoute("home"); 23959 PublisherManager.get("ticketsAppHeadersProvider")["Sonic-Tickets-App-Home"].set(appHome); 23960 PublisherManager.get(`user`).onAssign((response) => { 23961 if (response._sonic_http_response_) { 23962 PublisherManager.get(`carpooling_user_id`).encrypted_uid.set(response._sonic_http_response_.headers.get("Uid")); 23963 } 23964 }); 23965 handleRedirect(); 23966 super.connectedCallback(); 23967 this.dispatchEvent( 23968 new CustomEvent("sonic-routes-ready", { 23969 bubbles: true, 23970 composed: true 23971 }) 23972 ); 23973 } 23974 disconnectedCallback() { 23975 offFetchError(this.onFetchError); 23976 super.disconnectedCallback(); 23977 } 23978 showWaitingLine() { 23979 return this.hasWaitingLine && this.waitingLineStatus != "entered"; 23980 } 23981 showAppContent() { 23982 return !this.showWaitingLine() || sessionStorage.getItem("waiting-line-previously-entered") === "true" && this.waitingLineStatus == ""; 23983 } 23984 async willUpdate(_changedProperties) { 23985 invalidateFetchersInError(); 23986 await this.initTracking(_changedProperties); 23987 super.willUpdate(_changedProperties); 23988 } 23989 async initTracking(_changedProperties) { 23990 if (typeof window === "undefined" || window.self !== window.top || !!window?.__SonicTrackingManager) { 23991 return; 23992 } 23993 if (_changedProperties.has("trackings") && this.trackings && this.trackings.length > 0) { 23994 const manager = new TrackingManager(); 23995 await manager.init(this.trackings); 23996 window.__SonicTrackingManager = manager; 23997 const initEvent = new CustomEvent(InitTrackingEventKey, { detail: manager }); 23998 window.dispatchEvent(initEvent); 23999 } 24000 } 24001 render() { 24002 return b$1` ${!this.noFetchSettings ? b$1`<sonic-fetch dataprovider="settings" blockUntilDone localStorage="enabled"></sonic-fetch> ` : A$1} 24003 <sonic-theme part="theme" theme=${this.theme}> 24004 <sonic-queue-session></sonic-queue-session> 24005 ${!this.noFetchTheme ? b$1`<sonic-fetch dataprovider="theme"></sonic-fetch>` : A$1} 24006 ${this.preferWebsite && this.defaultFrontend ? b$1`<sonic-prefer-website-message></sonic-prefer-website-message>` : A$1} 24007 ${this.showWaitingLine() ? b$1`<sonic-waiting-line></sonic-waiting-line>` : A$1} 24008 ${!this.isWaiting ? b$1`<sonic-fetch addHTTPResponse dataprovider="user" endpoint="user/current"></sonic-fetch>` : A$1} 24009 ${!this.isWaiting ? b$1`<sonic-fetch dataprovider="cart/current" endpoint="cart/current"></sonic-fetch>` : A$1} 24010 ${this.showAppContent() ? b$1` 24011 <slot></slot> 24012 24013 <!-- Routes auto-implémentées --> 24014 <sonic-default-router .customRoutes=${this.customRoutes}></sonic-default-router> 24015 24016 ${!this.isWaiting ? b$1`<sonic-promo-active-code></sonic-promo-active-code> ` : A$1} 24017 24018 <!-- message subscriber --> 24019 <sonic-toast-message-subscriber dataProvider="cart/current"></sonic-toast-message-subscriber> 24020 <sonic-toast-message-subscriber dataProvider="defaultMessages"></sonic-toast-message-subscriber> 24021 <sonic-administrator-force-logout></sonic-administrator-force-logout> 24022 ` : A$1} 24023 </sonic-theme>`; 24024 } 24025 }; 24026 SonicTicketApp.styles = [ 24027 i$9` 24028 :host { 24029 display: contents; 24030 --sc-container-gutter-x: 1rem; 24031 --sc-container-gutter-y: 2rem; 24032 --sc-header-baseline-height: 1rem; 24033 --sc-header-gy: 1rem; 24034 --sc-header-height: calc(4.5rem + var(--sc-header-gy) * 2 + var(--sc-header-baseline-height, 0px)); 24035 --sc-header-mb: 2rem; 24036 } 24037 @media (min-width: 480px) { 24038 :host { 24039 --sc-container-gutter-x: clamp(1rem, 5vw, 5rem); 24040 } 24041 } 24042 24043 @media (min-width: 1024px) { 24044 :host { 24045 --sc-container-gutter-x: clamp(1rem, 5vw, 5rem); 24046 --sc-header-gy: 2rem; 24047 --sc-header-mb: 0px; 24048 } 24049 } 24050 ` 24051 ]; 24052 __decorateClass$3u([ 24053 n$5({ type: String }) 24054 ], SonicTicketApp.prototype, "token", 2); 24055 __decorateClass$3u([ 24056 n$5({ type: Object }) 24057 ], SonicTicketApp.prototype, "customRoutes", 2); 24058 __decorateClass$3u([ 24059 n$5({ type: String, reflect: true }) 24060 ], SonicTicketApp.prototype, "wordingVersionProvider", 2); 24061 __decorateClass$3u([ 24062 n$5({ type: String, reflect: true }) 24063 ], SonicTicketApp.prototype, "headersDataProvider", 2); 24064 __decorateClass$3u([ 24065 n$5({ type: String }) 24066 ], SonicTicketApp.prototype, "storeUrl", 2); 24067 __decorateClass$3u([ 24068 n$5({ type: String }) 24069 ], SonicTicketApp.prototype, "serviceUrl", 2); 24070 __decorateClass$3u([ 24071 n$5({ type: String }) 24072 ], SonicTicketApp.prototype, "cartProvider", 2); 24073 __decorateClass$3u([ 24074 n$5({ type: String }) 24075 ], SonicTicketApp.prototype, "credentials", 2); 24076 __decorateClass$3u([ 24077 n$5({ type: String }) 24078 ], SonicTicketApp.prototype, "theme", 2); 24079 __decorateClass$3u([ 24080 n$5({ type: String }) 24081 ], SonicTicketApp.prototype, "wordingProvider", 2); 24082 __decorateClass$3u([ 24083 n$5({ type: String }) 24084 ], SonicTicketApp.prototype, "customIconLibraryPath", 2); 24085 __decorateClass$3u([ 24086 n$5({ type: String }) 24087 ], SonicTicketApp.prototype, "customIconDefaultPrefix", 2); 24088 __decorateClass$3u([ 24089 n$5({ type: Boolean }) 24090 ], SonicTicketApp.prototype, "defaultFrontend", 2); 24091 __decorateClass$3u([ 24092 n$5({ type: Boolean }) 24093 ], SonicTicketApp.prototype, "noFetchSettings", 2); 24094 __decorateClass$3u([ 24095 n$5({ type: Boolean }) 24096 ], SonicTicketApp.prototype, "noFetchTheme", 2); 24097 __decorateClass$3u([ 24098 bind$1("settings.prefer_website"), 24099 n$5({ type: Boolean }) 24100 ], SonicTicketApp.prototype, "preferWebsite", 2); 24101 __decorateClass$3u([ 24102 bind$1("waiting_line_infos.status"), 24103 r$5() 24104 ], SonicTicketApp.prototype, "waitingLineStatus", 2); 24105 __decorateClass$3u([ 24106 bind$1("settings.modules.waiting_line.enabled"), 24107 n$5({ type: Boolean }) 24108 ], SonicTicketApp.prototype, "hasWaitingLine", 2); 24109 __decorateClass$3u([ 24110 bind$1("sonicTicketApp.isWaiting"), 24111 r$5() 24112 ], SonicTicketApp.prototype, "isWaiting", 2); 24113 __decorateClass$3u([ 24114 onAssign$1( 24115 "waiting_line_infos.status", 24116 "settings.modules.waiting_line.enabled", 24117 "settings.modules.queue.enabled", 24118 "sessionQueueAuthorised.authorized" 24119 ) 24120 ], SonicTicketApp.prototype, "onWaitingLineStatus", 1); 24121 __decorateClass$3u([ 24122 e$2({ context: appType }), 24123 n$5({ type: String }) 24124 ], SonicTicketApp.prototype, "appType", 2); 24125 __decorateClass$3u([ 24126 onAssign$1("settings.modules.logs_route.enabled") 24127 ], SonicTicketApp.prototype, "onLogRoute", 1); 24128 __decorateClass$3u([ 24129 bind$1("settings.trackings"), 24130 n$5({ type: Array }) 24131 ], SonicTicketApp.prototype, "trackings", 2); 24132 SonicTicketApp = __decorateClass$3u([ 24133 t$3(tagName$2d), 24134 dispatchConnectedEvent() 24135 ], SonicTicketApp); 24136 var __defProp$3q = Object.defineProperty; 24137 var __getOwnPropDesc$3s = Object.getOwnPropertyDescriptor; 24138 var __decorateClass$3t = (decorators, target, key, kind) => { 24139 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3s(target, key) : target; 24140 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 24141 if (decorator = decorators[i2]) 24142 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 24143 if (kind && result) __defProp$3q(target, key, result); 24144 return result; 24145 }; 24146 const tagName$2c = "sonic-tickets-app-legacy"; 24147 let SonicTicketAppLegacy = class extends Subscriber$1(i$6) { 24148 constructor() { 24149 super(...arguments); 24150 this.customRoutes = {}; 24151 this.appType = "customer"; 24152 } 24153 createRenderRoot() { 24154 return this; 24155 } 24156 connectedCallback() { 24157 dp("sonicTicketApp").isWaiting.set(false); 24158 const baseURL = this.customRoutes.home || defaultAppRoutes.home; 24159 Routes.register(defaultAppRoutes, baseURL); 24160 for (const key in this.customRoutes) { 24161 if (this.customRoutes[key] === null) delete this.customRoutes[key]; 24162 } 24163 Routes.register(this.customRoutes, baseURL); 24164 const customAccountBaseUrl = this.customRoutes["account"]; 24165 const hasCustomAccountBaseUrl = customAccountBaseUrl !== defaultAppRoutes.account; 24166 const accountBaseUrl = hasCustomAccountBaseUrl ? customAccountBaseUrl : defaultAppRoutes.home; 24167 Routes.register(accountRoutes, accountBaseUrl, "account."); 24168 this.setAttribute("serviceUrl", "/api/v2"); 24169 this.setAttribute("cartProvider", "cart/current"); 24170 this.setAttribute("credentials", "include"); 24171 this.setAttribute("wordingProvider", "translate"); 24172 this.setAttribute( 24173 "customIconLibraryPath", 24174 "https://cdn.supersoniks.com/concorde/icons/fontawesome/v6/$prefix/$name.svg" 24175 ); 24176 this.setAttribute("wordingVersionProvider", "settings.wording.ver
24176sion"); 24177 this.setAttribute( 24178 "customIconLibraryPath", 24179 "https://cdn.supersoniks.com/concorde/icons/fontawesome/v6/$prefix/$name.svg" 24180 ); 24181 this.setAttribute("customIconDefaultPrefix", "regular"); 24182 handleRedirect(); 24183 super.connectedCallback(); 24184 } 24185 render() { 24186 return b$1` <sonic-theme part="theme"> 24187 <sonic-fetch dataprovider="theme"></sonic-fetch> 24188 <sonic-fetch dataprovider="settings" localStorage="enabled"></sonic-fetch> 24189 <sonic-fetch dataprovider="user" endpoint="user/current"></sonic-fetch> 24190 <sonic-fetch dataprovider="cart/current" endpoint="cart/current"></sonic-fetch> 24191 <slot></slot> 24192 24193 <!-- message subscriber --> 24194 <sonic-toast-message-subscriber dataProvider="cart/current"></sonic-toast-message-subscriber> 24195 <sonic-toast-message-subscriber dataProvider="defaultMessages"></sonic-toast-message-subscriber> 24196 </sonic-theme>`; 24197 } 24198 }; 24199 __decorateClass$3t([ 24200 n$5({ type: Object }) 24201 ], SonicTicketAppLegacy.prototype, "customRoutes", 2); 24202 __decorateClass$3t([ 24203 e$2({ context: appType }), 24204 n$5({ type: String }) 24205 ], SonicTicketAppLegacy.prototype, "appType", 2); 24206 SonicTicketAppLegacy = __decorateClass$3t([ 24207 t$3(tagName$2c) 24208 ], SonicTicketAppLegacy);
24209 var __defProp$3p = Object.defineProperty; 24210 var __getOwnPropDesc$3r = Object.getOwnPropertyDescriptor; 24211 var __decorateClass$3s = (decorators, target, key, kind) => { 24212 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3r(target, key) : target; 24213 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 24214 if (decorator = decorators[i2]) 24215 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 24216 if (kind && result) __defProp$3p(target, key, result); 24217 return result; 24218 }; 24219 let ItemCount = class extends Subscriber$1(i$6) { 24220 constructor() { 24221 super(...arguments); 24222 this.quantity = null; 24223 this.payment_link_hash = null; 24224 this.quantityChanged = false; 24225 this.quantityIsInit = false; 24226 } 24227 willUpdate(_changedProperties) { 24228 if (_changedProperties.has("quantity")) { 24229 this.quantityIsInit = this.quantity !== null; 24230 if (Number(this.quantity) > 0 && this.quantityIsInit && Number(this.quantity) !== Number(_changedProperties.get("quantity"))) { 24231 this.triggerQuantityAnimation(); 24232 } 24233 } 24234 } 24235 triggerQuantityAnimation() { 24236 this.quantityChanged = true; 24237 setTimeout(() => { 24238 this.quantityChanged = false; 24239 }, 600); 24240 } 24241 render() { 24242 if (this.payment_link_hash) { 24243 return b$1`<span>!</span>`; 24244 } 24245 const count = Number(this.quantity); 24246 return b$1`<span>${count}</span>`; 24247 } 24248 }; 24249 ItemCount.styles = [ 24250 tailwind, 24251 i$9` 24252 :host { 24253 display: inline-flex; 24254 align-items: center; 24255 justify-content: center; 24256 line-height: 1; 24257 font-size: clamp(10px, 0.5em, 0.85rem); 24258 } 24259 24260 span { 24261 display: inline-flex; 24262 background-color: var(--sc-danger); 24263 color: var(--sc-danger-content); 24264 border-radius: 100px; 24265 padding: 0.35em; 24266 font-weight: bold; 24267 justify-content: center; 24268 align-items: center; 24269 line-height: 1; 24270 white-space: nowrap; 24271 min-width: 1.7em; 24272 height: 1.7em; 24273 /* fix bug #42622 */ 24274 transition: 24275 opacity 0.3s ease, 24276 scale 0.3s ease, 24277 box-shadow 0.3s ease; 24278 transform-origin: center center; 24279 font-weight: bold; 24280 line-height: 1.15; 24281 opacity: 0; 24282 scale: 0; 24283 } 24284 24285 :host([quantity="0"]) span { 24286 opacity: 0 !important; 24287 scale: 0 !important; 24288 } 24289 24290 :host([quantity]:not([quantity="0"])) span { 24291 opacity: 1; 24292 scale: 1; 24293 } 24294 :host([quantityChanged]) span { 24295 animation: quantityPulse 0.6s ease-in-out; 24296 } 24297 24298 @keyframes quantityPulse { 24299 0% { 24300 box-shadow: 0 0 0 0px var(--sc-danger); 24301 } 24302 25% { 24303 box-shadow: 0 0 0 3px var(--sc-danger); 24304 } 24305 50% { 24306 box-shadow: 0 0 0 0px var(--sc-danger); 24307 } 24308 75% { 24309 box-shadow: 0 0 0 1px var(--sc-danger); 24310 } 24311 100% { 24312 box-shadow: 0 0 0 0px var(--sc-danger); 24313 } 24314 } 24315 ` 24316 ]; 24317 __decorateClass$3s([ 24318 n$5({ type: Number, reflect: true }) 24319 ], ItemCount.prototype, "quantity", 2); 24320 __decorateClass$3s([ 24321 n$5({ type: String }) 24322 ], ItemCount.prototype, "payment_link_hash", 2); 24323 __decorateClass$3s([ 24324 n$5({ type: Boolean, reflect: true }) 24325 ], ItemCount.prototype, "quantityChanged", 2); 24326 ItemCount = __decorateClass$3s([ 24327 t$3("sonic-cart-item-count") 24328 ], ItemCount); 24329 var __defProp$3o = Object.defineProperty; 24330 var __getOwnPropDesc$3q = Object.getOwnPropertyDescriptor; 24331 var __decorateClass$3r = (decorators, target, key, kind) => { 24332 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3q(target, key) : target; 24333 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 24334 if (decorator = decorators[i2]) 24335 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 24336 if (kind && result) __defProp$3o(target, key, result); 24337 return result; 24338 }; 24339 let SonicCartRemaining = class extends Subscriber$1(i$6) { 24340 constructor() { 24341 super(...arguments); 24342 this.remaining_time = false;
24343 this.expired_at = null; 24344 this.noIcon = false; 24345 this.displayExpired = true; 24346 this.expired = false; 24347 this.remaining_time_string = ""; 24348 this.wording_expire = ""; 24349 } 24350 willUpdate(changedProperties) { 24351 super.willUpdate(changedProperties); 24352 if (changedProperties.has("expired_at") && this.expired_at) { 24353 this.remaining_time = this.expired_at; 24354 } 24355 if (changedProperties.has("remaining_time")) { 24356 if (this.remaining_time) { 24357 const update_countdown_id = setInterval(() => { 24358 this.updateCartCountdown(update_countdown_id); 24359 }, 1e3); 24360 } else { 24361 this.remaining_time_string = ""; 24362 } 24363 } 24364 } 24365 updateCartCountdown(update_countdown_id) { 24366 const endTimestamp = this.remaining_time; 24367 if (!endTimestamp) { 24368 clearInterval(update_countdown_id); 24369 return; 24370 } 24371 const endDate = new Date(endTimestamp * 1e3).getTime(); 24372 const startDate = Date.now(); 24373 const countdown = (endDate - startDate) / 1e3; 24374 this.formatCountdown(countdown); 24375 } 24376 formatCountdown(countdown) { 24377 this.expired = countdown < 0; 24378 if (countdown >= 0) { 24379 const hours = Math.floor(countdown / 3600); 24380 const mins = Math.floor(countdown % 3600 / 60); 24381 const secs = Math.floor(countdown % 60); 24382 const renderHour = hours ? `${hours.toString().padStart(2, "0")}:` : ""; 24383 this.remaining_time_string = `${renderHour}${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`; 24384 } 24385 } 24386 render() { 24387 if (this.expired && this.displayExpired) { 24388 return b$1` <span> 24389 ${!this.noIcon ? b$1`<sonic-icon library="custom" name="arrow-rotate-left"></sonic-icon>` : A$1} 24390 ${this.wording_expire} 24391 </span>`; 24392 } 24393 if (this.remaining_time_string) { 24394 return b$1`<span class="flex items-center gap-1" 24395 >${!this.noIcon ? b$1`<sonic-icon library="custom" name="clock" size="sm"></sonic-icon>` : A$1} 24396 ${this.remaining_time_string}</span 24397 >`; 24398 } 24399 return A$1; 24400 } 24401 }; 24402 SonicCartRemaining.styles = [ 24403 i$9` 24404 :host { 24405 display: inline-flex; 24406 align-items: center; 24407 min-width: 8ch; 24408 font-weight: bold; 24409 line-height: 1; 24410 gap: 0.25em; 24411 } 24412 24413 :host([badge]) { 24414 display: inline-flex; 24415 background-color: var(--sc-danger); 24416 color: var(--sc-danger-content); 24417 border-radius: 100px; 24418 padding: calc(1px + max(0.15em, 2.5px)) 0.4em max(0.15em, 2.5px); 24419 font-weight: bold; 24420 justify-content: center; 24421 align-items: center; 24422 line-height: 1; 24423 min-width: 8ch; 24424 font-family: "Roboto Mono", "Consolas", monospace; 24425 } 24426 24427 span { 24428 white-space: nowrap; 24429 display: flex; 24430 gap: 0.25em; 24431 } 24432 ` 24433 ]; 24434 __decorateClass$3r([ 24435 n$5({ type: Number }) 24436 ], SonicCartRemaining.prototype, "remaining_time", 2); 24437 __decorateClass$3r([ 24438 n$5({ type: Number }) 24439 ], SonicCartRemaining.prototype, "expired_at", 2); 24440 __decorateClass$3r([ 24441 n$5({ type: Boolean }) 24442 ], SonicCartRemaining.prototype, "noIcon", 2); 24443 __decorateClass$3r([ 24444 n$5({ type: Boolean }) 24445 ], SonicCartRemaining.prototype, "displayExpired", 2); 24446 __decorateClass$3r([ 24447 r$5() 24448 ], SonicCartRemaining.prototype, "expired", 2); 24449 __decorateClass$3r([ 24450 n$5({ type: String }) 24451 ], SonicCartRemaining.prototype, "remaining_time_string", 2); 24452 __decorateClass$3r([ 24453 n$5({ type: String }) 24454 ], SonicCartRemaining.prototype, "wording_expire", 2); 24455 SonicCartRemaining = __decorateClass$3r([ 24456 t$3("sonic-cart-remaining-time") 24457 ], SonicCartRemaining); 24458 var __defProp$3n = Object.defineProperty; 24459 var __getOwnPropDesc$3p = Object.getOwnPropertyDescriptor; 24460 var __decorateClass$3q = (decorators, target, key, kind) => { 24461 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3p(target, key) : target; 24462 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 24463 if (decorator = decorators[i2]) 24464 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 24465 if (kind && result) __defProp$3n(target, key, result); 24466 return result; 24467 }; 24468 let WaitingCart = class extends Subscriber$1(i$6) { 24469 constructor() { 24470 super(...arguments); 24471 this.link = null; 24472 } 24473 updateBadge() { 24474 this.publisher.invalidate(); 24475 } 24476 render() { 24477 if (this.link) { 24478 return b$1`<span> ! </span>`;
24479 } 24480 return A$1; 24481 } 24482 }; 24483 WaitingCart.styles = [ 24484 tailwind, 24485 i$9` 24486 :host { 24487 display: inline-flex; 24488 font-size: clamp(10px, 0.5em, 1rem); 24489 background-color: var(--sc-danger); 24490 color: var(--sc-danger-content); 24491 border-radius: 100px; 24492 width: 1.5em; 24493 height: 1.5em; 24494 font-weight: bold; 24495 justify-content: center; 24496 align-items: center; 24497 line-height: 1; 24498 white-space: nowrap; /* fix bug #42622 */ 24499 } 24500 ` 24501 ]; 24502 __decorateClass$3q([ 24503 n$5({ type: String }) 24504 ], WaitingCart.prototype, "link", 2); 24505 __decorateClass$3q([ 24506 onAssign$1("cart/current.data.quantity") 24507 ], WaitingCart.prototype, "updateBadge", 1); 24508 WaitingCart = __decorateClass$3q([ 24509 t$3("sonic-waiting-cart") 24510 ], WaitingCart); 24511 const r = (r2, o2, t2) => { 24512 for (const t3 of o2) if (t3[0] === r2) return (0, t3[1])(); 24513 return t2?.(); 24514 }; 24515 function* o(o2, t2) { 24516 const f2 = "function" == typeof t2; 24517 if (void 0 !== o2) { 24518 let i2 = -1; 24519 for (const n2 of o2) i2 > -1 && (yield f2 ? t2(i2) : t2), i2++, yield n2; 24520 } 24521 } 24522 var __decorate$s = function(decorators, target, key, desc) { 24523 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 24524 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 24525 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 24526 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 24527 }; 24528 const tagName$2b = "sonic-menu-item"; 24529 let MenuItem = class MenuItem extends Button { 24530 constructor() { 24531 super(); 24532 } 24533 connectedCallback() { 24534 if (!this.hasAttribute("variant")) { 24535 this.variant = "ghost"; 24536 } 24537 if (!this.hasAttribute("type")) { 24538 this.type = "default"; 24539 } 24540 if (!this.hasAttribute("shape")) { 24541 this.shape = "block"; 24542 } 24543 const isSquareOrCircle = this.shape === "square" || this.shape === "circle"; 24544 if (!this.hasAttribute("align") && !isSquareOrCircle) { 24545 this.align = "left"; 24546 } 24547 super.connectedCallback(); 24548 } 24549 }; 24550 MenuItem = __decorate$s([ 24551 t$3(tagName$2b) 24552 ], MenuItem); 24553 var __defProp$3m = Object.defineProperty; 24554 var __getOwnPropDesc$3o = Object.getOwnPropertyDescriptor; 24555 var __decorateClass$3p = (decorators, target, key, kind) => { 24556 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3o(target, key) : target; 24557 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 24558 if (decorator = decorators[i2]) 24559 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 24560 if (kind && result) __defProp$3m(target, key, result); 24561 return result; 24562 }; 24563 const tagName$2a = "sonic-form-event-category-item"; 24564 let SonicFormEventCategoryItem = class extends Subscriber$1(i$6) { 24565 constructor() { 24566 super(...arguments); 24567 this.title = ""; 24568 this.id = ""; 24569 this.display = false; 24570 this.filter = false; 24571 this.type = "filter"; 24572 this.size = "inherit"; 24573 } 24574 render() { 24575 if (this.type === "display" && !this.display) return A$1; 24576 if (this.type === "filter" && !this.filter) return A$1; 24577 return b$1`<sonic-menu-item 24578 .size=${this.size || "sm"} 24579 type="default" 24580 radio 24581 value="${this.id}" 24582 id="category_${this.id}" 24583 name="ids_category" 24584 > 24585 ${this.title} 24586 </sonic-menu-item>`; 24587 } 24588 }; 24589 __decorateClass$3p([ 24590 n$5({ type: String }) 24591 ], SonicFormEventCategoryItem.prototype, "title", 2); 24592 __decorateClass$3p([ 24593 n$5({ type: String }) 24594 ], SonicFormEventCategoryItem.prototype, "id", 2); 24595 __decorateClass$3p([ 24596 n$5({ type: Boolean }) 24597 ], SonicFormEventCategoryItem.prototype, "display", 2); 24598 __decorateClass$3p([ 24599 n$5({ type: Boolean }) 24600 ], SonicFormEventCategoryItem.prototype, "filter", 2); 24601 __decorateClass$3p([ 24602 n$5({ type: String }) 24603 ], SonicFormEventCategoryItem.prototype, "type", 2); 24604 __decorateClass$3p([ 24605 n$5({ type: String }) 24606 ], SonicFormEventCategoryItem.prototype, "size", 2); 24607 SonicFormEventCategoryItem = __decorateClass$3p([ 24608 t$3(tagName$2a) 24609 ], SonicFormEventCategoryItem); 24610 const shadowable = i$9` 24611 /*OMBRE*/ 24612 :host([shadow]) .shadowable, 24613 :host([shadow="md"]) .shadowable, 24614 :host([shadow="true"]) .shadowable { 24615 box-shadow: var(--sc-shadow); 24616 } 24617 24618 :host([shadow="sm"]) .shadowable { 24619 box-shadow: var(--sc-shadow-sm); 24620 } 24621 24622 :host([shadow="lg"]) .shadowable { 24623 box-shadow: var(--sc-shadow-lg); 24624 } 24625 24626 :host([shadow="none"]) .shadowable { 24627 box-shadow: none; 24628 } 24629`; 24630 var __decorate$r = function(decorators, target, key, desc) { 24631 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 24632 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 24633 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 24634 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 24635 }; 24636 var Pop_1; 24637 const tagName$29 = "sonic-pop"; 24638 let Pop = Pop_1 = class Pop extends i$6 { 24639 constructor() { 24640 super(...arguments); 24641 this.open = false;
24642 this.noToggle = false; 24643 this.inline = false; 24644 this.manual = false; 24645 this.shadow = "lg"; 24646 this.placement = "bottom"; 24647 this.positioningRuns = false; 24648 this.lastContentX = 0; 24649 this.lastContentY = 0; 24650 this.resizeObserver = new ResizeObserver(() => this.computePosition(this.placement)); 24651 this.triggerElement = null; 24652 this.ancestorsHavingZIndex = /* @__PURE__ */ new Set(); 24653 this._handleKeyDown = (e2) => { 24654 if (e2.key === "Escape" && this.open) { 24655 e2.stopPropagation(); 24656 this.hide(); 24657 } 24658 }; 24659 } 24660 runPositioningLoop() { 24661 if (!this.positioningRuns) 24662 return; 24663 this.positioningRuns = true; 24664 this.computePosition(this.placement); 24665 window.requestAnimationFrame(() => this.runPositioningLoop()); 24666 } 24667 toggle(e2) { 24668 if (this.open && this.noToggle) 24669 return; 24670 const keyboardEvent = e2; 24671 if (e2.type == "keydown" && (keyboardEvent.key != "ArrowDown" || this.open)) 24672 return; 24673 if (!this.open) { 24674 this.triggerElement = e2.target; 24675 } 24676 this.open = !this.open; 24677 this.open ? this.show() : this.hide(); 24678 } 24679 show() { 24680 this.setMaxZindex(); 24681 this.popContent?.style?.removeProperty("display"); 24682 this.open = true; 24683 this.popContent.setAttribute("tabindex", "0"); 24684 if (this.popBtn && this.popContent && !this.positioningRuns) { 24685 this.positioningRuns = true; 24686 this.lastContentX = 0; 24687 this.lastContentY = 0; 24688 this.runPositioningLoop(); 24689 } 24690 this.dispatchEvent(new CustomEvent("show")); 24691 } 24692 hide() { 24693 this.resetZindexes(); 24694 this.open = false; 24695 this.popContent.setAttribute("tabindex", "-1"); 24696 this.positioningRuns = false; 24697 if (this.triggerElement) { 24698 this.triggerElement.focus(); 24699 this.triggerElement = null; 24700 } 24701 Object.assign(this.popContent.style, { 24702 left: `${this.lastContentX}px`, 24703 top: `${this.lastContentY}px` 24704 }); 24705 this.dispatchEvent(new CustomEvent("hide")); 24706 } 24707 setMaxZindex() { 24708 HTML$1.everyAncestors(this, (parent) => { 24709 const htmlElement = parent; 24710 if (!htmlElement.className) 24711 return true; 24712 if ([...htmlElement.classList].includes("@container")) { 24713 const style = htmlElement.style; 24714 style.zIndex = "999999999"; 24715 const computedStyle = getComputedStyle(htmlElement); 24716 if (computedStyle.position !== "relative" && computedStyle.position !== "absolute") { 24717 style.position = "relative"; 24718 } 24719 this.ancestorsHavingZIndex.add(parent); 24720 return false; 24721 } 24722 return true; 24723 }); 24724 } 24725 resetZindexes() { 24726 this.ancestorsHavingZIndex.forEach((elt) => { 24727 elt.style.removeProperty("position"); 24728 elt.style.removeProperty("z-index"); 24729 }); 24730 this.ancestorsHavingZIndex.clear(); 24731 } 24732 _handleClosePop(e2) { 24733 const path = e2.composedPath(); 24734 const target = path[0]; 24735 Pop_1.pops.forEach((pop) => { 24736 const popContainsTarget = path.includes(pop); 24737 const popContentContainsTarget = path.includes(pop.querySelector('[slot="content"]')); 24738 const isCloseManual = HTML$1.getAncestorAttributeValue(target, "data-on-select") === "keep"; 24739 if (e2.type == "pointerdown" && popContainsTarget) 24740 return; 24741 if (e2.type == "click" && (popContainsTarget && isCloseManual || !popContentContainsTarget)) 24742 return; 24743 pop.hide(); 24744 }); 24745 } 24746 connectedCallback() { 24747 super.connectedCallback(); 24748 if (Pop_1.pops.size == 0) { 24749 document.addEventListener("pointerdown", this._handleClosePop); 24750 document.addEventListener("click", this._handleClosePop); 24751 document.addEventListener("keydown", this._handleKeyDown); 24752 } 24753 Pop_1.pops.add(this); 24754 } 24755 // /* 24756 // On attends le premier rendu pour observer les changements de taille car popup content n'est pas encore défini sinon 24757 // */ 24758 firstUpdated(_changedProperties) { 24759 super.firstUpdated(_changedProperties); 24760 this.resizeObserver.observe(this.popContent); 24761 } 24762 disconnectedCallback() { 24763 if (this.popContent) { 24764 this.resizeObserver.unobserve(this.popContent); 24765 } 24766 super.disconnectedCallback(); 24767 Pop_1.pops.delete(this); 24768 if (Pop_1.pops.size == 0) { 24769 document.removeEventListener("pointerdown", this._handleClosePop); 24770 document.removeEventListener("click", this._handleClosePop); 24771 document.removeEventListener("keydown", this._handleKeyDown); 24772 } 24773 } 24774 computePosition(placement) { 24775 const placementSplit = placement.split(" "); 24776 const placementBase = placementSplit[0]; 24777 let placementSec = placementSplit[1]; 24778 const padding = 5; 24779 const thisRect = this.getBoundingClientRect(); 24780 const scrollableAncestor = HTML$1.getScrollableAncestor(this.popContent); 24781 const scrollableAncestorRect = scrollableAncestor?.getBoundingClientRect(); 24782 const minX = Math.max(0, scrollableAncestorRect?.left || 0) + padding; 24783 const minY = Math.max(0, scrollableAncestorRect?.top || 0) + padding; 24784 const maxX = Math.min(window.innerWidth, scrollableAncestorRect?.right || window.innerWidth) - padding; 24785 const maxY = Math.min(window.innerHeight, scrollableAncestorRect?.bottom || window.innerHeight) - padding; 24786 const x0 = thisRect.left; 24787 const y0 = thisRect.top;
24788 let x2 = x0, y2 = y0; 24789 let contentRect = this.popContent?.getBoundingClientRect(); 24790 const yTop = y0 - contentRect.height; 24791 const xLeft = x0 - contentRect.width; 24792 const xRight = x0 + thisRect.width; 24793 const yBottom = y0 + thisRect.height; 24794 const xCenter = x0 + (thisRect.width - contentRect.width) * 0.5; 24795 const yCenter = y0 + (thisRect.height - contentRect.height) * 0.5; 24796 switch (placementBase) { 24797 case "bottom": 24798 y2 = yBottom; 24799 if (placementSec == "center") { 24800 x2 = xCenter; 24801 } 24802 break; 24803 case "top": 24804 y2 = yTop; 24805 if (placementSec == "center") { 24806 x2 = xCenter; 24807 } 24808 break; 24809 case "left": 24810 x2 = xLeft; 24811 if (placementSec == "center") { 24812 y2 = yCenter; 24813 } 24814 break; 24815 case "right": 24816 x2 = xRight; 24817 if (placementSec == "center") { 24818 y2 = yCenter; 24819 } 24820 break; 24821 } 24822 this.lastContentX += x2 - contentRect.x; 24823 this.lastContentY += y2 - contentRect.y; 24824 Object.assign(this.popContent.style, { 24825 left: `${this.lastContentX}px`, 24826 top: `${this.lastContentY}px` 24827 }); 24828 contentRect = this.popContent?.getBoundingClientRect(); 24829 if (contentRect.x < minX && placementBase == "left") 24830 x2 = xRight; 24831 if (contentRect.y < minY && placementBase == "top") 24832 y2 = yBottom; 24833 if (contentRect.x + contentRect.width > maxX && placementBase == "right") 24834 x2 = xLeft; 24835 if (contentRect.y + contentRect.height > maxY && placementBase == "bottom") 24836 y2 = yTop; 24837 this.lastContentX += x2 - contentRect.x; 24838 this.lastContentY += y2 - contentRect.y; 24839 Object.assign(this.popContent.style, { 24840 left: `${this.lastContentX}px`, 24841 top: `${this.lastContentY}px` 24842 }); 24843 contentRect = this.popContent?.getBoundingClientRect(); 24844 if (contentRect.x < minX) { 24845 this.lastContentX += minX - contentRect.x; 24846 } 24847 if (contentRect.y < minY) { 24848 this.lastContentY += minY - contentRect.y; 24849 } 24850 Object.assign(this.popContent.style, { 24851 left: `${this.lastContentX}px`, 24852 top: `${this.lastContentY}px` 24853 }); 24854 contentRect = this.popContent?.getBoundingClientRect(); 24855 if (contentRect.x + contentRect.width > maxX) { 24856 this.lastContentX += maxX - (contentRect.x + contentRect.width); 24857 } 24858 if (contentRect.y + contentRect.height > maxY) { 24859 this.lastContentY += maxY - (contentRect.y + contentRect.height); 24860 } 24861 Object.assign(this.popContent.style, { 24862 left: `${this.lastContentX}px`, 24863 top: `${this.lastContentY}px` 24864 }); 24865 } 24866 render() { 24867 return b$1` 24868 <slot 24869 @click=${this.manual ? () => { 24870 } : this.toggle} 24871 @keydown=${this.manual ? () => { 24872 } : this.toggle} 24873 class="contents" 24874 ></slot> 24875 <slot 24876 name="content" 24877 tabindex="-1" 24878 part="content" 24879 style="display: none;" 24880 class="shadowable 24881 ${this.open ? "is-open" : ""}" 24882 ></slot> 24883 `; 24884 } 24885 }; 24886 Pop.pops = /* @__PURE__ */ new Set(); 24887 Pop.styles = [ 24888 i$9` 24889 :host { 24890 display: inline-block; 24891 vertical-align: middle; 24892 } 24893 24894 slot[name="content"] { 24895 max-width: 100vw; 24896 background-color: var(--sc-base, #fff); 24897 position: fixed; 24898 z-index: 99999; 24899 display: block; 24900 transform: translateY(1rem) scale(0.95); 24901 opacity: 0; 24902 pointer-events: none; 24903 transition-duration: 0.15s; 24904 transition-timing-function: ease; 24905 transition-property: all; 24906 border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em); 24907 } 24908 24909 slot[name="content"].is-open:not(.is-empty) { 24910 transform: translateY(0) scale(1); 24911 opacity: 1; 24912 pointer-events: auto; 24913 transition-property: scale, opacity; 24914 transition-timing-function: cubic-bezier(0.25, 0.25, 0.42, 1.225); 24915 } 24916 24917 :host([inline]) { 24918 vertical-align: baseline; 24919 } 24920 `, 24921 shadowable 24922 ]; 24923 __decorate$r([ 24924 r$5() 24925 ], Pop.prototype, "open", void 0); 24926 __decorate$r([ 24927 e$7("slot:not([name=content])") 24928 ], Pop.prototype, "popBtn", void 0); 24929 __decorate$r([ 24930 e$7("slot[name=content]") 24931 ], Pop.prototype, "popContent", void 0); 24932 __decorate$r([ 24933 n$5({ type: Boolean }) 24934 ], Pop.prototype, "noToggle", void 0); 24935 __decorate$r([ 24936 n$5({ type: Boolean, reflect: true }) 24937 ], Pop.prototype, "inline", void 0); 24938 __decorate$r([ 24939 n$5({ type: Boolean }) 24940 ], Pop.prototype, "manual", void 0); 24941 __decorate$r([ 24942 n$5({ type: String, reflect: true }) 24943 ], Pop.prototype, "shadow", void 0); 24944 __decorate$r([ 24945 n$5({ type: String }) 24946 ], Pop.prototype, "placement", void 0); 24947 __decorate$r([ 24948 r$5() 24949 ], Pop.prototype, "triggerElement", void 0); 24950 Pop = Pop_1 = __decorate$r([ 24951 t$3(tagName$29) 24952 ], Pop); 24953 var __decorate$q = function(decorators, target, key, desc) { 24954 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 24955 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 24956 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 24957 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 24958 }; 24959 const queryAssignedElements = (options) => { 24960 return o$8(options); 24961 }; 24962 const tagName$28 = "sonic-menu"; 24963 let MenuItems = class MenuItems extends i$6 { 24964 constructor() { 24965 super(...arguments); 24966 this.direction = "column"; 24967 this.gap = "var(--sc-menu-gap)"; 24968 this.align = "left"; 24969 this.shadow = null; 24970 this.moreShape = "circle"; 24971 this.scrollable = false;
24972 this.observer = null; 24973 this.attributeObserver = null; 24974 this.minWidth = "0"; 24975 this.hasMoreElements = false; 24976 this.handleScrollEnd = () => { 24977 this.setScrollShadow(this.menuContent, this.direction); 24978 }; 24979 this.updateIsScollable = () => { 24980 if (this.scrollable) { 24981 this.initScrollable(); 24982 this.setScrollShadow(this.menuContent, this.direction); 24983 } 24984 }; 24985 } 24986 checkIfMore() { 24987 this.hasMoreElements = !!this.moreElements?.length; 24988 } 24989 moreSlotChange() { 24990 this.checkIfMore(); 24991 this.updateIsScollable(); 24992 } 24993 updated(_changedProperties) { 24994 const moreBtn = this.querySelector(".more-btn"); 24995 if (this.size && moreBtn) { 24996 moreBtn.setAttribute("size", this.size); 24997 } 24998 super.updated(_changedProperties); 24999 } 25000 setDividersSize(assignedElements) { 25001 assignedElements.forEach((elt) => { 25002 elt.setAttribute("size", "sm"); 25003 this.direction == "row" ? elt.style.setProperty("margin", "0 .1rem ") : elt.style.setProperty("margin", " 0.1rem 0"); 25004 }); 25005 } 25006 mainSlotChange() { 25007 this.setChildrenSize(this.menuChildren); 25008 this.setDividersSize(this.menuChildren); 25009 this.updateIsScollable(); 25010 this.updateScrollPosition(); 25011 this.observeMenuItemsAttributes(); 25012 } 25013 observeMenuItemsAttributes() { 25014 this.attributeObserver?.disconnect(); 25015 this.attributeObserver = new MutationObserver(() => { 25016 this.updateScrollPosition(); 25017 }); 25018 this.menuChildren.forEach((item) => { 25019 this.attributeObserver.observe(item, { 25020 attributes: true, 25021 attributeFilter: ["active"] 25022 }); 25023 }); 25024 } 25025 updateScrollPosition() { 25026 if (this.scrollable) { 25027 const activeItems = this.menuChildren.filter((item) => item.hasAttribute("active") && item.getAttribute("active") !== "false"); 25028 if (activeItems.length === 1) { 25029 requestAnimationFrame(() => { 25030 activeItems[0].scrollIntoView({ 25031 behavior: "smooth", 25032 block: "nearest", 25033 inline: "center" 25034 }); 25035 }); 25036 } 25037 } 25038 } 25039 connectedCallback() { 25040 this.observer = new ResizeObserver(this.updateIsScollable); 25041 this.observer.observe(this); 25042 super.connectedCallback(); 25043 } 25044 firstUpdated(_changedProperties) { 25045 this.menuContent.addEventListener("scrollend", this.handleScrollEnd); 25046 } 25047 disconnectedCallback() { 25048 this.observer?.disconnect(); 25049 this.attributeObserver?.disconnect(); 25050 this.menuContent.removeEventListener("scrollend", this.handleScrollEnd); 25051 super.disconnectedCallback(); 25052 } 25053 initScrollable() { 25054 let isDown = false; 25055 let startX; 25056 let scrollLeft; 25057 if (this.scrollable) { 25058 this.addEventListener("mousedown", (e2) => { 25059 isDown = true; 25060 this.classList.add("active"); 25061 startX = e2.pageX - this.menuContent.offsetLeft; 25062 scrollLeft = this.menuContent.scrollLeft; 25063 }); 25064 this.addEventListener("mouseleave", () => { 25065 isDown = false; 25066 this.classList.remove("active"); 25067 }); 25068 this.addEventListener("mouseup", () => { 25069 isDown = false; 25070 this.classList.remove("active"); 25071 }); 25072 this.addEventListener("mousemove", (e2) => { 25073 if (!isDown) 25074 return; 25075 e2.preventDefault(); 25076 const x2 = e2.pageX - this.menuContent.offsetLeft; 25077 const walk = (x2 - startX) * 1.5; 25078 this.menuContent.scrollLeft = scrollLeft - walk; 25079 this.setScrollShadow(this.menuContent, this.direction); 25080 }); 25081 this.addEventListener("scroll", (e2) => { 25082 e2.preventDefault(); 25083 this.setScrollShadow(this.menuContent, this.direction); 25084 }); 25085 } 25086 } 25087 setScrollShadow(target, direction) { 25088 if (direction == "row") { 25089 if (target.scrollLeft > 0) { 25090 this.classList.add("shadow-left"); 25091 } else { 25092 this.classList.remove("shadow-left"); 25093 } 25094 if (target.scrollLeft < target.scrollWidth - target.offsetWidth) { 25095 this.classList.add("shadow-right"); 25096 } else { 25097 this.classList.remove("shadow-right"); 25098 } 25099 } else if (direction == "column") { 25100 if (target.scrollTop > 0) { 25101 this.classList.add("shadow-top"); 25102 } else { 25103 this.classList.remove("shadow-top"); 25104 } 25105 if (target.scrollTop < target.scrollHeight - (target.offsetHeight + 1)) { 25106 this.classList.add("shadow-bottom"); 25107 } else { 25108 this.classList.remove("shadow-bottom"); 25109 } 25110 } 25111 } 25112 setChildrenSize(menuItems) {
25113 menuItems.forEach((elt) => { 25114 if (this.size) { 25115 elt.setAttribute("size", this.size); 25116 } 25117 if (this.align) { 25118 if (elt.getAttribute("shape") != "square" && elt.getAttribute("shape") != "circle") { 25119 elt.setAttribute("align", this.align); 25120 } 25121 } 25122 if (this.direction == "row") { 25123 if (elt.getAttribute("shape") == "block") { 25124 elt.setAttribute("shape", "default"); 25125 } 25126 } 25127 }); 25128 } 25129 render() { 25130 const menuStyles = { 25131 minWidth: this.minWidth, 25132 flexDirection: this.direction 25133 }; 25134 const isMenuRow = this.direction == "row"; 25135 const menuContentStyles = { 25136 gap: this.gap, 25137 flexDirection: this.direction 25138 }; 25139 const popStyles = { 25140 display: "block", 25141 alignSelf: isMenuRow ? "center" : "flex-start", 25142 justifySelf: "center", 25143 flexDirection: this.direction 25144 }; 25145 const popBtnStyles = { 25146 marginLeft: isMenuRow ? "" : ".55em" 25147 }; 25148 return b$1`<menu 25149 part="menu" 25150 class="shadowable" 25151 style=${o$3(menuStyles)} 25152 > 25153 <slot 25154 @slotchange=${this.mainSlotChange} 25155 id="menu-content" 25156 style=${o$3(menuContentStyles)} 25157 ></slot> 25158 <sonic-pop 25159 style=${o$3(popStyles)} 25160 class=${!this.hasMoreElements ? "hidden" : ""} 25161 > 25162 <sonic-menu-item 25163 style=${o$3(popBtnStyles)} 25164 class="more-btn" 25165 shape=${this.moreShape} 25166 align="center" 25167 > 25168 <sonic-icon 25169 size="xl" 25170 name=${isMenuRow ? "more-vert" : "more-horiz"} 25171 ></sonic-icon> 25172 </sonic-menu-item> 25173 <slot 25174 name="more" 25175 @slotchange=${this.moreSlotChange} 25176 slot="content" 25177 ></slot> 25178 </sonic-pop> 25179 </menu>`; 25180 } 25181 }; 25182 MenuItems.styles = [ 25183 i$9` 25184 :host { 25185 display: block; 25186 --sc-menu-gap: 0.15rem; 25187 } 25188 25189 :host > menu { 25190 display: flex; 25191 padding: 0; 25192 margin: 0; 25193 } 25194 25195 .hidden { 25196 display: none !important; 25197 } 25198 25199 /* SCROLLABLE*/ 25200 #menu-content { 25201 display: flex; 25202 padding: 0.35em; 25203 margin: 0; 25204 } 25205 25206 :host([scrollable]) #menu-content { 25207 scrollbar-width: none; 25208 max-width: 100%; 25209 -ms-overflow-style: none; 25210 scroll-snap-align: start; 25211 white-space: nowrap; 25212 border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em); 25213 transition: mask-image 0.15s linear; 25214 } 25215 25216 :host([scrollable][direction="row"]) #menu-content { 25217 overflow-x: scroll; 25218 scroll-snap-align: start; 25219 scroll-snap-type: x mandatory; 25220 } 25221 :host([scrollable][direction="column"]) #menu-content { 25222 overflow-y: scroll; 25223 scroll-snap-align: start; 25224 scroll-snap-type: y mandatory; 25225 } 25226 :host([scrollable])::-webkit-scrollbar {
25227 display: none !important; 25228 } 25229 :host([scrollable][direction="row"].shadow-right) #menu-content { 25230 -webkit-mask-image: linear-gradient( 25231 to left, 25232 rgba(0, 0, 0, 0), 25233 rgba(0, 0, 0, 1) 10% 25234 ); 25235 mask-image: linear-gradient( 25236 to left, 25237 rgba(0, 0, 0, 0), 25238 rgba(0, 0, 0, 1) 10% 25239 ); 25240 } 25241 :host([scrollable][direction="row"].shadow-left) #menu-content { 25242 -webkit-mask-image: linear-gradient( 25243 to right, 25244 rgba(0, 0, 0, 0), 25245 rgba(0, 0, 0, 1) 10% 25246 ); 25247 mask-image: linear-gradient( 25248 to right, 25249 rgba(0, 0, 0, 0), 25250 rgba(0, 0, 0, 1) 10% 25251 ); 25252 } 25253 :host([scrollable][direction="row"].shadow-left.shadow-right) 25254 #menu-content { 25255 -webkit-mask-image: linear-gradient( 25256 to right, 25257 rgba(0, 0, 0, 0) 0%, 25258 rgba(0, 0, 0, 1) 10%, 25259 rgba(0, 0, 0, 1) 90%, 25260 rgba(0, 0, 0, 0) 100% 25261 ); 25262 mask-image: linear-gradient( 25263 to right, 25264 rgba(0, 0, 0, 0) 0%, 25265 rgba(0, 0, 0, 1) 10%, 25266 rgba(0, 0, 0, 1) 90%, 25267 rgba(0, 0, 0, 0) 100% 25268 ); 25269 } 25270 :host([scrollable][direction="column"].shadow-top) #menu-content { 25271 -webkit-mask-image: linear-gradient( 25272 to bottom, 25273 rgba(0, 0, 0, 0), 25274 rgba(0, 0, 0, 1) 10% 25275 );queryAssignedElements 25276 mask-image: linear-gradient( 25277 to bottom, 25278 rgba(0, 0, 0, 0), 25279 rgba(0, 0, 0, 1) 10% 25280 ); 25281 } 25282 :host([scrollable][direction="column"].shadow-bottom) #menu-content { 25283 -webkit-mask-image: linear-gradient( 25284 to top, 25285 rgba(0, 0, 0, 0), 25286 rgba(0, 0, 0, 1) 10% 25287 ); 25288 mask-image: linear-gradient( 25289 to top, 25290 rgba(0, 0, 0, 0), 25291 rgba(0, 0, 0, 1) 10% 25292 ); 25293 } 25294 :host([scrollable][direction="column"].shadow-top.shadow-bottom) 25295 #menu-content { 25296 -webkit-mask-image: linear-gradient( 25297 to top, 25298 rgba(0, 0, 0, 0) 0%, 25299 rgba(0, 0, 0, 1) 10%, 25300 rgba(0, 0, 0, 1) 90%, 25301 rgba(0, 0, 0, 0) 100% 25302 ); 25303 mask-image: linear-gradient( 25304 to bottom, 25305 rgba(0, 0, 0, 0) 0%, 25306 rgba(0, 0, 0, 1) 10%, 25307 rgba(0, 0, 0, 1) 90%, 25308 rgba(0, 0, 0, 0) 100% 25309 ); 25310 } 25311 `, 25312 shadowable 25313 ]; 25314 __decorate$q([ 25315 n$5({ type: String, reflect: true }) 25316 ], MenuItems.prototype, "size", void 0); 25317 __decorate$q([ 25318 n$5({ type: String, reflect: true }) 25319 ], MenuItems.prototype, "direction", void 0); 25320 __decorate$q([ 25321 n$5({ type: String }) 25322 ], MenuItems.prototype, "gap", void 0); 25323 __decorate$q([ 25324 n$5({ type: String, reflect: true }) 25325 ], MenuItems.prototype, "align", void 0); 25326 __decorate$q([ 25327 n$5({ type: String, reflect: true }) 25328 ], MenuItems.prototype, "shadow", void 0); 25329 __decorate$q([ 25330 n$5({ type: String }) 25331 ], MenuItems.prototype, "moreShape", void 0); 25332 __decorate$q([ 25333 n$5({ type: Boolean }) 25334 ], MenuItems.prototype, "scrollable", void 0); 25335 __decorate$q([ 25336 n$5({ type: String }) 25337 ], MenuItems.prototype, "minWidth", void 0); 25338 __decorate$q([ 25339 e$7("menu") 25340 ], MenuItems.prototype, "menu", void 0); 25341 __decorate$q([ 25342 e$7("#menu-content") 25343 ], MenuItems.prototype, "menuContent", void 0); 25344 __decorate$q([ 25345 queryAssignedElements({ selector: "*" }) 25346 ], MenuItems.prototype, "menuChildren", void 0); 25347 __decorate$q([ 25348 queryAssignedElements({ slot: "more", selector: "*" }) 25349 ], MenuItems.prototype, "moreElements", void 0); 25350 __decorate$q([ 25351 r$5() 25352 ], MenuItems.prototype, "hasMoreElements", void 0); 25353 MenuItems = __decorate$q([ 25354 t$3(tagName$28) 25355 ], MenuItems); 25356 var __defProp$3l = Object.defineProperty; 25357 var __getOwnPropDesc$3n = Object.getOwnPropertyDescriptor; 25358 var __decorateClass$3o = (decorators, target, key, kind) => { 25359 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3n(target, key) : target; 25360 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 25361 if (decorator = decorators[i2]) 25362 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 25363 if (kind && result) __defProp$3l(target, key, result); 25364 return result; 25365 }; 25366 let SonicFormEventCategory = class extends Fetcher$1(Subscriber$1(i$6)) { 25367 constructor() { 25368 super(...arguments); 25369 this.dataProvider = "category"; 25370 this.hasCategory = false;
25371 this.onlyFilterCategories = []; 25372 this.data = null; 25373 } 25374 willUpdate(_changedProperties) { 25375 if (_changedProperties.has("data") && this.data) { 25376 this.onlyFilterCategories = this.data.filter((category) => category.filter === true); 25377 } else if (!this.data) { 25378 this.onlyFilterCategories = []; 25379 } 25380 super.willUpdate(_changedProperties); 25381 } 25382 render() { 25383 const isMobile = window?.innerWidth < 1024; 25384 return b$1` 25385 ${this.onlyFilterCategories?.length ? b$1`<sonic-pop> 25386 <div class="relative"> 25387 <sonic-button 25388 size="${this.size || "md"}" 25389 data-aria-label=${o$4(t("filter"))} 25390 .shape=${isMobile ? "square" : "default"} 25391 > 25392 ${isMobile ? b$1`<sonic-icon library="custom" prefix="regular" name="sliders"></sonic-icon>` : b$1`<sonic-icon library="custom" prefix="regular" name="sliders" slot="prefix"></sonic-icon> 25393 <span> ${t("filter")} </span> `} 25394 </sonic-button> 25395 ${this.hasCategory ? b$1` <sonic-badge class="absolute top-[-.3em] left-[.3em]" size="xs" type="danger"></sonic-badge>` : A$1} 25396 </div> 25397 <sonic-menu class="max-h-[45vh] lg:max-h-[50vh] overflow-auto" slot="content" minWidth="15rem"> 25398 <sonic-menu-item size=${this.size || "sm"} type="default" name="ids_category" value="" radio 25399 >${t("all_categories")}</sonic-menu-item 25400 > 25401 <sonic-list 25402 displayContents 25403 dataProvider="categories_filtered" 25404 .props=${this.onlyFilterCategories} 25405 .items=${() => b$1`<sonic-form-event-category-item size=${this.size || "sm"}></sonic-form-event-category-item>`} 25406 > 25407 </sonic-list> 25408 </sonic-menu> 25409 </sonic-pop>` : A$1} 25410 `; 25411 } 25412 }; 25413 SonicFormEventCategory.styles = [ 25414 tailwind, 25415 i$9` 25416 :host { 25417 display: block; 25418 } 25419 ` 25420 ]; 25421 __decorateClass$3o([ 25422 n$5({ type: Boolean }) 25423 ], SonicFormEventCategory.prototype, "hasCategory", 2); 25424 __decorateClass$3o([ 25425 n$5({ type: String }) 25426 ], SonicFormEventCategory.prototype, "size", 2); 25427 __decorateClass$3o([ 25428 r$5() 25429 ], SonicFormEventCategory.prototype, "onlyFilterCategories", 2); 25430 __decorateClass$3o([ 25431 r$5() 25432 ], SonicFormEventCategory.prototype, "data", 2); 25433 SonicFormEventCategory = __decorateClass$3o([ 25434 t$3("sonic-form-event-category") 25435 ], SonicFormEventCategory); 25436 var __defProp$3k = Object.defineProperty; 25437 var __getOwnPropDesc$3m = Object.getOwnPropertyDescriptor; 25438 var __decorateClass$3n = (decorators, target, key, kind) => { 25439 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3m(target, key) : target; 25440 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 25441 if (decorator = decorators[i2]) 25442 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 25443 if (kind && result) __defProp$3k(target, key, result); 25444 return result; 25445 }; 25446 let SonicFormEventDays = class extends Subscriber$1(i$6) { 25447 constructor() { 25448 super(...arguments); 25449 this.wording_tous = "Tous"; 25450 } 25451 render() { 25452 if (!this.props) return A$1; 25453 const days = Object.keys(this.props); 25454 return b$1` 25455 <sonic-menu class="inline-flex max-w-full" direction="row" scrollable> 25456 <sonic-menu-item 25457 variant="unstyled" 25458 radio 25459 name="day" 25460 value="" 25461 class="py-2 px-2 text-neutral-400 [&[active]]:font-bold [&[active]]:text-content hover:bg-neutral-100 transition-all rounded font-medium " 25462 > 25463 <span swap="on" class="leading-tight"> 25464 <sonic-icon library="iconoir" name="calendar"></sonic-icon> 25465 ${this.wording_tous} 25466 </span> 25467 <span swap="off" class="leading-tight"> 25468 <sonic-icon library="iconoir" name="calendar"></sonic-icon> 25469 ${this.wording_tous} 25470 </span> 25471 </sonic-menu-item> 25472 25473 ${days.length > 0 ? days.map( 25474 (day) => b$1`<sonic-form-event-days-day 25475 dataProvider="sonic-form-event-days-day/${day}" 25476 lazyRendering 25477 day=${day} 25478 ></sonic-form-event-days-day>` 25479 ) : A$1} 25480 </sonic-menu> 25481 `; 25482 } 25483 }; 25484 SonicFormEventDays.styles = [ 25485 i$9` 25486 :host { 25487 display: block; 25488 } 25489 `, 25490 tailwind 25491 ]; 25492 __decorateClass$3n([ 25493 n$5({ type: String }) 25494 ], SonicFormEventDays.prototype, "wording_tous", 2); 25495 SonicFormEventDays = __decorateClass$3n([ 25496 t$3("sonic-form-event-days") 25497 ], SonicFormEventDays); 25498 let SonicFormEventDaysDay = class extends Subscriber$1(i$6) { 25499 constructor() { 25500 super(...arguments); 25501 this.day = ""; 25502 } 25503 render() { 25504 const day = this.day; 25505 if (this.shouldRenderLazy) { 25506 return b$1`<div class="w-16"></div>`; 25507 } 25508 return b$1` <sonic-menu-item 25509 name="day" 25510 value=${day} 25511 type="default" 25512 variant="unstyled" 25513 radio 25514 class="py-2 px-2 leading-tight text-neutral-400 [&[active]]:font-bold [&[active]]:text-content hover:bg-neutral-100 transition-all rounded font-medium" 25515 > 25516 <sonic-date 25517 swap="on" 25518 designMode 25519 noShadowDom 25520 .date=${parseInt(day)} 25521 weekday="long" 25522 day="2-digit" 25523 month="short" 25524 hour="hidden" 25525 minute="hidden" 25526 second="hidden" 25527 year="numeric" 25528 > 25529 <template data-value="weekday">
25530 <span></span> 25531 </template> 25532 <template data-value="day"> 25533 <span class="uppercase font-bold"></span> 25534 </template> 25535 <template data-value="month"> 25536 <span class="font-bold capitalize"></span> 25537 </template> 25538 <template data-value="year"> 25539 <span class="uppercase font-bold hidden"></span> 25540 </template> 25541 </sonic-date> 25542 <sonic-date 25543 swap="off" 25544 designMode 25545 noShadowDom 25546 .date=${parseInt(day)} 25547 weekday="narrow" 25548 day="2-digit" 25549 month="short" 25550 hour="hidden" 25551 minute="hidden" 25552 second="hidden" 25553 year="2-digit" 25554 class="flex items-center" 25555 > 25556 <template data-value="weekday"> 25557 <span></span> 25558 </template> 25559 <template data-value="day"> 25560 <span class="uppercase"></span> 25561 </template> 25562 <template data-value="month"> 25563 <span class="hidden"></span> 25564 </template> 25565 <template data-value="year"> 25566 <span class="hidden"></span> 25567 </template> 25568 </sonic-date> 25569 </sonic-menu-item>`; 25570 } 25571 }; 25572 SonicFormEventDaysDay.styles = [ 25573 i$9` 25574 :host { 25575 display: block; 25576 } 25577 `, 25578 tailwind 25579 ]; 25580 __decorateClass$3n([ 25581 n$5({ type: String }) 25582 ], SonicFormEventDaysDay.prototype, "day", 2); 25583 SonicFormEventDaysDay = __decorateClass$3n([ 25584 t$3("sonic-form-event-days-day") 25585 ], SonicFormEventDaysDay); 25586 const e = e$5(class extends i$4 { 25587 constructor(t2) { 25588 if (super(t2), t2.type !== t$1.ATTRIBUTE || "class" !== t2.name || t2.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute."); 25589 } 25590 render(t2) { 25591 return " " + Object.keys(t2).filter((s2) => t2[s2]).join(" ") + " "; 25592 } 25593 update(s2, [i2]) { 25594 if (void 0 === this.st) { 25595 this.st = /* @__PURE__ */ new Set(), void 0 !== s2.strings && (this.nt = new Set(s2.strings.join(" ").split(/\s/).filter((t2) => "" !== t2))); 25596 for (const t2 in i2) i2[t2] && !this.nt?.has(t2) && this.st.add(t2); 25597 return this.render(i2); 25598 } 25599 const r2 = s2.element.classList; 25600 for (const t2 of this.st) t2 in i2 || (r2.remove(t2), this.st.delete(t2)); 25601 for (const t2 in i2) { 25602 const s3 = !!i2[t2]; 25603 s3 === this.st.has(t2) || this.nt?.has(t2) || (s3 ? (r2.add(t2), this.st.add(t2)) : (r2.remove(t2), this.st.delete(t2))); 25604 } 25605 return E; 25606 } 25607 }); 25608 var __decorate$p = function(decorators, target, key, desc) { 25609 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 25610 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 25611 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 25612 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 25613 }; 25614 const tagName$27 = "sonic-input"; 25615 let Input = class Input extends Form(Form$2(Subscriber$1(i$6))) { 25616 constructor() { 25617 super(...arguments); 25618 this.readonly = false; 25619 this.inlineContent = false; 25620 this.disableInlineContentFocus = false; 25621 this.showPasswordToggle = false; 25622 this.autoActive = false; 25623 this.active = false; 25624 this.hasDescription = false; 25625 this.hasLabel = false; 25626 this.hasSuffix = false; 25627 this.hasPrefix = false; 25628 this.isPassword = false; 25629 } 25630 connectedCallback() { 25631 super.connectedCallback(); 25632 this.hasSlotOrProps(); 25633 if (this.hasAttribute("sameValueAs")) { 25634 this.sameValueAsName = this.getAttribute("sameValueAs"); 25635 this.sameValueAsHandle = (v2) => this.pattern = this.escapeRegExp(v2); 25636 const formPublisher = this.getFormPublisher(); 25637 if (!formPublisher) 25638 return; 25639 formPublisher[this.sameValueAsName].onAssign(this.sameValueAsHandle); 25640 } 25641 if (this.type == "password") { 25642 this.isPassword = true; 25643 this.showPasswordToggle = true; 25644 this.inlineContent = true; 25645 } 25646 } 25647 disconnectedCallback() { 25648 super.disconnectedCallback(); 25649 if (this.hasAttribute("sameValueAs") && this.sameValueAsName) { 25650 const formPublisher = this.getFormPublisher(); 25651 if (!formPublisher) 25652 return; 25653 formPublisher[this.sameValueAsName].offAssign(this.sameValueAsHandle); 25654 } 25655 } 25656 escapeRegExp(string) { 25657 return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); 25658 } 25659 willUpdate(changedProperties) { 25660 this.hasSlotOrProps(); 25661 if (this.autoActive && changedProperties.has("value")) { 25662 this.active = !!this.value; 25663 } 25664 super.willUpdate(changedProperties); 25665 } 25666 setSelectionRange(start, end) { 25667 this.input.setSelectionRange(start, end); 25668 } 25669 hasSlotOrProps() { 25670 this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false;
25671 this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false; 25672 this.hasSuffix = this.slotSuffixNodes?.length ? true : false; 25673 this.hasPrefix = this.slotPrefixNodes?.length ? true : false; 25674 } 25675 inlineContentFocus() { 25676 if (!this.inlineContent || this.disableInlineContentFocus) 25677 return; 25678 this.input?.focus(); 25679 } 25680 handleChange(e2) { 25681 if (!this.hasAttribute("inputDelayMs")) { 25682 super.handleChange(e2); 25683 return; 25684 } 25685 if (this.changeTimeoutId) 25686 clearTimeout(this.changeTimeoutId); 25687 this.changeTimeoutId = setTimeout(() => super.handleChange(e2), parseInt(this.getAttribute("inputDelayMs"))); 25688 } 25689 // toggle password visibility 25690 togglePasswordVisibility(e2) { 25691 e2.preventDefault(); 25692 e2.stopPropagation(); 25693 this.isPassword = !this.isPassword; 25694 this._type = this.isPassword ? "password" : "text"; 25695 } 25696 /** 25697 * Code a réfléchir et tester a l'occasion : 25698 * le changement programmatique de la valeur de l'input ne renvoie pas d'événement change. 25699 * On pourrait le faire en surchargeant la propriété value de l'input. 25700 */ 25701 // protected firstUpdated(_changedProperties: PropertyValues): void { 25702 // super.firstUpdated(_changedProperties); 25703 // const descriptor = Object.getOwnPropertyDescriptor( 25704 // HTMLInputElement.prototype, 25705 // "value" 25706 // ); 25707 // const that = this; 25708 // Object.defineProperty(this.input, "value", { 25709 // get() { 25710 // return descriptor?.get?.call(this); 25711 // }, 25712 // set(val) { 25713 // const oldValue = this.value; 25714 // if (val !== oldValue) { 25715 // descriptor?.set?.call(this, val); 25716 // that.input.dispatchEvent(new Event("input")); 25717 // } 25718 // }, 25719 // }); 25720 // } 25721 render() { 25722 const slotClasses = { 25723 "has-prefix": this.hasPrefix, 25724 "has-suffix": this.hasSuffix, 25725 "no-suffix": !this.hasSuffix, 25726 "no-prefix": !this.hasPrefix 25727 }; 25728 return b$1` 25729 <label for="${this.id || "form-element"}" class="${this.hasLabel ? "form-label" : "hidden"}" 25730 >${this.label ? o$6( 25731 this.label 25732 /*+ labelStarSuffix*/ 25733 ) : ""}<slot 25734 name="label" 25735 @slotchange=${this.hasSlotOrProps} 25736 ></slot 25737 ></label> 25738 25739 <div @click=${this.inlineContentFocus} class="form-control ${e(slotClasses)}"> 25740 <div part="content" class="${this.inlineContent ? "form-element form-element-wrapper" : "contents"}"> 25741 <slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot> 25742 <input 25743 data-form-element 25744 part="input" 25745 id=${o$4(this.id || "form-element")} 25746 part="input" 25747 class="form-element input" 25748 @input=${this.handleChange} 25749 @blur=${this.handleBlur} 25750 type=${this.type} 25751 ?disabled=${this.disabled} 25752 ?readonly=${this.readonly} 25753 ?autofocus=${this.autofocus} 25754 list=${o$4(this.list)} 25755 tabindex=${o$4(this.tabindex)} 25756 pattern=${o$4(this.pattern)} 25757 min=${o$4(this.min)} 25758 max=${o$4(this.max)} 25759 step=${o$4(this.step)} 25760 inputmode=${o$4(this.inputmode)} 25761 src=${o$4(this.src)} 25762 minlength=${o$4(this.minlength)} 25763 maxlength=${o$4(this.maxlength)} 25764 placeholder=${o$4(this.placeholder)} 25765 ?required=${this.required} 25766 autocomplete=${o$4(this.autocomplete)} 25767 aria-label=${o$4(this.ariaLabel)} 25768 aria-labelledby=${o$4(this.ariaLabelledby)} 25769 .name=${this.name} 25770 .value=${this.value} 25771 /> 25772 ${this.showPasswordToggle ? b$1`<sonic-button 25773 shape="circle" 25774 class="password-toggle" 25775 @click=${this.togglePasswordVisibility} 25776 data-aria-label="Toggle password visibility" 25777 variant="unstyled" 25778 > 25779 <sonic-icon 25780 library="heroicons" 25781 name=${this.isPassword ? "eye" : "eye-slash"} 25782 ></sonic-icon> 25783 </sonic-button>` : ""} 25784 <slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot> 25785 </div> 25786 </div> 25787 25788 <!-- le slot ne doit pas avoir d'espace--> 25789 <slot 25790 name="description" 25791 @slotchange=${this.hasSlotOrProps} 25792 class="${this.hasDescription ? "form-description" : "hidden"}" 25793 >${this.description ? b$1`${o$6(this.description)}` : A$1}</slot> 25794 <slot name="list"></slot> 25795 </div> 25796 `; 25797 } 25798 }; 25799 Input.styles = [ 25800 fontSize, 25801 formControl, 25802 label, 25803 description, 25804 passwordToggle, 25805 i$9` 25806 :host([type="hidden"]) { 25807 appearance: none !important; 25808 display: none !important; 25809 } 25810 :host > .form-control { 25811 position: relative; 25812 } 25813 ` 25814 ]; 25815 __decorate$p([ 25816 n$5({ type: String, reflect: true }) 25817 ], Input.prototype, "size", void 0); 25818 __decorate$p([ 25819 n$5({ type: String }) 25820 ], Input.prototype, "inputmode", void 0); 25821 __decorate$p([ 25822 n$5({ type: String }) 25823 ], Input.prototype, "list", void 0); 25824 __decorate$p([ 25825 n$5({ type: String }) 25826 ], Input.prototype, "placeholder", void 0); 25827 __decorate$p([ 25828 n$5({ type: String }) 25829 ], Input.prototype, "pattern", void 0); 25830 __decorate$p([ 25831 n$5({ type: String }) 25832 ], Input.prototype, "min", void 0); 25833 __decorate$p([ 25834 n$5({ type: String }) 25835 ], Input.prototype, "max", void 0); 25836 __decorate$p([ 25837 n$5({ type: Boolean, reflect: true }) 25838 ], Input.prototype, "readonly", void 0); 25839 __decorate$p([ 25840 n$5({ type: Number }) 25841 ], Input.prototype, "step", void 0); 25842 __decorate$p([ 25843 n$5({ type: Number }) 25844 ], Input.prototype, "minlength", void 0); 25845 __decorate$p([ 25846 n$5({ type: Number }) 25847 ], Input.prototype, "maxlength", void 0); 25848 __decorate$p([ 25849 n$5({ type: String }) 25850 ], Input.prototype, "src", void 0); 25851 __decorate$p([ 25852 n$5({ type: Boolean, reflect: true }) 25853 ], Input.prototype, "inlineContent", void 0); 25854 __decorate$p([ 25855 n$5({ type: Boolean }) 25856 ], Input.prototype, "disableInlineContentFocus", void 0); 25857 __decorate$p([ 25858 n$5({ type: Boolean }) 25859 ], Input.prototype, "showPasswordToggle", void 0); 25860 __decorate$p([ 25861 n$5({ type: Boolean }) 25862 ], Input.prototype, "autoActive", void 0); 25863 __decorate$p([ 25864 n$5({ type: Boolean, reflect: true }) 25865 ], Input.prototype, "active", void 0); 25866 __decorate$p([ 25867 n$4({ slot: "label", flatten: true }) 25868 ], Input.prototype, "slotLabelNodes", void 0); 25869 __decorate$p([ 25870 n$4({ slot: "description", flatten: true }) 25871 ], Input.prototype, "slotDescriptionNodes", void 0); 25872 __decorate$p([ 25873 n$4({ slot: "suffix", flatten: true }) 25874 ], Input.prototype, "slotSuffixNodes", void 0); 25875 __decorate$p([ 25876 n$4({ slot: "prefix", flatten: true }) 25877 ], Input.prototype, "slotPrefixNodes", void 0); 25878 __decorate$p([ 25879 e$7("input") 25880 ], Input.prototype, "input", void 0); 25881 __decorate$p([ 25882 r$5() 25883 ], Input.prototype, "hasDescription", void 0); 25884 __decorate$p([ 25885 r$5() 25886 ], Input.prototype, "hasLabel", void 0); 25887 __decorate$p([ 25888 r$5() 25889 ], Input.prototype, "hasSuffix", void 0); 25890 __decorate$p([ 25891 r$5() 25892 ], Input.prototype, "hasPrefix", void 0); 25893 __decorate$p([ 25894 r$5() 25895 ], Input.prototype, "isPassword", void 0); 25896 Input = __decorate$p([ 25897 t$3(tagName$27) 25898 ], Input); 25899 var __decorate$o = function(decorators, target, key, desc) { 25900 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 25901 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 25902 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 25903 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 25904 }; 25905 const tagName$26 = "sonic-value"; 25906 let SonicValue = class SonicValue extends Subscriber(i$6) { 25907 connectedCallback() { 25908 this.setAttribute("subDataProvider", this.getAttribute("key")); 25909 super.connectedCallback(); 25910 } 25911 render() { 25912 if (typeof this.props === "object" || this.props === void 0) 25913 return b$1`<slot name="prefix"></slot><slot></slot><slot name="suffix"></slot>`; 25914 return b$1`${o$6(this.props.toString())}<slot name="prefix"></slot><slot></slot 25915 ><slot name="suffix"></slot>`; 25916 } 25917 }; 25918 SonicValue = __decorate$o([ 25919 t$3(tagName$26) 25920 ], SonicValue); 25921 var __defProp$3j = Object.defineProperty; 25922 var __getOwnPropDesc$3l = Object.getOwnPropertyDescriptor; 25923 var __decorateClass$3m = (decorators, target, key, kind) => { 25924 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3l(target, key) : target; 25925 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 25926 if (decorator = decorators[i2]) 25927 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 25928 if (kind && result) __defProp$3j(target, key, result); 25929 return result; 25930 }; 25931 let SonicFormEventFilter = class extends Subscriber$1(i$6) { 25932 constructor() { 25933 super(...arguments); 25934 this.counterFilterByDay = false;
25935 this.customerFilterByDay = false; 25936 this.filterCategory = false; 25937 this.filterDays = false; 25938 this.gap = "var(--form-gutter)"; 25939 this._selectedCategory = ""; 25940 this.formDataProvider = "eventFrontFilters"; 25941 this.entityType = EntityType.Event; 25942 this.resetOnSearch = (searchValue) => { 25943 if (searchValue && searchValue.length > 0) { 25944 this.form.ids_category = []; 25945 this.form.day = []; 25946 } 25947 }; 25948 } 25949 connectedCallback() { 25950 this.form = PublisherManager.get(this.formDataProvider); 25951 super.connectedCallback(); 25952 this.form.onInternalMutation(() => { 25953 const formData = this.form.get(); 25954 let selectedCategory = formData.ids_category; 25955 let selectedDay = formData.day; 25956 if (Array.isArray(selectedCategory)) { 25957 selectedCategory = selectedCategory.join(","); 25958 } 25959 if (Array.isArray(selectedDay)) { 25960 selectedDay = selectedDay.join(","); 25961 } 25962 this._selectedCategory = selectedCategory; 25963 const urlParams = new URLSearchParams(window.location.search); 25964 if (selectedCategory) urlParams.set("id_categ", selectedCategory); 25965 else urlParams.delete("id_categ"); 25966 if (selectedDay) { 25967 urlParams.set("day", selectedDay); 25968 } else { 25969 urlParams.delete("day"); 25970 } 25971 const currentFragment = window.location.hash; 25972 if (selectedCategory || selectedDay) { 25973 window.history.replaceState(null, "", `${window.location.pathname}?${urlParams.toString()}${currentFragment}`); 25974 } 25975 }); 25976 this.initFromUrl(); 25977 this.form.search.onAssign(this.resetOnSearch); 25978 } 25979 disconnectedCallback() { 25980 this.form.search.offAssign(this.resetOnSearch); 25981 super.disconnectedCallback(); 25982 } 25983 initFromUrl() { 25984 const urlParams = new URLSearchParams(window.location.search); 25985 const selectedCategory = urlParams.get("id_categ"); 25986 const selectedDay = urlParams.get("day"); 25987 this.form.ids_category = [selectedCategory]; 25988 this.form.day = [selectedDay]; 25989 } 25990 resetCategory() { 25991 this.form.ids_category = []; 25992 const urlParams = new URLSearchParams(window.location.search); 25993 urlParams.delete("id_categ"); 25994 window.history.replaceState(null, "", `${window.location.pathname}?${urlParams.toString()}${window.location.hash}`); 25995 } 25996 render() { 25997 const formStyles = { 25998 gap: this.gap 25999 }; 26000 const hasCategory = this._selectedCategory ? true : false; 26001 const today = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3); 26002 let settingsFilterDays; 26003 if (this.appType === "counter") { 26004 settingsFilterDays = this.counterFilterByDay; 26005 } else { 26006 settingsFilterDays = this.customerFilterByDay; 26007 } 26008 const displayFilterDays = (this.filterDays || settingsFilterDays) && this.entityType === EntityType.Event; 26009 return b$1` 26010 <div 26011 formDataProvider=${this.formDataProvider} 26012 class="flex min-w-0 flex-col w-full @container" 26013 style=${o$3(formStyles)} 26014 > 26015 <div class="flex flex-wrap @2xl:flex-nowrap" style=${o$3(formStyles)}> 26016 <div class="flex items-center" style=${o$3(formStyles)}> 26017 <!-- Search --> 26018 <sonic-input 26019 type="search" 26020 name="search" 26021 inlineContent 26022 placeholder="${t("Search...")}" 26023 filteredFields="title" 26024 class="grow" 26025 autocomplete="off" 26026 value="" 26027 size="inherit" 26028 > 26029 <sonic-icon library="iconoir" slot="prefix" name="search" size="lg"></sonic-icon> 26030 </sonic-input> 26031 26032 <!-- Categories --> 26033 ${this.filterCategory ? b$1`<sonic-form-event-category ?hasCategory=${hasCategory} size="inherit"></sonic-form-event-category>` : A$1} 26034 </div> 26035 <slot name="formSuffix"></slot> 26036 </div> 26037 26038 <!-- Days --> 26039 ${displayFilterDays ? b$1`<sonic-fetch 26040 dataProvider="events/filters/days?from=${today}${this.agendaId ? `&ids_agenda=${this.agendaId}` : ""}" 26041 key="data" 26042 > 26043 <sonic-form-event-days></sonic-form-event-days 26044 ></sonic-fetch>` : A$1} 26045 ${hasCategory ? b$1`<sonic-fetch dataProvider="selectedCategory" endPoint="category/${this._selectedCategory}" key="data"> 26046 <div class="inline-flex items-center gap-4 divide-x divide-neutral-200 pl-3 text-[max(16px,1em)] "> 26047 <div class=" font-bold mr-2 inline-flex gap-2 items-center leading-tight"> 26048 <sonic-icon library="custom" name="tag"></sonic-icon> 26049 <sonic-value key="title"></sonic-value> 26050 </div> 26051 <div class="px-2 py-2"> 26052 <sonic-button 26053 @click=${this.resetCategory} 26054 variant="unstyled" 26055 shape="circle" 26056 size="inherit" 26057 class="text-neutral-400 hover:text-neutral-600 flex-grow-0" 26058 > 26059 <sonic-icon library="custom" name="xmark"></sonic-icon> 26060 </sonic-button> 26061 </div> 26062 </div> 26063 </sonic-fetch>` : ""} 26064 </div> 26065 `; 26066 } 26067 }; 26068 SonicFormEventFilter.styles = [ 26069 i$9` 26070 :host { 26071 display: block; 26072 --form-gutter: 0.5rem; 26073 } 26074 `, 26075 tailwind 26076 ]; 26077 __decorateClass$3m([ 26078 c({ context: appType, subscribe: true }) 26079 ], SonicFormEventFilter.prototype, "appType", 2); 26080 __decorateClass$3m([ 26081 bind$1("settings.store_ui.event.filter_by_day"), 26082 r$5() 26083 ], SonicFormEventFilter.prototype, "counterFilterByDay", 2); 26084 __decorateClass$3m([ 26085 bind$1("settings.customer_ui.event.filter_by_day"), 26086 r$5() 26087 ], SonicFormEventFilter.prototype, "customerFilterByDay", 2); 26088 __decorateClass$3m([ 26089 n$5({ type: Boolean }) 26090 ], SonicFormEventFilter.prototype, "filterCategory", 2); 26091 __decorateClass$3m([ 26092 n$5({ type: Boolean }) 26093 ], SonicFormEventFilter.prototype, "filterDays", 2); 26094 __decorateClass$3m([ 26095 n$5({ type: String }) 26096 ], SonicFormEventFilter.prototype, "gap", 2); 26097 __decorateClass$3m([ 26098 n$5({ type: Array }) 26099 ], SonicFormEventFilter.prototype, "_selectedCategory", 2); 26100 __decorateClass$3m([ 26101 n$5({ type: String }) 26102 ], SonicFormEventFilter.prototype, "formDataProvider", 2); 26103 __decorateClass$3m([ 26104 n$5({ type: Number }) 26105 ], SonicFormEventFilter.prototype, "agendaId", 2); 26106 __decorateClass$3m([ 26107 n$5({ type: String }) 26108 ], SonicFormEventFilter.prototype, "entityType", 2); 26109 SonicFormEventFilter = __decorateClass$3m([ 26110 t$3("sonic-form-event-filter") 26111 ], SonicFormEventFilter); 26112 const d = (t2) => d$1(t2) ? t2._$litType$.h : t2.strings, h = e$5(class extends i$4 { 26113 constructor(t2) { 26114 super(t2), this.et = /* @__PURE__ */ new WeakMap(); 26115 } 26116 render(t2) { 26117 return [t2]; 26118 } 26119 update(s2, [e2]) { 26120 const u2 = l(this.it) ? d(this.it) : null, h2 = l(e2) ? d(e2) : null; 26121 if (null !== u2 && (null === h2 || u2 !== h2)) { 26122 const e3 = M(s2).pop(); 26123 let o2 = this.et.get(u2); 26124 if (void 0 === o2) { 26125 const s3 = document.createDocumentFragment(); 26126 o2 = D(A$1, s3), o2.setConnected(false), this.et.set(u2, o2); 26127 } 26128 p(o2, [e3]), v$1(o2, void 0, e3); 26129 } 26130 if (null !== h2) { 26131 if (null === u2 || u2 !== h2) { 26132 const t2 = this.et.get(h2); 26133 if (void 0 !== t2) { 26134 const i2 = M(t2).pop(); 26135 j$1(s2), v$1(s2, void 0, i2), p(s2, [i2]); 26136 } 26137 } 26138 this.it = e2; 26139 } else this.it = void 0; 26140 return this.render(e2); 26141 } 26142 }); 26143 var __defProp$3i = Object.defineProperty; 26144 var __getOwnPropDesc$3k = Object.getOwnPropertyDescriptor; 26145 var __decorateClass$3l = (decorators, target, key, kind) => { 26146 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3k(target, key) : target; 26147 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26148 if (decorator = decorators[i2]) 26149 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26150 if (kind && result) __defProp$3i(target, key, result); 26151 return result; 26152 }; 26153 const tagName$25 = "sonic-event-taxonomy"; 26154 let Taxonomy = class extends i$6 { 26155 constructor() { 26156 super(...arguments); 26157 this.icon = { name: "" }; 26158 this.taxonomy = []; 26159 this.separator = ", "; 26160 this.key = null; 26161 this.displayAll = false;
26162 this.contrast = false; 26163 this.type = "default"; 26164 this.variant = "default"; 26165 this.size = "md"; 26166 this.ellipsis = false; 26167 this.isScolar = false; 26168 } 26169 willUpdate(_changedProperties) { 26170 if (this.appType == "counter" && this.key == "range") { 26171 this.displayAll = true; 26172 } 26173 if (_changedProperties.has("taxonomy") && this.taxonomy && this.key == "label") { 26174 this.taxonomy.forEach((label2) => { 26175 if (typeof label2.title == "string" && label2.title?.toLowerCase().includes("scolaire")) { 26176 this.isScolar = true; 26177 this.icon = { library: "custom", prefix: "solid", name: "child-reaching" }; 26178 this.type = "primary"; 26179 } 26180 }); 26181 } 26182 super.willUpdate(_changedProperties); 26183 } 26184 render() { 26185 if (!Array.isArray(this.taxonomy)) return A$1; 26186 const key = this.key + "_display"; 26187 const taxo = this.displayAll ? this.taxonomy : this.taxonomy.filter( 26188 (elt) => elt != null && (elt[key] === true || elt[key] == "1" || !Object.hasOwnProperty.call(elt, key)) 26189 ); 26190 if (taxo.length === 0) { 26191 this.style.display = "none"; 26192 return A$1; 26193 } 26194 this.style.removeProperty("display"); 26195 return h(b$1` 26196 <sonic-badge 26197 ?ellipsis=${this.ellipsis} 26198 type=${this.type} 26199 variant=${this.variant} 26200 size=${this.size} 26201 class="min-w-0" 26202 ?contrast=${this.contrast} 26203 > 26204 ${this.icon.name ? b$1` 26205 <sonic-icon 26206 slot="prefix" 26207 library=${o$4(this.icon.library)} 26208 prefix=${o$4(this.icon.prefix)} 26209 name=${o$4(this.icon.name)} 26210 ></sonic-icon> 26211 ` : A$1} 26212 <div> 26213 ${o( 26214 o$1(taxo, (i2) => { 26215 const name = i2[this.key + "_name"] || i2["name"]; 26216 return b$1`${name}`; 26217 }), 26218 b$1`${o$6(this.separator)}` 26219 )} 26220 </div> 26221 </sonic-badge> 26222 `); 26223 } 26224 }; 26225 Taxonomy.styles = i$9` 26226 :host { 26227 line-height: 1; 26228 min-width: 0; 26229 } 26230 .taxonomy-list span { 26231 min-width: 0; 26232 display: inline-block; 26233 } 26234 `; 26235 __decorateClass$3l([ 26236 n$5({ type: Object }) 26237 ], Taxonomy.prototype, "icon", 2); 26238 __decorateClass$3l([ 26239 n$5({ type: Array }) 26240 ], Taxonomy.prototype, "taxonomy", 2); 26241 __decorateClass$3l([ 26242 n$5({ type: String }) 26243 ], Taxonomy.prototype, "separator", 2); 26244 __decorateClass$3l([ 26245 n$5({ type: String }) 26246 ], Taxonomy.prototype, "key", 2); 26247 __decorateClass$3l([ 26248 n$5({ type: Boolean }) 26249 ], Taxonomy.prototype, "displayAll", 2); 26250 __decorateClass$3l([ 26251 n$5({ type: Boolean }) 26252 ], Taxonomy.prototype, "contrast", 2); 26253 __decorateClass$3l([ 26254 n$5({ type: String, reflect: true }) 26255 ], Taxonomy.prototype, "type", 2); 26256 __decorateClass$3l([ 26257 n$5({ type: String, reflect: true }) 26258 ], Taxonomy.prototype, "variant", 2); 26259 __decorateClass$3l([ 26260 n$5({ type: String, reflect: true }) 26261 ], Taxonomy.prototype, "size", 2); 26262 __decorateClass$3l([ 26263 c({ context: appType, subscribe: true }) 26264 ], Taxonomy.prototype, "appType", 2); 26265 __decorateClass$3l([ 26266 n$5({ type: Boolean }) 26267 ], Taxonomy.prototype, "ellipsis", 2); 26268 __decorateClass$3l([ 26269 r$5() 26270 ], Taxonomy.prototype, "isScolar", 2); 26271 Taxonomy = __decorateClass$3l([ 26272 t$3(tagName$25) 26273 ], Taxonomy); 26274 class Electron { 26275 static fixBlankLink(link) { 26276 const electronStr = "electron"; 26277 const electron = typeof require == "undefined" || typeof process != "object" ? null : require(electronStr); 26278 if (link.target == "_blank") { 26279 link.addEventListener("click", () => { 26280 electron?.shell.openExternal(link.href); 26281 }); 26282 } 26283 } 26284 } 26285 var __decorate$n = function(decorators, target, key, desc) { 26286 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 26287 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 26288 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 26289 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 26290 }; 26291 const tagName$24 = "sonic-link"; 26292 let Link = class Link extends i$6 { 26293 constructor() { 26294 super(...arguments); 26295 this.href = ""; 26296 this._location = ""; 26297 this.ariaLabel = null; 26298 this.autoActive = "partial"; 26299 this._target = null; 26300 this.pushState = null; 26301 } 26302 get location() { 26303 return this._location; 26304 } 26305 set location(value) { 26306 this._location = value; 26307 LocationHandler$1.updateComponentActiveState(this); 26308 } 26309 connectedCallback() { 26310 if (this.href && this.href.indexOf("http") != 0) { 26311 LocationHandler$1.onChange(this); 26312 this.location = document.location.href.replace(document.location.origin, ""); 26313 } 26314 this.addEventListener("keypress", (e2) => {
26315 if (e2.key === "Enter") { 26316 this.shadowRoot?.querySelector("a")?.click(); 26317 } 26318 }); 26319 this.setFocusable(); 26320 super.connectedCallback(); 26321 } 26322 setFocusable() { 26323 if (this.href) { 26324 this.setAttribute("tabIndex", "0"); 26325 } else { 26326 this.removeAttribute("tabIndex"); 26327 } 26328 } 26329 disconnectedCallback() { 26330 LocationHandler$1.offChange(this); 26331 super.disconnectedCallback(); 26332 } 26333 set target(newTarget) { 26334 this._target = newTarget; 26335 Electron.fixBlankLink(this); 26336 this.requestUpdate(); 26337 } 26338 get target() { 26339 return this._target; 26340 } 26341 handlePushState(e2) { 26342 e2.preventDefault(); 26343 LocationHandler$1.changeFromComponent(this); 26344 } 26345 updated(changedProperties) { 26346 if (changedProperties.has("href")) { 26347 this.setFocusable(); 26348 } 26349 } 26350 render() { 26351 if (!this.href) 26352 return b$1`<slot></slot>`; 26353 return b$1` 26354 <a 26355 href="${this.href}" 26356 aria-label=${this.ariaLabel || A$1} 26357 target=${o$4(this.target)} 26358 @click=${this.pushState ? this.handlePushState : null} 26359 > 26360 <slot></slot> 26361 </a> 26362 `; 26363 } 26364 }; 26365 Link.styles = [ 26366 i$9` 26367 a { 26368 color: inherit; 26369 text-decoration: none; 26370 display: contents; 26371 } 26372 ` 26373 ]; 26374 __decorate$n([ 26375 n$5({ type: String }) 26376 ], Link.prototype, "href", void 0); 26377 __decorate$n([ 26378 n$5({ type: String, attribute: "data-aria-label" }) 26379 ], Link.prototype, "ariaLabel", void 0); 26380 __decorate$n([ 26381 n$5({ type: String }) 26382 ], Link.prototype, "autoActive", void 0); 26383 __decorate$n([ 26384 n$5({ type: String }) 26385 ], Link.prototype, "target", null); 26386 __decorate$n([ 26387 n$5({ type: Boolean }) 26388 ], Link.prototype, "pushState", void 0); 26389 Link = __decorate$n([ 26390 t$3(tagName$24) 26391 ], Link); 26392 var __defProp$3h = Object.defineProperty; 26393 var __getOwnPropDesc$3j = Object.getOwnPropertyDescriptor; 26394 var __decorateClass$3k = (decorators, target, key, kind) => { 26395 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3j(target, key) : target; 26396 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26397 if (decorator = decorators[i2]) 26398 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26399 if (kind && result) __defProp$3h(target, key, result); 26400 return result; 26401 }; 26402 const tagName$23 = "sonic-event-site-link"; 26403 let SonicComponent$i = class SonicComponent extends Subscriber$1(i$6) { 26404 constructor() { 26405 super(...arguments); 26406 this.site_link = ""; 26407 } 26408 render() { 26409 if (!this.site_link) return A$1; 26410 const siteLinkDomain = this.site_link.replace("https://", "").replace("http://", "").replace("www.", "").split("/")[0]; 26411 return b$1`<sonic-tooltip label=${siteLinkDomain} placement=${this.tooltipPlacement || "top-start"}> 26412 <sonic-link href=${this.site_link} target="_blank" class="group"> 26413 <sonic-icon name="arrow-up-right" library="custom" class="mr-[.25em]"></sonic-icon 26414 ><span class="underline hover:no-underline font-medium">${this.customText || t("site_link_info")} </span> 26415 </sonic-link> 26416 </sonic-tooltip>`; 26417 } 26418 }; 26419 SonicComponent$i.styles = [tailwind]; 26420 __decorateClass$3k([ 26421 n$5({ type: String }) 26422 ], SonicComponent$i.prototype, "site_link", 2); 26423 __decorateClass$3k([ 26424 n$5({ type: String }) 26425 ], SonicComponent$i.prototype, "customText", 2); 26426 __decorateClass$3k([ 26427 n$5({ type: String }) 26428 ], SonicComponent$i.prototype, "tooltipPlacement", 2); 26429 SonicComponent$i = __decorateClass$3k([ 26430 t$3(tagName$23) 26431 ], SonicComponent$i); 26432 var __defProp$3g = Object.defineProperty; 26433 var __getOwnPropDesc$3i = Object.getOwnPropertyDescriptor; 26434 var __decorateClass$3j = (decorators, target, key, kind) => { 26435 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3i(target, key) : target; 26436 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26437 if (decorator = decorators[i2]) 26438 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26439 if (kind && result) __defProp$3g(target, key, result); 26440 return result; 26441 }; 26442 let VerticalDate = class extends Subscriber$1(i$6) { 26443 constructor() { 26444 super(...arguments); 26445 this.start_date = 0; 26446 this.end_date = 0; 26447 } 26448 render() { 26449 return b$1` 26450 <sonic-date 26451 designMode 26452 noshadowdom 26453 year="numeric" 26454 month="short" 26455 weekday="short" 26456 class="block text-center leading-none ${this.end_date ? "text-[.82em]" : ""}" 26457 > 26458 <template data-value="weekday">
26459 <span class="uppercase font-bold text-[1.1em]"></span> 26460 </template> 26461 <template data-value="day"> 26462 <span class="text-[2.2em] block uppercase font-bold"></span> 26463 </template> 26464 <template data-value="month"> 26465 <span class="text-[1.1em] block uppercase font-bold"></span> 26466 </template> 26467 <template data-value="year"> 26468 <span class="mt-[.2em] mb-[.3em] font-bold block uppercase text-[.82em]"></span> 26469 </template> 26470 <template data-value="to"> 26471 <sonic-icon 26472 name="chevron-down" 26473 class="justify-center flex w-full mb-[.3em] -mt-[.15em]" 26474 library="custom" 26475 ></sonic-icon> 26476 </template> 26477 <template data-value="literal"> 26478 <span class="text-[.82em]"></span> 26479 </template> 26480 <template data-value="hour"> 26481 <span class="text-[.82em]"></span> 26482 </template> 26483 <template data-value="minute"> 26484 <span class="text-[.82em]"></span> 26485 </template> 26486 </sonic-date> 26487 `; 26488 } 26489 }; 26490 VerticalDate.styles = [tailwind]; 26491 __decorateClass$3j([ 26492 n$5({ type: Number }) 26493 ], VerticalDate.prototype, "start_date", 2); 26494 __decorateClass$3j([ 26495 n$5({ type: Number }) 26496 ], VerticalDate.prototype, "end_date", 2); 26497 VerticalDate = __decorateClass$3j([ 26498 t$3("sonic-vertical-date") 26499 ], VerticalDate); 26500 var __defProp$3f = Object.defineProperty; 26501 var __getOwnPropDesc$3h = Object.getOwnPropertyDescriptor; 26502 var __decorateClass$3i = (decorators, target, key, kind) => { 26503 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3h(target, key) : target; 26504 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26505 if (decorator = decorators[i2]) 26506 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26507 if (kind && result) __defProp$3f(target, key, result); 26508 return result; 26509 }; 26510 const tagName$22 = "sonic-reelax-link"; 26511 let SonicReelaxLink = class extends Subscriber$1(i$6) { 26512 constructor() { 26513 super(...arguments); 26514 this.isDuotone = false; 26515 this.svgReelax = b$1`<svg 26516 xmlns="http://www.w3.org/2000/svg" 26517 xmlns:xlink="http://www.w3.org/1999/xlink" 26518 viewBox="0 0 37.08 39.46" 26519 class="transform translate-z-0 fill-current" 26520 > 26521 <polygon fill="#ff9b85" points="28.21 0 37.08 12.28 27.19 25.92 19.64 25.92 29.59 12.2 20.79 0 28.21 0" /> 26522 <polygon fill="#3bceac" points="8.86 13.54 0 25.82 9.89 39.46 17.44 39.46 7.49 25.74 16.29 13.54 8.86 13.54" /> 26523 </svg>`; 26524 } 26525 updated() { 26526 this.checkIfDuotone(); 26527 } 26528 checkIfDuotone() { 26529 const duotoneChecker = this.shadowRoot?.getElementById("contextDuotoneChecker"); 26530 if (duotoneChecker) { 26531 const bgColor = window.getComputedStyle(duotoneChecker).backgroundColor; 26532 const textColor = window.getComputedStyle(duotoneChecker).color; 26533 if (bgColor === textColor) { 26534 this.isDuotone = true; 26535 } else { 26536 this.isDuotone = false; 26537 } 26538 } 26539 } 26540 render() { 26541 const urlReelax = this.props?.settings?.reelax_info?.all; 26542 if (!urlReelax) { 26543 return A$1; 26544 } 26545 return b$1` 26546 <div id="contextDuotoneChecker" class="bg-success text-danger hidden"></div> 26547 <sonic-tooltip label=${t("module_reelax_tooltip")} class="align-center" 26548 ><sonic-link href=${urlReelax} target="_blank" class="inline-flex gap-[.35em] items-center group"> 26549 <div 26550 class="rounded-full w-[2em] h-[2em] p-2 border transition-border border-solid transition duration-100 ${this.isDuotone ? "border-content bg-content text-neutral-0 [&_*]:fill-current" : "bg-[#222] text-neutral-0 border-[#c77dff] group-hover:border-[#ff9b85]"}" 26551 > 26552 ${this.svgReelax} 26553 </div> 26554 <span class="font-bold">${t("module_reelax_title")}</span></sonic-link 26555 > 26556 </sonic-tooltip> 26557 `; 26558 } 26559 }; 26560 SonicReelaxLink.styles = [tailwind]; 26561 __decorateClass$3i([ 26562 r$5() 26563 ], SonicReelaxLink.prototype, "isDuotone", 2); 26564 SonicReelaxLink = __decorateClass$3i([ 26565 t$3(tagName$22) 26566 ], SonicReelaxLink); 26567 var __defProp$3e = Object.defineProperty; 26568 var __getOwnPropDesc$3g = Object.getOwnPropertyDescriptor; 26569 var __decorateClass$3h = (decorators, target, key, kind) => { 26570 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3g(target, key) : target; 26571 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26572 if (decorator = decorators[i2]) 26573 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26574 if (kind && result) __defProp$3e(target, key, result); 26575 return result; 26576 }; 26577 let RefundLink = class extends Subscriber$1(i$6) { 26578 constructor() { 26579 super(...arguments); 26580 this.variant = "outline"; 26581 this.type = "default"; 26582 this.size = "xs"; 26583 } 26584 render() {
26585 const mustDisplayUrl = this.props?.settings?.refund?.display_url || this.refund?.display_url; 26586 if (!mustDisplayUrl) return A$1; 26587 const refundUrl = appRoute("refund").query({ event_id: this.id }); 26588 return b$1` 26589 <sonic-link class="inline-flex gap-[.35em] items-center group font-bold" href=${refundUrl}> 26590 <div 26591 class="rounded-full w-[2em] h-[2em] flex items-center justify-center bg-info text-info-content 26592 group-hover:opacity-70" 26593 > 26594 <sonic-icon library="custom" name="arrow-rotate-left"></sonic-icon> 26595 </div> 26596 ${t("LIB_refund")} 26597 </sonic-link> 26598 `; 26599 } 26600 }; 26601 RefundLink.styles = [tailwind]; 26602 __decorateClass$3h([ 26603 n$5({ type: Object }) 26604 ], RefundLink.prototype, "refund", 2); 26605 __decorateClass$3h([ 26606 n$5({ type: String }) 26607 ], RefundLink.prototype, "variant", 2); 26608 __decorateClass$3h([ 26609 n$5({ type: String }) 26610 ], RefundLink.prototype, "type", 2); 26611 __decorateClass$3h([ 26612 n$5({ type: String }) 26613 ], RefundLink.prototype, "size", 2); 26614 RefundLink = __decorateClass$3h([ 26615 t$3("sonic-refund-link") 26616 ], RefundLink); 26617 var __defProp$3d = Object.defineProperty; 26618 var __getOwnPropDesc$3f = Object.getOwnPropertyDescriptor; 26619 var __decorateClass$3g = (decorators, target, key, kind) => { 26620 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3f(target, key) : target; 26621 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26622 if (decorator = decorators[i2]) 26623 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26624 if (kind && result) __defProp$3d(target, key, result); 26625 return result; 26626 }; 26627 let SonicPromo$1 = class SonicPromo extends Subscriber$1(i$6) { 26628 constructor() { 26629 super(...arguments); 26630 this.promotion_code = false; 26631 this.event_id = null; 26632 this.has_promo = false; 26633 } 26634 handleSubmit(e2) { 26635 const data = e2.detail?.data || null; 26636 if (!data) return; 26637 const isCartCode = data.cart == true && data.success == true; 26638 if (isCartCode) { 26639 dp("cart/current").invalidate(); 26640 if (!appRoute("cart").matchesCurrentPath()) { 26641 goTo("cart"); 26642 } 26643 } else if (data?.success == true) { 26644 this.publisher?.invalidate(); 26645 promoCodeModal(data); 26646 } 26647 } 26648 render() { 26649 if (this.promotion_code || this.event_id && this.has_promo) { 26650 return b$1` 26651 <div formdataprovider="promoForm" dataProvider="promotion-code" method="post"> 26652 <sonic-submit onEnterKey @submit=${this.handleSubmit}> 26653 <sonic-input 26654 size=${o$4(this.size)} 26655 name="promo_code" 26656 placehoderAsLabel 26657 placeholder=${t("LIB_code_promo")} 26658 inlineContent 26659 > 26660 <sonic-icon library="custom" name="gift" slot="prefix"></sonic-icon> 26661 26662 <sonic-submit onClick slot="suffix"> 26663 <sonic-tooltip label="${t("submit")}"> 26664 <sonic-button 26665 size=${o$4(this.size)} 26666 shape="square" 26667 icon 26668 variant="unstyled" 26669 data-aria-label=${t("submit")} 26670 > 26671 <sonic-icon 26672 library="iconoir" 26673 name="check" 26674 class="${this.promoCodeValue ? "opacity-100 animate-[pulse.5s_ease-in-out_infinite_.5s] inline-block" : "opacity-30"}" 26675 ></sonic-icon> 26676 </sonic-button> 26677 </sonic-tooltip> 26678 </sonic-submit> 26679 </sonic-input> 26680 </sonic-submit> 26681 </div> 26682 `; 26683 } else { 26684 return A$1; 26685 } 26686 } 26687 }; 26688 SonicPromo$1.styles = [tailwind]; 26689 __decorateClass$3g([ 26690 bind$1("settings.promotion_code"), 26691 n$5({ type: Boolean }) 26692 ], SonicPromo$1.prototype, "promotion_code", 2); 26693 __decorateClass$3g([ 26694 n$5({ type: Number }) 26695 ], SonicPromo$1.prototype, "event_id", 2); 26696 __decorateClass$3g([ 26697 n$5({ type: Boolean }) 26698 ], SonicPromo$1.prototype, "has_promo", 2); 26699 __decorateClass$3g([ 26700 n$5({ type: String }) 26701 ], SonicPromo$1.prototype, "size", 2); 26702 __decorateClass$3g([ 26703 bind$1("promoForm.promo_code"), 26704 n$5({ type: String }) 26705 ], SonicPromo$1.prototype, "promoCodeValue", 2); 26706 SonicPromo$1 = __decorateClass$3g([ 26707 t$3("sonic-promo-form") 26708 ], SonicPromo$1); 26709 var __defProp$3c = Object.defineProperty; 26710 var __decorateClass$3f = (decorators, target, key, kind) => { 26711 var result = void 0; 26712 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26713 if (decorator = decorators[i2]) 26714 result = decorator(target, key, result) || result; 26715 if (result) __defProp$3c(target, key, result); 26716 return result; 26717 }; 26718 const CovoitLoad = (superClass) => { 26719 class CovoitElement extends superClass { 26720 constructor() { 26721 super(...arguments); 26722 this.scriptType = "front"; 26723 this.scriptIsLoaded = !!document.getElementById("sonic-covoit-script"); 26724 } 26725 connectedCallback() { 26726 super.connectedCallback(); 26727 this.setupCustomRoutes(); 26728 document.addEventListener("sonic-routes-ready", this.setupCustomRoutes.bind(this), { once: true }); 26729 this.addCovoitScript(); 26730 } 26731 setupCustomRoutes() { 26732 const LoginRoute = appRoute("account")?.toString(); 26733 if (LoginRoute) { 26734 this.customRoutes = { 26735 login: LoginRoute 26736 }; 26737 } 26738 } 26739 updated(changedProperties) { 26740 if (changedProperties.has("carpoolingSettings") && !this.scriptIsLoaded) { 26741 this.addCovoitScript(); 26742 } 26743 } 26744 addCovoitScript() { 26745 if (this.scriptIsLoaded) return; 26746 if (this.carpoolingSettings?.url) { 26747 let scriptURL = this.carpoolingSettings.url; 26748 if (scriptURL.endsWith("/")) { 26749 scriptURL = scriptURL.slice(0, -1); 26750 } 26751 const date2 = /* @__PURE__ */ new Date(); 26752 date2.setMinutes(0, 0, 0); 26753 const unixTimestamp = Math.floor(date2.getTime() / 1e3); 26754 scriptURL += "/dist/main.umd.js?" + unixTimestamp; 26755 const script = document.createElement("script"); 26756 script.id = "sonic-covoit-script"; 26757 script.src = scriptURL; 26758 script.type = "module"; 26759 document.head.appendChild(script); 26760 this.scriptIsLoaded = true; 26761 } 26762 } 26763 } 26764 __decorateClass$3f([ 26765 bind$1("carpooling_user_id.encrypted_uid"), 26766 n$5({ type: String }) 26767 ], CovoitElement.prototype, "encryptedUid"); 26768 __decorateClass$3f([ 26769 bind$1("settings.modules.carpooling"), 26770 n$5({ type: Object }) 26771 ], CovoitElement.prototype, "carpoolingSettings"); 26772 __decorateClass$3f([ 26773 n$5({ type: Object }) 26774 ], CovoitElement.prototype, "customRoutes"); 26775 return CovoitElement; 26776 }; 26777 var __defProp$3b = Object.defineProperty; 26778 var __getOwnPropDesc$3e = Object.getOwnPropertyDescriptor; 26779 var __decorateClass$3e = (decorators, target, key, kind) => { 26780 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3e(target, key) : target; 26781 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26782 if (decorator = decorators[i2]) 26783 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26784 if (kind && result) __defProp$3b(target, key, result); 26785 return result; 26786 }; 26787 const tagName$21 = "sonic-carpooling-event-widget"; 26788 let CarpoolingEventWidget = class extends CovoitLoad(Subscriber$1(i$6)) { 26789 constructor() { 26790 super(...arguments); 26791 this.id = ""; 26792 } 26793 render() { 26794 if (!this.carpoolingSettings) return A$1; 26795 const { url, token } = this.carpoolingSettings;
26796 if (!url || !this.id) return A$1; 26797 return b$1`<covoit-event-widget 26798 covoitURL="${url}" 26799 baseURL="${o$4(appRoute("carpooling"))}" 26800 token="${o$4(token)}" 26801 eventId=${o$4(this.id)} 26802 customTitle="${t("module_carpooling_title")}" 26803 class="leading-none" 26804 ></covoit-event-widget>`; 26805 } 26806 }; 26807 CarpoolingEventWidget.styles = [tailwind]; 26808 __decorateClass$3e([ 26809 n$5({ type: String }) 26810 ], CarpoolingEventWidget.prototype, "id", 2); 26811 CarpoolingEventWidget = __decorateClass$3e([ 26812 t$3(tagName$21) 26813 ], CarpoolingEventWidget); 26814 const alignContext = n("alignContext"); 26815 const flexJustify = (align) => { 26816 let justifyClass = "justify-start"; 26817 if (align === "center") justifyClass = "justify-center"; 26818 if (align === "right") justifyClass = "justify-end"; 26819 return justifyClass; 26820 }; 26821 var __defProp$3a = Object.defineProperty; 26822 var __getOwnPropDesc$3d = Object.getOwnPropertyDescriptor; 26823 var __decorateClass$3d = (decorators, target, key, kind) => { 26824 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3d(target, key) : target; 26825 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26826 if (decorator = decorators[i2]) 26827 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26828 if (kind && result) __defProp$3a(target, key, result); 26829 return result; 26830 }; 26831 const svgPassCulture = (options) => { 26832 const defaultOptions = { color: "#fff", width: 28, height: 28 }; 26833 const mergedOptions = { ...defaultOptions, ...options }; 26834 return b$1`<svg 26835 width=${mergedOptions.width} 26836 height=${mergedOptions.height} 26837 class=${mergedOptions.className} 26838 viewBox="0 0 ${defaultOptions.width} ${defaultOptions.height}" 26839 fill="none" 26840 xmlns="http://www.w3.org/2000/svg" 26841 > 26842 <path 26843 d="M14 1c-.13 0-.24.1-.24.23v1.8c0 .13.1.24.23.24H14c.13 0 .24-.1.24-.24v-1.8c0-.13-.1-.23-.23-.23ZM10.9 1.9a.24.24 0 0 0-.18.3l1.92 7.45c.03.13.16.2.29.17.13-.03.2-.16.17-.28l-1.92-7.47a.24.24 0 0 0-.28-.17ZM7.61 2.37v.01a.23.23 0 0 0-.1.32l.69 1.24c.06.11.2.15.31.1l.01-.01c.12-.07.16-.2.1-.32l-.69-1.24a.23.23 0 0 0-.32-.1ZM17 2.36h-.01a.24.24 0 0 0-.29.17l-1.8 7c-.03.13.04.26.17.3.13.03.26-.05.3-.18l1.8-7a.24.24 0 0 0-.18-.3ZM20.27 2.6a.24.24 0 0 0-.33.1l-1.7 3.1a.24.24 0 1 0 .42.23l1.7-3.1a.24.24 0 0 0-.1-.32ZM23.22 4.19a.23.23 0 0 0-.34 0l-1.26 1.35c-.1.1-.09.24 0 .33h.01c.1.1.25.1.33 0l1.27-1.35a.23.23 0 0 0-.01-.33ZM8.77 4.49a.24.24 0 0 0-.1.32l1.67 3.03c.06.11.2.15.32.1v-.01c.12-.06.16-.2.1-.32L9.09 4.58a.24.24 0 0 0-.32-.1ZM14 4.46c-.13 0-.24.1-.24.23v4.9c0 .14.1.24.24.24.13 0 .24-.1.24-.23V4.7c0-.14-.1-.24-.24-.24ZM5.8 5.27c-.09.1-.1.24 0 .34l4.32 4.61c.1.1.24.1.34.01.1-.1.1-.24.01-.34L6.14 5.3a.24.24 0 0 0-.33-.02ZM21.17 6.37a.24.24 0 0 0-.34 0L18.6 8.75c-.09.1-.08.24.01.33.1.1.25.09.34 0l2.22-2.36a.24.24 0 0 0-.01-.34ZM17.95 6.83a.24.24 0 0 0-.33.09l-1.4 2.56a.24.24 0 0 0 .42.23l1.4-2.56a.24.24 0 0 0-.1-.32ZM24.27 7.2l-6.02 3.82a.24.24 0 0 0 .26.4l6.02-3.82a.24.24 0 0 0-.26-.4ZM7.84 9.8 4.03 7.4a.24.24 0 0 0-.26.4l3.82 2.42c.1.07.25.04.32-.07a.24.24 0 0 0-.07-.33ZM11 8.52h-.02a.23.23 0 0 0-.09.32l.48.87c.06.11.2.16.32.1V9.8c.12-.06.16-.2.1-.32l-.48-.87a.23.23 0 0 0-.31-.09ZM18.22 9.52V9.5a.23.23 0 0 0-.33.01l-.37.39a.23.23 0 0 0 .01.32l.02.01c.09.09.23.09.32 0l.36-.39a.23.23 0 0 0 0-.32ZM3.94 10.48l-2-.65a.23.23 0 0 0-.15.45l2 .65c.12.04.26-.03.3-.15a.23.23 0 0 0-.15-.3ZM25.6 9.98l-1.67.54a.23.23 0 0 0 .15.45l1.66-.54a.23.23 0 1 0-.15-.45ZM9.76 11.03l-1.04-.66a.23.23 0 0 0-.26.4l1.04.66c.1.07.25.03.32-.07v-.01a.23.23 0 0 0-.06-.32ZM9.67 12.34l-4.65-1.51a.24.24 0 0 0-.15.45l4.65 1.51c.13.05.26-.02.3-.15a.24.24 0 0 0-.15-.3ZM22.66 10.93l-4.33 1.41a.24.24 0 1 0 .15.45l4.33-1.4c.13-.04.2-.18.15-.3a.24.24 0 0 0-.3-.16ZM5.4 13.22l-4.15-.26a.24.24 0 0 0-.03.48l4.16.26c.13 0 .24-.1.25-.22v-.01a.24.24 0 0 0-.22-.25ZM26.75 12.96l-4.73.3a.24.24 0 0 0 .03.48l4.73-.3c.13-.01.23-.13.22-.26a.24.24 0 0 0-.25-.22ZM9.61 13.48l-3.14-.2a.23.23 0 0 0-.03.48l3.14.2c.13 0 .24-.09.25-.22a.23.23 0 0 0-.22-.26ZM20.99 13.32l-2.6.16a.23.23 0 0 0-.22.25v.01c0 .13.12.23.25.22l2.6-.16c.13-.01.22-.12.22-.25v-.01a.23.23 0 0 0-.25-.22ZM9.55 14.6l-7.14 1.37a.24.24 0 0 0 .09.47l7.14-1.37a.24.24 0 1 0-.09-.47ZM25.95 16.04l-7.5-1.43a.24.24 0 1 0-.09.47l7.5 1.42c.13.03.25-.06.28-.18a.24.24 0 0 0-.19-.28ZM9.5 15.85l-1.01.48a.23.23 0 0 0-.11.3v.02c.06.12.2.17.31.11l1.01-.48c.12-.05.17-.19.11-.3v-.02a.23.23 0 0 0-.31-.1ZM23.05 18l-4.54-2.14a.24.24 0 0 0-.32.1v.01c-.06.12 0 .26.11.32l4.54 2.13c.12.06.26 0 .32-.11a.24.24 0 0 0-.11-.32ZM7.53 16.78l-2.58 1.21a.24.24 0 1 0 .2.43l2.59-1.21c.11-.06.16-.2.1-.32a.24.24 0 0 0-.3-.11
26843ZM9.71 17.24 4.79 21.3a.24.24 0 1 0 .3.37l4.92-4.07c.1-.09.12-.24.04-.34a.24.24 0 0 0-.34-.03ZM23.37 21.44l-5.08-4.2a.24.24 0 0 0-.3.37l5.07 4.2c.1.08.25.07.34-.04a.24.24 0 0 0-.03-.33ZM11.03 18.1v-.01a.24.24 0 0 0-.34.05l-2.56 3.53c-.08.11-.05.26.05.33.11.08.26.06.33-.05l2.57-3.53a.24.24 0 0 0-.05-.33ZM16.98 18.1h-.01a.23.23 0 0 0-.05.32l1.27 1.75c.08.1.22.13.33.05.1-.08.13-.23.05-.33l-1.27-1.75a.23.23 0 0 0-.32-.05ZM12.35 18.18h-.01a.23.23 0 0 0-.3.13l-1.02 2.57c-.05.12.01.26.13.3.13.05.26 0 .31-.13l1.02-2.56a.23.23 0 0 0-.13-.3ZM13.48 18.17a.24.24 0 0 0-.27.2l-1.06 8.36c-.02.13.08.25.2.27h.01c.13.01.25-.08.26-.2l1.06-8.37a.24.24 0 0 0-.2-.26ZM14.53 18.17a.24.24 0 0 0-.21.26l.52 4.14c.02.13.14.22.27.2a.24.24 0 0 0 .2-.26l-.52-4.14a.24.24 0 0 0-.26-.2ZM15.66 18.18h-.01a.23.23 0 0 0-.13.3l.32.8c.04.12.18.17.3.13a.23.23 0 0 0 .14-.3l-.32-.8a.23.23 0 0 0-.3-.13ZM3.98 18.45l-1.63.77a.23.23 0 0 0-.11.31v.01c.05.12.2.17.31.11l1.64-.77c.11-.06.16-.2.1-.31v-.01a.23.23 0 0 0-.3-.11ZM25.77 19.27l-1.67-.78a.23.23 0 0 0-.3.11h-.01c-.06.12 0 .26.11.32l1.66.79c.12.05.26 0 .32-.12a.23.23 0 0 0-.11-.32ZM16.4 20.08a.24.24 0 0 0-.13.3l1.28 3.21c.04.13.18.18.3.14a.24.24 0 0 0 .14-.31L16.7 20.2a.24.24 0 0 0-.3-.13ZM19.1 21h-.01a.24.24 0 0 0-.05.34l1.77 2.44c.08.1.22.12.33.05.1-.08.13-.23.05-.33l-1.77-2.44a.24.24 0 0 0-.33-.06ZM10.87 21.92a.24.24 0 0 0-.31.13l-1.48 3.73c-.05.12.01.26.13.3.13.06.26 0 .31-.13L11 22.22a.24.24 0 0 0-.13-.3ZM7.78 22.57h-.01a.23.23 0 0 0-.33.05L6.3 24.19c-.07.1-.05.25.06.32.1.09.25.06.33-.04l1.14-1.57a.23.23 0 0 0-.05-.33ZM15.2 23.44h-.01a.23.23 0 0 0-.2.26l.3 2.42c.02.13.14.22.27.2a.23.23 0 0 0 .2-.26l-.3-2.42a.23.23 0 0 0-.27-.2ZM18.16 24.49h-.01a.23.23 0 0 0-.13.3l.46 1.17c.05.12.18.18.3.13h.01a.23.23 0 0 0 .13-.3l-.46-1.17a.23.23 0 0 0-.3-.13Z" 26844 fill="${mergedOptions.color}" 26845 /> 26846 <path 26847 d="M14 1c-.13 0-.24.1-.24.23v1.8c0 .13.1.24.23.24H14c.13 0 .24-.1.24-.24v-1.8c0-.13-.1-.23-.23-.23ZM10.9 1.9a.24.24 0 0 0-.18.3l1.92 7.45c.03.13.16.2.29.17.13-.03.2-.16.17-.28l-1.92-7.47a.24.24 0 0 0-.28-.17ZM7.61 2.37v.01a.23.23 0 0 0-.1.32l.69 1.24c.06.11.2.15.31.1l.01-.01c.12-.07.16-.2.1-.32l-.69-1.24a.23.23 0 0 0-.32-.1ZM17 2.36h-.01a.24.24 0 0 0-.29.17l-1.8 7c-.03.13.04.26.17.3.13.03.26-.05.3-.18l1.8-7a.24.24 0 0 0-.18-.3ZM20.27 2.6a.24.24 0 0 0-.33.1l-1.7 3.1a.24.24 0 1 0 .42.23l1.7-3.1a.24.24 0 0 0-.1-.32ZM23.22 4.19a.23.23 0 0 0-.34 0l-1.26 1.35c-.1.1-.09.24 0 .33h.01c.1.1.25.1.33 0l1.27-1.35a.23.23 0 0 0-.01-.33ZM8.77 4.49a.24.24 0 0 0-.1.32l1.67 3.03c.06.11.2.15.32.1v-.01c.12-.06.16-.2.1-.32L9.09 4.58a.24.24 0 0 0-.32-.1ZM14 4.46c-.13 0-.24.1-.24.23v4.9c0 .14.1.24.24.24.13 0 .24-.1.24-.23V4.7c0-.14-.1-.24-.24-.24ZM5.8 5.27c-.09.1-.1.24 0 .34l4.32 4.61c.1.1.24.1.34.01.1-.1.1-.24.01-.34L6.14 5.3a.24.24 0 0 0-.33-.02ZM21.17 6.37a.24.24 0 0 0-.34 0L18.6 8.75c-.09.1-.08.24.01.33.1.1.25.09.34 0l2.22-2.36a.24.24 0 0 0-.01-.34ZM17.95 6.83a.24.24 0 0 0-.33.09l-1.4 2.56a.24.24 0 0 0 .42.23l1.4-2.56a.24.24 0 0 0-.1-.32ZM24.27 7.2l-6.02 3.82a.24.24 0 0 0 .26.4l6.02-3.82a.24.24 0 0 0-.26-.4ZM7.84 9.8 4.03 7.4a.24.24 0 0 0-.26.4l3.82 2.42c.1.07.25.04.32-.07a.24.24 0 0 0-.07-.33ZM11 8.52h-.02a.23.23 0 0 0-.09.32l.48.87c.06.11.2.16.32.1V9.8c.12-.06.16-.2.1-.32l-.48-.87a.23.23 0 0 0-.31-.09ZM18.22 9.52V9.5a.23.23 0 0 0-.33.01l-.37.39a.23.23 0 0 0 .01.32l.02.01c.09.09.23.09.32 0l.36-.39a.23.23 0 0 0 0-.32ZM3.94 10.48l-2-.65a.23.23 0 0 0-.15.45l2 .65c.12.04.26-.03.3-.15a.23.23 0 0 0-.15-.3ZM25.6 9.98l-1.67.54a.23.23 0 0 0 .15.45l1.66-.54a.23.23 0 1 0-.15-.45ZM9.76 11.03l-1.04-.66a.23.23 0 0 0-.26.4l1.04.66c.1.07.25.03.32-.07v-.01a.23.23 0 0 0-.06-.32ZM9.67 12.34l-4.65-1.51a.24.24 0 0 0-.15.45l4.65 1.51c.13.05.26-.02.3-.15a.24.24 0 0 0-.15-.3ZM22.66 10.93l-4.33 1.41a.24.24 0 1 0 .15.45l4.33-1.4c.13-.04.2-.18.15-.3a.24.24 0 0 0-.3-.16ZM5.4 13.22l-4.15-.26a.24.24 0 0 0-.03.48l4.16.26c.13 0 .24-.1.25-.22v-.01a.24.24 0 0 0-.22-.25ZM26.75 12.96l-4.73.3a.24.24 0 0 0 .03.48l4.73-.3c.13-.01.23-.13.22-.26a.24.24 0 0 0-.25-.22ZM9.61 13.48l-3.14-.2a.23.23 0 0 0-.03.48l3.14.2c.13 0 .24-.09.25-.22a.23.23 0 0 0-.22-.26ZM20.99 13.32l-2.6.16a.23.23 0 0 0-.22.25v.01c0 .13.12.23.25.22l2.6-.16c.13-.01.22-.12.22-.25v-.01a.23.23 0 0 0-.25-.22ZM9.55 14.6l-7.14 1.37a.24.24 0 0 0 .09.47l7.14-1.37a.24.24 0 1 0-.09-.47ZM25.95 16.04l-7.5-1.43a.24.24 0 1 0-.09.47l7.5 1.42c.13.03.25-.06.28-.18a.24.24 0 0 0-.19-.28ZM9.5 15.85l-1.01.48a.23.23 0 0 0-.11.3v.02c.06.12.2.17.31.11l1.01-.48c.12-.05.17-.19.11-.3v-.02a.23.23 0 0 0-.31-.1ZM23.05 18l-4.54-2.14a.24.24 0 0 0-.32.1v.01c-.06.12 0 .26.11.32l4.54 2.13c.12.06.26 0 .32-.11a.24.24 0 0 0-.11-.32ZM7.53 16.78l-2.58 1.21a.24.24 0 1 0 .2.43l2.59-1.21c.11-.06.16-.2.1-.32a.24.24 0 0 0-.3-.11
26847ZM9.71 17.24 4.79 21.3a.24.24 0 1 0 .3.37l4.92-4.07c.1-.09.12-.24.04-.34a.24.24 0 0 0-.34-.03ZM23.37 21.44l-5.08-4.2a.24.24 0 0 0-.3.37l5.07 4.2c.1.08.25.07.34-.04a.24.24 0 0 0-.03-.33ZM11.03 18.1v-.01a.24.24 0 0 0-.34.05l-2.56 3.53c-.08.11-.05.26.05.33.11.08.26.06.33-.05l2.57-3.53a.24.24 0 0 0-.05-.33ZM16.98 18.1h-.01a.23.23 0 0 0-.05.32l1.27 1.75c.08.1.22.13.33.05.1-.08.13-.23.05-.33l-1.27-1.75a.23.23 0 0 0-.32-.05ZM12.35 18.18h-.01a.23.23 0 0 0-.3.13l-1.02 2.57c-.05.12.01.26.13.3.13.05.26 0 .31-.13l1.02-2.56a.23.23 0 0 0-.13-.3ZM13.48 18.17a.24.24 0 0 0-.27.2l-1.06 8.36c-.02.13.08.25.2.27h.01c.13.01.25-.08.26-.2l1.06-8.37a.24.24 0 0 0-.2-.26ZM14.53 18.17a.24.24 0 0 0-.21.26l.52 4.14c.02.13.14.22.27.2a.24.24 0 0 0 .2-.26l-.52-4.14a.24.24 0 0 0-.26-.2ZM15.66 18.18h-.01a.23.23 0 0 0-.13.3l.32.8c.04.12.18.17.3.13a.23.23 0 0 0 .14-.3l-.32-.8a.23.23 0 0 0-.3-.13ZM3.98 18.45l-1.63.77a.23.23 0 0 0-.11.31v.01c.05.12.2.17.31.11l1.64-.77c.11-.06.16-.2.1-.31v-.01a.23.23 0 0 0-.3-.11ZM25.77 19.27l-1.67-.78a.23.23 0 0 0-.3.11h-.01c-.06.12 0 .26.11.32l1.66.79c.12.05.26 0 .32-.12a.23.23 0 0 0-.11-.32ZM16.4 20.08a.24.24 0 0 0-.13.3l1.28 3.21c.04.13.18.18.3.14a.24.24 0 0 0 .14-.31L16.7 20.2a.24.24 0 0 0-.3-.13ZM19.1 21h-.01a.24.24 0 0 0-.05.34l1.77 2.44c.08.1.22.12.33.05.1-.08.13-.23.05-.33l-1.77-2.44a.24.24 0 0 0-.33-.06ZM10.87 21.92a.24.24 0 0 0-.31.13l-1.48 3.73c-.05.12.01.26.13.3.13.06.26 0 .31-.13L11 22.22a.24.24 0 0 0-.13-.3ZM7.78 22.57h-.01a.23.23 0 0 0-.33.05L6.3 24.19c-.07.1-.05.25.06.32.1.09.25.06.33-.04l1.14-1.57a.23.23 0 0 0-.05-.33ZM15.2 23.44h-.01a.23.23 0 0 0-.2.26l.3 2.42c.02.13.14.22.27.2a.23.23 0 0 0 .2-.26l-.3-2.42a.23.23 0 0 0-.27-.2ZM18.16 24.49h-.01a.23.23 0 0 0-.13.3l.46 1.17c.05.12.18.18.3.13h.01a.23.23 0 0 0 .13-.3l-.46-1.17a.23.23 0 0 0-.3-.13Z" 26848 stroke="${mergedOptions.color}" 26849 stroke-width=".25" 26850 /> 26851 </svg>`; 26852 }; 26853 const tagName$20 = "sonic-passculture-link"; 26854 let SonicPassCultureLink = class extends Subscriber$1(i$6) { 26855 constructor() { 26856 super(...arguments); 26857 this.isDuotone = false; 26858 } 26859 updated() { 26860 this.checkIfDuotone(); 26861 } 26862 checkIfDuotone() { 26863 const duotoneChecker = this.shadowRoot?.getElementById("contextDuotoneChecker"); 26864 if (duotoneChecker) { 26865 const bgColor = window.getComputedStyle(duotoneChecker).backgroundColor; 26866 const textColor = window.getComputedStyle(duotoneChecker).color; 26867 if (bgColor === textColor) { 26868 this.isDuotone = true; 26869 } else { 26870 this.isDuotone = false; 26871 } 26872 } 26873 } 26874 render() { 26875 const passCultureUrl = this.pass_culture?.url || this.props?.settings?.pass_culture?.url; 26876 if (!passCultureUrl) { 26877 return A$1; 26878 } 26879 return b$1` 26880 <div id="contextDuotoneChecker" class="bg-success text-danger hidden"></div> 26881 <sonic-link 26882 data-aria-label=${t("pass_culture")} 26883 href=${passCultureUrl} 26884 target="_blank" 26885 class="inline-flex gap-[.35em] items-center group" 26886 > 26887 <div 26888 class="rounded-full w-[2em] h-[2em] flex items-center justify-center border transition-border border-solid transition duration-100 ${this.isDuotone ? "border-content bg-content [&_*]:fill-neutral-0" : "bg-gradient-to-r from-[#e10057] to-[#4f0090] border-neutral-100 group-hover:border-[#4f0090] "}" 26889 > 26890 ${svgPassCulture({ width: 40, height: 40 })} 26891 </div> 26892 <span class="font-bold ">${t("pass_culture")}</span></sonic-link 26893 > 26894 `; 26895 } 26896 }; 26897 SonicPassCultureLink.styles = [tailwind]; 26898 __decorateClass$3d([ 26899 r$5() 26900 ], SonicPassCultureLink.prototype, "isDuotone", 2); 26901 __decorateClass$3d([ 26902 n$5({ type: Object }) 26903 ], SonicPassCultureLink.prototype, "pass_culture", 2); 26904 SonicPassCultureLink = __decorateClass$3d([ 26905 t$3(tagName$20) 26906 ], SonicPassCultureLink); 26907 var __defProp$39 = Object.defineProperty; 26908 var __getOwnPropDesc$3c = Object.getOwnPropertyDescriptor; 26909 var __decorateClass$3c = (decorators, target, key, kind) => { 26910 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3c(target, key) : target; 26911 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26912 if (decorator = decorators[i2]) 26913 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26914 if (kind && result) __defProp$39(target, key, result); 26915 return result; 26916 }; 26917 const tagName$1$ = "sonic-buy-event-block-suffix";
26918 let BuyEventBlockSuffix = class extends EventContext(Subscriber$1(i$6)) { 26919 constructor() { 26920 super(...arguments); 26921 this.settings = null; 26922 this.displayBottomArea = false; 26923 this.displayTopArea = false; 26924 this.displayCarpooling = false; 26925 } 26926 willUpdate(changedProperties) { 26927 if ((changedProperties.has("settings") || changedProperties.has("carpoolingSettings")) && this.settings) { 26928 const { reelax_info, pass_culture, carpooling, refund, has_promo } = this.settings; 26929 this.displayCarpooling = !!(this.carpoolingSettings?.access && carpooling?.enabled); 26930 this.displayTopArea = !!(reelax_info?.buy || pass_culture?.url || refund?.url); 26931 this.displayBottomArea = !!(this.displayCarpooling || has_promo); 26932 } 26933 super.willUpdate(changedProperties); 26934 } 26935 render() { 26936 if (this._isGuichet || !this.settings) return A$1; 26937 if (!this.displayTopArea && !this.displayBottomArea) { 26938 this.style.display = "none"; 26939 return A$1; 26940 } 26941 this.style.removeProperty("display"); 26942 const displayReelax = !!this.settings.reelax_info?.all; 26943 const displayPassCulture = !!this.settings.pass_culture?.url; 26944 const displayRefund = !!this.settings.refund?.url; 26945 return b$1` 26946 ${this.displayTopArea ? b$1` <div 26947 class="flex flex-wrap gap-x-6 gap-y-2 text-sm lg:text-base lg:leading-tight ${flexJustify(this.align)}" 26948 > 26949 ${displayReelax ? b$1`<sonic-reelax-link></sonic-reelax-link>` : A$1} 26950 ${displayPassCulture ? b$1`<sonic-passculture-link></sonic-passculture-link>` : A$1} 26951 ${displayRefund ? b$1`<sonic-refund-link></sonic-refund-link>` : A$1} 26952 </div>` : A$1} 26953 ${this.displayTopArea && this.displayBottomArea ? b$1`<sonic-divider class="my-4"></sonic-divider>` : A$1} 26954 ${this.displayBottomArea ? b$1` 26955 <div class="flex flex-wrap gap-x-8 2xl:gap-x-10 gap-y-5 items-end ${flexJustify(this.align)}"> 26956 ${this.displayCarpooling ? b$1`<sonic-carpooling-event-widget class="text-sm"></sonic-carpooling-event-widget>` : A$1} 26957 ${this.settings.has_promo ? b$1`<sonic-promo-form class="inline-block w-[10rem]" size="sm"></sonic-promo-form>` : A$1} 26958 </div> 26959 ` : A$1} 26960 `; 26961 } 26962 }; 26963 BuyEventBlockSuffix.styles = [tailwind]; 26964 __decorateClass$3c([ 26965 c({ context: alignContext, subscribe: true }), 26966 n$5({ type: String }) 26967 ], BuyEventBlockSuffix.prototype, "align", 2); 26968 __decorateClass$3c([ 26969 bind$1("settings.modules.carpooling"), 26970 n$5({ type: Object }) 26971 ], BuyEventBlockSuffix.prototype, "carpoolingSettings", 2); 26972 __decorateClass$3c([ 26973 n$5({ type: Object }) 26974 ], BuyEventBlockSuffix.prototype, "settings", 2); 26975 __decorateClass$3c([ 26976 r$5() 26977 ], BuyEventBlockSuffix.prototype, "displayBottomArea", 2); 26978 __decorateClass$3c([ 26979 r$5()
26980 ], BuyEventBlockSuffix.prototype, "displayTopArea", 2); 26981 __decorateClass$3c([ 26982 r$5() 26983 ], BuyEventBlockSuffix.prototype, "displayCarpooling", 2); 26984 BuyEventBlockSuffix = __decorateClass$3c([ 26985 t$3(tagName$1$) 26986 ], BuyEventBlockSuffix); 26987 const formatAmount = (value) => { 26988 return new Intl.NumberFormat("fr-FR", { 26989 style: "currency", 26990 currency: "EUR", 26991 minimumFractionDigits: value % 1 !== 0 ? 2 : 0, 26992 maximumFractionDigits: value % 1 !== 0 ? 2 : 0 26993 }).format(value); 26994 }; 26995 const placementToString = (placementData) => { 26996 if (!placementData) return ""; 26997 const firstPartArray = []; 26998 const record = placementData; 26999 ["area", "door", "type_of_seat"].forEach((key) => { 27000 if (record[key]) firstPartArray.push(record[key]); 27001 }); 27002 const firstPart = firstPartArray.join(" / "); 27003 const secondPartArray = []; 27004 ["row", "seat"].forEach((key) => { 27005 if (record[key]) secondPartArray.push(record[key]); 27006 }); 27007 const secondPart = secondPartArray.join("-"); 27008 const contentArray = []; 27009 if (firstPart) contentArray.push(firstPart); 27010 if (secondPart) contentArray.push(secondPart); 27011 const content = contentArray.join(" - "); 27012 return content; 27013 }; 27014 var __defProp$38 = Object.defineProperty; 27015 var __getOwnPropDesc$3b = Object.getOwnPropertyDescriptor; 27016 var __decorateClass$3b = (decorators, target, key, kind) => { 27017 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3b(target, key) : target; 27018 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 27019 if (decorator = decorators[i2]) 27020 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 27021 if (kind && result) __defProp$38(target, key, result); 27022 return result; 27023 }; 27024 let PriceRange = class extends Subscriber$1(i$6) { 27025 constructor() { 27026 super(...arguments); 27027 this.prices = []; 27028 this.wording_pl_from_price = "de"; 27029 this.wording_pl_to_price = "a"; 27030 this.displayIcon = false; 27031 } 27032 render() { 27033 const availablePrices = this.prices.filter((price) => price.price_available); 27034 if (!availablePrices.length) return A$1; 27035 const minValue = Math.min(...availablePrices.map((price) => price.amount || 0)); 27036 const minText = minValue ? formatAmount(minValue) : t("free"); 27037 const maxValue = Math.max(...availablePrices.map((price) => price.amount || 0)); 27038 return b$1`<div class="flex gap-x-[.35em]"> 27039 ${this.displayIcon ? b$1`<div> 27040 <sonic-icon library="custom" name="circle-euro" class="w-[1em] text-center"></sonic-icon> 27041 </div>` : A$1} 27042 27043 <div> 27044 ${minValue != maxValue ? b$1` 27045 ${this.wording_pl_from_price} 27046 <span class="price-min lowercase">${minText}</span> 27047 ${this.wording_pl_to_price} 27048 <span class="price-max">
27048${formatAmount(maxValue)}</span> 27049 ` : b$1`<span class="price-min-max">${minText}</span>`} 27050 </div> 27051 </div>`; 27052 } 27053 }; 27054 PriceRange.styles = [tailwind]; 27055 __decorateClass$3b([ 27056 n$5({ type: Array }) 27057 ], PriceRange.prototype, "prices", 2); 27058 __decorateClass$3b([ 27059 n$5({ type: String }) 27060 ], PriceRange.prototype, "wording_pl_from_price", 2); 27061 __decorateClass$3b([ 27062 n$5({ type: String }) 27063 ], PriceRange.prototype, "wording_pl_to_price", 2); 27064 __decorateClass$3b([ 27065 n$5({ type: Boolean }) 27066 ], PriceRange.prototype, "displayIcon", 2); 27067 PriceRange = __decorateClass$3b([ 27068 t$3("sonic-price-range") 27069 ], PriceRange); 27070 const seatmapKey = new DataProviderKey("${seatmapProvider}"); 27071 const cartKey = new DataProviderKey("${cartProvider}"); 27072 const seatmapFormKey = new DataProviderKey("${dataProvider}"); 27073 const counterSeatmapKey = new DataProviderKey("counter/seatmapView"); 27074 dp$1(counterSeatmapKey.path); 27075 const seatmapPublisher = (seatmapProvider) => dp$1(seatmapProvider); 27076 const cartPublisher = (cartProvider) => dp$1(cartProvider); 27077 const typeColor = i$9` 27078 :host { 27079 --sc-_color: inherit; 27080 color: var(--sc-_color); 27081 } 27082 27083 :host([type="primary"]) { 27084 --sc-_color: var(--sc-primary, var(--sc-base-content, #000)); 27085 } 27086 :host([type="warning"]) { 27087 --sc-_color: var(--sc-warning, var(--sc-base-content, #000)); 27088 } 27089 :host([type="danger"]) { 27090 --sc-_color: var(--sc-danger, var(--sc-base-content, #000)); 27091 } 27092 :host([type="info"]) { 27093 --sc-_color: var(--sc-info, var(--sc-base-content, #000)); 27094 } 27095 :host([type="success"]) { 27096 --sc-_color: var(--sc-success, var(--sc-base-content, #000)); 27097 } 27098 27099 .inherit-color { 27100 color: var(--sc-_color); 27101 } 27102`; 27103 i$9` 27104 :host { 27105 --sc-_color: inherit; 27106 --sc-_bg: inherit; 27107 color: var(--sc-_color); 27108 background: var(--sc-_bg); 27109 } 27110 27111 /*TYPES*/ 27112 :host([type="primary"]) { 27113 --sc-_bg: var(--sc-primary, var(--sc-base-content, #000)); 27114 --sc-_color: var(--sc-primary-content, var(--sc-base, #fff)); 27115 } 27116 :host([type="warning"]) { 27117 --sc-_bg: var(--sc-warning, var(--sc-base-content, #000)); 27118 --sc-_color: var(--sc-warning-content, var(--sc-base, #fff)); 27119 } 27120 :host([type="danger"]) { 27121 --sc-_bg: var(--sc-danger, var(--sc-base-content, #000)); 27122 --sc-_color: var(--sc-danger-content, var(--sc-base, #fff)); 27123 } 27124 :host([type="info"]) { 27125 --sc-_bg: var(--sc-info, var(--sc-base-content, #000)); 27126 --sc-_color: var(--sc-info-content, var(--sc-base, #fff)); 27127 } 27128 :host([type="success"]) { 27129 --sc-_bg: var(--sc-success, var(--sc-base-content, #000)); 27130 --sc-_color: var(--sc-success-content, var(--sc-base, #fff)); 27131 } 27132
27133 /* dans un contexte de couleur - divider color*/ 27134 :host([type="primary"]), 27135 :host([type="warning"]), 27136 :host([type="danger"]), 27137 :host([type="info"]), 27138 :host([type="success"]) { 27139 --sc-border-color: currentColor; 27140 --sc-divider-opacity: 0.2; 27141 } 27142 27143 :host([type="base"]) { 27144 --sc-_bg: var(--sc-base, #fff); 27145 --sc-_color: var(--sc-base-content, #000); 27146 } 27147 :host([type="default"]), 27148 :host([type="light"]) { 27149 --sc-_bg: var(--sc-base-100, rgba(0, 0, 0, 0.07)); 27150 --sc-_color: var(--sc-base-content, #000); 27151 } 27152 27153 :host([type="neutral"]) { 27154 --sc-_bg: var(--sc-base-content, #000); 27155 --sc-_color: var(--sc-base, #fff); 27156 } 27157 27158 :host([type="invert"]) { 27159 --sc-_bg: var(--sc-base-900, var(--sc-base-content, #000)); 27160 --sc-_color: var(--sc-base, #fff); 27161 } 27162 27163 .inherit-bg { 27164 color: inherit; 27165 } 27166`; 27167 var __decorate$m = function(decorators, target, key, desc) { 27168 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27169 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27170 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 27171 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27172 }; 27173 const tagName$1_ = "sonic-tr"; 27174 let TableTr = class TableTr extends Subscriber$1(i$6) { 27175 constructor() { 27176 super(...arguments); 27177 this._metadata_ = {}; 27178 } 27179 willUpdate(changedProperties) { 27180 if (changedProperties.has("_metadata_")) { 27181 this.even = !!this._metadata_.even; 27182 this.odd = !!this._metadata_.odd; 27183 this.last = !!this._metadata_.lastChild; 27184 } 27185 super.willUpdate(changedProperties); 27186 } 27187 render() { 27188 return b$1`<slot></slot>`; 27189 } 27190 }; 27191 TableTr.styles = [ 27192 typeColor, 27193 i$9` 27194 :host { 27195 display: table-row; 27196 } 27197 27198 :host([odd]) { 27199 background: var(--sc-table-accent-bg) !important; 27200 } 27201 :host([even]) { 27202 background: var(--sc-table-bg) !important; 27203 } 27204 27205 :host([last]) { 27206 --sc-table-td-border-b: none; 27207 } 27208 :host(:hover) { 27209 background: var(--sc-table-hover-bg) !important; 27210 } 27211 ` 27212 ]; 27213 __decorate$m([ 27214 n$5({ type: Object }) 27215 ], TableTr.prototype, "_metadata_", void 0); 27216 __decorate$m([ 27217 n$5({ type: Boolean, reflect: true }) 27218 ], TableTr.prototype, "even", void 0); 27219 __decorate$m([ 27220 n$5({ type: Boolean, reflect: true }) 27221 ], TableTr.prototype, "odd", void 0); 27222 __decorate$m([ 27223 n$5({ type: Boolean, reflect: true }) 27224 ], TableTr.prototype, "last", void 0); 27225 TableTr = __decorate$m([ 27226 t$3(tagName$1_) 27227 ], TableTr); 27228 var __decorate$l = function(decorators, target, key, desc) { 27229 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27230 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27231 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 27232 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27233 }; 27234 const tagName$1Z = "sonic-th"; 27235 let TableTh = class TableTh extends i$6 { 27236 render() { 27237 const styles2 = { 27238 textAlign: this.align, 27239 minWidth: this.minWidth, 27240 maxWidth: this.maxWidth, 27241 width: this.width 27242 }; 27243 return b$1`<th 27244 part="th" 27245 style=${o$3(styles2)} 27246 colspan=${o$4(this.colSpan)} 27247 rowspan=${o$4(this.rowSpan)} 27248 > 27249 <slot></slot> 27250 </th> `; 27251 } 27252 }; 27253 TableTh.styles = [ 27254 typeColor, 27255 i$9` 27256 :host { 27257 display: contents; 27258 background: var(--sc-table-bg); 27259 position: sticky; 27260 top: 0; 27261 z-index: 20; 27262 } 27263 27264 th { 27265 all: inherit; 27266 display: table-cell; 27267 border-bottom: calc(var(--sc-border-width, max(1px, 0.12rem)) * 1.5) 27268 solid var(--sc-table-border-color); 27269 text-transform: var(--sc-table-th-tt); 27270 font-weight: var(--sc-table-th-fw); 27271 font-size: var(--sc-table-th-fs); 27272 padding: var(--sc-table-th-py) var(--sc-table-th-px); 27273 } 27274 27275 :host([noBorder]) th { 27276 border-bottom: none; 27277 } 27278 ` 27279 ]; 27280 __decorate$l([ 27281 n$5({ type: Number }) 27282 ], TableTh.prototype, "colSpan", void 0); 27283 __decorate$l([ 27284 n$5({ type: Number }) 27285 ], TableTh.prototype, "rowSpan", void 0); 27286 __decorate$l([ 27287 n$5({ type: String }) 27288 ], TableTh.prototype, "align", void 0); 27289 __decorate$l([ 27290 n$5({ type: String }) 27291 ], TableTh.prototype, "minWidth", void 0); 27292 __decorate$l([ 27293 n$5({ type: String }) 27294 ], TableTh.prototype, "maxWidth", void 0); 27295 __decorate$l([ 27296 n$5({ type: String }) 27297 ], TableTh.prototype, "width", void 0); 27298 TableTh = __decorate$l([ 27299 t$3(tagName$1Z) 27300 ], TableTh); 27301 var __decorate$k = function(decorators, target, key, desc) { 27302 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27303 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27304 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 27305 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27306 }; 27307 const tagName$1Y = "sonic-td"; 27308 let TableTd = class TableTd extends i$6 { 27309 render() { 27310 const styles2 = { 27311 textAlign: this.align, 27312 verticalAlign: this.vAlign, 27313 minWidth: this.minWidth, 27314 maxWidth: this.maxWidth, 27315 width: this.width 27316 }; 27317 return b$1`<td part="td" style=${o$3(styles2)} colspan=${o$4(this.colSpan)} rowspan=${o$4(this.rowSpan)}> 27318 <slot></slot> 27319 </td>`; 27320 } 27321 }; 27322 TableTd.styles = [ 27323 typeColor, 27324 i$9` 27325 :host { 27326 display: contents; 27327 } 27328 td { 27329 all: inherit; 27330 display: table-cell; 27331 padding: var(--sc-table-td-py) var(--sc-table-td-px); 27332 border-top: var(--sc-table-td-border-t, none); 27333 border-bottom: var(--sc-table-td-border-b, none); 27334 border-right: var(--sc-table-td-border-r, none); 27335 border-left: var(--sc-table-td-border-l, none); 27336 } 27337 ` 27338 ]; 27339 __decorate$k([ 27340 n$5({ type: Number }) 27341 ], TableTd.prototype, "colSpan", void 0); 27342 __decorate$k([ 27343 n$5({ type: Number }) 27344 ], TableTd.prototype, "rowSpan", void 0); 27345 __decorate$k([ 27346 n$5({ type: String }) 27347 ], TableTd.prototype, "align", void 0); 27348 __decorate$k([ 27349 n$5({ type: String }) 27350 ], TableTd.prototype, "vAlign", void 0); 27351 __decorate$k([ 27352 n$5({ type: String }) 27353 ], TableTd.prototype, "minWidth", void 0); 27354 __decorate$k([ 27355 n$5({ type: String }) 27356 ], TableTd.prototype, "maxWidth", void 0); 27357 __decorate$k([ 27358 n$5({ type: String }) 27359 ], TableTd.prototype, "width", void 0); 27360 TableTd = __decorate$k([ 27361 t$3(tagName$1Y) 27362 ], TableTd); 27363 var __decorate$j = function(decorators, target, key, desc) { 27364 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27365 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27366 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 27367 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27368 }; 27369 const tagName$1X = "sonic-thead"; 27370 let TableThead = class TableThead extends i$6 { 27371 render() { 27372 return b$1`<slot></slot>`; 27373 } 27374 }; 27375 TableThead.styles = [ 27376 i$9` 27377 :host { 27378 display: table-header-group; 27379 } 27380 ` 27381 ]; 27382 TableThead = __decorate$j([ 27383 t$3(tagName$1X) 27384 ], TableThead); 27385 var __decorate$i = function(decorators, target, key, desc) { 27386 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27387 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27388 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 27389 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27390 }; 27391 const tagName$1W = "sonic-tbody"; 27392 let TableTbody = class TableTbody extends i$6 { 27393 render() { 27394 return b$1`<tbody part="tbody"> 27395 <slot></slot> 27396 </tbody>`; 27397 } 27398 }; 27399 TableTbody.styles = [ 27400 i$9` 27401 :host { 27402 display: table-row-group; 27403 } 27404 27405 ::slotted(sonic-tr:nth-child(odd)) { 27406 background: var(--sc-table-accent-bg); 27407 } 27408 27409 ::slotted(sonic-tr:hover) { 27410 background: var(--sc-table-hover-bg); 27411 } 27412 27413 ::slotted(sonic-tr:not(:last-child)) { 27414 border-bottom: var(--sc-form-border-width) solid 27415 var(--sc-base-200, rgba(0, 0, 0, 0.12)) !important; 27416 } 27417 ` 27418 ]; 27419 TableTbody = __decorate$i([ 27420 t$3(tagName$1W) 27421 ], TableTbody); 27422 var __decorate$h = function(decorators, target, key, desc) { 27423 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27424 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27425 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 27426 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27427 }; 27428 const tagName$1V = "sonic-tfoot";
27429 let TableTfoot = class TableTfoot extends i$6 { 27430 render() { 27431 return b$1`<tfoot> 27432 <slot></slot> 27433 </tfoot>`; 27434 } 27435 }; 27436 TableTfoot.styles = [ 27437 i$9` 27438 :host { 27439 display: contents; 27440 } 27441 ` 27442 ]; 27443 TableTfoot = __decorate$h([ 27444 t$3(tagName$1V) 27445 ], TableTfoot); 27446 var __decorate$g = function(decorators, target, key, desc) { 27447 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27448 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27449 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 27450 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27451 }; 27452 const tagName$1U = "sonic-caption"; 27453 let TableCaption = class TableCaption extends i$6 { 27454 render() { 27455 return b$1`<slot></slot>`; 27456 } 27457 }; 27458 TableCaption.styles = [ 27459 i$9` 27460 :host { 27461 display: table-caption; 27462 font-size: 0.75rem; 27463 color: var(--sc-table-caption-color); 27464 padding: var(--sc-table-td-py) var(--sc-table-td-px) calc(2 * var(--sc-table-td-py)); 27465 } 27466 ` 27467 ]; 27468 TableCaption = __decorate$g([ 27469 t$3(tagName$1U) 27470 ], TableCaption); 27471 var __decorate$f = function(decorators, target, key, desc) { 27472 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27473 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27474 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 27475 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27476 }; 27477 const tagName$1T = "sonic-table"; 27478 let Table = class Table extends i$6 { 27479 render() { 27480 const containerStyles = { 27481 maxHeight: this.maxHeight 27482 }; 27483 return b$1` 27484 <div 27485 class="table-container ${!this.noCustomScroll ? "custom-scroll" : ""}" 27486 style=${o$3(containerStyles)} 27487 > 27488 <div class="table"> 27489 <slot></slot> 27490 </div> 27491 </div> 27492 `; 27493 } 27494 }; 27495 Table.styles = [ 27496 customScroll, 27497 fontSize, 27498 i$9` 27499 :host { 27500 --sc-table-fw: var(--sc-font-weight-base, 400); 27501 --sc-table-fst: var(--sc-font-style-base, normal); 27502 --sc-table-fs: 1rem; 27503 --sc-table-border-color: var(--sc-border-color); 27504 --sc-table-caption-color: var( 27505 --sc-base-500, 27506 var(--sc-base-content, #000) 27507 ); 27508 --sc-table-bg: var(--sc-base, #fff); 27509 --sc-table-accent-bg: var(--sc-base-50, rgba(0, 0, 0, 0.04)); 27510 --sc-table-hover-bg: var(--sc-base-100, rgba(0, 0, 0, 0.07)); 27511 --sc-table-th-fs: 0.85em; 27512 --sc-table-th-fw: bold; 27513 --sc-table-th-tt: uppercase; 27514 --sc-table-th-px: var(--sc-table-td-px); 27515 --sc-table-th-py: calc(1.8 * var(--sc-table-td-py)); 27516 --sc-table-td-px: 0.5em; 27517 --sc-table-td-py: 0.5em; 27518 --sc-table-bw: var(--sc-border-width, max(1px, 0.12rem)); 27519 display: block; 27520 } 27521 27522 .table-container { 27523 overflow-x: auto; 27524 -webkit-overflow-scrolling: touch; 27525 } 27526 27527 :host([noCustomScroll]) .table-container { 27528 overflow: initial; 27529 } 27530 27531 .table { 27532 width: 100%; 27533 display: table; 27534 box-sizing: border-box; 27535 } 27536 27537 :host([bordered]) .table-container { 27538 border: var(--sc-table-bw) solid var(--sc-table-border-color); 27539 border-radius: var(--sc-rounded); 27540 --sc-table-td-border-b: var(--sc-table-bw) solid 27541 var(--sc-table-border-color); 27542 } 27543 ` 27544 ]; 27545 __decorate$f([ 27546 n$5({ type: String, reflect: true }) 27547 ], Table.prototype, "size", void 0); 27548 __decorate$f([ 27549 n$5({ type: Boolean, reflect: true }) 27550 ], Table.prototype, "bordered", void 0); 27551 __decorate$f([ 27552 n$5({ type: Boolean, reflect: true }) 27553 ], Table.prototype, "rounded", void 0); 27554 __decorate$f([ 27555 n$5({ type: Boolean, reflect: true }) 27556 ], Table.prototype, "noCustomScroll", void 0); 27557 __decorate$f([ 27558 n$5({ type: String }) 27559 ], Table.prototype, "maxHeight", void 0); 27560 Table = __decorate$f([ 27561 t$3(tagName$1T) 27562 ], Table); 27563 const secondScreenDpKeys = { 27564 activePlan: new DataProviderKey("secondScreen/activePlan"), 27565 /** 27566 * Compteur monotone : plan miroir recharge quand la valeur change. 27567 * @example secondScreen.dpKeys.shareMapRevision 27568 */ 27569 shareMapRevision: new DataProviderKey("secondScreen/shareMapRevision") 27570 }; 27571 var SecondScreenStorageKey = /* @__PURE__ */ ((SecondScreenStorageKey2) => { 27572 SecondScreenStorageKey2["Enabled"] = "SecondScreen:enabled";
27573 SecondScreenStorageKey2["Loaded"] = "SecondScreen:Loaded"; 27574 SecondScreenStorageKey2["EventId"] = "SecondScreen:EventId"; 27575 SecondScreenStorageKey2["ShareMapId"] = "SecondScreen:ShareMapId"; 27576 SecondScreenStorageKey2["CartSnapshot"] = "SecondScreen:CartSnapshot"; 27577 SecondScreenStorageKey2["WindowBounds"] = "SecondScreen:WindowBounds"; 27578 return SecondScreenStorageKey2; 27579 })(SecondScreenStorageKey || {}); 27580 const secondScreenStorage = { 27581 enabledValue: "true", 27582 defaultValue: "0", 27583 keys: SecondScreenStorageKey 27584 }; 27585 const { keys, enabledValue, defaultValue } = secondScreenStorage; 27586 const activePlanKey = secondScreenDpKeys.activePlan; 27587 const shareMapRevisionKey = secondScreenDpKeys.shareMapRevision; 27588 const isSecondScreenPage = () => /\/second-screen(?:[?#]|$)/.test(window.location.pathname); 27589 const VIEWPORT_BUMP_DEBOUNCE_MS = 200; 27590 const MIRROR_SOURCE_ID = "main"; 27591 const STORAGE_INT_RADIX = 10; 27592 let viewportBumpTimer = 0; 27593 function readStorageInt(key) { 27594 return parseInt(localStorage.getItem(key) || defaultValue, STORAGE_INT_RADIX); 27595 } 27596 function isMainWindowSecondScreenActive() { 27597 if (isSecondScreenPage()) return false; 27598 return localStorage.getItem(keys.Enabled) === enabledValue; 27599 } 27600 function nextShareMapRevision() { 27601 return readStorageInt(keys.ShareMapId) + 1; 27602 } 27603 function pushActivePlanToStorage(plan) { 27604 if (localStorage.getItem(keys.Enabled) !== enabledValue) return; 27605 const nextEventId = plan?.eventId ?? 0; 27606 const prev = localStorage.getItem(keys.EventId); 27607 localStorage.setItem(keys.EventId, String(nextEventId)); 27608 if (String(nextEventId) === prev) return; 27609 const revision = nextShareMapRevision(); 27610 localStorage.setItem(keys.ShareMapId, String(revision)); 27611 set$1(shareMapRevisionKey, revision); 27612 } 27613 const secondScreenPlan = { 27614 /** 27615 * Plusieurs seatmap-view : sourceId désigne le plan actif. 27616 * @example secondScreen.plan.set(eventId, sourceId) 27617 */ 27618 set(eventId, sourceId) { 27619 if (isSecondScreenPage() || !eventId) return; 27620 set$1(activePlanKey, { eventId, sourceId }); 27621 }, 27622 clear(sourceId) { 27623 if (isSecondScreenPage()) return; 27624 const activePlan = get$2(activePlanKey); 27625 if (activePlan?.sourceId !== sourceId) return; 27626 set$1(activePlanKey, null); 27627 }, 27628 /** 27629 * Le 2e écran ignore les événements canvas Haxe du plan principal. 27630 * @example secondScreen.plan.bumpRevision() 27631 */ 27632 bumpRevision() { 27633 if (!isMainWindowSecondScreenActive()) return; 27634 const revision = nextShareMapRevision(); 27635 localStorage.setItem(keys.ShareMapId, String(revision)); 27636 set$1(shareMapRevisionKey, revision); 27637 }, 27638 /** 27639 * planChanged Haxe rafale : debounce avant ShareMapId. 27640 * @example secondScreen.plan.scheduleViewportBump() 27641 */ 27642 scheduleViewportBump() { 27643 if (!isMainWindowSecondScreenActive()) return; 27644 clearTimeout(viewportBumpTimer); 27645 viewportBumpTimer = window.setTimeout(() => secondScreenPlan.bumpRevision(), VIEWPORT_BUMP_DEBOUNCE_MS); 27646 }, 27647 /** 27648 * Réécrit localStorage si activePlan inchangé (activation 2e écran). 27649 * @example secondScreenPlan.flushToStorage() 27650 */ 27651 flushToStorage() { 27652 const activePlan = get$2(activePlanKey); 27653 pushActivePlanToStorage(activePlan); 27654 }, 27655 /** 27656 * Fenêtre 2e écran : storage event â DP (pas de DP partagé). 27657 * @example secondScreen.plan.syncFromStorage() 27658 */ 27659 syncFromStorage() { 27660 const eventId = readStorageInt(keys.EventId); 27661 const revision = readStorageInt(keys.ShareMapId); 27662 const activePlan = eventId > 0 ? { eventId, sourceId: MIRROR_SOURCE_ID } : null; 27663 set$1(activePlanKey, activePlan); 27664 set$1(shareMapRevisionKey, revision); 27665 }, 27666 /** 27667 * Branche activePlan â localStorage (fenêtre principale). 27668 * @example secondScreenPlan.installBridge() 27669 */ 27670 installBridge() { 27671 if (isSecondScreenPage()) return; 27672 dp$1(activePlanKey.path).onAssign(pushActivePlanToStorage); 27673 } 27674 }; 27675 const secondScreen = { 27676 plan: { 27677 set: secondScreenPlan.set, 27678 clear: secondScreenPlan.clear, 27679 bumpRevision: secondScreenPlan.bumpRevision, 27680 scheduleViewportBump: secondScreenPlan.scheduleViewportBump, 27681 syncFromStorage: secondScreenPlan.syncFromStorage 27682 } 27683 }; 27684 function getCounterSeatmapActions(seatMapDataOrProvider) { 27685 if (seatMapDataOrProvider == null) { 27686 return void 0; 27687 } 27688 if (typeof seatMapDataOrProvider === "string") { 27689 return getCounterSeatmapActions(seatmapPublisher(seatMapDataOrProvider).get()); 27690 } 27691 return seatMapDataOrProvider.counterSeatmapActions; 27692 }
27693 const allSeatsInCartContext = (seats, cartProvider) => { 27694 if (!seats || seats.length === 0 || !cartProvider) { 27695 return false; 27696 } 27697 const isCurrentCart = cartProvider === "cart/current"; 27698 const isReservation2 = cartProvider.startsWith("reservations"); 27699 if (isCurrentCart) { 27700 return seats.every((seat) => seat.panier); 27701 } else if (isReservation2) { 27702 return seats.every((seat) => seat.reserved); 27703 } else { 27704 const cartId = cartProvider.split("/")[1]; 27705 return seats.every((seat) => seat.id_panier === Number(cartId)); 27706 } 27707 }; 27708 const getUrl = (pathName) => { 27709 const containerElement = document.querySelector("sonic-tickets-app, sonic-counter-app, sonic-tickets-app-legacy"); 27710 const serviceURL = containerElement?.getAttribute("serviceURL") || document.location.origin; 27711 let url = new URL(serviceURL, document.location.origin); 27712 if (serviceURL?.startsWith("http")) { 27713 url = new URL(serviceURL); 27714 } 27715 url.pathname = pathName; 27716 return url; 27717 }; 27718 const publishPlanActionMessage = (content) => { 27719 set("defaultMessages", { 27720 messages: [{ content, status: "error" }] 27721 }); 27722 }; 27723 const parsePlanApiResponse = async (response) => { 27724 const raw = await response.text(); 27725 let message = ""; 27726 try { 27727 const parsed = JSON.parse(raw); 27728 message = (parsed.message || "").trim(); 27729 } catch { 27730 message = raw.trim(); 27731 } 27732 const ok = response.ok && (message === "" || message.toLowerCase() === "ok" || message.toLowerCase() === "lib_success"); 27733 return { ok, message: message || (response.ok ? "" : response.statusText) }; 27734 }; 27735 const updateSeatmapStatus = (seatmapProvider) => { 27736 const publisher = seatmapPublisher(seatmapProvider); 27737 const updateStatusRequestIndex = publisher.updateStatusRequestIndex?.get() ?? 0; 27738 publisher.updateStatusRequestIndex?.set(updateStatusRequestIndex + 1); 27739 secondScreen.plan.scheduleViewportBump(); 27740 }; 27741 const confirmSeatmapAction = (options) => { 27742 const { 27743 title, 27744 content = "", 27745 onConfirm, 27746 confirmLabel = t("confirm"), 27747 confirmType = "primary", 27748 confirmIcon = "check", 27749 maxWidth 27750 } = options; 27751 const handleConfirmClick = () => { 27752 void onConfirm(); 27753 }; 27754 const actions = b$1` 27755 <sonic-button 27756 minWidth="10rem" 27757 shape="block" 27758 type=${confirmType} 27759 hideModal 27760 @click=${handleConfirmClick} 27761 > 27762 <sonic-icon name=${confirmIcon} slot="prefix" library="custom"></sonic-icon> 27763 ${confirmLabel} 27764 </sonic-button> 27765 <sonic-button minWidth="10rem" shape="block" hideModal>${t("cancel")}</sonic-button> 27766 `; 27767 const modalOptions = { 27768 title, 27769 content, 27770 maxWidth, 27771 actions, 27772 removeOnHide: true 27773 }; 27774 return Modal.create(modalOptions); 27775 }; 27776 const seatsSelectionInfos = (seatMapProvider, seats) => { 27777 if (!seats.length) return A$1; 27778 if (seats.length === 1) { 27779 const isPlacementLibre = seats[0].positioningType === "2"; 27780 return seatCondensedSummary(seatToSeatingType(seatMapProvider, seats[0]), "md", isPlacementLibre); 27781 } 27782 return seatsTable(seatMapProvider, seats); 27783 }; 27784 const removeSeatSelection = async (options) => { 27785 const { seats, cartProvider, element, entity_id } = options; 27786 const seatmapProvider = element.getSeatmapProvider(); 27787 if (seatmapProvider) { 27788 seats.forEach((seat) => { 27789 seat.panier = false; 27790 seat.enCours = false; 27791 }); 27792 } 27793 await Cart.removeItems({ 27794 apiConfiguration: HTML.getApiConfiguration(element), 27795 cartProvider, 27796 query: { 27797 seat_ids: seats.map((seat) => Number(seat.name)), 27798 entity_type: EntityType.Event, 27799 ...entity_id ? { entity_id } : {} 27800 } 27801 }); 27802 updateSeatmapStatus(seatmapProvider); 27803 }; 27804 const neutraliser = async (seats, eventId, seatmapProvider) => { 27805 const place_ids = seats?.map((seat) => seat.name); 27806 const url = getUrl(`/la_billetterie/plan/api/neutraliser`) + `?id_evenement=${eventId}&id_place=${place_ids?.join(",")}`; 27807 const response = await fetch(url, { 27808 credentials: "include", 27809 mode: "cors" 27810 }); 27811 const { ok, message } = await parsePlanApiResponse(response); 27812 if (ok) { 27813 updateSeatmapStatus(seatmapProvider); 27814 } else if (message) { 27815 publishPlanActionMessage(message); 27816 } 27817 }; 27818 const deNeutraliser = async (seats, eventId, seatmapProvider) => { 27819 const id_place = seats?.map((seat) => seat.name) || []; 27820 const id_evenement = eventId; 27821 const url = getUrl("/la_billetterie/plan/api/decontingenter");
27822 const urlParams = new URLSearchParams(); 27823 for (const id of id_place) { 27824 urlParams.append("id_place[]", id.toString()); 27825 } 27826 if (id_evenement) { 27827 urlParams.append("id_evenement", id_evenement.toString()); 27828 } 27829 url.search = urlParams.toString(); 27830 const response = await fetch(url.toString(), { 27831 credentials: "include", 27832 mode: "cors" 27833 }); 27834 const { ok, message } = await parsePlanApiResponse(response); 27835 if (ok) { 27836 updateSeatmapStatus(seatmapProvider); 27837 } else if (message) { 27838 publishPlanActionMessage(message); 27839 } 27840 }; 27841 const isSeatNeutralised = (seat) => { 27842 return Number(seat.availability) === 1; 27843 }; 27844 const seatsTable = (seatMapProvider, seats) => { 27845 if (!seats?.length) return A$1; 27846 const hasZone = seats.some((place) => place.zone); 27847 const hasPorte = seats.some((place) => place.door); 27848 const hasRang = seats.some((place) => place.range); 27849 return b$1` 27850 <sonic-table bordered maxHeight="10rem" size="sm"> 27851 <sonic-thead> 27852 <sonic-tr> 27853 ${hasZone ? b$1`<sonic-th align="center"> ${t("pl_zone")} </sonic-th>` : A$1} 27854 ${hasPorte ? b$1`<sonic-th align="center"> ${t("pl_porte")} </sonic-th>` : A$1} 27855 ${hasRang ? b$1`<sonic-th align="center"> ${t("pl_rang")} </sonic-th>` : A$1} 27856 <sonic-th align="center"> ${t("pl_numero")} </sonic-th> 27857 <sonic-th align="center"> ${t("pl_type_siege")} </sonic-th> 27858 </sonic-tr> 27859 </sonic-thead> 27860 <sonic-tbody> 27861 ${seats.map((place) => { 27862 const seating = seatToSeatingType(seatMapProvider, place); 27863 const { area, door, row, number, type_of_seat } = seating; 27864 return b$1` <sonic-tr> 27865 ${hasZone ? b$1`<sonic-td align="center"> ${area} </sonic-td>` : A$1} 27866 ${hasPorte ? b$1`<sonic-td align="center"> ${door} </sonic-td>` : A$1} 27867 ${hasRang ? b$1`<sonic-td align="center"> ${row} </sonic-td>` : A$1} 27868 <sonic-td align="center"> ${number} </sonic-td> 27869 <sonic-td align="center"> ${type_of_seat} </sonic-td> 27870 </sonic-tr>`; 27871 })} 27872 </sonic-tbody> 27873 </sonic-table> 27874 `; 27875 }; 27876 const seatToSeatingType = (seatMapProvider, seat) => { 27877 const conf = seatmapPublisher(seatMapProvider).conf?.get(); 27878 if (!conf) { 27879 return { id: Number(seat.name), seatMapId: seat.id_detail }; 27880 } 27881 function getPublicName(key, id) { 27882 const item = conf[key]?.find((item2) => Number(item2.id) === Number(id)); 27883 return item?.nom; 27884 } 27885 const infos = { 27886 area: getPublicName("zone", seat.zone), 27887 rang: getPublicName("rang", seat.row), 27888 numero: getPublicName("numero", seat.seat), 27889 type_siege: getPublicName("type_siege", seat.seatType), 27890 porte: getPublicName("porte", seat.door) 27891 }; 27892 return { 27893 id: Number(seat.name), 27894 area: infos.area, 27895 row: infos.rang, 27896 number: infos.numero, 27897 type_of_seat: infos.type_siege, 27898 door: infos.porte, 27899 seatMapId: seat.id_detail, 27900 common_name: `${infos.area || ""} ${infos.rang || ""}${infos.rang && infos.numero ? "-" : ""}${infos.numero || ""}` 27901 }; 27902 }; 27903 const seatCondensedSummary = (seat, size = "md", isPlacementLibre = false) => { 27904 const { area, door, row, number, type_of_seat } = seat; 27905 const hasArea = !!area; 27906 const hasDoor = !!door; 27907 const hasRow = !!row; 27908 const hasNumber = !!number; 27909 const hasTypeOfSeat = !!type_of_seat; 27910 const labelTextSize = size === "sm" ? "text-2xs" : "text-xs"; 27911 const valueTextSize = size === "sm" ? "text-sm" : "text-base"; 27912 const isChair = type_of_seat && typeOfSeatIsChair(type_of_seat); 27913 return b$1` 27914 <div class="${valueTextSize}"> 27915 ${hasTypeOfSeat ? b$1` 27916 <div 27917 class="text-center ${size === "sm" ? "text-xs" : "text-sm"} ${isChair ? "text-neutral-500" : "text-danger font-bold "}" 27918 > 27919 <sonic-icon name="loveseat" library="custom"></sonic-icon> ${type_of_seat} 27920 </div> 27921 <div class="h-[1px] bg-neutral-200 mt-1 mb-2"></div> 27922 ` : A$1} 27923 <div class="flex divide-x-[1px] divide-neutral-200 w-full justify-center pb-1"> 27924 ${hasArea ? b$1` 27925 <div class="flex flex-col gap-1 items-center pr-3"> 27926 <div class="${labelTextSize} text-neutral-500">${t("pl_zone")}</div> 27927 <div class="font-bold whitespace-nowrap leading-none">${area}</div> 27928 </div> 27929 ` : A$1} 27930 ${hasRow && !isPlacementLibre ? b$1` 27931 <div class="flex flex-col gap-1 items-center px-3"> 27932 <div class="${labelTextSize} text-neutral-500">${t("pl_rang")}</div> 27933 <div class="font-bold whitespace-nowrap leading-none">${row}</div> 27934 </div> 27935 ` : A$1} 27936 ${hasNumber && !isPlacementLibre ? b$1` 27937 <div class="flex flex-col gap-1 items-center px-3"> 27938 <div class="${labelTextSize} text-neutral-500">${t("pl_numero")}</div> 27939 <div class="font-bold whitespace-nowrap leading-none">${number}</div> 27940 </div> 27941 ` : A$1} 27942 ${isPlacementLibre ? b$1` 27943 <div class="flex flex-col gap-1 items-center px-3"> 27944 <div class="${labelTextSize} text-neutral-500">${t("pl_type_placement")}</div> 27945 <div class="font-bold whitespace-nowrap leading-none">${t("placement_libre")}</div> 27946 </div> 27947 ` : A$1} 27948 ${hasDoor ? b$1` 27949 <div class="flex flex-col gap-1 items-center pl-3"> 27950 <div class="${labelTextSize} text-neutral-500">${t("pl_porte")}</div> 27951 <div class="font-bold whitespace-nowrap leading-none">${door}</div> 27952 </div> 27953 ` : A$1} 27954 </div> 27955 </div> 27956 `; 27957 };
27958 const getCategoryFromSeatmapRange = (seatMapProvider, range) => { 27959 const conf = seatmapPublisher(seatMapProvider).conf?.get(); 27960 const category = conf?.categorie?.find((item) => Number(item.id) === Number(range)); 27961 return category ? { id: Number(category.id), title: category.nom.toString(), color: category.couleur?.toString() } : null; 27962 }; 27963 const getQuotaFromSeatmap = (seatMapProvider, seat) => { 27964 const conf = seatmapPublisher(seatMapProvider).conf?.get(); 27965 const quota = conf?.contingentement_interne?.find((item) => Number(item.id) === Number(seat.contingentementInterne)); 27966 return quota ? { 27967 id: Number(quota.id), 27968 title: quota.nom.toString(), 27969 color: quota.couleur?.toString(), 27970 is_public: quota.en_ligne === "1" ? true : false 27971 } : null; 27972 }; 27973 const getCartSeats = (seatmapProvider, cartProvider) => { 27974 const cartId = cartPublisher(cartProvider).get()?.data?.id || 0; 27975 const seats = seatmapPublisher(seatmapProvider).get()?.mainState?.selectedLevel?.chairs || []; 27976 return cartId > 0 ? seats.filter((seat) => Number(seat.id_panier) === Number(cartId)) : seats.filter((seat) => seat.panier); 27977 }; 27978 const selectCartSeats = (seatmapProvider, cartProvider) => { 27979 const cartSeats = getCartSeats(seatmapProvider, cartProvider); 27980 seatmapPublisher(seatmapProvider).selectedSeats?.set(cartSeats); 27981 }; 27982 const resetSelection = (seatmapProvider) => { 27983 seatmapPublisher(seatmapProvider).selectedSeats?.set([]); 27984 }; 27985 const isLockedForever = (status) => { 27986 return [ 27987 ReservationStatus.Deleted, 27988 ReservationStatus.Expired, 27989 ReservationStatus.Processing, 27990 ReservationStatus.Processed, 27991 ReservationStatus.Error, 27992 ReservationStatus.Disabled, 27993 ReservationStatus.DeclinedForever 27994 ].includes(status ?? ReservationStatus.Draft); 27995 }; 27996 const displayExpired = (status) => { 27997 return [ 27998 ReservationStatus.Draft, 27999 ReservationStatus.Pending, 28000 ReservationStatus.PartiallyProcessed, 28001 ReservationStatus.Processed 28002 ].includes(status ?? ReservationStatus.Draft); 28003 }; 28004 const getQuoteTypeLabel = (type) => { 28005 if (type === CartType.ReservationRequest) return "justificatif"; 28006 if (type === QuoteTypeEnum.Proof) return "justificatif"; 28007 return "devis"; 28008 }; 28009 const isReservation = (cartType) => { 28010 return cartType === CartType.Reservation; 28011 }; 28012 const isReservationRequest = (cartType) => { 28013 return cartType === CartType.ReservationRequest; 28014 }; 28015 const isWaitingList = (cartType) => { 28016 return cartType === CartType.WaitingLists; 28017 }; 28018 const isRequest = (cartType) => { 28019 return isReservationRequest(cartType) || isWaitingList(cartType); 28020 }; 28021 const isInitialRequest = (cart) => { 28022 if (!cart) return false; 28023 const noCartOrigin = !cart.cart_origin?.id; 28024 return isRequest(cart?.cartType) && noCartOrigin; 28025 }; 28026 const getCartNumber = (cart) => { 28027 if (!(cart && "id" in cart)) return ""; 28028 const cartOriginId = cart?.cart_origin?.id; 28029 const hasOrigin = isRequest(cart?.cartType) && cartOriginId; 28030 const id = hasOrigin ? cartOriginId : cart?.id; 28031 return id; 28032 }; 28033 const closeParentModal = (element) => { 28034 if (!element) return; 28035 const parentModal = HTML.getClosestElement(element, "sonic-modal"); 28036 parentModal?.hide(); 28037 }; 28038 const getEventsForSubscriptions = async (options) => { 28039 const { apiConfiguration, subscriptions, accessParams, limit } = options; 28040 const api2 = new API(apiConfiguration); 28041 const allSubscriptionIds = subscriptions.map((item) => item?.entity_id?.toString() || ""); 28042 const events = await api2.get( 28043 entityEndPoint({ 28044 entityType: EntityType.Event, 28045 subscriptionTypeIds: allSubscriptionIds, 28046 accessParams, 28047 limit 28048 }) 28049 ); 28050 if (!events.success) return []; 28051 return events.data; 28052 }; 28053 const isSubscriptionRequired = (subscriptionRequirement, appType2) => { 28054 return subscriptionRequirement?.active && appType2 === "customer" ? true : false; 28055 }; 28056 const renderEndingMessage = (cartType, appType2) => { 28057 const label2 = t("LIB_request_created_message"); 28058 const route2 = isReservationRequest(cartType) ? "account.reservationRequests" : "account.waitingLists"; 28059 return b$1`<sonic-alert status="success" label=${label2} size="lg" background> 28060 ${isReservationRequest(cartType) ? b$1` 28061 <sonic-app-link 28062 to="home" 28063 type="success" 28064 variant="default" 28065 autoActive="disabled" 28066 class="mt-2" 28067 @click=${(e2) => {
28068 closeParentModal(e2.target); 28069 }} 28070 > 28071 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 28072 ${t("LIB_retour_accueil")} 28073 </sonic-app-link> 28074 ` : A$1} 28075 ${isWaitingList(cartType) ? b$1` 28076 <sonic-button 28077 to="home" 28078 type="success" 28079 variant="default" 28080 autoActive="disabled" 28081 class="mt-2" 28082 @click=${(e2) => { 28083 closeParentModal(e2.target); 28084 }} 28085 > 28086 <sonic-icon name="check" library="custom"></sonic-icon> 28087 ${t("LIB_terminer")} 28088 </sonic-app-link> 28089 ` : A$1} 28090 ${appType2 === "customer" ? b$1` 28091 <sonic-app-link 28092 to=${route2} 28093 @click=${(e2) => { 28094 closeParentModal(e2.target); 28095 }} 28096 variant="outline" 28097 type="success" 28098 autoActive="disabled" 28099 class="mt-2" 28100 > 28101 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 28102 ${t("LIB_mes_demandes")} 28103 </sonic-app-link> 28104 ` : A$1} 28105 </sonic-alert>`; 28106 }; 28107 var __defProp$37 = Object.defineProperty; 28108 var __getOwnPropDesc$3a = Object.getOwnPropertyDescriptor; 28109 var __decorateClass$3a = (decorators, target, key, kind) => { 28110 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3a(target, key) : target; 28111 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 28112 if (decorator = decorators[i2]) 28113 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 28114 if (kind && result) __defProp$37(target, key, result); 28115 return result; 28116 }; 28117 let SonicSeatSuggest = class extends i$6 { 28118 constructor() { 28119 super(...arguments); 28120 this.sessionId = 0; 28121 this.cartProvider = "cart/current"; 28122 this.cartItems = []; 28123 this.cartEntities = []; 28124 this.seatmapProvider = "seatmap"; 28125 this._seatmapId = 0; 28126 this._suggestions = []; 28127 this._hasSeatsInCart = false; 28128 this._busy = false; 28129 this._fetchKey = ""; 28130 this._refreshGen = 0; 28131 this._fetchPromiseKey = ""; 28132 this._fetchPromise = null; 28133 this._lastAvailability = { available_seats: [], unavailable_seats: [], total_checked: 0 }; 28134 } 28135 updated(changed) { 28136 if (changed.has("sessionId")) { 28137 this._seatmapId = 0; 28138 this._suggestions = []; 28139 this._fetchKey = ""; 28140 this._fetchPromiseKey = ""; 28141 this._fetchPromise = null; 28142 ++this._refreshGen; 28143 } 28144 if (changed.has("sessionId") || changed.has("cartItems") || changed.has("cartEntities")) { 28145 void this.refresh(); 28146 } 28147 } 28148 async refresh() { 28149 if (!this.sessionId) return; 28150 if (!this._seatmapId) { 28151 const sessionId = this.sessionId; 28152 const cached = SonicSeatSuggest.seatmapIdBySession.get(sessionId); 28153 if (cached) { 28154 this._seatmapId = cached; 28155 } else { 28156 const result = await getDefaultApi().get( 28157 entityEndPoint({ 28158 entityType: EntityType.Event, 28159 entityId: sessionId, 28160 accessParams: this.accessParams, 28161 features: [Feature.Settings] 28162 }) 28163 ); 28164 if (sessionId !== this.sessionId) return; 28165 const seatmapId = result?.data?.settings?.seatmapId || 0; 28166 if (seatmapId > 0) SonicSeatSuggest.seatmapIdBySession.set(sessionId, seatmapId); 28167 this._seatmapId = seatmapId; 28168 } 28169 } 28170 if (!this._seatmapId || !this.cartItems.length) { 28171 this._suggestions = []; 28172 this._hasSeatsInCart = false; 28173 return; 28174 } 28175 const suggestions = this.buildSuggestions(this._seatmapId); 28176 if (!suggestions.length) { 28177 this._suggestions = []; 28178 this._hasSeatsInCart = false; 28179 return; 28180 } 28181 const fetchKey = `${this.sessionId}:${this._seatmapId}:${suggestions.map((s2) => s2.seatsSlug).join("|")}`; 28182 if (fetchKey !== this._fetchKey) { 28183 if (this._fetchPromiseKey !== fetchKey) { 28184 this._fetchPromiseKey = fetchKey; 28185 const gen = ++this._refreshGen; 28186 this._fetchPromise = this.checkSeatsAvailability(suggestions).then((availability) => { 28187 if (gen !== this._refreshGen) return; 28188 this._fetchKey = fetchKey; 28189 this._lastAvailability = availability; 28190 }); 28191 } 28192 await this._fetchPromise; 28193 } 28194 this._suggestions = this.filterUnavailableSuggestions(suggestions, this._lastAvailability); 28195 } 28196 hasCartSeatsOnSeatmap(seatmapId) { 28197 return this.cartItems.some((item) => item.seat?.id && item.seat.seatMapId === seatmapId); 28198 } 28199 buildSuggestions(seatmapId) { 28200 if (!this.hasCartSeatsOnSeatmap(seatmapId)) { 28201 return []; 28202 } 28203 const suggestionsMap = /* @__PURE__ */ new Map(); 28204 for (const item of this.cartItems) { 28205 const seatId = item.seat?.id; 28206 if (!seatId || !item.entity_id || item.seat?.seatMapId !== seatmapId) continue; 28207 const sourceSessionId = item.entity_id; 28208 if (!suggestionsMap.has(sourceSessionId)) { 28209 suggestionsMap.set(sourceSessionId, { 28210 sessionId: sourceSessionId,
28211 sessionTitle: this.getSessionTitle(sourceSessionId), 28212 seats: [], 28213 seatsSlug: "", 28214 seatmapId 28215 }); 28216 } 28217 const sessionSuggestion = suggestionsMap.get(sourceSessionId); 28218 sessionSuggestion.seats.push({ 28219 seatId, 28220 shortName: item.seat?.short_name || "", 28221 seat: item.seat, 28222 quotaId: item.quota?.id || 0, 28223 parent: getParentItem(item, this.cartProvider) || {}, 28224 price: item.price 28225 }); 28226 } 28227 const itemsInCart = this.getCurrentSessionCartItems(); 28228 this._hasSeatsInCart = itemsInCart.length > 0; 28229 const suggestionsBySlug = /* @__PURE__ */ new Map(); 28230 for (const suggestion of suggestionsMap.values()) { 28231 suggestion.seats.sort((a2, b2) => a2.shortName.localeCompare(b2.shortName)); 28232 suggestion.seatsSlug = `${suggestion.seatmapId}-${suggestion.seats.map((s2) => s2.seatId).join("-")}`; 28233 suggestionsBySlug.set(suggestion.seatsSlug, suggestion); 28234 } 28235 let suggestions = [...suggestionsBySlug.values()]; 28236 let sortedSuggestionsArray = suggestions.sort((a2, b2) => this.compareSuggestions(a2, b2)); 28237 if (isSubscriptionRequired(this.subscriptionRequirement, this.appType)) { 28238 sortedSuggestionsArray = sortedSuggestionsArray.filter( 28239 (suggestion) => suggestion.seats?.every((seat) => seat.parent.id) 28240 ); 28241 } 28242 return sortedSuggestionsArray; 28243 } 28244 countSubscriptionSeats(suggestion) { 28245 return suggestion.seats.filter((seat) => seat.parent.id).length; 28246 } 28247 compareSuggestions(a2, b2) { 28248 const bySeatCount = b2.seats.length - a2.seats.length; 28249 if (bySeatCount !== 0) { 28250 return bySeatCount; 28251 } 28252 const bySubscriptionCount = this.countSubscriptionSeats(b2) - this.countSubscriptionSeats(a2); 28253 if (bySubscriptionCount !== 0) { 28254 return bySubscriptionCount; 28255 } 28256 return a2.sessionTitle.localeCompare(b2.sessionTitle); 28257 } 28258 getSessionTitle(sessionId) { 28259 const session = this.cartEntities.find( 28260 (entity) => entity.id === sessionId && entity.entity_type === EntityType.Event 28261 ); 28262 return session?.edito?.title || ""; 28263 } 28264 async checkSeatsAvailability(suggestions) { 28265 const empty = { available_seats: [], unavailable_seats: [], total_checked: 0 }; 28266 const seatIds = [...new Set(suggestions.flatMap((s2) => s2.seats.map((seat) => seat.seatId)))]; 28267 if (!seatIds.length) return empty; 28268 const result = await getDefaultApi().post(`/seat-availability/check`, { 28269 event_id: this.sessionId, 28270 seat_ids: seatIds 28271 }); 28272 return result?.data || empty; 28273 } 28274 getCurrentSessionCartItems() { 28275 return this.cartItems.filter( 28276 (item) => Number(item.entity_id) === Number(this.sessionId) && item.entity_type === EntityType.Event && item.seat?.id 28277 ); 28278 } 28279 suggestionMatchesCurrentSessionCart(suggestion) { 28280 const itemsInCart = this.getCurrentSessionCartItems(); 28281 if (!itemsInCart.length || suggestion.seats.length !== itemsInCart.length) return false; 28282 return itemsInCart.every( 28283 (item) => suggestion.seats.some( 28284 (seat) => seat.seatId === item.seat?.id && String(seat.parent.id || "") === String(item.parent_id || "") 28285 ) 28286 ); 28287 } 28288 filterUnavailableSuggestions(suggestions, availability) { 28289 const currentSessionSeatIds = new Set( 28290 this.getCurrentSessionCartItems().map((item) => item.seat?.id).filter((id) => !!id) 28291 ); 28292 const unavailableSeatIds = new Set( 28293 availability.unavailable_seats.filter((seat) => seat.reason !== "in_cart").map((seat) => seat.seat_id) 28294 ); 28295 return suggestions.filter((suggestion) => { 28296 const seatIds = suggestion.seats.map((seat) => seat.seatId); 28297 const isAvailable = !seatIds.some((id) => unavailableSeatIds.has(id) && !currentSessionSeatIds.has(id)); 28298 return isAvailable && !this.suggestionMatchesCurrentSessionCart(suggestion); 28299 }); 28300 } 28301 hasSeatsForCurrentSession() { 28302 return this.getCurrentSessionCartItems().length > 0; 28303 } 28304 async selectSeats(suggestion) { 28305 if (this._busy) return; 28306 this._busy = true;
28307 try { 28308 if (this.hasSeatsForCurrentSession()) { 28309 await Cart.removeItems({ 28310 apiConfiguration: getDefaultApiConfiguration(), 28311 cartProvider: this.cartProvider, 28312 query: { 28313 entity_type: EntityType.Event, 28314 entity_id: this.sessionId 28315 } 28316 }); 28317 } 28318 await Cart.addItems({ 28319 apiConfiguration: getDefaultApiConfiguration(), 28320 cartProvider: this.cartProvider, 28321 items: suggestion.seats.map((seat) => ({ 28322 entity_type: EntityType.Event, 28323 entity_id: this.sessionId, 28324 places_ids: [seat.seatId.toString()], 28325 quota: { id: seat.quotaId || 1 }, 28326 parent_id: seat.parent.id || void 0 28327 })) 28328 }); 28329 updateSeatmapStatus(this.seatmapProvider); 28330 } finally { 28331 this._busy = false; 28332 } 28333 } 28334 render() { 28335 if (!this.sessionId || !this._suggestions.length) return A$1; 28336 const text = this._hasSeatsInCart ? t("change_seats_for") : t("select_seats_quickly"); 28337 const shortText = this._hasSeatsInCart ? t("LIB_change") : t("LIB_add"); 28338 const visibleSuggestions = this._suggestions.slice(0, 2); 28339 return b$1`<sonic-alert background dismissible noIcon> 28340 <div class="flex gap-x-2 gap-y-1 flex-wrap"> 28341 ${o$1(visibleSuggestions, (suggestion) => { 28342 const count = suggestion.seats.length; 28343 return b$1`<sonic-tooltip 28344 label='${text} 28345 ${t("LIB_same_as")} "${suggestion.sessionTitle}"' 28346 > 28347 <sonic-button 28348 ?disabled=${this._busy} 28349 ?loading=${this._busy} 28350 @click=${() => this.selectSeats(suggestion)} 28351 align="left" 28352 size="sm" 28353 variant="outline" 28354 class="w-full lg:w-auto" 28355 > 28356 <div class="py-1"> 28357 <sonic-badge size="xs" type="${this._hasSeatsInCart ? "danger" : "success"}"> 28358 <div class="leading-none font-bold"> 28359 ${shortText} : ${count} 28360 <sonic-icon name="xmark" library="custom" size="sm" class="-mx-1"></sonic-icon> 28361 <sonic-icon name="ticket" library="custom"></sonic-icon> 28362 </div> 28363 </sonic-badge> 28364 28365 <div class=" mt-1 font-bold truncate lg:max-w-[15rem]"> 28366 ${t("LIB_same_as")} "${suggestion.sessionTitle}" 28367 </div> 28368 <div class="truncate"> 28369 <div class="flex gap-x-3 items-center text-xs flex-wrap"> 28370 ${o$1(suggestion.seats, (seat) => { 28371 const { firstName } = seat.parent.owner || {}; 28372 const label2 = getSeatPlacementLabel(seat.seat, "condensed"); 28373 if (!label2) return A$1; 28374 return b$1`<span>${o$6(label2)} ${firstName}</span>`; 28375 })} 28376 </div> 28377 </div> 28378 </div> 28379 </sonic-button> 28380 </sonic-tooltip>`; 28381 })} 28382 </div> 28383 </sonic-alert>`; 28384 } 28385 }; 28386 SonicSeatSuggest.seatmapIdBySession = /* @__PURE__ */ new Map(); 28387 SonicSeatSuggest.styles = [ 28388 tailwind, 28389 i$9` 28390 :host { 28391 display: block; 28392 } 28393 ` 28394 ]; 28395 __decorateClass$3a([ 28396 n$5({ type: Number }) 28397 ], SonicSeatSuggest.prototype, "sessionId", 2); 28398 __decorateClass$3a([ 28399 ancestorAttribute("cartProvider"), 28400 n$5({ type: String, reflect: true }) 28401 ], SonicSeatSuggest.prototype, "cartProvider", 2); 28402 __decorateClass$3a([ 28403 bind$1("${cartProvider}.data.items"), 28404 n$5({ type: Array }) 28405 ], SonicSeatSuggest.prototype, "cartItems", 2); 28406 __decorateClass$3a([ 28407 bind$1("${cartProvider}.data.entities"), 28408 n$5({ type: Array }) 28409 ], SonicSeatSuggest.prototype, "cartEntities", 2); 28410 __decorateClass$3a([ 28411 ancestorAttribute("seatmapProvider"), 28412 n$5({ type: String }) 28413 ], SonicSeatSuggest.prototype, "seatmapProvider", 2); 28414 __decorateClass$3a([ 28415 c({ context: accessParamsContext, subscribe: true }), 28416 n$5({ type: Object }) 28417 ], SonicSeatSuggest.prototype, "accessParams", 2); 28418 __decorateClass$3a([ 28419 c({ context: appType, subscribe: true }) 28420 ], SonicSeatSuggest.prototype, "appType", 2); 28421 __decorateClass$3a([ 28422 r$5() 28423 ], SonicSeatSuggest.prototype, "_seatmapId", 2); 28424 __decorateClass$3a([ 28425 r$5() 28426 ], SonicSeatSuggest.prototype, "_suggestions", 2); 28427 __decorateClass$3a([ 28428 r$5() 28429 ], SonicSeatSuggest.prototype, "_hasSeatsInCart", 2); 28430 __decorateClass$3a([ 28431 r$5() 28432 ], SonicSeatSuggest.prototype, "_busy", 2); 28433 __decorateClass$3a([ 28434 bind$1("settings.subscriptionRequirement"), 28435 r$5() 28436 ], SonicSeatSuggest.prototype, "subscriptionRequirement", 2); 28437 SonicSeatSuggest = __decorateClass$3a([ 28438 t$3("sonic-seat-suggest") 28439 ], SonicSeatSuggest); 28440 const priceEndPoint = (priceContext, accessParams) => {
28441 const { entityType, entityId, parentSubscription } = priceContext ?? {}; 28442 const currentType = entityType || EntityType.Event; 28443 if (!entityId) return ""; 28444 return entityEndPoint({ 28445 entityType: currentType, 28446 entityId, 28447 accessParams, 28448 view: entityView.prices, 28449 subscriptionTypeIds: parentSubscription?.entity_id ? [parentSubscription.entity_id.toString()] : void 0, 28450 subscriptionPriceIds: parentSubscription?.price?.id ? [Number(parentSubscription.price.id)] : void 0 28451 }); 28452 }; 28453 const buyContext = n("buyContext"); 28454 function getAvailablePrices(allPrices, quota, filterByQuota) { 28455 if (!allPrices) return []; 28456 if (filterByQuota && quota) { 28457 const availablePriceIds = quota.prices?.filter((p2) => p2.visible).map((p2) => p2.price_id); 28458 return allPrices.filter((price) => availablePriceIds?.includes(Number(price?.id) || 0)); 28459 } 28460 return allPrices.filter((price) => price?.price_available); 28461 } 28462 function meaningfulPriceCategories(categories) { 28463 return categories.filter((category) => category.id !== 0); 28464 } 28465 function shouldShowCategorySelect(categories) { 28466 const meaningful = meaningfulPriceCategories(categories); 28467 if (meaningful.length > 1) return true; 28468 return meaningful.length === 1 && !!meaningful[0].title; 28469 } 28470 function getPricesForSelectedCategory(showCategorySelect, priceCategories, selectedCategoryId, availablePrices) { 28471 if (!priceCategories.length) { 28472 return availablePrices; 28473 } 28474 const pool = meaningfulPriceCategories(priceCategories); 28475 const categories = pool.length ? pool : priceCategories; 28476 if (categories.length === 1) { 28477 return categories[0].prices; 28478 } 28479 if (showCategorySelect) { 28480 return categories.find((category) => category.id === selectedCategoryId)?.prices ?? categories[0]?.prices ?? []; 28481 } 28482 return categories.flatMap((category) => category.prices); 28483 } 28484 function findMatchingPriceInCategory(categoryPrices, currentPriceId, allPrices) { 28485 if (!categoryPrices.length) return void 0; 28486 const currentPrice = allPrices.find((price) => Number(price.id) === currentPriceId); 28487 if (!currentPrice?.title) return categoryPrices[0]; 28488 return categoryPrices.find((price) => price.title === currentPrice.title) ?? categoryPrices.find((price) => price.id === currentPrice.id) ?? categoryPrices[0]; 28489 } 28490 function syncFormSelection(state, mutators, scope) { 28491 const { selection, selectedCategoryId, selectedPriceId } = state; 28492 if (scope === "quota") { 28493 const aligned = selection.alignAfterQuotaChange(selectedCategoryId, selectedPriceId); 28494 if (aligned.categoryId !== selectedCategoryId) { 28495 mutators.setCategoryId(aligned.categoryId); 28496 } 28497 if (aligned.priceId !== selectedPriceId) { 28498 mutators.setPriceId(aligned.priceId); 28499 } 28500 } 28501 if (scope === "category") { 28502 const alignedPriceId = selection.alignPriceInCategory(selectedCategoryId, selectedPriceId); 28503 if (alignedPriceId !== selectedPriceId) { 28504 mutators.setPriceId(alignedPriceId); 28505 } 28506 } 28507 if (state.shouldShowQuantitySelect) { 28508 const clamped = Math.min(Math.max(state.selectedQuantity, state.minQuantity), state.maxQuantity); 28509 if (clamped !== state.selectedQuantity) { 28510 mutators.setQuantity(clamped); 28511 } 28512 } 28513 } 28514 function buildQuotaPriceSelection(input) { 28515 const quotaId = Number(input.quota?.id) || 0; 28516 const availablePrices = getAvailablePrices(input.allPrices, input.quota, input.filterByQuota); 28517 const categories = buildCategoriesFromStock( 28518 availablePrices, 28519 input.stock, 28520 quotaId, 28521 input.placesCategories, 28522 input.editCategoryId 28523 ); 28524 const displayCategories = meaningfulPriceCategories(categories); 28525 const showCategorySelect = shouldShowCategorySelect(categories); 28526 const defaultCategoryId = () => displayCategories[0]?.id ?? categories[0]?.id ?? 0; 28527 const pricesInCategory = (categoryId) => getPricesForSelectedCategory(showCategorySelect, categories, categoryId, availablePrices); 28528 const alignPriceInCategory = (categoryId, priceId) => { 28529 const pool = pricesInCategory(categoryId); 28530 if (!pool.length) return priceId;
28531 if (pool.some((price) => Number(price.id) === priceId)) return priceId; 28532 return Number(findMatchingPriceInCategory(pool, priceId, input.allPrices)?.id) || Number(pool[0]?.id) || 0; 28533 }; 28534 const alignAfterQuotaChange = (categoryId, priceId) => { 28535 let effectiveCategoryId = categoryId; 28536 if (showCategorySelect || categories.length === 1) { 28537 if (!categories.some((category) => category.id === effectiveCategoryId)) { 28538 effectiveCategoryId = defaultCategoryId(); 28539 } 28540 } else if (!categories.length) { 28541 effectiveCategoryId = 0; 28542 } 28543 return { 28544 categoryId: effectiveCategoryId, 28545 priceId: alignPriceInCategory(effectiveCategoryId, priceId) 28546 }; 28547 }; 28548 const resolvePrice = (categoryId, priceId) => { 28549 const pool = pricesInCategory(categoryId); 28550 return pool.find((price) => Number(price.id) === priceId) ?? findMatchingPriceInCategory(pool, priceId, input.allPrices); 28551 }; 28552 const isCategoryAvailable = (categoryId) => isStockCategoryAvailable(input.stock, quotaId, categoryId); 28553 return { 28554 availablePrices, 28555 categories, 28556 displayCategories, 28557 showCategorySelect, 28558 pricesInCategory, 28559 resolvePrice, 28560 alignAfterQuotaChange, 28561 alignPriceInCategory, 28562 isCategoryAvailable 28563 }; 28564 } 28565 function buildPriceFormView(input) { 28566 const selection = buildQuotaPriceSelection({ 28567 allPrices: input.allPrices, 28568 placesCategories: input.placesCategories, 28569 stock: input.stock, 28570 quota: input.quota, 28571 filterByQuota: input.filterByQuota, 28572 editCategoryId: input.editCategoryId 28573 }); 28574 const selectedPrice = selection.resolvePrice(input.form.categoryId, input.form.priceId) ?? {}; 28575 const prices = selection.pricesInCategory(input.form.categoryId); 28576 const minQuantity = Math.max(1, Number(selectedPrice.price_min_places) || 1); 28577 const maxQuantity = getMaxQuantity(selectedPrice, input.quota); 28578 const quantity = input.form.quantity || minQuantity; 28579 const validation = getPriceFormValidation({ 28580 selectedQuota: input.quota, 28581 mode: input.mode, 28582 initialQuotaId: input.initialQuotaId, 28583 initialCategoryId: input.editCategoryId, 28584 selectedQuotaId: input.form.quotaId, 28585 isCustomerMode: input.isCustomerMode, 28586 selection, 28587 categoryId: input.form.categoryId 28588 }); 28589 const shouldShowQuantitySelect = validation.canSubmit && input.mode === "add" && !input.parentSubscriptionId && prices.length > 0 && maxQuantity > 1 && maxQuantity > minQuantity; 28590 return { 28591 selection, 28592 selectedQuota: input.quota, 28593 selectedPrice, 28594 prices, 28595 validation, 28596 minQuantity, 28597 maxQuantity, 28598 shouldShowQuantitySelect, 28599 submitQuantity: shouldShowQuantitySelect ? quantity : minQuantity, 28600 freePriceAmount: selectedPrice.is_free_price ? input.form.freePriceAmount : void 0 28601 }; 28602 } 28603 function getStockDetailsForQuota(stock, quotaId) { 28604 if (!stock?.details?.length || !quotaId) return []; 28605 return stock.details.filter((detail) => Number(detail.quota_id) === quotaId); 28606 } 28607 function getStockDetailForCategory(stock, quotaId, categoryId) { 28608 const detailsForQuota = getStockDetailsForQuota(stock, quotaId); 28609 const categoryDetail = detailsForQuota.find((detail) => Number(detail.places_category_id) === categoryId); 28610 if (categoryDetail) return categoryDetail; 28611 return detailsForQuota.find((detail) => !detail.places_category_id); 28612 } 28613 function isStockCategoryAvailable(stock, quotaId, categoryId) { 28614 const detail = getStockDetailForCategory(stock, quotaId, categoryId); 28615 if (!detail) return true; 28616 return detail.has_available !== false; 28617 } 28618 function buildCategoriesFromStock(availablePrices, stock, quotaId, placesCategories, editCategoryId) { 28619 const pricesByCategory = groupPricesByCategory(availablePrices, placesCategories); 28620 const metaById = new Map(placesCategories?.map((c2) => [Number(c2.id) || 0, c2]) ?? []); 28621 const pricesById = new Map(pricesByCategory.map((category) => [category.id, category]));
28622 const stockDetails = getStockDetailsForQuota(stock, quotaId); 28623 if (!stockDetails.length) { 28624 return pricesByCategory; 28625 } 28626 const categoryIds = /* @__PURE__ */ new Set(); 28627 for (const detail of stockDetails) { 28628 const id = Number(detail.places_category_id); 28629 if (id) categoryIds.add(id); 28630 } 28631 if (editCategoryId) categoryIds.add(editCategoryId); 28632 return [...categoryIds].sort( 28633 (a2, b2) => (metaById.get(a2)?.weight ?? Infinity) - (metaById.get(b2)?.weight ?? Infinity) || a2 - b2 28634 ).map((categoryId) => { 28635 const fromGrouped = pricesById.get(categoryId); 28636 const meta = metaById.get(categoryId); 28637 return { 28638 id: categoryId, 28639 title: meta?.title || fromGrouped?.title || "", 28640 prices: fromGrouped?.prices ?? [] 28641 }; 28642 }); 28643 } 28644 function groupPricesByCategory(prices, placesCategories) { 28645 const metaById = new Map(placesCategories?.map((c2) => [Number(c2.id) || 0, c2]) ?? []); 28646 const grouped = /* @__PURE__ */ new Map(); 28647 for (const price of prices) { 28648 const id = Number(price.place_category?.id) || 0; 28649 if (!grouped.has(id)) { 28650 const meta = metaById.get(id); 28651 grouped.set(id, { 28652 id, 28653 title: meta?.title || price.place_category?.title || "", 28654 prices: [] 28655 }); 28656 } 28657 grouped.get(id).prices.push(price); 28658 } 28659 return [...grouped.values()].sort( 28660 (a2, b2) => (metaById.get(a2.id)?.weight ?? Infinity) - (metaById.get(b2.id)?.weight ?? Infinity) || a2.id - b2.id 28661 ); 28662 } 28663 function categoriesToOptions(categories, selectedCategoryId) { 28664 return categories.map((category) => { 28665 const wording2 = category.id !== 0 && category.title ? category.title : category.title || t("prices"); 28666 return { 28667 value: String(category.id), 28668 wording: wording2, 28669 selected: category.id === selectedCategoryId 28670 }; 28671 }); 28672 } 28673 function quantityToOptions(max, min = 1, selectedQuantity) { 28674 const cappedMax = Math.min(Math.max(max, min), 50); 28675 return Array.from({ length: cappedMax - min + 1 }, (_2, index) => { 28676 const value = min + index; 28677 return { 28678 value: String(value), 28679 wording: String(value), 28680 selected: selectedQuantity ? value === selectedQuantity : value === min 28681 }; 28682 }); 28683 } 28684 function getMaxQuantity(price, quota, defaultMax = 50) { 28685 let max = defaultMax; 28686 const priceLimits = [price?.price_max_places, price?.price_places_nb].filter( 28687 (value) => value != null && value > 0 28688 ); 28689 if (priceLimits.length) { 28690 max = Math.min(max, ...priceLimits); 28691 } 28692 const quotaRemaining = quota?.remaining_places_nb; 28693 if (quotaRemaining != null && quotaRemaining >= 0) { 28694 max = Math.min(max, quotaRemaining); 28695 } 28696 const min = Math.max(1, Number(price?.price_min_places) || 1); 28697 return Math.max(min, max); 28698 } 28699 function pricesToOptions(prices, { includeCategory = false, selectedPriceId } = {}) { 28700 if (prices.length === 0) { 28701 return [ 28702 { 28703 value: "", 28704 wording: t("no_price_available"), 28705 selected: true 28706 } 28707 ]; 28708 } 28709 return prices.map((price) => { 28710 const categoryTitle = includeCategory && price.place_category?.id !== 0 && price.place_category?.title ? `${price.place_category.title} â ` : ""; 28711 const amountText = price.is_free_price ? "" : ` ⢠${formatAmount(price.amount_display || 0)}`; 28712 const hasAdditionalProducts = price?.additional_products?.length && price?.additional_products?.length > 0; 28713 const additionnalProductsText = hasAdditionalProducts ? `
28713+ ${price?.additional_products?.map((product) => product.name).join(" + ")}` : ""; 28714 return { 28715 value: String(price.id), 28716 wording: `${categoryTitle}${price.title} ${additionnalProductsText} ${amountText}`, 28717 ...selectedPriceId != null && { selected: Number(price.id) === selectedPriceId } 28718 }; 28719 }); 28720 } 28721 function quotasToOptions(quotas, selectedQuotaId, isCounterMode, isCustomerMode) { 28722 return quotas.map((quota) => { 28723 const { remaining_places_nb, total_places_nb } = quota; 28724 let remainingInfo = ""; 28725 if (isCounterMode) { 28726 remainingInfo = `(reste : ${remaining_places_nb}/${total_places_nb})`; 28727 } else if (isCustomerMode) { 28728 remainingInfo = quota.has_remaining === false || remaining_places_nb === 0 ? b$1` â (${t("indisponible")})` : ""; 28729 } 28730 return { 28731 value: String(quota.id), 28732 wording: b$1`${quota.title} ${remainingInfo}`, 28733 selected: quota.id === selectedQuotaId 28734 }; 28735 }); 28736 } 28737 function isQuotaUnavailable(quota, isCustomerMode) { 28738 if (!quota) return false; 28739 if (isCustomerMode) { 28740 if (quota.has_remaining === false) return true; 28741 if (quota.has_remaining === true) return false; 28742 } 28743 return quota.remaining_places_nb === 0; 28744 } 28745 function filterQuotasForCustomer(quotas) { 28746 return quotas.filter((quota) => quota.prices?.some((p2) => p2.visible)); 28747 } 28748 function createItemsToAdd({ 28749 entity_id, 28750 entity_type, 28751 parent_id, 28752 selectedQuotaId, 28753 selectedPriceId, 28754 freePriceAmount, 28755 quantity = 1 28756 }) { 28757 return [ 28758 { 28759 entity_type, 28760 entity_id, 28761 parent_id, 28762 quantity, 28763 quota: { id: selectedQuotaId }, 28764 price: { 28765 id: selectedPriceId, 28766 ...freePriceAmount && { is_free_price: true, amount: freePriceAmount } 28767 } 28768 } 28769 ]; 28770 } 28771 const PRICE_MESSAGES = { 28772 noPriceAvailable: t("no_price_available"), 28773 noPriceAvailableOnline: t("titre_fallback_tarifs_placement"),
28774 noPriceAvailableOnlineSubtitle: t("fallback_tarifs_placement"), 28775 pricesSoldOut: t("prices_sold_out"), 28776 save: t("enregistrer"), 28777 add: t("LIB_add") 28778 }; 28779 function isEditOnInitialConfig(input) { 28780 const { mode: mode2, initialQuotaId, selectedQuotaId, initialCategoryId, categoryId } = input; 28781 if (mode2 !== "edit" || initialQuotaId == null) return false; 28782 if (Number(initialQuotaId) !== Number(selectedQuotaId)) return false; 28783 if (initialCategoryId != null && initialCategoryId > 0) { 28784 return Number(categoryId) === Number(initialCategoryId); 28785 } 28786 return true; 28787 } 28788 function getPriceFormValidation(input) { 28789 const { 28790 selectedQuota, 28791 mode: mode2, 28792 initialQuotaId, 28793 initialCategoryId, 28794 selectedQuotaId, 28795 isCustomerMode, 28796 selection, 28797 categoryId 28798 } = input; 28799 const editOnInitialConfig = isEditOnInitialConfig({ 28800 mode: mode2, 28801 initialQuotaId, 28802 selectedQuotaId, 28803 initialCategoryId, 28804 categoryId 28805 }); 28806 const quotaUnavailable = isQuotaUnavailable(selectedQuota, isCustomerMode); 28807 const noPriceInQuota = selectedQuota?.prices?.length === 0; 28808 const cantAddPrice = mode2 === "add" && quotaUnavailable || quotaUnavailable && initialQuotaId !== selectedQuotaId; 28809 const noPriceAndCustomer = !editOnInitialConfig && (noPriceInQuota || quotaUnavailable) && isCustomerMode; 28810 if (cantAddPrice || noPriceAndCustomer) { 28811 const selectedQuotaMatchUFR = titleMatchesUFR(selectedQuota); 28812 const noPriceMessage = selectedQuotaMatchUFR ? PRICE_MESSAGES.noPriceAvailableOnline : PRICE_MESSAGES.noPriceAvailable; 28813 return { 28814 canSubmit: false, 28815 errorMessage: noPriceInQuota || quotaUnavailable ? noPriceMessage : PRICE_MESSAGES.pricesSoldOut, 28816 errorSubtitle: selectedQuotaMatchUFR ? PRICE_MESSAGES.noPriceAvailableOnlineSubt
28816itle : void 0 28817 }; 28818 } 28819 if (!editOnInitialConfig && selection?.showCategorySelect && categoryId && !selection.isCategoryAvailable(categoryId)) { 28820 return { canSubmit: false, errorMessage: PRICE_MESSAGES.pricesSoldOut }; 28821 } 28822 return { canSubmit: true }; 28823 } 28824 function titleMatchesUFR(quota) { 28825 const textToTest = ["ufr", "pmr", "mobilité réduite", "handicapé", "fauteuil roulant", "U.F.R.", "P.M.R."]; 28826 return textToTest.some((text) => quota?.title?.toLowerCase().includes(text) ?? false); 28827 } 28828 const priceRange = ({ min, max, is_free_price }) => { 28829 const minAmount = min || 0; 28830 const maxAmount = is_free_price ? max || void 0 : max || 0; 28831 if (min === max && !is_free_price) return b$1`${formatAmount(minAmount)}`; 28832 if (minAmount && !maxAmount) return b$1`${t("pl_from_price_long")} ${formatAmount(minAmount)}`; 28833 if (!min && maxAmount) return b$1`${t("pl_to_price_long")} ${formatAmount(maxAmount || 0)}`; 28834 if (min && maxAmount) return b$1`${formatAmount(minAmount)} ${t("pl_to_price")} ${formatAmount(maxAmount || 0)}`; 28835 return A$1; 28836 }; 28837 var __defProp$36 = Object.defineProperty; 28838 var __getOwnPropDesc$39 = Object.getOwnPropertyDescriptor; 28839 var __decorateClass$39 = (decorators, target, key, kind) => { 28840 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$39(target, key) : target; 28841 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 28842 if (decorator = decorators[i2]) 28843 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 28844 if (kind && result) __defProp$36(target, key, result); 28845 return result; 28846 }; 28847 let SeatmapSeatPopover = class extends Subscriber$1(i$6) { 28848 constructor() { 28849 super(...arguments); 28850 this.hoveredSeat = null; 28851 this.dataProvider = "seatmap"; 28852 this._isPlacementLibre = false; 28853 this._seatInfos = null; 28854 this.visible = false; 28855 this._mouseMoveHandler = null; 28856 this._lastMousePosition = null; 28857 this._seatmapViewContainer = null; 28858 } 28859 handleHoveredSeatContactChange(contact) { 28860 if (!this._seatInfos) return; 28861 this._seatInfos.owner = contact || {}; 28862 this.requestUpdate(); 28863 if (this._lastMousePosition) { 28864 this.updatePopoverPosition( 28865 new MouseEvent("mousemove", { 28866 clientX: this._lastMousePosition.clientX, 28867 clientY: this._lastMousePosition.clientY 28868 }) 28869 ); 28870 } 28871 } 28872 handleHoveredSeatInfoControlChange(control) { 28873 if (!this._seatInfos) return; 28874 this._seatInfos.control = control || void 0; 28875 this.requestUpdate(); 28876 if (this._lastMousePosition) { 28877 this.updatePopoverPosition( 28878 new MouseEvent("mousemove", { 28879 clientX: this._lastMousePosition.clientX, 28880 clientY: this._lastMousePosition.clientY 28881 }) 28882 ); 28883 } 28884 } 28885 connectedCallback() { 28886 super.connectedCallback(); 28887 this._seatmapViewContainer = HTML.getClosestElement(this, "sonic-seatmap-view"); 28888 this.style.visibility = "hidden"; 28889 this._mouseMoveHandler = (e2) => { 28890 this.updatePopoverPosition(e2); 28891 this._lastMousePosition = { clientX: e2.clientX, clientY: e2.clientY }; 28892 }; 28893 window.addEventListener("mousemove", this._mouseMoveHandler); 28894 } 28895 /** 28896 * Met à jour la position du popover en fonction de la position de la souris, 28897 * en évitant les débordements du conteneur et de la fenêtre. 28898 */ 28899 updatePopoverPosition(e2) { 28900 if (!this._seatmapViewContainer) return; 28901 const OFFSET_Y = 20; 28902 const MARGIN = 10; 28903 const containerRect = this._seatmapViewContainer.getBoundingClientRect(); 28904 const popoverRect = this.getBoundingClientRect(); 28905 const relativeX = e2.clientX - containerRect.left; 28906 const relativeY = e2.clientY - containerRect.top; 28907 const popoverWidth = popoverRect.width || 200; 28908 const popoverHeight = popoverRect.height || 100; 28909 let left = relativeX; 28910 let top = relativeY + OFFSET_Y; 28911 let transformX = "translateX(-50%)"; 28912 const halfWidth = popoverWidth / 2; 28913 const minLeft = MARGIN; 28914 const maxLeft = containerRect.width - MARGIN; 28915 if (left - halfWidth < minLeft) { 28916 left = minLeft + halfWidth; 28917 transformX = "translateX(-50%)"; 28918 } else if (left + halfWidth > maxLeft) { 28919 left = maxLeft - halfWidth; 28920 transformX = "translateX(-50%)"; 28921 } 28922 const minTop = MARGIN; 28923 const maxTop = containerRect.height - popoverHeight - MARGIN; 28924 if (top < minTop) { 28925 top = minTop; 28926 } else if (top + popoverHeight > maxTop) { 28927 top = relativeY - popoverHeight - OFFSET_Y; 28928 if (top < minTop) { 28929 top = minTop; 28930 } 28931 } 28932 this.style.left = `${left}px`; 28933 this.style.top = `${top}px`; 28934 this.style.transform = transformX; 28935 } 28936 disconnectedCallback() { 28937 super.disconnectedCallback(); 28938 if (this._mouseMoveHandler) { 28939 window.removeEventListener("mousemove", this._mouseMoveHandler); 28940 } 28941 } 28942 willUpdate(changedProperties) { 28943 if (changedProperties.has("hoveredSeat")) { 28944 if (this.hoveredSeat?.seat) { 28945 const scorePointPreview = this.hoveredSeat.info?.scorePointPreview === true; 28946 if (scorePointPreview) { 28947 this._seatInfos = { 28948 seating: {}, 28949 theoreticalScore: this.hoveredSeat.info?.theoreticalScore, 28950 scorePointPreview: true 28951 }; 28952 } else { 28953 const ownerFromCart = getSeatOwnerFromCart( 28954 Number(this.hoveredSeat.seat.name), 28955 this.getAncestorAttributeValue("cartProvider") 28956 ); 28957 const hasOwnerFromCart = Object.keys(ownerFromCart || {}).length > 0; 28958 const owner = hasOwnerFromCart ? ownerFromCart : this.hoveredSeat.contact;
28959 const seatMapProvider = this.dataProvider || "seatmap"; 28960 const category = getCategoryFromSeatmapRange(seatMapProvider, this.hoveredSeat.seat.range); 28961 const quota = getQuotaFromSeatmap(seatMapProvider, this.hoveredSeat.seat); 28962 const modifiedQuota = this.hoveredSeat?.info?.modifications?.properties?.find( 28963 (property2) => property2.name === "Quota" 28964 ); 28965 this._seatInfos = { 28966 seating: seatToSeatingType(seatMapProvider, this.hoveredSeat.seat), 28967 owner, 28968 category: category ?? void 0, 28969 quota: quota ?? void 0, 28970 previousQuotaName: modifiedQuota?.newValue ? modifiedQuota.value : void 0, 28971 control: this.hoveredSeat.info?.control ?? void 0, 28972 theoreticalScore: this.hoveredSeat.info?.theoreticalScore 28973 }; 28974 } 28975 this.visible = true; 28976 this._isPlacementLibre = this.hoveredSeat.seat.positioningType === "2"; 28977 this.style.visibility = "visible"; 28978 } else { 28979 this.visible = false; 28980 this._isPlacementLibre = false; 28981 this.style.visibility = "hidden"; 28982 } 28983 } 28984 } 28985 render() { 28986 if (!this._seatInfos) { 28987 return A$1; 28988 } 28989 if (this._seatInfos.scorePointPreview) { 28990 return b$1` 28991 <div class="shadow-md bg-neutral-0 rounded-md px-3 py-2 ">${this.renderTheoreticalScore(true)}</div> 28992 `; 28993 } 28994 return b$1` 28995 <div class="shadow-md bg-neutral-0 rounded-md px-3 py-2 "> 28996 ${seatCondensedSummary(this._seatInfos.seating, "sm", this._isPlacementLibre)} ${this.renderCategory()} 28997 ${this.renderQuota()} ${this.renderOwner()} ${this.renderControl()} ${this.renderTheoreticalScore()} 28998 </div> 28999 `; 29000 } 29001 renderTheoreticalScore(standalone = false) { 29002 const score = this._seatInfos?.theoreticalScore; 29003 if (score == null) return A$1; 29004 const value = Number.isFinite(score) ? String(Math.round(score * 100) / 100) : "â"; 29005 const borderClass = standalone ? "" : "border-t-[1px] border-neutral-200 pt-2 mt-2"; 29006 const title = standalone || this._seatInfos?.scorePointPreview ? "Score hors donnée de siège" : "Score calculé"; 29007 return b$1`<div class="text-xs ${borderClass} text-center whitespace-nowrap"> 29008 ${title} : <span class="font-bold">${value}</span> 29009 </div>`; 29010 } 29011 renderCategory() { 29012 if (!this._seatInfos?.category) return A$1; 29013 const { title, color } = this._seatInfos.category; 29014 return b$1`<div 29015 class="text-xs border-t-[1px] border-neutral-200 pt-2 mt-2 text-center flex gap-2 justify-center whitespace-nowrap " 29016 > 29017 <div class="w-[13px] h-[13px] rounded-full" style="background-color: ${"#" + color}"></div> 29018 ${title} ${this.renderAmount()} 29019 </div>`; 29020 } 29021 renderQuota() { 29022 if (!this._seatInfos?.quota) return A$1; 29023 const { title, color, is_public } = this._seatInfos.quota; 29024 const isCustomer = this.appType === "customer"; 29025 const isCounter = this.appType === "counter"; 29026 const isHorsContingent = this._seatInfos.quota.id === 1; 29027 if (isCustomer && !is_public) return A$1; 29028 if (isCustomer && isHorsContingent) return A$1; 29029 return b$1`<div class="text-2xs mt-1 text-center whitespace-nowrap leading-tight"> 29030 <div class="flex items-center gap-2 justify-center"> 29031 ${isCounter && !isHorsContingent ? b$1` <div class="w-[7px] h-[7px] rounded mb-[1px]" style="background-color: ${"#" + color}"></div>` : A$1} 29032 <div class="uppercase">${title}</div> 29033 </div> 29034 ${isCounter && this._seatInfos.previousQuotaName ? b$1`<div class="text-neutral-500 text-2xs"> 29035 <sonic-icon name="clock-rotate-left" library="custom" class="shrink-0 mr-1"></sonic-icon>${this._seatInfos.previousQuotaName} 29036 </div>` : A$1} 29037 </div>`; 29038 } 29039 renderControl() { 29040 if (this.appType !== "counter" || !this._seatInfos?.control) return A$1; 29041 const createrAt = Number(this._seatInfos.control.created); 29042 const formattedDate = new Date(createrAt).toLocaleDateString("fr-FR", { 29043 day: "2-digit", 29044 month: "2-digit", 29045 year: "numeric", 29046 hour: "2-digit", 29047 minute: "2-digit" 29048 }); 29049 if (!createrAt) return A$1; 29050 return b$1`<div class="text-2xs mt-1 text-center whitespace-nowrap leading-tight text-neutral-500"> 29051 <div class="flex items-center gap-1 justify-center"> 29052 <sonic-icon name="barcode-scan" library="custom" class="shrink-0"></sonic-icon>${formattedDate} 29053 </div> 29054 </div>`; 29055 } 29056 renderOwner() { 29057 if (!this._seatInfos?.owner || Object.keys(this._seatInfos.owner).length === 0) return A$1; 29058 const { firstName, lastName, structure, isProfessional } = this._seatInfos.owner; 29059 const isAnonymous = !firstName && !lastName && !structure; 29060 return b$1`<div 29061 class="text-xs border-t-[1px] border-neutral-200 pt-2 mt-2 text-center flex gap-2 justify-center whitespace-nowrap" 29062 > 29063 <sonic-icon name="${isProfessional ? "user-tie" : "user"}" library="custom" class="shrink-0"></sonic-icon> 29064 <div> 29065 ${isAnonymous ? t("Anonyme") : b$1`${firstName} ${lastName} ${structure ? b$1`<div>${structure}</div>` : A$1}`} 29066 </div> 29067 </div>`; 29068 } 29069 renderAmount() { 29070 const noOwner = !this._seatInfos?.owner || Object.keys(this._seatInfos.owner).length === 0; 29071 const categoryId = this._seatInfos?.category?.id; 29072 if (noOwner) return b$1`⢠${this.renderPriceRangeForCategory(categoryId || 0)}`; 29073 const lineItemCart = getLineItemCartForSeat( 29074 Number(this.hoveredSeat?.seat?.name), 29075 this.getAncestorAttributeValue("cartProvider") 29076 ); 29077 if (!lineItemCart) return A$1; 29078 const price = lineItemCart.price; 29079 if (!price) return A$1; 29080 const amount = price.amount; 29081 if (!amount) return A$1;
29082 return b$1`⢠${formatAmount(amount)}`; 29083 } 29084 renderPriceRangeForCategory(categoryId) { 29085 if (!this.availablePrices) return A$1; 29086 const pricesForCategory = this.availablePrices.filter((price) => price.place_category?.id === categoryId); 29087 if (pricesForCategory.length === 0) return b$1`<span class="text-danger">${t("no_price_available")}</span>`; 29088 const minPrice = Math.min(...pricesForCategory.map((price) => price.amount || 0)); 29089 const maxPrice = Math.max(...pricesForCategory.map((price) => price.amount || 0)); 29090 return priceRange({ min: minPrice, max: maxPrice, is_free_price: false }); 29091 } 29092 }; 29093 SeatmapSeatPopover.styles = [ 29094 tailwind, 29095 i$9` 29096 :host { 29097 position: absolute; 29098 pointer-events: none; 29099 z-index: 1000; 29100 visibility: hidden; 29101 display: block; 29102 opacity: 0; 29103 transition: opacity 0.2s linear; 29104 } 29105 :host([visible]) { 29106 opacity: 1; 29107 } 29108 ` 29109 ]; 29110 __decorateClass$39([ 29111 n$5({ type: Object }) 29112 ], SeatmapSeatPopover.prototype, "hoveredSeat", 2); 29113 __decorateClass$39([ 29114 ancestorAttribute("dataProvider") 29115 ], SeatmapSeatPopover.prototype, "dataProvider", 2); 29116 __decorateClass$39([ 29117 c({ context: appType, subscribe: true }), 29118 r$5() 29119 ], SeatmapSeatPopover.prototype, "appType", 2); 29120 __decorateClass$39([ 29121 r$5() 29122 ], SeatmapSeatPopover.prototype, "_isPlacementLibre", 2); 29123 __decorateClass$39([ 29124 onAssign(seatmapFormKey.hoveredSeat.contact.path) 29125 ], SeatmapSeatPopover.prototype, "handleHoveredSeatContactChange", 1); 29126 __decorateClass$39([ 29127 onAssign(seatmapFormKey.hoveredSeat.info.control.path) 29128 ], SeatmapSeatPopover.prototype, "handleHoveredSeatInfoControlChange", 1); 29129 __decorateClass$39([ 29130 r$5() 29131 ], SeatmapSeatPopover.prototype, "_seatInfos", 2); 29132 __decorateClass$39([ 29133 n$5({ type: Boolean, reflect: true }) 29134 ], SeatmapSeatPopover.prototype, "visible", 2); 29135 __decorateClass$39([ 29136 n$5({ type: Array }) 29137 ], SeatmapSeatPopover.prototype, "availablePrices", 2); 29138 SeatmapSeatPopover = __decorateClass$39([ 29139 t$3("sonic-seatmap-seat-popover") 29140 ], SeatmapSeatPopover); 29141 const seatsContext = n("seatsContext"); 29142 var BuyMode = /* @__PURE__ */ ((BuyMode2) => { 29143 BuyMode2["DEFAULT"] = "default"; 29144 BuyMode2["AUTOSEATING"] = "autoseating"; 29145 BuyMode2["SEAT"] = "seat"; 29146 BuyMode2["SEATMAPVIEW"] = "seatmapview"; 29147 return BuyMode2; 29148 })(BuyMode || {}); 29149 function isDefaultMode(buyMode) { 29150 return buyMode === "default"; 29151 } 29152 function isAutoseatingMode(buyMode) { 29153 return buyMode === "autoseating"; 29154 } 29155 function isSeatMode(buyMode) { 29156 return buyMode === "seat"; 29157 } 29158 function isSeatmapviewMode(buyMode) { 29159 return buyMode === "seatmapview"; 29160 } 29161 function showsInlineRates(buyMode, hasSeatmap = false) { 29162 if (isAutoseatingMode(buyMode) || isSeatMode(buyMode)) { 29163 return true; 29164 } 29165 return !hasSeatmap; 29166 } 29167 function showsEventMapLink(buyMode, hasSeatmap = false) { 29168 return hasSeatmap && isDefaultMode(buyMode); 29169 } 29170 var __defProp$35 = Object.defineProperty; 29171 var __getOwnPropDesc$38 = Object.getOwnPropertyDescriptor; 29172 var __decorateClass$38 = (decorators, target, key, kind) => { 29173 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$38(target, key) : target; 29174 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 29175 if (decorator = decorators[i2]) 29176 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 29177 if (kind && result) __defProp$35(target, key, result); 29178 return result; 29179 }; 29180 let PlacementBuyBlock = class extends i$6 { 29181 constructor() { 29182 super(...arguments); 29183 this.seatsContext = [];
29184 this.seatMapProvider = "seatmap"; 29185 this.disablePrices = false; 29186 } 29187 connectedCallback() { 29188 if (!this.accessParams) { 29189 this.accessParams = getAccessParamsFromUrl(); 29190 } 29191 super.connectedCallback(); 29192 } 29193 willUpdate(_changedProperties) { 29194 this.disablePrices = false; 29195 const isCustomer = this.appType === "customer"; 29196 if (_changedProperties.has("seatsContext") || _changedProperties.has("appType") || _changedProperties.has("seatMapProvider")) { 29197 if (!this.seatsContext?.length) { 29198 return; 29199 } 29200 const seatmapConf = seatmapPublisher(this.seatMapProvider).conf?.get(); 29201 if (!seatmapConf) { 29202 return; 29203 } 29204 const seatTypeId = this.seatsContext[0].seatType; 29205 const seatTypeVueIsUfr = seatmapConf.type_siege.find((item) => Number(item.id) === Number(seatTypeId))?.vue === "ufr"; 29206 const currentQuotaId = this.seatsContext[0].contingentementInterne; 29207 const currentQuotaIsPublic = seatmapConf.contingentement_interne.find((item) => Number(item.id) === Number(currentQuotaId))?.en_ligne === "1"; 29208 this.disablePrices = isCustomer && seatTypeVueIsUfr && !currentQuotaIsPublic; 29209 } 29210 super.willUpdate(_changedProperties); 29211 } 29212 render() { 29213 return b$1`
29214 ${seatsSelectionInfos(this.seatMapProvider, this.seatsContext)} ${this.renderRates()} 29215 ${this.renderCounterActions()} 29216 `; 29217 } 29218 renderRates() { 29219 if (!this.priceContext?.entityId) return A$1; 29220 const oneSeat = this.seatsContext.length === 1; 29221 const allSeatsAreNeutralised = this.seatsContext.every((seat) => isSeatNeutralised(seat)); 29222 if (allSeatsAreNeutralised) { 29223 return A$1; 29224 } 29225 const endpoint = priceEndPoint(this.priceContext, this.accessParams); 29226 const categoryId = Number(this.seatsContext?.[0].range); 29227 const quotaId = Number(this.seatsContext?.[0].contingentementInterne); 29228 const counterActions = getCounterSeatmapActions(this.seatMapProvider); 29229 const lockSeatContingentSelection = this.appType === "counter" && !!counterActions && counterActions.canChangeSeatContingent === false; 29230 return b$1` 29231 <div class="flex gap-4 flex-col pt-5 ${oneSeat ? "border-t-[1px] border-neutral-200 mt-1" : ""}"> 29232 ${this.disablePrices ? this.renderFallback() : b$1` 29233 <sonic-fetch loader="inline" dataProvider=${endpoint} key="data"> 29234 <sonic-buy-event-block 29235 cartProvider=${this.cartProvider} 29236 categoryId=${o$4(categoryId)} 29237 .selectedQuota=${{ id: quotaId }} 29238 formType="buttons" 29239 disableButtonMultiSelect 29240 .buyMode=${BuyMode.SEAT} 29241 ?lockSeatContingentSelection=${lockSeatContingentSelection} 29242 noSuffix 29243 size="sm" 29244 ></sonic-buy-event-block> 29245 </sonic-fetch> 29246 `} 29247 </div> 29248 `; 29249 } 29250 renderFallback() { 29251 return b$1` 29252 <sonic-alert label="${t("titre_fallback_tarifs_placement")}" status="warning" class="my-3" background> 29253 ${t("fallback_tarifs_placement")} 29254 </sonic-alert> 29255 `; 29256 } 29257 renderCounterActions() { 29258 if (this.appType !== "counter") return A$1; 29259 const eventId = this.priceContext?.entityId; 29260 const actions = getCounterSeatmapActions(this.seatMapProvi
29260der); 29261 const mayUnneutralize = !actions || actions.canUnneutralizeSeats; 29262 const mayNeutralize = !actions || actions.canNeutralizeSeats; 29263 const displayDeneutralise = mayUnneutralize && this.seatsContext.length > 0 && this.seatsContext.every((seat) => isSeatNeutralised(seat)); 29264 const displayNeutralise = mayNeutralize && this.seatsContext.length > 0 && this.seatsContext.every((seat) => { 29265 return Number(seat.availability) === 2 && !seat.panier && !seat.reserved && !seat.enCours && !seat.vendu; 29266 }); 29267 if (!eventId) return A$1; 29268 return b$1` 29269 ${displayDeneutralise ? b$1` 29270 <sonic-button 29271 variant="outline" 29272 shape="block" 29273 class="mt-6" 29274 @click=${async () => { 29275 await deNeutraliser(this.seatsContext, eventId, this.seatMapProvider); 29276 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 29277 parentModal?.hide(); 29278 }} 29279 > 29280 <sonic-icon library="custom" name="unlock"></sonic-icon> 29281 ${t("LIB_deneutraliser")}</sonic-button 29282 > 29283 ` : A$1} 29284 ${displayNeutralise ? b$1` 29285 <sonic-divider class="my-6"></sonic-divider> 29286 <sonic-button 29287 variant="outline" 29288 shape="block" 29289 @click=${async () => { 29290 await neutraliser(this.seatsContext, eventId, this.seatMapProvi
29290der); 29291 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 29292 parentModal?.hide(); 29293 }} 29294 > 29295 <sonic-icon library="custom" name="lock"></sonic-icon> 29296 ${t("LIB_neutraliser")}</sonic-button 29297 > 29298 ` : A$1} 29299 `; 29300 } 29301 }; 29302 PlacementBuyBlock.styles = [ 29303 tailwind, 29304 i$9` 29305 :host { 29306 position: relative; 29307 z-index: 0; 29308 } 29309 .remove-space { 29310 margin-top: -1rem; 29311 } 29312 ` 29313 ]; 29314 __decorateClass$38([ 29315 e$2({ context: seatsContext }), 29316 n$5({ type: Array }) 29317 ], PlacementBuyBlock.prototype, "seatsContext", 2); 29318 __decorateClass$38([ 29319 e$2({ context: buyContext }), 29320 n$5({ type: Object }) 29321 ], PlacementBuyBlock.prototype, "priceContext", 2); 29322 __decorateClass$38([ 29323 ancestorAttribute("seatmapProvider"), 29324 n$5({ type: String }) 29325 ], PlacementBuyBlock.prototype, "seatMapProvider", 2); 29326 __decorateClass$38([ 29327 n$5({ type: String }) 29328 ], PlacementBuyBlock.prototype, "cartProvider", 2); 29329 __decorateClass$38([ 29330 c({ context: accessParamsContext, subscribe: true }), 29331 n$5({ type: Object }) 29332 ], PlacementBuyBlock.prototype, "accessParams", 2); 29333 __decorateClass$38([ 29334 c({ context: appType, subscribe: true }), 29335 r$5() 29336 ], PlacementBuyBlock.prototype, "appType", 2); 29337 __decorateClass$38([ 29338 r$5() 29339 ], PlacementBuyBlock.prototype, "disablePrices", 2); 29340 PlacementBuyBlock = __decorateClass$38([ 29341 t$3("sonic-placing-buy-block") 29342 ], PlacementBuyBlock); 29343 var CounterMode = /* @__PURE__ */ ((CounterMode2) => { 29344 CounterMode2["BUY"] = "COUNTER_MODE_BUY"; 29345 CounterMode2["MOVE"] = "COUNTER_MODE_MOVE"; 29346 return CounterMode2; 29347 })(CounterMode || {}); 29348 var SeatmapMode = /* @__PURE__ */ ((SeatmapMode2) => { 29349 SeatmapMode2["CART_ADD"] = "cart-add"; 29350 SeatmapMode2["CART_EDIT"] = "cart-edit"; 29351 SeatmapMode2["TRANSACTION"] = "transaction"; 29352 return SeatmapMode2; 29353 })(SeatmapMode || {}); 29354 const SEATMAP_MODES = { 29355 [ 29356 "cart-add" 29357 /* CART_ADD */ 29358 ]: { 29359 initialCounterMode: "COUNTER_MODE_BUY", 29360 allowModeSwitch: true, 29361 allowAddToCart: true 29362 }, 29363 [ 29364 "cart-edit" 29365 /* CART_EDIT */ 29366 ]: { 29367 initialCounterMode: "COUNTER_MODE_MOVE", 29368 allowModeSwitch: true, 29369 allowAddToCart: true 29370 }, 29371 [ 29372 "transaction" 29373 /* TRANSACTION */ 29374 ]: { 29375 initialCounterMode: "COUNTER_MODE_MOVE", 29376 allowModeSwitch: false, 29377 allowAddToCart: false 29378 } 29379 }; 29380 function getSeatmapModeOptions(mode2) { 29381 return SEATMAP_MODES[mode2]; 29382 } 29383 var SeatColorMode = /* @__PURE__ */ ((SeatColorMode2) => { 29384 SeatColorMode2["CATEGORY"] = "categorie"; 29385 SeatColorMode2["QUOTAS"] = "contingent"; 29386 return SeatColorMode2; 29387 })(SeatColorMode || {}); 29388 var __defProp$34 = Object.defineProperty; 29389 var __getOwnPropDesc$37 = Object.getOwnPropertyDescriptor; 29390 var __decorateClass$37 = (decorators, target, key, kind) => { 29391 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$37(target, key) : target; 29392 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 29393 if (decorator = decorators[i2]) 29394 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 29395 if (kind && result) __defProp$34(target, key, result); 29396 return result; 29397 };
29398 let PricesTable = class extends i$6 { 29399 constructor() { 29400 super(...arguments); 29401 this.seatmapProvider = "seatmap"; 29402 this.eventId = 0; 29403 this._places_categories = []; 29404 this._prices = []; 29405 } 29406 willUpdate(changedProperties) { 29407 if (changedProperties.has("eventId") && this.eventId) { 29408 this.getPrices(); 29409 } 29410 } 29411 async getPrices() { 29412 if (!this.eventId) { 29413 return; 29414 } 29415 const api2 = new API(HTML.getApiConfiguration(this)); 29416 const endpoint = entityEndPoint({ 29417 entityType: EntityType.Event, 29418 entityId: this.eventId, 29419 accessParams: this.accessParams, 29420 view: entityView.prices 29421 }); 29422 const result = await api2.get(endpoint); 29423 if (result?.success && result?.data) { 29424 this._prices = result.data.prices || []; 29425 this._places_categories = result.data.places_categories || []; 29426 } 29427 } 29428 render() { 29429 const nbCategories = this._places_categories.length; 29430 return b$1`<div class="@container"> 29431 <div 29432 class="grid grid-cols-1 ${nbCategories > 1 ? "@lg:grid-cols-2" : ""} ${nbCategories > 2 ? "@2xl:grid-cols-3" : ""} gap-3 mb-4" 29433 > 29434 ${c$1( 29435 this._places_categories, 29436 (category) => category.id, 29437 (category) => { 29438 const categoryFromSeatmap = this.seatMapData?.conf?.categorie?.find( 29439 (item) => Number(item.id) === Number(category.id) 29440 ); 29441 const color = "#" + categoryFromSeatmap?.couleur?.toString(); 29442 const pricesMatchesCategory = this._prices?.filter((price) => { 29443 return price.place_category?.id === category.id; 29444 }); 29445 const pricesMatchesCategoryAvailable = pricesMatchesCategory?.filter((price) => price.price_available) || []; 29446 return b$1`<sonic-table size="xs" bordered> 29447 <sonic-thead> 29448 <sonic-tr> 29449 <sonic-th colspan="2"> 29450 <div class="text-sm flex items-center gap-x-2 w-full"> 29451 <div class="size-3 rounded-full inline-flex " style="background-color: ${color}"></div> 29452 ${category.title} 29453 ${pricesMatchesCategoryAvailable?.length ? b$1` <sonic-badge size="2xs" class="ml-auto"> 29454 <sonic-price-range 29455 class="white-space-nowrap lowercase" 29456 .prices=${pricesMatchesCategory || []} 29457 dataProvider=${`pricesRange/${pricesMatchesCategory?.map((price) => price.id).join(",")}`} 29458 ></sonic-price-range 29459 ></sonic-badge>` : A$1} 29460 </div> 29461 </sonic-th> 29462 </sonic-tr> 29463 </sonic-thead> 29464 29465 <sonic-tbody> 29466 ${c$1( 29467 pricesMatchesCategory || [], 29468 (price) => price.id, 29469 (price) => { 29470 return b$1` 29471 <sonic-tr class="${price.price_available ? "" : "opacity-50"}"> 29472 <sonic-td>${price.title}</sonic-td> 29473 <sonic-td align="right">
29473${formatAmount(price.amount_display || 0)}</sonic-td> 29474 </sonic-tr> 29475 `; 29476 } 29477 )} 29478 </sonic-tbody> 29479 </sonic-table>`; 29480 } 29481 )} 29482 </div> 29483 </div>`; 29484 } 29485 }; 29486 PricesTable.styles = [tailwind]; 29487 __decorateClass$37([ 29488 bind(seatmapKey), 29489 n$5({ type: Object }) 29490 ], PricesTable.prototype, "seatMapData", 2); 29491 __decorateClass$37([ 29492 ancestorAttribute("seatmapProvider"), 29493 n$5({ type: String }) 29494 ], PricesTable.prototype, "seatmapProvider", 2); 29495 __decorateClass$37([ 29496 n$5({ type: Number }) 29497 ], PricesTable.prototype, "eventId", 2); 29498 __decorateClass$37([ 29499 r$5() 29500 ], PricesTable.prototype, "_places_categories", 2); 29501 __decorateClass$37([ 29502 r$5() 29503 ], PricesTable.prototype, "_prices", 2); 29504 __decorateClass$37([ 29505 c({ context: accessParamsContext, subscribe: true }), 29506 n$5({ type: Object }) 29507 ], PricesTable.prototype, "accessParams", 2); 29508 PricesTable = __decorateClass$37([ 29509 t$3("sonic-prices-table") 29510 ], PricesTable); 29511 var __defProp$33 = Object.defineProperty; 29512 var __getOwnPropDesc$36 = Object.getOwnPropertyDescriptor; 29513 var __decorateClass$36 = (decorators, target, key, kind) => { 29514 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$36(target, key) : target; 29515 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 29516 if (decorator = decorators[i2]) 29517 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 29518 if (kind && result) __defProp$33(target, key, result); 29519 return result; 29520 }; 29521 let SonicSeatmapHelpButton = class extends i$6 { 29522 constructor() { 29523 super(...arguments); 29524 this.variant = "default"; 29525 this.size = "sm"; 29526 this.seatmapProvider = "seatmap"; 29527 this.eventId = 0; 29528 this.mode = "icon"; 29529 } 29530 openModal() { 29531 if (this.appType === "counter") { 29532 this.openModalCounter(); 29533 } else { 29534 this.openModalCustomer(); 29535 } 29536 } 29537 openModalCounter() { 29538 Modal.create({ 29539 title: "Utilisation du plan au guichet", 29540 content: b$1` 29541 <div style="font-size:1.25rem; font-weight: bold;">Sélection multiple par rectangle</div> 29542 Maintenir la touche <b>Maj</b> et le bouton gauche de la souris enfoncés.<br /> 29543 Faire glisser la souris pour définir le rectangle de sélection.<br /> 29544 Relâcher le bouton pour sélectionner effectivement les places entourées par le rectangle. 29545 <div style="font-size:1.25rem; font-weight: bold; margin-top:.8rem;">Sélection multiple par dessin.</div> 29546 Maintenir la touche <b>Ctrl</b> et le bouton gauche de la souris enfoncés.<br /> 29547 Dessiner la sélection en passant sur les places choisies.<br /> 29548 <div style="font-size:1.25rem; font-weight: bold; margin-top:.8rem;">Désélectionner des places</div> 29549 Si l'on maintient la touche <b>Alt</b> enfoncée pendant une sélection par rectangle ou par dessin, alors les 29550 places choisies seront retirées de la sélection en cours. Si on clique dans le plan en dehors d'un place 29551 sélectionnée sans maintenir soit la touche <b>Maj</b> soit la touche <b>Ctrl</b> enfoncée, alors la sélection en 29552 cours est annulée. 29553 <div style="font-size:1.25rem; font-weight: bold; margin-top:.8rem;">Ajout au panier</div> 29554 Si aucune place n'est sélectionnée le clique sur une place quelcqonque l'ajoute directement au panier.<br /> 29555 L'ajout au panier d'une sélection multiple se fait en cliquant sur une des places de la sélection. 29556 `, 29557 removeOnHide: true 29558 }); 29559 } 29560 legendContent() { 29561 return b$1`<div class="text-xs "> 29562 <sonic-divider></sonic-divider> 29563 <div class="flex items-center gap-2 mb-2"> 29564 <div class="shrink-0 size-6 bg-success rounded-full flex items-center justify-center"></div> 29565 <div>${t("LIB_help_seatmap_available")}</div> 29566 </div> 29567 <sonic-divider></sonic-divider> 29568 <div class="flex items-center gap-2 mb-2"> 29569 <div class="shrink-0 size-6 bg-neutral-100 rounded-full flex items-center justify-center"></div> 29570 <div>${t("LIB_help_seatmap_unavailable")}</div> 29571 </div>
29572 <sonic-divider></sonic-divider> 29573 <div class="flex items-center gap-2 mb-2"> 29574 <div class="shrink-0 size-6 bg-info text-info-content rounded-full flex items-center justify-center"> 29575 <sonic-icon name="wheelchair" library="custom"></sonic-icon> 29576 </div> 29577 <div class="text-balance">${t("LIB_help_seatmap_wheelchair_users")}</div> 29578 </div> 29579 <sonic-divider></sonic-divider> 29580 <div class="flex items-center gap-2 mb-2"> 29581 <div class="shrink-0 size-6 bg-info text-info-content rounded-full flex items-center justify-center"> 29582 <img 29583 class="w-5" 29584 src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.0' width='200.000000pt' height='200.000000pt' viewBox='0 0 200.000000 200.000000' preserveAspectRatio='xMidYMid meet'%3E%3Cg transform='translate(0.000000,200.000000) scale(0.100000,-0.100000)' fill='%23ffffff' stroke='none'%3E%3Cpath d='M490 1711 c-40 -39 -46 -72 -23 -118 25 -53 79 -73 129 -49 41 19 68 73 59 117 -16 74 -112 103 -165 50z'/%3E%3Cpath d='M442 1480 c-18 -11 -36 -30 -41 -43 -4 -12 -18 -149 -30 -305 -19 -247 -28 -313 -71 -527 -28 -135 -50 -256 -50 -269 0 -28 29 -56 58 -56 45 0 55 27 117 317 52 246 63 283 80 287 11 3 23 2 26 -2 4 -4 39 -135 78 -292 73 -288 86 -320 128 -320 22 0 65 48 59 68 -3 9 -35 143 -71 297 l-65 281 2 184 3 185 131 -122 c73 -68 139 -123 147 -123 9 0 25 12 37 27 l21 26 -124 126 c-68 69 -150 155 -183 190 -32 35 -73 70 -91 77 -48 21 -122 18 -161 -6z'/%3E%3Cpath d='M1250 1472 c-44 -22 -62 -56 -56 -107 6 -53 43 -85 97 -85 81 0 126 87 82 161 -10 16 -26 32 -38 35 -11 3 -27 7 -35 10 -8 2 -31 -4 -50 -14z'/%3E%3Cpath d='M1245 1243 c-11 -3 -30 -14 -42 -26 -23 -20 -23 -25 -23 -254 l0 -233 158 0 157 0 100 -101 c55 -55 111 -106 125 -113 51 -26 111 20 97 75 -3 13 -71 88 -150 167 l-144 142 -66 0 -67 0 0 55 0 55 90 0 90 0 0 35 0 35 -90 0 -90 0 0 44 c0 55 -13 92 -37 105 -25 13 -83 21 -108 14z'/%3E%3Cpath d='M1071 1053 c-103 -44 -185 -134 -221 -243 -33 -97 -26 -214 18 -302 39 -79 120 -159 199 -196 50 -23 71 -27 153 -27 86 0 101 3 162 32 85 40 147 97 187 173 35 64 33 77 -15 113 -23 17 -24 17 -24 0 -1 -68 -92 -178 -181 -218 -150 -67 -337 1 -409 150 -77 159 -17 352 135 431 52 27 55 31 55 67 0 41 -6 43 -59 20z'/%3E%3C/g%3E%3C/svg%3E" 29585 /> 29586 </div> 29587 <div class="text-balance">${t("LIB_help_seatmap_wheelchair_helpers")}</div> 29588 </div> 29589 <sonic-divider></sonic-divider> 29590 </div> `; 29591 } 29592 openModalCustomer() { 29593 Modal.create({ 29594 styleSheet: [tailwind], 29595 title: b$1`${unsafeWording("titre_aide_placement")}`, 29596 content: b$1`${withAccessParams( 29597 this.accessParams, 29598 b$1`<sonic-prices-table seatmapProvider=${this.seatmapProvider} eventId=${this.eventId}></sonic-prices-table>` 29599 )} 29600 ${this.legendContent()} ${unsafeWording("aide_placement")}`, 29601 removeOnHide: true 29602 }); 29603 } 29604 render() { 29605 if (!this.appType) return A$1; 29606 if (this.mode === "icon") { 29607 return b$1` 29608 <sonic-tooltip placement="left" label=${t("pl_aide_tarif")} class="pointer-events-auto"> 29609 <sonic-button 29610 variant=${this.variant} 29611 size=${this.size} 29612 type="default" 29613 @click=${this.openModal} 29614 shape="circle" 29615 icon 29616 > 29617 <sonic-icon name="question" library="custom"></sonic-icon> 29618 </sonic-button> 29619 </sonic-tooltip> 29620 `; 29621 } 29622 return b$1` 29623 <sonic-button variant=${this.variant} size=${this.size} type="default" @click="${this.openModal}"> 29624 <sonic-icon name="circle-question" library="custom"></sonic-icon> ${t("pl_aide_tarif")} 29625 </sonic-button> 29626 `; 29627 } 29628 }; 29629 SonicSeatmapHelpButton.styles = [tailwind]; 29630 __decorateClass$36([ 29631 n$5({ type: String }) 29632 ], SonicSeatmapHelpButton.prototype, "variant", 2); 29633 __decorateClass$36([ 29634 n$5({ type: String }) 29635 ], SonicSeatmapHelpButton.prototype, "size", 2); 29636 __decorateClass$36([ 29637 c({ context: appType, subscribe: true }), 29638 r$5() 29639 ], SonicSeatmapHelpButton.prototype, "appType", 2); 29640 __decorateClass$36([ 29641 n$5({ type: String }) 29642 ], SonicSeatmapHelpButton.prototype, "seatmapProvider", 2); 29643 __decorateClass$36([ 29644 n$5({ type: Number }) 29645 ], SonicSeatmapHelpButton.prototype, "eventId", 2); 29646 __decorateClass$36([ 29647 n$5({ type: String }) 29648 ], SonicSeatmapHelpButton.prototype, "mode", 2); 29649 __decorateClass$36([ 29650 c({ context: accessParamsContext, subscribe: true }), 29651 n$5({ type: Object }) 29652 ], SonicSeatmapHelpButton.prototype, "accessParams", 2); 29653 SonicSeatmapHelpButton = __decorateClass$36([ 29654 t$3("sonic-seatmap-help-button") 29655 ], SonicSeatmapHelpButton); 29656 const SEATMAP_CANVAS_EVENT = { 29657 seatmapEventId: "seatmapEventId", 29658 planChanged: "planChanged", 29659 seatmapDestroy: "seatmapDestroy" 29660 }; 29661 let sourceSeq = 0; 29662 class SeatmapToSecondScreenBridge { 29663 constructor(host) { 29664 this.host = host; 29665 this.sourceId = `seatmap-${++sourceSeq}`; 29666 this.canvas = null; 29667 this.lastPublishedEventId = 0; 29668 this.onInteract = () => { 29669 if (!this.host.eventId) return; 29670 secondScreen.plan.set(this.host.eventId, this.sourceId); 29671 }; 29672 this.onSeatmapConfChanged = (conf) => { 29673 const eventId = conf?.eventId ?? 0; 29674 if (!eventId) return; 29675 this.publishEventId(eventId); 29676 }; 29677 this.onSeatmapEventId = (e2) => { 29678 const seatmapEvent = e2; 29679 const eventId = Number(seatmapEvent.detail?.eventId) || this.host.eventId; 29680 if (!eventId) return; 29681 this.publishEventId(eventId); 29682 secondScreen.plan.bumpRevision(); 29683 }; 29684 this.onSeatmapPlanChanged = () => { 29685 secondScreen.plan.scheduleViewportBump(); 29686 }; 29687 this.onSeatmapDestroy = () => { 29688 secondScreen.plan.clear(this.sourceId); 29689 }; 29690 if (host.isSecondScreen) return; 29691 this.publishEventId(host.eventId); 29692 host.addEventListener("pointerdown", this.onInteract, true); 29693 host.addEventListener("focusin", this.onInteract); 29694 dp$1(`${host.seatmapProvider}.conf`).onAssign(this.onSeatmapConfChanged); 29695 this.watchCanvas(); 29696 } 29697 dispose() { 29698 if (this.host.isSecondScreen) return; 29699 this.host.removeEventListener("pointerdown", this.onInteract, true); 29700 this.host.removeEventListener("focusin", this.onInteract); 29701 this.unbindCanvasEvents(); 29702 this.canvasObserver?.disconnect(); 29703 this.canvasObserver = void 0; 29704 secondScreen.plan.clear(this.sourceId); 29705 } 29706 publishEventId(eventId) { 29707 if (!eventId || eventId === this.lastPublishedEventId) return; 29708 this.lastPublishedEventId = eventId; 29709 secondScreen.plan.set(eventId, this.sourceId); 29710 } 29711 watchCanvas() { 29712 const root = this.host.shadowRoot; 29713 if (!root) return; 29714 this.canvasObserver = new MutationObserver(() => this.bindCanvasEvents()); 29715 this.canvasObserver.observe(root, { childList: true, subtree: true }); 29716 this.bindCanvasEvents(); 29717 } 29718 bindCanvasEvents() { 29719 const canvas2 = this.host.shadowRoot?.querySelector("canvas") ?? null; 29720 if (canvas2 === this.canvas) return; 29721 this.unbindCanvasEvents(); 29722 if (!canvas2) return; 29723 this.canvas = canvas2; 29724 canvas2.addEventListener(SEATMAP_CANVAS_EVENT.seatmapEventId, this.onSeatmapEventId); 29725 canvas2.addEventListener(SEATMAP_CANVAS_EVENT.planChanged, this.onSeatmapPlanChanged); 29726 canvas2.addEventListener(SEATMAP_CANVAS_EVENT.seatmapDestroy, this.onSeatmapDestroy); 29727 } 29728 unbindCanvasEvents() { 29729 if (!this.canvas) return; 29730 this.canvas.removeEventListener(SEATMAP_CANVAS_EVENT.seatmapEventId, this.onSeatmapEventId); 29731 this.canvas.removeEventListener(SEATMAP_CANVAS_EVENT.planChanged, this.onSeatmapPlanChanged); 29732 this.canvas.removeEventListener(SEATMAP_CANVAS_EVENT.seatmapDestroy, this.onSeatmapDestroy); 29733 this.canvas = null; 29734 } 29735 } 29736 function resolveAppType$1(appType2) { 29737 if (appType2) { 29738 return appType2; 29739 } 29740 if (typeof document !== "undefined" && document.querySelector("sonic-counter-app, sonic-counter-app-legacy")) { 29741 return "counter"; 29742 } 29743 return "customer"; 29744 } 29745 ({ 29746 placement_type: PlacementType.AUTO 29747 }); 29748 function isStoredPlacementType(value) { 29749 return value === PlacementType.AUTO || value === PlacementType.MANUAL; 29750 } 29751 function normalizeSwitchPlacementType(placementType) { 29752 return placementType === PlacementType.AUTO ? PlacementType.AUTO : PlacementType.MANUAL; 29753 } 29754 function resolvePlacementPreferences(config, stored = {}) { 29755 return { 29756 placement_type: resolvePlacementType({ 29757 config, 29758 storedPlacementType: isStoredPlacementType(stored.placement_type) ? stored.placement_type : void 0 29759 }) 29760 }; 29761 } 29762 function getVisiblePlacementTypes(config) { 29763 const availableModes = config?.available_modes ?? "both"; 29764 if (availableModes === PlacementType.AUTO) { 29765 return [PlacementType.AUTO]; 29766 } 29767 if (availableModes === PlacementType.MANUAL) { 29768 return []; 29769 } 29770 const isManualDefault = config?.default_mode === PlacementType.MANUAL; 29771 return isManualDefault ? [PlacementType.MANUAL, PlacementType.AUTO] : [PlacementType.AUTO, PlacementType.MANUAL]; 29772 } 29773 function isAutoOnlyPlacement(config) { 29774 return config?.available_modes === PlacementType.AUTO; 29775 } 29776 function resolvePlacementType({ 29777 config, 29778 storedPlacementType, 29779 fallback = PlacementType.AUTO 29780 }) { 29781 const availableModes = config?.available_modes ?? "both"; 29782 const defaultMode = config?.default_mode === PlacementType.MANUAL ? PlacementType.MANUAL : PlacementType.AUTO; 29783 if (availableModes === PlacementType.AUTO) { 29784 return PlacementType.AUTO; 29785 } 29786 if (availableModes === PlacementType.MANUAL) { 29787 return PlacementType.MANUAL; 29788 } 29789 if (storedPlacementType === PlacementType.AUTO || storedPlacementType === PlacementType.MANUAL) { 29790 return storedPlacementType; 29791 } 29792 return defaultMode ?? fallback; 29793 } 29794 var __defProp$32 = Object.defineProperty; 29795 var __getOwnPropDesc$35 = Object.getOwnPropertyDescriptor; 29796 var __decorateClass$35 = (decorators, target, key, kind) => { 29797 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$35(target, key) : target; 29798 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 29799 if (decorator = decorators[i2]) 29800 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 29801 if (kind && result) __defProp$32(target, key, result); 29802 return result; 29803 }; 29804 const scriptId = "seatmap-view-script"; 29805 const AUTO_ONLY_HINT_KEY = "LIB_seatmap_auto_only_hint"; 29806 const AUTO_ONLY_HINT_FALLBACK = "Seul le placement automatique est autorisé."; 29807 let SonicSeatmapView = class extends i$6 { 29808 constructor() { 29809 super(...arguments); 29810 this.eventId = 0; 29811 this.seatmapId = 0; 29812 this.roomId = 0; 29813 this.seatId = 0; 29814 this.move = 0; 29815 this.clickService = ""; 29816 this.editMode = SeatmapMode.CART_ADD; 29817 this._selectedSeats = []; 29818 this.isSecondScreen = false;
29819 this._availablePrices = []; 29820 this._items = null; 29821 this._displayMove = false; 29822 this._highlightAutoButton = false; 29823 this.cartProvider = "cart/current"; 29824 this.seatmapProvider = "seatmap"; 29825 this._lastAutoOnlyHintAt = 0; 29826 this.updateSeats = async (e2) => { 29827 if (!this.allowsSeatClickHandler()) { 29828 return; 29829 } 29830 const seats = e2.detail; 29831 if (allSeatsInCartContext(seats, this.cartProvider)) { 29832 this.confirmRemoveSeatsFromCart(seats); 29833 return; 29834 } 29835 if (this.isAutoOnlyCustomer) { 29836 resetSelection(this.seatmapProvider); 29837 this.getSeatmapInstanceRenderer()?.updateFromRoomData(false); 29838 this.showAutoOnlyHint(); 29839 return; 29840 } 29841 const addToCartModal = () => { 29842 Modal.create({ 29843 maxWidth: "50rem", 29844 content: withAccessParams( 29845 this.accessParams, 29846 b$1` 29847 <sonic-placing-buy-block 29848 .priceContext=${this.priceContext || { 29849 entityType: EntityType.Event, 29850 entityId: this.eventId 29851 }} 29852 seatmapProvider=${this.seatmapProvider} 29853 .seatsContext=${seats} 29854 .cartProvider=${this.cartProvider} 29855 ></sonic-placing-buy-block> 29856 ` 29857 ) 29858 }); 29859 }; 29860 const isSubscriptionContext = !!this.priceContext?.parentSubscription; 29861 if (isSubscriptionContext) { 29862 const currentPlaceCategory = Number(seats[0].range); 29863 const prices = this._availablePrices?.filter( 29864 (price) => Number(price.place_category?.id) === currentPlaceCategory && price.price_available 29865 ); 29866 if (prices?.length === 1) { 29867 const seatmap = this.getSeatmapInstanceRenderer(); 29868 if (seatmap) { 29869 const roomControl = seatmap.get_roomCtrl(); 29870 seats.forEach((seat) => { 29871 const seatData = roomControl.getChairData(seat.name); 29872 seatData.panier = true; 29873 seatData.enCours = true; 29874 }); 29875 seatmap.updateFromRoomData(false); 29876 } 29877 const items = seats.map((seat) => { 29878 return { 29879 entity_type: EntityType.Event, 29880 entity_id: this.priceContext?.entityId, 29881 quantity: 1, 29882 parent_id: this.priceContext?.parentSubscription?.id, 29883 price: { id: prices[0].id }, 29884 places_ids: [seat.name.toString()], 29885 quota: { 29886 id: Number(seat.contingentementInterne) || 1 29887 } 29888 }; 29889 }); 29890 const addToCartRequest = await Cart.addItems({ 29891 apiConfiguration: HTML.getApiConfiguration(this), 29892 cartProvider: this.cartProvider, 29893 items, 29894 accessParams: this.accessParams 29895 }); 29896 if (addToCartRequest === "asRequested") { 29897 const cartItemsAddedEvent = new CustomEvent("cartItemsAdded", { 29898 detail: { 29899 cartItems: items 29900 } 29901 }); 29902 this.dispatchEvent(cartItemsAddedEvent); 29903 }
29904 this.getSeatmapInstanceRenderer()?.reloadOnlindeChairsData(seats); 29905 } else { 29906 addToCartModal(); 29907 } 29908 } else { 29909 addToCartModal(); 29910 } 29911 this.getSeatmapInstanceRenderer()?.reloadOnlindeChairsData(seats); 29912 }; 29913 this.setupMap = () => { 29914 const win = window; 29915 if (this.isEditMode()) { 29916 win.Editor.init(this, PublisherManager, HTML); 29917 } else { 29918 if (this.mapInstance) { 29919 this.mapInstance.destroy(); 29920 this.mapInstance = void 0; 29921 } 29922 this.mapInstance = new win.placement.front.Initializer(this, PublisherManager, HTML); 29923 } 29924 }; 29925 this.timeoutId = null; 29926 } 29927 handleCounterModeChange(counterMode) { 29928 if (!counterMode) { 29929 return; 29930 } 29931 this._counterMode = counterMode; 29932 } 29933 getSeatmapInstanceRenderer() { 29934 return this.mapInstance?.renderer; 29935 } 29936 getSeatmapProvider() { 29937 return this.seatmapProvider || "seatmap"; 29938 } 29939 get modeOptions() { 29940 return getSeatmapModeOptions(this.editMode); 29941 } 29942 get isAutoOnlyCustomer() { 29943 return this.appType === "customer" && isAutoOnlyPlacement(this._customerPlacementConfig); 29944 } 29945 allowsBuyMode() { 29946 if (this.isAutoOnlyCustomer) { 29947 return false; 29948 } 29949 return this.modeOptions.allowModeSwitch; 29950 } 29951 allowsMoveMode() { 29952 return !this.isAutoOnlyCustomer; 29953 } 29954 /** Ãcoute les clics plan : retrait panier en auto-only, ajout/retrait sinon selon le mode. */ 29955 allowsSeatClickHandler() { 29956 if (this.isAutoOnlyCustomer) { 29957 return true; 29958 } 29959 return this.modeOptions.allowAddToCart; 29960 } 29961 getAutoOnlyHintMessage() { 29962 if (isWordingReady(AUTO_ONLY_HINT_KEY)) { 29963 const translated = get$2(`sonic-wording.wording_${AUTO_ONLY_HINT_KEY}`); 29964 if (typeof translated === "string" && translated.length > 0) { 29965 return translated; 29966 } 29967 } 29968 return AUTO_ONLY_HINT_FALLBACK; 29969 } 29970 showAutoOnlyHint() { 29971 const now = Date.now(); 29972 if (now - this._lastAutoOnlyHintAt < 2e3) { 29973 return; 29974 } 29975 this._lastAutoOnlyHintAt = now; 29976 const toast = { 29977 text: this.getAutoOnlyHintMessage(), 29978 status: "info" 29979 }; 29980 SonicToast.add(toast); 29981 this.pulseAutoPlacementButton(); 29982 } 29983 pulseAutoPlacementButton() { 29984 if (this._highlightAutoButtonTimeout) { 29985 clearTimeout(this._highlightAutoButtonTimeout); 29986 } 29987 this._highlightAutoButton = true; 29988 this._highlightAutoButtonTimeout = setTimeout(() => { 29989 this._highlightAutoButton = false; 29990 this._highlightAutoButtonTimeout = void 0; 29991 }, 1700); 29992 } 29993 clearAutoPlacementHighlight() { 29994 if (this._highlightAutoButtonTimeout) { 29995 clearTimeout(this._highlightAutoButtonTimeout); 29996 this._highlightAutoButtonTimeout = void 0; 29997 } 29998 this._highlightAutoButton = false; 29999 } 30000 handleSelectedSeatsChange(selectedSeats) { 30001 this._selectedSeats = selectedSeats; 30002 } 30003 // 30004 confirmRemoveSeatsFromCart(seats) { 30005 const title = seats.length > 1 ? t("pl_confirm_remove_seats_from_cart") : t("pl_confirm_remove_seat_from_cart"); 30006 const removeOptions = { 30007 seats, 30008 cartProvider: this.cartProvider, 30009 element: this, 30010 entity_id: Number(this.priceContext?.entityId) || this.eventId || void 0 30011 }; 30012 const onConfirm = () => removeSeatSelection(removeOptions); 30013 const confirmOptions = { 30014 title, 30015 content: seatsTable(this.getSeatmapProvider(), seats), 30016 confirmLabel: t("LIB_remove"), 30017 confirmType: "danger", 30018 confirmIcon: "trash", 30019 maxWidth: "50rem", 30020 onConfirm 30021 }; 30022 confirmSeatmapAction(confirmOptions); 30023 } 30024 isEditMode() { 30025 return this.hasAttribute("edit"); 30026 } 30027 async loadScript() { 30028 const mode2 = this.isEditMode() ? "edit" : "front"; 30029 const modedScriptId = `${scriptId}-${mode2}`; 30030 const existingScript = document.getElementById(modedScriptId); 30031 if (existingScript && SonicSeatmapView.isSeatMapCodeLoaded) { 30032 await SonicSeatmapView.isSeatMapCodeLoaded; 30033 this.setupMap(); 30034 return; 30035 } 30036 if (SonicSeatmapView.isLoadingScript && SonicSeatmapView.isSeatMapCodeLoaded) { 30037 await SonicSeatmapView.isSeatMapCodeLoaded; 30038 this.setupMap(); 30039 return; 30040 } 30041 SonicSeatmapView.isLoadingScript = true; 30042 SonicSeatmapView.isSeatMapCodeLoaded = new Promise((resolve, reject) => { 30043 const path = "/sites/all/modules/lb_placement/plan_interactif/bin/"; 30044 const fileName = this.isEditMode() ? "salle-edit" : "salle-front"; 30045 let serviceURL = HTML.getAncestorAttributeValue(this, "serviceURL"); 30046 if (!serviceURL) { 30047 serviceURL = document.location.origin; 30048 } 30049 let baseURL = path; 30050 if (serviceURL.startsWith("http")) { 30051 const url = new URL(serviceURL); 30052 baseURL = url.origin + path; 30053 } 30054 const script = document.createElement("script"); 30055 script.id = modedScriptId; 30056 script.type = "text/javascript"; 30057 script.src = baseURL + fileName + ".js?" + getCacheKey(); 30058 script.addEventListener("error", () => { 30059 SonicSeatmapView.isLoadingScript = false;
30060 reject(new Error(`Failed to load script: ${script.src}`)); 30061 }); 30062 script.addEventListener("load", () => { 30063 SonicSeatmapView.isLoadingScript = false; 30064 this.setupMap(); 30065 resolve(true); 30066 }); 30067 document.head.appendChild(script); 30068 }); 30069 } 30070 isVisible() { 30071 return this.getBoundingClientRect().width > 0; 30072 } 30073 syncSeatmapProviderAttribute() { 30074 if (!this.seatmapProvider) { 30075 this.seatmapProvider = "seatmap"; 30076 } 30077 this.setAttribute("seatmapProvider", this.seatmapProvider); 30078 } 30079 connectedCallback() { 30080 super.connectedCallback(); 30081 const appType2 = HTML.getAncestorAttributeValue(this, "appType"); 30082 if (appType2 && appType2 === "counter") { 30083 this.appType = "counter"; 30084 } 30085 if (this.timeoutId) { 30086 cancelAnimationFrame(this.timeoutId); 30087 this.timeoutId = null; 30088 return; 30089 } 30090 try { 30091 this.syncSeatmapProviderAttribute(); 30092 } catch (e2) { 30093 console.error(e2); 30094 } 30095 if (!this.priceContext && this.eventId) { 30096 this.priceContext = { 30097 entityType: EntityType.Event, 30098 entityId: this.eventId 30099 }; 30100 } 30101 this.secondScreenBridge = new SeatmapToSecondScreenBridge(this); 30102 } 30103 firstUpdated(_changedProperties) { 30104 this.loadScript(); 30105 } 30106 configEventSeats(_selectedSeats) { 30107 this.syncSeatClickHandler(); 30108 } 30109 syncSeatClickHandler() { 30110 const canvas2 = this.shadowRoot?.querySelector("canvas"); 30111 canvas2?.removeEventListener("addToCartRequest", this.updateSeats); 30112 if (!this.allowsSeatClickHandler()) { 30113 return; 30114 } 30115 canvas2?.addEventListener("addToCartRequest", this.updateSeats); 30116 } 30117 disconnectedCallback() { 30118 if (this.timeoutId) { 30119 cancelAnimationFrame(this.timeoutId); 30120 this.timeoutId = null; 30121 } 30122 this.timeoutId = requestAnimationFrame(() => { 30123 this.timeoutId = null; 30124 if (this.mapInstance) { 30125 this.mapInstance.destroy(); 30126 this.mapInstance = void 0; 30127 } 30128 this.secondScreenBridge?.dispose(); 30129 this.secondScreenBridge = void 0; 30130 this.clearAutoPlacementHighlight(); 30131 super.disconnectedCallback(); 30132 }); 30133 } 30134 updateConfigBase() { 30135 if (!this.eventId && !this.roomId && !this.seatmapId) { 30136 return; 30137 } 30138 const publisher = seatmapPublisher(this.seatmapProvider); 30139 publisher.isSecondScreen?.set(this.isSecondScreen); 30140 publisher.conf?.set({ 30141 eventId: this.eventId, 30142 roomId: this.roomId, 30143 id: this.seatmapId, 30144 seatId: this.seatId, 30145 move: this.move || 0, 30146 clickService: this.clickService, 30147 counterMode: this._counterMode ?? this.modeOptions.initialCounterMode 30148 }); 30149 } 30150 reloadStatus() {
30151 this.getSeatmapInstanceRenderer()?.updateStatus(); 30152 } 30153 async willUpdate(_changedProperties) { 30154 if (_changedProperties.has("priceContext")) { 30155 this._availablePrices = await this.getAvailablePrices(this.priceContext); 30156 if (this.eventId !== this.priceContext?.entityId) { 30157 this.eventId = this.priceContext?.entityId || 0; 30158 } 30159 } 30160 if (["eventId", "seatId", "move", "clickService", "editMode", "roomId", "seatmapId", "isSecondScreen"].some( 30161 (p2) => _changedProperties.has(p2) 30162 )) { 30163 this.updateConfigBase(); 30164 } 30165 if (_changedProperties.has("_items")) { 30166 const cartItems = this._items; 30167 const hasEventInCart = cartItems?.some((item) => item.entity_type === EntityType.Event && item.entity_id === this.eventId) ?? false; 30168 this._displayMove = hasEventInCart; 30169 } 30170 if (this.isAutoOnlyCustomer && (this._counterMode === CounterMode.MOVE || _changedProperties.has("_customerPlacementConfig"))) { 30171 resetSelection(this.seatmapProvider); 30172 seatmapPublisher(this.seatmapProvider).conf.counterMode?.set(CounterMode.BUY); 30173 } 30174 if (_changedProperties.has("_customerPlacementConfig") || _changedProperties.has("appType") || _changedProperties.has("editMode")) { 30175 this.syncSeatClickHandler(); 30176 } 30177 } 30178 async getAvailablePrices(priceContext) { 30179 if (!priceContext) return []; 30180 const api2 = new API(HTML.getApiConfiguration(this)); 30181 const endpoint = priceEndPoint(priceContext, this.accessParams); 30182 const result = (await api2.get(endpoint))?.data; 30183 return result?.prices; 30184 } 30185 renderControls() { 30186 if (this.isSecondScreen || this.move > 0) { 30187 return A$1; 30188 } 30189 const selectedSeatsCount = this._selectedSeats?.length || 0; 30190 if (this.isEditMode()) { 30191 return b$1` 30192 <div id="plan-controls" class="print:hidden flex flex-col gap-1 absolute top-4 left-3 z-10 pointer-events-none"> 30193 <sonic-button noAutoFill size="sm" shape="circle" data-action="zoomIn" class="pointer-events-auto"> 30194 <sonic-icon name="plus" library="custom"></sonic-icon> 30195 </sonic-button> 30196 <sonic-button size="sm" shape="circle" data-action="zoomOut" class="pointer-events-auto"> 30197 <sonic-icon name="minus" library="custom"></sonic-icon> 30198 </sonic-button> 30199 </div> 30200 `; 30201 } 30202 return b$1` 30203 <div class="flex items-center gap-1 flex-col absolute top-4 right-3 z-10 "> 30204 <sonic-seatmap-help-button 30205 .seatmapProvider=${this.seatmapProvider} 30206 .eventId=${this.eventId} 30207 ></sonic-seatmap-help-button> 30208 ${this.renderViewOptions()} 30209 </div> 30210 30211 <div 30212 id="plan-controls" 30213 class="print:hidden flex flex-col gap-1 absolute top-4 bottom-4 left-3 z-10 pointer-events-none " 30214 > 30215 ${this.allowsBuyMode() ? b$1`<sonic-tooltip 30216 placement="right" 30217 label=${t("LIB_seatmap_mode_buy")} 30218 class=" ${this.displayButtonClasses(this._displayMove || this._counterMode !== CounterMode.BUY)} " 30219 > 30220 <sonic-button 30221 noAutoFill 30222 size="sm" 30223 radio 30224 shape="circle" 30225 name="conf.counterMode" 30226 value=${CounterMode.BUY} 30227 class="pointer-events-auto" 30228 @click=${() => { 30229 resetSelection(this.seatmapProvider); 30230 }} 30231 > 30232 <sonic-icon name="basket-shopping" library="custom"></sonic-icon> 30233 </sonic-button> 30234 </sonic-tooltip>` : A$1} 30235 ${this.allowsMoveMode() ? b$1`<div class="relative z-10"> 30236 <sonic-tooltip 30237 placement="right" 30238 label=${t("LIB_seatmap_mode_move")} 30239 class="${this.displayButtonClasses( 30240 this._displayMove || this._counterMode === CounterMode.MOVE 30241 )}} delay-[80ms]" 30242 > 30243 <sonic-button 30244 noAutoFill 30245 size="sm" 30246 radio 30247 shape="circle" 30248 name="conf.counterMode"
30249 value=${CounterMode.MOVE} 30250 class="pointer-events-auto" 30251 @click=${() => { 30252 selectCartSeats(this.seatmapProvider, this.cartProvider); 30253 }} 30254 > 30255 <sonic-badge 30256 size="2xs" 30257 type="info" 30258 class="z-10 absolute -bottom-1 -right-1 transition duration-100 pointer-events-none 30259 ${selectedSeatsCount ? "opacity-100 scale-100" : "opacity-0 scale-0"} " 30260 > 30261 ${selectedSeatsCount} 30262 </sonic-badge> 30263 <sonic-icon name="right-left" library="custom"></sonic-icon 30264 ><!-- Déplacement--> 30265 </sonic-button> 30266 </sonic-tooltip> 30267 30268 ${this._counterMode === CounterMode.MOVE ? b$1`<sonic-button 30269 class=" absolute top-0 left-full ml-2 ${this.displayButtonClasses( 30270 this._displayMove || this._counterMode === CounterMode.MOVE 30271 )} " 30272 style="--sc-btn-rounded:99px;" 30273 noAutoFill 30274 size="sm" 30275 shape="circle" 30276 align="left" 30277 type="default" 30278 @click=${() => { 30279 const selectedSeats = this._selectedSeats || []; 30280 if (selectedSeats.length === 0) { 30281 selectCartSeats(this.seatmapProvider, this.cartProvider); 30282 } else { 30283 resetSelection(this.seatmapProvider); 30284 } 30285 }} 30286 > 30287 ${selectedSeatsCount ? b$1`<sonic-icon name="xmark" library="custom"></sonic-icon>` : b$1`<sonic-icon name="check-double" library="custom"></sonic-icon>`} 30288 <div 30289 class="absolute left-full text-left ml-2 top-1/2 -translate-y-1/2 30290 translate-z-0 30291 text-[10px] max-w-[5.7rem] min-w-[5.7rem] pointer-events-none" 30292 style="text-shadow: 1px 1px 0 rgba(255, 255, 255,1);" 30293 > 30294 ${selectedSeatsCount ? b$1` ${t("LIB_unselect_all_tickets_with_seating")}` : b$1` ${t("LIB_select_all_tickets_with_seating")}`} 30295 </div> 30296 </sonic-button>` : A$1} 30297 </div>` : A$1} 30298 30299 <sonic-tooltip 30300 placement="right" 30301 label=${t("LIB_seatmap_mode_auto")} 30302 class="${this.displayButtonClasses(this._displayMove)} delay-[160ms]" 30303 > 30304 <span class="inline-flex rounded-full ${this._highlightAutoButton ? "auto-placement-highlight" : ""}"> 30305 <sonic-button 30306 noAutoFill 30307 size="sm" 30308 radio 30309 shape="circle" 30310 @click=${() => { 30311 this.clearAutoPlacementHighlight(); 30312 this.mapInstance?.renderer?.setPlacesInCartToBestPosition(); 30313 }} 30314 > 30315 <sonic-icon name="sparkles" library="custom"></sonic-icon 30316 ><!-- Placement auto--> 30317 </sonic-button> 30318 </span> 30319 </sonic-tooltip> 30320 30321 <div class="flex items-center gap-1 flex-col mt-auto pointer-events-auto"> 30322 <sonic-tooltip placement="right" label=${t("LIB_zoom_in")} class=""> 30323 <sonic-button noAutoFill size="xs" shape="circle" data-action="zoomIn"> 30324 <sonic-icon name="plus" library="custom"></sonic-icon> 30325 </sonic-button> 30326 </sonic-tooltip> 30327 <sonic-tooltip placement="right" label=${t("LIB_zoom_out")}> 30328 <sonic-button noAutoFill size="xs" shape="circle" data-action="zoomOut"> 30329 <sonic-icon name="minus" library="custom"></sonic-icon> 30330 </sonic-button> 30331 </sonic-tooltip> 30332 </div> 30333 </div> 30334 `; 30335 } 30336 displayButtonClasses(display) { 30337 return `transition duration-300 ${display ? "opacity-100 pointer-events-auto scale-100" : "scale-0 opacity-0 pointer-events-none "}`; 30338 } 30339 renderViewOptions() { 30340 if (this.appType !== "counter") { 30341 return A$1; 30342 } 30343 return b$1` 30344 <sonic-pop> 30345 <sonic-tooltip placement="left" label=${t("LIB_view_mode_options")}>
30346 <sonic-button noAutoFill size="sm" shape="circle" icon> 30347 <sonic-icon name="gear" library="custom"></sonic-icon> 30348 </sonic-button> 30349 </sonic-tooltip> 30350 30351 <div slot="content"> 30352 <sonic-menu class="w-56"> 30353 <sonic-divider size="sm" label=${t("LIB_view_mode_global_arrangement")}></sonic-divider> 30354 <sonic-menu-item size="xs" radio name="conf.viewMode" value="MAP_VIEW" checked> 30355 <sonic-icon slot="prefix" name="map" library="custom"></sonic-icon> ${t("LIB_view_mode_map")} 30356 </sonic-menu-item> 30357 <sonic-menu-item size="xs" radio name="conf.viewMode" value="RANGE_VIEW"> 30358 <sonic-icon slot="prefix" name="list" library="custom"></sonic-icon> ${t("LIB_view_mode_list")} 30359 </sonic-menu-item> 30360 <sonic-divider size="sm" label=${t("LIB_view_mode_places_rendering")}></sonic-divider> 30361 <sonic-menu-item size="xs" radio name="conf.seatsColorsMode" value="categorie"> 30362 <sonic-icon slot="prefix" name="circle" library="custom"></sonic-icon> ${t( 30363 "LIB_view_mode_colors_category" 30364 )} 30365 </sonic-menu-item> 30366 <sonic-menu-item size="xs" radio name="conf.seatsColorsMode" value="contingent"> 30367 <sonic-icon slot="prefix" name="users-viewfinder" library="custom"></sonic-icon> ${t( 30368 "LIB_view_mode_colors_contingent" 30369 )} 30370 </sonic-menu-item> 30371 <sonic-menu-item size="xs" radio name="conf.seatsColorsMode" value="rows"> 30372 <sonic-icon slot="prefix" name="arrow-up-a-z" library="custom"></sonic-icon> ${t( 30373 "LIB_view_mode_colors_rows" 30374 )} 30375 </sonic-menu-item> 30376 <sonic-menu-item size="xs" radio name="conf.seatsColorsMode" value="seatNumbers"> 30377 <sonic-icon slot="prefix" name="arrow-up-1-9" library="custom"></sonic-icon> ${t( 30378 "LIB_view_mode_colors_seat_numbers" 30379 )} 30380 </sonic-menu-item> 30381 <sonic-menu-item size="xs" radio name="conf.seatsColorsMode" value="offlineView"> 30382 <sonic-icon slot="prefix" name="eye" library="custom"></sonic-icon> Vue publique 30383 </sonic-menu-item> 30384 </sonic-menu> 30385 </div> 30386 </sonic-pop> 30387 `; 30388 } 30389 render() { 30390 const planClasses = "min-h-[300px] h-full flex-1 relative"; 30391 return b$1`<sonic-fetch dataProvider=${this.cartProvider}></sonic-fetch> 30392 <div id="plan" class=${planClasses} formDataProvider=${this.seatmapProvider}> 30393 <div 30394 class="hidden absolute z-10 pointer-events-none bg-neutral-0 rounded px-2 py-4 text-neutral-900 shadow-md text-xs" 30395 id="plan-tooltip" 30396 ></div> 30397 <slot></slot> 30398 ${this.renderControls()} 30399 ${!this.isEditMode() ? b$1` 30400 <div class="absolute w-full"> 30401 <form class="form-sm mt-xs col-xs-8" style="max-width: 50rem"> 30402 <select aria-label="palier" class="hidden" id="plan-palier" name="plan-palier"></select> 30403 </form> 30404 </div> 30405 ` : A$1} 30406 </div> 30407 <sonic-seatmap-seat-popover 30408 dataProvider=${this.seatmapProvider} 30409 .availablePrices=${this._availablePrices} 30410 ></sonic-seatmap-seat-popover> `; 30411 } 30412 }; 30413 SonicSeatmapView.styles = [ 30414 tailwind, 30415 i$9` 30416 :host { 30417 display: block; 30418 position: relative; 30419 } 30420 30421 @keyframes auto-placement-highlight { 30422 0%, 30423 100% { 30424 box-shadow: 0 0 0 0 color-mix(in srgb, var(--sc-base-800, #1f2937) 40%, transparent); 30425 transform: scale(1); 30426 } 30427 50% { 30428 box-shadow: 0 0 0 0.5rem color-mix(in srgb, var(--sc-base-800, #1f2937) 0%, transparent); 30429 transform: scale(1.08); 30430 } 30431 } 30432 30433 .auto-placement-highlight { 30434 animation: auto-placement-highlight 0.55s ease-in-out 3; 30435 border-radius: 9999px; 30436 } 30437 ` 30438 ]; 30439 SonicSeatmapView.isLoadingScript = false; 30440 __decorateClass$35([ 30441 c({ context: appType, subscribe: true }), 30442 r$5() 30443 ], SonicSeatmapView.prototype, "appType", 2); 30444 __decorateClass$35([ 30445 c({ context: accessParamsContext, subscribe: true }), 30446 r$5() 30447 ], SonicSeatmapView.prototype, "accessParams", 2); 30448 __decorateClass$35([ 30449 bind("settings.customer_ui.event.placement"), 30450 r$5()
30451 ], SonicSeatmapView.prototype, "_customerPlacementConfig", 2); 30452 __decorateClass$35([ 30453 n$5({ type: Object }) 30454 ], SonicSeatmapView.prototype, "priceContext", 2); 30455 __decorateClass$35([ 30456 n$5({ type: Number }) 30457 ], SonicSeatmapView.prototype, "eventId", 2); 30458 __decorateClass$35([ 30459 n$5({ type: Number }) 30460 ], SonicSeatmapView.prototype, "seatmapId", 2); 30461 __decorateClass$35([ 30462 n$5({ type: Number }) 30463 ], SonicSeatmapView.prototype, "roomId", 2); 30464 __decorateClass$35([ 30465 n$5({ type: Number }) 30466 ], SonicSeatmapView.prototype, "seatId", 2); 30467 __decorateClass$35([ 30468 n$5({ type: Number }) 30469 ], SonicSeatmapView.prototype, "move", 2); 30470 __decorateClass$35([ 30471 n$5({ type: String }) 30472 ], SonicSeatmapView.prototype, "clickService", 2); 30473 __decorateClass$35([ 30474 n$5({ type: String, attribute: "edit-mode" }) 30475 ], SonicSeatmapView.prototype, "editMode", 2); 30476 __decorateClass$35([ 30477 r$5() 30478 ], SonicSeatmapView.prototype, "_counterMode", 2); 30479 __decorateClass$35([ 30480 r$5() 30481 ], SonicSeatmapView.prototype, "_selectedSeats", 2); 30482 __decorateClass$35([ 30483 n$5({ type: Boolean }) 30484 ], SonicSeatmapView.prototype, "isSecondScreen", 2); 30485 __decorateClass$35([ 30486 r$5() 30487 ], SonicSeatmapView.prototype, "_availablePrices", 2); 30488 __decorateClass$35([ 30489 bind(cartKey.data.items), 30490 r$5() 30491 ], SonicSeatmapView.prototype, "_items", 2); 30492 __decorateClass$35([ 30493 r$5() 30494 ], SonicSeatmapView.prototype, "_displayMove", 2); 30495 __decorateClass$35([ 30496 r$5() 30497 ], SonicSeatmapView.prototype, "_highlightAutoButton", 2); 30498 __decorateClass$35([ 30499 ancestorAttribute("cartProvider") 30500 ], SonicSeatmapView.prototype, "cartProvider", 2); 30501 __decorateClass$35([ 30502 ancestorAttribute("seatmapProvider") 30503 ], SonicSeatmapView.prototype, "seatmapProvider", 2); 30504 __decorateClass$35([ 30505 onAssign(seatmapKey.conf.counterMode.path) 30506 ], SonicSeatmapView.prototype, "handleCounterModeChange", 1); 30507 __decorateClass$35([ 30508 onAssign(seatmapKey.selectedSeats.path) 30509 ], SonicSeatmapView.prototype, "handleSelectedSeatsChange", 1); 30510 __decorateClass$35([ 30511 onAssign(seatmapKey.selectedSeats.path) 30512 ], SonicSeatmapView.prototype, "configEventSeats", 1); 30513 SonicSeatmapView = __decorateClass$35([ 30514 t$3("sonic-seatmap-view") 30515 ], SonicSeatmapView); 30516 var __defProp$31 = Object.defineProperty; 30517 var __getOwnPropDesc$34 = Object.getOwnPropertyDescriptor; 30518 var __decorateClass$34 = (decorators, target, key, kind) => { 30519 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$34(target, key) : target; 30520 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 30521 if (decorator = decorators[i2]) 30522 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 30523 if (kind && result) __defProp$31(target, key, result); 30524 return result; 30525 }; 30526 let SonicSessionNavigation = class extends i$6 { 30527 constructor() { 30528 super(...arguments); 30529 this.currentSessionId = 0; 30530 } 30531 get currentIndex() { 30532 return this.sessionsList?.findIndex((session) => Number(session.id) === Number(this.currentSessionId)) ?? -1; 30533 } 30534 get previousSession() { 30535 const index = this.currentIndex; 30536 if (index <= 0) return void 0; 30537 return this.sessionsList?.[index - 1]; 30538 } 30539 get nextSession() { 30540 const index = this.currentIndex; 30541 const list = this.sessionsList; 30542 if (!list || index === -1 || index >= list.length - 1) return void 0; 30543 return list[index + 1]; 30544 } 30545 render() { 30546 if (!this.sessionsList || this.sessionsList.length < 2) return A$1; 30547 return b$1` 30548 <div class="flex gap-x-1 items-center "> 30549 <sonic-tooltip label=${this.tooltipLabel(this.previousSession)} ?disabled=${!this.previousSession}> 30550 <sonic-button 30551 variant="outline" 30552 size="xs" 30553 minWidth="6rem" 30554 @click=${() => this.selectSession(this.previousSession?.id)} 30555 ?disabled=${!this.previousSession} 30556 > 30557 <sonic-icon name="chevron-left" library="custom" slot="prefix"></sonic-icon> 30558 ${t("previous")} 30559 </sonic-button> 30560 </sonic-tooltip> 30561 <sonic-tooltip label=${this.tooltipLabel(this.nextSession)} ?disabled=${!this.nextSession}> 30562 <sonic-button 30563 variant="outline" 30564 size="xs" 30565 minWidth="6rem" 30566 @click=${() => this.selectSession(this.nextSession?.id)} 30567 ?disabled=${!this.nextSession} 30568 > 30569 ${t("next")} 30570 <sonic-icon name="chevron-right" library="custom" slot="suffix"></sonic-icon> 30571 </sonic-button> 30572 </sonic-tooltip> 30573 </div> 30574 `; 30575 } 30576 selectSession(sessionId) { 30577 const newSessionId = Number(sessionId); 30578 if (!newSessionId) return; 30579 const event = new CustomEvent("selectSession", { 30580 detail: { sessionId: newSessionId } 30581 }); 30582 this.dispatchEvent(event); 30583 } 30584 tooltipLabel(session) { 30585 let label2 = session?.edito?.title ? session.edito.title : ""; 30586 label2 = label2.length > 30 ? label2.substring(0, 30) + "..." : label2; 30587 return label2; 30588 } 30589 }; 30590 SonicSessionNavigation.styles = [tailwind]; 30591 __decorateClass$34([ 30592 n$5() 30593 ], SonicSessionNavigation.prototype, "currentSessionId", 2); 30594 __decorateClass$34([ 30595 n$5({ type: Array }) 30596 ], SonicSessionNavigation.prototype, "sessionsList", 2); 30597 SonicSessionNavigation = __decorateClass$34([ 30598 t$3("sonic-session-navigation") 30599 ], SonicSessionNavigation); 30600 var __defProp$30 = Object.defineProperty; 30601 var __getOwnPropDesc$33 = Object.getOwnPropertyDescriptor; 30602 var __decorateClass$33 = (decorators, target, key, kind) => { 30603 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$33(target, key) : target; 30604 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 30605 if (decorator = decorators[i2]) 30606 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 30607 if (kind && result) __defProp$30(target, key, result); 30608 return result; 30609 }; 30610 let instanceCounter$e = 0; 30611 let SonicEventSeatSelector = class extends i$6 { 30612 constructor() { 30613 super(...arguments); 30614 this.cartProvider = "cart/current"; 30615 this.seatmapProvider = "seatmap"; 30616 this.summaryDataProvider = `seatmapSelectorPreview-${instanceCounter$e++}`; 30617 this.displaySummary = false;
30618 this.editMode = SeatmapMode.CART_ADD; 30619 this._subscriptions = []; 30620 this._items = []; 30621 this.handleCartMutation = () => { 30622 const cart = cartPublisher(this.cartProvider); 30623 this._items = cart.data?.items?.get() || []; 30624 const linked_subscriptions = cart.data?.linked_subscriptions?.get() || []; 30625 this._subscriptions = getCartSubscriptions({ items: this._items, linked_subscriptions }).filter( 30626 (sub2) => sub2.can_attach_events 30627 ); 30628 this.ensureSubscriptionSelected(); 30629 this.handleCartItemsChanged(); 30630 }; 30631 } 30632 handleCounterModeChange(counterMode) { 30633 this._counterMode = counterMode; 30634 } 30635 get currentEntityId() { 30636 return this.priceContext?.entityId || 0; 30637 } 30638 get isAutoOnlyPlacementMode() { 30639 const config = this.appType === "counter" ? this._storePlacementConfig : this._customerPlacementConfig; 30640 return isAutoOnlyPlacement(config); 30641 } 30642 connectedCallback() { 30643 super.connectedCallback(); 30644 cartPublisher(this.cartProvider).data?.onInternalMutation(this.handleCartMutation); 30645 this.handleCartMutation(); 30646 window.addEventListener("resize", this.seatmapViewHeight); 30647 requestAnimationFrame(() => { 30648 this.setupResizeObserver(); 30649 }); 30650 } 30651 setupResizeObserver() { 30652 if (!this._resizeObserver) { 30653 this._resizeObserver = new ResizeObserver(() => { 30654 this.seatmapViewHeight(); 30655 }); 30656 this._resizeObserver.observe(this); 30657 } 30658 const parentModal = HTML.getClosestElement(this, "dialog"); 30659 if (parentModal && parentModal !== this._observedModal && this._resizeObserver) { 30660 this._resizeObserver.observe(parentModal); 30661 this._observedModal = parentModal; 30662 this.seatmapViewHeight(); 30663 } 30664 } 30665 get canSelectOtherOwners() { 30666 const { subscriptionRequirement, disallowEventsForSoldSubscription } = this.settings || {}; 30667 const onlyNewSubscriptionAllowed = isSubscriptionRequired(subscriptionRequirement, this.appType) && disallowEventsForSoldSubscription?.active; 30668 return !onlyNewSubscriptionAllowed; 30669 } 30670 ensureSubscriptionSelected() { 30671 if (this.canSelectOtherOwners || this._subscriptions.length === 0) return; 30672 if (this.priceContext?.parentSubscription?.id) return; 30673 this.selectSubscription(this._subscriptions[0]); 30674 } 30675 disconnectedCallback() { 30676 window.removeEventListener("resize", this.seatmapViewHeight); 30677 if (this._resizeObserver) { 30678 this._resizeObserver.disconnect(); 30679 this._resizeObserver = void 0; 30680 } 30681 this._observedModal = void 0; 30682 cartPublisher(this.cartProvider).data?.offInternalMutation(this.handleCartMutation); 30683 super.disconnectedCallback(); 30684 } 30685 updated(_changedProperties) { 30686 if (this.isAutoOnlyPlacementMode && this.priceContext?.parentSubscription && (_changedProperties.has("_customerPlacementConfig") || _changedProperties.has("_storePlacementConfig") || _changedProperties.has("appType") || _changedProperties.has("priceContext"))) { 30687 this.unSelectSubscription(); 30688 } 30689 this.setupResizeObserver(); 30690 if (_changedProperties.has("settings") || _changedProperties.has("appType")) { 30691 this.ensureSubscriptionSelected(); 30692 } 30693 } 30694 seatmapViewHeight() { 30695 const parentModal = HTML.getClosestElement(this, "dialog"); 30696 if (!parentModal) return; 30697 const parentModalHeight = parentModal?.clientHeight || 0; 30698 const modalContent = parentModal.querySelector("#modal-content"); 30699 const modalClose = parentModal.querySelector("sonic-modal-close"); 30700 if (!modalContent) return; 30701 modalContent.style.paddingBottom = "0"; 30702 const closeComputedStyle = modalClose ? window.getComputedStyle(modalClose) : void 0; 30703 const closeMarginBottom = closeComputedStyle ? Math.abs(parseFloat(closeComputedStyle.marginBottom)) || 0 : 0; 30704 const computedStyle = window.getComputedStyle(modalContent); 30705 const paddingTop = parseFloat(computedStyle.paddingTop) || 0; 30706 const paddingBottom = parseFloat(computedStyle.paddingBottom) || 0;
30707 const availableHeight = parentModalHeight - paddingTop - paddingBottom - closeMarginBottom - 5; 30708 this._availableHeight = availableHeight; 30709 } 30710 render() { 30711 if (!this.currentEntityId) return A$1; 30712 return b$1`<div 30713 data-seatmap-container 30714 class="@container flex flex-col flex-1" 30715 style="${this._availableHeight ? `min-height: ${this._availableHeight}px;` : ""}" 30716 > 30717 <div data-seatmap-header>${this.renderSummary()} ${this.renderSeatSuggest()} ${this.renderSubscription()}</div> 30718 <sonic-seatmap-view 30719 class="min-h-[32rem] bg-neutral-50 30720 -mb-[var(--sc-modal-py)] 30721 -mx-[var(--sc-modal-px)] 30722 border border-neutral-50 rounded-lg relative overflow-hidden flex flex-col grow" 30723 .priceContext=${this.priceContext} 30724 edit-mode=${this.editMode} 30725 cartProvider=${this.cartProvider} 30726 ></sonic-seatmap-view> 30727 </div>`; 30728 } 30729 renderSummary() { 30730 const productEndpoint = entityEndPoint({ 30731 entityType: EntityType.Event, 30732 entityId: this.currentEntityId, 30733 accessParams: this.accessParams, 30734 view: entityView.mini 30735 }); 30736 if (!this.displaySummary) return A$1; 30737 return b$1`<div class="block @xl:flex justify-between items-center gap-x-4 mb-3"> 30738 <div class="min-h-[4rem] block w-full"> 30739 <sonic-fetch dataProvider="${this.summaryDataProvider}" endpoint="${productEndpoint}" key="data"> 30740 <sonic-product-summary size="sm"> </sonic-product-summary> 30741 </sonic-fetch> 30742 </div> 30743 <sonic-session-navigation 30744 class="shrink-0 self-end mt-3 block" 30745 @selectSession=${(e2) => this.updateSession(e2.detail.sessionId)} 30746 .sessionsList=${this.sessionsList} 30747 .currentSessionId=${this.currentEntityId} 30748 ></sonic-session-navigation> 30749 </div>`; 30750 } 30751 renderSeatSuggest() { 30752 if (this.isAutoOnlyPlacementMode) { 30753 return A$1; 30754 } 30755 return b$1`<sonic-seat-suggest .sessionId="${this.currentEntityId}" class="mb-3"></sonic-seat-suggest>`; 30756 } 30757 // renderPriceSelectionForm() { 30758 // if (!this.isAutoOnlyPlacementMode) { 30759 // return nothing; 30760 // } 30761 // return html`<sonic-fetch 30762 // dataProvider="${entityEndPoint({ 30763 // entityType: EntityType.Event, 30764 // entityId: this.currentEntityId, 30765 // accessParams: this.accessParams, 30766 // view: entityView.prices, 30767 // })}" 30768 // dataProvider="poauzpzaoue" 30769 // key="data" 30770 // ><sonic-buy-event-block 30771 // class="max-w-96 mx-auto block"
30772 // buyMode="${BuyMode.AUTOSEATING}" 30773 // .fallbackAvailableQuota=${false} 30774 // .priceContext=${this.priceContext} 30775 // ></sonic-buy-event-block 30776 // ></sonic-fetch>`; 30777 // } 30778 handleCartItemsChanged() { 30779 if (this.isAutoOnlyPlacementMode) { 30780 return; 30781 } 30782 const selectedSubscription = this.priceContext?.parentSubscription; 30783 if (!selectedSubscription?.id || !selectedSubscription.entity_id) return; 30784 const rules = getSubscriptionRules(selectedSubscription.entity_id, this.cartProvider); 30785 const maxPerSession = rules?.[0]?.conditions?.[0]?.ticketsPerSession?.max; 30786 if (!maxPerSession) return; 30787 if (this.countSessionTickets(selectedSubscription.id) < maxPerSession) return; 30788 const currentIndex = this._subscriptions.findIndex((sub2) => sub2.id === selectedSubscription.id); 30789 if (currentIndex === -1) return; 30790 const nextAvailable = this._subscriptions.slice(currentIndex + 1).find((sub2) => this.countSessionTickets(sub2.id) === 0); 30791 if (nextAvailable) { 30792 this.selectSubscription(nextAvailable); 30793 } else if (this.canSelectOtherOwners) { 30794 this.unSelectSubscription(); 30795 } else { 30796 const firstWithCapacity = this._subscriptions.find((sub2) => this.countSessionTickets(sub2.id) < maxPerSession); 30797 if (firstWithCapacity) { 30798 this.selectSubscription(firstWithCapacity); 30799 } 30800 } 30801 } 30802 countSessionTickets(subscriptionId) { 30803 if (!subscriptionId) return 0; 30804 return getSessionItems(this._items, this.currentEntityId, String(subscriptionId)).length; 30805 } 30806 renderSubscription() { 30807 if (this.isAutoOnlyPlacementMode || this._subscriptions.length === 0) { 30808 return A$1; 30809 } 30810 const isOtherOwner = !this.priceContext?.parentSubscription?.id; 30811 return b$1` 30812 <div 30813 class="shadow-lg relative z-10 bg-neutral-0 -mx-[var(--sc-modal-px)] lg:mx-2 rounded-md 30814 overflow-hidden transition-all duration-300 30815 ${this._counterMode !== CounterMode.BUY ? "h-0 mb-0" : "h-auto -mb-2"}" 30816 style="interpolate-size:allow-keywords" 30817 > 30818 <div class="px-2 mb-0 font-bold text-sm">${t("my_tickets_are_for")}</div> 30819 <sonic-menu 30820 size="sm" 30821 class="flex gap-x-1 items-center shrink-0 self-end justify-start " 30822 direction="row" 30823 scrollable 30824 > 30825 ${c$1( 30826 this._subscriptions, 30827 (subscription) => subscription.id, 30828 (subscription) => { 30829 const { firstName, lastName } = subscription.owner || {}; 30830 const fullname = firstName || lastName ? b$1`${firstName} 30831 <div class="font-normal text-xs leading-tight">${lastName}</div>` : t("anonymous"); 30832 const active = subscription.id === this.priceContext?.parentSubscription?.id; 30833 return b$1` 30834 <sonic-menu-item 30835 variant="default" 30836 noAutoFill 30837 type=${active ? "neutral" : "default"} 30838 ?active=${active} 30839 @click=${() => { 30840 this.selectSubscription(subscription); 30841 }} 30842 > 30843 <div class="flex items-start gap-x-1 py-1"> 30844 <sonic-icon 30845 name="${active ? "circle-check" : "circle"}" 30846 library="custom" 30847 class="self-auto" 30848 size="lg" 30849 ></sonic-icon> 30850 <div> 30851 <div class="font-bold">${fullname}</div> 30852 <div class="text-xs font-normal"> 30853 ${getSubscriptionName(subscription.entity_id, this.cartProvider)} 30854 </div> 30855 </div> 30856 ${this.renderTicketCount(subscription.id)} 30857 </div> 30858 </sonic-menu-item> 30859 `; 30860 } 30861 )} 30862 ${this.canSelectOtherOwners ? b$1`<sonic-menu-item 30863 variant="default" 30864 noAutoFill 30865 type="default" 30866 ?active=${isOtherOwner} 30867 @click=${() => this.unSelectSubscription()} 30868 > 30869 <div class="flex items-start gap-x-1 py-3"> 30870 <sonic-icon 30871 name=${isOtherOwner ? "circle-check" : "circle"} 30872 library="custom"
30873 class="self-auto" 30874 size="lg" 30875 ></sonic-icon> 30876 <div class="font-bold w-min whitespace-normal">${t("LIB_other_owners")}</div> 30877 ${this.renderTicketCount()} 30878 </div> 30879 </sonic-menu-item>` : A$1} 30880 </sonic-menu> 30881 </div> 30882 `; 30883 } 30884 renderTicketCount(parent_id) { 30885 const itemsCountWithParentId = getSessionItems(this._items, this.currentEntityId, parent_id).length; 30886 let borderClass = "border-current"; 30887 if (itemsCountWithParentId) { 30888 borderClass = "border-transparent"; 30889 } 30890 return b$1` 30891 <sonic-badge 30892 size="xs" 30893 type="${itemsCountWithParentId ? "success" : "default"}" 30894 class="self-center border ${borderClass} ml-1" 30895 > 30896 <div class="flex items-center "> 30897 <sonic-icon name="ticket" library="custom"></sonic-icon> 30898 <sonic-icon name="xmark" size="xs" library="custom"></sonic-icon> 30899 <span class="min-w-[1ch] text-center inline-block">${itemsCountWithParentId}</span> 30900 </div> 30901 </sonic-badge> 30902 `; 30903 } 30904 selectSubscription(subscription) { 30905 const isCurrentSubscription = subscription.id === this.priceContext?.parentSubscription?.id; 30906 if (!this.priceContext) return; 30907 if (isCurrentSubscription && !this.canSelectOtherOwners) return; 30908 this.updatePriceContext({ parentSubscription: isCurrentSubscription ? void 0 : subscription }); 30909 } 30910 unSelectSubscription() { 30911 if (!this.canSelectOtherOwners || !this.priceContext) return; 30912 this.updatePriceContext({ parentSubscription: void 0 }); 30913 } 30914 // Nav précédent ou suivant 30915 updateSession(sessionId) { 30916 const newSessionId = Number(sessionId); 30917 if (!newSessionId) return; 30918 if (this.priceContext) { 30919 this.updatePriceContext({ entityId: newSessionId }); 30920 } else { 30921 this.updatePriceContext({ entityType: EntityType.Event, entityId: newSessionId }); 30922 } 30923 } 30924 updatePriceContext(newPriceContext) { 30925 if (!this.priceContext) { 30926 this.priceContext = { 30927 entityType: EntityType.Event, 30928 entityId: Number(newPriceContext.entityId) 30929 }; 30930 } 30931 this.priceContext = { 30932 ...this.priceContext, 30933 ...newPriceContext 30934 }; 30935 } 30936 }; 30937 SonicEventSeatSelector.styles = [ 30938 tailwind, 30939 i$9` 30940 :host { 30941 display: block; 30942 } 30943 ` 30944 ]; 30945 __decorateClass$33([ 30946 ancestorAttribute("cartProvider"), 30947 n$5({ type: String, reflect: true }) 30948 ], SonicEventSeatSelector.prototype, "cartProvider", 2); 30949 __decorateClass$33([ 30950 c({ context: accessParamsContext, subscribe: true }), 30951 n$5({ type: Object }) 30952 ], SonicEventSeatSelector.prototype, "accessParams", 2); 30953 __decorateClass$33([ 30954 e$2({ context: buyContext }), 30955 n$5({ type: Object }) 30956 ], SonicEventSeatSelector.prototype, "priceContext", 2); 30957 __decorateClass$33([ 30958 n$5({ type: Array }) 30959 ], SonicEventSeatSelector.prototype, "sessionsList", 2); 30960 __decorateClass$33([ 30961 ancestorAttribute("seatmapProvider"), 30962 n$5({ type: String, reflect: true }) 30963 ], SonicEventSeatSelector.prototype, "seatmapProvider", 2); 30964 __decorateClass$33([ 30965 n$5({ type: Boolean }) 30966 ], SonicEventSeatSelector.prototype, "displaySummary", 2); 30967 __decorateClass$33([ 30968 n$5({ type: String, attribute: "edit-mode" }) 30969 ], SonicEventSeatSelector.prototype, "editMode", 2); 30970 __decorateClass$33([ 30971 c({ context: appType, subscribe: true }), 30972 r$5() 30973 ], SonicEventSeatSelector.prototype, "appType", 2); 30974 __decorateClass$33([ 30975 bind$1("settings.customer_ui.event.placement"), 30976 r$5() 30977 ], SonicEventSeatSelector.prototype, "_customerPlacementConfig", 2); 30978 __decorateClass$33([ 30979 bind$1("settings.store_ui.event.placement"), 30980 r$5() 30981 ], SonicEventSeatSelector.prototype, "_storePlacementConfig", 2); 30982 __decorateClass$33([ 30983 bind$1("settings"), 30984 r$5() 30985 ], SonicEventSeatSelector.prototype, "settings", 2); 30986 __decorateClass$33([ 30987 r$5() 30988 ], SonicEventSeatSelector.prototype, "_subscriptions", 2); 30989 __decorateClass$33([
30990 r$5() 30991 ], SonicEventSeatSelector.prototype, "_items", 2); 30992 __decorateClass$33([ 30993 r$5() 30994 ], SonicEventSeatSelector.prototype, "_counterMode", 2); 30995 __decorateClass$33([ 30996 onAssign(seatmapKey.conf.counterMode.path) 30997 ], SonicEventSeatSelector.prototype, "handleCounterModeChange", 1); 30998 __decorateClass$33([ 30999 r$5() 31000 ], SonicEventSeatSelector.prototype, "_availableHeight", 2); 31001 SonicEventSeatSelector = __decorateClass$33([ 31002 t$3("sonic-event-seat-selector") 31003 ], SonicEventSeatSelector); 31004 var __defProp$2$ = Object.defineProperty; 31005 var __getOwnPropDesc$32 = Object.getOwnPropertyDescriptor; 31006 var __decorateClass$32 = (decorators, target, key, kind) => { 31007 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$32(target, key) : target; 31008 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 31009 if (decorator = decorators[i2]) 31010 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 31011 if (kind && result) __defProp$2$(target, key, result); 31012 return result; 31013 }; 31014 let MapLink = class extends Subscriber$1(i$6) { 31015 constructor() { 31016 super(...arguments); 31017 this.slug = ""; 31018 this.infos_status = {}; 31019 this.room = {}; 31020 this.prices = []; 31021 this._href = ""; 31022 } 31023 connectedCallback() { 31024 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 31025 super.connectedCallback(); 31026 } 31027 willUpdate(changedProperties) { 31028 if (this.accessParams) { 31029 this._href = appRoute("seatmap").fill({ slug: this.slug, id: this.id }).query(accessParamsToQueryObject(this.accessParams)).toString(); 31030 } else { 31031 this._href = appRoute("seatmap").fill({ slug: this.slug, id: this.id }).toString(); 31032 } 31033 super.willUpdate(changedProperties); 31034 } 31035 async createModalSeatMap(id) { 31036 if (Modal?.modals) { 31037 await Promise.all([...Modal.modals].map((modal) => modal.dispose())); 31038 } 31039 Modal.create({ 31040 content: b$1` 31041 ${withAccessParams( 31042 this.accessParams, 31043 b$1` <sonic-event-seat-selector 31044 displaySummary 31045 cartProvider=${o$4(this._cartProvider)} 31046 seatmapProvider="seatmapModal/${id}" 31047 .priceContext=${{ entityType: EntityType.Event, entityId: Number(id) }} 31048 ></sonic-event-seat-selector>` 31049 )} 31050 `, 31051 maxWidth: "60rem", 31052 height: "92svh", 31053 maxHeight: "92svh", 31054 removeOnHide: true 31055 }); 31056 } 31057 handleClick(e2) { 31058 if (this.id && this._cartProvider !== "cart/current") { 31059 e2.preventDefault(); 31060 this.createModalSeatMap(parseInt(this.id.toString())); 31061 } 31062 } 31063 render() { 31064 const text = this.prices.length === 0 ? t("pl_voir_sur_plan") : t("pl_reserver_sur_plan"); 31065 const isPLaced = this.room && ["place", "mixte"].includes(this.room.placing_type_key || ""); 31066 if (!isPLaced) return A$1; 31067 return b$1` 31068 <sonic-button type="primary" href="${this._href}" @click=${this.handleClick}> 31069 <div class="reserver-plan-wording"> 31070 <sonic-icon library="custom" name="location-dot"></sonic-icon> 31071 <div>${text} ${this.renderPriceInfo()}</div> 31072 </div> 31073 </sonic-button> 31074 `; 31075 } 31076 renderPriceInfo() { 31077 const noPrice = !this.prices || this.prices.length === 0; 31078 const eventIsFull = this.infos_status?.additionnals && this.infos_status.additionnals.filter((x2) => x2.key && ["full", "full_here", "canceled"].includes(x2.key)).length > 0; 31079 if (eventIsFull || noPrice) return A$1; 31080 const maxPrice = Math.max(...this.prices.map((price) => price?.amount || 0)); 31081 const hasMultiplePrices = this.prices.length > 1; 31082 if (maxPrice > 0) { 31083 return b$1`<div class="text-sm font-normal mt-1 text-left justify-start"> 31084 ${hasMultiplePrices ? priceRange({ max: maxPrice }) : formatAmount(maxPrice)} 31085 </div>`; 31086 } else { 31087 return b$1`<div class="text-sm font-normal mt-1 text-left justify-start">${t("free")}</div>`; 31088 } 31089 } 31090 }; 31091 MapLink.styles = [ 31092 tailwind, 31093 i$9` 31094 sonic-button { 31095 --sc-btn-py: 0.8em; 31096 } 31097 31098 sonic-icon { 31099 margin-right: 0.3em; 31100 } 31101 31102 .reserver-plan-wording { 31103 display: flex; 31104 justify-content: flex-start; 31105 font-weight: 600; 31106 } 31107 ` 31108 ]; 31109 __decorateClass$32([ 31110 n$5({ type: String }) 31111 ], MapLink.prototype, "slug", 2); 31112 __decorateClass$32([ 31113 n$5({ type: Object }) 31114 ], MapLink.prototype, "infos_status", 2); 31115 __decorateClass$32([ 31116 n$5({ type: Object }) 31117 ], MapLink.prototype, "room", 2); 31118 __decorateClass$32([ 31119 n$5({ type: Array }) 31120 ], MapLink.prototype, "prices", 2); 31121 __decorateClass$32([ 31122 c({ context: accessParamsContext, subscribe: true }), 31123 n$5({ type: Object }) 31124 ], MapLink.prototype, "accessParams", 2); 31125 __decorateClass$32([ 31126 r$5() 31127 ], MapLink.prototype, "_href", 2); 31128 __decorateClass$32([ 31129 bind$1("settings.subscriptionRequirement"), 31130 r$5() 31131 ], MapLink.prototype, "subscriptionRequirement", 2); 31132 __decorateClass$32([ 31133 c({ context: appType, subscribe: true }), 31134 r$5() 31135 ], MapLink.prototype, "appType", 2); 31136 MapLink = __decorateClass$32([ 31137 t$3("sonic-event-map-link") 31138 ], MapLink); 31139 var __decorate$e = function(decorators, target, key, desc) { 31140 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 31141 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 31142 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 31143 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 31144 }; 31145 const tagName$1S = "sonic-select"; 31146 let Select = class Select extends Form$2(Subscriber$1(i$6)) { 31147 constructor() { 31148 super(...arguments); 31149 this.valueKey = "value"; 31150 this.wordingKey = "wording"; 31151 this.multiple = false;
31152 this.status = "default"; 31153 this._options = []; 31154 this.hasDoneFirstUpdate = false; 31155 this._value = ""; 31156 this.updateOptions = () => { 31157 const options = this.querySelectorAll("option"); 31158 if (options.length > 0) { 31159 this.options = Array.from(options).map((option) => { 31160 return { 31161 value: option.value, 31162 wording: option.text, 31163 selected: option.hasAttribute("selected") 31164 }; 31165 }); 31166 } 31167 }; 31168 this.forceAutoFill = false; 31169 this.hasDescription = false; 31170 this.hasLabel = false; 31171 this.hasSuffix = false; 31172 this.hasPrefix = false; 31173 } 31174 set options(options) { 31175 this._options = options; 31176 for (const option of options) { 31177 if (option.selected) { 31178 this.value = option[this.valueKey] || ""; 31179 } 31180 } 31181 const value = this.value || this.getAttribute("value"); 31182 if (!value && this._options.length > 0) { 31183 this.value = this._options[0][this.valueKey]; 31184 } 31185 this.requestUpdate(); 31186 } 31187 get options() { 31188 return this._options; 31189 } 31190 firstUpdated(changedProperties) { 31191 this.hasDoneFirstUpdate = true; 31192 super.firstUpdated(changedProperties); 31193 } 31194 set value(value) { 31195 if (value == null && !this.hasDoneFirstUpdate) 31196 return; 31197 if (!value) 31198 value = ""; 31199 if (this._value == value) 31200 return; 31201 this._value = value; 31202 this.updateFormPublisherValue(); 31203 this.requestUpdate(); 31204 } 31205 get value() { 31206 return this._value; 31207 } 31208 updateFormPublisherValue() { 31209 this.setFormPublisherValue(this.value); 31210 } 31211 connectedCallback() { 31212 super.connectedCallback(); 31213 this.hasSlotOrProps(); 31214 this.updateOptions(); 31215 } 31216 get description() { 31217 return this._description; 31218 } 31219 set description(value) { 31220 if (this.hasAttribute("description") && !this.forceAutoFill) 31221 value = this.getAttribute("description"); 31222 this._description = value; 31223 this.requestUpdate(); 31224 } 31225 get label() { 31226 return this._label; 31227 } 31228 set label(value) { 31229 if (this.hasAttribute("label") && !this.forceAutoFill) 31230 value = this.getAttribute("label"); 31231 this._label = value; 31232 this.requestUpdate(); 31233 } 31234 willUpdate(changedProperties) { 31235 this.hasSlotOrProps(); 31236 super.willUpdate(changedProperties); 31237 } 31238 hasSlotOrProps() { 31239 this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false; 31240 this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false; 31241 this.hasSuffix = this.slotSuffixNodes?.length ? true : false; 31242 this.hasPrefix = this.slotPrefixNodes?.length ? true : false; 31243 } 31244 validateFormElement() { 31245 const select2 = this.shadowRoot?.querySelector("select"); 31246 if (!select2 || select2.checkValidity()) 31247 return; 31248 const formPublisher = this.getFormPublisher(); 31249 if (formPublisher) { 31250 formPublisher.isFormValid = false; 31251 } 31252 select2.reportValidity(); 31253 } 31254 render() { 31255 const slotClasses = { 31256 "has-prefix": this.hasPrefix, 31257 "has-suffix": this.hasSuffix 31258 }; 31259 return b$1` 31260 <label 31261 for="form-element" 31262 class="${this.hasLabel ? "form-label" : "hidden"}" 31263 >${this.label ? o$6( 31264 this.label 31265 /*+ labelStarSuffix*/ 31266 ) : ""}<slot 31267 name="label" 31268 @slotchange=${this.hasSlotOrProps} 31269 ></slot 31270 ></label> 31271 31272 <div class="form-control ${e(slotClasses)}"> 31273 <slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot> 31274 <div class="form-select-wrapper"> 31275 <select 31276 data-form-element 31277 id="form-element" 31278 @change=${this.handleChange} 31279 @blur=${this.handleBlur} 31280 ?disabled=${this.disabled} 31281 ?required=${this.required} 31282 ?multiple=${this.multiple} 31283 size=${o$4(this.selectSize)} 31284 ?autofocus=${this.autofocus} 31285 .value="${this.value}" 31286 class="form-element" 31287 aria-label=${o$4(this.ariaLabel)} 31288 aria-labelledby=${o$4(this.ariaLabelledby)} 31289 > 31290 ${c$1(this.options, (option) =>
31290 option[this.valueKey], (option) => { 31291 const isSelected = this.value == option[this.valueKey] ? true : false; 31292 return b$1`<option 31293 ?selected=${isSelected} 31294 value="${option[this.valueKey]}" 31295 > 31296 ${option[this.wordingKey]} 31297 </option>`; 31298 })} 31299 <slot></slot> 31300 </select> 31301 <sonic-icon 31302 class="select-chevron" 31303 name="nav-arrow-down" 31304 .size=${this.size} 31305 ></sonic-icon> 31306 </div> 31307 <slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot> 31308 </div> 31309 31310 <slot 31311 name="description" 31312 @slotchange=${this.hasSlotOrProps} 31313 class="${this.hasDescription ? "form-description" : "hidden"}" 31314 >${this.description ? b$1`${o$6(this.description)}` : ""}</slot 31315 > 31316 `; 31317 } 31318 }; 31319 Select.styles = [ 31320 fontSize, 31321 formControl, 31322 label, 31323 description, 31324 i$9` 31325 .form-element { 31326 appearance: none; 31327 white-space: nowrap; 31328 overflow: hidden; 31329 text-overflow: ellipsis; 31330 } 31331 31332 :host([disabled]) sonic-icon { 31333 opacity: 0; 31334 } 31335 31336 @supports selector(:has(*)) { 31337 :host(:not([disabled]):not([align="center"])) 31338 .form-element:not(:has(option:only-child)) { 31339 padding-right: max(1.5em, calc(1.5 * var(--sc-input-px))); 31340 } 31341 } 31342 /*Firefox etc.*/ 31343 @supports not selector(:has(*)) { 31344 :host(:not([disabled]):not([align="center"])) .form-element { 31345 padding-right: max(1.5em, calc(1.5 * var(--sc-input-px))); 31346 } 31347 } 31348 31349 .form-select-wrapper { 31350 position: relative; 31351 width: 100%; 31352 } 31353 31354 sonic-icon { 31355 position: absolute; 31356 top: 50%; 31357 pointer-events: none; 31358 transform: translateY(-50%); 31359 color: var(--sc-input-c); 31360 right: 0.1em; 31361 width: 1.275em; 31362 } 31363 31364 option { 31365 padding: 0.1rem var(--sc-input-px, 0); 31366 color: var(--sc-base-content, #000); 31367 background: var(--sc-base, #fff); 31368 } 31369 31370 select[multiple] option { 31371 background: transparent; 31372 padding: 0; 31373 } 31374 :host([multiple]) sonic-icon { 31375 display: none !important; 31376 } 31377 ` 31378 ]; 31379 __decorate$e([ 31380 n$5({ type: String }) 31381 ], Select.prototype, "valueKey", void 0); 31382 __decorate$e([ 31383 n$5({ type: String }) 31384 ], Select.prototype, "wordingKey", void 0); 31385 __decorate$e([ 31386 n$5({ type: Boolean }) 31387 ], Select.prototype, "multiple", void 0); 31388 __decorate$e([ 31389 n$5({ type: String, reflect: true }) 31390 ], Select.prototype, "size", void 0); 31391 __decorate$e([ 31392 n$5({ type: Number }) 31393 ], Select.prototype, "selectSize", void 0); 31394 __decorate$e([ 31395 n$5({ type: String, reflect: true }) 31396 ], Select.prototype, "status", void 0); 31397 __decorate$e([ 31398 n$5({ type: Array }) 31399 ], Select.prototype, "options", null); 31400 __decorate$e([ 31401 n$5({ reflect: true }) 31402 ], Select.prototype, "value", null); 31403 __decorate$e([ 31404 n$5({ type: Boolean }) 31405 ], Select.prototype, "forceAutoFill", void 0); 31406 __decorate$e([ 31407 n$5() 31408 ], Select.prototype, "description", null); 31409 __decorate$e([ 31410 n$5() 31411 ], Select.prototype, "label", null); 31412 __decorate$e([ 31413 n$4({ slot: "label", flatten: true }) 31414 ], Select.prototype, "slotLabelNodes", void 0); 31415 __decorate$e([ 31416 n$4({ slot: "description", flatten: true }) 31417 ], Select.prototype, "slotDescriptionNodes", void 0); 31418 __decorate$e([ 31419 n$4({ slot: "suffix", flatten: true }) 31420 ], Select.prototype, "slotSuffixNodes", void 0); 31421 __decorate$e([ 31422 n$4({ slot: "prefix", flatten: true }) 31423 ], Select.prototype, "slotPrefixNodes", void 0); 31424 __decorate$e([ 31425 r$5() 31426 ], Select.prototype, "hasDescription", void 0); 31427 __decorate$e([ 31428 r$5() 31429 ], Select.prototype, "hasLabel", void 0); 31430 __decorate$e([ 31431 r$5() 31432 ], Select.prototype, "hasSuffix", void 0); 31433 __decorate$e([ 31434 r$5() 31435 ], Select.prototype, "hasPrefix", void 0); 31436 Select = __decorate$e([ 31437 t$3(tagName$1S) 31438 ], Select); 31439 var __defProp$2_ = Object.defineProperty; 31440 var __getOwnPropDesc$31 = Object.getOwnPropertyDescriptor; 31441 var __decorateClass$31 = (decorators, target, key, kind) => { 31442 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$31(target, key) : target; 31443 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 31444 if (decorator = decorators[i2]) 31445 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 31446 if (kind && result) __defProp$2_(target, key, result); 31447 return result; 31448 }; 31449 const tagName$1R = "sonic-iframe"; 31450 let SonicIframe = class extends i$6 { 31451 constructor() { 31452 super(...arguments); 31453 this.src = ""; 31454 this.title = ""; 31455 this.urlBase = ""; 31456 this.lang = "fr"; 31457 this.loading = true; 31458 this.error = false;
31459 this.nbOfLoad = 0; 31460 this.scollIsInitialized = false; 31461 this.configureTheme = (theme) => { 31462 if (!theme) return; 31463 if (this._iframe) { 31464 this._iframe.contentWindow?.postMessage({ type: "SonicTheme", ...theme }, "*"); 31465 } 31466 }; 31467 this.handleIframeMessage = (e2) => { 31468 if (e2.data.invalidate) { 31469 const dataProviders = e2.data.invalidate; 31470 if (Array.isArray(dataProviders)) { 31471 dataProviders.forEach((dataProvider) => { 31472 PublisherManager.get(dataProvider).invalidate(); 31473 }); 31474 } else { 31475 PublisherManager.get(dataProviders).invalidate(); 31476 } 31477 } 31478 if (e2.data.goTo) { 31479 { 31480 let redirectUrl = ""; 31481 const absoluteGoTo = e2.data.goTo.startsWith("http"); 31482 if (absoluteGoTo) { 31483 redirectUrl = decodeURIComponent(e2.data.goTo); 31484 } else { 31485 redirectUrl = appRoute(e2.data.goTo || "home").query(e2.data.params || {}).toString(); 31486 } 31487 if (redirectUrl) { 31488 window.location.href = redirectUrl; 31489 } 31490 } 31491 } 31492 if (e2.data.closeModal) { 31493 closeParentModal(this); 31494 } 31495 if (e2.data.isLoaded == true) { 31496 this._iframe?.contentWindow?.postMessage({ type: "iframeContext", value: "v2" }, "*"); 31497 if (this.nbOfLoad > 0) { 31498 this.scrollTopIframe(); 31499 } 31500 this.nbOfLoad += 1; 31501 } 31502 if (e2.data.goToPayment == true || e2.data.eventType === "popup" && window?.matchMedia("(max-width: 640px)").matches) { 31503 this.scrollTopIframe(); 31504 } 31505 if (e2.data.type == "SonicIframeResquestParentScrollPosition") { 31506 this.sendIframePosition(); 31507 if (!this.scollIsInitialized) { 31508 window.addEventListener("scroll", () => { 31509 this.sendIframePosition(); 31510 }); 31511 window.addEventListener("resize", () => { 31512 this.sendIframePosition(); 31513 }); 31514 } 31515 } 31516 if (e2.data.type == "iframeBodySize") { 31517 if (this._iframe) { 31518 this._iframe.style.height = e2.data.value.height + "px"; 31519 } 31520 } 31521 }; 31522 this.observer = new MutationObserver((mutationsList) => { 31523 mutationsList.forEach((mutation) => { 31524 if (mutation.type === "attributes") { 31525 this.lang = this.getHTMLlang(); 31526 } 31527 }); 31528 }); 31529 } 31530 connectedCallback() { 31531 const serviceURL = HTML$1.getAncestorAttributeValue(this, "serviceURL") || ""; 31532 this.urlBase = new URL(serviceURL, document.location.href).origin; 31533 this.lang = this.getHTMLlang(); 31534 this.observer.observe(document.documentElement, { attributes: true }); 31535 PublisherManager.get("sonic-theme").onAssign(this.configureTheme); 31536 window.addEventListener("message", this.handleIframeMessage, false); 31537 super.connectedCallback(); 31538 } 31539 getHTMLlang() { 31540 return document.documentElement.lang.split("-")[0] || "fr"; 31541 } 31542 sendIframePosition() { 31543 if (this._iframe) { 31544 const iframeWrapperRect = this._iframe.getBoundingClientRect(); 31545 const iframeWrapperTop = iframeWrapperRect.top; 31546 this._iframe.contentWindow?.postMessage( 31547 { 31548 type: "SonicIframeScrollPosition", 31549 scrollY: window.scrollY, 31550 iframeWrapperTop, 31551 parentInnerHeight: window.innerHeight 31552 }, 31553 "*" 31554 ); 31555 } 31556 } 31557 disconnectedCallback() { 31558 PublisherManager.get("sonic-theme").offAssign(this.configureTheme); 31559 this.observer.disconnect(); 31560 super.disconnectedCallback(); 31561 } 31562 scrollTopIframe() { 31563 if (this._iframe) { 31564 if (this._iframeAnchor) { 31565 const iframeAnchorRect = this._iframeAnchor.getBoundingClientRect(); 31566 const iframeAnchorTop = iframeAnchorRect.top; 31567 if (iframeAnchorTop < 0) { 31568 this._iframeAnchor.scrollIntoView({ block: "start", behavior: "smooth" }); 31569 } 31570 } 31571 } 31572 } 31573 handleLoad() { 31574 this.loading = false;
31575 } 31576 handleError() { 31577 this.error = true; 31578 } 31579 willUpdate(_changedProperties) { 31580 if (_changedProperties.has("src")) { 31581 this.loading = true; 31582 } 31583 super.willUpdate(_changedProperties); 31584 } 31585 render() { 31586 let src = this.src; 31587 const isUrlBackOffice = src.includes("/la_billetterie/"); 31588 const srcParams = `lang=${this.lang}&noredirect=1${!isUrlBackOffice ? "&iframe=true" : ""}&iframe_v2=true`; 31589 src = src.includes("?") ? `${src}&${srcParams}` : `${src}?${srcParams}`; 31590 return b$1` 31591 <span id="iframeAnchor" class="absolute -translate-y-4 pointer-events-none"></span> 31592 ${this.error ? b$1`<sonic-alert status="error">${t("error_title")}</sonic-alert>` : A$1} 31593 <iframe 31594 id="iframe" 31595 referrerpolicy="origin" 31596 src="${this.urlBase + src}" 31597 title="${this.title}" 31598 frameborder="0" 31599 scrolling="no" 31600 allowtransparency="true" 31601 width="100%" 31602 height="500" 31603 class="iframe-billetterie relative z-10 transition-opacity duration-300 opacity-1 ${this.loading ? "opacity-30 pointer-events-none duration-500" : ""}" 31604 @load="${this.handleLoad}" 31605 @error="${this.handleError}" 31606 ></iframe> 31607 ${this.loading ? b$1`<sonic-loader></sonic-loader>` : A$1} 31608 `; 31609 } 31610 }; 31611 SonicIframe.styles = [ 31612 tailwind, 31613 i$9` 31614 iframe { 31615 width: 100%; 31616 min-width: 100%; 31617 border: none; 31618 } 31619 31620 :host() { 31621 display: block; 31622 min-height: 1px; 31623 } 31624 31625 :host([cover]) iframe { 31626 min-height: 100% !important; 31627 position: absolute; 31628 top: 0; 31629 left: 0; 31630 right: 0; 31631 bottom: 0; 31632 } 31633 ` 31634 ]; 31635 __decorateClass$31([ 31636 n$5() 31637 ], SonicIframe.prototype, "src", 2); 31638 __decorateClass$31([ 31639 n$5() 31640 ], SonicIframe.prototype, "title", 2); 31641 __decorateClass$31([ 31642 e$7("#iframe") 31643 ], SonicIframe.prototype, "_iframe", 2); 31644 __decorateClass$31([ 31645 e$7("#iframeAnchor") 31646 ], SonicIframe.prototype, "_iframeAnchor", 2); 31647 __decorateClass$31([ 31648 n$5({ type: String }) 31649 ], SonicIframe.prototype, "urlBase", 2); 31650 __decorateClass$31([ 31651 n$5({ type: String }) 31652 ], SonicIframe.prototype, "lang", 2); 31653 __decorateClass$31([ 31654 n$5({ type: Boolean }) 31655 ], SonicIframe.prototype, "loading", 2); 31656 __decorateClass$31([ 31657 n$5({ type: Boolean }) 31658 ], SonicIframe.prototype, "error", 2); 31659 SonicIframe = __decorateClass$31([ 31660 t$3(tagName$1R) 31661 ], SonicIframe);
31662 const buyModeContext = n("buyModeContext"); 31663 async function fetchEntityQuotasStock(element, entityType, entityId) { 31664 if (!entityId) return []; 31665 const api2 = new API(HTML.getApiConfiguration(element)); 31666 const endpoint = entityEndPoint({ entityType, entityId, features: [Feature.Quotas] }); 31667 const result = await api2.get(endpoint); 31668 const data = result?.data; 31669 if (!data || !("quotas" in data)) return []; 31670 return data.quotas ?? []; 31671 } 31672 function shouldFetchQuotasStockDisplay(appType2, accessParams) { 31673 return appType2 === "counter" && accessParams?.isWaitingList === true; 31674 } 31675 function applyQuotasStockDisplay(logicQuotas, stockQuotas) { 31676 if (!stockQuotas.length) return logicQuotas; 31677 const stockById = new Map(stockQuotas.map((quota) => [Number(quota.id), quota])); 31678 return logicQuotas.map((quota) => { 31679 const stock = stockById.get(Number(quota.id)); 31680 if (!stock) return quota; 31681 return { 31682 ...quota, 31683 remaining_places_nb: stock.remaining_places_nb, 31684 total_places_nb: stock.total_places_nb, 31685 has_remaining: stock.has_remaining 31686 }; 31687 }); 31688 } 31689 function buildQuotaSelectOptions({ 31690 quotas, 31691 stockQuotas, 31692 selectedQuotaId, 31693 isCounterMode, 31694 isCustomerMode 31695 }) { 31696 const displayQuotas = stockQuotas?.length ? applyQuotasStockDisplay(quotas, stockQuotas) : quotas; 31697 return quotasToOptions(displayQuotas, selectedQuotaId, isCounterMode, isCustomerMode); 31698 } 31699 var __defProp$2Z = Object.defineProperty; 31700 var __getOwnPropDesc$30 = Object.getOwnPropertyDescriptor; 31701 var __decorateClass$30 = (decorators, target, key, kind) => { 31702 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$30(target, key) : target; 31703 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 31704 if (decorator = decorators[i2]) 31705 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 31706 if (kind && result) __defProp$2Z(target, key, result); 31707 return result; 31708 }; 31709 let QuotaSelector = class extends Subscriber$1(i$6) { 31710 constructor() { 31711 super(...arguments); 31712 this.room = {}; 31713 this._quotas = []; 31714 this.selectedQuota = null; 31715 this._initialSelectedQuota = null; 31716 this.display = "select"; 31717 this.buyMode = BuyMode.DEFAULT; 31718 this.lockSeatContingentSelection = false; 31719 this._stockQuotas = []; 31720 this._stockQuotasRequestId = 0; 31721 this.seatmapProvider = "seatmap"; 31722 this.pricesTerms = { 31723 fr: "Tarifs public", 31724 en: "Public prices", 31725 de: "Ãffentliche Preise", 31726 nl: "Publieke prijzen" 31727 }; 31728 this.firstUpdatedQuota = false; 31729 } 31730 get quotas() { 31731 return this._quotas; 31732 } 31733 set quotas(value) { 31734 this._quotas = value; 31735 const selectedSeats = get("seatmap.selectedSeats") || []; 31736 if (selectedSeats.length) { 31737 this.selectQuotaById(parseInt(selectedSeats[0].contingentementInterne)); 31738 this.requestUpdate(); 31739 return; 31740 } 31741 this.selectQuotaById(this.selectedQuota?.id); 31742 this.requestUpdate(); 31743 } 31744 connectedCallback() { 31745 super.connectedCallback(); 31746 this._initialSelectedQuota = structuredClone(this.selectedQuota); 31747 } 31748 selectQuotaById(id) { 31749 const quota = this.quotas.find((q) => q.id == parseInt(id + "")); 31750 const index = quota ? this.quotas.indexOf(quota) : 0; 31751 this.useQuotaAtIndex(index); 31752 } 31753 handleQuotaSelection(e2) { 31754 let elementValue = ""; 31755 if (e2.target instanceof HTMLSelectElement) { 31756 elementValue = e2.target.value; 31757 } else { 31758 elementValue = e2.currentTarget.value; 31759 } 31760 this.selectQuotaById(parseInt(elementValue)); 31761 } 31762 onSelectedSeatsChange(selectedSeats) { 31763 if (!selectedSeats?.length) { 31764 return; 31765 } 31766 this.selectQuotaById(parseInt(selectedSeats[0].contingentementInterne)); 31767 } 31768 useQuotaAtIndex(index) { 31769 if (!this.quotas || !this.props) return; 31770 const itemId = this.props.id; 31771 if (!itemId) return; 31772 const selectedQuota = this.quotas.length > 1 ? this.quotas[index] : null; 31773 this.selectedQuota = selectedQuota || {}; 31774 this.dispatchEvent(new CustomEvent("selectQuota", { detail: selectedQuota })); 31775 const showAll = this.quotas.length < 2 || !this.quotas[index]; 31776 PublisherManager.get("product/" + itemId + "/PricesFilter").set({ 31777 selectedQuota, 31778 showAll, 31779 quotas: this.quotas 31780 }); 31781 } 31782 editQuota(url) { 31783 Modal.create({ 31784 content: ( 31785 /*html*/ 31786 `<sonic-iframe src="${url}"></sonic-iframe>` 31787 ), 31788 width: "90%", 31789 paddingX: "1.25rem", 31790 paddingY: "1.25rem", 31791 maxWidth: "65rem", 31792 height: "90svh", 31793 maxHeight: "90svh", 31794 removeOnHide: true 31795 // zIndex: 10, 31796 }); 31797 } 31798 replaceTabTitle(title) { 31799 const currentHtmlLang = document.documentElement.lang; 31800 const cleanTitle = this.pricesTerms?.[currentHtmlLang] ? this.pricesTerms[currentHtmlLang] : "Tarifs public"; 31801 return title?.replace("Hors contingentement", cleanTitle); 31802 } 31803 // preferredQuotaInit = false;
31804 async willUpdate(changedProperties) { 31805 if (changedProperties.has("selectedQuota") && !this.firstUpdatedQuota) { 31806 this.selectFirstQuotaWithPrices(); 31807 this.firstUpdatedQuota = true; 31808 } 31809 if (changedProperties.has("props") || changedProperties.has("appType") || changedProperties.has("accessParams")) { 31810 await this.loadStockQuotas(); 31811 } 31812 super.willUpdate(changedProperties); 31813 } 31814 async loadStockQuotas() { 31815 if (!shouldFetchQuotasStockDisplay(this.appType, this.accessParams)) { 31816 this._stockQuotas = []; 31817 return; 31818 } 31819 const entityId = Number(this.props?.id); 31820 if (!entityId) { 31821 this._stockQuotas = []; 31822 return; 31823 } 31824 const requestId = ++this._stockQuotasRequestId; 31825 const stockQuotas = await fetchEntityQuotasStock(this, EntityType.Event, entityId); 31826 if (requestId !== this._stockQuotasRequestId) return; 31827 this._stockQuotas = stockQuotas; 31828 } 31829 buildQuotaOptions() { 31830 return buildQuotaSelectOptions({ 31831 quotas: this.quotas, 31832 stockQuotas: this._stockQuotas, 31833 selectedQuotaId: Number(this.selectedQuota?.id) || 0, 31834 isCounterMode: this.appType === "counter", 31835 isCustomerMode: this.appType === "customer" 31836 }); 31837 } 31838 selectFirstQuotaWithPrices() { 31839 if (this.appType !== "customer") { 31840 return; 31841 } 31842 if (this.props && !("settings" in this.props)) { 31843 return; 31844 } 31845 const settings = this.props?.settings; 31846 const no_seatmap = settings && "has_seatmap" in settings && settings?.has_seatmap === false; 31847 if (!no_seatmap) { 31848 return; 31849 } 31850 const firstQuotaWithPrice = this.getFirstQuotaWithPrice(); 31851 if (firstQuotaWithPrice) { 31852 this.useQuotaAtIndex(this.quotas.indexOf(firstQuotaWithPrice)); 31853 } 31854 } 31855 getFirstQuotaWithPrice() { 31856 return this.quotas.find((quota) => { 31857 const hasPrices = quota.prices && quota.prices?.length > 0; 31858 const hasVisiblePrices = hasPrices && quota.prices?.some((price) => price.visible == true); 31859 return hasVisiblePrices; 31860 }); 31861 } 31862 renderDescription() { 31863 if (!this.selectedQuota?.description) return A$1; 31864 return b$1`<div class="mt-5 prose prose-sm prose-tight">${o$6(this.selectedQuota.description)}</div>`; 31865 } 31866 /** 31867 * Place contingentée : id > 1 (hors « Hors contingentement »). 31868 * Indépendant du caractère public ou privé du contingent. 31869 */ 31870 shouldRenderContingentedPlacementAlert() { 31871 const isContingented = Number(this._initialSelectedQuota?.id) > 1; 31872 if (!isSeatMode(this.buyMode) || this.appType !== "counter" || !isContingented) { 31873 return false; 31874 } 31875 return true; 31876 } 31877 renderContingentAlert() { 31878 if (!this.shouldRenderContingentedPlacementAlert()) { 31879 return A$1; 31880 } 31881 const quotaHasChanged = this._initialSelectedQuota?.id !== this.selectedQuota?.id; 31882 return b$1`<sonic-badge 31883 type="${quotaHasChanged ? "warning" : "info"}" 31884 class="relative ml-3 mb-1 pointer-events-none" 31885 > 31886 <sonic-icon name="${quotaHasChanged ? "face-surprise" : "circle-info"}" library="custom"></sonic-icon> 31887 ${quotaHasChanged ? "Vous allez modifier le contingent de la place" : t("places_contingentees")} 31888 </sonic-badge> `; 31889 } 31890 render() { 31891 if (!this.quotas) return A$1; 31892 const isPlaced = this.room && ["place", "mixte"].includes(this.room.placing_type_key || ""); 31893 const isSeat = isSeatMode(this.buyMode); 31894 const isCounter = this.appType === "counter"; 31895 if (isPlaced && isDefaultMode(this.buyMode)) return A$1; 31896 if (isSeat && !isCounter) return this.renderDescription(); 31897 const options = this.buildQuotaOptions(); 31898 const mustRender = options.length > 1 && !this.lockSeatContingentSelection; 31899 const routeContingent = appRoute("event.edit.quotas")?.fill({ id: this.props?.id }).query({ dataProvider: this.dataProvider ? encodeURIComponent(this.dataProvider) : "" }).toString(); 31900 const showContingentEditButton = routeContingent && isDefaultMode(this.buyMode) && this.currentAdminPermissions?.event?.edit_quotas === true ? true : false;
31901 return b$1` 31902 <sonic-if .condition=${mustRender}> 31903 <!--Onglets--> 31904 ${this.display === "tabs" ? b$1` 31905 <div class="flex gap-2 w-full relative ${flexJustify(this.align)}"> 31906 ${o$1(this.quotas, (quota) => { 31907 return b$1` 31908 <button @click=${this.handleQuotaSelection} value=${quota.id} class="relative"> 31909 <div class="font-bold px-2 py-1">${this.replaceTabTitle(quota.title)}</div> 31910 <div 31911 class="${this.selectedQuota?.id == quota.id ? "scale-x-100" : "scale-x-0"} transition absolute h-[4px] -bottom-[4px] bg-current w-full rounded" 31912 ></div> 31913 </button> 31914 `; 31915 })} 31916 </div> 31917 <div class="h-[4px] w-full rounded bg-neutral-100"></div> 31918 ` : A$1} 31919 31920 <!--SELECT--> 31921 ${this.display === "select" ? b$1` ${this.renderContingentAlert()} ${this.renderDescription()} 31922 <div class="flex gap-x-2 items-center"> 31923 <sonic-select 31924 @change=${this.handleQuotaSelection} 31925 .options=${options} 31926 dataProvider=${this.dataProvider + "/quota-selector"} 31927 class="grow ${isSeat ? "" : "max-w-[26rem]"}" 31928 size="${isSeat ? "md" : "sm"}" 31929 name="quota" 31930 ></sonic-select> 31931 ${showContingentEditButton && this.appType === "counter" ? b$1` <sonic-button @click=${() => this.editQuota(routeContingent)} icon shape="circle" size="sm"> 31932 <sonic-icon name="pen" library="custom"></sonic-icon> 31933 </sonic-button>` : A$1} 31934 </div>` : A$1} 31935 </sonic-if> 31936 `; 31937 } 31938 }; 31939 QuotaSelector.styles = [tailwind]; 31940 __decorateClass$30([ 31941 n$5() 31942 ], QuotaSelector.prototype, "room", 2); 31943 __decorateClass$30([ 31944 n$5() 31945 ], QuotaSelector.prototype, "quotas", 1); 31946 __decorateClass$30([ 31947 n$5({ type: Object }) 31948 ], QuotaSelector.prototype, "selectedQuota", 2); 31949 __decorateClass$30([ 31950 n$5({ type: String }) 31951 ], QuotaSelector.prototype, "display", 2); 31952 __decorateClass$30([ 31953 c({ context: buyModeContext, subscribe: true }), 31954 n$5({ type: String }) 31955 ], QuotaSelector.prototype, "buyMode", 2); 31956 __decorateClass$30([ 31957 n$5({ type: Boolean }) 31958 ], QuotaSelector.prototype, "lockSeatContingentSelection", 2); 31959 __decorateClass$30([ 31960 c({ context: alignContext, subscribe: true }), 31961 n$5({ type: String, reflect: true }) 31962 ], QuotaSelector.prototype, "align", 2); 31963 __decorateClass$30([ 31964 c({ context: appType, subscribe: true }), 31965 r$5() 31966 ], QuotaSelector.prototype, "appType", 2); 31967 __decorateClass$30([ 31968 c({ context: accessParamsContext, subscribe: true }), 31969 n$5({ type: Object }) 31970 ], QuotaSelector.prototype, "accessParams", 2); 31971 __decorateClass$30([ 31972 r$5() 31973 ], QuotaSelector.prototype, "_stockQuotas", 2); 31974 __decorateClass$30([ 31975 bind$1("admin/current.data.permissions"), 31976 r$5() 31977 ], QuotaSelector.prototype, "currentAdminPermissions", 2); 31978 __decorateClass$30([ 31979 ancestorAttribute("seatmapProvider") 31980 ], QuotaSelector.prototype, "seatmapProvider", 2); 31981 __decorateClass$30([ 31982 onAssign(seatmapKey.selectedSeats.path) 31983 ], QuotaSelector.prototype, "onSelectedSeatsChange", 1); 31984 QuotaSelector = __decorateClass$30([ 31985 t$3("sonic-event-quota-selector") 31986 ], QuotaSelector); 31987 const styles$1 = i$9` 31988 .sonic-categorized-prices-form:not(:last-child) { 31989 margin-bottom: 1.1em; 31990 } 31991`; 31992 const styles = i$9` 31993 :host { 31994 display: flex; 31995 flex: 1; 31996 } 31997 31998 sonic-button { 31999 display: content; 32000 flex: 1; 32001 display: flex; 32002 position: relative; 32003 --sc-btn-py: 1em; 32004 --sc-btn-px: 0.7em; 32005 --sc-btn-gap: 0; 32006 --sc-btn-hover-filter: none; 32007 --sc-btn-active-filter: none; 32008 } 32009 32010 :host([size="sm"]) sonic-button { 32011 --sc-btn-py: 0.6em; 32012 } 32013 32014 .name { 32015 display: block; 32016 overflow-wrap: break-word; 32017 word-wrap: break-word; 32018 word-break: break-word; 32019 } 32020 32021 sonic-pop { 32022 position: absolute; 32023 right: 0; 32024 top: 0; 32025 } 32026 32027 :host svg { 32028 width: 0.3em; 32029 } 32030`; 32031 const disableButtonMultiSelectContext = n("disableButtonMultiSelectContext"); 32032 var __decorate$d = function(decorators, target, key, desc) { 32033 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 32034 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 32035 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 32036 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 32037 }; 32038 let LegendDescription = class LegendDescription extends i$6 { 32039 render() { 32040 return b$1`<slot></slot>`; 32041 } 32042 }; 32043 LegendDescription.styles = [ 32044 i$9` 32045 :host { 32046 font-size: 1.15rem; 32047 line-height: 1.2; 32048 display: block; 32049 color: var(--sc-base-500, var(--sc-base-content, #000)); 32050 font-weight: var(--sc-font-weight-base, 400); 32051 font-style: var(--sc-font-style-base, normal); 32052 margin-top: 0.2em; 32053 container-type: inline-size; 32054 } 32055 32056 @container (max-inline-size: 28rem) { 32057 :host { 32058 font-size: 1rem; 32059 } 32060 } 32061 ` 32062 ]; 32063 LegendDescription = __decorate$d([ 32064 t$3("sonic-legend-description") 32065 ], LegendDescription); 32066 var __decorate$c = function(decorators, target, key, desc) { 32067 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 32068 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 32069 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 32070 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 32071 }; 32072 const tagName$1Q = "sonic-legend"; 32073 let Legend = class Legend extends i$6 { 32074 constructor() { 32075 super(...arguments); 32076 this.forceAutoFill = false;
32077 } 32078 get description() { 32079 return this._description; 32080 } 32081 set description(value) { 32082 if (this.hasAttribute("description") && !this.forceAutoFill) 32083 value = this.getAttribute("description"); 32084 this._description = value; 32085 this.requestUpdate(); 32086 } 32087 get label() { 32088 return this._label; 32089 } 32090 set label(value) { 32091 if (this.hasAttribute("label") && !this.forceAutoFill) 32092 value = this.getAttribute("label"); 32093 this._label = value; 32094 this.requestUpdate(); 32095 } 32096 render() { 32097 return b$1`<legend part="legend"> 32098 ${this.iconName ? b$1`<div class="icon"> 32099 <sonic-icon 32100 name=${this.iconName} 32101 prefix=${o$4(this.iconPrefix)} 32102 library=${o$4(this.iconLibrary)} 32103 ></sonic-icon> 32104 </div>` : ""} 32105 32106 <div class="legend-content"> 32107 ${o$6(this.label ? this.label : "")} 32108 ${this.description ? b$1`<sonic-legend-description 32109 >${o$6(this.description)}</sonic-legend-description 32110 >` : ""} 32111 <slot></slot> 32112 </div> 32113 <slot name="suffix"></slot> 32114 </legend>`; 32115 } 32116 }; 32117 Legend.styles = [ 32118 i$9` 32119 :host { 32120 --sc-legend-font-size: 1.5rem; 32121 --sc-legend-font-weight: var(--sc-font-weight-base, 400); 32122 --sc-legend-font-style: var(--sc-headings-font-style, normal); 32123 --sc-legend-family: var( 32124 --sc-headings-font-family, 32125 var(--sc-font-family-base, sans-serif) 32126 ); 32127 --sc-legend-line-height: var(--sc-headings-line-height, 1.1); 32128 --sc-legend-color: var(--sc-base-content, #000); 32129 display: flex; 32130 width: 100%; 32131 container-type: inline-size; 32132 } 32133 32134 @container (max-inline-size: 28rem) { 32135 legend { 32136 --sc-legend-font-size: 1.3rem; 32137 } 32138 } 32139 legend { 32140 font-size: var(--sc-legend-font-size); 32141 font-weight: var(--sc-legend-font-weight); 32142 font-style: var(--sc-legend-font-style); 32143 font-family: var(--sc-legend-font-family); 32144 line-height: var(--sc-legend-line-height); 32145 color: var(--sc-legend-color); 32146 padding: 0; 32147 display: flex; 32148 width: 100%; 32149 align-items: flex-start; 32150 gap: 0.35em; 32151 } 32152 32153 slot[name="suffix"] { 32154 display: block; 32155 margin-left: auto; 32156 flex-shrink: 0; 32157 } 32158 32159 .legend-content { 32160 flex-grow: 1; 32161 } 32162 ` 32163 ]; 32164 __decorate$c([ 32165 n$5({ type: Boolean }) 32166 ], Legend.prototype, "forceAutoFill", void 0); 32167 __decorate$c([ 32168 n$5() 32169 ], Legend.prototype, "description", null); 32170 __decorate$c([ 32171 n$5() 32172 ], Legend.prototype, "label", null); 32173 __decorate$c([ 32174 n$5({ type: String }) 32175 ], Legend.prototype, "iconName", void 0); 32176 __decorate$c([ 32177 n$5({ type: String }) 32178 ], Legend.prototype, "iconLibrary", void 0); 32179 __decorate$c([ 32180 n$5({ type: String }) 32181 ], Legend.prototype, "iconPrefix", void 0); 32182 Legend = __decorate$c([ 32183 t$3(tagName$1Q) 32184 ], Legend); 32185 var __decorate$b = function(decorators, target, key, desc) { 32186 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 32187 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 32188 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 32189 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 32190 }; 32191 const tagName$1P = "sonic-fieldset"; 32192 let Fieldset = class Fieldset extends Subscriber$1(i$6) { 32193 constructor() { 32194 super(...arguments); 32195 this.disabled = false; 32196 this.variant = "default"; 32197 } 32198 render() { 32199 return b$1`<fieldset 32200 form="${o$4(this.form)}" 32201 ?disabled="${this.disabled}" 32202 > 32203 ${this.label ? b$1` <sonic-legend 32204 label=${o$4(this.label)} 32205 description=${o$4(this.description)} 32206 iconName=${o$4(this.iconName)} 32207 iconPrefix=${o$4(this.iconPrefix)} 32208 iconLibrary=${o$4(this.iconLibrary)} 32209 ></sonic-legend>` : A$1} 32210 <slot></slot> 32211 </fieldset>`; 32212 } 32213 }; 32214 Fieldset.styles = [ 32215 i$9` 32216 :host { 32217 --sc-fieldset-mt: 0; 32218 --sc-fieldset-mb: 1rem; 32219 --sc-fieldset-border-color: var(--sc-border-color); 32220 --sc-fieldset-border-width: var(--sc-form-border-width); 32221 --sc-fieldset-px: 1.25rem; 32222 --sc-fieldset-py: 1.8rem; 32223 32224 margin-top: var(--sc-fieldset-mt); 32225 margin-bottom: var(--sc-fieldset-mb); 32226 display: block; 32227 border: var(--sc-fieldset-border-width) solid 32228 var(--sc-fieldset-border-color) !important; 32229 padding: var(--sc-fieldset-py) var(--sc-fieldset-px); 32230 border-radius: var(--sc-rounded-lg); 32231 } 32232 32233 fieldset { 32234 all: unset; 32235 display: contents; 32236 } 32237 32238 :host([variant="shadow"]), 32239 :host([variant="ghost"]) { 32240 --sc-fieldset-border-color: transparent; 32241 } 32242 :host([variant="shadow"]) { 32243 --sc-fieldset-border-color: transparent; 32244 box-shadow: var(--sc-shadow-lg); 32245 } 32246 32247 :host([tight]) { 32248 --sc-fieldset-px: 0; 32249 border-left: none !important;
32250 border-right: none !important; 32251 border-radius: 0; 32252 } 32253 32254 sonic-legend, 32255 ::slotted(sonic-legend) { 32256 margin-bottom: 1.5rem; 32257 display: block; 32258 } 32259 32260 sonic-legend:last-child, 32261 ::slotted(sonic-legend:last-child) { 32262 margin-bottom: 0; 32263 } 32264 ` 32265 ]; 32266 __decorate$b([ 32267 n$5({ type: Boolean, reflect: true }) 32268 ], Fieldset.prototype, "disabled", void 0); 32269 __decorate$b([ 32270 n$5({ type: String }) 32271 ], Fieldset.prototype, "form", void 0); 32272 __decorate$b([ 32273 n$5({ type: String }) 32274 ], Fieldset.prototype, "label", void 0); 32275 __decorate$b([ 32276 n$5({ type: String }) 32277 ], Fieldset.prototype, "description", void 0); 32278 __decorate$b([ 32279 n$5({ type: String }) 32280 ], Fieldset.prototype, "iconName", void 0); 32281 __decorate$b([ 32282 n$5({ type: String }) 32283 ], Fieldset.prototype, "iconLibrary", void 0); 32284 __decorate$b([ 32285 n$5({ type: String }) 32286 ], Fieldset.prototype, "iconPrefix", void 0); 32287 __decorate$b([ 32288 n$5({ type: Boolean, reflect: true }) 32289 ], Fieldset.prototype, "tight", void 0); 32290 __decorate$b([ 32291 n$5({ type: String, reflect: true }) 32292 ], Fieldset.prototype, "variant", void 0); 32293 Fieldset = __decorate$b([ 32294 t$3(tagName$1P) 32295 ], Fieldset); 32296 var __defProp$2Y = Object.defineProperty; 32297 var __getOwnPropDesc$2$ = Object.getOwnPropertyDescriptor; 32298 var __decorateClass$2$ = (decorators, target, key, kind) => { 32299 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2$(target, key) : target; 32300 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 32301 if (decorator = decorators[i2]) 32302 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 32303 if (kind && result) __defProp$2Y(target, key, result); 32304 return result; 32305 }; 32306 const tagName$1O = "sonic-login-saml"; 32307 let SonicComponent$h = class SonicComponent extends Subscriber$1(i$6) { 32308 constructor() { 32309 super(...arguments); 32310 this.samlAccess = false; 32311 } 32312 render() { 32313 if (!this.samlAccess) return A$1; 32314 return b$1`<sonic-fieldset> 32315 <sonic-legend 32316 iconLibrary="custom" 32317 iconName="star" 32318 label="${t("LIB_connexion_annuaire_SAML")}" 32319 description="${t("LIB_connexion_annuaire_SAML_description")}" 32320 > 32321 </sonic-legend> 32322 <div> 32323 <sonic-button href=${getSamlUrl(this)} minWidth="12rem" type="info" class="w-full"> 32324 <sonic-icon library="custom" name="arrow-up-right"></sonic-icon> 32325 ${t("se_connecter")}</sonic-button 32326 > 32327 </div> 32328 </sonic-fieldset>`; 32329 } 32330 }; 32331 SonicComponent$h.styles = [tailwind]; 32332 __decorateClass$2$([ 32333 bind$1("settings.modules.saml.access"), 32334 n$5({ type: Boolean }) 32335 ], SonicComponent$h.prototype, "samlAccess", 2); 32336 SonicComponent$h = __decorateClass$2$([ 32337 t$3(tagName$1O) 32338 ], SonicComponent$h); 32339 const getSamlUrl = (contextElement) => { 32340 const currentLocationHref = window.location.href; 32341 const storeUrl = HTML.getAncestorAttributeValue(contextElement, "storeUrl") || ""; 32342 return `${storeUrl}/lb-saml?sonic_saml_destination=${currentLocationHref}`; 32343 }; 32344 const primaryIsEqualToBaseContent = (element) => { 32345 const baseContent = getComputedStyle(element).getPropertyValue("--sc-base-content"); 32346 const primary = getComputedStyle(element).getPropertyValue("--sc-primary"); 32347 return baseContent === primary; 32348 }; 32349 var __defProp$2X = Object.defineProperty; 32350 var __getOwnPropDesc$2_ = Object.getOwnPropertyDescriptor; 32351 var __decorateClass$2_ = (decorators, target, key, kind) => { 32352 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2_(target, key) : target; 32353 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 32354 if (decorator = decorators[i2]) 32355 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 32356 if (kind && result) __defProp$2X(target, key, result); 32357 return result; 32358 }; 32359 let instanceCounter$d = 0; 32360 let subscriptionButtonType$1; 32361 let PriceButton = class extends EventContext(Subscriber$1(i$6)) { 32362 constructor() { 32363 super(...arguments); 32364 this.quantityFormDataProvider = "PriceButtonQuantity/" + instanceCounter$d++; 32365 this.disabled = false;
32366 this.saml_auth_required = false; 32367 this.amount = 0; 32368 this.amount_display = 0; 32369 this.counter = false; 32370 this.price_online = false; 32371 this.item_id = 0; 32372 this.title = ""; 32373 this.need_subscription = false; 32374 this.need_partner_subscription = false; 32375 this.additional_products = []; 32376 this.buttonType = "neutral"; 32377 this.type = null; 32378 this.noPriceName = false; 32379 this.price_available = true; 32380 this.is_triggering_promo = true; 32381 this.price_is_promo = true; 32382 this.help_text = ""; 32383 this.size = "lg"; 32384 this.loading = false; 32385 this.settings = {}; 32386 this.price_min_places = 1; 32387 this.is_free_price = false; 32388 this.free_price = {}; 32389 this.displayQuantitySelector = false; 32390 this.disableButtonMultiSelect = false; 32391 this.seatsContext = []; 32392 this.buyMode = BuyMode.DEFAULT; 32393 this.longClickTimer = null; 32394 this.longClickTriggered = false; 32395 this.LONG_CLICK_DURATION = 300; 32396 this.pressProgress = 0; 32397 this.pressAnimationFrame = null; 32398 this.pressStartTime = null; 32399 this.seatmapProvider = "seatmap"; 32400 this.handlePointerDown = (_e) => { 32401 if (this.loading) return; 32402 if (this.saml_auth_required) { 32403 this.goToSaml(); 32404 return; 32405 } 32406 if (this.disableButtonMultiSelect) { 32407 return; 32408 } 32409 this.longClickTriggered = false; 32410 this.pressProgress = 0; 32411 this.pressStartTime = performance.now(); 32412 const animate = (now) => { 32413 if (this.pressStartTime === null) return; 32414 const elapsed = now - this.pressStartTime; 32415 this.pressProgress = Math.min(elapsed / this.LONG_CLICK_DURATION, 1); 32416 this.requestUpdate(); 32417 if (this.pressProgress < 1) { 32418 this.pressAnimationFrame = requestAnimationFrame(animate); 32419 } 32420 }; 32421 this.pressAnimationFrame = requestAnimationFrame(animate); 32422 this.longClickTimer = window.setTimeout(() => { 32423 this.longClickTriggered = true; 32424 this.selectQuantity(); 32425 this.resetPressProgress(); 32426 }, this.LONG_CLICK_DURATION); 32427 }; 32428 this.handlePointerUp = (e2) => { 32429 e2.stopPropagation(); 32430 e2.preventDefault(); 32431 if (this.disableButtonMultiSelect) { 32432 this.addToCart(); 32433 return; 32434 } 32435 if (this.longClickTimer) { 32436 clearTimeout(this.longClickTimer); 32437 this.longClickTimer = null; 32438 if (!this.longClickTriggered) { 32439 this.addToCart(); 32440 } 32441 } 32442 this.resetPressProgress(); 32443 }; 32444 this.handlePointerLeave = (e2) => { 32445 e2.stopPropagation(); 32446 e2.preventDefault(); 32447 if (this.longClickTimer) { 32448 clearTimeout(this.longClickTimer); 32449 this.longClickTimer = null; 32450 } 32451 this.resetPressProgress(); 32452 }; 32453 this.onFilterMutation = () => { 32454 this.requestUpdate(); 32455 this.updateDisabledState(); 32456 }; 32457 this.isDisabled = false; 32458 } 32459 resetPressProgress() { 32460 this.pressProgress = 0; 32461 this.pressStartTime = null; 32462 if (this.pressAnimationFrame) { 32463 cancelAnimationFrame(this.pressAnimationFrame); 32464 this.pressAnimationFrame = null; 32465 } 32466 this.requestUpdate(); 32467 } 32468 selectQuantity() { 32469 dp(this.quantityFormDataProvider).quantity.set(this.price_min_places || 1); 32470 this.popElement.show(); 32471 this.displayQuantitySelector = true; 32472 } 32473 async addToCart(quantity) { 32474 this.loading = true; 32475 const filter = PublisherManager.get("product/" + this.item_id + "/PricesFilter").get(); 32476 let currentQuota = filter.selectedQuota; 32477 if (!currentQuota && filter.quotas) { 32478 currentQuota = filter.quotas[0]; 32479 } 32480 const seats = this.seatsContext ? this.seatsContext.map((seat) => seat.name) : []; 32481 let quota; 32482 if (currentQuota) { 32483 quota = { 32484 id: parseInt(currentQuota.id) 32485 }; 32486 } 32487 const cartItem = { 32488 entity_type: this.type || void 0, 32489 entity_id: this.item_id, 32490 quantity: quantity || seats.length || 1,
32491 price: { id: parseInt(this.id), ...this.is_free_price && { is_free_price: true, amount: this.amount } }, 32492 places_ids: seats, 32493 parent_id: this.priceContext?.parentSubscription?.id, 32494 quota 32495 }; 32496 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 32497 await Cart.addItems({ 32498 apiConfiguration: this.getApiConfiguration(), 32499 cartProvider, 32500 items: [cartItem], 32501 attachOwnersAfterRequest: true, 32502 editFreePriceAfterRequest: true, 32503 accessParams: this.accessParams 32504 }).then(() => { 32505 if (seats.length > 0) { 32506 updateSeatmapStatus(this.seatmapProvider); 32507 this.closeParentModal(); 32508 } 32509 }); 32510 this.loading = false; 32511 } 32512 closeParentModal() { 32513 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 32514 parentModal?.hide(); 32515 } 32516 goToSaml() { 32517 const samlUrl = getSamlUrl(this); 32518 if (samlUrl) document.location = samlUrl; 32519 } 32520 updateDisabledState() { 32521 const selectedQuota = this.filterPublisher?.get()?.selectedQuota; 32522 const isDisabled = !this.price_available || selectedQuota && selectedQuota.remaining_places_nb === 0; 32523 this.isDisabled = isSeatMode(this.buyMode) && this.appType === "counter" ? false : isDisabled; 32524 this.requestUpdate(); 32525 } 32526 willUpdate(properties) { 32527 if (properties.has("item_id")) { 32528 this.filterPublisher?.offInternalMutation(this.onFilterMutation); 32529 this.filterPublisher = PublisherManager.get("product/" + this.item_id + "/PricesFilter"); 32530 this.filterPublisher?.onInternalMutation(this.onFilterMutation); 32531 } 32532 if (properties.has("price_available") || properties.has("item_id") || properties.has("disabled")) { 32533 this.updateDisabledState(); 32534 } 32535 super.willUpdate(properties); 32536 } 32537 disconnectedCallback() { 32538 this.filterPublisher?.offInternalMutation(this.onFilterMutation); 32539 super.disconnectedCallback(); 32540 } 32541 preventContextMenu(e2) { 32542 e2.preventDefault(); 32543 } 32544 addSpecificQuantity() { 32545 const quantity = dp(this.quantityFormDataProvider).quantity.get(); 32546 this.addToCart(Number(quantity)); 32547 dp(this.quantityFormDataProvider).quantity.set(this.price_min_places || 1); 32548 this.popElement.hide(); 32549 } 32550 connectedCallback() { 32551 super.connectedCallback(); 32552 if (!subscriptionButtonType$1) { 32553 const hostElement = this.shadowRoot?.host; 32554 subscriptionButtonType$1 = primaryIsEqualToBaseContent(hostElement) ? "info" : "primary"; 32555 } 32556 this._subTypeButton = subscriptionButtonType$1; 32557 } 32558 render() { 32559 if (!this.props) return; 32560 if (!this.counter && this.isGuichet) { 32561 return; 32562 } 32563 const defaultType = this.buttonType || "neutral"; 32564 const hasInfo = this.help_text !== ""; 32565 const subType = this._subTypeButton ?? "primary"; 32566 let type = this.need_subscription || this.need_partner_subscription ? subType : defaultType; 32567 if (this.is_triggering_promo || this.price_is_promo) { 32568 type = "success"; 32569 } 32570 let pressClass; 32571 if (this.pressProgress > 0 && this.pressProgress < 1) { 32572 pressClass = "scale-[.97]"; 32573 } else if (this.pressProgress === 1) { 32574 pressClass = "scale-[.90]"; 32575 } 32576 return b$1` 32577 <sonic-pop 32578 @hide=${() => this.displayQuantitySelector = false} 32579 class="flex relative w-full h-full" 32580 placement="top" 32581 manual 32582 > 32583 <sonic-button 32584 type="${type}" 32585 rounded="sm" 32586 size="${this.size}" 32587 align="left" 32588 alignItems="stretch" 32589 @mousedown="${this.handlePointerDown}" 32590 @mouseup="${this.handlePointerUp}" 32591 @mouseleave="${this.handlePointerLeave}" 32592 @touchstart="${this.handlePointerDown}" 32593 @touchend="${this.handlePointerUp}" 32594 @touchcancel="${this.handlePointerLeave}" 32595 @contextmenu="${this.preventContextMenu}" 32596 @keydown=${(e2) => { 32597 if (e2.key === "Enter" || e2.key === " ") { 32598 e2.preventDefault(); 32599 this.addToCart(1); 32600 } 32601 }} 32602 ?disabled=${this.loading || this.isDisabled} 32603 class="group ${pressClass} transition-all duration-200 " 32604 > 32605 ${this.pressProgress > 0 ? b$1`<div
32606 style="transform:scaleX(${this.pressProgress})" 32607 class="absolute left-1 bottom-1 right-1 h-[2px] rounded bg-neutral-0 wz-2" 32608 ></div>` : A$1} 32609 <div class="h-full flex flex-col"> 32610 ${!this.noPriceName ? b$1`<span class="name ${hasInfo ? "pr-3" : ""}"> ${this.title} </span> ${this.additional_products.length > 0 ? b$1`<div class="text-[.85em] flex gap-[.25em] opacity-60 "> 32611 ${this.additional_products.map( 32612 (product) => b$1`<span class="inline-block"> + ${product.name} </span> ` 32613 )} 32614 </div>` : A$1}` : A$1} 32615 32616 <span 32617 class="${!this.noPriceName ? "pt-2" : ""} mt-auto leading-none font-bold flex gap-[.4em] items-center " 32618 > 32619 <sonic-if 32620 .condition=${(this.need_partner_subscription || this.need_subscription) && !(this.is_triggering_promo || this.price_is_promo)} 32621 > 32622 <sonic-icon 32623 library="custom" 32624 prefix="solid" 32625 name="id-card" 32626 size="xl" 32627 class="mr-[.25em] inline-block transition group-hover:scale-110 group-focus-within:scale-110" 32628 ></sonic-icon> 32629 </sonic-if> 32630 <sonic-if .condition=${this.is_free_price}> 32631 <sonic-icon 32632 size="lg" 32633 library="custom" 32634 name="hand-holding-heart" 32635 class="transition group-hover:scale-110 group-focus-within:scale-110" 32636 ></sonic-icon> 32637 </sonic-if> 32638 <sonic-if .condition=${this.is_triggering_promo}> 32639 <sonic-icon 32640 size="sm" 32641 library="custom" 32642 name="stars" 32643 class="mr-[.25em] animate-heartbeat inline-block" 32644 ></sonic-icon> 32645 </sonic-if> 32646 32647 <sonic-if .condition=${this.price_is_promo}> 32648 <sonic-icon 32649 size="sm" 32650 library="custom" 32651 name="gift" 32652 class="mr-[.25em] animate-heartbeat inline-block" 32653 ></sonic-icon> 32654 </sonic-if> 32655 32656 <sonic-if .condition=${this.saml_auth_required}> 32657 <sonic-icon size="sm" library="custom" prefix="solid" name="user" class="mr-[.25em]"></sonic-icon> 32658 </sonic-if> 32659 32660 <sonic-if 32661 .condition=${!this.saml_auth_required && !this.price_is_promo && !this.is_triggering_promo && !this.need_partner_subscription && !this.need_subscription && !this.is_free_price} 32662 } 32663 > 32664 <sonic-icon 32665 size="lg" 32666 library="custom" 32667 name="circle-plus" 32668 prefix="light" 32669 class="mr-[.25em] opacity-50 group-hover:opacity-100 group-hover:scale-110 group-focus-within:opacity-100 group-focus-within:scale-110 transition-all transition-200 " 32670 ></sonic-icon> 32671 </sonic-if> 32672 <span class="leading-none inline-block"> 32673 ${this.is_free_price ? priceRange({ 32674 min: this.free_price.min || 0, 32675 max: this.free_price.max, 32676 is_free_price: this.is_free_price 32677 }) : formatAmount(this.amount_display)} 32678 </span> 32679 </span> 32680 <sonic-if .condition=${hasInfo}> 32681 <sonic-pop 32682 @mousedown=${(e2) => e2.stopPropagation()} 32683 @touchstart=${(e2) => e2.stopPropagation()} 32684 @click=${(e2) => e2.stopPropagation()} 32685 @touchend=${(e2) => e2.stopPropagation()} 32686 @touchcancel=${(e2) => e2.stopPropagation()} 32687 @mouseup=${(e2) => e2.stopPropagation()} 32688 @mouseleave=${(e2) => e2.stopPropagation()} 32689 placement="top" 32690 > 32691 <div class="p-1 transform translate-z-0 cursor-pointer hover:scale-110"> 32692 <sonic-icon library="custom" name="circle-info" prefix="solid" size="md"></sonic-icon> 32693 </div> 32694 <div 32695 slot="content" 32696 class="p-3 px-2 shadow-md text-xs text-content min-w-[25ch] max-w-[40ch] rounded-md" 32697 placement="top" 32698 > 32699 ${o$6(this.help_text)} 32700 </div> 32701 </sonic-pop> 32702 </sonic-if> 32703 </div> 32704 </sonic-button> 32705 32706 <div 32707 slot="content" 32708 formDataProvider="${this.quantityFormDataProvider}" 32709 dataProvider="${this.quantityFormDataProvider}" 32710 class="p-3 w-32 " 32711 > 32712 <div class="not-sr-only text-base mb-1">${t("quantity")}</div> 32713 <div class="flex gap-1 items-end"> 32714 <sonic-input 32715 @keydown=${(e2) => {
32716 if (e2.key === "Enter") { 32717 e2.preventDefault(); 32718 this.addSpecificQuantity(); 32719 } 32720 if (e2.key === "Escape") { 32721 this.popElement.hide(); 32722 } 32723 }} 32724 name="quantity" 32725 data-aria-label="${t("quantity")}" 32726 type="number" 32727 value="${this.price_min_places || 1}" 32728 min="1" 32729 ></sonic-input> 32730 <sonic-button type="primary" shape="circle" icon @click=${this.addSpecificQuantity} class="shrink-0" 32731 ><sonic-icon library="custom" name="basket-shopping" prefix="light"></sonic-icon 32732 ></sonic-button> 32733 </div> 32734 </div> 32735 </sonic-pop> 32736 `; 32737 } 32738 }; 32739 PriceButton.styles = [tailwind, styles]; 32740 __decorateClass$2_([ 32741 n$5({ type: Boolean, reflect: true }) 32742 ], PriceButton.prototype, "disabled", 2); 32743 __decorateClass$2_([ 32744 n$5({ type: Boolean }) 32745 ], PriceButton.prototype, "saml_auth_required", 2); 32746 __decorateClass$2_([ 32747 n$5({ type: Number }) 32748 ], PriceButton.prototype, "amount", 2); 32749 __decorateClass$2_([ 32750 n$5({ type: Number }) 32751 ], PriceButton.prototype, "amount_display", 2); 32752 __decorateClass$2_([ 32753 n$5({ type: Boolean }) 32754 ], PriceButton.prototype, "counter", 2); 32755 __decorateClass$2_([ 32756 n$5({ type: Boolean }) 32757 ], PriceButton.prototype, "price_online", 2); 32758 __decorateClass$2_([ 32759 n$5({ type: Number }) 32760 ], PriceButton.prototype, "item_id", 2); 32761 __decorateClass$2_([ 32762 n$5({ type: String }) 32763 ], PriceButton.prototype, "title", 2); 32764 __decorateClass$2_([ 32765 n$5({ type: Boolean }) 32766 ], PriceButton.prototype, "need_subscription", 2); 32767 __decorateClass$2_([ 32768 n$5({ type: Boolean }) 32769 ], PriceButton.prototype, "need_partner_subscription", 2); 32770 __decorateClass$2_([ 32771 n$5({ type: Array }) 32772 ], PriceButton.prototype, "additional_products", 2); 32773 __decorateClass$2_([ 32774 n$5({ type: String }) 32775 ], PriceButton.prototype, "buttonType", 2); 32776 __decorateClass$2_([ 32777 n$5({ type: String }) 32778 ], PriceButton.prototype, "type", 2); 32779 __decorateClass$2_([ 32780 n$5({ type: Boolean }) 32781 ], PriceButton.prototype, "noPriceName", 2); 32782 __decorateClass$2_([ 32783 n$5({ type: Boolean }) 32784 ], PriceButton.prototype, "price_available", 2); 32785 __decorateClass$2_([ 32786 n$5({ type: Boolean }) 32787 ], PriceButton.prototype, "is_triggering_promo", 2); 32788 __decorateClass$2_([ 32789 n$5({ type: Boolean }) 32790 ], PriceButton.prototype, "price_is_promo", 2); 32791 __decorateClass$2_([ 32792 n$5({ type: String }) 32793 ], PriceButton.prototype, "help_text", 2); 32794 __decorateClass$2_([ 32795 n$5({ type: String }) 32796 ], PriceButton.prototype, "size", 2); 32797 __decorateClass$2_([ 32798 n$5({ type: Boolean }) 32799 ], PriceButton.prototype, "loading", 2); 32800 __decorateClass$2_([ 32801 n$5({ type: Object }) 32802 ], PriceButton.prototype, "settings", 2); 32803 __decorateClass$2_([ 32804 n$5({ type: Number }) 32805 ], PriceButton.prototype, "price_min_places", 2); 32806 __decorateClass$2_([ 32807 n$5({ type: Boolean }) 32808 ], PriceButton.prototype, "is_free_price", 2); 32809 __decorateClass$2_([ 32810 n$5({ type: Object }) 32811 ], PriceButton.prototype, "free_price", 2); 32812 __decorateClass$2_([ 32813 e$7("sonic-pop") 32814 ], PriceButton.prototype, "popElement", 2); 32815 __decorateClass$2_([ 32816 r$5() 32817 ], PriceButton.prototype, "displayQuantitySelector", 2); 32818 __decorateClass$2_([ 32819 c({ context: disableButtonMultiSelectContext, subscribe: true }), 32820 n$5({ type: Boolean }) 32821 ], PriceButton.prototype, "disableButtonMultiSelect", 2); 32822 __decorateClass$2_([ 32823 c({ context: seatsContext, subscribe: true }), 32824 n$5({ type: Array }) 32825 ], PriceButton.prototype, "seatsContext", 2); 32826 __decorateClass$2_([ 32827 c({ context: accessParamsContext, subscribe: true }), 32828 n$5({ type: Object }) 32829 ], PriceButton.prototype, "accessParams", 2); 32830 __decorateClass$2_([ 32831 c({ context: buyContext, subscribe: true }), 32832 n$5({ type: Object }) 32833 ], PriceButton.prototype, "priceContext", 2); 32834 __decorateClass$2_([ 32835 c({ context: buyModeContext, subscribe: true }), 32836 n$5({ type: String }) 32837 ], PriceButton.prototype, "buyMode", 2); 32838 __decorateClass$2_([ 32839 r$5() 32840 ], PriceButton.prototype, "longClickTimer", 2); 32841 __decorateClass$2_([ 32842 n$5({ type: Number }) 32843 ], PriceButton.prototype, "pressProgress", 2); 32844 __decorateClass$2_([ 32845 ancestorAttribute("seatmapProvider") 32846 ], PriceButton.prototype, "seatmapProvider", 2); 32847 __decorateClass$2_([ 32848 c({ context: appType, subscribe: true }), 32849 n$5({ type: String }) 32850 ], PriceButton.prototype, "appType", 2); 32851 __decorateClass$2_([ 32852 r$5() 32853 ], PriceButton.prototype, "isDisabled", 2); 32854 __decorateClass$2_([ 32855 r$5() 32856 ], PriceButton.prototype, "_subTypeButton", 2); 32857 PriceButton = __decorateClass$2_([ 32858 t$3("sonic-price-button") 32859 ], PriceButton); 32860 var __defProp$2W = Object.defineProperty; 32861 var __getOwnPropDesc$2Z = Object.getOwnPropertyDescriptor; 32862 var __decorateClass$2Z = (decorators, target, key, kind) => { 32863 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2Z(target, key) : target; 32864 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 32865 if (decorator = decorators[i2]) 32866 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 32867 if (kind && result) __defProp$2W(target, key, result); 32868 return result; 32869 }; 32870 let subscriptionButtonType;
32871 let PriceSelect = class extends EventContext(Subscriber$1(i$6)) { 32872 constructor() { 32873 super(...arguments); 32874 this.disabled = false; 32875 this.saml_auth_required = false; 32876 this.amount = 0; 32877 this.amount_display = 0; 32878 this.item_id = ""; 32879 this.need_subscription = false; 32880 this.need_partner_subscription = false; 32881 this.additional_products = []; 32882 this.id = ""; 32883 this.type = ""; 32884 this.noPriceName = false; 32885 this.price_available = false; 32886 this.is_triggering_promo = false; 32887 this.price_is_promo = false; 32888 this.help_text = ""; 32889 this.price_min_places = 0; 32890 this.price_max_places = 0; 32891 this.price_places_nb = 0; 32892 this.price_max = 10; 32893 this.is_free_price = false; 32894 this.free_price = {}; 32895 this.size = "lg"; 32896 this.wording_LIB_connexion_required = ""; 32897 this.onFilterMutation = () => { 32898 this.updateDisabledState(); 32899 this.requestUpdate(); 32900 }; 32901 this.isSoldOut = false; 32902 } 32903 updateDisabledState() { 32904 const selectedQuota = this.filterPublisher?.get()?.selectedQuota; 32905 this.isSoldOut = !this.price_available || selectedQuota && selectedQuota.remaining_places_nb === 0; 32906 this.requestUpdate(); 32907 } 32908 connectedCallback() { 32909 super.connectedCallback(); 32910 if (!subscriptionButtonType) { 32911 const hostElement = this.shadowRoot?.host; 32912 subscriptionButtonType = primaryIsEqualToBaseContent(hostElement) ? "info" : "primary"; 32913 } 32914 this._subTypeButton = subscriptionButtonType; 32915 } 32916 willUpdate(properties) { 32917 if (properties.has("item_id")) { 32918 this.filterPublisher?.offInternalMutation(this.onFilterMutation); 32919 this.filterPublisher = PublisherManager.get("product/" + this.item_id + "/PricesFilter"); 32920 this.filterPublisher?.onInternalMutation(this.onFilterMutation); 32921 this.requestUpdate(); 32922 } 32923 if (properties.has("price_min_places") && this.price_min_places > this.price_max) { 32924 this.price_max = this.price_min_places + 10; 32925 } 32926 if ((properties.has("price_max_places") || properties.has("price_places_nb")) && (this.price_max_places || this.price_places_nb)) { 32927 if (this.price_max_places && this.price_places_nb) { 32928 this.price_max = Math.min(this.price_max_places, this.price_places_nb, this.price_max); 32929 } else { 32930 this.price_max = this.price_max_places || this.price_places_nb; 32931 } 32932 } 32933 if (properties.has("price_available") || properties.has("item_id")) { 32934 this.updateDisabledState(); 32935 } 32936 super.willUpdate(properties); 32937 } 32938 getOptions() { 32939 const optionsValues = [{ value: "", wording: 0 }]; 32940 const max = this.price_max > 50 ? 50 : this.price_max; 32941 for (let i2 = this.price_min_places; i2 <= max; i2++) { 32942 optionsValues.push({ value: i2.toString(), wording: i2 }); 32943 } 32944 return optionsValues; 32945 } 32946 firstUpdated() { 32947 if (!subscriptionButtonType) { 32948 const hostElement = this.shadowRoot?.host; 32949 subscriptionButtonType = primaryIsEqualToBaseContent(hostElement) ? "info" : "primary"; 32950 } 32951 } 32952 render() { 32953 if (!this.props) return; 32954 let ariaLabel = this.title + "Choisissez le nombre de places"; 32955 if (this.isSoldOut) { 32956 ariaLabel = this.title + " â épuisé"; 32957 } 32958 const isSubscription = this.need_partner_subscription || this.need_subscription; 32959 const amountMarkup = b$1` ${isSubscription ? b$1`<sonic-icon library="custom" prefix="regular" name="id-card" class="mr-[.25em] inline-block"></sonic-icon>` : A$1} 32960 ${this.is_triggering_promo ? b$1`<sonic-icon 32961 size="sm" 32962 library="custom" 32963 prefix="solid" 32964 name="${isSubscription ? "star" : "stars"}" 32965 class="mr-[.25em] animate-heartbeat inline-block ${isSubscription ? " -ml-[.4em] text-[.75em] relative -top-[.1em]" : ""}" 32966 ></sonic-icon>` : A$1} 32967 ${this.price_is_promo ? b$1`<sonic-icon 32968 size="sm" 32969 library="custom" 32970 prefix="solid" 32971 name="gift" 32972 class="mr-[.25em] animate-heartbeat inline-block ${isSubscription ? " -ml-[.4em] text-[.75em] relative -top-[.1em]" : ""}" 32973 ></sonic-icon>` : A$1} 32974 ${this.is_free_price ? b$1`<sonic-icon library="custom" name="hand-holding-heart" size="lg"></sonic-icon>
32974` : b$1`${formatAmount(this.amount_display)}`}`; 32975 const subType = this._subTypeButton ?? "primary"; 32976 let status = this.need_subscription || this.need_partner_subscription ? subType : "default"; 32977 if (this.is_triggering_promo || this.price_is_promo) { 32978 status = "success"; 32979 } 32980 return b$1` 32981 <sonic-group size="${this.size}" class="w-full"> 32982 <div slot="label" class="text-left"> 32983 <sonic-if .condition=${!this.noPriceName}> 32984 <div class="flex items-end gap-[.25em] w-full"> 32985 <div class="min-w-0"> 32986 <div 32987 class="leading-[1.1] lg:leading-[1.1] min-w-0 break-words ${this.price_is_promo ? "font-bold" : ""}" 32988 > 32989 ${this.title} 32990 </div> 32991 ${this.additional_products.length > 0 ? b$1`<div class="text-[.85em] leading-[1.1] flex gap-[.25em] flex-wrap "> 32992 ${this.additional_products.map( 32993 (product) => b$1`<span class="inline-block">+ ${product.name} </span> ` 32994 )} 32995 </div>` : A$1} 32996 ${this.is_free_price && (this.free_price?.min || this.free_price?.max) ? b$1`<div class="text-[.85em] leading-[1.1] flex gap-[.25em] flex-wrap mt-[1px]"> 32997 ⢠32998 ${priceRange({ 32999 min: this.free_price?.min || 0, 33000 max: this.free_price?.max, 33001 is_free_price: this.is_free_price 33002 })} 33003 </div>` : A$1} 33004 </div> 33005 ${this.help_text ? b$1`<div class="ml-auto"> 33006 <sonic-if .condition=${this.help_text !== ""}> 33007 <sonic-pop @click=${(e2) => e2.stopPropagation()} placement="top" class="inline-flex"> 33008 <div class=" cursor-pointer inline-flex"> 33009 <sonic-icon library="custom" name="circle-info" size="md"></sonic-icon> 33010 </div> 33011 <div 33012 slot="content" 33013 class="p-3 px-2 text-xs text-content min-w-[30ch] max-w-[40ch] rounded-md" 33014 placement="top" 33015 > 33016 ${o$6(this.help_text)} 33017 </div> 33018 </sonic-pop> 33019 </sonic-if> 33020 </div> ` : A$1} 33021 </div> 33022 </sonic-if> 33023 </div> 33024 33025 ${this.saml_auth_required ? b$1` 33026 <sonic-button href=${getSamlUrl(this)} size="${this.size}" variant="default" type="primary" noAutoFill> 33027 <div class="flex items-center justify-center gap-[.75em] w-full"> 33028 <div class="flex">${amountMarkup}</div> 33029 <div class="border-l h-[1em]"></div> 33030 <sonic-tooltip label="${this.wording_LIB_connexion_required}"> 33031 <div class="flex items-end"> 33032 <sonic-icon library="custom" name="user"></sonic-icon> 33033 <sonic-icon library="custom" name="arrow-right" class="-ml-[.5em]" size="xs"></sonic-icon> 33034 </div> 33035 </sonic-tooltip> 33036 </div> 33037 </sonic-button> 33038 ` : b$1` 33039 ${!this.isSoldOut ? b$1`<sonic-select 33040 rounded="sm" 33041 size="${this.size}" 33042 ?disabled=${this.disabled} 33043 data-aria-label=${o$4(ariaLabel)} 33044 align="center" 33045 name="${this.id}" 33046 status=${status} 33047 > 33048 <span class="min-w-[min(7.8ch,_4.5em)] text-center font-bold" slot="prefix" status="success"> 33049 ${amountMarkup} 33050 </span> 33051 ${this.disabled ? b$1`<option selected>â</option>` : c$1( 33052 this.getOptions(), 33053 (option) => b$1`<option value="${option.value}">${option.wording}</option>` 33054 )} 33055 </sonic-select>` : b$1`<sonic-tooltip 33056 focusable 33057 placement="bottom" 33058 label="${t("initial_amount")}
33059 ${formatAmount(this.amount_display)}" 33060 class="block w-full font-bold" 33061 > 33062 <sonic-input 33063 align="center" 33064 shape="block" 33065 size="${this.size}" 33066 value="${t("sold_out")}" 33067 class="pointer-events-none" 33068 readonly 33069 tabindex="-1" 33070 ></sonic-input 33071 ></sonic-tooltip>`} 33072 `} 33073 </sonic-group> 33074 `; 33075 } 33076 }; 33077 PriceSelect.styles = [tailwind]; 33078 __decorateClass$2Z([ 33079 n$5({ type: Boolean, reflect: true }) 33080 ], PriceSelect.prototype, "disabled", 2); 33081 __decorateClass$2Z([ 33082 n$5({ type: Boolean }) 33083 ], PriceSelect.prototype, "saml_auth_required", 2); 33084 __decorateClass$2Z([ 33085 n$5({ type: Number }) 33086 ], PriceSelect.prototype, "amount", 2); 33087 __decorateClass$2Z([ 33088 n$5({ type: Number }) 33089 ], PriceSelect.prototype, "amount_display", 2); 33090 __decorateClass$2Z([ 33091 n$5({ type: Number }) 33092 ], PriceSelect.prototype, "item_id", 2); 33093 __decorateClass$2Z([ 33094 n$5({ type: Boolean }) 33095 ], PriceSelect.prototype, "need_subscription", 2); 33096 __decorateClass$2Z([ 33097 n$5({ type: Boolean }) 33098 ], PriceSelect.prototype, "need_partner_subscription", 2); 33099 __decorateClass$2Z([ 33100 n$5({ type: Array }) 33101 ], PriceSelect.prototype, "additional_products", 2); 33102 __decorateClass$2Z([ 33103 n$5({ type: String }) 33104 ], PriceSelect.prototype, "id", 2); 33105 __decorateClass$2Z([ 33106 n$5({ type: String }) 33107 ], PriceSelect.prototype, "type", 2); 33108 __decorateClass$2Z([ 33109 n$5({ type: Boolean }) 33110 ], PriceSelect.prototype, "noPriceName", 2); 33111 __decorateClass$2Z([ 33112 n$5({ type: Boolean }) 33113 ], PriceSelect.prototype, "price_available", 2); 33114 __decorateClass$2Z([ 33115 n$5({ type: Boolean }) 33116 ], PriceSelect.prototype, "is_triggering_promo", 2); 33117 __decorateClass$2Z([ 33118 n$5({ type: Boolean }) 33119 ], PriceSelect.prototype, "price_is_promo", 2); 33120 __decorateClass$2Z([ 33121 n$5({ type: String }) 33122 ], PriceSelect.prototype, "help_text", 2); 33123 __decorateClass$2Z([ 33124 n$5({ type: Number }) 33125 ], PriceSelect.prototype, "price_min_places", 2); 33126 __decorateClass$2Z([ 33127 n$5({ type: Number }) 33128 ], PriceSelect.prototype, "price_max_places", 2); 33129 __decorateClass$2Z([ 33130 n$5({ type: Number }) 33131 ], PriceSelect.prototype, "price_places_nb", 2); 33132 __decorateClass$2Z([ 33133 n$5({ type: Number }) 33134 ], PriceSelect.prototype, "price_max", 2); 33135 __decorateClass$2Z([ 33136 n$5({ type: Boolean }) 33137 ], PriceSelect.prototype, "is_free_price", 2); 33138 __decorateClass$2Z([ 33139 n$5({ type: Object }) 33140 ], PriceSelect.prototype, "free_price", 2); 33141 __decorateClass$2Z([ 33142 n$5({ type: String }) 33143 ], PriceSelect.prototype, "size", 2); 33144 __decorateClass$2Z([ 33145 n$5({ type: String }) 33146 ], PriceSelect.prototype, "wording_LIB_connexion_required", 2); 33147 __decorateClass$2Z([ 33148 r$5() 33149 ], PriceSelect.prototype, "isSoldOut", 2); 33150 __decorateClass$2Z([ 33151 r$5() 33152 ], PriceSelect.prototype, "_subTypeButton", 2); 33153 PriceSelect = __decorateClass$2Z([ 33154 t$3("sonic-price-select") 33155 ], PriceSelect); 33156 const i = e$5(class extends i$4 { 33157 constructor() { 33158 super(...arguments), this.key = A$1; 33159 } 33160 render(r2, t2) { 33161 return this.key = r2, t2; 33162 } 33163 update(r2, [t2, e2]) { 33164 return t2 !== this.key && (p(r2), this.key = t2), e2; 33165 } 33166 }); 33167 function computeFilteredPrices(prices, filter) { 33168 if (!prices?.length) return []; 33169 let result = prices.slice(); 33170 if (!filter) return result; 33171 let filterPrices = filter.showAll !== true; 33172 const selectedQuota = filter.selectedQuota; 33173 if (!selectedQuota || !selectedQuota.id) filterPrices = false; 33174 if (!filterPrices) return result; 33175 const quotaPrices = selectedQuota?.prices?.filter((price) => price.visible) || []; 33176 return result.filter((price) => { 33177 const id = price.id; 33178 if (!quotaPrices) return true; 33179 return quotaPrices.some((quotaPrice) => quotaPrice.price_id == id); 33180 }); 33181 } 33182 var __defProp$2V = Object.defineProperty; 33183 var __getOwnPropDesc$2Y = Object.getOwnPropertyDescriptor; 33184 var __decorateClass$2Y = (decorators, target, key, kind) => { 33185 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2Y(target, key) : target; 33186 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33187 if (decorator = decorators[i2]) 33188 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33189 if (kind && result) __defProp$2V(target, key, result); 33190 return result; 33191 };
33192 let PricesForm = class extends EventContext(Subscriber$1(i$6)) { 33193 constructor() { 33194 super(...arguments); 33195 this.buttonType = ""; 33196 this.formType = "select"; 33197 this.type = EntityType.Event; 33198 this.item_id = ""; 33199 this.prices = []; 33200 this.noPriceName = false; 33201 this.loading = false; 33202 this.size = "lg"; 33203 this.onFilterMutation = () => { 33204 this.requestUpdate(); 33205 }; 33206 this.filteredPrices = []; 33207 } 33208 willUpdate(properties) { 33209 if (properties.has("item_id")) { 33210 this.filterPublisher?.offInternalMutation(this.onFilterMutation); 33211 this.filterPublisher = PublisherManager.get("product/" + this.item_id + "/PricesFilter"); 33212 this.filterPublisher?.onInternalMutation(this.onFilterMutation); 33213 } 33214 this.filteredPrices = this.filterPublisher ? computeFilteredPrices(this.prices, this.filterPublisher.get()) : []; 33215 super.willUpdate(properties); 33216 } 33217 disconnectedCallback() { 33218 this.filterPublisher?.offInternalMutation(this.onFilterMutation); 33219 super.disconnectedCallback(); 33220 } 33221 showAll() { 33222 if (!this.filterPublisher) return; 33223 this.filterPublisher.showAll = true; 33224 this.requestUpdate(); 33225 } 33226 getPriceItem(price) { 33227 switch (this.formType) { 33228 case "buttons": 33229 return i( 33230 price.id, 33231 b$1` 33232 <sonic-price-button 33233 type=${this.type} 33234 size=${this.size} 33235 buttonType=${this.buttonType} 33236 dataProvider=${this.dataProvider + "/price/" + price.id} 33237 .props=${price} 33238 item_id="${this.item_id}" 33239 ?noPriceName=${this.noPriceName} 33240 ></sonic-price-button> 33241 ` 33242 ); 33243 case "select": 33244 return i( 33245 price.id, 33246 b$1` 33247 <sonic-price-select 33248 type=${this.type} 33249 buttonType=${this.buttonType} 33250 dataProvider=${this.dataProvider + "/price/" + price.id} 33251 .props=${price} 33252 class=${price.price_is_promo ? "order-first" : ""} 33253 size=${this.size} 33254 item_id="${this.item_id}" 33255 ?noPriceName=${this.noPriceName} 33256 ></sonic-price-select> 33257 ` 33258 ); 33259 } 33260 } 33261 // RENDER 33262 render() { 33263 if (this.prices?.length === 0) return A$1; 33264 const prices = this.filteredPrices; 33265 const showShowAllButton = this.isGuichet && this.prices?.length != prices?.length; 33266 return b$1` 33267 <div class="@container"> 33268 <div class="sonic-prices-list ${"prices-list-" + this.formType}"> 33269 ${c$1( 33270 prices, 33271 (price) => price.id, 33272 (price) => this.getPriceItem(price) 33273 )} 33274 </div> 33275 </div> 33276 33277 <sonic-if .condition=${showShowAllButton}> 33278 <sonic-button @click=${this.showAll} variant="ghost" type="primary" size="sm" class="btn-show-all" noAutoFill> 33279 <sonic-icon 33280 library="custom" 33281 slot="prefix" 33282 @click=${this.showAll} 33283 class="show-all-icon" 33284 name="plus" 33285 ></sonic-icon> 33286 Tous les tarifs 33287 </sonic-button> 33288 </sonic-if> 33289 `; 33290 } 33291 }; 33292 PricesForm.styles = [ 33293 fontSize, 33294 tailwind, 33295 i$9` 33296 .prices-list-buttons { 33297 --_prices-item-mw: 8.5em; 33298 display: grid; 33299 grid-gap: 0.25em; 33300 } 33301 33302 .prices-list-select { 33303 --_prices-item-mw: 9.2em; 33304 display: grid; 33305 grid-gap: 1.25rem 0.7rem; 33306 /*margin-bottom: 1rem;*/ 33307 align-items: flex-end; 33308 } 33309 33310 .sonic-prices-list { 33311 grid-template-columns: repeat(auto-fill, minmax(min(var(--_prices-item-mw), 100%), 1fr)); 33312 } 33313 33314 :host([align="center"]) .sonic-prices-list { 33315 display: flex !important; 33316 justify-content: center; 33317 flex-wrap: wrap; 33318 grid-gap: 1.25rem; 33319 } 33320 33321 :host([align="center"]) sonic-price-select, 33322 :host([align="center"]) sonic-price-button { 33323 min-width: 12em; 33324 } 33325 33326 .btn-show-all { 33327 margin-top: 0.5em; 33328 } 33329 33330 :host([size="sm"]) .prices-list-buttons { 33331 --_prices-item-mw: 12em; 33332 } 33333 33334 @container (min-width: 60rem) { 33335 .prices-list-select { 33336 --_prices-item-mw: 9.2em; 33337 } 33338 } 33339 33340 @container (min-width: 80rem) { 33341 .prices-list-select { 33342 --_prices-item-mw: 10em; 33343 } 33344 } 33345 ` 33346 ]; 33347 __decorateClass$2Y([ 33348 n$5({ type: String }) 33349 ], PricesForm.prototype, "buttonType", 2); 33350 __decorateClass$2Y([ 33351 n$5({ type: String }) 33352 ], PricesForm.prototype, "formType", 2); 33353 __decorateClass$2Y([ 33354 n$5({ type: String }) 33355 ], PricesForm.prototype, "type", 2); 33356 __decorateClass$2Y([ 33357 n$5({ type: String }) 33358 ], PricesForm.prototype, "item_id", 2); 33359 __decorateClass$2Y([ 33360 n$5({ type: Array }) 33361 ], PricesForm.prototype, "prices", 2); 33362 __decorateClass$2Y([ 33363 n$5({ type: Boolean }) 33364 ], PricesForm.prototype, "noPriceName", 2); 33365 __decorateClass$2Y([ 33366 n$5({ type: Boolean }) 33367 ], PricesForm.prototype, "loading", 2); 33368 __decorateClass$2Y([ 33369 n$5({ type: String }) 33370 ], PricesForm.prototype, "size", 2); 33371 __decorateClass$2Y([ 33372 c({ context: alignContext, subscribe: true }), 33373 n$5({ type: String, reflect: true }) 33374 ], PricesForm.prototype, "align", 2);
33375 PricesForm = __decorateClass$2Y([ 33376 t$3("sonic-prices-form") 33377 ], PricesForm); 33378 var __defProp$2U = Object.defineProperty; 33379 var __getOwnPropDesc$2X = Object.getOwnPropertyDescriptor; 33380 var __decorateClass$2X = (decorators, target, key, kind) => { 33381 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2X(target, key) : target; 33382 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33383 if (decorator = decorators[i2]) 33384 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33385 if (kind && result) __defProp$2U(target, key, result); 33386 return result; 33387 }; 33388 let PriceInSitu = class extends Subscriber$1(i$6) { 33389 constructor() { 33390 super(...arguments); 33391 this.prices_in_situ = []; 33392 this.inline = false; 33393 } 33394 render() { 33395 if (!this.prices_in_situ) return A$1; 33396 return b$1`<div class="${this.inline ? "contents" : "mt-3"}"> 33397 ${this.prices_in_situ.map( 33398 (price) => !this.category?.id || price.place_category?.id == this.category?.id ? b$1`<div class="mr-3 inline-block"> 33399 ${price.title} : ${price.amount ? formatAmount(price.amount) : t("free")} 33400 </div>` : A$1 33401 )} 33402 </div> `; 33403 } 33404 }; 33405 PriceInSitu.styles = [tailwind]; 33406 __decorateClass$2X([ 33407 n$5() 33408 ], PriceInSitu.prototype, "prices_in_situ", 2); 33409 __decorateClass$2X([ 33410 n$5() 33411 ], PriceInSitu.prototype, "category", 2); 33412 __decorateClass$2X([ 33413 n$5({ type: Boolean }) 33414 ], PriceInSitu.prototype, "inline", 2); 33415 PriceInSitu = __decorateClass$2X([ 33416 t$3("sonic-price-in-situ") 33417 ], PriceInSitu); 33418 function getFilteredCategories(options) { 33419 const { prices, selectedQuota } = options; 33420 if (!prices?.length) return []; 33421 let filteredPrices = prices; 33422 if (selectedQuota?.id && selectedQuota.prices?.length && true) { 33423 const quotaPriceIds = selectedQuota.prices.filter((p2) => p2.visible).map((p2) => p2.price_id); 33424 filteredPrices = prices.filter((price) => quotaPriceIds.includes(Number(price.id))); 33425 } 33426 const categoriesMap = /* @__PURE__ */ new Map(); 33427 filteredPrices.forEach((price) => { 33428 const categoryId = Number(price.place_category?.id) || 0; 33429 const categoryTitle = price.place_category?.title || ""; 33430 if (!categoriesMap.has(categoryId)) { 33431 categoriesMap.set(categoryId, { 33432 id: categoryId, 33433 title: categoryTitle, 33434 prices: [] 33435 }); 33436 } 33437 categoriesMap.get(categoryId).prices.push(price); 33438 }); 33439 return Array.from(categoriesMap.values()).sort((a2, b2) => a2.id - b2.id); 33440 } 33441 var __defProp$2T = Object.defineProperty; 33442 var __getOwnPropDesc$2W = Object.getOwnPropertyDescriptor; 33443 var __decorateClass$2W = (decorators, target, key, kind) => { 33444 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2W(target, key) : target; 33445 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33446 if (decorator = decorators[i2]) 33447 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33448 if (kind && result) __defProp$2T(target, key, result); 33449 return result; 33450 }; 33451 const tagName$1N = "sonic-price-list-info"; 33452 let SonicPricesInfos = class extends i$6 { 33453 constructor() { 33454 super(...arguments); 33455 this.displaySoldOut = false; 33456 this.prices = []; 33457 this._renderableCategories = []; 33458 } 33459 willUpdate(properties) { 33460 if (properties.has("selectedQuota") || properties.has("prices")) { 33461 this._renderableCategories = getFilteredCategories({ 33462 prices: this.prices, 33463 selectedQuota: this.selectedQuota 33464 }); 33465 } 33466 super.willUpdate(properties); 33467 } 33468 render() { 33469 const justifyClass = flexJustify(this.align); 33470 if (!this._renderableCategories.some((c2) => c2.prices.length)) return A$1; 33471 return b$1`${this.displaySoldOut ? b$1` <span class="font-bold uppercase mb-2 block">${t("prices_sold_out")}</span> ` : A$1} 33472 <div class="grid grid-cols-1 gap-y-2"> 33473 ${c$1( 33474 this._renderableCategories, 33475 (category) => category.id, 33476 (category) => { 33477 return b$1` 33478 <div> 33479 ${category.title && category.id !== 0 ? b$1`<div class="font-bold mb-1">â ${category.title}</div>` : A$1} 33480 <div class="flex flex-wrap items-start gap-x-6 leading-tight ${justifyClass}"> 33481 ${o$1(category.prices, (price) => { 33482 return b$1`<div>
33483 <span class="font-bold mr-[.85em]">${price.title}</span>${price.amount ? formatAmount(price.amount) : t("free")} 33484 </div>`; 33485 })} 33486 <sonic-price-in-situ inline></sonic-price-in-situ> 33487 </div> 33488 </div> 33489 `; 33490 } 33491 )} 33492 </div>`; 33493 } 33494 }; 33495 SonicPricesInfos.styles = [tailwind, fontSize]; 33496 __decorateClass$2W([ 33497 n$5({ type: String }) 33498 ], SonicPricesInfos.prototype, "size", 2); 33499 __decorateClass$2W([ 33500 n$5({ type: Boolean }) 33501 ], SonicPricesInfos.prototype, "displaySoldOut", 2); 33502 __decorateClass$2W([ 33503 c({ context: alignContext, subscribe: true }), 33504 n$5({ type: String }) 33505 ], SonicPricesInfos.prototype, "align", 2); 33506 __decorateClass$2W([ 33507 n$5({ type: Object }) 33508 ], SonicPricesInfos.prototype, "selectedQuota", 2); 33509 __decorateClass$2W([ 33510 n$5({ type: Array }) 33511 ], SonicPricesInfos.prototype, "prices", 2); 33512 __decorateClass$2W([ 33513 r$5() 33514 ], SonicPricesInfos.prototype, "_renderableCategories", 2); 33515 SonicPricesInfos = __decorateClass$2W([ 33516 t$3(tagName$1N) 33517 ], SonicPricesInfos); 33518 var __defProp$2S = Object.defineProperty; 33519 var __getOwnPropDesc$2V = Object.getOwnPropertyDescriptor; 33520 var __decorateClass$2V = (decorators, target, key, kind) => { 33521 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2V(target, key) : target; 33522 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33523 if (decorator = decorators[i2]) 33524 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33525 if (kind && result) __defProp$2S(target, key, result); 33526 return result; 33527 }; 33528 let PageHeader = class extends i$6 { 33529 constructor() { 33530 super(...arguments); 33531 this.hasActions = false; 33532 this.hasSubtitle = false; 33533 this.hasMore = false; 33534 this._resizeController = new h$1(this, {}); 33535 } 33536 checkIfActions() { 33537 this.hasActions = !!this.actionsElement?.length; 33538 } 33539 checkIfMore() { 33540 this.hasMore = !!this.moreElement?.length; 33541 } 33542 willUpdate(_changedProperties) { 33543 if (_changedProperties.has("subtitle")) { 33544 this.checkIfSubtitle(); 33545 } 33546 } 33547 checkIfSubtitle() { 33548 this.hasSubtitle = !!this.subtitle || !!this.slotSubtitleNodes?.length; 33549 } 33550 render() { 33551 const isSmall = this.clientWidth < 500; 33552 return b$1` 33553 <div class="header"> 33554 ${this.goBack !== void 0 || this.goBackHref ? b$1` 33555 <div 33556 class="${isSmall ? "text-3xl" : "text-4xl"} leading-none flex items-center shrink-0 mr-3 pr-2 border-r" 33557 > 33558 <sonic-button 33559 ?goBack=${!this.goBackHref} 33560 href=${o$4(this.goBackHref)} 33561 variant="ghost" 33562 shape="square" 33563 size="${isSmall ? "md" : "lg"}" 33564 > 33565 <sonic-icon library="custom" name="arrow-left" size="${isSmall ? "lg" : "xl"}"></sonic-icon> 33566 </sonic-button> 33567 </div> 33568 ` : A$1} 33569 33570 <div class="header-content"> 33571 <div class="flex flex-wrap items-center pt-1"> 33572 <div class="${this.hasActions ? "mr-auto " : ""}"> 33573 <div> 33574 <span class="${isSmall ? "text-3xl" : "text-4xl"} leading-none font-bold mr-4 inline-block text-pretty" 33575 >${this.label}</span 33576 > 33577 <slot name="status"></slot> 33578 </div> 33579 33580 <slot 33581 name="subtitle" 33582 @slotchange=${this.checkIfSubtitle} 33583 class="mt-[.25em] w-full text-lg ${this.hasSubtitle ? "block" : "hidden"}" 33584 > 33585 ${this.subtitle ?? A$1} 33586 </slot> 33587 </div> 33588 <div class=${this.hasActions ? " block self-start " : "hidden"}> 33589 <slot 33590 name="actions" 33591 @slotchange=${this.checkIfActions} 33592 class=${this.hasActions ? "min-h-[2.8rem] inline-flex gap-1 items-center flex-wrap" : "hidden"} 33593 ></slot> 33594 </div> 33595 </div> 33596 <slot></slot> 33597 </div> 33598 33599 <div class=${this.hasMore ? "block" : "hidden"}> 33600 <sonic-pop class="block ml-2 mt-1"> 33601 <sonic-button shape="circle" size="${isSmall ? "md" : "lg"}"> 33602 <sonic-icon library="custom" name="ellipsis-vertical" size="${isSmall ? "md" : "lg"}"></sonic-icon> 33603 </sonic-button> 33604 <slot @slotchange=${this.checkIfMore} name="more" slot="content"></slot> 33605 </sonic-pop> 33606 </div> 33607 </div> 33608 `; 33609 } 33610 }; 33611 PageHeader.styles = [ 33612 tailwind, 33613 i$9` 33614 :host { 33615 display: block; 33616 margin-bottom: 2rem; 33617 } 33618 33619 .header { 33620 display: flex; 33621 align-items: flex-start; 33622 } 33623 33624 .header-content { 33625 flex-grow: 1; 33626 } 33627 ` 33628 ]; 33629 __decorateClass$2V([ 33630 n$5({ type: String }) 33631 ], PageHeader.prototype, "label", 2); 33632 __decorateClass$2V([ 33633 n$5({ type: String }) 33634 ], PageHeader.prototype, "subtitle", 2); 33635 __decorateClass$2V([ 33636 n$5({ type: String }) 33637 ], PageHeader.prototype, "goBack", 2); 33638 __decorateClass$2V([ 33639 n$5({ type: String }) 33640 ], PageHeader.prototype, "goBackHref", 2); 33641 __decorateClass$2V([ 33642 o$8({ selector: "*", slot: "actions" }) 33643 ], PageHeader.prototype, "actionsElement", 2); 33644 __decorateClass$2V([ 33645 r$5() 33646 ], PageHeader.prototype, "hasActions", 2); 33647 __decorateClass$2V([ 33648 r$5() 33649 ], PageHeader.prototype, "hasSubtitle", 2); 33650 __decorateClass$2V([ 33651 n$4({ slot: "subtitle", flatten: true }) 33652 ], PageHeader.prototype, "slotSubtitleNodes", 2); 33653 __decorateClass$2V([ 33654 o$8({ selector: "*", slot: "more" }) 33655 ], PageHeader.prototype, "moreElement", 2); 33656 __decorateClass$2V([ 33657 r$5() 33658 ], PageHeader.prototype, "hasMore", 2); 33659 PageHeader = __decorateClass$2V([ 33660 t$3("sonic-page-header") 33661 ], PageHeader); 33662 const ownerIcon = (owner, className) => { 33663 let length = 0; 33664 if (owner?.firstName) { 33665 length = owner?.firstName?.length ?? 0; 33666 } 33667 if (owner?.lastName) { 33668 length += owner?.lastName.length ?? 0; 33669 } 33670 let icon2; 33671 switch (length) { 33672 case 8: 33673 case 9: 33674 icon2 = "face-grin-wink"; 33675 break; 33676 case 10: 33677 icon2 = "face-sunglasses"; 33678 break; 33679 case 11: 33680 icon2 = "face-smile-beam"; 33681 break; 33682 case 12: 33683 icon2 = "face-grin"; 33684 break; 33685 case 13: 33686 icon2 = "face-laugh-wink"; 33687 break; 33688 case 14: 33689 icon2 = "face-party"; 33690 break; 33691 case 15: 33692 icon2 = "face-laugh-wink"; 33693 break; 33694 case 16: 33695 icon2 = "face-laugh-beam"; 33696 break; 33697 case 17: 33698 icon2 = "face-sunglasses"; 33699 break; 33700 case 18: 33701 icon2 = "face-awesome"; 33702 break; 33703 case 19: 33704 icon2 = "face-smile-relaxed"; 33705 break; 33706 case 20: 33707 icon2 = "face-glasses"; 33708 break; 33709 case 26: 33710 icon2 = "face-smirking"; 33711 break; 33712 case 21: 33713 icon2 = "face-surprise"; 33714 break; 33715 default: 33716 icon2 = "face-smile"; 33717 break; 33718 } 33719 return b$1`<sonic-icon name="${icon2}" library="custom" class="${o$4(className)}"></sonic-icon>`; 33720 }; 33721 const contactContext = n("contactContext"); 33722 var __defProp$2R = Object.defineProperty; 33723 var __getOwnPropDesc$2U = Object.getOwnPropertyDescriptor; 33724 var __decorateClass$2U = (decorators, target, key, kind) => { 33725 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2U(target, key) : target; 33726 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33727 if (decorator = decorators[i2]) 33728 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33729 if (kind && result) __defProp$2R(target, key, result); 33730 return result; 33731 }; 33732 let UserInfo = class extends Subscriber$1(i$6) { 33733 constructor() { 33734 super(...arguments); 33735 this.link = false;
33736 this.showAddress = false; 33737 this.showInfos = false; 33738 this.size = "md"; 33739 this.mode = "user"; 33740 this.contactContext = "user"; 33741 } 33742 render() { 33743 if (!this.props) return A$1; 33744 const { email: email2, phoneNumber, service } = this.props; 33745 return b$1`<div class="flex gap-2 leading-tight min-w-0 "> 33746 <div class="shrink-0 text-center">${this.renderIcon()}</div> 33747 <div class="min-w-0 grow"> 33748 <div class="font-bold">${this.renderName()}</div> 33749 ${service && !(this.size == "sm" || this.size === "xs") ? b$1`<div class="text-2xs uppercase leading-0 mt-1 text-neutral-500">Contact</div> 33750 ${service}` : A$1} 33751 ${email2 ? b$1`<div class="truncate block"> 33752 <sonic-link class="hover:underline" title="${email2}" href="mailto:${email2}">${email2}</sonic-link> 33753 </div>` : A$1} 33754 ${phoneNumber && this.size !== "xs" ? b$1`<a class="hover:underline" href="tel:${phoneNumber.replaceAll(" ", "")}">${phoneNumber}</a>` : A$1} 33755 ${this.size !== "xs" ? b$1` ${this.renderAddress()} ${this.renderInfos()}` : A$1} 33756 <slot></slot> 33757 </div> 33758 </div>`; 33759 } 33760 renderName() { 33761 const isProfessional = this.props?.isProfessional; 33762 const uid = this.props?.uid; 33763 const isAnonymous = !this.props?.firstName && !this.props?.lastName && !this.props?.structure; 33764 const route2 = isProfessional ? appRoute("pro") : appRoute("user"); 33765 const routeIsDefined = route2.toString() !== "" && route2.toString() !== "/"; 33766 const path = uid && routeIsDefined ? route2?.fill({ id: uid?.toString() }).toString() : null; 33767 const lastName = this.props?.lastName?.toUpperCase(); 33768 if (isAnonymous) { 33769 return b$1`Anonyme`; 33770 } 33771 const nameMarkup = b$1`<div class="text-left"> 33772 ${lastName} ${this.props?.firstName} 33773 ${this.props?.firstName || lastName ? b$1` <br />` : A$1}${this.props?.structure} 33774 </div>`; 33775 if (path) { 33776 return b$1`<sonic-tooltip label="Voir le compte ${isProfessional ? "pro" : "client"}" class=""> 33777 <sonic-link href=${path} class="hover:underline ">${nameMarkup}</sonic-link> 33778 </sonic-tooltip>`; 33779 } else { 33780 return nameMarkup; 33781 } 33782 } 33783 renderIcon() { 33784 if (!this.props) return A$1; 33785 let iconName = "user"; 33786 if (this.mode === "subscription") { 33787 iconName = "id-card"; 33788 } else { 33789 let { uid, isProfessional, firstName, lastName, isPiggyBank } = this.props; 33790 if (uid == 0 && !firstName && !lastName) { 33791 iconName = "user-secret"; 33792 } else if (uid == 0) { 33793 iconName = "cart-shopping-fast"; 33794 } else if (isPiggyBank) { 33795 iconName = "piggy-bank"; 33796 } else if (isProfessional) { 33797 iconName = "user-tie"; 33798 } 33799 if (!uid && this.contactContext === "owner") { 33800 return b$1`${ownerIcon(this.props)} `; 33801 } 33802 } 33803 return b$1`<sonic-icon library="custom" name="${iconName}" size="lg" prefix="light"></sonic-icon>`; 33804 } 33805 renderAddress() { 33806 if (!this.props) return A$1; 33807 const { address, address2, postalCode, city } = this.props; 33808 const hasAtLeastOneValue = address || address2 || postalCode || city; 33809 if (this.showAddress && hasAtLeastOneValue) { 33810 return b$1` 33811 <div class="text-xs mt-2"> 33812 ${address ? b$1`<div>${address}</div>` : A$1} ${address2 ? b$1`<div>${address2}</div>` : A$1} 33813 ${postalCode ? b$1`<span>${postalCode}</span>` : A$1} ${city ? b$1`<span> â ${city}</span>` : A$1} 33814 </div> 33815 `; 33816 } else { 33817 return A$1; 33818 } 33819 } 33820 renderInfos() { 33821 if (!this.props) return A$1; 33822 const { gender, birthdate } = this.props; 33823 const currentLang = document.documentElement.lang ?? "fr-FR"; 33824 const cleanBirthdate = birthdate ? new Date(birthdate).toLocaleDateString(currentLang) : null; 33825 const hasAtLeastOneValue = gender || birthdate; 33826 if (this.showInfos && hasAtLeastOneValue) { 33827 return b$1` 33828 <div class="text-xs mt-2 text-neutral-500"> 33829 ${gender ? b$1`<div>Genre : ${gender}</div>` : A$1} 33830 ${birthdate ? b$1`<div>Né·e le : ${cleanBirthdate}</div>` : A$1} 33831 </div> 33832 `; 33833 } else { 33834 return A$1; 33835 } 33836 } 33837 }; 33838 UserInfo.styles = [ 33839 tailwind, 33840 i$9` 33841 :host() { 33842 display: block; 33843 min-width: 0; 33844 max-width: 100%; 33845 } 33846 ` 33847 ]; 33848 __decorateClass$2U([ 33849 n$5({ type: Boolean }) 33850 ], UserInfo.prototype, "link", 2); 33851 __decorateClass$2U([ 33852 n$5({ type: Boolean }) 33853 ], UserInfo.prototype, "showAddress", 2); 33854 __decorateClass$2U([ 33855 n$5({ type: Boolean }) 33856 ], UserInfo.prototype, "showInfos", 2); 33857 __decorateClass$2U([ 33858 n$5({ type: String }) 33859 ], UserInfo.prototype, "size", 2); 33860 __decorateClass$2U([ 33861 n$5({ type: String }) 33862 ], UserInfo.prototype, "mode", 2); 33863 __decorateClass$2U([ 33864 c({ context: contactContext, subscribe: true }), 33865 n$5({ type: String }) 33866 ], UserInfo.prototype, "contactContext", 2); 33867 UserInfo = __decorateClass$2U([ 33868 t$3("sonic-user-info") 33869 ], UserInfo); 33870 var __defProp$2Q = Object.defineProperty; 33871 var __getOwnPropDesc$2T = Object.getOwnPropertyDescriptor; 33872 var __decorateClass$2T = (decorators, target, key, kind) => { 33873 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2T(target, key) : target; 33874 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33875 if (decorator = decorators[i2]) 33876 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33877 if (kind && result) __defProp$2Q(target, key, result); 33878 return result; 33879 }; 33880 let SonicUserToggle = class extends i$6 { 33881 constructor() { 33882 super(...arguments); 33883 this.selectedId = 0; 33884 this.canCreateAccount = false;
33885 this.handleCreateAccount = () => { 33886 Modal.create({ 33887 content: b$1`<sonic-iframe src="/inscription-guichet?popup=true&sonic_modal=true"></sonic-iframe>`, 33888 maxWidth: "62rem", 33889 removeOnHide: true 33890 }); 33891 }; 33892 this.dispatch = (uid) => { 33893 const event = new CustomEvent("select", { 33894 detail: { uid } 33895 }); 33896 this.dispatchEvent(event); 33897 this.selectedId = uid; 33898 }; 33899 this.handleSelect = (e2) => { 33900 this.dispatch(e2.detail.uid); 33901 }; 33902 } 33903 clear() { 33904 this.selectedId = 0; 33905 this.dispatch(0); 33906 } 33907 render() { 33908 const displaySearch = !this.selectedId; 33909 return b$1` 33910 ${displaySearch ? b$1`<div class="flex gap-3 w-full"> 33911 <sonic-user-selector @select=${this.handleSelect} class="grow"></sonic-user-selector> 33912 ${this.canCreateAccount ? b$1`<sonic-button @click=${this.handleCreateAccount} variant="outline" class="self-start"> 33913 <sonic-icon name="user-plus" library="custom"></sonic-icon> ${t("create_account")} 33914 </sonic-button> ` : A$1} 33915 </div> ` : b$1`<sonic-fetch dataProvider="user/${this.selectedId}"> 33916 <div 33917 noAutoFill 33918 variant="outline" 33919 align="left" 33920 class="flex gap-1 items-start border border-neutral-200 px-2 py-2 rounded-md" 33921 > 33922 <sonic-user-info 33923 inert 33924 dataProvider="user/${this.selectedId}" 33925 size="md" 33926 class="relative py-2 block flex-grow " 33927 ></sonic-user-info> 33928 <sonic-button slot="suffix" shape="circle" icon size="sm" noAutoFill @click=${this.clear}> 33929 <sonic-icon library="custom" name="trash"></sonic-icon 33930 ></sonic-button> 33931 </div> 33932 </sonic-fetch>`} 33933 `; 33934 } 33935 }; 33936 SonicUserToggle.styles = [tailwind]; 33937 __decorateClass$2T([ 33938 n$5({ type: String }) 33939 ], SonicUserToggle.prototype, "name", 2); 33940 __decorateClass$2T([ 33941 n$5({ type: Number }) 33942 ], SonicUserToggle.prototype, "selectedId", 2); 33943 __decorateClass$2T([ 33944 n$5({ type: Boolean }) 33945 ], SonicUserToggle.prototype, "canCreateAccount", 2); 33946 SonicUserToggle = __decorateClass$2T([ 33947 t$3("sonic-user-toggle") 33948 ], SonicUserToggle); 33949 var __decorate$a = function(decorators, target, key, desc) { 33950 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 33951 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 33952 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 33953 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 33954 }; 33955 const tagName$1M = "sonic-textarea"; 33956 let Textarea = class Textarea extends Form(Form$2(Subscriber$1(i$6))) { 33957 constructor() { 33958 super(...arguments); 33959 this.size = "md"; 33960 this.readonly = false; 33961 this.resize = "vertical"; 33962 this.hasDescription = false; 33963 this.hasLabel = false; 33964 } 33965 connectedCallback() { 33966 super.connectedCallback(); 33967 this.hasSlotOrProps(); 33968 } 33969 willUpdate(changedProperties) { 33970 this.hasSlotOrProps(); 33971 super.willUpdate(changedProperties); 33972 } 33973 hasSlotOrProps() { 33974 this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false; 33975 this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false; 33976 } 33977 validateFormElement() { 33978 const textarea2 = this.shadowRoot?.querySelector("textarea"); 33979 if (!textarea2 || textarea2.checkValidity()) 33980 return; 33981 const formPublisher = this.getFormPublisher(); 33982 if (formPublisher) { 33983 formPublisher.isFormValid = false; 33984 } 33985 textarea2.reportValidity(); 33986 } 33987 render() { 33988 const textAreaStyle = { 33989 resize: this.resize 33990 }; 33991 return b$1` 33992 <label 33993 for="${this.id || "form-element"}" 33994 class="${this.hasLabel ? "form-label" : "hidden"}" 33995 >${this.label ? o$6( 33996 this.label 33997 /*+ labelStarSuffix*/ 33998 ) : ""}<slot 33999 name="label" 34000 @slotchange=${this.hasSlotOrProps} 34001 ></slot 34002 ></label> 34003 34004 <div class="form-control"> 34005 <textarea 34006 data-form-element 34007 id="${this.id || "form-element"}"
34008 @input=${this.handleChange} 34009 @blur=${this.handleBlur} 34010 ?disabled=${this.disabled} 34011 ?required=${this.required} 34012 ?autofocus=${this.autofocus} 34013 rows=${o$4(this.rows)} 34014 cols=${o$4(this.cols)} 34015 maxlength=${o$4(this.maxlength)} 34016 minlength=${o$4(this.minlength)} 34017 ?readonly=${this.readonly} 34018 spellcheck=${o$4(this.spellcheck)} 34019 autocomplete=${o$4(this.autocomplete)} 34020 tabindex=${o$4(this.tabindex)} 34021 wrap=${o$4(this.wrap)} 34022 placeholder="${this.placeholder}" 34023 class="form-element textarea custom-scroll" 34024 aria-label=${o$4(this.ariaLabel)} 34025 aria-labelledby=${o$4(this.ariaLabelledby)} 34026 style=${o$3(textAreaStyle)} 34027 > 34028${this.value}</textarea 34029 > 34030 </div> 34031 34032 <slot 34033 name="description" 34034 @slotchange=${this.hasSlotOrProps} 34035 class="${this.hasDescription ? "form-description" : "hidden"}" 34036 >${this.description ? b$1`${o$6(this.description)}` : ""}</slot 34037 > 34038 `; 34039 } 34040 }; 34041 Textarea.styles = [ 34042 fontSize, 34043 formControl, 34044 label, 34045 description, 34046 customScroll, 34047 i$9` 34048 textarea { 34049 overflow-y: auto !important; 34050 font-size: inherit; 34051 } 34052 ` 34053 ]; 34054 __decorate$a([ 34055 n$5({ type: String }) 34056 ], Textarea.prototype, "size", void 0); 34057 __decorate$a([ 34058 n$5({ type: Number }) 34059 ], Textarea.prototype, "rows", void 0); 34060 __decorate$a([ 34061 n$5({ type: Number }) 34062 ], Textarea.prototype, "cols", void 0); 34063 __decorate$a([ 34064 n$5({ type: Number }) 34065 ], Textarea.prototype, "maxlength", void 0); 34066 __decorate$a([ 34067 n$5({ type: Number }) 34068 ], Textarea.prototype, "minlength", void 0); 34069 __decorate$a([ 34070 n$5({ type: String }) 34071 ], Textarea.prototype, "wrap", void 0); 34072 __decorate$a([ 34073 n$5({ type: Boolean }) 34074 ], Textarea.prototype, "readonly", void 0); 34075 __decorate$a([ 34076 n$5({ type: String }) 34077 ], Textarea.prototype, "placeholder", void 0); 34078 __decorate$a([ 34079 n$5({ type: String }) 34080 ], Textarea.prototype, "resize", void 0); 34081 __decorate$a([ 34082 n$4({ slot: "label", flatten: true }) 34083 ], Textarea.prototype, "slotLabelNodes", void 0); 34084 __decorate$a([ 34085 n$4({ slot: "description", flatten: true }) 34086 ], Textarea.prototype, "slotDescriptionNodes", void 0); 34087 __decorate$a([ 34088 r$5() 34089 ], Textarea.prototype, "hasDescription", void 0); 34090 __decorate$a([ 34091 r$5() 34092 ], Textarea.prototype, "hasLabel", void 0); 34093 Textarea = __decorate$a([ 34094 t$3(tagName$1M) 34095 ], Textarea); 34096 var __decorate$9 = function(decorators, target, key, desc) { 34097 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 34098 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 34099 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 34100 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 34101 }; 34102 const tagName$1L = "sonic-checkbox"; 34103 let Checkbox = class Checkbox extends Form$1(Form(Form$2(Subscriber$1(i$6)))) { 34104 constructor() { 34105 super(...arguments); 34106 this.touched = false; 34107 this.iconName = "check"; 34108 this.indeterminateIconName = "minus-small"; 34109 this.showAsIndeterminate = false; 34110 this.hasDescription = false; 34111 this.hasLabel = false; 34112 } 34113 connectedCallback() { 34114 this.type = "checkbox"; 34115 this.hasSlotOrProps(); 34116 super.connectedCallback(); 34117 } 34118 willUpdate(changedProperties) { 34119 this.hasSlotOrProps(); 34120 super.willUpdate(changedProperties); 34121 if (changedProperties.has("type")) { 34122 this.type = "checkbox"; 34123 } 34124 } 34125 hasSlotOrProps() { 34126 this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false; 34127 this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false; 34128 } 34129 render() { 34130 return b$1` 34131 <label class="checkbox-container ${this.disabled ? "disabled" : ""}"> 34132
34133 <span class="icon-container"> 34134 <input 34135 type="${this.type}" 34136 @click=${this.handleChange} 34137 @blur=${this.handleBlur} 34138 ?required=${this.required} 34139 ?data-indeterminate=${this.showAsIndeterminate} 34140 ?disabled=${this.disabled} 34141 .checked=${o$4(this.checked)} 34142 .name=${this.name} 34143 .value=${this.value} 34144 ?autofocus=${this.autofocus} 34145 aria-label=${o$4(this.ariaLabel)} 34146 aria-labelledby=${o$4(this.ariaLabelledby)} 34147 /> 34148 <sonic-icon name="${this.checked == "indeterminate" || this.showAsIndeterminate ? this.indeterminateIconName : this.iconName}" class="sc-input-icon"></sonic-icon> 34149 </span> 34150 34151 <div class="checkbox-text ${!this.hasDescription && !this.hasLabel ? "hidden" : "checkbox-text"}"> 34152 ${this.label ? o$6( 34153 this.label 34154 /*+ labelStarSuffix*/ 34155 ) : ""} 34156 <slot @slotchange=${this.hasSlotOrProps}></slot> 34157 <slot @slotchange=${this.hasSlotOrProps} name="description" class="${this.hasDescription ? "description" : "hidden"} ">${this.description ? b$1`${o$6(this.description)}` : ""}</slot> 34158 </div> 34159 </label> 34160 </label> 34161 `; 34162 } 34163 }; 34164 Checkbox.styles = [ 34165 fontSize, 34166 i$9` 34167 :host { 34168 --sc-checkbox-border-width: var(--sc-form-border-width); 34169 --sc-checkbox-border-color: var( 34170 --sc-input-border-color, 34171 var(--sc-base-content, #000) 34172 ); 34173 --sc-checkbox-bg: var(--sc-input-bg); 34174 --sc-checkbox-color: transparent; 34175 font-size: var(--sc-_fs); 34176 } 34177 34178 * { 34179 box-sizing: border-box; 34180 } 34181 34182 .checkbox-container { 34183 min-height: 1.4em; 34184 display: flex; 34185 gap: 0.5em; 34186 line-height: 1.2; 34187 align-items: flex-start; 34188 } 34189 34190 .icon-container { 34191 position: relative; 34192 display: flex; 34193 flex-shrink: 0; 34194 } 34195 34196 input { 34197 box-sizing: border-box; 34198 appearance: none; 34199 flex-shrink: 0; 34200 height: calc(var(--sc-_fs) * 1.25); 34201 width: calc(var(--sc-_fs) * 1.25); 34202 display: block; 34203 cursor: pointer; 34204 border-radius: 0.25em; 34205 transition: 0.2s; 34206 outline: none; 34207 margin: 0; 34208 background-color: var(--sc-checkbox-bg); 34209 border: var(--sc-checkbox-border-width) solid 34210 var(--sc-checkbox-border-color); 34211 } 34212 34213 input:focus-visible, 34214 :host(:not([disabled])) input:active { 34215 box-shadow: 0 0 0 2px var(--sc-primary, var(--sc-base-content, #000)); 34216 } 34217 34218 :host(:not([disabled])) label { 34219 cursor: pointer; 34220 } 34221 34222 sonic-icon { 34223 line-height: 0; 34224 position: absolute; 34225 top: 50%; 34226 left: 50%; 34227 transform: translateX(-50%) translateY(-50%) scale(0); 34228 transition: transform 0.2s ease-in-out; 34229 color: var(--sc-checkbox-color); 34230 } 34231 34232 /* .checkbox-text { 34233 align-self: center; 34234 } */ 34235 34236 .description { 34237 color: var(--sc-base-400, var(--sc-base-content, #000)); 34238 font-size: 0.85em; 34239 margin-top: 0.2em; 34240 display: block; 34241 } 34242 34243 /*Active */ 34244 input:checked, 34245 input[data-indeterminate], 34246 input[checked] { 34247 --sc-checkbox-border-color: var( 34248 --sc-primary, 34249 var(--sc-base-content, #000) 34250 ); 34251 --sc-checkbox-bg: var(--sc-primary, var(--sc-base-content, #000)); 34252 } 34253 input:checked + sonic-icon, 34254 input[data-indeterminate] + sonic-icon, 34255 input[checked] + sonic-icon { 34256 --sc-checkbox-color: var(--sc-primary-content, var(--sc-base, #fff)); 34257 transform: translateX(-50%) translateY(-50%) scale(1); 34258 } 34259 /*DISABLED */ 34260 .disabled { 34261 cursor: not-allowed; 34262 } 34263 .disabled input { 34264 opacity: 0.4; 34265 } 34266 34267 .disabled .checkbox-text { 34268 opacity: 0.6; 34269 } 34270 34271 /*INPUT HOVER*/ 34272 :host(:not([disabled])) label:hover input { 34273 background-color: hsl(from var(--sc-checkbox-bg) h s calc(l * 0.97)); 34274 } 34275 34276 ::slotted(a) { 34277 color: inherit; 34278 text-decoration: underline !important; 34279 } 34280 34281 ::slotted(a:hover) { 34282 text-decoration: none !important; 34283 } 34284 /*Utils */ 34285 .hidden { 34286 display: none; 34287 } 34288 ` 34289 ]; 34290 __decorate$9([ 34291 n$5({ type: Boolean, reflect: true }) 34292 ], Checkbox.prototype, "touched", void 0); 34293 __decorate$9([ 34294 n$5({ type: String }) 34295 ], Checkbox.prototype, "iconName", void 0); 34296 __decorate$9([ 34297 n$5({ type: String }) 34298 ], Checkbox.prototype, "indeterminateIconName", void 0); 34299 __decorate$9([ 34300 n$5({ type: Boolean }) 34301 ], Checkbox.prototype, "showAsIndeterminate", void 0); 34302 __decorate$9([ 34303 n$5({ type: Boolean }) 34304 ], Checkbox.prototype, "hasDescription", void 0); 34305 __decorate$9([ 34306 n$5({ type: Boolean }) 34307 ], Checkbox.prototype, "hasLabel", void 0); 34308 __decorate$9([ 34309 n$4({ flatten: true }) 34310 ], Checkbox.prototype, "slotLabelNodes", void 0); 34311 __decorate$9([ 34312 n$4({ slot: "description", flatten: true }) 34313 ], Checkbox.prototype, "slotDescriptionNodes", void 0); 34314 Checkbox = __decorate$9([ 34315 t$3(tagName$1L) 34316 ], Checkbox); 34317 const layoutContext = n("cartLayout"); 34318 const modeContext = n("cartMode"); 34319 const cartTypeContext = n("cartType"); 34320 const detailContext = n("detailContext"); 34321 var __defProp$2P = Object.defineProperty; 34322 var __getOwnPropDesc$2S = Object.getOwnPropertyDescriptor; 34323 var __decorateClass$2S = (decorators, target, key, kind) => { 34324 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2S(target, key) : target; 34325 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 34326 if (decorator = decorators[i2]) 34327 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 34328 if (kind && result) __defProp$2P(target, key, result); 34329 return result; 34330 }; 34331 const tagName$1K = "sonic-cart-move-items-button"; 34332 let SonicCartMoveItemsButton = class extends i$6 { 34333 constructor() { 34334 super(...arguments); 34335 this.mode = "default"; 34336 this.lineItems = []; 34337 this.size = "md"; 34338 } 34339 render() { 34340 if (!(this.mode == "split" || this.mode == "splitResult")) { 34341 return A$1; 34342 } 34343 const options = { 34344 sourceDataProvider: this.mode == "split" ? "splitSource" : "splitResult", 34345 targetDataProvider: this.mode == "split" ? "splitResult" : "splitSource" 34346 }; 34347 return b$1`<sonic-button 34348 noAutoFill 34349 .size="${this.size}" 34350 shape="circle" 34351 variant="ghost" 34352 icon 34353 @click=${() => moveCartItems(this.lineItems, options)} 34354 > 34355 ${this.mode == "split" ? b$1`<sonic-icon library="custom" name="arrow-right-from-arc"></sonic-icon>` : b$1`<sonic-icon library="custom" name="trash"></sonic-icon>`} 34356 </sonic-button>`; 34357 } 34358 }; 34359 SonicCartMoveItemsButton.styles = [ 34360 tailwind, 34361 i$9` 34362 :host { 34363 display: flex; 34364 justify-content: center; 34365 min-width: 3rem; 34366 } 34367 ` 34368 ]; 34369 __decorateClass$2S([ 34370 c({ context: modeContext, subscribe: true }), 34371 n$5({ type: String }) 34372 ], SonicCartMoveItemsButton.prototype, "mode", 2); 34373 __decorateClass$2S([ 34374 c({ context: cartTypeContext, subscribe: true }), 34375 n$5({ type: String }) 34376 ], SonicCartMoveItemsButton.prototype, "cartType", 2); 34377 __decorateClass$2S([ 34378 n$5({ type: Array }) 34379 ], SonicCartMoveItemsButton.prototype, "lineItems", 2); 34380 __decorateClass$2S([ 34381 n$5({ type: String }) 34382 ], SonicCartMoveItemsButton.prototype, "size", 2); 34383 SonicCartMoveItemsButton = __decorateClass$2S([ 34384 t$3(tagName$1K) 34385 ], SonicCartMoveItemsButton);
34386 const isSession = (entity) => { 34387 return entity.entity_type === EntityType.Event; 34388 }; 34389 var __defProp$2O = Object.defineProperty; 34390 var __getOwnPropDesc$2R = Object.getOwnPropertyDescriptor; 34391 var __decorateClass$2R = (decorators, target, key, kind) => { 34392 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2R(target, key) : target; 34393 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 34394 if (decorator = decorators[i2]) 34395 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 34396 if (kind && result) __defProp$2O(target, key, result); 34397 return result; 34398 }; 34399 const tagName$1J = "sonic-event-filter-taxonomy"; 34400 let EventFilterTaxonomy = class extends Fetcher(Subscriber$1(i$6)) { 34401 constructor() { 34402 super(...arguments); 34403 this.hasTerm = false; 34404 this.vocabulary = "category"; 34405 this.defaultTitle = ""; 34406 this.icon = "tag"; 34407 this.onlyFilter = false; 34408 this.formPublisher = null; 34409 this.updateHasTerm = (value) => { 34410 this.hasTerm = !!value?.length; 34411 }; 34412 } 34413 connectedCallback() { 34414 this.setAttribute("endPoint", this.vocabulary + "?sort=title:asc"); 34415 this.setAttribute("dataProvider", "event_filter_" + this.vocabulary); 34416 switch (this.vocabulary) { 34417 case "category": 34418 this.defaultTitle = "Toutes les catégories"; 34419 this.icon = "tag"; 34420 break; 34421 case "activity": 34422 this.defaultTitle = "Toutes les activités"; 34423 this.icon = "layer-group"; 34424 this.key = "data"; 34425 this.setAttribute("key", "data"); 34426 break; 34427 case "range": 34428 this.defaultTitle = "Toutes les gammes"; 34429 this.icon = "square-a"; 34430 this.setAttribute("key", "data"); 34431 break; 34432 } 34433 super.connectedCallback(); 34434 this.formPublisher = PublisherManager.get(this.getAncestorAttributeValue("formDataProvider")); 34435 if (this.formPublisher) { 34436 this.formPublisher["ids_" + this.vocabulary].onAssign(this.updateHasTerm); 34437 } 34438 } 34439 disconnectedCallback() { 34440 if (this.formPublisher) { 34441 this.formPublisher["ids_" + this.vocabulary].offAssign(this.updateHasTerm); 34442 } 34443 super.disconnectedCallback(); 34444 } 34445 render() { 34446 if (!this.vocabulary || !this.props) return A$1; 34447 const items = "data" in this.props ? this.props.data : this.props; 34448 const filterName = "ids_" + this.vocabulary; 34449 return b$1`<sonic-pop class="d-inline-block"> 34450 <div class="relative"> 34451 <sonic-button shape="circle"> 34452 <sonic-icon library="custom" name="${this.icon}"></sonic-icon> 34453 </sonic-button> 34454 ${this.hasTerm ? b$1` <sonic-badge class="absolute top-[.10em] right-[.10em]" size="2xs" type="danger"></sonic-badge>` : A$1} 34455 </div> 34456 <sonic-menu slot="content" size="sm" class="w-[14rem] overflow-auto max-h-[50vh]"> 34457 <sonic-menu-item radio size="sm" type="default" value="" name="${filterName}" 34458 >${this.defaultTitle}</sonic-menu-item 34459 > 34460 34461 ${items.length ? o$1(items, (item) => { 34462 const filterName2 = "ids_" + this.vocabulary; 34463 if (this.onlyFilter && "filter" in item && item?.filter === false) { 34464 return A$1; 34465 } 34466 return b$1`<sonic-menu-item radio size="sm" value="${item?.id || ""}" name="${filterName2}" 34467 >${item?.title}</sonic-menu-item 34468 >`; 34469 }) : A$1} 34470 </sonic-menu> 34471 </sonic-pop>`; 34472 } 34473 }; 34474 EventFilterTaxonomy.styles = [tailwind]; 34475 __decorateClass$2R([ 34476 n$5({ type: Boolean }) 34477 ], EventFilterTaxonomy.prototype, "hasTerm", 2); 34478 __decorateClass$2R([ 34479 n$5({ type: String }) 34480 ], EventFilterTaxonomy.prototype, "vocabulary", 2); 34481 __decorateClass$2R([ 34482 n$5({ type: String }) 34483 ], EventFilterTaxonomy.prototype, "defaultTitle", 2); 34484 __decorateClass$2R([ 34485 n$5({ type: String }) 34486 ], EventFilterTaxonomy.prototype, "icon", 2); 34487 __decorateClass$2R([ 34488 n$5({ type: Boolean }) 34489 ], EventFilterTaxonomy.prototype, "onlyFilter", 2); 34490 EventFilterTaxonomy = __decorateClass$2R([ 34491 t$3(tagName$1J) 34492 ], EventFilterTaxonomy); 34493 var __defProp$2N = Object.defineProperty; 34494 var __getOwnPropDesc$2Q = Object.getOwnPropertyDescriptor; 34495 var __decorateClass$2Q = (decorators, target, key, kind) => { 34496 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2Q(target, key) : target; 34497 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 34498 if (decorator = decorators[i2]) 34499 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 34500 if (kind && result) __defProp$2N(target, key, result); 34501 return result; 34502 }; 34503 const tagName$1I = "sonic-event-selection-filters"; 34504 let EventSelectionFilters = class extends Subscriber$1(i$6) { 34505 constructor() { 34506 super(...arguments); 34507 this.category = false;
34508 this.range = false; 34509 this.activity = false; 34510 this.text = false; 34511 this.reservationRequestConfigs = false; 34512 this.waitingLists = false; 34513 this.forTreatment = false; 34514 this.onlyFilter = false; 34515 this.canFilterDays = false; 34516 this.entityType = EntityType.Event; 34517 this.hasActiveFilter = false; 34518 this.hasSearch = false; 34519 this.counterFilterByDay = false; 34520 this.form = null; 34521 this.checkIfActiveFilter = () => { 34522 if (!this.form) return; 34523 if (this.waitingLists) { 34524 this.form.has_waiting_list_request.set(true); 34525 } else if (this.reservationRequestConfigs) { 34526 this.form.has_reservation_request.set(true); 34527 } 34528 if (this.forTreatment) { 34529 this.form.for_treatment.set(true); 34530 } 34531 const formData = this.form.get(); 34532 if (formData.search?.length > 0) { 34533 this.hasActiveFilter = true; 34534 this.hasSearch = true; 34535 return; 34536 } else { 34537 this.hasSearch = false; 34538 } 34539 const filterKeys = ["ids_category", "ids_activity", "ids_range"]; 34540 this.hasActiveFilter = filterKeys.some((key) => { 34541 const value = formData[key]; 34542 const isArray = Array.isArray(value); 34543 if (isArray) { 34544 const hasItemsArray = value.length > 0; 34545 if (hasItemsArray) { 34546 return true; 34547 } else { 34548 return false; 34549 } 34550 } 34551 if (value !== null && value !== void 0 && value !== "") { 34552 return true; 34553 } 34554 return false; 34555 }); 34556 }; 34557 this.today = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3); 34558 this.resetFilterOnSearch = (searchValue) => { 34559 if (searchValue && searchValue.length > 0 && this.form) { 34560 this.form.ids_category = []; 34561 this.form.ids_activity = []; 34562 this.form.ids_range = []; 34563 } 34564 }; 34565 this.reservationRequestConfigsOptions = []; 34566 this.initReservationRequestConfigsOptions = async () => { 34567 const api2 = new API(this.getApiConfiguration()); 34568 const result = await api2.get("reservation-request-config"); 34569 const isSuccess = result.success ?? false; 34570 if (isSuccess) { 34571 const data = result.data; 34572 const options = data.map((config) => ({ 34573 value: config.id?.toString() || "", 34574 wording: config.edito?.title || "" 34575 })); 34576 this.reservationRequestConfigsOptions = [ 34577 { 34578 value: "", 34579 wording: "Toutes les demandes" 34580 }, 34581 ...options 34582 ]; 34583 } 34584 }; 34585 } 34586 connectedCallback() { 34587 const formDataProvider = this.getAttribute("formDataProvider") || "filterEventSelection"; 34588 this.form = PublisherManager.get(formDataProvider); 34589 if (this.form) { 34590 this.form.onInternalMutation(this.checkIfActiveFilter); 34591 this.form.search.onAssign(this.resetFilterOnSearch); 34592 if (this.waitingLists) { 34593 this.form.has_waiting_list_request.set(true); 34594 } else if (this.reservationRequestConfigs) { 34595 this.form.has_reservation_request.set(true); 34596 } 34597 if (this.forTreatment) { 34598 this.form.for_treatment.set(true); 34599 } 34600 } 34601 super.connectedCallback(); 34602 } 34603 disconnectedCallback() { 34604 if (this.form) { 34605 this.form.search.offAssign(this.resetFilterOnSearch); 34606 this.form.offInternalMutation(this.checkIfActiveFilter); 34607 } 34608 super.disconnectedCallback(); 34609 } 34610 willUpdate(_changedProperties) { 34611 if (_changedProperties.has("reservationRequestConfigs") && this.reservationRequestConfigs) { 34612 this.initReservationRequestConfigsOptions(); 34613 } 34614 } 34615 renderReservationRequestConfigsFilter() { 34616 if (!this.reservationRequestConfigsOptions.length || !this.reservationRequestConfigs) return A$1; 34617 return b$1`<sonic-select 34618 name="campaign_id" 34619 .options=${this.reservationRequestConfigsOptions} 34620 class="w-[13rem]" 34621 ></sonic-select>`; 34622 } 34623 render() { 34624 const displayFilterDays = this.canFilterDays && this.counterFilterByDay && this.entityType === EntityType.Event; 34625 return b$1` 34626 <div class="flex gap-2 flex-wrap max-w-[50rem]"> 34627 <sonic-input 34628 class="grow" 34629 inlineContent 34630 type="search" 34631 name="search" 34632 placeholder="Rechercher..." 34633 value="" 34634 autocomplete="off" 34635 autoActive 34636 > 34637 <sonic-icon name="magnifying-glass" library="custom" slot="prefix"></sonic-icon> 34638 </sonic-input> 34639 34640 <div class="inline-flex gap-2"> 34641 ${this.renderReservationRequestConfigsFilter()} 34642 ${this.category ? b$1`<sonic-event-filter-taxonomy 34643 dataProvider="event_filter_category" 34644 vocabulary="category" 34645 ?onlyFilter=${this.onlyFilter} 34646 ></sonic-event-filter-taxonomy>` : A$1} 34647 ${this.range ? b$1`<sonic-event-filter-taxonomy 34648 dataProvider="event_filter_range" 34649 vocabulary="range" 34650 ></sonic-event-filter-taxonomy>` : A$1} 34651 ${this.activity ? b$1`<sonic-event-filter-taxonomy 34652 dataProvider="event_filter_activity" 34653 vocabulary="activity" 34654 ></sonic-event-filter-taxonomy>` : A$1}
34655 <sonic-divider 34656 vertical 34657 class="${this.hasActiveFilter ? "opacity-100" : "opacity-0 pointer-events-none"}" 34658 ></sonic-divider> 34659 <sonic-button 34660 variant="ghost" 34661 shape="circle" 34662 class="-ml-2 transition ease-linear ${this.hasActiveFilter ? "opacity-100 scale-100 " : "opacity-0 scale-50 -rotate-45 "}" 34663 reset 34664 ><sonic-icon name="arrow-rotate-left" library="custom" prefix="solid"></sonic-icon 34665 ></sonic-button> 34666 </div> 34667 </div> 34668 <!-- Days --> 34669 ${displayFilterDays ? b$1`<sonic-fetch 34670 dataProvider="events/filters/days?from=${this.today}" 34671 class="block w-full min-w-0 min-h-[3rem]" 34672 key="data" 34673 > 34674 <sonic-form-event-days></sonic-form-event-days 34675 ></sonic-fetch>` : A$1} 34676 `; 34677 } 34678 }; 34679 EventSelectionFilters.styles = [tailwind]; 34680 __decorateClass$2Q([ 34681 n$5({ type: Boolean }) 34682 ], EventSelectionFilters.prototype, "category", 2); 34683 __decorateClass$2Q([ 34684 n$5({ type: Boolean }) 34685 ], EventSelectionFilters.prototype, "range", 2); 34686 __decorateClass$2Q([ 34687 n$5({ type: Boolean }) 34688 ], EventSelectionFilters.prototype, "activity", 2); 34689 __decorateClass$2Q([ 34690 n$5({ type: Boolean }) 34691 ], EventSelectionFilters.prototype, "text", 2); 34692 __decorateClass$2Q([ 34693 n$5({ type: Boolean }) 34694 ], EventSelectionFilters.prototype, "reservationRequestConfigs", 2); 34695 __decorateClass$2Q([ 34696 n$5({ type: Boolean }) 34697 ], EventSelectionFilters.prototype, "waitingLists", 2); 34698 __decorateClass$2Q([ 34699 n$5({ type: Boolean }) 34700 ], EventSelectionFilters.prototype, "forTreatment", 2); 34701 __decorateClass$2Q([ 34702 n$5({ type: Boolean }) 34703 ], EventSelectionFilters.prototype, "onlyFilter", 2); 34704 __decorateClass$2Q([ 34705 n$5({ type: Boolean }) 34706 ], EventSelectionFilters.prototype, "canFilterDays", 2); 34707 __decorateClass$2Q([ 34708 n$5({ type: String }) 34709 ], EventSelectionFilters.prototype, "entityType", 2); 34710 __decorateClass$2Q([ 34711 r$5() 34712 ], EventSelectionFilters.prototype, "hasActiveFilter", 2); 34713 __decorateClass$2Q([ 34714 r$5() 34715 ], EventSelectionFilters.prototype, "hasSearch", 2); 34716 __decorateClass$2Q([ 34717 bind$1("settings.store_ui.event.filter_by_day"), 34718 r$5() 34719 ], EventSelectionFilters.prototype, "counterFilterByDay", 2); 34720 __decorateClass$2Q([ 34721 r$5() 34722 ], EventSelectionFilters.prototype, "reservationRequestConfigsOptions", 2); 34723 EventSelectionFilters = __decorateClass$2Q([ 34724 t$3(tagName$1I) 34725 ], EventSelectionFilters); 34726 var __defProp$2M = Object.defineProperty; 34727 var __getOwnPropDesc$2P = Object.getOwnPropertyDescriptor; 34728 var __decorateClass$2P = (decorators, target, key, kind) => { 34729 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2P(target, key) : target; 34730 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 34731 if (decorator = decorators[i2]) 34732 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 34733 if (kind && result) __defProp$2M(target, key, result); 34734 return result; 34735 }; 34736 let instanceCounter$c = 0; 34737 let SonicEventSelector = class extends i$6 { 34738 constructor() { 34739 super(...arguments); 34740 this.id = ""; 34741 this.formDataProvider = "eventSelection" + instanceCounter$c++; 34742 this.excludeCurrent = false; 34743 this.selectedIds = []; 34744 this.subscriptionTypeIds = []; 34745 this.subscriptionPriceIds = []; 34746 this.searchFormDataProvider = "searchFormDataProvider/eventSelection" + instanceCounter$c++; 34747 this.selectSession = (id) => { 34748 const event = new CustomEvent("select", { 34749 detail: { id, entity_type: EntityType.Event } 34750 }); 34751 this.pushId(id); 34752 this.dispatchEvent(event); 34753 }; 34754 this.unselectSession = (id) => { 34755 const event = new CustomEvent("unselect", { 34756 detail: { id, entity_type: EntityType.Event } 34757 }); 34758 this.removeId(id); 34759 this.dispatchEvent(event); 34760 }; 34761 this.removeId = (id) => { 34762 if (this.selectedIds.includes(id)) { 34763 this.selectedIds = this.selectedIds.filter((item) => item !== id); 34764 } 34765 }; 34766 this.pushId = (id) => { 34767 if (!this.selectedIds.includes(id)) { 34768 this.selectedIds.push(id); 34769 } 34770 }; 34771 this.itemsMarkup = (session) => { 34772 if (!session.id) return A$1; 34773 const isSelected = this.selectedIds.includes(Number(session.id)); 34774 return b$1`<sonic-button
34775 class="block w-full rounded-md hover:bg-neutral-50 mb-3" 34776 variant="unstyled" 34777 @click=${() => isSelected ? this.unselectSession(Number(session.id)) : this.selectSession(Number(session.id))} 34778 > 34779 <sonic-product-summary size="sm" .featureDisplay=${[ProductDisplay.Status, ProductDisplay.Range]}> 34780 ${isSelected ? b$1`<sonic-button slot="actions" noAutoFill class="group" shape="circle" size="sm" icon> 34781 <sonic-icon name="check" library="custom"></sonic-icon> 34782 </sonic-button>` : A$1} 34783 </sonic-product-summary> 34784 </sonic-button>`; 34785 }; 34786 this.noResultMarkup = () => { 34787 return b$1`<sonic-no-result size="md"></sonic-no-result>`; 34788 }; 34789 } 34790 render() { 34791 const queueEndpoint = entityEndPoint({ 34792 entityType: EntityType.Event, 34793 accessParams: this.accessParams, 34794 view: entityView.essential, 34795 features: [Feature.Status], 34796 isQueue: true, 34797 next: true, 34798 subscriptionTypeIds: this.subscriptionTypeIds, 34799 subscriptionPriceIds: this.subscriptionPriceIds, 34800 excludedIds: this.excludeCurrent ? [Number(this.id)] : [] 34801 }); 34802 return b$1` 34803 ${this.id ? b$1` 34804 <sonic-fetch 34805 dataProvider="${entityEndPoint({ 34806 entityType: EntityType.Event, 34807 entityId: Number(this.id), 34808 accessParams: this.accessParams, 34809 view: entityView.essential, 34810 features: [Feature.Status] 34811 })}" 34812 key="data" 34813 > 34814 <sonic-product-summary 34815 data-id=${this.id} 34816 size="lg" 34817 .featureDisplay=${[ProductDisplay.Status, ProductDisplay.Range]} 34818 ></sonic-product-summary> 34819 </sonic-fetch> 34820 <sonic-divider class="my-3"></sonic-divider> 34821 ` : A$1} 34822 34823 <div id="formContainer" class="mb-4"> 34824 <sonic-event-selection-filters 34825 formDataProvider="${this.searchFormDataProvider}" 34826 class=" block max-w-[40rem] w-full z-10 " 34827 category 34828 activity 34829 range 34830 ></sonic-event-selection-filters> 34831 </div> 34832 34833 <sonic-queue 34834 dataProviderExpression="${queueEndpoint}" 34835 key="data" 34836 limit="5" 34837 targetRequestDuration="1000" 34838 dataFilterProvider="${this.searchFormDataProvider}" 34839 .items=${this.itemsMarkup} 34840 .noItems=${this.noResultMarkup} 34841 > 34842 </sonic-queue> 34843 `; 34844 } 34845 }; 34846 SonicEventSelector.styles = [tailwind]; 34847 __decorateClass$2P([ 34848 n$5({ type: String, attribute: "data-id" }) 34849 ], SonicEventSelector.prototype, "id", 2); 34850 __decorateClass$2P([ 34851 n$5({ type: String }) 34852 ], SonicEventSelector.prototype, "formDataProvider", 2); 34853 __decorateClass$2P([ 34854 n$5({ type: Boolean }) 34855 ], SonicEventSelector.prototype, "excludeCurrent", 2); 34856 __decorateClass$2P([ 34857 n$5({ type: Array }) 34858 ], SonicEventSelector.prototype, "selectedIds", 2); 34859 __decorateClass$2P([ 34860 n$5({ type: Array }) 34861 ], SonicEventSelector.prototype, "subscriptionTypeIds", 2); 34862 __decorateClass$2P([ 34863 n$5({ type: Array }) 34864 ], SonicEventSelector.prototype, "subscriptionPriceIds", 2); 34865 __decorateClass$2P([ 34866 c({ context: accessParamsContext, subscribe: true }), 34867 e$2({ context: accessParamsContext }), 34868 n$5({ type: Object }) 34869 ], SonicEventSelector.prototype, "accessParams", 2); 34870 SonicEventSelector = __decorateClass$2P([ 34871 t$3("sonic-event-selector") 34872 ], SonicEventSelector); 34873 var __defProp$2L = Object.defineProperty; 34874 var __getOwnPropDesc$2O = Object.getOwnPropertyDescriptor; 34875 var __decorateClass$2O = (decorators, target, key, kind) => { 34876 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2O(target, key) : target; 34877 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 34878 if (decorator = decorators[i2]) 34879 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 34880 if (kind && result) __defProp$2L(target, key, result); 34881 return result; 34882 }; 34883 const tagName$1H = "sonic-session-selector"; 34884 let SonicSessionSelector = class extends i$6 { 34885 constructor() { 34886 super(...arguments); 34887 this.id = ""; 34888 this.subscriptionTypeIds = []; 34889 this.subscriptionPriceIds = []; 34890 this.markupNoItem = () => { 34891 return b$1`<sonic-no-result size="sm" class="my-8 mx-4"></sonic-no-result>`; 34892 }; 34893 this.dispatch = (id) => {
34894 if (!id || id == Number(this.id)) return; 34895 const event = new CustomEvent("select", { 34896 detail: { id, entity_type: EntityType.Event } 34897 }); 34898 this.dispatchEvent(event); 34899 }; 34900 this.markupItems = (item) => { 34901 const itemId = Number(item.id); 34902 if (!itemId) return A$1; 34903 const isActive = Number(this.id) === Number(itemId); 34904 return b$1` 34905 <sonic-button 34906 class="w-full gap-x-4 rounded-md hover:bg-neutral-50 group @container [&[active]]:pointer-events-none" 34907 variant="unstyled" 34908 value=${itemId} 34909 @click=${() => this.dispatch(itemId)} 34910 > 34911 <div class="flex items-center w-full"> 34912 <div class="py-2 px-2 @lg:px-4 grow "> 34913 <div class="flex items-center"> 34914 <sonic-date class="text-base @lg:text-lg font-bold" noShadowDom> </sonic-date> 34915 </div> 34916 <div class="mt-px flex items-center flex-wrap gap-x-5 gap-y-1 text-xs"> 34917 <sonic-event-location-hall noPlacement class="block text-neutral-500"></sonic-event-location-hall> 34918 ${item?.labels && item?.labels?.length > 0 ? b$1` <sonic-event-taxonomy 34919 .taxonomy=${item?.labels} 34920 key="label" 34921 size="inherit" 34922 class="inline-flex" 34923 ></sonic-event-taxonomy>` : A$1} 34924 ${itemId ? ( 34925 // on ne passe pas les accessParams 34926 // car on veut les statuts sans bypass des accessParams 34927 b$1`<sonic-event-additional-status 34928 dataProvider="${entityEndPoint({ 34929 entityType: EntityType.Event, 34930 entityId: itemId, 34931 view: entityView.status, 34932 ...this.appType !== "counter" ? { accessParams: this.accessParams } : {} 34933 })}" 34934 fetch 34935 size="inherit" 34936 class="flex flex-wrap gap-x-3 gap-y-1" 34937 variant="ghost" 34938 key="data" 34939 ></sonic-event-additional-status>` 34940 ) : A$1} 34941 </div> 34942 </div> 34943 ${isActive ? b$1`<sonic-icon 34944 name="circle-check" 34945 library="custom" 34946 prefix="solid" 34947 slot="suffix" 34948 class="mr-2 text-2xl" 34949 ></sonic-icon>` : A$1} 34950 </div> 34951 </sonic-button> 34952 <sonic-divider noMargin></sonic-divider> 34953 `; 34954 }; 34955 } 34956 render() { 34957 if (!this.id) return A$1; 34958 return b$1` 34959 <sonic-fetch 34960 dataProvider="${entityEndPoint({ 34961 entityType: "show", 34962 entityId: Number(this.id), 34963 next: true, 34964 accessParams: this.accessParams, 34965 subscriptionTypeIds: this.subscriptionTypeIds, 34966 subscriptionPriceIds: this.subscriptionPriceIds 34967 })}" 34968 key="data" 34969 > 34970 <sonic-product-summary></sonic-product-summary> 34971 <sonic-divider class="mt-4 mb-1"></sonic-divider> 34972 <sonic-list 34973 class="grid grid-cols-1 gap-1" 34974 subDataProvider="sessions" 34975 .items=${this.markupItems} 34976 .noItems=${this.markupNoItem} 34977 > 34978 </sonic-list> 34979 </sonic-fetch> 34980 `; 34981 } 34982 }; 34983 SonicSessionSelector.styles = [tailwind]; 34984 __decorateClass$2O([ 34985 n$5({ type: String, attribute: "data-id" }) 34986 ], SonicSessionSelector.prototype, "id", 2); 34987 __decorateClass$2O([ 34988 n$5({ type: Array }) 34989 ], SonicSessionSelector.prototype, "subscriptionTypeIds", 2); 34990 __decorateClass$2O([ 34991 n$5({ type: Array }) 34992 ], SonicSessionSelector.prototype, "subscriptionPriceIds", 2); 34993 __decorateClass$2O([ 34994 c({ context: accessParamsContext, subscribe: true }), 34995 e$2({ context: accessParamsContext }), 34996 n$5({ type: Object }) 34997 ], SonicSessionSelector.prototype, "accessParams", 2); 34998 __decorateClass$2O([ 34999 c({ context: appType, subscribe: true }), 35000 n$5({ type: String }) 35001 ], SonicSessionSelector.prototype, "appType", 2); 35002 SonicSessionSelector = __decorateClass$2O([ 35003 t$3(tagName$1H) 35004 ], SonicSessionSelector); 35005 function canEditPrice(mode2, entityType) { 35006 return mode2 === "default" && entityType !== EntityType.AdditionalProduct && entityType !== EntityType.Subscribe; 35007 } 35008 function canChangeEventSession(cartType, cartProvider) { 35009 return cartType !== "order" && cartProvider !== "cart/current"; 35010 } 35011 function sessionHasSeatmap(session) { 35012 return !!session?.room && ["place", "mixte"].includes(session.room.placing_type_key || ""); 35013 } 35014 function canShowSeatmapActions(accessParams, session) { 35015 const isRequestOrCampaign = getAccessType(accessParams) === AccessType.RESERVATION_REQUEST || getAccessType(accessParams) === AccessType.CAMPAIGN; 35016 return !isRequestOrCampaign && sessionHasSeatmap(session); 35017 } 35018 function isMultiSessionEntity(entity) { 35019 return !!entity && "multisession" in entity && !!entity.multisession; 35020 }
35021 function getSessionFromCart(cartProvider, entityId) { 35022 if (!entityId) return void 0; 35023 const entities = dp(cartProvider).data.entities.get(); 35024 return entities?.find((entity) => isSession(entity) && Number(entity.id) === entityId); 35025 } 35026 function isMultiSessionLineItem(cartProvider, item) { 35027 if (item.multisession_id) return true; 35028 return isMultiSessionEntity(getSessionFromCart(cartProvider, item.entity_id)); 35029 } 35030 function buildLineGroupQuery(items) { 35031 const first = items[0]; 35032 if (!first) return void 0; 35033 const { entity_type, entity_id, price, quota, parent_id } = first; 35034 const { id, amount } = price || {}; 35035 return { 35036 entity_type, 35037 entity_id, 35038 price: { id, amount }, 35039 quota, 35040 parent_id: parent_id || "null" 35041 }; 35042 } 35043 function buildEntityChangeQuery(firstItem) { 35044 return { 35045 parent_id: firstItem.parent_id || "null", 35046 entity_type: firstItem.entity_type, 35047 entity_id: firstItem.entity_id 35048 }; 35049 } 35050 function buildDetailRemoveQuery(itemId) { 35051 return { ids: [itemId] }; 35052 } 35053 function getSubscriptionFilterFromLineItems(lineItems, cartProvider) { 35054 const firstItem = lineItems[0]; 35055 if (!firstItem) { 35056 return { subscriptionTypeIds: [], subscriptionPriceIds: [] }; 35057 } 35058 const parentSubscription = getParentItem(firstItem, cartProvider); 35059 if (!parentSubscription?.entity_id) { 35060 return { subscriptionTypeIds: [], subscriptionPriceIds: [] }; 35061 } 35062 return { 35063 subscriptionTypeIds: [parentSubscription.entity_id.toString()], 35064 subscriptionPriceIds: parentSubscription.price?.id ? [Number(parentSubscription.price.id)] : [] 35065 }; 35066 } 35067 async function changeCartItemEvent(options) { 35068 const result = await Cart.set({ 35069 apiConfiguration: options.api.getApiConfiguration(), 35070 cartProvider: options.cartProvider, 35071 body: { entity_id: options.entity_id, entity_type: options.entity_type }, 35072 query: options.query 35073 }); 35074 if (result === "asRequested") { 35075 options.modal?.hide(); 35076 } 35077 } 35078 function removeCartItems(api2, cartProvider, query) { 35079 return Cart.removeItems({ 35080 apiConfiguration: api2.getApiConfiguration(), 35081 cartProvider, 35082 query 35083 }); 35084 } 35085 function openChangeEventModal(options) { 35086 const subscriptionFilter = getSubscriptionFilterFromLineItems(options.lineItems, options.cartProvider); 35087 return Modal.create({ 35088 title: t("change_event"), 35089 content: withAccessParams( 35090 options.accessParams, 35091 b$1`<sonic-event-selector 35092 .id=${options.lineItems[0].entity_id} 35093 excludeCurrent 35094 .subscriptionTypeIds=${subscriptionFilter.subscriptionTypeIds} 35095 .subscriptionPriceIds=${subscriptionFilter.subscriptionPriceIds} 35096 @select=${(event) => options.onSelect(event.detail.id, event.detail.entity_type)} 35097 ></sonic-event-selector>` 35098 ), 35099 maxWidth: "60rem", 35100 removeOnHide: true 35101 }); 35102 } 35103 function openChangeSessionModal(options) { 35104 const subscriptionFilter = getSubscriptionFilterFromLineItems(options.lineItems, options.cartProvider); 35105 return Modal.create({ 35106 title: t("change_session"), 35107 content: withAccessParams( 35108 options.accessParams, 35109 b$1`<sonic-session-selector 35110 data-id=${options.lineItems[0].entity_id} 35111 .subscriptionTypeIds=${subscriptionFilter.subscriptionTypeIds} 35112 .subscriptionPriceIds=${subscriptionFilter.subscriptionPriceIds} 35113 @select=${(event) => options.onSelect(event.detail.id, event.detail.entity_type)} 35114 ></sonic-session-selector>` 35115 ), 35116 maxWidth: "60rem", 35117 removeOnHide: true 35118 }); 35119 } 35120 function menuIcon(name) { 35121 return b$1`<sonic-icon name=${name} library="custom" slot="prefix"></sonic-icon>`; 35122 } 35123 function menuLabel(label2) { 35124 return b$1`<span>${label2}</span>`; 35125 } 35126 function renderChangeEventSessionItems(options) { 35127 const { ctx, lineItems, query, api: api2, isMultiSession } = options; 35128 if (!canChangeEventSession(ctx.cartType, ctx.cartProvider)) return A$1; 35129 if (lineItems[0]?.entity_type !== EntityType.Event) return A$1; 35130 let modal; 35131 const onSelect = (entity_id, entity_type) => changeCartItemEvent({ api: api2, cartProvider: ctx.cartProvider, query, entity_id, entity_type, modal }); 35132 return b$1` 35133 <sonic-menu-item @click=${() => modal = openChangeEventModal({ accessParams: ctx.accessParams, cartProvider: ctx.cartProvider, lineItems, onSelect })}> 35134 ${menuIcon("calendars")} ${menuLabel(t("change_event"))} 35135 </sonic-menu-item> 35136 ${isMultiSession ? b$1`<sonic-menu-item 35137 @click=${() => modal = openChangeSessionModal({ accessParams: ctx.accessParams, cartProvider: ctx.cartProvider, lineItems, onSelect })} 35138 > 35139 ${menuIcon("calendar-day")} ${menuLabel(t("change_session"))} 35140 </sonic-menu-item>` : A$1}
35141 <sonic-divider></sonic-divider> 35142 `; 35143 } 35144 function renderEditPriceItem(ctx, lineItems) { 35145 return b$1` 35146 <sonic-menu-item 35147 noAutoFill 35148 @click=${() => editPriceModal({ 35149 lineItems, 35150 cartProvider: ctx.cartProvider, 35151 accessParams: ctx.accessParams 35152 })} 35153 > 35154 ${menuIcon("circle-euro")} ${menuLabel(t("edit_price"))} 35155 </sonic-menu-item> 35156 <sonic-divider></sonic-divider> 35157 `; 35158 } 35159 function renderSeatmapMenuItems(ctx, sessionId) { 35160 if (!sessionId) return A$1; 35161 const priceContext = { entityId: sessionId, entityType: EntityType.Event }; 35162 return b$1` 35163 <sonic-menu-item 35164 noAutoFill 35165 @click=${() => addSeatsModal({ 35166 cartProvider: ctx.cartProvider, 35167 navigationMode: "cart", 35168 priceContext, 35169 accessParams: ctx.accessParams 35170 })} 35171 > 35172 ${menuIcon("loveseat")} ${menuLabel(t("add_tickets_with_seating"))} 35173 </sonic-menu-item> 35174 <sonic-menu-item 35175 noAutoFill 35176 @click=${() => editSeatsModal({ 35177 cartProvider: ctx.cartProvider, 35178 priceContext, 35179 accessParams: ctx.accessParams 35180 })} 35181 > 35182 ${menuIcon("arrow-right-arrow-left")} ${menuLabel(t("edit_selected_seats"))} 35183 </sonic-menu-item> 35184 `; 35185 } 35186 function renderAddTicketsItem(ctx, sessionId) { 35187 return b$1` 35188 <sonic-menu-item 35189 @click=${() => addTicketsModal({ id: sessionId, cartProvider: ctx.cartProvider, accessParams: ctx.accessParams })} 35190 > 35191 ${menuIcon("ticket")} ${menuLabel(t("add_tickets"))} 35192 </sonic-menu-item> 35193 <sonic-divider></sonic-divider> 35194 `; 35195 } 35196 function renderEditOwnerItem(item, cartProvider, needSubscription) { 35197 const icon2 = needSubscription ? "id-card" : "face-smile"; 35198 return b$1` 35199 <sonic-menu-item noAutoFill @click=${() => attachOwnerModal({ items: [item], cartProvider })}> 35200 ${menuIcon(icon2)} ${menuLabel(t("edit_owner"))} 35201 </sonic-menu-item> 35202 `; 35203 } 35204 function canEditSubscriptionPrice(cartType) { 35205 return cartType !== "cart"; 35206 } 35207 function renderEditSubscriptionOwnerItem(ctx, item) { 35208 return b$1` 35209 <sonic-menu-item 35210 @click=${() => editSubscriptionOwnerModal({ 35211 lineItem: item, 35212 cartProvider: ctx.cartProvider 35213 })} 35214 > 35215 ${menuIcon("id-card")} ${menuLabel(t("edit_owner"))} 35216 </sonic-menu-item> 35217 `; 35218 } 35219 function renderEditSubscriptionPriceItem(ctx, item) { 35220 return b$1` 35221 <sonic-menu-item @click=${() => editSubscriptionPriceModal({ lineItem: item, cartProvider: ctx.cartProvider })}> 35222 ${menuIcon("circle-euro")} ${menuLabel(t("edit_price"))} 35223 </sonic-menu-item> 35224 `; 35225 } 35226 function renderEventsChoiceItem(ctx, subscriptionItemId) { 35227 return b$1` 35228 <sonic-menu-item 35229 @click=${() => quickSelectModal({ 35230 cartProvider: ctx.cartProvider, 35231 selectedSubscriptionId: subscriptionItemId, 35232 accessParams: ctx.accessParams 35233 })} 35234 > 35235 ${menuIcon("calendar-check")} ${menuLabel(t("events_choice"))} 35236 </sonic-menu-item> 35237 `; 35238 } 35239 function renderAddProofItem(ctx, item) { 35240 return b$1` 35241 <sonic-menu-item 35242 @click=${() => addProofModal({ lineItem: item, cartProvider: ctx.cartProvider })} 35243 > 35244 ${menuIcon("file-arrow-up")} ${menuLabel(t("LIB_add_proof"))} 35245 </sonic-menu-item> 35246 `; 35247 } 35248 function renderUnlinkItem(options) { 35249 return b$1` 35250 <sonic-divider></sonic-divider> 35251 <sonic-menu-item 35252 noAutoFill 35253 ?disabled=${!options.canDetach} 35254 @click=${() => Cart.patchItems({ 35255 apiConfiguration: options.api.getApiConfiguration(), 35256 cartProvider: options.cartProvider, 35257 query: { ids: [options.itemId] }, 35258 body: { parent_id: "" } 35259 })} 35260 > 35261 ${menuIcon("link-slash")} ${menuLabel(t("unlink"))} 35262 </sonic-menu-item> 35263 `; 35264 } 35265 function renderRemoveMenuItem(onRemove, withDivider = false) { 35266 return b$1` 35267 ${withDivider ? b$1`<sonic-divider></sonic-divider>` : A$1} 35268 <sonic-menu-item @click=${onRemove} noAutoFill type="danger"> 35269 ${menuIcon("trash")} ${menuLabel(t("LIB_remove"))} 35270 </sonic-menu-item> 35271 `; 35272 } 35273 function renderTrashButton(onRemove) { 35274 return b$1` 35275 <sonic-button 35276 class="mr-auto" 35277 variant="ghost" 35278 shape="circle" 35279 size="sm" 35280 icon 35281 @click=${onRemove} 35282 data-aria-label=${t("LIB_remove")} 35283 noAutoFill 35284 > 35285 <sonic-icon name="trash" library="custom"></sonic-icon> 35286 </sonic-button> 35287 `; 35288 } 35289 function renderActionMenuShell(options) { 35290 const { triggerIcon, triggerVariant, menuMinWidth, menuItems, trashButton } = options; 35291 return b$1` 35292 ${trashButton ?? A$1} 35293 <sonic-pop class=${trashButton ? "ml-auto" : A$1} placement="bottom"> 35294 <sonic-button shape="circle" variant=${triggerVariant ?? A$1} size="sm" icon noAutoFill> 35295 <sonic-icon 35296 name=${triggerIcon} 35297 library="custom" 35298 size=${triggerIcon === "ellipsis-vertical" ? "lg" : A$1} 35299 ></sonic-icon> 35300 </sonic-button> 35301 <sonic-menu slot="content" size="sm" minWidth=${menuMinWidth}>${menuItems}</sonic-menu> 35302 </sonic-pop> 35303 `; 35304 } 35305 var __defProp$2K = Object.defineProperty; 35306 var __getOwnPropDesc$2N = Object.getOwnPropertyDescriptor; 35307 var __decorateClass$2N = (decorators, target, key, kind) => { 35308 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2N(target, key) : target; 35309 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 35310 if (decorator = decorators[i2]) 35311 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 35312 if (kind && result) __defProp$2K(target, key, result); 35313 return result; 35314 }; 35315 const tagName$1G = "sonic-cart-item-header-actions"; 35316 let SonicCartItemHeaderActions = class extends Subscriber$1(i$6) { 35317 constructor() { 35318 super(...arguments); 35319 this.mode = "default"; 35320 this.entity = {}; 35321 this.hash = ""; 35322 this.items = null; 35323 this.cartProvider = "cart/current"; 35324 } 35325 get actionContext() { 35326 return { 35327 cartProvider: this.cartProvider, 35328 accessParams: this.accessParams, 35329 cartType: this.cartType 35330 }; 35331 } 35332 render() {
35333 const isCondensed = this.layout === "condensed"; 35334 if (this.mode == "readonly" || !this.items?.length) { 35335 return A$1; 35336 } 35337 if ((this.mode == "split" || this.mode == "splitResult") && this.items.length) { 35338 return b$1`<sonic-cart-move-items-button 35339 .lineItems=${this.items} 35340 .size=${isCondensed ? "sm" : "md"} 35341 ></sonic-cart-move-items-button>`; 35342 } 35343 return this.renderActionMenu(); 35344 } 35345 renderActionMenu() { 35346 if (!this.items?.length) return A$1; 35347 const eventMenu = this.entity?.entity_type === EntityType.Event ? this.renderEventMenu(this.entity, this.items) : A$1; 35348 return renderActionMenuShell({ 35349 triggerIcon: "ellipsis-vertical", 35350 triggerVariant: "ghost", 35351 menuMinWidth: "13rem", 35352 menuItems: b$1` 35353 ${eventMenu} 35354 ${renderRemoveMenuItem(() => this.removeEntityTickets())} 35355 ` 35356 }); 35357 } 35358 renderEventMenu(entity, items) { 35359 if (entity.entity_type !== EntityType.Event || !entity.id) { 35360 return A$1; 35361 } 35362 const ctx = this.actionContext; 35363 const sessionId = parseInt(entity.id.toString()); 35364 const showSeatmapActions = canShowSeatmapActions(ctx.accessParams, entity); 35365 return b$1` 35366 ${renderChangeEventSessionItems({ 35367 ctx, 35368 lineItems: items, 35369 query: buildEntityChangeQuery(items[0]), 35370 api: this, 35371 isMultiSession: isMultiSessionEntity(entity) 35372 })} 35373 ${showSeatmapActions ? renderSeatmapMenuItems(ctx, sessionId) : renderAddTicketsItem(ctx, sessionId)} 35374 `; 35375 } 35376 removeEntityTickets() { 35377 if (!this.cartProvider) return; 35378 const entity_id = parseInt(this.props?.entity.id?.toString() || ""); 35379 const entity_type = this.props?.entity.entity_type; 35380 removeCartItems(this, this.cartProvider, { entity_id, entity_type, parent_id: "null" }); 35381 } 35382 }; 35383 SonicCartItemHeaderActions.styles = [tailwind]; 35384 __decorateClass$2N([ 35385 c({ context: layoutContext, subscribe: true }), 35386 n$5({ type: String }) 35387 ], SonicCartItemHeaderActions.prototype, "layout", 2); 35388 __decorateClass$2N([ 35389 c({ context: modeContext, subscribe: true }), 35390 n$5({ type: String }) 35391 ], SonicCartItemHeaderActions.prototype, "mode", 2); 35392 __decorateClass$2N([ 35393 c({ context: appType, subscribe: true }), 35394 n$5({ type: String }) 35395 ], SonicCartItemHeaderActions.prototype, "appType", 2); 35396 __decorateClass$2N([ 35397 c({ context: cartTypeContext, subscribe: true }), 35398 n$5({ type: String }) 35399 ], SonicCartItemHeaderActions.prototype, "cartType", 2); 35400 __decorateClass$2N([ 35401 c({ context: accessParamsContext, subscribe: true }), 35402 n$5({ type: Object }) 35403 ], SonicCartItemHeaderActions.prototype, "accessParams", 2); 35404 __decorateClass$2N([ 35405 n$5({ type: Object }) 35406 ], SonicCartItemHeaderActions.prototype, "entity", 2); 35407 __decorateClass$2N([ 35408 n$5({ type: String }) 35409 ], SonicCartItemHeaderActions.prototype, "hash", 2); 35410 __decorateClass$2N([ 35411 n$5({ type: Array }) 35412 ], SonicCartItemHeaderActions.prototype, "items", 2); 35413 __decorateClass$2N([ 35414 ancestorAttribute("cartProvider") 35415 ], SonicCartItemHeaderActions.prototype, "cartProvider", 2); 35416 SonicCartItemHeaderActions = __decorateClass$2N([ 35417 t$3(tagName$1G) 35418 ], SonicCartItemHeaderActions); 35419 var __defProp$2J = Object.defineProperty; 35420 var __getOwnPropDesc$2M = Object.getOwnPropertyDescriptor; 35421 var __decorateClass$2M = (decorators, target, key, kind) => { 35422 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2M(target, key) : target; 35423 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 35424 if (decorator = decorators[i2]) 35425 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 35426 if (kind && result) __defProp$2J(target, key, result); 35427 return result; 35428 }; 35429 let SonicRequestRemainingPlaces = class extends Subscriber(i$6) { 35430 constructor() { 35431 super(...arguments); 35432 this.entityQuotas = []; 35433 } 35434 async willUpdate(changedProperties) { 35435 const currentEntity = this.entity; 35436 if (this.appType === "counter" && isRequest(this.cartType)) { 35437 if (changedProperties.has("entity") || changedProperties.has("appType") && currentEntity) { 35438 this.entityQuotas = await fetchEntityQuotasStock( 35439 this, 35440 currentEntity?.entity_type ?? EntityType.Event, 35441 Number(currentEntity?.id) 35442 ); 35443 } 35444 } 35445 super.willUpdate(changedProperties); 35446 } 35447 render() { 35448 let disiredQuotas = []; 35449 this.entityQuotas.forEach((quota) => { 35450 if (this.items?.some((item) => item.quota?.id === quota.id)) { 35451 disiredQuotas.push(quota); 35452 } 35453 }); 35454 if (this.entityQuotas.length > 0 && disiredQuotas.length === 0) 35455 return b$1`<sonic-badge size="xs" type="danger">Pas de place pour ce contingent</sonic-badge>`; 35456 if (disiredQuotas.length === 0) return A$1; 35457 return b$1` <div class="flex flex-col gap-[1px] items-start"> 35458 ${disiredQuotas.map((quota) => { 35459 const wishedPlaces = this.items?.filter((item) => item.quota?.id === quota.id).reduce((acc, item) => acc + (item.quantity || 0), 0) || 0; 35460 const canBeSatisfied = wishedPlaces <= (quota.remaining_places_nb || 0); 35461 const title = quota.title === "Hors contingentement" ? "H.C." : quota.title; 35462 return b$1`<sonic-badge size="xs" type="${canBeSatisfied ? "success" : "danger"}"> 35463 <div class="flex items-center gap-1 leading-none"> 35464 ${title} <sonic-icon name="ticket" library="custom" size="lg"></sonic-icon> <b>${wishedPlaces}</b> / 35465 ${quota.remaining_places_nb} 35466 </div> 35467 </sonic-badge>`; 35468 })} 35469 </div>`; 35470 } 35471 }; 35472 SonicRequestRemainingPlaces.styles = [tailwind]; 35473 __decorateClass$2M([ 35474 c({ context: cartTypeContext, subscribe: true }), 35475 n$5({ type: String }) 35476 ], SonicRequestRemainingPlaces.prototype, "cartType", 2); 35477 __decorateClass$2M([ 35478 n$5({ type: Object }) 35479 ], SonicRequestRemainingPlaces.prototype, "entity", 2); 35480 __decorateClass$2M([ 35481 n$5({ type: Object }) 35482 ], SonicRequestRemainingPlaces.prototype, "items", 2); 35483 __decorateClass$2M([ 35484 r$5() 35485 ], SonicRequestRemainingPlaces.prototype, "entityQuotas", 2); 35486 __decorateClass$2M([ 35487 c({ context: appType, subscribe: true }), 35488 n$5({ type: String }) 35489 ], SonicRequestRemainingPlaces.prototype, "appType", 2); 35490 SonicRequestRemainingPlaces = __decorateClass$2M([ 35491 t$3("sonic-request-remaining-places") 35492 ], SonicRequestRemainingPlaces); 35493 var __defProp$2I = Object.defineProperty; 35494 var __getOwnPropDesc$2L = Object.getOwnPropertyDescriptor; 35495 var __decorateClass$2L = (decorators, target, key, kind) => { 35496 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2L(target, key) : target; 35497 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 35498 if (decorator = decorators[i2]) 35499 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 35500 if (kind && result) __defProp$2I(target, key, result); 35501 return result; 35502 }; 35503 let SonicCartItemHeader = class extends Subscriber$1(i$6) { 35504 constructor() { 35505 super(...arguments); 35506 this.textOnly = false;
35507 this.layout = "default"; 35508 this.mode = "default"; 35509 this.showDetail = false; 35510 this.entity = {}; 35511 this.items = null; 35512 this._cartProvider = ""; 35513 this.outsideTextToCheck = ["hors les murs", "outside", "extérieur", "auÃer Haus", "op locatie"]; 35514 } 35515 connectedCallback() { 35516 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 35517 super.connectedCallback(); 35518 } 35519 async willUpdate(changedProperties) { 35520 if (changedProperties.has("layout")) { 35521 if (this.layout == "condensed") { 35522 this.textOnly = true; 35523 } 35524 } 35525 super.willUpdate(changedProperties); 35526 } 35527 shouldCheckRemainingPlaces() { 35528 const status = dp$1(this._cartProvider).data.status.get(); 35529 return isRequest(this.cartType) && this.layout !== "condensed" && ![ReservationStatus.Deleted, ReservationStatus.Expired, ReservationStatus.Processed].includes(status); 35530 } 35531 // SWITCH LAYOUTS 35532 render() { 35533 const enableLink = this.mode == "default" && this.entity.entity_type !== EntityType.Subscribe; 35534 const isCondensed = this.layout == "condensed"; 35535 const size = isCondensed ? "xs" : "sm"; 35536 let outsideLabel = void 0; 35537 const entity = this.entity; 35538 if ("labels" in entity && entity.labels instanceof Array) { 35539 outsideLabel = entity.labels.find( 35540 (label2) => this.outsideTextToCheck.some((text) => label2.title?.toLowerCase() === text) 35541 ); 35542 } 35543 const features = this.showDetail ? [ProductDisplay.LocationFull] : []; 35544 return b$1`<div class="flex gap-2 w-full px-1"> 35545 <sonic-product-summary 35546 size="${size}" 35547 class="block flew-grow w-full min-w-0 self-center leading-tight ${enableLink ? "hover:bg-neutral-50 rounded" : ""}" 35548 subDataProvider="entity" 35549 ?link=${enableLink} 35550 ?textOnly=${this.textOnly} 35551 .featureDisplay=${features} 35552 > 35553 ${outsideLabel ? b$1`<sonic-badge size="xs" class="mt-1" type="info" slot="subTitle">${outsideLabel.title}</sonic-badge>` : A$1} 35554 ${this.shouldCheckRemainingPlaces() ? b$1`<div slot="infos"> 35555 <sonic-request-remaining-places 35556 .entity=${this.entity} 35557 .items=${this.items} 35558 ></sonic-request-remaining-places> 35559 </div>` : A$1} 35560 </sonic-product-summary> 35561 ${this.entity ? b$1`<sonic-cart-item-header-actions class="ml-auto block shrink-0 "></sonic-cart-item-header-actions> ` : A$1} 35562 </div>`; 35563 } 35564 }; 35565 SonicCartItemHeader.styles = [tailwind]; 35566 __decorateClass$2L([ 35567 n$5({ type: Boolean }) 35568 ], SonicCartItemHeader.prototype, "textOnly", 2); 35569 __decorateClass$2L([ 35570 c({ context: layoutContext, subscribe: true }), 35571 n$5({ type: String }) 35572 ], SonicCartItemHeader.prototype, "layout", 2); 35573 __decorateClass$2L([ 35574 c({ context: modeContext, subscribe: true }), 35575 n$5({ type: String }) 35576 ], SonicCartItemHeader.prototype, "mode", 2); 35577 __decorateClass$2L([ 35578 c({ context: detailContext, subscribe: true }), 35579 n$5({ type: Boolean }) 35580 ], SonicCartItemHeader.prototype, "showDetail", 2); 35581 __decorateClass$2L([ 35582 n$5({ type: Object }) 35583 ], SonicCartItemHeader.prototype, "entity", 2); 35584 __decorateClass$2L([ 35585 n$5({ type: Array }) 35586 ], SonicCartItemHeader.prototype, "items", 2); 35587 __decorateClass$2L([ 35588 c({ context: appType, subscribe: true }), 35589 n$5({ type: String }) 35590 ], SonicCartItemHeader.prototype, "appType", 2); 35591 __decorateClass$2L([ 35592 c({ context: cartTypeContext, subscribe: true }), 35593 n$5({ type: String }) 35594 ], SonicCartItemHeader.prototype, "cartType", 2); 35595 __decorateClass$2L([ 35596 r$5() 35597 ], SonicCartItemHeader.prototype, "_cartProvider", 2); 35598 SonicCartItemHeader = __decorateClass$2L([ 35599 t$3("sonic-cart-item-header") 35600 ], SonicCartItemHeader); 35601 var __defProp$2H = Object.defineProperty; 35602 var __getOwnPropDesc$2K = Object.getOwnPropertyDescriptor; 35603 var __decorateClass$2K = (decorators, target, key, kind) => { 35604 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2K(target, key) : target; 35605 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 35606 if (decorator = decorators[i2]) 35607 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 35608 if (kind && result) __defProp$2H(target, key, result); 35609 return result; 35610 }; 35611 let CartInput = class extends Input { 35612 constructor() { 35613 super(...arguments); 35614 this.entity_id = 0; 35615 this.entity_type = null; 35616 this.parent_id = null; 35617 this.price = {}; 35618 this.quota = null; 35619 this.shake = false;
35620 this.plusMinus = false; 35621 this.cartItemQuantity = 0; 35622 this.items = null; 35623 this.mode = "default"; 35624 this._queryQuantityIncrement = ""; 35625 this.cartOperationId = 0; 35626 this.bntPlus = /*html*/ 35627 ` 35628 <sonic-button 35629 slot="suffix" 35630 radio 35631 name="queryQuantityIncrement" 35632 autoRepeat 35633 value="1" 35634 shape="circle" 35635 size="xs" 35636 icon 35637 variant="unstyled" 35638 > 35639 <sonic-icon library="iconoir" name="plus"></sonic-icon> 35640 </sonic-button> 35641 `; 35642 this.btnMinus = /*html */ 35643 ` 35644 <sonic-button 35645 class="btnMinus" 35646 slot="prefix" 35647 name="queryQuantityIncrement" 35648 autoRepeat 35649 radio 35650 value="-1" 35651 shape="circle" 35652 size="xs" 35653 icon 35654 variant="unstyled" 35655 > 35656 <sonic-icon library="iconoir" name="minus"></sonic-icon> 35657 </sonic-button> 35658 `; 35659 } 35660 async handleChange(e2) { 35661 let value = this.input.value.trim(); 35662 value = value.replace(/\D/g, ""); 35663 this.input.value = value; 35664 if (value == "") return; 35665 super.handleChange(e2); 35666 await this.cartOperation(); 35667 } 35668 setValueFromPublisher(value) { 35669 super.setValueFromPublisher(value); 35670 const btnMinus = this.querySelector(".btnMinus"); 35671 if (parseInt(this.value) > 1) { 35672 btnMinus?.removeAttribute("disabled"); 35673 } else { 35674 btnMinus?.setAttribute("disabled", ""); 35675 } 35676 } 35677 handleBlur(e2) { 35678 super.handleBlur(e2); 35679 if (this.input.value.trim() == "") { 35680 this.input.value = this.value; 35681 } 35682 } 35683 get queryQuantityIncrement() { 35684 return this._queryQuantityIncrement; 35685 } 35686 set queryQuantityIncrement(value) { 35687 if (value == this.queryQuantityIncrement) return; 35688 this._queryQuantityIncrement = value; 35689 const id = ++CartInput.queryIncrementId; 35690 (async () => { 35691 await Utils.delayPromise(1); 35692 if (id !== CartInput.queryIncrementId) return; 35693 window.queueMicrotask(() => this.publisher.queryQuantityIncrement = null); 35694 if (!value) return; 35695 const increment = parseInt(value); 35696 if (isNaN(increment)) return; 35697 const quantity = parseInt(this.value || "0") + increment; 35698 if (quantity < 1) return; 35699 this.input.value = quantity.toString(); 35700 this.input.dispatchEvent(new Event("input")); 35701 })(); 35702 } 35703 async cartOperation() { 35704 const id = ++this.cartOperationId; 35705 await Utils.delayPromise(400); 35706 if (id !== this.cartOperationId) return; 35707 const quantity = Number(this.value); 35708 if (isNaN(quantity)) return; 35709 if (this.mode === "splitResult") { 35710 this.handleSplit(Number(this.input.value)); 35711 return; 35712 } else { 35713 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 35714 const query = { 35715 entity_type: this.entity_type || void 0, 35716 entity_id: this.entity_id, 35717 parent_id: this.parent_id || "null" 35718 }; 35719 if (this.quota) { 35720 query.quota = { id: this.quota.id }; 35721 } 35722 if (this.price) { 35723 query.price = { id: this.price.id, amount: this.price.amount }; 35724 } 35725 const result = await Cart.set({ 35726 apiConfiguration: this.getApiConfiguration(), 35727 cartProvider, 35728 query, 35729 body: { 35730 quantity 35731 } 35732 }); 35733 if (result === "differentFromRequest") { 35734 this.shake = true; 35735 await Utils.delayPromise(820); 35736 this.shake = false; 35737 } else { 35738 this.highlight(); 35739 } 35740 return result; 35741 } 35742 } 35743 async handleSplit(wantedQuantity) { 35744 if (!wantedQuantity) return; 35745 const currentItemsCount = this.items?.length || 0; 35746 const itemsDelta = wantedQuantity - currentItemsCount; 35747 if (itemsDelta === 0) return; 35748 const [sourceDP, targetDP] = itemsDelta > 0 ? ["splitSource", "splitResult"] : ["splitResult", "splitSource"]; 35749 const remainingItems = dp(sourceDP).items.get(); 35750 const matchingItems = this.filterMatchingItems(remainingItems); 35751 const itemsToMove = matchingItems.slice(0, Math.abs(itemsDelta)); 35752 if (itemsToMove.length > 0) { 35753 moveCartItems(itemsToMove, { 35754 targetDataProvider: targetDP, 35755 sourceDataProvider: sourceDP 35756 }); 35757 } else if (itemsDelta > 0) { 35758 await this.shakeAndResetInput(currentItemsCount); 35759 } 35760 } 35761 // Helper method to filter matching items 35762 filterMatchingItems(items) { 35763 return items.filter( 35764 (item) => item.price?.id === this.price?.id && item.entity_id === this.entity_id && item.quota?.id === this.quota?.id && item.entity_type === this.entity_type 35765 ); 35766 } 35767 // Helper method for shake animation and input reset 35768 async shakeAndResetInput(value) { 35769 this.shake = true; 35770 this.input.value = value.toString(); 35771 await Utils.delayPromise(820); 35772 this.shake = false;
35773 } 35774 connectedCallback() { 35775 this.setAttribute("pattern", "\\d+"); 35776 this.setAttribute("noAppearance", ""); 35777 this.setAttribute("name", "quantity"); 35778 this.setAttribute("inlineContent", ""); 35779 this.setAttribute("type", "number"); 35780 super.connectedCallback(); 35781 this.setAttribute("formDataProvider", this.dataProvider || ""); 35782 } 35783 willUpdate(changedProperties) { 35784 if (changedProperties.has("shake")) { 35785 if (this.shake) { 35786 this.status = "error"; 35787 setTimeout(() => { 35788 this.shake = false; 35789 this.status = "default"; 35790 }, 900); 35791 } 35792 } 35793 if (changedProperties.has("plusMinus")) { 35794 if (this.plusMinus && !this.readonly) { 35795 this.innerHTML = this.btnMinus + this.bntPlus; 35796 } else { 35797 this.innerHTML = ""; 35798 } 35799 } 35800 super.willUpdate(changedProperties); 35801 } 35802 highlight() { 35803 this.status = "success"; 35804 setTimeout(() => { 35805 this.status = "default"; 35806 }, 900); 35807 } 35808 }; 35809 CartInput.styles = [ 35810 ...Input.styles, 35811 i$9` 35812 :host { 35813 display: inline-block; 35814 text-align: center; 35815 width: max(2.5rem, 2ch); 35816 } 35817 :host([plusMinus]) { 35818 width: 5rem; 35819 } 35820 :host([plusMinus][size="2xs"]) { 35821 width: 5rem; 35822 } 35823 35824 :host([shake]) { 35825 animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; 35826 transform: translate3d(0, 0, 0); 35827 backface-visibility: hidden; 35828 perspective: 1000px; 35829 } 35830 35831 :host([readonly]) .form-element { 35832 --sc-input-border: var(--sc-base-50) !important; 35833 --sc-input-background: var(--sc-base-50) !important; 35834 } 35835 35836 @keyframes shake { 35837 10%, 35838 90% { 35839 transform: translate3d(-1px, 0, 0); 35840 } 35841 35842 20%, 35843 80% { 35844 transform: translate3d(2px, 0, 0); 35845 } 35846 35847 30%, 35848 50%, 35849 70% { 35850 transform: translate3d(-3px, 0, 0); 35851 } 35852 35853 40%, 35854 60% { 35855 transform: translate3d(3px, 0, 0); 35856 } 35857 } 35858 ` 35859 ]; 35860 CartInput.queryIncrementId = 0; 35861 __decorateClass$2K([ 35862 n$5({ type: Number }) 35863 ], CartInput.prototype, "entity_id", 2); 35864 __decorateClass$2K([ 35865 n$5({ type: String }) 35866 ], CartInput.prototype, "entity_type", 2); 35867 __decorateClass$2K([ 35868 n$5({ type: String }) 35869 ], CartInput.prototype, "parent_id", 2); 35870 __decorateClass$2K([ 35871 n$5({ type: Object }) 35872 ], CartInput.prototype, "price", 2); 35873 __decorateClass$2K([ 35874 n$5({ type: Object }) 35875 ], CartInput.prototype, "quota", 2); 35876 __decorateClass$2K([ 35877 n$5({ type: Boolean, reflect: true }) 35878 ], CartInput.prototype, "shake", 2); 35879 __decorateClass$2K([ 35880 n$5({ type: Boolean, reflect: true }) 35881 ], CartInput.prototype, "plusMinus", 2); 35882 __decorateClass$2K([ 35883 n$5({ type: Number }) 35884 ], CartInput.prototype, "cartItemQuantity", 2); 35885 __decorateClass$2K([ 35886 n$5({ type: Array }) 35887 ], CartInput.prototype, "items", 2); 35888 __decorateClass$2K([ 35889 c({ context: modeContext, subscribe: true }), 35890 n$5({ type: String }) 35891 ], CartInput.prototype, "mode", 2); 35892 __decorateClass$2K([ 35893 r$5() 35894 ], CartInput.prototype, "queryQuantityIncrement", 1); 35895 CartInput = __decorateClass$2K([ 35896 t$3("sonic-cart-input") 35897 ], CartInput); 35898 var __defProp$2G = Object.defineProperty; 35899 var __getOwnPropDesc$2J = Object.getOwnPropertyDescriptor; 35900 var __decorateClass$2J = (decorators, target, key, kind) => { 35901 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2J(target, key) : target; 35902 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 35903 if (decorator = decorators[i2]) 35904 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 35905 if (kind && result) __defProp$2G(target, key, result); 35906 return result; 35907 }; 35908 const tagName$1F = "sonic-cart-item-line-messages"; 35909 let CartItemLineMessages = class extends Subscriber$1(i$6) { 35910 constructor() { 35911 super(...arguments); 35912 this.messages = []; 35913 this.size = "sm"; 35914 } 35915 render() { 35916 return this.messages.map( 35917 (msg) => msg.type === "public" && ["warning", "error"].includes(msg.status || "") ? b$1`<sonic-alert status="${msg.status || "default"}" size="${this.size}"> 35918 ${o$6(msg.content)}</sonic-alert 35919 >` : A$1 35920 ); 35921 } 35922 }; 35923 __decorateClass$2J([ 35924 n$5({ type: Array }) 35925 ], CartItemLineMessages.prototype, "messages", 2); 35926 __decorateClass$2J([ 35927 n$5({ type: String }) 35928 ], CartItemLineMessages.prototype, "size", 2); 35929 CartItemLineMessages = __decorateClass$2J([ 35930 t$3(tagName$1F) 35931 ], CartItemLineMessages); 35932 async function fetchPriceEntity(api2, endpoint) { 35933 const result = await api2.get(endpoint); 35934 const data = result?.data; 35935 if (!data) return void 0; 35936 return { 35937 quotas: "quotas" in data ? data.quotas ?? [] : [], 35938 prices: data.prices ?? [], 35939 placesCategories: "places_categories" in data ? data.places_categories ?? [] : [], 35940 stock: data.stock 35941 }; 35942 } 35943 function prepareQuotas(quotas, isCustomerMode) { 35944 return isCustomerMode ? filterQuotasForCustomer(quotas) : quotas; 35945 } 35946 function resolveQuotaIdOnLoad(quotas, {
35947 currentQuotaId, 35948 preferredQuotaId, 35949 isEditMode, 35950 isCustomerMode 35951 }) { 35952 if (!isEditMode && preferredQuotaId) { 35953 const preferred = quotas.find((quota) => Number(quota.id) === Number(preferredQuotaId)); 35954 if (preferred && !isQuotaUnavailable(preferred, isCustomerMode)) { 35955 return preferredQuotaId; 35956 } 35957 } 35958 if (isCustomerMode) { 35959 const current2 = quotas.find((quota) => quota.id === currentQuotaId); 35960 if (!current2 || isQuotaUnavailable(current2, true)) { 35961 const firstAvailable = quotas.find((quota) => !isQuotaUnavailable(quota, true)); 35962 if (firstAvailable?.id != null) return Number(firstAvailable.id); 35963 } 35964 } 35965 return currentQuotaId; 35966 } 35967 function buildEditFormValues(edit) { 35968 const initialPrice = edit.initialPrice; 35969 return { 35970 price: { 35971 id: initialPrice?.id || 0, 35972 amount: initialPrice?.is_free_price ? Number(initialPrice.amount || 0) : void 0 35973 }, 35974 quota: { id: edit.initialQuotaId || 0 }, 35975 category: { id: Number(edit.lineItems?.[0]?.price?.placeCategory?.id) || 0 } 35976 }; 35977 } 35978 var __decorate$8 = function(decorators, target, key, desc) { 35979 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 35980 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 35981 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 35982 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 35983 }; 35984 const tagName$1E = "sonic-radio"; 35985 let Radio = class Radio extends Checkbox { 35986 constructor() { 35987 super(); 35988 this.radio = true; 35989 } 35990 willUpdate(changedProperties) { 35991 const typeChanged = changedProperties.has("type"); 35992 super.willUpdate(changedProperties); 35993 if (typeChanged) { 35994 this.type = "radio"; 35995 } 35996 } 35997 connectedCallback() { 35998 super.connectedCallback(); 35999 this.type = "radio"; 36000 } 36001 }; 36002 Radio.styles = [ 36003 Checkbox.styles, 36004 i$9` 36005 :host input { 36006 border-radius: 50%; 36007 } 36008 :host sonic-icon { 36009 border-radius: 50%; 36010 overflow: hidden; 36011 background-color: var(--sc-primary-content, var(--sc-base, #fff)); 36012 line-height: 0; 36013 display: block; 36014 font-size: 1em; 36015 height: 0.6em; 36016 height: round(0.6em, 1px); 36017 width: 0.6em; 36018 width: round(0.6em, 1px); 36019 } 36020 ` 36021 ]; 36022 Radio = __decorate$8([ 36023 t$3(tagName$1E) 36024 ], Radio); 36025 var __defProp$2F = Object.defineProperty; 36026 var __getOwnPropDesc$2I = Object.getOwnPropertyDescriptor; 36027 var __decorateClass$2I = (decorators, target, key, kind) => { 36028 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2I(target, key) : target; 36029 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36030 if (decorator = decorators[i2]) 36031 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36032 if (kind && result) __defProp$2F(target, key, result); 36033 return result; 36034 }; 36035 const tagName$1D = "sonic-subscription-requirement-warning"; 36036 let SonicSubscriptionRequirementWarning = class extends Subscriber$1(i$6) { 36037 constructor() { 36038 super(...arguments); 36039 this.prices = []; 36040 } 36041 render() { 36042 const pricesMatchingQuota = this.selectedQuota ? this.prices.filter((p2) => this.selectedQuota?.prices?.some((q) => q.price_id == p2.id)) : this.prices; 36043 const subIsRequired = isSubscriptionRequired(this.subscriptionRequirement, this.appType); 36044 if (!subIsRequired) { 36045 return A$1; 36046 } 36047 const hasPrices = this.selectedQuota?.prices && this.selectedQuota?.prices.length > 0; 36048 if (!hasPrices) { 36049 return A$1; 36050 } 36051 const isWaitingListContext = this.accessParams?.isWaitingList; 36052 if (isWaitingListContext) { 36053 return A$1; 36054 } 36055 const allPricesNeedSubscription = pricesMatchingQuota.length > 0 && pricesMatchingQuota.every((p2) => p2.need_subscription); 36056 const hasPriceAvailable = this.selectedQuota ? this.selectedQuota.remaining_places_nb !== 0 : true; 36057 const displayWarning = subIsRequired && allPricesNeedSubscription && hasPrices && hasPriceAvailable; 36058 if (displayWarning) { 36059 return b$1`<sonic-alert 36060 status="info" 36061 background 36062 size="sm" 36063 class="my-8" 36064 label=${t("LIB_restriction_individuelle_warning_title")} 36065 > 36066 <sonic-icon library="custom" name="id-card" slot="icon"></sonic-icon> 36067 <div>${t("LIB_restriction_individuelle_warning_subtitle")}</div> 36068 <sonic-app-link 36069 to="subscription" 36070 variant="default" 36071 type="info" 36072 size="xs" 36073 class="mt-1 font-medium" 36074 autoactive="disabled" 36075 > 36076 <sonic-icon library="custom" name="arrow-right"></sonic-icon> 36077 ${t("onglet_home_abonnements")} 36078 </sonic-app-link> 36079 </sonic-alert>`; 36080 } else { 36081 return A$1; 36082 } 36083 } 36084 }; 36085 SonicSubscriptionRequirementWarning.styles = [tailwind]; 36086 __decorateClass$2I([ 36087 c({ context: appType, subscribe: true }), 36088 r$5() 36089 ], SonicSubscriptionRequirementWarning.prototype, "appType", 2); 36090 __decorateClass$2I([ 36091 c({ context: accessParamsContext, subscribe: true }), 36092 n$5({ type: Object }) 36093 ], SonicSubscriptionRequirementWarning.prototype, "accessParams", 2); 36094 __decorateClass$2I([ 36095 bind$1("settings.subscriptionRequirement"), 36096 r$5() 36097 ], SonicSubscriptionRequirementWarning.prototype, "subscriptionRequirement", 2); 36098 __decorateClass$2I([ 36099 n$5({ type: Array }) 36100 ], SonicSubscriptionRequirementWarning.prototype, "prices", 2); 36101 __decorateClass$2I([ 36102 n$5({ type: Object }) 36103 ], SonicSubscriptionRequirementWarning.prototype, "selectedQuota", 2); 36104 SonicSubscriptionRequirementWarning = __decorateClass$2I([ 36105 t$3(tagName$1D) 36106 ], SonicSubscriptionRequirementWarning); 36107 var __defProp$2E = Object.defineProperty; 36108 var __getOwnPropDesc$2H = Object.getOwnPropertyDescriptor; 36109 var __decorateClass$2H = (decorators, target, key, kind) => { 36110 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2H(target, key) : target; 36111 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36112 if (decorator = decorators[i2]) 36113 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36114 if (kind && result) __defProp$2E(target, key, result); 36115 return result; 36116 }; 36117 const tagName$1C = "sonic-price-selection-form"; 36118 let instanceCount$1 = 0; 36119 let PriceSelectionForm = class extends i$6 { 36120 constructor() { 36121 super(...arguments); 36122 this.cartProvider = "cart/current"; 36123 this.seatmapProvider = ""; 36124 this.fallbackAvailableQuota = true; 36125 this.showSubmitButton = true; 36126 this._isLoading = false;
36127 this._isSubmitting = false; 36128 this._stockQuotas = []; 36129 this._filterPriceByQuota = true; 36130 this.formDataProvider = `priceSelectionForm/${instanceCount$1++}`; 36131 this.quotaUpdatePolicyDataProvider = `priceSelectionPolicyForm/${instanceCount$1++}`; 36132 this.onQuotaChange = () => this.handleFormChange("quota"); 36133 this.onCategoryChange = () => this.handleFormChange("category"); 36134 this.onPriceChange = () => this.handleFormChange("price"); 36135 this.handleFormChange = (scope) => { 36136 const form2 = this.readForm(); 36137 const view = this.buildView(form2); 36138 syncFormSelection( 36139 { 36140 selection: view.selection, 36141 selectedCategoryId: form2.categoryId, 36142 selectedPriceId: form2.priceId, 36143 shouldShowQuantitySelect: view.shouldShowQuantitySelect, 36144 minQuantity: view.minQuantity, 36145 maxQuantity: view.maxQuantity, 36146 selectedQuantity: form2.quantity || view.minQuantity 36147 }, 36148 this.formMutators, 36149 scope 36150 ); 36151 if (scope !== "price") this.requestUpdate(); 36152 }; 36153 } 36154 get isEditMode() { 36155 return !!this.priceContext?.edit?.lineItems?.length; 36156 } 36157 get isCounterMode() { 36158 return this.appType === "counter"; 36159 } 36160 get isCustomerMode() { 36161 return this.appType === "customer"; 36162 } 36163 get editCategoryId() { 36164 const id = Number(this.priceContext?.edit?.lineItems?.[0]?.price?.placeCategory?.id); 36165 return this.isEditMode && id ? id : void 0; 36166 } 36167 readForm() { 36168 const form2 = dp(this.formDataProvider); 36169 const freeAmount = form2.price.amount.get(); 36170 return { 36171 quotaId: Number(form2.quota.id.get()) || 0, 36172 categoryId: Number(form2.category.id.get()) || 0, 36173 priceId: Number(form2.price.id.get()) || 0, 36174 quantity: Number(form2.quantity.get()) || 1, 36175 ...freeAmount !== void 0 && freeAmount !== "" && { freePriceAmount: Number(freeAmount) } 36176 }; 36177 } 36178 buildView(form2 = this.readForm()) { 36179 const selectedQuota = this._availableQuotas?.find((quota) => quota.id === form2.quotaId); 36180 return buildPriceFormView({ 36181 form: form2, 36182 allPrices: this._allPrices ?? [], 36183 placesCategories: this._placesCategories, 36184 stock: this._stock, 36185 quota: selectedQuota, 36186 filterByQuota: this._filterPriceByQuota, 36187 editCategoryId: this.editCategoryId, 36188 mode: this.isEditMode ? "edit" : "add", 36189 initialQuotaId: this.priceContext?.edit?.initialQuotaId, 36190 isCustomerMode: this.isCustomerMode, 36191 parentSubscriptionId: this.priceContext?.parentSubscription?.id 36192 }); 36193 } 36194 get formMutators() { 36195 const form2 = dp(this.formDataProvider); 36196 return { 36197 setCategoryId: (id) => form2.category.id.set(id), 36198 setPriceId: (id) => form2.price.id.set(id), 36199 setQuantity: (quantity) => form2.quantity.set(String(quantity)) 36200 }; 36201 } 36202 connectedCallback() { 36203 super.connectedCallback(); 36204 const form2 = dp(this.formDataProvider); 36205 form2.quota.id.onAssign(this.onQuotaChange); 36206 form2.category.id.onAssign(this.onCategoryChange); 36207 form2.price.id.onAssign(this.onPriceChange); 36208 } 36209 disconnectedCallback() { 36210 const form2 = dp(this.formDataProvider); 36211 form2.quota.id.offAssign(this.onQuotaChange); 36212 form2.category.id.offAssign(this.onCategoryChange); 36213 form2.price.id.offAssign(this.onPriceChange); 36214 super.disconnectedCallback(); 36215 } 36216 async fetchEntityData() { 36217 const { entityType, entityId } = this.priceContext || {}; 36218 if (!entityType || !entityId) return; 36219 this._isLoading = true; 36220 try { 36221 const api2 = new API(HTML.getApiConfiguration(this)); 36222 const endpoint = priceEndPoint( 36223 { entityType, entityId, parentSubscription: this.priceContext?.parentSubscription }, 36224 this.accessParams 36225 ); 36226 const data = await fetchPriceEntity(api2, endpoint); 36227 if (!data) return; 36228 this._availableQuotas = prepareQuotas(data.quotas, this.isCustomerMode); 36229 this._placesCategories = data.placesCategories; 36230 this._stock = data.stock; 36231 this._allPrices = data.prices; 36232 this._stockQuotas = shouldFetchQuotasStockDisplay(this.appType, this.accessParams) ? await fetchEntityQuotasStock(this, entityType, Number(entityId)) : []; 36233 const quotaId = resolveQuotaIdOnLoad(this._availableQuotas, { 36234 currentQuotaId: this.readForm().quotaId, 36235 preferredQuotaId: this.preferredQuotaId, 36236 isEditMode: this.isEditMode,
36237 isCustomerMode: this.isCustomerMode 36238 }); 36239 if (quotaId !== this.readForm().quotaId) { 36240 dp(this.formDataProvider).quota.id.set(quotaId); 36241 } 36242 this.handleFormChange("quota"); 36243 } finally { 36244 this._isLoading = false; 36245 } 36246 } 36247 async willUpdate(changedProperties) { 36248 if ((changedProperties.has("priceContext") || changedProperties.has("accessParams")) && this.priceContext?.entityType && this.priceContext?.entityId) { 36249 await this.fetchEntityData(); 36250 if (this.priceContext?.edit) { 36251 dp(this.formDataProvider).set(buildEditFormValues(this.priceContext.edit)); 36252 } 36253 } 36254 if (changedProperties.has("_filterPriceByQuota")) { 36255 this.handleFormChange("quota"); 36256 } 36257 if (changedProperties.has("appType") && this.isCounterMode) { 36258 this._filterPriceByQuota = false; 36259 } 36260 super.willUpdate(changedProperties); 36261 } 36262 async handleSubmit() { 36263 const form2 = this.readForm(); 36264 const view = this.buildView(form2); 36265 this._isSubmitting = true; 36266 try { 36267 const apiConfiguration = HTML.getApiConfiguration(this); 36268 const priceBody = { 36269 id: view.selectedPrice.id || 0, 36270 ...view.freePriceAmount && { is_free_price: true, amount: view.freePriceAmount } 36271 }; 36272 if (this.isEditMode) { 36273 const edit = this.priceContext.edit; 36274 const itemIds = edit.lineItems?.map((item) => item.id).filter((id) => id !== void 0) ?? []; 36275 const query = itemIds.length ? { ids: itemIds } : { 36276 entity_type: this.priceContext?.entityType, 36277 entity_id: Number(this.priceContext?.entityId), 36278 parent_id: this.priceContext?.parentSubscription?.id || "null", 36279 price: { id: edit.initialPrice?.id }, 36280 quota: { id: edit.initialQuotaId } 36281 }; 36282 const result = await Cart.patchItems({ 36283 apiConfiguration, 36284 cartProvider: this.cartProvider, 36285 query, 36286 body: { 36287 price: priceBody, 36288 quota: { id: form2.quotaId }, 36289 quota_update_strategy: dp(this.quotaUpdatePolicyDataProvider).quota_update_strategy.get() 36290 } 36291 }); 36292 if (result === "asRequested") { 36293 this.dispatchEvent( 36294 new CustomEvent("updated", { 36295 detail: { itemIds: itemIds.map(String) } 36296 }) 36297 ); 36298 } 36299 } else { 36300 const result = await Cart.addItems({ 36301 apiConfiguration, 36302 cartProvider: this.cartProvider, 36303 items: createItemsToAdd({ 36304 entity_id: Number(this.priceContext?.entityId), 36305 entity_type: this.priceContext?.entityType || EntityType.Event, 36306 parent_id: this.priceContext?.parentSubscription?.id || void 0, 36307 selectedQuotaId: form2.quotaId, 36308 selectedPriceId: Number(view.selectedPrice.id) || 0, 36309 freePriceAmount: view.freePriceAmount, 36310 quantity: view.submitQuantity 36311 }), 36312 auto_seating: true, 36313 fallback_available_quota: this.fallbackAvailableQuota, 36314 attachOwnersAfterRequest: true, 36315 accessParams: this.accessParams ?? void 0 36316 }); 36317 if (result === "asRequested") { 36318 if (this.seatmapProvider) updateSeatmapStatus(this.seatmapProvider); 36319 this.dispatchEvent(new CustomEvent("added")); 36320 } 36321 } 36322 } finally { 36323 this._isSubmitting = false; 36324 } 36325 } 36326 render() { 36327 const { entityType, entityId } = this.priceContext || {}; 36328 if (this._isLoading) { 36329 return b$1`<div class="mt-3"><sonic-loader mode="inline" align="left"></sonic-loader></div>`; 36330 } 36331 if (!entityType || !entityId) return A$1; 36332 const form2 = this.readForm(); 36333 const view = this.buildView(form2); 36334 const { selection, validation, prices, selectedQuota } = view; 36335 const showQuotaStrategy = this.isEditMode && this.priceContext?.edit?.lineItems.some((item) => !!item.seat?.id) && this.priceContext?.edit?.initialQuotaId !== form2.quotaId; 36336 return b$1` 36337 <div class="grid grid-cols-1 gap-5" formDataProvider="${this.formDataProvider}" dataProvider="cart/editForm"> 36338 ${this._availableQuotas?.length ? b$1` 36339 <sonic-select 36340 class="grow block ${this._availableQuotas.length === 1 ? "hidden" : ""}" 36341 .label="${this.isCounterMode ? "Contingentement" : ""}" 36342 name="quota.id" 36343 .options=${this.buildQuotaOptions(form2.quotaId)} 36344 ></sonic-select> 36345 ` : A$1} 36346 ${selection.showCategorySelect ? b$1` 36347 <sonic-select 36348 class="grow shrink-0 block" 36349 data-aria-label="${t("LIB_categories")}" 36350 name="category.id" 36351 label=${!selection.displayCategories.some((c2) => c2.title?.toLowerCase().includes("cat")) ? t("LIB_categories") : ""} 36352 .options=${categoriesToOptions(selection.displayCategories, form2.categoryId)} 36353 > 36354 ${this.getCategoryColor(form2.categoryId) ? b$1`<div 36355 slot="prefix" 36356 class="size-5 rounded-full shrink-0 border border-neutral-500" 36357 style="background-color: ${this.getCategoryColor(form2.categoryId)}" 36358 ></div>` : A$1} 36359 </sonic-select> 36360 ` : A$1} 36361 <div class="flex gap-2"> 36362 ${!validation.canSubmit ? b$1`<sonic-alert 36363 background 36364 status="error" 36365 label="${validation.errorMessage}" 36366 text="${validation.errorSubtitle}" 36367 class="w-full" 36368 > 36369 </sonic-alert>` : b$1`<div class="grow"> 36370 <sonic-select name="price.id" .options=${pricesToOptions(prices, { selectedPriceId: form2.priceId })}> 36371 <div slot="label"> 36372 ${prices.length > 1 ? t("prices") : t("price")} 36373 ${prices.length > 1 ? b$1`<sonic-badge type="info" size="xs" class="-top-[2px] relative" 36374 >${prices.length} ${t("disponibles")}<sonic-icon 36375 name="arrow-down" 36376 library="custom" 36377 size="xs" 36378 ></sonic-icon> 36379 </sonic-badge>` : A$1} 36380 </div> 36381 </sonic-select> 36382 </div>`} 36383 ${this.renderFreeAmountInput(view)} 36384 ${view.shouldShowQuantitySelect ? b$1` 36385 <sonic-select 36386 class="shrink-0 w-[5rem]" 36387 label="${t("quantity")}" 36388 name="quantity" 36389 .options=${quantityToOptions(view.maxQuantity, view.minQuantity, form2.quantity)} 36390 ></sonic-select> 36391 ` : A$1} 36392 </div> 36393 ${this.isCounterMode && this._availableQuotas?.length ? b$1` 36394 <div class="text-sm text-neutral-400 mb-3 -mt-2"> 36395 <sonic-button 36396 size="inherit" 36397 class="mt-1" 36398 variant="link" 36399 @click=${() => this._filterPriceByQuota = !this._filterPriceByQuota} 36400 noAutoFill 36401 > 36402 <sonic-icon 36403 name="${this._filterPriceByQuota ? "filter-slash" : "filter"}" 36404 library="custom" 36405 ></sonic-icon> 36406 ${this._filterPriceByQuota ? "Afficher tous les tarifs" : "Filtrer les tarifs selon le contingentement"} 36407 </sonic-button> 36408 </div> 36409 ` : A$1} 36410 ${showQuotaStrategy ? this.renderQuotaStrategyWarning() : A$1} 36411 ${this.showSubmitButton ? b$1` 36412 <sonic-button 36413 ?disabled=${!validation.canSubmit} 36414 ?loading=${this._isSubmitting} 36415 type="success" 36416 noAutoFill 36417 class="w-full" 36418 @click=${this.handleSubmit} 36419 > 36420 <sonic-icon name="check" library="custom"></sonic-icon> 36421 ${this.isEditMode ? PRICE_MESSAGES.save : PRICE_MESSAGES.add} 36422 </sonic-button> 36423 ` : A$1} 36424 </div> 36425 36426 ${!this.priceContext?.parentSubscription?.id ? b$1` 36427 <sonic-subscription-requirement-warning 36428 .prices=${selection.availablePrices} 36429 .selectedQuota=${selectedQuota} 36430 ></sonic-subscription-requirement-warning> 36431 ` : A$1} 36432 `; 36433 } 36434 renderQuotaStrategyWarning() { 36435 return b$1` 36436 ${this.isCounterMode ? b$1`<div>
36437 <sonic-divider align="left" class="text-neutral-400 mb-3 mt-0" size="sm" 36438 >Modification du contingentement</sonic-divider 36439 > 36440 <div class="flex gap-6" formDataProvider="${this.quotaUpdatePolicyDataProvider}"> 36441 <sonic-radio name="quota_update_strategy" value="update_seat_quota" checked> 36442 <div class="text-pretty">Modifier le contingentement de la place</div> 36443 </sonic-radio> 36444 <sonic-radio name="quota_update_strategy" value="change_seat"> 36445 <sonic-icon name="arrow-right-arrow-left" library="custom"></sonic-icon> 36446 Replacement auto 36447 </sonic-radio> 36448 </div> 36449 </div>` : A$1} 36450 ${this.isCustomerMode ? b$1`<sonic-alert background status="warning" label="${t("LIB_replacement_auto_warning")}"></sonic-alert>` : A$1} 36451 `; 36452 } 36453 buildQuotaOptions(selectedQuotaId) { 36454 if (!this._availableQuotas?.length) return []; 36455 return buildQuotaSelectOptions({ 36456 quotas: this._availableQuotas, 36457 stockQuotas: this._stockQuotas, 36458 selectedQuotaId, 36459 isCounterMode: this.isCounterMode, 36460 isCustomerMode: this.isCustomerMode 36461 }); 36462 } 36463 getCategoryColor(categoryId) { 36464 const color = this.seatMapData?.conf?.categorie?.find( 36465 (item) => Number(item.id) === Number(categoryId) 36466 )?.couleur; 36467 return color ? `#${color}` : void 0; 36468 } 36469 renderFreeAmountInput(view) { 36470 const price = view.selectedPrice; 36471 if (!price?.is_free_price) return A$1; 36472 const minAmount = price.free_price?.min || 0; 36473 const maxAmount = price.free_price?.max || void 0; 36474 const quantity = this.priceContext?.edit?.lineItems.length; 36475 return b$1` 36476 <div> 36477 <div class="font-bold w-[10rem] items-center flex gap-2"> 36478 <sonic-input 36479 type="number" 36480 name="price.amount" 36481 label="${t("Montant")}" 36482 min=${minAmount} 36483 max=${o$4(maxAmount)} 36484 suffix="â¬" 36485 inlineContent 36486 > 36487 <div slot="suffix">â¬</div> 36488 </sonic-input> 36489 ${quantity ? b$1`<div class="flex gap-1 mr-2 items-center pt-5 font-normal"> 36490 <sonic-icon name="xmark" size="xs" library="custom"></sonic-icon> 36491 ${quantity} <sonic-icon name="ticket" library="custom"></sonic-icon> 36492 </div>` : A$1} 36493 </div> 36494 <div class="font-normal text-neutral-400 mt-1 text-sm"> 36495 ${priceRange({ min: minAmount, max: maxAmount, is_free_price: true })} 36496 </div> 36497 </div> 36498 `; 36499 } 36500 }; 36501 PriceSelectionForm.styles = [tailwind]; 36502 __decorateClass$2H([ 36503 ancestorAttribute("cartProvider"), 36504 n$5({ type: String }) 36505 ], PriceSelectionForm.prototype, "cartProvider", 2); 36506 __decorateClass$2H([ 36507 ancestorAttribute("seatmapProvider"), 36508 n$5({ type: String }) 36509 ], PriceSelectionForm.prototype, "seatmapProvider", 2); 36510 __decorateClass$2H([ 36511 bind(seatmapKey), 36512 r$5() 36513 ], PriceSelectionForm.prototype, "seatMapData", 2); 36514 __decorateClass$2H([ 36515 n$5({ type: Object }) 36516 ], PriceSelectionForm.prototype, "priceContext", 2); 36517 __decorateClass$2H([ 36518 n$5({ type: Number }) 36519 ], PriceSelectionForm.prototype, "preferredQuotaId", 2); 36520 __decorateClass$2H([ 36521 n$5({ type: Boolean }) 36522 ], PriceSelectionForm.prototype, "fallbackAvailableQuota", 2); 36523 __decorateClass$2H([ 36524 n$5({ type: Boolean }) 36525 ], PriceSelectionForm.prototype, "showSubmitButton", 2); 36526 __decorateClass$2H([ 36527 c({ context: accessParamsContext, subscribe: true }), 36528 n$5({ type: Object }) 36529 ], PriceSelectionForm.prototype, "accessParams", 2); 36530 __decorateClass$2H([ 36531 c({ context: appType, subscribe: true }), 36532 n$5({ type: String }) 36533 ], PriceSelectionForm.prototype, "appType", 2); 36534 __decorateClass$2H([ 36535 r$5() 36536 ], PriceSelectionForm.prototype, "_isLoading", 2); 36537 __decorateClass$2H([ 36538 r$5() 36539 ], PriceSelectionForm.prototype, "_isSubmitting", 2); 36540 __decorateClass$2H([ 36541 r$5() 36542 ], PriceSelectionForm.prototype, "_availableQuotas", 2); 36543 __decorateClass$2H([ 36544 r$5() 36545 ], PriceSelectionForm.prototype, "_stockQuotas", 2); 36546 __decorateClass$2H([ 36547 r$5() 36548 ], PriceSelectionForm.prototype, "_allPrices", 2); 36549 __decorateClass$2H([ 36550 r$5() 36551 ], PriceSelectionForm.prototype, "_placesCategories", 2); 36552 __decorateClass$2H([ 36553 r$5() 36554 ], PriceSelectionForm.prototype, "_stock", 2); 36555 __decorateClass$2H([ 36556 r$5() 36557 ], PriceSelectionForm.prototype, "_filterPriceByQuota", 2); 36558 PriceSelectionForm = __decorateClass$2H([ 36559 t$3(tagName$1C) 36560 ], PriceSelectionForm); 36561 var __defProp$2D = Object.defineProperty; 36562 var __getOwnPropDesc$2G = Object.getOwnPropertyDescriptor; 36563 var __decorateClass$2G = (decorators, target, key, kind) => { 36564 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2G(target, key) : target; 36565 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36566 if (decorator = decorators[i2]) 36567 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36568 if (kind && result) __defProp$2D(target, key, result); 36569 return result; 36570 }; 36571 const tagName$1B = "sonic-cart-item-edit-price"; 36572 let CartItemEditPrice = class extends i$6 { 36573 constructor() { 36574 super(...arguments); 36575 this.cartProvider = "cart/current"; 36576 this.fallbackAvailableQuota = true; 36577 this.handleFormSuccess = () => {
36578 this.closeParentModal(); 36579 }; 36580 this.handleFormUpdated = (event) => { 36581 this.dispatchEvent( 36582 new CustomEvent("updated", { 36583 detail: event.detail 36584 }) 36585 ); 36586 this.closeParentModal(); 36587 }; 36588 } 36589 get isEditMode() { 36590 return !!this.priceContext?.edit?.lineItems?.length; 36591 } 36592 closeParentModal() { 36593 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 36594 parentModal?.hide(); 36595 } 36596 get hasSeat() { 36597 return this.priceContext?.edit?.lineItems.some((item) => !!item.seat?.id) || false; 36598 } 36599 renderHeader() { 36600 const { entityType, entityId } = this.priceContext || {}; 36601 if (!entityType || !entityId) return A$1; 36602 return b$1` 36603 ${this.isEditMode ? productPriceSummary({ 36604 lineItemCart: this.priceContext?.edit?.lineItems, 36605 className: "mb-6 block ", 36606 accessParams: this.accessParams 36607 }) : b$1` 36608 <sonic-fetch 36609 dataProvider=${entityEndPoint({ 36610 entityType, 36611 entityId: Number(entityId), 36612 view: entityView.essential, 36613 accessParams: this.accessParams 36614 })} 36615 > 36616 <sonic-product-summary size="md" subDataprovider="data" class="mb-6 block" noOverTitle> 36617 </sonic-product-summary> 36618 </sonic-fetch> 36619 `} 36620 `; 36621 } 36622 renderSeatSection() { 36623 const hasSeat = this.hasSeat; 36624 const hasOneItem = this.priceContext?.edit?.lineItems?.length === 1; 36625 const needSubscription = hasOneItem && this.priceContext?.edit?.lineItems?.[0]?.price?.need_subscription; 36626 const canChangeSeats = hasSeat; 36627 if (!canChangeSeats && !needSubscription) return A$1; 36628 return b$1` 36629 <sonic-divider class="mt-8 mb-3"></sonic-divider> 36630 <div class="flex gap-2 justify-center "> 36631 ${canChangeSeats ? b$1` <sonic-button 36632 variant="ghost" 36633 size="sm" 36634 minWidth="12rem" 36635 @click=${() => { 36636 this.closeParentModal(); 36637 editSeatsModal({ 36638 cartProvider: this.cartProvider, 36639 priceContext: this.priceContext, 36640 accessParams: this.accessParams 36641 }); 36642 }} 36643 > 36644 <sonic-icon name="loveseat" library="custom"></sonic-icon> 36645 ${t("change_seats")} 36646 </sonic-button>` : A$1} 36647 ${needSubscription && canChangeSeats ? b$1` <sonic-divider vertical></sonic-divider> ` : A$1} 36648 ${needSubscription ? b$1` <sonic-button 36649 variant="ghost" 36650 size="sm" 36651 minWidth="12rem" 36652 @click=${() => { 36653 this.closeParentModal(); 36654 attachOwnerModal({ 36655 cartProvider: this.cartProvider, 36656 items: this.priceContext?.edit?.lineItems || [] 36657 }); 36658 }} 36659 > 36660 <sonic-icon name="id-card" library="custom"></sonic-icon> 36661 ${t("edit_owner")} 36662 </sonic-button>` : A$1} 36663 </div> 36664 `; 36665 } 36666 render() { 36667 return b$1` 36668 ${this.renderHeader()} 36669 36670 <sonic-price-selection-form 36671 cartProvider=${this.cartProvider} 36672 .priceContext=${this.priceContext} 36673 .preferredQuotaId=${this.preferredQuotaId} 36674 .fallbackAvailableQuota=${this.fallbackAvailableQuota} 36675 @added=${this.handleFormSuccess} 36676 @updated=${this.handleFormUpdated} 36677 ></sonic-price-selection-form> 36678 36679 ${this.renderSeatSection()} 36680 `; 36681 } 36682 }; 36683 CartItemEditPrice.styles = [tailwind]; 36684 __decorateClass$2G([ 36685 ancestorAttribute("cartProvider"), 36686 n$5({ type: String }) 36687 ], CartItemEditPrice.prototype, "cartProvider", 2); 36688 __decorateClass$2G([ 36689 n$5({ type: Object }) 36690 ], CartItemEditPrice.prototype, "priceContext", 2); 36691 __decorateClass$2G([ 36692 n$5({ type: Number }) 36693 ], CartItemEditPrice.prototype, "preferredQuotaId", 2); 36694 __decorateClass$2G([ 36695 n$5({ type: Boolean }) 36696 ], CartItemEditPrice.prototype, "fallbackAvailableQuota", 2); 36697 __decorateClass$2G([ 36698 c({ context: accessParamsContext, subscribe: true }), 36699 n$5({ type: Object }) 36700 ], CartItemEditPrice.prototype, "accessParams", 2); 36701 CartItemEditPrice = __decorateClass$2G([ 36702 t$3(tagName$1B) 36703 ], CartItemEditPrice); 36704 var __defProp$2C = Object.defineProperty; 36705 var __getOwnPropDesc$2F = Object.getOwnPropertyDescriptor; 36706 var __decorateClass$2F = (decorators, target, key, kind) => { 36707 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2F(target, key) : target; 36708 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36709 if (decorator = decorators[i2]) 36710 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36711 if (kind && result) __defProp$2C(target, key, result); 36712 return result; 36713 }; 36714 let SonicUserSelectorItem = class extends Subscriber$1(i$6) { 36715 constructor() { 36716 super(...arguments); 36717 this.important = false;
36718 this.size = "sm"; 36719 this.noAutoFill = false; 36720 this.buttonType = "button"; 36721 } 36722 render() { 36723 const currentId = this.props?.uid; 36724 if (!currentId && !this.props?.firstName && !this.props?.lastName && !this.props?.email) return A$1; 36725 const isRadio = this.buttonType === "radio"; 36726 return b$1` 36727 <sonic-button 36728 ?noAutoFill="${this.noAutoFill}" 36729 ?radio=${isRadio} 36730 name=${o$4(this.buttonName)} 36731 value="${o$4(isRadio ? currentId : void 0)}" 36732 variant="unstyled" 36733 type="default" 36734 shape="block" 36735 align="left" 36736 class="h-full border cursor-pointer 36737 ${this.important ? "border-success text-success hover:bg-neutral-100 " : "border-neutral-200 hover:border-neutral-600 hover:bg-neutral-100"} 36738 transition 36739 [&[active]]:border-neutral-800 rounded-md py-2 px-2" 36740 > 36741 <sonic-user-info tabindex="-1" class="text-xs pointer-events-none py-1 min-w-0" .size=${this.size}> 36742 <slot></slot> 36743 </sonic-user-info> 36744 </sonic-button> 36745 `; 36746 } 36747 }; 36748 SonicUserSelectorItem.styles = [tailwind]; 36749 __decorateClass$2F([ 36750 n$5({ type: Boolean }) 36751 ], SonicUserSelectorItem.prototype, "important", 2); 36752 __decorateClass$2F([ 36753 n$5({ type: String }) 36754 ], SonicUserSelectorItem.prototype, "size", 2); 36755 __decorateClass$2F([ 36756 n$5({ type: Boolean }) 36757 ], SonicUserSelectorItem.prototype, "noAutoFill", 2); 36758 __decorateClass$2F([ 36759 n$5({ type: String }) 36760 ], SonicUserSelectorItem.prototype, "buttonType", 2); 36761 __decorateClass$2F([ 36762 n$5({ type: String }) 36763 ], SonicUserSelectorItem.prototype, "buttonName", 2); 36764 SonicUserSelectorItem = __decorateClass$2F([ 36765 t$3("sonic-user-selector-item") 36766 ], SonicUserSelectorItem); 36767 var __defProp$2B = Object.defineProperty; 36768 var __getOwnPropDesc$2E = Object.getOwnPropertyDescriptor; 36769 var __decorateClass$2E = (decorators, target, key, kind) => { 36770 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2E(target, key) : target; 36771 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36772 if (decorator = decorators[i2]) 36773 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36774 if (kind && result) __defProp$2B(target, key, result); 36775 return result; 36776 }; 36777 const tagName$1A = "sonic-user-suggest"; 36778 let SonicUserSuggest = class extends i$6 { 36779 constructor() { 36780 super(...arguments); 36781 this.lastName = ""; 36782 this.firstName = ""; 36783 this.email = ""; 36784 this.structure = ""; 36785 this.limit = 4; 36786 this.userList = []; 36787 this.userListFromEmail = []; 36788 this.userListFromNameOrFirstName = []; 36789 this.formDataProvider = "userSuggestions"; 36790 this.matchEmail = false; 36791 this.selectedId = 0; 36792 this.isFetching = false; 36793 this.fetchQueue = []; 36794 this.dispatch = (uid) => { 36795 if (!uid || uid == this.selectedId) return; 36796 const event = new CustomEvent("select", { 36797 detail: { uid } 36798 }); 36799 this.dispatchEvent(event); 36800 this.selectedId = uid; 36801 }; 36802 } 36803 connectedCallback() { 36804 PublisherManager.get(this.formDataProvider).uid.onAssign(this.dispatch); 36805 super.connectedCallback(); 36806 } 36807 disconnectedCallback() { 36808 PublisherManager.get(this.formDataProvider).uid.offAssign(this.dispatch); 36809 PublisherManager.get(this.formDataProvider).uid.set(null); 36810 super.disconnectedCallback(); 36811 } 36812 async getUser(options) { 36813 if (this.isFetching) { 36814 this.fetchQueue.push(options); 36815 return; 36816 } 36817 this.isFetching = true; 36818 try { 36819 const api2 = new API(HTML.getApiConfiguration(this)); 36820 if (options.email) { 36821 const resultEmail = await api2.get(`/user?search=${options.email}&limit=${this.limit}`); 36822 const data = resultEmail?.data ?? []; 36823 this.userListFromEmail = data.flat() || []; 36824 } else if (options.lastName || options.firstName || options.structure) { 36825 const resultName = await api2.get( 36826 `/user?search=${options.firstName}${options.lastName ? " " + options.lastName : ""}${options.structure ? " " + options.structure : ""}&limit=${this.limit}` 36827 ); 36828 const data = resultName?.data ?? []; 36829 this.userListFromNameOrFirstName = data.flat() || []; 36830 } 36831 } catch (error) { 36832 console.error("Fetch error:", error); 36833 } finally { 36834 this.isFetching = false;
36835 this.processQueue(); 36836 } 36837 } 36838 async processQueue() { 36839 if (this.fetchQueue.length > 0) { 36840 const nextRequest = this.fetchQueue.shift(); 36841 if (nextRequest) { 36842 await this.getUser(nextRequest); 36843 } 36844 } 36845 } 36846 willUpdate(_changedProperties) { 36847 if (_changedProperties.has("email")) { 36848 if (this.email?.length > 2) { 36849 this.getUser({ email: this.email }); 36850 } else { 36851 this.userListFromEmail = []; 36852 } 36853 } 36854 if (_changedProperties.has("lastName") || _changedProperties.has("firstName") || _changedProperties.has("structure")) { 36855 if (this.lastName.length + this.firstName.length + this.structure.length > 2) { 36856 this.getUser({ lastName: this.lastName, firstName: this.firstName, structure: this.structure }); 36857 } else { 36858 this.userListFromNameOrFirstName = []; 36859 } 36860 } 36861 if (_changedProperties.has("userListFromEmail") || _changedProperties.has("userListFromNameOrFirstName")) { 36862 this.sortAndFilterUserList(); 36863 } 36864 super.willUpdate(_changedProperties); 36865 } 36866 sortAndFilterUserList() { 36867 const pertinence = (user2) => { 36868 let score = 0; 36869 if (user2.email === this.email) score += 3; 36870 if (user2.firstName === this.firstName || user2.lastName === this.lastName) score += 1; 36871 return score; 36872 }; 36873 const userList = [...this.userListFromEmail, ...this.userListFromNameOrFirstName]; 36874 const removeSameID = userList.filter( 36875 (user2, index, self) => self.findIndex((t2) => t2.uid && t2.uid === user2.uid) === index 36876 ); 36877 const sortedList = removeSameID.sort((a2, b2) => pertinence(b2) - pertinence(a2)); 36878 if (sortedList.length > this.limit) { 36879 sortedList.length = this.limit; 36880 } 36881 this.userList = sortedList; 36882 const event = new CustomEvent("found", { 36883 detail: this.userList 36884 }); 36885 this.dispatchEvent(event); 36886 this.matchEmail = this.userListFromEmail.some((user2) => user2.email === this.email); 36887 } 36888 render() { 36889 if (!this.userList.length) { 36890 this.style.display = "none"; 36891 return A$1; 36892 } 36893 this.style.removeProperty("display"); 36894 return b$1`<div 36895 class="@container" 36896 formDataProvider="${this.formDataProvider}" 36897 ${F({ in: v, out: f, stabilizeOut: true })} 36898 > 36899 ${this.matchEmail ? b$1`<div align="left" class="mt-0 mb-4 text-success "> 36900 <sonic-icon library="custom" name="seal-exclamation" class="animate-heartbeat inline-block"></sonic-icon> Un 36901 compte correspond à votre sélection 36902 </div>` : b$1`<div align="left" class="mt-0 mb-4 text-neutral-400 "> 36903 <sonic-icon library="custom" name="face-smile-relaxed"></sonic-icon> Des comptes pourraient correspondre à 36904 votre sélection 36905 </div>`} 36906 <div class="grid grid-cols-1 @lg:grid-cols-2 @xl:grid-cols-3 gap-2 @3xl:grid-cols-4 "> 36907 ${c$1( 36908 this.userList, 36909 (user2) => user2.uid, 36910 (user2) => { 36911 const uid = user2.uid; 36912 if (!uid) return; 36913 const isCurrentEmail = user2?.email === this.email; 36914 return b$1`<sonic-user-selector-item 36915 noAutoFill 36916 dataProvider="userSuggestion/${uid}" 36917 size="xs" 36918 buttonType="button" 36919 ?important="${isCurrentEmail}" 36920 @click=${() => this.dispatch(uid)} 36921 .props=${user2} 36922 ></sonic-user-selector-item>`; 36923 } 36924 )} 36925 </div> 36926 </div>`; 36927 } 36928 }; 36929 SonicUserSuggest.styles = [tailwind]; 36930 __decorateClass$2E([ 36931 n$5({ type: String }) 36932 ], SonicUserSuggest.prototype, "lastName", 2); 36933 __decorateClass$2E([ 36934 n$5({ type: String }) 36935 ], SonicUserSuggest.prototype, "firstName", 2); 36936 __decorateClass$2E([ 36937 n$5({ type: String }) 36938 ], SonicUserSuggest.prototype, "email", 2); 36939 __decorateClass$2E([ 36940 n$5({ type: String }) 36941 ], SonicUserSuggest.prototype, "structure", 2); 36942 __decorateClass$2E([ 36943 n$5({ type: Number }) 36944 ], SonicUserSuggest.prototype, "limit", 2); 36945 __decorateClass$2E([ 36946 r$5() 36947 ], SonicUserSuggest.prototype, "userList", 2); 36948 __decorateClass$2E([ 36949 r$5() 36950 ], SonicUserSuggest.prototype, "userListFromEmail", 2); 36951 __decorateClass$2E([ 36952 r$5() 36953 ], SonicUserSuggest.prototype, "userListFromNameOrFirstName", 2); 36954 __decorateClass$2E([ 36955 n$5({ type: String }) 36956 ], SonicUserSuggest.prototype, "formDataProvider", 2); 36957 __decorateClass$2E([ 36958 r$5() 36959 ], SonicUserSuggest.prototype, "matchEmail", 2); 36960 SonicUserSuggest = __decorateClass$2E([ 36961 t$3(tagName$1A) 36962 ], SonicUserSuggest); 36963 var __defProp$2A = Object.defineProperty; 36964 var __getOwnPropDesc$2D = Object.getOwnPropertyDescriptor; 36965 var __decorateClass$2D = (decorators, target, key, kind) => { 36966 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2D(target, key) : target; 36967 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36968 if (decorator = decorators[i2]) 36969 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36970 if (kind && result) __defProp$2A(target, key, result); 36971 return result; 36972 }; 36973 const tagName$1z = "sonic-purchase-expiration-date"; 36974 let SonicPurchaseExpirationDate = class extends Subscriber$1(i$6) { 36975 constructor() { 36976 super(...arguments); 36977 this.expiration_date = null; 36978 this.expires_at = null; 36979 } 36980 render() { 36981 const date2 = this.expiration_date || this.expires_at; 36982 const now = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3); 36983 const isExpired = date2 && date2 < now; 36984 const text = isExpired ? t("expire_depuis_le") : t("valide_jusqu_au"); 36985 if (!date2) return A$1; 36986 return b$1`<sonic-badge 36987 variant="outline" 36988 type=${isExpired ? "danger" : "success"} 36989 size=${o$4(this.size)} 36990 variant="ghost" 36991 class="font-bold" 36992 > 36993 ${text} 36994 <sonic-date date=${date2} weekday="hidden" month="2-digit" hour="hidden" minute="hidden"></sonic-date> 36995 </sonic-badge>`; 36996 } 36997 }; 36998 SonicPurchaseExpirationDate.styles = [tailwind]; 36999 __decorateClass$2D([ 37000 n$5() 37001 ], SonicPurchaseExpirationDate.prototype, "size", 2); 37002 __decorateClass$2D([ 37003 n$5({ type: Number }) 37004 ], SonicPurchaseExpirationDate.prototype, "expiration_date", 2); 37005 __decorateClass$2D([ 37006 n$5({ type: Number }) 37007 ], SonicPurchaseExpirationDate.prototype, "expires_at", 2); 37008 SonicPurchaseExpirationDate = __decorateClass$2D([ 37009 t$3(tagName$1z) 37010 ], SonicPurchaseExpirationDate); 37011 var __getOwnPropDesc$2C = Object.getOwnPropertyDescriptor; 37012 var __decorateClass$2C = (decorators, target, key, kind) => { 37013 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2C(target, key) : target; 37014 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37015 if (decorator = decorators[i2]) 37016 result = decorator(result) || result; 37017 return result; 37018 }; 37019 let SubscriptionInfo = class extends Subscriber$1(i$6) { 37020 // output 37021 render() { 37022 if (!this.props) return A$1; 37023 const { number, price } = this.props; 37024 const renderLabel = price?.label && price?.label !== this.props.entity?.edito?.title; 37025 return b$1` 37026 <sonic-user-info subDataProvider="owner" mode="subscription" class="block" inert> 37027 <div class="mt-2"> 37028 <sonic-product-title subDataProvider="entity.edito" size="inherit"></sonic-product-title> 37029 <div>${renderLabel ? b$1`<div>${price?.label}</div>` : A$1}</div> 37030 <div class="flex gap-2 flex-wrap items-center"> 37031 ${number ? b$1` <div>N° ${number}</div>` : A$1} 37032 <sonic-purchase-expiration-date size="2xs"></sonic-purchase-expiration-date> 37033 </div> 37034 </div> 37035 </sonic-user-info> 37036 `; 37037 } 37038 }; 37039 SubscriptionInfo.styles = [tailwind]; 37040 SubscriptionInfo = __decorateClass$2C([ 37041 t$3("sonic-subscription-info") 37042 ], SubscriptionInfo); 37043 var __defProp$2z = Object.defineProperty; 37044 var __getOwnPropDesc$2B = Object.getOwnPropertyDescriptor; 37045 var __decorateClass$2B = (decorators, target, key, kind) => { 37046 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2B(target, key) : target; 37047 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37048 if (decorator = decorators[i2]) 37049 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 37050 if (kind && result) __defProp$2z(target, key, result); 37051 return result; 37052 }; 37053 let instanceCounter$b = 0; 37054 let SubscriptionSelector = class extends i$6 { 37055 constructor() { 37056 super(...arguments); 37057 this._searchFormDataProvider = `subscriptionSelectorFormFilters/${instanceCounter$b++}`; 37058 this._searchResultDataProvider = `subscriptionSelectorFormResults/${instanceCounter$b++}`; 37059 this.searchStatus = "valid"; 37060 this.canRenew = false;
37061 this.hideForm = false; 37062 this.hasSearchValue = false; 37063 this.handleSearchFormMutation = () => { 37064 const searchValue = dp(this._searchFormDataProvider).search.get(); 37065 const numberSearch = dp(this._searchFormDataProvider).number_search.get(); 37066 this.hasSearchValue = !!(searchValue || numberSearch); 37067 }; 37068 this._items = (item) => b$1` 37069 <sonic-button 37070 noAutoFill 37071 shape="block" 37072 align="left" 37073 size="xs" 37074 @click=${() => this.selectSubscription(item)} 37075 class="relative" 37076 variant="ghost" 37077 > 37078 <div 37079 class="bg-warning absolute top-0 left-0 w-full h-full pointer-events-none opacity-[.1] rounded-[--sc-btn-rounded]" 37080 ></div> 37081 <sonic-subscription-info class="block py-1 min-h-[7.5rem] min-w-0 relative" inert></sonic-subscription-info> 37082 </sonic-button> 37083 `; 37084 this.selectSubscription = (subscription) => { 37085 const customEvent = new CustomEvent("select", { detail: { subscription } }); 37086 this.dispatchEvent(customEvent); 37087 }; 37088 this._noItemsMarkup = () => { 37089 return b$1`<sonic-no-result size="lg"></sonic-no-result>`; 37090 }; 37091 } 37092 connectedCallback() { 37093 dp(this._searchFormDataProvider).onInternalMutation(this.handleSearchFormMutation); 37094 super.connectedCallback(); 37095 } 37096 disconnectedCallback() { 37097 super.disconnectedCallback(); 37098 dp(this._searchFormDataProvider).set({}); 37099 dp(this._searchFormDataProvider).offInternalMutation(this.handleSearchFormMutation); 37100 } 37101 render() { 37102 const searchParams = new URLSearchParams(); 37103 if (this.pricesTypeIds) { 37104 this.pricesTypeIds.forEach((price) => { 37105 searchParams.append(`prices_type_ids[]`, price.toString()); 37106 }); 37107 } 37108 if (this.subscriptionTypeId) { 37109 searchParams.set(`subscription_type_id`, this.subscriptionTypeId.toString()); 37110 } 37111 if (this.searchStatus) { 37112 searchParams.set(`status`, this.searchStatus); 37113 } 37114 if (this.canRenew) { 37115 searchParams.set(`can_renew`, "true"); 37116 } 37117 const searchParamsStrings = searchParams.toString(); 37118 return b$1`<div class="block @container"> 37119 <div 37120 formDataProvider="${this._searchFormDataProvider}" 37121 class=${this.hideForm ? "hidden" : " flex flex-col @xl:flex-row gap-2"} 37122 > 37123 ${this.hideForm ? b$1`<sonic-input 37124 type="hidden" 37125 name="search" 37126 id="inputSearch" 37127 value=${this.search || ""} 37128 dataProvider="susbcriptionsFilters" 37129 ></sonic-input> 37130 <sonic-input 37131 type="hidden" 37132 name="number_search" 37133 id="inputNumberSearch" 37134 value=${o$4(this.numberSearch)} 37135 dataProvider="susbcriptionsFilters" 37136 ></sonic-input> ` : b$1`<sonic-input 37137 inlineContent 37138 type="search" 37139 name="search" 37140 id="inputSearch" 37141 placeholder="${t("search_subscription")}" 37142 value="" 37143 dataProvider="susbcriptionsFilters" 37144 autocomplete="off" 37145 class="grow" 37146 > 37147 <sonic-icon name="magnifying-glass" library="custom" slot="prefix"></sonic-icon> 37148 </sonic-input> 37149 <sonic-input 37150 name="number_search" 37151 id="inputNumberSearch" 37152 value=${o$4(this.numberSearch)} 37153 dataProvider="susbcriptionsFilters" 37154 class="grow @xl:max-w-60" 37155 autocomplete="off" 37156 inlineContent 37157 placeholder="${t("numero_carte")}" 37158 > 37159 <sonic-icon name="input-numeric" library="custom" slot="prefix"></sonic-icon> 37160 </sonic-input> `} 37161 </div> 37162 37163 <sonic-queue 37164 limit="9" 37165 targetRequestDuration="1000" 37166 dataFilterProvider="${this._searchFormDataProvider}" 37167 dataProvider="${this._searchResultDataProvider}" 37168 dataProviderExpression="/subscriptions?limit=$limit&offset=$offset&features[]=owner&features[]=buyer&features[]=price&${searchParamsStrings}" 37169 key="data" 37170 class="custom-scroll mask-scroll 37171 pb-5 pr-2 pt-2
37172 grid grid-cols-1 @lg:grid-cols-2 @2xl:grid-cols-3 gap-2 max-h-80 37173 items-start 37174 ${this.hasSearchValue ? "" : "hidden"} 37175 " 37176 .items=${this._items} 37177 .noItems=${this._noItemsMarkup} 37178 > 37179 </sonic-queue> 37180 </div>`; 37181 } 37182 }; 37183 SubscriptionSelector.styles = [ 37184 tailwind, 37185 customScroll, 37186 i$9` 37187 .mask-scroll { 37188 mask-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 1)); 37189 } 37190 ` 37191 ]; 37192 __decorateClass$2B([ 37193 n$5({ type: String }) 37194 ], SubscriptionSelector.prototype, "searchStatus", 2); 37195 __decorateClass$2B([ 37196 n$5({ type: Boolean }) 37197 ], SubscriptionSelector.prototype, "canRenew", 2); 37198 __decorateClass$2B([ 37199 n$5({ type: Array }) 37200 ], SubscriptionSelector.prototype, "pricesTypeIds", 2); 37201 __decorateClass$2B([ 37202 n$5({ type: Number }) 37203 ], SubscriptionSelector.prototype, "subscriptionTypeId", 2); 37204 __decorateClass$2B([ 37205 n$5({ type: Boolean }) 37206 ], SubscriptionSelector.prototype, "hideForm", 2); 37207 __decorateClass$2B([ 37208 n$5({ type: String }) 37209 ], SubscriptionSelector.prototype, "search", 2); 37210 __decorateClass$2B([ 37211 n$5({ type: String }) 37212 ], SubscriptionSelector.prototype, "numberSearch", 2); 37213 __decorateClass$2B([ 37214 c({ context: appType, subscribe: true }) 37215 ], SubscriptionSelector.prototype, "appType", 2); 37216 __decorateClass$2B([ 37217 n$5({ type: String }) 37218 ], SubscriptionSelector.prototype, "cartProvider", 2); 37219 __decorateClass$2B([ 37220 r$5() 37221 ], SubscriptionSelector.prototype, "hasSearchValue", 2); 37222 SubscriptionSelector = __decorateClass$2B([ 37223 t$3("sonic-subscription-selector") 37224 ], SubscriptionSelector); 37225 var __defProp$2y = Object.defineProperty; 37226 var __getOwnPropDesc$2A = Object.getOwnPropertyDescriptor; 37227 var __decorateClass$2A = (decorators, target, key, kind) => { 37228 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2A(target, key) : target; 37229 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37230 if (decorator = decorators[i2]) 37231 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 37232 if (kind && result) __defProp$2y(target, key, result); 37233 return result; 37234 }; 37235 const tagName$1y = "sonic-quick-access-card"; 37236 let SonicComponent$g = class SonicComponent extends Subscriber$1(i$6) { 37237 constructor() { 37238 super(...arguments); 37239 this.href = ""; 37240 this.title = ""; 37241 this.icon = ""; 37242 this.target = "_self"; 37243 this.size = "md"; 37244 } 37245 render() { 37246 if (!this.href) return A$1; 37247 return b$1`<a 37248 href=${this.href} 37249 class="card h-full flex justify-between gap-[.5em] shadow-lg hover:shadow transition-[boxShadow_.2s] text-pretty" 37250 target=${this.target} 37251 > 37252 <div> 37253 <div 37254 class="flex items-center gap-[.5em] font-bold break-anywhere ${this.size === "sm" ? "text-[1em]" : "text-[1.15em] mb-[.3em]"}" 37255 > 37256 ${this.icon ? b$1` <sonic-icon 37257 library="custom" 37258 prefix="light" 37259 name=${o$4(this.icon)} 37260 class="${this.size === "sm" ? "text-[1.2em]" : "text-[1.6em]"} shrink-0" 37261 ></sonic-icon>` : A$1} 37262 <div class="text-pretty">${this.title}</div> 37263 </div> 37264 ${this.text && this.size === "md" ? b$1`<div class="text-[max(12px,.8em)] px-[.35em] mb-[.5em]">${this.text}</div>` : A$1} 37265 </div> 37266 <div class="-mr-[.5em] ${this.size === "md" ? "self-end -mb-[.5em]" : "self-center -my-[.5em]"} "> 37267 <sonic-button shape="circle" data-aria-label=${o$4(t("link_title_more_about"))} inert size=${this.size}> 37268 <sonic-icon library="custom" prefix="regular" name="arrow-right"></sonic-icon> 37269 </sonic-button> 37270 </div> 37271 </a>`; 37272 } 37273 }; 37274 SonicComponent$g.styles = [ 37275 tailwind, 37276 i$9` 37277 :host { 37278 --card-base: var(--sc-card-base, var(--sc-base-900)); 37279 --card-content: var(--sc-card-content, var(--sc-base-content)); 37280 } 37281 37282 :host([type="default"]) { 37283 --card-base: var(--sc-base-900); 37284 } 37285 37286 :host([type="primary"]) { 37287 --card-base: var(--sc-primary); 37288 } 37289 :host([type="warning"]) { 37290 --card-base: var(--sc-warning); 37291 } 37292 :host([type="danger"]) { 37293 --card-base: var(--sc-danger); 37294 } 37295 :host([type="info"]) { 37296 --card-base: var(--sc-info); 37297 } 37298 :host([type="success"]) { 37299 --card-base: var(--sc-success); 37300 } 37301 :host([type="neutral"]) { 37302 --card-base: var(--sc-base-600); 37303 } 37304 37305 .card { 37306 position: relative; 37307 padding: 1rem; 37308 border-radius: var(--sc-rounded-md); 37309 overflow: hidden; 37310 color: var(--card-content); 37311 } 37312 .card::before { 37313 content: ""; 37314 position: absolute; 37315 top: 0; 37316 left: 0; 37317 right: 0; 37318 bottom: 0; 37319 opacity: 0.1; 37320 background-color: var(--card-base); 37321 transition: opacity 0.2s; 37322 } 37323 .card:hover::before { 37324 opacity: 0.15; 37325 } 37326 37327 .break-anywhere {
37328 overflow-wrap: anywhere; /* word break flexbox*/ 37329 } 37330 ` 37331 ]; 37332 __decorateClass$2A([ 37333 n$5() 37334 ], SonicComponent$g.prototype, "href", 2); 37335 __decorateClass$2A([ 37336 n$5() 37337 ], SonicComponent$g.prototype, "title", 2); 37338 __decorateClass$2A([ 37339 n$5() 37340 ], SonicComponent$g.prototype, "text", 2); 37341 __decorateClass$2A([ 37342 n$5() 37343 ], SonicComponent$g.prototype, "icon", 2); 37344 __decorateClass$2A([ 37345 n$5() 37346 ], SonicComponent$g.prototype, "target", 2); 37347 __decorateClass$2A([ 37348 n$5({ type: String }) 37349 ], SonicComponent$g.prototype, "size", 2); 37350 SonicComponent$g = __decorateClass$2A([ 37351 t$3(tagName$1y) 37352 ], SonicComponent$g); 37353 var __defProp$2x = Object.defineProperty; 37354 var __getOwnPropDesc$2z = Object.getOwnPropertyDescriptor; 37355 var __decorateClass$2z = (decorators, target, key, kind) => { 37356 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2z(target, key) : target; 37357 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37358 if (decorator = decorators[i2]) 37359 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 37360 if (kind && result) __defProp$2x(target, key, result); 37361 return result; 37362 }; 37363 let instanceCounter$a = 0; 37364 let SubscriptionAttachForm = class extends i$6 { 37365 constructor() { 37366 super(...arguments); 37367 this.formDataProvider = `newSubscriptionAttachForm/${instanceCounter$a++}`; 37368 this._linkEndpoint = ""; 37369 this.needPartnerSubscription = false; 37370 this._currentSubscription = null; 37371 this._siblingsWithoutParent = []; 37372 this._compatibleSubscriptions = []; 37373 this._compatibleSubscriptionsRequestId = 0; 37374 this._presetFormDataProvider = "AttachToSiblingsPreset" + instanceCounter$a++; 37375 this.partnerOptions = []; 37376 this.refreshCompatibleSubscriptions = async () => { 37377 const requestId = ++this._compatibleSubscriptionsRequestId; 37378 const subscriptions = await this.updateCompatibleSubscriptions(); 37379 if (requestId !== this._compatibleSubscriptionsRequestId) { 37380 return; 37381 } 37382 this._compatibleSubscriptions = subscriptions; 37383 }; 37384 this.onCartAssign = () => { 37385 void this.refreshCompatibleSubscriptions(); 37386 }; 37387 this.updateCompatibleSubscriptions = async () => { 37388 const api2 = new API(HTML$1.getApiConfiguration(this)); 37389 const itemId = this.item?.id; 37390 const cartProvider = this.cartProvider; 37391 if (!cartProvider || !itemId) return []; 37392 const params = new URLSearchParams(); 37393 params.append("features[]", "owner"); 37394 params.append("features[]", "buyer"); 37395 params.append("features[]", "price"); 37396 const result = await api2.get( 37397 `${cartProvider}/items/${itemId}/compatible-subscriptions?${params.toString()}` 37398 ); 37399 if (result.success && result.data && Array.isArray(result.data)) { 37400 return result.data; 37401 } 37402 return []; 37403 }; 37404 this.unlinkSubscription = async () => { 37405 const itemId = this.item?.id; 37406 if (!itemId || !this.cartProvider) return; 37407 Cart.patchItems({ 37408 apiConfiguration: HTML$1.getApiConfiguration(this), 37409 cartProvider: this.cartProvider, 37410 query: { 37411 ids: [itemId] 37412 }, 37413 body: { parent_id: "0" } 37414 }).then((result) => { 37415 if (result === "asRequested") { 37416 this._currentSubscription = null; 37417 if (this.item?.parent_id) { 37418 this.item.parent_id = null; 37419 } 37420 } 37421 }); 37422 }; 37423 } 37424 connectedCallback() { 37425 if (this.cartProvider) { 37426 dp(this.cartProvider).data.onAssign(this.onCartAssign); 37427 this._linkEndpoint = `${this.cartProvider}/items/link`; 37428 } 37429 super.connectedCallback(); 37430 } 37431 disconnectedCallback() { 37432 super.disconnectedCallback(); 37433 if (this.cartProvider) { 37434 dp(this.cartProvider).data.offAssign(this.onCartAssign); 37435 } 37436 } 37437 async willUpdate(_changedProperties) { 37438 if (_changedProperties.has("item") || _changedProperties.has("cartProvider")) { 37439 if (this.item?.id) { 37440 dp(this.formDataProvider).ids.set([this.item?.id]); 37441 } 37442 if (this.item?.price?.id) { 37443 this._siblingsWithoutParent = dp(this.cartProvider || "").data?.items?.get()?.filter((item) => { 37444 const noParentId = !item.parent_id; 37445 const isSamePrice = item.price?.id === this.item?.price?.id; 37446 const isSameEntity = item.entity_type === this.item?.entity_type && item.entity_id === this.item?.entity_id; 37447 return isSamePrice && isSameEntity && noParentId; 37448 }); 37449 } 37450 if (this.cartProvider && this.item?.id) { 37451 void this.refreshCompatibleSubscriptions(); 37452 } else { 37453 this._compatibleSubscriptions = []; 37454 } 37455 } 37456 if (_changedProperties.has("needPartnerSubscription")) { 37457 this.getPartnerOptions().then((options) => { 37458 this.partnerOptions = options; 37459 }); 37460 } 37461 super.willUpdate(_changedProperties); 37462 } 37463 render() { 37464 const currentPriceTypeId = this.item?.price?.price_type_id; 37465 const { entity_type, entity_id } = this.item || {}; 37466 if (!currentPriceTypeId || !entity_type || !entity_id || !this.item) return A$1; 37467 return b$1` ${productPriceSummary({ lineItemCart: this.item, className: "mb-4" })} 37468 ${this.appType === "counter" && this._siblingsWithoutParent.length > 1 ? b$1` 37469 <div class="mt-6 mb-3" formDataProvider=${this._presetFormDataProvider}> 37470 <sonic-checkbox name="applyToSiblings" value=${true} unique size="lg">
37471 <span class="font-bold" 37472 >Associer les ${this._siblingsWithoutParent.length} places au même détenteur</span 37473 > 37474 </sonic-checkbox> 37475 </div> 37476 ` : A$1} 37477 <div class="block @container"> 37478 ${this.needPartnerSubscription ? this.subscriptionForm(this.needPartnerSubscription) : b$1` 37479 ${this.subscriptionSuggestions()} 37480 ${this.appType === "counter" ? b$1` 37481 <sonic-divider class="text-sm text-neutral-500 my-3 " align="left" 37482 >${t("owner_already_registered_this_season")} 37483 </sonic-divider> 37484 37485 <sonic-subscription-selector 37486 class="border-dashed border-neutral-200 block" 37487 size="md" 37488 @select=${(e2) => this.linkSubscriptionPurchase(e2.detail.subscription)} 37489 .pricesTypeIds=${[currentPriceTypeId]} 37490 ></sonic-subscription-selector> 37491 ` : A$1} 37492 ${this.appType === "customer" ? b$1`${this.newSubscription()} ${this.subscriptionForm()} ` : A$1} 37493 `} 37494 </div>`; 37495 } 37496 getIdsToAttach() { 37497 const attachToSiblings = !!dp(this._presetFormDataProvider).applyToSiblings.get(); 37498 const itemId = this.item?.id; 37499 if (!itemId || !this.item) return []; 37500 if (attachToSiblings) { 37501 const siblingsItems = this._siblingsWithoutParent; 37502 return [this.item, ...siblingsItems].map((item) => item?.id || ""); 37503 } 37504 return [this.item].map((item) => item?.id || ""); 37505 } 37506 async attachCartSubscription(subscriptionId) { 37507 const idsToAttach = this.getIdsToAttach(); 37508 if (!subscriptionId || !this.cartProvider || !idsToAttach.length) return; 37509 const isInCart = subscriptionId.startsWith("subscription-tmp"); 37510 let body = {}; 37511 if (isInCart) { 37512 body = { parent_id: String(subscriptionId) }; 37513 } 37514 Cart.patchItems({ 37515 apiConfiguration: HTML$1.getApiConfiguration(this), 37516 cartProvider: this.cartProvider, 37517 query: { 37518 ids: idsToAttach 37519 }, 37520 body 37521 }).then((result) => { 37522 if (result === "asRequested") { 37523 const event = new CustomEvent("attach", { 37524 detail: { itemIds: this.getIdsToAttach() } 37525 }); 37526 this.dispatchEvent(event); 37527 this.closeParentModal(); 37528 } 37529 }); 37530 } 37531 closeParentModal() { 37532 const parentModal = HTML$1.getClosestElement(this, "sonic-modal"); 37533 if (parentModal) { 37534 parentModal.hide(); 37535 } 37536 } 37537 handleSubmit(e2) { 37538 const result = e2.detail; 37539 if (result.success && this.cartProvider) { 37540 dp(this.cartProvider).set(result); 37541 this.closeParentModal(); 37542 } 37543 } 37544 async getPartnerOptions() { 37545 const api2 = new API(HTML$1.getApiConfiguration(this)); 37546 const result = await api2.get(`/partners`); 37547 if (result.success && result.data) { 37548 const data = result.data ?? []; 37549 const options = data.map((partner) => ({ 37550 wording: partner.title || "", 37551 value: Number(partner.id) 37552 })) || []; 37553 if (options.length > 1) { 37554 const defaultOption = { 37555 wording: t("LIB_choose_organisation"), 37556 value: "" 37557 }; 37558 options.unshift(defaultOption); 37559 } 37560 return options; 37561 } 37562 return []; 37563 } 37564 async linkSubscriptionPurchase(subscription) { 37565 const idsToAttach = this.getIdsToAttach(); 37566 if (!idsToAttach.length) return; 37567 const subscriptionNumber = "number" in subscription ? subscription.number : void 0; 37568 const email2 = subscription.owner?.email; 37569 if (!subscriptionNumber || !this.cartProvider || !email2) return; 37570 Loader.show(); 37571 const api2 = new API(HTML$1.getApiConfiguration(this)); 37572 const result = await api2.post(this._linkEndpoint, { 37573 ids: idsToAttach, 37574 subscription_id: subscription.id, 37575 number: subscriptionNumber, 37576 email: email2 37577 }); 37578 if (result?.success) { 37579 dp(this.cartProvider).set(result); 37580 const event = new CustomEvent("attach", { 37581 detail: { itemIds: this.getIdsToAttach() } 37582 }); 37583 this.dispatchEvent(event);
37584 this.closeParentModal(); 37585 } 37586 Loader.hide(); 37587 } 37588 // subscriptionForm :: NEW OWNER 37589 subscriptionForm(needPartnerSubscription) { 37590 const isCounter = this.appType === "counter"; 37591 const cartProvider = this.cartProvider; 37592 const currentItemId = this.item?.id; 37593 if (!cartProvider || !currentItemId) return A$1; 37594 const title = needPartnerSubscription ? t("LIB_associer_un_abonnement_partenaire") : t("owner_already_registered_this_season"); 37595 const notLoggedIn = !this.userId; 37596 const disallowEventsForSoldSubscription = this.appType === "customer" && this.disallowEventsForSoldSubscription?.active; 37597 if (disallowEventsForSoldSubscription) { 37598 return b$1`<sonic-alert status="info"> ${t("LIB_reserved_for_new_subscriptions")} </sonic-alert>`; 37599 } 37600 return b$1` 37601 <sonic-divider class="text-sm text-neutral-500 mb-3" align="left">${title}</sonic-divider> 37602 37603 <div formDataProvider=${this.formDataProvider} class="@container"> 37604 <div class="grid grid-cols-1 @2xl:flex items-end w-full gap-3"> 37605 <sonic-submit 37606 endPoint=${this._linkEndpoint} 37607 @submit=${this.handleSubmit} 37608 method="post" 37609 class="w-full" 37610 onEnterKey 37611 > 37612 <div class="grid grid-cols-1 @2xl:flex items-end w-full gap-3 grow "> 37613 ${needPartnerSubscription ? b$1` <sonic-select 37614 class="grow" 37615 label="${t("LIB_partner_organisation")}" 37616 name="partner_id" 37617 .options=${this.partnerOptions} 37618 ></sonic-select>` : A$1} 37619 <sonic-input class="grow" autocomplete="off" type="text" name="number" label="${t("numero_de_carte")}"> 37620 </sonic-input> 37621 <sonic-input 37622 class="grow" 37623 autocomplete="${isCounter ? "off" : "email"}" 37624 type="email" 37625 name="email" 37626 label="${t("email")}" 37627 ></sonic-input> 37628 </div> 37629 </sonic-submit> 37630 <sonic-submit 37631 @submit=${this.handleSubmit} 37632 endPoint=${this._linkEndpoint} 37633 method="post" 37634 class="shrink-0" 37635 onClick 37636 > 37637 <sonic-button type="primary" shape="block" class="block @2xl:hidden"> 37638 <sonic-icon name="check" library="custom"></sonic-icon> 37639 ${t("enregistrer")} 37640 </sonic-button> 37641 37642 <sonic-tooltip label="${t("enregistrer")}" class="hidden @2xl:block"> 37643 <sonic-button type="primary" shape="block" noAutoFill> 37644 <sonic-icon name="check" library="custom"></sonic-icon> 37645 </sonic-button> 37646 </sonic-tooltip> 37647 </sonic-submit> 37648 </div> 37649 ${!needPartnerSubscription && notLoggedIn ? b$1` 37650 <sonic-app-link 37651 to="account" 37652 size="xs" 37653 variant="link" 37654 type="info" 37655 class="inline-block mb-4 mt-4 @2xl:mt-2 " 37656 > 37657 <sonic-icon name="arrow-right-to-arc" library="custom" slot="prefix"></sonic-icon> 37658 ${t("LIB_se_connecter_pour_retrouver_mon_numero", true)} 37659 </sonic-app-link> 37660 ` : A$1} 37661 </div> 37662 `; 37663 } 37664 newSubscription() { 37665 const urlParams = new URLSearchParams(window.location.search); 37666 let subscriptionHref = appRoute("subscription").toString(); 37667 if (urlParams.get("sonic_subscription_legacy_href")) { 37668 subscriptionHref = urlParams.get("sonic_subscription_legacy_href") || ""; 37669 subscriptionHref = decodeURIComponent(subscriptionHref); 37670 } 37671 const isWaitingList2 = dp(this.cartProvider || "").data?.cartType?.get() === CartType.WaitingLists; 37672 if (isWaitingList2) { 37673 return A$1; 37674 } 37675 return b$1` 37676 ${this.subscriptionAccess && subscriptionHref ? b$1` <sonic-divider class="mb-3 text-sm text-neutral-500" align="left"> 37677 ${t("LIB_pas_encore_abonne_pour_cette_saison")}
37678 </sonic-divider> 37679 37680 <sonic-quick-access-card 37681 class="block flex-grow lg:max-w-[25rem] mb-10 " 37682 type="warning" 37683 title=${t("onglet_home_abonnements")} 37684 text=${o$4(t("module_subscription_summary"))} 37685 icon="address-card" 37686 href=${subscriptionHref} 37687 @click=${() => { 37688 this.closeParentModal(); 37689 }} 37690 > 37691 </sonic-quick-access-card>` : A$1} 37692 `; 37693 } 37694 subscriptionSuggestions() { 37695 if (!this._compatibleSubscriptions.length) return A$1; 37696 let text = t("LIB_subscription_suggestions_title"); 37697 if (this.appType === "counter") { 37698 text = t("LIB_subscription_suggestions_title_counter"); 37699 } 37700 return b$1`<sonic-divider class="text-sm text-neutral-500 my-3" align="left"> ${text} </sonic-divider> 37701 <div class="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] w-full gap-3 mb-10"> 37702 ${c$1( 37703 this._compatibleSubscriptions, 37704 (subscription) => subscription.id?.toString() ?? "", 37705 (subscription) => this.subscriptionSuggestionItem(subscription) 37706 )} 37707 </div>`; 37708 } 37709 removePrefix(id) { 37710 if (!id) return ""; 37711 return id.replace("subscription-tmp_", "")?.replace("subscription_", ""); 37712 } 37713 subscriptionSuggestionItem(subscription) { 37714 const subscriptionId = subscription.id?.toString(); 37715 const isInCart = subscriptionId && subscriptionId.startsWith("subscription-tmp"); 37716 const subIdWithoutPrefix = this.removePrefix(subscriptionId); 37717 const parentIdWithoutPrefix = this.removePrefix(this.item?.parent_id || void 0); 37718 const isActive = subIdWithoutPrefix === parentIdWithoutPrefix; 37719 const canDetach = !isSubscriptionRequired(this.subscriptionRequirement, this.appType); 37720 if (!isInCart) { 37721 const linkedSubs = dp(this.cartProvider || "").data?.linked_subscriptions?.get(); 37722 const targetPurchaseId = this.removePrefix(subscriptionId); 37723 const linkedSubscription = linkedSubs?.find( 37724 (ls) => targetPurchaseId && String(ls.id) === String(targetPurchaseId) 37725 ); 37726 if (linkedSubscription) { 37727 subscription = linkedSubscription; 37728 } 37729 } else { 37730 const entitiesInCart = dp(this.cartProvider || "").data?.entities?.get(); 37731 const entityId = "entity_id" in subscription ? subscription?.entity_id : void 0; 37732 const entity = "entity_id" in subscription ? entitiesInCart.filter((entity2) => entity2.entity_type === EntityType.Subscribe).find((entity2) => { 37733 const matchId = entity2.id?.toString() === entityId; 37734 return matchId; 37735 }) : void 0; 37736 subscription = { ...subscription, ...entity ? { entity } : {} }; 37737 } 37738 return b$1`<sonic-tooltip label="${isActive ? canDetach ? t("unlink") : "" : t("attach")}" class="w-full block"> 37739 ${isActive && canDetach ? b$1`<sonic-button 37740 type="danger" 37741 shape="circle" 37742 size="xs" 37743 noAutoFill 37744 icon 37745 class="absolute -top-2 right-2 z-10 pointer-events-none" 37746 > 37747 <sonic-icon name="link-slash" library="custom" prefix="solid"></sonic-icon 37748 ></sonic-button>` : A$1} 37749 <sonic-button 37750 ?active=${isActive} 37751 shape="block" 37752 align="left" 37753 size="xs" 37754 variant="${isActive ? "outline" : "ghost"}" 37755 @click=${() => { 37756 if (isActive) { 37757 if (canDetach) { 37758 this.unlinkSubscription(); 37759 } 37760 return; 37761 } 37762 if (isInCart) { 37763 this.attachCartSubscription(subscriptionId); 37764 } else { 37765 this.linkSubscriptionPurchase(subscription); 37766 } 37767 }} 37768 > 37769 ${!isActive ? b$1` 37770 <div 37771 class="bg-warning absolute top-0 left-0 w-full h-full pointer-events-none opacity-[.1] rounded-[--sc-btn-rounded]" 37772 ></div> 37773 ` : A$1} 37774 <sonic-subscription-info 37775 noAutoFill 37776 dataProvider="/subscriptionSuggestion/${subscription.id}" 37777 .props=${subscription} 37778 class="block py-1 self-start min-h-24 min-w-0 relative" 37779 ></sonic-subscription-info> </sonic-button 37780 ></sonic-tooltip>`; 37781 } 37782 }; 37783 SubscriptionAttachForm.styles = [tailwind, customScroll]; 37784 __decorateClass$2z([ 37785 n$5({ type: Boolean }) 37786 ], SubscriptionAttachForm.prototype, "needPartnerSubscription", 2); 37787 __decorateClass$2z([ 37788 n$5({ type: Object }) 37789 ], SubscriptionAttachForm.prototype, "item", 2); 37790 __decorateClass$2z([ 37791 n$5({ type: String }) 37792 ], SubscriptionAttachForm.prototype, "cartProvider", 2); 37793 __decorateClass$2z([ 37794 c({ context: appType, subscribe: true }) 37795 ], SubscriptionAttachForm.prototype, "appType", 2); 37796 __decorateClass$2z([ 37797 bind$1("user.id"), 37798 n$5({ type: String }) 37799 ], SubscriptionAttachForm.prototype, "userId", 2); 37800 __decorateClass$2z([ 37801 r$5()
37802 ], SubscriptionAttachForm.prototype, "_currentSubscription", 2); 37803 __decorateClass$2z([ 37804 r$5() 37805 ], SubscriptionAttachForm.prototype, "_siblingsWithoutParent", 2); 37806 __decorateClass$2z([ 37807 bind$1("settings.modules.subscription.access"), 37808 n$5({ type: Boolean }) 37809 ], SubscriptionAttachForm.prototype, "subscriptionAccess", 2); 37810 __decorateClass$2z([ 37811 bind$1("settings.subscriptionRequirement"), 37812 r$5() 37813 ], SubscriptionAttachForm.prototype, "subscriptionRequirement", 2); 37814 __decorateClass$2z([ 37815 r$5() 37816 ], SubscriptionAttachForm.prototype, "_compatibleSubscriptions", 2); 37817 __decorateClass$2z([ 37818 r$5() 37819 ], SubscriptionAttachForm.prototype, "partnerOptions", 2); 37820 __decorateClass$2z([ 37821 bind$1("settings.disallowEventsForSoldSubscription"), 37822 r$5() 37823 ], SubscriptionAttachForm.prototype, "disallowEventsForSoldSubscription", 2); 37824 SubscriptionAttachForm = __decorateClass$2z([ 37825 t$3("sonic-subscription-attach-form") 37826 ], SubscriptionAttachForm); 37827 var __defProp$2w = Object.defineProperty; 37828 var __getOwnPropDesc$2y = Object.getOwnPropertyDescriptor; 37829 var __decorateClass$2y = (decorators, target, key, kind) => { 37830 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2y(target, key) : target; 37831 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37832 if (decorator = decorators[i2]) 37833 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 37834 if (kind && result) __defProp$2w(target, key, result); 37835 return result; 37836 }; 37837 const tagName$1x = "sonic-cart-item-line-detail-actions"; 37838 let CartItemLineDetailActions = class extends i$6 { 37839 constructor() { 37840 super(...arguments); 37841 this.cartProvider = "cart/current"; 37842 this.mode = "default"; 37843 this.canEditPriceFlag = false; 37844 } 37845 willUpdate(changedProperties) { 37846 super.willUpdate(changedProperties); 37847 if (changedProperties.has("mode") || changedProperties.has("item")) { 37848 this.canEditPriceFlag = canEditPrice(this.mode, this.item?.entity_type); 37849 } 37850 } 37851 get actionContext() { 37852 return { 37853 cartProvider: this.cartProvider, 37854 accessParams: this.accessParams, 37855 cartType: this.cartType 37856 }; 37857 } 37858 getApiConfiguration() { 37859 return HTML.getApiConfiguration(this); 37860 } 37861 render() { 37862 const item = this.item; 37863 const itemId = item?.id; 37864 if (!itemId || !item) return A$1; 37865 const ctx = this.actionContext; 37866 const needSubscription = item.price?.need_subscription || item.price?.need_partner_subscription; 37867 const canDelete = item.canDelete; 37868 const hasSeat = !!item.seat?.id; 37869 const sessionId = item.entity_type === EntityType.Event ? item.entity_id : 0; 37870 const canDetach = !isSubscriptionRequired(this.subscriptionRequirement, this.appType); 37871 const removeQuery = buildDetailRemoveQuery(itemId); 37872 const onRemove = () => removeCartItems(this, this.cartProvider, removeQuery); 37873 return renderActionMenuShell({ 37874 triggerIcon: "pen", 37875 menuMinWidth: "16rem", 37876 trashButton: canDelete ? renderTrashButton(onRemove) : void 0, 37877 menuItems: b$1` 37878 ${renderChangeEventSessionItems({ 37879 ctx, 37880 lineItems: [item], 37881 query: removeQuery, 37882 api: this, 37883 isMultiSession: isMultiSessionLineItem(this.cartProvider, item) 37884 })} 37885 ${this.canEditPriceFlag ? renderEditPriceItem(ctx, [item]) : A$1} 37886 ${renderEditOwnerItem(item, this.cartProvider, !!needSubscription)} 37887 ${hasSeat && sessionId ? b$1`<sonic-divider></sonic-divider>${renderSeatmapMenuItems(ctx, Number(sessionId))}` : A$1} 37888 ${item.parent_id ? renderUnlinkItem({ api: this, cartProvider: this.cartProvider, itemId, canDetach }) : A$1} 37889 ${canDelete ? renderRemoveMenuItem(onRemove, true) : A$1} 37890 ` 37891 }); 37892 } 37893 }; 37894 CartItemLineDetailActions.styles = [ 37895 tailwind, 37896 i$9` 37897 :host { 37898 display: flex; 37899 } 37900 ` 37901 ]; 37902 __decorateClass$2y([ 37903 n$5({ type: Object }) 37904 ], CartItemLineDetailActions.prototype, "item", 2); 37905 __decorateClass$2y([ 37906 ancestorAttribute("cartProvider") 37907 ], CartItemLineDetailActions.prototype, "cartProvider", 2); 37908 __decorateClass$2y([ 37909 c({ context: modeContext, subscribe: true }), 37910 n$5({ type: String }) 37911 ], CartItemLineDetailActions.prototype, "mode", 2); 37912 __decorateClass$2y([ 37913 r$5() 37914 ], CartItemLineDetailActions.prototype, "canEditPriceFlag", 2); 37915 __decorateClass$2y([ 37916 c({ context: cartTypeContext, subscribe: true }), 37917 n$5({ type: String }) 37918 ], CartItemLineDetailActions.prototype, "cartType", 2); 37919 __decorateClass$2y([ 37920 c({ context: accessParamsContext, subscribe: true }), 37921 n$5({ type: Object }) 37922 ], CartItemLineDetailActions.prototype, "accessParams", 2); 37923 __decorateClass$2y([ 37924 bind$1("settings.subscriptionRequirement"), 37925 r$5() 37926 ], CartItemLineDetailActions.prototype, "subscriptionRequirement", 2); 37927 __decorateClass$2y([ 37928 c({ context: appType, subscribe: true }), 37929 n$5({ type: String }) 37930 ], CartItemLineDetailActions.prototype, "appType", 2); 37931 CartItemLineDetailActions = __decorateClass$2y([ 37932 t$3(tagName$1x) 37933 ], CartItemLineDetailActions); 37934 var __defProp$2v = Object.defineProperty; 37935 var __getOwnPropDesc$2x = Object.getOwnPropertyDescriptor; 37936 var __decorateClass$2x = (decorators, target, key, kind) => { 37937 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2x(target, key) : target; 37938 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37939 if (decorator = decorators[i2]) 37940 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 37941 if (kind && result) __defProp$2v(target, key, result); 37942 return result; 37943 }; 37944 let SonicCartItemLine$2 = class SonicCartItemLine extends Subscriber$1(i$6) { 37945 constructor() { 37946 super(...arguments); 37947 this.mode = "default"; 37948 this.entity_type = null; 37949 this.price = {}; 37950 this.quota = null; 37951 this.owner = null; 37952 this.infos = null; 37953 this.placeCategory = null; 37954 this.seat = null; 37955 this.messages = []; 37956 this.canEditPrice = false;
37957 this._cartProvider = ""; 37958 } 37959 connectedCallback() { 37960 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 37961 super.connectedCallback(); 37962 } 37963 willUpdate(changedProperties) { 37964 if (changedProperties.has("mode") || changedProperties.has("cartType")) { 37965 this.canEditPrice = this.mode == "default" && this.entity_type !== EntityType.AdditionalProduct && this.entity_type !== EntityType.Subscribe; 37966 } 37967 super.willUpdate(changedProperties); 37968 } 37969 // 37970 // RENDER 37971 // LAYOUT GLOBAL 37972 render() { 37973 const quotaName = this.quota?.title || ""; 37974 const displayQuota = this.quota?.id && this.quota.id > 1 && quotaName ? true : false; 37975 const itemsToMove = this.props && Object.keys(this.props).length !== 0 ? [this.props] : []; 37976 const canEditLabel = this.canEditPrice ? t("edit_price") : ""; 37977 if (!this.props) return A$1; 37978 return b$1` 37979 <div 37980 class=" 37981 @container 37982 flex w-full items-start gap-2 37983 min-h-6 37984 rounded 37985 px-1 37986 py-2 37987 group 37988 hover:bg-[rgba(0,0,0,.02)] 37989 " 37990 > 37991 <div class=" self-center text-xs @lg:text-sm leading-tight grow items-start "> 37992 <div class="flex flex-wrap gap-x-[0.35em] w-full mb-[2px]"> 37993 <div 37994 @click=${() => { 37995 if (this.canEditPrice) { 37996 editPriceModal({ 37997 lineItems: this.props ? [this.props] : [], 37998 cartProvider: this._cartProvider, 37999 accessParams: this.accessParams 38000 }); 38001 } 38002 }} 38003 class="${this.canEditPrice ? "cursor-pointer hover:underline" : ""}" 38004 title=${o$4(canEditLabel)} 38005 > 38006 ${categoryMarkup(this.price)} ${this.price.label} 38007 </div> 38008 </div> 38009 <div class="text-xs"> 38010 ${displayQuota ? b$1`<sonic-badge size="inherit" class="mr-2">${quotaName}</sonic-badge>` : A$1} 38011 ${placementMarkup([this.props], "default")} 38012 ${this.price?.is_countermark ? b$1`<sonic-badge type="warning" size="xs" class="mr-2" variant="ghost"> 38013 <sonic-icon name="file-exclamation" library="custom" slot="prefix"></sonic-icon> 38014 <div class="text-balance">${t("contremarque_echanger_guichet")}</div> 38015 </sonic-badge>` : A$1} 38016 </div> 38017 38018 ${this.messages && this.messages.length > 0 ? b$1`<sonic-cart-item-line-messages class="my-2 block " size="xs"></sonic-cart-item-line-messages>` : A$1} 38019 <div class="text-xs">${this.renderOwner()}</div> 38020 </div> 38021 <div class="inline-flex gap-1 justify-end items-center ml-auto min-h-[2.1em]"> 38022 <div class="text-sm text-right leading-none font-bold">
38022${formatAmount(this.price?.amount || 0)}</div> 38023 ${this.mode == "split" || this.mode == "splitResult" ? b$1`<sonic-cart-move-items-button size="xs" .lineItems=${itemsToMove}></sonic-cart-move-items-button>` : A$1} 38024 ${this.mode == "default" ? b$1` 38025 <sonic-cart-item-line-detail-actions 38026 .item=${this.props} 38027 class="w-[4.45rem] flex justify-end shrink-0" 38028 ></sonic-cart-item-line-detail-actions> 38029 ` : A$1} 38030 </div> 38031 </div> 38032 `; 38033 } 38034 renderOwner() { 38035 if (!this.props) return A$1; 38036 const owner = this.props.owner; 38037 const { firstName, lastName, email: email2 } = owner || {}; 38038 const fancyLastName = lastName ? b$1`<span class="uppercase">${lastName}</span>` : ""; 38039 const has_error_owner = this.props?.has_error_owner; 38040 const ownerIsEmpty = !owner || !firstName && !lastName && !email2; 38041 const hasOwnerData = !ownerIsEmpty; 38042 const needSubscription = this.props?.price?.need_subscription || this.props?.price?.need_partner_subscription; 38043 let icon2 = ownerIcon(owner); 38044 if (needSubscription) { 38045 icon2 = b$1`<sonic-icon name="id-card" prefix="regular" library="custom" class="shrink-0"></sonic-icon>`; 38046 } else if (ownerIsEmpty) { 38047 icon2 = b$1`<sonic-icon name="circle-plus" prefix="regular" library="custom" class="shrink-0"></sonic-icon>`; 38048 } else if (!has_error_owner && !needSubscription) { 38049 icon2 = ownerIcon(owner, "shrink-0"); 38050 } 38051 const disabled = !this.canEditPrice; 38052 if (hasOwnerData) { 38053 return b$1`<button 38054 size="inherit" 38055 class="mt-1 flex gap-1 text-left ${disabled ? "text-neutral-500" : "text-info"}" 38056 ?inert=${disabled} 38057 @click=${() => { 38058 attachOwnerModal({ items: this.props ? [this.props] : [], cartProvider: this._cartProvider }); 38059 }} 38060 > 38061 <span class="shrink-0 ">${icon2}</span> 38062 <span class="grow text-left">${fancyLastName} ${firstName} ${email2 ? `⢠${email2}` : ""}</span> 38063 </button>`; 38064 } 38065 if (!this.props?.owner_required || this.mode != "default") return A$1; 38066 let buttonText = t("edit_owner"); 38067 if (ownerIsEmpty && !this.props?.parent_id) { 38068 buttonText = t("add_owner"); 38069 } 38070 const isCondensed = this.layout == "condensed"; 38071 const isCounter = this.appType === "counter"; 38072 let buttonType = "danger"; 38073 if (isCounter && this.entity_type === EntityType.Event && !needSubscription) { 38074 buttonType = "info"; 38075 } else if (this.props?.parent_id && ownerIsEmpty) { 38076 buttonType = "warning"; 38077 } 38078 return b$1`<sonic-button 38079 @click=${() => { 38080 attachOwnerModal({ items: this.props ? [this.props] : [], cartProvider: this._cartProvider }); 38081 }} 38082 size="${isCondensed ? "2xs" : "xs"}" 38083 variant="outline" 38084 type="${buttonType}" 38085 class="mt-1 mb-2 " 38086 data-aria-label=${buttonText} 38087 > 38088 <div class="flex gap-1"> 38089 ${icon2} 38090 <div>${buttonText}</div> 38091 </div> 38092 </sonic-button>`; 38093 } 38094 }; 38095 SonicCartItemLine$2.styles = [ 38096 tailwind, 38097 i$9` 38098 :host { 38099 display: block; 38100 } 38101 ` 38102 ]; 38103 __decorateClass$2x([ 38104 c({ context: appType, subscribe: true }), 38105 n$5({ type: String }) 38106 ], SonicCartItemLine$2.prototype, "appType", 2); 38107 __decorateClass$2x([ 38108 c({ context: modeContext, subscribe: true }), 38109 n$5({ type: String }) 38110 ], SonicCartItemLine$2.prototype, "mode", 2); 38111 __decorateClass$2x([ 38112 c({ context: layoutContext, subscribe: true }), 38113 n$5({ type: String }) 38114 ], SonicCartItemLine$2.prototype, "layout", 2); 38115 __decorateClass$2x([ 38116 n$5({ type: String }) 38117 ], SonicCartItemLine$2.prototype, "entity_type", 2); 38118 __decorateClass$2x([ 38119 n$5({ type: Object }) 38120 ], SonicCartItemLine$2.prototype, "price", 2); 38121 __decorateClass$2x([ 38122 n$5({ type: Object }) 38123 ], SonicCartItemLine$2.prototype, "quota", 2); 38124 __decorateClass$2x([ 38125 n$5({ type: Object }) 38126 ], SonicCartItemLine$2.prototype, "owner", 2); 38127 __decorateClass$2x([ 38128 n$5({ type: Object }) 38129 ], SonicCartItemLine$2.prototype, "infos", 2); 38130 __decorateClass$2x([ 38131 n$5({ type: Object }) 38132 ], SonicCartItemLine$2.prototype, "placeCategory", 2); 38133 __decorateClass$2x([ 38134 n$5({ type: Object }) 38135 ], SonicCartItemLine$2.prototype, "seat", 2); 38136 __decorateClass$2x([ 38137 n$5({ type: Array }) 38138 ], SonicCartItemLine$2.prototype, "messages", 2); 38139 __decorateClass$2x([ 38140 r$5() 38141 ], SonicCartItemLine$2.prototype, "_modal", 2); 38142 __decorateClass$2x([ 38143 r$5() 38144 ], SonicCartItemLine$2.prototype, "canEditPrice", 2); 38145 __decorateClass$2x([ 38146 r$5()
38147 ], SonicCartItemLine$2.prototype, "_cartProvider", 2); 38148 __decorateClass$2x([ 38149 c({ context: cartTypeContext, subscribe: true }), 38150 n$5({ type: String }) 38151 ], SonicCartItemLine$2.prototype, "cartType", 2); 38152 __decorateClass$2x([ 38153 c({ context: accessParamsContext, subscribe: true }), 38154 n$5({ type: Object }) 38155 ], SonicCartItemLine$2.prototype, "accessParams", 2); 38156 SonicCartItemLine$2 = __decorateClass$2x([ 38157 t$3("sonic-cart-item-line-detail") 38158 ], SonicCartItemLine$2); 38159 var __defProp$2u = Object.defineProperty; 38160 var __getOwnPropDesc$2w = Object.getOwnPropertyDescriptor; 38161 var __decorateClass$2w = (decorators, target, key, kind) => { 38162 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2w(target, key) : target; 38163 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 38164 if (decorator = decorators[i2]) 38165 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 38166 if (kind && result) __defProp$2u(target, key, result); 38167 return result; 38168 }; 38169 const tagName$1w = "sonic-cart-item-line-actions"; 38170 let CartItemLineActions = class extends i$6 { 38171 constructor() { 38172 super(...arguments); 38173 this.cartProvider = "cart/current"; 38174 this.mode = "default"; 38175 this.canEditPriceFlag = false; 38176 } 38177 willUpdate(changedProperties) { 38178 if (changedProperties.has("items")) { 38179 this.query = buildLineGroupQuery(this.items || []); 38180 } 38181 if (changedProperties.has("mode") || changedProperties.has("items")) { 38182 this.canEditPriceFlag = canEditPrice(this.mode, this.items?.[0]?.entity_type); 38183 } 38184 super.willUpdate(changedProperties); 38185 } 38186 get actionContext() { 38187 return { 38188 cartProvider: this.cartProvider, 38189 accessParams: this.accessParams, 38190 cartType: this.cartType 38191 }; 38192 } 38193 getApiConfiguration() { 38194 return HTML.getApiConfiguration(this); 38195 } 38196 render() { 38197 const items = this.items; 38198 if (!items?.length || !this.query) return A$1; 38199 const ctx = this.actionContext; 38200 const firstItem = items[0]; 38201 const canDelete = items.every((item) => item.canDelete); 38202 const sessionId = firstItem.entity_type === EntityType.Event ? firstItem.entity_id : null; 38203 const hasSeat = items.some((item) => item.seat?.id); 38204 const isMultiSession = isMultiSessionLineItem(this.cartProvider, firstItem); 38205 const hasActions = canDelete || hasSeat && sessionId || this.canEditPriceFlag || isMultiSession; 38206 const onRemove = () => removeCartItems(this, this.cartProvider, this.query); 38207 if (!hasActions) return A$1; 38208 return renderActionMenuShell({ 38209 triggerIcon: "pen", 38210 menuMinWidth: "13rem", 38211 trashButton: canDelete ? renderTrashButton(onRemove) : void 0, 38212 menuItems: b$1` 38213 ${renderChangeEventSessionItems({ 38214 ctx, 38215 lineItems: items, 38216 query: this.query, 38217 api: this, 38218 isMultiSession 38219 })} 38220 ${this.canEditPriceFlag ? renderEditPriceItem(ctx, items) : A$1} 38221 ${hasSeat && sessionId ? renderSeatmapMenuItems(ctx, Number(sessionId)) : A$1} 38222 ${canDelete ? renderRemoveMenuItem(onRemove) : A$1} 38223 ` 38224 }); 38225 } 38226 }; 38227 CartItemLineActions.styles = [ 38228 tailwind, 38229 i$9` 38230 :host { 38231 display: flex; 38232 } 38233 ` 38234 ]; 38235 __decorateClass$2w([ 38236 n$5({ type: Array }) 38237 ], CartItemLineActions.prototype, "items", 2); 38238 __decorateClass$2w([ 38239 ancestorAttribute("cartProvider") 38240 ], CartItemLineActions.prototype, "cartProvider", 2); 38241 __decorateClass$2w([ 38242 c({ context: modeContext, subscribe: true }), 38243 n$5({ type: String }) 38244 ], CartItemLineActions.prototype, "mode", 2); 38245 __decorateClass$2w([ 38246 r$5() 38247 ], CartItemLineActions.prototype, "query", 2); 38248 __decorateClass$2w([ 38249 r$5() 38250 ], CartItemLineActions.prototype, "canEditPriceFlag", 2); 38251 __decorateClass$2w([ 38252 c({ context: appType, subscribe: true }), 38253 n$5({ type: String }) 38254 ], CartItemLineActions.prototype, "appType", 2); 38255 __decorateClass$2w([ 38256 c({ context: cartTypeContext, subscribe: true }), 38257 n$5({ type: String }) 38258 ], CartItemLineActions.prototype, "cartType", 2); 38259 __decorateClass$2w([ 38260 c({ context: accessParamsContext, subscribe: true }), 38261 n$5({ type: Object }) 38262 ], CartItemLineActions.prototype, "accessParams", 2); 38263 CartItemLineActions = __decorateClass$2w([ 38264 t$3(tagName$1w) 38265 ], CartItemLineActions); 38266 var __defProp$2t = Object.defineProperty; 38267 var __getOwnPropDesc$2v = Object.getOwnPropertyDescriptor; 38268 var __decorateClass$2v = (decorators, target, key, kind) => { 38269 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2v(target, key) : target; 38270 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 38271 if (decorator = decorators[i2]) 38272 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 38273 if (kind && result) __defProp$2t(target, key, result); 38274 return result; 38275 }; 38276 let SonicCartItemLine$1 = class SonicCartItemLine extends Subscriber$1(i$6) { 38277 constructor() { 38278 super(...arguments); 38279 this.mode = "default"; 38280 this.quantity = 0; 38281 this.price = {}; 38282 this.infos = null; 38283 this.canEditQuantity = false;
38284 this.owner_required = false; 38285 this.showDetail = false; 38286 this.entity_type = null; 38287 this.total = 0; 38288 this.messages = []; 38289 this.quota = null; 38290 this.items = null; 38291 this.wording_abonnement = ""; 38292 this.wording_LIB_abo_place = ""; 38293 this.canEditPrice = false; 38294 this._cartProvider = ""; 38295 } 38296 connectedCallback() { 38297 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 38298 super.connectedCallback(); 38299 } 38300 willUpdate(changedProperties) { 38301 if (this.price.amount !== void 0 && (changedProperties.has("quantity") || changedProperties.has("price"))) { 38302 this.publisher.total = this.quantity * this.price.amount; 38303 } 38304 if (changedProperties.has("items")) { 38305 const categories = this.items?.map((item) => item.price?.placeCategory?.title); 38306 if (categories && new Set(categories).size === 1) { 38307 this.categoryLabel = categories[0]; 38308 } 38309 } 38310 this.canEditPrice = this.mode == "default" && this.cartType !== "cart" && this.entity_type !== EntityType.AdditionalProduct && this.entity_type !== EntityType.Subscribe; 38311 super.willUpdate(changedProperties); 38312 } 38313 // 38314 // RENDER 38315 // LAYOUT GLOBAL 38316 render() { 38317 const quotaName = this.quota?.title || ""; 38318 const displayQuota = this.quota?.id && this.quota.id > 1 && quotaName ? true : false; 38319 const hasError = this.props?.items?.some((item) => item.has_error); 38320 const canEditLabel = this.canEditPrice ? t("edit_price") : ""; 38321 const itemsToMove = this.items; 38322 const anItemRequestOwner = this.items?.some((item) => { 38323 const needSubscription = item.price?.need_subscription || item.price?.need_partner_subscription; 38324 if (needSubscription) { 38325 return true; 38326 } else if (this.appType === "counter" && this.entity_type === EntityType.Event) { 38327 return false; 38328 } else { 38329 return item.owner_required; 38330 } 38331 }); 38332 const forceGlobalLine = this.mode !== "split" && this.mode !== "splitResult" && this.entity_type === EntityType.AdditionalProduct; 38333 const displayGlobalLine = (!this.showDetail || forceGlobalLine) && !anItemRequestOwner; 38334 const displayDetail = !displayGlobalLine; 38335 return b$1` 38336 ${displayGlobalLine ? b$1` <div 38337 class=" 38338 @container 38339 grid 38340 grid-cols-[minmax(35%,1fr)_auto_minmax(0,max-content)] items-center gap-3 38341 rounded py-[1px] 38342 px-1 38343 hover:bg-neutral-50 hover:shadow-[0_0_0_2px_var(--sc-base-50)] 38344 min-h-[1.7rem] @lg:min-h-[2rem] 38345 " 38346 > 38347 <div class="text-xs @lg:text-sm leading-tight py-1"> 38348 <slot name="text"> 38349 38350 <div> 38351 ${this.priceIcon()} 38352 <span 38353 @click=${() => { 38354 if (this.canEditPrice) { 38355 editPriceModal({ 38356 lineItems: this.props ? [this.props] : [], 38357 cartProvider: this._cartProvider, 38358 accessParams: this.accessParams 38359 }); 38360 } 38361 }} 38362 class="${hasError ? "text-danger font-bold" : ""} ${this.canEditPrice ? "cursor-pointer hover:underline" : ""}" 38363 title=${o$4(canEditLabel)} 38364 > 38365 ${categoryMarkup(this.price)} 38366 ${this.price.label} 38367 </span> 38368 ${this.infos?.code ? b$1`<sonic-badge size="xs" class="tracking-wider">${this.infos.code}</sonic-badge>` : A$1} 38369 </div> 38370 <div class="text-xs flex items-center flex-wrap"> 38371 ${displayQuota ? b$1`<sonic-badge size="inherit" class="mr-2" ellipsis>${quotaName}</sonic-badge>` : A$1} 38372 ${placementMarkup(this.items, "condensed")} 38373 ${this.price?.is_countermark ? b$1`<sonic-badge type="warning" size="xs" class="mr-2" variant="ghost"> 38374 <sonic-icon name="file-exclamation" library="custom" slot="prefix"></sonic-icon> 38375 <div class="text-balance">${t("contremarque_echanger_guichet")}</div> 38376 </sonic-badge>` : A$1} 38377 <sonic-cart-item-line-messages class="block my-1" size="inherit"></sonic-cart-item-line-messages> 38378 </div> 38379 </slot> 38380 </div> 38381 38382 <div class="inline-flex gap-1 items-center ml-auto text-xs text-neutral-400 "> 38383 <slot name="quantity">${this.defaultQuantityMarkup()}</slot> 38384 </div> 38385 38386 <div class="inline-flex gap-1 justify-end items-center"> 38387 <div 38388 class="text-sm @sm:text-base min-w-[3.2rem] whitespace-nowrap 38389 @lg:min-w-[6ch] 38390 text-right ml-auto leading-none font-bold" 38391 >
38392 ${formatAmount(this.total)} 38393 </div> 38394 38395 <!-- retirer bientot this.isExtra && this.props?.entity?.entity_type === EntityType.Giftcard) --> 38396 ${(this.mode == "split" || this.mode == "splitResult") && itemsToMove && itemsToMove?.length ? b$1`<sonic-cart-move-items-button 38397 size="sm" 38398 .lineItems=${itemsToMove} 38399 ></sonic-cart-move-items-button>` : A$1} 38400 ${this.mode == "default" ? b$1` 38401 <sonic-cart-item-line-actions 38402 .items=${this.items || []} 38403 class="w-[4.45rem] shrink-0 flex items-center justify-end" 38404 ></sonic-cart-item-line-actions> 38405 ` : A$1} 38406 </div> 38407 </div> </div>` : A$1} 38408 ${displayDetail ? b$1` <sonic-list 38409 subDataProvider="items" 38410 .items=${() => { 38411 return b$1`<sonic-cart-item-line-detail lazyRendering> </sonic-cart-item-line-detail> `; 38412 }} 38413 > 38414 </sonic-list>` : A$1} 38415 `; 38416 } 38417 priceIcon() { 38418 if (this.price.is_promo) return b$1`<sonic-icon library="custom" name="gift"></sonic-icon>`; 38419 if (this.price.is_triggering_promo) return b$1`<sonic-icon library="custom" name="star"></sonic-icon>`; 38420 else return A$1; 38421 } 38422 categoryMarkup() { 38423 return b$1`${this.categoryLabel ? b$1`<span class="inline-block italic">| ${o$6(this.categoryLabel)}</span>` : A$1}`; 38424 } 38425 // QUANTITÃ et ajout au panier 38426 defaultQuantityMarkup() { 38427 const hasError = this.props?.items?.some((item) => item.has_error); 38428 const isCondensed = this.layout == "condensed" ? true : false; 38429 const isRequestOrCampaign = getAccessType(this.accessParams) === AccessType.RESERVATION_REQUEST || getAccessType(this.accessParams) === AccessType.CAMPAIGN; 38430 const canEdit = isRequestOrCampaign ? true : this.canEditQuantity && this.mode !== "split"; 38431 return b$1` 38432 ${this.mode == "readonly" ? b$1` <div class="inline-block font-bold min-w-[2ch] text-right">${this.quantity}</div> ` : b$1` 38433 <sonic-cart-input 38434 name="quantity" 38435 status="${hasError ? "error" : "default"}" 38436 ?readonly=${!canEdit} 38437 ?plusMinus=${canEdit} 38438 formDataProvider="${this.dataProvider || ""}" 38439 size="${isCondensed ? "2xs" : "xs"}" 38440 min=${this.price.min || 0} 38441 max=${Math.min(this.price.max || 999)} 38442 .propertyMap=${{ type: "entity_type" }} 38443 > 38444 </sonic-cart-input> 38445 `} 38446 38447 <div class="hidden @lg:block min-w-[7ch] @lg:min-w-[8.5ch] @lg:ml-1"> 38448 Ã ${formatAmount(this.price.amount || 0)} 38449 </div> 38450 `; 38451 } 38452 }; 38453 SonicCartItemLine$1.styles = [tailwind]; 38454 __decorateClass$2v([ 38455 c({ context: appType, subscribe: true }), 38456 n$5({ type: String }) 38457 ], SonicCartItemLine$1.prototype, "appType", 2); 38458 __decorateClass$2v([ 38459 c({ context: modeContext, subscribe: true }), 38460 n$5({ type: String }) 38461 ], SonicCartItemLine$1.prototype, "mode", 2); 38462 __decorateClass$2v([ 38463 c({ context: layoutContext, subscribe: true }), 38464 n$5({ type: String }) 38465 ], SonicCartItemLine$1.prototype, "layout", 2); 38466 __decorateClass$2v([ 38467 n$5({ type: Number }) 38468 ], SonicCartItemLine$1.prototype, "quantity", 2); 38469 __decorateClass$2v([ 38470 n$5({ type: Object }) 38471 ], SonicCartItemLine$1.prototype, "price", 2); 38472 __decorateClass$2v([ 38473 n$5({ type: Object }) 38474 ], SonicCartItemLine$1.prototype, "infos", 2); 38475 __decorateClass$2v([ 38476 n$5({ type: Boolean }) 38477 ], SonicCartItemLine$1.prototype, "canEditQuantity", 2); 38478 __decorateClass$2v([ 38479 n$5({ type: Boolean }) 38480 ], SonicCartItemLine$1.prototype, "owner_required", 2); 38481 __decorateClass$2v([ 38482 c({ context: detailContext, subscribe: true }), 38483 n$5({ type: Boolean }) 38484 ], SonicCartItemLine$1.prototype, "showDetail", 2); 38485 __decorateClass$2v([ 38486 n$5({ type: String }) 38487 ], SonicCartItemLine$1.prototype, "entity_type", 2); 38488 __decorateClass$2v([ 38489 n$5({ type: Number }) 38490 ], SonicCartItemLine$1.prototype, "total", 2); 38491 __decorateClass$2v([ 38492 n$5({ type: Array }) 38493 ], SonicCartItemLine$1.prototype, "messages", 2); 38494 __decorateClass$2v([ 38495 n$5({ type: Object }) 38496 ], SonicCartItemLine$1.prototype, "quota", 2); 38497 __decorateClass$2v([ 38498 r$5() 38499 ], SonicCartItemLine$1.prototype, "_modal", 2); 38500 __decorateClass$2v([ 38501 n$5({ type: Array }) 38502 ], SonicCartItemLine$1.prototype, "items", 2); 38503 __decorateClass$2v([ 38504 n$5({ type: String }) 38505 ], SonicCartItemLine$1.prototype, "wording_abonnement", 2); 38506 __decorateClass$2v([ 38507 n$5({ type: String }) 38508 ], SonicCartItemLine$1.prototype, "wording_LIB_abo_place", 2); 38509 __decorateClass$2v([ 38510 n$5({ type: String }) 38511 ], SonicCartItemLine$1.prototype, "categoryLabel", 2); 38512 __decorateClass$2v([ 38513 r$5() 38514 ], SonicCartItemLine$1.prototype, "canEditPrice", 2); 38515 __decorateClass$2v([ 38516 c({ context: cartTypeContext, subscribe: true }), 38517 n$5({ type: String }) 38518 ], SonicCartItemLine$1.prototype, "cartType", 2); 38519 __decorateClass$2v([ 38520 c({ context: accessParamsContext, subscribe: true }), 38521 n$5({ type: Object }) 38522 ], SonicCartItemLine$1.prototype, "accessParams", 2); 38523 SonicCartItemLine$1 = __decorateClass$2v([ 38524 t$3("sonic-cart-item-line") 38525 ], SonicCartItemLine$1); 38526 var __defProp$2s = Object.defineProperty; 38527 var __getOwnPropDesc$2u = Object.getOwnPropertyDescriptor; 38528 var __decorateClass$2u = (decorators, target, key, kind) => { 38529 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2u(target, key) : target; 38530 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 38531 if (decorator = decorators[i2]) 38532 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 38533 if (kind && result) __defProp$2s(target, key, result); 38534 return result; 38535 }; 38536 const tagName$1v = "sonic-cart-item-line-subscribe"; 38537 let CartItemSubscribe = class extends Subscriber$1(i$6) { 38538 constructor() { 38539 super(...arguments); 38540 this.quantity = 0; 38541 this.total = 0; 38542 this.items = []; 38543 this.showDetail = false;
38544 this.mode = "default"; 38545 this.cartType = CartType.Cart; 38546 this.layout = "default"; 38547 this.fullWidth = false; 38548 this.noSubscriptionActions = false; 38549 this.cartProvider = "cart/current"; 38550 this.entityTitle = ""; 38551 } 38552 willUpdate(_changedProperties) { 38553 if (_changedProperties.has("props")) { 38554 this.entityTitle = this.props?.entity?.edito?.title || ""; 38555 } 38556 super.willUpdate(_changedProperties); 38557 } 38558 addEntitiesToItems(items) { 38559 if (!this.cartProvider) return items; 38560 try { 38561 const entities = dp(this.cartProvider).data.entities.get(); 38562 if (!entities) return items; 38563 return items.map((item) => ({ 38564 ...item, 38565 entity: entities.find( 38566 (entity) => entity.id === item.entity_id && entity.entity_type === item.entity_type 38567 ) 38568 })); 38569 } catch (error) { 38570 console.error("Error fetching entities:", error); 38571 return items; 38572 } 38573 } 38574 // Méthode helper pour déterminer le type d'entité 38575 // private getEntityType(entity: Session | GiftCard | SubscribeType | AdditionalProduct): string { 38576 // if ("start_date" in entity) { 38577 // return EntityType.Event; 38578 // } else if ("code" in entity) { 38579 // return EntityType.Giftcard; 38580 // } else if ("subscription_type" in entity) { 38581 // return EntityType.Subscribe; 38582 // } else if ("product_type" in entity) { 38583 // return EntityType.AdditionalProduct; 38584 // } 38585 // return ""; 38586 // } 38587 sortItemsByStartDates(items) { 38588 return [...items].sort((a2, b2) => { 38589 const aStartDate = a2.entity && "start_date" in a2.entity ? a2.entity.start_date ?? 0 : 0; 38590 const bStartDate = b2.entity && "start_date" in b2.entity ? b2.entity.start_date ?? 0 : 0; 38591 return aStartDate - bStartDate; 38592 }); 38593 } 38594 render() { 38595 const isCondensed = this.layout == "condensed"; 38596 const editMode = this.mode !== "readonly"; 38597 return b$1` 38598 ${c$1( 38599 this.items, 38600 (item) => item.id, 38601 (item, _index) => { 38602 let ticketQuantity = item.items?.filter((item2) => item2.entity_type === EntityType.Event).length || 0; 38603 const ticketQuantityLabel = ticketQuantity > 1 ? t("billets") : t("billet"); 38604 let total = 0; 38605 if ("total" in item) { 38606 total = item.total || 0; 38607 } 38608 const subscriptionEntityId = item.entity_id?.toString(); 38609 const subscriptionPriceId = item.price?.id?.toString(); 38610 const displayEmail = item.owner?.email && !item.owner?.email.endsWith(".pasdemail"); 38611 if (!subscriptionEntityId || !subscriptionPriceId) return A$1; 38612 return b$1` 38613 <div 38614 class=" 38615 @container 38616 ${this.fullWidth ? "w-full" : "px-1 py-2 mb-1 rounded"} 38617 ${editMode ? "hover:bg-[rgba(0,0,0,.02)] hover:shadow-[0_0_0_1px_rgba(0,0,0,.02)]" : ""}" 38618 > 38619 <div class="flex items-center gap-3 min-h-10 "> 38620 <div class="min-w-0"> 38621 <div class="font-bold text-lg">${this.entityTitle}</div> 38622 <div class="min-w-0 flex gap-1 text-xs @lg:text-sm"> 38623 <div class="min-w-0"> 38624 ${this.ownerName(item)} 38625 ${item.price?.label && item.price?.label !== this.entityTitle ? b$1`<span class="inline-block"><span class="mx-1">â</span> ${item.price?.label}</span>` : A$1} 38626 <div class="flex gap-x-3 text-neutral-500 flex-wrap min-w-0"> 38627 ${displayEmail ? b$1`<div class="truncate overflow-hidden">${item.owner?.email}</div>` : A$1} 38628 </div> 38629 </div> 38630 </div> 38631 </div> 38632 38633 <div class="flex ml-auto items-center gap-1 text-sm"> 38634 <div 38635 class="ml-auto font-bold text-right whitespace-nowrap ${isCondensed ? "text-sm min-w-[3.2rem]" : "text-base min-w-[6ch]"}" 38636 > 38637 ${formatAmount(total)} 38638 </div> 38639 38640 ${(this.mode == "split" || this.mode == "splitResult") && item ? b$1`<sonic-cart-move-items-button size="sm" .lineItems=${[item]}></sonic-cart-move-items-button>
38640` : A$1} 38641 ${this.mode === "default" ? b$1` ${this.subscriptionActions(item)} ` : A$1} 38642 </div> 38643 </div> 38644 38645 <div class="my-2"> 38646 ${ticketQuantity ? b$1` 38647 <sonic-badge type="primary" size="sm" aria-label="${ticketQuantity} ${ticketQuantityLabel}"> 38648 <div class="flex items-center"> 38649 <sonic-icon name="id-card" library="custom" prefix="regular"></sonic-icon> 38650 <sonic-icon name="plus" library="custom" size="xs"></sonic-icon> 38651 ${ticketQuantity} 38652 <sonic-icon name="ticket" library="custom" prefix="regular" class="ml-1"></sonic-icon> 38653 </div> 38654 </sonic-badge> 38655 ` : A$1} 38656 ${item.renew_from?.number ? b$1` 38657 <sonic-tooltip label="N°${item.renew_from.number}"> 38658 <sonic-badge type="primary" size="sm"> 38659 <sonic-icon name="arrows-rotate" library="custom" prefix="regular"></sonic-icon> 38660 <span>${t("LIB_Renouvellement")}</span> 38661 </sonic-badge> 38662 </sonic-tooltip> 38663 ` : A$1} 38664 </div> 38665 ${item.messages && item.messages.length > 0 ? b$1`<sonic-cart-item-line-messages 38666 class="block my-2 max-w-[64ch]" 38667 size="xs" 38668 dataProvider="subscriptionCartInfo/${item.entity_id}" 38669 .messages=${item.messages} 38670 ></sonic-cart-item-line-messages>` : A$1} 38671 ${this.quickActions(item)} ${this.renderDetail(item)} 38672 </div> 38673 `; 38674 } 38675 )} 38676 `; 38677 } 38678 quickActions(item) { 38679 const has_error = item.has_error_owner || item.has_error_linked_events || item.has_error_proof; 38680 if (this.mode !== "default" || !has_error) return A$1; 38681 return b$1` 38682 <div class="flex gap-[2px] flex-wrap text-2xs @lg:text-xs mb-4 @xl:mb-5"> 38683 ${item.has_error_owner ? b$1` 38684 <sonic-button 38685 variant="outline" 38686 size="inherit" 38687 type="danger" 38688 @click=${() => editSubscriptionOwnerModal({ 38689 lineItem: item, 38690 cartProvider: this.cartProvider, 38691 accessParams: this.accessParams 38692 })} 38693 > 38694 <sonic-icon name="id-card" library="custom" prefix="regular" slot="prefix"></sonic-icon> 38695 ${t("edit_owner")}</sonic-button 38696 > 38697 ` : A$1} 38698 ${item.has_error_proof ? b$1` 38699 <sonic-button 38700 variant="outline" 38701 size="inherit" 38702 type="danger" 38703 @click=${() => addProofModal({ lineItem: item, cartProvider: this.cartProvider, accessParams: this.accessParams })} 38704 > 38705 <sonic-icon name="file-arrow-up" library="custom" prefix="regular" slot="prefix"></sonic-icon> 38706 ${t("LIB_add_proof")}</sonic-button 38707 > 38708 ` : A$1} 38709 ${item.has_error_linked_events ? b$1` 38710 <sonic-button 38711 variant="outline" 38712 size="inherit" 38713 type="danger" 38714 @click=${() => quickSelectModal({ 38715 cartProvider: this.cartProvider, 38716 selectedSubscriptionId: item.id, 38717 accessParams: this.accessParams 38718 })} 38719 > 38720 <sonic-icon name="calendar-check" library="custom" prefix="regular" slot="prefix"></sonic-icon> 38721 ${t("events_choice")}</sonic-button 38722 > 38723 ` : A$1} 38724 </div> 38725 `; 38726 } 38727 renderDetail(item) { 38728 const hasEvents = item?.items?.some((item2) => item2.entity_type === EntityType.Event); 38729 const itemsWithEntities = this.addEntitiesToItems(item?.items || []); 38730 const subItems = this.sortItemsByStartDates(itemsWithEntities); 38731 if (!hasEvents) return A$1; 38732 const displayDetail = item?.items?.length && (this.showDetail || this.layout !== "condensed"); 38733 return b$1` ${displayDetail ? b$1`<div class="w-full @lg:pb-2 pl-2 @xl:pl-3 @2xl:pl-6"> 38734 ${c$1( 38735 subItems, 38736 (item2) => `${item2.entity_type}_${item2.id}`, 38737 (item2, _index) => { 38738 const entity = item2.entity; 38739 const displayPriceLabel = item2?.price?.label && item2?.price?.label !== this.entityTitle; 38740 const quotaTitle = item2.quota?.id !== 1 ? item2?.quota?.title : null; 38741 return b$1`<div class="flex w-full gap-1 my-4" style="interpolate-size: allow-keywords"> 38742 <sonic-product-summary 38743 dataProvider="subscriptionCartInfo_${item2.entity_type}_${item2.entity_id}" 38744 size="2xs" 38745 .props=${entity} 38746 class="w-full" 38747 ?textOnly=${this.layout == "condensed"} 38748 lazyRendering 38749 noAutoFill 38750 > 38751 <div 38752 slot="infos" 38753 class="align-middle w-full @lg:w-[12rem] @xl:w-[15rem] text-xs text-neutral-500 gap-1 items-center" 38754 > 38755 <div class="truncate"> 38756 ${categoryMarkup(item2?.price)} 38757 ${displayPriceLabel ? b$1`${o$6(item2?.price?.label)} ` : A$1} 38758 </div> 38759 ${quotaTitle ? b$1`<sonic-badge size="inherit" ellipsis>${o$6(quotaTitle)}</sonic-badge>` : A$1} 38760 ${placementMarkup([item2], "condensed")} 38761 ${c$1( 38762 item2.messages || [], 38763 (message) => message, 38764 (message) => { 38765 const isSubscription = item2.entity_type === EntityType.Subscribe; 38766 if (isSubscription) return A$1; 38767 return b$1`<sonic-alert 38768 status="${message.status ?? "error"}" 38769 size="xs" 38770 class="mt-px max-w-[50ch]" 38771 >${o$6(message.content)}</sonic-alert 38772 >`; 38773 } 38774 )} 38775 </div> 38776 </sonic-product-summary> 38777 38778 <div class="flex items-center self-start gap-1"> 38779 <div 38780 class="${item2.price?.amount ? " min-h-[2.5em] " : ""} text-sm pl-2 min-w-[6ch] text-right whitespace-nowrap inline-flex items-center justify-end " 38781 >
38782 ${item2.price?.amount ? formatAmount(item2.price.amount) : A$1} 38783 </div> 38784 38785 ${this.mode === "default" ? b$1`<div class="w-[4.45rem] shrink-0 flex items-center justify-end"> 38786 ${item2.entity_type !== EntityType.Subscribe ? b$1`<sonic-cart-item-line-detail-actions 38787 class=" flex items-center justify-end" 38788 .item=${item2} 38789 ></sonic-cart-item-line-detail-actions>` : A$1} 38790 </div>` : A$1} 38791 ${this.mode === "split" ? b$1`<div class="w-[3rem] shrink-0 ml-auto"> 38792 ${this.mode == "split" || this.mode == "splitResult" ? b$1`<sonic-cart-move-items-button 38793 size="xs" 38794 .lineItems=${[item2]} 38795 ></sonic-cart-move-items-button>` : A$1} 38796 </div>` : A$1} 38797 </div> 38798 </div>`; 38799 } 38800 )} 38801 </div>` : A$1}`; 38802 } 38803 ownerName(item) { 38804 const owner = item.owner; 38805 const firstName = owner?.firstName; 38806 const lastName = owner?.lastName; 38807 if (!firstName || !lastName) return b$1`<span class="font-bold">${t("no_owner")}</span>`; 38808 return b$1`<span class="font-bold"> <span class="uppercase">${lastName}</span> ${firstName}</span>`; 38809 } 38810 subscriptionActions(item) { 38811 const itemId = item.id; 38812 if (!itemId) return A$1; 38813 const ctx = { 38814 cartProvider: this.cartProvider, 38815 accessParams: this.accessParams, 38816 cartType: this.cartType 38817 }; 38818 const onRemove = () => removeCartItems(this, this.cartProvider, buildDetailRemoveQuery(itemId)); 38819 return b$1` 38820 <div class="w-[4.45rem] shrink-0 flex items-center justify-end"> 38821 ${!this.noSubscriptionActions ? b$1` 38822 ${renderActionMenuShell({ 38823 triggerIcon: "ellipsis-vertical", 38824 triggerVariant: "ghost", 38825 menuMinWidth: "15rem", 38826 menuItems: b$1` 38827 ${renderEditSubscriptionOwnerItem(ctx, item)} 38828 ${canEditSubscriptionPrice(ctx.cartType) ? renderEditSubscriptionPriceItem(ctx, item) : A$1} 38829 ${item.can_attach_events ? renderEventsChoiceItem(ctx, itemId) : A$1} 38830 ${item.price?.need_proof_of_identity ? renderAddProofItem(ctx, item) : A$1} 38831 ${renderRemoveMenuItem(onRemove, true)} 38832 ` 38833 })} 38834 ` : A$1} 38835 </div> 38836 `; 38837 } 38838 }; 38839 CartItemSubscribe.styles = [tailwind]; 38840 __decorateClass$2u([ 38841 n$5({ type: Number }) 38842 ], CartItemSubscribe.prototype, "quantity", 2); 38843 __decorateClass$2u([ 38844 n$5({ type: Number }) 38845 ], CartItemSubscribe.prototype, "total", 2); 38846 __decorateClass$2u([ 38847 n$5({ type: Array }) 38848 ], CartItemSubscribe.prototype, "items", 2); 38849 __decorateClass$2u([ 38850 c({ context: detailContext, subscribe: true }), 38851 n$5({ type: Boolean }) 38852 ], CartItemSubscribe.prototype, "showDetail", 2); 38853 __decorateClass$2u([ 38854 c({ context: modeContext, subscribe: true }), 38855 n$5({ type: String }) 38856 ], CartItemSubscribe.prototype, "mode", 2); 38857 __decorateClass$2u([ 38858 c({ context: cartTypeContext, subscribe: true }), 38859 n$5({ type: String }) 38860 ], CartItemSubscribe.prototype, "cartType", 2); 38861 __decorateClass$2u([ 38862 c({ context: layoutContext, subscribe: true }), 38863 n$5({ type: String }) 38864 ], CartItemSubscribe.prototype, "layout", 2); 38865 __decorateClass$2u([ 38866 n$5({ type: Boolean }) 38867 ], CartItemSubscribe.prototype, "fullWidth", 2); 38868 __decorateClass$2u([ 38869 n$5({ type: Boolean }) 38870 ], CartItemSubscribe.prototype, "noSubscriptionActions", 2); 38871 __decorateClass$2u([ 38872 ancestorAttribute("cartProvider") 38873 ], CartItemSubscribe.prototype, "cartProvider", 2); 38874 __decorateClass$2u([ 38875 c({ context: accessParamsContext, subscribe: true }), 38876 n$5({ type: Object }) 38877 ], CartItemSubscribe.prototype, "accessParams", 2); 38878 __decorateClass$2u([ 38879 r$5() 38880 ], CartItemSubscribe.prototype, "entityTitle", 2); 38881 CartItemSubscribe = __decorateClass$2u([ 38882 t$3(tagName$1v) 38883 ], CartItemSubscribe); 38884 var __defProp$2r = Object.defineProperty; 38885 var __getOwnPropDesc$2t = Object.getOwnPropertyDescriptor; 38886 var __decorateClass$2t = (decorators, target, key, kind) => { 38887 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2t(target, key) : target; 38888 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 38889 if (decorator = decorators[i2]) 38890 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 38891 if (kind && result) __defProp$2r(target, key, result); 38892 return result; 38893 }; 38894 let SonicCartItem$1 = class SonicCartItem extends Subscriber$1(i$6) { 38895 constructor() { 38896 super(...arguments); 38897 this.hideHeader = false;
38898 this.textOnly = false; 38899 } 38900 render() { 38901 const noMargin = this.hideHeader || this.textOnly || this.layout == "condensed"; 38902 const entity = this.props?.entity; 38903 const isAdditionalProduct = entity?.entity_type === EntityType.AdditionalProduct; 38904 const isSubscription = entity?.entity_type === EntityType.Subscribe; 38905 const displayHeader = !(this.hideHeader || isAdditionalProduct || isSubscription); 38906 return b$1`${displayHeader ? b$1`<sonic-cart-item-header ?textOnly=${this.textOnly || this.layout == "condensed"}></sonic-cart-item-header>` : A$1} 38907 ${isSubscription ? b$1`<sonic-cart-item-line-subscribe 38908 class=" block ${noMargin ? "mt-0" : "mt-2"}" 38909 ></sonic-cart-item-line-subscribe>` : b$1` 38910 <sonic-list 38911 subDataProvider="items" 38912 class="w-full relative grid grid-cols-1 gap-1 ${noMargin ? "mt-0" : "mt-2"}" 38913 > 38914 <template><sonic-cart-item-line></sonic-cart-item-line> </template> 38915 </sonic-list> 38916 `}`; 38917 } 38918 }; 38919 SonicCartItem$1.styles = [tailwind]; 38920 __decorateClass$2t([ 38921 n$5({ type: Boolean }) 38922 ], SonicCartItem$1.prototype, "hideHeader", 2); 38923 __decorateClass$2t([ 38924 n$5({ type: Boolean }) 38925 ], SonicCartItem$1.prototype, "textOnly", 2); 38926 __decorateClass$2t([ 38927 c({ context: layoutContext, subscribe: true }), 38928 n$5({ type: String }) 38929 ], SonicCartItem$1.prototype, "layout", 2); 38930 SonicCartItem$1 = __decorateClass$2t([ 38931 t$3("sonic-cart-item") 38932 ], SonicCartItem$1); 38933 var __defProp$2q = Object.defineProperty; 38934 var __getOwnPropDesc$2s = Object.getOwnPropertyDescriptor; 38935 var __decorateClass$2s = (decorators, target, key, kind) => { 38936 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2s(target, key) : target; 38937 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 38938 if (decorator = decorators[i2]) 38939 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 38940 if (kind && result) __defProp$2q(target, key, result); 38941 return result; 38942 }; 38943 let SonicCartItemLine = class extends Subscriber$1(i$6) { 38944 constructor() { 38945 super(...arguments); 38946 this.mode = "default"; 38947 this.price = {}; 38948 this.infos = null; 38949 this.canDelete = false; 38950 } 38951 // protected willUpdate(_changedProperties: PropertyValues): void { 38952 // if (_changedProperties.has("props")) { 38953 // this.isExchange = this.props?.is_exchange ?? false; 38954 // } 38955 // } 38956 // 38957 // RENDER 38958 // LAYOUT GLOBAL 38959 render() { 38960 const isCondensed = this.layout == "condensed"; 38961 const noDeleteCell = this.mode === "readonly" && !this.canDelete; 38962 return b$1` 38963 <div 38964 class="flex items-center gap-1 justify-end 38965 rounded py-[1px] px-1 leading-tight ${isCondensed ? "text-sm" : "text-base"}" 38966 > 38967 <div class=" text-right"> 38968 ${this.extraIcon()} 38969 38970 <span>${this.price.label}</span> 38971 ${this.infos?.code ? b$1`<sonic-badge size="xs" class="tracking-wider">${this.infos.code}</sonic-badge>` : A$1} 38972 </div> 38973 <div class="inline-flex gap-1 justify-end items-center"> 38974 <div class="min-w-[5ch] text-right ml-auto leading-none font-bold "> 38975 ${this.price.amount ? formatAmount(this.price.amount) : A$1} 38976 </div> 38977 38978 ${this.mode != "splitResult" && this.mode != "split" && !noDeleteCell ? b$1` 38979 <div class="shrink-0 flex items-center justify-center w-[2rem]"> 38980 ${this.canDelete ? b$1`<sonic-button 38981 shape="circle" 38982 @click=${(e2) => { 38983 const exchangeId = this.props?.exchange_id; 38984 if (exchangeId) { 38985 e2.preventDefault(); 38986 e2.stopPropagation(); 38987 window.location.href = `/la_billetterie/billet/${exchangeId}?echanger=&annuler=`; 38988 } else { 38989 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 38990 Cart.removeItems({ 38991 apiConfiguration: HTML.getApiConfiguration(this), 38992 cartProvider: cartProvider || "cart/current", 38993 query: { 38994 ids: [this.id] 38995 } 38996 }); 38997 } 38998 }} 38999 variant="ghost" 39000 size="xs" 39001 icon 39002 > 39003 <sonic-icon name="trash" library="custom"></sonic-icon> 39004 </sonic-button>` : A$1} 39005 </div> 39006 ` : A$1} 39007 </div> 39008 </div> 39009 `; 39010 } 39011 extraIcon() { 39012 const exchange_id = this.props?.exchange_id; 39013 if (exchange_id) { 39014 return b$1` 39015 <sonic-icon name="ticket" library="custom"></sonic-icon> 39016 <b>Ãchange :</b> 39017 <sonic-app-link 39018 noAutoFill 39019 to="ticket" 39020 .id=${exchange_id.toString()} 39021 size="inherit" 39022 variant="link" 39023 class="inline-block align-baseline" 39024 > 39025 Billet n°${exchange_id} 39026 </sonic-app-link> 39027 ⢠39028 `; 39029 } 39030 if (this.props?.entity_type === EntityType.Credit) { 39031 return b$1`<sonic-icon name="wallet" library="custom"></sonic-icon>`; 39032 } 39033 if (this.props?.entity_type === EntityType.Giftcard) { 39034 return b$1`<sonic-icon name="gift-card" library="custom"></sonic-icon>`; 39035 } 39036 return A$1; 39037 } 39038 }; 39039 SonicCartItemLine.styles = [tailwind]; 39040 __decorateClass$2s([ 39041 c({ context: modeContext, subscribe: true }), 39042 n$5({ type: String }) 39043 ], SonicCartItemLine.prototype, "mode", 2); 39044 __decorateClass$2s([ 39045 c({ context: layoutContext, subscribe: true }), 39046 n$5({ type: String }) 39047 ], SonicCartItemLine.prototype, "layout", 2); 39048 __decorateClass$2s([ 39049 n$5({ type: Object }) 39050 ], SonicCartItemLine.prototype, "price", 2); 39051 __decorateClass$2s([ 39052 n$5({ type: Object }) 39053 ], SonicCartItemLine.prototype, "infos", 2); 39054 __decorateClass$2s([ 39055 n$5({ type: Boolean }) 39056 ], SonicCartItemLine.prototype, "canDelete", 2); 39057 SonicCartItemLine = __decorateClass$2s([ 39058 t$3("sonic-cart-item-line-extra") 39059 ], SonicCartItemLine); 39060 var __defProp$2p = Object.defineProperty; 39061 var __getOwnPropDesc$2r = Object.getOwnPropertyDescriptor; 39062 var __decorateClass$2r = (decorators, target, key, kind) => { 39063 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2r(target, key) : target; 39064 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39065 if (decorator = decorators[i2]) 39066 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39067 if (kind && result) __defProp$2p(target, key, result); 39068 return result; 39069 }; 39070 const tagName$1u = "sonic-cart-item-divider"; 39071 let SonicComponent$f = class SonicComponent extends i$6 { 39072 constructor() { 39073 super(...arguments); 39074 this.layout = "default"; 39075 this.showDetail = false;
39076 } 39077 render() { 39078 const isCondensed = this.layout == "condensed"; 39079 let dividerClass = isCondensed ? "my-[.5rem]" : "my-3"; 39080 if (this.showDetail && !isCondensed) { 39081 dividerClass = "my-5"; 39082 } 39083 return b$1`<sonic-divider class="${dividerClass}"></sonic-divider>`; 39084 } 39085 }; 39086 SonicComponent$f.styles = [tailwind]; 39087 __decorateClass$2r([ 39088 c({ context: layoutContext, subscribe: true }), 39089 n$5({ type: String }) 39090 ], SonicComponent$f.prototype, "layout", 2); 39091 __decorateClass$2r([ 39092 c({ context: detailContext, subscribe: true }), 39093 n$5({ type: Boolean }) 39094 ], SonicComponent$f.prototype, "showDetail", 2); 39095 SonicComponent$f = __decorateClass$2r([ 39096 t$3(tagName$1u) 39097 ], SonicComponent$f); 39098 var __defProp$2o = Object.defineProperty; 39099 var __getOwnPropDesc$2q = Object.getOwnPropertyDescriptor; 39100 var __decorateClass$2q = (decorators, target, key, kind) => { 39101 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2q(target, key) : target; 39102 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39103 if (decorator = decorators[i2]) 39104 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39105 if (kind && result) __defProp$2o(target, key, result); 39106 return result; 39107 }; 39108 let SonicCartEmpty = class extends i$6 { 39109 constructor() { 39110 super(...arguments); 39111 this.mode = "default"; 39112 this.textMain = t("message_panier_vide"); 39113 this.textSecondary = t("LIB_empty_cart_add_item"); 39114 } 39115 willUpdate(_changedProperties) { 39116 super.willUpdate(_changedProperties); 39117 if (_changedProperties.has("cartType") || _changedProperties.has("mode")) { 39118 let textMain = t("message_panier_vide"); 39119 let textSecondary = ""; 39120 if (this.mode === "splitResult") { 39121 textMain = "Aucun élément pour l'instant"; 39122 } else if (this.cartType === CartType.Cart && this.mode === "default") { 39123 textMain = t("message_panier_vide"); 39124 textSecondary = t("LIB_empty_cart_add_item"); 39125 } else { 39126 textMain = t("cart_default_no_items"); 39127 } 39128 this.textMain = textMain; 39129 this.textSecondary = textSecondary; 39130 } 39131 } 39132 render() { 39133 const status = this.status; 39134 const statusNoRender = [ReservationStatus.Deleted, ReservationStatus.Processed]; 39135 if (status && statusNoRender.includes(status)) { 39136 return A$1; 39137 } 39138 return b$1` 39139 <div class="flex gap-2 items-center"> 39140 <sonic-icon library="custom" name="face-thinking"></sonic-icon> 39141 <div>${this.textMain}</div> 39142 </div> 39143 ${this.textSecondary?.toString() !== "" ? b$1` <div class="text-[.75em]">${this.textSecondary}</div>` : A$1} 39144 `; 39145 } 39146 }; 39147 SonicCartEmpty.styles = [ 39148 tailwind, 39149 i$9` 39150 :host { 39151 display: block; 39152 } 39153 ` 39154 ]; 39155 __decorateClass$2q([ 39156 c({ context: cartTypeContext, subscribe: true }), 39157 n$5({ type: String }) 39158 ], SonicCartEmpty.prototype, "cartType", 2); 39159 __decorateClass$2q([ 39160 c({ context: modeContext, subscribe: true }), 39161 n$5({ type: String }) 39162 ], SonicCartEmpty.prototype, "mode", 2); 39163 __decorateClass$2q([ 39164 c({ context: layoutContext, subscribe: true }), 39165 n$5({ type: String }) 39166 ], SonicCartEmpty.prototype, "layout", 2); 39167 __decorateClass$2q([ 39168 n$5({ type: String }) 39169 ], SonicCartEmpty.prototype, "status", 2); 39170 __decorateClass$2q([ 39171 r$5() 39172 ], SonicCartEmpty.prototype, "textMain", 2); 39173 __decorateClass$2q([ 39174 r$5() 39175 ], SonicCartEmpty.prototype, "textSecondary", 2); 39176 SonicCartEmpty = __decorateClass$2q([ 39177 t$3("sonic-cart-empty") 39178 ], SonicCartEmpty); 39179 var __defProp$2n = Object.defineProperty; 39180 var __getOwnPropDesc$2p = Object.getOwnPropertyDescriptor; 39181 var __decorateClass$2p = (decorators, target, key, kind) => { 39182 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2p(target, key) : target; 39183 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39184 if (decorator = decorators[i2]) 39185 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39186 if (kind && result) __defProp$2n(target, key, result); 39187 return result; 39188 }; 39189 const tagName$1t = "sonic-cart-total"; 39190 let SonicCartTotal = class extends Subscriber$1(i$6) { 39191 constructor() { 39192 super(...arguments); 39193 this.total = 0; 39194 this.subTotal = 0; 39195 this.isSubtotal = false;
39196 this.computeId = 0; 39197 this.computeTotal = async () => { 39198 this.computeId++; 39199 const id = this.computeId; 39200 await Utils.delayPromise(1); 39201 if (id !== this.computeId) return; 39202 const items = this.publisher.items.get(); 39203 const itemsTotal = items ? items.reduce((acc, item) => { 39204 if (!item) return acc; 39205 const amount = item.price?.amount ? parseFloat(item.price?.amount.toString()) : 0; 39206 const total = item.quantity ? amount * item.quantity : 0; 39207 return acc + total; 39208 }, 0) : 0; 39209 const extras = this.publisher.extras.get(); 39210 const extrasTotal = extras ? extras.reduce((acc, item) => { 39211 if (!item) return acc; 39212 const amount = item.price?.amount ? parseFloat(item.price?.amount.toString()) : 0; 39213 const total = item.quantity ? amount * item.quantity : 0; 39214 return acc + total; 39215 }, 0) : 0; 39216 this.publisher.subTotal = itemsTotal; 39217 this.publisher.total = itemsTotal + extrasTotal; 39218 }; 39219 } 39220 connectedCallback() { 39221 super.connectedCallback(); 39222 this.publisher.items.onInternalMutation(this.computeTotal); 39223 } 39224 disconnectedCallback() { 39225 super.disconnectedCallback(); 39226 this.publisher.items.offInternalMutation(this.computeTotal); 39227 } 39228 render() { 39229 const defaultLabel = this.isSubtotal ? t("subTotal") : t("total"); 39230 const label2 = this.label || defaultLabel; 39231 const totalOutput = this.isSubtotal ? this.subTotal : this.total; 39232 return b$1`${label2} 39233 <span class="font-bold min-w-[5ch] inline-block text-right">
39233${formatAmount(totalOutput)}</span>`; 39234 } 39235 }; 39236 SonicCartTotal.styles = [tailwind]; 39237 __decorateClass$2p([ 39238 n$5({ type: Number }) 39239 ], SonicCartTotal.prototype, "total", 2); 39240 __decorateClass$2p([ 39241 n$5({ type: Number }) 39242 ], SonicCartTotal.prototype, "subTotal", 2); 39243 __decorateClass$2p([ 39244 n$5({ type: Boolean }) 39245 ], SonicCartTotal.prototype, "isSubtotal", 2); 39246 __decorateClass$2p([ 39247 n$5({ type: String }) 39248 ], SonicCartTotal.prototype, "label", 2); 39249 SonicCartTotal = __decorateClass$2p([ 39250 t$3(tagName$1t) 39251 ], SonicCartTotal); 39252 var __defProp$2m = Object.defineProperty; 39253 var __getOwnPropDesc$2o = Object.getOwnPropertyDescriptor; 39254 var __decorateClass$2o = (decorators, target, key, kind) => { 39255 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2o(target, key) : target; 39256 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39257 if (decorator = decorators[i2]) 39258 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39259 if (kind && result) __defProp$2m(target, key, result); 39260 return result; 39261 }; 39262 let CartAdditionalProductsItem = class extends Subscriber$1(i$6) { 39263 constructor() { 39264 super(...arguments); 39265 this.edito = null; 39266 this.prices = null; 39267 this.id = ""; 39268 this.loading = false; 39269 this.disabled = false; 39270 } 39271 async addToCart() { 39272 if (!this.prices) return; 39273 const priceId = this.prices[0].id; 39274 const cartItem = { 39275 entity_type: EntityType.AdditionalProduct, 39276 entity_id: parseInt(this.id), 39277 quantity: 1, 39278 price: { id: priceId || -1 } 39279 }; 39280 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 39281 this.loading = true; 39282 await Cart.addItems({ 39283 apiConfiguration: this.getApiConfiguration(), 39284 cartProvider, 39285 items: [cartItem], 39286 editFreePriceAfterRequest: true 39287 }); 39288 this.loading = false; 39289 } 39290 render() { 39291 if (!Array.isArray(this.prices) || this.prices.length == 0) { 39292 return A$1; 39293 } 39294 const firstPrice = this.prices[0]; 39295 const amount = firstPrice?.amount || 0; 39296 return b$1` 39297 <div 39298 class="flex gap-2 items-center justify-end text-left transition ${this.loading ? "pointer-events-none opacity-50" : ""} 39299 39300 " 39301 > 39302 <div 39303 class="flex flex-grow text-sm leading-tight gap-3 items-center justify-end ${this.disabled ? "opacity-50" : ""}" 39304 > 39305 <div class="flex-grow flex justify-end text-right">${this.edito?.title}</div> 39306 <div 39307 class="ml-auto font-medium min-w-[7ch] text-right flex items-center justify-end gap-x-2 whitespace-nowrap" 39308 > 39309 <div class="border-t border-dotted flex-grow border-neutral-300 min-w-[.5rem]"></div> 39310 <span class="shrink-0" 39311 >${firstPrice?.is_free_price ? priceRange({ 39312 min: firstPrice.free_price?.min || 0, 39313 max: firstPrice.free_price?.max, 39314 is_free_price: firstPrice.is_free_price 39315 }) : formatAmount(amount)} 39316 </span> 39317 </div> 39318 </div> 39319 <div class="flex items-center justify-center w-[1.6rem] shrink-0"> 39320 ${this.disabled ? b$1` <sonic-icon 39321 library="custom" 39322 name="ban" 39323 prefix="solid" 39324 aria-label="${t("not_available")}" 39325 class=" ${this.disabled ? "opacity-50 text-danger" : ""}" 39326 ></sonic-icon>` : b$1`<sonic-button type="success" shape="circle" size="2xs" @click=${this.addToCart}> 39327 <sonic-icon library="custom" name="plus" size="lg"></sonic-icon> 39328 </sonic-button>`} 39329 </div> 39330 </div> 39331 `; 39332 } 39333 }; 39334 CartAdditionalProductsItem.styles = [ 39335 tailwind, 39336 i$9` 39337 :host { 39338 direction: ltr; 39339 } 39340 ` 39341 ]; 39342 __decorateClass$2o([ 39343 n$5({ type: Object }) 39344 ], CartAdditionalProductsItem.prototype, "edito", 2); 39345 __decorateClass$2o([ 39346 n$5({ type: Array }) 39347 ], CartAdditionalProductsItem.prototype, "prices", 2); 39348 __decorateClass$2o([ 39349 n$5({ type: String }) 39350 ], CartAdditionalProductsItem.prototype, "id", 2); 39351 __decorateClass$2o([ 39352 n$5({ type: Boolean }) 39353 ], CartAdditionalProductsItem.prototype, "loading", 2); 39354 __decorateClass$2o([ 39355 n$5({ type: Boolean }) 39356 ], CartAdditionalProductsItem.prototype, "disabled", 2); 39357 CartAdditionalProductsItem = __decorateClass$2o([ 39358 t$3("sonic-cart-additional-products-item") 39359 ], CartAdditionalProductsItem); 39360 var __defProp$2l = Object.defineProperty; 39361 var __getOwnPropDesc$2n = Object.getOwnPropertyDescriptor; 39362 var __decorateClass$2n = (decorators, target, key, kind) => { 39363 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2n(target, key) : target; 39364 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39365 if (decorator = decorators[i2]) 39366 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39367 if (kind && result) __defProp$2l(target, key, result); 39368 return result; 39369 }; 39370 let CartAdditionalProducts = class extends Fetcher$1(Subscriber$1(i$6)) { 39371 constructor() { 39372 super(...arguments); 39373 this.dataProvider = "additional_products?features[]=prices&sort=title:asc";
39374 this.condensed = false; 39375 this.flatten = false; 39376 this.data = []; 39377 } 39378 renderList() { 39379 return b$1`<sonic-list 39380 class=" grid grid-cols-1 gap-y-2" 39381 subDataProvider="data" 39382 .items=${(item) => { 39383 const isAvailable = item.prices?.some((price) => price?.price_available); 39384 return b$1`<sonic-cart-additional-products-item 39385 ?disabled=${!isAvailable} 39386 ></sonic-cart-additional-products-item>`; 39387 }} 39388 > 39389 </sonic-list>`; 39390 } 39391 render() { 39392 const itemsCount = this.data?.length; 39393 if (!itemsCount) return A$1; 39394 if (itemsCount > 3 && !this.flatten) { 39395 return b$1`<sonic-pop noToggle data-on-select="keep"> 39396 <sonic-button size="${this.condensed ? "xs" : "sm"}" variant="outline"> 39397 <sonic-icon name="circle-plus" library="custom"></sonic-icon>${t("add_product")} 39398 </sonic-button> 39399 <div class="w-80 p-3 py-4 max-h-[45vh] custom-scroll" slot="content">${this.renderList()}</div> 39400 </sonic-pop>`; 39401 } else { 39402 return this.renderList(); 39403 } 39404 } 39405 }; 39406 CartAdditionalProducts.styles = [ 39407 tailwind, 39408 customScroll, 39409 i$9` 39410 :host { 39411 display: block; 39412 } 39413 39414 sonic-list { 39415 direction: rtl; 39416 } 39417 ` 39418 ]; 39419 __decorateClass$2n([ 39420 n$5() 39421 ], CartAdditionalProducts.prototype, "cartProvider", 2); 39422 __decorateClass$2n([ 39423 n$5({ type: Boolean }) 39424 ], CartAdditionalProducts.prototype, "condensed", 2); 39425 __decorateClass$2n([ 39426 n$5({ type: Boolean }) 39427 ], CartAdditionalProducts.prototype, "flatten", 2); 39428 __decorateClass$2n([ 39429 n$5({ type: Array }) 39430 ], CartAdditionalProducts.prototype, "data", 2); 39431 CartAdditionalProducts = __decorateClass$2n([ 39432 t$3("sonic-cart-additional-products") 39433 ], CartAdditionalProducts); 39434 var __defProp$2k = Object.defineProperty; 39435 var __getOwnPropDesc$2m = Object.getOwnPropertyDescriptor; 39436 var __decorateClass$2m = (decorators, target, key, kind) => { 39437 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2m(target, key) : target; 39438 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39439 if (decorator = decorators[i2]) 39440 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39441 if (kind && result) __defProp$2k(target, key, result); 39442 return result; 39443 }; 39444 let CounterStore = class extends Subscriber$1(i$6) { 39445 constructor() { 39446 super(...arguments); 39447 this.formType = "buttons"; 39448 this.hasToolbar = false; 39449 this.hasParentModal = false; 39450 this.enableSticky = false; 39451 this.localStoreFilters = false; 39452 this.formDataProvider = "counterEventFilters"; 39453 this.dataProviderExpression = "sessions?limit=$limit&offset=$offset&next=1"; 39454 this.observer = new IntersectionObserver( 39455 function(_ref) { 39456 const e2 = _ref[0]; 39457 return e2.target.classList.toggle("isSticky", e2.intersectionRatio < 1); 39458 }, 39459 { 39460 root: null, 39461 rootMargin: (this.hasToolbar ? "-61px" : "-1px") + " 0px 0px 0px", 39462 threshold: 1 39463 } 39464 ); 39465 } 39466 connectedCallback() { 39467 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 39468 if (!this.hasToolbar) { 39469 this.hasToolbar = !parentModal && document.getElementById("toolbar") !== null; 39470 } 39471 super.connectedCallback(); 39472 } 39473 updated(_changedProperties) { 39474 if (!this.formContainer) { 39475 this.observer.disconnect(); 39476 } else { 39477 this.observer.observe(this.formContainer); 39478 } 39479 super.updated(_changedProperties); 39480 } 39481 willUpdate(_changedProperties) { 39482 this.dataProviderExpression = entityEndPoint({ 39483 entityType: EntityType.Event, 39484 accessParams: this.accessParams, 39485 isQueue: true, 39486 next: true, 39487 view: entityView.essential 39488 }); 39489 super.willUpdate(_changedProperties); 39490 } 39491 disconnectedCallback() { 39492 this.observer.disconnect(); 39493 super.disconnectedCallback(); 39494 } 39495 render() { 39496 const searchDataProvider = this.formDataProvider + "searchResults"; 39497 return b$1` 39498 <div 39499 id="formContainer" 39500 class="flex gap-x-4 z-20 39501 mb-5 ${this.enableSticky ? "sticky shadow-[0_0_0_2px_var(--sc-base)]" : ""} ${this.hasToolbar ? "top-[--sticky-top-offset]" : "top-0"}" 39502 > 39503 <!--save form state in localstorage --> 39504 ${this.localStoreFilters ? b$1`<sonic-subscriber dataProvider="${this.formDataProvider}" localStorage="enabled"></sonic-subscriber>` : A$1} 39505 <sonic-event-selection-filters 39506 formDataProvider="${this.formDataProvider}"
39507 class=" block min-w-0 w-full " 39508 category 39509 activity 39510 range 39511 onlyFilter 39512 canFilterDays 39513 ></sonic-event-selection-filters> 39514 </div> 39515 <sonic-queue 39516 dataProviderExpression="${this.dataProviderExpression}" 39517 limit="8" 39518 targetRequestDuration="1000" 39519 key="data" 39520 dataProvider="${searchDataProvider}" 39521 dataFilterProvider="${this.formDataProvider}" 39522 > 39523 <template data-value="no-item"> 39524 <sonic-no-result size="xl"></sonic-no-result> 39525 </template> 39526 <template data-value="skeleton"> 39527 <sonic-event-store-item class="mb-4 block" skeleton></sonic-event-store-item> 39528 <sonic-event-store-item class="mb-4 block" skeleton></sonic-event-store-item> 39529 <sonic-event-store-item class="mb-4 block" skeleton></sonic-event-store-item> 39530 </template> 39531 <template> 39532 <sonic-event-store-item class="mb-4 block" showAllSessionsButton formType="buttons"></sonic-event-store-item> 39533 </template> 39534 </sonic-queue> 39535 `; 39536 } 39537 }; 39538 CounterStore.styles = [ 39539 tailwind, 39540 i$9` 39541 .isSticky { 39542 background-color: var(--sc-base); 39543 box-shadow: 0 1.5rem 1rem -1rem rgb(0 0 0 / 0.07); 39544 } 39545 ` 39546 ]; 39547 __decorateClass$2m([ 39548 n$5({ type: String }) 39549 ], CounterStore.prototype, "formType", 2); 39550 __decorateClass$2m([ 39551 n$5({ type: Boolean }) 39552 ], CounterStore.prototype, "hasToolbar", 2); 39553 __decorateClass$2m([ 39554 r$5() 39555 ], CounterStore.prototype, "hasParentModal", 2); 39556 __decorateClass$2m([ 39557 r$5() 39558 ], CounterStore.prototype, "enableSticky", 2); 39559 __decorateClass$2m([ 39560 n$5({ type: Boolean }) 39561 ], CounterStore.prototype, "localStoreFilters", 2); 39562 __decorateClass$2m([ 39563 n$5({ type: String }) 39564 ], CounterStore.prototype, "formDataProvider", 2); 39565 __decorateClass$2m([ 39566 e$7("#formContainer") 39567 ], CounterStore.prototype, "formContainer", 2); 39568 __decorateClass$2m([ 39569 r$5() 39570 ], CounterStore.prototype, "dataProviderExpression", 2); 39571 __decorateClass$2m([ 39572 c({ context: accessParamsContext, subscribe: true }), 39573 e$2({ context: accessParamsContext }), 39574 n$5({ type: Object }) 39575 ], CounterStore.prototype, "accessParams", 2); 39576 CounterStore = __decorateClass$2m([ 39577 t$3("sonic-counter-store") 39578 ], CounterStore); 39579 var __defProp$2j = Object.defineProperty; 39580 var __getOwnPropDesc$2l = Object.getOwnPropertyDescriptor; 39581 var __decorateClass$2l = (decorators, target, key, kind) => { 39582 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2l(target, key) : target; 39583 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39584 if (decorator = decorators[i2]) 39585 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39586 if (kind && result) __defProp$2j(target, key, result); 39587 return result; 39588 }; 39589 let ScheduledStatus = class extends Subscriber$1(i$6) { 39590 constructor() { 39591 super(...arguments); 39592 this.size = "md"; 39593 this.variant = "ghost"; 39594 } 39595 willUpdate(_changedProperties) { 39596 if (_changedProperties.has("props")) { 39597 const firstScheduleOnSale = this.props?.infos_status?.schedule?.find((schedule) => { 39598 const currentTime = (/* @__PURE__ */ new Date()).getTime() / 1e3; 39599 return schedule.publication === "on_sale" && schedule.date && schedule.date > currentTime; 39600 }); 39601 if (this.props?.settings?.sale_start_date) { 39602 this.sale_start_date = this.props?.settings?.sale_start_date; 39603 } else if (firstScheduleOnSale) { 39604 this.sale_start_date = firstScheduleOnSale.date; 39605 } 39606 } 39607 super.willUpdate(_changedProperties); 39608 } 39609 render() { 39610 const shouldRender = this.sale_start_date && this.appType === "customer" && !hasAccessParams(this.accessParams); 39611 if (!shouldRender) { 39612 return A$1; 39613 } 39614 return b$1` 39615 <sonic-badge type="info" size="${this.size}" variant="${this.variant}"> 39616 <sonic-icon library="custom" name="circle-exclamation" slot="prefix"></sonic-icon> 39617 <span> 39618 ${t("en_vente_a_partir_du")} 39619 <sonic-date 39620 date=${this.sale_start_date} 39621 noAutoFill 39622 weekday="hidden" 39623 day="2-digit" 39624 month="2-digit" 39625 ></sonic-date> 39626 </span> 39627 </sonic-badge> 39628 `; 39629 } 39630 }; 39631 ScheduledStatus.styles = [ 39632 tailwind, 39633 i$9` 39634 :host { 39635 display: contents !important; 39636 } 39637 ` 39638 ]; 39639 __decorateClass$2l([ 39640 n$5({ type: String }) 39641 ], ScheduledStatus.prototype, "size", 2); 39642 __decorateClass$2l([ 39643 n$5({ type: String }) 39644 ], ScheduledStatus.prototype, "variant", 2); 39645 __decorateClass$2l([ 39646 c({ context: appType, subscribe: true }), 39647 r$5() 39648 ], ScheduledStatus.prototype, "appType", 2); 39649 __decorateClass$2l([ 39650 c({ context: accessParamsContext, subscribe: true }), 39651 n$5({ type: Object }) 39652 ], ScheduledStatus.prototype, "accessParams", 2); 39653 __decorateClass$2l([ 39654 r$5() 39655 ], ScheduledStatus.prototype, "sale_start_date", 2); 39656 ScheduledStatus = __decorateClass$2l([ 39657 t$3("sonic-event-scheduled-status") 39658 ], ScheduledStatus); 39659 var __defProp$2i = Object.defineProperty; 39660 var __getOwnPropDesc$2k = Object.getOwnPropertyDescriptor; 39661 var __decorateClass$2k = (decorators, target, key, kind) => { 39662 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2k(target, key) : target; 39663 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39664 if (decorator = decorators[i2]) 39665 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39666 if (kind && result) __defProp$2i(target, key, result); 39667 return result; 39668 }; 39669 const tagName$1s = "sonic-pin"; 39670 let SonicPin = class extends Subscriber$1(i$6) { 39671 constructor() { 39672 super(...arguments); 39673 this.size = "md"; 39674 this.isPinned = false;
39675 } 39676 updatePin(pinned) { 39677 this.currentItemIsPined(pinned); 39678 } 39679 willUpdate(_changedProperties) { 39680 if (_changedProperties.has("props")) { 39681 this.currentItemIsPined(); 39682 } 39683 if (this.isPinned) { 39684 this.setAttribute("active", ""); 39685 } else { 39686 this.removeAttribute("active"); 39687 } 39688 super.willUpdate(_changedProperties); 39689 } 39690 currentItemIsPined(pinned) { 39691 const pinnedItem = pinned || getPinned(); 39692 if (pinnedItem) { 39693 const { id, entity_type } = pinnedItem; 39694 const ispinnedId = id === this.props?.id; 39695 const ispinnedType = entity_type === this.props?.entity_type; 39696 this.isPinned = ispinnedId && ispinnedType; 39697 } 39698 } 39699 // toggle pin 39700 togglePin() { 39701 if (this.isPinned) { 39702 this.isPinned = false; 39703 removePinned(true); 39704 } else { 39705 const id = this.props?.id; 39706 const entity_type = this.props?.entity_type; 39707 const archiving_date = this.props?.settings?.archiving_date || this.props?.archiving_date; 39708 const hasSeatmap = !!(this.props?.room && ["place", "mixte"].includes(this.props.room.placing_type_key || "")); 39709 const slug = this.props?.slug; 39710 setPinned({ id, entity_type, archiving_date, hasSeatmap, slug }); 39711 this.isPinned = true; 39712 } 39713 } 39714 render() { 39715 return b$1`<sonic-button 39716 variant="ghost" 39717 shape="block" 39718 align="left" 39719 ?active=${this.isPinned} 39720 size=${this.size} 39721 @click=${this.togglePin} 39722 > 39723 <sonic-icon name="thumbtack" library="custom" slot="prefix"> </sonic-icon> 39724 ${this.isPinned ? "Désépingler" : "Ãpingler"} 39725 </sonic-button>`; 39726 } 39727 }; 39728 __decorateClass$2k([ 39729 n$5({ type: String }) 39730 ], SonicPin.prototype, "size", 2); 39731 __decorateClass$2k([ 39732 n$5({ type: Boolean }) 39733 ], SonicPin.prototype, "isPinned", 2); 39734 __decorateClass$2k([ 39735 onAssign$1(DP_PINNED_ITEM) 39736 ], SonicPin.prototype, "updatePin", 1); 39737 SonicPin = __decorateClass$2k([ 39738 t$3(tagName$1s) 39739 ], SonicPin); 39740 const setPinned = (pinOptions, redirect) => { 39741 const { id, hasSeatmap, slug } = pinOptions; 39742 const pinnedItem = JSON.stringify({ ...pinOptions }); 39743 localStorage.setItem(DP_PINNED_ITEM, pinnedItem); 39744 PublisherManager.get(DP_PINNED_ITEM).set({ ...pinOptions }); 39745 { 39746 if (hasSeatmap && slug && id) { 39747 appRoute("seatmap").fill({ slug, id }).goTo(); 39748 } else { 39749 appRoute("pin").goTo(); 39750 } 39751 } 39752 }; 39753 const removePinned = (redirect) => { 39754 localStorage.removeItem(DP_PINNED_ITEM); 39755 PublisherManager.get(DP_PINNED_ITEM).set({}); 39756 const isPinPage = appRoute("pin").matchesCurrentPath(); 39757 if (isPinPage && redirect) { 39758 setTimeout(() => { 39759 appRoute("store").goTo(); 39760 }, 80); 39761 } 39762 }; 39763 const getPinned = () => { 39764 const pinnedItem = localStorage.getItem(DP_PINNED_ITEM); 39765 if (pinnedItem) { 39766 const { id, entity_type, archiving_date, hasSeatmap, slug } = JSON.parse(pinnedItem); 39767 return { id, entity_type, archiving_date, hasSeatmap, slug }; 39768 } 39769 return null; 39770 }; 39771 var __defProp$2h = Object.defineProperty; 39772 var __getOwnPropDesc$2j = Object.getOwnPropertyDescriptor; 39773 var __decorateClass$2j = (decorators, target, key, kind) => { 39774 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2j(target, key) : target; 39775 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39776 if (decorator = decorators[i2]) 39777 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39778 if (kind && result) __defProp$2h(target, key, result); 39779 return result; 39780 }; 39781 let RefundStatus = class extends Subscriber$1(i$6) { 39782 constructor() { 39783 super(...arguments); 39784 this.refund = {}; 39785 this.wording_LIB_remboursement_actif = ""; 39786 this.noText = false; 39787 this.noIcon = false; 39788 } 39789 render() { 39790 if (!this.refund.display_setting_status || !this.refund.enabled) return A$1; 39791 return b$1` 39792 <sonic-tooltip label=${this.wording_LIB_remboursement_actif} ?disabled=${!this.noText}> 39793 ${!this.noIcon ? b$1`<sonic-icon library="custom" name="arrow-rotate-left"></sonic-icon>` : A$1} 39794 ${!this.noText ? b$1` <span class="wording">${this.wording_LIB_remboursement_actif}</span>` : A$1} 39795 </sonic-tooltip> 39796 `; 39797 } 39798 }; 39799 RefundStatus.styles = styles$2; 39800 __decorateClass$2j([ 39801 n$5({ type: Object }) 39802 ], RefundStatus.prototype, "refund", 2); 39803 __decorateClass$2j([ 39804 n$5({ type: String }) 39805 ], RefundStatus.prototype, "wording_LIB_remboursement_actif", 2); 39806 __decorateClass$2j([ 39807 n$5({ type: Boolean }) 39808 ], RefundStatus.prototype, "noText", 2); 39809 __decorateClass$2j([ 39810 n$5({ type: Boolean }) 39811 ], RefundStatus.prototype, "noIcon", 2); 39812 RefundStatus = __decorateClass$2j([ 39813 t$3("sonic-event-refund-status") 39814 ], RefundStatus); 39815 var __defProp$2g = Object.defineProperty; 39816 var __getOwnPropDesc$2i = Object.getOwnPropertyDescriptor; 39817 var __decorateClass$2i = (decorators, target, key, kind) => { 39818 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2i(target, key) : target; 39819 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39820 if (decorator = decorators[i2]) 39821 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39822 if (kind && result) __defProp$2g(target, key, result); 39823 return result; 39824 }; 39825 let DistancingStatus = class extends Subscriber$1(i$6) { 39826 constructor() { 39827 super(...arguments); 39828 this.distancing = {}; 39829 this.wording_LIB_distanciation_actif = ""; 39830 this.noText = false;
39831 this.noIcon = false; 39832 } 39833 render() { 39834 if (!this.distancing.display_setting_status || !this.distancing.enabled) return A$1; 39835 return b$1` 39836 <sonic-tooltip label=${this.wording_LIB_distanciation_actif} ?disabled=${!this.noText}> 39837 ${!this.noIcon ? b$1`<sonic-icon library="custom" prefix="solid" name="people-arrows"></sonic-icon>` : A$1} 39838 ${!this.noText ? b$1`<span class="wording">${this.wording_LIB_distanciation_actif}</span>` : A$1} 39839 </sonic-tooltip> 39840 `; 39841 } 39842 }; 39843 DistancingStatus.styles = styles$2; 39844 __decorateClass$2i([ 39845 n$5({ type: Object }) 39846 ], DistancingStatus.prototype, "distancing", 2); 39847 __decorateClass$2i([ 39848 n$5({ type: String }) 39849 ], DistancingStatus.prototype, "wording_LIB_distanciation_actif", 2); 39850 __decorateClass$2i([ 39851 n$5({ type: Boolean }) 39852 ], DistancingStatus.prototype, "noText", 2); 39853 __decorateClass$2i([ 39854 n$5({ type: Boolean }) 39855 ], DistancingStatus.prototype, "noIcon", 2); 39856 DistancingStatus = __decorateClass$2i([ 39857 t$3("sonic-event-distancing-status") 39858 ], DistancingStatus); 39859 var __defProp$2f = Object.defineProperty; 39860 var __getOwnPropDesc$2h = Object.getOwnPropertyDescriptor; 39861 var __decorateClass$2h = (decorators, target, key, kind) => { 39862 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2h(target, key) : target; 39863 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39864 if (decorator = decorators[i2]) 39865 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39866 if (kind && result) __defProp$2f(target, key, result); 39867 return result; 39868 }; 39869 let SonicProductPublication = class extends Subscriber$1(i$6) { 39870 constructor() { 39871 super(...arguments); 39872 this.direction = "column"; 39873 this.displaySchedule = "single"; 39874 this.publication = null; 39875 this.schedule = null; 39876 } 39877 getStatusInfo(status) { 39878 switch (status) { 39879 case "unpublished": 39880 return { 39881 icon: "eye-slash", 39882 wording: t("non_publie") 39883 }; 39884 case "counter": 39885 return { 39886 icon: "store", 39887 wording: t("au_guichet_uniquement") 39888 }; 39889 case "only_visible": 39890 return { 39891 icon: "eye", 39892 wording: t("au_guichet_uniquement_et_visible_en_ligne") 39893 }; 39894 case "on_sale": 39895 return { 39896 icon: "basket-shopping", 39897 wording: t("au_guichet_uniquement_et_en_ligne") 39898 }; 39899 default: 39900 return { 39901 icon: "", 39902 wording: "" 39903 }; 39904 } 39905 } 39906 render() { 39907 const currentPublication = this.getStatusInfo(this.publication); 39908 const schedule = this.schedule ?? []; 39909 if (this.displaySchedule === "none" || schedule.length === 0) return this.renderStatus(currentPublication); 39910 const slicedSchedule = this.displaySchedule === "all" ? schedule : schedule.slice(0, 1); 39911 return b$1`<div class="grid grid-cols-1 gap-2"> 39912 ${c$1(slicedSchedule, (schedule2, index) => { 39913 const previousPublication = index === 0 ? currentPublication : this.getStatusInfo(this.schedule ? this.schedule[index - 1]?.publication : null); 39914 const nextPublication = schedule2?.date; 39915 const nextPublicationStatus = this.getStatusInfo(schedule2?.publication); 39916 return b$1` 39917 <div class="-mt-1"> 39918 <sonic-date 39919 class="font-medium text-2xs -mb-[2px] block" 39920 date="${nextPublication}" 39921 noAutoFill 39922 weekday="hidden" 39923 day="2-digit" 39924 month="2-digit" 39925 year="2-digit" 39926 ></sonic-date> 39927 <span class="flex items-center justify-center gap-1 "> 39928 ${this.renderStatus(previousPublication)} 39929 <sonic-icon size="xs" library="custom" name="arrow-right-long"></sonic-icon> 39930 ${this.renderStatus(nextPublicationStatus)} 39931 </span> 39932 </div> 39933 `; 39934 })} 39935 </div>`; 39936 } 39937 renderStatus(status) { 39938 return b$1` 39939 <sonic-tooltip label=${status.wording} placement=${o$4(this.tooltipPlacement)}> 39940 <sonic-icon library="custom" name=${status.icon}></sonic-icon> 39941 </sonic-tooltip> 39942 `; 39943 } 39944 }; 39945 SonicProductPublication.styles = [ 39946 tailwind, 39947 i$9` 39948 /* default | row */ 39949 :host { 39950 display: inline-flex; 39951 align-items: center; 39952 justify-content: center; 39953 text-align: center; 39954 } 39955 :host([direction="row"]) { 39956 flex-direction: row; 39957 gap: 0.25em; 39958 } 39959 39960 :host([direction="row"]) .closed { 39961 display: inline-flex; 39962 align-items: center; 39963 justify-content: center; 39964 } 39965 39966 /* column */ 39967 :host([direction="column"]) { 39968 flex-direction: column; 39969 } 39970 39971 :host([direction="column"]) .closed { 39972 display: inline-flex; 39973 flex-direction: column; 39974 align-items: center; 39975 justify-content: center; 39976 gap: 0.25em; 39977 } 39978 ` 39979 ]; 39980 __decorateClass$2h([ 39981 n$5({ type: String }) 39982 ], SonicProductPublication.prototype, "tooltipPlacement", 2); 39983 __decorateClass$2h([ 39984 n$5({ type: String, reflect: true }) 39985 ], SonicProductPublication.prototype, "direction", 2); 39986 __decorateClass$2h([ 39987 n$5({ type: String }) 39988 ], SonicProductPublication.prototype, "displaySchedule", 2); 39989 __decorateClass$2h([ 39990 n$5({ type: String }) 39991 ], SonicProductPublication.prototype, "publication", 2); 39992 __decorateClass$2h([ 39993 n$5({ type: Array }) 39994 ], SonicProductPublication.prototype, "schedule", 2); 39995 SonicProductPublication = __decorateClass$2h([ 39996 t$3("sonic-product-publication") 39997 ], SonicProductPublication); 39998 var __defProp$2e = Object.defineProperty; 39999 var __getOwnPropDesc$2g = Object.getOwnPropertyDescriptor; 40000 var __decorateClass$2g = (decorators, target, key, kind) => { 40001 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2g(target, key) : target; 40002 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40003 if (decorator = decorators[i2]) 40004 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40005 if (kind && result) __defProp$2e(target, key, result); 40006 return result; 40007 }; 40008 let Configuration = class extends Subscriber$1(i$6) { 40009 constructor() { 40010 super(...arguments); 40011 this.inline = false;
40012 this.settings = null; 40013 this.svgReelax = b$1`<svg 40014 xmlns="http://www.w3.org/2000/svg" 40015 xmlns:xlink="http://www.w3.org/1999/xlink" 40016 viewBox="0 0 37.08 39.46" 40017 width="1em" 40018 height="1em" 40019 fill="currentColor" 40020 style="vertical-align:middle;object-fit: contain;" 40021 > 40022 <polygon points="28.21 0 37.08 12.28 27.19 25.92 19.64 25.92 29.59 12.2 20.79 0 28.21 0" /> 40023 <polygon points="8.86 13.54 0 25.82 9.89 39.46 17.44 39.46 7.49 25.74 16.29 13.54 8.86 13.54" /> 40024 </svg>`; 40025 } 40026 render() { 40027 const settings = this.settings ?? this.props; 40028 const hasSyncho = !!settings?.synchro_site; 40029 const hasRefund = !!settings?.refund?.enabled; 40030 const hasReelax = !!settings?.reelax_info; 40031 const hasWaitingList = !!settings?.waiting_list?.enabled; 40032 const hasCarpooling = !!settings?.carpooling?.enabled; 40033 const hasOpenAgenda = !!settings?.openagenda; 40034 const passCultureIsSynchronized = settings?.pass_culture?.status === "synchronized"; 40035 return b$1`<sonic-product-publication 40036 direction=${this.inline ? "row" : "column"} 40037 noText 40038 class=${this.inline ? "" : "w-full"} 40039 displaySchedule=${o$4(this.displaySchedule)} 40040 ></sonic-product-publication> 40041 40042 ${settings?.closing_date ? b$1`<span class="font-bold text-[11px] leading-tight text-center gap-x-1 text-neutral-400 w-full"> 40043 <sonic-icon library="custom" name="lock" prefix="solid"></sonic-icon> 40044 <span>Clôturé le</span> 40045 <sonic-date 40046 date="${o$4(settings?.closing_date)}" 40047 weekday="hidden" 40048 day="2-digit" 40049 month="2-digit" 40050 year="2-digit" 40051 hour="hidden" 40052 minute="hidden" 40053 ></sonic-date> 40054 </span>` : A$1} 40055 ${hasRefund ? b$1`<sonic-tooltip label="Remboursement activé"> 40056 <sonic-icon class="text-sm text-neutral-400 " library="custom" name="arrow-rotate-left"></sonic-icon 40057 ></sonic-tooltip>` : A$1} 40058 ${hasOpenAgenda ? b$1`<sonic-tooltip label="OpenAgenda activé"> 40059 <sonic-icon class="text-sm text-neutral-400 " library="custom" name="location-check"></sonic-icon 40060 ></sonic-tooltip>` : A$1} 40061 ${hasSyncho ? b$1`<sonic-tooltip label="Synchronisé avec le site"> 40062 <sonic-icon class="text-sm text-neutral-400 " library="custom" name="link"></sonic-icon 40063 ></sonic-tooltip>` : A$1} 40064 ${hasCarpooling ? b$1`<sonic-tooltip label="Covoiturage activé" 40065 ><sonic-icon class="text-sm text-neutral-400 " library="custom" name="car-side"></sonic-icon 40066 ></sonic-tooltip>` : A$1} 40067 ${hasWaitingList ? b$1`<sonic-tooltip label="Liste d'attente si complet" 40068 ><sonic-icon class="text-sm text-neutral-400 " library="custom" name="list-ol"></sonic-icon 40069 ></sonic-tooltip>` : A$1} 40070 ${hasReelax ? b$1`<sonic-tooltip label="Bourse aux billets activée" 40071 ><span class="text-sm text-neutral-400">${this.svgReelax}</span></sonic-tooltip 40072 >` : A$1} 40073 ${passCultureIsSynchronized ? b$1`<sonic-tooltip label="pass Culture synchronisé"> 40074 ${svgPassCulture({ color: "currentColor", className: "size-6 text-neutral-500" })} 40075 </sonic-tooltip>` : A$1} `; 40076 } 40077 }; 40078 Configuration.styles = [ 40079 tailwind, 40080 i$9` 40081 :host { 40082 display: flex; 40083 align-items: center; 40084 justify-content: center; 40085 flex-wrap: wrap; 40086 gap: 0.3em 0.75em; 40087 } 40088 ` 40089 ]; 40090 __decorateClass$2g([ 40091 n$5({ type: String }) 40092 ], Configuration.prototype, "displaySchedule", 2); 40093 __decorateClass$2g([ 40094 n$5({ type: Boolean }) 40095 ], Configuration.prototype, "inline", 2); 40096 __decorateClass$2g([ 40097 n$5({ type: Object }) 40098 ], Configuration.prototype, "settings", 2); 40099 Configuration = __decorateClass$2g([ 40100 t$3("sonic-event-configuration") 40101 ], Configuration); 40102 var __defProp$2d = Object.defineProperty; 40103 var __getOwnPropDesc$2f = Object.getOwnPropertyDescriptor; 40104 var __decorateClass$2f = (decorators, target, key, kind) => { 40105 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2f(target, key) : target; 40106 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40107 if (decorator = decorators[i2]) 40108 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40109 if (kind && result) __defProp$2d(target, key, result); 40110 return result; 40111 }; 40112 const tagName$1r = "sonic-product-actions"; 40113 var ProductActionsEnum = /* @__PURE__ */ ((ProductActionsEnum2) => { 40114 ProductActionsEnum2["VIEW"] = "view"; 40115 ProductActionsEnum2["EDIT"] = "edit"; 40116 ProductActionsEnum2["STATS"] = "stats"; 40117 ProductActionsEnum2["CLONE"] = "clone";
40118 ProductActionsEnum2["PRICES"] = "prices"; 40119 ProductActionsEnum2["SALES"] = "sales"; 40120 ProductActionsEnum2["HISTORY"] = "history"; 40121 ProductActionsEnum2["MULTISESSIONS"] = "multisessions"; 40122 ProductActionsEnum2["MULTISESSIONS_EDIT"] = "multisessions.edit"; 40123 ProductActionsEnum2["MULTISESSIONS_STATS"] = "multisessions.stats"; 40124 ProductActionsEnum2["MULTISESSIONS_TICKETS"] = "multisessions.tickets"; 40125 ProductActionsEnum2["RESERVATIONS"] = "reservations.view"; 40126 ProductActionsEnum2["ALL_SESSIONS"] = "allSessions"; 40127 ProductActionsEnum2["DELETE"] = "delete"; 40128 ProductActionsEnum2["PIN"] = "pin"; 40129 ProductActionsEnum2["DIVIDER"] = "divider"; 40130 return ProductActionsEnum2; 40131 })(ProductActionsEnum || {}); 40132 let SonicProductActions = class extends Subscriber$1(i$6) { 40133 constructor() { 40134 super(...arguments); 40135 this.size = "md"; 40136 this.entity_type = EntityType.Event; 40137 this.displayConfiguration = false; 40138 } 40139 render() { 40140 if (!this.actions?.length) return A$1; 40141 return b$1`<sonic-pop> 40142 <sonic-button shape="circle" variant="ghost" icon size="${this.size}"> 40143 <sonic-icon library="custom" name="ellipsis-vertical" size="lg"></sonic-icon> 40144 </sonic-button> 40145 <sonic-menu slot="content" minWidth="11rem" size="sm"> 40146 ${this.menuActions()} 40147 ${this.displayConfiguration ? b$1`<sonic-divider>Configuration</sonic-divider> 40148 <sonic-event-configuration subDataProvider="settings" class="w-full text-lg"></sonic-event-configuration>` : A$1}</sonic-menu 40149 > 40150 </sonic-pop>`; 40151 } 40152 async deleteEvent() { 40153 const api2 = new API(this.getApiConfiguration()); 40154 await api2.delete(`sessions/${this.id}`, {}); 40155 this.dispatchEvent(new CustomEvent("deleteEvent")); 40156 const closestQueue = HTML.getClosestElement(this, "sonic-queue"); 40157 const formDataProvider = closestQueue?.getAttribute("dataFilterProvider"); 40158 if (this.dataProvider) { 40159 dp(this.dataProvider).invalidate(); 40160 } 40161 if (formDataProvider) { 40162 dp(formDataProvider).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 40163 } 40164 } 40165 confirmDeleteSession() { 40166 const entityTitle = this.props?.edito?.title; 40167 Modal.create({ 40168 title: `Confirmer la suppression`, 40169 subtitle: b$1`<i>"${entityTitle}"</i> sera supprimé définitivement.`, 40170 actions: b$1`<sonic-button @click=${() => this.deleteEvent()} type="danger" hideModal> 40171 <sonic-icon name="trash" library="custom" slot="prefix"> </sonic-icon> Supprimer</sonic-button 40172 > 40173 <sonic-button shape="block" hideModal> Annuler</sonic-button> ` 40174 }); 40175 } 40176 menuActions() { 40177 return this.actions?.map((action) => { 40178 const multisessionId = this.props?.multisession?.id; 40179 const isPast = !!(this.props?.settings?.archiving_date && this.props?.settings?.archiving_date < Math.floor(Date.now() / 1e3)); 40180 switch (action) { 40181 case "view": 40182 if (!this.props?.slug) return A$1; 40183 return b$1`<sonic-app-link 40184 size=${this.size} 40185 to="${this.viewRoute()}" 40186 slug=${this.props.slug} 40187 variant="ghost" 40188 shape="block" 40189 align="left" 40190 > 40191 <sonic-icon name="store" library="custom" slot="prefix"> </sonic-icon> Voir au guichet</sonic-app-link 40192 >`; 40193 case "edit": 40194 return b$1` <sonic-app-link 40195 size=${this.size} 40196 to=${this.editRoute()} 40197 id=${this.id} 40198 variant="ghost" 40199 shape="block" 40200 align="left" 40201 > 40202 <sonic-icon name="pen" library="custom" slot="prefix"> </sonic-icon> Modifier</sonic-app-link 40203 >`; 40204 case "stats": 40205 return b$1`<sonic-app-link 40206 size=${this.size} 40207 to="event.stats" 40208 id=${this.id} 40209 variant="ghost" 40210 shape="block" 40211 align="left" 40212 > 40213 <sonic-icon name="chart-pie-simple" library="custom" slot="prefix"> </sonic-icon> 40214 Statistiques</sonic-app-link 40215 >`; 40216 case "multisessions.stats": 40217 if (!multisessionId) return A$1; 40218 return b$1`<sonic-app-link 40219 size=${this.size} 40220 to="event.multisessions.stats" 40221 .id=${multisessionId} 40222 variant="ghost" 40223 shape="block" 40224 align="left" 40225 noAutoFill 40226 > 40227 <sonic-icon name="chart-pie-simple" library="custom" slot="prefix"> </sonic-icon> 40228 Statistiques</sonic-app-link 40229 >`; 40230 case "multisessions.tickets": 40231 if (!multisessionId) return A$1; 40232 return b$1`<sonic-app-link 40233 to=${this.salesRoute()} 40234 .query=${{ "reset-filtres": 1, multiseance: multisessionId, date_debut: "", saison: -2 }} 40235 variant="ghost" 40236 shape="block" 40237 size=${this.size} 40238 align="left" 40239 noAutoFill 40240 > 40241 <sonic-icon name="ticket" library="custom" slot="prefix"> </sonic-icon> Billets émis</sonic-app-link 40242 >`; 40243 case "multisessions": 40244 if (!multisessionId) return A$1; 40245 return b$1`<sonic-app-link 40246 to="event.multisessions" 40247 .id=${multisessionId} 40248 variant="ghost" 40249 shape="block" 40250 size=${this.size} 40251 align="left" 40252 noAutoFill 40253 > 40254 <sonic-icon name="calendar-day" library="custom" slot="prefix"> </sonic-icon> 40255 Multiséance</sonic-app-link 40256 >`; 40257 case "allSessions": 40258 if (!multisessionId) return A$1; 40259 return b$1`<sonic-app-link 40260 to="event" 40261 id=${this.id} 40262 slug=${o$4(this.props?.slug)} 40263 variant="ghost" 40264 shape="block" 40265 size=${this.size} 40266 align="left" 40267 > 40268 <sonic-icon name="calendar-day" library="custom" slot="prefix"> </sonic-icon> 40269 Toutes les séances</sonic-app-link 40270 >`; 40271 case "reservations.view": 40272 return b$1`<sonic-app-link 40273 to="reservations" 40274 .query=${{ "reset-filtres": 1, evenement: this.id }} 40275 variant="ghost" 40276 shape="block" 40277 align="left" 40278 size=${this.size} 40279 > 40280 <sonic-icon name="badge-check" library="custom" slot="prefix"> </sonic-icon> Réservations</sonic-app-link 40281 >`; 40282 case "prices": 40283 return b$1`<sonic-app-link 40284 to="prices" 40285 .query=${{ "reset-filtres": 1, evenement: this.id }} 40286 variant="ghost" 40287 shape="block" 40288 align="left" 40289 size=${this.size} 40290 > 40291 <sonic-icon name="euro-sign" library="custom" slot="prefix"> </sonic-icon> Tarifs</sonic-app-link 40292 >`; 40293 case "sales": 40294 if (this.entity_type == EntityType.Event && this.props?.settings?.can_be_deleted === true) return A$1; 40295 return b$1`<sonic-app-link 40296 to=${this.salesRoute()} 40297 .query=${{ 40298 "reset-filtres": 1, 40299 evenement: this.id, 40300 nid: this.id, 40301 type_abo: this.id, 40302 date_debut: "", 40303 saison: -2 40304 }} 40305 variant="ghost" 40306 shape="block" 40307 align="left" 40308 size=${this.size} 40309 > 40310 <sonic-icon name="ticket" library="custom" slot="prefix"> </sonic-icon> ${this.salesText()}</sonic-app-link 40311 >`; 40312 case "history": 40313 return b$1`<sonic-app-link 40314 size=${this.size} 40315 to="event.history" 40316 id=${this.id} 40317 variant="ghost" 40318 shape="block" 40319 align="left" 40320 > 40321 <sonic-icon name="clock-rotate-left" library="custom" slot="prefix"> </sonic-icon> 40322 Historique</sonic-app-link 40323 >`;
40324 case "clone": 40325 return b$1`<sonic-app-link 40326 size=${this.size} 40327 to="event.clone" 40328 id=${this.id} 40329 variant="ghost" 40330 shape="block" 40331 align="left" 40332 > 40333 <sonic-icon name="copy" library="custom" slot="prefix"> </sonic-icon> Dupliquer</sonic-app-link 40334 >`; 40335 case "pin": 40336 if (isPast) return A$1; 40337 return b$1`<sonic-pin size="sm"></sonic-pin>`; 40338 case "divider": 40339 return b$1`<sonic-divider></sonic-divider>`; 40340 case "delete": 40341 if (this.entity_type !== EntityType.Event || this.props?.settings?.can_be_deleted !== true || !this.permissions?.event?.delete) 40342 return A$1; 40343 return b$1` <sonic-button 40344 @click=${() => this.confirmDeleteSession()} 40345 variant="ghost" 40346 type="danger" 40347 noAutoFill 40348 shape="block" 40349 align="left" 40350 size=${this.size} 40351 > 40352 <sonic-icon name="trash" library="custom" slot="prefix"> </sonic-icon> Supprimer</sonic-button 40353 >`; 40354 default: 40355 return A$1; 40356 } 40357 }); 40358 } 40359 editRoute() { 40360 switch (this.entity_type) { 40361 case EntityType.Subscribe: 40362 return "subscriptionType.edit"; 40363 case EntityType.Giftcard: 40364 return "giftcard.edit"; 40365 case EntityType.Event: 40366 return "event.edit"; 40367 case EntityType.Merch: 40368 return "merch.edit"; 40369 default: 40370 return "event.edit"; 40371 } 40372 } 40373 salesRoute() { 40374 switch (this.entity_type) { 40375 case EntityType.Event: 40376 return "tickets"; 40377 case EntityType.Merch: 40378 return "merch.sales"; 40379 case EntityType.Subscribe: 40380 return "subscription.sales"; 40381 case EntityType.Giftcard: 40382 return "giftcard.sales"; 40383 default: 40384 return "tickets"; 40385 } 40386 } 40387 viewRoute() { 40388 switch (this.entity_type) { 40389 case EntityType.Event: 40390 return "event.session"; 40391 case EntityType.Merch: 40392 return "merch"; 40393 case EntityType.Subscribe: 40394 return "subscription"; 40395 case EntityType.Giftcard: 40396 return "giftcards"; 40397 default: 40398 return "event.session"; 40399 } 40400 } 40401 salesText() { 40402 switch (this.entity_type) { 40403 case EntityType.Event: 40404 return "Billets émis"; 40405 default: 40406 return "Produits vendus"; 40407 } 40408 } 40409 }; 40410 SonicProductActions.styles = [ 40411 tailwind, 40412 i$9` 40413 :host() { 40414 display: block; 40415 } 40416 40417 sonic-divider:last-child { 40418 display: none; 40419 } 40420 ` 40421 ]; 40422 __decorateClass$2f([ 40423 n$5() 40424 ], SonicProductActions.prototype, "size", 2); 40425 __decorateClass$2f([ 40426 n$5({ type: Array }) 40427 ], SonicProductActions.prototype, "actions", 2); 40428 __decorateClass$2f([ 40429 n$5({ type: String }) 40430 ], SonicProductActions.prototype, "entity_type", 2); 40431 __decorateClass$2f([ 40432 n$5({ type: Boolean }) 40433 ], SonicProductActions.prototype, "displayConfiguration", 2); 40434 __decorateClass$2f([ 40435 bind$1("admin/current.data.permissions"), 40436 r$5() 40437 ], SonicProductActions.prototype, "permissions", 2); 40438 SonicProductActions = __decorateClass$2f([ 40439 t$3(tagName$1r) 40440 ], SonicProductActions); 40441 var __defProp$2c = Object.defineProperty; 40442 var __getOwnPropDesc$2e = Object.getOwnPropertyDescriptor; 40443 var __decorateClass$2e = (decorators, target, key, kind) => { 40444 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2e(target, key) : target; 40445 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40446 if (decorator = decorators[i2]) 40447 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40448 if (kind && result) __defProp$2c(target, key, result); 40449 return result; 40450 }; 40451 let MerchCard = class extends Subscriber$1(i$6) { 40452 constructor() { 40453 super(...arguments); 40454 this.displayBackButton = false; 40455 } 40456 handleClickIllustration(src) { 40457 if (!src) return; 40458 Modal.create({ 40459 maxWidth: "60rem", 40460 content: b$1` <sonic-image src=${src} rounded="md" class="max-w-full max-h-full"></sonic-image> ` 40461 }); 40462 } 40463 render() { 40464 if (!this.props) return A$1; 40465 const bigPicture = this.props?.picture?.src ?? void 0; 40466 const body = this.props?.edito?.body ?? void 0; 40467 return b$1` 40468 <div class="@container "> 40469 <div 40470 class=" grid grid-cols-1 40471 @xl:grid-cols-[minmax(0,_12rem),_minmax(0,_1fr)] 40472 items-start 40473 rounded-lg gap-5 " 40474 > 40475 <div class="relative group"> 40476 ${this.displayBackButton ? b$1` 40477 <sonic-button 40478 icon 40479 goBack=${appRoute("home")} 40480 shape="circle" 40481 size="sm" 40482 noAutoFill 40483 type="neutral" 40484 class="absolute -left-1 -top-1 z-10" 40485 > 40486 <sonic-icon library="custom" name="arrow-left"></sonic-icon> 40487 </sonic-button> 40488 ` : A$1} 40489 <sonic-button variant="unstyled" @click=${() => this.handleClickIllustration(bigPicture)} class="w-full "> 40490 ${bigPicture ? b$1` 40491 <sonic-icon 40492 name="magnifying-glass-plus" 40493 library="custom" 40494 size="lg" 40495 class="absolute bottom-3 right-3 z-10 text-contrast-content group-hover:scale-[1.1] 40496 drop-shadow-md 40497 transition-all duration-200 " 40498 ></sonic-icon> 40499 ` : A$1} 40500 <sonic-product-illustration rounded="md"></sonic-product-illustration> 40501 </sonic-button> 40502 </div> 40503 40504 <div class="flex flex-col gap-2"> 40505 <sonic-product-title class="text-xl @xl:text-2xl font-bold flex-grow mb-3 mt-1"></sonic-product-title> 40506 <sonic-event-additional-status size="sm"></sonic-event-additional-status> 40507 <sonic-event-scheduled-status size="sm"></sonic-event-scheduled-status> 40508 <sonic-categorized-prices 40509 formType="select" 40510 type="merch" 40511 item_id=${this.id || ""} 40512 size="sm" 40513 class="flex-grow" 40514 ></sonic-categorized-prices> 40515
40516 ${body ? b$1` <sonic-divider class="my-4"></sonic-divider> 40517 <div class="prose prose-tight block text-sm @xl:text-base">${o$6(body)}</div>` : A$1} 40518 </div> 40519 </div> 40520 </div> 40521 `; 40522 } 40523 }; 40524 MerchCard.styles = [tailwind]; 40525 __decorateClass$2e([ 40526 n$5({ type: Boolean }) 40527 ], MerchCard.prototype, "displayBackButton", 2); 40528 MerchCard = __decorateClass$2e([ 40529 t$3("sonic-merch") 40530 ], MerchCard); 40531 var __defProp$2b = Object.defineProperty; 40532 var __getOwnPropDesc$2d = Object.getOwnPropertyDescriptor; 40533 var __decorateClass$2d = (decorators, target, key, kind) => { 40534 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2d(target, key) : target; 40535 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40536 if (decorator = decorators[i2]) 40537 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40538 if (kind && result) __defProp$2b(target, key, result); 40539 return result; 40540 }; 40541 const tagName$1q = "sonic-prose"; 40542 let SonicProse = class extends Subscriber$1(i$6) { 40543 constructor() { 40544 super(...arguments); 40545 this.size = "md"; 40546 } 40547 connectedCallback() { 40548 const templateEl = this.querySelector("template"); 40549 this.htmlContent = templateEl?.innerHTML.toString(); 40550 super.connectedCallback(); 40551 } 40552 render() { 40553 return b$1`<div class="prose ${this.size == "sm" ? " prose-sm prose-tight" : ""} max-w-[80ch]"> 40554 ${o$6(this.htmlContent)} 40555 <slot></slot> 40556 </div>`; 40557 } 40558 }; 40559 SonicProse.styles = [ 40560 tailwind, 40561 i$9` 40562 :host { 40563 display: block; 40564 } 40565 ` 40566 ]; 40567 __decorateClass$2d([ 40568 n$5() 40569 ], SonicProse.prototype, "size", 2); 40570 __decorateClass$2d([ 40571 n$5() 40572 ], SonicProse.prototype, "htmlContent", 2); 40573 SonicProse = __decorateClass$2d([ 40574 t$3(tagName$1q) 40575 ], SonicProse); 40576 const sonicProse = i$9` 40577 .sonic-prose { 40578 --sc-prose-mb: 1em; 40579 max-width: 72ch; 40580 } 40581 .sonic-prose-condensed { 40582 --sc-prose-mb: 0.6em; 40583 } 40584 .sonic-prose a { 40585 text-decoration: underline; 40586 } 40587 .sonic-prose p { 40588 margin-bottom: var(--_sc-prose-mb, 1em); 40589 } 40590 .sonic-prose ul, 40591 .sonic-prose ol { 40592 margin-bottom: var(--_sc-prose-mb, 1em); 40593 padding-left: 1.75em; 40594 } 40595 .sonic-prose li { 40596 margin-bottom: 0.1em; 40597 } 40598 .sonic-prose ul, 40599 .sonic-prose li { 40600 list-style-type: disc; 40601 } 40602`; 40603 var __defProp$2a = Object.defineProperty; 40604 var __getOwnPropDesc$2c = Object.getOwnPropertyDescriptor; 40605 var __decorateClass$2c = (decorators, target, key, kind) => { 40606 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2c(target, key) : target; 40607 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40608 if (decorator = decorators[i2]) 40609 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40610 if (kind && result) __defProp$2a(target, key, result); 40611 return result; 40612 }; 40613 const tagName$1p = "sonic-page-layout"; 40614 let PageLayout = class extends Subscriber$1(i$6) { 40615 constructor() { 40616 super(...arguments); 40617 this.displayTitle = false; 40618 this.displayText = false; 40619 this.smallTitle = false; 40620 } 40621 render() { 40622 const cleanTextMarkup = this.pageText ? this.removeEmptyParagraphs(this.pageText) : ""; 40623 const pageText = o$6(cleanTextMarkup || ""); 40624 return b$1`<div> 40625 ${(this.pageTitle || this.pageSubtitle) && this.displayTitle ? b$1`<div class="mb-4"> 40626 ${this.pageTitle && this.displayTitle ? b$1`<h1 40627 class="font-headings font-weight-headings font-style-headings lg:leading-none text-pretty ${this.smallTitle ? "text-2xl lg:text-4xl" : "text-4xl lg:text-5xl max-w-[30ch]"} " 40628 > 40629 ${this.pageTitle} 40630 </h1>` : A$1} 40631 ${this.pageSubtitle && this.displayTitle ? b$1`<h1 40632 class="font-headings font-weight-headings font-style-headings mt-1 ${this.smallTitle ? "text-lg lg:text-xl" : "text-xl lg:text-2xl max-w-[30ch]"} " 40633 > 40634 ${this.pageSubtitle} 40635 </h1>` : A$1} 40636 </div>` : A$1} 40637 40638 <slot name="intro"></slot> 40639 ${pageText && this.displayText ? b$1`<div class="mb-10 prose ">${pageText}</div>` : A$1} 40640 <slot></slot> 40641 </div>`; 40642 } 40643 removeEmptyParagraphs(markup) { 40644 return markup.replace(/<p><\/p>/g, "").replace(/<p> <\/p>/g, "").replace(/<p><br><\/p>/g, ""); 40645 } 40646 }; 40647 PageLayout.styles = [ 40648 tailwind, 40649 sonicProse, 40650 i$9` 40651 :host { 40652 display: block; 40653 } 40654 ` 40655 ]; 40656 __decorateClass$2c([ 40657 n$5({ type: String }) 40658 ], PageLayout.prototype, "pageTitle", 2); 40659 __decorateClass$2c([ 40660 n$5({ type: String }) 40661 ], PageLayout.prototype, "pageSubtitle", 2); 40662 __decorateClass$2c([ 40663 n$5({ type: String }) 40664 ], PageLayout.prototype, "pageText", 2); 40665 __decorateClass$2c([ 40666 n$5({ type: Boolean }) 40667 ], PageLayout.prototype, "displayTitle", 2); 40668 __decorateClass$2c([ 40669 n$5({ type: Boolean }) 40670 ], PageLayout.prototype, "displayText", 2); 40671 __decorateClass$2c([ 40672 n$5({ type: Boolean }) 40673 ], PageLayout.prototype, "smallTitle", 2); 40674 PageLayout = __decorateClass$2c([ 40675 t$3(tagName$1p) 40676 ], PageLayout); 40677 var __defProp$29 = Object.defineProperty; 40678 var __getOwnPropDesc$2b = Object.getOwnPropertyDescriptor; 40679 var __decorateClass$2b = (decorators, target, key, kind) => { 40680 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2b(target, key) : target; 40681 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40682 if (decorator = decorators[i2]) 40683 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40684 if (kind && result) __defProp$29(target, key, result); 40685 return result; 40686 }; 40687 let SonicEventCard$2 = class SonicEventCard extends Subscriber$1(i$6) { 40688 constructor() { 40689 super(...arguments); 40690 this.categories = []; 40691 this.labels = []; 40692 this.slug = ""; 40693 this.skeleton = false;
40694 this.link = false; 40695 this.displayLocation = false; 40696 this.staticMode = false; 40697 } 40698 render() { 40699 if (this.skeleton) { 40700 return this.renderSkeleton(); 40701 } 40702 if (this.link) { 40703 let route2 = "event"; 40704 const entityType = this.props && "entity_type" in this.props ? this.props.entity_type : EntityType.Event; 40705 if (entityType === EntityType.Merch) { 40706 route2 = "merch"; 40707 } 40708 return b$1`<sonic-app-link to=${route2} .slug=${this.slug} class="group contents"> 40709 ${this.cardMarkup()} 40710 </sonic-app-link>`; 40711 } 40712 return this.cardMarkup(); 40713 } 40714 cardMarkup() { 40715 const id = this.props?.id; 40716 if (!id) return A$1; 40717 const isShowContext = this.props && "sessions" in this.props; 40718 const entityType = this.props && "entity_type" in this.props ? this.props.entity_type : EntityType.Event; 40719 const entityEndpoint = entityType === EntityType.Merch ? "merchs" : "sessions"; 40720 const statusEndpoint = isShowContext ? `shows/${id}/status` : `${entityEndpoint}/${id}?features[]=status`; 40721 const statusKey = isShowContext ? void 0 : "data"; 40722 const isMerch = entityType === EntityType.Merch; 40723 return b$1`<div class="@container"> 40724 <div 40725 class="leading-tight p-2 @sm:p-3 flex gap-3 rounded-md border border-solid border-neutral-100 40726 hover:border-neutral-200 focus:border-neutral-300 40727 transition duration-75 bg-neutral-0 " 40728 > 40729 <sonic-product-illustration 40730 rounded="md" 40731 class="w-1/3 max-w-[8rem] shrink-0 relative self-start" 40732 ></sonic-product-illustration> 40733 <div class="self-center flex-grow py-1 min-w-0"> 40734 <sonic-date 40735 weekday="short" 40736 day="2-digit" 40737 month="short" 40738 class="text-xs leading-tight block mb-2 uppercase" 40739 ></sonic-date> 40740 <div class="mb-3"> 40741 <sonic-product-title class="leading-tight"></sonic-product-title> 40742 </div> 40743 40744 <div class="flex gap-1 flex-wrap items-center gap-x-2 text-xs"> 40745 ${this.staticMode ? b$1`<sonic-event-additional-status 40746 size="inherit" 40747 variant="ghost" 40748 class="flex flex-wrap gap-x-3 gap-y-1" 40749 ></sonic-event-additional-status>` : b$1`<sonic-event-additional-status 40750 fetch 40751 dataProvider="${statusEndpoint}" 40752 key="${o$4(statusKey)}" 40753 size="inherit" 40754 variant="ghost" 40755 warnAndDangerAsPill 40756 class="flex flex-wrap gap-x-3 gap-y-1" 40757 ></sonic-event-additional-status>`} 40758 40759 <sonic-event-scheduled-status size="inherit"></sonic-event-scheduled-status> 40760 <sonic-event-taxonomy .taxonomy=${this.labels} size="inherit" key="label"></sonic-event-taxonomy> 40761 ${this.categories.length > 0 ? b$1` <sonic-event-taxonomy 40762 .icon=${{ name: "tag", library: "custom" }} 40763 .taxonomy=${this.categories} 40764 variant="ghost" 40765 key="category" 40766 size="xs" 40767 > 40768 </sonic-event-taxonomy>` : A$1} 40769 ${this.displayLocation ? b$1`<sonic-event-location-hall size="inherit" class=" grow w-full"></sonic-event-location-hall>` : A$1} 40770 </div> 40771 ${isMerch ? b$1`<sonic-price-range class="text-sm"></sonic-price-range>` : A$1} 40772 <slot name="bottom"></slot> 40773 </div> 40774 </div> 40775 </div>`; 40776 } 40777 renderSkeleton() { 40778 return b$1` 40779 <div class="leading-tight p-2 @sm:p-3 flex gap-3 rounded-md border border-solid border-neutral-100"> 40780 <div class="w-1/3 max-w-[8rem] shrink-0 relative aspect-square rounded-md bg-neutral-100 animate-pulse"></div> 40781 <div class="self-center flex-grow"> 40782 <div class=" leading-none block mb-2 bg-neutral-50 rounded-sm h-4 w-1/2 "></div> 40783 <div class=" leading-none block mb-1 bg-neutral-100 rounded-sm h-5 w-2/3 "></div> 40784 <div class="text-xs leading-tight block bg-neutral-100 rounded-sm h-3 w-1/3"></div> 40785 </div> 40786 </div> 40787 `; 40788 } 40789 }; 40790 SonicEventCard$2.styles = [tailwind]; 40791 __decorateClass$2b([ 40792 n$5({ type: Array }) 40793 ], SonicEventCard$2.prototype, "categories", 2); 40794 __decorateClass$2b([ 40795 n$5({ type: Array }) 40796 ], SonicEventCard$2.prototype, "labels", 2); 40797 __decorateClass$2b([ 40798 n$5({ type: String }) 40799 ], SonicEventCard$2.prototype, "slug", 2); 40800 __decorateClass$2b([ 40801 n$5({ type: Boolean }) 40802 ], SonicEventCard$2.prototype, "skeleton", 2); 40803 __decorateClass$2b([ 40804 n$5({ type: Boolean }) 40805 ], SonicEventCard$2.prototype, "link", 2); 40806 __decorateClass$2b([ 40807 n$5({ type: Boolean }) 40808 ], SonicEventCard$2.prototype, "displayLocation", 2); 40809 __decorateClass$2b([ 40810 c({ context: staticMode }), 40811 r$5() 40812 ], SonicEventCard$2.prototype, "staticMode", 2); 40813 SonicEventCard$2 = __decorateClass$2b([ 40814 t$3("sonic-event-card") 40815 ], SonicEventCard$2); 40816 var __defProp$28 = Object.defineProperty; 40817 var __getOwnPropDesc$2a = Object.getOwnPropertyDescriptor; 40818 var __decorateClass$2a = (decorators, target, key, kind) => { 40819 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2a(target, key) : target; 40820 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40821 if (decorator = decorators[i2]) 40822 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40823 if (kind && result) __defProp$28(target, key, result); 40824 return result; 40825 }; 40826 const tagName$1o = "sonic-shop"; 40827 let SonicShop = class extends Subscriber$1(i$6) { 40828 constructor() { 40829 super(...arguments); 40830 this.displayTitle = false;
40831 this.displayText = false; 40832 this.smallTitle = false; 40833 this.noRouting = false; 40834 this.storeMode = false; 40835 this.localStoreFilters = false; 40836 this.filterFormDataProvider = "defaultStoreFilters"; 40837 } 40838 handleClick(item) { 40839 if (!this.noRouting) return; 40840 Modal.create({ 40841 maxWidth: "72rem", 40842 content: b$1` 40843 <sonic-fetch 40844 key="data" 40845 dataProvider="merchs/${item.id}?features[]=prices&features[]=picture&features[]=status" 40846 cartProvider=${o$4(this.cartProvider)} 40847 > 40848 <sonic-merch .item=${item}></sonic-merch> 40849 </sonic-fetch> 40850 ` 40851 }); 40852 } 40853 render() { 40854 return b$1`<sonic-page-layout 40855 pageTitle=${t("module_shop_title")} 40856 pageText=${t("module_shop_text")} 40857 ?smallTitle=${this.smallTitle} 40858 ?displayTitle=${this.displayTitle} 40859 ?displayText=${this.displayText} 40860 > 40861 <div class="@container"> 40862 ${this.localStoreFilters ? b$1`<sonic-subscriber 40863 dataProvider="${this.filterFormDataProvider}" 40864 localStorage="enabled" 40865 ></sonic-subscriber>` : A$1} 40866 <sonic-form-event-filter 40867 .entityType=${EntityType.Merch} 40868 formDataProvider="${this.filterFormDataProvider}" 40869 class="block max-w-[40rem] w-full min-w-0 mb-6" 40870 ></sonic-form-event-filter> 40871 40872 <sonic-queue 40873 key="data" 40874 dataFilterProvider="${this.filterFormDataProvider}" 40875 dataProviderExpression="merchs?features[]=prices&features[]=picture&features[]=status&features[]=settings&limit=$limit&offset=$offset" 40876 class="grid grid-cols-1 ${this.storeMode ? "" : "@2xl:grid-cols-2 gap-4 @5xl:grid-cols-3"} " 40877 .items=${(item) => this.renderItems(item)} 40878 .noItems=${() => b$1` <sonic-no-result></sonic-no-result> `} 40879 .skeleton=${() => this.renderSkeleton()} 40880 > 40881 </sonic-queue> 40882 </div> 40883 </sonic-page-layout>`; 40884 } 40885 renderItems(item) { 40886 return b$1` 40887 ${this.storeMode ? b$1`<sonic-event-store-item formType=${this.appType === "counter" ? "buttons" : "select"} class="mb-4 block"> 40888 </sonic-event-store-item> ` : b$1` <sonic-event-card 40889 ?link=${!this.noRouting} 40890 @click=${() => this.handleClick(item)} 40891 class="cursor-pointer" 40892 > 40893 </sonic-event-card>`} 40894 `; 40895 } 40896 renderSkeleton() { 40897 return b$1` 40898 ${this.storeMode ? b$1` <sonic-event-store-item skeleton></sonic-event-store-item> ` : b$1` <sonic-event-card skeleton></sonic-event-card> `} 40899 `; 40900 } 40901 }; 40902 SonicShop.styles = [ 40903 tailwind, 40904 i$9` 40905 :host { 40906 display: block; 40907 } 40908 ` 40909 ]; 40910 __decorateClass$2a([ 40911 n$5({ type: Boolean }) 40912 ], SonicShop.prototype, "displayTitle", 2); 40913 __decorateClass$2a([ 40914 n$5({ type: Boolean }) 40915 ], SonicShop.prototype, "displayText", 2); 40916 __decorateClass$2a([ 40917 n$5({ type: Boolean }) 40918 ], SonicShop.prototype, "smallTitle", 2); 40919 __decorateClass$2a([ 40920 n$5({ type: Boolean }) 40921 ], SonicShop.prototype, "noRouting", 2); 40922 __decorateClass$2a([ 40923 n$5({ type: String }) 40924 ], SonicShop.prototype, "cartProvider", 2); 40925 __decorateClass$2a([ 40926 n$5({ type: Boolean }) 40927 ], SonicShop.prototype, "storeMode", 2); 40928 __decorateClass$2a([ 40929 n$5({ type: Boolean }) 40930 ], SonicShop.prototype, "localStoreFilters", 2); 40931 __decorateClass$2a([ 40932 n$5({ type: String }) 40933 ], SonicShop.prototype, "filterFormDataProvider", 2); 40934 __decorateClass$2a([ 40935 c({ context: appType, subscribe: true }) 40936 ], SonicShop.prototype, "appType", 2); 40937 SonicShop = __decorateClass$2a([ 40938 t$3(tagName$1o) 40939 ], SonicShop); 40940 var __defProp$27 = Object.defineProperty; 40941 var __getOwnPropDesc$29 = Object.getOwnPropertyDescriptor; 40942 var __decorateClass$29 = (decorators, target, key, kind) => { 40943 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$29(target, key) : target; 40944 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40945 if (decorator = decorators[i2]) 40946 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40947 if (kind && result) __defProp$27(target, key, result); 40948 return result; 40949 }; 40950 let instanceCounter$9 = 0; 40951 let SubscriptionType = class extends Subscriber$1(i$6) { 40952 constructor() { 40953 super(...arguments); 40954 this.infos_status = null; 40955 this._needProof = false;
40956 this.formDataProvider = `SubscriptionTypePriceForm/${instanceCounter$9++}`; 40957 this._selectedPriceId = 0; 40958 this.pricesOptions = []; 40959 this.loading = false; 40960 this.handleFormMutation = () => { 40961 const priceId = dp(this.formDataProvider).price.id.get(); 40962 const priceHasChanged = this._selectedPriceId !== Number(priceId); 40963 if (!priceId || !priceHasChanged) return; 40964 const currentPrice = this.props?.prices?.find((price) => price.id?.toString() === priceId.toString()); 40965 const quantity = Number(dp(this.formDataProvider).quantity.get()) || 1; 40966 this._needProof = !!currentPrice?.need_proof_of_identity; 40967 this._priceAmount = Number(currentPrice?.amount_display) * Number(quantity); 40968 this._selectedPriceId = Number(priceId); 40969 }; 40970 } 40971 connectedCallback() { 40972 super.connectedCallback(); 40973 dp(this.formDataProvider).onInternalMutation(this.handleFormMutation); 40974 dp(this.formDataProvider).set({ quantity: "1" }); 40975 } 40976 disconnectedCallback() { 40977 dp(this.formDataProvider).offInternalMutation(this.handleFormMutation); 40978 super.disconnectedCallback(); 40979 } 40980 willUpdate(_changedProperties) { 40981 if (_changedProperties.has("props")) { 40982 if (this.props?.prices) { 40983 this.pricesOptions = this.pricesToOptions(this.props.prices); 40984 } 40985 } 40986 if (_changedProperties.has("_selectedPriceId")) { 40987 const currentPrice = this.props?.prices?.find((price) => this._selectedPriceId === price.id); 40988 const isDuo = currentPrice?.is_duo ?? false; 40989 if (isDuo) { 40990 dp(this.formDataProvider).quantity.set("2"); 40991 } else { 40992 const maxQuantity = currentPrice?.price_max_places; 40993 const currentQuantity = Number(dp(this.formDataProvider).quantity.get()) || 1; 40994 if (maxQuantity && currentQuantity > maxQuantity) { 40995 dp(this.formDataProvider).quantity.set(maxQuantity.toString()); 40996 } 40997 } 40998 } 40999 } 41000 pricesToOptions(prices) { 41001 const pricesOptionsDefault = []; 41002 if (prices.length > 1) { 41003 const defaultSelectOption = { 41004 value: "0", 41005 wording: t("LIB_select_price_option") 41006 }; 41007 pricesOptionsDefault.push(defaultSelectOption); 41008 } 41009 const pricesOptions = prices.map((price) => ({ value: price.id?.toString() || "", wording: price.title || "" })); 41010 return [...pricesOptionsDefault, ...pricesOptions]; 41011 } 41012 quantityOptions(max = 10) { 41013 return Array.from({ length: max }, (_2, i2) => ({ 41014 value: (i2 + 1).toString(), 41015 wording: (i2 + 1).toString() 41016 })); 41017 } 41018 async addToCart() { 41019 if (!this.props?.id) return; 41020 this.loading = true; 41021 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 41022 const formValues = dp(this.formDataProvider); 41023 const cartItem = { 41024 entity_type: EntityType.Subscribe, 41025 entity_id: Number(this.props.id), 41026 quantity: Number(formValues.quantity.get()) || 1, 41027 price: { id: parseInt(formValues.price.id.get()) } 41028 }; 41029 await Cart.addItems({ 41030 apiConfiguration: this.getApiConfiguration(), 41031 cartProvider, 41032 items: [cartItem], 41033 attachOwnersAfterRequest: true 41034 }); 41035 this.loading = false; 41036 } 41037 render() { 41038 if (!this.props?.id) return A$1; 41039 const { prices } = this.props; 41040 const displayMoreInfo = !!this.props.edito?.body; 41041 const hasMultiplePrices = prices && prices.length > 1; 41042 const isFull = this.props.infos_status?.additionnals?.some((additional) => additional.key === "full"); 41043 return b$1` 41044 <div class="@container group max-w-[80rem] w-full"> 41045 <div 41046 class="relative min-h-[15rem] bg-neutral-0 grid grid-cols-1 @2xl:grid-cols-[minmax(0,_12rem),_minmax(0,_1fr)] border border-neutral-100 hover:border-neutral-200 transition-border rounded-lg gap-5 p-5 " 41047 > 41048 <div class="hidden @2xl:block"> 41049 <sonic-product-illustration rounded="md"></sonic-product-illustration> 41050 </div> 41051 <div> 41052 <div class="flex items-center gap-2"> 41053 <sonic-product-title class="text-xl @xl:text-2xl font-bold mb-1"></sonic-product-title> 41054 ${this.appType == "counter" ? b$1`<div class="ml-auto pl-1 flex items-center"> 41055 <sonic-product-publication 41056 subDataProvider="infos_status" 41057 class="text-lg" 41058 ></sonic-product-publication> 41059 ${this.renderMenu()} 41060 </div>` : A$1} 41061 </div> 41062 ${this.props?.validity_text ? b$1`<div class="font-bold mb-3 -ml-1"> 41063 <sonic-icon name="calendar-lines" library="custom"></sonic-icon> ${o$6( 41064 this.props?.validity_text 41065 )} 41066 </div>` : A$1} 41067 <sonic-event-additional-status size="sm"></sonic-event-additional-status> 41068 <sonic-event-scheduled-status size="sm"></sonic-event-scheduled-status> 41069 41070 <div class="text-sm mb-6 mt-2"> 41071 ${this.props.edito?.summary ? b$1`<div class="prose prose-sm prose-tight block text-pretty"> 41072 ${o$6(this.props.edito?.summary)} 41073 </div>` : A$1} 41074 ${displayMoreInfo ? b$1`<sonic-button class="mt-1" size="inherit" @click=${() => this.showMoreInfo()} variant="link"> 41075 <sonic-icon name="circle-info" library="custom" slot="prefix"></sonic-icon> 41076 ${t("LIB_more_info")} 41077 </sonic-button>` : A$1} 41078 </div> 41079 41080 <!-- Price --> 41081 ${this._priceAmount ? b$1`<div class="text-lg @xl:text-xl mb-3 font-bold">
41081${formatAmount(this._priceAmount)}</div>` : A$1} 41082 ${this._needProof ? b$1`<sonic-alert 41083 ${F({ 41084 in: v, 41085 out: f, 41086 stabilizeOut: true, 41087 keyframeOptions: { 41088 duration: 250, 41089 easing: "linear" 41090 } 41091 })} 41092 status="warning" 41093 class="mb-3" 41094 size="sm" 41095 label="${t("LIB_need_proof")}" 41096 ></sonic-alert>` : A$1} 41097 ${prices && prices.length > 0 && !isFull ? b$1`<div 41098 formDataProvider=${this.formDataProvider} 41099 class="flex flex-col gap-3 @lg:flex-row @lg:items-end @lg:gap-2 w-full grow" 41100 > 41101 <sonic-select 41102 label="${t("price")}" 41103 name="price.id" 41104 class="${prices.length == 1 ? "hidden" : "min-w-[7.5rem] grow"} " 41105 .options=${this.pricesOptions} 41106 ></sonic-select> 41107 41108 <sonic-select 41109 name="quantity" 41110 label="${t("quantity")}" 41111 class="${this._selectedPriceId === 0 ? "opacity-0 pointer-events-none" : ""} inline-block min-w-[5rem] transition-opacity duration-300" 41112 value="1" 41113 .options=${this.quantityOptions()} 41114 ?disabled=${this._selectedPriceId === 0} 41115 ></sonic-select> 41116 41117 <sonic-button 41118 ?loading=${this.loading} 41119 data-aria-label=${t("LIB_add_to_cart")} 41120 @click=${this.addToCart} 41121 minWidth="10rem" 41122 type="primary" 41123 class="min-w-[10rem] transition-opacity duration-300 delay-200 ${this._selectedPriceId === 0 ? "opacity-0 pointer-events-none" : ""}" 41124 ?disabled=${this._selectedPriceId === 0 && hasMultiplePrices} 41125 > 41126 <sonic-icon name="basket-shopping" library="custom"></sonic-icon> 41127 <span class="font-bold">${t("LIB_add")}</span> 41128 </sonic-button> 41129 </div> ` : A$1} 41130 ${this.loginButton()} 41131 </div> 41132 </div> 41133 </div> 41134 `; 41135 } 41136 showMoreInfo() { 41137 const body = this.props?.edito?.body; 41138 const title = this.props?.edito?.title; 41139 const subtitle = this.props?.edito?.sub_title; 41140 if (this._modal) { 41141 this._modal.hide(); 41142 } 41143 if (!body) return; 41144 this._modal = Modal.create({ 41145 title: b$1`${title}`, 41146 subtitle: b$1`${subtitle}`, 41147 content: b$1`<div class="prose prose-sm prose-tight block">${o$6(this.props?.edito?.body)}</div>`, 41148 maxWidth: "45rem", 41149 removeOnHide: true 41150 }); 41151 } 41152 loginButton() { 41153 const isRestrictedToPro = this.props?.infos_status?.additionnals?.some( 41154 (additional) => additional.key === "pro_need_login" 41155 ); 41156 if (!isRestrictedToPro) return A$1; 41157 return b$1`<sonic-app-link to="account" variant="default" type="primary"> 41158 <sonic-icon library="custom" name="user-tie"></sonic-icon> 41159 ${t("se_connecter")} 41160 </sonic-app-link>`; 41161 } 41162 renderMenu() { 41163 const actions = [ 41164 ProductActionsEnum.EDIT, 41165 ProductActionsEnum.SALES, 41166 ProductActionsEnum.DIVIDER, 41167 ProductActionsEnum.PIN 41168 ]; 41169 return b$1` <sonic-product-actions size="sm" .actions=${actions}></sonic-product-actions>`; 41170 } 41171 }; 41172 SubscriptionType.styles = [ 41173 tailwind, 41174 i$9` 41175 :host { 41176 display: flex; 41177 width: 100%; 41178 min-height: 100%; 41179 } 41180 ` 41181 ]; 41182 __decorateClass$29([ 41183 n$5({ type: Object }) 41184 ], SubscriptionType.prototype, "infos_status", 2); 41185 __decorateClass$29([ 41186 r$5() 41187 ], SubscriptionType.prototype, "_modal", 2); 41188 __decorateClass$29([ 41189 r$5() 41190 ], SubscriptionType.prototype, "_priceAmount", 2); 41191 __decorateClass$29([ 41192 r$5() 41193 ], SubscriptionType.prototype, "_needProof", 2); 41194 __decorateClass$29([ 41195 c({ context: appType, subscribe: true }), 41196 r$5() 41197 ], SubscriptionType.prototype, "appType", 2); 41198 __decorateClass$29([ 41199 r$5() 41200 ], SubscriptionType.prototype, "_selectedPriceId", 2); 41201 __decorateClass$29([ 41202 r$5() 41203 ], SubscriptionType.prototype, "pricesOptions", 2); 41204 __decorateClass$29([ 41205 r$5() 41206 ], SubscriptionType.prototype, "loading", 2); 41207 SubscriptionType = __decorateClass$29([ 41208 t$3("sonic-subscription-type") 41209 ], SubscriptionType); 41210 const autocompleteValue = (name, appType2) => { 41211 const isChromeBrowser = navigator.userAgent.includes("Chrome"); 41212 if (appType2 === "counter") { 41213 return isChromeBrowser ? "off-chrome" : "off"; 41214 } 41215 return name; 41216 }; 41217 const generateFakeEmail = (firstName, lastName) => { 41218 const sanitizeEmailPart = (value) => value?.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/\s+/g, "").replace(/[^a-z0-9]/g, "").slice(0, 30
41218); 41219 const prenom = sanitizeEmailPart(firstName); 41220 const nom = sanitizeEmailPart(lastName); 41221 const renderName = prenom || nom ? `${prenom}-${nom}` : "unknown"; 41222 return `${renderName}@${Date.now()}.pasdemail`; 41223 }; 41224 const normalizeCountry = (country) => { 41225 return country?.toUpperCase() || "FR"; 41226 }; 41227 function requiredMark(isRequired, slot = "label") { 41228 const shouldRender = isRequired || false; 41229 return shouldRender ? b$1`<span class="opacity-50 pl-1" slot=${o$4(slot)}>*</span>` : A$1; 41230 } 41231 const cleanFormData = (objectToClean, formConfiguration) => { 41232 if (!formConfiguration) return objectToClean; 41233 const keysToPreserve = [ 41234 ...Object.keys(formConfiguration).filter((key) => formConfiguration[key]?.enabled), 41235 "firstName", 41236 "lastName", 41237 "optins" 41238 ]; 41239 return Object.fromEntries(Object.entries(objectToClean).filter(([key]) => keysToPreserve.includes(key))); 41240 }; 41241 var __defProp$26 = Object.defineProperty; 41242 var __getOwnPropDesc$28 = Object.getOwnPropertyDescriptor; 41243 var __decorateClass$28 = (decorators, target, key, kind) => { 41244 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$28(target, key) : target; 41245 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 41246 if (decorator = decorators[i2]) 41247 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 41248 if (kind && result) __defProp$26(target, key, result); 41249 return result; 41250 }; 41251 const API_URLS = { 41252 zipcode: "https://data.geopf.fr/geocodage/completion?type=StreetAddress&maximumResponses=15", 41253 city: "https://data.geopf.fr/geocodage/completion?poiType=commune&type=PositionOfInterest&maximumResponses=15", 41254 address: "https://data.geopf.fr/geocodage/completion?poiType=housenumber&type=StreetAddress&maximumResponses=15" 41255 }; 41256 let instanceCounter$8 = 0; 41257 const tagName$1n = "sonic-geo-autocomplete"; 41258 let GeoAutocomplete = class extends Subscriber$1(i$6) { 41259 constructor() { 41260 super(...arguments); 41261 this._resizeController = new h$1(this, {}); 41262 this.required = false; 41263 this.type = "zipcode"; 41264 this.noSuggestion = false; 41265 this._isPopContentVisible = false; 41266 this.formDataProvider = ""; 41267 this.dataProviderExpression = ""; 41268 this.searchDataProvider = "searchGeoDP" + instanceCounter$8++; 41269 this.handleCurrentValueChange = (value) => { 41270 if (this.noSuggestion) { 41271 this._isPopContentVisible = false; 41272 dp(this.searchDataProvider).text.set(""); 41273 return; 41274 } 41275 if (value?.length && value.length > 2) { 41276 dp(this.searchDataProvider).text.set(value); 41277 this._isPopContentVisible = true; 41278 } else { 41279 dp(this.searchDataProvider).text.set(""); 41280 this._isPopContentVisible = false; 41281 } 41282 }; 41283 this.renderResults = (result) => { 41284 if (this.type === "zipcode" && result.kind !== "municipality") { 41285 return A$1; 41286 } 41287 if (this.type === "city" && result.kind !== "administratif") { 41288 return A$1; 41289 } 41290 return b$1`<sonic-menu-item @click=${() => this.handleSelect(result)} size="sm"> 41291 ${r(this.type, [ 41292 ["city", () => b$1`${result.names[0]} <span class="text-neutral-500 text-[.9em]">â ${result.zipcode}</span>`], 41293 ["zipcode", () => b$1`${result.zipcode} <span class="text-neutral-500 text-[.9em]">â ${result.city}</span>`], 41294 ["address", () => b$1`${result.fulltext}`] 41295 ])}</sonic-menu-item 41296 >`; 41297 }; 41298 } 41299 connectedCallback() { 41300 this.formDataProvider = HTML.getAncestorAttributeValue(this, "formdataprovider") || ""; 41301 this.dataProviderExpression = API_URLS[this.type]; 41302 if (!this.name) { 41303 this.name = this.defaultInputName(); 41304 } 41305 dp(this.formDataProvider)[this.name].onAssign(this.handleCurrentValueChange); 41306 super.connectedCallback(); 41307 } 41308 disconnectedCallback() { 41309 if (this.name) { 41310 dp(this.formDataProvider)[this.name].offAssign(this.handleCurrentValueChange); 41311 } 41312 super.disconnectedCallback(); 41313 } 41314 defaultInputName() {
41315 if (this.type === "zipcode") { 41316 return "postalCode"; 41317 } else if (this.type === "city") { 41318 return "city"; 41319 } else if (this.type === "address") { 41320 return "address"; 41321 } 41322 return ""; 41323 } 41324 handleSelect(result) { 41325 this.fillCurrentValue(result); 41326 const event = new CustomEvent("select", { detail: result }); 41327 this.dispatchEvent(event); 41328 } 41329 fillCurrentValue(result) { 41330 if (!result || !this.name) return; 41331 let newValue = ""; 41332 if (this.type === "zipcode") { 41333 newValue = result.zipcode; 41334 } else if (this.type === "city") { 41335 newValue = result.city || result.names?.[0]; 41336 } else if (this.type === "address") { 41337 newValue = result.fulltext ? result.fulltext.substring(0, result?.fulltext?.lastIndexOf(",")) : ""; 41338 } 41339 dp(this.formDataProvider)[this.name].set(newValue); 41340 } 41341 render() { 41342 const menuStyles = { 41343 display: this._isPopContentVisible ? "block" : "none", 41344 width: this.offsetWidth ? `${this.offsetWidth}px` : "auto" 41345 }; 41346 return b$1` 41347 <sonic-pop data-keyboard-nav="nav-autocomplete" class="w-full relative"> 41348 <sonic-input 41349 label="${this.label}" 41350 name="${this.name}" 41351 .size="${this.size}" 41352 ?required=${this.required} 41353 autocomplete="off-chrome" 41354 type="search" 41355 > 41356 ${requiredMark(this.required)} 41357 </sonic-input> 41358 <sonic-menu 41359 slot="content" 41360 style=${o$3(menuStyles)} 41361 class="max-h-[10rem] overflow-y-auto custom-scroll max-w-full" 41362 > 41363 <sonic-queue 41364 lazyload 41365 key="results" 41366 headersDataProvider="none" 41367 credentials="omit" 41368 dataProviderExpression="${this.dataProviderExpression}" 41369 dataFilterProvider="${this.searchDataProvider}" 41370 .items=${this.renderResults} 41371 .noItems=${() => b$1`<sonic-no-result size="sm"></sonic-no-result>`} 41372 > 41373 </sonic-queue> 41374 </sonic-menu> 41375 </sonic-pop> 41376 `; 41377 } 41378 // @todo / voir si c'est pas plus simple ainsi. 41379 // permettrait le filter en amont. 41380 // async fetchSuggestions(query: string): Promise<GeoResult[]> { 41381 // if (query.length < 3) { 41382 // return []; 41383 // } 41384 // const url = `${API_URLS[this.type]}&text=${encodeURIComponent(query)}`; 41385 // const res = await fetch(url); 41386 // const data = await res.json(); 41387 // return data.filter((item: GeoResult) => { 41388 // if (this.type === "zipcode" && item.kind !== "municipality") { 41389 // return false; 41390 // } 41391 // if (this.type === "city" && item.kind !== "administratif") { 41392 // return false; 41393 // } 41394 // return true; 41395 // }); 41396 // } 41397 }; 41398 GeoAutocomplete.styles = [ 41399 tailwind, 41400 customScroll, 41401 i$9` 41402 :host { 41403 width: 100%; 41404 } 41405 ` 41406 ]; 41407 __decorateClass$28([ 41408 n$5({ type: String }) 41409 ], GeoAutocomplete.prototype, "name", 2); 41410 __decorateClass$28([ 41411 n$5({ type: String }) 41412 ], GeoAutocomplete.prototype, "label", 2); 41413 __decorateClass$28([ 41414 n$5({ type: String }) 41415 ], GeoAutocomplete.prototype, "size", 2); 41416 __decorateClass$28([ 41417 n$5({ type: String }) 41418 ], GeoAutocomplete.prototype, "autoComplete", 2); 41419 __decorateClass$28([ 41420 n$5({ type: Boolean }) 41421 ], GeoAutocomplete.prototype, "required", 2); 41422 __decorateClass$28([ 41423 n$5({ type: String }) 41424 ], GeoAutocomplete.prototype, "type", 2); 41425 __decorateClass$28([ 41426 n$5({ type: Boolean }) 41427 ], GeoAutocomplete.prototype, "noSuggestion", 2); 41428 __decorateClass$28([ 41429 r$5() 41430 ], GeoAutocomplete.prototype, "_isPopContentVisible", 2); 41431 GeoAutocomplete = __decorateClass$28([ 41432 t$3(tagName$1n) 41433 ], GeoAutocomplete); 41434 var __defProp$25 = Object.defineProperty; 41435 var __getOwnPropDesc$27 = Object.getOwnPropertyDescriptor; 41436 var __decorateClass$27 = (decorators, target, key, kind) => { 41437 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$27(target, key) : target; 41438 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 41439 if (decorator = decorators[i2]) 41440 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 41441 if (kind && result) __defProp$25(target, key, result); 41442 return result; 41443 }; 41444 let AddressSuggestion = class extends Subscriber$1(i$6) { 41445 constructor() { 41446 super(...arguments); 41447 this.addresses = []; 41448 this.data = null; 41449 this.allowNewAddress = false;
41450 this.size = "sm"; 41451 this.defaultCountry = "FR"; 41452 this.formDataProvider = ""; 41453 this.handleAddressChange = () => { 41454 const formData = dp(this.formDataProvider).get(); 41455 const address = { 41456 address: formData?.address, 41457 address2: formData?.address2, 41458 postalCode: formData?.postalCode, 41459 city: formData?.city, 41460 country: formData?.country 41461 }; 41462 this.selectedId = this.generateAddressId(address); 41463 }; 41464 } 41465 connectedCallback() { 41466 this.dataProvider = this.getAncestorAttributeValue("cartProvider") || "cart/current"; 41467 this.formDataProvider = HTML.getAncestorAttributeValue(this, "formdataprovider") || ""; 41468 dp(this.formDataProvider)?.address.onAssign(this.handleAddressChange); 41469 dp(this.formDataProvider)?.address2.onAssign(this.handleAddressChange); 41470 dp(this.formDataProvider)?.postalCode.onAssign(this.handleAddressChange); 41471 dp(this.formDataProvider)?.city.onAssign(this.handleAddressChange); 41472 dp(this.formDataProvider)?.country.onAssign(this.handleAddressChange); 41473 super.connectedCallback(); 41474 } 41475 disconnectedCallback() { 41476 dp(this.formDataProvider)?.address.offAssign(this.handleAddressChange); 41477 dp(this.formDataProvider)?.address2.offAssign(this.handleAddressChange); 41478 dp(this.formDataProvider)?.postalCode.offAssign(this.handleAddressChange); 41479 dp(this.formDataProvider)?.city.offAssign(this.handleAddressChange); 41480 dp(this.formDataProvider)?.country.offAssign(this.handleAddressChange); 41481 super.disconnectedCallback(); 41482 } 41483 willUpdate(_changedProperties) { 41484 if (_changedProperties.has("data")) { 41485 this.addresses = this.getAddressSuggestion(this.data?.items || [], this.data?.linked_subscriptions || []); 41486 } 41487 if (_changedProperties.has("addresses")) { 41488 this.defaultCountry = this.addresses[0]?.country?.toUpperCase() || "FR"; 41489 } 41490 super.willUpdate(_changedProperties); 41491 } 41492 getAddressSuggestion(items, linked_subscriptions) { 41493 const subscriptions = getCartSubscriptions({ items, linked_subscriptions }); 41494 const addresses = []; 41495 subscriptions.forEach((subscription) => { 41496 if (subscription.owner?.address) { 41497 const owner = subscription.owner; 41498 const address = owner.address || ""; 41499 const address2 = owner.address2 || ""; 41500 const postalCode = owner.postalCode || ""; 41501 const city = owner.city || ""; 41502 const country = owner.country || "FR"; 41503 const id = this.generateAddressId({ address, address2, postalCode, city, country }); 41504 if (addresses.find((a2) => a2.id === id)) return; 41505 addresses.push({ 41506 id, 41507 address, 41508 address2, 41509 postalCode, 41510 city, 41511 country 41512 }); 41513 } 41514 }); 41515 return addresses; 41516 } 41517 generateAddressId(address) { 41518 let id = `${address.address}-${address.address2}-${address.postalCode}-${address.city}-${address.country}`; 41519 id = id.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(); 41520 return id; 41521 } 41522 selectAddress(address) { 41523 this.selectedId = address.id; 41524 const event = new CustomEvent("select", { detail: address }); 41525 this.dispatchEvent(event); 41526 } 41527 publicCountry(region) {
41528 const regionUpper = region?.toUpperCase(); 41529 if (!regionUpper) return ""; 41530 const locale = new Intl.DisplayNames("fr-FR", { type: "region", style: "short" }); 41531 const nomTraduit = locale.of(regionUpper); 41532 return nomTraduit; 41533 } 41534 render() { 41535 if (!this.addresses || this.addresses.length === 0) return A$1; 41536 return b$1`<div class="grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-2"> 41537 ${c$1( 41538 this.addresses, 41539 (address) => address.id, 41540 (address) => b$1`<sonic-button 41541 ?active=${this.selectedId === address.id} 41542 variant="outline" 41543 size=${this.size} 41544 @click=${() => this.selectAddress(address)} 41545 > 41546 <div class="text-left min-h-12 py-3 min-w-0"> 41547 <div class="truncate leading-tight">${address.address}</div> 41548 <div class="truncate leading-tight">${address.address2}</div> 41549 <div class="mt-2 truncate leading-tight"><b class="mr-1">${address.postalCode}</b> ${address.city}</div> 41550 <div class="truncate leading-tight"> 41551 ${address.country ? `â ${this.publicCountry(address.country)}` : ""} 41552 </div> 41553 </div> 41554 </sonic-button>` 41555 )} 41556 ${this.allowNewAddress ? b$1` 41557 <sonic-button 41558 variant="outline" 41559 size=${this.size} 41560 ?active=${this.selectedId === "new"} 41561 @click=${() => this.selectAddress({ 41562 id: "new", 41563 address: "", 41564 address2: "", 41565 postalCode: "", 41566 city: "", 41567 country: this.defaultCountry 41568 })} 41569 > 41570 <div class="font-bold"> 41571 <sonic-icon name="sparkles" library="custom" size="sm"></sonic-icon> 41572 Nouvelle adresse 41573 </div> 41574 </sonic-button> 41575 ` : A$1} 41576 </div>`; 41577 } 41578 }; 41579 AddressSuggestion.styles = [ 41580 tailwind, 41581 i$9` 41582 :host { 41583 display: block; 41584 } 41585 ` 41586 ]; 41587 __decorateClass$27([ 41588 r$5() 41589 ], AddressSuggestion.prototype, "addresses", 2); 41590 __decorateClass$27([ 41591 r$5() 41592 ], AddressSuggestion.prototype, "data", 2); 41593 __decorateClass$27([ 41594 n$5({ type: String }) 41595 ], AddressSuggestion.prototype, "selectedId", 2); 41596 __decorateClass$27([ 41597 n$5({ type: Boolean }) 41598 ], AddressSuggestion.prototype, "allowNewAddress", 2); 41599 __decorateClass$27([ 41600 n$5({ type: String }) 41601 ], AddressSuggestion.prototype, "size", 2); 41602 __decorateClass$27([ 41603 n$5() 41604 ], AddressSuggestion.prototype, "defaultCountry", 2); 41605 AddressSuggestion = __decorateClass$27([ 41606 t$3("sonic-address-suggestion") 41607 ], AddressSuggestion); 41608 var __decorate$7 = function(decorators, target, key, desc) { 41609 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 41610 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 41611 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 41612 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 41613 }; 41614 const tagName$1m = "sonic-form-layout"; 41615 let FormLayout = class FormLayout extends Subscriber$1(i$6) { 41616 constructor() { 41617 super(...arguments); 41618 this._resizeController = new h$1(this, {}); 41619 this.oneFormElement = false; 41620 } 41621 onSlotChange() { 41622 let elements = this.slottedElements; 41623 const formElementColumns = ["sonic-input", "sonic-select", "sonic-input-autocomplete", ".form-item-container"]; 41624 elements = elements.filter((elt) => formElementColumns.includes(elt.nodeName.toLowerCase())); 41625 this.oneFormElement = elements.length == 1; 41626 } 41627 render() { 41628 const classes2 = { 41629 "cq--md": this.offsetWidth > 440, 41630 "one-form-element": this.oneFormElement 41631 }; 41632 return b$1`<div class=${e(classes2)}> 41633 <slot @slotchange=${this.onSlotChange}></slot> 41634 </div>`; 41635 } 41636 }; 41637 FormLayout.styles = [ 41638 i$9` 41639 :host { 41640 display: block; 41641 } 41642 41643 div { 41644 display: grid; 41645 grid-gap: 1.5rem; 41646 align-items: flex-start; 41647 } 41648 41649 .cq--md { 41650 grid-gap: 1.75rem; 41651 grid-template-columns: repeat(2, minmax(0, 1fr)); 41652 } 41653 .one-form-element { 41654 grid-template-columns: 1fr; 41655 } 41656 /*::slotted(sonic-radio), 41657 ::slotted(sonic-checkbox), 41658 ::slotted(sonic-form-actions),
41659 ::slotted(sonic-divider), 41660 ::slotted(sonic-textarea) { 41661 grid-column: 1 / -1; 41662 }*/ 41663 ::slotted(sonic-submit) { 41664 display: contents; 41665 } 41666 ::slotted(:not(sonic-input):not(sonic-select):not(sonic-input-autocomplete):not(.form-item-container)) { 41667 grid-column: 1 / -1; 41668 } 41669 41670 ::slotted(sonic-divider) { 41671 --sc-divider-my: 0; 41672 } 41673 ` 41674 ]; 41675 __decorate$7([ 41676 o$8({ flatten: true }) 41677 ], FormLayout.prototype, "slottedElements", void 0); 41678 __decorate$7([ 41679 n$5({ type: Boolean }) 41680 ], FormLayout.prototype, "oneFormElement", void 0); 41681 FormLayout = __decorate$7([ 41682 t$3(tagName$1m) 41683 ], FormLayout); 41684 var __defProp$24 = Object.defineProperty; 41685 var __getOwnPropDesc$26 = Object.getOwnPropertyDescriptor; 41686 var __decorateClass$26 = (decorators, target, key, kind) => { 41687 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$26(target, key) : target; 41688 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 41689 if (decorator = decorators[i2]) 41690 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 41691 if (kind && result) __defProp$24(target, key, result); 41692 return result; 41693 }; 41694 let SonicCountry = class extends Subscriber$1(i$6) { 41695 constructor() { 41696 super(...arguments); 41697 this.countries = []; 41698 this.required = false; 41699 this.formDataProvider = ""; 41700 this.handleSetCountry = (value) => { 41701 const country = this.countries.find((country2) => country2.id.toString() == value); 41702 if (!country) return; 41703 const event = new CustomEvent("selected", { 41704 detail: { 41705 country 41706 } 41707 }); 41708 this.dispatchEvent(event); 41709 }; 41710 } 41711 connectedCallback() { 41712 const lang = document.documentElement.lang.split("-")[0]; 41713 const safeLang = ["fr", "en", "nl", "de"].includes(lang) ? lang : "fr"; 41714 this.getCountries(safeLang); 41715 const FormDataProvider = this.getAncestorAttributeValue("formDataProvider"); 41716 this.formDataProvider = FormDataProvider; 41717 dp(this.formDataProvider).country.onAssign(this.handleSetCountry); 41718 super.connectedCallback(); 41719 } 41720 disconnectedCallback() { 41721 dp(this.formDataProvider).country.offAssign(this.handleSetCountry); 41722 super.disconnectedCallback(); 41723 } 41724 // retourne la liste des pays depuis le fichier json local dans la langue spécifiée 41725 // et la stocke dans la propriété countries 41726 getCountries(lang = "fr") { 41727 fetch("/sites/all/modules/la-billetterie/lib/Ssks/LaBilletterie/Core/Util/data/countries_" + lang + ".json").then((response) => response.json()).then((data) => { 41728 this.addLaReunion(data); 41729 this.countries = data; 41730 }).then(() => { 41731 this.setDefaultCountry(); 41732 }).catch((error) => { 41733 console.error("Error:", error); 41734 }); 41735 } 41736 addLaReunion(countries) { 41737 countries.push({ 41738 id: 999, 41739 alpha2: "RE", 41740 alpha3: "REU", 41741 name: "La Réunion", 41742 subregion: "La Réunion" 41743 }); 41744 } 41745 setDefaultCountry() { 41746 const initialCountry = dp(this.formDataProvider).country.get(); 41747 if (!initialCountry) { 41748 dp(this.formDataProvider).country.set("FR"); 41749 } 41750 } 41751 countriesToOptions(countries) { 41752 return countries.map((country) => ({ 41753 value: country.alpha2.toUpperCase(), 41754 wording: country.name 41755 })); 41756 } 41757 render() { 41758 if (!this.countries || this.countries.length === 0) return A$1; 41759 return b$1` 41760 <sonic-select label="${t("pays")}" name="country" .options=${this.countriesToOptions(this.countries)}> 41761 ${requiredMark(this.required)} 41762 </sonic-select> 41763 `; 41764 } 41765 }; 41766 SonicCountry.styles = [tailwind]; 41767 __decorateClass$26([ 41768 r$5() 41769 ], SonicCountry.prototype, "countries", 2); 41770 __decorateClass$26([ 41771 n$5({ type: Boolean }) 41772 ], SonicCountry.prototype, "required", 2); 41773 SonicCountry = __decorateClass$26([ 41774 t$3("sonic-country") 41775 ], SonicCountry); 41776 var __defProp$23 = Object.defineProperty; 41777 var __getOwnPropDesc$25 = Object.getOwnPropertyDescriptor; 41778 var __decorateClass$25 = (decorators, target, key, kind) => { 41779 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$25(target, key) : target; 41780 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 41781 if (decorator = decorators[i2]) 41782 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 41783 if (kind && result) __defProp$23(target, key, result); 41784 return result; 41785 }; 41786 let AddressFieldset = class extends i$6 { 41787 constructor() { 41788 super(...arguments); 41789 this.formDataProvider = ""; 41790 this.noSuggestion = false;
41791 this.handleCountryChange = () => { 41792 const formData = dp(this.formDataProvider).get(); 41793 this.noSuggestion = formData?.country && formData?.country !== "FR"; 41794 }; 41795 this.setCity = (e2) => { 41796 if (this.formConfiguration?.city?.enabled === false) return; 41797 const result = e2.detail; 41798 const city = result.city || result.names[0]; 41799 dp(this.formDataProvider).city.set(city); 41800 }; 41801 this.setPostalCode = (e2) => { 41802 if (this.formConfiguration?.postalCode?.enabled === false) return; 41803 const result = e2.detail; 41804 dp(this.formDataProvider).postalCode.set(result.zipcode); 41805 }; 41806 this.setCityAndPostalCode = (e2) => { 41807 this.setCity(e2); 41808 this.setPostalCode(e2); 41809 }; 41810 this.handleAddressSelect = (e2) => { 41811 const address = e2.detail; 41812 dp(this.formDataProvider).address.set(address.address || ""); 41813 dp(this.formDataProvider).address2.set(address.address2 || ""); 41814 dp(this.formDataProvider).postalCode.set(address.postalCode || ""); 41815 dp(this.formDataProvider).city.set(address.city || ""); 41816 dp(this.formDataProvider).country.set(address.country || "FR"); 41817 }; 41818 } 41819 connectedCallback() { 41820 this.formDataProvider = HTML.getAncestorAttributeValue(this, "formdataprovider") || ""; 41821 dp(this.formDataProvider)?.country.onAssign(this.handleCountryChange); 41822 super.connectedCallback(); 41823 } 41824 disconnectedCallback() { 41825 dp(this.formDataProvider)?.country.offAssign(this.handleCountryChange); 41826 super.disconnectedCallback(); 41827 } 41828 isRequired(field) { 41829 if (this.appType === "counter") { 41830 return false; 41831 } else if (this.appType === "customer") { 41832 return field?.required || false; 41833 } 41834 return false; 41835 } 41836 render() { 41837 const { country, address, address2, postalCode, city } = this.formConfiguration || {}; 41838 if (!address?.enabled && !address2?.enabled && !postalCode?.enabled && !city?.enabled && !country?.enabled) 41839 return A$1; 41840 return b$1` 41841 <sonic-fieldset iconLibrary="custom" iconName="location-dot" label="${t("coordonnes")}"> 41842 <sonic-address-suggestion 41843 allowNewAddress 41844 class="mb-6" 41845 @select=${this.handleAddressSelect} 41846 ></sonic-address-suggestion> 41847 41848 <sonic-form-layout> 41849 ${country?.enabled ? b$1`<sonic-country ?required=${this.isRequired(country)} size="sm"></sonic-country> 41850 <sonic-divider></sonic-divider>` : A$1} 41851 ${address?.enabled ? b$1` 41852 <div class="form-item-container"> 41853 <sonic-geo-autocomplete 41854 size="sm" 41855 autocomplete=${autocompleteValue("address-line1")} 41856 ?noSuggestion="${this.noSuggestion}" 41857 type="address" 41858 name="address" 41859 label=${t("adresse")} 41860 ?required=${this.isRequired(address)} 41861 @select=${(e2) => this.setCityAndPostalCode(e2)} 41862 ></sonic-geo-autocomplete> 41863 </div> 41864 ` : A$1} 41865 ${address2?.enabled ? b$1` 41866 <div class="form-item-container"> 41867 <sonic-input 41868 size="sm" 41869 name="address2" 41870 label=${t("adresse_2")} 41871 autocomplete=${autocompleteValue("address-line2", this.appType)} 41872 ></sonic-input> 41873 </div> 41874 ` : A$1} 41875 ${postalCode?.enabled ? b$1` 41876 <div class="form-item-container col-start-1"> 41877 <sonic-geo-autocomplete 41878 size="sm" 41879 autocomplete=${autocompleteValue("postal-code", this.appType)} 41880 ?noSuggestion="$this.noSuggestion}" 41881 type="zipcode" 41882 name="postalCode" 41883 label="${t("code_postal")}" 41884 ?required=${this.isRequired(postalCode)} 41885 @select=${(e2) => this.setCity(e2)} 41886 ></sonic-geo-autocomplete> 41887 </div> 41888 ` : A$1} 41889 ${city?.enabled ? b$1` 41890 <div class="form-item-container"> 41891 <sonic-geo-autocomplete 41892 size="sm" 41893 autocomplete=${autocompleteValue("city", this.appType)} 41894 ?noSuggestion="$this.noSuggestion}" 41895 type="city" 41896 name="city" 41897 label="${t("ville")}" 41898 ?required=${this.isRequired(city)} 41899 @select=${(e2) => this.setPostalCode(e2)} 41900 ></sonic-geo-autocomplete> 41901 </div> 41902 ` : A$1} 41903 </sonic-form-layout> 41904 </sonic-fieldset> 41905 `; 41906 } 41907 }; 41908 AddressFieldset.styles = [tailwind]; 41909 __decorateClass$25([ 41910 n$5({ type: Object }) 41911 ], AddressFieldset.prototype, "formConfiguration", 2); 41912 __decorateClass$25([ 41913 c({ context: appType, subscribe: true }), 41914 r$5() 41915 ], AddressFieldset.prototype, "appType", 2); 41916 __decorateClass$25([ 41917 n$5({ type: String }) 41918 ], AddressFieldset.prototype, "formDataProvider", 2); 41919 __decorateClass$25([ 41920 r$5() 41921 ], AddressFieldset.prototype, "noSuggestion", 2); 41922 AddressFieldset = __decorateClass$25([ 41923 t$3("sonic-address-fieldset") 41924 ], AddressFieldset); 41925 var __defProp$22 = Object.defineProperty; 41926 var __getOwnPropDesc$24 = Object.getOwnPropertyDescriptor; 41927 var __decorateClass$24 = (decorators, target, key, kind) => { 41928 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$24(target, key) : target; 41929 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 41930 if (decorator = decorators[i2]) 41931 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 41932 if (kind && result) __defProp$22(target, key, result); 41933 return result; 41934 }; 41935 let SonicDragAndDrop = class extends FormElement(Subscriber(i$6)) { 41936 constructor() { 41937 super(...arguments); 41938 this.multiple = false;
41939 this.withoutText = false; 41940 this.displayFileName = false; 41941 this.previewIndex = 0; 41942 this.size = "md"; 41943 this.dropState = "default"; 41944 this.files = []; 41945 this.filesWithPreview = []; 41946 this.handleDrop = async (e2) => { 41947 if (this.dropState === "error") return this.dropState = "default"; 41948 this.preventDefaults(e2); 41949 this.dropState = "default"; 41950 const droppedFiles = Array.from(e2.dataTransfer?.files || []); 41951 const validFiles = droppedFiles.filter(this.isValidFileType); 41952 if (validFiles.length > 0) { 41953 this.files = validFiles; 41954 } 41955 return; 41956 }; 41957 this.previewFiles = async (files) => { 41958 if (!files || files.length === 0) return Promise.resolve([]); 41959 const readFiles = files.filter(this.isValidFileType).map((file) => { 41960 return new Promise((resolve, reject) => { 41961 const reader = new FileReader(); 41962 reader.onloadend = () => { 41963 const previewType = this.getPreviewType(file); 41964 if (reader.error) { 41965 reject(reader.error); 41966 return; 41967 } 41968 if (!reader.result) { 41969 resolve({ 41970 file 41971 }); 41972 return; 41973 } 41974 resolve({ 41975 file, 41976 result: reader.result, 41977 previewType 41978 }); 41979 }; 41980 reader.onerror = () => { 41981 reject(`Failed to read file: ${file.name}`); 41982 }; 41983 reader.readAsDataURL(file); 41984 }); 41985 }); 41986 const filesWithPreview = await Promise.all(readFiles); 41987 this.dispatchEvent( 41988 new CustomEvent("files-change", { 41989 detail: { 41990 files: this.filesWithPreview 41991 }, 41992 bubbles: true, 41993 composed: true 41994 }) 41995 ); 41996 return filesWithPreview; 41997 }; 41998 this.versionHash = ""; 41999 this.isValidFileType = (file) => { 42000 if (!this.accept) return true; 42001 return this.accept.includes(file.type); 42002 }; 42003 this.getPreviewType = (file) => { 42004 if (file.type.startsWith("image/")) return "image"; 42005 if (file.type.startsWith("application/pdf")) return "pdf"; 42006 return "file"; 42007 }; 42008 this.handleDragOver = (e2) => { 42009 e2.preventDefault(); 42010 e2.stopPropagation(); 42011 const isValidFileType = Array.from(e2.dataTransfer?.items || []).every((item) => { 42012 if (!this.accept) return true; 42013 return this.accept.includes(item.type); 42014 }); 42015 this.dropState = isValidFileType ? "success" : "error"; 42016 }; 42017 this.handleDragLeave = (e2) => { 42018 e2.preventDefault(); 42019 e2.stopPropagation(); 42020 this.dropState = "default"; 42021 }; 42022 } 42023 getLocalizedButtonText() { 42024 const language = navigator.language || navigator.languages[0]; 42025 const translations = { 42026 fr: "Choisir un fichier", 42027 en: "Choose a file", 42028 es: "Elegir un archivo", 42029 de: "Datei auswählen", 42030 it: "Scegli un file", 42031 pt: "Escolher um arquivo", 42032 nl: "Kies een bestand", 42033 pl: "Wybierz plik", 42034 ru: "ÐÑбеÑиÑе Ñайл", 42035 zh: "éæ©æä»¶", 42036 ja: "ãã¡ã¤ã«ã鏿", 42037 ko: "íì¼ ì í", 42038 ar: "اختر Ù ÙÙÙØ§", 42039 default: "Choose a file" 42040 }; 42041 const mainLanguage = language.split("-")[0]; 42042 return translations[mainLanguage] || translations["default"]; 42043 } 42044 preventDefaults(e2) { 42045 e2.preventDefault(); 42046 e2.stopPropagation(); 42047 } 42048 async willUpdate(_changedProperties) { 42049 if (_changedProperties.has("files")) { 42050 if (this.fileInput) { 42051 this.fileInput.files = this.createFileList(this.files); 42052 } 42053 this.filesWithPreview = await this.previewFiles(this.files); 42054 this.updateDataValue(); 42055 } 42056 super.willUpdate(_changedProperties); 42057 } 42058 setFormPublisherValue(_value) { 42059 const filesWithPreview = this.filesWithPreview || []; 42060 const hash = this.fileHash(filesWithPreview.map((file) => file.file)); 42061 if (hash === this.versionHash) { 42062 return; 42063 } 42064 this.versionHash = hash; 42065 const valueToSet = filesWithPreview.map((file) => { 42066 return { 42067 name: file.file.name, 42068 type: file.file.type, 42069 size: file.file.size, 42070 data: file.result || "" 42071 }; 42072 }); 42073 traverseDotNotation(this.getFormPublisher(), this.name).set(valueToSet); 42074 } 42075 /** 42076 * Note: this is not a secure hash, it is used to compare the files with the files in the form publisher 42077 * Create a hash of the files 42078 * @param files tu use to compute the hash 42079 * @returns hash of the files 42080 */ 42081 fileHash(files) { 42082 return files.map((file) => { 42083 return file.name + file.type + file.size; 42084 }).join("\n"); 42085 } 42086 /** 42087 * Create a file list from the files 42088 * Its used tu update the file input with a compatible file list 42089 * @param files to create the file list from 42090 * @returns file list 42091 */ 42092 createFileList(files) { 42093 const dataTransfer = new DataTransfer();
42094 files.forEach((file) => dataTransfer.items.add(file)); 42095 return dataTransfer.files; 42096 } 42097 /** 42098 * Converts files from the publisher to the component propertiesÅ 42099 * @param value to set the files from 42100 */ 42101 setFormValueFromPublisher(value) { 42102 const files = value || []; 42103 const hash = this.fileHash(files); 42104 const hash2 = this.fileHash(this.files); 42105 if (hash === hash2) { 42106 return; 42107 } 42108 const result = files.map((file) => { 42109 return this.base64ToFile(file.data || "", file.name || "", file.type || ""); 42110 }); 42111 this.value = files[0]?.name ?? ""; 42112 this.files = result; 42113 } 42114 /** 42115 * Converts a base64 string to a file 42116 * @param base64 to convert to a file 42117 * @param filename to set the file name 42118 * @param mimeType to set the file type 42119 * @returns file 42120 */ 42121 base64ToFile(base64, filename, mimeType) { 42122 const byteString = atob(base64.split(",")[1]); 42123 const ab = new ArrayBuffer(byteString.length); 42124 const ia = new Uint8Array(ab); 42125 for (let i2 = 0; i2 < byteString.length; i2++) { 42126 ia[i2] = byteString.charCodeAt(i2); 42127 } 42128 return new File([ab], filename, { type: mimeType }); 42129 } 42130 removeItem(index) { 42131 this.files = this.files.filter((_2, i2) => i2 !== index); 42132 } 42133 handleFileInput(event) { 42134 const input = event?.target; 42135 if (this.multiple) { 42136 const newFiles = input.files ? Array.from(input.files) : []; 42137 this.files = [...this.files || [], ...newFiles]; 42138 } else { 42139 const newFile = input.files?.[0]; 42140 if (newFile) { 42141 this.files = [newFile]; 42142 } 42143 } 42144 } 42145 handleClick() { 42146 const fileInput = this.fileInput; 42147 fileInput?.click(); 42148 } 42149 showModal(item) { 42150 if (!item.result) return; 42151 this._modal = Modal.create({ 42152 title: `${item.file.name}`, 42153 content: b$1`<img 42154 src="${o$4(item.result)}" 42155 style="max-width: 100%; 42156 object-fit: contain; 42157 display: block; 42158 " 42159 />`, 42160 removeOnHide: true 42161 }); 42162 } 42163 switchSize() { 42164 switch (this.size) { 42165 case "sm": 42166 return "size-[6rem]"; 42167 case "md": 42168 return "size-[10rem]"; 42169 case "lg": 42170 return "size-[15rem]"; 42171 case "custom": 42172 return `${this.customSize}`; 42173 default: 42174 return "size-[10rem]"; 42175 } 42176 } 42177 render() { 42178 return b$1` 42179 ${this.label ? b$1`<label for="file-input" class="form-label">${this.label}</label>` : A$1} 42180 42181 <input 42182 type="file" 42183 id="file-input" 42184 ?multiple=${this.multiple} 42185 hidden 42186 @change=${this.handleFileInput} 42187 accept=${o$4(this.accept?.join(","))} 42188 /> 42189 42190 <div class="flex gap-x-5 gap-y-2 flex-wrap"> 42191 <div 42192 id="drop-area" 42193 class=${`${this.switchSize()} ${!this.multiple && this.filesWithPreview.length > 0 ? "hidden" : ""} aspect-square border-dashed border-2 text-current rounded-md flex flex-col items-center justify-center text-center p-5 flex-shrink-0 hover:bg-neutral-100 cursor-pointer transition-all duration-200`} 42194 @click=${this.handleClick} 42195 @dragover=${this.handleDragOver} 42196 @dragleave=${this.handleDragLeave} 42197 @drop=${this.handleDrop} 42198 > 42199 <sonic-icon name="file-import" library="custom" size="3xl"></sonic-icon> 42200 42201 <div class="text-sm mt-2 leading-tight">${this.getLocalizedButtonText()}</div> 42202 </div> 42203 42204 ${this.filesWithPreview?.length > 0 ? o$1(this.filesWithPreview, (item, index) => { 42205 return b$1` 42206 <div 42207 class=${`relative ${this.switchSize()} aspect-square`} 42208 ${F({ 42209 keyframeOptions: { 42210 duration: 250, 42211 easing: "linear" 42212 }, 42213 in: [{ opacity: 0 }], 42214 stabilizeOut: true 42215 })} 42216 > 42217 ${item.previewType === "image" ? b$1` 42218 <sonic-button 42219 ${F({ 42220 keyframeOptions: { 42221 duration: 250, 42222 easing: `cubic-bezier(0.250, 0.250, 0.420, 1.225)` 42223 }, 42224 in: [{ transform: "scale(.9) translateY(5px)" }] 42225 })} 42226 @click=${() => this.showModal(item)} 42227 variant="unstyled" 42228 class="rounded-md shadow-lg size-full min-w-0 border-neutral-0 border hover:border-neutral-400 hover:shadow-xl transition overflow-hidden relative bg-neutral-0 " 42229 > 42230 <img 42231 class="aspect-square min-h-full rounded-sm object-cover absolute object-center max-h-full max-w-full -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 " 42232 src=${o$4(item.result)} 42233 alt="" 42234 /> 42235 </sonic-button> 42236 ` : A$1} 42237 ${item.previewType === "pdf" ? b$1` 42238 <embed 42239 src=${o$4(item.result)} 42240 type="application/pdf" 42241 class="rounded-md shadow-lg size-full min-w-0 border-neutral-0 border hover:border-neutral-400 hover:shadow-xl transition overflow-hidden relative bg-neutral-0" 42242 /> 42243 ` : A$1} 42244 ${item.previewType === "file" ? b$1` 42245 <div 42246 class="size-full flex flex-col items-center justify-center border bg-content text-base rounded-md p-4" 42247 > 42248 <sonic-icon library="custom" name="file" variant="default" class="text-4xl mb-2"></sonic-icon> 42249 <div class="text-sm text-neutral-600 text-center break-words max-w-full"> 42250 ${item.file.name} 42251 </div> 42252 </div> 42253 ` : A$1} 42254 42255 <sonic-button 42256 @click=${() => this.removeItem(index)} 42257 shape="circle" 42258 size="2xs" 42259 class="absolute top-1 right-1" 42260 type="danger" 42261 ><sonic-icon library="custom" name="x" variant="default"></sonic-icon 42262 ></sonic-button> 42263 </div> 42264 `; 42265 }) : A$1} 42266 </div> 42267 ${this.description ? b$1`<div class="form-description max-w-[300px] mt-1 text-xs">${this.description}</div>` : A$1} 42268 ${this.alertMessage ? b$1`<sonic-alert class="mt-6" status="info" background dismissible>${this.alertMessage}</sonic-alert>` : A$1} 42269 `; 42270 } 42271 }; 42272 SonicDragAndDrop.styles = [ 42273 label, 42274 description, 42275 tailwind, 42276 i$9` 42277 :host([dropState="default"]) #drop-area { 42278 --_color: var(--sc-base-400); 42279 } 42280 42281 :host([dropState="success"]) #drop-area { 42282 --_color: var(--sc-success); 42283 } 42284 :host([dropState="error"]) #drop-area { 42285 --_color: var(--sc-danger); 42286 } 42287 #drop-area { 42288 color: var(--_color); 42289 } 42290 ` 42291 ]; 42292 __decorateClass$24([ 42293 n$5({ type: Boolean, reflect: true }) 42294 ], SonicDragAndDrop.prototype, "multiple", 2); 42295 __decorateClass$24([ 42296 n$5({ type: String }) 42297 ], SonicDragAndDrop.prototype, "label", 2); 42298 __decorateClass$24([ 42299 n$5({ type: String }) 42300 ], SonicDragAndDrop.prototype, "description", 2); 42301 __decorateClass$24([ 42302 n$5({ type: String }) 42303 ], SonicDragAndDrop.prototype, "customSize", 2); 42304 __decorateClass$24([ 42305 n$5({ type: Array }) 42306 ], SonicDragAndDrop.prototype, "accept", 2); 42307 __decorateClass$24([ 42308 n$5({ type: Boolean }) 42309 ], SonicDragAndDrop.prototype, "withoutText", 2); 42310 __decorateClass$24([ 42311 n$5({ type: Boolean }) 42312 ], SonicDragAndDrop.prototype, "displayFileName", 2); 42313 __decorateClass$24([ 42314 e$7("#file-input") 42315 ], SonicDragAndDrop.prototype, "fileInput", 2); 42316 __decorateClass$24([ 42317 e$7("#drop-area") 42318 ], SonicDragAndDrop.prototype, "dropArea", 2); 42319 __decorateClass$24([ 42320 e$7("#preview-container") 42321 ], SonicDragAndDrop.prototype, "previewContainer", 2); 42322 __decorateClass$24([ 42323 r$5() 42324 ], SonicDragAndDrop.prototype, "previewIndex", 2); 42325 __decorateClass$24([ 42326 r$5() 42327 ], SonicDragAndDrop.prototype, "alertMessage", 2); 42328 __decorateClass$24([ 42329 n$5({ type: String }) 42330 ], SonicDragAndDrop.prototype, "size", 2); 42331 __decorateClass$24([ 42332 n$5({ type: String, reflect: true }) 42333 ], SonicDragAndDrop.prototype, "dropState", 2); 42334 __decorateClass$24([ 42335 r$5() 42336 ], SonicDragAndDrop.prototype, "_modal", 2); 42337 __decorateClass$24([ 42338 n$5({ type: Array }) 42339 ], SonicDragAndDrop.prototype, "files", 2); 42340 __decorateClass$24([ 42341 r$5() 42342 ], SonicDragAndDrop.prototype, "filesWithPreview", 2); 42343 SonicDragAndDrop = __decorateClass$24([ 42344 t$3("sonic-file-upload") 42345 ], SonicDragAndDrop); 42346 var __defProp$21 = Object.defineProperty; 42347 var __getOwnPropDesc$23 = Object.getOwnPropertyDescriptor; 42348 var __decorateClass$23 = (decorators, target, key, kind) => { 42349 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$23(target, key) : target; 42350 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 42351 if (decorator = decorators[i2]) 42352 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 42353 if (kind && result) __defProp$21(target, key, result); 42354 return result; 42355 }; 42356 let instanceCounter$7 = 0; 42357 const tagName$1l = "sonic-subscription-renew-form"; 42358 let SubscriptionRenewFrom = class extends i$6 { 42359 constructor() { 42360 super(...arguments); 42361 this.formDataProvider = "subscriptionRenewFrom" + instanceCounter$7++; 42362 this.renewFromForm = false;
42363 this.handleSubscriptionSelect = (e2) => { 42364 const subscription = e2.detail.subscription; 42365 const renewFrom = { id: Number(subscription.id), number: subscription.number, email: subscription.owner?.email }; 42366 this.updateRenewFrom(renewFrom); 42367 }; 42368 } 42369 connectedCallback() { 42370 if (!this.cartProvider) { 42371 this.cartProvider = HTML$1.getAncestorAttributeValue(this, "cartProvider") || ""; 42372 } 42373 super.connectedCallback(); 42374 } 42375 willUpdate(_changedProperties) { 42376 if (_changedProperties.has("lineItem")) { 42377 this.renewFrom = this.lineItem?.renew_from || void 0; 42378 } 42379 super.willUpdate(_changedProperties); 42380 } 42381 render() { 42382 return b$1` 42383 <sonic-fieldset 42384 class="my-8" 42385 label="${t("LIB_Renouvellement")}" 42386 iconLibrary="custom" 42387 iconName="arrows-rotate" 42388 class="@container" 42389 > 42390 <div class="@container"> 42391 ${this.lineItem?.renew_from?.id ? b$1`<div class="flex items-start gap-4 rounded-md p-4 bg-neutral-50"> 42392 <sonic-fetch 42393 dataProvider="currentRenew" 42394 endPoint="/subscriptions/${this.lineItem.renew_from.id}?features[]=owner&features[]=buyer&features[]=price" 42395 > 42396 <sonic-subscription-info subDataProvider="data" class="grow min-w-0"></sonic-subscription-info 42397 ></sonic-fetch> 42398 <sonic-tooltip label=${t("unlink")} class="ml-auto"> 42399 <sonic-button 42400 @click=${() => this.updateRenewFrom({ id: 0, number: "", email: "" })} 42401 shape="circle" 42402 size="md" 42403 variant="outline" 42404 > 42405 <sonic-icon library="custom" name="link-slash"></sonic-icon> 42406 </sonic-button> 42407 </sonic-tooltip> 42408 </div> 42409 ${this.renewWarning()} ` : b$1`${this.renewFromSelection()}`} 42410 </div> 42411 </sonic-fieldset> 42412 `; 42413 } 42414 renewWarning() { 42415 if (!this.currentRenew) return A$1; 42416 const date2 = this.currentRenew.expires_at; 42417 const now = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3); 42418 const isExpired = date2 && date2 < now; 42419 if (isExpired) return A$1; 42420 return b$1`<sonic-alert 42421 status="warning" 42422 size="sm" 42423 class="mt-2 animate-pulse" 42424 background 42425 label=${t("LIB_subscription_actuellement_toujours_valide")} 42426 > 42427 </sonic-alert>`; 42428 } 42429 renewFromSelection() { 42430 const isCustomerLoggedIn = !!this.userId; 42431 const displayTabs = this.appType === "counter" || isCustomerLoggedIn; 42432 const displaySearchSelector = displayTabs && !this.renewFromForm; 42433 const displayClassicForm = this.renewFromForm || !displayTabs; 42434 return b$1` 42435 ${displayTabs ? b$1` 42436 <div class="flex gap-3 mb-3" direction="row"> 42437 <button 42438 size="sm" 42439 variant="ghost" 42440 class=" ${!displaySearchSelector ? "text-neutral-500" : ""} hover:text-current" 42441 ?active=${displaySearchSelector} 42442 @click=${() => this.renewFromForm = false} 42443 > 42444 ${t("Rechercher")} 42445 </button> 42446 <sonic-divider vertical></sonic-divider> 42447 <button 42448 size="sm" 42449 variant="ghost" 42450 class=" ${!displayClassicForm ? "text-neutral-500" : ""} hover:text-current" 42451 ?active=${displayClassicForm} 42452 @click=${() => this.renewFromForm = true} 42453 > 42454 ${t("i_have_a_number")} 42455 </button> 42456 </div> 42457 ` : A$1} 42458 ${displaySearchSelector ? b$1` 42459 <sonic-subscription-selector 42460 @select=${this.handleSubscriptionSelect} 42461 canRenew 42462 searchStatus="all" 42463 ></sonic-subscription-selector> 42464 ` : b$1` 42465 <div class="flex flex-col @xl:flex-row gap-2" formDataProvider=${this.formDataProvider}> 42466 <sonic-input 42467 class="grow" 42468 name="email" 42469 id="email" 42470 data-aria-label=${t("email")} 42471 inlineContent 42472 placeholder="${t("email")}" 42473 > 42474 <sonic-icon name="envelope" library="custom" slot="prefix"></sonic-icon> 42475 </sonic-input> 42476 <sonic-input 42477 name="number" 42478 id="inputNumber" 42479 inlineContent 42480 data-aria-label=${t("numero_carte")} 42481 placeholder="${t("numero_carte")}" 42482 > 42483 <sonic-icon name="input-numeric" library="custom" slot="prefix"></sonic-icon> 42484 </sonic-input> 42485 <sonic-button 42486 @click=${() => { 42487 const renewFrom = dp(this.formDataProvider).get(); 42488 if (!renewFrom) return; 42489 this.updateRenewFrom(renewFrom); 42490 }} 42491 size="sm" 42492 type="success" 42493 > 42494 ${t("LIB_abo_renouveler")} 42495 </sonic-button> 42496 </div> 42497 `} 42498 `; 42499 } 42500 clearRenewFrom() { 42501 if (this.lineItem) { 42502 this.lineItem.renew_from = void 0; 42503 } 42504 dp(this.formDataProvider).set({ 42505 email: "", 42506 number: "" 42507 }); 42508 } 42509 async updateRenewFrom(renew_from) { 42510 let id = this.lineItem?.id; 42511 const cartProvider = this.cartProvider; 42512 if (!id || !cartProvider) return; 42513 await Cart.patchItems({ 42514 apiConfiguration: HTML$1.getApiConfiguration(this), 42515 cartProvider, 42516 query: { 42517 ids: [id] 42518 }, 42519 body: { 42520 renew_from 42521 } 42522 }).then((e2) => { 42523 if (e2 === "asRequested") { 42524 const isCleared = renew_from.id === 0; 42525 if (isCleared) { 42526 this.clearRenewFrom(); 42527 } 42528 if (!renew_from.number) { 42529 const event2 = new CustomEvent("renewFromRemove"); 42530 this.dispatchEvent(event2); 42531 return; 42532 }
42533 const subscription = this.getSubscriptionFromLineItemCart(renew_from.number); 42534 if (subscription) { 42535 this.renewFrom = { 42536 id: Number(subscription.renew_from?.id || 0), 42537 number: subscription.renew_from?.number || "", 42538 email: subscription.renew_from?.email 42539 }; 42540 } 42541 const event = new CustomEvent("renewFromSelect", { detail: { ...subscription } }); 42542 this.dispatchEvent(event); 42543 } 42544 }); 42545 } 42546 getSubscriptionFromLineItemCart(number) { 42547 if (!this.cartProvider) return; 42548 const cartItems = dp(this.cartProvider).data.items.get(); 42549 const subscription = cartItems.find((item) => item?.renew_from?.number === number); 42550 return subscription; 42551 } 42552 }; 42553 SubscriptionRenewFrom.styles = [tailwind]; 42554 __decorateClass$23([ 42555 n$5({ type: Object }) 42556 ], SubscriptionRenewFrom.prototype, "lineItem", 2); 42557 __decorateClass$23([ 42558 r$5() 42559 ], SubscriptionRenewFrom.prototype, "renewFrom", 2); 42560 __decorateClass$23([ 42561 n$5() 42562 ], SubscriptionRenewFrom.prototype, "cartProvider", 2); 42563 __decorateClass$23([ 42564 n$5() 42565 ], SubscriptionRenewFrom.prototype, "formDataProvider", 2); 42566 __decorateClass$23([ 42567 c({ context: appType, subscribe: true }), 42568 r$5() 42569 ], SubscriptionRenewFrom.prototype, "appType", 2); 42570 __decorateClass$23([ 42571 bind$1("user.id"), 42572 n$5({ type: String }) 42573 ], SubscriptionRenewFrom.prototype, "userId", 2); 42574 __decorateClass$23([ 42575 r$5() 42576 ], SubscriptionRenewFrom.prototype, "renewFromForm", 2); 42577 __decorateClass$23([ 42578 bind$1("currentRenew.data"), 42579 r$5() 42580 ], SubscriptionRenewFrom.prototype, "currentRenew", 2); 42581 SubscriptionRenewFrom = __decorateClass$23([ 42582 t$3(tagName$1l) 42583 ], SubscriptionRenewFrom); 42584 var __defProp$20 = Object.defineProperty; 42585 var __getOwnPropDesc$22 = Object.getOwnPropertyDescriptor; 42586 var __decorateClass$22 = (decorators, target, key, kind) => { 42587 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$22(target, key) : target; 42588 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 42589 if (decorator = decorators[i2]) 42590 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 42591 if (kind && result) __defProp$20(target, key, result); 42592 return result; 42593 }; 42594 const tagName$1k = "sonic-optins-form"; 42595 var OptinType = /* @__PURE__ */ ((OptinType2) => { 42596 OptinType2["SUBSCRIPTION"] = "subscription"; 42597 OptinType2["ACCOUNT"] = "account"; 42598 OptinType2["QUICK_PURCHASE"] = "quick_purchase"; 42599 OptinType2["COUNTER"] = "counter"; 42600 return OptinType2; 42601 })(OptinType || {}); 42602 let OptinsForm = class extends i$6 { 42603 constructor() { 42604 super(...arguments); 42605 this.optinsListType = []; 42606 this.optins = []; 42607 this.loading = false; 42608 } 42609 willUpdate(_changedProperties) { 42610 if (_changedProperties.has("optinsListType")) { 42611 this.loadMailingLists(this.optinsListType); 42612 } 42613 } 42614 render() { 42615 if (this.loading) { 42616 return b$1`<sonic-loader class="my-4" mode="inline"></sonic-loader>`; 42617 } 42618 if (!this.loading && this.optins.length === 0) { 42619 return A$1; 42620 } 42621 return b$1` 42622 <sonic-fieldset> 42623 <div class="flex flex-col gap-3"> 42624 ${this.loading ? b$1`<sonic-loader></sonic-loader>` : b$1` 42625 ${this.optins.map((optin) => { 42626 const id = optin.id; 42627 if (!id) return; 42628 return b$1` <sonic-checkbox type="checkbox" name="optins" value=${id}> 42629 ${optin?.description} 42630 </sonic-checkbox>`; 42631 })} 42632 `} 42633 </div> 42634 </sonic-fieldset> 42635 `; 42636 } 42637 async loadMailingLists(types) { 42638 this.loading = true; 42639 try { 42640 const searchParams = new URLSearchParams(); 42641 if (types?.includes( 42642 "counter" 42643 /* COUNTER */ 42644 )) { 42645 searchParams.set("is_counter_enabled", "true"); 42646 } else if (types?.includes( 42647 "quick_purchase" 42648 /* QUICK_PURCHASE */ 42649 )) { 42650 searchParams.set("is_quick_purchase_enabled", "true"); 42651 } else if (types?.includes( 42652 "subscription" 42653 /* SUBSCRIPTION */ 42654 )) { 42655 searchParams.set("is_subscription_enabled", "true"); 42656 } else if (types?.includes( 42657 "account" 42658 /* ACCOUNT */ 42659 )) { 42660 searchParams.set("is_customer_account_enabled", "true"); 42661 } 42662 const api2 = new API(HTML.getApiConfiguration(this)); 42663 const response = await api2.get("/optins?" + searchParams.toString()); 42664 if (response?.success) { 42665 this.optins = response.data; 42666 } else { 42667 this.optins = []; 42668 } 42669 } catch (error) { 42670 console.error("Failed to load optins:", error); 42671 } finally { 42672 this.loading = false;
42673 } 42674 } 42675 }; 42676 OptinsForm.styles = [tailwind]; 42677 __decorateClass$22([ 42678 n$5({ type: Array }) 42679 ], OptinsForm.prototype, "optinsListType", 2); 42680 __decorateClass$22([ 42681 r$5() 42682 ], OptinsForm.prototype, "optins", 2); 42683 __decorateClass$22([ 42684 r$5() 42685 ], OptinsForm.prototype, "loading", 2); 42686 OptinsForm = __decorateClass$22([ 42687 t$3(tagName$1k) 42688 ], OptinsForm); 42689 var __decorate$6 = function(decorators, target, key, desc) { 42690 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 42691 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 42692 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 42693 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 42694 }; 42695 const tagName$1j = "sonic-switch"; 42696 let Switch = class Switch extends Checkbox { 42697 constructor() { 42698 super(); 42699 this.unique = true; 42700 } 42701 }; 42702 Switch.styles = [ 42703 Checkbox.styles, 42704 i$9` 42705 sonic-icon { 42706 display: none; 42707 } 42708 42709 .icon-container { 42710 display: flex; 42711 align-items: center; 42712 justify-content: center; 42713 vertical-align: baseline; 42714 position: relative; 42715 font-size: var(--sc-_fs, 1rem); 42716 } 42717 :host([disabled]) .icon-container { 42718 cursor: not-allowed; 42719 } 42720 42721 :host input { 42722 -webkit-appearance: none; 42723 -moz-appearance: none; 42724 appearance: none; 42725 flex-shrink: 0; 42726 width: 100%; 42727 width: calc(var(--sc-_fs) * 2.5) !important; 42728 cursor: pointer; 42729 border-radius: 1.75em; 42730 background-color: var(--sc-checkbox-bg); 42731 } 42732 42733 :host input:checked { 42734 -webkit-appearance: none; 42735 -moz-appearance: none; 42736 appearance: none; 42737 flex-shrink: 0; 42738 width: 100%; 42739 width: calc(var(--sc-_fs) * 2.5) !important; 42740 cursor: pointer; 42741 border-radius: 1.75em; 42742 border-color: var(--sc-primary, var(--sc-base-content, #fff)); 42743 background-color: var(--sc-primary, var(--sc-base-content, #fff)); 42744 } 42745 42746 .icon-container::after { 42747 content: ""; 42748 position: absolute; 42749 height: round(calc(95% - var(--sc-checkbox-border-width)), 1px); 42750 aspect-ratio: 1/1; 42751 border-radius: 50%; 42752 left: var(--sc-checkbox-border-width); 42753 top: 50%; 42754 transform: translateY(-50%); 42755 display: block; 42756 background-color: var(--sc-input-color, var(--sc-base-content, #000)); 42757 transition: all 0.2s ease-in-out; 42758 } 42759 42760 .icon-container:has(input:checked)::after { 42761 left: calc(100% - var(--sc-checkbox-border-width)); 42762 background-color: var(--sc-primary-content, var(--sc-base, #fff)); 42763 transform: translateX(-100%) translateY(-50%); 42764 } 42765 42766 input + sonic-icon { 42767 display: none; 42768 } 42769 ` 42770 ]; 42771 Switch = __decorate$6([ 42772 t$3(tagName$1j) 42773 ], Switch); 42774 var __defProp$1$ = Object.defineProperty; 42775 var __getOwnPropDesc$21 = Object.getOwnPropertyDescriptor; 42776 var __decorateClass$21 = (decorators, target, key, kind) => { 42777 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$21(target, key) : target; 42778 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 42779 if (decorator = decorators[i2]) 42780 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 42781 if (kind && result) __defProp$1$(target, key, result); 42782 return result; 42783 }; 42784 const CUSTOM_FORMS_KEY = "customFormValues"; 42785 const tagName$1i = "sonic-custom-form"; 42786 let SonicCustomForm$1 = class SonicCustomForm extends i$6 { 42787 render() { 42788 return b$1` 42789 <sonic-fieldset 42790 .label=${this.customForm?.label} 42791 iconLibrary="custom" 42792 iconName="circle-info" 42793 variant=${o$4(this.variant)} 42794 > 42795 ${this.customForm?.body ? b$1`<div class="mb-6">${this.customForm?.body}</div>` : A$1} 42796 <div class="grid grid-cols-1 gap-6"> 42797 ${c$1( 42798 this.customForm?.inputs || [], 42799 (input) => input.id, 42800 (input) => this.renderMatchingInput(input) 42801 )} 42802 </div> 42803 </sonic-fieldset> 42804 `; 42805 } 42806 renderMatchingInput(input) { 42807 switch (input.type) { 42808 case InputType.Text: 42809 return this.renderInput(input); 42810 case InputType.Textarea: 42811 return this.renderTextarea(input); 42812 case InputType.Radio: 42813 return this.renderRadio(input); 42814 case InputType.Checkbox: 42815 return this.renderCheckbox(input); 42816 case InputType.Checkboxes: 42817 return this.renderCheckboxes(input); 42818 case InputType.Select: 42819 return this.renderSelect(input); 42820 case InputType.File: 42821 return this.renderFile(input); 42822 case InputType.Email: 42823 return this.renderEmail(input); 42824 case InputType.Number: 42825 return this.renderNumber(input); 42826 case InputType.Tel: 42827 return this.renderTel(input); 42828 case InputType.Date: 42829 return this.renderDate(input); 42830 case InputType.TextSection: 42831 return this.renderTextZone(input); 42832 default: 42833 return A$1; 42834 } 42835 } 42836 getInputName(input) { 42837 return `${this.namePrefix ? `${this.namePrefix}.` : ""}${input.name}`; 42838 } 42839 renderInput(input) { 42840 return b$1`<sonic-input 42841 type="text" 42842 name=${this.getInputName(input)} 42843 label=${input.label} 42844 ?required=${input.required} 42845 placeholder=${o$4(input.placeholder)} 42846 >${requiredMark(input.required)}</sonic-input 42847 >`; 42848 } 42849 renderNumber(input) { 42850 return b$1`<sonic-input 42851 type="number" 42852 name=${this.getInputName(input)} 42853 label=${input.label} 42854 ?required=${input.required} 42855 placeholder=${input.placeholder || "0"} 42856 >${requiredMark(input.required)}</sonic-input 42857 >`; 42858 } 42859 renderTextarea(input) { 42860 return b$1`<sonic-textarea 42861 type="textarea" 42862 name=${this.getInputName(input)} 42863 label=${input.label} 42864 ?required=${input.required} 42865 placeholder=${o$4(input.placeholder)} 42866 rows=${input.rows || 4} 42867 >${requiredMark(input.required)}</sonic-textarea 42868 >`; 42869 } 42870 renderEmail(input) { 42871 return b$1`<sonic-input 42872 type="email" 42873 name=${this.getInputName(input)} 42874 label=${input.label} 42875 ?required=${input.required} 42876 placeholder=${input.placeholder || "[email protected]"} 42877 >${requiredMark(input.required)}</sonic-input 42878 >`; 42879 } 42880 renderTel(input) { 42881 return b$1`<sonic-input 42882 type="tel" 42883 name=${this.getInputName(input)} 42884 label=${input.label} 42885 ?required=${input.required} 42886 placeholder=${o$4(input.placeholder)} 42887 >${requiredMark(input.required)}</sonic-input 42888 >`; 42889 } 42890 renderSelect(input) { 42891 const emptyOption = { value: "", wording: "- - - -" }; 42892 const options = [ 42893 emptyOption, 42894 ...input.options?.map((option) => ({ value: option.value, wording: option.label })) || [] 42895 ]; 42896 return b$1`<sonic-select 42897 name=${this.getInputName(input)} 42898 label=${input.label} 42899 ?required=${input.required} 42900 .options=${options} 42901 >${requiredMark(input.required)} 42902 </sonic-select>`; 42903 } 42904 renderRadio(input) { 42905 return b$1`<div> 42906 <label class="inline-block label mb-2">${input.label} ${requiredMark(input.required)}</label> 42907 <div class="flex gap-x-6 gap-y-2 flex-wrap"> 42908 ${input.options?.map( 42909 (option) => b$1` 42910 <sonic-radio name=${this.getInputName(input)} value=${option.value} ?required=${input.required} 42911 >${option.label}</sonic-radio 42912 > 42913 ` 42914 )} 42915 </div> 42916 </div>`; 42917 } 42918 renderCheckboxes(input) { 42919 return b$1`<div> 42920 <label class="inline-block label mb-2">${input.label}</label> 42921 <div class="flex gap-x-6 gap-y-2 flex-wrap"> 42922 ${input.options?.map( 42923 (option) => b$1` 42924 <sonic-checkbox name=${this.getInputName(input)} value=${option.value}>${option.label}</sonic-checkbox> 42925 ` 42926 )} 42927 </div> 42928 </div>`; 42929 } 42930 renderCheckbox(input) { 42931 return b$1`<sonic-checkbox name=${this.getInputName(input)} unique .value=${true} ?required=${input.required}> 42932 ${input.label} ${requiredMark(input.required, "")} 42933 </sonic-checkbox>`; 42934 } 42935 renderFile(input) { 42936 const extensions = input?.constraints?.extensions || []; 42937 return b$1`<sonic-file-upload 42938 name=${this.getInputName(input)} 42939 label=${input.label} 42940 ?required=${input.required} 42941 .accept=${input?.constraints?.fileTypes} 42942 .description=${extensions.join(", ")} 42943 ></sonic-file-upload>`; 42944 } 42945 renderDate(input) { 42946 return b$1`<sonic-input 42947 type="date" 42948 name=${this.getInputName(input)} 42949 label=${input.label} 42950 ?required=${input.required} 42951 >${requiredMark(input.required)}</sonic-input 42952 >`; 42953 } 42954 renderTextZone(input) { 42955 return b$1`<div class="max-w-prose">${o$6(input?.body)}</div>`; 42956 } 42957 }; 42958 SonicCustomForm$1.styles = [tailwind, label]; 42959 __decorateClass$21([ 42960 n$5({ type: Object }) 42961 ], SonicCustomForm$1.prototype, "customForm", 2); 42962 __decorateClass$21([ 42963 n$5({ type: String })
42964 ], SonicCustomForm$1.prototype, "namePrefix", 2); 42965 __decorateClass$21([ 42966 n$5({ type: String }) 42967 ], SonicCustomForm$1.prototype, "variant", 2); 42968 SonicCustomForm$1 = __decorateClass$21([ 42969 t$3(tagName$1i) 42970 ], SonicCustomForm$1); 42971 var __defProp$1_ = Object.defineProperty; 42972 var __getOwnPropDesc$20 = Object.getOwnPropertyDescriptor; 42973 var __decorateClass$20 = (decorators, target, key, kind) => { 42974 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$20(target, key) : target; 42975 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 42976 if (decorator = decorators[i2]) 42977 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 42978 if (kind && result) __defProp$1_(target, key, result); 42979 return result; 42980 }; 42981 let instanceCounter$6 = 0; 42982 const tagName$1h = "sonic-subscription-owner-form"; 42983 let SubscriptionOwnerForm = class extends i$6 { 42984 constructor() { 42985 super(...arguments); 42986 this.formDataProvider = "subscriptionOwnerForm" + instanceCounter$6++; 42987 this.structureTypesOptions = []; 42988 this.loading = false; 42989 this.no_email = "false"; 42990 this.selectFormSuggest = false; 42991 this.has_renew_from = false; 42992 this.handleFormMutation = () => { 42993 const formData = dp(this.formDataProvider).get(); 42994 const no_email = formData?.email?.endsWith(".pasdemail") ? "true" : "false"; 42995 this.no_email = no_email; 42996 }; 42997 this.handleNoEmailChange = (e2) => { 42998 const checkbox2 = e2.target; 42999 const firstName = dp(this.formDataProvider).firstName.get() || ""; 43000 const lastName = dp(this.formDataProvider).lastName.get() || ""; 43001 const email2 = generateFakeEmail(firstName, lastName); 43002 if (checkbox2.checked) { 43003 dp(this.formDataProvider).email.set(email2); 43004 } else { 43005 dp(this.formDataProvider).email.set(""); 43006 } 43007 }; 43008 this.udpateForUid = async (uid) => { 43009 const api2 = new API(HTML$1.getApiConfiguration(this)); 43010 const endpoint = `/user/${uid}`; 43011 const result = await api2.get(endpoint); 43012 const user2 = result; 43013 const id = this.item?.id; 43014 if (!id || !this.cartProvider) return; 43015 const customFormsData = dp(this.formDataProvider)?.[CUSTOM_FORMS_KEY]?.get(); 43016 await Cart.patchItems({ 43017 apiConfiguration: HTML$1.getApiConfiguration(this), 43018 cartProvider: this.cartProvider, 43019 query: { 43020 ids: [id] 43021 }, 43022 body: { 43023 owner: user2, 43024 [CUSTOM_FORMS_KEY]: customFormsData 43025 } 43026 }); 43027 this.setFormData(user2); 43028 this.selectFormSuggest = true; 43029 }; 43030 this.suggestFieldHasChanged = () => { 43031 this.selectFormSuggest = false; 43032 }; 43033 } 43034 connectedCallback() { 43035 this.setFormData(this.item?.owner, this.item?.[CUSTOM_FORMS_KEY] || {}); 43036 dp(this.formDataProvider).onInternalMutation(this.handleFormMutation); 43037 dp(this.formDataProvider).email.onAssign(this.suggestFieldHasChanged); 43038 dp(this.formDataProvider).lastName.onAssign(this.suggestFieldHasChanged); 43039 dp(this.formDataProvider).firstName.onAssign(this.suggestFieldHasChanged); 43040 super.connectedCallback(); 43041 } 43042 disconnectedCallback() { 43043 dp(this.formDataProvider).offInternalMutation(this.handleFormMutation); 43044 dp(this.formDataProvider).email.offAssign(this.suggestFieldHasChanged); 43045 dp(this.formDataProvider).lastName.offAssign(this.suggestFieldHasChanged); 43046 dp(this.formDataProvider).firstName.offAssign(this.suggestFieldHasChanged); 43047 super.disconnectedCallback(); 43048 } 43049 async willUpdate(_changedProperties) { 43050 if (_changedProperties.has("item")) { 43051 const subscriptionTypeId = this.item?.entity_id;
43052 this.getSubscriptionType(subscriptionTypeId).then((subscriptionType) => { 43053 this.subscriptionType = subscriptionType; 43054 }); 43055 this.has_renew_from = !!this.item?.renew_from?.id; 43056 } 43057 if (_changedProperties.has("subscriptionType")) { 43058 if (this.appType === "counter") { 43059 this.formConfiguration = this.subscriptionType?.owner_form?.counter; 43060 } else { 43061 this.formConfiguration = this.subscriptionType?.owner_form?.customer; 43062 } 43063 } 43064 if (_changedProperties.has("formConfiguration")) { 43065 const { structureType } = this.formConfiguration || {}; 43066 if (structureType?.enabled) { 43067 this.structureTypesOptions = await this.structureTypesToOptions() || []; 43068 } 43069 } 43070 } 43071 // RENDER FORM 43072 render() { 43073 if (!this.cartProvider) return A$1; 43074 const canRenew = this.appType === "counter" || this.subscriptionType?.settings?.can_renew; 43075 return b$1` 43076 ${productPriceSummary({ lineItemCart: this.item, className: "mb-6" })} 43077 ${canRenew ? b$1`<sonic-subscription-renew-form 43078 class="mb-8" 43079 @renewFromRemove=${() => { 43080 this.has_renew_from = false; 43081 if (this.item) { 43082 this.item = { 43083 ...this.item, 43084 renew_from: void 0 43085 }; 43086 } 43087 this.setFormData({}); 43088 }} 43089 @renewFromSelect=${(e2) => { 43090 const owner = e2.detail.owner; 43091 const customFormsData = dp(this.formDataProvider)?.[CUSTOM_FORMS_KEY]?.get(); 43092 this.setFormData(owner, customFormsData); 43093 this.has_renew_from = true; 43094 if (this.item) { 43095 this.item = { 43096 ...this.item, 43097 renew_from: e2.detail.renew_from 43098 }; 43099 } 43100 }} 43101 .lineItem=${this.item} 43102 cartProvider=${this.cartProvider} 43103 ></sonic-subscription-renew-form>` : A$1} 43104 ${this.loading ? b$1`<sonic-loader mode="inline" class="my-8"></sonic-loader>` : b$1` 43105 <form id="subscription-owner" formDataProvider=${this.formDataProvider}> 43106 ${this.renderInfos()} ${this.renderPhotography()} ${this.renderAddress()} ${this.renderCustomForms()} 43107 ${this.renderAllowInDirectory()} ${this.renderMailingLists()} 43108 <sonic-button @click=${this.submitForm} size="lg" type="success" shape="block" type="success"> 43109 <sonic-icon library="custom" name="check"></sonic-icon> 43110 ${t("Valider")} 43111 </sonic-button> 43112 43113 <div class="text-sm text-neutral-500 text-center pt-3">${t("LIB_required_fields")}</div> 43114 </form> 43115 `} 43116 `; 43117 } 43118 isRequired(isRequired) { 43119 if (this.appType === "counter") { 43120 return false; 43121 } else if (this.appType === "customer") { 43122 return isRequired || false; 43123 } 43124 return false; 43125 } 43126 requiredMark(isRequired) { 43127 const shouldRender = isRequired || false; 43128 return shouldRender ? b$1`<span class="opacity-50 pl-1" slot="label">*</span>` : A$1; 43129 } 43130 renderMailingLists() { 43131 return b$1`<sonic-optins-form .optinsListType=${[OptinType.SUBSCRIPTION]}></sonic-optins-form>`; 43132 } 43133 renderInfos() { 43134 if (!this.formConfiguration) return A$1; 43135 const { gender, birthdate, phoneNumber } = this.formConfiguration; 43136 const displaySuggestion = this.appType === "counter" && !this.has_renew_from && !this.selectFormSuggest; 43137 return b$1` 43138 <sonic-fieldset iconLibrary="custom" iconName="id-card" label="${t("type_abo_informations_personnelles")}"> 43139 <sonic-form-layout class="mb-6"> 43140 <sonic-input 43141 size="sm" 43142 autocomplete=${autocompleteValue("family-name", this.appType)} 43143 name="lastName" 43144 id="lastName" 43145 required 43146 label=${t("nom")} 43147 >${this.requiredMark(true)}</sonic-input 43148 > 43149 43150 <sonic-input 43151 size="sm" 43152 autocomplete=${autocompleteValue("given-name", this.appType)} 43153 name="firstName" 43154 id="firstName" 43155 required 43156 label=${t("prenom")} 43157 >${this.requiredMark(true)}</sonic-input 43158 > 43159
43160 <sonic-divider></sonic-divider> 43161 43162 <div class="form-item-container"> 43163 <sonic-input 43164 size="sm" 43165 id="email" 43166 name="email" 43167 type="email" 43168 label=${t("email")} 43169 ?disabled=${this.no_email === "true"} 43170 ?required=${this.appType !== "counter"} 43171 >${this.requiredMark(true)}</sonic-input 43172 > 43173 ${this.appType === "counter" ? b$1` 43174 <sonic-checkbox 43175 class="mt-3 block" 43176 name="no_email" 43177 size="sm" 43178 unique 43179 value="true" 43180 label="Le client n'a pas d'adresse email" 43181 @change=${this.handleNoEmailChange} 43182 ></sonic-checkbox> 43183 ` : A$1} 43184 </div> 43185 43186 ${phoneNumber?.enabled ? b$1` 43187 <sonic-input 43188 size="sm" 43189 id="phone" 43190 autocomplete=${autocompleteValue("tel", this.appType)} 43191 name="phoneNumber" 43192 type="tel" 43193 label=${t("telephone")} 43194 ?required=${this.isRequired(phoneNumber?.required)} 43195 >${this.requiredMark(phoneNumber?.required)}</sonic-input 43196 > 43197 ` : A$1} 43198 ${displaySuggestion ? b$1` 43199 <sonic-user-suggest 43200 class="p-5 block border-neutral-200 border-dashed rounded-md border-2" 43201 @select=${(e2) => { 43202 this.udpateForUid(e2.detail.uid); 43203 }} 43204 limit="3" 43205 .email=${sub(this.formDataProvider + ".email")} 43206 .lastName=${sub(this.formDataProvider + ".lastName")} 43207 ></sonic-user-suggest> 43208 ` : A$1} 43209 ${gender?.enabled ? b$1` 43210 <sonic-select 43211 size="sm" 43212 autocomplete=${autocompleteValue("gender", this.appType)} 43213 name="gender" 43214 id="gender" 43215 label=${t("sexe")} 43216 ?required=${this.isRequired(gender?.required)} 43217 .options=${[ 43218 { wording: "", value: "" }, 43219 { wording: t("select_vide"), value: "-" }, 43220 { wording: t("homme"), value: "Homme" }, 43221 { wording: t("femme"), value: "Femme" } 43222 ]} 43223 >${this.requiredMark(gender?.required)} 43224 </sonic-select> 43225 ` : A$1} 43226 ${birthdate?.enabled ? b$1` 43227 <sonic-input 43228 size="sm" 43229 id="birthdate" 43230 autocomplete=${autocompleteValue("birthdate", this.appType)} 43231 name="birthdate" 43232 type="date" 43233 label=${t("date_naissance")} 43234 ?required=${this.isRequired(birthdate?.required)} 43235 >${this.requiredMark(birthdate?.required)}</sonic-input 43236 > 43237 ` : A$1} 43238 ${this.renderStructure()} 43239 </sonic-form-layout> 43240 </sonic-fieldset> 43241 `; 43242 } 43243 renderStructure() { 43244 if (!this.formConfiguration) return A$1; 43245 const { structure, role, structureType } = this.formConfiguration; 43246 if (!structure?.enabled && !role?.enabled) return A$1; 43247 return b$1` 43248 <sonic-divider></sonic-divider> 43249 <sonic-form-layout> 43250 ${structure?.enabled ? b$1` 43251 <sonic-input 43252 size="sm" 43253 id="organization" 43254 autocomplete=${autocompleteValue("organization", this.appType)} 43255 name="structure" 43256 label="${t("LIB_organization")}" 43257 ?required=${this.isRequired(structure?.required)} 43258 >${this.requiredMark(structure?.required)}</sonic-input 43259 > 43260 ` : A$1} 43261 ${role?.enabled ? b$1` 43262 <sonic-input 43263 size="sm" 43264 id="organization-title" 43265 autocomplete=${autocompleteValue("organization-title", this.appType)} 43266 name="role" 43267 label=${t("Fonction")} 43268 ?required=${this.isRequired(role?.required)} 43269 >${this.requiredMark(role?.required)}</sonic-input 43270 > 43271 ` : A$1} 43272 ${structureType?.enabled && this.structureTypesOptions.length > 1 ? b$1` 43273 <sonic-select 43274 size="sm" 43275 id="structure-type" 43276 name="structureType.id" 43277 label=${t("Type de structure")} 43278 .options=${this.structureTypesOptions} 43279 ?required=${this.isRequired(structureType?.required)} 43280 >${this.requiredMark(structureType?.required)}</sonic-select 43281 > 43282 ` : A$1} 43283 </sonic-form-layout> 43284 `; 43285 } 43286 renderAllowInDirectory() { 43287 if (!this.formConfiguration) return A$1; 43288 const { allowInDirectory } = this.formConfiguration; 43289 if (!allowInDirectory?.enabled) return A$1; 43290 return b$1` 43291 <sonic-fieldset iconLibrary="custom" iconName="address-book" label="${t("accreditations_directory_title")}"> 43292 <sonic-switch 43293 label="${t("LIB_annuaire_autorisation_case")}" 43294 name="allowInDirectory" 43295 .value=${true} 43296 class="text-balance" 43297 ></sonic-switch> 43298 </sonic-fieldset> 43299 `; 43300 } 43301 renderPhotography() { 43302 const { photography } = this.formConfiguration || {}; 43303 if (!photography?.enabled) return A$1; 43304 return b$1` 43305 <sonic-fieldset> 43306 <sonic-file-upload 43307 id="photography" 43308 name="photography" 43309 type="file" 43310 label=${t("abonnement_photographie")} 43311 .accept=${["image/jpeg", "image/png", "image/jpg", "image/gif"]} 43312 description=".jpg, .jpeg, .png, .gif" 43313 ?required=${this.isRequired(photography?.required)} 43314 >${this.requiredMark(photography?.required)}</sonic-file-upload 43315 > 43316 </sonic-fieldset> 43317 `; 43318 } 43319 renderAddress() { 43320 if (!this.formConfiguration) return A$1; 43321 return b$1`<sonic-address-fieldset .formConfiguration=${this.formConfiguration}></sonic-address-fieldset>`; 43322 } 43323 setFormData(owner, customFormsData) { 43324 const ownerData = owner || {}; 43325 ownerData.country = normalizeCountry(ownerData.country); 43326 const no_email = ownerData.email?.endsWith(".pasdemail") ? "true" : "false"; 43327 this.no_email = no_email; 43328 dp(this.formDataProvider).set({ 43329 ...ownerData, 43330 no_email, 43331 [CUSTOM_FORMS_KEY]: customFormsData || {} 43332 }); 43333 } 43334 async submitForm(e2) { 43335 const button2 = e2.target; 43336 const id = this.item?.id; 43337 if (!id || !this.cartProvider) return; 43338 const formPublisher = dp(this.formDataProvider); 43339 formPublisher.isFormValid.set(true); 43340 formPublisher.invalidateForm(); 43341 if (!formPublisher.isFormValid.get()) return; 43342 const formData = formPublisher.get(); 43343 const ownerFormDataCleaned = cleanFormData(formData, this.formConfiguration); 43344 const customFormsData = formPublisher?.[CUSTOM_FORMS_KEY]?.get(); 43345 await Cart.patchItems({ 43346 apiConfiguration: HTML$1.getApiConfiguration(this), 43347 cartProvider: this.cartProvider, 43348 query: { 43349 ids: [id] 43350 }, 43351 body: { 43352 owner: ownerFormDataCleaned, 43353 [CUSTOM_FORMS_KEY]: customFormsData 43354 } 43355 }).then((e22) => { 43356 if (e22 === "asRequested") { 43357 const parentModal = HTML$1.getClosestElement(this, "sonic-modal"); 43358 if (parentModal) { 43359 parentModal.hide(); 43360 const event = new CustomEvent("attach", { 43361 detail: { 43362 itemIds: this.item?.id ? [this.item.id] : [] 43363 } 43364 }); 43365 this.dispatchEvent(event); 43366 } 43367 } 43368 }).finally(() => { 43369 button2.removeAttribute("loading"); 43370 }); 43371 } 43372 async getStructureTypes() { 43373 const api2 = new API(HTML$1.getApiConfiguration(this)); 43374 const endpoint = `/structures-types`; 43375 const result = await api2.get(endpoint); 43376 return result.data; 43377 } 43378 async structureTypesToOptions() {
43379 const structureTypes = await this.getStructureTypes(); 43380 const options = structureTypes?.map((structureType) => ({ 43381 value: structureType.id?.toString() || "", 43382 wording: structureType.title || "" 43383 })); 43384 options?.unshift({ wording: "...", value: "" }); 43385 return options; 43386 } 43387 async getSubscriptionType(subscriptionTypeId) { 43388 this.loading = true; 43389 if (!subscriptionTypeId) return void 0; 43390 const api2 = new API(HTML$1.getApiConfiguration(this)); 43391 const endpoint = entityEndPoint({ 43392 entityType: EntityType.Subscribe, 43393 entityId: subscriptionTypeId, 43394 features: [Feature.Prices, Feature.OwnerForm, Feature.Settings], 43395 subscriptionPriceIds: this.item?.price?.id ? [Number(this.item.price.id)] : void 0 43396 }); 43397 const result = await api2.get(endpoint); 43398 this.loading = false; 43399 return result.data; 43400 } 43401 renderCustomForms() { 43402 const customForms = this.subscriptionType?.customForms; 43403 if (!customForms) return A$1; 43404 return b$1` 43405 ${c$1( 43406 customForms || [], 43407 (customForm) => customForm.id, 43408 (customForm) => b$1`<sonic-custom-form .namePrefix=${CUSTOM_FORMS_KEY} .customForm=${customForm}></sonic-custom-form> ` 43409 )} 43410 `; 43411 } 43412 }; 43413 SubscriptionOwnerForm.styles = [tailwind]; 43414 __decorateClass$20([ 43415 n$5() 43416 ], SubscriptionOwnerForm.prototype, "formDataProvider", 2); 43417 __decorateClass$20([ 43418 n$5() 43419 ], SubscriptionOwnerForm.prototype, "cartProvider", 2); 43420 __decorateClass$20([ 43421 n$5({ type: Object }) 43422 ], SubscriptionOwnerForm.prototype, "item", 2); 43423 __decorateClass$20([ 43424 c({ context: appType, subscribe: true }), 43425 r$5() 43426 ], SubscriptionOwnerForm.prototype, "appType", 2); 43427 __decorateClass$20([ 43428 r$5() 43429 ], SubscriptionOwnerForm.prototype, "subscriptionType", 2); 43430 __decorateClass$20([ 43431 r$5() 43432 ], SubscriptionOwnerForm.prototype, "formConfiguration", 2); 43433 __decorateClass$20([ 43434 r$5() 43435 ], SubscriptionOwnerForm.prototype, "structureTypesOptions", 2); 43436 __decorateClass$20([ 43437 r$5() 43438 ], SubscriptionOwnerForm.prototype, "loading", 2); 43439 __decorateClass$20([ 43440 r$5() 43441 ], SubscriptionOwnerForm.prototype, "no_email", 2); 43442 __decorateClass$20([ 43443 r$5() 43444 ], SubscriptionOwnerForm.prototype, "selectFormSuggest", 2); 43445 __decorateClass$20([ 43446 r$5() 43447 ], SubscriptionOwnerForm.prototype, "has_renew_from", 2); 43448 SubscriptionOwnerForm = __decorateClass$20([ 43449 t$3(tagName$1h) 43450 ], SubscriptionOwnerForm); 43451 var __defProp$1Z = Object.defineProperty; 43452 var __getOwnPropDesc$1$ = Object.getOwnPropertyDescriptor; 43453 var __decorateClass$1$ = (decorators, target, key, kind) => { 43454 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1$(target, key) : target; 43455 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43456 if (decorator = decorators[i2]) 43457 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43458 if (kind && result) __defProp$1Z(target, key, result); 43459 return result; 43460 }; 43461 const tagName$1g = "sonic-subscription-help"; 43462 let SubscriptionHelp = class extends Subscriber$1(i$6) { 43463 constructor() { 43464 super(...arguments); 43465 this.data = null; 43466 this.cartProvider = "cart/current"; 43467 this._hasEventsForSubscriptions = false; 43468 } 43469 connectedCallback() { 43470 this.cartProvider = this.getAncestorAttributeValue("cartProvider") || "cart/current"; 43471 this.dataProvider = this.cartProvider; 43472 super.connectedCallback(); 43473 } 43474 async willUpdate(_changedProperties) { 43475 if (_changedProperties.has("data")) { 43476 const subscriptions = getCartSubscriptions({ 43477 items: this.data?.items || [], 43478 linked_subscriptions: this.data?.linked_subscriptions || [], 43479 can_attach_events: true 43480 }); 43481 if (subscriptions.length > 0) { 43482 const apiConfiguration = HTML.getApiConfiguration(this); 43483 const events = await getEventsForSubscriptions({ 43484 apiConfiguration, 43485 subscriptions, 43486 accessParams: this.accessParams, 43487 limit: 1 43488 }); 43489 this._hasEventsForSubscriptions = events.length > 0; 43490 } else { 43491 this._hasEventsForSubscriptions = false;
43492 } 43493 } 43494 } 43495 render() { 43496 if (this._hasEventsForSubscriptions) { 43497 return b$1`<div class="@container"> 43498 <sonic-alert 43499 ${F({ 43500 in: v 43501 })} 43502 background 43503 status="success" 43504 data-action-area 43505 class="mb-6 @xl:text-lg" 43506 size="inherit" 43507 label="${t("LIB_subscription_help_cart")}" 43508 > 43509 <div class="mb-2">${t("LIB_subscription_help_cart_desc")}</div> 43510 <sonic-button 43511 @click=${() => quickSelectModal({ cartProvider: this.cartProvider, accessParams: this.accessParams })} 43512 type="success" 43513 size="inherit" 43514 class="animate-pulse lg:text-base" 43515 > 43516 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 43517 <span class="font-bold">${t("events_choice")}</span> 43518 </sonic-button> 43519 </sonic-alert> 43520 </div>`; 43521 } 43522 return A$1; 43523 } 43524 }; 43525 SubscriptionHelp.styles = [ 43526 tailwind, 43527 i$9` 43528 :host { 43529 width: 100%; 43530 display: block; 43531 } 43532 ` 43533 ]; 43534 __decorateClass$1$([ 43535 n$5({ type: Object }) 43536 ], SubscriptionHelp.prototype, "data", 2); 43537 __decorateClass$1$([ 43538 n$5({ type: String }) 43539 ], SubscriptionHelp.prototype, "cartProvider", 2); 43540 __decorateClass$1$([ 43541 c({ context: accessParamsContext, subscribe: true }), 43542 n$5({ type: Object }) 43543 ], SubscriptionHelp.prototype, "accessParams", 2); 43544 __decorateClass$1$([ 43545 r$5() 43546 ], SubscriptionHelp.prototype, "_hasEventsForSubscriptions", 2); 43547 SubscriptionHelp = __decorateClass$1$([ 43548 t$3(tagName$1g) 43549 ], SubscriptionHelp); 43550 var __defProp$1Y = Object.defineProperty; 43551 var __getOwnPropDesc$1_ = Object.getOwnPropertyDescriptor; 43552 var __decorateClass$1_ = (decorators, target, key, kind) => { 43553 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1_(target, key) : target; 43554 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43555 if (decorator = decorators[i2]) 43556 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43557 if (kind && result) __defProp$1Y(target, key, result); 43558 return result; 43559 }; 43560 const tagName$1f = "sonic-subscription"; 43561 let SonicSubscription = class extends Subscriber$1(i$6) { 43562 constructor() { 43563 super(...arguments); 43564 this.urlBase = ""; 43565 this.displayTitle = false; 43566 this.displayText = false; 43567 this.noHelp = false; 43568 this.smallTitle = false; 43569 } 43570 connectedCallback() { 43571 const urlParams = new URLSearchParams(window.location.search); 43572 if (!this.hash) { 43573 this.hash = urlParams.get("subscription_hash") || ""; 43574 } 43575 if (!this.type) { 43576 this.type = urlParams.get("subscription_type") || ""; 43577 } 43578 super.connectedCallback(); 43579 } 43580 firstUpdated() { 43581 this.endpoint = this.subscriptionListEndPoint(); 43582 } 43583 subscriptionListEndPoint() { 43584 const queryParameters = new URLSearchParams(); 43585 if (this.type) { 43586 const types = this.type.split(","); 43587 types.forEach((type) => { 43588 queryParameters.append("id[]", type); 43589 }); 43590 } 43591 return entityEndPoint({ 43592 entityType: EntityType.Subscribe, 43593 next: true, 43594 features: [Feature.Prices, Feature.Status, Feature.Settings, Feature.Season, Feature.Picture], 43595 customSearchParams: queryParameters, 43596 accessParams: this.accessParams 43597 }); 43598 } 43599 render() { 43600 if (this.isWaiting || !this.endpoint) return A$1; 43601 return b$1`<sonic-page-layout 43602 ?smallTitle=${this.smallTitle} 43603 ?displayTitle=${this.displayTitle} 43604 ?displayText=${this.displayText} 43605 .pageTitle=${t("onglet_home_abonnements")} 43606 .pageText=${t("LIB_interface_vente_abonnement")} 43607 > 43608 <div class="@container"> 43609 ${!this.noHelp ? b$1`<sonic-subscription-help></sonic-subscription-help>` : A$1} 43610 <sonic-list 43611 loader="inline" 43612 fetch 43613 dataProvider=${this.endpoint} 43614 endPoint=${this.endpoint} 43615 key="data" 43616 class="grid grid-cols-1 @5xl:grid-cols-2 gap-4" 43617 .items=${() => b$1`<sonic-subscription-type></sonic-subscription-type>`} 43618 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 43619 > 43620 </sonic-list> 43621 </div> 43622 </sonic-page-layout>`; 43623 } 43624 }; 43625 SonicSubscription.styles = [tailwind]; 43626 __decorateClass$1_([ 43627 n$5({ type: String }) 43628 ], SonicSubscription.prototype, "urlBase", 2); 43629 __decorateClass$1_([ 43630 n$5({ type: String }) 43631 ], SonicSubscription.prototype, "hash", 2); 43632 __decorateClass$1_([ 43633 n$5({ type: String }) 43634 ], SonicSubscription.prototype, "type", 2); 43635 __decorateClass$1_([ 43636 n$5({ type: Boolean }) 43637 ], SonicSubscription.prototype, "displayTitle", 2); 43638 __decorateClass$1_([ 43639 n$5({ type: Boolean }) 43640 ], SonicSubscription.prototype, "displayText", 2); 43641 __decorateClass$1_([ 43642 n$5({ type: Boolean }) 43643 ], SonicSubscription.prototype, "noHelp", 2); 43644 __decorateClass$1_([ 43645 n$5({ type: Boolean }) 43646 ], SonicSubscription.prototype, "smallTitle", 2); 43647 __decorateClass$1_([ 43648 c({ context: accessParamsContext, subscribe: true }), 43649 n$5({ type: Object }) 43650 ], SonicSubscription.prototype, "accessParams", 2); 43651 __decorateClass$1_([ 43652 bind$1("sonicTicketApp.isWaiting"), 43653 r$5() 43654 ], SonicSubscription.prototype, "isWaiting", 2); 43655 __decorateClass$1_([ 43656 r$5() 43657 ], SonicSubscription.prototype, "endpoint", 2); 43658 SonicSubscription = __decorateClass$1_([ 43659 t$3(tagName$1f) 43660 ], SonicSubscription); 43661 var __defProp$1X = Object.defineProperty; 43662 var __getOwnPropDesc$1Z = Object.getOwnPropertyDescriptor; 43663 var __decorateClass$1Z = (decorators, target, key, kind) => { 43664 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1Z(target, key) : target; 43665 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43666 if (decorator = decorators[i2]) 43667 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43668 if (kind && result) __defProp$1X(target, key, result); 43669 return result; 43670 }; 43671 let Giftcard = class extends Subscriber$1(i$6) { 43672 render() { 43673 if (!this.props) return A$1; 43674 const hasBody = !!this.props.edito?.body; 43675 const isCounter = this.appType == "counter"; 43676 return b$1` 43677 <div class="@container group max-w-[80rem] "> 43678 <div 43679 class=" bg-neutral-0 grid grid-cols-1 @md:grid-cols-[minmax(0,_12rem),_minmax(0,_3fr)] 43680 items-center 43681 border border-neutral-100 rounded-lg gap-5 p-5 relative" 43682 > 43683 <div> 43684 <sonic-product-illustration rounded="md"></sonic-product-illustration> 43685 </div> 43686 <div class="flex flex-col gap-2"> 43687 ${isCounter ? b$1` 43688 <div class="absolute top-1 right-1 @md:top-3 @md:right-3 flex items-center gap-2"> 43689 <sonic-product-publication 43690 subDataProvider="infos_status" 43691 class="text-lg" 43692 ></sonic-product-publication> 43693 ${this.renderMenu()} 43694 </div> 43695 ` : A$1} 43696 <div class="mb-3"> 43697 <sonic-product-title class="text-2xl font-bold flex-grow pr-8 "></sonic-product-title> 43698 ${hasBody ? b$1`<div class="prose prose-sm prose-tight block">${o$6(this.props.edito?.body)}</div>` : A$1} 43699 </div> 43700 <div class="flex flex-wrap items-center gap-x-3 gap-y-1"> 43701 <sonic-event-additional-status 43702 visibility="public" 43703 variant="ghost" 43704 size="lg" 43705 class="flex mt-4 flex-wrap gap-3" 43706 ></sonic-event-additional-status> 43707 <sonic-event-scheduled-status size="sm"></sonic-event-scheduled-status> 43708 </div> 43709 43710 <sonic-prices-form 43711 item_id=${this.id || ""} 43712 buttonType="primary" 43713 formType="buttons" 43714 type="giftcard" 43715 noPriceName 43716 size="sm" 43717 class="flex-grow" 43718 ></sonic-prices-form> 43719 </div> 43720 </div> 43721 </div> 43722 `; 43723 } 43724 renderMenu() { 43725 const actions = [ProductActionsEnum.EDIT]; 43726 return b$1`<sonic-product-actions size="sm" .actions=${actions}></sonic-product-actions>`; 43727 } 43728 }; 43729 Giftcard.styles = [tailwind]; 43730 __decorateClass$1Z([ 43731 c({ context: appType, subscribe: true }), 43732 r$5() 43733 ], Giftcard.prototype, "appType", 2); 43734 Giftcard = __decorateClass$1Z([ 43735 t$3("sonic-giftcard") 43736 ], Giftcard); 43737 var __defProp$1W = Object.defineProperty; 43738 var __getOwnPropDesc$1Y = Object.getOwnPropertyDescriptor; 43739 var __decorateClass$1Y = (decorators, target, key, kind) => { 43740 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1Y(target, key) : target; 43741 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43742 if (decorator = decorators[i2]) 43743 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43744 if (kind && result) __defProp$1W(target, key, result); 43745 return result; 43746 }; 43747 const tagName$1e = "sonic-giftcards"; 43748 let SonicGiftcards = class extends Subscriber$1(i$6) { 43749 constructor() { 43750 super(...arguments); 43751 this.displayTitle = false;
43752 this.displayText = false; 43753 this.smallTitle = false; 43754 } 43755 render() { 43756 const endPoint = entityEndPoint({ 43757 entityType: EntityType.Giftcard, 43758 accessParams: this.accessParams, 43759 next: true, 43760 view: entityView.full 43761 }); 43762 return b$1`<sonic-page-layout 43763 pageTitle=${t("module_giftcards_title")} 43764 pageText=${t("message_front_cartes_cadeaux")} 43765 ?smallTitle=${this.smallTitle} 43766 ?displayTitle=${this.displayTitle} 43767 ?displayText=${this.displayText} 43768 > 43769 <div class="@container"> 43770 <sonic-list 43771 loader="inline" 43772 key="data" 43773 fetch 43774 dataProvider=${endPoint} 43775 class="grid grid-cols-1 @[1500px]:grid-cols-2 gap-4" 43776 .items=${() => b$1`<sonic-giftcard></sonic-giftcard>`} 43777 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 43778 > 43779 </sonic-list> 43780 </div> 43781 </sonic-page-layout>`; 43782 } 43783 }; 43784 SonicGiftcards.styles = [ 43785 tailwind, 43786 i$9` 43787 :host { 43788 display: block; 43789 } 43790 ` 43791 ]; 43792 __decorateClass$1Y([ 43793 n$5({ type: Boolean }) 43794 ], SonicGiftcards.prototype, "displayTitle", 2); 43795 __decorateClass$1Y([ 43796 n$5({ type: Boolean }) 43797 ], SonicGiftcards.prototype, "displayText", 2); 43798 __decorateClass$1Y([ 43799 n$5({ type: Boolean }) 43800 ], SonicGiftcards.prototype, "smallTitle", 2); 43801 __decorateClass$1Y([ 43802 c({ context: accessParamsContext, subscribe: true }), 43803 n$5({ type: Object }) 43804 ], SonicGiftcards.prototype, "accessParams", 2); 43805 SonicGiftcards = __decorateClass$1Y([ 43806 t$3(tagName$1e) 43807 ], SonicGiftcards); 43808 var __defProp$1V = Object.defineProperty; 43809 var __getOwnPropDesc$1X = Object.getOwnPropertyDescriptor; 43810 var __decorateClass$1X = (decorators, target, key, kind) => { 43811 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1X(target, key) : target; 43812 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43813 if (decorator = decorators[i2]) 43814 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43815 if (kind && result) __defProp$1V(target, key, result); 43816 return result; 43817 }; 43818 let SonicCartIcon = class extends i$6 { 43819 onSlotChange(e2) { 43820 const _isSlotEmpty = e2.target.assignedNodes().length === 0; 43821 if (!_isSlotEmpty) { 43822 e2.target.setAttribute("slot", "icon"); 43823 } else { 43824 e2.target.removeAttribute("slot"); 43825 } 43826 } 43827 render() { 43828 return b$1`<sonic-reservation-icon 43829 size="${o$4(this.size)}" 43830 dataProvider="cart/current" 43831 subDataProvider="data" 43832 > 43833 <slot name="icon" @slotchange=${this.onSlotChange}></slot> 43834 </sonic-reservation-icon>`; 43835 } 43836 }; 43837 SonicCartIcon.styles = [ 43838 i$9` 43839 :host { 43840 display: inline-flex; 43841 } 43842 ` 43843 ]; 43844 __decorateClass$1X([ 43845 n$5({ type: String }) 43846 ], SonicCartIcon.prototype, "size", 2); 43847 SonicCartIcon = __decorateClass$1X([ 43848 t$3("sonic-cart-icon"), 43849 awaitConnectedAncestors(APP_TAG_SELECTOR) 43850 ], SonicCartIcon); 43851 var __defProp$1U = Object.defineProperty; 43852 var __getOwnPropDesc$1W = Object.getOwnPropertyDescriptor; 43853 var __decorateClass$1W = (decorators, target, key, kind) => { 43854 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1W(target, key) : target; 43855 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43856 if (decorator = decorators[i2]) 43857 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43858 if (kind && result) __defProp$1U(target, key, result); 43859 return result; 43860 }; 43861 let SonicEventStoreContent = class extends Subscriber$1(i$6) { 43862 constructor() { 43863 super(...arguments); 43864 this.dataProviderExpression = "sessions?next=1&limit=$limit&offset=$offset"; 43865 this.formDataProvider = "eventFrontFilters"; 43866 this.displayCart = false; 43867 this.formType = "buttons"; 43868 this.cartProvider = "cart/current"; 43869 this.observer = new IntersectionObserver(([e2]) => e2.target.classList.toggle("isSticky", e2.intersectionRatio < 1), { 43870 threshold: [1] 43871 }); 43872 } 43873 updated(_changedProperties) { 43874 if (!this.formContainer) { 43875 this.observer.disconnect(); 43876 } else { 43877 this.observer.observe(this.formContainer); 43878 } 43879 super.updated(_changedProperties); 43880 } 43881 willUpdate(_changedProperties) { 43882 const searchParams = new URLSearchParams(); 43883 this.activity?.forEach((id) => { 43884 searchParams.append("ids_activity[]", id); 43885 }); 43886 this.category?.forEach((id) => { 43887 searchParams.append("ids_category[]", id); 43888 }); 43889 if (this.agendaId) { 43890 searchParams.append("ids_agenda", this.agendaId.toString()); 43891 } 43892 this.dataProviderExpression = entityEndPoint({ 43893 entityType: EntityType.Event, 43894 isQueue: true, 43895 next: true, 43896 accessParams: this.accessParams, 43897 customSearchParams: searchParams, 43898 view: entityView.essential 43899 }); 43900 super.willUpdate(_changedProperties); 43901 } 43902 disconnectedCallback() { 43903 this.observer.disconnect(); 43904 super.disconnectedCallback(); 43905 } 43906 openCart() { 43907 Modal.create({ 43908 content: b$1` 43909 <sonic-cart-full 43910 style="margin-top: 1rem !important;" 43911 cartProvider="${this.cartProvider}" 43912 dataProvider="${this.cartProvider}" 43913 subdataprovider="data" 43914 ></sonic-cart-full> 43915 ` 43916 }); 43917 } 43918 render() { 43919 const displayCartClassLayout = this.displayCart ? "grid grid-cols-1 @4xl:grid-cols-[minmax(0,2fr)_minmax(0,1.2fr)
43919] @5xl:grid-cols-[minmax(0,2fr)_minmax(0,1fr)] gap-8 relative z-[0]" : ""; 43920 return b$1` 43921 <div class="@container"> 43922 <div class="${displayCartClassLayout}"> 43923 <div> 43924 <slot name="intro"></slot> 43925 <div 43926 id="formContainer" 43927 class="flex gap-x-4 sticky top-[-1px] py-2 mb-5 shadow-[0_0_0_2px_var(--sc-base)] z-[1] pr-5" 43928 > 43929 ${this.appType === "counter" ? b$1`<sonic-event-selection-filters 43930 formDataProvider="${this.formDataProvider}" 43931 class=" block min-w-0 w-full " 43932 category 43933 activity 43934 range 43935 onlyFilter 43936 canFilterDays 43937 ></sonic-event-selection-filters>` : A$1} 43938 ${this.appType === "customer" ? b$1`<sonic-form-event-filter 43939 formDataProvider="${this.formDataProvider}" 43940 ?filterCategory=${!this.category?.length} 43941 class="block max-w-[40rem] w-full z-10 min-w-0" 43942 ></sonic-form-event-filter>` : A$1} 43943 43944 <slot name="formSuffix"></slot> 43945 43946 ${this.displayCart ? b$1` 43947 <sonic-button 43948 @click=${() => this.openCart()} 43949 class="@4xl:hidden ml-auto" 43950 variant="default" 43951 shape="circle" 43952 size="lg" 43953 icon 43954 > 43955 <sonic-reservation-icon 43956 dataProvider="${this.cartProvider}" 43957 subDataProvider="data" 43958 ></sonic-reservation-icon> 43959 </sonic-button> 43960 ` : A$1} 43961 </div> 43962 43963 <div> 43964 <sonic-queue 43965 dataProviderExpression="${this.dataProviderExpression}" 43966 key="data" 43967 limit="8" 43968 targetRequestDuration="1000" 43969 dataProvider="${this.formDataProvider + "searchResults"}" 43970 dataFilterProvider="${this.formDataProvider}" 43971 .items=${() => b$1`<sonic-event-store-item 43972 .queueFormDataProvider=${this.formDataProvider} 43973 showAllSessionsButton 43974 formType=${this.formType} 43975 class="mb-4 block" 43976 ></sonic-event-store-item>`} 43977 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 43978 > 43979 </sonic-queue> 43980 </div> 43981 </div> 43982 43983 ${this.displayCart ? b$1`<div class="hidden @4xl:block pt-3"> 43984 <sonic-cart-full 43985 cartProvider="${this.cartProvider}" 43986 dataProvider="${this.cartProvider}" 43987 subdataprovider="data" 43988 lazyrendering 43989 layout="condensed" 43990 class="sticky top-3" 43991 maxHeight 43992 ></sonic-cart-full> 43993 </div>` : A$1} 43994 </div> 43995 </div> 43996 `; 43997 } 43998 }; 43999 SonicEventStoreContent.styles = [ 44000 tailwind, 44001 i$9` 44002 .isSticky { 44003 background-color: var(--sc-base); 44004 box-shadow: 0 1.5rem 1rem -1rem rgb(0 0 0 / 0.07); 44005 } 44006 ` 44007 ]; 44008 __decorateClass$1W([ 44009 r$5() 44010 ], SonicEventStoreContent.prototype, "dataProviderExpression", 2); 44011 __decorateClass$1W([ 44012 e$7("#formContainer") 44013 ], SonicEventStoreContent.prototype, "formContainer", 2); 44014 __decorateClass$1W([ 44015 n$5({ type: Array }) 44016 ], SonicEventStoreContent.prototype, "activity", 2); 44017 __decorateClass$1W([ 44018 n$5({ type: Array }) 44019 ], SonicEventStoreContent.prototype, "category", 2); 44020 __decorateClass$1W([ 44021 n$5({ type: Number }) 44022 ], SonicEventStoreContent.prototype, "agendaId", 2); 44023 __decorateClass$1W([ 44024 n$5({ type: String }) 44025 ], SonicEventStoreContent.prototype, "formDataProvider", 2); 44026 __decorateClass$1W([ 44027 n$5({ type: Boolean }) 44028 ], SonicEventStoreContent.prototype, "displayCart", 2); 44029 __decorateClass$1W([ 44030 n$5({ type: String }) 44031 ], SonicEventStoreContent.prototype, "formType", 2); 44032 __decorateClass$1W([ 44033 c({ context: accessParamsContext, subscribe: true }), 44034 e$2({ context: accessParamsContext }), 44035 n$5({ type: Object }) 44036 ], SonicEventStoreContent.prototype, "accessParams", 2); 44037 __decorateClass$1W([ 44038 n$5({ type: String }) 44039 ], SonicEventStoreContent.prototype, "cartProvider", 2); 44040 __decorateClass$1W([ 44041 c({ context: appType }), 44042 n$5({ type: String }) 44043 ], SonicEventStoreContent.prototype, "appType", 2); 44044 SonicEventStoreContent = __decorateClass$1W([ 44045 t$3("sonic-event-store-content") 44046 ], SonicEventStoreContent); 44047 var __defProp$1T = Object.defineProperty; 44048 var __getOwnPropDesc$1V = Object.getOwnPropertyDescriptor; 44049 var __decorateClass$1V = (decorators, target, key, kind) => { 44050 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1V(target, key) : target; 44051 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44052 if (decorator = decorators[i2]) 44053 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44054 if (kind && result) __defProp$1T(target, key, result); 44055 return result; 44056 }; 44057 const ENTITY_INFO = { 44058 [EntityType.Subscribe]: { text: t("onglet_home_abonnements"), icon: "i
44058d-card" }, 44059 [EntityType.Giftcard]: { text: t("LIB_cartes_cadeaux"), icon: "gift-card" }, 44060 [EntityType.Merch]: { text: t("module_shop_title"), icon: "bags-shopping" }, 44061 [EntityType.Event]: { text: t("LIB_events"), icon: "calendar-day" } 44062 }; 44063 let SonicCartAddEntity = class extends i$6 { 44064 constructor() { 44065 super(...arguments); 44066 this.isEnabled = false; 44067 this._entityInfo = { 44068 text: t("LIB_add"), 44069 icon: "calendar-day" 44070 }; 44071 } 44072 connectedCallback() { 44073 if (!this.cartProvider) { 44074 this.cartProvider = HTML$1.getAncestorAttributeValue(this, "cartProvider") || "cart/current"; 44075 } 44076 super.connectedCallback(); 44077 } 44078 willUpdate(_changedProperties) { 44079 if (!this.cartProvider) { 44080 this.cartProvider = HTML$1.getAncestorAttributeValue(this, "cartProvider") || "cart/current"; 44081 } 44082 this.isEnabled = this.enableButton(this.entityType); 44083 if (_changedProperties.has("entityType") && this.entityType) { 44084 const info = ENTITY_INFO[this.entityType]; 44085 if (info) this._entityInfo = info; 44086 } 44087 super.willUpdate(_changedProperties); 44088 } 44089 render() { 44090 if (!this.isEnabled) return A$1; 44091 return b$1`<sonic-button 44092 .shape="${this.shape || "block"}" 44093 align="${this.align}" 44094 variant="${this.variant}" 44095 .size="${this.size}" 44096 type="${o$4(this.type)}" 44097 autoActive="disabled" 44098 @click=${() => this.addEntityModal(this.cartProvider || "cart/current")} 44099 > 44100 <slot name="icon"> 44101 <span class="relative"> 44102 <sonic-icon 44103 library="custom" 44104 name="circle-plus" 44105 prefix="solid" 44106 size="sm" 44107 class="absolute -bottom-1 -left-[.7em]" 44108 ></sonic-icon 44109 ><sonic-icon library="custom" name=${this._entityInfo.icon}></sonic-icon> 44110 </span> 44111 </slot> 44112 ${this._entityInfo.text} 44113 </sonic-button>`; 44114 } 44115 enableButton(entityType) { 44116 const mod = this.settings?.modules; 44117 const isCounter = this.appType === "counter"; 44118 const access = (module, counterBypass = false) => isCounter ? Boolean(counterBypass || module?.adminAccess) : Boolean(module?.access); 44119 switch (entityType) { 44120 case EntityType.Giftcard: 44121 return access(mod?.giftcards); 44122 case EntityType.Merch: 44123 return access(mod?.shop); 44124 case EntityType.Subscribe: 44125 return access(mod?.subscription); 44126 case EntityType.Event: 44127 return access(mod?.agenda, true); 44128 default: 44129 return false; 44130 } 44131 } 44132 addEntityModal(cartProvider) { 44133 if (this.entityType === EntityType.Subscribe) { 44134 this.addSubscriptionModal(cartProvider); 44135 } else if (this.entityType === EntityType.Giftcard) { 44136 this.addGiftcardModal(cartProvider); 44137 } else if (this.entityType === EntityType.Merch) { 44138 this.addMerchModal(cartProvider); 44139 } else { 44140 this.addEventModal(cartProvider); 44141 } 44142 } 44143 addEventModal(cartProvider) { 44144 Modal.create({ 44145 title: ENTITY_INFO[EntityType.Event]?.text, 44146 content: withAccessParams( 44147 this.accessParams, 44148 b$1`<sonic-event-store-content 44149 cartProvider=${cartProvider} 44150 class="block w-full" 44151 formDataProvider="cartAddEventsFilters" 44152 ></sonic-event-store-content>` 44153 ), 44154 width: "77rem", 44155 maxWidth: "90vw", 44156 maxHeight: "92svh", 44157 height: "92svh", 44158 removeOnHide: true 44159 }); 44160 } 44161 addSubscriptionModal(cartProvider) { 44162 Modal.create({ 44163 title: ENTITY_INFO[EntityType.Subscribe]?.text, 44164 content: withAccessParams( 44165 this.accessParams, 44166 b$1`<sonic-subscription cartProvider=${cartProvider} noHelp class="block w-full" v2></sonic-subscription>` 44167 ), 44168 maxWidth: "60rem", 44169 maxHeight: "92svh", 44170 removeOnHide: true 44171 }); 44172 } 44173 addGiftcardModal(cartProvider) { 44174 Modal.create({ 44175 title: ENTITY_INFO[EntityType.Giftcard]?.text, 44176 content: withAccessParams( 44177 this.accessParams, 44178 b$1`<sonic-giftcards cartProvider=${cartProvider} class="block w-full"></sonic-giftcards>` 44179 ), 44180 maxWidth: "60rem", 44181 maxHeight: "92svh", 44182 removeOnHide: true 44183 }); 44184 } 44185 addMerchModal(cartProvider) { 44186 Modal.create({ 44187 title: ENTITY_INFO[EntityType.Merch]?.text, 44188 content: withAccessParams( 44189 this.accessParams, 44190 b$1`<sonic-shop 44191 storeMode 44192 cartProvider=${cartProvider} 44193 .filterFormDataProvider=${"cartAddMerchFilters"} 44194 class="block w-full" 44195 noRouting 44196 ></sonic-shop>` 44197 ), 44198 maxWidth: "60rem", 44199 maxHeight: "92svh", 44200 height: "92svh", 44201 removeOnHide: true 44202 }); 44203 } 44204 }; 44205 SonicCartAddEntity.styles = [tailwind]; 44206 __decorateClass$1V([ 44207 n$5({ type: String }) 44208 ], SonicCartAddEntity.prototype, "cartProvider", 2); 44209 __decorateClass$1V([ 44210 n$5({ type: String }) 44211 ], SonicCartAddEntity.prototype, "entityType", 2); 44212 __decorateClass$1V([ 44213 n$5({ type: String }) 44214 ], SonicCartAddEntity.prototype, "size", 2); 44215 __decorateClass$1V([ 44216 n$5({ type: String }) 44217 ], SonicCartAddEntity.prototype, "type", 2); 44218 __decorateClass$1V([ 44219 n$5({ type: String }) 44220 ], SonicCartAddEntity.prototype, "shape", 2); 44221 __decorateClass$1V([ 44222 n$5({ type: String }) 44223 ], SonicCartAddEntity.prototype, "variant", 2); 44224 __decorateClass$1V([ 44225 n$5({ type: String }) 44226 ], SonicCartAddEntity.prototype, "customText", 2); 44227 __decorateClass$1V([ 44228 n$5({ type: String }) 44229 ], SonicCartAddEntity.prototype, "align", 2); 44230 __decorateClass$1V([ 44231 bind$1("settings"), 44232 n$5({ type: Object }) 44233 ], SonicCartAddEntity.prototype, "settings", 2); 44234 __decorateClass$1V([ 44235 c({ context: cartTypeContext, subscribe: true }), 44236 n$5({ type: String }) 44237 ], SonicCartAddEntity.prototype, "cartType", 2); 44238 __decorateClass$1V([ 44239 c({ context: accessParamsContext, subscribe: true }), 44240 n$5({ type: Object }) 44241 ], SonicCartAddEntity.prototype, "accessParams", 2); 44242 __decorateClass$1V([ 44243 c({ context: appType, subscribe: true }), 44244 n$5({ type: String }) 44245 ], SonicCartAddEntity.prototype, "appType", 2); 44246 __decorateClass$1V([ 44247 r$5() 44248 ], SonicCartAddEntity.prototype, "isEnabled", 2); 44249 __decorateClass$1V([ 44250 r$5()
44251 ], SonicCartAddEntity.prototype, "_entityInfo", 2); 44252 SonicCartAddEntity = __decorateClass$1V([ 44253 t$3("sonic-cart-add-entity") 44254 ], SonicCartAddEntity); 44255 var __defProp$1S = Object.defineProperty; 44256 var __getOwnPropDesc$1U = Object.getOwnPropertyDescriptor; 44257 var __decorateClass$1U = (decorators, target, key, kind) => { 44258 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1U(target, key) : target; 44259 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44260 if (decorator = decorators[i2]) 44261 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44262 if (kind && result) __defProp$1S(target, key, result); 44263 return result; 44264 }; 44265 const tagName$1d = "sonic-cart-payment-buttons"; 44266 let SonicComponent$e = class SonicComponent extends Subscriber$1(i$6) { 44267 constructor() { 44268 super(...arguments); 44269 this.payments_methods = []; 44270 this.resaAndCredit = []; 44271 this.paymentsWithoutResaAndCredit = []; 44272 this.canCheckout = false; 44273 this.quantity = 0; 44274 this.align = "center"; 44275 this.layout = "default"; 44276 this.displayShowAllPayments = false; 44277 this.showAllPayments = false; 44278 this.errorText = t("cart_payement_buttons_error"); 44279 this._resizeController = new h$1(this, {}); 44280 this.cartProvider = ""; 44281 } 44282 connectedCallback() { 44283 if (!this.cartProvider) { 44284 this.cartProvider = this.getAncestorAttributeValue("cartProvider"); 44285 } 44286 super.connectedCallback(); 44287 } 44288 willUpdate(_changedProperties) { 44289 switch (_changedProperties.has("props") && this.props?.cartType) { 44290 case "reservation": 44291 this.errorText = t("cart_payement_buttons_error_reservation"); 44292 break; 44293 case "cart": 44294 this.errorText = t("cart_payement_buttons_error"); 44295 break; 44296 } 44297 if (_changedProperties.has("payments_methods")) { 44298 this.resaAndCredit = this.payments_methods.filter((payment) => payment.code === "resa" || payment.code === "credit").sort((a2, b2) => { 44299 if (a2.code === "resa") return -1; 44300 if (b2.code === "resa") return 1; 44301 if (a2.code === "credit") return -1; 44302 if (b2.code === "credit") return 1; 44303 return 0; 44304 }); 44305 let paymentsWithoutResaAndCredit = this.payments_methods.filter( 44306 (payment) => payment.code !== "resa" && payment.code !== "credit" 44307 ); 44308 const maxToDisplay = 6; 44309 if (!this.showAllPayments && paymentsWithoutResaAndCredit.length > maxToDisplay) { 44310 paymentsWithoutResaAndCredit = paymentsWithoutResaAndCredit.slice(0, maxToDisplay); 44311 this.displayShowAllPayments = true; 44312 } else { 44313 this.displayShowAllPayments = false; 44314 } 44315 this.paymentsWithoutResaAndCredit = paymentsWithoutResaAndCredit; 44316 } 44317 super.willUpdate(_changedProperties); 44318 } 44319 // getCheckoutPath 44320 getCheckoutPath(payment) { 44321 const cart_id = this.props?.id; 44322 const params = {}; 44323 if (payment) { 44324 params.payment_id = payment.id; 44325 } 44326 if (cart_id) { 44327 params.cart_id = cart_id; 44328 } 44329 let route2 = appRoute("checkout").query(params); 44330 if (payment) { 44331 route2 = route2.fill(payment); 44332 } 44333 return route2; 44334 } 44335 render() { 44336 const isXsContainer = this.clientWidth < 200; 44337 const hasResaOrCredit = this.resaAndCredit.length; 44338 const messages2 = this.props?.messages || []; 44339 const messagesMarkup = b$1` 44340 ${messages2.map( 44341 (message) => b$1` 44342 <sonic-alert status="${message.status || "warning"}" ?background=${!isXsContainer} size="sm" class="mb-2"> 44343 ${o$6(message.content)} 44344 </sonic-alert> 44345 ` 44346 )} 44347 `; 44348 if (!this.canCheckout && !this.quantity) return A$1; 44349 if (!this.canCheckout && this.quantity) 44350 return b$1` 44351 ${messagesMarkup} 44352 <sonic-alert status="error" ?background=${!isXsContainer} size="sm"> ${this.errorText} </sonic-alert> 44353 ${this.resaAndCreditMarkup(true)} 44354 `; 44355 const paymentCount = this.paymentsWithoutResaAndCredit.length; 44356 const hasOnePaymentMethod = paymentCount === 1; 44357 if (!this.payments_methods.length) { 44358 return A$1; 44359 } 44360 if (this.appType === "customer") { 44361 return b$1` 44362 ${messagesMarkup} 44363 <sonic-button 44364 type="success" 44365 href=${this.getCheckoutPath().toString()} 44366 size="lg" 44367 align="center" 44368 shape="block" 44369 ?disabled=${!this.canCheckout} 44370 autoActive="disabled" 44371 class="mx-auto" 44372 ><sonic-icon name="arrow-right" library="custom"></sonic-icon>
44373 <span class="font-bold">${t("commander")} </span></sonic-button 44374 > 44375 `; 44376 } 44377 return b$1`<div class="@container"> 44378 ${messagesMarkup} 44379 ${this.paymentsWithoutResaAndCredit.length > 0 ? b$1` 44380 <div 44381 class="grid grid-cols-1 gap-1 ${paymentCount >= 2 ? " @sm:grid-cols-2" : ""} ${paymentCount >= 3 ? "@xl:grid-cols-3" : ""} " 44382 > 44383 ${this.paymentsWithoutResaAndCredit.map((payment, index) => { 44384 let type = "default"; 44385 if (index < 4) { 44386 type = "neutral"; 44387 } 44388 return b$1`<sonic-button 44389 type="${type}" 44390 href=${this.getCheckoutPath(payment).toString()} 44391 size="${o$4(this.size)}" 44392 shape="block" 44393 minWidth="8rem" 44394 autoActive="disabled" 44395 align="left" 44396 ?disabled=${!this.canCheckout} 44397 >${hasOnePaymentMethod ? b$1`<sonic-icon name="arrow-right" library="custom" slot="prefix"></sonic-icon> ${t("commander")}` : b$1`${renderPaymentIcon$1(payment.title)} 44398 <span class="${index < 3 ? "font-bold" : ""} ">${payment.title}</span>`}</sonic-button 44399 >`; 44400 })} 44401 ${this.displayShowAllPayments ? b$1` 44402 <sonic-button 44403 @click=${() => showAllPaymentsModal(this.cartProvider, this.appType)} 44404 shape="block" 44405 size="${o$4(this.size)}" 44406 align="left" 44407 class="col-span-full" 44408 > 44409 <sonic-icon size="lg" name="ellipsis" library="custom" slot="prefix"></sonic-icon> 44410 ${t("LIB_voir_tout")}</sonic-button 44411 > 44412 ` : A$1} 44413 </div> 44414 ` : A$1} 44415 ${hasResaOrCredit ? this.resaAndCreditMarkup() : A$1} 44416 </div>`; 44417 } 44418 resaAndCreditMarkup(resaOnly = false) { 44419 return b$1` <div 44420 class="pt-4 grid grid-cols-1 gap-1 ${this.resaAndCredit.length == 2 ? " @sm:grid-cols-2" : ""} " 44421 > 44422 ${this.resaAndCredit.map((payment) => { 44423 let type = "default"; 44424 let variant = "outline"; 44425 if (payment.code === "resa") { 44426 type = "warning"; 44427 variant = "default"; 44428 } else if (payment.code === "credit") { 44429 type = "info"; 44430 } 44431 const enableButton = this.canCheckout || payment.code === "resa"; 44432 if (resaOnly && payment.code !== "resa") return A$1; 44433 return b$1`<sonic-button 44434 type="${type}" 44435 href=${this.getCheckoutPath(payment).toString()} 44436 size="${o$4(this.size)}" 44437 shape="block" 44438 minWidth="8rem" 44439 autoActive="disabled" 44440 variant="${variant}" 44441 align="left" 44442 ?disabled=${!enableButton} 44443 >${renderPaymentIcon$1(payment.title)} 44444 <div>${payment.title}</div></sonic-button 44445 >`; 44446 })} 44447 </div>`; 44448 } 44449 }; 44450 SonicComponent$e.styles = [ 44451 tailwind, 44452 i$9` 44453 :host { 44454 width: 100%; 44455 display: block; 44456 } 44457 ` 44458 ]; 44459 __decorateClass$1U([ 44460 n$5({ type: Array }) 44461 ], SonicComponent$e.prototype, "payments_methods", 2); 44462 __decorateClass$1U([ 44463 r$5() 44464 ], SonicComponent$e.prototype, "resaAndCredit", 2); 44465 __decorateClass$1U([ 44466 r$5() 44467 ], SonicComponent$e.prototype, "paymentsWithoutResaAndCredit", 2); 44468 __decorateClass$1U([ 44469 n$5({ type: Boolean }) 44470 ], SonicComponent$e.prototype, "canCheckout", 2); 44471 __decorateClass$1U([ 44472 n$5({ type: Number }) 44473 ], SonicComponent$e.prototype, "quantity", 2); 44474 __decorateClass$1U([ 44475 n$5({ type: String }) 44476 ], SonicComponent$e.prototype, "size", 2); 44477 __decorateClass$1U([ 44478 n$5({ type: String }) 44479 ], SonicComponent$e.prototype, "align", 2); 44480 __decorateClass$1U([ 44481 n$5({ type: String }) 44482 ], SonicComponent$e.prototype, "layout", 2); 44483 __decorateClass$1U([ 44484 r$5() 44485 ], SonicComponent$e.prototype, "displayShowAllPayments", 2); 44486 __decorateClass$1U([ 44487 n$5({ type: Boolean }) 44488 ], SonicComponent$e.prototype, "showAllPayments", 2); 44489 __decorateClass$1U([ 44490 r$5() 44491 ], SonicComponent$e.prototype, "errorText", 2); 44492 __decorateClass$1U([ 44493 n$5() 44494 ], SonicComponent$e.prototype, "cartProvider", 2); 44495 __decorateClass$1U([ 44496 c({ context: appType, subscribe: true }), 44497 r$5() 44498 ], SonicComponent$e.prototype, "appType", 2); 44499 SonicComponent$e = __decorateClass$1U([ 44500 t$3(tagName$1d) 44501 ], SonicComponent$e); 44502 function renderPaymentIcon$1(text) { 44503 if (!text) return; 44504 const icons2 = { 44505 "cb/": "credit-card", 44506 cb: "credit-card", 44507 cheque: "money-check-dollar", 44508 espece: "money-bill-wave", 44509 exonere: "hand-peace", 44510 differe: "clock", 44511 passculture: "graduation-cap",
44512 compteclient: "wallet", 44513 virement: "arrow-right-arrow-left", 44514 reservation: "badge-check", 44515 sepa: "pen-nib", 44516 facture: "file-lines", 44517 paypal: "paypal", 44518 commander: "arrow-right", 44519 commande: "memo-circle-check", 44520 wonder: "sparkles", 44521 yep: "y", 44522 tourisme: "map-location", 44523 defaultIcon: "square-arrow-right" 44524 }; 44525 const cleanText = text.normalize("NFD").replaceAll(" ", "").replace(/[\u0300-\u036f]/g, "").toLowerCase(); 44526 const iconNamekey = Object.keys(icons2).find((key) => cleanText.includes(key)); 44527 const iconName = icons2[iconNamekey || "defaultIcon"]; 44528 return b$1`<sonic-icon slot="prefix" size="lg" name="${iconName}" library="custom"></sonic-icon>`; 44529 } 44530 var __defProp$1R = Object.defineProperty; 44531 var __getOwnPropDesc$1T = Object.getOwnPropertyDescriptor; 44532 var __decorateClass$1T = (decorators, target, key, kind) => { 44533 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1T(target, key) : target; 44534 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44535 if (decorator = decorators[i2]) 44536 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44537 if (kind && result) __defProp$1R(target, key, result); 44538 return result; 44539 }; 44540 let CartSummary = class extends Subscriber$1(i$6) { 44541 constructor() { 44542 super(...arguments); 44543 this.items = null; 44544 this.entities = null; 44545 this.quantity = 0; 44546 this.displayRemainingTime = false; 44547 this.displayTotal = false; 44548 this.noText = false; 44549 this.canEditSubscription = false; 44550 this.countEvents = 0; 44551 this.countTickets = 0; 44552 this.countGiftcards = 0; 44553 this.countSubscription = 0; 44554 this.countAdditionnalProduct = 0; 44555 this.countMerchs = 0; 44556 this.hasSeats = false; 44557 this._cartProvider = ""; 44558 this.mode = "default"; 44559 this._countUniqueEntityTypes = 0; 44560 } 44561 connectedCallback() { 44562 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 44563 super.connectedCallback(); 44564 } 44565 willUpdate(_changedProperties) { 44566 if (_changedProperties.has("items") || _changedProperties.has("entities")) { 44567 if (this.items && this.entities?.length) { 44568 let countUniqueEvents = 0; 44569 let countTickets = 0; 44570 let countGiftcards = 0; 44571 let countSubscription = 0; 44572 let countAdditionnalProduct = 0; 44573 let countMerchs = 0; 44574 countUniqueEvents = new Set( 44575 this.items.filter((item) => item.entity_type === EntityType.Event).map((item) => item.entity_id) 44576 ).size; 44577 this.items.forEach((item) => { 44578 switch (item.entity_type) { 44579 case EntityType.Event: 44580 countTickets += item.quantity || 1; 44581 break; 44582 case EntityType.Giftcard: 44583 countGiftcards++; 44584 break; 44585 case EntityType.Subscribe: 44586 countSubscription++; 44587 break; 44588 case EntityType.AdditionalProduct: 44589 countAdditionnalProduct++; 44590 break; 44591 case EntityType.Merch: 44592 countMerchs++; 44593 } 44594 }); 44595 this.countEvents = countUniqueEvents; 44596 this.countTickets = countTickets; 44597 this.countGiftcards = countGiftcards; 44598 this.countSubscription = countSubscription; 44599 this.countAdditionnalProduct = countAdditionnalProduct; 44600 this.countMerchs = countMerchs; 44601 this._countUniqueEntityTypes = new Set(this.items.map((item) => item.entity_type)).size; 44602 this.hasSeats = this.items?.some((item) => item.entity_type === EntityType.Event && item.seat?.id); 44603 } 44604 } 44605 super.willUpdate(_changedProperties); 44606 } 44607 render() { 44608 if (!this.items) { 44609 return A$1; 44610 } 44611 return b$1`<div class="@container"> 44612 <div class=" flex flex-wrap gap-x-3 @lg:gap-x-3 @xl:gap-x-4 gap-y-1 leading-none"> 44613 <slot name="prefix"></slot> 44614 44615 ${this.displayTotal ? b$1`<sonic-badge type="danger" size="sm" class="font-bold"> ${this.quantity}</sonic-badge>` : A$1} 44616 ${this.itemSummary({ 44617 title: t("LIB_event"),
44618 titlePlural: t("LIB_events"), 44619 icon: "calendar-day", 44620 count: this.countEvents 44621 })} 44622 ${this.itemSummary({ 44623 title: t("LIB_cartes_cadeaux"), 44624 titlePlural: t("LIB_cartes_cadeaux"), 44625 icon: "gift-card", 44626 count: this.countGiftcards 44627 })} 44628 ${this.itemSummary({ 44629 title: t("LIB_merch"), 44630 titlePlural: t("LIB_merchs"), 44631 icon: "bags-shopping", 44632 count: this.countMerchs 44633 })} 44634 ${this.itemSummary({ title: t("billet"), titlePlural: t("billets"), icon: "ticket", count: this.countTickets })} 44635 ${this.itemSummary({ 44636 title: t("LIB_produit_additionnel"), 44637 titlePlural: t("LIB_produits_additionnels"), 44638 icon: "circle-plus", 44639 count: this.countAdditionnalProduct 44640 })} 44641 ${this.itemSummary({ 44642 title: t("abonnement"), 44643 titlePlural: t("abonnement"), 44644 icon: "id-card", 44645 count: this.countSubscription 44646 })} 44647 ${this.renderSeatsSummary()} 44648 44649 <!-- TODO: add owners summary 44650 <sonic-cart-owners></sonic-cart-owners>--> 44651 44652 ${this.displayRemainingTime ? b$1`<sonic-cart-remaining-time class="font-bold text-center inline-flex "></sonic-cart-remaining-time>` : A$1} 44653 </div> 44654 </div>`; 44655 } 44656 itemSummary(options) { 44657 const { title, titlePlural, icon: icon2, count } = options; 44658 if (!count) { 44659 return A$1; 44660 } 44661 let textMarkup; 44662 if (this.noText) { 44663 textMarkup = A$1; 44664 } else { 44665 textMarkup = count > 1 ? b$1`${titlePlural}` : b$1`${title}`; 44666 } 44667 let classDisplayText = "@xs:inline-block"; 44668 if (this._countUniqueEntityTypes > 2) { 44669 classDisplayText = "@md:inline-block"; 44670 } else if (this._countUniqueEntityTypes > 3) { 44671 classDisplayText = "@lg:inline-block"; 44672 } else if (this._countUniqueEntityTypes > 4) { 44673 classDisplayText = "@xl:inline-block"; 44674 } 44675 return b$1` 44676 <div class="lowercase flex items-center gap-x-1 min-h-[1.1em]"> 44677 <sonic-icon library="custom" name="${icon2}" class="transform -translate-y-[.05em]"></sonic-icon> 44678 <span class="leading-none min-w-[1ch] " 44679 >${count} <span class="hidden ${classDisplayText}">${textMarkup}</span></span 44680 > 44681 </div> 44682 `; 44683 } 44684 renderSeatsSummary() { 44685 if (!this.hasSeats || this.mode !== "default") { 44686 return A$1; 44687 } 44688 return b$1`<sonic-tooltip label="${t("my_seats")}"> 44689 <sonic-button 44690 size="xs" 44691 variant="outline" 44692 class="text-sm" 44693 @click=${() => editSeatsModal({ cartProvider: this._cartProvider })} 44694 > 44695 <sonic-icon library="custom" name="loveseat"></sonic-icon> 44696 <span class="hidden @lg:inline-block">${t("my_seats")}</span> 44697 </sonic-button> 44698 </sonic-tooltip>`; 44699 } 44700 }; 44701 CartSummary.styles = [tailwind]; 44702 __decorateClass$1T([ 44703 n$5({ type: Array }) 44704 ], CartSummary.prototype, "items", 2); 44705 __decorateClass$1T([ 44706 n$5({ type: Array }) 44707 ], CartSummary.prototype, "entities", 2); 44708 __decorateClass$1T([ 44709 n$5({ type: Number }) 44710 ], CartSummary.prototype, "quantity", 2); 44711 __decorateClass$1T([ 44712 n$5({ type: Boolean }) 44713 ], CartSummary.prototype, "displayRemainingTime", 2); 44714 __decorateClass$1T([ 44715 n$5({ type: Boolean }) 44716 ], CartSummary.prototype, "displayTotal", 2); 44717 __decorateClass$1T([ 44718 n$5({ type: Boolean }) 44719 ], CartSummary.prototype, "noText", 2); 44720 __decorateClass$1T([ 44721 n$5({ type: Boolean }) 44722 ], CartSummary.prototype, "canEditSubscription", 2); 44723 __decorateClass$1T([ 44724 r$5() 44725 ], CartSummary.prototype, "countEvents", 2); 44726 __decorateClass$1T([ 44727 r$5() 44728 ], CartSummary.prototype, "countTickets", 2); 44729 __decorateClass$1T([ 44730 r$5() 44731 ], CartSummary.prototype, "countGiftcards", 2); 44732 __decorateClass$1T([ 44733 r$5() 44734 ], CartSummary.prototype, "countSubscription", 2); 44735 __decorateClass$1T([ 44736 r$5() 44737 ], CartSummary.prototype, "countAdditionnalProduct", 2); 44738 __decorateClass$1T([ 44739 r$5() 44740 ], CartSummary.prototype, "countMerchs", 2); 44741 __decorateClass$1T([ 44742 r$5() 44743 ], CartSummary.prototype, "hasSeats", 2); 44744 __decorateClass$1T([ 44745 r$5()
44746 ], CartSummary.prototype, "_cartProvider", 2); 44747 __decorateClass$1T([ 44748 c({ context: modeContext, subscribe: true }), 44749 n$5({ type: String }) 44750 ], CartSummary.prototype, "mode", 2); 44751 __decorateClass$1T([ 44752 r$5() 44753 ], CartSummary.prototype, "_countUniqueEntityTypes", 2); 44754 CartSummary = __decorateClass$1T([ 44755 t$3("sonic-cart-summary") 44756 ], CartSummary); 44757 var __defProp$1Q = Object.defineProperty; 44758 var __getOwnPropDesc$1S = Object.getOwnPropertyDescriptor; 44759 var __decorateClass$1S = (decorators, target, key, kind) => { 44760 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1S(target, key) : target; 44761 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44762 if (decorator = decorators[i2]) 44763 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44764 if (kind && result) __defProp$1Q(target, key, result); 44765 return result; 44766 }; 44767 let ClearCartButton = class extends Subscriber(i$6) { 44768 constructor() { 44769 super(...arguments); 44770 this.loading = false; 44771 this.quantity = null; 44772 } 44773 async clearCart() { 44774 this.loading = true; 44775 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 44776 await Cart.removeItems({ 44777 apiConfiguration: this.getApiConfiguration(), 44778 cartProvider 44779 }); 44780 this.loading = false; 44781 } 44782 render() { 44783 if (this.quantity && this.quantity > 0) { 44784 return b$1` 44785 <sonic-tooltip label=${t("LIB_clear_cart")} placement="left"> 44786 <sonic-button 44787 icon 44788 size="lg" 44789 shape="circle" 44790 variant="ghost" 44791 @click="${this.clearCart}" 44792 ?loading=${this.loading} 44793 ?disabled=${this.loading} 44794 > 44795 <sonic-icon library="custom" name="trash"></sonic-icon> 44796 </sonic-button> 44797 </sonic-tooltip> 44798 `; 44799 } else { 44800 return A$1; 44801 } 44802 } 44803 }; 44804 ClearCartButton.styles = [tailwind]; 44805 __decorateClass$1S([ 44806 n$5({ type: Boolean }) 44807 ], ClearCartButton.prototype, "loading", 2); 44808 __decorateClass$1S([ 44809 n$5({ type: Number }) 44810 ], ClearCartButton.prototype, "quantity", 2); 44811 ClearCartButton = __decorateClass$1S([ 44812 t$3("sonic-clear-cart-btn") 44813 ], ClearCartButton); 44814 var __defProp$1P = Object.defineProperty; 44815 var __getOwnPropDesc$1R = Object.getOwnPropertyDescriptor; 44816 var __decorateClass$1R = (decorators, target, key, kind) => { 44817 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1R(target, key) : target; 44818 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44819 if (decorator = decorators[i2]) 44820 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44821 if (kind && result) __defProp$1P(target, key, result); 44822 return result; 44823 }; 44824 let WaitingCartsLink = class extends Subscriber(i$6) { 44825 constructor() { 44826 super(...arguments); 44827 this.size = "md"; 44828 this.variant = "ghost"; 44829 this.shape = "block"; 44830 } 44831 render() { 44832 if (!this.adminId || !this.waitingCarts) return A$1; 44833 const hasWaitingCarts = !!this.waitingCarts?.data?.length; 44834 const waitingCartText = this.waitingCarts?.total ? `${this.waitingCarts?.total} panier${this.waitingCarts?.total > 1 ? "s" : ""} en attente` : "Aucun panier en attente"; 44835 return b$1` 44836 ${hasWaitingCarts ? b$1` 44837 <sonic-app-link 44838 class="ml-auto relative" 44839 to="carts" 44840 size=${this.size} 44841 type="warning" 44842 .query=${{ "reset-filtres": "1", vendeur: this.adminId }} 44843 variant=${this.variant} 44844 shape="block" 44845 > 44846 <div class="relative inline-block"> 44847 <sonic-icon 44848 class="absolute -top-2 -left-2 text-[11px] animate-pulse rounded-full text-warning " 44849 library="custom" 44850 prefix="solid" 44851 name="clock" 44852 > 44853 </sonic-icon> 44854 <sonic-icon library="custom" name="basket-shopping"></sonic-icon> 44855 </div> 44856 ${waitingCartText} 44857 </sonic-app-link> 44858 ` : A$1} 44859 `; 44860 } 44861 }; 44862 WaitingCartsLink.styles = [tailwind]; 44863 __decorateClass$1R([ 44864 bind$1("admin/current.data.id"), 44865 n$5({ type: Number }) 44866 ], WaitingCartsLink.prototype, "adminId", 2); 44867 __decorateClass$1R([ 44868 bind$1("admin/waitingCarts"), 44869 r$5() 44870 ], WaitingCartsLink.prototype, "waitingCarts", 2); 44871 __decorateClass$1R([ 44872 n$5({ type: String }) 44873 ], WaitingCartsLink.prototype, "size", 2); 44874 __decorateClass$1R([ 44875 n$5({ type: String }) 44876 ], WaitingCartsLink.prototype, "variant", 2); 44877 __decorateClass$1R([ 44878 n$5({ type: String }) 44879 ], WaitingCartsLink.prototype, "shape", 2); 44880 WaitingCartsLink = __decorateClass$1R([ 44881 t$3("sonic-waiting-carts-link") 44882 ], WaitingCartsLink); 44883 var __defProp$1O = Object.defineProperty; 44884 var __getOwnPropDesc$1Q = Object.getOwnPropertyDescriptor; 44885 var __decorateClass$1Q = (decorators, target, key, kind) => { 44886 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1Q(target, key) : target; 44887 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44888 if (decorator = decorators[i2]) 44889 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44890 if (kind && result) __defProp$1O(target, key, result); 44891 return result; 44892 }; 44893 let SonicCartItem = class extends Subscriber$1(i$6) { 44894 constructor() { 44895 super(...arguments); 44896 this.items = null; 44897 this.entities = null; 44898 this.linked_subscriptions = null; 44899 this.extras = null; 44900 this.canCheckout = false;
44901 this.canClearCart = false; 44902 this.total = 0; 44903 this.subTotal = 0; 44904 this.noAdditionalProducts = false; 44905 this.mode = "default"; 44906 this.showDetail = false; 44907 this.displaySummary = false; 44908 this.noDetailButton = false; 44909 this.layout = "default"; 44910 this.cartType = CartType.Cart; 44911 this.maxHeight = false; 44912 this._cartProvider = ""; 44913 this._hasEventsForSubscriptions = false; 44914 this._subscriptionsInCart = []; 44915 this.setMaxHeight = () => { 44916 if (!this.maxHeight) return; 44917 const top = this.getBoundingClientRect().top; 44918 let actionHeight = 0; 44919 if (this.actionElements) { 44920 this.actionElements.forEach((element) => { 44921 actionHeight += element.getBoundingClientRect().height; 44922 }); 44923 } 44924 const isNavigationV2 = document.documentElement.classList.contains("admin-navigation-v2"); 44925 const buttonDefaultHeight = isNavigationV2 ? 0 : 60; 44926 this.maxHeightValue = window.innerHeight - top - actionHeight - buttonDefaultHeight; 44927 }; 44928 this._resizeController = new h$1(this, { 44929 callback: this.setMaxHeight 44930 }); 44931 } 44932 connectedCallback() { 44933 if (this.maxHeight) { 44934 this.setMaxHeight(); 44935 window.addEventListener("resize", this.setMaxHeight); 44936 window.addEventListener("scroll", this.setMaxHeight); 44937 } 44938 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 44939 super.connectedCallback(); 44940 } 44941 disconnectedCallback() { 44942 super.disconnectedCallback(); 44943 if (this.maxHeight) { 44944 window.removeEventListener("resize", this.setMaxHeight); 44945 window.removeEventListener("scroll", this.setMaxHeight); 44946 } 44947 } 44948 async willUpdate(_changedProperties) { 44949 if (_changedProperties.has("items") && this.dataProvider) { 44950 if (this.items && this.entities?.length) { 44951 const groupedItems = groupItemsByEntity(this.items, this.entities); 44952 PublisherManager.get(this.dataProvider + "/clean").groupedItems.set(groupedItems); 44953 PublisherManager.get(this.dataProvider + "/clean").entities.set(this.entities); 44954 } 44955 } 44956 if (_changedProperties.has("items") || _changedProperties.has("linked_subscriptions")) { 44957 this._subscriptionsInCart = getCartSubscriptions({ 44958 items: this.items || [], 44959 linked_subscriptions: this.linked_subscriptions || [], 44960 can_attach_events: true 44961 }); 44962 } 44963 if (_changedProperties.has("_subscriptionsInCart")) { 44964 if (this._subscriptionsInCart.length > 0) { 44965 const apiConfiguration = HTML.getApiConfiguration(this); 44966 const events = await getEventsForSubscriptions({ 44967 apiConfiguration, 44968 subscriptions: this._subscriptionsInCart, 44969 accessParams: this.accessParams, 44970 limit: 1 44971 }); 44972 this._hasEventsForSubscriptions = events.length > 0; 44973 } else { 44974 this._hasEventsForSubscriptions = false; 44975 } 44976 } 44977 super.willUpdate(_changedProperties); 44978 } 44979 toggleDetail() { 44980 this.showDetail = !this.showDetail; 44981 this.dispatchEvent( 44982 new CustomEvent("detailChanged", { 44983 detail: { showDetail: this.showDetail }, 44984 bubbles: true, 44985 composed: true 44986 }) 44987 ); 44988 } 44989 render() { 44990 const isCurrentCart = this._cartProvider === "cart/current"; 44991 const isCondensed = this.layout == "condensed"; 44992 const showAdditionnal = !this.noAdditionalProducts && this.mode == "default"; 44993 if (!this.props) return A$1; 44994 const hasExtra = this.extras && this.extras?.length; 44995 const hasContent = !!this.items && this.items?.length > 0 || hasExtra; 44996 if (Object.keys(this.props).length === 0) return b$1`<sonic-loader mode="inline" class="mb-3"></sonic-loader>`; 44997 if (!hasContent) { 44998 const status = this.props && "status" in this.props ? this.props?.status : void 0; 44999 return b$1`<slot name="title"></slot> 45000 <sonic-cart-empty 45001 .status="${status}" 45002 .cartType="${this.cartType}" 45003 .mode="${this.mode}" 45004 class="${this.layout == "condensed" ? "lg:text-xl" : "text-lg lg:text-xl"} my-[2em] px-1 text-neutral-400" 45005 ></sonic-cart-empty>
45006 ${isCurrentCart ? b$1` <sonic-divider class="my-5"></sonic-divider 45007 ><sonic-waiting-carts-link 45008 shape="block" 45009 .size="${isCondensed ? "sm" : "md"}" 45010 variant="outline" 45011 ></sonic-waiting-carts-link>` : A$1} 45012 ${showAdditionnal ? this.renderAdditionnalProducts(isCondensed) : A$1} 45013 ${this.mode == "default" && !isCondensed && this.appType === "counter" ? this.renderActions() : A$1}`; 45014 } 45015 let styles2 = {}; 45016 if (this.maxHeightValue) { 45017 styles2 = { maxHeight: `clamp(200px, ${this.maxHeightValue}px, 2000px)` }; 45018 } 45019 const hasAction = this.mode !== "readonly"; 45020 const hideDetailText = isCondensed ? t("hide_detail_short") : t("hide_detail"); 45021 const showDetailText = isCondensed ? t("show_detail_short") : t("show_detail"); 45022 const displayEventChoiceButton = this.mode === "default" && this._hasEventsForSubscriptions && this.cartType !== CartType.WaitingLists; 45023 return b$1` 45024 <div class="@container"> 45025 <div class="flex w-full " data-action-area> 45026 <div class="min-w-0 grow"> 45027 <slot name="title"></slot> 45028 ${this.displaySummary ? b$1`<div class="flex items-center ${isCondensed ? "mb-2" : "mb-3"} gap-x-3 "> 45029 ${!this.noDetailButton ? b$1` 45030 <sonic-button 45031 @click=${this.toggleDetail} 45032 ?active=${this.showDetail} 45033 variant="unstyled" 45034 class="font-bold shrink-0 ${isCondensed ? "min-w-[4.5rem]" : "w-[12rem]"} " 45035 size="sm" 45036 > 45037 ${this.showDetail ? b$1`<sonic-icon library="custom" name="chevrons-up"></sonic-icon> 45038 <span class="underline underline-offset-2">${hideDetailText}</span>` : b$1`<sonic-icon library="custom" name="chevrons-down"></sonic-icon> 45039 <span class="underline underline-offset-2">${showDetailText}</span>`} 45040 </sonic-button> 45041 ` : A$1} 45042 <sonic-cart-summary 45043 ?displayRemainingTime=${isCurrentCart && !isCondensed} 45044 class="text-sm grow " 45045 ></sonic-cart-summary> 45046 </div>` : A$1} 45047 </div> 45048 <!-- Vider le panier --> 45049 ${this.canClearCart && hasAction ? b$1` <sonic-clear-cart-btn class="ml-auto"></sonic-clear-cart-btn> ` : A$1} 45050 </div> 45051 45052 <div 45053 style="${o$3(styles2)}" 45054 class="cart-content ${this.maxHeight ? "!overflow-y-auto overflow-x-hidden custom-scroll" : ""} ${isCondensed ? "pt-1" : "pt-3"}" 45055 > 45056 <sonic-list dataProvider="${this.dataProvider + "/clean"}" subDataProvider="groupedItems"> 45057 <template 45058 ><sonic-cart-item></sonic-cart-item> <sonic-cart-item-divider></sonic-cart-item-divider> 45059 </template> 45060 </sonic-list> 45061 45062 ${this.subTotal !== null && hasExtra ? b$1`<div 45063 class="text-right px-1 ${isCondensed ? "text-sm" : "text-base"} my-1 ${hasAction ? "mr-[2rem]" : ""} " 45064 > 45065 <sonic-cart-total isSubtotal></sonic-cart-total> 45066 </div>` : A$1} 45067 45068 <sonic-list subDataProvider="extras"> 45069 <template> 45070 <sonic-cart-item-line-extra></sonic-cart-item-line-extra> 45071 </template> 45072 </sonic-list> 45073 </div> 45074 45075 <div 45076 data-action-area 45077 class="px-1 ${hasAction ? "mr-[2rem]" : ""} ${isCondensed ? "text-lg @xl:text-xl" : "text-xl @xl:text-2xl "} py-[max(1.5%,.5rem)] text-right" 45078 > 45079 <sonic-cart-total></sonic-cart-total> 45080 </div> 45081 45082 <!-- Liste des produits additionels pouvant être ajoutés depuis le panier --> 45083 ${showAdditionnal ? this.renderAdditionnalProducts(isCondensed) : A$1} 45084 </div> 45085 45086 ${displayEventChoiceButton ? b$1`<div data-action-area class="py-4"> 45087 <sonic-button 45088 @click=${() => quickSelectModal({ cartProvider: this._cartProvider, accessParams: this.accessParams })} 45089 variant="outline" 45090 shape="block" 45091 > 45092 <sonic-icon name="calendar-check" library="custom"></sonic-icon>
45093 <span class="font-bold">${t("events_choice")}</span> 45094 </sonic-button> 45095 </div>` : A$1} 45096 ${this.mode == "default" && !isCondensed && this.appType === "counter" ? this.renderActions() : A$1} 45097 ${hasContent ? b$1`<slot name="actions"></slot>` : A$1} 45098 `; 45099 } 45100 renderActions() { 45101 if (isWaitingList(this.props?.cartType)) { 45102 return A$1; 45103 } 45104 const notReservationRequest = !isReservationRequest(this.props?.cartType); 45105 const enableSubscriptions = notReservationRequest && this.modules?.subscription?.enabled; 45106 const enableGiftcards = notReservationRequest && this.modules?.giftcards?.enabled; 45107 const enableMerch = notReservationRequest && this.modules?.shop?.enabled; 45108 return b$1` <div class="@container" data-action-area> 45109 <div class="flex flex-col @xl:flex-row gap-y-2 gap-x-1 pt-3 mb-4 "> 45110 <sonic-cart-add-entity .entityType=${EntityType.Event} class="block w-full"></sonic-cart-add-entity> 45111 ${enableSubscriptions ? b$1`<sonic-cart-add-entity 45112 .entityType=${EntityType.Subscribe} 45113 class="block w-full" 45114 ></sonic-cart-add-entity>` : A$1} 45115 ${enableGiftcards ? b$1`<sonic-cart-add-entity 45116 .entityType=${EntityType.Giftcard} 45117 class="block w-full" 45118 ></sonic-cart-add-entity>` : A$1} 45119 ${enableMerch ? b$1`<sonic-cart-add-entity .entityType=${EntityType.Merch} class="block w-full"></sonic-cart-add-entity> ` : A$1} 45120 </div> 45121 </div>`; 45122 } 45123 renderAdditionnalProducts(isCondensed) { 45124 const isCounter = this.appType === "counter"; 45125 if (isWaitingList(this.props?.cartType)) { 45126 return A$1; 45127 } 45128 return b$1`<div data-action-area class="text-right py-3 px-1"> 45129 <sonic-cart-additional-products 45130 ?condensed="${isCondensed}" 45131 ?flatten="${!isCounter}" 45132 ></sonic-cart-additional-products> 45133 </div>`; 45134 } 45135 }; 45136 SonicCartItem.styles = [ 45137 tailwind, 45138 customScroll, 45139 i$9` 45140 :host { 45141 text-align: left; 45142 display: block; 45143 } 45144 ` 45145 ]; 45146 __decorateClass$1Q([ 45147 n$5({ type: Array }) 45148 ], SonicCartItem.prototype, "items", 2); 45149 __decorateClass$1Q([ 45150 n$5({ type: Array }) 45151 ], SonicCartItem.prototype, "entities", 2); 45152 __decorateClass$1Q([ 45153 n$5({ type: Array }) 45154 ], SonicCartItem.prototype, "linked_subscriptions", 2); 45155 __decorateClass$1Q([ 45156 n$5({ type: Array }) 45157 ], SonicCartItem.prototype, "extras", 2); 45158 __decorateClass$1Q([ 45159 n$5({ type: Boolean }) 45160 ], SonicCartItem.prototype, "canCheckout", 2); 45161 __decorateClass$1Q([ 45162 n$5({ type: Boolean }) 45163 ], SonicCartItem.prototype, "canClearCart", 2); 45164 __decorateClass$1Q([ 45165 n$5({ type: Number }) 45166 ], SonicCartItem.prototype, "total", 2); 45167 __decorateClass$1Q([ 45168 n$5({ type: Number }) 45169 ], SonicCartItem.prototype, "subTotal", 2); 45170 __decorateClass$1Q([ 45171 n$5({ type: Boolean }) 45172 ], SonicCartItem.prototype, "noAdditionalProducts", 2); 45173 __decorateClass$1Q([ 45174 c({ context: modeContext, subscribe: true }), 45175 e$2({ context: modeContext }), 45176 n$5({ type: String }) 45177 ], SonicCartItem.prototype, "mode", 2); 45178 __decorateClass$1Q([ 45179 e$2({ context: detailContext }), 45180 n$5({ type: Boolean }) 45181 ], SonicCartItem.prototype, "showDetail", 2); 45182 __decorateClass$1Q([ 45183 n$5({ type: Boolean }) 45184 ], SonicCartItem.prototype, "displaySummary", 2); 45185 __decorateClass$1Q([ 45186 n$5({ type: Boolean }) 45187 ], SonicCartItem.prototype, "noDetailButton", 2); 45188 __decorateClass$1Q([ 45189 e$2({ context: layoutContext }), 45190 n$5({ type: String }) 45191 ], SonicCartItem.prototype, "layout", 2); 45192 __decorateClass$1Q([ 45193 c({ context: cartTypeContext, subscribe: true }), 45194 e$2({ context: cartTypeContext }), 45195 n$5({ type: String }) 45196 ], SonicCartItem.prototype, "cartType", 2); 45197 __decorateClass$1Q([ 45198 c({ context: accessParamsContext, subscribe: true }), 45199 n$5({ type: Object }) 45200 ], SonicCartItem.prototype, "accessParams", 2); 45201 __decorateClass$1Q([ 45202 c({ context: appType, subscribe: true }) 45203 ], SonicCartItem.prototype, "appType", 2); 45204 __decorateClass$1Q([ 45205 n$5({ type: Boolean }) 45206 ], SonicCartItem.prototype, "maxHeight", 2); 45207 __decorateClass$1Q([ 45208 r$4("[data-action-area]") 45209 ], SonicCartItem.prototype, "actionElements", 2); 45210 __decorateClass$1Q([ 45211 r$5() 45212 ], SonicCartItem.prototype, "maxHeightValue", 2); 45213 __decorateClass$1Q([ 45214 bind$1("settings.modules"), 45215 n$5({ type: Object }) 45216 ], SonicCartItem.prototype, "modules", 2); 45217 __decorateClass$1Q([ 45218 r$5() 45219 ], SonicCartItem.prototype, "_hasEventsForSubscriptions", 2); 45220 __decorateClass$1Q([ 45221 r$5() 45222 ], SonicCartItem.prototype, "_subscriptionsInCart", 2); 45223 SonicCartItem = __decorateClass$1Q([ 45224 t$3("sonic-cart-items") 45225 ], SonicCartItem); 45226 var __defProp$1N = Object.defineProperty; 45227 var __getOwnPropDesc$1P = Object.getOwnPropertyDescriptor; 45228 var __decorateClass$1P = (decorators, target, key, kind) => { 45229 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1P(target, key) : target; 45230 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 45231 if (decorator = decorators[i2]) 45232 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 45233 if (kind && result) __defProp$1N(target, key, result); 45234 return result; 45235 }; 45236 let SonicPromo = class extends Subscriber$1(i$6) { 45237 constructor() { 45238 super(...arguments); 45239 this.giftcardEnabled = false;
45240 } 45241 invalidateCart(apiResult) { 45242 if (apiResult.success && this.cartProvider) { 45243 PublisherManager.get(this.cartProvider).invalidate(); 45244 this.giftCardCode = ""; 45245 } 45246 } 45247 connectedCallback() { 45248 if (!this.cartProvider) { 45249 this.cartProvider = this.getAncestorAttributeValue("cartProvider"); 45250 } 45251 super.connectedCallback(); 45252 } 45253 render() { 45254 if (this.giftcardEnabled) { 45255 const cartId = this.cartProvider?.split("/")?.pop() || "current"; 45256 return b$1` 45257 <div 45258 formdataprovider="giftcardForm" 45259 submitresultdataprovider="giftcardResult" 45260 dataProvider="giftcards" 45261 method="post" 45262 > 45263 <sonic-input type="hidden" name="cartId" value="${cartId}"></sonic-input> 45264 45265 <sonic-submit onEnterKey> 45266 <sonic-input 45267 size=${o$4(this.size)} 45268 name="code" 45269 placehoderAsLabel 45270 placeholder=${t("LIB_cartes_cadeaux")} 45271 inlineContent 45272 > 45273 <sonic-icon library="custom" name="gift-card" slot="prefix"></sonic-icon> 45274 45275 <sonic-submit onClick slot="suffix"> 45276 <sonic-tooltip label="${t("submit")}"> 45277 <sonic-button 45278 size=${o$4(this.size)} 45279 shape="square" 45280 icon 45281 variant="unstyled" 45282 data-aria-label=${t("submit")} 45283 > 45284 <sonic-icon 45285 library="iconoir" 45286 name="check" 45287 class="${this.giftCardCode ? "opacity-100 animate-[pulse.5s_ease-in-out_infinite_.5s] inline-block" : "opacity-30"}" 45288 ></sonic-icon> 45289 </sonic-button> 45290 </sonic-tooltip> 45291 </sonic-submit> 45292 </sonic-input> 45293 </sonic-submit> 45294 </div> 45295 `; 45296 } else { 45297 return A$1; 45298 } 45299 } 45300 }; 45301 SonicPromo.styles = [tailwind]; 45302 __decorateClass$1P([ 45303 bind$1("settings.modules.giftcards.enabled"), 45304 n$5({ type: Boolean }) 45305 ], SonicPromo.prototype, "giftcardEnabled", 2); 45306 __decorateClass$1P([ 45307 n$5({ type: String }) 45308 ], SonicPromo.prototype, "size", 2); 45309 __decorateClass$1P([ 45310 bind$1("giftcardForm.code"), 45311 n$5({ type: String }) 45312 ], SonicPromo.prototype, "giftCardCode", 2); 45313 __decorateClass$1P([ 45314 n$5({ type: String }) 45315 ], SonicPromo.prototype, "cartProvider", 2); 45316 __decorateClass$1P([ 45317 onAssign$1("giftcardResult") 45318 ], SonicPromo.prototype, "invalidateCart", 1); 45319 SonicPromo = __decorateClass$1P([ 45320 t$3("sonic-giftcard-form") 45321 ], SonicPromo); 45322 var __defProp$1M = Object.defineProperty; 45323 var __getOwnPropDesc$1O = Object.getOwnPropertyDescriptor; 45324 var __decorateClass$1O = (decorators, target, key, kind) => { 45325 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1O(target, key) : target; 45326 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 45327 if (decorator = decorators[i2]) 45328 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 45329 if (kind && result) __defProp$1M(target, key, result); 45330 return result; 45331 }; 45332 const tagName$1c = "sonic-use-my-giftcards"; 45333 let SonicGiftcardSelect = class extends Fetcher$1(Subscriber$1(i$6)) { 45334 constructor() { 45335 super(...arguments); 45336 this.data = null; 45337 this.cartProvider = ""; 45338 this.invalidateMyGiftCards = (_apiDataResult) => { 45339 if (this.dataProvider) { 45340 PublisherManager.get(this.dataProvider).invalidate(); 45341 } 45342 this._fetchData(); 45343 }; 45344 } 45345 connectedCallback() { 45346 this.isFetchEnabled = false; 45347 if (!this.cartProvider) { 45348 this.cartProvider = this.getAncestorAttributeValue("cartProvider") || "cart/current"; 45349 } 45350 this.dataProvider = this.cartProvider + "/cartMyGiftcards"; 45351 PublisherManager.get(this.cartProvider).data.onAssign(this.invalidateMyGiftCards); 45352 super.connectedCallback(); 45353 } 45354 disconnectedCallback() { 45355 PublisherManager.get(this.cartProvider).data.offAssign(this.invalidateMyGiftCards); 45356 super.disconnectedCallback(); 45357 } 45358 handleSubmit(e2) { 45359 if (e2.detail?.success == true) { 45360 PublisherManager.get(this.cartProvider).invalidate(); 45361 if (this.dataProvider) { 45362 PublisherManager.get(this.dataProvider).invalidate(); 45363 } 45364 } 45365 } 45366 willUpdate(changedProperties) { 45367 if (changedProperties.has("userId") && this.userId && !this.isFetchEnabled) { 45368 this.endPoint = `/user/${this.userId}/purchases/giftcard?owner=${this.userId}&available=true&inUse=false`; 45369 this.isFetchEnabled = true; 45370 this._fetchData(); 45371 } 45372 super.willUpdate(changedProperties); 45373 } 45374 render() { 45375 const hasData = this.data && this.data.length > 0; 45376 if (!hasData) { 45377 this.style.display = "none"; 45378 } else { 45379 this.style.display = "block"; 45380 } 45381 if (!this.data || this.data.length == 0 || !this.userId) return A$1; 45382 const cartId = this.cartProvider?.split("/")?.pop() || "current"; 45383 return b$1`<div>
45384 <sonic-divider class="uppercase text-xs mb-3 text-center text-neutral-500"> 45385 <sonic-icon name="gift-card" library="custom"></sonic-icon> ${t("giftcard_available")} 45386 </sonic-divider> 45387 45388 <div 45389 formdataprovider="cartMyGiftcardForm" 45390 submitresultdataprovider="cartMyGiftcardResult" 45391 dataProvider="giftcards" 45392 method="post" 45393 class="flex flex-wrap gap-2 justify-center" 45394 > 45395 <sonic-input type="hidden" name="cartId" value="${cartId}"></sonic-input> 45396 45397 ${c$1( 45398 this.data, 45399 (purchase) => purchase.giftcard?.code, 45400 (purchase) => { 45401 return b$1`${purchase.giftcard?.code ? b$1`<sonic-submit onClick clearedDataOnSuccess="cartMyGiftcardForm" @submit=${this.handleSubmit} 45402 ><sonic-button unique size="xs" name="code" value=${purchase.giftcard.code}> 45403 <div class="font-bold text-xs "> 45404 ${purchase.entity?.edito?.alt_title || purchase.entity?.edito?.title} 45405 </div> 45406 <span class="tracking-wide"> ${purchase.giftcard?.code} </span> 45407 ${purchase.giftcard?.remaining_amount ? b$1`/ ${formatAmount(purchase.giftcard?.remaining_amount || 0)}` : A$1} 45408 </sonic-button></sonic-submit 45409 >` : A$1}`; 45410 } 45411 )} 45412 </div> 45413 </div> `; 45414 } 45415 }; 45416 SonicGiftcardSelect.styles = [ 45417 tailwind, 45418 i$9` 45419 :host() { 45420 display: block; 45421 } 45422 ` 45423 ]; 45424 __decorateClass$1O([ 45425 bind$1("user.id"), 45426 n$5({ type: String }) 45427 ], SonicGiftcardSelect.prototype, "userId", 2); 45428 __decorateClass$1O([ 45429 n$5({ type: Array }) 45430 ], SonicGiftcardSelect.prototype, "data", 2); 45431 __decorateClass$1O([ 45432 n$5({ type: String }) 45433 ], SonicGiftcardSelect.prototype, "cartProvider", 2); 45434 SonicGiftcardSelect = __decorateClass$1O([ 45435 t$3(tagName$1c) 45436 ], SonicGiftcardSelect); 45437 const checkCanUseCredit = (proAccess, credit) => { 45438 if (!proAccess || !credit) return false; 45439 const isEnableForPros = credit?.enabledForPros ?? false; 45440 const isEnableForCustomers = credit?.enabledForCustomer ?? false; 45441 if (proAccess === "yes") { 45442 return isEnableForPros; 45443 } else { 45444 return isEnableForCustomers; 45445 } 45446 }; 45447 var __defProp$1L = Object.defineProperty; 45448 var __getOwnPropDesc$1N = Object.getOwnPropertyDescriptor; 45449 var __decorateClass$1N = (decorators, target, key, kind) => { 45450 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1N(target, key) : target; 45451 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 45452 if (decorator = decorators[i2]) 45453 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 45454 if (kind && result) __defProp$1L(target, key, result); 45455 return result; 45456 }; 45457 let SonicUseMyCredit = class extends i$6 { 45458 constructor() { 45459 super(...arguments); 45460 this.balance = 0; 45461 this.cartId = "current"; 45462 this.hasCreditInCurrentCart = false; 45463 this._canUseCredit = false; 45464 } 45465 willUpdate(_changedProperties) { 45466 if (_changedProperties.has("cart")) { 45467 this.hasCreditInCurrentCart = this.cart?.extras?.some((extra) => extra.entity_type === EntityType.Credit) ?? false; 45468 } 45469 if (_changedProperties.has("proAccess") || _changedProperties.has("credit") || _changedProperties.has("userId")) { 45470 this._canUseCredit = checkCanUseCredit(this.proAccess, this.credit); 45471 } 45472 super.willUpdate(_changedProperties); 45473 } 45474 async useMyCredit() { 45475 const api2 = new API(HTML.getApiConfiguration(this)); 45476 const cartId = Number(this.cart?.id) || 0; 45477 const response = await api2.post("/cart/discount", { 45478 type: "user_credit", 45479 userId: this.userId, 45480 cartId 45481 }); 45482 if (response.success && cartId) { 45483 Cart.updateCart(api2, `cart/${cartId}`); 45484 } 45485 } 45486 render() { 45487 if (this.balance <= 0 || !this._canUseCredit) return A$1; 45488 if (this.hasCreditInCurrentCart) return A$1; 45489 const hasBalanceButNoCartId = this.balance > 0 && !this.cart?.id; 45490 const cartTotal = this.cart?.total || 0; 45491 const remainingBalance = cartTotal < this.balance ? this.balance - cartTotal : 0; 45492 if (hasBalanceButNoCartId) 45493 return b$1` 45494 <sonic-alert status="info" size="sm" align="center" class="animate-pulse" noIcon> 45495 <strong>
45495${formatAmount(this.balance)} ${t("available_as_a_credit")}</strong><br /> 45496 ${t("LIB_use_your_credit_finalization")} 45497 </sonic-alert> 45498 `; 45499 return b$1`<sonic-divider> 45500 <sonic-button @click=${this.useMyCredit} type="info" variant="outline" size="sm"> 45501 <div> 45502 <sonic-icon name="wallet" library="custom" size="lg"></sonic-icon> 45503 <span class="font-bold"> ${t("LIB_use_your_credit")} : ${formatAmount(this.balance)}</span> 45504 </div> 45505 ${remainingBalance > 0 ? b$1` 45506 <div class="text-xs mt-1">${t("LIB_use_your_credit_remaining")} ${formatAmount(remainingBalance)}</div> 45507 ` : A$1} 45508 </sonic-button> 45509 </sonic-divider>`; 45510 } 45511 }; 45512 SonicUseMyCredit.styles = [tailwind]; 45513 __decorateClass$1N([ 45514 bind$1("user.balance"), 45515 n$5({ type: Number }) 45516 ], SonicUseMyCredit.prototype, "balance", 2); 45517 __decorateClass$1N([ 45518 bind$1("user.id"), 45519 n$5({ type: String }) 45520 ], SonicUseMyCredit.prototype, "userId", 2); 45521 __decorateClass$1N([ 45522 bind$1("user.proAccess"), 45523 n$5({ type: String }) 45524 ], SonicUseMyCredit.prototype, "proAccess", 2); 45525 __decorateClass$1N([ 45526 bind$1("settings.credit"), 45527 n$5({ type: Boolean }) 45528 ], SonicUseMyCredit.prototype, "credit", 2); 45529 __decorateClass$1N([ 45530 bind$1("cart/${cartId}.data"), 45531 n$5({ type: Object }) 45532 ], SonicUseMyCredit.prototype, "cart", 2); 45533 __decorateClass$1N([ 45534 n$5({ type: String }) 45535 ], SonicUseMyCredit.prototype, "cartId", 2); 45536 __decorateClass$1N([ 45537 r$5() 45538 ], SonicUseMyCredit.prototype, "hasCreditInCurrentCart", 2); 45539 __decorateClass$1N([ 45540 r$5() 45541 ], SonicUseMyCredit.prototype, "_canUseCredit", 2); 45542 SonicUseMyCredit = __decorateClass$1N([ 45543 t$3("sonic-use-my-credit") 45544 ], SonicUseMyCredit); 45545 var __defProp$1K = Object.defineProperty; 45546 var __getOwnPropDesc$1M = Object.getOwnPropertyDescriptor; 45547 var __decorateClass$1M = (decorators, target, key, kind) => { 45548 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1M(target, key) : target; 45549 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 45550 if (decorator = decorators[i2]) 45551 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 45552 if (kind && result) __defProp$1K(target, key, result); 45553 return result; 45554 }; 45555 const tagName$1b = "sonic-cart-actions"; 45556 let CartActions = class extends Subscriber$1(i$6) { 45557 constructor() { 45558 super(...arguments); 45559 this.messages = []; 45560 this.layout = "default"; 45561 this.cartType = CartType.Cart; 45562 this.quantity = 0; 45563 this.promoEnabled = false; 45564 this.giftcardEnabled = false; 45565 this.noSuffix = false; 45566 this.canSplitCart = false; 45567 this.extras = []; 45568 this._reservationRequestConfig = null; 45569 this.handleSaveCart = (e2, goToSplit = false) => { 45570 if (e2.detail?.success == true) { 45571 PublisherManager.get(this.cartProvider || "cart/current").invalidate(); 45572 const data = e2.detail?.data; 45573 const id = data?.id; 45574 if (id) { 45575 if (goToSplit) { 45576 appRoute("reservation").fill({ id }).query({ display_split: true }).goTo(); 45577 } else { 45578 appRoute("reservation").fill({ id }).goTo(); 45579 } 45580 } 45581 } 45582 }; 45583 } 45584 connectedCallback() { 45585 if (!this.cartProvider) { 45586 this.cartProvider = this.getAncestorAttributeValue("cartProvider"); 45587 } 45588 super.connectedCallback(); 45589 } 45590 async willUpdate(_changedProperties) { 45591 const isCounter = this.appType === "counter"; 45592 const hasExchange = this.extras && this.extras.some((item) => item.exchange_id); 45593 this.canSplitCart = this.cartProvider === "cart/current" && !this.noSuffix && this.quantity > 1 && !hasExchange && isCounter && this.cartType === CartType.Cart && this.props?.canCheckout === true; 45594 if (isReservationRequest(this.cartType)) { 45595 const reservationRequestConfigId = this.props?.reservationRequestConfigId; 45596 if (reservationRequestConfigId !== this._reservationRequestConfig?.id) { 45597 const apiConfiguration = this.getApiConfiguration(); 45598 const api2 = new API(apiConfiguration); 45599 const result = await api2.get(`reservation-request-config/${reservationRequestConfigId}`); 45600 if (result?.data && result.success) { 45601 this._reservationRequestConfig = result.data; 45602 } 45603 } 45604 } else { 45605 this._reservationRequestConfig = null; 45606 } 45607 super.willUpdate(_changedProperties); 45608 } 45609 render() {
45610 const isCondensed = this.layout == "condensed"; 45611 const isCurrentCart = this.cartProvider === "cart/current"; 45612 const displaySuffixDivider = !this.noSuffix && this.quantity && (this.promoEnabled || this.giftcardEnabled) && isCurrentCart; 45613 return b$1`<div class=" grid grid-cols-1 ${isCondensed ? "gap-3" : "gap-7"} "> 45614 ${this.quantity && isCurrentCart ? b$1`<sonic-use-my-giftcards></sonic-use-my-giftcards><sonic-use-my-credit></sonic-use-my-credit>` : A$1} 45615 ${this.reservationRequestActions()} 45616 <sonic-cart-payment-buttons size=${isCondensed ? "sm" : "md"}></sonic-cart-payment-buttons> 45617 45618 ${isCurrentCart && this.quantity && !this.noSuffix && this.appType === "counter" ? b$1` 45619 <div class="flex gap-2 justify-center w-full"> 45620 <sonic-submit 45621 endPoint="/cart/current/save" 45622 method="post" 45623 onEnterKey 45624 onClick 45625 @submit=${(event) => this.handleSaveCart(event, false)} 45626 > 45627 <sonic-tooltip label="Sauvegarde temporaire"> 45628 <sonic-button autoActive="disabled" size="sm" align="left" variant="outline" shape="circle" icon> 45629 <div class="relative inline-flex"> 45630 <sonic-icon 45631 name="floppy-disk" 45632 library="custom" 45633 class="translate-x-[1px] translate-y-[-1px]" 45634 ></sonic-icon> 45635 <sonic-icon 45636 name="clock" 45637 library="custom" 45638 prefix="solid" 45639 class="text-[11px] absolute bottom-[-2px] left-[-2px] bg-neutral-0 size-[13px] border-px border-neutral-0 rounded-full flex items-center" 45640 ></sonic-icon> 45641 </div> 45642 </sonic-button> 45643 </sonic-tooltip> 45644 </sonic-submit> 45645 45646 <sonic-submit 45647 endPoint="/cart/current/save" 45648 method="post" 45649 onEnterKey 45650 onClick 45651 class="grow" 45652 ?disabled=${!this.canSplitCart} 45653 @submit=${(event) => this.handleSaveCart(event, true)} 45654 > 45655 <sonic-button autoActive="disabled" size="sm" shape="block" align="left" variant="outline"> 45656 <sonic-icon slot="prefix" name="split" library="custom" size="lg"></sonic-icon> 45657 Diviser 45658 </sonic-button> 45659 </sonic-submit> 45660 </div> 45661 ` : A$1} 45662 ${this.quantity ? b$1` <slot name="customActions"></slot>` : A$1} 45663 ${displaySuffixDivider ? b$1`<sonic-divider noMargin></sonic-divider>` : A$1} 45664 ${!this.noSuffix && isCurrentCart ? b$1` <div class="flex flex-wrap gap-2 justify-center w-full"> 45665 <sonic-promo-form 45666 size=${isCondensed ? "xs" : "sm"} 45667 class=" flew-grow block text-left ${isCondensed ? " max-w-[10rem] " : "max-w-[13rem] "} " 45668 ></sonic-promo-form> 45669 45670 ${this.quantity ? b$1` <sonic-giftcard-form 45671 size=${isCondensed ? "xs" : "sm"} 45672 class=" flew-grow block text-left ${isCondensed ? " max-w-[10rem] " : "max-w-[13rem] "}" 45673 ></sonic-giftcard-form>` : A$1} 45674 </div>` : A$1} 45675 </div>`; 45676 } 45677 reservationRequestActions() { 45678 const items = this.props?.items || []; 45679 const extras = this.props?.extras || []; 45680 const hasItemsOrExtras = items?.length || extras?.length; 45681 if (!isReservationRequest(this.cartType) && !isWaitingList(this.cartType) || !hasItemsOrExtras) return A$1; 45682 if (this.props?.canCheckout && "status" in this.props && this.props?.status && this.props?.status === ReservationStatus.Incomplete && hasItemsOrExtras) { 45683 return b$1` 45684 <sonic-button 45685 slot="actions" 45686 type="success" 45687 @click=${() => this.lockReservationRequestModal(this.cartType, this.appType)} 45688 > 45689 <sonic-icon library="custom" name="check"></sonic-icon> 45690 ${t("confirm")} 45691 </sonic-button> 45692 `; 45693 } 45694 return A$1; 45695 } 45696 lockReservationRequestModal(cartType, appType2) { 45697 const cartProvider = this.cartProvider; 45698 const id = this.props && "id" in this.props && this.props.id ? this.props.id : ""; 45699 let formKey = `formInfos/requestLockForm/${cartType}/${id}`; 45700 let title = t("LIB_request_lock_title"); 45701 let subTitle = t("LIB_request_lock_subtitle"); 45702 let precisionLabel = t("LIB_precisions"); 45703 if (appType2 === "counter") { 45704 subTitle = t("LIB_request_lock_subtitle_counter"); 45705 precisionLabel = t("LIB_precisions_publiques"); 45706 } 45707 const description2 = isReservationRequest(cartType) ? t("LIB_indications_pmr_publiques_specifiques_financements") : void 0; 45708 const displayPublicNotes = this._reservationRequestConfig ? this._reservationRequestConfig?.display_public_notes : true; 45709 if (!cartProvider) return; 45710 Modal.create({ 45711 title, 45712 subtitle: subTitle, 45713 content: b$1` 45714 ${displayPublicNotes ? b$1` 45715 <div formDataProvider=${formKey}> 45716 <sonic-textarea 45717 label="${precisionLabel}" 45718 rows="4" 45719 name="publicNotes" 45720 value=${this.props?.publicNotes} 45721 .description=${description2} 45722 ></sonic-textarea> 45723 </div> 45724 ` : A$1} 45725 `, 45726 actions: b$1` <sonic-button 45727 shape="block" 45728 minWidth="10rem" 45729 hideModal 45730 type="success" 45731 @click=${async () => { 45732 const apiConfiguration = this.getApiConfiguration(); 45733 const api2 = new API(apiConfiguration); 45734 const publicNotes = dp$1(formKey).publicNotes.get(); 45735 const result = await api2.patch(cartProvider, { publicNotes }); 45736 if (result?.success) { 45737 await lockReservationRequest(apiConfiguration, cartProvider); 45738 } 45739 }} 45740 type="primary" 45741 > 45742 <sonic-icon library="custom" name="check"></sonic-icon> 45743 ${t("confirm")}</sonic-button 45744 > 45745 <sonic-button shape="block" minWidth="10rem" hideModal> ${t("cancel")}</sonic-button>`, 45746 maxWidth: "38rem", 45747 removeOnHide: true 45748 }); 45749 } 45750 }; 45751 CartActions.styles = [tailwind]; 45752 __decorateClass$1M([ 45753 n$5({ type: Array }) 45754 ], CartActions.prototype, "messages", 2); 45755 __decorateClass$1M([ 45756 c({ context: layoutContext, subscribe: true }), 45757 n$5({ type: String }) 45758 ], CartActions.prototype, "layout", 2); 45759 __decorateClass$1M([ 45760 c({ context: cartTypeContext, subscribe: true }), 45761 n$5({ type: String }) 45762 ], CartActions.prototype, "cartType", 2); 45763 __decorateClass$1M([ 45764 n$5({ type: Number }) 45765 ], CartActions.prototype, "quantity", 2); 45766 __decorateClass$1M([ 45767 c({ context: appType, subscribe: true }), 45768 r$5() 45769 ], CartActions.prototype, "appType", 2); 45770 __decorateClass$1M([ 45771 n$5({ type: String }) 45772 ], CartActions.prototype, "cartProvider", 2); 45773 __decorateClass$1M([ 45774 bind$1("settings.modules.giftcards.enabled"), 45775 n$5({ type: Boolean }) 45776 ], CartActions.prototype, "promoEnabled", 2); 45777 __decorateClass$1M([ 45778 bind$1("settings.promotion_code"), 45779 n$5({ type: Boolean }) 45780 ], CartActions.prototype, "giftcardEnabled", 2); 45781 __decorateClass$1M([ 45782 n$5({ type: Boolean }) 45783 ], CartActions.prototype, "noSuffix", 2); 45784 __decorateClass$1M([ 45785 r$5() 45786 ], CartActions.prototype, "canSplitCart", 2); 45787 __decorateClass$1M([ 45788 r$5() 45789 ], CartActions.prototype, "extras", 2); 45790 __decorateClass$1M([ 45791 r$5() 45792 ], CartActions.prototype, "_reservationRequestConfig", 2); 45793 CartActions = __decorateClass$1M([ 45794 t$3(tagName$1b) 45795 ], CartActions); 45796 const endpoints = { 45797 /** POST â Synchronize access control badge context. @hostProps badgeId: string | number */ 45798 accessControlBadgeSync: new Endpoint("access-control/badges/${badgeId}/sync"),
45799 /** POST â Create a ticket from access control. @hostProps sessionId: string | number */ 45800 accessControlSessionCreateTicket: new Endpoint("access-control/sessions/${sessionId}/tickets"), 45801 /** POST â Synchronize access control session. @hostProps sessionId: string | number */ 45802 accessControlSessionSync: new Endpoint("access-control/sessions/${sessionId}/sync"), 45803 /** GET â Products informations */ 45804 accessItems: new Endpoint("access-control/access-items"), 45805 /** POST â Connexion accréditation PRO autorisée au public */ 45806 accreditationLogin: new Endpoint("accreditations/login"), 45807 /** GET â Permet de se déconnecter de l'accréditation PRO */ 45808 accreditationsLogout: new Endpoint("accreditations/logout"), 45809 /** POST â Request a ticket refund */ 45810 askRefund: new Endpoint("refunds/ask"), 45811 /** PUT â Annuler la soumission d'une demande de réservation. @hostProps reservationRequestId: string | number */ 45812 cancelSubmissionReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/cancel-submission"), 45813 /** DELETE â Cancel a ticket online */ 45814 cancelTicket: new Endpoint("tickets"), 45815 /** POST â Cancel ticket for store credit */ 45816 cancelTicketForCredit: new Endpoint("tickets/cancel-for-credit"), 45817 /** GET â Check queue authorization */ 45818 checkQueueAuthorization: new Endpoint("queue/authorized"), 45819 /** POST â Check seat availability */ 45820 checkSeatAvailability: new Endpoint("seat-availability/check"), 45821 /** POST â Check subscription validity for partner event purchase */ 45822 checkSubscription: new Endpoint("partner/check_subscription"), 45823 /** PUT â Confirm a reservation. @hostProps reservationId: string | number */ 45824 confirmReservation: new Endpoint("reservations/${reservationId}/confirm"), 45825 /** PUT â Confirm a reservation request. @hostProps reservationRequestId: string | number */ 45826 confirmReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/confirm"), 45827 /** POST â Contact accréditation PRO */ 45828 contactAccreditation: new Endpoint("accreditations/contact"), 45829 /** POST â Créer un lien de connexion simplifié. @hostProps identifiant: string | number */ 45830 createAdminLoginLink: new Endpoint("admin/${identifiant}/login-link"), 45831 /** POST â Create a new reservation */ 45832 createReservation: new Endpoint("reservations"), 45833 /** POST â Create a new reservation request */ 45834 createReservationRequest: new Endpoint("reservation-request"), 45835 /** PUT â Décliner une demande de réservation. @hostProps reservationRequestId: string | number */ 45836 declineReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/decline"), 45837 /** DELETE â Delete an activity. @hostProps activityId: string | number */ 45838 deleteActivity: new Endpoint("activity/${activityId}"), 45839 /** DELETE â Delete a cart. @hostProps cartId: string | number */ 45840 deleteCart: new Endpoint("cart/${cartId}"), 45841 /** DELETE â Delete one item of a cart. @hostProps cartId: string | number; itemId: string | number */ 45842 deleteCartItem: new Endpoint("cart/${cartId}/items/${itemId}"), 45843 /** DELETE â Delete items of a cart. @hostProps cartId: string | number */ 45844 deleteCartItems: new Endpoint("cart/${cartId}/items"), 45845 /** DELETE â Delete a category. @hostProps categoryId: string | number */ 45846 deleteCategory: new Endpoint("categories/${categoryId}"), 45847 /** DELETE â Delete a label. @hostProps labelId: string | number */ 45848 deleteLabel: new Endpoint("label/${labelId}"), 45849 /** DELETE â Suppression d'un code promo actif */ 45850 deletePromotionCode: new Endpoint("promotion-code"), 45851 /** DELETE â Expire queue session */ 45852 deleteQueueSession: new Endpoint("queue/session"), 45853 /** DELETE â Delete a quota. @hostProps quotaId: string | number */ 45854 deleteQuota: new Endpoint("quota/${quotaId}"), 45855 /** DELETE â Delete a reservation. @hostProps reservationId: string | number */ 45856 deleteReservation: new Endpoint("reservations/${reservationId}"), 45857 /** PUT â Supprimer la réservation et restaurer la demande. @hostProps reservationId: string | number */ 45858 deleteReservationAndRestoreRequest: new Endpoint("reservations/${reservationId}/delete-and-restore-request"), 45859 /** DELETE â Delete an item from a reservation. @hostProps reservationId: string | number; itemId: string | number */ 45860 deleteReservationItem: new Endpoint("reservations/${reservationId}/items/${itemId}"), 45861 /** DELETE â Delete multiple items from a reservation (based on criteria). @hostProps reservationId: string | number */ 45862 deleteReservationItems: new Endpoint("reservations/${reservationId}/items"), 45863 /** DELETE â Delete a reservation request. @hostProps reservationRequestId: string | number */ 45864 deleteReservationRequest: new Endpoint("reservation-request/${reservationRequestId}"), 45865 /** DELETE â Delete multiple items from a reservation request (based on criteria). @hostProps reservationRequestId: string | number */ 45866 deleteReservationRequestItems: new Endpoint("reservation-request/${reservationRequestId}/items"), 45867 /** DELETE â Delete a session. @hostProps sessionId: string | number */ 45868 deleteSession: new Endpoint("sessions/${sessionId}"), 45869 /** DELETE â Delete user. @hostProps userId: string | number */ 45870 deleteUserById: new Endpoint("user/${userId}"), 45871 /** PUT â Refuser définitivement une demande de réservation. @hostProps reservationRequestId: string | number */ 45872 denyForeverReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/deny-forever"), 45873 /** POST â Désactive une demande de réservation. @hostProps reservationRequestId: string | number */ 45874 disableReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/disabled"), 45875 /** POST â Modifier une demande de réservation (duplication serveur). @hostProps reservationRequestId: string | number */ 45876 editReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/edit"), 45877 /** PATCH â Manage the waiting line */
45878 editWaitingLineAdmin: new Endpoint("waiting-line-admin"), 45879 /** GET â Get badge contexts */ 45880 getAccessControlBadgeContexts: new Endpoint("access-control/badges"), 45881 /** GET â List access controllers */ 45882 getAccessControllers: new Endpoint("access-controller"), 45883 /** GET â Get a session. @hostProps sessionId: string | number */ 45884 getAccessControlSession: new Endpoint("access-control/sessions/${sessionId}"), 45885 /** GET â Get sessions */ 45886 getAccessControlSessions: new Endpoint("access-control/sessions"), 45887 /** GET â Accréditation PRO autorisée au public. @hostProps identifiant: string | number */ 45888 getAccreditation: new Endpoint("accreditations/${identifiant}"), 45889 /** GET â Accréditations PRO autorisées au public */ 45890 getAccreditations: new Endpoint("accreditations"), 45891 /** GET â Liste des types de structures */ 45892 getAccreditationStructuresTypes: new Endpoint("accreditations/structures_types"), 45893 /** GET â Retrieve activities */ 45894 getActivities: new Endpoint("activity"), 45895 /** GET â Retrieve an activity. @hostProps activityId: string | number */ 45896 getActivity: new Endpoint("activity/${activityId}"), 45897 /** GET â Retrieve an additional product. @hostProps additionalProductId: string | number */ 45898 getAdditionalProduct: new Endpoint("additional_products/${additionalProductId}"), 45899 /** GET â Retrieve additional products */ 45900 getAdditionalProducts: new Endpoint("additional_products"), 45901 /** GET â Récupération d'un admin. @hostProps identifiant: string | number */ 45902 getAdmin: new Endpoint("admin/${identifiant}"), 45903 /** GET â Admin navigation */ 45904 getAdminNavigation: new Endpoint("admin-navigation"), 45905 /** GET â Agenda details. @hostProps agendaId: string | number */ 45906 getAgenda: new Endpoint("agendas/${agendaId}"), 45907 /** GET â List of agendas */ 45908 getAgendas: new Endpoint("agendas"), 45909 /** GET â Get all reservations requests */ 45910 getAllReservationRequests: new Endpoint("reservation-request"), 45911 /** GET â Get all reservations */ 45912 getAllReservations: new Endpoint("reservations"), 45913 /** GET â Demande de compte professionnel. @hostProps askAccountProId: string | number */ 45914 getAskAccountProById: new Endpoint("ask_account_pro/${askAccountProId}/"), 45915 /** GET â Get banking information. @hostProps userId: string | number */ 45916 getBankingInfo: new Endpoint("user/${userId}/banking-info"), 45917 /** GET â Get campaign by hash. @hostProps hash: string | number */ 45918 getCampaign: new Endpoint("campaign/${hash}"), 45919 /** GET â Return the cart. @hostProps cartId: string | number */ 45920 getCart: new Endpoint("cart/${cartId}"), 45921 /** GET â Returns one item of a cart. @hostProps cartId: string | number; itemId: string | number */ 45922 getCartItem: new Endpoint("cart/${cartId}/items/${itemId}"), 45923 /** GET â Get compatible subscriptions for a cart item. @hostProps cartId: string | number; itemId: string | number */ 45924 getCartItemCompatibleSubscriptions: new Endpoint("cart/${cartId}/items/${itemId}/compatible-subscriptions"), 45925 /** GET â Returns the items of a cart. @hostProps cartId: string | number */ 45926 getCartItems: new Endpoint("cart/${cartId}/items"), 45927 /** GET â Get categories */ 45928 getCategories: new Endpoint("category"), 45929 /** GET â Get a category. @hostProps categoryId: string | number */ 45930 getCategory: new Endpoint("category/${categoryId}"), 45931 /** GET â Recherche d'une ville et son code postal. @hostProps search: string | number */ 45932 getCitiesBySearch: new Endpoint("cities/${search}"), 45933 /** GET â Retrieve a closing statement. @hostProps closingId: string | number */ 45934 getClosingStatement: new Endpoint("statement/closing/${closingId}"), 45935 /** GET â Retrieve closing statements. @hostProps from: number; to: number */ 45936 getClosingStatements: new Endpoint("statement/closing?from=${from}&to=${to}"), 45937 /** GET â Get user contacts. @hostProps userId: string | number */ 45938 getContacts: new Endpoint("users/${userId}/contacts"), 45939 /** GET â Initialisation du cookie (route CMS/Site) */ 45940 getCookieSession: new Endpoint("cookie_session"), 45941 /** GET â Accréditation PRO autorisée au public de la session */ 45942 getCurrentAccreditation: new Endpoint("accreditations/current"), 45943 /** GET â 678aa662989d8b6ee13b3ee1960ef370 */ 45944 getCustomForms: new Endpoint("custom-forms"), 45945 /** GET â 77dacaab8bf5fdcf138a317be4a31a66. @hostProps formId: string | number; answerSetId: string | number */ 45946 getCustomFormsByFormIdAnswerSetsById: new Endpoint("custom-forms/${formId}/answer-sets/${answerSetId}"), 45947 /** GET â 28fb49d6c176693696b28223ab77d18d. @hostProps customFormId: string | number */ 45948 getCustomFormsById: new Endpoint("custom-forms/${customFormId}"), 45949 /** GET â 6e3d8c533968efcd54e567b0396d5ac1. @hostProps customFormId: string | number */ 45950 getCustomFormsByIdAnswerSets: new Endpoint("custom-forms/${customFormId}/answer-sets"), 45951 /** GET â Get custom list. @hostProps list: string | number */ 45952 getCustomList: new Endpoint("custom-list/${list}"), 45953 /** GET â Dernières connexions des comptes administrateurs */ 45954 getDashboardLastConnections: new Endpoint("dashboard/last_connections"), 45955 /** GET â Widgets du tableau de bord */ 45956 getDashboardWidgets: new Endpoint("dashboard/widgets"), 45957 /** GET â Récupération d'évènements */ 45958 getEvents: new Endpoint("events"), 45959 /** GET â Récupération d'un évènement. @hostProps eventId: string | number */ 45960 getEventsById: new Endpoint("events/${eventId}"), 45961 /** GET â Get event status. @hostProps eventId: string | number */ 45962 getEventStatus: new Endpoint("events/${eventId}/status"), 45963 /** GET â Récupération des cartes cadeaux. @hostProps ids: string */ 45964 getGiftcards: new Endpoint("giftcards?ids=${ids}"), 45965 /** GET â Get user giftcards. @hostProps userId: string | number */ 45966 getGiftcards2: new Endpoint("user/${userId}/giftcards"), 45967 /** GET â Récupération d'une carte cadeau. @hostProps giftcardId: string | number */ 45968 getGiftcardsById: new Endpoint("giftcards/${giftcardId}"), 45969 /** GET â Test d'une carte cadeau. @hostProps code: string */ 45970 getGiftcardsTest: new Endpoint("giftcards/test?code=${code}"), 45971 /** GET â Retrieve integrity reports data by class_name. @hostProps className: string | number */ 45972 getIntegrityReport: new Endpoint("integrity_report/${className}"), 45973 /** GET â Retrieve integrity reports data */ 45974 getIntegrityReports: new Endpoint("integrity_report"), 45975 /** GET â Get a label. @hostProps labelId: string | number */ 45976 getLabel: new Endpoint("label/${labelId}"), 45977 /** GET â Get labels */ 45978 getLabels: new Endpoint("label"), 45979 /** GET â Token de session legacy */ 45980 getLegacyToken: new Endpoint("legacy/token"), 45981 /** GET â Retrieve a location. @hostProps locationId: string | number */ 45982 getLocation: new Endpoint("locations/${locationId}"), 45983 /** GET â Retrieve available locations */ 45984 getLocations: new Endpoint("locations"), 45985 /** GET â Retrieve a merch. @hostProps merchId: string | number */ 45986 getMerch: new Endpoint("merchs/${merchId}"), 45987 /** GET â Retrieve merchs */ 45988 getMerchs: new Endpoint("merchs"), 45989 /** GET â Get optin by ID. @hostProps optinId: string | number */ 45990 getOptinById: new Endpoint("optins/${optinId}"), 45991 /** GET â Get optins */ 45992 getOptins: new Endpoint("optins"), 45993 /** GET â Retrieve a transaction. @hostProps orderId: string | number */ 45994 getOrder: new Endpoint("orders/${orderId}"), 45995 /** GET â Retrieve transactions */ 45996 getOrders: new Endpoint("orders"), 45997 /** GET â Retrieve a partner. @hostProps partnerId: string | number */ 45998 getPartner: new Endpoint("partner/${partnerId}"), 45999 /** GET â Retrieve the list of partners */ 46000 getPartners: new Endpoint("partner"), 46001 /** GET â Get payment links. @hostProps quoteId: string | number */ 46002 getPaymentLinks: new Endpoint("quote/${quoteId}/payment-link"), 46003 /** GET â Recherche d'une ville et son code postal. @hostProps search: string | number */ 46004 getPostcodesBySearch: new Endpoint("postcodes/${search}"), 46005 /** GET â Price details. @hostProps priceId: string | number */
46006 getPrice: new Endpoint("prices/${priceId}"), 46007 /** GET â Retrieve a producer. @hostProps producerId: string | number */ 46008 getProducer: new Endpoint("producer/${producerId}"), 46009 /** GET â List available producers */ 46010 getProducers: new Endpoint("producer"), 46011 /** GET â Récupération des codes promos */ 46012 getPromotionCode: new Endpoint("promotion-code"), 46013 /** GET â Get a purchase. @hostProps purchaseId: string | number */ 46014 getPurchase: new Endpoint("purchases/${purchaseId}"), 46015 /** GET â List purchases */ 46016 getPurchases: new Endpoint("purchases"), 46017 /** GET â Get queue front configuration */ 46018 getQueueFrontConfig: new Endpoint("queue/front/config"), 46019 /** GET â Get queue V2 configuration and status */ 46020 getQueueInfo: new Endpoint("queue/info"), 46021 /** GET â Get queue session */ 46022 getQueueSession: new Endpoint("queue/session"), 46023 /** GET â Get queue sessions for monitoring */ 46024 getQueueSessions: new Endpoint("queue/sessions"), 46025 /** GET â Retrieve a quota. @hostProps quotaId: string | number */ 46026 getQuota: new Endpoint("quota/${quotaId}"), 46027 /** GET â Retrieve available quotas */ 46028 getQuotas: new Endpoint("quota"), 46029 /** GET â Get a quote. @hostProps quoteId: string | number */ 46030 getQuote: new Endpoint("quotes/${quoteId}"), 46031 /** GET â Récupération des devis */ 46032 getQuotes: new Endpoint("quotes"), 46033 /** GET â Get a ticketing range. @hostProps rangeId: string | number */ 46034 getRange: new Endpoint("range/${rangeId}"), 46035 /** GET â Get available ticketing ranges */ 46036 getRanges: new Endpoint("range"), 46037 /** GET â Récupèrer les informations d'une réservation. @hostProps reservationId: string | number */ 46038 getReservation: new Endpoint("reservations/${reservationId}"), 46039 /** GET â Get a specific item from a reservation. @hostProps reservationId: string | number; itemId: string | number */ 46040 getReservationItem: new Endpoint("reservations/${reservationId}/items/${itemId}"), 46041 /** GET â Get compatible subscriptions for a reservation item. @hostProps reservationId: string | number; itemId: string | number */ 46042 getReservationItemCompatibleSubscriptions: new Endpoint("reservations/${reservationId}/items/${itemId}/compatible-subscriptions"), 46043 /** GET â Get all items from a reservation. @hostProps reservationId: string | number */ 46044 getReservationItems: new Endpoint("reservations/${reservationId}/items"), 46045 /** GET â Récupèrer les informations d'une demande de réservation. @hostProps reservationRequestId: string | number */ 46046 getReservationRequest: new Endpoint("reservation-request/${reservationRequestId}"), 46047 /** GET â Get pre-reservation configuration by ID. @hostProps reservationRequestConfigId: string | number */ 46048 getReservationRequestConfigById: new Endpoint("reservation-request-config/${reservationRequestConfigId}"), 46049 /** GET â List active pre-reservation configurations */ 46050 getReservationRequestConfigs: new Endpoint("reservation-request-config"), 46051 /** GET â Get a specific item from a reservation request. @hostProps reservationRequestId: string | number; itemId: string | number */ 46052 getReservationRequestItem: new Endpoint("reservation-request/${reservationRequestId}/items/${itemId}"), 46053 /** GET â Get compatible subscriptions for a reservation request item. @hostProps reservationRequestId: string | number; itemId: string | number */ 46054 getReservationRequestItemCompatibleSubscriptions: new Endpoint("reservation-request/${reservationRequestId}/items/${itemId}/compatible-subscriptions"), 46055 /** GET â Get all items from a reservation request. @hostProps reservationRequestId: string | number */ 46056 getReservationRequestItems: new Endpoint("reservation-request/${reservationRequestId}/items"), 46057 /** GET â Get reservation request treatment index for shows. @hostProps showId: string */ 46058 getReservationRequestTreatment: new Endpoint("reservation-request/treatment?show_id[]=${showId}"), 46059 /** GET â Get a room. @hostProps roomId: string | number */ 46060 getRoom: new Endpoint("room/${roomId}"), 46061 /** GET â Get rooms */ 46062 getRooms: new Endpoint("room"), 46063 /** GET â Récupération des saisons disponibles */ 46064 getSeason: new Endpoint("season"), 46065 /** GET â Récupération de la saison en cours. @hostProps filter: string | number | "past" | "current" | "next" */ 46066 getSeasonByFilter: new Endpoint("season/${filter}"),
46067 /** GET â Récupération d'une saison. @hostProps seasonId: string | number */ 46068 getSeasonById: new Endpoint("season/${seasonId}"), 46069 /** GET â Get a session. @hostProps sessionId: string | number */ 46070 getSession: new Endpoint("sessions/${sessionId}"), 46071 /** GET â Get sessions */ 46072 getSessions: new Endpoint("sessions"), 46073 /** GET â Settings de la billetterie */ 46074 getSettings: new Endpoint("settings"), 46075 /** GET â List shows */ 46076 getShows: new Endpoint("shows"), 46077 /** GET â Get a show. @hostProps showId: string | number */ 46078 getShowsById: new Endpoint("shows/${showId}"), 46079 /** GET â Retrieve shows related to the provided one. @hostProps showId: string | number */ 46080 getShowsRelated: new Endpoint("shows/${showId}/related"), 46081 /** GET â Get shows status. @hostProps showId: string | number */ 46082 getShowStatus: new Endpoint("shows/${showId}/status"), 46083 /** GET â getStatsPassControlMatrix. @hostProps seasonId: string | number */ 46084 getStatsPassControlMatrix: new Endpoint("stats/pass-control-matrix/${seasonId}"), 46085 /** GET â Retrieve structure types */ 46086 getStructureTypes: new Endpoint("structures-types"), 46087 /** GET â Retrieve a subscription. @hostProps subscriptionId: string | number */ 46088 getSubscription: new Endpoint("subscriptions/${subscriptionId}"), 46089 /** GET â Retrieve subscriptions */ 46090 getSubscriptions: new Endpoint("subscriptions"), 46091 /** GET â Retrieve a subscription type. @hostProps subscriptionTypeId: string | number */ 46092 getSubscriptionType: new Endpoint("subscription-types/${subscriptionTypeId}"), 46093 /** GET â Retrieve subscription types */ 46094 getSubscriptionTypes: new Endpoint("subscription-types"), 46095 /** GET â Récupération du thème */ 46096 getTheme: new Endpoint("theme"), 46097 /** GET â Retrieve a ticket. @hostProps ticketId: string | number */ 46098 getTicket: new Endpoint("tickets/${ticketId}"), 46099 /** GET â Retrieve tickets */ 46100 getTickets: new Endpoint("tickets"), 46101 /** GET â Génère un token d'accès à l'API */ 46102 getToken: new Endpoint("token"), 46103 /** GET â Récupération de libellés */ 46104 getTranslate: new Endpoint("translate"), 46105 /** GET â Get users */ 46106 getUser: new Endpoint("user"), 46107 /** GET â Get user. @hostProps userId: string | number */ 46108 getUser2: new Endpoint("user/${userId}"), 46109 /** GET â Get user orders. @hostProps userId: string | number */ 46110 getUserByIdOrders: new Endpoint("user/${userId}/orders"), 46111 /** GET â Get a user's purchases. @hostProps userId: string | number */ 46112 getUserByIdPurchases: new Endpoint("user/${userId}/purchases"), 46113 /** GET â Get a user's purchases by product type. @hostProps userId: string | number; type: string | number | "event" | "subscribe" | "merch" | "giftcard" | "additionalProduct" | "" */ 46114 getUserByIdPurchasesByType: new Endpoint("user/${userId}/purchases/${type}"), 46115 /** GET â Logout */ 46116 getUserLogout: new Endpoint("user/logout"), 46117 /** GET â Consume magic login link. @hostProps token: string */ 46118 getUserMagicLogin: new Endpoint("user/magic-login?token=${token}"), 46119 /** GET â Get position in waiting line */ 46120 getWaitingLine: new Endpoint("waiting-line"), 46121 /** GET â Retrieve information about the current config of the waiting line */ 46122 getWaitingLineConfig: new Endpoint("waiting-line-admin"), 46123 /** GET â Check if user has access to a password-protected pre-reservation configuration. @hostProps reservationRequestConfigId: string | number */ 46124 hasAccessReservationRequestConfig: new Endpoint("reservation-request-config/${reservationRequestConfigId}/has-access"), 46125 /** POST â Création ou mise à jour d'un contact pro avec le CRM. @hostProps type: string | number */ 46126 importCrmPro: new Endpoint("crm-import/${type}"), 46127 /** POST â Link items to a subscription. @hostProps cartId: string | number */ 46128 linkCartItems: new Endpoint("cart/${cartId}/link"), 46129 /** POST â Link ticket to user account */ 46130 linkTicketToAccount: new Endpoint("tickets/link-to-account"), 46131 /** POST â Verrouiller une réservation. @hostProps reservationId: string | number */ 46132 lockReservation: new Endpoint("reservations/${reservationId}/lock"), 46133 /** POST â Verrouiller une demande de réservation. @hostProps reservationRequestId: string | number */ 46134 lockReservationReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/lock"), 46135 /** POST â Login custom list */ 46136 loginCustomList: new Endpoint("custom-list/login"), 46137 /** PATCH â Update an activity. @hostProps activityId: string | number */ 46138 patchActivity: new Endpoint("activity/${activityId}"), 46139 /** PATCH â Modifier le quota préféré d'un admin. @hostProps identifiant: string | number */ 46140 patchAdmin: new Endpoint("admin/${identifiant}"), 46141 /** PATCH â Patch an item of a cart. @hostProps cartId: string | number; itemId: string | number */ 46142 patchCartItem: new Endpoint("cart/${cartId}/items/${itemId}"), 46143 /** PATCH â Patch items of a cart. @hostProps cartId: string | number */ 46144 patchCartItems: new Endpoint("cart/${cartId}/items"), 46145 /** PATCH â Update a category. @hostProps categoryId: string | number */ 46146 patchCategory: new Endpoint("category/${categoryId}"), 46147 /** PATCH â f5fb3f90f173ff88171038d515bbe7c5. @hostProps formId: string | number; answerSetId: string | number */ 46148 patchCustomFormsByFormIdAnswerSetsById: new Endpoint("custom-forms/${formId}/answer-sets/${answerSetId}"), 46149 /** PATCH â Update a label. @hostProps labelId: string | number */ 46150 patchLabel: new Endpoint("label/${labelId}"), 46151 /** PATCH â Update a producer. @hostProps producerId: string | number */ 46152 patchProducer: new Endpoint("producer/${producerId}"), 46153 /** PATCH â Modify a quota. @hostProps quotaId: string | number */ 46154 patchQuota: new Endpoint("quota/${quotaId}"), 46155 /** PATCH â Partially update a reservation. @hostProps reservationId: string | number */ 46156 patchReservation: new Endpoint("reservations/${reservationId}"), 46157 /** PATCH â Met à jour un item d'une réservation. @hostProps reservationId: string | number; itemId: string | number */ 46158 patchReservationItem: new Endpoint("reservations/${reservationId}/items/${itemId}"), 46159 /** PATCH â Met à jour des items d'une réservation (selon une recherche). @hostProps reservationId: string | number */ 46160 patchReservationItems: new Endpoint("reservations/${reservationId}/items"), 46161 /** PATCH â Partially update a reservation request. @hostProps reservationRequestId: string | number */ 46162 patchReservationRequest: new Endpoint("reservation-request/${reservationRequestId}"), 46163 /** PATCH â Met à jour un item d'une demande de réservation. @hostProps reservationRequestId: string | number; itemId: string | number */ 46164 patchReservationRequestItem: new Endpoint("reservation-request/${reservationRequestId}/items/${itemId}"), 46165 /** PATCH â Met à jour des items d'une demande réservation (selon une recherche). @hostProps reservationRequestId: string | number */ 46166 patchReservationRequestItems: new Endpoint("reservation-request/${reservationRequestId}/items"), 46167 /** PATCH â Update a subscription. @hostProps subscriptionId: string | number */ 46168 patchSubscription: new Endpoint("subscriptions/${subscriptionId}"), 46169 /** POST â Create an activity */ 46170 postActivity: new Endpoint("activity"), 46171 /** POST â Creates a new cart */ 46172 postCart: new Endpoint("cart"), 46173 /** POST â Apply discount to cart */ 46174 postCartDiscount: new Endpoint("cart/discount"), 46175 /** POST â Add items to a cart. @hostProps cartId: string | number */ 46176 postCartItems: new Endpoint("cart/${cartId}/items"), 46177 /** POST â Create a category */ 46178 postCategory: new Endpoint("category"), 46179 /** POST â Ajout d'une carte cadeau */ 46180 postGiftcards: new Endpoint("giftcards"), 46181 /** POST â Lien d'une carte cadeau */ 46182 postGiftcardsLink: new Endpoint("giftcards/link"), 46183 /** POST â Create a label */ 46184 postLabel: new Endpoint("label"), 46185 /** POST â Create a producer */ 46186 postProducer: new Endpoint("producer"), 46187 /** POST â Validation d'un code promo */ 46188 postPromotionCode: new Endpoint("promotion-code"), 46189 /** POST â Create a quota */ 46190 postQuota: new Endpoint("quota"),
46191 /** POST â Create a quote */ 46192 postQuote: new Endpoint("quotes"), 46193 /** POST â Add items to a reservation. @hostProps reservationId: string | number */ 46194 postReservationItems: new Endpoint("reservations/${reservationId}/items"), 46195 /** POST â Add items to a reservation request. @hostProps reservationRequestId: string | number */ 46196 postReservationRequestItems: new Endpoint("reservation-request/${reservationRequestId}/items"), 46197 /** POST â Create user */ 46198 postUser: new Endpoint("user"), 46199 /** POST â Send account validation link */ 46200 postUserLinkValidate: new Endpoint("user/link/validate"), 46201 /** POST â Login */ 46202 postUserLogin: new Endpoint("user/login"), 46203 /** POST â Process integrity report */ 46204 processIntegrityReport: new Endpoint("integrity_report/process"), 46205 /** POST â Process integrity report (one check). @hostProps className: string | number */ 46206 processIntegrityReportByClass: new Endpoint("integrity_report/process/${className}"), 46207 /** DELETE â Purge queue sessions */ 46208 purgeQueueSessions: new Endpoint("queue/sessions"), 46209 /** PUT â Replace items of a cart. @hostProps cartId: string | number */ 46210 putCartItems: new Endpoint("cart/${cartId}/items"), 46211 /** PUT â Update user. @hostProps userId: string | number */ 46212 putUserById: new Endpoint("user/${userId}"), 46213 /** PUT â Update user password. @hostProps userId: string | number */ 46214 putUserByIdPassword: new Endpoint("user/${userId}/password"), 46215 /** PUT â Validate account */ 46216 putUserValidate: new Endpoint("user/validate"), 46217 /** POST â Récupérer les commandes d'une personne */ 46218 recoverCart: new Endpoint("recover-orders"), 46219 /** POST â Refresh banned IPs from Data */ 46220 refreshBannedIpsFromData: new Endpoint("banned_ips/refresh_from_data"), 46221 /** POST â Request login link */ 46222 requestLoginLink: new Endpoint("user/login-link"), 46223 /** POST â Forgot password */ 46224 resetPassword: new Endpoint("user/reset-password"), 46225 /** PUT â Restaurer une demande de réservation initiale. @hostProps reservationRequestId: string | number */ 46226 restoreReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/restore"), 46227 /** POST â Save cart in the database */ 46228 saveCart: new Endpoint("cart/current/save"), 46229 /** POST â Envoi d'un mail */ 46230 sendEmail: new Endpoint("email"), 46231 /** POST â Submit logs */ 46232 sendLogs: new Endpoint("log"), 46233 /** POST â Send a quote. @hostProps quoteId: string | number */ 46234 sendQuote: new Endpoint("quote/${quoteId}/send/"), 46235 /** POST â Modifier la préférence d'interface admin. @hostProps identifiant: string | number */ 46236 setAdminInterface: new Endpoint("admin/${identifiant}/interface"), 46237 /** POST â Soumet une demande de réservation. @hostProps reservationRequestId: string | number */ 46238 submitReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/submit"), 46239 /** GET â Synchronisation d'un contact pro avec le CRM. @hostProps synchro: string */ 46240 synchroCrm: new Endpoint("crm?synchro=${synchro}"), 46241 /** GET â Synchronisation d'un contact pro avec le CRM. @hostProps method: string | number; crmProId: string | number */ 46242 synchroCrmPro: new Endpoint("crm-pro/${method}/${crmProId}"), 46243 /** PUT â Débloquer une réservation. @hostProps reservationId: string | number */ 46244 unlockReservation: new Endpoint("reservations/${reservationId}/unlock"), 46245 /** PUT â Débloquer une demande de réservation. @hostProps reservationRequestId: string | number */ 46246 unlockReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/unlock"), 46247 /** POST â Unlock a password-protected pre-reservation configuration. @hostProps reservationRequestConfigId: string | number */ 46248 unlockReservationRequestConfig: new Endpoint("reservation-request-config/${reservationRequestConfigId}/login"), 46249 /** PUT â Update banking information. @hostProps userId: string | number */ 46250 updateBankingInfo: new Endpoint("user/${userId}/banking-info"), 46251 /** POST â Update queue configuration */ 46252 updateQueueConfig: new Endpoint("queue/config"), 46253 /** PATCH â Update queue session */ 46254 updateQueueSession: new Endpoint("queue/session") 46255 }; 46256 ({ 46257 contextual: { 46258 accessControlBadgeSync: endpoints.accessControlBadgeSync.getDataProviderKey(), 46259 accessControlSessionCreateTicket: endpoints.accessControlSessionCreateTicket.getDataProviderKey(), 46260 accessControlSessionSync: endpoints.accessControlSessionSync.getDataProviderKey(), 46261 accessItems: new DataProviderKey("access-control/access-items"), 46262 accreditationLogin: new DataProviderKey("accreditations/login"), 46263 accreditationsLogout: new DataProviderKey("accreditations/logout"), 46264 askRefund: new DataProviderKey("refunds/ask"), 46265 cancelSubmissionReservationRequest: endpoints.cancelSubmissionReservationRequest.getDataProviderKey(), 46266 cancelTicket: new DataProviderKey("tickets"), 46267 cancelTicketForCredit: new DataProviderKey("tickets/cancel-for-credit"), 46268 checkQueueAuthorization: new DataProviderKey("queue/authorized"), 46269 checkSeatAvailability: new DataProviderKey("seat-availability/check"), 46270 checkSubscription: new DataProviderKey("partner/check_subscription"), 46271 confirmReservation: endpoints.confirmReservation.getDataProviderKey(), 46272 confirmReservationRequest: endpoints.confirmReservationRequest.getDataProviderKey(), 46273 contactAccreditation: new DataProviderKey("accreditations/contact"), 46274 createAdminLoginLink: endpoints.createAdminLoginLink.getDataProviderKey(), 46275 createReservation: new DataProviderKey("reservations"), 46276 createReservationRequest: new DataProviderKey("reservation-request"), 46277 declineReservationRequest: endpoints.declineReservationRequest.getDataProviderKey(), 46278 deleteActivity: endpoints.deleteActivity.getDataProviderKey(),
46279 deleteCart: endpoints.deleteCart.getDataProviderKey(), 46280 deleteCartItem: endpoints.deleteCartItem.getDataProviderKey(), 46281 deleteCartItems: endpoints.deleteCartItems.getDataProviderKey(), 46282 deleteCategory: endpoints.deleteCategory.getDataProviderKey(), 46283 deleteLabel: endpoints.deleteLabel.getDataProviderKey(), 46284 deletePromotionCode: new DataProviderKey("promotion-code"), 46285 deleteQueueSession: new DataProviderKey("queue/session"), 46286 deleteQuota: endpoints.deleteQuota.getDataProviderKey(), 46287 deleteReservation: endpoints.deleteReservation.getDataProviderKey(), 46288 deleteReservationAndRestoreRequest: endpoints.deleteReservationAndRestoreRequest.getDataProviderKey(), 46289 deleteReservationItem: endpoints.deleteReservationItem.getDataProviderKey(), 46290 deleteReservationItems: endpoints.deleteReservationItems.getDataProviderKey(), 46291 deleteReservationRequest: endpoints.deleteReservationRequest.getDataProviderKey(), 46292 deleteReservationRequestItems: endpoints.deleteReservationRequestItems.getDataProviderKey(), 46293 deleteSession: endpoints.deleteSession.getDataProviderKey(), 46294 deleteUserById: endpoints.deleteUserById.getDataProviderKey(), 46295 denyForeverReservationRequest: endpoints.denyForeverReservationRequest.getDataProviderKey(), 46296 disableReservationRequest: endpoints.disableReservationRequest.getDataProviderKey(), 46297 editReservationRequest: endpoints.editReservationRequest.getDataProviderKey(), 46298 editWaitingLineAdmin: new DataProviderKey("waiting-line-admin"), 46299 getAccessControlBadgeContexts: new DataProviderKey("access-control/badges"), 46300 getAccessControllers: new DataProviderKey("access-controller"), 46301 getAccessControlSession: endpoints.getAccessControlSession.getDataProviderKey(), 46302 getAccessControlSessions: new DataProviderKey("access-control/sessions"), 46303 getAccreditation: endpoints.getAccreditation.getDataProviderKey(), 46304 getAccreditations: new DataProviderKey("accreditations"), 46305 getAccreditationStructuresTypes: new DataProviderKey("accreditations/structures_types"), 46306 getActivities: new DataProviderKey("activity"), 46307 getActivity: endpoints.getActivity.getDataProviderKey(), 46308 getAdditionalProduct: endpoints.getAdditionalProduct.getDataProviderKey(), 46309 getAdditionalProducts: new DataProviderKey("additional_products"), 46310 getAdmin: endpoints.getAdmin.getDataProviderKey(), 46311 getAdminNavigation: new DataProviderKey("admin-navigation"), 46312 getAgenda: endpoints.getAgenda.getDataProviderKey(), 46313 getAgendas: new DataProviderKey("agendas"), 46314 getAllReservationRequests: new DataProviderKey("reservation-request"), 46315 getAllReservations: new DataProviderKey("reservations"), 46316 getAskAccountProById: endpoints.getAskAccountProById.getDataProviderKey(), 46317 getBankingInfo: endpoints.getBankingInfo.getDataProviderKey(), 46318 getCampaign: endpoints.getCampaign.getDataProviderKey(), 46319 getCart: endpoints.getCart.getDataProviderKey(), 46320 getCartItem: endpoints.getCartItem.getDataProviderKey(), 46321 getCartItemCompatibleSubscriptions: endpoints.getCartItemCompatibleSubscriptions.getDataProviderKey(), 46322 getCartItems: endpoints.getCartItems.getDataProviderKey(), 46323 getCategories: new DataProviderKey("category"), 46324 getCategory: endpoints.getCategory.getDataProviderKey(), 46325 getCitiesBySearch: endpoints.getCitiesBySearch.getDataProviderKey(), 46326 getClosingStatement: endpoints.getClosingStatement.getDataProviderKey(), 46327 getClosingStatements: endpoints.getClosingStatements.getDataProviderKey(), 46328 getContacts: endpoints.getContacts.getDataProviderKey(), 46329 getCookieSession: new DataProviderKey("cookie_session"), 46330 getCurrentAccreditation: new DataProviderKey("accreditations/current"), 46331 getCustomForms: new DataProviderKey("custom-forms"), 46332 getCustomFormsByFormIdAnswerSetsById: endpoints.getCustomFormsByFormIdAnswerSetsById.getDataProviderKey(), 46333 getCustomFormsById: endpoints.getCustomFormsById.getDataProviderKey(), 46334 getCustomFormsByIdAnswerSets: endpoints.getCustomFormsByIdAnswerSets.getDataProviderKey(), 46335 getCustomList: endpoints.getCustomList.getDataProviderKey(), 46336 getDashboardLastConnections: new DataProviderKey("dashboard/last_connections"), 46337 getDashboardWidgets: new DataProviderKey("dashboard/widgets"), 46338 getEvents: new DataProviderKey("events"), 46339 getEventsById: endpoints.getEventsById.getDataProviderKey(), 46340 getEventStatus: endpoints.getEventStatus.getDataProviderKey(), 46341 getGiftcards: endpoints.getGiftcards.getDataProviderKey(), 46342 getGiftcards2: endpoints.getGiftcards2.getDataProviderKey(), 46343 getGiftcardsById: endpoints.getGiftcardsById.getDataProviderKey(), 46344 getGiftcardsTest: endpoints.getGiftcardsTest.getDataProviderKey(), 46345 getIntegrityReport: endpoints.getIntegrityReport.getDataProviderKey(), 46346 getIntegrityReports: new DataProviderKey("integrity_report"), 46347 getLabel: endpoints.getLabel.getDataProviderKey(), 46348 getLabels: new DataProviderKey("label"), 46349 getLegacyToken: new DataProviderKey("legacy/token"), 46350 getLocation: endpoints.getLocation.getDataProviderKey(), 46351 getLocations: new DataProviderKey("locations"), 46352 getMerch: endpoints.getMerch.getDataProviderKey(), 46353 getMerchs: new DataProviderKey("merchs"), 46354 getOptinById: endpoints.getOptinById.getDataProviderKey(), 46355 getOptins: new DataProviderKey("optins"), 46356 getOrder: endpoints.getOrder.getDataProviderKey(), 46357 getOrders: new DataProviderKey("orders"), 46358 getPartner: endpoints.getPartner.getDataProviderKey(), 46359 getPartners: new DataProviderKey("partner"), 46360 getPaymentLinks: endpoints.getPaymentLinks.getDataProviderKey(), 46361 getPostcodesBySearch: endpoints.getPostcodesBySearch.getDataProviderKey(),
46362 getPrice: endpoints.getPrice.getDataProviderKey(), 46363 getProducer: endpoints.getProducer.getDataProviderKey(), 46364 getProducers: new DataProviderKey("producer"), 46365 getPromotionCode: new DataProviderKey("promotion-code"), 46366 getPurchase: endpoints.getPurchase.getDataProviderKey(), 46367 getPurchases: new DataProviderKey("purchases"), 46368 getQueueFrontConfig: new DataProviderKey("queue/front/config"), 46369 getQueueInfo: new DataProviderKey("queue/info"), 46370 getQueueSession: new DataProviderKey("queue/session"), 46371 getQueueSessions: new DataProviderKey("queue/sessions"), 46372 getQuota: endpoints.getQuota.getDataProviderKey(), 46373 getQuotas: new DataProviderKey("quota"), 46374 getQuote: endpoints.getQuote.getDataProviderKey(), 46375 getQuotes: new DataProviderKey("quotes"), 46376 getRange: endpoints.getRange.getDataProviderKey(), 46377 getRanges: new DataProviderKey("range"), 46378 getReservation: endpoints.getReservation.getDataProviderKey(), 46379 getReservationItem: endpoints.getReservationItem.getDataProviderKey(), 46380 getReservationItemCompatibleSubscriptions: endpoints.getReservationItemCompatibleSubscriptions.getDataProviderKey(), 46381 getReservationItems: endpoints.getReservationItems.getDataProviderKey(), 46382 getReservationRequest: endpoints.getReservationRequest.getDataProviderKey(), 46383 getReservationRequestConfigById: endpoints.getReservationRequestConfigById.getDataProviderKey(), 46384 getReservationRequestConfigs: new DataProviderKey("reservation-request-config"), 46385 getReservationRequestItem: endpoints.getReservationRequestItem.getDataProviderKey(), 46386 getReservationRequestItemCompatibleSubscriptions: endpoints.getReservationRequestItemCompatibleSubscriptions.getDataProviderKey(), 46387 getReservationRequestItems: endpoints.getReservationRequestItems.getDataProviderKey(), 46388 getReservationRequestTreatment: endpoints.getReservationRequestTreatment.getDataProviderKey(), 46389 getRoom: endpoints.getRoom.getDataProviderKey(), 46390 getRooms: new DataProviderKey("room"), 46391 getSeason: new DataProviderKey("season"), 46392 getSeasonByFilter: endpoints.getSeasonByFilter.getDataProviderKey(), 46393 getSeasonById: endpoints.getSeasonById.getDataProviderKey(), 46394 getSession: endpoints.getSession.getDataProviderKey(), 46395 getSessions: new DataProviderKey("sessions"), 46396 getSettings: new DataProviderKey("settings"), 46397 getShows: new DataProviderKey("shows"), 46398 getShowsById: endpoints.getShowsById.getDataProviderKey(), 46399 getShowsRelated: endpoints.getShowsRelated.getDataProviderKey(), 46400 getShowStatus: endpoints.getShowStatus.getDataProviderKey(), 46401 getStatsPassControlMatrix: endpoints.getStatsPassControlMatrix.getDataProviderKey(), 46402 getStructureTypes: new DataProviderKey("structures-types"), 46403 getSubscription: endpoints.getSubscription.getDataProviderKey(), 46404 getSubscriptions: new DataProviderKey("subscriptions"), 46405 getSubscriptionType: endpoints.getSubscriptionType.getDataProviderKey(), 46406 getSubscriptionTypes: new DataProviderKey("subscription-types"), 46407 getTheme: new DataProviderKey("theme"), 46408 getTicket: endpoints.getTicket.getDataProviderKey(), 46409 getTickets: new DataProviderKey("tickets"), 46410 getToken: new DataProviderKey("token"), 46411 getTranslate: new DataProviderKey("translate"), 46412 getUser: new DataProviderKey("user"), 46413 getUser2: endpoints.getUser2.getDataProviderKey(), 46414 getUserByIdOrders: endpoints.getUserByIdOrders.getDataProviderKey(), 46415 getUserByIdPurchases: endpoints.getUserByIdPurchases.getDataProviderKey(), 46416 getUserByIdPurchasesByType: endpoints.getUserByIdPurchasesByType.getDataProviderKey(), 46417 getUserLogout: new DataProviderKey("user/logout"), 46418 getUserMagicLogin: endpoints.getUserMagicLogin.getDataProviderKey(), 46419 getWaitingLine: new DataProviderKey("waiting-line"), 46420 getWaitingLineConfig: new DataProviderKey("waiting-line-admin"), 46421 hasAccessReservationRequestConfig: endpoints.hasAccessReservationRequestConfig.getDataProviderKey(), 46422 importCrmPro: endpoints.importCrmPro.getDataProviderKey(), 46423 linkCartItems: endpoints.linkCartItems.getDataProviderKey(), 46424 linkTicketToAccount: new DataProviderKey("tickets/link-to-account"), 46425 lockReservation: endpoints.lockReservation.getDataProviderKey(), 46426 lockReservationReservationRequest: endpoints.lockReservationReservationRequest.getDataProviderKey(), 46427 loginCustomList: new DataProviderKey("custom-list/login"), 46428 patchActivity: endpoints.patchActivity.getDataProviderKey(), 46429 patchAdmin: endpoints.patchAdmin.getDataProviderKey(), 46430 patchCartItem: endpoints.patchCartItem.getDataProviderKey(), 46431 patchCartItems: endpoints.patchCartItems.getDataProviderKey(), 46432 patchCategory: endpoints.patchCategory.getDataProviderKey(), 46433 patchCustomFormsByFormIdAnswerSetsById: endpoints.patchCustomFormsByFormIdAnswerSetsById.getDataProviderKey(), 46434 patchLabel: endpoints.patchLabel.getDataProviderKey(), 46435 patchProducer: endpoints.patchProducer.getDataProviderKey(), 46436 patchQuota: endpoints.patchQuota.getDataProviderKey(), 46437 patchReservation: endpoints.patchReservation.getDataProviderKey(), 46438 patchReservationItem: endpoints.patchReservationItem.getDataProviderKey(), 46439 patchReservationItems: endpoints.patchReservationItems.getDataProviderKey(), 46440 patchReservationRequest: endpoints.patchReservationRequest.getDataProviderKey(), 46441 patchReservationRequestItem: endpoints.patchReservationRequestItem.getDataProviderKey(), 46442 patchReservationRequestItems: endpoints.patchReservationRequestItems.getDataProviderKey(), 46443 patchSubscription: endpoints.patchSubscription.getDataProviderKey(), 46444 postActivity: new DataProviderKey("activity"), 46445 postCart: new DataProviderKey("cart"), 46446 postCartDiscount: new DataProviderKey("cart/discount"), 46447 postCartItems: endpoints.postCartItems.getDataProviderKey(), 46448 postCategory: new DataProviderKey("category"), 46449 postGiftcards: new DataProviderKey("giftcards"), 46450 postGiftcardsLink: new DataProviderKey("giftcards/link"), 46451 postLabel: new DataProviderKey("label"), 46452 postProducer: new DataProviderKey("producer"), 46453 postPromotionCode: new DataProviderKey("promotion-code"), 46454 postQuota: new DataProviderKey("quota"),
46455 postQuote: new DataProviderKey("quotes"), 46456 postReservationItems: endpoints.postReservationItems.getDataProviderKey(), 46457 postReservationRequestItems: endpoints.postReservationRequestItems.getDataProviderKey(), 46458 postUser: new DataProviderKey("user"), 46459 postUserLinkValidate: new DataProviderKey("user/link/validate"), 46460 postUserLogin: new DataProviderKey("user/login"), 46461 processIntegrityReport: new DataProviderKey("integrity_report/process"), 46462 processIntegrityReportByClass: endpoints.processIntegrityReportByClass.getDataProviderKey(), 46463 purgeQueueSessions: new DataProviderKey("queue/sessions"), 46464 putCartItems: endpoints.putCartItems.getDataProviderKey(), 46465 putUserById: endpoints.putUserById.getDataProviderKey(), 46466 putUserByIdPassword: endpoints.putUserByIdPassword.getDataProviderKey(), 46467 putUserValidate: new DataProviderKey("user/validate"), 46468 recoverCart: new DataProviderKey("recover-orders"), 46469 refreshBannedIpsFromData: new DataProviderKey("banned_ips/refresh_from_data"), 46470 requestLoginLink: new DataProviderKey("user/login-link"), 46471 resetPassword: new DataProviderKey("user/reset-password"), 46472 restoreReservationRequest: endpoints.restoreReservationRequest.getDataProviderKey(), 46473 saveCart: new DataProviderKey("cart/current/save"), 46474 sendEmail: new DataProviderKey("email"), 46475 sendLogs: new DataProviderKey("log"), 46476 sendQuote: endpoints.sendQuote.getDataProviderKey(), 46477 setAdminInterface: endpoints.setAdminInterface.getDataProviderKey(), 46478 submitReservationRequest: endpoints.submitReservationRequest.getDataProviderKey(), 46479 synchroCrm: endpoints.synchroCrm.getDataProviderKey(), 46480 synchroCrmPro: endpoints.synchroCrmPro.getDataProviderKey(), 46481 unlockReservation: endpoints.unlockReservation.getDataProviderKey(), 46482 unlockReservationRequest: endpoints.unlockReservationRequest.getDataProviderKey(), 46483 unlockReservationRequestConfig: endpoints.unlockReservationRequestConfig.getDataProviderKey(), 46484 updateBankingInfo: endpoints.updateBankingInfo.getDataProviderKey(), 46485 updateQueueConfig: new DataProviderKey("queue/config"), 46486 updateQueueSession: new DataProviderKey("queue/session") 46487 }, 46488 generic: { 46489 accessControlBadgeSync: new DataProviderKey("access-control/badges/generic/sync"), 46490 accessControlSessionCreateTicket: new DataProviderKey("access-control/sessions/generic/tickets"), 46491 accessControlSessionSync: new DataProviderKey("access-control/sessions/generic/sync"), 46492 accessItems: new DataProviderKey("access-control/access-items"), 46493 accreditationLogin: new DataProviderKey("accreditations/login"), 46494 accreditationsLogout: new DataProviderKey("accreditations/logout"), 46495 askRefund: new DataProviderKey("refunds/ask"), 46496 cancelSubmissionReservationRequest: new DataProviderKey("reservation-request/generic/cancel-submission"), 46497 cancelTicket: new DataProviderKey("tickets"), 46498 cancelTicketForCredit: new DataProviderKey("tickets/cancel-for-credit"), 46499 checkQueueAuthorization: new DataProviderKey("queue/authorized"), 46500 checkSeatAvailability: new DataProviderKey("seat-availability/check"), 46501 checkSubscription: new DataProviderKey("partner/check_subscription"), 46502 confirmReservation: new DataProviderKey("reservations/generic/confirm"), 46503 confirmReservationRequest: new DataProviderKey("reservation-request/generic/confirm"), 46504 contactAccreditation: new DataProviderKey("accreditations/contact"), 46505 createAdminLoginLink: new DataProviderKey("admin/generic/login-link"), 46506 createReservation: new DataProviderKey("reservations"), 46507 createReservationRequest: new DataProviderKey("reservation-request"), 46508 declineReservationRequest: new DataProviderKey("reservation-request/generic/decline"), 46509 deleteActivity: new DataProviderKey("activity/generic"), 46510 deleteCart: new DataProviderKey("cart/generic"), 46511 deleteCartItem: new DataProviderKey("cart/generic/items/generic"), 46512 deleteCartItems: new DataProviderKey("cart/generic/items"),
46513 deleteCategory: new DataProviderKey("categories/generic"), 46514 deleteLabel: new DataProviderKey("label/generic"), 46515 deletePromotionCode: new DataProviderKey("promotion-code"), 46516 deleteQueueSession: new DataProviderKey("queue/session"), 46517 deleteQuota: new DataProviderKey("quota/generic"), 46518 deleteReservation: new DataProviderKey("reservations/generic"), 46519 deleteReservationAndRestoreRequest: new DataProviderKey("reservations/generic/delete-and-restore-request"), 46520 deleteReservationItem: new DataProviderKey("reservations/generic/items/generic"), 46521 deleteReservationItems: new DataProviderKey("reservations/generic/items"), 46522 deleteReservationRequest: new DataProviderKey("reservation-request/generic"), 46523 deleteReservationRequestItems: new DataProviderKey("reservation-request/generic/items"), 46524 deleteSession: new DataProviderKey("sessions/generic"), 46525 deleteUserById: new DataProviderKey("user/generic"), 46526 denyForeverReservationRequest: new DataProviderKey("reservation-request/generic/deny-forever"), 46527 disableReservationRequest: new DataProviderKey("reservation-request/generic/disabled"), 46528 editReservationRequest: new DataProviderKey("reservation-request/generic/edit"), 46529 editWaitingLineAdmin: new DataProviderKey("waiting-line-admin"), 46530 getAccessControlBadgeContexts: new DataProviderKey("access-control/badges"), 46531 getAccessControllers: new DataProviderKey("access-controller"), 46532 getAccessControlSession: new DataProviderKey("access-control/sessions/generic"), 46533 getAccessControlSessions: new DataProviderKey("access-control/sessions"), 46534 getAccreditation: new DataProviderKey("accreditations/generic"), 46535 getAccreditations: new DataProviderKey("accreditations"), 46536 getAccreditationStructuresTypes: new DataProviderKey("accreditations/structures_types"), 46537 getActivities: new DataProviderKey("activity"), 46538 getActivity: new DataProviderKey("activity/generic"), 46539 getAdditionalProduct: new DataProviderKey("additional_products/generic"), 46540 getAdditionalProducts: new DataProviderKey("additional_products"), 46541 getAdmin: new DataProviderKey("admin/generic"), 46542 getAdminNavigation: new DataProviderKey("admin-navigation"), 46543 getAgenda: new DataProviderKey("agendas/generic"), 46544 getAgendas: new DataProviderKey("agendas"), 46545 getAllReservationRequests: new DataProviderKey("reservation-request"), 46546 getAllReservations: new DataProviderKey("reservations"), 46547 getAskAccountProById: new DataProviderKey("ask_account_pro/generic/"), 46548 getBankingInfo: new DataProviderKey("user/generic/banking-info"), 46549 getCampaign: new DataProviderKey("campaign/generic"), 46550 getCart: new DataProviderKey("cart/generic"), 46551 getCartItem: new DataProviderKey("cart/generic/items/generic"), 46552 getCartItemCompatibleSubscriptions: new DataProviderKey("cart/generic/items/generic/compatible-subscriptions"), 46553 getCartItems: new DataProviderKey("cart/generic/items"), 46554 getCategories: new DataProviderKey("category"), 46555 getCategory: new DataProviderKey("category/generic"), 46556 getCitiesBySearch: new DataProviderKey("cities/generic"), 46557 getClosingStatement: new DataProviderKey("statement/closing/generic"), 46558 getClosingStatements: new DataProviderKey("statement/closing?from=generic&to=generic"), 46559 getContacts: new DataProviderKey("users/generic/contacts"), 46560 getCookieSession: new DataProviderKey("cookie_session"), 46561 getCurrentAccreditation: new DataProviderKey("accreditations/current"), 46562 getCustomForms: new DataProviderKey("custom-forms"), 46563 getCustomFormsByFormIdAnswerSetsById: new DataProviderKey("custom-forms/generic/answer-sets/generic"), 46564 getCustomFormsById: new DataProviderKey("custom-forms/generic"), 46565 getCustomFormsByIdAnswerSets: new DataProviderKey("custom-forms/generic/answer-sets"), 46566 getCustomList: new DataProviderKey("custom-list/generic"), 46567 getDashboardLastConnections: new DataProviderKey("dashboard/last_connections"), 46568 getDashboardWidgets: new DataProviderKey("dashboard/widgets"), 46569 getEvents: new DataProviderKey("events"), 46570 getEventsById: new DataProviderKey("events/generic"), 46571 getEventStatus: new DataProviderKey("events/generic/status"), 46572 getGiftcards: new DataProviderKey("giftcards?ids=generic"), 46573 getGiftcards2: new DataProviderKey("user/generic/giftcards"), 46574 getGiftcardsById: new DataProviderKey("giftcards/generic"), 46575 getGiftcardsTest: new DataProviderKey("giftcards/test?code=generic"), 46576 getIntegrityReport: new DataProviderKey("integrity_report/generic"), 46577 getIntegrityReports: new DataProviderKey("integrity_report"), 46578 getLabel: new DataProviderKey("label/generic"), 46579 getLabels: new DataProviderKey("label"), 46580 getLegacyToken: new DataProviderKey("legacy/token"), 46581 getLocation: new DataProviderKey("locations/generic"), 46582 getLocations: new DataProviderKey("locations"), 46583 getMerch: new DataProviderKey("merchs/generic"), 46584 getMerchs: new DataProviderKey("merchs"), 46585 getOptinById: new DataProviderKey("optins/generic"), 46586 getOptins: new DataProviderKey("optins"), 46587 getOrder: new DataProviderKey("orders/generic"), 46588 getOrders: new DataProviderKey("orders"), 46589 getPartner: new DataProviderKey("partner/generic"), 46590 getPartners: new DataProviderKey("partner"), 46591 getPaymentLinks: new DataProviderKey("quote/generic/payment-link"), 46592 getPostcodesBySearch: new DataProviderKey("postcodes/generic"),
46593 getPrice: new DataProviderKey("prices/generic"), 46594 getProducer: new DataProviderKey("producer/generic"), 46595 getProducers: new DataProviderKey("producer"), 46596 getPromotionCode: new DataProviderKey("promotion-code"), 46597 getPurchase: new DataProviderKey("purchases/generic"), 46598 getPurchases: new DataProviderKey("purchases"), 46599 getQueueFrontConfig: new DataProviderKey("queue/front/config"), 46600 getQueueInfo: new DataProviderKey("queue/info"), 46601 getQueueSession: new DataProviderKey("queue/session"), 46602 getQueueSessions: new DataProviderKey("queue/sessions"), 46603 getQuota: new DataProviderKey("quota/generic"), 46604 getQuotas: new DataProviderKey("quota"), 46605 getQuote: new DataProviderKey("quotes/generic"), 46606 getQuotes: new DataProviderKey("quotes"), 46607 getRange: new DataProviderKey("range/generic"), 46608 getRanges: new DataProviderKey("range"), 46609 getReservation: new DataProviderKey("reservations/generic"), 46610 getReservationItem: new DataProviderKey("reservations/generic/items/generic"), 46611 getReservationItemCompatibleSubscriptions: new DataProviderKey("reservations/generic/items/generic/compatible-subscriptions"), 46612 getReservationItems: new DataProviderKey("reservations/generic/items"), 46613 getReservationRequest: new DataProviderKey("reservation-request/generic"), 46614 getReservationRequestConfigById: new DataProviderKey("reservation-request-config/generic"), 46615 getReservationRequestConfigs: new DataProviderKey("reservation-request-config"), 46616 getReservationRequestItem: new DataProviderKey("reservation-request/generic/items/generic"), 46617 getReservationRequestItemCompatibleSubscriptions: new DataProviderKey("reservation-request/generic/items/generic/compatible-subscriptions"), 46618 getReservationRequestItems: new DataProviderKey("reservation-request/generic/items"), 46619 getReservationRequestTreatment: new DataProviderKey("reservation-request/treatment?show_id[]=generic"), 46620 getRoom: new DataProviderKey("room/generic"), 46621 getRooms: new DataProviderKey("room"), 46622 getSeason: new DataProviderKey("season"), 46623 getSeasonByFilter: new DataProviderKey("season/generic"), 46624 getSeasonById: new DataProviderKey("season/generic"), 46625 getSession: new DataProviderKey("sessions/generic"), 46626 getSessions: new DataProviderKey("sessions"), 46627 getSettings: new DataProviderKey("settings"), 46628 getShows: new DataProviderKey("shows"), 46629 getShowsById: new DataProviderKey("shows/generic"), 46630 getShowsRelated: new DataProviderKey("shows/generic/related"), 46631 getShowStatus: new DataProviderKey("shows/generic/status"), 46632 getStatsPassControlMatrix: new DataProviderKey("stats/pass-control-matrix/generic"), 46633 getStructureTypes: new DataProviderKey("structures-types"), 46634 getSubscription: new DataProviderKey("subscriptions/generic"), 46635 getSubscriptions: new DataProviderKey("subscriptions"), 46636 getSubscriptionType: new DataProviderKey("subscription-types/generic"), 46637 getSubscriptionTypes: new DataProviderKey("subscription-types"), 46638 getTheme: new DataProviderKey("theme"), 46639 getTicket: new DataProviderKey("tickets/generic"), 46640 getTickets: new DataProviderKey("tickets"), 46641 getToken: new DataProviderKey("token"), 46642 getTranslate: new DataProviderKey("translate"), 46643 getUser: new DataProviderKey("user"), 46644 getUser2: new DataProviderKey("user/generic"), 46645 getUserByIdOrders: new DataProviderKey("user/generic/orders"), 46646 getUserByIdPurchases: new DataProviderKey("user/generic/purchases"), 46647 getUserByIdPurchasesByType: new DataProviderKey("user/generic/purchases/generic"), 46648 getUserLogout: new DataProviderKey("user/logout"), 46649 getUserMagicLogin: new DataProviderKey("user/magic-login?token=generic"), 46650 getWaitingLine: new DataProviderKey("waiting-line"), 46651 getWaitingLineConfig: new DataProviderKey("waiting-line-admin"), 46652 hasAccessReservationRequestConfig: new DataProviderKey("reservation-request-config/generic/has-access"), 46653 importCrmPro: new DataProviderKey("crm-import/generic"), 46654 linkCartItems: new DataProviderKey("cart/generic/link"), 46655 linkTicketToAccount: new DataProviderKey("tickets/link-to-account"), 46656 lockReservation: new DataProviderKey("reservations/generic/lock"), 46657 lockReservationReservationRequest: new DataProviderKey("reservation-request/generic/lock"), 46658 loginCustomList: new DataProviderKey("custom-list/login"), 46659 patchActivity: new DataProviderKey("activity/generic"), 46660 patchAdmin: new DataProviderKey("admin/generic"), 46661 patchCartItem: new DataProviderKey("cart/generic/items/generic"), 46662 patchCartItems: new DataProviderKey("cart/generic/items"), 46663 patchCategory: new DataProviderKey("category/generic"), 46664 patchCustomFormsByFormIdAnswerSetsById: new DataProviderKey("custom-forms/generic/answer-sets/generic"), 46665 patchLabel: new DataProviderKey("label/generic"), 46666 patchProducer: new DataProviderKey("producer/generic"), 46667 patchQuota: new DataProviderKey("quota/generic"), 46668 patchReservation: new DataProviderKey("reservations/generic"), 46669 patchReservationItem: new DataProviderKey("reservations/generic/items/generic"), 46670 patchReservationItems: new DataProviderKey("reservations/generic/items"), 46671 patchReservationRequest: new DataProviderKey("reservation-request/generic"), 46672 patchReservationRequestItem: new DataProviderKey("reservation-request/generic/items/generic"), 46673 patchReservationRequestItems: new DataProviderKey("reservation-request/generic/items"), 46674 patchSubscription: new DataProviderKey("subscriptions/generic"), 46675 postActivity: new DataProviderKey("activity"), 46676 postCart: new DataProviderKey("cart"), 46677 postCartDiscount: new DataProviderKey("cart/discount"), 46678 postCartItems: new DataProviderKey("cart/generic/items"), 46679 postCategory: new DataProviderKey("category"), 46680 postGiftcards: new DataProviderKey("giftcards"), 46681 postGiftcardsLink: new DataProviderKey("giftcards/link"), 46682 postLabel: new DataProviderKey("label"), 46683 postProducer: new DataProviderKey("producer"), 46684 postPromotionCode: new DataProviderKey("promotion-code"), 46685 postQuota: new DataProviderKey("quota"),
46686 postQuote: new DataProviderKey("quotes"), 46687 postReservationItems: new DataProviderKey("reservations/generic/items"), 46688 postReservationRequestItems: new DataProviderKey("reservation-request/generic/items"), 46689 postUser: new DataProviderKey("user"), 46690 postUserLinkValidate: new DataProviderKey("user/link/validate"), 46691 postUserLogin: new DataProviderKey("user/login"), 46692 processIntegrityReport: new DataProviderKey("integrity_report/process"), 46693 processIntegrityReportByClass: new DataProviderKey("integrity_report/process/generic"), 46694 purgeQueueSessions: new DataProviderKey("queue/sessions"), 46695 putCartItems: new DataProviderKey("cart/generic/items"), 46696 putUserById: new DataProviderKey("user/generic"), 46697 putUserByIdPassword: new DataProviderKey("user/generic/password"), 46698 putUserValidate: new DataProviderKey("user/validate"), 46699 recoverCart: new DataProviderKey("recover-orders"), 46700 refreshBannedIpsFromData: new DataProviderKey("banned_ips/refresh_from_data"), 46701 requestLoginLink: new DataProviderKey("user/login-link"), 46702 resetPassword: new DataProviderKey("user/reset-password"), 46703 restoreReservationRequest: new DataProviderKey("reservation-request/generic/restore"), 46704 saveCart: new DataProviderKey("cart/current/save"), 46705 sendEmail: new DataProviderKey("email"), 46706 sendLogs: new DataProviderKey("log"), 46707 sendQuote: new DataProviderKey("quote/generic/send/"), 46708 setAdminInterface: new DataProviderKey("admin/generic/interface"), 46709 submitReservationRequest: new DataProviderKey("reservation-request/generic/submit"), 46710 synchroCrm: new DataProviderKey("crm?synchro=generic"), 46711 synchroCrmPro: new DataProviderKey("crm-pro/generic/generic"), 46712 unlockReservation: new DataProviderKey("reservations/generic/unlock"), 46713 unlockReservationRequest: new DataProviderKey("reservation-request/generic/unlock"), 46714 unlockReservationRequestConfig: new DataProviderKey("reservation-request-config/generic/login"), 46715 updateBankingInfo: new DataProviderKey("user/generic/banking-info"), 46716 updateQueueConfig: new DataProviderKey("queue/config"), 46717 updateQueueSession: new DataProviderKey("queue/session") 46718 } 46719 }); 46720 const FALLBACK_LIST_PATH = { 46721 [CartType.WaitingLists]: "waiting-lists", 46722 [CartType.Cart]: "cart" 46723 }; 46724 function listPathForCartType(type) { 46725 switch (type) { 46726 case CartType.ReservationRequest: 46727 return endpoints.getAllReservationRequests.path; 46728 case CartType.Reservation: 46729 return endpoints.getAllReservations.path; 46730 default: 46731 return FALLBACK_LIST_PATH[type] ?? "cart"; 46732 } 46733 } 46734 const TREATMENT_CART_STATUSES = [ 46735 ReservationStatus.Pending, 46736 ReservationStatus.Draft, 46737 ReservationStatus.PartiallyProcessed, 46738 ReservationStatus.Confirmed, 46739 ReservationStatus.Declined, 46740 ReservationStatus.Submitted 46741 ]; 46742 function getCartEndpoint(options) { 46743 const { 46744 type, 46745 userId, 46746 statuses, 46747 limit, 46748 isQueue, 46749 sessionIds, 46750 multisessionId, 46751 updatedAfter, 46752 updatedBefore, 46753 ids, 46754 forTreatment, 46755 sort 46756 } = options; 46757 const params = new URLSearchParams(); 46758 params.set("type[]", type); 46759 if (forTreatment) { 46760 TREATMENT_CART_STATUSES.forEach((status) => { 46761 params.append("status[]", status); 46762 }); 46763 } else { 46764 statuses?.forEach((status) => { 46765 params.append("status[]", status); 46766 }); 46767 } 46768 sessionIds?.forEach((sessionId) => { 46769 params.append("session_id[]", sessionId.toString()); 46770 }); 46771 if (multisessionId) { 46772 params.set("multisession_id", multisessionId.toString()); 46773 } 46774 if (userId) { 46775 params.set("buyer[uid]", userId.toString()); 46776 } 46777 if (ids?.length) { 46778 params.set("ids", ids.join(",")); 46779 params.set("limit", String(ids.length)); 46780 } 46781 if (updatedAfter) { 46782 const updatedAfterToTimestamp = Math.floor(updatedAfter.getTime() / 1e3); 46783 params.set("updated_after", updatedAfterToTimestamp.toString()); 46784 } 46785 if (updatedBefore) { 46786 const updatedBeforeToTimestamp = Math.floor(updatedBefore.getTime() / 1e3); 46787 params.set("updated_before", updatedBeforeToTimestamp.toString()); 46788 } 46789 if (sort) { 46790 params.set("sort", sort); 46791 } 46792 const limitParam = limit ? `&limit=${limit}` : ""; 46793 const queueParams = isQueue ? `&limit=$limit&offset=$offset` : ""; 46794 return `${listPathForCartType(type)}?${params.toString()}${queueParams}${limitParam}`; 46795 } 46796 async function getUserCarts(element, options) { 46797 const { cartType, userId, statuses, limit, isQueue, sessionIds, multisessionId, updatedAfter, updatedBefore } = options; 46798 const endpoint = getCartEndpoint({ 46799 type: cartType, 46800 userId, 46801 statuses, 46802 limit, 46803 isQueue, 46804 sessionIds, 46805 multisessionId, 46806 updatedAfter, 46807 updatedBefore 46808 }); 46809 if (!userId || !endpoint) return []; 46810 const api2 = new API(HTML$1.getApiConfiguration(element)); 46811 const result = await api2.get(endpoint); 46812 if (result?.data && result.success) { 46813 return result.data; 46814 } 46815 return []; 46816 } 46817 var __defProp$1J = Object.defineProperty; 46818 var __getOwnPropDesc$1L = Object.getOwnPropertyDescriptor; 46819 var __decorateClass$1L = (decorators, target, key, kind) => { 46820 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1L(target, key) : target; 46821 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 46822 if (decorator = decorators[i2]) 46823 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 46824 if (kind && result) __defProp$1J(target, key, result); 46825 return result; 46826 }; 46827 let SonicCartFull$1 = class SonicCartFull extends Subscriber$1(i$6) { 46828 constructor() { 46829 super(...arguments); 46830 this.layout = "default"; 46831 this.mode = "default"; 46832 this.goBack = false;
46833 this.noCartActions = false; 46834 this.payment_link_hash = null; 46835 this.readOnly = false; 46836 this.maxHeight = false; 46837 this.displaySummary = false; 46838 this.noDetailButton = false; 46839 this.title = ""; 46840 this.summary = "icon"; 46841 this.cartType = CartType.Cart; 46842 this.subTitle = ""; 46843 this.text = ""; 46844 this.cartProvider = "cart/current"; 46845 this._waitingListModuleEnabled = false; 46846 this.cancelCart = () => { 46847 const api2 = new API(this.getApiConfiguration()); 46848 api2.delete("/cart/cancel", {}).then(() => dp("cart/current").invalidate()); 46849 }; 46850 this.isWaiting = false; 46851 this._hasWaitingList = false; 46852 } 46853 connectedCallback() { 46854 this.cartProvider = this.getAncestorAttributeValue("cartProvider") || "cart/current"; 46855 super.connectedCallback(); 46856 } 46857 willUpdate(_changedProperties) { 46858 super.willUpdate(_changedProperties); 46859 if (_changedProperties.has("readOnly")) { 46860 if (this.readOnly) { 46861 this.mode = "readonly"; 46862 } 46863 } 46864 if (_changedProperties.has("payment_link_hash")) { 46865 if (this.payment_link_hash) { 46866 this.mode = "readonly"; 46867 } 46868 } 46869 if (_changedProperties.has("userId") && _changedProperties.has("_waitingListModuleEnabled")) { 46870 if (this.userId && this._waitingListModuleEnabled) { 46871 this.updateWaitingList(); 46872 } 46873 } 46874 } 46875 async updateWaitingList() { 46876 const fourHoursAgo = new Date(Date.now() - 4 * 60 * 60 * 1e3); 46877 const userWaitingLists = await getUserCarts(this, { 46878 cartType: CartType.WaitingLists, 46879 userId: Number(this.userId), 46880 statuses: [ReservationStatus.Submitted], 46881 limit: 1, 46882 updatedAfter: fourHoursAgo 46883 }); 46884 this._hasWaitingList = userWaitingLists.length > 0; 46885 } 46886 async firstUpdated() { 46887 if (!this.props && this.cartProvider !== "cart/current") { 46888 const api2 = new API(HTML.getApiConfiguration(this)); 46889 await Cart.updateCart(api2, this.cartProvider); 46890 } 46891 } 46892 render() { 46893 if (this.isWaiting) return A$1; 46894 const urlCartRecover = appRoute("checkout"); 46895 const paymentHash = this.payment_link_hash; 46896 if (urlCartRecover.hasHash() && paymentHash) { 46897 urlCartRecover.query({ cart_id: paymentHash }); 46898 } else if (paymentHash) { 46899 urlCartRecover.appendPath(paymentHash); 46900 } 46901 if (this.cartType == "cart" && paymentHash) 46902 return b$1` 46903 ${this.renderTitle()} 46904 <div class="@container my-12"> 46905 <div class="mb-2 flex flex-col gap-2 "> 46906 <div class="flex gap-2"> 46907 <sonic-icon 46908 library="custom" 46909 prefix="solid" 46910 name="circle-exclamation" 46911 class="text-lg @xl:text-xl @2xl:text-2xl" 46912 ></sonic-icon> 46913 <div class=" flex-grow"> 46914 <div class="text-lg @xl:text-xl @2xl:text-2xl leading-none font-bold mb-6"> 46915 ${t("waiting_cart_message")} 46916 </div> 46917 <sonic-cart-summary></sonic-cart-summary> 46918 <div class="flex items-center gap-x-3 mt-2"> 46919 <sonic-cart-total class="text-lg font-bold"></sonic-cart-total> 46920 <sonic-pop> 46921 <sonic-button shape="circle" size="xs" icon> 46922 <sonic-icon library="custom" name="angle-down"></sonic-icon 46923 ></sonic-button> 46924 <div slot="content" class="content w-[80vw] max-w-[20rem] p-3"> 46925 <sonic-cart-items 46926 mode="readonly" 46927 layout="condensed" 46928 noCartActions 46929 maxHeight="40vh" 46930 ></sonic-cart-items> 46931 </div> 46932 </sonic-pop> 46933 </div> 46934 </div> 46935 </div> 46936 </div> 46937 <div class="flex gap-2 flex-col items-center justify-center mt-6"> 46938 <sonic-button href="${urlCartRecover}" type="success" class="w-full "> 46939 <sonic-icon library="custom" name="arrow-right"></sonic-icon>
46940 <span class="font-bold"> ${t("waiting_cart_continue")} </span> 46941 </sonic-button> 46942 <sonic-button variant="ghost" size="xs" @click="${this.cancelCart}"> 46943 <sonic-icon library="iconoir" name="trash"></sonic-icon> 46944 ${t("waiting_cart_cancel")} 46945 </sonic-button> 46946 </div> 46947 </div> 46948 `; 46949 return b$1` 46950 <!-- Contenu du panier et bouton de soumission --> 46951 <sonic-cart-items 46952 layout=${this.layout} 46953 displaySummary 46954 ?readOnly=${this.readOnly} 46955 ?maxHeight=${this.maxHeight} 46956 ?noAdditionalProducts=${this.readOnly} 46957 ?noDetailButton=${this.noDetailButton} 46958 > 46959 <div class="mb-2" slot="title"> 46960 ${this.renderTitle()} 46961 ${this.text || this.subTitle ? b$1` 46962 <sonic-alert status="info" class="text-left mt-6 mb-4" label="${this.subTitle}" size="sm" background> 46963 ${this.text ? b$1`${o$6(this.text)}` : A$1} 46964 </sonic-alert> 46965 ` : A$1} 46966 </div> 46967 46968 ${this.renderWaitingMessage()} 46969 </sonic-cart-items> 46970 46971 ${this.noCartActions ? A$1 : b$1`<sonic-cart-actions></sonic-cart-actions>`} 46972 `; 46973 } 46974 renderWaitingMessage() { 46975 if (this.cartType !== CartType.Cart || !this._hasWaitingList) return A$1; 46976 return b$1`<sonic-alert 46977 slot="actions" 46978 noIcon 46979 class="text-center my-2 text-info" 46980 size="sm" 46981 background 46982 label="${t("LIB_waiting_list_message_cart")}" 46983 > 46984 <sonic-button 46985 autoActive="strict" 46986 variant="outline" 46987 size="xs" 46988 type="info" 46989 href=${appRoute("account.waitingLists")} 46990 > 46991 <sonic-icon library="custom" name="list-ol"> </sonic-icon> ${t("LIB_mes_listes_d_attente")} 46992 </sonic-button> 46993 </sonic-alert> `; 46994 } 46995 renderTitle() { 46996 const isCondensed = this.layout == "condensed"; 46997 return b$1` 46998 <div 46999 class="${isCondensed ? "text-xl lg:text-2xl" : "text-2xl lg:text-2xl xl:text-3xl "} flex gap-2 items-center text-left " 47000 > 47001 ${this.goBack ? b$1` 47002 <sonic-button goBack=${appRoute("home")} icon shape="circle" class="mr-1"> 47003 <sonic-icon library="custom" name="arrow-left"></sonic-icon> 47004 </sonic-button> 47005 ` : A$1} 47006 <div class="flex items-center gap-2"> 47007 <sonic-reservation-icon class="relative z-20" noRemainingTime></sonic-reservation-icon> 47008 <div class="font-bold leading-none">${cartTitle(this.cartType)}</div> 47009 </div> 47010 </div> 47011 `; 47012 } 47013 }; 47014 SonicCartFull$1.styles = [ 47015 tailwind, 47016 i$9` 47017 :host { 47018 display: block; 47019 max-width: 90ch; 47020 } 47021 :host([fullWidth]) { 47022 max-width: none; 47023 } 47024 ` 47025 ]; 47026 __decorateClass$1L([ 47027 e$2({ context: layoutContext }), 47028 n$5({ type: String }) 47029 ], SonicCartFull$1.prototype, "layout", 2); 47030 __decorateClass$1L([ 47031 e$2({ context: modeContext }), 47032 n$5({ type: String }) 47033 ], SonicCartFull$1.prototype, "mode", 2); 47034 __decorateClass$1L([ 47035 n$5({ type: Boolean }) 47036 ], SonicCartFull$1.prototype, "goBack", 2); 47037 __decorateClass$1L([ 47038 n$5({ type: Boolean }) 47039 ], SonicCartFull$1.prototype, "noCartActions", 2); 47040 __decorateClass$1L([ 47041 n$5({ type: String }) 47042 ], SonicCartFull$1.prototype, "payment_link_hash", 2); 47043 __decorateClass$1L([ 47044 n$5({ type: Boolean }) 47045 ], SonicCartFull$1.prototype, "readOnly", 2); 47046 __decorateClass$1L([ 47047 n$5({ type: Boolean }) 47048 ], SonicCartFull$1.prototype, "maxHeight", 2); 47049 __decorateClass$1L([ 47050 n$5({ type: Boolean }) 47051 ], SonicCartFull$1.prototype, "displaySummary", 2); 47052 __decorateClass$1L([ 47053 n$5({ type: Boolean }) 47054 ], SonicCartFull$1.prototype, "noDetailButton", 2); 47055 __decorateClass$1L([ 47056 n$5({ type: String, attribute: "data-title" }) 47057 ], SonicCartFull$1.prototype, "title", 2); 47058 __decorateClass$1L([ 47059 n$5({ type: String }) 47060 ], SonicCartFull$1.prototype, "summary", 2); 47061 __decorateClass$1L([ 47062 e$2({ context: cartTypeContext }), 47063 n$5({ type: String }) 47064 ], SonicCartFull$1.prototype, "cartType", 2); 47065 __decorateClass$1L([ 47066 n$5({ type: String }) 47067 ], SonicCartFull$1.prototype, "subTitle", 2); 47068 __decorateClass$1L([ 47069 n$5({ type: String }) 47070 ], SonicCartFull$1.prototype, "text", 2); 47071 __decorateClass$1L([ 47072 n$5({ type: String }) 47073 ], SonicCartFull$1.prototype, "cartProvider", 2); 47074 __decorateClass$1L([ 47075 bind$1("settings.modules.waiting_list.enabled"), 47076 r$5() 47077 ], SonicCartFull$1.prototype, "_waitingListModuleEnabled", 2); 47078 __decorateClass$1L([ 47079 bind$1("sonicTicketApp.isWaiting"), 47080 r$5() 47081 ], SonicCartFull$1.prototype, "isWaiting", 2); 47082 __decorateClass$1L([ 47083 bind$1("user.id"), 47084 r$5() 47085 ], SonicCartFull$1.prototype, "userId", 2); 47086 __decorateClass$1L([ 47087 r$5() 47088 ], SonicCartFull$1.prototype, "_hasWaitingList", 2); 47089 SonicCartFull$1 = __decorateClass$1L([ 47090 t$3("sonic-cart-full") 47091 ], SonicCartFull$1); 47092 const algorithm = "AES-CBC"; 47093 const keyLength = 256; 47094 async function generateKey() { 47095 return crypto.subtle.generateKey( 47096 { 47097 name: algorithm, 47098 length: keyLength 47099 }, 47100 true, 47101 // extractable 47102 ["encrypt", "decrypt"] 47103 ); 47104 } 47105 function toBase64(buffer) { 47106 return btoa(String.fromCharCode(...new Uint8Array(buffer))); 47107 } 47108 async function encryptToBase64(data, key, iv) {
47109 const encodedData = new TextEncoder().encode(data); 47110 const encrypted = await crypto.subtle.encrypt({ 47111 name: algorithm, 47112 iv: iv.buffer 47113 }, key, encodedData); 47114 return toBase64(encrypted); 47115 } 47116 const altchaStyles = i$9` 47117 @keyframes altcha-spinner { 47118 to { 47119 transform: rotate(360deg); 47120 } 47121 } 47122 .altcha { 47123 background: var(--altcha-color-base, transparent); 47124 display: flex; 47125 flex-direction: column; 47126 position: relative; 47127 } 47128 47129 .altcha[data-floating] { 47130 background: var(--altcha-color-base, white); 47131 display: none; 47132 filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2)); 47133 left: -100%; 47134 position: fixed; 47135 top: -100%; 47136 width: var(--altcha-max-width, 260px); 47137 z-index: 999999; 47138 } 47139 .altcha[data-floating="top"] .altcha-anchor-arrow { 47140 border-bottom-color: transparent; 47141 border-top-color: var(--altcha-color-border, #a0a0a0); 47142 bottom: -12px; 47143 top: auto; 47144 } 47145 .altcha[data-floating="bottom"]:focus-within::after { 47146 border-bottom-color: var(--altcha-color-border-focus, currentColor); 47147 } 47148 .altcha[data-floating="top"]:focus-within::after { 47149 border-top-color: var(--altcha-color-border-focus, currentColor); 47150 } 47151 .altcha[data-floating]:not([data-state="unverified"]) { 47152 display: block; 47153 } 47154 .altcha-anchor-arrow { 47155 border: 6px solid transparent; 47156 border-bottom-color: var(--altcha-color-border, #a0a0a0); 47157 content: ""; 47158 height: 0; 47159 left: 12px; 47160 position: absolute; 47161 top: -12px; 47162 width: 0; 47163 } 47164 .altcha-main { 47165 align-items: center; 47166 display: flex; 47167 gap: 0.4rem; 47168 padding: 0.7rem; 47169 position: relative; 47170 } 47171 .altcha-code-challenge { 47172 background: var(--altcha-color-base, white); 47173 border: 1px solid var(--altcha-color-border-focus, currentColor); 47174 border-radius: var(--altcha-border-radius, 3px); 47175 filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2)); 47176 padding: 0.5rem; 47177 position: absolute; 47178 top: 2.5rem; 47179 z-index: 9999999; 47180 } 47181 .altcha-code-challenge > form { 47182 display: flex; 47183 flex-direction: column; 47184 gap: 0.5rem; 47185 } 47186 .altcha-code-challenge-input { 47187 border: 1px solid currentColor; 47188 border-radius: 3px; 47189 box-sizing: border-box; 47190 outline: 0; 47191 font-size: 16px; 47192 padding: 0.35rem; 47193 width: 220px; 47194 } 47195 .altcha-code-challenge-input:focus { 47196 outline: 2px solid 47197 color-mix(in srgb, var(--altcha-color-active, #1d1dc9) 20%, transparent); 47198 } 47199 .altcha-code-challenge-input:disabled { 47200 opacity: 0.7; 47201 } 47202 .altcha-code-challenge-image { 47203 background-color: #fff; 47204 border: 1px solid currentColor; 47205 border-radius: 3px; 47206 box-sizing: border-box; 47207 object-fit: contain; 47208 height: 50px; 47209 width: 220px; 47210 } 47211 .altcha-code-challenge-audio, 47212 .altcha-code-challenge-reload { 47213 background: color-mix( 47214 in srgb, 47215 var(--altcha-color-text, currentColor) 10%, 47216 transparent 47217 ); 47218 border: 0; 47219 border-radius: 3px; 47220 color: var(--altcha-color-text, currentColor); 47221 cursor: pointer; 47222 display: flex; 47223 align-items: center; 47224 justify-content: center; 47225 padding: 0.35rem; 47226 } 47227 .altcha-code-challenge-audio:disabled, 47228 .altcha-code-challenge-reload:disabled, 47229 .altcha-code-challenge-verify:disabled { 47230 opacity: 0.7; 47231 pointer-events: none; 47232 } 47233 .altcha-code-challenge-audio > *, 47234 .altcha-code-challenge-reload > * { 47235 height: 20px; 47236 width: 20px; 47237 } 47238 .altcha-code-challenge-buttons { 47239 display: flex; 47240 justify-content: space-between; 47241 } 47242 .altcha-code-challenge-buttons-left { 47243 display: flex; 47244 gap: 0.25rem; 47245 } 47246 .altcha-code-challenge-verify { 47247 align-items: center; 47248 background: var(--altcha-color-active, #1d1dc9); 47249 border: 0; 47250 border-radius: 3px; 47251 color: #fff; 47252 cursor: pointer; 47253 display: flex; 47254 gap: 0.5rem; 47255 font-size: 100%; 47256 padding: 0.35rem 1rem; 47257 } 47258 .altcha-code-challenge-arrow { 47259 border: 6px solid transparent; 47260 border-bottom-color: var(--altcha-color-border, currentColor); 47261 content: ""; 47262 height: 0; 47263 left: 0.15rem; 47264 position: absolute; 47265 top: -12px; 47266 width: 0; 47267 } 47268 .altcha[data-floating="top"] .altcha-code-challenge { 47269 top: -150px; 47270 } 47271 .altcha[data-floating="top"] .altcha-code-challenge-arrow { 47272 border-bottom-color: transparent; 47273 border-top-color: var(--altcha-color-border, currentColor); 47274 bottom: -12px; 47275 top: auto; 47276 } 47277 .altcha-label { 47278 cursor: pointer; 47279 flex-grow: 1; 47280 line-height: 1.15; 47281 } 47282 .altcha-logo { 47283 color: currentColor !important; 47284 opacity: 0.7; 47285 } 47286 .altcha-footer:hover, 47287 .altcha-logo:hover { 47288 opacity: 1; 47289 } 47290 .altcha-error { 47291 color: var(--altcha-color-error-text, #f23939); 47292 display: flex; 47293 font-size: 0.85rem; 47294 gap: 0.3rem; 47295 padding: 0 0.7rem 0.7rem; 47296 } 47297 .altcha-footer {
47298 align-items: center; 47299 background-color: var(--altcha-color-footer-bg, transparent); 47300 display: flex; 47301 font-size: 0.75rem; 47302 opacity: 0.7; 47303 justify-content: end; 47304 padding: 0.2rem 0.7rem; 47305 } 47306 .altcha-footer a { 47307 color: currentColor; 47308 } 47309 .altcha-checkbox { 47310 display: flex; 47311 align-items: center; 47312 justify-content: center; 47313 height: 24px; 47314 position: relative; 47315 width: 24px; 47316 margin: 0; 47317 } 47318 .altcha-checkbox .altcha-spinner { 47319 bottom: 0; 47320 left: 0; 47321 position: absolute; 47322 right: 0; 47323 top: 0; 47324 } 47325 .altcha-checkbox input { 47326 width: 18px; 47327 height: 18px; 47328 margin: 0; 47329 } 47330 .altcha-checkbox-verifying input { 47331 appearance: none; 47332 opacity: 0; 47333 pointer-events: none; 47334 } 47335 .altcha-spinner { 47336 animation: altcha-spinner 0.75s infinite linear; 47337 transform-origin: center; 47338 } 47339`; 47340 var __defProp$1I = Object.defineProperty; 47341 var __getOwnPropDesc$1K = Object.getOwnPropertyDescriptor; 47342 var __decorateClass$1K = (decorators, target, key, kind) => { 47343 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1K(target, key) : target; 47344 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 47345 if (decorator = decorators[i2]) 47346 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 47347 if (kind && result) __defProp$1I(target, key, result); 47348 return result; 47349 }; 47350 const MATH_FALLBACK_KEY = "math_fallback"; 47351 const ALTCHA_ENABLED_PATH = "settings.modules.altcha.enabled"; 47352 const CHALLENGE_URL = "https://altcha.supersoniks.org/get-challenge"; 47353 const MAX_NUMBER = 5e4; 47354 const PASS_PHRASE = "supersoniks_altcha"; 47355 const IV = "Si2\\]X8M4!n9DCLd"; 47356 const CHALLENGE_TIMEOUT_MS = 5e3; 47357 let scriptAdded = false; 47358 let LbCaptcha = class extends i$6 { 47359 constructor() { 47360 super(...arguments); 47361 this.key = ""; 47362 this.useMathFallback = false; 47363 this.mathAnswer = ""; 47364 this.captchaImgSrc = "/captcha?t=0"; 47365 this.challengeProbeDone = false; 47366 this.altchaBootstrapped = false; 47367 this.onCaptchaTokenChanged = (v2) => { 47368 if (v2 !== "request_token") return; 47369 this.formPublisher?.captchaToken.set(""); 47370 this.useMathFallback ? this.publishMath() : this.publishAltcha(); 47371 }; 47372 this.onAltchaEnabledAssign = (enabled) => this.applyAltchaAvailability(enabled); 47373 this.onLoginMessageAssign = (message) => { 47374 if (this.useMathFallback && message?.success === false) this.refreshMathChallenge(); 47375 }; 47376 this.onAltchaStateChange = (ev) => { 47377 const detail = ev.detail; 47378 if (detail?.state === "error") this.activateMathFallback(); 47379 else if (detail?.state === "verified") this.publishAltcha(); 47380 }; 47381 } 47382 connectedCallback() { 47383 if (!document.location.protocol.includes("https")) { 47384 super.connectedCallback(); 47385 return; 47386 } 47387 super.connectedCallback(); 47388 const providerPath = HTML.getAncestorAttributeValue(this, "headersDataProvider") ?? HTML.getAncestorAttributeValue(this, "formDataProvider") ?? this.getAttribute("formdataprovider"); 47389 this.formPublisher = providerPath ? dp$1(providerPath) : void 0; 47390 if (this.formPublisher && !this.formPublisher.captchaToken.get()) { 47391 this.formPublisher.needsCaptchaValidation.set(true); 47392 this.formPublisher.captchaToken.onAssign(this.onCaptchaTokenChanged); 47393 } 47394 dp$1(ALTCHA_ENABLED_PATH).onAssign(this.onAltchaEnabledAssign); 47395 dp$1("LoginMessage").onAssign(this.onLoginMessageAssign); 47396 this.applyAltchaAvailability(get$2(ALTCHA_ENABLED_PATH)); 47397 } 47398 disconnectedCallback() { 47399 dp$1(ALTCHA_ENABLED_PATH).offAssign(this.onAltchaEnabledAssign); 47400 dp$1("LoginMessage").offAssign(this.onLoginMessageAssign); 47401 if (this.formPublisher) { 47402 this.formPublisher.captchaToken.offAssign(this.onCaptchaTokenChanged); 47403 this.formPublisher.captchaToken.set(""); 47404 this.formPublisher.needsCaptchaValidation.set(false); 47405 } 47406 super.disconnectedCallback(); 47407 } 47408 applyAltchaAvailability(enabled) { 47409 if (enabled === false) { 47410 this.activateMathFallback(); 47411 return; 47412 } 47413 if (enabled !== true || this.altchaBootstrapped || this.useMathFallback) return; 47414 this.altchaBootstrapped = true; 47415 if (!scriptAdded) { 47416 const script = document.createElement("script"); 47417 script.type = "module"; 47418 script.src = "https://eu.altcha.org/js/latest/altcha.min.js"; 47419 scriptAdded = true; 47420 document.head.appendChild(script); 47421 } 47422 void generateKey().then((key) => encryptToBase64(PASS_PHRASE, key, new TextEncoder().encode(IV))).then((encrypted) => { 47423 if (!this.key) this.key = encrypted; 47424 }).catch(() => this.activateMathFallback()); 47425 } 47426 updated(changed) { 47427 if (changed.has("key") && this.key && !this.useMathFallback && !this.challengeProbeDone) { 47428 this.challengeProbeDone = true; 47429 const url = `${CHALLENGE_URL}?key=${encodeURIComponent(this.key)}&maxNumber=${MAX_NUMBER}`; 47430 const ctrl = new AbortController(); 47431 const timer = window.setTimeout(() => ctrl.abort(), CHALLENGE_TIMEOUT_MS); 47432 void fetch(url, { signal: ctrl.signal }).then((r2) => { 47433 if (!r2.ok) this.activateMathFallback(); 47434 }).catch(() => this.activateMathFallback()).finally(() => window.clearTimeout(timer)); 47435 } 47436 if (this.useMathFallback && (changed.has("mathAnswer") || changed.has("useMathFallback"))) { 47437 this.publishMath(); 47438 } 47439 } 47440 activateMathFallback() { 47441 if (this.useMathFallback) return; 47442 this.useMathFallback = true;
47443 this.refreshMathChallenge(); 47444 } 47445 refreshMathChallenge() { 47446 this.mathAnswer = ""; 47447 this.captchaImgSrc = `/captcha?t=${Date.now()}`; 47448 this.publishMath(); 47449 } 47450 publishAltcha() { 47451 if (!this.formPublisher || this.useMathFallback) return; 47452 const form2 = this.shadowRoot?.querySelector("form"); 47453 if (!form2) return; 47454 this.formPublisher.captchaKey.set(this.key); 47455 this.formPublisher.captchaToken.set(new FormData(form2).get("altcha")?.toString() || ""); 47456 } 47457 publishMath() { 47458 if (!this.formPublisher) return; 47459 this.formPublisher.captchaKey.set(MATH_FALLBACK_KEY); 47460 this.formPublisher.captchaToken.set(this.mathAnswer.trim()); 47461 } 47462 render() { 47463 if (this.useMathFallback) { 47464 const label2 = t("LIB_combien_font"); 47465 const hint = t("LIB_question_securite"); 47466 return b$1` 47467 <div class="grid gap-2 text-left max-w-[260px] mb-2"> 47468 <label> 47469 ${label2} 47470 <img class="align-middle ml-1.5" src=${this.captchaImgSrc} alt=${hint} width="100" height="40" /> 47471 </label> 47472 <input 47473 class="border border-[var(--sc-input-border-color,var(--sc-base-content,#000))] rounded-[var(--sc-rounded)] px-2.5 py-1.5 text-[var(--sc-base-content,#000)] bg-[var(--sc-base)]" 47474 type="text" 47475 inputmode="numeric" 47476 autocomplete="off" 47477 required 47478 .value=${this.mathAnswer} 47479 @input=${(ev) => { 47480 this.mathAnswer = ev.target.value; 47481 }} 47482 /> 47483 <div class="text-sm opacity-80">${hint}</div> 47484 </div> 47485 <slot></slot> 47486 `; 47487 } 47488 if (!this.key) return b$1`<slot></slot>`; 47489 const isFR = Boolean(HTML.getLanguage().match("^fr\\b")); 47490 const labels = isFR ? { 47491 aria: "Visitez altcha.org", 47492 error: "La vérification a échoué, réessayez plus tard.", 47493 expired: "La vérification a expiré, réessayez.", 47494 footer: "Protégé par Altcha", 47495 label: "Je ne suis pas un robot.", 47496 verified: "Vérifié", 47497 verifying: "Vérification en cours...", 47498 wait: "Vérification en cours⦠Veuillez patienter." 47499 } : {}; 47500 return b$1` 47501 <form> 47502 <altcha-widget 47503 challengeurl="${CHALLENGE_URL}?key=${encodeURIComponent(this.key)}&maxNumber=${MAX_NUMBER}" 47504 maxnumber=${MAX_NUMBER} 47505 hidelogo 47506 hidefooter 47507 auto="onfocus" 47508 strings=${JSON.stringify(labels)} 47509 @statechange=${this.onAltchaStateChange} 47510 ></altcha-widget> 47511 </form> 47512 <slot></slot> 47513 `; 47514 } 47515 }; 47516 LbCaptcha.styles = [ 47517 altchaStyles, 47518 tailwind, 47519 i$9` 47520 :host { 47521 --altcha-border-width: var(--sc-border-width, 1px); 47522 --altcha-border-radius: var(--sc-rounded); 47523 --altcha-color-base: var(--sc-base); 47524 --altcha-color-border: var(--sc-input-border-color, var(--sc-base-content, #000)); 47525 --altcha-color-text: var(--sc-base-content, #000); 47526 --altcha-color-active: var(--sc-base-content, #000); 47527 --altcha-color-border-focus: currentColor; 47528 --altcha-color-error-text: var(--sc-danger, var(--sc-base-content, #000)); 47529 --altcha-color-footer-bg: var(--sc-base-100, #000); 47530 --altcha-max-width: 260px; 47531 display: block; 47532 } 47533 ` 47534 ]; 47535 __decorateClass$1K([ 47536 n$5() 47537 ], LbCaptcha.prototype, "key", 2); 47538 __decorateClass$1K([ 47539 r$5() 47540 ], LbCaptcha.prototype, "useMathFallback", 2); 47541 __decorateClass$1K([ 47542 r$5() 47543 ], LbCaptcha.prototype, "mathAnswer", 2); 47544 __decorateClass$1K([ 47545 r$5() 47546 ], LbCaptcha.prototype, "captchaImgSrc", 2); 47547 LbCaptcha = __decorateClass$1K([ 47548 t$3("lb-captcha") 47549 ], LbCaptcha); 47550 var __defProp$1H = Object.defineProperty; 47551 var __getOwnPropDesc$1J = Object.getOwnPropertyDescriptor; 47552 var __decorateClass$1J = (decorators, target, key, kind) => { 47553 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1J(target, key) : target; 47554 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 47555 if (decorator = decorators[i2]) 47556 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 47557 if (kind && result) __defProp$1H(target, key, result); 47558 return result; 47559 }; 47560 let UserFormLogin = class extends Subscriber$1(i$6) { 47561 constructor() { 47562 super(...arguments); 47563 this.createAccount = false;
47564 this.customerType = "all"; 47565 this.userId = false; 47566 this.checkout = false; 47567 this.online_payment_id = 0; 47568 this.canCheckout = false; 47569 this.quickBuyEnabled = false; 47570 this.accessAskProAccount = false; 47571 this.create_pro_account = false; 47572 this.create_client_account = true; 47573 this.cartItems = []; 47574 this.displayLoginLinkModal = false; 47575 this.loginLinkEmail = ""; 47576 this.canQuickPurchase = false; 47577 } 47578 handleLogin() { 47579 const message = PublisherManager.get("LoginMessage").get(); 47580 if (message?.success) { 47581 PublisherManager.get("user").invalidate(); 47582 const urlParams = new URLSearchParams(window.location.search); 47583 const destination = urlParams.get("sonic_login_destination"); 47584 if (destination) { 47585 const decodedDestination = decodeURIComponent(destination); 47586 if (decodedDestination.startsWith("#")) { 47587 window.location.hash = decodedDestination; 47588 } else { 47589 window.location.href = decodedDestination; 47590 } 47591 } 47592 } 47593 } 47594 handleLoginLinkResult() { 47595 const result = PublisherManager.get("user/login-link/result").get(); 47596 if (result?.success) { 47597 this.hideLoginLinkModal(); 47598 } 47599 } 47600 connectedCallback() { 47601 const urlParams = new URLSearchParams(window.location.search); 47602 if (!this.online_payment_id) { 47603 this.online_payment_id = urlParams.get("payment_id") || PublisherManager.get("settings").online_payment_id.get(); 47604 } 47605 PublisherManager.get("LoginMessage").onInternalMutation(this.handleLogin); 47606 PublisherManager.get("user/login-link/result").onInternalMutation(this.handleLoginLinkResult); 47607 super.connectedCallback(); 47608 } 47609 willUpdate(_changedProperties) { 47610 const hasCartItems = this.cartItems && this.cartItems.length > 0; 47611 this.canQuickPurchase = this.checkout && hasCartItems && this.canCheckout && this.quickBuyEnabled; 47612 super.willUpdate(_changedProperties); 47613 } 47614 render() { 47615 const defaultCreateUrl = appRoute("account.create").toString(); 47616 const defaultMissingUrl = appRoute("account.missingPassword").toString(); 47617 const checkoutQuery = { 47618 payment_id: this.online_payment_id 47619 }; 47620 const urlCreateAccount = this.checkout ? appRoute("checkout").query({ ...checkoutQuery, create_account: true }) : defaultCreateUrl; 47621 const loginDescription = t("LIB_connexion_description"); 47622 const canCreateOrAskAcount = this.create_client_account || this.accessAskProAccount || this.create_pro_account; 47623 return b$1` 47624 <sonic-login-saml></sonic-login-saml> 47625 <div class="contents"> 47626 <sonic-fieldset 47627 endpoint="user/login" 47628 dataProvider="user/login" 47629 method="post" 47630 class="mb-2 lg:mb-3" 47631 formDataProvider="userLogin" 47632 submitResultDataProvider="LoginMessage" 47633 > 47634 <sonic-legend 47635 iconLibrary="custom" 47636 iconName="face-smile-relaxed" 47637 label=${t("se_connecter")} 47638 .description=${loginDescription} 47639 > 47640 </sonic-legend> 47641 <sonic-submit usernameKey="email" onEnterKey> 47642 <div class="grid grid-cols-1 gap-4 mb-4"> 47643 <sonic-input 47644 required 47645 autocomplete="username" 47646 id="username" 47647 label="${t("email")}" 47648 type="email" 47649 name="email" 47650 ></sonic-input> 47651 <sonic-input 47652 required 47653 autocomplete="current-password" 47654 id="current-password" 47655 label="${t("mot_de_passe")}" 47656 name="password" 47657 type="password" 47658 ></sonic-input> 47659 </div> 47660 </sonic-submit> 47661 47662 <div class="text-center"> 47663 <lb-captcha formdataprovider="userLogin" class="text-left"> 47664 <sonic-submit onClick usernameKey="email" class="w-full text-center"> 47665 <sonic-button minWidth="12rem" type="success" class="w-full mb-1 lg:mb-2 mt-2"> 47666 <sonic-icon library="custom" name="arrow-right-to-arc" slot="prefix"></sonic-icon> 47667 ${t("connexion")}</sonic-button 47668 > 47669 </sonic-submit> 47670 </lb-captcha> 47671 <div class="grid grid-cols-1 gap-3 justify-center items-center mt-1"> 47672 <sonic-button size="sm" variant="link" @click=${this.showLoginLinkModal} autoActive="disabled"> 47673 ${t("LIB_magic_login_button")} 47674 </sonic-button> 47675 <sonic-button href="${defaultMissingUrl}" size="sm" variant="link" autoActive="disabled"> 47676 ${t("mot_de_passe_oublie")} 47677 </sonic-button> 47678 </div> 47679 </div> 47680 </sonic-fieldset> 47681 </div> 47682 47683 ${this.createAccount && (canCreateOrAskAcount || this.canQuickPurchase) ? b$1` 47684 <sonic-fieldset> 47685 ${canCreateOrAskAcount ? b$1` 47686 <sonic-legend 47687 description=${this.createSubTitle} 47688 label="${t("no_account_yet")}" 47689 iconName="face-thinking" 47690 iconLibrary="custom" 47691 class="mb-3" 47692 > 47693 </sonic-legend> 47694 ` : A$1} 47695 <div class="grid w-full grid-cols-1 gap-2"> 47696 ${this.customerIsAllowed() && urlCreateAccount && this.create_client_account ? b$1` 47697 <sonic-button href=${urlCreateAccount}
47697 minWidth="12rem" type="neutral" class="w-full" 47698 ><sonic-icon library="custom" name="user-plus" slot="prefix"></sonic-icon> ${t( 47699 "create_account" 47700 )}</sonic-button 47701 > 47702 ` : A$1} 47703 ${this.quickPurchaseButton()} 47704 ${this.proIsAllowed() && (this.accessAskProAccount || this.create_pro_account) ? b$1` 47705 ${this.customerType === "all" ? b$1` <sonic-divider class="my-3"></sonic-divider> ` : A$1} 47706 <div class="text-center "> 47707 <sonic-app-link 47708 to="askProAccount" 47709 type="info" 47710 minWidth="12rem" 47711 variant="default" 47712 class="w-full" 47713 > 47714 <sonic-icon library="custom" name="user-tie" slot="prefix"></sonic-icon> 47715 <span class="font-bold" 47716 >${this.accessAskProAccount ? t("LIB_compte_pro_demander") : t("LIB_compte_pro_creer")}</span 47717 > 47718 </sonic-app-link> 47719 </div> 47720 ` : A$1} 47721 </div> 47722 </sonic-fieldset> 47723 ` : A$1} 47724 ${this.renderLoginLinkModal()} 47725 `; 47726 } 47727 customerIsAllowed() { 47728 return this.customerType === "all" || this.customerType === "customer"; 47729 } 47730 proIsAllowed() { 47731 return this.customerType === "all" || this.customerType === "pros"; 47732 } 47733 renderLoginLinkModal() { 47734 return b$1` 47735 <sonic-modal @hidden=${this.hideLoginLinkModal} ?visible=${this.displayLoginLinkModal} width="30rem"> 47736 <sonic-modal-title>${t("LIB_magic_login_button")}</sonic-modal-title> 47737 <sonic-modal-subtitle class="text-pretty"> ${t("LIB_magic_login_subtitle")} </sonic-modal-subtitle> 47738 <sonic-modal-content> 47739 <div 47740 class="flex gap-3 flex-col" 47741 formdataprovider="loginLink" 47742 submitResultDataProvider="user/login-link/result" 47743 > 47744 <sonic-submit 47745 @submit=${this.handleLoginLinkSubmit} 47746 onEnterKey 47747 endPoint="user/login-link" 47748 method="post" 47749 formDataProvider="loginLink" 47750 > 47751 <sonic-input 47752 name="email" 47753 type="email" 47754 label="${t("email")}" 47755 placeholder="[email protected]" 47756 .value=${this.loginLinkEmail} 47757 ></sonic-input> 47758 </sonic-submit> 47759 47760 <sonic-submit 47761 @submit=${this.handleLoginLinkSubmit} 47762 onClick 47763 endPoint="user/login-link" 47764 method="post" 47765 formDataProvider="loginLink" 47766 class="block w-full" 47767 > 47768 <sonic-button type="primary" shape="block"> 47769 <sonic-icon name="paper-plane" library="custom"></sonic-icon> ${t("LIB_send")} 47770 </sonic-button> 47771 </sonic-submit> 47772 </div> 47773 </sonic-modal-content> 47774 </sonic-modal> 47775 `; 47776 } 47777 handleLoginLinkSubmit(e2) { 47778 if (e2.detail.success) { 47779 this.hideLoginLinkModal(); 47780 } 47781 } 47782 showLoginLinkModal() { 47783 const emailInput = this.renderRoot?.querySelector("#username"); 47784 this.loginLinkEmail = (emailInput?.value || emailInput?.getAttribute?.("value") || "").toString(); 47785 this.displayLoginLinkModal = true; 47786 } 47787 hideLoginLinkModal() { 47788 this.displayLoginLinkModal = false; 47789 } 47790 quickPurchaseButton() { 47791 const checkoutQuery = { 47792 payment_id: this.online_payment_id 47793 }; 47794 const urlQuickPurchase = appRoute("checkout").query({ 47795 ...checkoutQuery, 47796 quick_buy: true 47797 }); 47798 const hasSubscriptionInCart = this.cartItems?.some((item) => item.entity_type === EntityType.Subscribe); 47799 const displayQuickPurchaseButton = this.canQuickPurchase && urlQuickPurchase && !hasSubscriptionInCart; 47800 if (displayQuickPurchaseButton) { 47801 return b$1`<div class="text-center "> 47802 <sonic-button href=${urlQuickPurchase} variant="outline" minWidth="12rem" class="w-full" 47803 ><sonic-icon library="custom" name="cart-shopping-fast" slot="prefix"></sonic-icon> 47804 ${t("link_title_quick_purchase")} 47805 </sonic-button> 47806 </div>`; 47807 } 47808 return A$1; 47809 } 47810 }; 47811 UserFormLogin.styles = [ 47812 tailwind, 47813 i$9` 47814 :host { 47815 display: block; 47816 max-width: 25rem; 47817 } 47818 ` 47819 ]; 47820 __decorateClass$1J([ 47821 n$5({ type: Boolean }) 47822 ], UserFormLogin.prototype, "createAccount", 2); 47823 __decorateClass$1J([ 47824 n$5({ type: String }) 47825 ], UserFormLogin.prototype, "customerType", 2); 47826 __decorateClass$1J([ 47827 n$5({ type: Boolean }) 47828 ], UserFormLogin.prototype, "userId", 2); 47829 __decorateClass$1J([ 47830 n$5({ type: Boolean }) 47831 ], UserFormLogin.prototype, "checkout", 2); 47832 __decorateClass$1J([ 47833 n$5({ type: Number }) 47834 ], UserFormLogin.prototype, "online_payment_id", 2); 47835 __decorateClass$1J([ 47836 n$5({ type: String }) 47837 ], UserFormLogin.prototype, "createSubTitle", 2); 47838 __decorateClass$1J([ 47839 bind$1("cart/current.data.canCheckout"), 47840 r$5() 47841 ], UserFormLogin.prototype, "canCheckout", 2); 47842 __decorateClass$1J([ 47843 bind$1("settings.quick_purchase"), 47844 r$5() 47845 ], UserFormLogin.prototype, "quickBuyEnabled", 2); 47846 __decorateClass$1J([ 47847 bind$1("settings.modules.ask_pro_account.access"), 47848 r$5() 47849 ], UserFormLogin.prototype, "accessAskProAccount", 2); 47850 __decorateClass$1J([ 47851 bind$1("settings.modules.create_pro_account.access"), 47852 r$5() 47853 ], UserFormLogin.prototype, "create_pro_account", 2); 47854 __decorateClass$1J([ 47855 bind$1("settings.modules.create_client_account.access"), 47856 r$5() 47857 ], UserFormLogin.prototype, "create_client_account", 2); 47858 __decorateClass$1J([ 47859 bind$1("cart/current.data.items"), 47860 r$5() 47861 ], UserFormLogin.prototype, "cartItems", 2); 47862 __decorateClass$1J([ 47863 r$5() 47864 ], UserFormLogin.prototype, "displayLoginLinkModal", 2); 47865 __decorateClass$1J([ 47866 r$5() 47867 ], UserFormLogin.prototype, "loginLinkEmail", 2); 47868 __decorateClass$1J([ 47869 r$5() 47870 ], UserFormLogin.prototype, "canQuickPurchase", 2); 47871 UserFormLogin = __decorateClass$1J([ 47872 t$3("sonic-user-form-login") 47873 ], UserFormLogin); 47874 var __defProp$1G = Object.defineProperty; 47875 var __getOwnPropDesc$1I = Object.getOwnPropertyDescriptor; 47876 var __decorateClass$1I = (decorators, target, key, kind) => { 47877 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1I(target, key) : target; 47878 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 47879 if (decorator = decorators[i2]) 47880 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 47881 if (kind && result) __defProp$1G(target, key, result); 47882 return result; 47883 }; 47884 const tagName$1a = "sonic-custom-form-preview"; 47885 let SonicCustomForm = class extends i$6 { 47886 constructor() { 47887 super(...arguments); 47888 this.isCollapsed = false;
47889 } 47890 connectedCallback() { 47891 super.connectedCallback(); 47892 const lotOfValues = this.customFormValues && Object.keys(this.customFormValues).length > 4; 47893 this.isCollapsed = (this.collapsible && lotOfValues) ?? false; 47894 } 47895 render() { 47896 const noValues = Object.keys(this.customFormValues || {}).length === 0 || Object.values(this.customFormValues || {}).every((value) => value === ""); 47897 if (this.isCollapsed) { 47898 const title = this.customForm?.label ?? t("LIB_show_form_values"); 47899 return b$1`<sonic-button @click=${() => this.isCollapsed = false} shape="block" align="left"> 47900 <sonic-icon library="custom" name="file" size="lg"></sonic-icon> 47901 ${title} 47902 <sonic-icon library="custom" name="chevron-down" slot="suffix"></sonic-icon> 47903 </sonic-button>`; 47904 } 47905 return b$1` 47906 <sonic-fieldset variant=${o$4(this.variant)} class="mb-2"> 47907 ${this.displayLegends ? b$1`<sonic-legend iconLibrary="custom" iconName="circle-info"> 47908 ${this.customForm?.label} <slot name="actions" slot="suffix"></slot 47909 ></sonic-legend>` : A$1} 47910 ${noValues ? b$1`<div class="${this.size === "sm" ? "text-xs" : "text-sm"} text-neutral-400"> 47911 ${t("LIB_custom_form_no_values")} 47912 </div>` : b$1`<div class="grid grid-cols-1 ${this.size === "sm" ? "gap-3" : "gap-4"}"> 47913 ${c$1( 47914 this.customForm?.inputs || [], 47915 (input) => input.id, 47916 (input) => { 47917 if (input.type === InputType.TextSection) { 47918 return A$1; 47919 } 47920 return b$1`<div> 47921 <div 47922 class="${this.size === "sm" ? "text-xs" : "text-sm"} mb-[2px] text-neutral-500 font-medium" 47923 > 47924 ${input.label} 47925 </div> 47926 <div>${this.renderMatchingPreview(input)}</div> 47927 </div>`; 47928 } 47929 )} 47930 </div> `} 47931 </div> 47932 </sonic-fieldset> 47933 `; 47934 } 47935 renderMatchingPreview(input) { 47936 switch (input.type) { 47937 case InputType.File: 47938 return this.renderFilePreview(input); 47939 default: 47940 return this.renderDefaultPreview(input); 47941 } 47942 } 47943 renderDefaultPreview(input) { 47944 const value = this.getInputValue(input); 47945 const inputType = input.type; 47946 return b$1`<div class="max-w-[85ch] ${this.size === "sm" ? "text-sm" : "text-base"}"> 47947 ${value ? this.renderValue(inputType, value) : b$1`<div class="text-neutral-300">â</div>`} 47948 </div>`; 47949 } 47950 renderValue(inputType, value) { 47951 if (!inputType) { 47952 return value; 47953 } 47954 switch (inputType) { 47955 case InputType.Checkbox: 47956 return value ? t("oui") : t("non"); 47957 case InputType.Checkboxes: 47958 case InputType.Radio: 47959 case InputType.Select: 47960 if (Array.isArray(value)) { 47961 return value.filter((v2) => v2 !== "").map((v2) => v2).join(", "); 47962 } 47963 return value; 47964 case InputType.Date: 47965 return value ? new Date(value).toLocaleDateString("fr-FR") : "â"; 47966 default: 47967 return value; 47968 } 47969 } 47970 getInputValue(input) { 47971 return this.customFormValues?.[input.name] || ""; 47972 } 47973 renderFilePreview(input) { 47974 const value = this.getInputValue(input); 47975 const preview = Array.isArray(value) ? value.map((file) => { 47976 return b$1`<div class="relative"> 47977 <embed class="w-full h-full max-w-48 rounded-md" src=${file.data} type="${file.type}" /> 47978 <sonic-tooltip label="${t("telecharger")}" class="absolute bottom-2 right-2"> 47979 <sonic-button size="xs" shape="circle" href=${file.data} download> 47980 <sonic-icon library="custom" name="arrow-down" variant="default"></sonic-icon> 47981 </sonic-button> 47982 </sonic-tooltip> 47983 </div>`; 47984 }) : typeof value === "string" && value !== "" ? b$1`<div class="text-neutral-500 text-sm italic">${value}</div>` : void 0; 47985 return b$1`<div class="flex flex-wrap gap-4"> 47986 <div>${preview ?? b$1`<div class="text-neutral-300">â</div>`}</div> 47987 </div> `; 47988 } 47989 }; 47990 SonicCustomForm.styles = [tailwind, label]; 47991 __decorateClass$1I([ 47992 n$5({ type: Object }) 47993 ], SonicCustomForm.prototype, "customForm", 2); 47994 __decorateClass$1I([ 47995 n$5({ type: Object }) 47996 ], SonicCustomForm.prototype, "customFormValues", 2); 47997 __decorateClass$1I([ 47998 n$5({ type: String }) 47999 ], SonicCustomForm.prototype, "variant", 2); 48000 __decorateClass$1I([ 48001 n$5({ type: Boolean }) 48002 ], SonicCustomForm.prototype, "displayLegends", 2); 48003 __decorateClass$1I([ 48004 n$5({ type: String }) 48005 ], SonicCustomForm.prototype, "size", 2); 48006 __decorateClass$1I([ 48007 n$5({ type: Boolean }) 48008 ], SonicCustomForm.prototype, "collapsible", 2); 48009 __decorateClass$1I([ 48010 r$5() 48011 ], SonicCustomForm.prototype, "isCollapsed", 2); 48012 SonicCustomForm = __decorateClass$1I([ 48013 t$3(tagName$1a) 48014 ], SonicCustomForm); 48015 const renderFormData = (options) => { 48016 const { 48017 reservationRequest, 48018 reservationRequestConfig, 48019 displayLegends, 48020 size = "md", 48021 displayPassCulture = true, 48022 collapsible = false, 48023 displayTitle = true 48024 } = options; 48025 if (!reservationRequest) return A$1; 48026 const { title, publicNotes, passCulture } = reservationRequest; 48027 const renderTitle = !reservationRequestConfig?.force_request_title && displayTitle; 48028 const renderPublicNotes = !!publicNotes; 48029 const renderRequestPassCulture = !!reservationRequestConfig?.display_pass_culture && displayPassCulture; 48030 const customForms = reservationRequestConfig?.customForms ?? []; 48031 const shouldRenderMainFieldset = renderTitle || renderPublicNotes || renderRequestPassCulture; 48032 if (!shouldRenderMainFieldset && customForms.length === 0) return A$1; 48033 return b$1` 48034 ${shouldRenderMainFieldset ? b$1`<sonic-fieldset class="mb-2"> 48035 ${displayLegends ? b$1` 48036 <sonic-legend iconLibrary="custom" iconName="circle-info"> ${t("LIB_informations")} </sonic-legend> 48037 ` : A$1} 48038 <div class="grid grid-cols-1 ${size === "sm" ? "gap-3" : "gap-4"}"> 48039 <div> 48040 ${renderTitle ? b$1` 48041 <div class="${size === "sm" ? "text-xs" : "text-sm"} text-neutral-600 mb-[2px]"> 48042 ${t("LIB_nom_du_projet_du_groupe")} 48043 </div> 48044 ` : A$1} 48045 <div class="${size === "sm" ? "text-sm" : "text-base"} font-bold">${title || "â"}</div> 48046 </div> 48047 48048 ${renderPublicNotes ? b$1` 48049 <div> 48050 <div class="${size === "sm" ? "text-xs" : "text-sm"} text-neutral-600 mb-[2px]"> 48051 ${t("LIB_precisions")} 48052 </div>
48053 <span 48054 class="${size === "sm" ? "text-sm" : "text-base"} 48055 max-w-[70ch] text-pretty whitespace-pre-line block" 48056 >${publicNotes} 48057 </span> 48058 </div> 48059 ` : A$1} 48060 ${renderRequestPassCulture ? b$1` 48061 <div class="flex items-center gap-x-3"> 48062 <div>${svgPassCulture({ color: "currentColor", width: 53, height: 53 })}</div> 48063 <div> 48064 <div class="${size === "sm" ? "text-xs" : "text-sm"} text-neutral-600 mb-[2px]"> 48065 ${t("LIB_prise_en_charge_pass_culture")} 48066 </div> 48067 <span 48068 class="${size === "sm" ? "text-sm" : "text-base"} font-bold ${!passCulture?.enabled ? "text-danger" : ""}" 48069 >${passCulture?.enabled ? t("oui") : t("non")}</span 48070 > 48071 </div> 48072 </div> 48073 ` : A$1} 48074 </div> 48075 </sonic-fieldset>` : A$1} 48076 ${c$1( 48077 customForms, 48078 (customForm) => customForm.id, 48079 (customForm) => b$1`<sonic-custom-form-preview 48080 .size=${size} 48081 ?displayLegends=${displayLegends} 48082 .customForm=${customForm} 48083 .customFormValues=${reservationRequest?.[CUSTOM_FORMS_KEY]} 48084 formDataProvider="formSubscription/${reservationRequest.id}/${customForm.id}" 48085 ?collapsible=${collapsible} 48086 > 48087 </sonic-custom-form-preview>` 48088 )} 48089 `; 48090 }; 48091 var RequestMode = /* @__PURE__ */ ((RequestMode2) => { 48092 RequestMode2["Uninitialized"] = "uninitialized"; 48093 RequestMode2["Create"] = "create"; 48094 RequestMode2["UpdateData"] = "updateData"; 48095 RequestMode2["Selection"] = "selection"; 48096 RequestMode2["Ending"] = "ending"; 48097 RequestMode2["Password"] = "password"; 48098 RequestMode2["Login"] = "login"; 48099 RequestMode2["NotAuthorized"] = "notAuthorized"; 48100 return RequestMode2; 48101 })(RequestMode || {}); 48102 async function findWaitingListCart(element, options) { 48103 const { userId, statuses, sessionIds, multisessionId } = options; 48104 if (sessionIds?.length) { 48105 const carts = await getUserCarts(element, { 48106 cartType: CartType.WaitingLists, 48107 userId, 48108 statuses, 48109 sessionIds, 48110 limit: 1 48111 }); 48112 if (carts[0]) { 48113 return carts[0]; 48114 } 48115 } 48116 if (multisessionId) { 48117 const carts = await getUserCarts(element, { 48118 cartType: CartType.WaitingLists, 48119 userId, 48120 statuses, 48121 multisessionId, 48122 limit: 1 48123 }); 48124 if (carts[0]) { 48125 return carts[0]; 48126 } 48127 } 48128 const incompleteCarts = await getUserCarts(element, { 48129 cartType: CartType.WaitingLists, 48130 userId, 48131 statuses: [ReservationStatus.Incomplete], 48132 limit: 50 48133 }); 48134 return incompleteCarts.find((list) => !list.items?.length) ?? null; 48135 } 48136 const getCartMatchingItems = async (options) => { 48137 const { element, userId, statuses, entityIds, multisessionId } = options; 48138 if (!userId) return null; 48139 const cart = await findWaitingListCart(element, { 48140 userId, 48141 statuses, 48142 sessionIds: entityIds, 48143 multisessionId 48144 }); 48145 return cart?.id ?? null; 48146 }; 48147 var __defProp$1F = Object.defineProperty; 48148 var __getOwnPropDesc$1H = Object.getOwnPropertyDescriptor; 48149 var __decorateClass$1H = (decorators, target, key, kind) => { 48150 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1H(target, key) : target; 48151 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 48152 if (decorator = decorators[i2]) 48153 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 48154 if (kind && result) __defProp$1F(target, key, result); 48155 return result; 48156 }; 48157 const tagName$19 = "sonic-waiting-list-form"; 48158 let SonicWaitingListForm = class extends Subscriber$1(i$6) { 48159 constructor() { 48160 super(...arguments); 48161 this._initGeneration = 0; 48162 this.accessParams = { isWaitingList: true }; 48163 this._cartProvider = ""; 48164 this._mode = RequestMode.Uninitialized; 48165 this.isLoading = false;
48166 this.handleSelect = async (e2) => { 48167 const isRemoved = this._selectedUserId && e2.detail.uid === 0; 48168 if (isRemoved && this._cartProvider) { 48169 const api2 = new API(getDefaultApiConfiguration()); 48170 await Cart.delete(api2, this._cartProvider); 48171 } 48172 this._selectedUserId = e2.detail.uid; 48173 }; 48174 this.handleDelete = async (e2) => { 48175 const target = e2.currentTarget; 48176 const parentModal = HTML.getClosestElement(target, "sonic-modal"); 48177 if (this._cartProvider) { 48178 const api2 = new API(getDefaultApiConfiguration()); 48179 await Cart.delete(api2, this._cartProvider); 48180 } 48181 parentModal?.hide(); 48182 }; 48183 } 48184 // guichet uniquement 48185 get buyerUserId() { 48186 return this.appType === "counter" ? this._selectedUserId : this.loggedUserId ?? void 0; 48187 } 48188 get cartStatus() { 48189 return this._cartData?.status; 48190 } 48191 get cartItems() { 48192 return this._cartData?.items; 48193 } 48194 get cartType() { 48195 return this._cartData?.cartType; 48196 } 48197 get hasItemsInCart() { 48198 return (this.cartItems?.length ?? 0) > 0; 48199 } 48200 get dataProviderExpression() { 48201 const hasSessionIds = this.sessionIds?.length; 48202 return entityEndPoint({ 48203 entityType: EntityType.Event, 48204 isQueue: true, 48205 next: true, 48206 accessParams: this.accessParams, 48207 view: entityView.essential, 48208 customSearchParams: new URLSearchParams({ 48209 ...hasSessionIds ? { ids: this.sessionIds?.join(",") ?? "" } : {} 48210 }) 48211 }); 48212 } 48213 async willUpdate(changed_properties) { 48214 const buyerChanged = changed_properties.has("loggedUserId") || changed_properties.has("_selectedUserId") || changed_properties.has("appType"); 48215 const needsCartInit = buyerChanged || !this._cartProvider && (this.buyerUserId !== void 0 || this.requestId !== void 0); 48216 if (needsCartInit) { 48217 const generation = ++this._initGeneration; 48218 await this.initData(this.requestId, generation); 48219 } 48220 if (changed_properties.has("_cartData") || changed_properties.has("_cartProvider")) { 48221 this.syncSessionIdsFromCart(); 48222 } 48223 if (buyerChanged || changed_properties.has("_cartData") || changed_properties.has("_cartProvider") || changed_properties.has("appType")) { 48224 this.setMode(); 48225 } 48226 super.willUpdate(changed_properties); 48227 } 48228 syncSessionIdsFromCart() { 48229 if (!this.cartItems?.length) return; 48230 const sessionIds = this.cartItems.filter((item) => item.entity_type === EntityType.Event).map((item) => Number(item.entity_id)); 48231 if (sessionIds.length) { 48232 const arrayIds = [...this.sessionIds ?? [], ...sessionIds]; 48233 this.sessionIds = [...new Set(arrayIds)]; 48234 } 48235 } 48236 /** Détermine le mode d'affichage (login, sélection, confirmation) selon l'utilisateur et le statut du panier. */ 48237 setMode() { 48238 const suggestLogin = !this.buyerUserId; 48239 const displaySelection = !suggestLogin && this._cartProvider; 48240 const displayEnding = [ 48241 ReservationStatus.Submitted, 48242 ReservationStatus.Confirmed, 48243 ReservationStatus.PartiallyProcessed, 48244 ReservationStatus.Processed 48245 ].includes(this.cartStatus ?? ReservationStatus.Draft); 48246 if (displayEnding && this.appType === "counter") { 48247 closeParentModal(this); 48248 return; 48249 } 48250 if (!this.appType || this.isLoading) { 48251 this._mode = RequestMode.Uninitialized; 48252 } else if (displayEnding) { 48253 this._mode = RequestMode.Ending; 48254 } else if (suggestLogin) { 48255 this._mode = RequestMode.Login; 48256 } else if (displaySelection) { 48257 this._mode = RequestMode.Selection; 48258 } else { 48259 this._mode = RequestMode.Uninitialized; 48260 } 48261 } 48262 /** Charge une liste d'attente existante ou en crée une, puis met à jour le cart provider. */ 48263 async initData(forcedCartId, generation) { 48264 this.isLoading = true; 48265 let listId = forcedCartId ?? void 0; 48266 if (!listId && this.appType === "customer") { 48267 listId = await getCartMatchingItems({ 48268 element: this, 48269 cartType: CartType.WaitingLists, 48270 userId: this.buyerUserId, 48271 entityType: EntityType.Event, 48272 entityIds: this.sessionIds, 48273 statuses: [ReservationStatus.Incomplete] 48274 }); 48275 } 48276 if (!listId) { 48277 listId = await this.newWaitingList(cartProviderKey(CartType.WaitingLists), this.buyerUserId); 48278 } 48279 if (generation !== void 0 && generation !== this._initGeneration) return; 48280 this._cartProvider = cartProviderKey(CartType.WaitingLists, Number(listId)); 48281 const api2 = new API(getDefaultApiConfiguration()); 48282 await Cart.updateCart(api2, this._cartProvider); 48283 this.isLoading = false;
48284 } 48285 /** Au guichet, pré-sélectionne l'utilisateur depuis le panier lié (buyer ou email d'abonnement). */ 48286 // TODO: réactiver quand l'acheteur sera éditable/visible au guichet. 48287 // async initUserFromLinkedCart() { 48288 // if (!this.linkedCartProvider) return; 48289 // 48290 // const api = new API(getDefaultApiConfiguration()); 48291 // const result = await api.get<APIResult>(this.linkedCartProvider); 48292 // if (!result?.success || !result.data) return; 48293 // 48294 // const cart = result.data as CartAPI; 48295 // const userId = await resolveCounterBuyerUid(toCounterCartBuyerSource(cart), getDefaultApiConfiguration()); 48296 // if (userId) { 48297 // this._selectedUserId = userId; 48298 // } 48299 // } 48300 /** Crée une nouvelle liste d'attente et retourne son identifiant. */ 48301 async newWaitingList(providerKey, buyerUserId) { 48302 const result = await Cart.newCart({ 48303 apiConfiguration: getDefaultApiConfiguration(), 48304 cartProvider: providerKey, 48305 ...buyerUserId ? { buyer: { uid: buyerUserId } } : {} 48306 }); 48307 return result?.data?.id ?? null; 48308 } 48309 render() { 48310 if (!this.sessionIds && !this._cartProvider) return A$1; 48311 const displayUserToggle = this.appType === "counter" && [RequestMode.Selection, RequestMode.Login].includes(this._mode); 48312 return b$1` 48313 <sonic-page-header .label=${t("waiting_list")}> 48314 ${this.renderCancelButton()} 48315 ${this._mode === RequestMode.Selection && this.hasItemsInCart ? b$1`<sonic-alert status="info" class="mt-1">${t("LIB_waiting_list_confirm_help")}</sonic-alert>` : A$1} 48316 </sonic-page-header> 48317 <div class="min-w-0"> 48318 ${displayUserToggle ? b$1` 48319 <sonic-user-toggle 48320 .selectedId=${this._selectedUserId} 48321 @select=${this.handleSelect} 48322 class="block mb-6" 48323 canCreateAccount 48324 ></sonic-user-toggle> 48325 ` : A$1} 48326 ${r(this._mode, [ 48327 [RequestMode.Uninitialized, () => this.renderLoader()], 48328 [RequestMode.Login, () => this.renderLogin()], 48329 [RequestMode.Selection, () => this.renderSelection()], 48330 [RequestMode.Ending, () => renderEndingMessage(CartType.WaitingLists, this.appType)] 48331 ])} 48332 </div> 48333 `; 48334 } 48335 renderCancelButton() { 48336 if (this._mode === RequestMode.Ending) return A$1; 48337 if (this._mode === RequestMode.Selection && this.hasItemsInCart) { 48338 return b$1` 48339 <sonic-button @click=${(e2) => this.handleDelete(e2)} slot="actions" type="danger"> 48340 <sonic-icon name="trash" library="custom"></sonic-icon> ${t("supprimer")} 48341 </sonic-button> 48342 `; 48343 } 48344 return b$1`<sonic-button @click=${(e2) => this.handleDelete(e2)} slot="actions" shape="circle" icon size="lg"> 48345 <sonic-icon name="xmark" library="custom"></sonic-icon> 48346 </sonic-button>`; 48347 } 48348 renderHelp() { 48349 if (this.appType === "counter") { 48350 return A$1; 48351 } 48352 return b$1`<div class="text-lg mb-6 text-pretty prose -mt-3">${t("LIB_waiting_list_help", true)}</div>`; 48353 } 48354 renderLoader() { 48355 return b$1`<sonic-loader mode="inline" align="left"></sonic-loader>`; 48356 } 48357 renderSelection() { 48358 return i( 48359 this._cartProvider, 48360 this.hasItemsInCart ? b$1`<sonic-fieldset> 48361 <sonic-cart-full 48362 cartProvider="${this._cartProvider}" 48363 dataProvider="${this._cartProvider}" 48364 subdataprovider="data" 48365 class="block" 48366 ></sonic-cart-full 48367 ></sonic-fieldset>` : b$1`${this.renderHelp()} 48368 <div class="@container block" cartProvider="${this._cartProvider}">${this.renderEventCatalog()}</div>` 48369 ); 48370 } 48371 renderEventCatalog() { 48372 const hasOnlyOneSessionId = this.sessionIds && this.sessionIds.length === 1; 48373 return b$1` 48374 <sonic-queue 48375 dataProviderExpression="${this.dataProviderExpression}" 48376 key="data" 48377 class="block w-full" 48378 limit="8" 48379 targetRequestDuration="1000" 48380 .items=${() => b$1`<sonic-event-store-item 48381 showAllSessionsButton 48382 formType="select" 48383 class="mb-4 block" 48384 noActionMenu 48385 noAllSessionsButton 48386 ?alwaysExpanded=${hasOnlyOneSessionId} 48387 ></sonic-event-store-item>`} 48388 .skeleton=${() => b$1`<sonic-event-store-item skeleton></sonic-event-store-item>`} 48389 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 48390 ></sonic-queue> 48391 `; 48392 } 48393 renderLogin() { 48394 if (this.appType === "counter") { 48395 return A$1; 48396 } 48397 return b$1`${this.renderHelp()} <sonic-user-form-login createAccount></sonic-user-form-login> `; 48398 } 48399 }; 48400 SonicWaitingListForm.styles = [ 48401 tailwind, 48402 i$9` 48403 :host { 48404 display: block; 48405 min-height: 35rem; 48406 } 48407 ` 48408 ]; 48409 __decorateClass$1H([ 48410 bind$1("user.id"), 48411 n$5({ type: Number }) 48412 ], SonicWaitingListForm.prototype, "loggedUserId", 2); 48413 __decorateClass$1H([ 48414 r$5() 48415 ], SonicWaitingListForm.prototype, "_selectedUserId", 2); 48416 __decorateClass$1H([ 48417 n$5({ type: Number }) 48418 ], SonicWaitingListForm.prototype, "requestId", 2); 48419 __decorateClass$1H([ 48420 n$5({ type: Array }) 48421 ], SonicWaitingListForm.prototype, "sessionIds", 2); 48422 __decorateClass$1H([ 48423 e$2({ context: accessParamsContext }), 48424 n$5({ type: Object }) 48425 ], SonicWaitingListForm.prototype, "accessParams", 2); 48426 __decorateClass$1H([ 48427 c({ context: appType, subscribe: true }), 48428 r$5() 48429 ], SonicWaitingListForm.prototype, "appType", 2); 48430 __decorateClass$1H([ 48431 n$5({ type: String }) 48432 ], SonicWaitingListForm.prototype, "linkedCartProvider", 2); 48433 __decorateClass$1H([ 48434 r$5()
48435 ], SonicWaitingListForm.prototype, "_cartProvider", 2); 48436 __decorateClass$1H([ 48437 bind$1("${_cartProvider}.data"), 48438 r$5() 48439 ], SonicWaitingListForm.prototype, "_cartData", 2); 48440 __decorateClass$1H([ 48441 r$5() 48442 ], SonicWaitingListForm.prototype, "_mode", 2); 48443 __decorateClass$1H([ 48444 r$5() 48445 ], SonicWaitingListForm.prototype, "isLoading", 2); 48446 SonicWaitingListForm = __decorateClass$1H([ 48447 t$3(tagName$19) 48448 ], SonicWaitingListForm); 48449 var __defProp$1E = Object.defineProperty; 48450 var __getOwnPropDesc$1G = Object.getOwnPropertyDescriptor; 48451 var __decorateClass$1G = (decorators, target, key, kind) => { 48452 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1G(target, key) : target; 48453 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 48454 if (decorator = decorators[i2]) 48455 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 48456 if (kind && result) __defProp$1E(target, key, result); 48457 return result; 48458 }; 48459 const tagName$18 = "sonic-waiting-list-button"; 48460 let SonicWaitingListButton = class extends Subscriber$1(i$6) { 48461 constructor() { 48462 super(...arguments); 48463 this.id = ""; 48464 this.handleClick = () => { 48465 Modal.create({ 48466 forceAction: true, 48467 content: b$1`<sonic-waiting-list-form 48468 .sessionIds=${[Number(this.id)]} 48469 .linkedCartProvider=${this.cartProvider} 48470 ></sonic-waiting-list-form>`, 48471 maxWidth: "60rem" 48472 }); 48473 }; 48474 this._hasIncompleteWaitingList = false; 48475 } 48476 get isEnabled() { 48477 return !!this.props?.settings?.waiting_list?.enabled; 48478 } 48479 async willUpdate(_changedProperties) { 48480 if (_changedProperties.has("userId") || _changedProperties.has("props")) { 48481 if (this.isEnabled && this.userId) { 48482 const matchingCart = await getCartMatchingItems({ 48483 element: this, 48484 cartType: CartType.WaitingLists, 48485 userId: this.userId, 48486 entityType: EntityType.Event, 48487 entityIds: [Number(this.id)], 48488 statuses: [ReservationStatus.Incomplete] 48489 }); 48490 this._hasIncompleteWaitingList = !!matchingCart; 48491 } else { 48492 this._hasIncompleteWaitingList = false; 48493 } 48494 } 48495 } 48496 render() { 48497 if (!this.id || !this.isEnabled) return A$1; 48498 return b$1`<div class="inline-flex relative"> 48499 ${this._hasIncompleteWaitingList ? b$1`<sonic-badge 48500 type="danger" 48501 size="2xs" 48502 class="absolute -top-1 -left-1 z-[2] pointer-events-none animate-heartbeat" 48503 >!</sonic-badge 48504 >` : A$1} 48505 <sonic-button 48506 type="primary" 48507 variant=${o$4(this.variant)} 48508 size=${o$4(this.size)} 48509 to="waitingList" 48510 class="relative" 48511 @click=${this.handleClick} 48512 noAutofill 48513 > 48514 <sonic-icon library="custom" name="list-ol" slot="prefix"></sonic-icon> 48515 <span class="font-bold">${t("waiting_list")}</span> 48516 </sonic-button> 48517 </div>`; 48518 } 48519 }; 48520 SonicWaitingListButton.styles = [tailwind]; 48521 __decorateClass$1G([ 48522 bind$1("settings.modules.waiting_list.enabled"), 48523 n$5({ type: Boolean }) 48524 ], SonicWaitingListButton.prototype, "hasWaitingList", 2); 48525 __decorateClass$1G([ 48526 n$5({ type: Number }) 48527 ], SonicWaitingListButton.prototype, "id", 2); 48528 __decorateClass$1G([ 48529 n$5({ type: String }) 48530 ], SonicWaitingListButton.prototype, "size", 2); 48531 __decorateClass$1G([ 48532 n$5({ type: String }) 48533 ], SonicWaitingListButton.prototype, "variant", 2); 48534 __decorateClass$1G([ 48535 ancestorAttribute("cartProvider"), 48536 r$5() 48537 ], SonicWaitingListButton.prototype, "cartProvider", 2); 48538 __decorateClass$1G([ 48539 bind$1("user.id"), 48540 r$5() 48541 ], SonicWaitingListButton.prototype, "userId", 2); 48542 __decorateClass$1G([ 48543 r$5() 48544 ], SonicWaitingListButton.prototype, "_hasIncompleteWaitingList", 2); 48545 SonicWaitingListButton = __decorateClass$1G([ 48546 t$3(tagName$18) 48547 ], SonicWaitingListButton); 48548 var __defProp$1D = Object.defineProperty; 48549 var __getOwnPropDesc$1F = Object.getOwnPropertyDescriptor; 48550 var __decorateClass$1F = (decorators, target, key, kind) => { 48551 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1F(target, key) : target; 48552 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 48553 if (decorator = decorators[i2]) 48554 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 48555 if (kind && result) __defProp$1D(target, key, result); 48556 return result; 48557 };
48558 let CategorizedPrices = class extends EventContext(Subscriber$1(i$6)) { 48559 constructor() { 48560 super(...arguments); 48561 this.buyMode = BuyMode.DEFAULT; 48562 this.categoryId = 0; 48563 this.infos_status = {}; 48564 this.disabled = false; 48565 this.type = null; 48566 this.formType = "select"; 48567 this.size = "lg"; 48568 this.buttonType = ""; 48569 this.room = {}; 48570 this.stock = {}; 48571 this.loading = false; 48572 this.wording_LIB_add_to_cart = ""; 48573 this.someItemSelected = false; 48574 this.formItemsDataProvider = ""; 48575 this._pricesFilterSubscribedPath = null; 48576 this.onPricesFilterMutation = () => { 48577 this.requestUpdate(); 48578 }; 48579 this.updateSubmitBtnStatus = () => { 48580 const itemQuantities = Object.values(PublisherManager.get(this.formItemsDataProvider).get()); 48581 this.someItemSelected = itemQuantities.some((quantity) => quantity); 48582 }; 48583 this.places_categories = []; 48584 this._hasPricesDisplayed = false; 48585 } 48586 get props() { 48587 return super.props; 48588 } 48589 set props(value) { 48590 super.props = value; 48591 this.addDefaultPrices(); 48592 this.requestUpdate(); 48593 } 48594 /** Publisher du filtre tarifs pour le path couramment souscrit (évite de répéter `PublisherManager.get`). */ 48595 get subscribedPricesFilterPublisher() { 48596 const path = this._pricesFilterSubscribedPath; 48597 return path ? PublisherManager.get(path) : void 0; 48598 } 48599 syncPricesFilterSubscription() { 48600 const id = this.props?.id; 48601 if (!id) { 48602 this.subscribedPricesFilterPublisher?.offInternalMutation(this.onPricesFilterMutation); 48603 this._pricesFilterSubscribedPath = null; 48604 return; 48605 } 48606 const path = "product/" + id + "/PricesFilter"; 48607 if (this._pricesFilterSubscribedPath === path) return; 48608 this.subscribedPricesFilterPublisher?.offInternalMutation(this.onPricesFilterMutation); 48609 this._pricesFilterSubscribedPath = path; 48610 this.subscribedPricesFilterPublisher?.onInternalMutation(this.onPricesFilterMutation); 48611 } 48612 recomputeHasPricesDisplayed() { 48613 if (!this.props?.id) { 48614 this._hasPricesDisplayed = false; 48615 return; 48616 } 48617 const filter = PublisherManager.get("product/" + this.props.id + "/PricesFilter").get(); 48618 const placeCategories = this.categoryId ? this.places_categories.filter((c2) => c2.id == this.categoryId) : this.places_categories; 48619 this._hasPricesDisplayed = placeCategories.some((c2) => computeFilteredPrices(c2.items, filter).length > 0); 48620 } 48621 connectedCallback() { 48622 super.connectedCallback(); 48623 this._initialSelectedQuota = structuredClone(this.selectedQuota); 48624 this.formItemsDataProvider = this.dataProvider + "/price-form-items"; 48625 PublisherManager.get(this.formItemsDataProvider).onInternalMutation(this.updateSubmitBtnStatus); 48626 } 48627 disconnectedCallback() { 48628 super.disconnectedCallback(); 48629 PublisherManager.get(this.formItemsDataProvider).offInternalMutation(this.updateSubmitBtnStatus); 48630 this.subscribedPricesFilterPublisher?.offInternalMutation(this.onPricesFilterMutation); 48631 this._pricesFilterSubscribedPath = null; 48632 } 48633 willUpdate(properties) { 48634 if (properties.has("places_categories")) { 48635 this.addDefaultPrices(); 48636 } 48637 if (properties.has("selectedQuota")) { 48638 this.resetSelection(); 48639 } 48640 this.syncPricesFilterSubscription(); 48641 this.recomputeHasPricesDisplayed(); 48642 super.willUpdate(properties); 48643 } 48644 addDefaultPrices() { 48645 this.places_categories.forEach((category) => this.injectPrices(category)); 48646 if (this.places_categories.length == 0 && this.props && this.props.prices) 48647 this.places_categories.push({ items: this.props.prices || [] }); 48648 } 48649 injectPrices(category) { 48650 category.items = this.props?.prices?.filter( 48651 (price) => !price.place_category?.id || price.place_category.id == category.id 48652 ); 48653 } 48654 async addToCart() { 48655 this.loading = true; 48656 const entity_id = this.props?.id ? parseInt(this.props.id.toString()) : 0; 48657 const filter = PublisherManager.getInstance().get("product/" + entity_id + "/PricesFilter").get(); 48658 let currentQuota = filter.selectedQuota; 48659 if (!currentQuota && filter.quotas) { 48660 currentQuota = filter.quotas[0]; 48661 } 48662 const cartItems = []; 48663 let quota; 48664 if (currentQuota) { 48665 quota = { 48666 id: parseInt(currentQuota.id) 48667 }; 48668 } 48669 const itemSelects = Object.entries(PublisherManager.get(this.formItemsDataProvider).get()); 48670 for (const [price_id, price_quantity] of itemSelects) { 48671 if (price_quantity > 0) { 48672 const cartItem = { 48673 entity_type: this.type || void 0, 48674 entity_id, 48675 quantity: Number(price_quantity), 48676 price: { id: Number(price_id) }, 48677 quota 48678 }; 48679 cartItems.push(cartItem); 48680 } 48681 } 48682 const cartProvider = this.cartProvider; 48683 await Cart.addItems({ 48684 apiConfiguration: this.getApiConfiguration(), 48685 cartProvider, 48686 items: cartItems, 48687 attachOwnersAfterRequest: true, 48688 editFreePriceAfterRequest: true,
48689 auto_seating: isAutoseatingMode(this.buyMode), 48690 accessParams: this.accessParams ?? void 0 48691 }); 48692 this.resetSelection(); 48693 this.loading = false; 48694 } 48695 resetSelection() { 48696 const formPublisher = PublisherManager.get(this.formItemsDataProvider); 48697 const formData = PublisherManager.get(this.formItemsDataProvider).get(); 48698 Object.keys(formData).forEach((key) => { 48699 if (formData[key] > 0) { 48700 formPublisher[key].set(""); 48701 } 48702 }); 48703 } 48704 noPriceMessage(placeCategories) { 48705 const noItems = this.places_categories.length > 0 && this.places_categories.every((c2) => c2.items?.length == 0) || placeCategories.every((c2) => c2.items?.length == 0); 48706 if (!noItems) return A$1; 48707 if (!isSeatMode(this.buyMode)) return A$1; 48708 return b$1`<div class="text-neutral-500 text-center"> 48709 <sonic-icon name="circle-info" library="custom"></sonic-icon> ${t("no_price_available")} 48710 </div>`; 48711 } 48712 render() { 48713 if (!this.props) return A$1; 48714 const hasSeatmap = this.room && ["place", "mixte"].includes(this.room.placing_type_key || ""); 48715 const accessType = getAccessType(this.accessParams); 48716 const isWaitingListContext = accessType === AccessType.WAITING_LIST; 48717 const isCampaignContext = accessType === AccessType.CAMPAIGN; 48718 const isReservationRequestContext = accessType === AccessType.RESERVATION_REQUEST; 48719 if (!showsInlineRates(this.buyMode, !!hasSeatmap) && !isWaitingListContext) return A$1; 48720 const placeCategories = this.categoryId ? this.places_categories.filter((c2) => c2.id == this.categoryId) : this.places_categories; 48721 const hasAvailablePrices = placeCategories.some((c2) => c2.items?.some((p2) => p2.price_available)); 48722 const renderAsText = !this.isGuichet && !hasAvailablePrices; 48723 const item_id = this.props.id; 48724 const salesEnded = this.infos_status?.additionnals?.some((s2) => s2.key == "end_sale"); 48725 return b$1`<div> 48726 ${this.noPriceMessage(placeCategories)} 48727 ${c$1( 48728 placeCategories, 48729 (category) => category.id, 48730 (category) => { 48731 if (category.items?.length == 0) return A$1; 48732 if (renderAsText) return A$1; 48733 const initial = this.getInitial(category) || 0; 48734 const remaining = this.getRemainingPlacesNb(category); 48735 const specialContext = isCampaignContext || isReservationRequestContext || isWaitingListContext; 48736 const displaySoldOut = !this.isGuichet && remaining === 0 && !specialContext; 48737 const displayRemaining = this.isGuichet && !(isSeatMode(this.buyMode) && this._initialSelectedQuota?.id !== this.selectedQuota?.id); 48738 return b$1` 48739 <div class="sonic-categorized-prices-form"> 48740 ${category.title ? b$1` 48741 <div class="mt-4 mb-3 font-bold"> 48742 ${category.title ? category.title : A$1} 48743 ${displaySoldOut ? b$1`<sonic-badge type="danger" size="xs">${t("sold_out")}</sonic-badge>` : A$1} 48744 48745 <sonic-if .condition=${displayRemaining}> 48746 <sonic-badge type="${remaining == 0 ? "danger" : "default"}" size="sm" class="ml-2 inline-block" 48747 >Reste : ${remaining} / ${initial} 48748 </sonic-badge> 48749 </sonic-if> 48750 </div> 48751 ` : A$1} 48752 ${this.isGuichet || hasAvailablePrices ? b$1`<sonic-prices-form 48753 formDataProvider=${this.formItemsDataProvider} 48754 dataProvider=${`${this.dataProvider}/category-prices/${category.id ? category.id : "default"}`} 48755 .props=${{ 48756 quota: this.selectedQuota, 48757 prices: category.items, 48758 item_id, 48759 loading: this.loading 48760 }} 48761 formType="${this.formType}" 48762 buttonType="${this.buttonType}" 48763 size="${this.size}" 48764 type=${this.type} 48765 ></sonic-prices-form> 48766 <sonic-price-in-situ .category=${category} class="text-sm"></sonic-price-in-situ>` : A$1} 48767 </div> 48768 `; 48769 } 48770 )} 48771 48772 <!-- 48773 Ne rend en texte que si tous les tarifs sont complets 48774 --> 48775 ${!this.isGuichet && !hasAvailablePrices && isDefaultMode(this.buyMode) ? b$1`<sonic-price-list-info 48776 size="${this.size}" 48777 .prices=${this.props.prices || []} 48778 ?displaySoldOut=${!salesEnded} 48779 .selectedQuota=${this.selectedQuota} 48780 class="block mb-3" 48781 ></sonic-price-list-info>` : A$1} 48782 48783 <!--Achat--> 48784 ${this.getExtraFormItems()} 48785 48786 <sonic-subscription-requirement-warning 48787 .prices=${this.props.prices || []} 48788 .selectedQuota=${this.selectedQuota} 48789 ></sonic-subscription-requirement-warning> 48790 </div>`; 48791 } 48792 getExtraFormItems() { 48793 const isDisabled = this.loading || this.disabled || !this.someItemSelected; 48794 const noQuotaPlaces = this.selectedQuota && this.selectedQuota.remaining_places_nb === 0; 48795 let displaySubmitButton = false;
48796 if (this.isGuichet) { 48797 displaySubmitButton = this.formType === "select" && this._hasPricesDisplayed; 48798 } else { 48799 displaySubmitButton = this.formType === "select" && this._hasPricesDisplayed && !noQuotaPlaces; 48800 } 48801 const cartType = dp$1(this.cartProvider ?? "cart/current").data.cartType.get(); 48802 let text = t("LIB_add_to_cart"); 48803 if (cartType === CartType.WaitingLists || cartType === CartType.ReservationRequest || this.accessParams?.isWaitingList) { 48804 text = t("LIB_add_to_request"); 48805 } else if (cartType === CartType.Reservation) { 48806 text = t("LIB_add_to_reservation"); 48807 } 48808 return b$1`${displaySubmitButton ? b$1`<sonic-button 48809 data-aria-label=${text} 48810 @click=${this.addToCart} 48811 minWidth="16rem" 48812 type="primary" 48813 size=${this.size} 48814 ?disabled=${isDisabled} 48815 > 48816 <sonic-icon name="basket-shopping" library="custom" slot="prefix"></sonic-icon> 48817 <span class="font-bold uppercase">${text}</span> 48818 </sonic-button>` : A$1}`; 48819 } 48820 getRemainingPlacesNb(category) { 48821 const matchingStockDetail = this.getStockDetail(category); 48822 if (!matchingStockDetail) return 0; 48823 if (typeof matchingStockDetail.available === "number") { 48824 return matchingStockDetail.available; 48825 } 48826 return matchingStockDetail.has_available ? null : 0; 48827 } 48828 getInitial(category) { 48829 const matchingStockDetail = this.getStockDetail(category); 48830 return matchingStockDetail?.initial || 0; 48831 } 48832 getStockDetail(category) { 48833 return this.stock?.details?.find((d2) => { 48834 const matchingQuotaAndCategory = d2.places_category_id === category.id && d2.quota_id === this.selectedQuota?.id; 48835 if (matchingQuotaAndCategory) { 48836 return true; 48837 } 48838 const matchingGlobalQuota = d2.quota_id === this.selectedQuota?.id && !d2?.places_category_id; 48839 if (matchingGlobalQuota) { 48840 return true; 48841 } 48842 return false; 48843 }); 48844 } 48845 }; 48846 CategorizedPrices.styles = [tailwind, styles$1]; 48847 __decorateClass$1F([ 48848 n$5() 48849 ], CategorizedPrices.prototype, "props", 1); 48850 __decorateClass$1F([ 48851 c({ context: buyModeContext, subscribe: true }), 48852 n$5({ type: String }) 48853 ], CategorizedPrices.prototype, "buyMode", 2); 48854 __decorateClass$1F([ 48855 n$5({ type: Number }) 48856 ], CategorizedPrices.prototype, "categoryId", 2); 48857 __decorateClass$1F([ 48858 n$5({ type: Object }) 48859 ], CategorizedPrices.prototype, "infos_status", 2); 48860 __decorateClass$1F([ 48861 n$5({ type: Boolean }) 48862 ], CategorizedPrices.prototype, "disabled", 2); 48863 __decorateClass$1F([ 48864 bind$1("user.is_pro"), 48865 n$5({ type: Boolean }) 48866 ], CategorizedPrices.prototype, "userIsPro", 2); 48867 __decorateClass$1F([ 48868 n$5() 48869 ], CategorizedPrices.prototype, "type", 2); 48870 __decorateClass$1F([ 48871 n$5() 48872 ], CategorizedPrices.prototype, "formType", 2); 48873 __decorateClass$1F([ 48874 n$5({ type: String }) 48875 ], CategorizedPrices.prototype, "size", 2); 48876 __decorateClass$1F([ 48877 n$5() 48878 ], CategorizedPrices.prototype, "buttonType", 2); 48879 __decorateClass$1F([ 48880 n$5() 48881 ], CategorizedPrices.prototype, "room", 2); 48882 __decorateClass$1F([ 48883 n$5() 48884 ], CategorizedPrices.prototype, "stock", 2); 48885 __decorateClass$1F([ 48886 n$5() 48887 ], CategorizedPrices.prototype, "selectedQuota", 2); 48888 __decorateClass$1F([ 48889 n$5() 48890 ], CategorizedPrices.prototype, "loading", 2); 48891 __decorateClass$1F([ 48892 n$5({ type: String }) 48893 ], CategorizedPrices.prototype, "eventSlug", 2); 48894 __decorateClass$1F([ 48895 n$5({ type: String }) 48896 ], CategorizedPrices.prototype, "wording_LIB_add_to_cart", 2); 48897 __decorateClass$1F([ 48898 n$5({ type: Boolean }) 48899 ], CategorizedPrices.prototype, "someItemSelected", 2); 48900 __decorateClass$1F([ 48901 c({ context: accessParamsContext, subscribe: true }), 48902 n$5({ type: Object }) 48903 ], CategorizedPrices.prototype, "accessParams", 2); 48904 __decorateClass$1F([ 48905 ancestorAttribute("cartProvider"), 48906 n$5({ type: String }) 48907 ], CategorizedPrices.prototype, "cartProvider", 2); 48908 __decorateClass$1F([ 48909 n$5({ type: Array }) 48910 ], CategorizedPrices.prototype, "places_categories", 2); 48911 CategorizedPrices = __decorateClass$1F([ 48912 t$3("sonic-categorized-prices") 48913 ], CategorizedPrices); 48914 var __defProp$1C = Object.defineProperty; 48915 var __getOwnPropDesc$1E = Object.getOwnPropertyDescriptor; 48916 var __decorateClass$1E = (decorators, target, key, kind) => { 48917 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1E(target, key) : target; 48918 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 48919 if (decorator = decorators[i2]) 48920 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 48921 if (kind && result) __defProp$1C(target, key, result); 48922 return result; 48923 }; 48924 const tagName$17 = "sonic-store-status"; 48925 let SonicClosedStoreMessage = class extends Subscriber$1(i$6) { 48926 constructor() { 48927 super(...arguments); 48928 this.templateClosed = null; 48929 this.templateOpen = null; 48930 this.is_online = null; 48931 this.maintenance = false;
48932 this.status = "error"; 48933 this.isGuichet = false; 48934 } 48935 connectedCallback() { 48936 if (!this.dataProvider) { 48937 this.dataProvider = "settings"; 48938 } 48939 this.accessParams = getAccessParamsFromUrl(); 48940 this.isGuichet = this.hasAncestorAttribute("is_guichet"); 48941 this.templateClosed = this.querySelector("template[data-value='closed']"); 48942 this.templateOpen = this.querySelector("template[data-value='open']"); 48943 super.connectedCallback(); 48944 } 48945 render() { 48946 const message = this.maintenance ? t("LIB_maintenance_message", true) : t("message_billetterie_en_ligne_fermee", true); 48947 const isClosed = this.is_online === false; 48948 if (isClosed && !hasAccessParams(this.accessParams) || this.maintenance) { 48949 if (this.templateClosed) { 48950 return b$1`<div>${o$2(this.templateClosed)}</div>`; 48951 } else if (!this.isGuichet) { 48952 return b$1`<sonic-alert status=${this.status} size=${o$4(this.size)} class="py-[2em]" 48953 ><div class="sonic-prose sonic-prose-condensed">${message}</div> 48954 </sonic-alert>`; 48955 } 48956 } 48957 if (this.is_online === true && this.templateOpen) { 48958 return b$1`<div>${o$2(this.templateOpen)}</div>`; 48959 } 48960 return A$1; 48961 } 48962 }; 48963 SonicClosedStoreMessage.styles = [tailwind, sonicProse]; 48964 __decorateClass$1E([ 48965 n$5() 48966 ], SonicClosedStoreMessage.prototype, "templateClosed", 2); 48967 __decorateClass$1E([ 48968 n$5() 48969 ], SonicClosedStoreMessage.prototype, "templateOpen", 2); 48970 __decorateClass$1E([ 48971 n$5({ type: Boolean }) 48972 ], SonicClosedStoreMessage.prototype, "is_online", 2); 48973 __decorateClass$1E([ 48974 n$5({ type: Boolean }) 48975 ], SonicClosedStoreMessage.prototype, "maintenance", 2); 48976 __decorateClass$1E([ 48977 n$5({ type: String }) 48978 ], SonicClosedStoreMessage.prototype, "status", 2); 48979 __decorateClass$1E([ 48980 n$5({ type: String }) 48981 ], SonicClosedStoreMessage.prototype, "size", 2); 48982 __decorateClass$1E([ 48983 n$5({ type: Boolean }) 48984 ], SonicClosedStoreMessage.prototype, "isGuichet", 2); 48985 __decorateClass$1E([ 48986 e$2({ context: accessParamsContext }), 48987 n$5({ type: Object }) 48988 ], SonicClosedStoreMessage.prototype, "accessParams", 2); 48989 SonicClosedStoreMessage = __decorateClass$1E([ 48990 t$3(tagName$17) 48991 ], SonicClosedStoreMessage); 48992 function shouldDisplayWaitingList(options) { 48993 const { 48994 session, 48995 quotas, 48996 availablePrices, 48997 accessParams, 48998 appType: appType2, 48999 waitingListModuleEnabled = true, 49000 hasSeatmap = false, 49001 isPlacementRateSelection = false, 49002 selectedQuota 49003 } = options; 49004 const waitingListSettings = session?.settings?.waiting_list; 49005 const isEnabled = waitingListSettings?.enabled; 49006 const isHidden = waitingListSettings?.forceHidden === true; 49007 if (accessParams?.isWaitingList) { 49008 return false; 49009 } 49010 if (!waitingListModuleEnabled || !isEnabled || isHidden) { 49011 return false; 49012 } 49013 const isCustomer = appType2 === "customer"; 49014 const isOnlyVisibleForCustomer = isCustomer && session?.infos_status?.publication === "only_visible"; 49015 if (isOnlyVisibleForCustomer) { 49016 return false; 49017 } 49018 const accessType = getAccessType(accessParams); 49019 if (accessType === AccessType.RESERVATION_REQUEST || accessType === AccessType.CAMPAIGN) { 49020 return false; 49021 } 49022 const forceDisplayWaitingList = waitingListSettings?.forceDisplay; 49023 const isGuichet = appType2 === "counter"; 49024 if (forceDisplayWaitingList || isGuichet) { 49025 return true; 49026 } 49027 const sessionPrices = session?.prices ?? []; 49028 const hasPrices = sessionPrices.length > 0 || (availablePrices?.length ?? 0) > 0 || (quotas?.some((quota) => (quota.prices?.length ?? 0) > 0) ?? false); 49029 const isPlacedSummary = hasSeatmap && !isPlacementRateSelection; 49030 if (isPlacedSummary) { 49031 const someQuotaIsFull = quotas?.some((quota) => quota.remaining_places_nb === 0); 49032 return !!someQuotaIsFull && hasPrices; 49033 } 49034 if (selectedQuota) { 49035 const remainingPlaces = selectedQuota.remaining_places_nb; 49036 const quotaHasPrices = (selectedQuota.prices?.length ?? 0) > 0; 49037 return remainingPlaces === 0 && quotaHasPrices; 49038 } 49039 return false;
49040 } 49041 var __defProp$1B = Object.defineProperty; 49042 var __getOwnPropDesc$1D = Object.getOwnPropertyDescriptor; 49043 var __decorateClass$1D = (decorators, target, key, kind) => { 49044 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1D(target, key) : target; 49045 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49046 if (decorator = decorators[i2]) 49047 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49048 if (kind && result) __defProp$1B(target, key, result); 49049 return result; 49050 }; 49051 let instanceCount = 0; 49052 const tagName$16 = "sonic-buy-event-block"; 49053 let BuyEventBlock$1 = class BuyEventBlock extends EventContext(Subscriber$1(i$6)) { 49054 constructor() { 49055 super(...arguments); 49056 this.buyMode = BuyMode.DEFAULT; 49057 this.lockSeatContingentSelection = false; 49058 this.disabled = false; 49059 this.noSuffix = false; 49060 this.billetteriePurchaseLink = false; 49061 this.quotas = null; 49062 this.display = "select"; 49063 this.size = "md"; 49064 this.slug = ""; 49065 this.room = {}; 49066 this.categoryId = 0; 49067 this.start_date = 0; 49068 this.end_date = 0; 49069 this.isFetchEnabled = false; 49070 this.isPin = false; 49071 this.disableButtonMultiSelect = false; 49072 this.formDataProvider = "buyEventBlock" + instanceCount++; 49073 this.refetch = (api2) => { 49074 return async () => { 49075 const rect = this.getBoundingClientRect(); 49076 const isInViewPort = rect.width > 0 && rect.height > 0 && rect.top >= 0 && rect.left >= 0 && rect.bottom <= window.innerHeight && rect.right <= window.innerWidth; 49077 if (!isInViewPort) return; 49078 const endpoint = entityEndPoint({ 49079 entityType: EntityType.Event, 49080 entityId: Number(this.id), 49081 accessParams: this.accessParams, 49082 view: entityView.full 49083 }); 49084 const result = await api2.get(endpoint); 49085 if (result?.data) { 49086 this.publisher.set(result.data); 49087 } 49088 }; 49089 }; 49090 this.refetchIntervalId = 0; 49091 } 49092 connectedCallback() { 49093 this.isFetchEnabled = this.hasAttribute("fetch"); 49094 if (this.isFetchEnabled && this.id) { 49095 this.dataProvider = entityEndPoint({ 49096 entityType: EntityType.Event, 49097 entityId: Number(this.id), 49098 accessParams: this.accessParams, 49099 view: entityView.prices, 49100 features: [Feature.Location] 49101 }); 49102 } 49103 super.connectedCallback(); 49104 } 49105 disconnectedCallback() { 49106 super.disconnectedCallback(); 49107 clearInterval(this.refetchIntervalId); 49108 } 49109 onSelectQuota(e2) { 49110 this.selectedQuota = e2.detail; 49111 } 49112 handleRefetch() { 49113 if (this.refetchIntervalId) { 49114 clearInterval(this.refetchIntervalId); 49115 } 49116 if (!this.start_date) return; 49117 const now = Date.now() / 1e3; 49118 const startDateExtended = this.start_date - 24 * 60 * 60; 49119 const endDateExtended = (this.end_date || this.start_date) + 24 * 60 * 60; 49120 if (endDateExtended - startDateExtended > 96 * 60 * 60) return; 49121 if (now > startDateExtended && now < endDateExtended) { 49122 const api2 = new API(this.getApiConfiguration()); 49123 this.refetchIntervalId = setInterval(this.refetch(api2), 1e4); 49124 } 49125 } 49126 willUpdate(_changedProperties) { 49127 if (_changedProperties.has("quotas") && this.quotas) { 49128 if (!this.selectedQuota) { 49129 this.selectedQuota = this.quotas[0]; 49130 } else { 49131 const matchingQuota = this.quotas.find((quota) => quota.id == this.selectedQuota?.id); 49132 this.selectedQuota = matchingQuota || this.quotas[0]; 49133 } 49134 dp("product/" + this.id + "/PricesFilter").selectedQuota.set(this.selectedQuota); 49135 } 49136 if (_changedProperties.has("start_date") && this.start_date) { 49137 this.handleRefetch(); 49138 } 49139 if (_changedProperties.has("accessParams")) { 49140 const accessType = getAccessType(this.accessParams); 49141 if (accessType === AccessType.RESERVATION_REQUEST || accessType === AccessType.CAMPAIGN || accessType === AccessType.WAITING_LIST) { 49142 this.noSuffix = true; 49143 } 49144 } 49145 super.willUpdate(_changedProperties); 49146 } 49147 displayWaitingList() { 49148 return shouldDisplayWaitingList({ 49149 session: this.props, 49150 quotas: this.quotas, 49151 accessParams: this.accessParams, 49152 appType: this.appType, 49153 hasSeatmap: !!this.props?.settings?.has_seatmap, 49154 isPlacementRateSelection: isSeatMode(this.buyMode), 49155 selectedQuota: this.selectedQuota 49156 }); 49157 } 49158 isOnlyVisibleForCustomer() { 49159 const isCustomer = this.appType === "customer"; 49160 const isOnlyVisibleForCustomer = isCustomer && this.props?.infos_status?.publication === "only_visible"; 49161 return isOnlyVisibleForCustomer; 49162 } 49163 shouldDisplayQuotaSelector() { 49164 return this.quotas && this.quotas.length > 1 && !this.lockSeatContingentSelection && !this.isOnlyVisibleForCustomer() && !isAutoseatingMode(this.buyMode) && !isSeatmapviewMode(this.buyMode); 49165 } 49166 render() { 49167 const showsMapLink = showsEventMapLink(this.buyMode, !!this.props?.settings?.has_seatmap); 49168 const displayWaitingList = this.displayWaitingList(); 49169 const justifyClass = flexJustify(this.align); 49170 const isWaitingListContext = this.accessParams?.isWaitingList; 49171 const displayCategorizedPrices = isAutoseatingMode(this.buyMode) ? false : true; 49172 if (this.isWaiting) { 49173 return A$1; 49174 } 49175 return b$1` 49176 ${this.isFetchEnabled ? b$1`<sonic-fetch dataProvider=${this.dataProvider || ""} key="data"></sonic-fetch>` : A$1} 49177 <sonic-store-status></sonic-store-status> 49178 49179 ${this.shouldDisplayQuotaSelector() ? b$1`<sonic-event-quota-selector 49180 formDataProvider=${this.formDataProvider} 49181 ?lockSeatContingentSelection=${this.lockSeatContingentSelection} 49182 .selectedQuota=${this.selectedQuota} 49183 @selectQuota="${this.onSelectQuota}" 49184 display="${this.isGuichet ? "select" : "tabs"}" 49185 class="block mb-5" 49186 ></sonic-event-quota-selector>` : A$1} 49187 ${isAutoseatingMode(this.buyMode) ? b$1` 49188 <sonic-fieldset class=" hover:shadow-lg"> 49189 <div class="text-lg mb-5 font-bold"> 49190 <sonic-icon name="ticket" library="custom"></sonic-icon> ${t("LIB_select_price")} 49191 </div> 49192 <sonic-price-selection-form 49193 .priceContext=${{ 49194 entityType: EntityType.Event,
49195 entityId: Number(this.id) 49196 }} 49197 .fallbackAvailableQuota=${false} 49198 ></sonic-price-selection-form> 49199 </sonic-fieldset> 49200 ` : A$1} 49201 ${displayCategorizedPrices ? b$1`<sonic-categorized-prices 49202 type="${this.props?.entity_type ?? null}" 49203 categoryId="${this.categoryId}" 49204 formType="${this.formType || this.display || "select"}" 49205 ?disabled=${this.disabled} 49206 size="${this.size}" 49207 .selectedQuota=${this.selectedQuota} 49208 ></sonic-categorized-prices>` : A$1} 49209 ${showsMapLink && !this.isPin && !isWaitingListContext ? b$1`<div class="flex gap-x-3 gap-y-2 items-center flex-wrap ${justifyClass}"> 49210 <sonic-event-map-link></sonic-event-map-link> 49211 ${displayWaitingList ? b$1`<sonic-waiting-list-button variant="outline"></sonic-waiting-list-button>` : A$1} 49212 </div> 49213 49214 <sonic-seat-suggest .sessionId="${Number(this.id)}" class="my-2 block"></sonic-seat-suggest>` : A$1} 49215 ${!showsMapLink && displayWaitingList && !isAutoseatingMode(this.buyMode) ? b$1`<sonic-waiting-list-button 49216 class="mt-2 block" 49217 size="${this._isGuichet ? "sm" : this.size}" 49218 variant="${this._isGuichet ? "outline" : "default"}" 49219 ></sonic-waiting-list-button>` : A$1} 49220 ${this.noSuffix ? A$1 : b$1`<div> 49221 <sonic-buy-event-block-suffix class="block mt-6"></sonic-buy-event-block-suffix> 49222 </div>`} 49223 `; 49224 } 49225 }; 49226 BuyEventBlock$1.styles = [ 49227 i$9` 49228 :host([align="center"]) { 49229 text-align: center; 49230 } 49231 `, 49232 tailwind 49233 ]; 49234 __decorateClass$1D([ 49235 e$2({ context: buyModeContext }), 49236 n$5({ type: String }) 49237 ], BuyEventBlock$1.prototype, "buyMode", 2); 49238 __decorateClass$1D([ 49239 n$5({ type: Boolean }) 49240 ], BuyEventBlock$1.prototype, "lockSeatContingentSelection", 2); 49241 __decorateClass$1D([ 49242 n$5({ type: Boolean }) 49243 ], BuyEventBlock$1.prototype, "disabled", 2); 49244 __decorateClass$1D([ 49245 n$5({ type: Boolean }) 49246 ], BuyEventBlock$1.prototype, "noSuffix", 2); 49247 __decorateClass$1D([ 49248 n$5({ type: Boolean }) 49249 ], BuyEventBlock$1.prototype, "billetteriePurchaseLink", 2); 49250 __decorateClass$1D([ 49251 n$5({ type: Array }) 49252 ], BuyEventBlock$1.prototype, "quotas", 2); 49253 __decorateClass$1D([ 49254 n$5({ type: String }) 49255 ], BuyEventBlock$1.prototype, "formType", 2); 49256 __decorateClass$1D([ 49257 n$5({ type: String }) 49258 ], BuyEventBlock$1.prototype, "display", 2); 49259 __decorateClass$1D([ 49260 n$5({ type: String }) 49261 ], BuyEventBlock$1.prototype, "size", 2); 49262 __decorateClass$1D([ 49263 n$5({ type: String }) 49264 ], BuyEventBlock$1.prototype, "slug", 2); 49265 __decorateClass$1D([ 49266 n$5({ type: Object }) 49267 ], BuyEventBlock$1.prototype, "room", 2); 49268 __decorateClass$1D([ 49269 n$5({ type: Number }) 49270 ], BuyEventBlock$1.prototype, "categoryId", 2); 49271 __decorateClass$1D([ 49272 n$5({ type: Number }) 49273 ], BuyEventBlock$1.prototype, "start_date", 2); 49274 __decorateClass$1D([ 49275 n$5({ type: Number }) 49276 ], BuyEventBlock$1.prototype, "end_date", 2); 49277 __decorateClass$1D([ 49278 c({ context: alignContext, subscribe: true }), 49279 e$2({ context: alignContext }), 49280 n$5({ type: String, reflect: true }) 49281 ], BuyEventBlock$1.prototype, "align", 2); 49282 __decorateClass$1D([ 49283 c({ context: accessParamsContext, subscribe: true }), 49284 n$5({ type: Object }) 49285 ], BuyEventBlock$1.prototype, "accessParams", 2); 49286 __decorateClass$1D([ 49287 bind$1("sonicTicketApp.isWaiting"), 49288 r$5() 49289 ], BuyEventBlock$1.prototype, "isWaiting", 2); 49290 __decorateClass$1D([ 49291 c({ context: appType, subscribe: true }), 49292 r$5() 49293 ], BuyEventBlock$1.prototype, "appType", 2); 49294 __decorateClass$1D([ 49295 c({ context: pinContext, subscribe: true }), 49296 n$5({ type: Boolean }) 49297 ], BuyEventBlock$1.prototype, "isPin", 2); 49298 __decorateClass$1D([ 49299 e$2({ context: disableButtonMultiSelectContext }), 49300 n$5({ type: Boolean }) 49301 ], BuyEventBlock$1.prototype, "disableButtonMultiSelect", 2); 49302 __decorateClass$1D([ 49303 r$5() 49304 ], BuyEventBlock$1.prototype, "selectedQuota", 2); 49305 __decorateClass$1D([ 49306 bind$1("settings.subscriptionRequirement"), 49307 r$5() 49308 ], BuyEventBlock$1.prototype, "subscriptionRequirement", 2); 49309 BuyEventBlock$1 = __decorateClass$1D([ 49310 t$3(tagName$16) 49311 ], BuyEventBlock$1); 49312 var __defProp$1A = Object.defineProperty; 49313 var __getOwnPropDesc$1C = Object.getOwnPropertyDescriptor; 49314 var __decorateClass$1C = (decorators, target, key, kind) => { 49315 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1C(target, key) : target; 49316 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49317 if (decorator = decorators[i2]) 49318 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49319 if (kind && result) __defProp$1A(target, key, result); 49320 return result; 49321 }; 49322 let EventTaxonomies = class extends Subscriber$1(i$6) { 49323 constructor() { 49324 super(...arguments); 49325 this.categories = []; 49326 this.labels = []; 49327 this.range = null; 49328 this.size = "md"; 49329 this.displayAll = false;
49330 this.forceRangeDisplay = false; 49331 this.displayTaxonomies = ["range", "label", "category"]; 49332 } 49333 render() { 49334 const hasRange = this.range && (this.range.display || this.forceRangeDisplay || this.appType === "counter"); 49335 const hasLabel = this.labels && this.labels.length > 0; 49336 const hasCategory = this.categories && this.categories.length > 0; 49337 if (!hasRange && !hasLabel && !hasCategory) { 49338 this.style.display = "none"; 49339 return A$1; 49340 } 49341 this.style.removeProperty("display"); 49342 return b$1` 49343 ${this.displayTaxonomies.includes("range") && this.range ? b$1`<sonic-event-taxonomy 49344 size=${this.size} 49345 .taxonomy=${[this.range]} 49346 key="range" 49347 variant="outline" 49348 ?displayAll=${this.forceRangeDisplay} 49349 ></sonic-event-taxonomy>` : A$1} 49350 ${this.displayTaxonomies.includes("label") && this.labels.length > 0 ? b$1`<sonic-event-taxonomy size=${this.size} .taxonomy=${this.labels} key="label" variant="default"> 49351 </sonic-event-taxonomy>` : A$1} 49352 ${this.displayTaxonomies.includes("category") && this.categories.length > 0 ? b$1`<sonic-event-taxonomy 49353 size=${this.size} 49354 .icon=${{ library: "custom", prefix: "regular", name: "tag" }} 49355 .taxonomy=${this.categories} 49356 ?displayAll=${this.displayAll} 49357 variant="ghost" 49358 key="category" 49359 ></sonic-event-taxonomy>` : A$1} 49360 `; 49361 } 49362 }; 49363 EventTaxonomies.styles = i$9` 49364 :host { 49365 display: flex; 49366 gap: 0.25em 0.35em; 49367 flex-wrap: wrap; 49368 align-items: center; 49369 } 49370 `; 49371 __decorateClass$1C([ 49372 n$5({ type: Array }) 49373 ], EventTaxonomies.prototype, "categories", 2); 49374 __decorateClass$1C([ 49375 n$5({ type: Array }) 49376 ], EventTaxonomies.prototype, "labels", 2); 49377 __decorateClass$1C([ 49378 n$5({ type: Object }) 49379 ], EventTaxonomies.prototype, "range", 2); 49380 __decorateClass$1C([ 49381 n$5({ type: String }) 49382 ], EventTaxonomies.prototype, "size", 2); 49383 __decorateClass$1C([ 49384 n$5({ type: Boolean }) 49385 ], EventTaxonomies.prototype, "displayAll", 2); 49386 __decorateClass$1C([ 49387 n$5({ type: Boolean }) 49388 ], EventTaxonomies.prototype, "forceRangeDisplay", 2); 49389 __decorateClass$1C([ 49390 n$5({ type: Array }) 49391 ], EventTaxonomies.prototype, "displayTaxonomies", 2); 49392 __decorateClass$1C([ 49393 c({ context: appType, subscribe: true }), 49394 r$5() 49395 ], EventTaxonomies.prototype, "appType", 2); 49396 EventTaxonomies = __decorateClass$1C([ 49397 t$3("sonic-event-taxonomies") 49398 ], EventTaxonomies); 49399 var __defProp$1z = Object.defineProperty; 49400 var __getOwnPropDesc$1B = Object.getOwnPropertyDescriptor; 49401 var __decorateClass$1B = (decorators, target, key, kind) => { 49402 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1B(target, key) : target; 49403 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49404 if (decorator = decorators[i2]) 49405 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49406 if (kind && result) __defProp$1z(target, key, result); 49407 return result; 49408 }; 49409 const tagName$15 = "sonic-event-duration"; 49410 let SonicEventDuration = class extends Subscriber$1(i$6) { 49411 constructor() { 49412 super(...arguments); 49413 this.duration = 0; 49414 this.settings = {}; 49415 this.durationOutput = ""; 49416 } 49417 willUpdate(changedProperties) { 49418 if (changedProperties.has("settings") || changedProperties.has("duration")) { 49419 const duration = this.settings?.duration || this.duration || 0; 49420 this.durationOutput = this.cleanDurationOutput(duration); 49421 } 49422 super.willUpdate(changedProperties); 49423 } 49424 cleanDurationOutput(duration) { 49425 if (!duration) return ""; 49426 let durationOuput = ""; 49427 const lang = document.documentElement.lang; 49428 const isFrench = lang.split("-")[0] === "fr"; 49429 const hourSeparator = isFrench ? "h" : ":"; 49430 if (duration >= 60) { 49431 const hours = Math.floor(duration / 60); 49432 const minutes = duration % 60; 49433 const formatedMinutes = minutes < 10 ? `0${minutes}` : minutes; 49434 durationOuput = `${hours}${hourSeparator}${formatedMinutes}`; 49435 } else if (isFrench) { 49436 durationOuput = `${duration < 10 ? `0${duration}` : duration}min`; 49437 } else { 49438 durationOuput = `0${hourSeparator}${duration < 10 ? `0${duration}` : duration}`; 49439 } 49440 return durationOuput; 49441 } 49442 render() { 49443 if (!this.durationOutput) return A$1; 49444 return b$1`<div class="flex gap-[.35em] items-center"> 49445 <sonic-icon name="clock" library="custom" class=" text-center"></sonic-icon>
49446 <span> ${t("duree")} : ${this.durationOutput} </span> 49447 </div>`; 49448 } 49449 }; 49450 SonicEventDuration.styles = [tailwind]; 49451 __decorateClass$1B([ 49452 n$5({ type: Number }) 49453 ], SonicEventDuration.prototype, "duration", 2); 49454 __decorateClass$1B([ 49455 n$5({ type: Object }) 49456 ], SonicEventDuration.prototype, "settings", 2); 49457 __decorateClass$1B([ 49458 r$5() 49459 ], SonicEventDuration.prototype, "durationOutput", 2); 49460 SonicEventDuration = __decorateClass$1B([ 49461 t$3(tagName$15) 49462 ], SonicEventDuration); 49463 var __defProp$1y = Object.defineProperty; 49464 var __getOwnPropDesc$1A = Object.getOwnPropertyDescriptor; 49465 var __decorateClass$1A = (decorators, target, key, kind) => { 49466 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1A(target, key) : target; 49467 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49468 if (decorator = decorators[i2]) 49469 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49470 if (kind && result) __defProp$1y(target, key, result); 49471 return result; 49472 }; 49473 let SonicEventNotes = class extends Subscriber$1(i$6) { 49474 constructor() { 49475 super(...arguments); 49476 this.notes = ""; 49477 this.lineClamp = false; 49478 } 49479 render() { 49480 if (!this.notes) return A$1; 49481 return b$1` 49482 <div class=" text-info flex gap-[.35em] "> 49483 <sonic-icon library="custom" name="comment-exclamation"></sonic-icon> 49484 <div class=" text-pretty ${this.lineClamp ? "line-clamp-3" : ""} [&_a]:underline"> 49485 ${o$6(this.notes)} 49486 </div> 49487 </div> 49488 `; 49489 } 49490 }; 49491 SonicEventNotes.styles = [tailwind]; 49492 __decorateClass$1A([ 49493 n$5({ type: String }) 49494 ], SonicEventNotes.prototype, "notes", 2); 49495 __decorateClass$1A([ 49496 n$5({ type: Boolean }) 49497 ], SonicEventNotes.prototype, "lineClamp", 2); 49498 SonicEventNotes = __decorateClass$1A([ 49499 t$3("sonic-event-notes") 49500 ], SonicEventNotes); 49501 var __defProp$1x = Object.defineProperty; 49502 var __getOwnPropDesc$1z = Object.getOwnPropertyDescriptor; 49503 var __decorateClass$1z = (decorators, target, key, kind) => { 49504 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1z(target, key) : target; 49505 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49506 if (decorator = decorators[i2]) 49507 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49508 if (kind && result) __defProp$1x(target, key, result); 49509 return result; 49510 }; 49511 let SonicEventStore = class extends Subscriber$1(i$6) { 49512 constructor() { 49513 super(...arguments); 49514 this.formType = "select"; 49515 this.noBorder = false; 49516 this.noActionMenu = false;
49517 this.skeleton = false; 49518 this.expanded = false; 49519 this.alwaysExpanded = false; 49520 this.showAllSessionsButton = false; 49521 this.noAllSessionsButton = false; 49522 } 49523 toggleExpanded() { 49524 if (this.alwaysExpanded) return; 49525 this.expanded = !this.expanded; 49526 } 49527 updated() { 49528 if (!this.resizeObserver) { 49529 this.publicationElement = this.renderRoot.querySelector("sonic-product-publication") ?? void 0; 49530 if (this.publicationElement) { 49531 this.resizeObserver = new ResizeObserver((entries) => { 49532 for (const entry of entries) { 49533 const width = entry.contentRect.width; 49534 this.style.setProperty("--publication-size", `${width}px`); 49535 } 49536 }); 49537 this.resizeObserver.observe(this.publicationElement); 49538 } 49539 } 49540 } 49541 willUpdate(_changedProperties) { 49542 if (_changedProperties.has("accessParams") && this.accessParams?.customListSlug) { 49543 this.alwaysExpanded = true; 49544 this.expanded = true; 49545 } 49546 if (_changedProperties.has("alwaysExpanded")) { 49547 if (this.alwaysExpanded) { 49548 this.expanded = true; 49549 } 49550 } 49551 const isEvent = this.props?.entity_type === EntityType.Event; 49552 if (isEvent && this.appType === "counter") { 49553 this.actions = [ 49554 ProductActionsEnum.EDIT, 49555 ProductActionsEnum.MULTISESSIONS, 49556 ProductActionsEnum.STATS, 49557 ProductActionsEnum.SALES, 49558 ProductActionsEnum.RESERVATIONS, 49559 ProductActionsEnum.DIVIDER, 49560 ProductActionsEnum.PIN 49561 ]; 49562 } 49563 const isMerch = this.props?.entity_type === EntityType.Merch; 49564 if (isMerch && this.appType === "counter") { 49565 this.actions = [ 49566 ProductActionsEnum.EDIT, 49567 ProductActionsEnum.SALES, 49568 ProductActionsEnum.DIVIDER, 49569 ProductActionsEnum.PIN 49570 ]; 49571 } 49572 super.willUpdate(_changedProperties); 49573 } 49574 render() { 49575 if (this.skeleton) { 49576 return this.renderSkeleton(); 49577 } 49578 const entityType = this.props?.entity_type; 49579 if (!entityType) return A$1; 49580 const statusEndPoint = entityStatusEndPoint({ 49581 entityType, 49582 entityId: Number(this.id), 49583 accessParams: this.accessParams 49584 }); 49585 const props = this.props || {}; 49586 const { edito, settings } = props; 49587 const start_date = "start_date" in props ? props.start_date : void 0; 49588 const { site_link } = settings || {}; 49589 const hasDate = !!start_date; 49590 const gridColsClass = hasDate ? " @md:grid-cols-[6rem,1fr,2.5rem] @xl:gr
49590id-cols-[4rem,7.5rem,1fr,2.5rem]" : "@md:grid-cols-[1fr,2.5rem] @xl:grid-cols-[7.5rem,1fr,2.5rem]"; 49591 const displayActions = this.actions?.length && !this.noActionMenu; 49592 return b$1` 49593 <div class="@container"> 49594 <div 49595 @click=${this.toggleExpanded} 49596 class="bg-neutral-0 grid grid-cols-[8rem,1fr] ${gridColsClass} gap-y-2 gap-x-3 49597 @xl:gap-4 items-start @xl:items-center 49598 @sm:rounded-lg relative 49599 ${!this.noBorder ? `pb-6 @sm:p-3 @xl:p-4 49600 border-b @sm:border border-neutral-100 49601 @sm:hover:border-neutral-300 @sm:focus:border-neutral-300 49602 transition-border duration-100` : ""} 49603 49604 ${!this.alwaysExpanded ? "[&:not([alwaysExpanded])]:hover:cursor-pointer tap-highlight-none" : ""} 49605 " 49606 > 49607 ${hasDate ? b$1`<sonic-vertical-date class="hidden @xl:block self-center text-sm"></sonic-vertical-date>` : A$1} 49608 49609 <sonic-product-illustration rounded="md" class="row-span-2 @md:row-span-1 "></sonic-product-illustration> 49610 49611 <div class="flex flex-col pt-1 @md:py-2"> 49612 <div class="mb-2"> 49613 ${hasDate ? b$1`<sonic-date 49614 class="block @xl:hidden text-[.8em] mb-[.2em] uppercase mr-3" 49615 month="2-digit" 49616 ></sonic-date>` : A$1} 49617 49618 <sonic-product-title class="text-lg leading-tight pr-[var(--publication-size)]"></sonic-product-title> 49619 </div> 49620 49621 <div class="flex flex-wrap items-center gap-x-3 gap-y-1"> 49622 ${this.id ? b$1`<sonic-event-additional-status 49623 fetch 49624 dataProvider=${statusEndPoint} 49625 key="data" 49626 size="xs" 49627 class="flex flex-wrap gap-x-3" 49628 ></sonic-event-additional-status>` : A$1} 49629 <sonic-event-scheduled-status size="xs"></sonic-event-scheduled-status> 49630 <sonic-event-taxonomies size="xs" class="contents"></sonic-event-taxonomies> 49631 </div> 49632 49633 <div class="flex flex-wrap items-center gap-x-4 gap-y-1 min-h-[1.8rem] mt-2 text-xs "> 49634 ${this.props?.entity_type === EntityType.Merch ? b$1`<sonic-price-range class="text-sm"></sonic-price-range>` : A$1} 49635 49636 <sonic-event-location-hall class="w-full @md:w-auto"></sonic-event-location-hall> 49637 ${edito?.body || site_link ? b$1` <sonic-pop class="inline-block leading-tight" @click=${(e2) => e2.stopPropagation()}> 49638 <sonic-button variant="unstyled" class="text-xs hover:underline"> 49639 <div class="text-xs hover:text-neutral-800 hover:underline flex items-center gap-[0.35em]"> 49640 <sonic-icon library="custom" name="circle-info"></sonic-icon> 49641 ${t("link_title_infos")} 49642 </div> 49643 </sonic-button> 49644 <div 49645 slot="content" 49646 class="bg-neutral-0 text-content p-4 rounded max-w-[80vw] w-[20rem] lg:min-w-[30rem] z-20 grid grid-cols-1 gap-2" 49647 > 49648 ${edito?.body ? b$1`<div class="prose-sm prose-tight leading-tight max-h-[40vh] overflow-auto"> 49649 ${o$6(edito?.body)} 49650 </div> ` : A$1} 49651 <sonic-divider size="sm"></sonic-divider> 49652 <sonic-event-duration class="text-sm"></sonic-event-duration> 49653 <sonic-event-location-hall class="text-sm" addressDisplay="text"></sonic-event-location-hall> 49654 ${site_link ? b$1`<sonic-link href=${site_link} class="text-info text-sm" target="_blank"> 49655 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 49656 <span class="hover:underline">${t("link_title_more_about")}</span> 49657 </sonic-link>` : A$1} 49658 </div> 49659 </sonic-pop>` : A$1} 49660 ${this.renderAllSessionsButton()} 49661 </div> 49662 <sonic-event-notes subDataProvider="settings" lineClamp class="text-xs mt-1"></sonic-event-notes> 49663 </div> 49664 49665 ${displayActions ? b$1`<div class="absolute top-1 right-1 @md:top-3 @md:right-3 flex items-center gap-2"> 49666 <sonic-product-publication 49667 subDataProvider="${entityType === EntityType.Merch ? "infos_status" : "settings"}" 49668 class="text-lg" 49669 ></sonic-product-publication> 49670 <sonic-product-actions 49671 .actions=${this.actions} 49672 @click=${(e2) => e2.stopPropagation()} 49673 size="sm" 49674 > 49675 </sonic-product-actions> 49676 </div>` : A$1} 49677 ${!this.alwaysExpanded && !displayActions ? b$1`<div class="hidden @md:block"> 49678 <sonic-button ?active=${this.expanded} icon variant="ghost" shape="circle"> 49679 <sonic-icon name="chevron-up" swap="on" library="custom"></sonic-icon> 49680 <sonic-icon name="chevron-down" swap="off" library="custom"></sonic-icon> 49681 </sonic-button> 49682 </div>` : A$1} 49683 ${!this.alwaysExpanded && !displayActions ? b$1` <div class="col-span-full @md:hidden px-3"> 49684 <sonic-button 49685 data-aria-label=${t("link_title_show_prices")} 49686 shape="block" 49687 size="xs" 49688 noAutoFill 49689 class="w-full text-center text-neutral-200 ${this.expanded ? "mb-3" : ""}" 49690 > 49691 ${this.expanded ? b$1`<sonic-icon name="chevron-up" library="custom"></sonic-icon> ${t("link_title_hide_prices")}` : b$1`<sonic-icon name="chevron-down" library="custom"></sonic-icon> ${t("link_title_show_prices")}`} 49692 </sonic-button> 49693 </div>` : A$1} 49694 49695 <div 49696 class="${this.expanded && this.id ? "block" : "hidden"} col-[1/-1] @xl:col-[2/-1] px-3 @md:px-0" 49697 @click=${(e2) => e2.stopPropagation()} 49698 > 49699 ${h(this.expanded ? b$1` ${this.renderBuyBlock()} ` : A$1)} 49700 </div> 49701 </div> 49702 </div> 49703 `; 49704 } 49705 renderSkeleton() { 49706 return b$1`<div class="@container"> 49707 <div 49708 class="grid grid-cols-[8rem,1fr] @md:grid-cols-[6rem,1fr,2.5rem] 49709 @xl:grid-cols-[4rem,7.5rem,1fr,2.5rem] gap-y-2 gap-x-3 49710 @xl:gap-4 items-start @xl:items-center
49711 @sm:rounded-lg 49712 pb-6 @sm:p-3 @xl:p-4 49713 border-b @sm:border border-neutral-100 49714 " 49715 > 49716 <div class="hidden @xl:flex self-center items-center justify-center flex-col"> 49717 <div class="rounded-sm h-3 w-8 bg-neutral-100 "></div> 49718 <div class="rounded-sm size-10 bg-neutral-100 my-2"></div> 49719 <div class="rounded-sm h-3 w-8 bg-neutral-100 "></div> 49720 </div> 49721 <div class=" animate-pulse row-span-2 @md:row-span-1 rounded-md bg-neutral-50 aspect-square"></div> 49722 <div class="flex flex-col pt-1"> 49723 <div class="mb-2"> 49724 <div class="animate-pulse leading-none block bg-neutral-100 rounded-sm h-6 w-1/2 @md:w-1/3 mb-2"></div> 49725 <div class="animate-pulse leading-none block bg-neutral-100 rounded-sm h-5 w-1/3 @md:w-1/4 mb-3"></div> 49726 <div class="animate-pulse leading-none block mb-2 bg-neutral-50 rounded-sm h-4 w-1/2 @md:w-1/3"></div> 49727 </div> 49728 </div> 49729 </div> 49730 </div>`; 49731 } 49732 renderBuyBlock() { 49733 const entityType = this.props?.entity_type; 49734 if (!entityType) return A$1; 49735 const pricesEndPoint = entityEndPoint({ 49736 entityType, 49737 entityId: Number(this.id), 49738 accessParams: this.accessParams, 49739 next: true, 49740 view: entityView.full 49741 }); 49742 if (this.props?.entity_type === EntityType.Merch) { 49743 return b$1`<sonic-buy-event-block display=${this.formType} size="sm"></sonic-buy-event-block> `; 49744 } 49745 if (!pricesEndPoint) return A$1; 49746 return b$1`<sonic-fetch 49747 loader="inline" 49748 dataProvider=${pricesEndPoint} 49749 endpoint=${pricesEndPoint} 49750 key="data" 49751 lazyload 49752 ><sonic-buy-event-block display=${this.formType} size="sm"></sonic-buy-event-block> 49753 </sonic-fetch>`; 49754 } 49755 renderAllSessionsButton() { 49756 if (this.noAllSessionsButton) return A$1; 49757 const props = this.props || {}; 49758 const { slug } = props; 49759 const multisession = "multisession" in props && props.multisession ? props.multisession : void 0; 49760 const multisessionId = multisession ? multisession.id : void 0; 49761 if (!(multisessionId && this.showAllSessionsButton && slug)) return A$1; 49762 const hasCustomAccess = hasAccessParams(this.accessParams); 49763 const buttonContent = b$1` 49764 <div class="text-xs group flex items-center gap-[0.35em]"> 49765 <sonic-icon name="calendar-day" library="custom"></sonic-icon> 49766 <span class="group-hover:underline"> ${t("link_title_sessions_all")} </span> 49767 </div> 49768 `; 49769 if (hasCustomAccess) { 49770 return b$1`<sonic-button 49771 variant="unstyled" 49772 @click=${(e2) => { 49773 const title = this.props?.edito?.title; 49774 if (this.queueFormDataProvider && title) { 49775 dp(this.queueFormDataProvider).set({ search: title.trim() }); 49776 } 49777 e2.stopPropagation(); 49778 e2.preventDefault(); 49779 }} 49780 >${buttonContent}</sonic-button 49781 > `; 49782 } else { 49783 return b$1`<sonic-app-link to="event" slug=${slug} toShow variant="unstyled"> 49784 ${buttonContent} 49785 </sonic-app-link>`; 49786 } 49787 } 49788 }; 49789 SonicEventStore.styles = [ 49790 tailwind, 49791 i$9` 49792 .tap-highlight-none { 49793 -webkit-tap-highlight-color: transparent; 49794 } 49795 ` 49796 ]; 49797 __decorateClass$1z([ 49798 n$5() 49799 ], SonicEventStore.prototype, "formType", 2); 49800 __decorateClass$1z([ 49801 n$5({ type: Boolean }) 49802 ], SonicEventStore.prototype, "noBorder", 2); 49803 __decorateClass$1z([ 49804 n$5({ type: Boolean }) 49805 ], SonicEventStore.prototype, "noActionMenu", 2); 49806 __decorateClass$1z([ 49807 n$5({ type: Boolean }) 49808 ], SonicEventStore.prototype, "skeleton", 2); 49809 __decorateClass$1z([ 49810 n$5({ type: Boolean }) 49811 ], SonicEventStore.prototype, "expanded", 2); 49812 __decorateClass$1z([ 49813 n$5({ type: Boolean }) 49814 ], SonicEventStore.prototype, "alwaysExpanded", 2); 49815 __decorateClass$1z([ 49816 n$5({ type: Boolean }) 49817 ], SonicEventStore.prototype, "showAllSessionsButton", 2); 49818 __decorateClass$1z([ 49819 n$5({ type: Boolean }) 49820 ], SonicEventStore.prototype, "noAllSessionsButton", 2); 49821 __decorateClass$1z([ 49822 c({ context: accessParamsContext, subscribe: true }), 49823 e$2({ context: accessParamsContext }), 49824 n$5({ type: Object }) 49825 ], SonicEventStore.prototype, "accessParams", 2); 49826 __decorateClass$1z([ 49827 c({ context: appType, subscribe: true }) 49828 ], SonicEventStore.prototype, "appType", 2); 49829 __decorateClass$1z([ 49830 n$5({ type: Array }) 49831 ], SonicEventStore.prototype, "actions", 2); 49832 __decorateClass$1z([ 49833 n$5({ type: String }) 49834 ], SonicEventStore.prototype, "queueFormDataProvider", 2); 49835 SonicEventStore = __decorateClass$1z([ 49836 t$3("sonic-event-store-item") 49837 ], SonicEventStore); 49838 var __defProp$1w = Object.defineProperty; 49839 var __getOwnPropDesc$1y = Object.getOwnPropertyDescriptor; 49840 var __decorateClass$1y = (decorators, target, key, kind) => { 49841 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1y(target, key) : target; 49842 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49843 if (decorator = decorators[i2]) 49844 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49845 if (kind && result) __defProp$1w(target, key, result); 49846 return result; 49847 }; 49848 let SonicUserSelector = class extends i$6 { 49849 constructor() { 49850 super(...arguments); 49851 this.formDataProvider = "userSelection"; 49852 this.searchFormDataProvider = ""; 49853 this.searchResultDataProvider = ""; 49854 this.selectedId = 0; 49855 this.dispatch = (uid) => { 49856 if (!uid || uid == this.selectedId) return; 49857 const event = new CustomEvent("select", { 49858 detail: { uid } 49859 }); 49860 this.dispatchEvent(event); 49861 this.selectedId = uid; 49862 }; 49863 } 49864 connectedCallback() { 49865 PublisherManager.get(this.formDataProvider).uid.onAssign(this.dispatch); 49866 this.searchFormDataProvider = this.formDataProvider + "Filters"; 49867 this.searchResultDataProvider = this.formDataProvider + "FiltersResult"; 49868 super.connectedCallback(); 49869 } 49870 disconnectedCallback() { 49871 PublisherManager.get(this.formDataProvider).uid.offAssign(this.dispatch); 49872 PublisherManager.get(this.searchFormDataProvider).search.set(""); 49873 PublisherManager.get(this.formDataProvider).uid.set(null); 49874 super.disconnectedCallback(); 49875 } 49876 render() { 49877 return b$1` 49878 <div class="@container "> 49879 <div formDataProvider="${this.searchFormDataProvider}"> 49880 <sonic-input 49881 inlineContent 49882 type="search" 49883 name="search" 49884 size="lg" 49885 id="inputSearch" 49886 placeholder="Rechercher un compte client" 49887 value="" 49888 dataProvider="userSelectionFilters" 49889 autocomplete="off" 49890 > 49891 <sonic-icon name="magnifying-glass" library="custom" slot="prefix"></sonic-icon> 49892 </sonic-input> 49893 </div> 49894 49895 <sonic-if .condition=${sub(this.searchFormDataProvider + ".search")}> 49896 <sonic-queue 49897 limit="9" 49898 targetRequestDuration="1000" 49899 dataFilterProvider="${this.searchFormDataProvider}" 49900 dataProvider="${this.searchResultDataProvider}" 49901 dataProviderExpression="/user?limit=$limit&offset=$offset" 49902 formDataProvider="${this.formDataProvider}" 49903 key="data" 49904 tabindex="0" 49905 class=" custom-scroll mask-scroll pb-5 pr-2 pt-2 grid grid-cols-1 @lg:grid-cols-2 @xl:grid-cols-3 @3xl:grid-cols-4 gap-2 max-h-60" 49906 > 49907 <template> 49908 <sonic-user-selector-item buttonType="radio" buttonName="uid" class="h-full"></sonic-user-selector-item> 49909 </template> 49910 <template data-value="no-item"> 49911 <sonic-no-result size="md"></sonic-no-result> 49912 </template> 49913 </sonic-queue> 49914 </sonic-if> 49915 </div> 49916 `; 49917 } 49918 }; 49919 SonicUserSelector.styles = [ 49920 tailwind, 49921 customScroll, 49922 i$9` 49923 .mask-scroll { 49924 mask-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 1)); 49925 } 49926 ` 49927 ]; 49928 __decorateClass$1y([ 49929 n$5({ type: String }) 49930 ], SonicUserSelector.prototype, "formDataProvider", 2); 49931 __decorateClass$1y([ 49932 r$5() 49933 ], SonicUserSelector.prototype, "selectedId", 2); 49934 SonicUserSelector = __decorateClass$1y([ 49935 t$3("sonic-user-selector") 49936 ], SonicUserSelector); 49937 var __defProp$1v = Object.defineProperty; 49938 var __getOwnPropDesc$1x = Object.getOwnPropertyDescriptor; 49939 var __decorateClass$1x = (decorators, target, key, kind) => { 49940 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1x(target, key) : target; 49941 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49942 if (decorator = decorators[i2]) 49943 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49944 if (kind && result) __defProp$1v(target, key, result); 49945 return result; 49946 }; 49947 let instanceCounter$5 = 0; 49948 let UserAttachForm = class extends i$6 { 49949 constructor() { 49950 super(...arguments); 49951 this.formDataProvider = `newOwnerForm/${instanceCounter$5++}`; 49952 this.owners = []; 49953 this.contactContext = "owner"; 49954 this.updateOwners = (cart) => { 49955 this.owners = getCartOwners(cart.items); 49956 }; 49957 this.handleSubmit = (e2) => { 49958 if (e2?.detail.success) { 49959 const event = new CustomEvent("attach", { detail: { itemIds: [this.item?.id || ""] } }); 49960 this.dispatchEvent(event); 49961 } 49962 }; 49963 } 49964 connectedCallback() { 49965 this.initFormDataProvider(); 49966 if (this.cartProvider) { 49967 dp(this.cartProvider).data.onAssign(this.updateOwners); 49968 } 49969 super.connectedCallback(); 49970 } 49971 initFormDataProvider() { 49972 dp(this.formDataProvider).set({ 49973 owner: this.item?.owner 49974 }); 49975 } 49976 disconnectedCallback() { 49977 super.disconnectedCallback(); 49978 if (this.cartProvider) { 49979 dp(this.cartProvider).data.offAssign(this.updateOwners); 49980 } 49981 } 49982 render() { 49983 const { entity_type, entity_id } = this.item || {}; 49984 if (!entity_type || !entity_id || !this.item) return A$1; 49985 return b$1`${productPriceSummary({ lineItemCart: this.item, className: "mb-4", accessParams: this.accessParams })} 49986 <div class="block @container"> 49987 ${this.ownerSuggestion()} ${this.ownerForm()} 49988 ${this.appType === "counter" ? b$1` <sonic-user-selector 49989 class="pt-8 mt-8 border-t border-dashed border-neutral-200 block" 49990 formDataProvider="Owner/userSelection" 49991 size="md" 49992 @select=${(e2) => this.patchOwner(e2.detail)} 49993 ></sonic-user-selector>` : A$1} 49994 </div>`; 49995 } 49996 // OwnerForm :: NEW OWNER 49997 ownerForm() { 49998 const endpoint = `${this.cartProvider}/items/${this.item?.id}`; 49999 if (!this.cartProvider) return A$1; 50000 const isCounter = this.appType === "counter"; 50001 return b$1`<div formDataProvider=${this.formDataProvider} class="@container">
50002 <sonic-input class="grow" type="hidden" value="0" name="owner.uid"></sonic-input> 50003 <div class="grid grid-cols-1 @2xl:flex items-end w-full gap-3"> 50004 <sonic-submit 50005 class="w-full" 50006 endPoint=${endpoint} 50007 submitResultDataprovider="${this.cartProvider}" 50008 method="patch" 50009 @submit=${this.handleSubmit} 50010 onEnterKey 50011 > 50012 <div class="grid grid-cols-1 @2xl:flex items-end w-full gap-3 grow"> 50013 <sonic-input type="hidden" name="owner.uid" value="0"></sonic-input> 50014 <sonic-input 50015 class="grow" 50016 type="text" 50017 id="lastName" 50018 autocomplete=${autocompleteValue("family-name", this.appType)} 50019 name="owner.lastName" 50020 label="${t("nom")}" 50021 ?required=${!isCounter} 50022 > 50023 ${this.requiredMark(!isCounter)} 50024 </sonic-input> 50025 <sonic-input 50026 class="grow" 50027 id="firstName" 50028 autocomplete=${autocompleteValue("given-name", this.appType)} 50029 type="text" 50030 name="owner.firstName" 50031 label="${t("prenom")}" 50032 ?required=${!isCounter} 50033 > 50034 ${this.requiredMark(!isCounter)} 50035 </sonic-input> 50036 <sonic-input 50037 class="grow min-w-[10rem]" 50038 id="email" 50039 autocomplete=${autocompleteValue("email", this.appType)} 50040 type="email" 50041 name="owner.email" 50042 label="${t("email")}" 50043 ></sonic-input> 50044 </div> 50045 </sonic-submit> 50046 <sonic-submit 50047 @submit=${this.handleSubmit} 50048 endPoint=${endpoint} 50049 submitResultDataprovider="${this.cartProvider}" 50050 method="patch" 50051 onClick 50052 > 50053 <sonic-button type="primary" shape="block" noAutoFill> 50054 <sonic-icon name="check" library="custom" slot="prefix"></sonic-icon> 50055 ${t("enregistrer")}</sonic-button 50056 > 50057 </sonic-submit> 50058 50059 <sonic-tooltip label="${t("reset_informations")}" placement="bottom-end"> 50060 <sonic-button shape="circle" @click=${this.resetOwnerForm}> 50061 <sonic-icon library="custom" name="arrow-rotate-left"></sonic-icon 50062 ></sonic-button> 50063 </sonic-tooltip> 50064 </div> 50065 </div>`; 50066 } 50067 // @todo : refacto this in a shared component 50068 requiredMark(isRequired) { 50069 const shouldRender = isRequired || false; 50070 return shouldRender ? b$1`<span class="opacity-50 pl-1" slot="label">*</span>` : A$1; 50071 } 50072 resetOwnerForm() { 50073 dp(this.formDataProvider).set({ 50074 owner: { 50075 uid: 0, 50076 lastName: "", 50077 firstName: "", 50078 email: "" 50079 } 50080 }); 50081 } 50082 ownerSuggestion() { 50083 if (!this.owners.length) return A$1; 50084 const hasNonEmptyOwner = this.owners.some((owner) => owner.uid || owner.firstName || owner.lastName || owner.email); 50085 if (!hasNonEmptyOwner) return A$1; 50086 return b$1`<sonic-divider class="text-sm text-neutral-500 " align="left">${t("choose_owner")}</sonic-divider> 50087 <div class="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] w-full gap-3 mb-8"> 50088 ${c$1( 50089 this.owners, 50090 (owner) => owner, 50091 (owner) => this.ownerSuggestionItem(owner) 50092 )} 50093 </div>`; 50094 } 50095 ownerSuggestionItem(owner) { 50096 const { uid, firstName, lastName, email: email2 } = owner; 50097 if (!uid && !firstName && !lastName && !email2) return; 50098 const uniqueId = `${firstName}-${lastName}-${email2}-${uid}`; 50099 return b$1` 50100 <sonic-user-selector-item 50101 noAutoFill 50102 dataProvider="ownerSelection/${uniqueId}" 50103 size="xs" 50104 buttonType="button" 50105 @click=${() => this.patchOwner(owner)} 50106 .props=${owner} 50107 ></sonic-user-selector-item> 50108 `; 50109 } 50110 async patchOwner(owner) { 50111 const id = this.item?.id; 50112 if (!id || !this.cartProvider) return; 50113 Cart.patchItems({ 50114 apiConfiguration: HTML$1.getApiConfiguration(this), 50115 cartProvider: this.cartProvider, 50116 query: { 50117 ids: [id] 50118 }, 50119 body: { 50120 owner 50121 } 50122 }).then((e2) => { 50123 if (e2 === "asRequested") { 50124 const event = new CustomEvent("attach", { detail: { itemIds: [id] } }); 50125 this.dispatchEvent(event); 50126 } 50127 }); 50128 } 50129 }; 50130 UserAttachForm.styles = [tailwind, customScroll]; 50131 __decorateClass$1x([ 50132 n$5({ type: Object }) 50133 ], UserAttachForm.prototype, "item", 2); 50134 __decorateClass$1x([ 50135 n$5({ type: String }) 50136 ], UserAttachForm.prototype, "formDataProvider", 2); 50137 __decorateClass$1x([ 50138 c({ context: appType, subscribe: true }) 50139 ], UserAttachForm.prototype, "appType", 2); 50140 __decorateClass$1x([ 50141 n$5({ type: String }) 50142 ], UserAttachForm.prototype, "cartProvider", 2); 50143 __decorateClass$1x([ 50144 c({ context: accessParamsContext }), 50145 n$5({ type: Object }) 50146 ], UserAttachForm.prototype, "accessParams", 2); 50147 __decorateClass$1x([ 50148 r$5() 50149 ], UserAttachForm.prototype, "owners", 2); 50150 __decorateClass$1x([ 50151 e$2({ context: contactContext }), 50152 n$5({ type: String }) 50153 ], UserAttachForm.prototype, "contactContext", 2); 50154 UserAttachForm = __decorateClass$1x([ 50155 t$3("sonic-owner-attach-form") 50156 ], UserAttachForm); 50157 var __decorate$5 = function(decorators, target, key, desc) { 50158 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 50159 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 50160 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 50161 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 50162 }; 50163 const tagName$14 = "sonic-form-actions"; 50164 let FormActions = class FormActions extends i$6 { 50165 constructor() { 50166 super(...arguments); 50167 this.direction = "row"; 50168 this.justify = "flex-start"; 50169 } 50170 render() { 50171 const styles2 = { 50172 flexDirection: this.direction, 50173 justifyContent: this.justify 50174 }; 50175 return b$1`<slot style=${o$3(styles2)}></slot>`; 50176 } 50177 }; 50178 FormActions.styles = [ 50179 i$9` 50180 :host { 50181 display: block; 50182 } 50183 slot { 50184 display: flex; 50185 flex-wrap: wrap; 50186 gap: 0.3rem; 50187 } 50188 ` 50189 ]; 50190 __decorate$5([ 50191 n$5({ type: String }) 50192 ], FormActions.prototype, "direction", void 0); 50193 __decorate$5([ 50194 n$5({ type: String }) 50195 ], FormActions.prototype, "justify", void 0); 50196 FormActions = __decorate$5([ 50197 t$3(tagName$14) 50198 ], FormActions); 50199 var __defProp$1u = Object.defineProperty; 50200 var __getOwnPropDesc$1w = Object.getOwnPropertyDescriptor; 50201 var __decorateClass$1w = (decorators, target, key, kind) => { 50202 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1w(target, key) : target; 50203 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 50204 if (decorator = decorators[i2]) 50205 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 50206 if (kind && result) __defProp$1u(target, key, result); 50207 return result; 50208 }; 50209 let instanceCounter$4 = 0; 50210 const tagName$13 = "sonic-add-proof"; 50211 let AddProof = class extends i$6 { 50212 constructor() { 50213 super(...arguments); 50214 this.formDataProvider = "subscriptionAddProof" + instanceCounter$4++; 50215 this.canSubmit = false;
50216 this.handleFormMutation = () => { 50217 const proof = dp(this.formDataProvider).proof_of_identity?.get(); 50218 const proofIsEmpty = Array.isArray(proof) ? proof.length === 0 : !proof; 50219 this.canSubmit = !proofIsEmpty; 50220 }; 50221 } 50222 connectedCallback() { 50223 dp(this.formDataProvider).proof_of_identity.set(this.item?.proof_of_identity); 50224 dp(this.formDataProvider).onInternalMutation(this.handleFormMutation); 50225 super.connectedCallback(); 50226 } 50227 render() { 50228 return b$1`${productPriceSummary({ lineItemCart: this.item, className: "mb-6" })} 50229 <form formDataProvider=${this.formDataProvider}> 50230 <sonic-fieldset> 50231 <sonic-file-upload 50232 required 50233 type="file" 50234 name="proof_of_identity" 50235 label="${t("LIB_proof_private")}" 50236 .accept=${["image/jpeg", "image/png", "image/jpg", "application/pdf", "image/gif"]} 50237 ></sonic-file-upload> 50238 </sonic-fieldset> 50239 <sonic-form-actions> 50240 <sonic-button @click=${this.submitForm} type="success" shape="block" ?disabled=${!this.canSubmit}> 50241 <sonic-icon name="file-arrow-up" library="custom"></sonic-icon> 50242 ${t("LIB_send")}</sonic-button 50243 > 50244 </sonic-form-actions> 50245 </form>`; 50246 } 50247 async submitForm(e2) { 50248 const button2 = e2.target; 50249 const id = this.item?.id; 50250 if (!id || !this.cartProvider) return; 50251 const formPublisher = dp(this.formDataProvider); 50252 formPublisher.isFormValid.set(true); 50253 formPublisher.invalidateForm(); 50254 if (!formPublisher.isFormValid.get()) return; 50255 button2.setAttribute("loading", ""); 50256 await Cart.patchItems({ 50257 apiConfiguration: HTML.getApiConfiguration(this), 50258 cartProvider: this.cartProvider, 50259 query: { 50260 ids: [id] 50261 }, 50262 body: { 50263 proof_of_identity: formPublisher.proof_of_identity?.get() 50264 } 50265 }).then((e22) => { 50266 if (e22 === "asRequested") { 50267 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 50268 if (parentModal) { 50269 parentModal.hide(); 50270 this.dispatchEvent(new CustomEvent("attach")); 50271 } 50272 } 50273 }).finally(() => { 50274 button2.removeAttribute("loading"); 50275 }); 50276 } 50277 }; 50278 AddProof.styles = [tailwind]; 50279 __decorateClass$1w([ 50280 n$5({ type: Object }) 50281 ], AddProof.prototype, "item", 2); 50282 __decorateClass$1w([ 50283 n$5({ type: String }) 50284 ], AddProof.prototype, "cartProvider", 2); 50285 __decorateClass$1w([ 50286 r$5() 50287 ], AddProof.prototype, "canSubmit", 2); 50288 AddProof = __decorateClass$1w([ 50289 t$3(tagName$13) 50290 ], AddProof); 50291 const subscriptionsContext = n("subscriptions"); 50292 const quickSelectSliderCSS = i$9` 50293 [data-quick-select-slider] { 50294 overflow: hidden; 50295 width: 100%; 50296 display: block; 50297 } 50298 50299 [data-quick-select-slider-wrapper] { 50300 display: flex; 50301 transform: translateX(var(--quick-select-slider-offset, 0px)); 50302 transition: transform 0.2s ease-in-out; 50303 height: 100%; 50304 will-change: transform; 50305 } 50306 50307 [data-quick-select-slider-item] { 50308 scroll-snap-align: start; 50309 width: var(--quick-select-column-width); 50310 padding: 0.5rem 0.5rem; 50311 flex-shrink: 0; 50312 position: relative; 50313 height: 100%; 50314 } 50315`; 50316 const normalizeEmail = (email2) => email2?.trim().toLowerCase() ?? ""; 50317 const buildUserEmailSearchUrl = (emails, limit) => { 50318 const params = new URLSearchParams(); 50319 params.set("limit", String(limit)); 50320 emails.forEach((email2) => params.append("email[]", email2)); 50321 return `/user?${params.toString()}`; 50322 }; 50323 const groupAccountsByEmail = (accounts, emails) => { 50324 const accountsByEmail = /* @__PURE__ */ new Map(); 50325 emails.forEach((email2) => { 50326 accountsByEmail.set(normalizeEmail(email2), []); 50327 }); 50328 accounts.forEach((account) => { 50329 const bucket = accountsByEmail.get(normalizeEmail(account.email)); 50330 if (bucket) { 50331 bucket.push(account); 50332 } 50333 }); 50334 return accountsByEmail; 50335 }; 50336 const computeAccountSearchLimit = (emailCount, accountSearchLimit) => Math.min(500, Math.max(accountSearchLimit, emailCount * accountSearchLimit)); 50337 const fetchAccountsByEmails = async (api2, emails, accountSearchLimit) => { 50338 const uniqueEmails = [...new Set(emails.map((email2) =>
50338 email2.trim()).filter(Boolean))]; 50339 if (!uniqueEmails.length) { 50340 return /* @__PURE__ */ new Map(); 50341 } 50342 const limit = computeAccountSearchLimit(uniqueEmails.length, accountSearchLimit); 50343 try { 50344 const result = await api2.get(buildUserEmailSearchUrl(uniqueEmails, limit)); 50345 const accounts = result?.data ?? []; 50346 return groupAccountsByEmail(accounts, uniqueEmails); 50347 } catch (error) { 50348 console.error("Owner suggestion account search failed:", error); 50349 return new Map(uniqueEmails.map((email2) => [normalizeEmail(email2), []])); 50350 } 50351 }; 50352 function getOwnerEmailsFromCart(cart) { 50353 const owners = getCartOwnerSuggestions({ 50354 items: cart.items ?? [], 50355 linked_subscriptions: cart.linked_subscriptions 50356 }); 50357 const emails = []; 50358 for (const owner of owners) { 50359 const email2 = owner.email?.trim(); 50360 if (!email2 || email2.endsWith(".pasdemail")) { 50361 continue; 50362 } 50363 if (!emails.some((existing) => normalizeEmail(existing) === normalizeEmail(email2))) { 50364 emails.push(email2); 50365 } 50366 } 50367 return emails; 50368 } 50369 async function findUserAccountsByOwnerEmails(api2, emails) { 50370 if (!emails.length) { 50371 return []; 50372 } 50373 const accountsByEmail = await fetchAccountsByEmails(api2, emails, 5); 50374 const seenUids = /* @__PURE__ */ new Set(); 50375 const accounts = []; 50376 for (const email2 of emails) { 50377 for (const account of accountsByEmail.get(normalizeEmail(email2)) ?? []) { 50378 const uid = account.uid; 50379 if (!uid || seenUids.has(uid)) { 50380 continue; 50381 } 50382 seenUids.add(uid); 50383 accounts.push(account); 50384 } 50385 } 50386 return accounts; 50387 } 50388 async function findCounterBuyerAccounts(cart, apiConfiguration) { 50389 const emails = getOwnerEmailsFromCart(cart); 50390 if (!emails.length) { 50391 return []; 50392 } 50393 return findUserAccountsByOwnerEmails(new API(apiConfiguration), emails); 50394 } 50395 let pendingBuyerSelection = null; 50396 function promptCounterBuyerSelection(accounts) { 50397 if (!accounts.length) { 50398 return Promise.resolve(void 0); 50399 } 50400 if (pendingBuyerSelection) { 50401 return pendingBuyerSelection; 50402 } 50403 pendingBuyerSelection = new Promise((resolve) => { 50404 let settled = false; 50405 let selectedUid; 50406 const finish = (uid) => { 50407 if (settled) { 50408 return; 50409 } 50410 settled = true; 50411 resolve(uid); 50412 }; 50413 const modal = Modal.create({ 50414 title: t("choose_customer_account"), 50415 maxWidth: "42rem", 50416 removeOnHide: true, 50417 styleSheet: [tailwind], 50418 content: b$1` 50419 <sonic-alert class="mb-5">Comptes clients candidats parmi les détenteurs du panier</sonic-alert> 50420 <div class="grid grid-cols-1 gap-2"> 50421 ${accounts.map( 50422 (account) => b$1` 50423 <sonic-button 50424 variant="outline" 50425 align="left" 50426 shape="block" 50427 class="mb-3" 50428 @click=${() => { 50429 selectedUid = account.uid ?? void 0; 50430 modal.hide(); 50431 }} 50432 > 50433 <sonic-user-info 50434 inert 50435 tabindex="-1" 50436 class=" pointer-events-none py-2 block" 50437 size="sm" 50438 noAutoFill 50439 dataProvider="user/${account.uid}" 50440 .props=${account} 50441 ></sonic-user-info> 50442 </sonic-button> 50443 ` 50444 )} 50445 </div> 50446 ` 50447 }); 50448 modal.addEventListener( 50449 "hide", 50450 () => { 50451 finish(selectedUid); 50452 }, 50453 { once: true } 50454 ); 50455 }).finally(() => { 50456 pendingBuyerSelection = null; 50457 }); 50458 return pendingBuyerSelection; 50459 } 50460 function toCounterCartBuyerSource(cart, items) { 50461 return { 50462 buyer: cart?.buyer, 50463 items: items ?? cart?.items ?? [], 50464 linked_subscriptions: cart?.linked_subscriptions 50465 }; 50466 } 50467 async function resolveCounterBuyerUidForSubscription(cart, apiConfiguration, ownerEmail) { 50468 const email2 = ownerEmail?.trim(); 50469 if (email2 && !email2.endsWith(".pasdemail")) { 50470 const accounts2 = await findUserAccountsByOwnerEmails(new API(apiConfiguration), [email2]); 50471 if (accounts2.length === 1) { 50472 return { uid: accounts2[0].uid ?? void 0, hasCandidateAccounts: true }; 50473 } 50474 if (accounts2.length > 1) { 50475 const uid2 = await promptCounterBuyerSelection(accounts2); 50476 return { uid: uid2, hasCandidateAccounts: true }; 50477 } 50478 } 50479 const accounts = await findCounterBuyerAccounts(cart, apiConfiguration); 50480 if (!accounts.length) { 50481 return { hasCandidateAccounts: false }; 50482 } 50483 if (accounts.length === 1) { 50484 return { uid: accounts[0].uid ?? void 0, hasCandidateAccounts: true }; 50485 } 50486 const uid = await promptCounterBuyerSelection(accounts); 50487 return { uid, hasCandidateAccounts: true }; 50488 } 50489 const ACTIVE_WAITING_LIST_STATUSES = [ 50490 ReservationStatus.Incomplete, 50491 ReservationStatus.Draft, 50492 ReservationStatus.Submitted, 50493 ReservationStatus.Pending 50494 ]; 50495 const WAITING_LIST_TUNNEL_DP = "cart/quickSelect/waitingListTunnel"; 50496 const WAITING_LIST_TUNNEL_BIND_PATH = "cart/quickSelect/waitingListTunnel.data"; 50497 let refreshWaitingListRequestId = 0; 50498 function asWaitingListTunnelEntries(entries) { 50499 return Array.isArray(entries) ? entries : []; 50500 } 50501 function hasNoParentSubscription(parentId) { 50502 return parentId == null || parentId === ""; 50503 } 50504 function matchesParentSubscription(lineItemParentId, parentSubscriptionId) { 50505 if (!parentSubscriptionId) { 50506 return hasNoParentSubscription(lineItemParentId); 50507 } 50508 return String(lineItemParentId ?? "") === String(parentSubscriptionId); 50509 } 50510 function filterWaitingListTunnelEntries(entries, sessionId, parentSubscriptionId) { 50511 return asWaitingListTunnelEntries(entries).filter(({ lineItem }) => { 50512 if (lineItem.entity_type !== EntityType.Event || Number(lineItem.entity_id) !== sessionId) { 50513 return false;
50514 } 50515 return matchesParentSubscription(lineItem.parent_id, parentSubscriptionId); 50516 }); 50517 } 50518 function filterWaitingListTunnelEntriesForSubscriber(entries, parentSubscriptionId) { 50519 return asWaitingListTunnelEntries(entries).filter( 50520 ({ lineItem }) => matchesParentSubscription(lineItem.parent_id, parentSubscriptionId) 50521 ); 50522 } 50523 function isWaitingListTunnelEntryDirectlyEditable(status) { 50524 if (!status) { 50525 return true; 50526 } 50527 return status === ReservationStatus.Incomplete || status === ReservationStatus.Draft; 50528 } 50529 function isWaitingListTunnelEntryLockedForever(status) { 50530 if (!status) { 50531 return false; 50532 } 50533 return isLockedForever(status); 50534 } 50535 async function ensureWaitingListTunnelEntryEditable(entry, apiConfiguration) { 50536 if (isWaitingListTunnelEntryDirectlyEditable(entry.status)) { 50537 return true; 50538 } 50539 if (isWaitingListTunnelEntryLockedForever(entry.status)) { 50540 return false; 50541 } 50542 const api2 = new API(apiConfiguration); 50543 const result = await api2.put(`${entry.cartProvider}/cancel-submission`, {}); 50544 return !!result?.success; 50545 } 50546 async function restoreWaitingListTunnelEntrySubmission(entry, apiConfiguration) { 50547 if (await waitingListCartHasErrors(apiConfiguration, entry.cartProvider)) { 50548 return true; 50549 } 50550 return lockReservationRequest(apiConfiguration, entry.cartProvider); 50551 } 50552 function waitingListCartHasItemErrors(items = []) { 50553 return items.some((item) => item.has_error || item.messages?.some((message) => message?.status === "error")); 50554 } 50555 async function waitingListCartHasErrors(apiConfiguration, cartProvider) { 50556 const api2 = new API(apiConfiguration); 50557 const result = await api2.get(cartProvider); 50558 if (!result?.success || !result.data) { 50559 return true; 50560 } 50561 return waitingListCartHasItemErrors(result.data.items ?? []); 50562 } 50563 async function loadWaitingListTunnelEntries(element, buyerUid, options) { 50564 if (!buyerUid) { 50565 return []; 50566 } 50567 const sessionIds = void 0; 50568 const carts = await getUserCarts(element, { 50569 cartType: CartType.WaitingLists, 50570 userId: buyerUid, 50571 statuses: ACTIVE_WAITING_LIST_STATUSES, 50572 limit: 50, 50573 sessionIds, 50574 multisessionId: options?.multisessionId 50575 }); 50576 const entries = []; 50577 for (const cart of carts) { 50578 if (!cart.id) { 50579 continue; 50580 } 50581 const cartProvider = cartProviderKey(CartType.WaitingLists, cart.id); 50582 for (const item of cart.items ?? []) { 50583 if (item.entity_type !== EntityType.Event) { 50584 continue; 50585 } 50586 entries.push({ 50587 lineItem: item, 50588 cartProvider, 50589 cartId: cart.id, 50590 status: cart.status 50591 }); 50592 } 50593 } 50594 return entries; 50595 } 50596 async function loadWaitingListTunnelEntriesForBuyers(element, buyerUids, options) { 50597 const uniqueUids = [...new Set(buyerUids.filter((uid) => uid > 0))]; 50598 if (!uniqueUids.length) { 50599 return []; 50600 } 50601 const results = await Promise.all( 50602 uniqueUids.map((buyerUid) => loadWaitingListTunnelEntries(element, buyerUid, options)) 50603 ); 50604 return results.flat(); 50605 } 50606 async function resolveWaitingListBuyerUids(element, options) { 50607 if (options.appType === "counter") { 50608 const cartData = dp(options.cartProvider).data.get?.() ?? dp(options.cartProvider).data.get(); 50609 const accounts = await findCounterBuyerAccounts( 50610 toCounterCartBuyerSource(cartData, cartData?.items), 50611 options.apiConfiguration ?? HTML$1.getApiConfiguration(element) 50612 ); 50613 return accounts.map((account) => account.uid).filter((uid) => !!uid); 50614 } 50615 return options.loggedUserId ? [options.loggedUserId] : []; 50616 } 50617 async function refreshWaitingListTunnelEntries(element, options) { 50618 const requestId = ++refreshWaitingListRequestId; 50619 const buyerUids = await resolveWaitingListBuyerUids(element, options); 50620 if (requestId !== refreshWaitingListRequestId) { 50621 return asWaitingListTunnelEntries(dp(WAITING_LIST_TUNNEL_DP).data.get()); 50622 } 50623 if (!buyerUids.length) { 50624 dp(WAITING_LIST_TUNNEL_DP).data.set([]); 50625 return []; 50626 } 50627 const entries = await loadWaitingListTunnelEntriesForBuyers(element, buyerUids); 50628 if (requestId !== refreshWaitingListRequestId) { 50629 return asWaitingListTunnelEntries(dp(WAITING_LIST_TUNNEL_DP).data.get()); 50630 } 50631 dp(WAITING_LIST_TUNNEL_DP).data.set(entries); 50632 return entries; 50633 } 50634 async function resolveBuyerUid(_element, _linkedCartProvider, buyerUid) { 50635 if (buyerUid) { 50636 return buyerUid; 50637 } 50638 return void 0; 50639 } 50640 async function unlockWaitingListCartIfNeeded(cartProvider, status, apiConfiguration) { 50641 if (!status || isWaitingListTunnelEntryDirectlyEditable(status)) { 50642 return true; 50643 } 50644 if (isWaitingListTunnelEntryLockedForever(status)) { 50645 return false;
50646 } 50647 const api2 = new API(apiConfiguration); 50648 const result = await api2.put(`${cartProvider}/cancel-submission`, {}); 50649 return !!result?.success; 50650 } 50651 async function ensureWaitingListCartProvider(element, options) { 50652 const buyerId = await resolveBuyerUid(element, options.linkedCartProvider, options.buyerUid); 50653 if (!buyerId) { 50654 return null; 50655 } 50656 const apiConfiguration = options.apiConfiguration ?? HTML$1.getApiConfiguration(element); 50657 const matchingCart = await findWaitingListCart(element, { 50658 userId: buyerId, 50659 statuses: ACTIVE_WAITING_LIST_STATUSES, 50660 sessionIds: options.sessionId ? [options.sessionId] : void 0, 50661 multisessionId: options.multisessionId 50662 }); 50663 let listId = matchingCart?.id ?? null; 50664 if (!listId) { 50665 const providerKey = cartProviderKey(CartType.WaitingLists); 50666 const result = await Cart.newCart({ 50667 apiConfiguration, 50668 cartProvider: providerKey, 50669 buyer: { uid: buyerId } 50670 }); 50671 listId = result?.data?.id ?? null; 50672 } 50673 if (!listId) { 50674 return null; 50675 } 50676 const cartProvider = cartProviderKey(CartType.WaitingLists, listId); 50677 const unlocked = await unlockWaitingListCartIfNeeded(cartProvider, matchingCart?.status, apiConfiguration); 50678 return unlocked ? cartProvider : null; 50679 } 50680 async function addSessionToWaitingList(element, options) { 50681 const waitingListProvider = await ensureWaitingListCartProvider(element, { 50682 linkedCartProvider: options.linkedCartProvider, 50683 buyerUid: options.buyerUid, 50684 sessionId: options.sessionId, 50685 multisessionId: options.multisessionId, 50686 apiConfiguration: options.apiConfiguration 50687 }); 50688 if (!waitingListProvider) { 50689 return false; 50690 } 50691 const item = { 50692 entity_type: EntityType.Event, 50693 entity_id: options.sessionId, 50694 quantity: options.quantity ?? 1, 50695 ...options.parentSubscriptionId ? { parent_id: options.parentSubscriptionId } : {}, 50696 ...options.quotaId ? { quota: { id: options.quotaId } } : {} 50697 }; 50698 const apiConfiguration = options.apiConfiguration ?? HTML$1.getApiConfiguration(element); 50699 const result = await Cart.addItems({ 50700 apiConfiguration, 50701 cartProvider: waitingListProvider, 50702 items: [item] 50703 }); 50704 if (result === "error") { 50705 return false; 50706 } 50707 if (result !== "asRequested") { 50708 return true; 50709 } 50710 return lockReservationRequest(apiConfiguration, waitingListProvider); 50711 } 50712 async function removeWaitingListTunnelEntry(element, entry, apiConfiguration) { 50713 if (!entry.lineItem.id) { 50714 return; 50715 } 50716 await Cart.removeItems({ 50717 apiConfiguration: apiConfiguration ?? HTML$1.getApiConfiguration(element), 50718 cartProvider: entry.cartProvider, 50719 query: { ids: [entry.lineItem.id] } 50720 }); 50721 } 50722 function renderQuotaBadge(quota) { 50723 if (!quota?.id || isOutOfContingentQuotaId(quota.id)) return A$1; 50724 return b$1`<sonic-badge size="2xs" class="mt-2">${quota.title}</sonic-badge>`; 50725 } 50726 function getAmountLabel(price) { 50727 return price?.amount_display ? formatAmount(price.amount_display) : t("free"); 50728 } 50729 function renderWaitingListHeader(messages2) { 50730 const hasError = messages2?.some((message) => message?.status === "error"); 50731 return b$1` 50732 <sonic-badge 50733 size="2xs" 50734 type="${hasError ? "danger" : "info"}" 50735 class="font-bold italic mb-[3px] flex items-center justify-center gap-1" 50736 > 50737 <sonic-icon name="list-ol" library="custom"></sonic-icon> 50738 ${t("waiting_list")} 50739 </sonic-badge> 50740 `; 50741 } 50742 function renderPriceHeader(price) { 50743 const promoIcon = price.is_triggering_promo ? b$1`<sonic-icon 50744 name="stars" 50745 library="custom" 50746 prefix="solid" 50747 class="animate-heartbeat inline-block" 50748 ></sonic-icon>` : price.is_promo ? b$1`<sonic-icon 50749 name="gift" 50750 library="custom" 50751 prefix="solid" 50752 class="animate-heartbeat inline-block" 50753 ></sonic-icon>` : A$1; 50754 const categoryLabel = price.placeCategory?.title ? b$1`<div class="font-bold italic mb-[3px]">${price.placeCategory.title}</div>` : A$1; 50755 const priceTitle = b$1`<div class="mb-[2px]">${promoIcon} ${price.label}</div>`; 50756 return b$1`<div class="text-pretty mb-2">${categoryLabel} ${priceTitle}</div>`; 50757 }
50758 function renderSeatLabel(seat) { 50759 if (!seat?.short_name) return A$1; 50760 return b$1` 50761 <span class="flex items-center gap-x-1"> 50762 <sonic-icon name="loveseat" library="custom"></sonic-icon> 50763 <span>${seat.short_name}</span> 50764 </span> 50765 `; 50766 } 50767 function renderQuickSelectLineItemMarkup(lineItem, isWaitingList2) { 50768 const { price, quota, messages: messages2, seat } = lineItem; 50769 const amountLabel = getAmountLabel(price); 50770 const editRow = b$1`<div class="flex items-center gap-x-1"> 50771 <span>${amountLabel}</span> 50772 <span>|</span> 50773 <sonic-icon name="pen" library="custom"></sonic-icon> 50774 </div>`; 50775 const quotaBadge = renderQuotaBadge(quota); 50776 if (isWaitingList2) { 50777 const priceLabel = price?.label ?? t("waiting_list"); 50778 return b$1` 50779 <div class="text-pretty mb-2 flex flex-col items-center justify-center gap-1"> 50780 ${renderWaitingListHeader(messages2)} 50781 <div class="mb-[2px]">${priceLabel}</div> 50782 ${editRow} 50783 </div> 50784 ${quotaBadge} 50785 `; 50786 } 50787 if (!price) return "..."; 50788 return b$1` 50789 ${renderPriceHeader(price)} 50790 <div class="flex gap-x-3 flex-nowrap justify-center">${renderSeatLabel(seat)} ${editRow}</div> 50791 ${quotaBadge} 50792 `; 50793 } 50794 var __defProp$1t = Object.defineProperty; 50795 var __getOwnPropDesc$1v = Object.getOwnPropertyDescriptor; 50796 var __decorateClass$1v = (decorators, target, key, kind) => { 50797 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1v(target, key) : target; 50798 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 50799 if (decorator = decorators[i2]) 50800 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 50801 if (kind && result) __defProp$1t(target, key, result); 50802 return result; 50803 }; 50804 let SonicCartQuickSelectLineItem = class extends Subscriber$1(i$6) { 50805 constructor() { 50806 super(...arguments); 50807 this.cartProvider = ""; 50808 } 50809 render() { 50810 const entry = this.entry; 50811 if (!entry) return A$1; 50812 const { lineItem, waitingListEntry } = entry; 50813 const { id, has_error, messages: messages2 } = lineItem; 50814 if (!id) return A$1; 50815 const isWaitingList2 = !!waitingListEntry; 50816 const isLockedForever2 = isWaitingList2 && isWaitingListTunnelEntryLockedForever(waitingListEntry.status); 50817 const displayMessages = isWaitingList2 ? messages2?.filter((message) => message?.status === "error") : messages2; 50818 const hasWarning = !!displayMessages?.some((message) => message?.status === "warning"); 50819 const messageMarkup = this.renderLineItemMessages(displayMessages, hasWarning); 50820 const buttonType = this.getLineItemButtonType(lineItem, { 50821 isWaitingList: isWaitingList2, 50822 hasError: !!has_error, 50823 hasWarning 50824 }); 50825 const buttonVariant = has_error || isWaitingList2 ? "outline" : "default"; 50826 const itemMarkup = renderQuickSelectLineItemMarkup(lineItem, isWaitingList2); 50827 const fadeAnimation = F({ in: v, out: f, stabilizeOut: true }); 50828 const openEditModal = async () => { 50829 if (isWaitingList2 && waitingListEntry) { 50830 const wasSubmitted = waitingListEntry.status === ReservationStatus.Submitted; 50831 const editable = await ensureWaitingListTunnelEntryEditable(waitingListEntry, this.getApiConfiguration()); 50832 if (!editable) return; 50833 editPriceModal({ 50834 lineItems: [lineItem], 50835 cartProvider: waitingListEntry.cartProvider, 50836 linkedCartProvider: this.cartProvider, 50837 accessParams: { ...this.accessParams, isWaitingList: true }, 50838 onUpdated: async () => { 50839 if (wasSubmitted) { 50840 await restoreWaitingListTunnelEntrySubmission(waitingListEntry, this.getApiConfiguration()); 50841 } 50842 this.dispatchWaitingListUpdated(); 50843 } 50844 }); 50845 return; 50846 } 50847 editPriceModal({ 50848 lineItems: [lineItem], 50849 cartProvider: this.cartProvider, 50850 accessParams: this.accessParams 50851 }); 50852 }; 50853 const removeItem = async () => { 50854 if (isWaitingList2 && waitingListEntry) { 50855 const editable = await ensureWaitingListTunnelEntryEditable(waitingListEntry, this.getApiConfiguration()); 50856 if (!editable) return; 50857 await removeWaitingListTunnelEntry(this, waitingListEntry, this.getApiConfiguration()); 50858 this.dispatchWaitingListUpdated(); 50859 return; 50860 } 50861 await Cart.removeItems({ 50862 apiConfiguration: this.getApiConfiguration(), 50863 cartProvider: this.cartProvider, 50864 query: { ids: [id] } 50865 }); 50866 }; 50867 const mainButton = b$1` 50868 <sonic-button 50869 type="${buttonType}" 50870 variant="${buttonVariant}" 50871 size="xs" 50872 shape="block" 50873 ${fadeAnimation} 50874 class="w-full relative ${isLockedForever2 ? "pointer-events-none" : "hover:opacity-85 transition-opacity duration-100"}" 50875 @click="${isLockedForever2 ? void 0 : () => void openEditModal()}" 50876 > 50877 ${itemMarkup} ${messageMarkup} 50878 </sonic-button> 50879 `; 50880 const removeButton = !isLockedForever2 ? b$1` 50881 <sonic-button 50882 size="2xs" 50883 icon 50884 shape="circle" 50885 type="danger" 50886 ${fadeAnimation} 50887 class="absolute -right-2 -top-2 rounded-full hover:scale-110 transition-all duration-100" 50888 data-aria-label=${t("LIB_remove")} 50889 @click="${() => void removeItem()}" 50890 > 50891 <sonic-icon name="trash" library="custom"></sonic-icon> 50892 </sonic-button> 50893 ` : A$1; 50894 return b$1` <div class="relative my-1 z-[2]">${mainButton} ${removeButton}</div> `; 50895 } 50896 dispatchWaitingListUpdated() { 50897 this.dispatchEvent(new CustomEvent("waiting-list-updated", { bubbles: true, composed: true })); 50898 } 50899 getLineItemButtonType(lineItem, { isWaitingList: isWaitingList2, hasError, hasWarning }) { 50900 if (hasError) return "danger"; 50901 if (hasWarning) return "warning"; 50902 if (lineItem.price?.is_triggering_promo) return "success"; 50903 if (isWaitingList2) return "info"; 50904 return "neutral"; 50905 } 50906 renderLineItemMessages(messages2, hasWarning) { 50907 if (!messages2?.length) return A$1; 50908 return b$1` 50909 <div class="mt-2 ${hasWarning ? "animate-pulse" : ""}"> 50910 ${o( 50911 o$1(messages2, (message) => message?.content ? o$6(message.content) : A$1), 50912 b$1`<br />` 50913 )} 50914 </div> 50915 `; 50916 } 50917 }; 50918 SonicCartQuickSelectLineItem.styles = [tailwind]; 50919 __decorateClass$1v([ 50920 n$5({ type: Object }) 50921 ], SonicCartQuickSelectLineItem.prototype, "entry", 2); 50922 __decorateClass$1v([ 50923 n$5({ type: String }) 50924 ], SonicCartQuickSelectLineItem.prototype, "cartProvider", 2); 50925 __decorateClass$1v([ 50926 n$5({ type: Object }) 50927 ], SonicCartQuickSelectLineItem.prototype, "accessParams", 2); 50928 SonicCartQuickSelectLineItem = __decorateClass$1v([ 50929 t$3("sonic-cart-quick-select-line-item") 50930 ], SonicCartQuickSelectLineItem); 50931 var __defProp$1s = Object.defineProperty; 50932 var __getOwnPropDesc$1u = Object.getOwnPropertyDescriptor; 50933 var __decorateClass$1u = (decorators, target, key, kind) => { 50934 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1u(target, key) : target; 50935 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 50936 if (decorator = decorators[i2]) 50937 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 50938 if (kind && result) __defProp$1s(target, key, result); 50939 return result; 50940 }; 50941 dp("cart/quickSelect/isAdding").set(false); 50942 let SonicCartQuickSelectSessionPrices = class extends Subscriber$1(i$6) { 50943 constructor() { 50944 super(...arguments); 50945 this.items = []; 50946 this.hasSeatmap = false;
50947 this._waitingListShowEntries = []; 50948 this._availablePrices = null; 50949 this._isLoading = false; 50950 this._waitingListEnabled = false; 50951 this._availablePricesRequestId = 0; 50952 this._isAdding = false; 50953 this._waitingListModuleEnabled = false; 50954 this._cartProvider = ""; 50955 this._availableQuotas = []; 50956 } 50957 connectedCallback() { 50958 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 50959 super.connectedCallback(); 50960 } 50961 get _waitingListEntries() { 50962 if (!this.priceContext?.entityId) return []; 50963 return filterWaitingListTunnelEntries( 50964 this._waitingListShowEntries ?? [], 50965 Number(this.priceContext.entityId), 50966 this.priceContext.parentSubscription?.id 50967 ); 50968 } 50969 get _waitingListEntriesForSubscriber() { 50970 return filterWaitingListTunnelEntriesForSubscriber( 50971 this._waitingListShowEntries ?? [], 50972 this.priceContext?.parentSubscription?.id 50973 ); 50974 } 50975 dispatchWaitingListUpdated() { 50976 this.dispatchEvent(new CustomEvent("waiting-list-updated", { bubbles: true, composed: true })); 50977 } 50978 willUpdate(_changedProperties) { 50979 if (_changedProperties.has("items") || _changedProperties.has("priceContext") && this.priceContext) { 50980 const subscriptionEntityId = this.priceContext?.parentSubscription?.entity_id; 50981 this.updateGeneralCondition(subscriptionEntityId); 50982 } 50983 if (_changedProperties.has("priceContext") && this.priceContext?.entityId && this.isConnected) { 50984 const previousPriceContext = _changedProperties.get("priceContext"); 50985 if (previousPriceContext?.entityId !== this.priceContext?.entityId || previousPriceContext?.parentSubscription?.id !== this.priceContext?.parentSubscription?.id) { 50986 this._availablePrices = null; 50987 this._availableQuotas = []; 50988 void this.setAvailablePrices(); 50989 } 50990 } 50991 if (_changedProperties.has("items") && this._pricesLoaded) { 50992 this._isLoading = false; 50993 } 50994 if (_changedProperties.has("loggedUserId") && this.loggedUserId && this._customerAccountModal) { 50995 this._customerAccountModal.hide(); 50996 this._customerAccountModal = void 0; 50997 } 50998 super.willUpdate(_changedProperties); 50999 } 51000 get canUseWaitingList() { 51001 const isCanceled = this.infosStatus?.additionnals?.some((additionnal) => additionnal.key === "canceled"); 51002 const notVisibleForCurrentCustomerType = this.infosStatus?.publication !== Publication.OnSale && "customer" === this.appType; 51003 if (isCanceled || notVisibleForCurrentCustomerType) return false; 51004 return this._waitingListModuleEnabled && this._waitingListEnabled; 51005 } 51006 get _pricesLoaded() { 51007 return this._availablePrices !== null; 51008 } 51009 get canAddToCart() { 51010 return (this._availablePrices?.length ?? 0) > 0; 51011 } 51012 /** Hors contingent ou contingent préféré guichet sans places restantes. */ 51013 get hasRelevantQuotaWithoutRemaining() { 51014 const outOfContingentQuota = this._availableQuotas.find((quota) => isOutOfContingentQuotaId(quota.id)); 51015 if (outOfContingentQuota?.has_remaining === false) return true; 51016 if (this.preferredQuotaId) { 51017 const preferredQuota = this._availableQuotas.find((quota) => Number(quota.id) === Number(this.preferredQuotaId)); 51018 if (preferredQuota?.has_remaining === false) return true; 51019 } 51020 return false; 51021 } 51022 /** 51023 * Indique si l'utilisateur peut ajouter la session à la liste d'attente ("waiting list"). 51024 * 51025 * â true si : 51026 * - les prix sont chargés, 51027 * - la waiting list est possible sur cette session, 51028 * - l'utilisateur peut ajouter plus de places à la session, 51029 * - (règles différentes selon le mode guichet ou non) 51030 * 51031 * Pour le mode "counter" (guichet) : 51032 * - true si : il y a un quota pertinent sans places restantes OU on ne peut pas ajouter au panier. 51033 * Pour les autres : true si on ne peut pas ajouter au panier. 51034 */ 51035 get canAddWaitingList() { 51036 if (!this._pricesLoaded || !this.canUseWaitingList || !this.canAddMoreToSession) return false;
51037 if (this.appType === "counter") { 51038 return this.hasRelevantQuotaWithoutRemaining || !this.canAddToCart; 51039 } 51040 return !this.canAddToCart; 51041 } 51042 get matchingLineItems() { 51043 return this.items.filter( 51044 (item) => this.belongsToSubscriber(item) && Number(item.entity_id) === Number(this.priceContext?.entityId) && item.entity_type === EntityType.Event 51045 ); 51046 } 51047 get selectedQuantity() { 51048 return this.matchingLineItems.length + this._waitingListEntries.length; 51049 } 51050 get minTicketsPerSession() { 51051 return this._generalCondition?.ticketsPerSession?.min ?? 1; 51052 } 51053 get maxTicketsPerSession() { 51054 return this._generalCondition?.ticketsPerSession?.max ?? 999; 51055 } 51056 get maxSessionsPerShow() { 51057 return this._generalCondition?.sessionsPerShow?.max ?? null; 51058 } 51059 belongsToSubscriber(item) { 51060 const parentId = this.priceContext?.parentSubscription?.id; 51061 return parentId ? item.parent_id === parentId : !item.parent_id; 51062 } 51063 get sessionIdsWithItemsForShow() { 51064 const showId = Number(this.multisessionId); 51065 if (!showId) return /* @__PURE__ */ new Set(); 51066 const lineItems = [ 51067 ...this.items.filter((item) => this.belongsToSubscriber(item)), 51068 ...this._waitingListEntriesForSubscriber.map((entry) => entry.lineItem) 51069 ]; 51070 return new Set( 51071 lineItems.filter((item) => item.entity_type === EntityType.Event && item.multisession_id === showId && item.entity_id).map((item) => Number(item.entity_id)) 51072 ); 51073 } 51074 get canAddMoreToSession() { 51075 const currentSessionId = Number(this.priceContext?.entityId); 51076 if (!currentSessionId) return false; 51077 if (this.maxTicketsPerSession && this.selectedQuantity >= this.maxTicketsPerSession) return false; 51078 const sessionsPerShowMax = this.maxSessionsPerShow; 51079 if (sessionsPerShowMax == null) return true; 51080 if (this.isShowLimitReached) return false; 51081 return !(sessionsPerShowMax === 1 && this.selectedQuantity >= 1); 51082 } 51083 get isShowLimitReached() { 51084 const sessionsPerShowMax = this.maxSessionsPerShow; 51085 const currentSessionId = Number(this.priceContext?.entityId); 51086 if (sessionsPerShowMax == null || !currentSessionId) return false; 51087 const sessionsWithItems = this.sessionIdsWithItemsForShow; 51088 return !sessionsWithItems.has(currentSessionId) && sessionsWithItems.size >= sessionsPerShowMax; 51089 } 51090 get displayLineItems() { 51091 return [ 51092 ...this.matchingLineItems.map((lineItem) => ({ lineItem })), 51093 ...this._waitingListEntries.map((entry) => ({ lineItem: entry.lineItem, waitingListEntry: entry })) 51094 ]; 51095 } 51096 getCounterCartBuyerSource() { 51097 const cartData = dp(this._cartProvider).data.get?.() ?? dp(this._cartProvider).data.get(); 51098 return toCounterCartBuyerSource(cartData, this.items); 51099 } 51100 /** 51101 * Au guichet : résout le compte client du détenteur de la colonne abonné. 51102 */ 51103 async resolveCounterBuyer() { 51104 return resolveCounterBuyerUidForSubscription( 51105 this.getCounterCartBuyerSource(), 51106 this.getApiConfiguration(), 51107 this.priceContext?.parentSubscription?.owner?.email 51108 ); 51109 } 51110 openCustomerAccountModal() { 51111 this._customerAccountModal = Modal.create({ 51112 title: t("LIB_account_required"), 51113 content: b$1`<sonic-user-form-login createAccount></sonic-user-form-login>`, 51114 removeOnHide: true 51115 }); 51116 } 51117 openCounterCreateAccountModal() { 51118 Modal.create({ 51119 title: t("LIB_account_required"), 51120 content: b$1`<sonic-alert 51121 background 51122 status="info" 51123 label="Aucun compte client ne correspond à l'email d'un abonnement du panier." 51124 > 51125 Veuillez créer un compte client correspondant à l'email d'un abonnement du panier. 51126 </sonic-alert> `, 51127 removeOnHide: true 51128 }); 51129 } 51130 /** 51131 * Met à jour la condition générale de l'abonnement (règles ticketsPerSession, sessionsPerShow, etc.) 51132 * @param subscriptionEntityId - ID de l'entité abonnement 51133 */ 51134 updateGeneralCondition(subscriptionEntityId) { 51135 this._generalCondition = subscriptionEntityId ? getSubscriptionRules(subscriptionEntityId, this._cartProvider)?.[0]?.conditions?.[0] : void 0; 51136 } 51137 /**
51138 * Récupère les prix disponibles pour l'entité 51139 * Et les contingent disponibles 51140 */ 51141 async setAvailablePrices() { 51142 if (!this.priceContext) return; 51143 const requestId = ++this._availablePricesRequestId; 51144 const api2 = getDefaultApi(); 51145 const endpoint = priceEndPoint(this.priceContext, this.accessParams); 51146 this._isLoading = true; 51147 try { 51148 const result = await api2.get(endpoint); 51149 if (requestId !== this._availablePricesRequestId) return; 51150 const data = result?.data; 51151 this._availablePrices = data?.prices?.filter((price) => price?.price_available) ?? []; 51152 this._availableQuotas = data?.quotas ?? []; 51153 this._waitingListEnabled = !!data?.settings?.waiting_list?.enabled; 51154 } finally { 51155 if (requestId === this._availablePricesRequestId) { 51156 this._isLoading = false; 51157 } 51158 } 51159 } 51160 getLastQuotaId() { 51161 if (this.items.length === 0) return; 51162 const subscriptionItems = this.items.filter((item) => item.parent_id === this.priceContext?.parentSubscription?.id); 51163 if (subscriptionItems.length === 0) return; 51164 const sortedItems = this.sortItemsByUpdatedAt(subscriptionItems); 51165 const lastItem = sortedItems[0]; 51166 if (!lastItem.quota) return 0; 51167 return Number(lastItem.quota?.id); 51168 } 51169 getPreferredQuotaId() { 51170 const lastQuotaId = this.getLastQuotaId(); 51171 const lastQuotaIsOutOfContingentOrUnset = !lastQuotaId || isOutOfContingentQuotaId(lastQuotaId); 51172 if (lastQuotaIsOutOfContingentOrUnset && this.preferredQuotaId) { 51173 return Number(this.preferredQuotaId); 51174 } 51175 if (lastQuotaId) { 51176 return Number(lastQuotaId); 51177 } 51178 if (this.preferredQuotaId) { 51179 return Number(this.preferredQuotaId); 51180 } 51181 return void 0; 51182 } 51183 sortItemsByUpdatedAt(items) { 51184 return [...items].sort((a2, b2) => { 51185 if (a2.updatedAt && b2.updatedAt) { 51186 return b2.updatedAt - a2.updatedAt; 51187 } 51188 return 0; 51189 }); 51190 } 51191 async addToCart() { 51192 if (!this.canAddMoreToSession) return; 51193 if (this.needsPriceSelection()) { 51194 this.openPriceSelectionModal(); 51195 return; 51196 } 51197 if (this.maxTicketsPerSession && this.selectedQuantity >= this.maxTicketsPerSession) return; 51198 await this.submitCartAddition(this.computeQuantityToAdd()); 51199 } 51200 needsPriceSelection() { 51201 const lastQuotaId = this.getLastQuotaId(); 51202 return this.hasAmbiguousFreePrice() || this.hasMultiplePricesWithoutQuotaHistory(lastQuotaId) || this.hasMultipleQuotasWithoutPreference(lastQuotaId); 51203 } 51204 /** Plusieurs prix dont au moins un gratuit et au moins un payant â choix ambigu. */ 51205 hasAmbiguousFreePrice() { 51206 const prices = this._availablePrices; 51207 if (!prices || prices.length <= 1) return false; 51208 const hasFreePrice = prices.some((price) => price.amount === 0); 51209 const allPricesAreFree = prices.every((price) => price.amount === 0); 51210 return hasFreePrice && !allPricesAreFree; 51211 } 51212 /** Plusieurs prix mais aucun historique de quota dans le panier â on laisse l'utilisateur choisir. */ 51213 hasMultiplePricesWithoutQuotaHistory(lastQuotaId) { 51214 const prices = this._availablePrices; 51215 if (!prices || prices.length <= 1) return false; 51216 return !lastQuotaId; 51217 } 51218 /** Plusieurs quotas visibles sans préférence guichet ni historique â on laisse l'utilisateur choisir. */ 51219 hasMultipleQuotasWithoutPreference(lastQuotaId) { 51220 if (!this._availableQuotas?.length) return false; 51221 const visibleQuotaCount = this._availableQuotas.filter( 51222 (quota) => quota?.prices?.some((price) => price.visible === true) 51223 ).length; 51224 if (visibleQuotaCount <= 1) return false; 51225 return !this.preferredQuotaId && !lastQuotaId; 51226 } 51227 openPriceSelectionModal() { 51228 if (!this.priceContext) return; 51229 addPriceModal({ 51230 cartProvider: this._cartProvider, 51231 priceContext: this.priceContext, 51232 preferredQuotaId: this.preferredQuotaId || this.getLastQuotaId() 51233 }); 51234 } 51235 openPriceModalAfterApiMismatch() { 51236 if (!this.priceContext) return; 51237 addPriceModal({ 51238 cartProvider: this._cartProvider, 51239 priceContext: this.priceContext, 51240 accessParams: this.accessParams 51241 }); 51242 } 51243 computeQuantityToAdd() { 51244 let quantity = 1; 51245 if (this.selectedQuantity + quantity > this.maxTicketsPerSession) { 51246 quantity = this.maxTicketsPerSession - this.selectedQuantity; 51247 } 51248 if (this.selectedQuantity === 0) { 51249 quantity = this.minTicketsPerSession; 51250 } 51251 return quantity; 51252 } 51253 buildLineItemToAdd(quantity) { 51254 const quotaId = this.getPreferredQuotaId(); 51255 return { 51256 entity_type: EntityType.Event, 51257 entity_id: Number(this.priceContext?.entityId), 51258 parent_id: this.priceContext?.parentSubscription?.id, 51259 quantity, 51260 ...quotaId ? { quota: { id: quotaId } } : {} 51261 }; 51262 } 51263 async submitCartAddition(quantity) { 51264 dp("cart/quickSelect/isAdding").set(true);
51265 try { 51266 const result = await Cart.addItems({ 51267 apiConfiguration: this.getApiConfiguration(), 51268 cartProvider: this._cartProvider, 51269 items: [this.buildLineItemToAdd(quantity)], 51270 auto_seating: true, 51271 attachOwnersAfterRequest: true, 51272 accessParams: this.accessParams 51273 }); 51274 if (result === "differentFromRequest") { 51275 this.openPriceModalAfterApiMismatch(); 51276 } 51277 } finally { 51278 dp("cart/quickSelect/isAdding").set(false); 51279 } 51280 } 51281 async addToWaitingList() { 51282 if (!this.priceContext?.entityId) return; 51283 if (!this.canAddMoreToSession) return; 51284 let buyerUid; 51285 if (this.appType === "counter") { 51286 const { uid, hasCandidateAccounts } = await this.resolveCounterBuyer(); 51287 if (!uid) { 51288 if (!hasCandidateAccounts) { 51289 this.openCounterCreateAccountModal(); 51290 } 51291 return; 51292 } 51293 buyerUid = uid; 51294 } else { 51295 buyerUid = this.loggedUserId ?? void 0; 51296 if (!buyerUid) { 51297 this.openCustomerAccountModal(); 51298 return; 51299 } 51300 } 51301 dp("cart/quickSelect/isAdding").set(true); 51302 const success = await addSessionToWaitingList(this, { 51303 linkedCartProvider: this._cartProvider, 51304 sessionId: Number(this.priceContext.entityId), 51305 multisessionId: this.multisessionId, 51306 parentSubscriptionId: this.priceContext.parentSubscription?.id, 51307 quotaId: this.getPreferredQuotaId(), 51308 quantity: 1, 51309 apiConfiguration: this.getApiConfiguration(), 51310 buyerUid 51311 }); 51312 dp("cart/quickSelect/isAdding").set(false); 51313 if (success) { 51314 await refreshWaitingListTunnelEntries(this, { 51315 cartProvider: this._cartProvider, 51316 appType: this.appType, 51317 loggedUserId: this.loggedUserId, 51318 apiConfiguration: this.getApiConfiguration() 51319 }); 51320 this.dispatchWaitingListUpdated(); 51321 } 51322 } 51323 render() { 51324 if (this._isLoading || !this._pricesLoaded && this.priceContext?.entityId) { 51325 return b$1`<sonic-loader mode="inline" class="opacity-20"></sonic-loader>`; 51326 } 51327 const displayItems = this.displayLineItems; 51328 const hasDisplayItems = displayItems.length > 0; 51329 const unavailableMessage = this.getUnavailableMessage(); 51330 if (unavailableMessage && !hasDisplayItems && !this.canAddWaitingList) { 51331 return b$1`${this.renderUnavailableMessage(unavailableMessage)}`; 51332 } 51333 const noQuantity = this.selectedQuantity === 0; 51334 const manualPlacement = this.placementType === PlacementType.MANUAL && this.hasSeatmap; 51335 return b$1` 51336 <div class="text-center"> 51337 ${unavailableMessage ? this.renderUnavailableMessage(unavailableMessage) : A$1} ${this._renderItems()} 51338 ${this.canAddToCart && this.canAddMoreToSession ? b$1` <div class="${noQuantity ? "" : "mt-1"} justify-center flex items-center"> 51339 <div class="inline-flex relative items-center"> 51340 <sonic-button 51341 size="${noQuantity && !hasDisplayItems ? "md" : "xs"}" 51342 shape="circle" 51343 variant="ghost" 51344 ?disabled=${this._isAdding} 51345 @click="${() => { 51346 if (!this.canAddMoreToSession) return; 51347 if (manualPlacement && this.priceContext) { 51348 addSeatsModal({ 51349 cartProvider: this._cartProvider, 51350 navigationMode: "event", 51351 priceContext: this.priceContext, 51352 accessParams: this.accessParams 51353 }); 51354 } else { 51355 this.addToCart(); 51356 } 51357 }}" 51358 icon 51359 class="relative hover:scale-110 transition-all duration-100 inline-block will-change-transform" 51360 > 51361 <sonic-icon name="plus" library="custom" size="lg"></sonic-icon> 51362 </sonic-button> 51363 </div> 51364 </div>` : A$1} 51365 ${this.canAddWaitingList ? b$1`<div class="${hasDisplayItems ? "mt-3" : "mt-1"} justify-center flex items-center"> 51366 <sonic-button 51367 size="xs" 51368 variant="default" 51369 ?disabled=${this._isAdding} 51370 @click=${() => this.addToWaitingList()} 51371 class="mx-auto" 51372 > 51373 <sonic-icon name="plus" library="custom" slot="prefix" size="lg"></sonic-icon>
51374 <span>${t("waiting_list")}</span> 51375 </sonic-button> 51376 </div>` : A$1} 51377 </div> 51378 `; 51379 } 51380 _renderItems() { 51381 return b$1` 51382 ${c$1( 51383 this.displayLineItems, 51384 (entry) => entry.waitingListEntry?.lineItem.id ?? entry.lineItem.id ?? "", 51385 (entry) => b$1` 51386 <sonic-cart-quick-select-line-item 51387 .entry=${entry} 51388 .cartProvider=${this._cartProvider} 51389 .accessParams=${this.accessParams} 51390 ></sonic-cart-quick-select-line-item> 51391 ` 51392 )} 51393 `; 51394 } 51395 getUnavailableMessage() { 51396 if (!this._pricesLoaded) return void 0; 51397 if (!this.canAddToCart && this.matchingLineItems.length === 0) { 51398 const hasSubscription = !!this.priceContext?.parentSubscription?.id; 51399 return hasSubscription ? t("no_price_available_for_this_offer") : t("no_price_available"); 51400 } 51401 if (this.isShowLimitReached) { 51402 return t("LIB_max_reached_for_this_event"); 51403 } 51404 return void 0; 51405 } 51406 renderUnavailableMessage(text) { 51407 return b$1`<div class="text-center text-neutral-500 my-1 lg:my-2"> 51408 <sonic-icon name="ban" library="custom"></sonic-icon> 51409 <div class="text-xs mt-1 text-balance mx-2">${text}</div> 51410 </div>`; 51411 } 51412 }; 51413 SonicCartQuickSelectSessionPrices.styles = [tailwind]; 51414 __decorateClass$1u([ 51415 n$5({ type: Array }) 51416 ], SonicCartQuickSelectSessionPrices.prototype, "items", 2); 51417 __decorateClass$1u([ 51418 n$5({ type: Boolean }) 51419 ], SonicCartQuickSelectSessionPrices.prototype, "hasSeatmap", 2); 51420 __decorateClass$1u([ 51421 n$5({ type: Object }) 51422 ], SonicCartQuickSelectSessionPrices.prototype, "priceContext", 2); 51423 __decorateClass$1u([ 51424 n$5({ type: Number }) 51425 ], SonicCartQuickSelectSessionPrices.prototype, "multisessionId", 2); 51426 __decorateClass$1u([ 51427 bind$1(WAITING_LIST_TUNNEL_BIND_PATH), 51428 r$5() 51429 ], SonicCartQuickSelectSessionPrices.prototype, "_waitingListShowEntries", 2); 51430 __decorateClass$1u([ 51431 r$5() 51432 ], SonicCartQuickSelectSessionPrices.prototype, "_availablePrices", 2); 51433 __decorateClass$1u([ 51434 r$5() 51435 ], SonicCartQuickSelectSessionPrices.prototype, "_isLoading", 2); 51436 __decorateClass$1u([ 51437 r$5() 51438 ], SonicCartQuickSelectSessionPrices.prototype, "_waitingListEnabled", 2); 51439 __decorateClass$1u([ 51440 r$5() 51441 ], SonicCartQuickSelectSessionPrices.prototype, "_generalCondition", 2); 51442 __decorateClass$1u([ 51443 bind$1("cart/quickSelect/isAdding"), 51444 r$5() 51445 ], SonicCartQuickSelectSessionPrices.prototype, "_isAdding", 2); 51446 __decorateClass$1u([ 51447 bind$1("settings.modules.waiting_list.enabled"), 51448 r$5() 51449 ], SonicCartQuickSelectSessionPrices.prototype, "_waitingListModuleEnabled", 2); 51450 __decorateClass$1u([ 51451 bind$1("user.id"), 51452 n$5({ type: Number }) 51453 ], SonicCartQuickSelectSessionPrices.prototype, "loggedUserId", 2); 51454 __decorateClass$1u([ 51455 c({ context: preferredQuotaIdContext, subscribe: true }), 51456 r$5() 51457 ], SonicCartQuickSelectSessionPrices.prototype, "preferredQuotaId", 2); 51458 __decorateClass$1u([ 51459 c({ context: appType, subscribe: true }), 51460 n$5({ type: String }) 51461 ], SonicCartQuickSelectSessionPrices.prototype, "appType", 2); 51462 __decorateClass$1u([ 51463 r$5() 51464 ], SonicCartQuickSelectSessionPrices.prototype, "_availableQuotas", 2); 51465 __decorateClass$1u([ 51466 bind$1(QUICK_SELECT_PLACEMENT_TYPE), 51467 r$5() 51468 ], SonicCartQuickSelectSessionPrices.prototype, "placementType", 2); 51469 __decorateClass$1u([ 51470 c({ context: accessParamsContext, subscribe: true }), 51471 n$5({ type: Object }) 51472 ], SonicCartQuickSelectSessionPrices.prototype, "accessParams", 2); 51473 __decorateClass$1u([ 51474 n$5({ type: Object }) 51475 ], SonicCartQuickSelectSessionPrices.prototype, "infosStatus", 2); 51476 SonicCartQuickSelectSessionPrices = __decorateClass$1u([ 51477 t$3("sonic-cart-quick-select-session-prices") 51478 ], SonicCartQuickSelectSessionPrices); 51479 var __defProp$1r = Object.defineProperty; 51480 var __getOwnPropDesc$1t = Object.getOwnPropertyDescriptor; 51481 var __decorateClass$1t = (decorators, target, key, kind) => { 51482 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1t(target, key) : target; 51483 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 51484 if (decorator = decorators[i2]) 51485 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 51486 if (kind && result) __defProp$1r(target, key, result); 51487 return result; 51488 }; 51489 let SonicCartQuickSelectSessionRow = class extends Subscriber$1(i$6) { 51490 constructor() { 51491 super(...arguments); 51492 this.id = ""; 51493 this._subscriptions = []; 51494 this._metadata_ = {}; 51495 this.isFirstRow = false;
51496 this.isOdd = false; 51497 this.isLarge = false; 51498 this.isCondensed = false; 51499 this._cartProvider = ""; 51500 this._currentStatusEndpoint = ""; 51501 this._showOtherOwners = false; 51502 this.updateStatus = () => { 51503 this._infosStatus = dp(this.dataProviderStatusKey).get()?.infos_status || null; 51504 }; 51505 } 51506 connectedCallback() { 51507 this._cartProvider = this.getAncestorAttributeValue("cartProvider") || "cart/current"; 51508 super.connectedCallback(); 51509 } 51510 get dataProviderStatusKey() { 51511 return `quickSelect/status/${this.id}`; 51512 } 51513 willUpdate(_changedProperties) { 51514 if (_changedProperties.has("_metadata_")) { 51515 this.isFirstRow = !!this._metadata_.firstChild; 51516 this.isOdd = !!this._metadata_.odd; 51517 } 51518 if (_changedProperties.has("id") && this.id) { 51519 const previousId = _changedProperties.get("id"); 51520 if (previousId) { 51521 dp(`quickSelect/status/${previousId}`).offInternalMutation(this.updateStatus); 51522 } 51523 this._currentStatusEndpoint = this.statusEndPoint(this.id); 51524 dp(this.dataProviderStatusKey).onInternalMutation(this.updateStatus); 51525 } 51526 super.willUpdate(_changedProperties); 51527 } 51528 disconnectedCallback() { 51529 if (this.id) { 51530 dp(this.dataProviderStatusKey).offInternalMutation(this.updateStatus); 51531 } 51532 this._currentStatusEndpoint = ""; 51533 super.disconnectedCallback(); 51534 } 51535 statusEndPoint(id) { 51536 return entityEndPoint({ 51537 entityType: EntityType.Event, 51538 entityId: Number(id), 51539 accessParams: this.accessParams, 51540 view: entityView.status, 51541 subscriptionTypeIds: this._subscriptions?.map((subscription) => subscription.entity_id?.toString() || ""), 51542 subscriptionPriceIds: this._subscriptions?.map((subscription) => Number(subscription.price?.id) || 0) 51543 }); 51544 } 51545 render() { 51546 const isCondensed = this.isCondensed; 51547 return b$1` 51548 <div class="flex"> 51549 <div class="flex flex-col min-h-16 w-[--_event-width] shrink-0 pl-3 pr-1 md:px-2 lg:px-3 py-3 relative "> 51550 <div class="flex flex-row w-full gap-2 min-w-0 items-start "> 51551 <div class="flex items-center gap-2"> 51552 <sonic-date 51553 class="font-bold lg:min-w-[11rem] block leading-none mb-1 uppercase ${!this.isLarge ? "max-w-[15ch]" : ""}" 51554 month="2-digit" 51555 designMode 51556 noshadowdom 51557 > 51558 <template data-value="literal"> 51559 <span class="text-[.9em] font-normal"></span> 51560 </template> 51561 <template data-value="hour"> 51562 <span class="text-[.9em] font-normal"></span> 51563 </template> 51564 <template data-value="minute"> 51565 <span class="text-[.9em] font-normal"></span> 51566 </template> 51567 </sonic-date> 51568 51569 ${isCondensed ? b$1`<sonic-pop class="-mt-1" 51570 ><sonic-button variant="ghost" shape="circle" size="xs" icon> 51571 <sonic-icon name="circle-info" library="custom" class="text-neutral-500"></sonic-icon> 51572 </sonic-button> 51573 <div slot="content" class="p-3 max-w-[18rem]"> 51574 <sonic-event-taxonomies size="xs"></sonic-event-taxonomies> 51575 <sonic-event-location-hall 51576 ?noPlacement=${!this.isLarge} 51577 size="xs" 51578 class="text-xs mt-1 block " 51579 ></sonic-event-location-hall> 51580 </div> 51581 </sonic-pop>` : A$1} 51582 </div> 51583 </div> 51584 51585 <div class="text-2xs lg:text-xs pointer-events-none"> 51586 <div class=${this.appType === "counter" ? "block w-full min-h-[1.25rem]" : "contents"}> 51587 <sonic-event-additional-status 51588 variant="ghost" 51589 fetch 51590 size="inherit" 51591 warnAndDangerAsPill 51592 key="data" 51593 endpoint=${this._currentStatusEndpoint} 51594 dataProvider="${this.dataProviderStatusKey}" 51595 lazyload 51596 ></sonic-event-additional-status> 51597 </div> 51598 51599 <sonic-event-taxonomies 51600 size="inherit" 51601 class="pointer-events-none mt-1 ${isCondensed ? "hidden" : ""} " 51602 ></sonic-event-taxonomies> 51603 <sonic-event-location-hall
51604 size="inherit" 51605 noPlacement 51606 class="pointer-events-none block mt-1 ${isCondensed ? "hidden" : ""} " 51607 ></sonic-event-location-hall> 51608 </div> 51609 </div> 51610 <div data-quick-select-slider> 51611 <div data-quick-select-slider-wrapper> 51612 ${c$1( 51613 this._subscriptions, 51614 (subscription) => subscription.id, 51615 (subscription, index) => { 51616 const isLastSubscription = index === this._subscriptions.length - 1; 51617 const isLastFromRow = isLastSubscription && !this._showOtherOwners; 51618 return this.renderSubscriptionPriceItem(subscription, isLastFromRow); 51619 } 51620 )} 51621 ${this._showOtherOwners ? this.renderSubscriptionPriceItem(null, true) : A$1} 51622 </div> 51623 </div> 51624 </div> 51625 `; 51626 } 51627 renderSubscriptionPriceItem(subscription, isLastFromRow) { 51628 const sessionId = this.id; 51629 if (!sessionId) return A$1; 51630 const isSelected = subscription === null ? isOtherOwnersTabId(this.selectedSubscriptionId) : this.selectedSubscriptionId === subscription?.id; 51631 const hiddenOnMobile = !this.isLarge && !isSelected; 51632 if (hiddenOnMobile) return A$1; 51633 return b$1`<div 51634 data-quick-select-slider-item 51635 class="px-2 lg:px-3 py-4 flex border-l items-start border-r 51636 border-dashed border-neutral-200 shrink-0 justify-center 51637 ${this.isFirstRow ? "border-t" : ""} 51638 ${this.isLarge && !isLastFromRow ? "border-r-0" : ""} 51639 ${isLastFromRow ? "border-r" : ""} " 51640 > 51641 <sonic-cart-quick-select-session-prices 51642 class="block w-full text-center max-w-60" 51643 dataProvider=${this._cartProvider} 51644 subDataProvider="data" 51645 ?hasSeatmap=${!!this.props?.settings?.has_seatmap} 51646 .multisessionId=${Number(this.props?.multisession?.id) || void 0} 51647 .priceContext=${{ 51648 entityType: EntityType.Event, 51649 entityId: Number(sessionId), 51650 parentSubscription: subscription, 51651 accessParams: this.accessParams 51652 }} 51653 .infosStatus=${this._infosStatus} 51654 ></sonic-cart-quick-select-session-prices> 51655 </div> `; 51656 } 51657 }; 51658 SonicCartQuickSelectSessionRow.styles = [ 51659 tailwind, 51660 quickSelectSliderCSS, 51661 i$9` 51662 :host { 51663 display: block; 51664 } 51665 :host([isOdd]) { 51666 background: var(--sc-base-50); 51667 } 51668 ` 51669 ]; 51670 __decorateClass$1t([ 51671 n$5({ type: String, attribute: "data-id" }) 51672 ], SonicCartQuickSelectSessionRow.prototype, "id", 2); 51673 __decorateClass$1t([ 51674 c({ context: subscriptionsContext, subscribe: true }), 51675 r$5() 51676 ], SonicCartQuickSelectSessionRow.prototype, "_subscriptions", 2); 51677 __decorateClass$1t([ 51678 n$5({ type: Object }) 51679 ], SonicCartQuickSelectSessionRow.prototype, "_metadata_", 2); 51680 __decorateClass$1t([ 51681 n$5({ type: Boolean }) 51682 ], SonicCartQuickSelectSessionRow.prototype, "isFirstRow", 2); 51683 __decorateClass$1t([ 51684 n$5({ type: Boolean, reflect: true }) 51685 ], SonicCartQuickSelectSessionRow.prototype, "isOdd", 2); 51686 __decorateClass$1t([ 51687 c({ context: isLargeContext, subscribe: true }), 51688 r$5() 51689 ], SonicCartQuickSelectSessionRow.prototype, "isLarge", 2); 51690 __decorateClass$1t([ 51691 c({ context: selectedSubscriptionIdContext, subscribe: true }), 51692 r$5() 51693 ], SonicCartQuickSelectSessionRow.prototype, "selectedSubscriptionId", 2); 51694 __decorateClass$1t([ 51695 bind$1(QUICK_SELECT_DISPLAY_IS_CONDENSED), 51696 r$5() 51697 ], SonicCartQuickSelectSessionRow.prototype, "isCondensed", 2); 51698 __decorateClass$1t([ 51699 c({ context: accessParamsContext, subscribe: true }), 51700 n$5({ type: Object }) 51701 ], SonicCartQuickSelectSessionRow.prototype, "accessParams", 2); 51702 __decorateClass$1t([ 51703 r$5() 51704 ], SonicCartQuickSelectSessionRow.prototype, "_infosStatus", 2); 51705 __decorateClass$1t([ 51706 r$5() 51707 ], SonicCartQuickSelectSessionRow.prototype, "_currentStatusEndpoint", 2); 51708 __decorateClass$1t([ 51709 c({ context: appType, subscribe: true }), 51710 r$5() 51711 ], SonicCartQuickSelectSessionRow.prototype, "appType", 2); 51712 __decorateClass$1t([ 51713 c({ context: showOtherOwnersContext, subscribe: true }), 51714 r$5() 51715 ], SonicCartQuickSelectSessionRow.prototype, "_showOtherOwners", 2); 51716 SonicCartQuickSelectSessionRow = __decorateClass$1t([ 51717 t$3("sonic-cart-quick-select-session-row") 51718 ], SonicCartQuickSelectSessionRow); 51719 var __defProp$1q = Object.defineProperty; 51720 var __getOwnPropDesc$1s = Object.getOwnPropertyDescriptor; 51721 var __decorateClass$1s = (decorators, target, key, kind) => { 51722 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1s(target, key) : target; 51723 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 51724 if (decorator = decorators[i2]) 51725 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 51726 if (kind && result) __defProp$1q(target, key, result); 51727 return result; 51728 }; 51729 const tagName$12 = "sonic-cart-quick-select-show"; 51730 let SonicCartQuickSelectShow = class extends Subscriber$1(i$6) { 51731 constructor() { 51732 super(...arguments); 51733 this.isLarge = false;
51734 this.isCondensed = false; 51735 this.collapsed = false; 51736 } 51737 willUpdate(_changedProperties) { 51738 if (_changedProperties.has("isCondensed") || _changedProperties.has("isLarge")) { 51739 this.collapsed = this.isLarge === false; 51740 } 51741 super.willUpdate(_changedProperties); 51742 } 51743 render() { 51744 return b$1` 51745 <div 51746 class="@container 51747 bg-neutral-0 md:rounded-md 51748 border-b md:border border-neutral-200 hover:border-neutral-400 transition-border duration-300 overflow-hidden" 51749 > 51750 <sonic-product-summary 51751 fixedActions 51752 size="${this.isLarge ? "md" : "sm"}" 51753 class=" px-3 pb-3 md:mb-2 md:px-2 lg:px-3 md:pt-2 md:pb-0 block group" 51754 @click=${() => { 51755 if (this.isLarge && !this.isCondensed) return; 51756 this.collapsed = !this.collapsed; 51757 }} 51758 > 51759 ${!this.isLarge ? b$1`<sonic-button shape="circle" variant="ghost" icon slot="actions" class="group" 51760 ><sonic-icon 51761 class="text-neutral-300 group-hover:text-neutral-500" 51762 name="${this.collapsed ? "chevron-down" : "chevron-up"}" 51763 library="custom" 51764 ></sonic-icon 51765 ></sonic-button>` : A$1} 51766 </sonic-product-summary> 51767 <sonic-list 51768 subDataProvider="sessions" 51769 class="${this.collapsed ? "hidden" : ""}" 51770 .items=${() => b$1`<sonic-cart-quick-select-session-row></sonic-cart-quick-select-session-row>`} 51771 > 51772 </sonic-list> 51773 </div> 51774 `; 51775 } 51776 }; 51777 SonicCartQuickSelectShow.styles = [ 51778 tailwind, 51779 i$9` 51780 :host { 51781 display: block; 51782 } 51783 ` 51784 ]; 51785 __decorateClass$1s([ 51786 c({ context: isLargeContext, subscribe: true }), 51787 r$5() 51788 ], SonicCartQuickSelectShow.prototype, "isLarge", 2); 51789 __decorateClass$1s([ 51790 bind$1(QUICK_SELECT_DISPLAY_IS_CONDENSED), 51791 r$5() 51792 ], SonicCartQuickSelectShow.prototype, "isCondensed", 2); 51793 __decorateClass$1s([ 51794 r$5() 51795 ], SonicCartQuickSelectShow.prototype, "collapsed", 2); 51796 SonicCartQuickSelectShow = __decorateClass$1s([ 51797 t$3(tagName$12) 51798 ], SonicCartQuickSelectShow); 51799 var __defProp$1p = Object.defineProperty; 51800 var __getOwnPropDesc$1r = Object.getOwnPropertyDescriptor; 51801 var __decorateClass$1r = (decorators, target, key, kind) => { 51802 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1r(target, key) : target; 51803 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 51804 if (decorator = decorators[i2]) 51805 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 51806 if (kind && result) __defProp$1p(target, key, result); 51807 return result; 51808 }; 51809 const tagName$11 = "sonic-preferred-quota-selector"; 51810 let PreferredQuotaSelector = class extends i$6 { 51811 constructor() { 51812 super(...arguments); 51813 this._quotas = []; 51814 this._quotaOptions = []; 51815 this.displayLabel = false; 51816 this.canDisplayAll = false; 51817 this.hasFetchOnce = false; 51818 } 51819 async fetchQuotas() { 51820 const api2 = new API(HTML.getApiConfiguration(this)); 51821 const result = await api2.get("quota"); 51822 if (result?.data) { 51823 this._quotas = result.data; 51824 this._quotaOptions = this.quotaToOptions(this._quotas); 51825 if (this.canDisplayAll) { 51826 const allOption = { wording: "Tous les contingentements", value: "all" }; 51827 this._quotaOptions.unshift(allOption); 51828 } 51829 } 51830 this.hasFetchOnce = true; 51831 } 51832 quotaToOptions(quotas) { 51833 const options = quotas.map((quota) => ({ 51834 wording: quota.title ?? "", 51835 value: quota.id?.toString() ?? "" 51836 // selected: quota.id === this.preferred_quota_id, 51837 })); 51838 return options; 51839 } 51840 willUpdate(_changedProperties) { 51841 if (!this.hasFetchOnce) { 51842 this.fetchQuotas(); 51843 } 51844 super.willUpdate(_changedProperties); 51845 } 51846 render() { 51847 if (this._quotaOptions.length === 0) { 51848 return A$1; 51849 } 51850 return b$1` 51851 <sonic-select 51852 @change=${this.handleQuotaChange} 51853 name="preferred_quota_id" 51854 size=${o$4(this.size)} 51855 .options=${this._quotaOptions} 51856 label=${this.displayLabel ? "Contingentement de préférence" : ""} 51857 > 51858 <sonic-icon slot="prefix" library="custom" name="users-v
51858iewfinder"></sonic-icon> 51859 </sonic-select> 51860 `; 51861 } 51862 async handleQuotaChange(event) { 51863 const select2 = event.target; 51864 const quotaId = Number(select2.value); 51865 this.dispatchEvent( 51866 new CustomEvent("quotaChange", { 51867 detail: { 51868 quotaId 51869 } 51870 }) 51871 ); 51872 } 51873 }; 51874 PreferredQuotaSelector.styles = [tailwind]; 51875 __decorateClass$1r([ 51876 r$5() 51877 ], PreferredQuotaSelector.prototype, "_quotas", 2); 51878 __decorateClass$1r([ 51879 r$5() 51880 ], PreferredQuotaSelector.prototype, "_quotaOptions", 2); 51881 __decorateClass$1r([ 51882 n$5({ type: Boolean }) 51883 ], PreferredQuotaSelector.prototype, "displayLabel", 2); 51884 __decorateClass$1r([ 51885 n$5({ type: String }) 51886 ], PreferredQuotaSelector.prototype, "size", 2); 51887 __decorateClass$1r([ 51888 n$5({ type: Boolean }) 51889 ], PreferredQuotaSelector.prototype, "canDisplayAll", 2); 51890 PreferredQuotaSelector = __decorateClass$1r([ 51891 t$3(tagName$11) 51892 ], PreferredQuotaSelector); 51893 var __defProp$1o = Object.defineProperty; 51894 var __getOwnPropDesc$1q = Object.getOwnPropertyDescriptor; 51895 var __decorateClass$1q = (decorators, target, key, kind) => { 51896 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1q(target, key) : target; 51897 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 51898 if (decorator = decorators[i2]) 51899 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 51900 if (kind && result) __defProp$1o(target, key, result); 51901 return result; 51902 }; 51903 const tagName$10 = "sonic-placement-choice"; 51904 let SonicPlacementChoice = class extends Subscriber$1(i$6) { 51905 constructor() { 51906 super(...arguments); 51907 this.formDataProvider = QUICK_SELECT_PLACEMENT_DP; 51908 this.displayMode = "default"; 51909 this.displayDescription = false; 51910 this._placementType = PlacementType.AUTO; 51911 this._hasSeatingModule = false; 51912 this._isApplyingSync = false; 51913 this.handlePreferencesMutation = () => { 51914 if (this._isApplyingSync) { 51915 return; 51916 } 51917 const current2 = dp(this.formDataProvider).get() ?? {}; 51918 if (this.displayMode === "switch") { 51919 const placement_type = normalizeSwitchPlacementType(current2.placement_type); 51920 if (current2.placement_type !== placement_type) { 51921 this.setPlacementType(placement_type, current2); 51922 return; 51923 } 51924 } 51925 this._placementType = current2.placement_type ?? PlacementType.AUTO; 51926 this.saveToStorage(); 51927 }; 51928 } 51929 get _resolvedAppType() { 51930 return resolveAppType$1(this.appType); 51931 } 51932 readPlacementConfigFromDp(appType2) { 51933 const resolvedAppType = resolveAppType$1(appType2); 51934 return resolvedAppType === "counter" ? dp("settings.store_ui.event.placement").get() : dp("settings.customer_ui.event.placement").get(); 51935 } 51936 readSeatingModuleFromDp() { 51937 return dp("settings.modules.seating.enabled").get() === true; 51938 } 51939 /** Lit la config admin depuis le bind ou le dp (fallback si le bind a raté la valeur initiale). */ 51940 get _placementConfig() { 51941 const fromBind = this._resolvedAppType === "counter" ? this._storePlacementConfig : this._customerPlacementConfig; 51942 if (fromBind !== void 0) { 51943 return fromBind; 51944 } 51945 return this.readPlacementConfigFromDp(this.appType); 51946 } 51947 get _seatingModuleEnabled() { 51948 return this._hasSeatingModule || this.readSeatingModuleFromDp(); 51949 } 51950 get _isVisible() { 51951 if (!this.formDataProvider || !this._seatingModuleEnabled) { 51952 return false; 51953 } 51954 if (getVisiblePlacementTypes(this._placementConfig).length === 0) { 51955 return false; 51956 } 51957 if (this.displayMode === "switch") { 51958 return this._resolvedAppType === "counter"; 51959 } 51960 return this._resolvedAppType !== "counter"; 51961 } 51962 get _isPlacementConfigLoaded() { 51963 return this.readPlacementConfigFromDp(this.appType) !== void 0; 51964 } 51965 connectedCallback() { 51966 super.connectedCallback(); 51967 if (!this.formDataProvider) { 51968 return; 51969 } 51970 dp(this.formDataProvider).onInternalMutation(this.handlePreferencesMutation); 51971 this.syncIfReady(); 51972 } 51973 disconnectedCallback() { 51974 if (this.formDataProvider) { 51975 dp(this.formDataProvider).offInternalMutation(this.handlePreferencesMutation); 51976 } 51977 super.disconnectedCallback(); 51978 } 51979 willUpdate(changedProperties) { 51980 if (changedProperties.has("_customerPlacementConfig") || changedProperties.has("_storePlacementConfig") || changedProperties.has("_hasSeatingModule") || changedProperties.has("appType")) { 51981 this.syncIfReady(this._isPlacementConfigLoaded); 51982 } 51983 super.willUpdate(changedProperties); 51984 } 51985 onPlacementSettingsChanged() { 51986 this.syncIfReady(this._isPlacementConfigLoaded); 51987 } 51988 setPlacementType(placement_type, current2 = {}) { 51989 this._isApplyingSync = true;
51990 try { 51991 dp(this.formDataProvider).set({ ...current2, placement_type }); 51992 } finally { 51993 this._isApplyingSync = false; 51994 } 51995 } 51996 syncIfReady(persist = false) { 51997 this.syncFromConfig(persist); 51998 } 51999 syncFromConfig(persist = false) { 52000 let { placement_type } = resolvePlacementPreferences(this._placementConfig, this.readFromStorage()); 52001 if (this.displayMode === "switch") { 52002 placement_type = normalizeSwitchPlacementType(placement_type); 52003 } 52004 const current2 = dp(this.formDataProvider).get() ?? {}; 52005 if (placement_type !== current2.placement_type) { 52006 this.setPlacementType(placement_type, current2); 52007 } 52008 this._placementType = placement_type; 52009 if (persist) { 52010 this.saveToStorage(); 52011 } 52012 } 52013 readFromStorage() { 52014 try { 52015 return JSON.parse(localStorage.getItem(this.formDataProvider) ?? "{}"); 52016 } catch { 52017 return {}; 52018 } 52019 } 52020 saveToStorage() { 52021 const preferences = dp(this.formDataProvider).get(); 52022 if (!preferences) { 52023 return; 52024 } 52025 localStorage.setItem(this.formDataProvider, JSON.stringify(preferences)); 52026 } 52027 render() { 52028 if (!this._isVisible) { 52029 return A$1; 52030 } 52031 if (this.displayMode === "switch") { 52032 return this.renderSwitch(); 52033 } 52034 const visiblePlacementTypes = getVisiblePlacementTypes(this._placementConfig); 52035 return b$1` 52036 <div class="@container"> 52037 <div class="flex flex-col @sm:flex-row gap-1 "> 52038 ${visiblePlacementTypes.map((placementType) => this.renderPlacementTypeChoiceButton(placementType))} 52039 </div> 52040 </div> 52041 `; 52042 } 52043 renderSwitch() { 52044 if (this._customerPlacementConfig === void 0 || this._storePlacementConfig === void 0) { 52045 const customerConfig = this.readPlacementConfigFromDp("customer"); 52046 const storeConfig = this.readPlacementConfigFromDp("counter"); 52047 if (customerConfig === void 0 || storeConfig === void 0) { 52048 return A$1; 52049 } 52050 } 52051 const isAuto = this._placementType === PlacementType.AUTO; 52052 return b$1` 52053 <sonic-switch 52054 formDataProvider="${this.formDataProvider}" 52055 dataProvider="${this.formDataProvider}" 52056 value="${PlacementType.AUTO}" 52057 class="font-bold" 52058 name="placement_type" 52059 > 52060 <span class=${isAuto ? "text-content" : "text-neutral-400"}> 52061 <sonic-icon name="sparkles" library="custom"></sonic-icon> ${t("LIB_placement_auto_short")} 52062 </span> 52063 </sonic-switch> 52064 `; 52065 } 52066 renderPlacementTypeChoiceButton(placementType) { 52067 const isAuto = placementType === PlacementType.AUTO; 52068 const iconName = isAuto ? "sparkles" : "loveseat"; 52069 const label2 = isAuto ? t("LIB_placement_auto") : t("LIB_placement_manuel"); 52070 const description2 = isAuto ? t("LIB_placement_auto_customer_help_text") : t("LIB_placement_manuel_customer_help_text"); 52071 return b$1` 52072 <sonic-button 52073 radio 52074 formDataProvider="${this.formDataProvider}" 52075 dataProvider="${this.formDataProvider}" 52076 value="${placementType}" 52077 shape="block" 52078 class="text-sm @xl:text-base font-bold @xl:max-w-[30rem] grow min-w-0" 52079 name="placement_type" 52080 align="left" 52081 size="inherit" 52082 > 52083 <sonic-icon 52084 class="self-start mt-2" 52085 swap="off" 52086 name="circle" 52087 library="custom" 52088 slot="prefix" 52089 size="lg" 52090 ></sonic-icon> 52091 <sonic-icon 52092 class="self-start mt-2" 52093 swap="on" 52094 name="circle-check" 52095 library="custom" 52096 slot="prefix" 52097 size="lg" 52098 ></sonic-icon> 52099 <div class="flex items-center gap-2 min-h-[2.1em] grow min-w-0"> 52100 <sonic-icon name="${iconName}" library="custom" slot="prefix" size="lg"></sonic-icon> 52101 <span class="block font-bold">${label2}</span> 52102 </div> 52103 ${this.displayDescription ? b$1` <span class="text-xs @xl:text-sm mt-2 border-t text-pretty py-3 hidden @xl:block" 52104 >${description2}</span 52105 >` : A$1} 52106 </sonic-button> 52107 `; 52108 } 52109 }; 52110 SonicPlacementChoice.styles = [ 52111 tailwind, 52112 i$9` 52113 :host { 52114 display: block; 52115 } 52116 ` 52117 ]; 52118 __decorateClass$1q([ 52119 n$5({ type: String }) 52120 ], SonicPlacementChoice.prototype, "formDataProvider", 2); 52121 __decorateClass$1q([ 52122 n$5({ type: String }) 52123 ], SonicPlacementChoice.prototype, "displayMode", 2); 52124 __decorateClass$1q([ 52125 n$5({ type: Boolean }) 52126 ], SonicPlacementChoice.prototype, "displayDescription", 2); 52127 __decorateClass$1q([ 52128 r$5() 52129 ], SonicPlacementChoice.prototype, "_placementType", 2); 52130 __decorateClass$1q([ 52131 c({ context: appType, subscribe: true }), 52132 r$5() 52133 ], SonicPlacementChoice.prototype, "appType", 2); 52134 __decorateClass$1q([ 52135 bind$1("settings.modules.seating.enabled"), 52136 r$5() 52137 ], SonicPlacementChoice.prototype, "_hasSeatingModule", 2); 52138 __decorateClass$1q([ 52139 bind$1("settings.customer_ui.event.placement"), 52140 r$5()
52141 ], SonicPlacementChoice.prototype, "_customerPlacementConfig", 2); 52142 __decorateClass$1q([ 52143 bind$1("settings.store_ui.event.placement"), 52144 r$5() 52145 ], SonicPlacementChoice.prototype, "_storePlacementConfig", 2); 52146 __decorateClass$1q([ 52147 onAssign$1( 52148 "settings.modules.seating.enabled", 52149 "settings.customer_ui.event.placement", 52150 "settings.store_ui.event.placement" 52151 ) 52152 ], SonicPlacementChoice.prototype, "onPlacementSettingsChanged", 1); 52153 SonicPlacementChoice = __decorateClass$1q([ 52154 t$3(tagName$10) 52155 ], SonicPlacementChoice); 52156 var __defProp$1n = Object.defineProperty; 52157 var __getOwnPropDesc$1p = Object.getOwnPropertyDescriptor; 52158 var __decorateClass$1p = (decorators, target, key, kind) => { 52159 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1p(target, key) : target; 52160 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 52161 if (decorator = decorators[i2]) 52162 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 52163 if (kind && result) __defProp$1n(target, key, result); 52164 return result; 52165 }; 52166 const tagName$$ = "sonic-quick-select-display-toggle"; 52167 let SonicQuickSelectDisplayToggle = class extends Subscriber$1(i$6) { 52168 constructor() { 52169 super(...arguments); 52170 this.formDataProvider = QUICK_SELECT_DISPLAY_DP; 52171 this._isCondensed = false; 52172 } 52173 connectedCallback() { 52174 super.connectedCallback(); 52175 if (!this.formDataProvider) { 52176 return; 52177 } 52178 this.loadFromStorage(); 52179 } 52180 onIsCondensedChanged(isCondensed) { 52181 if (!this.formDataProvider) { 52182 return; 52183 } 52184 localStorage.setItem(this.formDataProvider, JSON.stringify({ isCondensed: isCondensed ?? false })); 52185 } 52186 loadFromStorage() { 52187 const stored = this.readFromStorage(); 52188 dp(this.formDataProvider).set({ 52189 isCondensed: stored.isCondensed ?? false 52190 }); 52191 } 52192 readFromStorage() { 52193 try { 52194 return JSON.parse(localStorage.getItem(this.formDataProvider) ?? "{}"); 52195 } catch { 52196 return {}; 52197 } 52198 } 52199 render() { 52200 if (this.appType !== "counter") { 52201 return A$1; 52202 } 52203 return b$1` 52204 <sonic-switch 52205 formDataProvider="${this.formDataProvider}" 52206 dataProvider="${this.formDataProvider}" 52207 value="true" 52208 class="font-bold" 52209 name="isCondensed" 52210 > 52211 <span class=${this._isCondensed ? "text-content" : "text-neutral-400"}> 52212 <sonic-icon name="bars" library="custom"></sonic-icon> Condensé 52213 </span> 52214 </sonic-switch> 52215 `; 52216 } 52217 }; 52218 SonicQuickSelectDisplayToggle.styles = [ 52219 tailwind, 52220 i$9` 52221 :host { 52222 display: block; 52223 } 52224 ` 52225 ]; 52226 __decorateClass$1p([ 52227 n$5({ type: String }) 52228 ], SonicQuickSelectDisplayToggle.prototype, "formDataProvider", 2); 52229 __decorateClass$1p([ 52230 c({ context: appType, subscribe: true }) 52231 ], SonicQuickSelectDisplayToggle.prototype, "appType", 2); 52232 __decorateClass$1p([ 52233 bind(quickSelectDisplayFormKey.isCondensed), 52234 r$5() 52235 ], SonicQuickSelectDisplayToggle.prototype, "_isCondensed", 2); 52236 __decorateClass$1p([ 52237 handle(quickSelectDisplayFormKey.isCondensed) 52238 ], SonicQuickSelectDisplayToggle.prototype, "onIsCondensedChanged", 1); 52239 SonicQuickSelectDisplayToggle = __decorateClass$1p([ 52240 t$3(tagName$$) 52241 ], SonicQuickSelectDisplayToggle); 52242 var __defProp$1m = Object.defineProperty; 52243 var __getOwnPropDesc$1o = Object.getOwnPropertyDescriptor; 52244 var __decorateClass$1o = (decorators, target, key, kind) => { 52245 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1o(target, key) : target; 52246 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 52247 if (decorator = decorators[i2]) 52248 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 52249 if (kind && result) __defProp$1m(target, key, result); 52250 return result; 52251 }; 52252 let SonicCartQuickSelectSubscriptionSummary = class extends Subscriber$1(i$6) { 52253 constructor() { 52254 super(...arguments); 52255 this.cartProvider = "cart/current"; 52256 this._groupedItem = []; 52257 } 52258 willUpdate(_changedProperties) { 52259 super.willUpdate(_changedProperties); 52260 if (_changedProperties.has("subscription") || _changedProperties.has("props")) { 52261 if (this.subscription) { 52262 const clonedItems = structuredClone(this.props?.items || []); 52263 const items = clonedItems.filter((item) => item.id === this.subscription?.id || item.parent_id === this.subscription?.id) || []; 52264 const entities = this.props?.entities || []; 52265 this._groupedItem = groupItemsByEntity(items, entities); 52266 } 52267 } 52268 } 52269 render() { 52270 return b$1`<sonic-cart-item-line-subscribe 52271 cartProvider=${o$4(this.cartProvider || void 0)} 52272 dataProvider="${this.cartProvider}/subSummary/${this.subscription?.id}" 52273 showDetail 52274 fullWidth 52275 noSubscriptionActions 52276 .props=${this._groupedItem[0]} 52277 ></sonic-cart-item-line-subscribe>`; 52278 } 52279 }; 52280 __decorateClass$1o([ 52281 ancestorAttribute("cartProvider") 52282 ], SonicCartQuickSelectSubscriptionSummary.prototype, "cartProvider", 2); 52283 __decorateClass$1o([ 52284 n$5({ type: Object }) 52285 ], SonicCartQuickSelectSubscriptionSummary.prototype, "subscription", 2); 52286 __decorateClass$1o([ 52287 r$5() 52288 ], SonicCartQuickSelectSubscriptionSummary.prototype, "_groupedItem", 2); 52289 SonicCartQuickSelectSubscriptionSummary = __decorateClass$1o([ 52290 t$3("sonic-cart-quick-select-subscription-summary") 52291 ], SonicCartQuickSelectSubscriptionSummary); 52292 var __defProp$1l = Object.defineProperty; 52293 var __getOwnPropDesc$1n = Object.getOwnPropertyDescriptor; 52294 var __decorateClass$1n = (decorators, target, key, kind) => { 52295 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1n(target, key) : target; 52296 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 52297 if (decorator = decorators[i2]) 52298 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 52299 if (kind && result) __defProp$1l(target, key, result); 52300 return result; 52301 }; 52302 let instanceCounter$3 = 0; 52303 const tagName$_ = "sonic-cart-quick-select"; 52304 let SonicCartQuickSelect = class extends Subscriber$1(i$6) { 52305 constructor() { 52306 super(...arguments); 52307 this._dpSessionFilters = "subTypeSessionsFilters" + instanceCounter$3++; 52308 this.items = []; 52309 this.linked_subscriptions = []; 52310 this.cartType = CartType.Cart; 52311 this.entities = []; 52312 this._modal = null; 52313 this._subscriptions = []; 52314 this.tabs = []; 52315 this._resizeController = new h$1(this, { 52316 callback: () => { 52317 this.isLarge = this.clientWidth > 768; 52318 if (this.isLarge) { 52319 this.updateSliderOffset(); 52320 } 52321 } 52322 }); 52323 this.isLarge = false;
52324 this.allSubscriptionsAreValid = false; 52325 this._sliderInitialized = false; 52326 this._showOtherOwners = false; 52327 this.handleWaitingListRefresh = () => { 52328 void this.refreshWaitingListEntries(); 52329 }; 52330 this.handleWaitingListUpdated = () => { 52331 void this.refreshWaitingListEntries(); 52332 }; 52333 this.sliderIndex = 0; 52334 } 52335 setTabs(showOtherOwners) { 52336 const subscriptionTabs = this._subscriptions.filter((sub2) => sub2.id).map((sub2) => ({ 52337 id: sub2.id, 52338 type: "subscription", 52339 subscriptionItem: sub2 52340 })); 52341 this.tabs = showOtherOwners ? [ 52342 ...subscriptionTabs, 52343 { 52344 id: OTHER_OWNERS_TAB_ID, 52345 type: OTHER_OWNERS_TAB_ID 52346 } 52347 ] : subscriptionTabs; 52348 } 52349 getStickyTopValue() { 52350 const parentModal = this.closest("#modal"); 52351 if (!parentModal) return 0; 52352 const modalPaddingTop = getComputedStyle(parentModal).paddingTop; 52353 const paddingTopValue = parseInt(modalPaddingTop); 52354 const negativePaddingTop = paddingTopValue ? `-${paddingTopValue}px` : "0px"; 52355 return negativePaddingTop; 52356 } 52357 async willUpdate(changedProperties) { 52358 if (changedProperties.has("items") || changedProperties.has("linked_subscriptions") || changedProperties.has("subscriptionRequirement") || changedProperties.has("appType")) { 52359 this._subscriptions = getCartSubscriptions({ items: this.items, linked_subscriptions: this.linked_subscriptions }); 52360 this.allSubscriptionsAreValid = this._subscriptions && this._subscriptions.length > 0 && this._subscriptions.every((sub2) => !sub2.has_error_linked_events); 52361 const { subscriptionRequirement, disallowEventsForSoldSubscription } = this.settings || {}; 52362 const onlyNewSubscriptionAllowed = isSubscriptionRequired(subscriptionRequirement, this.appType) && disallowEventsForSoldSubscription?.active; 52363 const hasItemsNeedingOtherOwners = !onlyNewSubscriptionAllowed || this.items.some( 52364 (item) => item.entity_type === EntityType.Event && item.price?.need_subscription && !item.parent_id 52365 ); 52366 this._showOtherOwners = hasItemsNeedingOtherOwners; 52367 this.setTabs(this._showOtherOwners); 52368 void this.refreshWaitingListEntries(); 52369 } 52370 if (changedProperties.has("loggedUserId") || changedProperties.has("appType")) { 52371 void this.refreshWaitingListEntries(); 52372 } 52373 if (changedProperties.has("_subscriptions")) { 52374 const newQueueExpression = this.queueExpression(); 52375 if (newQueueExpression !== this._queueDpExpression) { 52376 this._queueDpExpression = newQueueExpression; 52377 } 52378 const isOtherOwnersSelected = isOtherOwnersTabId(this.selectedSubscriptionId); 52379 const selectedSubscriptionNotFound = !isOtherOwnersSelected && this._subscriptions.findIndex((sub2) => sub2.id === this.selectedSubscriptionId) === -1; 52380 if ((selectedSubscriptionNotFound || !this.selectedSubscriptionId) && this._subscriptions.length > 0) { 52381 this.selectedSubscriptionId = this._subscriptions[0].id; 52382 } 52383 } 52384 if (changedProperties.has("selectedSubscriptionId")) { 52385 this.initSliderIndex(); 52386 } 52387 super.willUpdate(changedProperties); 52388 } 52389 updated(changedProperties) { 52390 if (!this._sliderInitialized) { 52391 this.updateSliderOffset(); 52392 } 52393 super.updated(changedProperties); 52394 } 52395 connectedCallback() { 52396 dp("toastSettings").muteCartSuccessMessages.set(true); 52397 super.connectedCallback(); 52398 this.addEventListener("waiting-list-updated", this.handleWaitingListUpdated); 52399 const cartProvider = this.cartProvider || "cart/current"; 52400 dp(cartProvider).data.onInternalMutation(this.handleWaitingListRefresh); 52401 void this.refreshWaitingListEntries(); 52402 } 52403 disconnectedCallback() { 52404 dp("toastSettings").muteCartSuccessMessages.set(false); 52405 this.removeEventListener("waiting-list-updated", this.handleWaitingListUpdated); 52406 const cartProvider = this.cartProvider || "cart/current"; 52407 dp(cartProvider).data.offInternalMutation(this.handleWaitingListRefresh); 52408 super.disconnectedCallback(); 52409 } 52410 refreshWaitingListEntries() { 52411 void refreshWaitingListTunnelEntries(this, { 52412 cartProvider: this.cartProvider || "cart/current", 52413 appType: this.appType, 52414 loggedUserId: this.loggedUserId, 52415 apiConfiguration: this.getApiConfiguration() 52416 }); 52417 } 52418 firstUpdated(_changedProperties) { 52419 if (this.isLarge && this.appType !== "counter") { 52420 dp(QUICK_SELECT_DISPLAY_DP).isCondensed.set(false); 52421 } 52422 } 52423 renderAddSubscriptionButton(size = "md", variant = "outline") {
52424 return b$1`<sonic-divider> 52425 <sonic-cart-add-entity 52426 align="left" 52427 .entityType=${EntityType.Subscribe} 52428 class="block w-full" 52429 variant=${variant} 52430 type="success" 52431 size=${size} 52432 > 52433 <sonic-icon name="circle-plus" library="custom" slot="icon"></sonic-icon> </sonic-cart-add-entity 52434 ></sonic-divider>`; 52435 } 52436 render() { 52437 const isCounter = this.appType === "counter"; 52438 const displayQuotaSelector = isCounter; 52439 const noSubscriptionOrOtherOwner = !this.tabs.length; 52440 if (noSubscriptionOrOtherOwner) { 52441 return this.renderAddSubscriptionButton("lg"); 52442 } 52443 return b$1` 52444 ${!isCounter ? b$1`<sonic-placement-choice 52445 formDataProvider="${QUICK_SELECT_PLACEMENT_DP}" 52446 displayDescription 52447 class="mb-5" 52448 ></sonic-placement-choice>` : A$1} 52449 <div> 52450 <div id="SubSessionFormContainer" class="mb-5 flex gap-4 flex-wrap items-center relative z-[3]"> 52451 <sonic-form-event-filter 52452 dataProvider="${this._dpSessionFilters}" 52453 formDataProvider="${this._dpSessionFilters}" 52454 class="block w-full z-[2] min-w-0 ${displayQuotaSelector ? "max-w-[64rem]" : "max-w-[35rem]"}" 52455 filterCategory 52456 > 52457 ${displayQuotaSelector ? b$1` 52458 <div class="flex items-center" slot="formSuffix"> 52459 <sonic-divider vertical class="mx-4 hidden lg:block"></sonic-divider> 52460 <sonic-subscriber 52461 localStorage="enabled" 52462 dataProvider="admin_form_preferred_quota" 52463 ></sonic-subscriber> 52464 <sonic-preferred-quota-selector 52465 dataProvider="admin_form_preferred_quota" 52466 formDataProvider="admin_form_preferred_quota" 52467 ></sonic-preferred-quota-selector> 52468 </div> 52469 ` : A$1} 52470 </sonic-form-event-filter> 52471 </div> 52472 52473 ${this.renderHeader()} ${this.renderAddSubscriptionButton("sm", "ghost")} 52474 52475 <sonic-queue 52476 dataProviderExpression="${o$4(this._queueDpExpression)}" 52477 key="data" 52478 limit="4" 52479 targetRequestDuration="1000" 52480 dataFilterProvider="${this._dpSessionFilters}" 52481 class="mb-10 min-h-[40vh] relative z-[1] -mx-[--sc-modal-px] lg:-mx-0" 52482 .items=${() => b$1`<sonic-cart-quick-select-show 52483 class="${this.isLarge ? "mb-5" : "mb-3"} " 52484 ></sonic-cart-quick-select-show>`} 52485 .noItems=${() => b$1`<sonic-no-result class="py-12 px-6 block"></sonic-no-result>`} 52486 > 52487 </sonic-queue> 52488 52489 ${this.renderFooter()} 52490 </div> 52491 `; 52492 } 52493 renderHeader() { 52494 return b$1` 52495 <div 52496 class="sticky z-[2] flex mb-5 52497 ${this.isLarge ? "rounded-md border-neutral-200 border" : " border-t border-b border-neutral-200"} 52498 bg-neutral-0 shadow-lg -mx-[--sc-modal-px] lg:-mx-0 " 52499 style="top: ${this.getStickyTopValue()}" 52500 > 52501 ${this.isLarge ? this.renderDesktopHeader() : this.renderMobileHeader()} 52502 </div> 52503 `; 52504 } 52505 renderFooter() { 52506 const isValid = this.allSubscriptionsAreValid; 52507 const oneItemHasSeat = this.items?.some((item) => item.seat?.id); 52508 const hasEventTickets = this.items?.some((item) => item.entity_type === EntityType.Event); 52509 if (!hasEventTickets || !isValid) return A$1; 52510 return b$1` 52511 <div class="sticky z-[2] bottom-0 w-full"> 52512 <div 52513 class=" 52514 flex gap-2 items-center justify-center 52515 bg-neutral-0 py-3 shadow-[0_-1rem_1rem_-1rem_rgba(0,0,0,0.1)] 52516 -mx-[--sc-modal-px] px-3 lg:px-[--sc-modal-px] 52517 text-pretty 52518 " 52519 > 52520 ${isValid && oneItemHasSeat ? b$1` 52521 <sonic-button 52522 shape="block" 52523 type="info" 52524 variant="outline" 52525 @click=${async () => { 52526 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 52527 await parentModal?.hide(); 52528 if (this.cartProvider) { 52529 editSeatsModal({ cartProvider: this.cartProvider, accessParams: this.accessParams }); 52530 } 52531 }} 52532 > 52533 ${this.isLarge ? b$1`<sonic-icon library="custom" name="loveseat" size="lg"></sonic-icon>` : A$1}
52534 <span class="font-bold"> ${t("LIB_validate_and_check_seats")} </span> 52535 </sonic-button> 52536 ` : A$1} 52537 ${isValid && hasEventTickets ? b$1` 52538 <sonic-button 52539 shape="block" 52540 type="success" 52541 @click=${async () => { 52542 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 52543 await parentModal?.hide(); 52544 if (this.cartType === CartType.Cart && !appRoute("cart").matchesCurrentPath()) { 52545 appRoute("cart").goTo(); 52546 } else if (this.cartType === CartType.Reservation && this.cartProvider && !appRoute("reservation").fill({ id: dp(this.cartProvider).data.id.get() }).matchesCurrentPath()) { 52547 appRoute("reservation").fill({ id: dp(this.cartProvider).data.id.get() }).goTo(); 52548 } 52549 }} 52550 > 52551 ${this.isLarge ? b$1`<sonic-icon library="custom" name="check" size="lg"></sonic-icon>` : A$1} 52552 <span class="font-bold"> 52553 ${this.cartType === CartType.Reservation ? t("LIB_validate_and_go_to_reservation") : t("LIB_validate_and_go_to_cart")} 52554 </span> 52555 </sonic-button> 52556 ` : A$1} 52557 </div> 52558 </div> 52559 `; 52560 } 52561 initSliderIndex() { 52562 const currentIndex = this.tabs.findIndex((tab) => tab.id === this.selectedSubscriptionId); 52563 this.sliderIndex = Math.max(currentIndex, 0); 52564 } 52565 previous() { 52566 this.sliderIndex = Math.max(this.sliderIndex - 1, 0); 52567 this.updateSliderOffset(); 52568 } 52569 next() { 52570 const maxIndex = this.tabs.length - 1; 52571 this.sliderIndex = Math.min(this.sliderIndex + 1, maxIndex); 52572 this.updateSliderOffset(); 52573 } 52574 updateSliderOffset() { 52575 const sliderWrapper = this.shadowRoot?.querySelector("[data-quick-select-slider-wrapper]"); 52576 const sliderItems = this.shadowRoot?.querySelectorAll("[data-quick-select-slider-item]"); 52577 if (!sliderWrapper || !sliderItems.length) return; 52578 const targetItem = sliderItems[this.sliderIndex]; 52579 if (!targetItem) return; 52580 const wrapperRect = sliderWrapper.getBoundingClientRect(); 52581 const itemRect = targetItem.getBoundingClientRect(); 52582 const offset = wrapperRect.left - itemRect.left; 52583 this.style.setProperty("--quick-select-slider-offset", `${offset}px`); 52584 this._sliderInitialized = true; 52585 } 52586 renderDesktopHeader() { 52587 const displaySliderButtons = this.tabs.length > 1; 52588 const isCounter = this.appType === "counter"; 52589 return b$1`<div class="w-[--_event-width] px-2 lg:px-3 py-4 shrink-0 flex gap-2 items-center justify-center "> 52590 ${isCounter ? b$1` 52591 <div class="mr-auto flex flex-col gap-1"> 52592 <sonic-placement-choice 52593 displayMode="switch" 52594 formDataProvider="${QUICK_SELECT_PLACEMENT_DP}" 52595 ></sonic-placement-choice> 52596 <sonic-quick-select-display-toggle></sonic-quick-select-display-toggle> 52597 </div> 52598 ` : A$1} 52599 <div class="flex items-center gap-2 ${isCounter ? "ml-auto" : ""} ${displaySliderButtons ? "" : "hidden"}"> 52600 <sonic-button 52601 noAutoFill 52602 shape="circle" 52603 icon 52604 size="sm" 52605 @click=${() => this.previous()} 52606 ?disabled=${this.sliderIndex === 0} 52607 > 52608 <sonic-icon name="chevron-left" library="custom"></sonic-icon> 52609 </sonic-button> 52610 <sonic-divider vertical noMargin></sonic-divider> 52611 <sonic-button 52612 noAutoFill 52613 shape="circle" 52614 icon 52615 size="sm" 52616 @click=${() => this.next()} 52617 ?disabled=${this.sliderIndex === this.tabs.length - 1} 52618 > 52619 <sonic-icon name="chevron-right" library="custom"></sonic-icon> 52620 </sonic-button> 52621 </div> 52622 </div> 52623 <div data-quick-select-slider class="rounded-tr-md rounded-br-md"> 52624 <div data-quick-select-slider-wrapper> 52625 ${c$1( 52626 this.tabs, 52627 (tab) => tab.id, 52628 (tab, index) => { 52629 const isLast = index === this.tabs.length - 1; 52630 if (tab.type === OTHER_OWNERS_TAB_ID) { 52631 return b$1` 52632 <div 52633 data-quick-select-slider-item 52634 class="text-sm bg-neutral-0 font-medium border-l 52635 border-neutral-200 border-dashed text-center 52636 ${isLast ? "border-r" : ""}" 52637 > 52638 <div class="block font-bold">${t("LIB_other_owners")}</div> 52639 </div> 52640 `; 52641 } 52642 return b$1` 52643 <div 52644 data-quick-select-slider-item 52645 class=" 52646 bg-neutral-0 font-medium border-l 52647 border-neutral-200 border-dashed text-center 52648 ${isLast ? "border-r" : ""} 52649 " 52650 > 52651 ${tab.subscriptionItem ? this.renderHeaderItem(tab.subscriptionItem, "center") : A$1} 52652 </div> 52653 `; 52654 } 52655 )} 52656 </div> 52657 </div>`; 52658 } 52659 renderMobileHeader() { 52660 const selectedTab = this.tabs.find((tab) => tab.id === this.selectedSubscriptionId); 52661 if (!selectedTab) return b$1`<div class="p-3 w-full"></div>`; 52662 if (selectedTab.type === OTHER_OWNERS_TAB_ID) { 52663 return b$1` 52664 <div class="p-3 w-full"> 52665 <div class="">
52666 <span class="block font-bold mb-2">${t("LIB_other_owners")}</span> 52667 </div> 52668 <div class="flex items-center gap-1 ">${this.renderTabsPop()}</div> 52669 </div> 52670 `; 52671 } 52672 const selectedSubscription = selectedTab.subscriptionItem; 52673 return b$1` 52674 <div class="p-3 w-full">${selectedSubscription ? this.renderHeaderItem(selectedSubscription, "left") : ""}</div> 52675 `; 52676 } 52677 selectSubscription(subscriptionItem) { 52678 this.selectedSubscriptionId = subscriptionItem.id; 52679 } 52680 renderTabsPop() { 52681 if (this.tabs.length <= 1 || this.isLarge) return A$1; 52682 return b$1` 52683 <sonic-pop class="grow max-w-40"> 52684 <sonic-button size="xs" shape="block" type="info"> 52685 ${t("owners")} <sonic-icon name="chevron-down" library="custom" slot="suffix"></sonic-icon> 52686 </sonic-button> 52687 <sonic-menu 52688 slot="content" 52689 minWidth="14rem" 52690 class="max-h-[40vh] overflow-y-auto custom-scroll" 52691 direction="column" 52692 > 52693 ${c$1( 52694 this.tabs, 52695 (tab) => tab.id, 52696 (tab, index) => { 52697 const isLast = index === this.tabs.length - 1; 52698 if (tab.type === OTHER_OWNERS_TAB_ID) { 52699 const isCurrent2 = isOtherOwnersTabId(this.selectedSubscriptionId); 52700 return b$1`<sonic-menu-item 52701 size="sm" 52702 ?active=${isCurrent2} 52703 @click=${() => { 52704 this.selectedSubscriptionId = OTHER_OWNERS_TAB_ID; 52705 }} 52706 > 52707 <sonic-icon 52708 name="${isCurrent2 ? "circle-check" : "circle"}" 52709 slot="prefix" 52710 library="custom" 52711 size="lg" 52712 ></sonic-icon> 52713 <div class="font-bold text-sm whitespace-nowrap">${t("LIB_other_owners")}</div> 52714 </sonic-menu-item> 52715 ${!isLast && this.tabs.length > 1 ? b$1`<sonic-divider class="my-0"></sonic-divider>` : A$1}`; 52716 } 52717 const subscriptionItem = tab.subscriptionItem; 52718 if (!subscriptionItem) return A$1; 52719 const { id, owner } = subscriptionItem || {}; 52720 const { firstName, lastName } = owner || {}; 52721 const isCurrent = id === this.selectedSubscriptionId; 52722 const hasError = subscriptionItem.has_error_linked_events; 52723 const isAnonymous = !firstName && !lastName; 52724 return b$1`<sonic-menu-item 52725 size="sm" 52726 ?active=${isCurrent} 52727 @click=${() => this.selectSubscription(subscriptionItem)} 52728 > 52729 <sonic-icon 52730 name="${isCurrent ? "circle-check" : "circle"}" 52731 slot="prefix" 52732 library="custom" 52733 class="self-start mt-1" 52734 size="lg" 52735 ></sonic-icon> 52736 52737 <div class="font-bold text-sm whitespace-nowrap mt-1"> 52738 ${isAnonymous ? t("Anonyme") : b$1`${firstName} <span class="uppercase">${lastName}</span>`} 52739 </div> 52740 <div class="text-xs mt-1 mb-2">${this.getSubscriptionName(subscriptionItem)}</div> 52741 52742 ${hasError ? b$1`<sonic-icon 52743 name="triangle-exclamation" 52744 library="custom" 52745 slot="suffix" 52746 prefix="solid" 52747 class="text-danger ml-left" 52748 size="lg" 52749 ></sonic-icon>` : A$1} 52750 </sonic-menu-item> `; 52751 } 52752 )} 52753 </sonic-menu> 52754 </sonic-pop> 52755 `; 52756 } 52757 renderHeaderItem(subscriptionItem, align = "center") { 52758 const { has_error_linked_events, has_error_owner, has_error_proof } = subscriptionItem; 52759 const firstName = subscriptionItem?.owner?.firstName; 52760 const lastName = subscriptionItem?.owner?.lastName; 52761 const isAnonymous = !firstName && !lastName; 52762 const isPrePurchased = isPrePurchaseSubscription(subscriptionItem); 52763 const displayOwnerButton = !isPrePurchased; 52764 const displayProofButton = !isPrePurchased && subscriptionItem.price?.
52764need_proof_of_identity; 52765 const title = isAnonymous ? t("Anonyme") : b$1`${firstName} ${lastName}`; 52766 return b$1` 52767 <div class="${align === "left" ? "text-left" : "text-center"}"> 52768 <button 52769 class="group block w-full ${align === "left" ? "text-left" : "text-center"}" 52770 @click=${() => { 52771 if (isPrePurchased) { 52772 return; 52773 } 52774 editSubscriptionOwnerModal({ 52775 lineItem: subscriptionItem, 52776 cartProvider: this.cartProvider, 52777 accessParams: this.accessParams 52778 }); 52779 }} 52780 > 52781 <div 52782 class="text-base md:text-sm ${isPrePurchased ? "" : "group-hover:underline underline-offset-2"} truncate font-bold min-h-[1.15em]" 52783 > 52784 ${title} 52785 </div> 52786 </button> 52787 52788 <div class="truncate mt-1 mb-1 min-h-[1.15em] text-xs">${this.getSubscriptionName(subscriptionItem)}</div> 52789 <div class="flex items-center gap-1 ${this.isLarge ? "justify-center" : ""}"> 52790 ${displayOwnerButton ? b$1` 52791 <sonic-tooltip label=${t("owner")} ?disabled=${!this.isLarge}> 52792 <sonic-button 52793 size="xs" 52794 shape="square" 52795 variant="${has_error_owner ? "outline" : "default"}" 52796 type="${has_error_owner ? "danger" : "neutral"}" 52797 @click=${() => editSubscriptionOwnerModal({ 52798 lineItem: subscriptionItem, 52799 cartProvider: this.cartProvider, 52800 accessParams: this.accessParams 52801 })} 52802 > 52803 <sonic-icon name="id-card" library="custom"></sonic-icon> 52804 </sonic-button> 52805 </sonic-tooltip> 52806 ` : A$1} 52807 ${displayProofButton ? b$1` 52808 <sonic-tooltip label=${t("LIB_add_proof")} ?disabled=${!this.isLarge}> 52809 <sonic-button 52810 size="xs" 52811 shape="square" 52812 variant="${has_error_proof ? "outline" : "default"}" 52813 type="${has_error_proof ? "danger" : "neutral"}" 52814 @click=${() => addProofModal({ 52815 lineItem: subscriptionItem, 52816 cartProvider: this.cartProvider, 52817 accessParams: this.accessParams 52818 })} 52819 > 52820 <sonic-icon name="file-arrow-up" library="custom"></sonic-icon> 52821 </sonic-button> 52822 </sonic-tooltip> 52823 ` : A$1} 52824 <sonic-tooltip label=${t("LIB_summary")} ?disabled=${!this.isLarge}> 52825 <sonic-button 52826 size="xs" 52827 variant="default" 52828 type="${has_error_linked_events ? "danger" : "success"}" 52829 class="mt-auto" 52830 @click=${() => this.displaySummary(subscriptionItem)} 52831 > 52832 <sonic-icon name="ticket" library="custom"></sonic-icon> 52833 <span class="min-w-[2ch] inline-block"> ${this.countSubscriptionSessions(subscriptionItem.id)} </span> 52834 <sonic-icon 52835 ${F({ in: v })} 52836 name="${has_error_linked_events ? "triangle-exclamation" : "thumbs-up"}" 52837 class="${has_error_linked_events ? "animate-pulse" : ""}" 52838 prefix="solid" 52839 library="custom" 52840 ></sonic-icon> 52841 </sonic-button> 52842 </sonic-tooltip> 52843 52844 <sonic-tooltip label=${t("LIB_remove")} class="ml-2"> 52845 <sonic-button 52846 shape="circle" 52847 icon 52848 size="xs" 52849 @click=${() => { 52850 this.confirmDeleteSubscription(subscriptionItem); 52851 }} 52852 > 52853 <sonic-icon name="trash" library="custom" class=""></sonic-icon> 52854 </sonic-button> 52855 </sonic-tooltip> 52856 52857 ${!this.isLarge ? b$1`<sonic-divider vertical></sonic-divider>` : A$1} ${this.renderTabsPop()} 52858 </div> 52859 </div> 52860 `; 52861 } 52862 /** 52863 * Construit l'expression de requête pour récupérer les spectacles associés aux abonnements 52864 */ 52865 queueExpression() { 52866 const subscriptionTypeIds = [...new Set(this._subscriptions.map((subscription) => subscription.entity_id))]; 52867 const subscription_price_ids = [...new Set(this._subscriptions.map((subscription) => subscription.price?.id))]; 52868 const endPoint = entityEndPoint({ 52869 entityType: "show", 52870 subscriptionTypeIds: subscriptionTypeIds.map((id) => id?.toString() || ""), 52871 subscriptionPriceIds: subscription_price_ids.map((id) => Number(id) || 0), 52872 view: entityView.essential, 52873 next: true, 52874 isQueue: true, 52875 accessParams: this.accessParams 52876 }); 52877 return endPoint; 52878 } 52879 /** 52880 * Compte le nombre de séances associées à un abonnement donné 52881 */ 52882 countSubscriptionSessions(subscriptionId) { 52883 if (!subscriptionId) return 0; 52884 const sessionIds = this.items.filter((lineCartItem) => lineCartItem.parent_id === subscriptionId); 52885 return sessionIds?.length || 0; 52886 } 52887 /** 52888 * Récupère le nom/titre d'un type d'abonnement 52889 */ 52890 getSubscriptionName(subscriptionItem, displayPrice = true) { 52891 const subscriptionEntityId = subscriptionItem?.entity_id; 52892 if (!subscriptionEntityId) return ""; 52893 const subscriptionEntity = this.entities.find( 52894 (entity) => entity.id === subscriptionEntityId && entity.entity_type === EntityType.Subscribe 52895 ); 52896 const linkedSubscription = this.linked_subscriptions.find( 52897 (subscription) => subscription.entity?.id === subscriptionEntityId 52898 ); 52899 const entityTitle = linkedSubscription?.entity?.edito?.title || subscriptionEntity?.edito?.title || ""; 52900 const priceLabel = subscriptionItem?.price?.label; 52901 return b$1`${entityTitle} 52902 ${priceLabel && priceLabel !== entityTitle && displayPrice ? b$1`⢠${priceLabel}` : A$1}`; 52903 } 52904 /** 52905 * Affiche le récapitulatif d'un abonnement donné 52906 */ 52907 displaySummary(subscriptionItem) { 52908 const hasItems = !!this.items?.find( 52909 (item) => item.parent_id === subscriptionItem.id || item.id === subscriptionItem.id 52910 ); 52911 if (!hasItems || !this.cartProvider) return; 52912 this._modal = Modal.create({ 52913 title: t("LIB_summary"), 52914 removeOnHide: true, 52915 content: b$1` 52916 <sonic-cart-quick-select-subscription-summary 52917 .subscription=${subscriptionItem} 52918 cartProvider=${this.cartProvider} 52919 dataProvider=${this.cartProvider} 52920 subDataProvider="data" 52921 > 52922 </sonic-cart-quick-select-subscription-summary> 52923 ${this.goToCartButton()} 52924 `, 52925 maxWidth: "45rem" 52926 }); 52927 } 52928 goToCartButton() { 52929 const cartProvider = this.cartProvider; 52930 if (!cartProvider) return; 52931 const canCheckout = !!dp(cartProvider).data.canCheckout.get(); 52932 if (!canCheckout) return; 52933 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 52934 let backLabel = t("back_to_cart"); 52935 const cartType = dp(cartProvider).data.cartType.get(); 52936 if (cartType === "reservation") { 52937 backLabel = t("back_to_reservation"); 52938 } 52939 return b$1`<sonic-button 52940 shape="block" 52941 type="success" 52942 style="margin-top:1rem" 52943 @click=${() => { 52944 this._modal?.hide(); 52945 parentModal?.hide(); 52946 }} 52947 > 52948 <sonic-icon name="arrow-right" library="custom"></sonic-icon>
52949 <span class="font-bold">${backLabel}</span> 52950 </sonic-button>`; 52951 } 52952 confirmDeleteSubscription(subscriptionItem) { 52953 if (!subscriptionItem.id) return; 52954 const subscriptionName = this.getSubscriptionName(subscriptionItem, false); 52955 const linkedSessions = this.countSubscriptionSessions(subscriptionItem.id); 52956 const firstName = subscriptionItem?.owner?.firstName; 52957 const lastName = subscriptionItem?.owner?.lastName; 52958 const isAnonymous = !firstName && !lastName; 52959 Modal.create({ 52960 title: `Confirmer la suppression`, 52961 content: b$1`<div style="display: flex; align-items: flex-start; margin-bottom: .25rem;"> 52962 <sonic-icon name="id-card" library="custom" style="margin-right:3px;"> </sonic-icon> 52963 <div> 52964 ${subscriptionName} 52965 <br /> 52966 â ${isAnonymous ? t("Anonyme") : b$1`${firstName} <span class="uppercase">${lastName}</span>`} 52967 </div> 52968 </div> 52969 ${linkedSessions > 0 ? b$1`<div style="display: flex; align-items: center;"> 52970 <sonic-icon name="ticket" library="custom" style="margin-right:3px;"> </sonic-icon> ${linkedSessions} 52971 billet(s) associé(s) 52972 </div>` : A$1}`, 52973 actions: b$1`<sonic-button 52974 @click=${() => { 52975 if (!subscriptionItem.id) return; 52976 Cart.removeItems({ 52977 apiConfiguration: this.getApiConfiguration(), 52978 cartProvider: this.cartProvider, 52979 query: { 52980 ids: [subscriptionItem.id] 52981 } 52982 }).then(() => { 52983 const firstTab = this.tabs[0]; 52984 if (firstTab) { 52985 this.selectedSubscriptionId = firstTab.id; 52986 } 52987 }); 52988 }} 52989 type="danger" 52990 hideModal 52991 > 52992 <sonic-icon name="trash" library="custom" slot="prefix"> </sonic-icon> Supprimer</sonic-button 52993 > 52994 <sonic-button shape="block" hideModal> Annuler</sonic-button> ` 52995 }); 52996 } 52997 }; 52998 SonicCartQuickSelect.styles = [ 52999 tailwind, 53000 customScroll, 53001 quickSelectSliderCSS, 53002 i$9` 53003 :host { 53004 width: 100%; 53005 position: relative; 53006 display: block; 53007 --_event-width: clamp(13rem, 50%, 25rem); 53008 --quick-select-column-width: 100%; 53009 } 53010 53011 :host([islarge]) { 53012 --_event-width: clamp(14rem, 50%, 25rem); 53013 --quick-select-column-width: 15rem; 53014 } 53015 ` 53016 ]; 53017 __decorateClass$1n([ 53018 n$5({ type: Array }) 53019 ], SonicCartQuickSelect.prototype, "items", 2); 53020 __decorateClass$1n([ 53021 n$5({ type: Array }) 53022 ], SonicCartQuickSelect.prototype, "linked_subscriptions", 2); 53023 __decorateClass$1n([ 53024 n$5({ type: String }) 53025 ], SonicCartQuickSelect.prototype, "cartType", 2); 53026 __decorateClass$1n([ 53027 n$5({ type: String }) 53028 ], SonicCartQuickSelect.prototype, "cartProvider", 2); 53029 __decorateClass$1n([ 53030 n$5({ type: Array }) 53031 ], SonicCartQuickSelect.prototype, "entities", 2); 53032 __decorateClass$1n([ 53033 e$2({ context: selectedSubscriptionIdContext }), 53034 n$5({ type: String }) 53035 ], SonicCartQuickSelect.prototype, "selectedSubscriptionId", 2); 53036 __decorateClass$1n([ 53037 e$2({ context: subscriptionsContext }), 53038 r$5() 53039 ], SonicCartQuickSelect.prototype, "_subscriptions", 2); 53040 __decorateClass$1n([ 53041 c({ context: accessParamsContext, subscribe: true }), 53042 e$2({ context: accessParamsContext }), 53043 n$5({ type: Object }) 53044 ], SonicCartQuickSelect.prototype, "accessParams", 2); 53045 __decorateClass$1n([ 53046 r$5() 53047 ], SonicCartQuickSelect.prototype, "tabs", 2); 53048 __decorateClass$1n([ 53049 bind$1("settings"), 53050 r$5() 53051 ], SonicCartQuickSelect.prototype, "settings", 2); 53052 __decorateClass$1n([ 53053 c({ context: appType, subscribe: true }) 53054 ], SonicCartQuickSelect.prototype, "appType", 2); 53055 __decorateClass$1n([ 53056 e$2({ context: preferredQuotaIdContext }), 53057 bind$1("admin_form_preferred_quota.preferred_quota_id"), 53058 r$5() 53059 ], SonicCartQuickSelect.prototype, "preferredQuotaId", 2); 53060 __decorateClass$1n([ 53061 r$5() 53062 ], SonicCartQuickSelect.prototype, "_queueDpExpression", 2); 53063 __decorateClass$1n([ 53064 e$2({ context: isLargeContext }), 53065 n$5({ type: Boolean, reflect: true }) 53066 ], SonicCartQuickSelect.prototype, "isLarge", 2); 53067 __decorateClass$1n([ 53068 r$5() 53069 ], SonicCartQuickSelect.prototype, "allSubscriptionsAreValid", 2); 53070 __decorateClass$1n([ 53071 bind$1("user.id"), 53072 r$5() 53073 ], SonicCartQuickSelect.prototype, "loggedUserId", 2); 53074 __decorateClass$1n([ 53075 e$2({ context: showOtherOwnersContext }), 53076 r$5() 53077 ], SonicCartQuickSelect.prototype, "_showOtherOwners", 2); 53078 __decorateClass$1n([ 53079 r$5() 53080 ], SonicCartQuickSelect.prototype, "sliderIndex", 2); 53081 SonicCartQuickSelect = __decorateClass$1n([ 53082 t$3(tagName$_) 53083 ], SonicCartQuickSelect); 53084 var __defProp$1k = Object.defineProperty; 53085 var __getOwnPropDesc$1m = Object.getOwnPropertyDescriptor; 53086 var __decorateClass$1m = (decorators, target, key, kind) => { 53087 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1m(target, key) : target; 53088 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 53089 if (decorator = decorators[i2]) 53090 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 53091 if (kind && result) __defProp$1k(target, key, result); 53092 return result; 53093 }; 53094 let instanceCounter$2 = 0; 53095 let SubscriptionPriceForm = class extends i$6 { 53096 constructor() { 53097 super(...arguments); 53098 this.prices = []; 53099 this.isLoading = false;
53100 this.formDataProvider = `subscription-price-form-${instanceCounter$2++}`; 53101 } 53102 async willUpdate(_changedProperties) { 53103 if (_changedProperties.has("lineItem")) { 53104 this.setPrices(this.lineItem?.entity_id?.toString()); 53105 } 53106 } 53107 async setPrices(id) { 53108 this.isLoading = true; 53109 const api2 = new API(HTML.getApiConfiguration(this)); 53110 const endpoint = `/subscription-types/${id}?features[]=prices`; 53111 const result = await api2.get(endpoint); 53112 if (result.success && result.data) { 53113 const data = result.data; 53114 this.prices = data?.prices ?? []; 53115 } else { 53116 this.prices = []; 53117 } 53118 this.isLoading = false; 53119 } 53120 pricesToOptions(prices) { 53121 let displayAmount = true; 53122 const everyAmountAreNull = prices.length > 0 && prices.every((price) => !price.amount); 53123 if (everyAmountAreNull) { 53124 displayAmount = false; 53125 } 53126 return prices.map((price) => { 53127 const isSelected = price.id?.toString() === this.lineItem?.price?.id?.toString(); 53128 const amount = formatAmount(price.amount || 0); 53129 return { 53130 value: price.id?.toString() || "", 53131 wording: `${price.title} ${displayAmount ? `â ${amount}` : ""}`, 53132 selected: isSelected 53133 }; 53134 }); 53135 } 53136 render() { 53137 if (this.isLoading) { 53138 return b$1`<sonic-loader mode="inline"></sonic-loader>`; 53139 } 53140 return b$1`<div class="flex flex-col gap-2" formDataProvider=${this.formDataProvider}> 53141 <sonic-select 53142 label=${t("price")} 53143 name="subscriptionPriceId" 53144 .options=${this.pricesToOptions(this.prices)} 53145 ?readonly=${this.prices.length === 1} 53146 ></sonic-select> 53147 <sonic-button 53148 size="lg" 53149 type="success" 53150 shape="block" 53151 @click=${this.handleSubmit} 53152 ?disabled=${this.prices.length === 1} 53153 > 53154 <sonic-icon library="custom" name="check"></sonic-icon> 53155 ${t("Valider")} 53156 </sonic-button> 53157 </div>`; 53158 } 53159 handleSubmit(e2) { 53160 e2.preventDefault(); 53161 const priceId = dp(this.formDataProvider).subscriptionPriceId.get(); 53162 const itemId = this.lineItem?.id; 53163 if (!itemId || !this.cartProvider || !priceId) return; 53164 const button2 = e2.target; 53165 button2.setAttribute("disabled", ""); 53166 button2.setAttribute("loading", ""); 53167 Cart.patchItems({ 53168 apiConfiguration: HTML.getApiConfiguration(this), 53169 cartProvider: this.cartProvider, 53170 query: { 53171 ids: [itemId] 53172 }, 53173 body: { 53174 price: { 53175 id: priceId 53176 } 53177 } 53178 }).then((e22) => { 53179 if (e22 === "asRequested") { 53180 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 53181 parentModal?.hide(); 53182 } 53183 }); 53184 button2.removeAttribute("disabled"); 53185 button2.removeAttribute("loading"); 53186 } 53187 }; 53188 SubscriptionPriceForm.styles = [tailwind]; 53189 __decorateClass$1m([ 53190 n$5({ type: Object }) 53191 ], SubscriptionPriceForm.prototype, "lineItem", 2); 53192 __decorateClass$1m([ 53193 n$5({ type: String }) 53194 ], SubscriptionPriceForm.prototype, "cartProvider", 2); 53195 __decorateClass$1m([ 53196 n$5({ type: Array }) 53197 ], SubscriptionPriceForm.prototype, "prices", 2); 53198 __decorateClass$1m([ 53199 r$5() 53200 ], SubscriptionPriceForm.prototype, "isLoading", 2); 53201 SubscriptionPriceForm = __decorateClass$1m([ 53202 t$3("sonic-subscription-price-form") 53203 ], SubscriptionPriceForm); 53204 function resolveAppType(appType2) { 53205 if (appType2) { 53206 return appType2; 53207 } 53208 if (document.querySelector("sonic-counter-app, sonic-counter-app-legacy")) { 53209 return "counter"; 53210 } 53211 return "customer"; 53212 } 53213 function getEventPlacementConfig(appType2) { 53214 const resolvedAppType = resolveAppType(appType2); 53215 return resolvedAppType === "counter" ? dp("settings.store_ui.event.placement").get() : dp("settings.customer_ui.event.placement").get(); 53216 } 53217 function shouldOpenAddPriceModalInsteadOfSeatmap(appType2) { 53218 return isAutoOnlyPlacement(getEventPlacementConfig(appType2)); 53219 } 53220 function openAddPriceModalForAutoPlacement({ 53221 cartProvider, 53222 priceContext, 53223 accessParams, 53224 preferredQuotaId 53225 }) { 53226 addPriceModal({ 53227 cartProvider, 53228 priceContext, 53229 accessParams, 53230 preferredQuotaId 53231 }); 53232 } 53233 const categoryMarkup = (price) => { 53234 if (!price) return A$1; 53235 return b$1`${price?.placeCategory && price?.placeCategory.title ? b$1`<span class="inline-block italic font-bold">${o$6(price?.placeCategory.title)} ⢠</span>` : A$1}`; 53236 }; 53237 const typeOfSeatIsChair = (type_of_seat) => { 53238 const normalSeatsLabels = ["chair", "siège", "fauteuil", "sitz", "stoel"]; 53239 const lowerCaseTypeOfSeat = type_of_seat?.toLowerCase().trim(); 53240 return normalSeatsLabels.includes(lowerCaseTypeOfSeat); 53241 }; 53242 function getSeatPlacementLabel(seat, mode2 = "default") { 53243 const { type_of_seat, common_name, short_name } = seat || {}; 53244 const typeSeatLabel = type_of_seat && !typeOfSeatIsChair(type_of_seat) ? " " + type_of_seat : ""; 53245 if (mode2 === "condensed" && short_name) { 53246 return `${short_name}${typeSeatLabel}`; 53247 } 53248 if (seat?.common_name) { 53249 return `${common_name}${typeSeatLabel}`; 53250 } 53251 return void 0; 53252 } 53253 const placementMarkup = (lineItems, mode2 = "default") => { 53254 if (!lineItems) return A$1; 53255 const labels = lineItems.map((item) => getSeatPlacementLabel(item.seat, mode2)).filter((label2) => !!label2); 53256 if (!labels.length) return A$1; 53257 return b$1`<div class="inline-flex gap-1 items-center align-middle">
53258 <sonic-icon library="custom" name="loveseat" class="self-start"></sonic-icon> 53259 ${o( 53260 o$1(labels, (label2) => b$1`${o$6(label2)}`), 53261 b$1`, ` 53262 )} 53263 </div>`; 53264 }; 53265 const priceLineMarkup = (lineItems) => { 53266 if (!lineItems?.length) return A$1; 53267 const firstPrice = lineItems[0].price; 53268 const allSamePrice = lineItems.every( 53269 (item) => item.price?.id === firstPrice?.id && item.price?.amount === firstPrice?.amount 53270 ); 53271 const isMultiple = lineItems.length > 1; 53272 const isSubscription = lineItems[0]?.entity_type === EntityType.Subscribe; 53273 let displayAmount = true; 53274 if (isSubscription && !firstPrice?.amount) { 53275 displayAmount = false; 53276 } 53277 return b$1` 53278 ${allSamePrice ? b$1`<span class="mr-3"> 53279 ${categoryMarkup(firstPrice)} ${firstPrice?.label} 53280 ${!isMultiple && lineItems[0]?.seat?.id ? b$1` â ${placementMarkup(lineItems, "default")} ` : A$1} 53281 ${displayAmount ? b$1`⢠${formatAmount(firstPrice?.amount || 0)}` : A$1} 53282 </span> 53283 ${isMultiple ? b$1`<span> 53284 <sonic-icon name="ticket" library="custom"></sonic-icon> 53285 à 53286 <span class="font-medium">${lineItems.length} </span> 53287 </span>` : A$1} ` : A$1} 53288 `; 53289 }; 53290 const editPriceModal = (options) => { 53291 const { lineItems, cartProvider, linkedCartProvider, accessParams, onUpdated } = options; 53292 const firstItem = lineItems?.[0]; 53293 if (!cartProvider || !firstItem) return; 53294 const { entity_type, entity_id } = firstItem; 53295 const parentSubscription = getParentItem(firstItem, cartProvider) || (linkedCartProvider ? getParentItem(firstItem, linkedCartProvider) : void 0); 53296 const priceContext = { 53297 entityType: entity_type, 53298 entityId: Number(entity_id), 53299 parentSubscription, 53300 edit: { 53301 lineItems, 53302 initialPrice: { 53303 id: Number(firstItem.price?.id), 53304 amount: Number(firstItem.price?.amount) || void 0, 53305 is_free_price: firstItem.price?.is_free_price || false 53306 }, 53307 initialQuotaId: Number(firstItem.quota?.id) || void 0 53308 } 53309 }; 53310 Modal.create({ 53311 title: lineItems.length > 0 ? t("edit_price") : t("LIB_select_price"), 53312 content: withAccessParams( 53313 accessParams, 53314 b$1`<sonic-cart-item-edit-price 53315 cartProvider=${cartProvider} 53316 .priceContext=${priceContext} 53317 @updated=${() => onUpdated?.()} 53318 ></sonic-cart-item-edit-price>` 53319 ), 53320 maxWidth: "40rem", 53321 removeOnHide: true 53322 }); 53323 }; 53324 const addPriceModal = (options) => { 53325 const { priceContext, cartProvider, preferredQuotaId, accessParams } = options; 53326 if (!cartProvider || !priceContext) return; 53327 Modal.create({ 53328 title: t("LIB_select_price"), 53329 content: withAccessParams( 53330 accessParams, 53331 b$1`<sonic-cart-item-edit-price 53332 cartProvider=${cartProvider} 53333 .priceContext=${priceContext} 53334 .preferredQuotaId=${preferredQuotaId} 53335 ></sonic-cart-item-edit-price>` 53336 ), 53337 maxWidth: "40rem", 53338 removeOnHide: true 53339 }); 53340 }; 53341 const quickSelectModal = async (options) => { 53342 const { cartProvider, selectedSubscriptionId, accessParams } = options; 53343 if (!cartProvider) return; 53344 if (Modal?.modals) { 53345 await Promise.all([...Modal.modals].map((modal) => modal.dispose())); 53346 } 53347 Modal.create({ 53348 title: b$1`<div style="display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start;"> 53349 <sonic-button 53350 to="subscription" 53351 noAutoFill 53352 autoActive="disabled" 53353 size="sm" 53354 variant="unstyled" 53355 @click=${(e2) => { 53356 const parentModal = HTML.getClosestElement(e2.target, "sonic-modal"); 53357 parentModal?.hide(); 53358 }} 53359 > 53360 <sonic-icon name="arrow-left" library="custom" size="lg"></sonic-icon> 53361 <span style="text-transform:uppercase;font-weight:bold">${t("back")}</span> 53362 </sonic-button> 53363 ${t("events_choice")} 53364 </div>`, 53365 subtitle: b$1``, 53366 content: withAccessParams( 53367 accessParams, 53368 b$1` 53369 <sonic-cart-quick-select 53370 dataProvider="${cartProvider}" 53371 cartProvider="${cartProvider}" 53372 subDataProvider="data" 53373 .selectedSubscriptionId=${selectedSubscriptionId} 53374 ></sonic-cart-quick-select> 53375 ` 53376 ), 53377 removeOnHide: true, 53378 fullScreen: true, 53379 closeButtonType: "danger" 53380 }); 53381 }; 53382 const addProofModal = ({ 53383 lineItem, 53384 cartProvider 53385 }) => { 53386 if (!lineItem?.id || !cartProvider) return; 53387 Modal.create({ 53388 title: t("LIB_add_proof"), 53389 content: b$1`<sonic-add-proof .item=${lineItem} cartProvider=${cartProvider}></sonic-add-proof>`, 53390 removeOnHide: true 53391 }); 53392 }; 53393 const editSubscriptionOwnerModal = ({ 53394 lineItem, 53395 cartProvider 53396 }) => { 53397 if (!lineItem?.id || !cartProvider) return; 53398 Modal.create({ 53399 title: t("owner"), 53400 content: b$1`<sonic-subscription-owner-form 53401 cartProvider=${cartProvider} 53402 .item=${lineItem} 53403 ></sonic-subscription-owner-form>`, 53404 removeOnHide: true, 53405 maxWidth: "50rem" 53406 }); 53407 }; 53408 const editSubscriptionPriceModal = ({ 53409 lineItem, 53410 cartProvider 53411 }) => { 53412 if (!lineItem || !cartProvider) return; 53413 Modal.create({ 53414 title: t("edit_price"), 53415 content: b$1`<sonic-subscription-price-form 53416 .lineItem=${lineItem} 53417 cartProvider=${cartProvider} 53418 ></sonic-subscription-price-form>`, 53419 maxWidth: "32rem", 53420 removeOnHide: true 53421 }); 53422 }; 53423 const editSeatsModal = ({ 53424 cartProvider, 53425 priceContext, 53426 sessionId, 53427 accessParams, 53428 editMode = SeatmapMode.CART_EDIT, 53429 onHide 53430 }) => { 53431 if (!cartProvider) return; 53432 const sessions = getSessionsWithSeatmap(cartProvider); 53433 const entityId = priceContext?.entityId ?? sessionId ?? Number(sessions[0]?.id) ?? 0; 53434 if (!entityId) return; 53435 const currentPriceContext = priceContext ?? { 53436 entityId, 53437 entityType: EntityType.Event 53438 }; 53439 const seatmapPublisher2 = getSeatmapModalPublisher(currentPriceContext); 53440 const modal = Modal.create({ 53441 // title: t("edit_selected_seats"), 53442 content: withAccessParams( 53443 accessParams, 53444 b$1`<sonic-event-seat-selector 53445 cartProvider=${cartProvider} 53446 seatmapProvider=${seatmapPublisher2} 53447 displaySummary 53448 .sessionsList=${sessions} 53449 edit-mode=${editMode} 53450 .priceContext=${currentPriceContext} 53451 ></sonic-event-seat-selector>` 53452 ), 53453 maxWidth: "68rem", 53454 height: "95svh", 53455 maxHeight: "95svh", 53456 removeOnHide: true 53457 }); 53458 modal.addEventListener("hidden", () => { 53459 dp(seatmapPublisher2).set({}); 53460 }); 53461 if (onHide) { 53462 modal.addEventListener("hide", onHide, { once: true }); 53463 } 53464 return modal; 53465 }; 53466 function getSeatmapModalPublisher(priceContext) { 53467 return `seatmapModal/${priceContext?.entityId ?? 0}`; 53468 } 53469 const addSeatsModal = (options) => { 53470 const { cartProvider, navigationMode, priceContext, accessParams, appType: appType2, preferredQuotaId } = options; 53471 if (!cartProvider) return; 53472 if (shouldOpenAddPriceModalInsteadOfSeatmap(appType2)) { 53473 openAddPriceModalForAutoPlacement({ 53474 cartProvider, 53475 priceContext, 53476 accessParams, 53477 preferredQuotaId 53478 }); 53479 return; 53480 } 53481 const sessions = navigationMode === "cart" ? getSessionsWithSeatmap(cartProvider) : []; 53482 const seatmapPublisher2 = getSeatmapModalPublisher(priceContext); 53483 const modal = Modal.create({ 53484 // title: t("add_tickets_with_seating"), 53485 content: withAccessParams( 53486 accessParams, 53487 b$1`<sonic-event-seat-selector 53488 cartProvider=${cartProvider} 53489 seatmapProvider=${seatmapPublisher2} 53490 displaySummary 53491 .sessionsList=${sessions} 53492 edit-mode=${SeatmapMode.CART_ADD} 53493 .priceContext=${priceContext} 53494 ></sonic-event-seat-selector>` 53495 ), 53496 maxWidth: "68rem", 53497 height: "95svh", 53498 maxHeight: "95svh", 53499 removeOnHide: true 53500 }); 53501 modal.addEventListener("hidden", () => { 53502 dp(seatmapPublisher2).set({}); 53503 }); 53504 return modal; 53505 }; 53506 const productPriceSummary = ({ 53507 lineItemCart, 53508 accessParams, 53509 className 53510 }) => { 53511 if (!lineItemCart) return A$1; 53512 const firstLineItem = Array.isArray(lineItemCart) ? lineItemCart[0] : lineItemCart; 53513 const isArray = Array.isArray(lineItemCart); 53514 const { entity_type, entity_id } = firstLineItem || {}; 53515 if (!entity_type || !entity_id) return A$1; 53516 return b$1`<sonic-fetch 53517 dataProvider="${entity_type}/${entity_id}/summary" 53518 endpoint=${entityEndPoint({ 53519 entityType: entity_type, 53520 entityId: Number(entity_id), 53521 view: entityView.full, 53522 accessParams 53523 })} 53524 key="data" 53525 > 53526 <sonic-product-summary size="md" class="${o$4(className)}" noOverTitle> 53527 <div class="text-sm mt-2" slot="subTitle">${priceLineMarkup(isArray ? lineItemCart : [firstLineItem])}</div> 53528 </sonic-product-summary> 53529 </sonic-fetch> `; 53530 }; 53531 const getSessionsWithSeatmap = (cartProvider) => { 53532 const cartEntities = dp(cartProvider).data.entities.get(); 53533 if (!cartEntities?.length) return []; 53534 return cartEntities.filter(isSession).filter((entity) => !!entity.id && !!entity.start_date && entity?.settings?.has_seatmap === true).sort((a2, b2) => Number(a2.start_date) - Number(b2.start_date)); 53535 }; 53536 const showAllPaymentsModal = (cartProvider, appType2) => { 53537 const title = appType2 === "counter" ? t("LIB_moyen_de_paiement_principal") : t("LIB_moyen_de_paiement"); 53538 Modal.create({ 53539 title, 53540 content: b$1`<sonic-cart-payment-buttons 53541 showAllPayments 53542 dataProvider="${cartProvider}" 53543 cartProvider="${cartProvider}" 53544 subDataProvider="data" 53545 ></sonic-cart-payment-buttons>`, 53546 removeOnHide: true 53547 }); 53548 }; 53549 const addTicketsModal = ({ 53550 id, 53551 cartProvider, 53552 accessParams 53553 }) => { 53554 const endPoint = entityEndPoint({ 53555 entityType: EntityType.Event, 53556 entityId: id, 53557 view: entityView.full, 53558 accessParams 53559 }); 53560 Modal.create({ 53561 title: t("add_tickets"), 53562 content: withAccessParams( 53563 accessParams, 53564 b$1`<sonic-fetch dataProvider=${endPoint} cartProvider=${o$4(cartProvider)} key="data"> 53565 <sonic-event-store-item noActionMenu alwaysExpanded formType="buttons"></sonic-event-store-item> 53566 </sonic-fetch>` 53567 ), 53568 maxWidth: "60rem", 53569 removeOnHide: true 53570 }); 53571 }; 53572 const getSubscriptionName = (subscriptionEntityId, cartProvider) => { 53573 if (!subscriptionEntityId || !cartProvider) return ""; 53574 const entities = dp(cartProvider).data.entities.get(); 53575 const subscription = entities.find( 53576 (entity) => entity.id === subscriptionEntityId && entity.entity_type === EntityType.Subscribe 53577 ); 53578 if (!subscription) return ""; 53579 return subscription.edito?.title || ""; 53580 }; 53581 let currentModal = null; 53582 const calculateCounters = (tasks, currentTask, totalTasksByType) => { 53583 const currentTaskType = currentTask.type; 53584 const tasksOfSameType = tasks.filter((task) => task.type === currentTaskType); 53585 const totalOfType = totalTasksByType?.[currentTaskType] || tasksOfSameType.length;
53586 let currentIndex; 53587 if (totalTasksByType?.[currentTaskType]) { 53588 currentIndex = totalTasksByType[currentTaskType] - tasksOfSameType.length + 1; 53589 } else { 53590 currentIndex = tasksOfSameType.findIndex((task) => task === currentTask) + 1; 53591 } 53592 return { 53593 currentIndex, 53594 totalOfType, 53595 isSubscription: currentTaskType === "owner-subscription" || currentTaskType === "owner" && currentTask.items[0]?.entity_type === EntityType.Subscribe 53596 }; 53597 }; 53598 async function hideAndProcessNextTask(modal, config) { 53599 await modal?.hide(); 53600 const { tasks, cartProvider, processedItems, totalTasksByType } = config; 53601 if (tasks.length && cartProvider) { 53602 const refreshedTasks = refreshTasksWithFreshItems(tasks, cartProvider); 53603 unifiedModal({ tasks: refreshedTasks, processedItems, cartProvider, totalTasksByType }); 53604 } else if (cartProvider) { 53605 const hadSubscriptionTasks = (totalTasksByType?.[ 53606 "owner-subscription" 53607 /* OWNER_SUBSCRIPTION */ 53608 ] ?? 0) > 0; 53609 if (hadSubscriptionTasks) { 53610 checkAndOpenQuickSelectModal(processedItems, cartProvider); 53611 } 53612 } 53613 } 53614 async function hideAndAttachNextOwners(modal, config) { 53615 await modal?.hide(); 53616 const { items, cartProvider, processedItems } = config; 53617 if (items.length && cartProvider) { 53618 attachOwnerModal({ items, processedItems, cartProvider }); 53619 } 53620 } 53621 const checkAndOpenQuickSelectModal = (processedItems, cartProvider) => { 53622 if (!processedItems?.length) return; 53623 try { 53624 const freshCartData = dp(cartProvider).data.get(); 53625 const freshItems = freshCartData?.items || []; 53626 const subscriptionsCanAttachEvents = processedItems.filter((item) => item.entity_type === EntityType.Subscribe).map((item) => freshItems.find((freshItem) => freshItem.id === item.id)).filter((item) => { 53627 return !!item && !!item.can_attach_events; 53628 }); 53629 const subscriptionsNeedingQuickSelection = subscriptionsCanAttachEvents?.filter((item) => { 53630 return item?.has_error_linked_events || item?.force_quick_selection; 53631 }); 53632 if (subscriptionsNeedingQuickSelection.length > 0) { 53633 quickSelectModal({ 53634 cartProvider, 53635 selectedSubscriptionId: subscriptionsNeedingQuickSelection[0].id 53636 }); 53637 } 53638 } catch (error) { 53639 console.warn("Erreur lors de la vérification des abonnements nécessitant des événements:", error); 53640 } 53641 }; 53642 const unifiedModal = (config) => { 53643 const { tasks, cartProvider, processedItems, totalTasksByType } = config; 53644 const currentTask = tasks[0]; 53645 if (!currentTask || !cartProvider) return; 53646 const currentItem = currentTask.items[0]; 53647 const id = currentItem?.id; 53648 if (!id) return; 53649 const { currentIndex, totalOfType } = calculateCounters(tasks, currentTask, totalTasksByType); 53650 let progressText = A$1; 53651 if (totalOfType > 1) { 53652 progressText = b$1`<span style="font-size: 0.7em;font-weight: 400; margin-left: 0.5rem;"> 53653 n°${currentIndex}/${totalOfType}</span 53654 >`; 53655 } 53656 const modalContent = b$1`${r(currentTask.type, [ 53657 [ 53658 "owner", 53659 () => renderOwnerModalContent(currentTask, cartProvider, tasks, processedItems, totalTasksByType) 53660 ], 53661 [ 53662 "owner-subscription", 53663 () => renderOwnerModalContent(currentTask, cartProvider, tasks, processedItems, totalTasksByType) 53664 ], 53665 [ 53666 "owner-other", 53667 () => renderOwnerModalContent(currentTask, cartProvider, tasks, processedItems, totalTasksByType) 53668 ], 53669 [ 53670 "free-price", 53671 () => renderFreePriceModalContent(currentTask, cartProvider, tasks, processedItems, totalTasksByType) 53672 ] 53673 ])}`; 53674 let width = "40rem"; 53675 if (currentTask.type === "owner-subscription" || currentTask.type === "owner" && currentItem.entity_type === EntityType.Subscribe) { 53676 width = "48rem"; 53677 } else if (currentTask.type === "owner" || currentTask.type === "owner-other") { 53678 width = "64rem"; 53679 } 53680 const modal = Modal.create({ 53681 title: b$1`${currentTask.title} ${progressText}`, 53682 content: modalContent, 53683 maxWidth: "95vw", 53684 width, 53685 removeOnHide: true 53686 }); 53687 currentModal = modal; 53688 }; 53689 const renderOwnerModalContent = (currentTask, cartProvider, tasks, processedItems, totalTasksByType) => { 53690 const currentItem = currentTask.items[0]; 53691 let mode2 = "default"; 53692 if (currentTask.type === "owner-subscription" || currentItem.entity_type === EntityType.Subscribe) { 53693 mode2 = "subscription"; 53694 }
53694 else if (currentItem.price?.need_subscription || currentItem.price?.need_partner_subscription) { 53695 mode2 = "attach-subscription"; 53696 } 53697 return r(mode2, [ 53698 [ 53699 "subscription", 53700 () => b$1`<sonic-subscription-owner-form 53701 cartProvider=${cartProvider} 53702 .item=${currentItem} 53703 @attach=${(e2) => { 53704 hideAndProcessNextTask(currentModal, { 53705 tasks: getNextTasks(tasks, e2.detail.itemIds), 53706 processedItems: getProcessedItems(processedItems, currentTask.items, e2.detail.itemIds), 53707 cartProvider, 53708 totalTasksByType 53709 }); 53710 }} 53711 ></sonic-subscription-owner-form>` 53712 ], 53713 [ 53714 "default", 53715 () => b$1`<sonic-owner-attach-form 53716 cartProvider=${cartProvider} 53717 .item=${currentItem} 53718 @attach=${(e2) => { 53719 hideAndProcessNextTask(currentModal, { 53720 tasks: getNextTasks(tasks, e2.detail.itemIds), 53721 processedItems: getProcessedItems(processedItems, currentTask.items, e2.detail.itemIds), 53722 cartProvider, 53723 totalTasksByType 53724 }); 53725 }} 53726 ></sonic-owner-attach-form>` 53727 ], 53728 [ 53729 "attach-subscription", 53730 () => b$1`<sonic-subscription-attach-form 53731 ?needPartnerSubscription=${currentItem.price?.need_partner_subscription} 53732 cartProvider=${cartProvider} 53733 .item=${currentItem} 53734 @attach=${(e2) => { 53735 hideAndProcessNextTask(currentModal, { 53736 tasks: getNextTasks(tasks, e2.detail.itemIds), 53737 processedItems: getProcessedItems(processedItems, currentTask.items, e2.detail.itemIds), 53738 cartProvider, 53739 totalTasksByType 53740 }); 53741 }} 53742 ></sonic-subscription-attach-form>` 53743 ] 53744 ]); 53745 }; 53746 const renderFreePriceModalContent = (currentTask, cartProvider, tasks, processedItems, totalTasksByType) => { 53747 const currentItem = currentTask.items[0]; 53748 const parentItem = getParentItem(currentItem, cartProvider); 53749 const priceContext = { 53750 entityType: currentItem.entity_type || EntityType.Event, 53751 entityId: Number(currentItem.entity_id), 53752 parentSubscription: parentItem, 53753 edit: { 53754 lineItems: currentTask.items, 53755 initialPrice: { 53756 id: Number(currentItem?.price?.id), 53757 amount: Number(currentItem?.price?.amount) || void 0, 53758 is_free_price: currentItem?.price?.is_free_price || false 53759 }, 53760 initialQuotaId: Number(currentItem?.quota?.id) || void 0 53761 } 53762 }; 53763 return b$1`<sonic-cart-item-edit-price 53764 .priceContext=${priceContext} 53765 cartProvider=${cartProvider} 53766 @updated=${() => { 53767 hideAndProcessNextTask(currentModal, { 53768 tasks: tasks.slice(1), 53769 processedItems: [...processedItems || [], ...currentTask.items], 53770 cartProvider, 53771 totalTasksByType 53772 }); 53773 }} 53774 ></sonic-cart-item-edit-price>`; 53775 }; 53776 const getNextTasks = (tasks, processedItemIds) => { 53777 const remainingItems = tasks[0].items.slice(1).filter((item) => !processedItemIds.includes(item.id || "")); 53778 if (remainingItems.length > 0) { 53779 return [{ ...tasks[0], items: remainingItems }, ...tasks.slice(1)]; 53780 } else { 53781 return tasks.slice(1); 53782 } 53783 }; 53784 const attachOwnerModal = (config) => { 53785 const { items, cartProvider, processedItems } = config; 53786 const currentItem = items[0]; 53787 const id = currentItem?.id; 53788 if (!id || !cartProvider) return; 53789 const currentIndex = items.findIndex((item) => item.id === currentItem.id) + 1; 53790 const totalOfType = items.length; 53791 let progressText = A$1; 53792 if (totalOfType > 1) { 53793 progressText = b$1`<span style="font-size: 0.7em;font-weight: 400; margin-left: 0.5rem;"> 53794 n°${currentIndex}/${totalOfType}</span 53795 >`; 53796 } 53797 let mode2 = "default"; 53798 if (currentItem.entity_type === EntityType.Subscribe) { 53799 mode2 = "subscription"; 53800 } else if (currentItem.price?.need_subscription || currentItem.price?.need_partner_subscription) { 53801 mode2 = "attach-subscription"; 53802 } 53803 const modal = Modal.create({ 53804 title: b$1`${t("owner")} ${progressText}`, 53805 content: b$1`${r(mode2, [ 53806 [ 53807 "subscription", 53808 () => b$1`<sonic-subscription-owner-form 53809 cartProvider=${cartProvider} 53810 .item=${currentItem} 53811 @attach=${(e2) => { 53812 hideAndAttachNextOwners(modal, { 53813 items: getNextItems(items, e2.detail.itemIds), 53814 processedItems: getProcessedItems(processedItems, items, e2.detail.itemIds), 53815 cartProvider 53816 }); 53817 }} 53818 ></sonic-subscription-owner-form>` 53819 ], 53820 [ 53821 "default", 53822 () => b$1`<sonic-owner-attach-form 53823 cartProvider=${cartProvider} 53824 .item=${currentItem} 53825 @attach=${(e2) => { 53826 hideAndAttachNextOwners(modal, { 53827 items: getNextItems(items, e2.detail.itemIds), 53828 processedItems: getProcessedItems(processedItems, items, e2.detail.itemIds), 53829 cartProvider 53830 }); 53831 }} 53832 ></sonic-owner-attach-form>` 53833 ], 53834 [ 53835 "attach-subscription", 53836 () => b$1`<sonic-subscription-attach-form
53837 ?needPartnerSubscription=${currentItem.price?.need_partner_subscription} 53838 cartProvider=${cartProvider} 53839 .item=${currentItem} 53840 @attach=${(e2) => { 53841 hideAndAttachNextOwners(modal, { 53842 items: getNextItems(items, e2.detail.itemIds), 53843 processedItems: getProcessedItems(processedItems, items, e2.detail.itemIds), 53844 cartProvider 53845 }); 53846 }} 53847 ></sonic-subscription-attach-form>` 53848 ] 53849 ])}`, 53850 maxWidth: "95vw", 53851 width: mode2 === "subscription" ? "48rem" : "64rem", 53852 removeOnHide: true 53853 }); 53854 }; 53855 const createModalTasks = (items, editFreePriceAfterRequest) => { 53856 const tasks = []; 53857 const itemsNeedingOwner = items.filter((item) => item.has_error_owner); 53858 const itemsNeedingFreePrice = editFreePriceAfterRequest ? items.filter((item) => { 53859 return item.price?.is_free_price; 53860 }).sort((a2, b2) => { 53861 return (b2.updatedAt || 0) - (a2.updatedAt || 0); 53862 }) : []; 53863 if (itemsNeedingFreePrice.length > 0) { 53864 const groupedFreePriceItems = groupFreePriceItems(itemsNeedingFreePrice); 53865 groupedFreePriceItems.forEach((group) => { 53866 tasks.push({ 53867 type: "free-price", 53868 items: group, 53869 title: t("edit_price") 53870 }); 53871 }); 53872 } 53873 if (itemsNeedingOwner.length > 0) { 53874 itemsNeedingOwner.forEach((item) => { 53875 let taskType; 53876 if (item.entity_type === EntityType.Subscribe) { 53877 taskType = "owner-subscription"; 53878 } else { 53879 taskType = "owner-other"; 53880 } 53881 tasks.push({ 53882 type: taskType, 53883 items: [item], 53884 // Un seul item par tâche 53885 title: t("owner") 53886 }); 53887 }); 53888 } 53889 return tasks; 53890 }; 53891 const groupFreePriceItems = (items) => { 53892 const groups = /* @__PURE__ */ new Map(); 53893 items.forEach((item) => { 53894 const key = `${item.entity_id}-${item.entity_type}-${item.price?.id}-${item.price?.amount}`; 53895 if (!groups.has(key)) { 53896 groups.set(key, []); 53897 } 53898 groups.get(key).push(item); 53899 }); 53900 return Array.from(groups.values()); 53901 }; 53902 const itemsMatchingRequest = (items, requestItems) => { 53903 return items.filter((lineItem) => { 53904 return requestItems?.some((requestItem) => { 53905 const matchEntity = requestItem.entity_id === lineItem.entity_id && requestItem.entity_type === lineItem.entity_type; 53906 const matchingPriceId = requestItem.price?.id ? requestItem.price?.id === lineItem.price?.id : true; 53907 const matchingParentId = (requestItem.parent_id ?? null) === (lineItem.parent_id ?? null); 53908 return matchEntity && matchingPriceId && matchingParentId; 53909 }); 53910 }); 53911 }; 53912 const handlePostRequestModals = (request, resultItems, editFreePriceAfterRequest) => { 53913 const { cartProvider, items: requestItems } = request; 53914 if (!cartProvider) return; 53915 let matchingItems = itemsMatchingRequest(resultItems, requestItems || []); 53916 const hasSubscriptionInRequest = requestItems?.some((item) => item.entity_type === EntityType.Subscribe); 53917 if (hasSubscriptionInRequest) { 53918 const itemsNeedingSubscription = resultItems.filter( 53919 (item) => item.entity_type === EntityType.Event && (item.price?.need_subscription || item.price?.need_partner_subscription) && item.has_error_owner 53920 ); 53921 const existingIds = new Set(matchingItems.map((item) => item.id)); 53922 const newItems = itemsNeedingSubscription.filter((item) => !existingIds.has(item.id)); 53923 matchingItems = [...matchingItems, ...newItems]; 53924 } 53925 const tasks = createModalTasks(matchingItems, editFreePriceAfterRequest); 53926 if (tasks.length > 0) { 53927 const totalTasksByType = tasks.reduce( 53928 (acc, task) => { 53929 acc[task.type] = (acc[task.type] || 0) + 1; 53930 return acc; 53931 }, 53932 {} 53933 ); 53934 unifiedModal({ 53935 tasks, 53936 cartProvider, 53937 totalTasksByType 53938 }); 53939 } 53940 }; 53941 const getNextItems = (items, attachedItemsIds) => { 53942 return items.slice(1).filter((item) => !attachedItemsIds.includes(item.id || "")); 53943 }; 53944 const getProcessedItems = (processedItems, items, attachedItems) => { 53945 const itemsToAdd = items?.filter((item) => attachedItems?.includes(item?.id || "")); 53946 return [...processedItems || [], ...itemsToAdd || []]; 53947 }; 53948 const refreshTasksWithFreshItems = (tasks, cartProvider) => { 53949 try { 53950 const freshCartData = dp(cartProvider).data.get(); 53951 const freshItems = freshCartData?.items || []; 53952 return tasks.map((task) => ({ 53953 ...task, 53954 items: task.items.map((oldItem) => { 53955 const freshItem = freshItems.find((item) => item.id === oldItem.id); 53956 return freshItem || oldItem; 53957 }).filter((item) => { 53958 if (task.type === "owner" || task.type === "owner-subscription" || task.type === "owner-other") { 53959 return item.has_error_owner; 53960 } else if (task.type === "free-price") { 53961 return item.price?.is_free_price; 53962 } 53963 return true; 53964 }) 53965 })).filter((task) => task.items.length > 0); 53966 } catch (error) { 53967 console.warn("Erreur lors du rafraîchissement des items des tâches:", error); 53968 return tasks; 53969 } 53970 }; 53971 const _Cart = class _Cart { 53972 /**
53973 * Crée un nouveau panier 53974 * @param request - La requête de création d'un nouveau panier 53975 * @returns le panier créé 53976 */ 53977 static async newCart(request) { 53978 const api2 = new API(request.apiConfiguration); 53979 const { cartProvider, buyer, items, cart_origin } = request; 53980 if (!cartProvider) return; 53981 Loader.show(); 53982 const result = await api2.post(cartProvider, { 53983 items, 53984 cart_origin, 53985 ...buyer 53986 }); 53987 Loader.hide(); 53988 await this.handleResult({ request, api: api2, result }); 53989 return result; 53990 } 53991 static async patchCart(request) { 53992 const api2 = new API(request.apiConfiguration); 53993 const { cartProvider, buyer, items } = request; 53994 if (!cartProvider) return; 53995 Loader.show(); 53996 const result = await api2.patch(cartProvider, { 53997 items, 53998 ...buyer 53999 }); 54000 Loader.hide(); 54001 await this.handleResult({ request, api: api2, result }); 54002 return result; 54003 } 54004 /** 54005 * Ajoute des éléments au panier 54006 * @param request - La requête d'ajout d'éléments 54007 * @returns le panier mis à jour 54008 */ 54009 static async addItems(request) { 54010 const api2 = new API(request.apiConfiguration); 54011 const { 54012 cartProvider, 54013 items, 54014 auto_seating, 54015 fallback_available_quota, 54016 attachOwnersAfterRequest, 54017 editFreePriceAfterRequest, 54018 accessParams 54019 } = request; 54020 if (!cartProvider) return; 54021 const endPoint = itemsEndpoint(cartProvider); 54022 Loader.show(); 54023 const { campaignHash, campaignId, reservationRequestConfigId, customListSlug } = accessParams ?? {}; 54024 const result = await api2.post(endPoint, { 54025 items, 54026 auto_seating, 54027 fallback_available_quota, 54028 campaign_hash: campaignHash, 54029 campaign_id: campaignId, 54030 reservation_request_config_id: reservationRequestConfigId, 54031 custom_list_slug: customListSlug 54032 }); 54033 Loader.hide(); 54034 return await this.handleResult({ 54035 request, 54036 api: api2, 54037 result, 54038 attachOwnersAfterRequest, 54039 editFreePriceAfterRequest 54040 }); 54041 } 54042 /** 54043 * Modifie un ou plusieurs articles du panier 54044 * @param request - La requête de modification d'un article 54045 */ 54046 static async patchItems(request) { 54047 const api2 = new API(request.apiConfiguration); 54048 const { cartProvider } = request; 54049 if (!cartProvider) return; 54050 let endpoint = itemsEndpoint(cartProvider); 54051 endpoint = addQueryToEndpoint(endpoint, request.query); 54052 const result = await api2.patch(endpoint, request.body); 54053 return await this.handleResult({ request, api: api2, result }); 54054 } 54055 static async set(request) { 54056 const api2 = new API(request.apiConfiguration); 54057 const { cartProvider } = request; 54058 if (!cartProvider) return "error"; 54059 const requestsKey = request.apiConfiguration.serviceURL + cartProvider; 54060 let requests = this.setRequests.get(requestsKey); 54061 if (!requests) { 54062 this.setRequests.set(requestsKey, requests = {}); 54063 } 54064 if (requests.current) { 54065 requests.next = request; 54066 return "pending"; 54067 } 54068 requests.current = request; 54069 Loader.show({ noDelay: true }); 54070 let endPoint = itemsEndpoint(cartProvider); 54071 endPoint = addQueryToEndpoint(endPoint, request.query); 54072 const body = request.body || {}; 54073 const result = await api2.patch(endPoint, body); 54074 delete requests.current; 54075 Loader.hide(); 54076 if (requests.next) { 54077 const next = requests.next; 54078 delete requests.next; 54079 return await this.set(next); 54080 } else { 54081 return await this.handleResult({ request, api: api2, result }); 54082 } 54083 } 54084 /** 54085 * Supprime un ou plusieurs articles du panier 54086 * @param request - La requête de suppression d'un article 54087 * sans Requête, elle supprime tous les articles du panier 54088 */ 54089 static async removeItems(request) { 54090 const api2 = new API(request.apiConfiguration); 54091 const cartProvider = request.cartProvider; 54092 if (!cartProvider) return; 54093 let endpoint = itemsEndpoint(cartProvider); 54094 endpoint = addQueryToEndpoint(endpoint, request.query); 54095 Loader.show(); 54096 const result = await api2.delete(endpoint, {}); 54097 Loader.hide(); 54098 await this.handleResult({ request, api: api2, result }); 54099 } 54100 /** 54101 * Gère le résultat d'une requête de panier 54102 * @param options - Les options de la requête 54103 * @returns le résultat de la requête 54104 */ 54105 static async handleResult(options) { 54106 const { request, api: api2, result, attachOwnersAfterRequest, editFreePriceAfterRequest } = options; 54107 const { cartProvider } = request; 54108 if (!cartProvider) return "error"; 54109 if (!result) { 54110 const alertMessage = { messages: [{ content: "Network Error", status: "error" }] }; 54111 dp(cartProvider).set(alertMessage); 54112 return "error"; 54113 } 54114 if (result.data && "items" in result.data) { 54115 dp(cartProvider).set(result); 54116 if (window.self !== window.top) { 54117 window.top?.postMessage({ invalidate: [cartProvider] }, "*"); 54118 } 54119 const hasErrors = result.messages?.some((m2) => m2.status === "error"); 54120 if (hasErrors) { 54121 await this.updateCart(api2, cartProvider); 54122 return "differentFromRequest";
54123 } else { 54124 if ("items" in request && (editFreePriceAfterRequest || attachOwnersAfterRequest)) { 54125 const items = result.data?.items ?? []; 54126 handlePostRequestModals(request, items, editFreePriceAfterRequest); 54127 } 54128 if ("items" in request) { 54129 this.handleTracking(request.items, result.data); 54130 } 54131 return "asRequested"; 54132 } 54133 } else { 54134 await this.updateCart(api2, cartProvider); 54135 return "differentFromRequest"; 54136 } 54137 } 54138 static handleTracking(items, cart) { 54139 if (cart?.cartType !== CartType.Cart) { 54140 return; 54141 } 54142 items.forEach((item) => { 54143 const cartItem = cart.items?.find((i2) => i2.entity_id === item.entity_id && i2.price?.id === item.price?.id); 54144 const entity = cart.entities?.find((e2) => e2.id === item.entity_id); 54145 if (!cartItem || !entity) { 54146 return; 54147 } 54148 const title = entity.edito?.title ?? "Produit"; 54149 const trackingCartItem = { 54150 item: { ...cartItem, quantity: item.quantity }, 54151 title, 54152 total: String(cart.total) 54153 }; 54154 TrackingManager.getTrackingManager((trackingManager) => { 54155 trackingManager.trackingOnCart(trackingCartItem); 54156 }); 54157 }); 54158 } 54159 static async updateCart(api2, dataProvider) { 54160 let result = await api2.get(dataProvider); 54161 if (!result) { 54162 result = { 54163 messages: [ 54164 { 54165 content: "Network Error", 54166 status: "error" 54167 } 54168 ] 54169 }; 54170 dp(dataProvider).set(result); 54171 return; 54172 } 54173 const isWaitingList2 = dataProvider.includes("waiting-list"); 54174 if (isWaitingList2) { 54175 const linkedCartProvider = "cart/current"; 54176 const cartCurrentResult = await api2.get(linkedCartProvider); 54177 if (cartCurrentResult) { 54178 dp(linkedCartProvider).set(cartCurrentResult); 54179 } 54180 } 54181 dp(dataProvider).set(result); 54182 } 54183 static async delete(api2, dataProvider) { 54184 const result = await api2.delete(dataProvider, {}); 54185 if (result?.success) { 54186 await this.updateCart(api2, dataProvider); 54187 } 54188 return result; 54189 } 54190 }; 54191 _Cart.setRequests = /* @__PURE__ */ new Map(); 54192 let Cart = _Cart; 54193 const flattenObject = (obj, prefix = "") => { 54194 let result = {}; 54195 for (const key in obj) { 54196 if (Object.prototype.hasOwnProperty.call(obj, key)) { 54197 const value = obj[key]; 54198 const newKey = prefix ? `${prefix}[${key}]` : key; 54199 if (typeof value === "object" && !Array.isArray(value)) { 54200 Object.assign(result, flattenObject(value, newKey)); 54201 } else if (Array.isArray(value)) { 54202 value.forEach((val, index) => { 54203 result[`${newKey}[${index}]`] = val; 54204 }); 54205 } else { 54206 result[newKey] = value; 54207 } 54208 } 54209 } 54210 return result; 54211 }; 54212 const itemsEndpoint = (cartProvider) => { 54213 return cartProvider + "/items"; 54214 }; 54215 const addQueryToEndpoint = (endpoint, query) => { 54216 if (!query) return endpoint; 54217 const queryParams = new URLSearchParams(flattenObject(query)); 54218 return `${endpoint}?${queryParams.toString()}`; 54219 }; 54220 const getItemsWithParentId = (items) => { 54221 return items.filter((item) => item.parent_id); 54222 }; 54223 const getItemsWithoutMatchingParent = (items) => { 54224 const itemsWithoutParent = items.filter((item) => { 54225 if (!item.parent_id) return true; 54226 return !items.some((i2) => i2.id === item.parent_id); 54227 }); 54228 return itemsWithoutParent; 54229 }; 54230 const getTotal = (item) => { 54231 let quantity = item.quantity || 0; 54232 let total = item.price?.amount ? parseFloat((item.price.amount * quantity).toString()) : 0; 54233 if (!item.items) return total; 54234 item.items?.forEach((subItem) => { 54235 if (subItem.price?.amount) { 54236 const subitemQuantity = subItem.quantity || 0; 54237 const subitemTotal = parseFloat((subItem.price.amount * subitemQuantity).toString()); 54238 total += subitemTotal || 0; 54239 } 54240 }); 54241 return total; 54242 }; 54243 const groupItemsByEntity = (items, entities) => { 54244 const clonedItems = structuredClone(items); 54245 const itemsWithoutParent = getItemsWithoutMatchingParent(clonedItems); 54246 const itemsWithParentId = getItemsWithParentId(clonedItems); 54247 const groupedItems = [];
54248 entities.forEach((entity) => { 54249 const matchingItems = itemsWithoutParent.filter( 54250 (item) => item.entity_id === entity.id && item.entity_type === entity.entity_type 54251 ); 54252 if (matchingItems.length === 0) { 54253 return; 54254 } 54255 const entityGroup = { 54256 entity, 54257 items: [] 54258 }; 54259 matchingItems.forEach((item) => { 54260 const childItems = itemsWithParentId.filter((childItem) => childItem.parent_id === item.id); 54261 const total = getTotal(item) + childItems.reduce((sum, childItem) => sum + getTotal(childItem), 0); 54262 const itemWithTotal = { ...item, total, items: [item, ...childItems] }; 54263 if (item.entity_type === EntityType.Subscribe) { 54264 const hash = item.infos?.hash; 54265 entityGroup.hash = hash; 54266 entityGroup.items.push(itemWithTotal); 54267 } else { 54268 const existingPrice = entityGroup.items.find( 54269 (i2) => i2.price?.id === item.price?.id && i2.quota?.id === item.quota?.id && i2.price?.amount === item.price?.amount
54270 ); 54271 if (existingPrice) { 54272 existingPrice.items.push(...itemWithTotal.items); 54273 existingPrice.total += total; 54274 existingPrice.quantity = (existingPrice.quantity || 0) + (item.quantity || 0); 54275 existingPrice.owner_required = item.owner_required; 54276 } else { 54277 entityGroup.items.push({ 54278 ...itemWithTotal, 54279 quantity: item.quantity || 0, 54280 messages: item.messages || [], 54281 canEditQuantity: !!item.canEditQuantity, 54282 canDelete: !!item.canDelete 54283 }); 54284 } 54285 } 54286 }); 54287 entityGroup.items.sort((a2, b2) => (Number(a2.price?.id) || 0) - (Number(b2.price?.id) || 0)); 54288 groupedItems.push(entityGroup); 54289 }); 54290 return groupedItems.filter((item) => item.items.length > 0); 54291 }; 54292 const getTicketsQuantity = (items) => { 54293 return items.reduce((acc, item) => { 54294 if (item.entity_type === EntityType.Event) { 54295 acc += item.quantity || 0; 54296 } 54297 return acc; 54298 }, 0); 54299 }; 54300 const moveCartItems = (items, options) => { 54301 if (!items) return; 54302 let itemsToMove = []; 54303 if (items.some((item) => item.items?.length)) { 54304 items.forEach((item) => { 54305 itemsToMove.push(...item.items || []); 54306 }); 54307 } else { 54308 itemsToMove = structuredClone(items || []); 54309 } 54310 const sourcePublisher = dp(options.sourceDataProvider); 54311 const targetPublisher = dp(options.targetDataProvider); 54312 const targetPublisherCurrentItems = targetPublisher.items.get() || []; 54313 const seenIds = new Set(targetPublisherCurrentItems.map((item) => String(item.id))); 54314 const uniqueClonedItems = itemsToMove.filter((item) => !seenIds.has(item.id)); 54315 const targetPublisherUpdatedItems = [...targetPublisherCurrentItems, ...uniqueClonedItems]; 54316 targetPublisher.items.set(targetPublisherUpdatedItems); 54317 targetPublisher.quantity.set(getTicketsQuantity(targetPublisherUpdatedItems)); 54318 const sourceItems = sourcePublisher.items?.get(); 54319 const sourceItemsAfterUpdate = sourceItems?.filter((item) => !itemsToMove.some((i2) => i2.id === item.id)) || []; 54320 sourcePublisher.items.set(sourceItemsAfterUpdate); 54321 sourcePublisher.quantity.set(getTicketsQuantity(sourceItemsAfterUpdate)); 54322 }; 54323 const matchOwners = (owner1, owner2) => { 54324 if (owner1.email && owner2.email && owner1.email !== owner2.email) { 54325 return false; 54326 } 54327 return owner1.firstName === owner2.firstName && owner1.lastName === owner2.lastName && owner1.email === owner2.email; 54328 }; 54329 const isNonEmptyOwner = (owner) => { 54330 if (!owner) { 54331 return false; 54332 } 54333 return Boolean( 54334 owner.uid || owner.firstName?.trim() || owner.lastName?.trim() || owner.email?.trim() || owner.structure?.trim() || owner.address?.trim() || owner.postalCode?.trim() || owner.phoneNumber?.trim() 54335 ); 54336 }; 54337 const sortCartOwners = (uniqueOwners) => uniqueOwners.sort((a2, b2) => { 54338 const isAAnonymous = !a2.firstName && !a2.lastName && !a2.email; 54339 const isBAnonymous = !b2.firstName && !b2.lastName && !b2.email; 54340 if (isAAnonymous !== isBAnonymous) { 54341 return isAAnonymous ? 1 : -1; 54342 } 54343 if (!a2.lastName && b2.lastName) return 1; 54344 if (a2.lastName && !b2.lastName) return -1; 54345 if (a2.lastName && b2.lastName) { 54346 return a2.lastName.localeCompare(b2.lastName); 54347 } 54348 if (a2.email && b2.email) { 54349 return a2.email.localeCompare(b2.email); 54350 } 54351 if (!a2.email && b2.email) return 1; 54352 if (a2.email && !b2.email) return -1; 54353 return 0; 54354 }); 54355 const getCartOwners = (items) => { 54356 if (!items || !items.length) return []; 54357 const owners = items.filter((item) => item.owner).map((item) => item.owner); 54358 const uniqueOwners = owners?.reduce((acc, current2) => { 54359 if (!current2) return acc; 54360 const isDuplicate = acc.some((owner) => matchOwners(owner, current2)); 54361 if (!isDuplicate) { 54362 acc.push(current2); 54363 } 54364 return acc; 54365 }, []); 54366 return sortCartOwners(uniqueOwners); 54367 }; 54368 const getCartSubscriptions = ({ 54369 items, 54370 linked_subscriptions, 54371 can_attach_events 54372 }) => {
54373 let cartSubscriptions = items.filter((item) => item.entity_type === EntityType.Subscribe); 54374 let linkedSubscriptions = linked_subscriptions?.map((sub2) => prePurchaseSubscriptionToLineItemCart(sub2)).filter((sub2) => !!sub2) || []; 54375 let mergedSubscriptions = [...cartSubscriptions, ...linkedSubscriptions]; 54376 if (can_attach_events) { 54377 mergedSubscriptions = mergedSubscriptions.filter((sub2) => sub2.can_attach_events); 54378 } 54379 return mergedSubscriptions; 54380 }; 54381 const getCartOwnerSuggestions = ({ items, linked_subscriptions }) => { 54382 const cartItems = items || []; 54383 const subscriptionOwners = []; 54384 const otherOwners = []; 54385 const pushUniqueOwner = (acc, owner, exclude = []) => { 54386 if (!isNonEmptyOwner(owner)) { 54387 return; 54388 } 54389 if ([...acc, ...exclude].some((existing) => matchOwners(existing, owner))) { 54390 return; 54391 } 54392 acc.push(owner); 54393 }; 54394 for (const item of cartItems) { 54395 if (item.entity_type === EntityType.Subscribe) { 54396 pushUniqueOwner(subscriptionOwners, item.owner); 54397 } 54398 } 54399 for (const purchase of linked_subscriptions || []) { 54400 pushUniqueOwner(subscriptionOwners, purchase.owner); 54401 } 54402 for (const item of cartItems) { 54403 if (item.entity_type === EntityType.Subscribe) { 54404 continue; 54405 } 54406 pushUniqueOwner(otherOwners, item.owner, subscriptionOwners); 54407 } 54408 return [...subscriptionOwners, ...otherOwners]; 54409 }; 54410 const prePurchaseSubscriptionToLineItemCart = (purchase) => { 54411 if (purchase?.entity_type !== EntityType.Subscribe) return void 0; 54412 const priceId = purchase.price?.id; 54413 const price = priceId ? { 54414 id: priceId, 54415 amount: purchase.price?.amount, 54416 label: purchase.price?.label 54417 } : void 0; 54418 return { 54419 id: "subscription_" + purchase.id, 54420 entity_type: EntityType.Subscribe, 54421 entity_id: Number(purchase.entity?.id), 54422 owner: purchase.owner || {}, 54423 price, 54424 can_attach_events: !!purchase.can_attach_events 54425 }; 54426 }; 54427 const isPrePurchaseSubscription = (purchase) => { 54428 return purchase.entity_type === EntityType.Subscribe && purchase.id?.toString().startsWith("subscription_"); 54429 }; 54430 const getParentItem = (item, cartProvider) => { 54431 const cartContent = dp(cartProvider).data.get(); 54432 const parentItem = cartContent?.items?.find((i2) => i2.id === item.parent_id); 54433 if (parentItem) return parentItem; 54434 const parentLinkedSubscription = cartContent?.linked_subscriptions?.find( 54435 (i2) => Number(i2.id) === Number(item.parent_id?.replace("subscription_", "")) 54436 ); 54437 if (!parentLinkedSubscription) return void 0; 54438 return prePurchaseSubscriptionToLineItemCart(parentLinkedSubscription); 54439 }; 54440 const getSubscriptionRules = (entityId, cartProvider) => { 54441 const entities = dp(cartProvider).data.entities.get(); 54442 const subscriptionEntity = entities.find( 54443 (item) => Number(item.id) === Number(entityId) && item.entity_type === EntityType.Subscribe 54444 ); 54445 if (!subscriptionEntity) return; 54446 return subscriptionEntity.rules; 54447 }; 54448 const getSeatOwnerFromCart = (seatId, cartProvider) => { 54449 const cartItems = dp(cartProvider).data.items.get(); 54450 const matchingItem = cartItems?.find((item) => item.seat?.id === seatId); 54451 if (!matchingItem) return; 54452 const ownerFromParent = matchingItem.parent_id ? getParentItem(matchingItem, cartProvider)?.owner : void 0; 54453 return ownerFromParent || matchingItem.owner; 54454 }; 54455 const getLineItemCartForSeat = (seatId, cartProvider) => { 54456 const cartItems = dp(cartProvider).data.items.get(); 54457 const matchingItem = cartItems?.find((item) => item.seat?.id === seatId); 54458 return matchingItem; 54459 }; 54460 const cartTitle = (cartType) => { 54461 switch (cartType) { 54462 case CartType.Cart: 54463 return t("cart_title_panier"); 54464 case CartType.Reservation: 54465 return t("cart_title_reservation"); 54466 case CartType.Order: 54467 return t("cart_title_commande"); 54468 case CartType.ReservationRequest: 54469 return t("cart_title_demande_de_reservation"); 54470 case CartType.Split: 54471 return t("cart_title_retrait_partiel"); 54472 case CartType.WaitingLists: 54473 return t("cart_title_liste_attente"); 54474 default: 54475 return t("cart_title_panier"); 54476 } 54477 }; 54478 const lockReservationRequest = async (apiConfiguration, cartProvider) => { 54479 const api2 = new API(apiConfiguration); 54480 const result = await api2.post(cartProvider + "/submit", {}); 54481 const isSuccess = result.success ?? false; 54482 if (isSuccess) { 54483 await Cart.updateCart(api2, cartProvider); 54484 } 54485 return isSuccess; 54486 }; 54487 const getSessionItems = (items, entityId, parentId) => { 54488 return items.filter((item) => { 54489 const matchParent = parentId ? item.parent_id === parentId : !item.parent_id; 54490 return matchParent && item.entity_id === entityId && item.entity_type === EntityType.Event; 54491 }); 54492 }; 54493 const cartProviderKey = (cartType, id) => { 54494 switch (cartType) { 54495 case CartType.ReservationRequest: 54496 return `reservation-request${id ? `/${id}` : ""}`; 54497 case CartType.WaitingLists: 54498 return `waiting-lists${id ? `/${id}` : ""}`; 54499 case CartType.Reservation: 54500 return `reservations${id ? `/${id}` : ""}`; 54501 case CartType.Order: 54502 return `orders${id ? `/${id}` : ""}`; 54503 default: 54504 case CartType.Cart: 54505 return `cart${id ? `/${id}` : "/current"}`; 54506 } 54507 }; 54508 var __defProp$1j = Object.defineProperty; 54509 var __getOwnPropDesc$1l = Object.getOwnPropertyDescriptor; 54510 var __decorateClass$1l = (decorators, target, key, kind) => { 54511 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1l(target, key) : target; 54512 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 54513 if (decorator = decorators[i2]) 54514 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 54515 if (kind && result) __defProp$1j(target, key, result); 54516 return result; 54517 }; 54518 let SonicReservationIcon = class extends Subscriber$1(i$6) { 54519 constructor() { 54520 super(...arguments); 54521 this.noRemainingTime = false;
54522 } 54523 render() { 54524 const { quantity, cartType } = this.props ?? {}; 54525 return b$1`<span class="sr-only">${cartTitle(cartType)} ${quantity ? b$1`${quantity} items` : A$1}</span> 54526 54527 <div class="inline-flex relative items-center justify-center align-center"> 54528 <slot name="icon"> 54529 <sonic-icon library="custom" name="basket-shopping" size="${o$4(this.size)}"></sonic-icon> 54530 </slot> 54531 <sonic-cart-item-count class="item-count"></sonic-cart-item-count> 54532 ${!this.noRemainingTime ? b$1`<sonic-cart-remaining-time 54533 class="remaining-time" 54534 badge 54535 style="font-size: clamp(9px, 0.45em, 0.75rem);" 54536 ></sonic-cart-remaining-time>` : A$1} 54537 </div>`; 54538 } 54539 }; 54540 SonicReservationIcon.styles = [ 54541 tailwind, 54542 i$9` 54543 /*:host { 54544 vertical-align: text-bottom; 54545 display: inline-flex; 54546 }*/ 54547 54548 :host { 54549 display: inline-flex; 54550 } 54551 54552 .item-count { 54553 position: absolute; 54554 left: 50%; 54555 top: 50%; 54556 transform: translate(-50%, -50%) translate(-1.35em, -1.35em); 54557 } 54558 54559 .remaining-time { 54560 position: absolute; 54561 left: 50%; 54562 top: 100%; 54563 transform: translate(-50%, 10%); 54564 } 54565 ` 54566 ]; 54567 __decorateClass$1l([ 54568 n$5({ type: String }) 54569 ], SonicReservationIcon.prototype, "size", 2); 54570 __decorateClass$1l([ 54571 n$5({ type: Boolean }) 54572 ], SonicReservationIcon.prototype, "noRemainingTime", 2); 54573 SonicReservationIcon = __decorateClass$1l([ 54574 t$3("sonic-reservation-icon") 54575 ], SonicReservationIcon); 54576 var __defProp$1i = Object.defineProperty; 54577 var __getOwnPropDesc$1k = Object.getOwnPropertyDescriptor; 54578 var __decorateClass$1k = (decorators, target, key, kind) => { 54579 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1k(target, key) : target; 54580 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 54581 if (decorator = decorators[i2]) 54582 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 54583 if (kind && result) __defProp$1i(target, key, result); 54584 return result; 54585 }; 54586 let SonicUserIcon = class extends i$6 { 54587 render() { 54588 if (this.userId) { 54589 return b$1`<sonic-icon 54590 library="custom" 54591 prefix="solid" 54592 name="user-check" 54593 size="${o$4(this.size)}" 54594 class="translate-x-[.1em] inline-block" 54595 ></sonic-icon>`; 54596 } 54597 return b$1`<sonic-icon library="custom" name="user" size="${o$4(this.size)}"></sonic-icon>`; 54598 } 54599 }; 54600 SonicUserIcon.styles = [ 54601 tailwind, 54602 i$9` 54603 :host { 54604 display: inline-flex; 54605 } 54606 ` 54607 ]; 54608 __decorateClass$1k([ 54609 n$5({ type: String }) 54610 ], SonicUserIcon.prototype, "size", 2); 54611 __decorateClass$1k([ 54612 bind$1("user.id"), 54613 n$5({ type: String }) 54614 ], SonicUserIcon.prototype, "userId", 2); 54615 SonicUserIcon = __decorateClass$1k([ 54616 t$3("sonic-user-icon") 54617 ], SonicUserIcon); 54618 var __defProp$1h = Object.defineProperty; 54619 var __getOwnPropDesc$1j = Object.getOwnPropertyDescriptor; 54620 var __decorateClass$1j = (decorators, target, key, kind) => { 54621 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1j(target, key) : target; 54622 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 54623 if (decorator = decorators[i2]) 54624 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 54625 if (kind && result) __defProp$1h(target, key, result); 54626 return result; 54627 }; 54628 const tagName$Z = "sonic-header"; 54629 let SonicHeader = class extends Subscriber$1(i$6) { 54630 constructor() { 54631 super(...arguments); 54632 this.showOffCanvas = false; 54633 this.closeOffCanvas = false; 54634 this.enableOffCanvas = false; 54635 this.showBaseline = false; 54636 this.noPaddingX = false; 54637 this._isAccesibilityMode = false; 54638 this.handleSonicA11y = (e2) => { 54639 const customEvent = e2; 54640 this._isAccesibilityMode = customEvent.detail.a11y; 54641 }; 54642 } 54643 connectedCallback() { 54644 this.enableOffCanvas = this.hasAncestorAttribute("enableOffCanvas"); 54645 this.showBaseline = this.hasAncestorAttribute("defaultFrontend"); 54646 if (document.documentElement.hasAttribute("data-sonic-a11y")) { 54647 this._isAccesibilityMode = true; 54648 } 54649 window.addEventListener("sonicA11y", this.handleSonicA11y); 54650 super.connectedCallback(); 54651 } 54652 disconnectedCallback() { 54653 window.removeEventListener("sonicA11y", this.handleSonicA11y); 54654 super.disconnectedCallback(); 54655 } 54656 getBaseline() { 54657 const lang = document.documentElement.lang.split("-")[0]; 54658 const wording2 = { 54659 fr: "Billetterie", 54660 en: "Ticketing", 54661 nl: "Tickets", 54662 de: "Eintrittskarten" 54663 }; 54664 return wording2[lang] || wording2.fr;
54665 } 54666 getMarquee() { 54667 return b$1`<marquee> 54668 ${this.testMode ? b$1`Mode test` : A$1} ${this.testMode && this.isAuthorizedIP ? " ⢠" : A$1} 54669 ${this.isAuthorizedIP ? b$1`Fermée â IP autorisée` : A$1} 54670 </marquee>`; 54671 } 54672 render() { 54673 return b$1`<div 54674 class="h-[--sc-header-height] -mt-cgy ${this.noPaddingX ? "" : "-mx-cgx px-cgx"} py-[--sc-header-gy] flex" 54675 > 54676 <div class="flex items-center gap-4 grow"> 54677 ${this.enableOffCanvas && (this.showOffCanvas || this.closeOffCanvas) && this.isStoreOnline !== false ? b$1` 54678 <!-- Toggle menu --> 54679 <div class="flex items-center gap-4"> 54680 <sonic-button 54681 data-aria-label="Menu" 54682 formDataProvider="offCanvas" 54683 name="displayOffCanvas" 54684 value="true" 54685 size="lg" 54686 shape="circle" 54687 unique 54688 icon 54689 >${this.closeOffCanvas ? b$1`<sonic-icon library="custom" prefix="regular" name="xmark"></sonic-icon>` : b$1`<sonic-icon library="custom" prefix="regular" name="bars"></sonic-icon>`} 54690 </sonic-button> 54691 </div> 54692 ` : A$1} 54693 <!-- Logo --> 54694 <div class="h-full max-w-[12rem] relative mr-2 lg:mr-3 flex items-center"> 54695 <div class="h-full flex w-full items-center ${this._isAccesibilityMode ? "logo-a11y-wrapper" : ""} "> 54696 <sonic-theme-logo class="${this._isAccesibilityMode ? "logo-a11y-mode" : ""} h-full"></sonic-theme-logo> 54697 </div> 54698 ${this.renderBaseline()} 54699 </div> 54700 54701 <!-- Outils --> 54702 <div class="flex items-center pl-3 lg:pl-4 gap-1 border-l border-neutral-200"> 54703 <sonic-tooltip label=${o$4(t("mon_compte"))} placement="bottom"> 54704 <sonic-app-link 54705 to="account" 54706 shape="circle" 54707 variant="ghost" 54708 data-aria-label="${o$4(t("mon_compte"))}" 54709 size="lg" 54710 type=${this.userId ? "primary" : "default"} 54711 icon 54712 > 54713 <sonic-user-icon></sonic-user-icon> 54714 </sonic-app-link> 54715 </sonic-tooltip> 54716 ${this.isStoreOnline !== false ? b$1` <sonic-tooltip label=${o$4(t("panier"))} placement="bottom"> 54717 <sonic-app-link to="cart" shape="circle" variant="ghost" size="lg" icon data-aria-label=${t("panier")}> 54718 <sonic-reservation-icon 54719 dataProvider="cart/current" 54720 subDataProvider="data" 54721 ></sonic-reservation-icon> </sonic-app-link 54722 ></sonic-tooltip>` : A$1} 54723 54724 <!--Attention - n'est rendu que si le composant est défini, par le site par exemple --> 54725 <sonic-a11y 54726 class="text-xl ml-2" 54727 aria-label="${t("toggle_accessibility_mode")}" 54728 title="${t("toggle_accessibility_mode")}" 54729 > 54730 <sonic-a11y-icon></sonic-a11y-icon 54731 ></sonic-a11y> 54732 </div> 54733 </div> 54734 </div>`; 54735 } 54736 renderBaseline() { 54737 const headerBaseline = this.getBaseline(); 54738 if (this.testMode || this.isAuthorizedIP) { 54739 return b$1`<div 54740 class="absolute top-[100%] font-bold mt-[.35rem] inline-flex items-center transform left-0 w-20 whitespace-nowrap py-[4px] bg-[yellow] text-[#222222] z-20 rounded-[.3rem] leading-none opacity-80 font-weight-bold text-xs pointer-events-none shadow-md" 54741 > 54742 ${this.getMarquee()} 54743 </div>`; 54744 } else if (this.showBaseline) { 54745 return b$1`<sonic-badge type="neutral" size="xs" class="absolute top-[100%] left-0 mt-[.35rem]" 54746 ><span class="font-bold text-nowrap">â ${headerBaseline}</span></sonic-badge 54747 > `; 54748 } 54749 return A$1; 54750 } 54751 }; 54752 SonicHeader.styles = [ 54753 tailwind, 54754 i$9` 54755 .logo-a11y-mode { 54756 filter: hue-rotate(180deg) brightness(100%) contrast(30%) brightness(50%) saturate(100%); 54757 } 54758 54759 @media (prefers-color-scheme: dark) { 54760 .logo-a11y-mode { 54761 filter: invert(1) hue-rotate(180deg) brightness(100%) contrast(30%) brightness(100%) saturate(100%); 54762 } 54763 } 54764 ` 54765 ]; 54766 __decorateClass$1j([ 54767 n$5({ type: Boolean }) 54768 ], SonicHeader.prototype, "showOffCanvas", 2); 54769 __decorateClass$1j([ 54770 n$5({ type: Boolean }) 54771 ], SonicHeader.prototype, "closeOffCanvas", 2); 54772 __decorateClass$1j([ 54773 n$5({ type: Boolean }) 54774 ], SonicHeader.prototype, "enableOffCanvas", 2); 54775 __decorateClass$1j([ 54776 n$5({ type: Boolean }) 54777 ], SonicHeader.prototype, "showBaseline", 2); 54778 __decorateClass$1j([ 54779 n$5({ type: Boolean }) 54780 ], SonicHeader.prototype, "noPaddingX", 2); 54781 __decorateClass$1j([ 54782 bind$1("user.id"), 54783 n$5({ type: String }) 54784 ], SonicHeader.prototype, "userId", 2); 54785 __decorateClass$1j([ 54786 r$5() 54787 ], SonicHeader.prototype, "_isAccesibilityMode", 2); 54788 __decorateClass$1j([ 54789 bind$1("settings.is_online"), 54790 n$5({ type: Boolean }) 54791 ], SonicHeader.prototype, "isStoreOnline", 2); 54792 __decorateClass$1j([ 54793 bind$1("settings.test_mode"), 54794 n$5({ type: Boolean }) 54795 ], SonicHeader.prototype, "testMode", 2); 54796 __decorateClass$1j([ 54797 bind$1("settings.is_authorized_ip"), 54798 n$5({ type: Boolean }) 54799 ], SonicHeader.prototype, "isAuthorizedIP", 2); 54800 SonicHeader = __decorateClass$1j([ 54801 t$3(tagName$Z), 54802 awaitConnectedAncestors(APP_TAG_SELECTOR) 54803 ], SonicHeader); 54804 var __defProp$1g = Object.defineProperty; 54805 var __getOwnPropDesc$1i = Object.getOwnPropertyDescriptor; 54806 var __decorateClass$1i = (decorators, target, key, kind) => { 54807 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1i(target, key) : target; 54808 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 54809 if (decorator = decorators[i2]) 54810 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 54811 if (kind && result) __defProp$1g(target, key, result); 54812 return result; 54813 }; 54814 const tagName$Y = "sonic-language-menu"; 54815 let SonicComponent$d = class SonicComponent extends Subscriber$1(i$6) { 54816 constructor() { 54817 super(...arguments); 54818 this.langs = []; 54819 this.wording_page_available_in_multiple_languages = ""; 54820 } 54821 willUpdate(changedProperties) { 54822 if (changedProperties.has("langs") || changedProperties.has("wording_page_available_in_multiple_languages")) { 54823 if (this.langs.length < 2) return; 54824 const htmlLang = document.documentElement.lang.split("-")[0]; 54825 const navigatorLang = window.navigator.language.split("-")[0]; 54826 if (navigatorLang != htmlLang && isWordingReady("page_available_in_multiple_languages") && !localStorage.getItem("SonicSelectedLanguage")) { 54827 const toast = { 54828 text: ( 54829 /*html*/ 54830 `${this.wording_page_available_in_multiple_languages} <br /> 54831 <div style="margin-top:.25em"> 54832 ${this.langs.map( 54833 (lang) => `<sonic-button 54834 href="?language=${lang}" 54835 autoActive="disabled" 54836 shape="circle" 54837 variant="outline" 54838 size="xs" 54839 onClick="localStorage.setItem('SonicSelectedLanguage', '${lang}')" 54840 ><span style="text-transform:uppercase">${lang}</span></sonic-button 54841 >` 54842 ).join(" ")} 54843 </div>` 54844 ), 54845 id: "language-menu-toast", 54846 status: "info", 54847 preserve: true,
54848 dismissForever: true 54849 }; 54850 SonicToast.add(toast); 54851 } 54852 } 54853 super.willUpdate(changedProperties); 54854 } 54855 render() { 54856 if (this.langs.length > 1) { 54857 return b$1`<div class="flex flex-wrap gap-1 items-center"> 54858 <!-- <sonic-icon name="translate" library="custom"></sonic-icon> --> 54859 ${this.langs.map((lang) => { 54860 return b$1`<sonic-button 54861 href="?language=${lang}" 54862 autoActive="disabled" 54863 ?active=${lang.split("-")[0] == HTML$1.getLanguage()?.split("-")[0]} 54864 shape="circle" 54865 size="xs" 54866 @click=${() => localStorage.setItem("SonicSelectedLanguage", lang)} 54867 ><span class="uppercase">${lang}</span></sonic-button 54868 > `; 54869 })} 54870 </div>`; 54871 } else { 54872 return A$1; 54873 } 54874 } 54875 }; 54876 SonicComponent$d.styles = [tailwind]; 54877 __decorateClass$1i([ 54878 n$5({ type: Array }) 54879 ], SonicComponent$d.prototype, "langs", 2); 54880 __decorateClass$1i([ 54881 n$5({ type: String }) 54882 ], SonicComponent$d.prototype, "wording_page_available_in_multiple_languages", 2); 54883 SonicComponent$d = __decorateClass$1i([ 54884 t$3(tagName$Y) 54885 ], SonicComponent$d); 54886 async function getAgenda(id, htmlContext) { 54887 const api2 = new API(HTML$1.getApiConfiguration(htmlContext)); 54888 const result = await api2.get(`/agendas/${id}`); 54889 if (result.success && result.data) { 54890 return result.data; 54891 } 54892 return null; 54893 } 54894 async function getAgendas(htmlContext, excludeMainAgenda = false) { 54895 const api2 = new API(HTML$1.getApiConfiguration(htmlContext)); 54896 const result = await api2.get(`/agendas${excludeMainAgenda ? "?exclude_main=true" : ""}`); 54897 if (result.success && result.data) { 54898 return result.data; 54899 } 54900 return []; 54901 } 54902 const getBrandLogo = (brand, options) => { 54903 const color = options?.color ?? "currentColor"; 54904 const className = options?.className; 54905 if (brand?.id === "soticket") { 54906 return b$1` 54907 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 133 42.1" fill=${color} class=${className}> 54908 <path 54909 d="M132.8 30V.3H36.2v7.5c1.8.6 3.4 2 4.4 4 2 3.8.6 8.1-3.4 10.1l-1 .5v.3l-.2-.3c-3.6 1.2-7.2-.2-9-3.7s-.8-7.3 2.3-9.5l-3.4-6.6L1 15.3l13.5 26.5 23-11.8h95.4Zm-109-1.2c-3.2 1.6-6.1.6-7.7-1l2-2.4c1.1 1.1 2.7 1.7 4.3.9 1.2-.6 1.7-1.7 1.3-2.5-1.3-2.5-7.6 2.7-10-2.2-1.1-2-.2-4.6 2.7-6 2.5-1.3 5.3-1 6.9.5l-2.1 2.5a3 3 0 0 0-3.5-.6c-1 .5-1.5 1.3-1.2 2 1.2 2.4 7.4-3.1 10.2 2.2 1.1 2.3 0 5-3 6.6m37.8-18.4H65v14.7h-3.6V10.4ZM55 13.5V20c0 1.4.7 2.2 1.9 2.2a4 4 0 0 0 1.7-.4l.2 3.2a7 7 0 0 1-2.3.4c-3 0-5.2-1.6-5.2-5v-6.8h-2.5v-3h2.5V6h3.7v4.3h3.7v3.1H55ZM65.6 6c0 1.3-1 2.3-2.3 2.3S61 7.2 61 5.9s1-2.2 2.3-2.2c1.3 0 2.3 1 2.3 2.2m6 11.9c0 2.6 1.5 4.4 3.8 4.4 1.7 0 2.9-1 3.2-2.5l3.6.7c-.6 3-3.2 5-6.9 5-4.4 0-7.4-3.2-7.4-7.6s3-7.6 7.4-7.6c3.7 0 6.4 2 6.9 5l-3.6.8c-.3-1.6-1.5-2.6-3.2-2.6-2.2 0-3.7 1.7-3.7 4.4m21.1-1.6 6.5 8.9h-4.5l-4.5-6.5-1.7 1.7v4.8H85V4.5h3.6v11.1l5.6-5.2h4.6l-6 5.8Zm21.4 1v1.5h-11c.4 2.3 1.8 3.6 3.9 3.6 1.7 0 3-.9 3.3-2.3l3.4 1c-.8 2.7-3.3 4.3-6.8 4.3-4.8 0-7.4-3.7-7.4-7.5s2.4-7.6 7.2-7.6 7.4 3.7 7.4 7m7.3-3.7V20c0 1.4.8 2.2 1.9 2.2a4 4 0 0 0 1.7-.4l.3 3.2a7 7 0 0 1-2.4.4c-3 0-5.2-1.6-5.2-5v-6.8h-2.4v-3h2.4V6h3.7v4.3h3.7v3.1h-3.7Zm-18.1 2.6h6.9c-.2-1.8-1.3-3-3.5-3-1.8 0-3 1-3.4 3" 54910 class="cls-1" 54911 /> 54912 <path 54913 d="M80.1 40c-.7 0-1.3-.3-1.6-.7v.6h-1.8v-8.5h1.8v3c.4-.5.9-.7 1.6-.7.9 0 1.6.3 2 .9s.8 1.3.8 2.2-.2 1.7-.7 2.3c-.5.6-1.2.9-2.1.9Zm-.3-1.5c.4 0 .8-.2 1-.5.3-.3.4-.7.4-1.2s-.1-.8-.4-1.1c-.2-.3-.6-.5-1-.5s-.8.2-1 .5c-.3.3-.4.7-.4 1.1s.1 1 .4 1.2c.2.3.6.5 1 .5ZM87.5 33.8h1.8L86 42.1h-1.8l1-2.5-2.4-5.8h1.9l1.3 3.5 1.4-3.5ZM95.3 40c-.9 0-1.6-.3-2.2-.8-.7-.5-1-1.1-1.1-2l1.7-.4c0 .5.2.8.5 1.1.3.3.7.5 1.1.5.4 0 .7-.1 1-.3s.3-.4.3-.6l-.3-.6-.6-.3-.8-.3a9 9 0 0 1-1-.3l-.8-.4c-.3-.1-.4-.4-.6-.8-.2-.3-.2-.6-.2-1 0-.7.3-1.3.8-1.7.6-.5 1.3-.7 2.1-.7s1.5.2 2.1.6c.6.4 1 .9 1.2 1.5l-1.7.7-.6-.9c-.2-.2-.6-.3-1-.3-.3 0-.5 0-.7.2s-.3.3-.3.5 0 .4.2.5l.6.3.9.2.9.3c.3 0 .6.2.8.4l.7.8.2 1.2c0 .8-.3 1.4-.9 1.9-.6.4-1.4.7-2.3.7ZM102.2 40c-1 0-1.7-.3-2.3-1-.6-.5-1-1.3-1-2.2s.4-1.6 1-2.2c.6-.6 1.3-.9 2.3-.9s1.6.3 2.3.9c.6.6.9 1.3.9 2.2s-.3 1.7-1 2.3-1.3.9-2.2.9Zm0-1.5c.4 0 .7-.2 1-.5.3-.3.4-.7.4-1.2s-.1-.8-.4-1.1c-.3-.3-.6-.5-1-.5s-.8.2-1 .5c-.3.3-.5.7-.5 1.1s.2 1 .4
549131.2c.3.3.6.5 1 .5ZM109 40c-1 0-1.7-.3-2.3-1s-.8-1.2-.8-2.2a3 3 0 0 1 3-3c.9 0 1.5.1 2 .5.6.4 1 1 1 1.6l-1.7.3c0-.3-.2-.5-.4-.7s-.4-.3-.7-.3c-.5 0-.8.2-1 .5s-.4.7-.4 1.2.1.8.4 1.1c.2.3.5.5 1 .5.6 0 1-.3 1-1l1.8.4c-.1.7-.4 1.2-1 1.5-.5.4-1.1.6-2 .6ZM115.6 40c-1 0-1.7-.3-2.3-1-.6-.5-.9-1.3-.9-2.2s.3-1.6 1-2.2c.5-.6 1.3-.9 2.2-.9s1.7.3 2.3.9c.6.6 1 1.3 1 2.2s-.4 1.7-1 2.3-1.4.9-2.3.9Zm0-1.5c.5 0 .8-.2 1-.5.3-.3.5-.7.5-1.2s-.2-.8-.4-1.1c-.3-.3-.7-.5-1-.5s-.9.2-1.1.5c-.3.3-.4.7-.4 1.1s.1 1 .4 1.2c.2.3.6.5 1 .5ZM122.5 40c-1 0-1.7-.3-2.3-1-.6-.5-.9-1.3-.9-2.2s.3-1.6 1-2.2c.5-.6 1.3-.9 2.2-.9s1.7.3 2.3.9c.6.6 1 1.3 1 2.2s-.4 1.7-1 2.3-1.3.9-2.3.9Zm0-1.5c.5 0 .8-.2 1-.5.3-.3.5-.7.5-1.2s-.2-.8-.4-1.1c-.3-.3-.6-.5-1-.5s-.8.2-1.1.5c-.3.3-.4.7-.4 1.1s.1 1 .4 1.2c.2.3.6.5 1 .5ZM126.5 42v-8.2h1.8v.6c.4-.4 1-.7 1.7-.7.8 0 1.5.3 2 .9.5.5.8 1.3.8 2.2s-.3 1.7-.8 2.3-1.3.9-2.1.9c-.7 0-1.3-.2-1.6-.6V42h-1.8Zm2-4c.4.3.7.5 1.1.5s.8-.2 1-.5c.3-.3.4-.7.4-1.2s0-.8-.4-1.1c-.2-.3-.5-.5-1-.5s-.7.2-1 .5c-.3.3-.4.6-.4 1.1s.1 1 .4 1.2Z" 54914 /> 54915 </svg> 54916 `; 54917 } else { 54918 return b$1` 54919 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 242.8 62.9" fill=${color} class=${className}> 54920 <g> 54921 <path 54922 d="M65.8 53c.5.4 1 .8 1.2 1.3.3.6.5 1.2.5 2a3.5 3.5 0 0 1-1.7 3c-.6.4-1.2.5-1.8.5-1 0-1.7-.3-2.2-.9v.8h-2v-9.6h2v3.4c.6-.6 1.3-.9 2.2-.9.6 0 1.2.2 1.8.5Zm-.9 4.6c.3-.3.5-.8.5-1.4s-.2-1-.5-1.4c-.3-.3-.7-.5-1.3-.5s-1 .1-1.2.5c-.4.4-.5.8-.5 1.4s.1 1 .5 1.4c.3.4.7.6 1.2.6s1-.2 1.3-.6ZM69 51.4c-.3-.2-.4-.5-.4-.8s.1-.6.3-.8c.3-.2.6-.3 1-.3s.6 0 .9.3c.2.2.3.5.3.8 0 .3-.1.6-.3.8-.3.2-.6.3-1 .3s-.6 0-.9-.3Zm-.2 1.3h2v7h-2v-7ZM72.8 50h2v9.7h-2v-9.6ZM76.7 50h2v9.7h-2v-9.6ZM87.4 56.8H82c.1.4.3.8.7 1 .3.3.8.4 1.3.4.4 0 .7 0 1-.2l.8-.5 1 1.2c-.6.8-1.6 1.1-2.8 1.1-.8 0-1.5-.1-2.1-.4-.6-.3-1.1-.8-1.4-1.3a3.7 3.7 0 0 1 0-3.7c.3-.6.7-1 1.3-1.3.6-.3 1.2-.5 2-.5s1.2.2 1.8.5c.5.3 1 .7 1.3 1.2a3.7 3.7 0 0 1 .4 2.5Zm-4.8-2.3c-.3.3-.5.7-.5 1.1h3.4c0-.4-.2-.8-.6-1-.3-.3-.6-.5-1.1-.5s-.8.2-1.2.4ZM93.3 59.4a2 2 0 0 1-.7.3 4 4 0 0 1-1 .1c-.8 0-1.4-.2-1.9-.6-.5-.4-.7-1-.7-1.9v-2.9h-1V53h1v-1.7h2v1.7h1.8v1.5h-1.7v2.9c0 .3 0 .5.2.7l.6.2c.3 0 .6 0 .8-.2l.6 1.4ZM98.8 59.4a2 2 0 0 1-.7.3 4 4 0 0 1-1 .1c-.8 0-1.4-.2-1.9-.6-.5-.4-.7-1-.7-1.9v-2.9h-1V53h1v-1.7h2v1.7h1.8v1.5h-1.7v2.9c0 .3 0 .5.2.7l.6.2c.3 0 .6 0 .8-.2l.6 1.4ZM106.5 56.8h-5.3c.1.4.3.8.7 1 .4.3.8.4 1.3.4.4 0 .7 0 1-.2.3 0 .5-.2.8-.5l1 1.2c-.6.8-1.5 1.1-2.8 1.1-.8 0-1.5-.1-2.1-.4a3.3 3.3 0 0 1-1.9-3.2 3.5 3.5 0 0 1 1.8-3.1c.6-.3 1.2-.5 2-.5s1.2.2 1.8.5c.6.3 1 .7 1.3 1.2a3.7 3.7 0 0 1 .4 2.5Zm-4.7-2.3c-.3.3-.5.7-.6 1.1h3.5c-.1-.4-.3-.8-.6-1-.3-.3-.7-.5-1.2-.5s-.8.2-1.1.4ZM110.8 52.9c.4-.2 1-.3 1.5-.3v1.9h-.5c-.6 0-1 .1-1.4.5s-.5.8-.5 1.4v3.3h-2v-7h2v1c.2-.4.5-.7 1-.8ZM113.6 51.4c-.3-.2-.4-.5-.4-.8s.1-.6.4-.8c.2-.2.5-.3.9-.3s.7 0 .9.3c.2.2.3.5.3.8 0 .3 0 .6-.3.8-.2.2-.6.3-1 .3s-.6 0-.8-.3Zm-.1 1.3h2v7h-2v-7ZM124.2 56.8h-5.3c0 .4.3.8.7 1 .3.3.8.4 1.3.4.4 0 .7 0 1-.2.3 0 .5-.2.8-.5l1 1.2c-.6.8-1.6 1.1-2.8 1.1-.8 0-1.5-.1-2.1-.4a3.3 3.3 0 0 1-2-3.2 3.5 3.5 0 0 1 2-3.1c.5-.3 1.1-.5 1.8-.5s1.3.2 1.9.5c.5.3 1 .7 1.3 1.2a3.7 3.7 0 0 1 .4 2.5Zm-4.8-2.3c-.3.3-.5.7-.5 1.1h3.4c0-.4-.2-.8-.5-1-.4-.3-.7-.5-1.2-.5s-.8.2-1.1.4ZM127 56.7l-.1-.5c0-.2 0-.4.2-.5l.5-.2a.7.7 0 0 1 .7.7c0 .2 0 .4-.2.5l-.5.2c-.2 0-.4 0-.5-.2ZM132.8 59.3c-.5-.2-1-.7-1.2-1.2-.3-.5-.5-1.1-.5-1.8a3.4 3.4 0 0 1 1.7-3c.6-.3 1.2-.5 1.8-.5.6 0 1.2.1 1.6.4.5.2.9.5 1.1 1l-.7.5c-.2-.4-.5-.6-.8-.8s-.8-.3-1.2-.3c-.4 0-.9.2-1.3.4s-.7.5-1 1l-.2 1.3c0 .5 0 1 .3 1.4a2.4 2.4 0 0 0 2.2 1.3c.5 0 .8-.1 1.2-.3s.6-.4.8-.7l.7.4c-.2.5-.6.8-1 1-.5.3-1 .4-1.6.4-.7 0-1.3-.2-1.9-.4ZM141 53.2c.4-.3 1-.4 1.6-.4v1h-.3c-.7 0-1.2.1-1.6.6-.4.4-.6 1-.6 1.8v3.5h-1V53h1v1.3c.1-.5.4-.8.9-1ZM154.8 53.6c.5.5.7 1.2.7 2.1v4h-1v-3.9c0-.7 0-1.2-.4-1.6-.4-.4-.8-.5-1.5-.5s-1.2.2-1.6.6-.7 1-.7 1.8v3.6h-.9v-3.9c0-.7-.1-1.2-.5-1.6-.3-.3-.8-.5-1.4-.5-.7 0-1.3.2-1.7.6-.4.5-.6 1-.6 1.8v3.6h-1V53h1V54c.2-.4.5-.7 1-1 .4-.2.9-.3 1.4-.3s1.1.2 1.5.4c.4.2.8.6 1 1 .2-.4.6-.7 1-1 .5-.2 1-.4 1.7-.4.8 0 1.5.3 2 .8ZM159.2 56.7l-.2-.5c0-.2 0-.4.2-.5l.5-.2a.7.7 0 0 1 .7.7l-.2.5-.5.2c-.2 0-.4 0-.5-.2ZM174 52.9l-2.7 6.8h-.8l-2.2-5.6-2.1 5.6h-1l-2.5-6.8h.9l2.1 5.8 2.2-5.8h.8l2.2 5.8 2.2-5.8h.8ZM181 56.6h-5.6c0 .7.3 1.3.8 1.7s1.1.7 1.9.7c.4 0 .8-.1 1.1-.3l1-.6.5.6a3.9 3.9 0 0 1-2.6 1.1c-.8 0-1.4-.2-2-.5s-.9-.7-1.2-1.2c-.3-.5-.5-1.1-.5-1.8s.2-1.3.5-1.8a3.2 3.2 0 0 1 2.9-1.7c.6 0 1.2.2 1.7.5s.9.7 1.2 1.2.4 1.1.4 1.8v.3Zm-4.9-2.4c-.4.5-.7 1-.7 1.7h4.8c0-.7-.3-1.2-.7-1.6-.5-.5-1-.7-1.7-.7s-1.2.2-1.7.6ZM188.3 53.3c.5.3.9.7 1.2 1.2.3.5.4 1.1.4 1.8s-.1 1.3-.4 1.8c-.3.5-.7 1-1.3 1.2a3.5 3.5 0 0 1-3.2.1c-.5-.2-.9-.6-1.1-1v1.3h-1v-9.6h1v4l1.1-1 1.5-.3c.6 0 1.2.2 1.7.5Zm-.6 5.3c.4-.2.7-.5 1-1 .2-.3.3-.8.3-1.3s-.1-1-.3-1.4l-1-1c-.3-.1-.8-.3-1.3-.3s-.9.1-1.3.4c-.4.2-.7.5-.9 1s-.3.8-.3 1.3.1 1 .3 1.4a2.6 2.6 0 0 0 2.2 1.3c.5 0 1-.2 1.3-.4ZM193 56.7c-.2-.1-.2-.3-.2-.5l.2-.5.5-.2a.7.7 0 0 1 .7.7l-.2.5-.5.2c-.2 0-.4 0-.5-.2ZM202.1 53.5c.5.4.7 1.1.7 2v4.2h-.8v-1a2 2 0 0 1-1 .8c-.4.2-.8.3-1.4.3-.8 0-1.4-.2-1.8-.6-.5-.3-.7-.8-.7-1.4s.2-1 .6-1.4c.4-.4 1.1-.5 2-.5h2.2v-.5c0-.6-.2-1-.5-1.3-.3-.3-.8-.5-1.4-.5l-1.3.2-1 .6-.4-.7c.3-.3.7-.5 1.2-.6l1.6-.3c.8 0 1.5.2 2 .7Zm-1 5.2c.4-.2.6-.6.8-1v-1.2h-2.1c-1.2 0-1.8.5-1.8 1.3 0 .4.2.7.5.9.3.2.7.3 1.2.3s1 0 1.4-.3ZM210.6 53.3c.5.3 1 .7 1.2 1.2a3.7 3.7 0 0 1 0 3.6 3 3 0 0 1-1.2 1.3 3.5 3.5 0 0 1-3.2 0c-.5-.2-.8-.5-1.1-1v3.8h-1V53h1v1.3c.2-.4.6-.8 1-1 .5-.2 1-.4 1.6-.4.6 0 1.2.2 1.7.5Zm-.5 5.3c.4-.2.7-.5 1-1 .1-.3.3-.8.3-1.3s-.2-1-.4-1.4c-.2-.4-.5-.7-.9-1s-.8-.3-1.3-.3-1 .1-1.3.4-.7.5-1 1l-.2 1.3c0 .5 0 1 .3 1.4.2.4.5.7.9 1 .4.1.8.3 1.3.3s1-.2 1.3-.4ZM219.4 53.3c.6.3 1 .7 1.3 1.2.2.5.4 1.1.4 1.8s-.2 1.3-.4 1.8a3 3 0 0 1-1.3 1.2 3.5 3.5 0 0 1-3.2.1c-.5-.2-.8-.5-1.1-1v3.8h-1V53h1v1.3c.2-.4.6-.8 1-1 .5-.2 1-.4 1.6-.4.6 0 1.2.2 1.7.5Zm-.5 5.3c.4-.2.7-.5 1-1 .2-.3.3-.8.3-1.3s-.1-1-.4-1.4c-.2-.4-.5-.7-.9-1s-.8-.3-1.3-.3-.9.1-1.3.4-.7.5-.9 1c-.2.3-.3.8-.3 1.3s0 1 .3 1.4a2.6 2.6 0 0 0 2.2 1.3c.5 0 1-.2 1.3-.4Z" 54923 /> 54924 <g> 54925 <path 54926 d="M36.3 41.3H33a7.7 7.7 0 0 1-7.1 4.2c-5 0-6.4-3-6.4-9.4v-7.2c0-3.2-3.1-3.3-3.1-3.3h6.6v6.8c0 7.3 0 11.4 4.6 11.4 3.4 0 5.4-2.4 5.4-7v-8c0-3-3.1-3.2-3.1-3.2h6.5v15.7ZM43 30.4a8 8 0 0 1 7.5-5.2c4.6 0 8.1 3.6 8.1 9 0 6.5-4.7 11.2-10.7 11.2-1.7 0-3.2-.3-4.7-.9v12.9h-3.4v-27H43Zm5.5 14c3.6 0 6.2-3.2 6.2-8.3 0-5.8-2.5-9-6-9-3 0-5.5 2.6-5.5 7V42c1.4 1.7 3.1 2.5 5.3 2.5ZM65 32.8c-1 0-1 .7-1 2.1 0 5.2 3 9 7.6 9a8 8 0 0 0 5.6-2.4l.4.6a9.8 9.8 0 0 1-8 3.6c-5.8 0-9.4-3.7-9.4-9.8s4.2-11 9.3-11c4.3 0 7.7 3.2 7.7 6.8l-.1 1h-12Zm8.5-1.8c0-2.6-2-5-4.7-5s-4.7 2.1-4.8 5.7h8.4c.8 0 1-.2 1-.7ZM84.2 31.9h.3c1.2-4.4 3-6.6 5.5-6.6 1.6 0 2.8 1 2.8 2.1 0 1-.6 1.6-1.6 1.9-.7-1-1.5-1.4-2.4-1.4-2.3 0-4.2 3.3-4.2 9.6V45h-3.4V28.8c0-3.2-3-3.2-3-3.2h6v6.2ZM120.4 45.6c-6.3 0-10.5-4.6-10.5-10.6s4.2-10.6 10.5-10.6 10.4 4.5 10.4 10.6-4.2 10.6-10.4 10.6Zm-5.1-10.9c0 6.4 1.8 9.6 5 9.6s5.1-3.2 5.1-9.3-1.9-9.2-5-9.2-5.1 3-5.1 9ZM134 28.9c0-3.2-3-3.2-3-3.2h7.1v3.2l.4.2c1.2-3 3.5-4.5 6.7-4.5 5 0 6.5 3.2 6.5 9.7v10.9h-4.8v-8.7c0-6.3-.4-9.6-3.8-9.6-3 0-4.4 2.5-4.4 7.3v11h-4.8V28.9ZM156 29c0-3.3-3-3.3-3-3.3h7.7v19.5h-4.6V28.9Zm1.9-14c1.6 0 2.8 1.2 2.8 3s-1.2 3-2.8 3-2.8-1.3-2.8-3 1.1-3 2.8-3ZM181.3 24.5c-5.2 0-8.2 2.5-8.2 6 0 3.3 2.1 4.6 5.9 6.2 2.8 1.2 4.4 2.3 4.4 4.3 0 1.8-1.4 3-3.6 3-3.8 0-6.4-2.7-7.6-4.5l-.9-1.3-4-6.8s11-12.9 6-17.8c-1.1-1-2.7-1.2-3.5-.4-.6.6-.7 1.4-.2 2.4 1.2
54926-.2 2 0 2.6.7 3.2 3.2-4.4 12-9.6 16.5 0 0 4.1 6.9 5.4 8.5 1.8 2 3.9 4.5 11.8 4.5 5.2 0 8.2-3 8.2-6.7s-2.6-4.8-7-6.8c-2.1-1-3.3-1.9-3.3-3.5s1.3-2.9 3.2-2.9c3.4 0 4.7 1.5 4.7 2.2v-2.9c-1-.4-2.5-.7-4.3-.7ZM101.9 24.5c-5.2 0-8.2 2.5-8.2 6 0 3.3 2.2 4.6 5.9 6.2 2.8 1.2 4.4 2.3 4.4 4.3 0 1.8-1.4 3-3.6 3-3.8 0-6.3-2.7-7.6-4.2V43c1.1.6 3.7 2.4 7.3 2.4 5.2 0 8.6-2.7 8.6-6.4s-2.7-4.9-7-6.8c-2.2-1-3.4-2-3.4-3.6s1.3-2.8 3.2-2.8c2.4 0 4.2.8 4.7 2v-2.7c-1-.5-2.5-.7-4.3-.7ZM9.4 33.4c-3.2-1.3-5-2.2-5-4.3 0-2 1.7-3.3 4.4-3.3 2 0 4.6.6 5.3 3.7v-3.4c-1-.5-2.8-1.3-5-1.3-5.2 0-8.3 2.3-8.3 5.6 0 2.8 2.2 4.2 6.3 5.8 3.3 1.3 5 2.3 5 4.7 0 2.1-2.2 3.6-5 3.6-4.2 0-6.7-4-6.7-4v3c1 .7 3.7 2 6.2 2 5.6 0 9.2-2.7 9.2-6s-2.3-4.4-6.4-6Z" 54927 /> 54928 </g> 54929 </g> 54930 <g> 54931 <path 54932 d="M194.2 20c0-9 7.2-16.4 16.2-16.6l-.4 1.9-.2 2.1V14l-.7 2.8v.2a19.1 19.1 0 0 1-3.6 8c-1.8 2.4-2 3.2-2.2 4v.8l-.1.6.6.3 3 .3v-.2h.2v.2h1.1v-.2h.2l.1.3h1c.4 0 .5.3.5.3.1 1.6.3 3.8.7 5.2-9 0-16.4-7.4-16.4-16.5Z" 54933 /> 54934 <path d="M210.7 38.4a18.4 18.4 0 1 1 10.8-33.2l.6-.9a19.4 19.4 0 1 0 7.8 18l-1-.1c-1 9-8.8 16.2-18.2 16.2Z" /> 54935 <path 54936 d="M209.4 31h-1v-.3h-.2l-.1.3h-1l-.1-.3h-.2v.1l-3-.2-.6-.3v-.6l.1-.9c.1-.6.4-1.5 2.2-4 1.7-2.5 2.3-3.4 3.6-7.9v-.2l.7-2.7V7.5l.2-2.2.4-1.8a16.5 16.5 0 0 0 .1 33 32 32 0 0 1-.6-5.1s-.1-.3-.5-.3ZM219.8 11c0-1.4.3-2.9.9-4.2-2.7-2-6-3.3-9.7-3.4l.4 1.9.2 2.1V14l.7 2.8v.2c1.3 4.5 1.9 5.4 3.6 8 1.8 2.4 2 3.2 2.2 4l.1.7v.7l-.6.3-3 .3v-.2h-.2v.2h-1.1v-.2h-.2v.3H212c-.4 0-.5.3-.5.3 0 1.6-.3 3.8-.6 5.2 8.5 0 15.5-6.6 16.3-14.9a11.5 11.5 0 0 1-7.4-10.6Z" 54937 /> 54938 <path 54939 d="M231.6.6a10.4 10.4 0 1 0 0 20.9 10.4 10.4 0 0 0 0-20.9Zm4.3 17.6h-2a2.3 2.3 0 1 0-4.6 0h-2V4h2a2.3 2.3 0 1 0 4.5 0h2v14.3Z" 54940 style="fill:#d35162" 54941 /> 54942 </g> 54943 </svg> 54944 `; 54945 } 54946 }; 54947 var __defProp$1f = Object.defineProperty; 54948 var __getOwnPropDesc$1h = Object.getOwnPropertyDescriptor; 54949 var __decorateClass$1h = (decorators, target, key, kind) => { 54950 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1h(target, key) : target; 54951 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 54952 if (decorator = decorators[i2]) 54953 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 54954 if (kind && result) __defProp$1f(target, key, result); 54955 return result; 54956 }; 54957 const tagName$X = "sonic-brand-logo"; 54958 let SonicComponent$c = class SonicComponent extends Subscriber$1(i$6) { 54959 constructor() { 54960 super(...arguments); 54961 this.brand = {}; 54962 } 54963 render() { 54964 if (!this.brand.url || !this.brand.id) return A$1; 54965 return b$1`<sonic-link href=${this.brand.url} data-aria-label=${o$4(this.brand.url)} target="_blank" 54966 >${getBrandLogo(this.brand, { className: "w-full h-full" })} 54967 </sonic-link>`; 54968 } 54969 }; 54970 SonicComponent$c.styles = [ 54971 i$9` 54972 :host { 54973 display: block; 54974 } 54975 svg { 54976 display: block; 54977 width: 100%; 54978 } 54979 ` 54980 ]; 54981 __decorateClass$1h([ 54982 n$5({ type: Object }) 54983 ], SonicComponent$c.prototype, "brand", 2); 54984 SonicComponent$c = __decorateClass$1h([ 54985 t$3(tagName$X) 54986 ], SonicComponent$c); 54987 var __defProp$1e = Object.defineProperty; 54988 var __getOwnPropDesc$1g = Object.getOwnPropertyDescriptor; 54989 var __decorateClass$1g = (decorators, target, key, kind) => { 54990 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1g(target, key) : target; 54991 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 54992 if (decorator = decorators[i2]) 54993 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 54994 if (kind && result) __defProp$1e(target, key, result); 54995 return result; 54996 }; 54997 const tagName$W = "sonic-footer"; 54998 let SonicFooter = class extends Subscriber$1(i$6) { 54999 constructor() { 55000 super(...arguments); 55001 this.hideBottomMobile = false; 55002 this.modules = {}; 55003 this.infos = {}; 55004 this.is_online = false; 55005 this._displayCookiesButton = false; 55006 } 55007 connectedCallback() { 55008 if (!this.dataProvider) { 55009 this.dataProvider = "settings"; 55010 } 55011 this.setDisplayCookiesButton(); 55012 super.connectedCallback(); 55013 } 55014 setDisplayCookiesButton() { 55015 TrackingManager.getTrackingManager((trackingManager) => { 55016 this._displayCookiesButton = trackingManager.trackings.length > 0; 55017 }); 55018 } 55019 render() { 55020 const storeUrl = this.getAncestorAttributeValue("storeUrl") || ""; 55021 const phoneNumber = this.infos.address?.phone_number; 55022 let hrefPhoneNumber; 55023 if (phoneNumber) { 55024 hrefPhoneNumber = phoneNumber.replace(/[^+\d]+/g, ""); 55025 } 55026 return b$1`<div class="text-content"> 55027 <!-- Menu prefooter --> 55028 ${this.is_online !== false ? this.render_prefooter() : A$1} 55029 55030 <!-- Footer adresse --> 55031 <div 55032 class=" flex-wrap items-center gap-y-3 gap-x-6 justify-between mb-4 font-bold text-[.9rem] ${this.hideBottomMobile ? " hidden lg:flex" : "flex"}" 55033 >
55034 <span class="flex flex-wrap gap-x-3"> 55035 ${this.infos ? b$1`<span>${this.render_address()}</span>` : A$1} 55036 ${hrefPhoneNumber ? b$1`<span>â</span> 55037 <sonic-link 55038 href="tel:${hrefPhoneNumber}" 55039 class="hover:text-primary [&[active]]:underline underline-offset-2" 55040 > 55041 ${phoneNumber} 55042 </sonic-link>` : A$1} 55043 ${this.infos.website ? b$1`<span>â</span> 55044 <sonic-link 55045 href=${this.infos.website} 55046 target="_blank" 55047 class="hover:text-primary [&[active]]:underline underline-offset-2" 55048 > 55049 ${new URL(this.infos.website).host.replace("www.", "")} 55050 </sonic-link>` : A$1} 55051 </span> 55052 <span class="h-[var(--sc-border-width)] grow bg-current"></span> 55053 55054 <sonic-brand-logo class="w-[10rem] transition hover:scale-[.95]"></sonic-brand-logo> 55055 </div> 55056 55057 <!-- Menu Footer --> 55058 <div 55059 class=" flex-wrap gap-y-3 gap-x-6 lg:gap-x-14 text-[.8rem] ${this.hideBottomMobile ? " hidden lg:flex" : "flex"}" 55060 > 55061 ${this._displayCookiesButton ? b$1` 55062 <sonic-link href="#tarteaucitron" class="hover:text-primary [&[active]]:underline underline-offset-2"> 55063 ${t("LIB_gestion_des_cookies")} 55064 </sonic-link> 55065 ` : A$1} 55066 ${this.infos.legal_terms?.url ? b$1`<sonic-link 55067 href=${this.infos.legal_terms.url} 55068 target="_blank" 55069 class="hover:text-primary [&[active]]:underline underline-offset-2" 55070 > 55071 ${t("mentions_legales")} 55072 </sonic-link>` : A$1} 55073 ${this.infos.cgv_link ? b$1`<sonic-link 55074 href="${this.infos.cgv_link}" 55075 target="_blank" 55076 class="hover:text-primary [&[active]]:underline underline-offset-2" 55077 > 55078 ${t("cgv_de_la_billetterie")} 55079 </sonic-link>` : A$1} 55080 <sonic-link href="${storeUrl + "/user"}" class="hover:text-primary [&[active]]:underline underline-offset-2"> 55081 ${t("administration")} 55082 </sonic-link> 55083 </div> 55084 </div>`; 55085 } 55086 render_prefooter() { 55087 return b$1` <div 55088 class="flex flex-wrap flex-col lg:flex-row gap-y-4 gap-x-6 mb-[2rem] lg:grid lg:grid-cols-4 lg:mb-[2.5rem] " 55089 > 55090 <sonic-app-link to="store" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55091 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55092 <sonic-icon library="custom" prefix="regular" name="cart-shopping-fast" size="lg"></sonic-icon> 55093 <span class="pt-[.1em] inline-block text-pretty">${t("module_store_title")}</span> 55094 </div> 55095 </sonic-app-link> 55096 <sonic-app-link to="infosPrices" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55097 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55098 <sonic-icon library="custom" prefix="regular" name="circle-info" size="lg"></sonic-icon> 55099 <span class="pt-[.1em] inline-block text-pretty">${t("module_infos_title")}</span> 55100 </div> 55101 </sonic-app-link> 55102 ${this.modules.reelax?.access && this.modules.reelax?.url ? b$1`<sonic-button 55103 href=${this.modules.reelax?.url} 55104 variant="unstyled" 55105 class="[&[active]]:underline [&[active]]:text-primary underline-offset-2" 55106 > 55107 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55108 <sonic-icon library="custom" prefix="regular" name="ssks-reelax" size="lg"></sonic-icon> 55109 <span class="pt-[.1em] inline-block text-pretty">${t("module_reelax_title")}</span> 55110 </div> 55111 </sonic-button>` : A$1} 55112 ${this.modules.cashless?.access && this.modules.cashless?.url ? b$1`<sonic-button 55113 href=${this.modules.cashless?.url} 55114 variant="unstyled" 55115 class="[&[active]]:underline [&[active]]:text-primary underline-offset-2" 55116 > 55117 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55118 <sonic-icon library="custom" prefix="regular" name="mobile-signal-out" size="lg"></sonic-icon>
55119 <span class="pt-[.1em] inline-block text-pretty">${t("module_cashless_title")}</span> 55120 </div> 55121 </sonic-button>` : A$1} 55122 55123 <sonic-app-link to="orderRecover" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55124 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55125 <sonic-icon library="custom" prefix="regular" name="circle-question" size="lg"></sonic-icon> 55126 <span class="pt-[.1em] inline-block text-pretty">${t("module_order_recover_title")}</span> 55127 </div> 55128 </sonic-app-link> 55129 ${this.modules.promo?.enabled ? b$1` 55130 <sonic-app-link to="promo" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55131 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55132 <sonic-icon library="custom" prefix="regular" name="gift" size="lg"></sonic-icon> 55133 <span class="pt-[.1em] inline-block text-pretty">${t("module_promo_code_title")}</span> 55134 </div> 55135 </sonic-app-link> 55136 ` : A$1} 55137 ${this.modules.freeup_tickets?.enabled ? b$1` 55138 <sonic-app-link to="freeup" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55139 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55140 <sonic-icon library="custom" prefix="regular" name="hand-wave" size="lg"></sonic-icon> 55141 <span class="pt-[.1em] inline-block text-pretty">${t("free_up")}</span> 55142 </div> 55143 </sonic-app-link> 55144 ` : A$1} 55145 55146 <sonic-app-link to="reservationRequest" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55147 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55148 <sonic-icon library="custom" prefix="regular" name="file-heart" size="lg"></sonic-icon> 55149 <span class="pt-[.1em] inline-block text-pretty">${t("LIB_reservation_request_title")}</span> 55150 </div> 55151 </sonic-app-link> 55152 </div>`; 55153 } 55154 render_address() { 55155 return b$1`${this.infos.editor_name ? b$1` <span>${this.infos.editor_name}</span>` : A$1} 55156 ${this.infos.address?.street ? b$1`<span class="[&:first-child]:hidden"> - </span><span>${this.infos.address.street}</span>` : A$1} 55157 ${this.infos.address?.street_2 ? b$1`<span class="[&:first-child]:hidden"> - </span><span>${this.infos.address.street_2}</span>` : A$1} 55158 ${this.infos.address?.zip_code || this.infos.address?.city || this.infos.address?.country ? b$1`<span class="[&:first-child]:hidden"> - </span 55159 ><span>${this.infos.address?.zip_code} ${this.infos.address?.city} ${this.infos.address?.country}</span>` : A$1} `; 55160 } 55161 }; 55162 SonicFooter.styles = [ 55163 tailwind, 55164 i$9` 55165 :host { 55166 display: block; 55167 padding-top: 3.5rem; 55168 padding-bottom: 3.5rem; 55169 } 55170 ` 55171 ]; 55172 __decorateClass$1g([ 55173 n$5({ type: Boolean }) 55174 ], SonicFooter.prototype, "hideBottomMobile", 2); 55175 __decorateClass$1g([ 55176 n$5({ type: Object }) 55177 ], SonicFooter.prototype, "modules", 2); 55178 __decorateClass$1g([ 55179 n$5({ type: Object }) 55180 ], SonicFooter.prototype, "infos", 2); 55181 __decorateClass$1g([ 55182 n$5({ type: Boolean }) 55183 ], SonicFooter.prototype, "is_online", 2); 55184 __decorateClass$1g([ 55185 r$5() 55186 ], SonicFooter.prototype, "_displayCookiesButton", 2); 55187 SonicFooter = __decorateClass$1g([ 55188 t$3(tagName$W), 55189 awaitConnectedAncestors(APP_TAG_SELECTOR) 55190 ], SonicFooter); 55191 var __defProp$1d = Object.defineProperty; 55192 var __getOwnPropDesc$1f = Object.getOwnPropertyDescriptor; 55193 var __decorateClass$1f = (decorators, target, key, kind) => { 55194 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1f(target, key) : target; 55195 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55196 if (decorator = decorators[i2]) 55197 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55198 if (kind && result) __defProp$1d(target, key, result); 55199 return result; 55200 }; 55201 const tagName$V = "sonic-off-canvas"; 55202 let SonicOffCanvas = class extends Subscriber$1(i$6) { 55203 constructor() { 55204 super(...arguments); 55205 this.displayOffCanvas = false;
55206 this.logoSrc = ""; 55207 this.customAgendas = []; 55208 } 55209 async willUpdate(_changedProperties) { 55210 if (_changedProperties.has("settings")) { 55211 const hasCustomAgendas = this.settings?.modules?.custom_agendas?.access; 55212 this.customAgendas = hasCustomAgendas ? (await getAgendas(this, true)).filter((agenda) => agenda.isLinkEnabled === true) : []; 55213 } 55214 } 55215 handleRoutes() { 55216 if (!this.href_agenda) { 55217 this.href_agenda = appRoute("agenda").toString(); 55218 } 55219 if (!this.href_subscription) { 55220 this.href_subscription = appRoute("subscription").toString(); 55221 } 55222 if (!this.href_giftcards) { 55223 this.href_giftcards = appRoute("giftcards").toString(); 55224 } 55225 if (!this.href_shop) { 55226 this.href_shop = appRoute("shop").toString(); 55227 } 55228 if (!this.href_carpooling) { 55229 this.href_carpooling = appRoute("carpooling").toString(); 55230 } 55231 if (!this.href_accreditationsDirectory) { 55232 this.href_accreditationsDirectory = appRoute("accreditationsDirectory").toString(); 55233 } 55234 } 55235 updated(_changedProperties) { 55236 const wasHiddenBefore = _changedProperties.get("displayOffCanvas") !== true; 55237 if (this.displayOffCanvas && wasHiddenBefore) { 55238 if (this.firstMenuItem) { 55239 this.firstMenuItem?.focus({ preventScroll: true }); 55240 } 55241 } 55242 super.updated(_changedProperties); 55243 } 55244 connectedCallback() { 55245 super.connectedCallback(); 55246 this.addEventListener("keydown", this.handleKeyDown); 55247 } 55248 disconnectedCallback() { 55249 this.removeEventListener("keydown", this.handleKeyDown); 55250 super.disconnectedCallback(); 55251 } 55252 handleKeyDown(event) { 55253 if (event.key === "Escape") { 55254 dp("offCanvas").displayOffCanvas.set(false); 55255 } 55256 } 55257 render() { 55258 this.handleRoutes(); 55259 const { agenda, subscription, giftcards, carpooling, shop, accreditations_directory } = this.settings?.modules || {}; 55260 return b$1`<div 55261 class="${this.displayOffCanvas ? "" : "hidden"} fixed flex flex-col inset-0 px-cgx py-cgy bg-neutral-0 overflow-auto z-[980]" 55262 > 55263 <sonic-header closeOffCanvas></sonic-header> 55264 55265 <div class="grow flex flex-col items-start gap-4 lg:gap-5 mt-7 lg:mt-8 mb-[2rem]" id="off-canvas-menu"> 55266 ${this.href_agenda && agenda?.access ? this.renderMenuItem(this.href_agenda, "calendar-day", t("module_agenda_title")) : A$1} 55267 ${this.customAgendas?.length > 0 ? c$1( 55268 this.customAgendas, 55269 (agenda2) => agenda2.id, 55270 (agenda2) => this.renderMenuItem( 55271 appRoute("customAgenda").fill({ slug: agenda2.slug }).toString(), 55272 "calendar-star", 55273 agenda2.title || "" 55274 ) 55275 ) : A$1} 55276 ${this.href_subscription && subscription?.access ? this.renderMenuItem(this.href_subscription, "address-card", t("onglet_home_abonnements")) : A$1} 55277 ${this.href_giftcards && giftcards?.access ? this.renderMenuItem(this.href_giftcards, "gift-card", t("module_giftcards_title")) : A$1} 55278 ${this.href_shop && shop?.access ? this.renderMenuItem(this.href_shop, "bags-shopping", t("module_shop_title")) : A$1} 55279 ${this.href_accreditationsDirectory && accreditations_directory?.access ? this.renderMenuItem(this.href_accreditationsDirectory, "address-book", t("accreditations_directory_title")) : A$1} 55280 ${this.href_carpooling && carpooling?.access ? this.renderMenuItem(this.href_carpooling, "car-side", t("module_carpooling_title")) : A$1} 55281 </div> 55282 55283 <sonic-language-menu dataProvider="settings" class="mb-6"></sonic-language-menu> 55284 <sonic-footer class="p-0" hideBottomMobile dataProvider="settings"></sonic-footer> 55285 </div>`; 55286 } 55287 renderMenuItem(href, iconName, label2) { 55288 return b$1`<sonic-button variant="unstyled" class="main-menu-item" href=${href} data-aria-label=${label2} 55289 ><div class="items-start group inline-flex gap-x-[.3em]"> 55290 <sonic-icon 55291 library="custom" 55292 prefix="light" 55293 class=" group-hover:opacity-0 transition-scale duration-200 group-hover:scale-[1.1]" 55294 name=${iconName} 55295 ></sonic-icon> 55296 <sonic-icon 55297 library="custom" 55298 prefix="thin" 55299 class="group-hover:opacity-100 absolute opacity-0 transition-transform duration-100 55300 ease-[cubic-bezier(0.16,0.69,0.54,1.15)] group-hover:scale-[1.15]" 55301 name=${iconName} 55302 ></sonic-icon 55303 ><span class="font-headings font-weight-headings font-style-headings">${label2}</span> 55304 </div></sonic-button 55305 >`; 55306 } 55307 }; 55308 SonicOffCanvas.styles = [ 55309 tailwind, 55310 i$9` 55311 .main-menu-item { 55312 display: flex; 55313 align-items: center; 55314 gap: 0.6em; 55315 font-weight: bold; 55316 font-size: 1.8rem; 55317 } 55318 @media (min-width: 992px) { 55319 .main-menu-item { 55320 font-size: 2rem; 55321 } 55322 } 55323 @media (min-width: 1200px) { 55324 .main-menu-item { 55325 font-size: 2.5rem; 55326 } 55327 } 55328 .main-menu-item:hover { 55329 color: var(--sc-primary); 55330 } 55331 .main-menu-item[active] { 55332 color: var(--sc-primary); 55333 text-underline-offset: 0.2em; 55334 text-decoration: underline; 55335 } 55336 ` 55337 ]; 55338 __decorateClass$1f([ 55339 n$5({ type: Boolean }) 55340 ], SonicOffCanvas.prototype, "displayOffCanvas", 2); 55341 __decorateClass$1f([ 55342 n$5({ type: String }) 55343 ], SonicOffCanvas.prototype, "logoSrc", 2); 55344 __decorateClass$1f([ 55345 bind$1("settings"), 55346 n$5({ type: Object }) 55347 ], SonicOffCanvas.prototype, "settings", 2); 55348 __decorateClass$1f([ 55349 r$5() 55350 ], SonicOffCanvas.prototype, "customAgendas", 2); 55351 __decorateClass$1f([ 55352 e$7(".main-menu-item") 55353 ], SonicOffCanvas.prototype, "firstMenuItem", 2); 55354 SonicOffCanvas = __decorateClass$1f([ 55355 t$3(tagName$V), 55356 awaitConnectedAncestors(APP_TAG_SELECTOR) 55357 ], SonicOffCanvas);
55358 var __defProp$1c = Object.defineProperty; 55359 var __getOwnPropDesc$1e = Object.getOwnPropertyDescriptor; 55360 var __decorateClass$1e = (decorators, target, key, kind) => { 55361 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1e(target, key) : target; 55362 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55363 if (decorator = decorators[i2]) 55364 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55365 if (kind && result) __defProp$1c(target, key, result); 55366 return result; 55367 }; 55368 let SonicPriceListText = class extends Fetcher$1(Subscriber$1(i$6)) { 55369 constructor() { 55370 super(...arguments); 55371 this.customIconLibraryPath = "https://cdn.supersoniks.com/concorde/icons/fontawesome/v6/$prefix/$name.svg"; 55372 this.customIconDefaultPrefix = "regular"; 55373 } 55374 connectedCallback() { 55375 if (this.storeUrl) { 55376 const urlWithoutLastSlash = this.storeUrl.replace(/\/$/, ""); 55377 this.setAttribute("serviceUrl", urlWithoutLastSlash + "/api/v2"); 55378 this.setAttribute("wordingProvider", "translate"); 55379 this.setAttribute("customIconLibraryPath", this.customIconLibraryPath); 55380 this.setAttribute("customIconDefaultPrefix", this.customIconDefaultPrefix); 55381 } 55382 if (!this.fetch) { 55383 this.isFetchEnabled = false; 55384 } 55385 if (this.id) { 55386 this.dataProvider = `sessions/${this.id}?features[]=prices&features[]=quotas&features[]=places_categories`; 55387 this.key = "data"; 55388 } 55389 super.connectedCallback(); 55390 } 55391 willUpdate(changedProperties) { 55392 if (changedProperties.has("props") || changedProperties.has("filterByPriceLabels")) { 55393 if (this.filterByPriceLabels && this.filterByPriceLabels.length > 0) { 55394 this._pricesToRender = this.props?.prices?.filter((price) => { 55395 const normalizedTitle = this.normalizeString(price.title ?? "") ?? ""; 55396 const normalizedFilterByPriceLabels = this.filterByPriceLabels?.map( 55397 (label2) => this.normalizeString(label2 ?? "") 55398 ); 55399 return normalizedFilterByPriceLabels?.includes(normalizedTitle ?? ""); 55400 }) || []; 55401 } else { 55402 this._pricesToRender = this.props?.prices || []; 55403 } 55404 } 55405 super.willUpdate(changedProperties); 55406 } 55407 normalizeString(string) { 55408 return string.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/\s+/g, "").replace(/[^a-z0-9]/g, ""); 55409 } 55410 onSelectQuota(e2) { 55411 this.selectedQuota = e2.detail; 55412 } 55413 render() { 55414 const isExternalLink = this.storeUrl?.startsWith("http"); 55415 const slug = this.props?.slug || this.props?.id || this.id; 55416 const eventLink2 = `${this.storeUrl}?sonic_to=event(slug:${slug})&session=${this.id}`; 55417 const quotas = this.props?.quotas || []; 55418 return b$1` 55419 <sonic-event-quota-selector 55420 @selectQuota="${this.onSelectQuota}" 55421 display="tabs" 55422 .quotas=${quotas || []} 55423 ></sonic-event-quota-selector> 55424 55425 <sonic-price-list-info 55426 class=" my-5 block" 55427 .prices=${this._pricesToRender || []} 55428 .selectedQuota=${this.selectedQuota} 55429 class="block mb-3" 55430 > 55431 </sonic-price-list-info> 55432 ${eventLink2 ? b$1` 55433 <sonic-button 55434 href=${eventLink2} 55435 type="primary" 55436 target=${isExternalLink ? "_blank" : "_self"} 55437 noAutoFill 55438 variant="default" 55439 minWidth="18rem" 55440 > 55441 <sonic-icon library="custom" name="basket-shopping"></sonic-icon> 55442 Acheter en ligne 55443 </sonic-button> 55444 ` : A$1} 55445 `; 55446 } 55447 }; 55448 SonicPriceListText.styles = [tailwind]; 55449 __decorateClass$1e([ 55450 n$5({ type: String }) 55451 ], SonicPriceListText.prototype, "storeUrl", 2); 55452 __decorateClass$1e([ 55453 n$5({ type: String }) 55454 ], SonicPriceListText.prototype, "token", 2); 55455 __decorateClass$1e([ 55456 n$5({ type: String }) 55457 ], SonicPriceListText.prototype, "customIconLibraryPath", 2); 55458 __decorateClass$1e([ 55459 n$5({ type: String }) 55460 ], SonicPriceListText.prototype, "customIconDefaultPrefix", 2); 55461 __decorateClass$1e([ 55462 n$5({ type: Boolean }) 55463 ], SonicPriceListText.prototype, "fetch", 2); 55464 __decorateClass$1e([ 55465 r$5() 55466 ], SonicPriceListText.prototype, "selectedQuota", 2); 55467 __decorateClass$1e([ 55468 n$5({ type: Array }) 55469 ], SonicPriceListText.prototype, "filterByPriceLabels", 2); 55470 __decorateClass$1e([ 55471 r$5() 55472 ], SonicPriceListText.prototype, "_pricesToRender", 2); 55473 SonicPriceListText = __decorateClass$1e([ 55474 t$3("sonic-link-event-block") 55475 ], SonicPriceListText); 55476 var __defProp$1b = Object.defineProperty; 55477 var __getOwnPropDesc$1d = Object.getOwnPropertyDescriptor; 55478 var __decorateClass$1d = (decorators, target, key, kind) => { 55479 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1d(target, key) : target; 55480 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55481 if (decorator = decorators[i2]) 55482 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55483 if (kind && result) __defProp$1b(target, key, result); 55484 return result; 55485 }; 55486 const tagName$U = "sonic-jumbotron"; 55487 let SonicJumbotron = class extends i$6 { 55488 constructor() { 55489 super(...arguments); 55490 this.title = ""; 55491 this.home = false;
55492 } 55493 render() { 55494 let title; 55495 let text; 55496 if (this.home) { 55497 title = this.title || t("home_jumbotron_title"); 55498 text = t("home_jumbotron_text", true); 55499 } else { 55500 title = this.title; 55501 text = this.text || o$6(this.text); 55502 } 55503 if (!title && !this.text) { 55504 return A$1; 55505 } 55506 return b$1` <div class="shadow-[0_40px_50px_-70px_rgb(0_0_0_/_0.35)] pb-8 text-left max-w-[55rem] "> 55507 ${title ? b$1` <div 55508 class="font-headings font-weight-headings font-style-headings text-3xl lg:text-5xl text-balance leading-tighter mb-4" 55509 > 55510 ${title} 55511 </div>` : A$1} 55512 ${text ? b$1` <div class="text-lg lg:text-xl sonic-prose sonic-prose-condensed "> 55513 ${this.text ? o$6(this.text) : t("home_jumbotron_text", true)} 55514 </div>` : A$1} 55515 </div>`; 55516 } 55517 }; 55518 SonicJumbotron.styles = [ 55519 tailwind, 55520 sonicProse, 55521 i$9` 55522 :host { 55523 display: block; 55524 margin-left: calc(-1 * var(--sc-container-gutter-x)); 55525 margin-right: calc(-1 * var(--sc-container-gutter-x)); 55526 padding: 1rem var(--sc-container-gutter-x); 55527 } 55528 ` 55529 ]; 55530 __decorateClass$1d([ 55531 n$5({ type: String }) 55532 ], SonicJumbotron.prototype, "title", 2); 55533 __decorateClass$1d([ 55534 n$5({ type: String }) 55535 ], SonicJumbotron.prototype, "text", 2); 55536 __decorateClass$1d([ 55537 n$5({ type: Boolean }) 55538 ], SonicJumbotron.prototype, "home", 2); 55539 SonicJumbotron = __decorateClass$1d([ 55540 t$3(tagName$U) 55541 ], SonicJumbotron); 55542 var __defProp$1a = Object.defineProperty; 55543 var __getOwnPropDesc$1c = Object.getOwnPropertyDescriptor; 55544 var __decorateClass$1c = (decorators, target, key, kind) => { 55545 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1c(target, key) : target; 55546 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55547 if (decorator = decorators[i2]) 55548 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55549 if (kind && result) __defProp$1a(target, key, result); 55550 return result; 55551 }; 55552 let SonicEventCard$1 = class SonicEventCard extends Subscriber$1(i$6) { 55553 constructor() { 55554 super(...arguments); 55555 this.categories = []; 55556 this.labels = []; 55557 this.event_id = ""; 55558 this.slug = ""; 55559 this.multisession = null; 55560 this.skeleton = false; 55561 this.staticMode = false; 55562 } 55563 render() { 55564 if (this.skeleton) { 55565 return this.renderSkeleton(); 55566 } 55567 const id = this.props?.id; 55568 if (!id) return A$1; 55569 const isShowContext = this.props && "sessions" in this.props; 55570 const statusEndpoint = isShowContext ? `shows/${id}/status` : `sessions/${id}?features[]=status`; 55571 const statusKey = isShowContext ? void 0 : "data"; 55572 return b$1` 55573 <sonic-app-link to="event" .slug=${this.slug} class="group contents"> 55574 <div class="@container w-full h-full relative"> 55575 <div 55576 class="leading-tight h-full relative p-3 @sm:p-4 grid grid-cols-1 grid-rows-[max-content_1fr] gap-3 rounded-md border border-transparent group-hover:border group-hover:border-neutral-200 group-focus:border-neutral-300 transition duration-75 " 55577 > 55578 <sonic-product-illustration class="relative rounded-md overflow-hidden"></sonic-product-illustration> 55579 <div class="min-h-[6rem]"> 55580 <sonic-date 55581 weekday="short" 55582 day="2-digit" 55583 month="short" 55584 class="text-xs leading-tight block mb-2 uppercase" 55585 ></sonic-date> 55586 <div class="mb-3"> 55587 <sonic-product-title 55588 class="font-headings font-weight-headings font-style-headings @xs:text-xl @sm:text-2xl leading-tight @xs:leading-tight @sm:leading-tight @md:leading-tight" 55589 ></sonic-product-title> 55590 </div> 55591 55592 <div class="flex gap-1 flex-wrap items-center gap-x-2"> 55593 ${this.staticMode ? b$1`<sonic-event-additional-status 55594 size="xs" 55595 variant="ghost" 55596 warnAndDangerAsPill 55597 class="flex flex-wrap gap-x-3 gap-y-1" 55598 ></sonic-event-additional-status>` : b$1`<sonic-event-additional-status 55599 fetch 55600 dataProvider="${statusEndpoint}" 55601 key="${o$4(statusKey)}" 55602 size="xs" 55603 warnAndDangerAsPill 55604 variant="ghost" 55605 class="flex flex-wrap gap-x-3 gap-y-1" 55606 ></sonic-event-additional-status>`} 55607 55608 <sonic-event-scheduled-status size="xs"></sonic-event-scheduled-status> 55609 55610 <sonic-event-taxonomy .taxonomy=${this.labels} size="xs" key="label"></sonic-event-taxonomy> 55611 ${this.categories.length > 0 ? b$1` <sonic-event-taxonomy 55612 .icon=${{ name: "tag", library: "custom" }} 55613 .taxonomy=${this.categories} 55614 variant="ghost" 55615 key="category" 55616 size="xs" 55617 > 55618 </sonic-event-taxonomy>` : A$1} 55619 </div> 55620 </div> 55621 </div> 55622 </div> 55623 </sonic-app-link> 55624 `; 55625 } 55626 renderSkeleton() { 55627 return b$1` 55628 <div class="@container w-full h-full "> 55629 <div 55630 class="leading-tight p-3 @sm:p-4 grid grid-cols-1 gap-3 rounded-md @sm:rounded-lg border border-transparent" 55631 > 55632 <div class=" relative aspect-square rounded-lg bg-neutral-100 animate-pulse "></div> 55633 <div class="min-h-[6rem]"> 55634 <div class=" leading-none block mb-2 bg-neutral-50 rounded-sm h-4 w-1/2 "></div> 55635 <div class=" leading-none block mb-1 bg-neutral-100 rounded-sm h-5 w-2/3 "></div> 55636 <div class="text-xs leading-tight block bg-neutral-100 rounded-sm h-3 w-1/3"></div> 55637 </div> 55638 </div> 55639 </div> 55640 `; 55641 } 55642 }; 55643 SonicEventCard$1.styles = [ 55644 tailwind, 55645 i$9` 55646 :host { 55647 width: 100%; 55648 position: relative; 55649 display: block; 55650 } 55651 ` 55652 ]; 55653 __decorateClass$1c([ 55654 n$5({ type: Array }) 55655 ], SonicEventCard$1.prototype, "categories", 2); 55656 __decorateClass$1c([ 55657 n$5({ type: Array }) 55658 ], SonicEventCard$1.prototype, "labels", 2); 55659 __decorateClass$1c([ 55660 n$5({ type: String }) 55661 ], SonicEventCard$1.prototype, "event_id", 2); 55662 __decorateClass$1c([ 55663 n$5({ type: String }) 55664 ], SonicEventCard$1.prototype, "slug", 2); 55665 __decorateClass$1c([ 55666 n$5({ type: Object }) 55667 ], SonicEventCard$1.prototype, "multisession", 2); 55668 __decorateClass$1c([ 55669 n$5({ type: Boolean }) 55670 ], SonicEventCard$1.prototype, "skeleton", 2); 55671 __decorateClass$1c([ 55672 c({ context: staticMode }), 55673 r$5() 55674 ], SonicEventCard$1.prototype, "staticMode", 2); 55675 SonicEventCard$1 = __decorateClass$1c([ 55676 t$3("sonic-event-card-vertical") 55677 ], SonicEventCard$1); 55678 var __defProp$19 = Object.defineProperty; 55679 var __getOwnPropDesc$1b = Object.getOwnPropertyDescriptor; 55680 var __decorateClass$1b = (decorators, target, key, kind) => { 55681 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1b(target, key) : target; 55682 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55683 if (decorator = decorators[i2]) 55684 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55685 if (kind && result) __defProp$19(target, key, result); 55686 return result; 55687 }; 55688 let SonicEventCard = class extends Subscriber$1(i$6) { 55689 constructor() { 55690 super(...arguments); 55691 this.staticMode = false;
55692 this.id = ""; 55693 this.slug = ""; 55694 this.start_date = ""; 55695 this.illustration = ""; 55696 this.categories = []; 55697 this.labels = []; 55698 this.event_id = ""; 55699 this.multisession = null; 55700 this.skeleton = false; 55701 } 55702 render() { 55703 if (this.skeleton) { 55704 return this.renderSkeleton(); 55705 } 55706 if (!this.props?.id) return A$1; 55707 return b$1` 55708 <sonic-app-link to="event" .slug=${this.slug} variant="unstyled" class="contents "> 55709 <div 55710 class="sonic-event-card no-underline relative rounded-lg overflow-hidden @container group hover:scale-[103%] transition hover:shadow-xl" 55711 > 55712 <sonic-vertical-date 55713 class="py-4 inline-block text-contrast-content p-4 @sm:p-5 @md:p-6 absolute top-0 left-0 z-20 text-xs @sm:text-sm @md:text-base leading-none @sm:leading-none @md:leading-none" 55714 ></sonic-vertical-date> 55715 <sonic-product-illustration transition="fade-scale-out"></sonic-product-illustration> 55716 <div class="absolute z-20 bottom-0 text-contrast-content p-4 @xs:p-5 @sm:p-6 flex flex-col gap-1 @sm:gap-2"> 55717 <sonic-product-title 55718 class="font-headings font-weight-headings font-style-headings text-lg @xs:text-xl @sm:text-2xl @lg:text-3xl leading-tight @xs:leading-tight @sm:leading-tight @md:leading-tight @lg:leading-tight" 55719 ></sonic-product-title> 55720 55721 <div class="text-xs @md:text-sm flex flex-wrap gap-1 gap-x-2 items-center"> 55722 ${this.id ? b$1`<sonic-event-additional-status 55723 ?fetch=${!this.staticMode} 55724 dataProvider=${!this.staticMode ? `shows/${this.id}/status` : A$1} 55725 size="inherit" 55726 variant="default" 55727 class="flex flex-wrap gap-x-3 gap-y-1" 55728 ></sonic-event-additional-status>` : A$1} 55729 <sonic-event-scheduled-status variant="default" size="inherit"></sonic-event-scheduled-status> 55730 <sonic-event-taxonomy 55731 .taxonomy=${this.labels} 55732 key="label" 55733 size="inherit" 55734 class="block" 55735 ></sonic-event-taxonomy> 55736 55737 <sonic-event-taxonomy 55738 .icon=${{ 55739 library: "custom", 55740 prefix: "regular", 55741 name: "tag" 55742 }} 55743 .taxonomy=${this.categories} 55744 variant="ghost" 55745 contrast 55746 key="category" 55747 size="inherit" 55748 class="block" 55749 > 55750 </sonic-event-taxonomy> 55751 </div> 55752 </div> 55753 55754 <div class="absolute inset-0 z-10 bg-gradient-to-br from-[rgba(0,0,0,.25)] to-[rgba(0,0,0,0)]"></div> 55755 <div class="absolute inset-0 z-10 bg-gradient-to-t from-[rgba(0,0,0,.25)] to-[rgba(0,0,0,0)]"></div> 55756 </div> 55757 </sonic-app-link> 55758 `; 55759 } 55760 renderSkeleton() { 55761 return b$1`<div class="aspect-square bg-neutral-50 rounded-lg relative @container "> 55762 <div 55763 class="animate-pulse z-20 absolute top-4 @xs:top-5 @sm:top-6 left-4 @xs:left-5 @sm:left-6 rounded-md h-28 w-[5rem] bg-neutral-100" 55764 ></div> 55765 <div class="absolute z-20 bottom-0 text-contrast-content p-4 @xs:p-5 @sm:p-6 w-full "> 55766 <div class="animate-pulse leading-none block bg-neutral-100 rounded-sm h-10 w-2/3 mb-2"></div> 55767 <div class="animate-pulse text-xs leading-tight block bg-neutral-100 rounded-sm h-7 w-1/3 mb-4"></div> 55768 <div class="animate-pulse leading-none block mb-2 bg-neutral-100 rounded-sm h-5 w-1/2 "></div> 55769 </div> 55770 </div> `; 55771 } 55772 }; 55773 SonicEventCard.styles = [tailwind]; 55774 __decorateClass$1b([ 55775 c({ context: staticMode }), 55776 r$5() 55777 ], SonicEventCard.prototype, "staticMode", 2); 55778 __decorateClass$1b([ 55779 n$5({ type: String }) 55780 ], SonicEventCard.prototype, "id", 2); 55781 __decorateClass$1b([ 55782 n$5({ type: String }) 55783 ], SonicEventCard.prototype, "slug", 2); 55784 __decorateClass$1b([ 55785 n$5({ type: String }) 55786 ], SonicEventCard.prototype, "start_date", 2); 55787 __decorateClass$1b([ 55788 n$5({ type: String }) 55789 ], SonicEventCard.prototype, "illustration", 2); 55790 __decorateClass$1b([ 55791 n$5({ type: Array }) 55792 ], SonicEventCard.prototype, "categories", 2); 55793 __decorateClass$1b([ 55794 n$5({ type: Array }) 55795 ], SonicEventCard.prototype, "labels", 2); 55796 __decorateClass$1b([ 55797 n$5({ type: String }) 55798 ], SonicEventCard.prototype, "event_id", 2); 55799 __decorateClass$1b([ 55800 n$5({ type: Object }) 55801 ], SonicEventCard.prototype, "multisession", 2); 55802 __decorateClass$1b([ 55803 n$5({ type: Boolean }) 55804 ], SonicEventCard.prototype, "skeleton", 2); 55805 SonicEventCard = __decorateClass$1b([ 55806 t$3("sonic-event-card-cover") 55807 ], SonicEventCard); 55808 var __defProp$18 = Object.defineProperty; 55809 var __getOwnPropDesc$1a = Object.getOwnPropertyDescriptor; 55810 var __decorateClass$1a = (decorators, target, key, kind) => { 55811 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1a(target, key) : target; 55812 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55813 if (decorator = decorators[i2]) 55814 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55815 if (kind && result) __defProp$18(target, key, result); 55816 return result; 55817 }; 55818 const tagName$T = "sonic-related"; 55819 let SonicComponent$b = class SonicComponent extends Subscriber$1(i$6) { 55820 constructor() { 55821 super(...arguments); 55822 this.staticMode = false;
55823 } 55824 render() { 55825 if (!this.id || !this.relatedEnabled) return A$1; 55826 return b$1`<div class="@container"> 55827 ${t("related") ? b$1` <h2 class="flex items-center text-2xl lg:text-4xl font-bold mb-5 gap-3"> 55828 <span>${t("related")}</span> 55829 <span class="h-[var(--sc-border-width)] grow bg-content "></span> 55830 </h2>` : A$1} 55831 55832 <sonic-list 55833 fetch 55834 lazyload 55835 lazyBoundsRatio="0.2" 55836 dataprovider="shows/${this.id}/related?next=1&limit=4&view=essential" 55837 key="data" 55838 class="grid grid-cols-1 @xl:grid-cols-2 @6xl:grid-cols-4 gap-4" 55839 > 55840 <template data-value="skeleton"> 55841 <sonic-event-card-cover skeleton></sonic-event-card-cover> 55842 <sonic-event-card-cover skeleton></sonic-event-card-cover> 55843 <sonic-event-card-cover skeleton></sonic-event-card-cover> 55844 <sonic-event-card-cover skeleton></sonic-event-card-cover> 55845 </template> 55846 <template> 55847 <sonic-event-card-cover lazyrendering></sonic-event-card-cover> 55848 </template> 55849 </sonic-list> 55850 </div> `; 55851 } 55852 }; 55853 SonicComponent$b.styles = [ 55854 tailwind, 55855 i$9` 55856 :host { 55857 display: block; 55858 } 55859 ` 55860 ]; 55861 __decorateClass$1a([ 55862 bind$1("settings.modules.related_events.access"), 55863 r$5() 55864 ], SonicComponent$b.prototype, "relatedEnabled", 2); 55865 __decorateClass$1a([ 55866 e$2({ context: staticMode }) 55867 ], SonicComponent$b.prototype, "staticMode", 2); 55868 SonicComponent$b = __decorateClass$1a([ 55869 t$3(tagName$T) 55870 ], SonicComponent$b); 55871 const formTypeContext = n("formType"); 55872 var __defProp$17 = Object.defineProperty; 55873 var __getOwnPropDesc$19 = Object.getOwnPropertyDescriptor; 55874 var __decorateClass$19 = (decorators, target, key, kind) => { 55875 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$19(target, key) : target; 55876 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55877 if (decorator = decorators[i2]) 55878 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55879 if (kind && result) __defProp$17(target, key, result); 55880 return result; 55881 }; 55882 let SessionCard = class extends EventContext(Subscriber$1(i$6)) { 55883 constructor() { 55884 super(...arguments); 55885 this.expanded = false; 55886 this.alwaysExpanded = false; 55887 this.onlyHours = false; 55888 this.id = ""; 55889 this._metadata_ = {}; 55890 this.formType = "select"; 55891 this.formSize = "sm"; 55892 this.start_date = ""; 55893 this.edito = {}; 55894 this.site_link = ""; 55895 this.entity_type = EntityType.Event; 55896 this.initialized = false; 55897 } 55898 connectedCallback() { 55899 if (this.alwaysExpanded) this.expanded = true; 55900 super.connectedCallback(); 55901 } 55902 willUpdate(changedProperties) { 55903 if (this.entity_type === EntityType.Event && this.appType === "counter") { 55904 this.actions = [ 55905 ProductActionsEnum.EDIT, 55906 ProductActionsEnum.STATS, 55907 ProductActionsEnum.SALES, 55908 ProductActionsEnum.DIVIDER, 55909 ProductActionsEnum.PIN 55910 ]; 55911 } 55912 if (changedProperties.has("id") && !this.expanded && !this.initialized) { 55913 const urlParams = new URLSearchParams(window.location.search); 55914 const sessionIds = urlParams.get("session"); 55915 if (sessionIds) { 55916 const sessionIdsArray = sessionIds.split(","); 55917 const sessionId = this.id.toString(); 55918 if (sessionIdsArray.includes(sessionId)) { 55919 this.expanded = true; 55920 } 55921 } 55922 this.initialized = true; 55923 } 55924 if (changedProperties.has("_metadata_") && !this.alwaysExpanded) this.alwaysExpanded = !!this._metadata_?.onlyChild; 55925 super.willUpdate(changedProperties); 55926 } 55927 toggleExpanded() { 55928 if (this.alwaysExpanded) return; 55929 this.expanded = !this.expanded; 55930 } 55931 render() { 55932 let startDateHours; 55933 if (this.start_date) { 55934 const startDate = new Date(parseInt(this.start_date) * 1e3); 55935 const minutes = startDate.getMinutes(); 55936 startDateHours = startDate.getHours() + ":" + (minutes < 10 ? "0" : "") + minutes; 55937 } 55938 const displayActions = this.actions?.length; 55939 return b$1` 55940 <div class="@container"> 55941 <div 55942 @click="${this.toggleExpanded}" 55943 class="${this.alwaysExpanded ? "cursor-default" : "cursor-pointer"} relative p-5 hover:border-neutral-200 w-full rounded-lg border border-neutral-100 transition duration-100 flex flex-col ${this.expanded ? "shadow-lg" : ""}" 55944 > 55945 <slot name="prefix"></slot> 55946 <div class="flex justify-between items-center gap-2 "> 55947 <div class=" grid grid-cols-1 flex-grow gap-y-1 text-left"> 55948 ${this.onlyHours && startDateHours ? b$1`<span class="text-lg leading-tighter lg:text-xl font-bold">${startDateHours}</span>` : b$1`
55949 <sonic-date noshadowdom designMode class="font-bold capitalize text-lg leading-tighter lg:text-xl "> 55950 <template data-value="to"> 55951 <sonic-icon name="chevron-right" class="mx-2" library="custom"></sonic-icon> 55952 </template> 55953 <template data-value="hour"> 55954 <span class="font-normal text-[.8em]"></span> 55955 </template> 55956 <template data-value="minute"> 55957 <span class="font-normal text-[.8em]"></span> 55958 </template> 55959 <template data-value="literal"> 55960 <span class="font-normal text-[.8em]"></span> 55961 </template> 55962 </sonic-date> 55963 `} 55964 <div class="flex flex-wrap items-center gap-x-3 gap-y-[0.125em] leading-none text-xs"> 55965 <sonic-event-location-hall></sonic-event-location-hall> 55966 55967 ${this.staticMode ? b$1`<sonic-event-additional-status 55968 size="inherit" 55969 class="flex flex-wrap gap-x-3" 55970 ></sonic-event-additional-status>` : b$1`<sonic-event-additional-status 55971 fetch 55972 dataProvider=${`sessions/${this.id}?features[]=status`} 55973 size="inherit" 55974 class="flex flex-wrap gap-x-3" 55975 key="data" 55976 ></sonic-event-additional-status>`} 55977 55978 <sonic-event-scheduled-status size="xs"></sonic-event-scheduled-status> 55979 <sonic-event-taxonomies size="xs" class="contents"></sonic-event-taxonomies> 55980 <sonic-event-duration class="text-xs text-neutral-500"></sonic-event-duration> 55981 </div> 55982 <sonic-event-notes subDataProvider="settings" lineClamp class="text-xs "></sonic-event-notes> 55983 </div> 55984 55985 ${displayActions ? b$1`<div class=" -mr-2 flex items-center gap-2"> 55986 <sonic-product-publication subDataProvider="settings" class="text-lg"></sonic-product-publication> 55987 <sonic-product-actions 55988 .actions=${this.actions} 55989 @click=${(e2) => e2.stopPropagation()} 55990 size="sm" 55991 > 55992 </sonic-product-actions> 55993 </div>` : A$1} 55994 ${!this.alwaysExpanded && !displayActions ? b$1` 55995 <sonic-button 55996 ?active=${this.expanded} 55997 ?data-aria-expanded=${this.expanded} 55998 data-aria-controls="card-session-${this.id}" 55999 data-aria-label=${this.expanded ? "Fermer" : "Ouvrir"} 56000 icon 56001 shape="circle" 56002 variant="ghost" 56003 class="hidden @md:block -my-1 -mr-2" 56004 noAutoFill 56005 > 56006 <sonic-icon name="chevron-up" swap="on" library="custom"></sonic-icon> 56007 <sonic-icon name="chevron-down" swap="off" library="custom"></sonic-icon> 56008 </sonic-button> 56009 ` : A$1} 56010 </div> 56011 <div 56012 class="grid grid-cols-1 transition-all duration-[400ms] ${this.expanded || this.alwaysExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"}" 56013 id="card-session-${this.id}" 56014 ?inert=${!this.expanded && !this.alwaysExpanded} 56015 > 56016 <div class="${!this.alwaysExpanded ? "overflow-hidden" : ""}"> 56017 <div class="py-3"> 56018 ${this.edito?.body ? b$1`<div class="prose-sm mb-5 prose-tight">${o$6(this.edito?.body)}</div>` : A$1} 56019 ${this.site_link ? b$1` <sonic-event-site-link 56020 class="block text-sm mb-5 ${this.edito?.body ? "-mt-2" : ""}" 56021 tooltipPlacement="bottom-start" 56022 ></sonic-event-site-link>` : A$1} 56023 <!-- 56024 Actuellement en mode static on ne peut pas suppr le fetch 56025 la notion de placement disparait avec le clean_session_data 56026 ce qui change le rendu malgré la présence des autres données 56027 --> 56028 <sonic-fetch 56029 lazyload 56030 loader="inline" 56031 dataProvider="${entityEndPoint({ 56032 entityType: EntityType.Event,
56033 entityId: Number(this.id), 56034 accessParams: this.accessParams, 56035 view: entityView.full 56036 })}" 56037 key="data" 56038 @click=${(e2) => e2.stopPropagation()} 56039 > 56040 <sonic-buy-event-block 56041 size=${this.formSize} 56042 display=${this.formType} 56043 class="cursor-default" 56044 ></sonic-buy-event-block> 56045 </sonic-fetch> 56046 </div> 56047 </div> 56048 </div> 56049 </div> 56050 </div> 56051 `; 56052 } 56053 }; 56054 SessionCard.styles = [tailwind]; 56055 __decorateClass$19([ 56056 n$5({ type: Boolean }) 56057 ], SessionCard.prototype, "expanded", 2); 56058 __decorateClass$19([ 56059 n$5({ type: Boolean }) 56060 ], SessionCard.prototype, "alwaysExpanded", 2); 56061 __decorateClass$19([ 56062 n$5({ type: Boolean }) 56063 ], SessionCard.prototype, "onlyHours", 2); 56064 __decorateClass$19([ 56065 n$5({ type: String }) 56066 ], SessionCard.prototype, "id", 2); 56067 __decorateClass$19([ 56068 n$5({ type: Object }) 56069 ], SessionCard.prototype, "_metadata_", 2); 56070 __decorateClass$19([ 56071 c({ context: formTypeContext, subscribe: true }), 56072 n$5({ type: String }) 56073 ], SessionCard.prototype, "formType", 2); 56074 __decorateClass$19([ 56075 n$5({ type: String }) 56076 ], SessionCard.prototype, "formSize", 2); 56077 __decorateClass$19([ 56078 n$5({ type: String }) 56079 ], SessionCard.prototype, "start_date", 2); 56080 __decorateClass$19([ 56081 n$5({ type: Object }) 56082 ], SessionCard.prototype, "edito", 2); 56083 __decorateClass$19([ 56084 n$5({ type: String }) 56085 ], SessionCard.prototype, "site_link", 2); 56086 __decorateClass$19([ 56087 c({ context: appType, subscribe: true }) 56088 ], SessionCard.prototype, "appType", 2); 56089 __decorateClass$19([ 56090 n$5({ type: String }) 56091 ], SessionCard.prototype, "entity_type", 2); 56092 __decorateClass$19([ 56093 n$5({ type: Array }) 56094 ], SessionCard.prototype, "actions", 2); 56095 __decorateClass$19([ 56096 c({ context: staticMode }), 56097 r$5() 56098 ], SessionCard.prototype, "staticMode", 2); 56099 __decorateClass$19([ 56100 c({ context: accessParamsContext, subscribe: true }), 56101 r$5() 56102 ], SessionCard.prototype, "accessParams", 2); 56103 SessionCard = __decorateClass$19([ 56104 t$3("sonic-event-session-card") 56105 ], SessionCard); 56106 var __defProp$16 = Object.defineProperty, __getOwnPropSymbols = Object.getOwnPropertySymbols, __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable, __defNormalProp = (e2, t2, a2) => t2 in e2 ? __defProp$16(e2, t2, { enumerable: true, configurable: true, writable: true, value: a2 }) : e2[t2] = a2, __spreadValues = (e2, t2) => { 56107 for (var a2 in t2 || (t2 = {})) __hasOwnProp.call(t2, a2) && __defNormalProp(e2, a2, t2[a2]); 56108 if (__getOwnPropSymbols) for (var a2 of __getOwnPropSymbols(t2)) __propIsEnum.call(t2, a2) && __defNormalProp(e2, a2, t2[a2]); 56109 return e2; 56110 }, __publicField = (e2, t2, a2) => (__defNormalProp(e2, "symbol" != typeof t2 ? t2 + "" : t2, a2), a2); 56111 const classes = { calendar: "vanilla-calendar", calendarDefault: "vanilla-calendar_default", calendarMultiple: "vanilla-calendar_multiple", calendarMonth: "vanilla-calendar_month", calendarYear: "vanilla-calendar_year", calendarHidden: "vanilla-calendar_hidden", calendarToInput: "vanilla-calendar_to-input", calendarToInputTop: "vanilla-calendar_to-input_top", calendarToInputBottom: "vanilla-calendar_to-input_bottom", controls: "vanilla-calendar-controls", grid: "vanilla-calendar-grid", gridDisabled: "vanilla-calendar-grid_disabled", column: "vanilla-calendar-column", columnMonth: "vanilla-calendar-column_month", columnYear: "vanilla-calendar-column_year", header: "vanilla-calendar-header", headerContent: "vanilla-calendar-header__content", month: "vanilla-calendar-month", monthDisabled: "vanilla-calendar-month_disabled", year: "vanilla-calendar-year", yearDisabled: "vanilla-calendar-year_disabled", arrow: "vanilla-calendar-arrow", arrowPrev: "vanilla-calendar-arrow_prev", arrowNext: "vanilla-calendar-arrow_next", wrapper: "vanilla-calendar-wrapper", content: "vanilla-calendar-content", week: "vanilla-calendar-week", weekDay: "vanilla-calendar-week__day", weekDayWeekend: "vanilla-calendar-week__day_weekend", days: "vanilla-calendar-days", daysSelecting: "vanilla-calendar-days_selecting", months: "vanilla-calendar-months", monthsSelecting: "vanilla-calendar-months_selecting", monthsMonth: "vanilla-calendar-months__month", monthsMonthSelected: "vanilla-calendar-months__month_selected", monthsMonthDisabled: "vanilla-calendar-months__month_disabled", years: "vanilla-calendar-years", yearsSelecting: "vanilla-calendar-years_selecting", yearsYear: "vanilla-calendar-years__year", yearsYearSelected: "vanilla-calendar-years__year_selected", yearsYearDisabled: "vanilla-calendar-years__year_disabled", time: "vanilla-calendar-time", timeContent: "vanilla-calendar-time__content", timeHours: "vanilla-calendar-time__hours", timeMinutes: "vanilla-calendar-time__minutes", timeKeeping: "vanilla-calendar-time__keeping", timeRanges: "vanilla-calendar-time__ranges", timeRange: "vanilla-calendar-time__range", day: "vanilla-calendar-day", dayHoverFirst: "vanilla-calendar-day_hover-first", dayHoverLast: "vanilla-calendar-day_hover-last", dayHoverIntermediate: "vanilla-calendar-day_hover-intermediate", daySelectedFirst: "vanilla-calendar-day_selected-first", daySelectedLast: "vanilla-calendar-day_selected-last", daySelectedIntermediate: "vanilla-calendar-day_selected-intermediate", dayPopup: "vanilla-calendar-day__popup", dayBtn: "vanilla-calendar-day__btn", dayBtnPrev: "vanilla-calendar-day__btn_prev", dayBtnNext: "vanilla-calendar-day__btn_next", dayBtnToday: "vanilla-calendar-day__btn_today", dayBtnSelected: "vanilla-calendar-day__btn_selected", dayBtnHover: "vanilla-calendar-day__btn_hover", dayBtnDisabled: "vanilla-calendar-day__btn_disabled", dayBtnWeekend: "vanilla-calendar-day__btn_weekend", dayBtnHoliday: "vanilla-calendar-day__btn_holiday", weekNumbers: "vanilla-calendar-week-numbers", weekNumbersTitle: "vanilla-calendar-week-numbers__title", weekNumbersContent: "vanilla-calendar-week-numbers__content", weekNumber: "vanilla-calendar-week-number", isFocus: "vanilla-calendar-is-focus" }, DOMMultiple = (e2) => `<div class="${e2.controls}"><#ArrowPrev /><#ArrowNext /></div><div class="${e2.grid}"><#Multiple><div class="${e2.column}"><div class="${e2.header}"><div class="${e2.headerContent}"><#Month /><#Year /></div></div><div class="${e2.wrapper}"><#WeekNumbers /><div class="${e2.content}"><#Week /><#Days /></div></div></div><#/Multiple></div><#ControlTime />`, DOMMonths = (e2) => `<div class="${e2.header}"><div class="${e2.headerContent}"><#Month /><#Year /></div></div><div class="${e2.wrapper}"><div class="${e2.content}"><#Months /></div></div>`, DOMYears = (e2) => `<div class="${e2.header}"><#ArrowPrev /><div class="${e2.headerContent}"><#Month /><#Year /></div><#ArrowNext /></div><div class="${e2.wrapper}"><div class="${e2.content}"><#Years /></div></div>`; 56112 class DefaultOptionsCalendar { 56113 constructor() { 56114 var e2; 56115 __publicField(this, "isInit", false), __publicField(this, "input", false), __publicField(this, "type", "default"), __publicField(this, "months", 2), __publicField(this, "jumpMonths", 1), __publicField(this, "date", { min: "1970-01-01", max: "2470-12-31", today: /* @__PURE__ */ new Date() }), __publicField(this, "settings", { lang: "en", iso8601: true, range: { min: this.date.min, max: this.date.max, disablePast: false, disableGaps: false, disableAllDays: false, disableWeekday: void 0, disabled: void 0, enabled: void 0 }, selection: { day: "single", month: true, year: true, time: false, controlTime: "all", stepHours: 1, stepMinutes: 1, cancelableDay: true }, selected: { dates: void 0, month: void 0, year: void 0, holidays: void 0, time: void 0 }, visibility: { theme: "system", themeDetect: "html[data-theme]", monthShort: true, weekNumbers: false, weekend: true, today: true, disabled: false, daysOutside: true, positionToInput: "left" } }), __publicField(this, "locale", { months: [], weekday: [] }), __publicField(this, "actions", { clickDay: null, clickWeekNumber: null, clickMonth: null, clickYear: null, clickArrow: null, changeTime: null, changeToInput
56115: null, getDays: null, getMonths: null, getYears: null, initCalendar: null, updateCalendar: null, destroyCalendar: null, showCalendar: null, hideCalendar: null }), __publicField(this, "popups", {}), __publicField(this, "CSSClasses", __spreadValues({}, classes)), __publicField(this, "DOMTemplates", { default: (e2 = this.CSSClasses, `<div class="${e2.header}"><#ArrowPrev /><div class="${e2.headerContent}"><#Month /><#Year /></div><#ArrowNext /></div><div class="${e2.wrapper}"><#WeekNumbers /><div class="${e2.content}"><#Week /><#Days /></div></div><#ControlTime />`), multiple: DOMMultiple(this.CSSClasses), month: DOMMonths(this.CSSClasses), year: DOMYears(this.CSSClasses) }), __publicField(this, "HTMLElement"), __publicField(this, "HTMLOriginalElement"), __publicField(this, "HTMLInputElement"), __publicField(this, "rangeMin"), __publicField(this, "rangeMax"), __publicField(this, "rangeDisabled"), __publicField(this, "rangeEnabled"), __publicField(this, "selectedDates"), __publicField(this, "selectedHolidays"), __publicField(this, "selectedMonth"), __publicField(this, "selectedYear"), __publicField(this, "selectedHours"), __publicField(this, "selectedMinutes"), __publicField(this, "selectedKeeping"), __publicField(this, "selectedTime"), __publicField(this, "currentType"), __publicField(this, "correctMonths"), __publicField(this, "viewYear"), __publicField(this, "dateMin"), __publicField(this, "dateMax"); 56116 } 56117 } 56118 const getDateString = (e2) => `${e2.getFullYear()}-${String(e2.getMonth() + 1).padStart(2, "0")}-${String(e2.getDate()).padStart(2, "0")}`, getDate = (e2) => /* @__PURE__ */ new Date(`${e2}T00:00:00`), parseDates = (e2) => e2.reduce(((e3, t2) => (t2.match(/^(\d{4}-\d{2}-\d{2})$/g) ? e3.push(t2) : t2.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g, ((t3, a2, n2) => { 56119 const s2 = getDate(a2), l2 = getDate(n2), r2 = new Date(s2.getTime()); 56120 for (; r2 <= l2; r2.setDate(r2.getDate() + 1)) e3.push(getDateString(r2)); 56121 return t3; 56122 })), e3)), []), transformTime12 = (e2) => e2 ? { 0: "12", 13: "01", 14: "02", 15: "03", 16: "04", 17: "05", 18: "06", 19: "07", 20: "08", 21: "09", 22: "10", 23: "11" }[Number(e2)] || String(e2) : "", messages = { notFoundSelector: (e2) => `${e2} is not found, check the first argument passed to new VanillaCalendar.`, notInit: 'The calendar has not been initialized, please initialize it using the "init()" method first.', notLocale: 'You specified "define" for "settings.lang" but did not provide the required values for "locale.weekday" or "locale.months".', incorrectTheme: 'Incorrect name of theme in "settings.visibility.theme".', incorrectTime: "The value of the time property can be: false, true, 12 or 24." }, initSelectedMonthYear = (e2) => { 56123 const t2 = void 0 !== e2.settings.selected.month && Number(e2.settings.selected.month) >= 0 && Number(e2.settings.selected.month) < 12, a2 = void 0 !== e2.settings.selected.year && Number(e2.settings.selected.year) >= 0 && Number(e2.settings.selected.year) <= 9999; 56124 e2.selectedMonth = t2 ? Number(e2.settings.selected.month) : e2.date.today.getMonth(), e2.selectedYear = a2 ? Number(e2.settings.selected.year) : e2.date.today.getFullYear(), e2.viewYear = e2.selectedYear; 56125 }, initRange = (e2) => { 56126 var t2, a2, n2; 56127 e2.settings.range.min = getDate(e2.date.min) >= getDate(e2.settings.range.min) ? e2.date.min : e2.settings.range.min, e2.settings.range.max = getDate(e2.date.max) <= getDate(e2.settings.range.max) ? e2.date.max : e2.settings.range.max; 56128 const s2 = e2.settings.range.disablePast && !e2.settings.range.disableAllDays && getDate(e2.settings.range.min) < e2.date.today; 56129 e2.rangeMin = s2 || e2.settings.range.disableAllDays ? getDateString(e2.date.today) : e2.settings.range.min, e2.rangeMax = e2.settings.range.disableAllDays ? getDateString(e2.date.today) : e2.settings.range.max, e2.rangeDisabled = e2.settings.range.disabled && !e2.settings.range.disableAllDays ? parseDates(e2.settings.range.disabled) : e2.settings.range.disableAllDays ? [e2.rangeMin] : [], e2.rangeDisabled.length > 1 && e2.rangeDisabled.sort(((e3, t3) => +new Date(e3) - +new Date(t3))), e2.rangeEnabled = e2.settings.range.enabled ? parseDates(e2.settings.range.enabled) : [], (null == (t2 = e2.rangeEnabled) ? void 0 : t2[0]) && (null == (a2 = e2.rangeDisabled) ? void 0 : a2[0]) && (e2.rangeDisabled = e2.rangeDisabled.filter(((t3) => !e2.rangeEnabled.includes(t3)))), e2.rangeEnabled.length > 1 && e2.rangeEnabled.sort(((e3, t3) => +new Date(e3) - +new Date(t3))), (null == (n2 = e2.rangeEnabled) ? void 0 : n2[0]) && e2.settings.range.disableAllDays && (e2.rangeMin = e2.rangeEnabled[0], e2.rangeMax = e2.rangeEnabled[e2.rangeEnabled.length - 1]); 56130 }, initSelectedDates = (e2) => { 56131 var t2, a2; 56132 e2.selectedDates = (null == (t2 = e2.settings.selected.dates) ? void 0 : t2[0]) ? parseDates(e2.settings.selected.dates) : [], e2.selectedHolidays = (null == (a2 = e2.settings.selected.holidays) ? void 0 : a2[0]) ? parseDates(e2.settings.selected.holidays) : []; 56133 }, initDateMinMax = (e2) => {
56134 e2.dateMin = e2.settings.visibility.disabled ? getDate(e2.date.min) : getDate(e2.rangeMin), e2.dateMax = e2.settings.visibility.disabled ? getDate(e2.date.max) : getDate(e2.rangeMax); 56135 }, initTime = (e2) => { 56136 const t2 = true === e2.settings.selection.time || 12 === e2.settings.selection.time; 56137 if (t2 || 24 === e2.settings.selection.time) { 56138 let a2 = false; 56139 if ("string" == typeof e2.settings.selected.time) { 56140 const n2 = t2 ? /^([0-9]|0[1-9]|1[0-2]):([0-5][0-9])|(AM|PM)/g : /^([0-1]?[0-9]|2[0-3]):([0-5][0-9])/g; 56141 e2.settings.selected.time.replace(n2, ((n3, s2, l2, r2) => (s2 && l2 && (a2 = true, e2.selectedHours = s2, e2.selectedMinutes = l2), r2 && t2 ? e2.selectedKeeping = r2 : t2 && (e2.selectedKeeping = "AM"), ""))); 56142 } 56143 !a2 && t2 ? (e2.selectedHours = transformTime12(String(e2.date.today.getHours())), e2.selectedMinutes = String(e2.date.today.getMinutes()), e2.selectedKeeping = Number(e2.date.today.getHours()) >= 12 ? "PM" : "AM") : a2 || (e2.selectedHours = String(e2.date.today.getHours()), e2.selectedMinutes = String(e2.date.today.getMinutes())), e2.selectedHours = Number(e2.selectedHours) < 10 ? `0${Number(e2.selectedHours)}` : `${e2.selectedHours}`, e2.selectedMinutes = Number(e2.selectedMinutes) < 10 ? `0${Number(e2.selectedMinutes)}` : `${e2.selectedMinutes}`, e2.selectedTime = `${e2.selectedHours}:${e2.selectedMinutes}${e2.selectedKeeping ? ` ${e2.selectedKeeping}` : ""}`; 56144 } else if (e2.settings.selection.time) throw new Error(messages.incorrectTime); 56145 }, initCorrectMonths = (e2) => { 56146 e2.correctMonths = "multiple" === e2.type ? 1 === e2.months ? 2 : e2.months > 12 ? 12 : e2.months : 1; 56147 }, setVariables = (e2) => { 56148 e2.currentType = e2.type, initSelectedMonthYear(e2), initRange(e2), initSelectedDates(e2), initDateMinMax(e2), initTime(e2), initCorrectMonths(e2); 56149 }, setVisibilityArrows = ({ arrowPrev: e2, arrowNext: t2, isPrevHidden: a2, isNextHidden: n2 }) => { 56150 e2.style.visibility = a2 ? "hidden" : "", t2.style.visibility = n2 ? "hidden" : ""; 56151 }, visibilityArrows = (e2) => { 56152 var t2, a2; 56153 if ("month" === e2.currentType) return; 56154 const n2 = null == (t2 = e2.HTMLElement) ? void 0 : t2.querySelector(`.${e2.CSSClasses.arrowPrev}`), s2 = null == (a2 = e2.HTMLElement) ? void 0 : a2.querySelector(`.${e2.CSSClasses.arrowNext}`); 56155 if (!n2 || !s2) return; 56156 ({ default: () => { 56157 const t3 = getDate(getDateString(new Date(e2.selectedYear, e2.selectedMonth, 1))), a3 = new Date(t3.getTime()), l2 = new Date(t3.getTime()); 56158 a3.setMonth(a3.getMonth() - e2.jumpMonths), l2.setMonth(l2.getMonth() + e2.jumpMonths), e2.settings.selection.year || (e2.dateMin.setFullYear(t3.getFullYear()), e2.dateMax.setFullYear(t3.getFullYear())); 56159 const r2 = !e2.settings.selection.month || a3.getFullYear() < e2.dateMin.getFullYear() || a3.getFullYear() === e2.dateMin.getFullYear() && a3.getMonth() < e2.dateMin.getMonth(), i2 = !e2.settings.selection.month || l2.getFullYear() > e2.dateMax.getFullYear() || l2.getFullYear() === e2.dateMax.getFullYear() && l2.getMonth() > e2.dateMax.getMonth(); 56160 setVisibilityArrows({ arrowPrev: n2, arrowNext: s2, isPrevHidden: r2, isNextHidden: i2 }); 56161 }, year: () => { 56162 setVisibilityArrows({ arrowPrev: n2, arrowNext: s2, isPrevHidden: e2.dateMin.getFullYear() && e2.viewYear - 7 <= e2.dateMin.getFullYear(), isNextHidden: e2.dateMax.getFullYear() && e2.viewYear + 7 >= e2.dateMax.getFullYear() }); 56163 } })["multiple" === e2.currentType ? "default" : e2.currentType](); 56164 }, getWeekNumber = (e2, t2) => { 56165 if (!e2) return null; 56166 const a2 = getDate(e2), n2 = t2 ? a2.getDay() || 7 : a2.getDay(); 56167 a2.setDate(a2.getDate() + 4 - n2); 56168 const s2 = new Date(a2.getFullYear(), 0, 1), l2 = Math.ceil(((+a2 - +s2) / 864e5 + 1) / 7); 56169 return { year: a2.getFullYear(), week: l2 }; 56170 }, handleDay = (e2, t2, a2, n2) => { 56171 const s2 = a2.querySelector(`[data-calendar-day="${e2}"]`); 56172 s2 && ((null == t2 ? void 0 : t2.modifier) && s2.classList.add(...t2.modifier.trim().split(" ")), (null == t2 ? void 0 : t2.html) && (s2.parentElement.innerHTML += `<div class="${n2}">${t2.html}</div>`)); 56173 }, createPopup = (e2, t2) => { 56174 var a2; 56175 e2.popups && (null == (a2 = Object.entries(e2.popups)) || a2.forEach((([a3, n2]) =>
56175 handleDay(a3, n2, t2, e2.CSSClasses.dayPopup)))); 56176 }, createWeekNumber = (e2, t2, a2, n2, s2) => { 56177 const l2 = t2[a2].querySelector(`.${e2.CSSClasses.dayBtn}`), r2 = getWeekNumber(null == l2 ? void 0 : l2.dataset.calendarDay, e2.settings.iso8601); 56178 if (!r2) return; 56179 const i2 = n2.cloneNode(true); 56180 i2.innerText = String(r2.week), i2.dataset.calendarYearWeek = String(r2.year), s2.append(i2); 56181 }, createWeekNumbers = (e2, t2, a2, n2, s2) => { 56182 if (!e2.settings.visibility.weekNumbers) return; 56183 n2.innerHTML = ""; 56184 const l2 = document.createElement("b"); 56185 l2.className = e2.CSSClasses.weekNumbersTitle, l2.innerText = "#", n2.append(l2); 56186 const r2 = document.createElement("div"); 56187 r2.className = e2.CSSClasses.weekNumbersContent, n2.append(r2); 56188 const i2 = document.createElement("button"); 56189 i2.type = "button", i2.className = e2.CSSClasses.weekNumber; 56190 const d2 = s2.querySelectorAll(`.${e2.CSSClasses.day}`), c2 = Math.ceil((t2 + a2) / 7); 56191 for (let t3 = 0; t3 < c2; t3++) createWeekNumber(e2, d2, 0 === t3 ? 6 : 7 * t3, i2, r2); 56192 }, setDisabledDays = (e2, t2, a2) => { 56193 var n2, s2, l2, r2, i2; 56194 const d2 = null == (n2 = e2.settings.range.disableWeekday) ? void 0 : n2.includes(a2), c2 = e2.settings.range.disableAllDays && !!(null == (s2 = e2.rangeEnabled) ? void 0 : s2[0]); 56195 !d2 && !c2 || (null == (l2 = e2.rangeEnabled) ? void 0 : l2.includes(t2)) || (null == (r2 = e2.rangeDisabled) ? void 0 : r2.includes(t2)) || (e2.rangeDisabled.push(t2), null == (i2 = e2.rangeDisabled) || i2.sort(((e3, t3) => +new Date(e3) - +new Date(t3)))); 56196 }, setDayModifier = (e2, t2, a2, n2, s2, l2, r2) => { 56197 var i2, d2, c2; 56198 (getDate(e2.rangeMin) > getDate(l2) || getDate(e2.rangeMax) < getDate(l2) || (null == (i2 = e2.rangeDisabled) ? void 0 : i2.includes(l2)) || !e2.settings.selection.month && r2 || !e2.settings.selection.year && getDate(l2).getFullYear() !== t2) && (n2.classList.add(e2.CSSClasses.dayBtnDisabled), n2.tabIndex = -1), e2.settings.visibility.today && getDateString(e2.date.today) === l2 && n2.classList.add(e2.CSSClasses.dayBtnToday), !e2.settings.visibility.weekend || 0 !== s2 && 6 !== s2 || n2.classList.add(e2.CSSClasses.dayBtnWeekend), (null == (d2 = e2.selectedHolidays) ? void 0 : d2.includes(l2)) && n2.classList.add(e2.CSSClasses.dayBtnHoliday), (null == (c2 = e2.selectedDates) ? void 0 : c2.includes(l2)) && (n2.classList.add(e2.CSSClasses.dayBtnSelected), e2.selectedDates.length > 1 && "multiple-ranged" === e2.settings.selection.day && (e2.selectedDates[0] === l2 && a2.classList.add(e2.CSSClasses.daySelectedFirst), e2.selectedDates[e2.selectedDates.length - 1] === l2 && a2.classList.add(e2.CSSClasses.daySelectedLast), e2.selectedDates[0] !== l2 && e2.selectedDates[e2.selectedDates.length - 1] !== l2 && a2.classList.add(e2.CSSClasses.daySelectedIntermediate))); 56199 }, createDay = (e2, t2, a2, n2, s2, l2, r2, i2) => { 56200 const d2 = document.createElement("div"); 56201 d2.className = e2.CSSClasses.day; 56202 const c2 = document.createElement("button"); 56203 c2.className = `${e2.CSSClasses.dayBtn}${i2 ? ` ${i2}` : ""}`, c2.type = "button", c2.innerText = String(n2), c2.dataset.calendarDay = l2; 56204 e2.settings.visibility.weekNumbers && (() => { 56205 const t3 = getWeekNumber(l2, e2.settings.iso8601); 56206 t3 && (c2.dataset.calendarWeekNumber = String(t3.week)); 56207 })(), r2 ? e2.settings.visibility.daysOutside && d2.append(c2) : d2.append(c2), setDisabledDays(e2, l2, s2), setDayModifier(e2, t2, d2, c2, s2, l2, r2), a2.append(d2), e2.actions.getDays && e2.actions.getDays(n2, l2, d2, c2, e2); 56208 }, prevMonth = (e2, t2, a2, n2, s2) => { 56209 let l2 = new Date(a2, n2, 0).getDate() - (s2 - 1); 56210 const r2 = 0 === n2 ? a2 - 1 : a2, i2 = 0 === n2 ? 12 : n2 < 10 ? `0${n2}` : n2; 56211 for (let n3 = s2; n3 > 0; n3--, l2++) { 56212 const n4 = `${r2}-${i2}-${l2}`, s3 = getDate(n4).getDay(); 56213 createDay(e2, a2, t2, l2, s3, n4, true, e2.CSSClasses.dayBtnPrev); 56214 } 56215 }, currentMonth = (e2, t2, a2, n2, s2) => { 56216 for (let l2 = 1; l2 <= a2; l2++) { 56217 const a3 = new Date(n2, s2, l2), r2 = getDateString(a3), i2 = a3.getDay(); 56218 createDay(e2, n2, t2, l2, i2, r2, false, null); 56219 } 56220 }, nextMonth = (e2, t2, a2, n2, s2, l2) => { 56221 const r2 = l2 + a2, i2 = 7 * Math.ceil(r2 / 7) - r2, d2 = s2 + 1 === 12 ? n2 + 1 : n2, c2 = s2 + 1 === 12 ? "01" : s2 + 2 < 10 ? `0${s2 + 2}` : s2 + 2; 56222 for (let a3 = 1; a3 <= i2; a3++) { 56223 const s3 = `${d2}-${c2}-${a3 < 10 ? `0${a3}` : String(a3)}`, l3 = getDate(s3).getDay();
56224 createDay(e2, n2, t2, a3, l3, s3, true, e2.CSSClasses.dayBtnNext); 56225 } 56226 }, createDays = (e2) => { 56227 const t2 = e2.HTMLElement.querySelectorAll(`.${e2.CSSClasses.days}`), a2 = e2.HTMLElement.querySelectorAll(`.${e2.CSSClasses.weekNumbers}`), n2 = new Date(e2.selectedYear, e2.selectedMonth, 1); 56228 t2.forEach(((t3, s2) => { 56229 const l2 = new Date(n2); 56230 l2.setMonth(l2.getMonth() + s2); 56231 const r2 = l2.getMonth(), i2 = l2.getFullYear(), d2 = new Date(i2, r2, 1), c2 = new Date(i2, r2 + 1, 0).getDate(), o2 = e2.settings.iso8601 ? (0 !== d2.getDay() ? d2.getDay() : 7) - 1 : d2.getDay(); 56232 e2.settings.selection.day && t3.classList.add(e2.CSSClasses.daysSelecting), t3.innerHTML = "", prevMonth(e2, t3, i2, r2, o2), currentMonth(e2, t3, c2, i2, r2), nextMonth(e2, t3, c2, i2, r2, o2), createWeekNumbers(e2, o2, c2, a2[s2], t3), createPopup(e2, t3); 56233 })); 56234 }, visibilityMonth = (e2, t2, a2, n2) => { 56235 const s2 = new Date(n2.setMonth(e2.selectedMonth + a2)).getMonth(), l2 = false === e2.settings.selection.month || "only-arrows" === e2.settings.selection.month; 56236 t2.tabIndex = l2 ? -1 : 0, t2.classList.toggle(e2.CSSClasses.monthDisabled, l2), t2.setAttribute("data-calendar-selected-month", String(s2)), t2.innerText = e2.locale.months[s2]; 56237 }, visibilityYear = (e2, t2, a2, n2) => { 56238 const s2 = new Date(n2.setFullYear(e2.selectedYear, e2.selectedMonth + a2)).getFullYear(), l2 = false === e2.settings.selection.year || "only-arrows" === e2.settings.selection.year; 56239 t2.tabIndex = l2 ? -1 : 0, t2.classList.toggle(e2.CSSClasses.yearDisabled, l2), t2.setAttribute("data-calendar-selected-year", String(s2)), t2.innerText = String(s2); 56240 }, visibilityTitle = (e2) => { 56241 var t2, a2; 56242 const n2 = null == (t2 = e2.HTMLElement) ? void 0 : t2.querySelectorAll("[data-calendar-selected-month]"), s2 = null == (a2 = e2.HTMLElement) ? void 0 : a2.querySelectorAll("[data-calendar-selected-year]"); 56243 if (!(null == n2 ? void 0 : n2[0]) && (null == s2 ? void 0 : s2[0])) return; 56244 const l2 = new Date(e2.selectedYear, e2.selectedMonth, 1); 56245 null == n2 || n2.forEach(((t3, a3) => visibilityMonth(e2, t3, a3, l2))), null == s2 || s2.forEach(((t3, a3) => visibilityYear(e2, t3, a3, l2))); 56246 }, changeMonth = (e2, t2) => { 56247 const a2 = getDate(getDateString(new Date(e2.selectedYear, e2.selectedMonth, 1))); 56248 ({ prev: () => a2.setMonth(a2.getMonth() - e2.jumpMonths), next: () => a2.setMonth(a2.getMonth() + e2.jumpMonths) })[t2](), [e2.selectedMonth, e2.selectedYear] = [a2.getMonth(), a2.getFullYear()], visibilityTitle(e2), visibilityArrows(e2), createDays(e2); 56249 }, ArrowPrev = (e2) => `<button type="button"class="${e2.CSSClasses.arrow} ${e2.CSSClasses.arrowPrev}"data-calendar-arrow="prev"></button>`, ArrowNext = (e2) => `<button type="button"class="${e2.CSSClasses.arrow} ${e2.CSSClasses.arrowNext}"data-calendar-arrow="next"></button>`, Month = (e2) => `<button type="button"class="${e2.CSSClasses.month}"data-calendar-selected-month></button>`, Year = (e2) => `<button type="button"class="${e2.CSSClasses.year}"data-calendar-selected-year></button>`, Week = (e2) => `<div class="${e2.CSSClasses.week}"></div>`, Days = (e2) => `<div class="${e2.CSSClasses.days}"></div>`, Months = (e2) => `<div class="${e2.CSSClasses.months}"></div>`, Years = (e2) => `<div class="${e2.CSSClasses.years}"></div>`, WeekNumbers = (e2) => e2.settings.visibility.weekNumbers ? `<div class="${e2.CSSClasses.weekNumbers}"></div>` : "", ControlTime = (e2) => e2.settings.selection.time ? `<div class="${e2.CSSClasses.time}"></div>` : "", components = Object.freeze(Object.defineProperty({ __proto__: null, ArrowNext, ArrowPrev, ControlTime, Days, Month, Months, Week, WeekNumbers, Year, Years }, Symbol.toStringTag, { value: "Module" })), DOMParser = (e2, t2) => t2.replace(/[\n\t]/g, "").replace(/<#(?!\/?Multiple)(.*?)>/g, ((t3, a2) => { 56250 const n2 = (s2 = a2.replace(/[/\s\n\t]/g, ""), components[s2]); 56251 var s2; 56252 return n2 ? n2(e2) : ""; 56253 })).replace(/[\n\t]/g, ""), MultipleParser = (e2, t2) => t2.replace(/<#Multiple>(.*?)<#\/Multiple>/g, ((t3, a2) => { 56254 let n2 = ""; 56255 for (let t4 = 0; t4 < e2.correctMonths; t4++) n2 += a2; 56256 return n2; 56257 })).replace(/[\n\t]/g, ""), createDOM = (e2, t2) => {
56258 const { HTMLElement: a2, CSSClasses: n2, DOMTemplates: s2, type: l2, currentType: r2, correctMonths: i2 } = e2, d2 = (s3, l3) => { 56259 if (!t2) return; 56260 const r3 = a2.querySelector(`.${n2.controls}`); 56261 r3 && a2.removeChild(r3); 56262 a2.querySelector(`.${n2.grid}`).classList.add(n2.gridDisabled); 56263 const i3 = t2.closest(`.${n2.column}`); 56264 i3.classList.add(s3), i3.innerHTML = DOMParser(e2, l3); 56265 }, c2 = { default: () => { 56266 a2.classList.add(n2.calendarDefault), a2.classList.remove(n2.calendarMonth, n2.calendarYear), a2.innerHTML = DOMParser(e2, s2.default); 56267 }, multiple: () => { 56268 i2 && (a2.classList.add(n2.calendarMultiple), a2.classList.remove(n2.calendarMonth, n2.calendarYear), a2.innerHTML = MultipleParser(e2, DOMParser(e2, s2.multiple))); 56269 }, month: () => { 56270 "multiple" !== l2 ? (a2.classList.add(n2.calendarMonth), a2.classList.remove(n2.calendarDefault, n2.calendarYear), a2.innerHTML = DOMParser(e2, s2.month)) : d2(n2.columnMonth, s2.month); 56271 }, year: () => { 56272 "multiple" !== l2 ? (a2.classList.add(n2.calendarYear), a2.classList.remove(n2.calendarDefault, n2.calendarMonth), a2.innerHTML = DOMParser(e2, s2.year)) : d2(n2.columnYear, s2.year); 56273 } }; 56274 a2.classList.add(n2.calendar), c2[r2](); 56275 }, createYearEl = (e2, t2, a2, n2, s2) => { 56276 const l2 = t2.cloneNode(false); 56277 return l2.className = `${e2.CSSClasses.yearsYear}${a2 === s2 ? ` ${e2.CSSClasses.yearsYearSelected}` : n2 ? ` ${e2.CSSClasses.yearsYearDisabled}` : ""}`, l2.dataset.calendarYear = String(s2), l2.title = String(s2), l2.innerText = String(s2), n2 && (l2.tabIndex = -1), l2; 56278 }, createYears = (e2, t2) => { 56279 const a2 = (null == t2 ? void 0 : t2.dataset.calendarSelectedYear) ? Number(null == t2 ? void 0 : t2.dataset.calendarSelectedYear) : e2.selectedYear; 56280 e2.currentType = "year", createDOM(e2, t2), visibilityTitle(e2), visibilityArrows(e2); 56281 const n2 = e2.HTMLElement.querySelector(`.${e2.CSSClasses.years}`); 56282 if (!e2.settings.selection.year || !n2) return; 56283 n2.classList.add(e2.CSSClasses.yearsSelecting); 56284 const s2 = "multiple" !== e2.type || e2.selectedYear === a2 ? 0 : 1, l2 = document.createElement("button"); 56285 l2.type = "button"; 56286 for (let t3 = e2.viewYear - 7; t3 < e2.viewYear + 8; t3++) { 56287 const r2 = t3 < e2.dateMin.getFullYear() + s2 || t3 > e2.dateMax.getFullYear(), i2 = createYearEl(e2, l2, a2, r2, t3); 56288 n2.append(i2), e2.actions.getYears && e2.actions.getYears(t3, i2, e2); 56289 } 56290 }, handleClickArrow = (e2, t2) => { 56291 const a2 = t2.target.closest(`.${e2.CSSClasses.arrow}`); 56292 a2 && (["default", "multiple"].includes(e2.currentType) ? changeMonth(e2, a2.dataset.calendarArrow) : "year" === e2.currentType && void 0 !== e2.viewYear && (e2.viewYear += { prev: -15, next: 15 }[a2.dataset.calendarArrow], createYears(e2, t2.target)), e2.actions.clickArrow && e2.actions.clickArrow(t2, e2)); 56293 }, handleClickWeekNumber = (e2, t2) => { 56294 var a2; 56295 if (!e2.settings.visibility.weekNumbers || !e2.actions.clickWeekNumber) return; 56296 const n2 = t2.target.closest(`.${e2.CSSClasses.weekNumber}`), s2 = null == (a2 = e2.HTMLElement) ? void 0 : a2.querySelectorAll("[data-calendar-week-number]"); 56297 if (!n2 || !s2) return; 56298 const l2 = Number(n2.innerText), r2 = Number(n2.dataset.calendarYearWeek), i2 = [...s2].filter(((e3) => Number(e3.dataset.calendarWeekNumber) === l2)); 56299 e2.actions.clickWeekNumber(t2, l2, i2, r2, e2); 56300 }, capitalizeFirstLetter = (e2) => `${e2.charAt(0).toUpperCase()}${e2.substring(1, e2.length)}`.replace(/\./, ""), getLocaleWeekday = (e2, t2) => { 56301 const a2 = (/* @__PURE__ */ new Date(`1978-01-0${t2 + 1}T00:00:00.000Z`)).toLocaleString(e2.settings.lang, { weekday: "short", timeZone: "UTC" }); 56302 e2.locale.weekday.push(capitalizeFirstLetter(a2)); 56303 }, getLocaleMonth = (e2, t2) => { 56304 const a2 = (/* @__PURE__ */ new Date(`1978-${t2 + 1 <= 9 ? `0${t2 + 1}` : t2 + 1}-01T00:00:00.000Z`)).toLocaleString(e2.settings.lang, { month: "long", timeZone: "UTC" }); 56305 e2.locale.months.push(capitalizeFirstLetter(a2)); 56306 }, getLocale = (e2) => { 56307 if ("define" !== e2.settings.lang || !e2.locale.weekday[6] || !e2.locale.months[11]) { 56308 if ("define" === e2.settings.lang) throw new Error(messages.notLocale); 56309 e2.locale.weekday = [], e2.locale.months = []; 56310 for (let t2 = 0; t2 < 7; t2++) getLocaleWeekday(e2, t2); 56311 for (let t2 = 0; t2 < 12; t2++) getLocaleMonth(e2, t2); 56312 } 56313 }, relationshipID = (e2) => { 56314 if ("multiple" !== e2.type) return 0; 56315 const t2 = [...e2.HTMLElement.querySelectorAll(`.${e2.CSSClasse
56315s.column}`)].findIndex(((t3) => t3.classList.contains(`${e2.CSSClasses.columnMonth}`))); 56316 return t2 > 0 ? t2 : 0; 56317 }, createMonthEl = (e2, t2, a2, n2, s2, l2) => { 56318 const r2 = t2.cloneNode(false); 56319 return r2.className = `${e2.CSSClasses.monthsMonth}${a2 === l2 ? ` ${e2.CSSClasses.monthsMonthSelected}` : s2 ? ` ${e2.CSSClasses.monthsMonthDisabled}` : ""}`, r2.title = n2, r2.innerText = `${e2.settings.visibility.monthShort ? n2.substring(0, 3) : n2}`, r2.dataset.calendarMonth = String(l2), s2 && (r2.tabIndex = -1), r2; 56320 }, createMonths = (e2, t2) => { 56321 var a2, n2; 56322 const s2 = (null == t2 ? void 0 : t2.dataset.calendarSelectedMonth) ? Number(t2.dataset.calendarSelectedMonth) : e2.selectedMonth, l2 = null == (a2 = null == t2 ? void 0 : t2.closest(`.${e2.CSSClasses.column}`)) ? void 0 : a2.querySelector(`.${e2.CSSClasses.year}`), r2 = l2 ? Number(l2.dataset.calendarSelectedYear) : e2.selectedYear; 56323 e2.currentType = "month", createDOM(e2, t2), visibilityTitle(e2); 56324 const i2 = null == (n2 = e2.HTMLElement) ? void 0 : n2.querySelector(`.${e2.CSSClasses.months}`); 56325 if (!e2.settings.selection.month || !i2) return; 56326 i2.classList.add(e2.CSSClasses.monthsSelecting); 56327 const d2 = e2.jumpMonths > 1 ? e2.locale.months.map(((t3, a3) => s2 - e2.jumpMonths * a3)).concat(e2.locale.months.map(((t3, a3) => s2 + e2.jumpMonths * a3))).filter(((e3) => e3 >= 0 && e3 <= 12)) : Array.from(Array(12).keys()), c2 = document.createElement("button"); 56328 c2.type = "button"; 56329 for (let t3 = 0; t3 < 12; t3++) { 56330 const a3 = e2.locale.months[t3], n3 = t3 < e2.dateMin.getMonth() + relationshipID(e2) && r2 <= e2.dateMin.getFullYear() || t3 > e2.dateMax.getMonth() + relationshipID(e2) && r2 >= e2.dateMax.getFullYear() || t3 !== s2 && !d2.includes(t3), l3 = createMonthEl(e2, c2, s2, a3, n3, t3); 56331 i2.append(l3), e2.actions.getMonths && e2.actions.getMonths(t3, l3, e2); 56332 } 56333 }, transformTime24 = (e2, t2) => e2 && t2 ? { 0: { AM: "00", PM: "12" }, 1: { AM: "01", PM: "13" }, 2: { AM: "02", PM: "14" }, 3: { AM: "03", PM: "15" }, 4: { AM: "04", PM: "16" }, 5: { AM: "05", PM: "17" }, 6: { AM: "06", PM: "18" }, 7: { AM: "07", PM: "19" }, 8: { AM: "08", PM: "20" }, 9: { AM: "09", PM: "21" }, 10: { AM: "10", PM: "22" }, 11: { AM: "11", PM: "23" }, 12: { AM: "12", PM: "12" } }[Number(e2)][t2] : "", getInputElement = (e2, t2, a2) => e2.querySelector(`.${t2}${a2 ? ` input[name="${a2}"]` : ""}`), addMouseEvents = (e2, t2, a2) => { 56334 e2.addEventListener("mouseover", (() => t2.classList.add(a2))), e2.addEventListener("mouseout", (() => t2.classList.remove(a2))); 56335 }, setTime = (e2, t2, a2, n2) => { 56336 ({ hours: () => { 56337 e2.selectedHours = a2; 56338 }, minutes: () => { 56339 e2.selectedMinutes = a2; 56340 } })[n2](), e2.selectedTime = `${e2.selectedHours}:${e2.selectedMinutes}${e2.selectedKeeping ? ` ${e2.selectedKeeping}` : ""}`, e2.actions.changeTime && e2.actions.changeTime(t2, e2), e2.input && e2.HTMLInputElement && e2.actions.changeToInput && e2.actions.changeToInput(t2, e2); 56341 }, changeRange = (e2, t2, a2, n2, s2, l2) => { 56342 t2.addEventListener("input", ((t3) => { 56343 const r2 = t3.target, i2 = Number(r2.value), d2 = i2 < 10 ? `0${i2}` : `${i2}`; 56344 if ("hours" !== s2 || 12 !== l2) return a2.value = d2, void setTime(e2, t3, d2, s2); 56345 i2 < l2 && i2 > 0 ? (a2.value = d2, e2.selectedKeeping = "AM", n2.innerText = e2.selectedKeeping, setTime(e2, t3, d2, s2)) : (0 === i2 ? (e2.selectedKeeping = "AM", n2.innerText = "AM") : (e2.selectedKeeping = "PM", n2.innerText = "PM"), a2.value = transformTime12(r2.value), setTime(e2, t3, transformTime12(r2.value), s2)); 56346 })); 56347 }, changeInput = (e2, t2, a2, n2, s2, l2) => { 56348 a2.addEventListener("change", ((a3) => { 56349 const r2 = a3.target, i2 = Number(r2.value), d2 = i2 < 10 ? `0${i2}` : `${i2}`; 56350 "hours" === s2 && 12 === l2 ? r2.value && i2 <= l2 && i2 > 0 ? (r2.value = d2, t2.value = transformTime24(d2, e2.selectedKeeping), setTime(e2, a3, d2, s2)) : r2.value && i2 < 24 && (i2 > l2 || 0 === i2) ? (0 === i2 ? (e2.selectedKeeping = "AM", n2.innerText = "AM") : (e2.selectedKeeping = "PM", n2.innerText = "PM"), r2.value = transformTime12(r2.value), t2.value = d2, setTime(e2, a3, transformTime12(r2.value), s2)) : r2.value = e2.selectedHours : r2.value && i2 <= l2 && i2 >= 0 ? (r2.value = d2, t2.value = d2, setTime(e2, a3, d2, s2)) : "hours" === s2 ? r2.value = e2.selectedHours : "minutes" === s2 && (r2.value = e2.selectedMinutes); 56351 })); 56352 }, clickBtnKeepingTime = (e2, t2, a2) => { 56353 t2.addEventListener("click", ((n2) => { 56354 e2.selectedKeeping = t2.innerText.includes("AM") ? "PM" : "AM", t2.innerText = e2.selectedKeeping, a2.value = transformTime24(e2.selectedHours, e2.selectedKeeping), setTime(e2, n2, e2.selectedHours, "hours"); 56355 })); 56356 }, changeTime = (e2, t2, a2) => { 56357 const n2 = 24 === a2 ? 23 : a2 || 12, s2 = getInputElement(t2, e2.CSSClasse
56357s.timeRange, "hours"), l2 = getInputElement(t2, e2.CSSClasses.timeRange, "minutes"), r2 = getInputElement(t2, e2.CSSClasses.timeHours, "hours"), i2 = getInputElement(t2, e2.CSSClasses.timeMinutes, "minutes"), d2 = t2.querySelector(`.${e2.CSSClasses.timeKeeping}`); 56358 addMouseEvents(s2, r2, e2.CSSClasses.isFocus), addMouseEvents(l2, i2, e2.CSSClasses.isFocus), changeRange(e2, s2, r2, d2, "hours", n2), changeRange(e2, l2, i2, d2, "minutes", 0), changeInput(e2, s2, r2, d2, "hours", n2), changeInput(e2, l2, i2, d2, "minutes", 59), d2 && clickBtnKeepingTime(e2, d2, s2); 56359 }, InputTime = (e2, t2, a2, n2) => `<label class="${t2}"><input type="text"name="${e2}"maxlength="2"value="${a2}"${n2 ? "disabled" : ""}></label>`, RangeTime = (e2, t2, a2, n2, s2, l2) => `<label class="${t2}"><input type="range"name="${e2}"min="${a2}"max="${n2}"step="${s2}"value="${l2}"></label>`, createTime = (e2) => { 56360 const t2 = e2.HTMLElement.querySelector(`.${e2.CSSClasses.time}`); 56361 if (!t2) return; 56362 const a2 = true === e2.settings.selection.time ? 12 : e2.settings.selection.time, n2 = "range" === e2.settings.selection.controlTime, [s2, l2] = [0, 23], [r2, i2] = [0, 59]; 56363 t2.innerHTML = `<div class="${e2.CSSClasses.timeContent}">${InputTime("hours", e2.CSSClasses.timeHours, e2.selectedHours, n2)}${InputTime("minutes", e2.CSSClasses.timeMinutes, e2.selectedMinutes, n2)}${12 === a2 ? `<button type="button" class="${e2.CSSClasses.timeKeeping}"${n2 ? "disabled" : ""}>${e2.selectedKeeping}</button>` : ""}</div><div class="${e2.CSSClasses.timeRanges}">${RangeTime("hours", e2.CSSClasses.timeRange, s2, l2, e2.settings.selection.stepHours, e2.selectedKeeping ? transformTime24(e2.selectedHours, e2.selectedKeeping) : e2.selectedHours)}${RangeTime("minutes", e2.CSSClasses.timeRange, r2, i2, e2.settings.selection.stepMinutes, e2.selectedMinutes)}</div>`, changeTime(e2, t2, a2); 56364 }, createWeekDays = (e2, t2, a2) => { 56365 const n2 = document.createElement("b"); 56366 t2.innerHTML = ""; 56367 for (let s2 = 0; s2 < a2.length; s2++) { 56368 const l2 = a2[s2], r2 = n2.cloneNode(true); 56369 r2.className = `${e2.CSSClasses.weekDay}`, r2.className = `${e2.CSSClasses.weekDay}${e2.settings.visibility.weekend && e2.settings.iso8601 ? 5 === s2 || 6 === s2 ? ` ${e2.CSSClasses.weekDayWeekend}` : "" : e2.settings.visibility.weekend && !e2.settings.iso8601 && (0 === s2 || 6 === s2) ? ` ${e2.CSSClasses.weekDayWeekend}` : ""}`, r2.innerText = `${l2}`, t2.append(r2); 56370 } 56371 }, createWeek = (e2) => { 56372 const t2 = [...e2.locale.weekday]; 56373 if (!t2[0]) return; 56374 e2.settings.iso8601 && t2.push(t2.shift()); 56375 e2.HTMLElement.querySelectorAll(`.${e2.CSSClasses.week}`).forEach(((a2) => createWeekDays(e2, a2, t2))); 56376 }, themes = ["light", "dark", "system"], haveListener = { value: false, set: () => { 56377 haveListener.value = true; 56378 }, check: () => haveListener.value }, getTheme = (e2, t2) => themes.find(((a2) => { 56379 var n2; 56380 return "system" !== a2 && (null == (n2 = e2.getAttribute(t2)) ? void 0 : n2.includes(a2)); 56381 })), setTheme = (e2, t2) => { 56382 e2.dataset.calendarTheme = t2; 56383 }, trackChangesThemeInSystemSettings = (e2, t2) => { 56384 var a2; 56385 if (a2 = t2, setTheme(e2.HTMLElement, a2.matches ? "dark" : "light"), "system" !== e2.settings.visibility.theme || haveListener.check()) return; 56386 const n2 = (t3) => { 56387 const a3 = document.querySelectorAll(`.${e2.CSSClasses.calendar}`); 56388 null == a3 || a3.forEach(((e3) => setTheme(e3, t3.matches ? "dark" : "light"))); 56389 }; 56390 t2.addEventListener ? t2.addEventListener("change", n2) : t2.addListener(n2), haveListener.set(); 56391 }, trackChangesThemeInHTMLElement = (e2, t2, a2) => { 56392 new MutationObserver(((n2) => { 56393 for (let s2 = 0; s2 < n2.length; s2++) { 56394 if (n2[s2].attributeName === a2) { 56395 const n3 = getTheme(t2, a2); 56396 n3 && setTheme(e2.HTMLElement, n3); 56397 break; 56398 } 56399 } 56400 })).observe(t2, { attributes: true }); 56401 }, detectTheme = (e2, t2) => { 56402 const a2 = e2.settings.visibility.themeDetect ? document.querySelector(e2.settings.visibility.themeDetect) : null; 56403 if (!a2) return void trackChangesThemeInSystemSettings(e2, t2); 56404 const n2 = e2.settings.visibility.themeDetect.replace(/^.*\[(.+)\]/g, ((e3, t3) => t3)), s2 = getTheme(a2, n2); 56405 s2 ? (setTheme(e2.HTMLElement, s2), trackChangesThemeInHTMLElement(e2, a2, n2)) : trackChangesThemeInSystemSettings(e2, t2); 56406 }, changeTheme = (e2) => { 56407 if (!themes.includes(e2.settings.visibility.theme)) throw new Error(messages.incorrectTheme); 56408 if ("not all" === window.matchMedia("(prefers-color-scheme)").media) return void setTheme(e2.HTMLElement, "light"); 56409 ({ light: () => setTheme(e2.HTMLElement, "light"), dark: () => setTheme(e2.HTMLElement, "dark"), system: () => detectTheme(e2, window.matchMedia("(prefers-color-scheme: dark)")) })[e2.settings.visibility.theme](); 56410 }, create = (e2) => { 56411 const t2 = { default: () => { 56412 createWeek(e2), createDays(e2); 56413 }, multiple: () => { 56414 createWeek(e2), createDays(e2); 56415 }, month: () => createMonths(e2), year: () => createYears(e2) }; 56416 changeTheme(e2), getLocale(e2), createDOM(e2), visibilityTitle(e2), visibilityArrows(e2), createTime(e2), t2[e2.currentType](); 56417 }, current = { self: null, rangeMin: void 0, rangeMax: void 0 }, removeHoverEffect = () => { 56418 var e2; 56419 if (!(null == (e2 = current.self) ? void 0 : e2.HTMLElement)) return;
56420 const { CSSClasses: t2 } = current.self; 56421 current.self.HTMLElement.querySelectorAll(`.${current.self.CSSClasses.dayBtnHover}`).forEach(((e3) => { 56422 var a2; 56423 e3.classList.remove(current.self.CSSClasses.dayBtnHover), null == (a2 = e3.parentElement) || a2.classList.remove(t2.dayHoverIntermediate, t2.dayHoverFirst, t2.dayHoverLast); 56424 })); 56425 }, addHoverEffect = (e2, t2, a2) => { 56426 var n2, s2, l2; 56427 if (!(null == (n2 = current.self) ? void 0 : n2.selectedDates)) return; 56428 const r2 = getDateString(e2), { CSSClasses: i2 } = current.self; 56429 if (null == (s2 = current.self.rangeDisabled) ? void 0 : s2.includes(r2)) return; 56430 const d2 = null == (l2 = current.self.HTMLElement) ? void 0 : l2.querySelectorAll(`[data-calendar-day="${r2}"]`); 56431 null == d2 || d2.forEach(((e3) => { 56432 var t3; 56433 e3.classList.add(i2.dayBtnHover), null == (t3 = e3.parentElement) || t3.classList.add(i2.dayHoverIntermediate); 56434 })), null == t2 || t2.forEach(((e3) => { 56435 var t3; 56436 return null == (t3 = e3.parentElement) ? void 0 : t3.classList.add(i2.dayHoverFirst); 56437 })), null == a2 || a2.forEach(((e3) => { 56438 var t3; 56439 return null == (t3 = e3.parentElement) ? void 0 : t3.classList.add(i2.dayHoverLast); 56440 })); 56441 }, handleHoverDaysEvent = (e2) => { 56442 var t2; 56443 if (!e2.target || !(null == (t2 = current.self) ? void 0 : t2.selectedDates)) return; 56444 if (!e2.target.closest(`.${current.self.CSSClasses.days}`)) return void removeHoverEffect(); 56445 const a2 = e2.target.closest("[data-calendar-day]"); 56446 if (!a2) return; 56447 const n2 = a2.dataset.calendarDay, s2 = getDate(current.self.selectedDates[0]), l2 = getDate(n2), r2 = current.self.HTMLElement.querySelectorAll(`[data-calendar-day="${current.self.selectedDates[0]}"]`), i2 = current.self.HTMLElement.querySelectorAll(`[data-calendar-day="${n2}"]`), [d2, c2] = s2 < l2 ? [r2, i2] : [i2, r2], [o2, u2] = s2 < l2 ? [s2, l2] : [l2, s2]; 56448 removeHoverEffect(); 56449 for (let e3 = new Date(o2); e3 <= u2; e3.setDate(e3.getDate() + 1)) addHoverEffect(e3, d2, c2); 56450 }, handleCancelSelectionDays = (e2) => { 56451 current.self && "Escape" === e2.key && (current.self.selectedDates = [], current.self.HTMLElement.removeEventListener("mousemove", handleHoverDaysEvent), document.removeEventListener("keydown", handleCancelSelectionDays), create(current.self)); 56452 }, updateDisabledDates = () => { 56453 var e2, t2, a2; 56454 if (!(null == (t2 = null == (e2 = current.self) ? void 0 : e2.selectedDates) ? void 0 : t2[0]) || !current.self.rangeDisabled || (null == (a2 = current.self.rangeDisabled) ? void 0 : a2.length) < 2) return; 56455 const n2 = getDate(current.self.selectedDates[0]), [s2, l2] = current.self.rangeDisabled.map(((e3) => getDate(e3))).reduce((([e3, t3], a3) => [n2 >= a3 ? a3 : e3, n2 < a3 && null === t3 ? a3 : t3]), [null, null]); 56456 s2 && (current.self.rangeMin = getDateString(new Date(s2.setDate(s2.getDate() + 1)))), l2 && (current.self.rangeMax = getDateString(new Date(l2.setDate(l2.getDate() - 1)))); 56457 }, handleDayRangedSelection = (e2, t2) => { 56458 var a2; 56459 if (t2) { 56460 const n2 = 1 === e2.selectedDates.length && e2.selectedDates[0].includes(t2); 56461 e2.selectedDates = n2 && !e2.settings.selection.cancelableDay ? [t2, t2] : n2 && e2.settings.selection.cancelableDay ? [] : e2.selectedDates.length > 1 ? [t2] : [...e2.selectedDates, t2], null == (a2 = e2.selectedDates) || a2.sort(((e3, t3) => +new Date(e3) - +new Date(t3))); 56462 } 56463 e2.settings.range.disableGaps && (current.rangeMin = current.rangeMin ? current.rangeMin : e2.rangeMin, current.rangeMax = current.rangeMax ? current.rangeMax : e2.rangeMax), current.self = e2; 56464 ({ set: () => { 56465 e2.HTMLElement.addEventListener("mousemove", handleHoverDaysEvent), document.addEventListener("keydown", handleCancelSelectionDays), e2.settings.range.disableGaps && updateDisabledDates(); 56466 }, reset: () => { 56467 const [t3, a3] = [e2.selectedDates[0], e2.selectedDates[e2.selectedDates.length - 1]]; 56468 e2.selectedDates = e2.selectedDates[0] !== e2.selectedDates[e2.selectedDates.length - 1] ? parseDates([`${t3}:${a3}`]) : [e2.selectedDates[0], e2.selectedDates[0]], e2.HTMLElement.removeEventListener("mousemove", handleHoverDaysEvent), document.removeEventListener("keydown", handleCancelSelectionDays), e2.settings.range.disableGaps && current.self && (current.self.rangeMin = current.rangeMin, current.self.rangeMax = current.rangeMax); 56469 } })[1 === e2.selectedDates.length ? "set" : "reset"](); 56470 }, handleDaySelection = (e2, t2, a2) => { 56471 if (!t2.dataset.calendarDay) return; 56472 const n2 = t2.dataset.calendarDay, s2 = t2.classList.contains(e2.CSSClasse
56472s.dayBtnSelected); 56473 s2 && !e2.settings.selection.cancelableDay || (e2.selectedDates = s2 ? e2.selectedDates.filter(((e3) => e3 !== n2)) : a2 ? [...e2.selectedDates, n2] : [n2]); 56474 }, handleClickDay = (e2, t2) => { 56475 var a2; 56476 const n2 = t2.target, s2 = (e3) => n2.closest(`.${e3}`), l2 = s2(e2.CSSClasses.dayBtn); 56477 if (!e2.settings.selection.day || !["single", "multiple", "multiple-ranged"].includes(e2.settings.selection.day) || !l2) return; 56478 ({ single: () => handleDaySelection(e2, l2, false), multiple: () => handleDaySelection(e2, l2, true), "multiple-ranged": () => handleDayRangedSelection(e2, l2.dataset.calendarDay) })[e2.settings.selection.day](), null == (a2 = e2.selectedDates) || a2.sort(((e3, t3) => +new Date(e3) - +new Date(t3))), e2.actions.clickDay && e2.actions.clickDay(t2, e2); 56479 e2.input && e2.HTMLInputElement && e2.HTMLElement && e2.actions.changeToInput && e2.actions.changeToInput(t2, e2); 56480 const r2 = s2(e2.CSSClasses.dayBtnPrev), i2 = s2(e2.CSSClasses.dayBtnNext); 56481 ({ prev: () => changeMonth(e2, "prev"), next: () => changeMonth(e2, "next"), default: () => createDays(e2) })[r2 ? "prev" : i2 ? "next" : "default"](); 56482 }, getColumnID = (e2, t2, a2, n2, s2) => { 56483 const l2 = e2.HTMLElement.querySelectorAll(`.${e2.CSSClasses.column}`), r2 = [...l2].findIndex(((e3) => e3.classList.contains(t2))), i2 = Number(l2[r2].querySelector(`.${a2}`).getAttribute(s2)); 56484 return "month" === e2.currentType && r2 >= 0 ? n2 - r2 : "year" === e2.currentType && e2.selectedYear !== i2 ? n2 - 1 : n2; 56485 }, handleItemClick = (e2, t2, a2, n2, s2) => { 56486 const l2 = { year: () => { 56487 var a3, n3; 56488 return null == (n3 = (a3 = e2.actions).clickYear) ? void 0 : n3.call(a3, t2, e2); 56489 }, month: () => { 56490 var a3, n3; 56491 return null == (n3 = (a3 = e2.actions).clickMonth) ? void 0 : n3.call(a3, t2, e2); 56492 } }; 56493 ({ year: () => { 56494 if ("multiple" === e2.type) { 56495 const t3 = getColumnID(e2, e2.CSSClasses.columnYear, e2.CSSClasses.year, Number(s2.dataset.calendarYear), "data-calendar-selected-year"), a3 = e2.selectedMonth < e2.dateMin.getMonth() && t3 <= e2.dateMin.getFullYear(), n3 = e2.selectedMonth > e2.dateMax.getMonth() && t3 >= e2.dateMax.getFullYear(), l3 = t3 < e2.dateMin.getFullYear(), r2 = t3 > e2.dateMax.getFullYear(); 56496 a3 || l3 ? (e2.selectedYear = e2.dateMin.getFullYear(), e2.selectedMonth = e2.dateMin.getMonth()) : n3 || r2 ? (e2.selectedYear = e2.dateMax.getFullYear(), e2.selectedMonth = e2.dateMax.getMonth()) : e2.selectedYear = t3; 56497 } else e2.selectedYear = Number(s2.dataset.calendarYear); 56498 }, month: () => { 56499 if ("multiple" === e2.type) { 56500 const t3 = getColumnID(e2, e2.CSSClasses.columnMonth, e2.CSSClasses.month, Number(s2.dataset.calendarMonth), "data-calendar-selected-month"), a3 = s2.closest(`.${n2.column}`).querySelector(`.${e2.CSSClasses.year}`); 56501 e2.selectedYear = Number(a3.dataset.calendarSelectedYear); 56502 const l3 = t3 < e2.dateMin.getMonth() && e2.selectedYear <= e2.dateMin.getFullYear(), r2 = t3 > e2.dateMax.getMonth() && e2.selectedYear >= e2.dateMax.getFullYear(); 56503 e2.selectedMonth = l3 ? e2.dateMin.getMonth() : r2 ? e2.dateMax.getMonth() : t3; 56504 } else e2.selectedMonth = Number(s2.dataset.calendarMonth); 56505 } })[a2](), l2[a2](), e2.currentType = e2.type, create(e2); 56506 }, handleClickMonthOrYear = (e2, t2, a2, n2) => { 56507 if (!e2.settings.selection[a2]) return; 56508 const s2 = t2.target, l2 = (e3) => s2.closest(`.${e3}`), r2 = l2(n2.header), i2 = l2(n2.item), d2 = l2(e2.CSSClasses.grid), c2 = l2(e2.CSSClasses.column); 56509 if (e2.currentType !== a2 && r2) { 56510 ({ year: () => createYears(e2, s2), month: () => createMonths(e2, s2) })[a2](); 56511 } else i2 ? handleItemClick(e2, t2, a2, n2, i2) : (e2.currentType === a2 && r2 || "multiple" === e2.type && e2.currentType === a2 && d2 && !c2) && (e2.currentType = e2.type, create(e2)); 56512 }, handleClick = (e2) => { 56513 const t2 = (t3) => { 56514 handleClickArrow(e2, t3), handleClickWeekNumber(e2, t3), handleClickDay(e2, t3), handleClickMonthOrYear(e2, t3, "month", { header: e2.CSSClasse
56514s.month, item: e2.CSSClasses.monthsMonth, column: e2.CSSClasses.columnMonth }), handleClickMonthOrYear(e2, t3, "year", { header: e2.CSSClasses.year, item: e2.CSSClasses.yearsYear, column: e2.CSSClasses.columnYear }); 56515 }; 56516 return e2.HTMLElement.addEventListener("click", t2), () => e2.HTMLElement.removeEventListener("click", t2); 56517 }, reset = (e2, { year: t2, month: a2, dates: n2, holidays: s2, time: l2 } = {}) => { 56518 var r2; 56519 const i2 = __spreadValues({}, e2.settings.selected); 56520 e2.settings.selected.year = t2 ? i2.year : e2.selectedYear, e2.settings.selected.month = a2 ? i2.month : e2.selectedMonth, e2.settings.selected.holidays = s2 ? i2.holidays : e2.selectedHolidays, e2.settings.selected.time = l2 ? i2.time : e2.selectedTime, e2.settings.selected.dates = "only-first" === n2 && (null == (r2 = e2.selectedDates) ? void 0 : r2[0]) ? [e2.selectedDates[0]] : true === n2 ? i2.dates : e2.selectedDates, setVariables(e2), create(e2), e2.settings.selected = i2, "multiple-ranged" === e2.settings.selection.day && n2 && handleDayRangedSelection(e2); 56521 }, setPositionCalendar = (e2, t2, a2, n2) => { 56522 const s2 = { top: -t2.offsetHeight, bottom: e2.offsetHeight, left: 0, center: e2.offsetWidth / 2 - t2.offsetWidth / 2, right: e2.offsetWidth - t2.offsetWidth }, l2 = Array.isArray(a2) ? a2[0] : "bottom", r2 = Array.isArray(a2) ? a2[1] : a2; 56523 t2.classList.add("bottom" === l2 ? n2.calendarToInputBottom : n2.calendarToInputTop); 56524 const i2 = e2.getBoundingClientRect(), d2 = window.scrollX || document.documentElement.scrollLeft, c2 = window.scrollY || document.documentElement.scrollTop, o2 = i2.top + c2 + s2[l2], u2 = i2.left + d2 + s2[r2]; 56525 Object.assign(t2.style, { left: `${u2}px`, top: `${o2}px` }); 56526 }, handleInput = (e2) => { 56527 let t2 = true; 56528 const a2 = []; 56529 e2.HTMLInputElement = e2.HTMLElement; 56530 const n2 = () => setPositionCalendar(e2.HTMLInputElement, e2.HTMLElement, e2.settings.visibility.positionToInput, e2.CSSClasses), s2 = (t3) => { 56531 var a3; 56532 e2 && t3.target !== e2.HTMLInputElement && !(null == (a3 = e2.HTMLElement) ? void 0 : a3.contains(t3.target)) && (e2.HTMLInputElement && e2.HTMLElement && e2.hide(), window.removeEventListener("resize", n2), document.removeEventListener("click", s2, { capture: true })); 56533 }; 56534 return e2.HTMLInputElement.addEventListener("click", (() => { 56535 t2 ? a2.push((() => { 56536 const a3 = document.createElement("div"); 56537 return a3.className = `${e2.CSSClasses.calendar} ${e2.CSSClasses.calendarToInput} ${e2.CSSClasses.calendarHidden}`, e2.HTMLElement = a3, document.body.append(e2.HTMLElement), t2 = false, setTimeout((() => { 56538 setPositionCalendar(e2.HTMLInputElement, a3, e2.settings.visibility.positionToInput, e2.CSSClasses), e2.show(); 56539 }), 0), reset(e2, { year: true, month: true, dates: true, holidays: true, time: true }), e2.actions.initCalendar && e2.actions.initCalendar(e2), handleClick(e2); 56540 })()) : (setPositionCalendar(e2.HTMLInputElement, e2.HTMLElement, e2.settings.visibility.positionToInput, e2.CSSClasses), e2.show()), window.addEventListener("resize", n2), document.addEventListener("click", s2, { capture: true }); 56541 })), () => { 56542 a2.forEach(((e3) => e3())); 56543 }; 56544 }, update = (e2, { year: t2, month: a2, dates: n2, holidays: s2, time: l2 }
56544 = {}) => { 56545 if (!e2.isInit) throw new Error(messages.notInit); 56546 reset(e2, { year: t2, month: a2, dates: n2, holidays: s2, time: l2 }), e2.actions.updateCalendar && e2.actions.updateCalendar(e2); 56547 }, destroy = (e2) => { 56548 var t2, a2, n2, s2; 56549 if (!e2.isInit) throw new Error(messages.notInit); 56550 e2.input ? (null == (a2 = null == (t2 = e2.HTMLElement) ? void 0 : t2.parentElement) || a2.removeChild(e2.HTMLElement), null == (n2 = e2.HTMLInputElement) || n2.replaceWith(e2.HTMLOriginalElement), e2.HTMLInputElement = void 0) : null == (s2 = e2.HTMLElement) || s2.replaceWith(e2.HTMLOriginalElement), e2.HTMLElement = e2.HTMLOriginalElement, e2.actions.destroyCalendar && e2.actions.destroyCalendar(e2); 56551 }; 56552 class VanillaCalendar extends DefaultOptionsCalendar { 56553 constructor(e2, t2) { 56554 if (super(), __publicField(this, "init", (() => { 56555 return (e3 = this).HTMLOriginalElement = e3.HTMLElement.cloneNode(true), e3.isInit = true, e3.input ? handleInput(e3) : (setVariables(e3), create(e3), e3.actions.initCalendar && e3.actions.initCalendar(e3), handleClick(e3)); 56556 var e3; 56557 })), __publicField(this, "update", ((e3) => update(this, e3))), __publicField(this, "destroy", (() => destroy(this))), __publicField(this, "show", (() => { 56558 var e3; 56559 (e3 = this).currentType ? (e3.HTMLElement.classList.remove(e3.CSSClasses.calendarHidden), e3.actions.showCalendar && e3.actions.showCalendar(e3)) : e3.HTMLElement.click(); 56560 })), __publicField(this, "hide", (() => { 56561 var e3; 56562 (e3 = this).currentType && (e3.HTMLElement.classList.add(e3.CSSClasses.calendarHidden), e3.actions.hideCalendar && e3.actions.hideCalendar(e3)); 56563 })), this.HTMLElement = "string" == typeof e2 ? document.querySelector(e2) : e2, !this.HTMLElement) throw new Error(messages.notFoundSelector(e2)); 56564 if (!t2) return; 56565 const a2 = (e3, t3) => { 56566 Object.keys(t3).forEach(((n2) => { 56567 "object" != typeof e3[n2] || "object" != typeof t3[n2] || t3[n2] instanceof Date ? e3[n2] = t3[n2] : a2(e3[n2], t3[n2]); 56568 })); 56569 }; 56570 a2(this, t2); 56571 } 56572 } 56573 const vanillaCalendarCSS = i$9` 56574 .vanilla-calendar { 56575 position: relative; 56576 box-sizing: border-box; 56577 display: flex; 56578 height: -webkit-max-content; 56579 height: max-content; 56580 width: -webkit-max-content; 56581 width: max-content; 56582 min-width: 272px; 56583 max-width: 100%; 56584 flex-direction: column; 56585 border-radius: var(--sc-rounded-md); 56586 opacity: 1; 56587 transition-property: opacity; 56588 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 56589 transition-duration: 0.15s; 56590 } 56591 .vanilla-calendar_multiple { 56592 width: 550px; 56593 } 56594 .vanilla-calendar button:focus-visible { 56595 border-radius: var(-sc-rounded); 56596 outline-style: solid; 56597 outline-width: 1px; 56598 } 56599 .vanilla-calendar.vanilla-calendar_multiple .vanilla-calendar-days { 56600 flex-grow: 0; 56601 } 56602 .vanilla-calendar_hidden { 56603 pointer-events: none; 56604 opacity: 0; 56605 } 56606 .vanilla-calendar_to-input { 56607 position: absolute; 56608 left: 0; 56609 bottom: 0; 56610 margin-top: 0.25em; 56611 } 56612 .vanilla-calendar-controls { 56613 pointer-events: none; 56614 position: absolute; 56615 left: 0; 56616 right: 0; 56617 top: 0; 56618 z-index: 20; 56619 box-sizing: content-box; 56620 display: flex; 56621 align-items: center; 56622 justify-content: space-between; 56623 padding-left: 1em; 56624 padding-right: 1em; 56625 padding-top: 1.25em; 56626 } 56627 .vanilla-calendar-arrow { 56628 pointer-events: auto; 56629 position: relative; 56630 display: block; 56631 height: 1.5em; 56632 width: 1.5em; 56633 cursor: pointer; 56634 border-width: 0px; 56635 background-color: transparent; 56636 } 56637 .vanilla-calendar-arrow:before { 56638 position: absolute; 56639 inset: 0; 56640 background-color: currentColor; 56641 --tw-content: ""; 56642 -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 16c-.3 0-.5-.1-.7-.3l-6-6c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l5.3 5.3 5.3-5.3c.4-.4 1-.4 1.4 0s.4 1 0 1.4l-6 6c-.2.2-.4.3-.7.3z'/></svg>"); 56643 mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 16c-.3 0-.5-.1-.7-.3l-6-6c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l5.3 5.3 5.3-5.3c.4-.4 1-.4 1.4 0s.4 1 0 1.4l-6 6c-.2.2-.4.3-.7.3z'/></svg>"); 56644 -webkit-mask-position: center center; 56645 mask-position: center center; 56646 content: var(--tw-content); 56647 -webkit-mask-repeat: no-repeat; 56648 mask-repeat: no-repeat; 56649 } 56650 .vanilla-calendar-arrow.vanilla-calendar-arrow_prev:before { 56651 transform: rotate(90deg); 56652 } 56653 .vanilla-calendar-arrow.vanilla-calendar-arrow_next:before { 56654 transform: rotate(-90deg); 56655 } 56656 .vanilla-calendar-grid { 56657 display: grid; 56658 flex-grow: 1; 56659 grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 56660 gap: 1.75em; 56661 } 56662 .vanilla-calendar-grid.vanilla-calendar-grid_disabled .vanilla-calendar-column { 56663 pointer-events: none; 56664 opacity: 0.3; 56665 } 56666 .vanilla-calendar-grid.vanilla-calendar-grid_disabled .vanilla-calendar-column.vanilla-calendar-column_month, 56667 .vanilla-calendar-grid.vanilla-calendar-grid_disabled .vanilla-calendar-column.vanilla-calendar-column_year {
56668 pointer-events: auto; 56669 opacity: 1; 56670 } 56671 .vanilla-calendar-column { 56672 display: flex; 56673 min-width: -webkit-min-content; 56674 min-width: min-content; 56675 flex-direction: column; 56676 } 56677 .vanilla-calendar-header { 56678 position: relative; 56679 margin-bottom: 0.75em; 56680 display: flex; 56681 align-items: center; 56682 } 56683 .vanilla-calendar-header__content { 56684 display: grid; 56685 flex-grow: 1; 56686 grid-auto-columns: -webkit-max-content; 56687 grid-auto-columns: max-content; 56688 grid-auto-flow: column; 56689 align-items: center; 56690 justify-content: center; 56691 white-space: pre-wrap; 56692 padding-left: 1em; 56693 padding-right: 1em; 56694 } 56695 .vanilla-calendar-month, 56696 .vanilla-calendar-year { 56697 cursor: pointer; 56698 border-radius: var(--sc-rounded-sm); 56699 border-width: 0px; 56700 background-color: transparent; 56701 padding: 0.25em; 56702 font-size: 1em; 56703 line-height: 1.5em; 56704 font-weight: 700; 56705 } 56706 .vanilla-calendar-month.vanilla-calendar-month_disabled, 56707 .vanilla-calendar-year.vanilla-calendar-year_disabled { 56708 pointer-events: none; 56709 } 56710 .vanilla-calendar-months { 56711 display: grid; 56712 flex-grow: 1; 56713 grid-template-columns: repeat(4, minmax(0, 1fr)); 56714 align-items: center; 56715 row-gap: 1em; 56716 column-gap: 0.5em; 56717 } 56718 .vanilla-calendar-years { 56719 display: grid; 56720 flex-grow: 1; 56721 grid-template-columns: repeat(5, minmax(0, 1fr)); 56722 align-items: center; 56723 row-gap: 1em; 56724 column-gap: 0.5em; 56725 } 56726 .vanilla-calendar-months_selecting .vanilla-calendar-months__month, 56727 .vanilla-calendar-years_selecting .vanilla-calendar-years__year { 56728 cursor: pointer; 56729 } 56730 .vanilla-calendar-months_selecting .vanilla-calendar-months__month .vanilla-calendar-months__month_disabled, 56731 .vanilla-calendar-years_selecting .vanilla-calendar-years__year .vanilla-calendar-years__year_disabled { 56732 cursor: default; 56733 } 56734 .vanilla-calendar-months__month, 56735 .vanilla-calendar-years__year { 56736 display: flex; 56737 height: 2.5em; 56738 align-items: center; 56739 justify-content: center; 56740 word-break: break-all; 56741 border-radius: var(-sc-rounded); 56742 border-width: 0px; 56743 padding: 0.25em; 56744 text-align: center; 56745 font-size: 0.75em; 56746 line-height: 1em; 56747 font-weight: 600; 56748 } 56749 .vanilla-calendar-months__month.vanilla-calendar-months__month_disabled, 56750 .vanilla-calendar-years__year.vanilla-calendar-years__year_disabled { 56751 pointer-events: none; 56752 } 56753 .vanilla-calendar-week-numbers { 56754 display: flex; 56755 flex-direction: column; 56756 } 56757 .vanilla-calendar-week-numbers__title { 56758 margin-bottom: 0.5em; 56759 display: flex; 56760 align-items: center; 56761 justify-content: center; 56762 font-size: 0.75em; 56763 line-height: 1em; 56764 font-weight: 700; 56765 } 56766 .vanilla-calendar-week-numbers__content { 56767 display: grid; 56768 grid-auto-flow: row; 56769 align-items: center; 56770 justify-items: center; 56771 row-gap: 0.25em; 56772 } 56773 .vanilla-calendar-week-number { 56774 margin: 0; 56775 display: flex; 56776 height: 100%; 56777 min-height: 1.875em; 56778 width: 100%; 56779 min-width: 1.875em; 56780 cursor: pointer;
56781 align-items: center; 56782 justify-content: center; 56783 border-style: none; 56784 background-color: transparent; 56785 padding: 0; 56786 font-size: 0.75em; 56787 line-height: 1em; 56788 font-weight: 600; 56789 } 56790 .vanilla-calendar-wrapper { 56791 display: flex; 56792 flex-grow: 1; 56793 } 56794 .vanilla-calendar-content { 56795 display: flex; 56796 flex-grow: 1; 56797 flex-direction: column; 56798 } 56799 .vanilla-calendar-week { 56800 margin-bottom: 0.5em; 56801 display: grid; 56802 grid-template-columns: repeat(7, 1fr); 56803 justify-items: center; 56804 } 56805 .vanilla-calendar-week__day { 56806 display: flex; 56807 height: 100%; 56808 width: 100%; 56809 min-width: 1.875em; 56810 align-items: center; 56811 justify-content: center; 56812 font-size: 0.75em; 56813 line-height: 1em; 56814 font-weight: 700; 56815 } 56816 .vanilla-calendar-days { 56817 display: grid; 56818 flex-grow: 1; 56819 grid-template-columns: repeat(7, 1fr); 56820 align-items: center; 56821 justify-items: center; 56822 gap: 0.25em; 56823 } 56824 .vanilla-calendar-days_selecting .vanilla-calendar-day__btn { 56825 cursor: pointer; 56826 } 56827 .vanilla-calendar-days_selecting .vanilla-calendar-day__btn_disabled { 56828 cursor: default; 56829 } 56830 .vanilla-calendar-day { 56831 position: relative; 56832 display: flex; 56833 height: 100%; 56834 width: 100%; 56835 align-items: center; 56836 justify-content: center; 56837 } 56838 .vanilla-calendar-day:focus-visible .vanilla-calendar-day__popup, 56839 .vanilla-calendar-day:hover .vanilla-calendar-day__popup { 56840 pointer-events: auto; 56841 opacity: 1; 56842 } 56843 .vanilla-calendar-day_selected-first .vanilla-calendar-day__btn_selected { 56844 border-top-right-radius: 0; 56845 border-bottom-right-radius: 0; 56846 border-top-left-radius: 0.5em; 56847 border-bottom-left-radius: 0.5em; 56848 } 56849 .vanilla-calendar-day_selected-last .vanilla-calendar-day__btn_selected { 56850 border-top-left-radius: 0; 56851 border-bottom-left-radius: 0; 56852 border-top-right-radius: 0.5em; 56853 border-bottom-right-radius: 0.5em; 56854 } 56855 .vanilla-calendar-day_selected-intermediate .vanilla-calendar-day__btn_selected_intermediate { 56856 border-radius: 0; 56857 } 56858 .vanilla-calendar-day__btn { 56859 display: flex; 56860 height: 100%; 56861 min-height: 1.875em; 56862 width: 100%; 56863 min-width: 1.875em; 56864 cursor: default; 56865 align-items: center; 56866 justify-content: center; 56867 border-radius: var(-sc-rounded); 56868 border-width: 0px; 56869 font-size: 0.75em; 56870 line-height: 1em; 56871 font-weight: 400; 56872 } 56873 .vanilla-calendar-day__btn_today { 56874 font-weight: 700; 56875 } 56876 .vanilla-calendar-day__btn_disabled { 56877 pointer-events: none; 56878 } 56879 .vanilla-calendar-day__popup { 56880 transform: translate(-50%); 56881 pointer-events: none; 56882 position: absolute; 56883 left: 50%; 56884 top: 100%; 56885 z-index: 20; 56886 width: 8em; 56887 padding: 1em 0.75em 0.5em; 56888 font-size: 0.75em; 56889 line-height: 1em; 56890 font-weight: 400; 56891 opacity: 0; 56892 } 56893 .vanilla-calendar-day__popup:before { 56894 content: var(--tw-content); 56895 position: absolute; 56896 } 56897 .vanilla-calendar-day__popup:after { 56898 content: var(--tw-content); 56899 position: absolute; 56900 } 56901 .vanilla-calendar-day__popup:hover { 56902 pointer-events: auto; 56903 opacity: 1; 56904 } 56905 .vanilla-calendar-day__popup:before { 56906 content: ""; 56907 left: 0; 56908 bottom: 0; 56909 z-index: -10; 56910 display: block; 56911 height: calc(100% - 8px); 56912 width: 100%; 56913 border-radius: var(-sc-rounded); 56914 } 56915 .vanilla-calendar-day__popup:after { 56916 content: ""; 56917 transform: translate(-50%); 56918 left: 50%; 56919 top: 1px; 56920 z-index: -10; 56921 display: block; 56922 height: 0px; 56923 width: 0px; 56924 border-left-width: 8px; 56925 border-right-width: 8px; 56926 border-top-width: 0px; 56927 border-bottom-width: 8px; 56928 border-style: solid; 56929 border-left-color: transparent; 56930 border-right-color: transparent; 56931 border-top-color: transparent; 56932 } 56933 .vanilla-calendar-time { 56934 margin-top: 0.75em; 56935 display: grid; 56936 grid-template-columns: auto 1fr; 56937 gap: 0.75em; 56938 border-top-width: 1px; 56939 border-bottom-width: 0px; 56940 border-left-width: 0px; 56941 border-right-width: 0px; 56942 border-style: solid; 56943 padding-top: 0.75em; 56944 } 56945 .vanilla-calendar-time__content { 56946 display: grid; 56947 grid-auto-flow: column; 56948 align-items: center; 56949 } 56950 .vanilla-calendar-time__hours { 56951 position: relative; 56952 margin-right: 0.35em; 56953 width: 1.75em; 56954 } 56955 .vanilla-calendar-time__hours:after { 56956 position: absolute; 56957 right: -5px; 56958 top: 50%; 56959 margin-top: calc(-50% + 1px); 56960 display: block; 56961 --tw-content: ":"; 56962 content: var(--tw-content); 56963 } 56964 .vanilla-calendar-time__minutes { 56965 width: 1.75em; 56966 } 56967 .vanilla-calendar-time__hours input, 56968 .vanilla-calendar-time__minutes input { 56969 position: relative; 56970 margin: 0; 56971 box-sizing: border-box; 56972 display: block; 56973 width: 100%; 56974 border-radius: var(--sc-rounded-sm); 56975 border-width: 0px; 56976 padding: 0.125em; 56977 text-align: center; 56978 font-size: 1.125em; 56979 font-weight: 600; 56980 line-height: 1.125em; 56981 } 56982 .vanilla-calendar-time__hours input:focus-visible, 56983 .vanilla-calendar-time__minutes input:focus-visible { 56984 outline-style: solid; 56985 outline-width: 1px; 56986 } 56987 .vanilla-calendar-time__hours input:disabled, 56988 .vanilla-calendar-time__minutes input:disabled { 56989 cursor: default; 56990 } 56991 .vanilla-calendar-time__hours input:hover:disabled, 56992 .vanilla-calendar-time__minutes input:hover:disabled { 56993 background-color: transparent; 56994 } 56995 .vanilla-calendar-time__keeping { 56996 margin-left: 1px; 56997 margin-top: 0.25em; 56998 width: 22px; 56999 cursor: pointer; 57000 border-radius: var(--sc-rounded-sm); 57001 border-width: 0px; 57002 background-color: transparent; 57003 padding: 0; 57004 font-size: 11px; 57005 } 57006 .vanilla-calendar-time__keeping:focus-visible { 57007 outline-style: solid; 57008 outline-width: 1px; 57009 } 57010 .vanilla-calendar-time__keeping:disabled { 57011 cursor: default; 57012 } 57013 .vanilla-calendar-time__keeping:hover:disabled { 57014 background-color: transparent; 57015 } 57016 .vanilla-calendar-time__ranges { 57017 display: grid; 57018 grid-auto-flow: row; 57019 } 57020 .vanilla-calendar-time__range { 57021 position: relative; 57022 z-index: 10; 57023 font-size: 0; 57024 } 57025 .vanilla-calendar-time__range:before { 57026 content: var(--tw-content); 57027 left: 0; 57028 } 57029 .vanilla-calendar-time__range:after { 57030 content: var(--tw-content); 57031 right: 0; 57032 } 57033 .vanilla-calendar-time__range:before, 57034 .vanilla-calendar-time__range:after { 57035 content: ""; 57036 transform: translateY(-50%); 57037 pointer-events: none; 57038 position: absolute; 57039 top: 50%; 57040 z-index: 10; 57041 height: 0.5em; 57042 width: 1px; 57043 } 57044 .vanilla-calendar-time__range input { 57045 position: relative; 57046 margin: 0; 57047 height: 1.25em; 57048 width: 100%; 57049 cursor: pointer; 57050 -webkit-appearance: none; 57051 appearance: none; 57052 outline-width: 0px; 57053 } 57054 .vanilla-calendar-time__range input::-webkit-slider-thumb { 57055 position: relative; 57056 z-index: 20; 57057 margin-top: -0.5em; 57058 box-sizing: border-box; 57059 height: 1em; 57060 width: 0.75em; 57061 cursor: pointer; 57062 -webkit-appearance: none; 57063 appearance: none; 57064 border-radius: var(--sc-rounded-sm); 57065 border-width: 1px; 57066 border-style: solid; 57067 --tw-shadow: 0 0 #0000; 57068 --tw-shadow-colored: 0 0 #0000; 57069 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-sha
57069dow); 57070 } 57071 .vanilla-calendar-time__range input::-moz-range-thumb { 57072 position: relative; 57073 z-index: 20; 57074 box-sizing: border-box; 57075 height: 1em; 57076 width: 0.75em; 57077 cursor: pointer; 57078 border-radius: var(--sc-rounded-sm); 57079 border-width: 1px; 57080 border-style: solid; 57081 --tw-shadow: 0 0 #0000; 57082 --tw-shadow-colored: 0 0 #0000; 57083 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 57084 } 57085 .vanilla-calendar-time__range input::-webkit-slider-runnable-track { 57086 margin-top: 1px; 57087 box-sizing: border-box; 57088 height: 1px; 57089 width: 100%; 57090 cursor: pointer; 57091 --tw-shadow: 0 0 #0000; 57092 --tw-shadow-colored: 0 0 #0000; 57093 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 57094 } 57095 .vanilla-calendar-time__range input::-moz-range-track { 57096 margin-top: 1px; 57097 box-sizing: border-box; 57098 height: 1px; 57099 width: 100%; 57100 cursor: pointer; 57101 --tw-shadow: 0 0 #0000; 57102 --tw-shadow-colored: 0 0 #0000; 57103 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-sha
57103dow); 57104 } 57105 57106 .vanilla-calendar-day { 57107 width: 2em; 57108 height: 2em; 57109 color: var(--sc-base-content); 57110 } 57111 57112 .vanilla-calendar-day__btn { 57113 border-radius: 50% !important; 57114 font-weight: 600; 57115 box-shadow: 0 0 0 0 var(--sc-base-100); 57116 } 57117 57118 .vanilla-calendar-week__day_weekend, 57119 .vanilla-calendar-day__btn_weekend, 57120 .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_disabled { 57121 color: var(--sc-base-700); 57122 } 57123 57124 .vanilla-calendar-day__btn_disabled { 57125 border-color: transparent; 57126 opacity: 0.7; 57127 color: var(--sc-base-content); 57128 background-color: transparent; 57129 font-weight: 400; 57130 } 57131 57132 .vanilla-calendar-day__btn_today { 57133 font-weight: 600 !important; 57134 } 57135 .vanilla-calendar-day__btn:not(.vanilla-calendar-day__btn_disabled) { 57136 border-radius: 50% !important; 57137 font-weight: 600; 57138 color: var(--sc-base-content); 57139 background: var(--sc-base-100); 57140 box-shadow: 0 0 0 0 var(--sc-base-100); 57141 } 57142 57143 /* !! SUPERSONIKS !! */ 57144 .vanilla-calendar-day__btn:focus, 57145 .vanilla-calendar-day__btn:hover { 57146 box-shadow: 0 0 0 2px var(--sc-base-content); 57147 } 57148 57149 .vanilla-calendar-day__btn:focus, 57150 .vanilla-calendar-day__btn:hover, 57151 .vanilla-calendar-day__btn_selected { 57152 transition: 0.1s; 57153 background-color: var(--sc-base-content) !important; 57154 color: var(--sc-base) !important; 57155 } 57156 /* YEAR */ 57157 .vanilla-calendar-months__month, 57158 .vanilla-calendar-years__year { 57159 border-radius: var(--sc-rounded); 57160 } 57161 57162 .vanilla-calendar-months__month:hover, 57163 .vanilla-calendar-months__month:focus, 57164 .vanilla-calendar-years__year:focus, 57165 .vanilla-calendar-years__year:hover { 57166 background: var(--sc-base-100); 57167 } 57168 .vanilla-calendar-months__month_disabled, 57169 .vanilla-calendar-years__year_disabled { 57170 color: var(--sc-base-400); 57171 } 57172`; 57173 var __defProp$15 = Object.defineProperty; 57174 var __getOwnPropDesc$18 = Object.getOwnPropertyDescriptor; 57175 var __decorateClass$18 = (decorators, target, key, kind) => { 57176 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$18(target, key) : target; 57177 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 57178 if (decorator = decorators[i2]) 57179 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 57180 if (kind && result) __defProp$15(target, key, result); 57181 return result; 57182 }; 57183 const WarningKeys = ["almost_full_here", "almost_full_places", "almost_full", "remaining_places_warning", "deferred"]; 57184 const UnavailableKeys = ["full", "full_here", "full_in_no_quota", "canceled", "forced_to_full"]; 57185 const tagName$S = "sonic-buy-calendar"; 57186 let SonicBuyCalendar = class extends Subscriber$1(i$6) { 57187 constructor() { 57188 super(...arguments); 57189 this.initialized = false; 57190 this.sessions = []; 57191 this.dates = []; 57192 this.displayInfos = false; 57193 this.sessionStatuses = []; 57194 this._filteredSessions = []; 57195 this.formatDateForCalendar = (date2) => { 57196 return date2.toLocaleDateString("en-GB", { 57197 year: "numeric", 57198 month: "2-digit", 57199 day: "2-digit" 57200 }).split("/").reverse().join("-"); 57201 }; 57202 } 57203 // INITIALISATION DU CALENDRIER 57204 initCalendar(enabledDates = [], container) { 57205 const htmlLang = HTML$1.getLanguage(); 57206 const options = { 57207 actions: { 57208 clickDay: (_2, _self) => { 57209 if (_self) { 57210 this.selectedDay = _self.selectedDates[0]; 57211 } 57212 } 57213 }, 57214 settings: { 57215 lang: htmlLang, 57216 range: { 57217 disableAllDays: true 57218 } 57219 } 57220 }; 57221 if (options?.settings?.range) { 57222 options.settings.range.enabled = enabledDates; 57223 } 57224 const today = /* @__PURE__ */ new Date(); 57225 today.setHours(0, 0, 0, 0); 57226 const firstUpcomingDate = enabledDates.find((date2) => { 57227 const [year, month, day] = date2.split("-").map(Number); 57228 const dateObj = new Date(year, month - 1, day); 57229 return dateObj >= today; 57230 }) || enabledDates[0]; 57231 if (firstUpcomingDate) { 57232 const [year, month] = firstUpcomingDate.split("-").map(Number); 57233 if (options?.settings) { 57234 options.settings.selected = { 57235 month: month - 1, 57236 year 57237 }; 57238 } 57239 } 57240 this.calendar = new VanillaCalendar(container, options);
57241 this.calendar.init(); 57242 } 57243 async updated(changedProperties) { 57244 if (changedProperties.has("sessions")) { 57245 if (this.sessions.length && this.calendarContainer) { 57246 const enabledDates = this.sessions.map((session) => { 57247 if (session.start_date) { 57248 const date2 = new Date(session.start_date * 1e3); 57249 return date2.toLocaleDateString("en-GB", { 57250 year: "numeric", 57251 month: "2-digit", 57252 day: "2-digit" 57253 }).split("/").reverse().join("-"); 57254 } else { 57255 return ""; 57256 } 57257 }); 57258 if (!this.calendar) { 57259 this.initCalendar(enabledDates, this.calendarContainer); 57260 } else { 57261 this.calendar.settings.range.enabled = enabledDates; 57262 this.calendar.update(); 57263 } 57264 if (this.sessions.length && this.calendar) { 57265 this.sessionStatuses = await this.getSatusInfo(this.sessions); 57266 const popupSettings = await this.getPopupSettings(); 57267 this.calendar.popups = popupSettings; 57268 this.displayInfos = Object.keys(popupSettings).length > 0; 57269 this.calendar.update(); 57270 } 57271 } 57272 if (!this.initialized) { 57273 const urlParams = new URLSearchParams(window.location.search); 57274 const sessionId = urlParams.get("session"); 57275 if (sessionId) { 57276 const session = this.sessions.find((s2) => s2.id === parseInt(sessionId)); 57277 if (session?.start_date) { 57278 const date2 = new Date(session.start_date * 1e3); 57279 this.selectedDay = this.formatDateForCalendar(date2); 57280 } 57281 } 57282 this.initialized = true; 57283 } 57284 } 57285 if (changedProperties.has("selectedDay")) { 57286 this._filteredSessions = this.sessions?.filter((session) => { 57287 if (!session.start_date) { 57288 return false; 57289 } 57290 const date2 = new Date(session.start_date * 1e3); 57291 return this.formatDateForCalendar(date2) === this.selectedDay; 57292 }); 57293 } 57294 super.willUpdate(changedProperties); 57295 } 57296 async getSatusInfo(sessions) { 57297 const api2 = new API(this.getApiConfiguration()); 57298 const ids = sessions.map((session) => session.id).join(","); 57299 const eventsData = await api2.get(`/sessions?ids=${ids}&features[]=status`); 57300 return eventsData.data; 57301 } 57302 // 57303 async getPopupSettings() { 57304 const events = this.sessionStatuses; 57305 const eventsStatusByDay = {}; 57306 events.forEach((event) => { 57307 if (!event.start_date) { 57308 return; 57309 } 57310 const date2 = new Date(event.start_date * 1e3); 57311 const day = this.formatDateForCalendar(date2); 57312 if (!eventsStatusByDay[day]) { 57313 eventsStatusByDay[day] = []; 57314 } 57315 const isAvailable = event.infos_status?.additionnals?.some((additionnal) => { 57316 if (!additionnal.key) return true; 57317 return !UnavailableKeys.includes(additionnal.key); 57318 }); 57319 const isWarning = event.infos_status?.additionnals?.some((additionnal) => { 57320 if (!additionnal.key) return false; 57321 return WarningKeys.includes(additionnal.key); 57322 }); 57323 eventsStatusByDay[day].push({ 57324 isAvailable: isAvailable || false, 57325 isWarning: isWarning || false 57326 }); 57327 }); 57328 const popupSettings = {}; 57329 Object.keys(eventsStatusByDay).forEach((day) => { 57330 const modifierClass = this.getModifierClass(eventsStatusByDay[day]); 57331 if (modifierClass) { 57332 popupSettings[day] = { 57333 modifier: modifierClass 57334 }; 57335 } 57336 }); 57337 return popupSettings; 57338 } 57339 getModifierClass(eventsDayStatus) { 57340 const isUnavailable = eventsDayStatus.length > 0 && eventsDayStatus.every((status) => status.isAvailable === false); 57341 if (isUnavailable) { 57342 return "calendar-danger-dot"; 57343 } 57344 const isWarning = eventsDayStatus.every((status) => status.isWarning === true || status.isAvailable === false); 57345 if (isWarning) { 57346 return "calendar-warning-dot"; 57347 } else { 57348 return false;
57349 } 57350 } 57351 // unset selected day 57352 unsetSelectedDay() { 57353 this.calendar?.update({ 57354 dates: true 57355 }); 57356 this.selectedDay = null; 57357 } 57358 render() { 57359 let startOfDay; 57360 if (this.selectedDay) { 57361 const date2 = new Date(this.selectedDay); 57362 startOfDay = date2.getTime() / 1e3; 57363 } 57364 const justifyClass = flexJustify(this.align); 57365 return b$1` 57366 <div class="${this.selectedDay ? "hidden" : " @container"}"> 57367 <div 57368 class="font-headings text-lg @2xl:text-xl @3xl:text-3xl @xl:leading-tight @3xl:leading-tight m-1 @3xl:mb-3 flex gap-2 items-center ${justifyClass}" 57369 > 57370 <sonic-icon library="custom" name="calendar-day"></sonic-icon> ${t("select_a_day")} 57371 </div> 57372 <sonic-fieldset class="@container mb-0"> 57373 <div class="@md:flex gap-4 ${justifyClass}"> 57374 <div id="calendarContainer" class=" @xl:text-lg @2xl:text-xl"></div> 57375 57376 <div 57377 class=" grid-cols-1 gap-1 self-start @md:border-l @md:border-l-neutral-200 @md:pl-3 py-4 ${this.displayInfos ? "grid" : "hidden"}" 57378 > 57379 <div class="text-warning text-xs flex items-center font-bold gap-x-2"> 57380 <span class="bg-warning size-3 warning-triangle"></span><span> ${t("sold_out_soon")}</span> 57381 </div> 57382 <div class="text-danger text-xs flex items-center font-bold gap-x-2"> 57383 <span class="bg-danger rounded-full size-3"></span> <span> ${t("sold_out_or_canceled")}</span> 57384 </div> 57385 </div> 57386 </div> 57387 </sonic-fieldset> 57388 </div> 57389 57390 ${this.selectedDay && this._filteredSessions.length > 0 && this.id ? b$1`<sonic-tooltip label="${t("back_to_calendar")}"> 57391 <sonic-button type="primary" size="lg" @click=${this.unsetSelectedDay} class="mb-3 cursor-pointer"> 57392 <span class="font-bold flex gap-3"> 57393 <sonic-date date=${o$4(startOfDay)} noAutoFill hour="hidden" minute="hidden"></sonic-date> 57394 <span class="border-l-[1px] border-current block self-stretch "></span> 57395 <sonic-icon library="custom" name="xmark" class="self-center"></sonic-icon> 57396 </span> 57397 </sonic-button> 57398 </sonic-tooltip> 57399 <!-- 57400 Liste des séances du 57401 show filtrées par date 57402 --> 57403 <sonic-list 57404 class="grid gap-3 grid-cols-1" 57405 dataProvider="_filteredSessions/${this.id}" 57406 .props=${this._filteredSessions} 57407 > 57408 <template> 57409 <sonic-event-session-card onlyHours></sonic-event-session-card> 57410 </template> 57411 </sonic-list>` : A$1} 57412 `; 57413 } 57414 }; 57415 SonicBuyCalendar.styles = [ 57416 vanillaCalendarCSS, 57417 tailwind, 57418 i$9` 57419 .calendar-danger-dot::before, 57420 .calendar-danger-dot::after, 57421 .calendar-warning-dot::before, 57422 .calendar-warning-dot::after { 57423 width: 13px; 57424 height: 13px; 57425 display: inline-flex; 57426 vertical-align: middle; 57427 border-radius: 50%; 57428 content: ""; 57429 position: absolute; 57430 top: -3px; 57431 left: -2px; 57432 z-index: 3; 57433 } 57434 57435 /*OMBRE*/ 57436 .calendar-danger-dot::after, 57437 .calendar-warning-dot::after { 57438 transform: scale(1.3); 57439 z-index: 2; 57440 background-color: var(--sc-base); 57441 } 57442 57443 .calendar-warning-dot::after, 57444 .calendar-warning-dot::before { 57445 border-radius: 0; 57446 clip-path: polygon(50% 0, 0 100%, 100% 100%); 57447 } 57448 57449 .warning-triangle { 57450 clip-path: polygon(50% 0, 0 100%, 100% 100%); 57451 } 57452 57453 .calendar-warning-dot::before { 57454 background-color: var(--sc-warning); 57455 } 57456 .calendar-danger-dot::before { 57457 background-color: var(--sc-danger); 57458 } 57459 .calendar-warning-dot { 57460 --sc-base-content: var(--sc-warning); 57461 } 57462 .calendar-warning-dot:focus, 57463 .calendar-warning-dot:hover { 57464 color: var(--sc-warning-content) !important; 57465 } 57466 57467 .calendar-danger-dot { 57468 --sc-base-content: var(--sc-danger); 57469 } 57470 57471 .calendar-danger-dot:focus, 57472 .calendar-danger-dot:hover { 57473 color: var(--sc-danger-content) !important; 57474 } 57475 ` 57476 ]; 57477 __decorateClass$18([ 57478 e$7("#calendarContainer") 57479 ], SonicBuyCalendar.prototype, "calendarContainer", 2); 57480 __decorateClass$18([ 57481 c({ context: formTypeContext }), 57482 n$5({ type: String }) 57483 ], SonicBuyCalendar.prototype, "formType", 2); 57484 __decorateClass$18([ 57485 n$5({ type: Array }) 57486 ], SonicBuyCalendar.prototype, "sessions", 2); 57487 __decorateClass$18([ 57488 n$5({ type: Array }) 57489 ], SonicBuyCalendar.prototype, "dates", 2); 57490 __decorateClass$18([ 57491 r$5() 57492 ], SonicBuyCalendar.prototype, "selectedDay", 2); 57493 __decorateClass$18([ 57494 r$5() 57495 ], SonicBuyCalendar.prototype, "displayInfos", 2); 57496 __decorateClass$18([ 57497 c({ context: alignContext, subscribe: true }), 57498 n$5({ type: String, reflect: true }) 57499 ], SonicBuyCalendar.prototype, "align", 2); 57500 __decorateClass$18([ 57501 r$5() 57502 ], SonicBuyCalendar.prototype, "sessionStatuses", 2); 57503 __decorateClass$18([ 57504 r$5() 57505 ], SonicBuyCalendar.prototype, "_filteredSessions", 2); 57506 SonicBuyCalendar = __decorateClass$18([ 57507 t$3(tagName$S) 57508 ], SonicBuyCalendar); 57509 var __defProp$14 = Object.defineProperty; 57510 var __getOwnPropDesc$17 = Object.getOwnPropertyDescriptor; 57511 var __decorateClass$17 = (decorators, target, key, kind) => { 57512 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$17(target, key) : target; 57513 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 57514 if (decorator = decorators[i2]) 57515 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 57516 if (kind && result) __defProp$14(target, key, result); 57517 return result; 57518 }; 57519 const tagName$R = "sonic-buy-list"; 57520 let SonicBuyList = class extends Subscriber$1(i$6) { 57521 constructor() { 57522 super(...arguments); 57523 this.sessions = []; 57524 this.selectedSession = ""; 57525 this.formType = "select"; 57526 this.isInitialized = false;
57527 } 57528 // unset selected day 57529 unsetSelectedSession() { 57530 this.selectedSession = ""; 57531 } 57532 setSession(id) { 57533 this.selectedSession = id || ""; 57534 } 57535 willUpdate(changedProperties) { 57536 if (changedProperties.has("sessions") && !this.isInitialized) { 57537 const urlParams = new URLSearchParams(window.location.search); 57538 const sessionId = urlParams.get("session"); 57539 if (sessionId) this.setSession(sessionId); 57540 this.isInitialized = true; 57541 } 57542 } 57543 updated(changedProperties) { 57544 if (changedProperties.has("selectedSession") && this.selectedSession) { 57545 this.scrollIntoView({ behavior: "smooth", block: "start" }); 57546 } 57547 } 57548 render() { 57549 return b$1` 57550 <div class="${this.selectedSession ? "hidden" : " @container"}"> 57551 <div class="@container"> 57552 <div class="grid gap-3 grid-cols-1 @3xl:grid-cols-2"> 57553 ${o$1( 57554 this.sessions, 57555 (session) => b$1`<sonic-event-card 57556 tabindex="0" 57557 class="cursor-pointer" 57558 @keypress=${(e2) => { 57559 if (e2.key === "Enter") this.setSession(session.id); 57560 }} 57561 @click=${() => this.setSession(session.id)} 57562 dataProvider="eventListGroup/${session.id}" 57563 noAutoFill 57564 displayLocation 57565 .props=${session} 57566 ></sonic-event-card>` 57567 )} 57568 </div> 57569 </div> 57570 </div> 57571 ${this.selectedSession ? b$1`<sonic-fetch 57572 dataProvider="sessions/${this.selectedSession}?features[]=location&features[]=taxonomies&features[]=range&features[]=settings" 57573 key="data" 57574 > 57575 <sonic-event-session-card alwaysExpanded expanded .id=${this.selectedSession.toString()}> 57576 <div slot="prefix" class="flex"> 57577 <sonic-product-title class="text-3xl mb-4 text-left align-middle"></sonic-product-title> 57578 <sonic-tooltip label="${t("back_to_sessions")}" class="flex ml-auto self-start"> 57579 <sonic-button 57580 shape="circle" 57581 size="xl" 57582 type="neutral" 57583 @click=${this.unsetSelectedSession} 57584 class="translate-x-1 -translate-y-1 " 57585 > 57586 <sonic-icon library="custom" name="xmark" class="self-center"></sonic-icon> 57587 </sonic-button> 57588 </sonic-tooltip> 57589 </div> 57590 </sonic-event-session-card> 57591 </sonic-fetch>` : A$1} 57592 `; 57593 } 57594 }; 57595 SonicBuyList.styles = [tailwind]; 57596 __decorateClass$17([ 57597 n$5({ type: Array }) 57598 ], SonicBuyList.prototype, "sessions", 2); 57599 __decorateClass$17([ 57600 r$5() 57601 ], SonicBuyList.prototype, "selectedSession", 2); 57602 __decorateClass$17([ 57603 e$2({ context: formTypeContext }), 57604 n$5({ type: String }) 57605 ], SonicBuyList.prototype, "formType", 2); 57606 SonicBuyList = __decorateClass$17([ 57607 t$3(tagName$R) 57608 ], SonicBuyList); 57609 var __defProp$13 = Object.defineProperty; 57610 var __getOwnPropDesc$16 = Object.getOwnPropertyDescriptor; 57611 var __decorateClass$16 = (decorators, target, key, kind) => { 57612 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$16(target, key) : target; 57613 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 57614 if (decorator = decorators[i2]) 57615 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 57616 if (kind && result) __defProp$13(target, key, result); 57617 return result; 57618 }; 57619 const tagName$Q = "sonic-buy"; 57620 let BuyEventBlock = class extends EventContext(Fetcher$1(Subscriber$1(i$6))) { 57621 constructor() { 57622 super(...arguments); 57623 this.sessions = []; 57624 this.cleanData = false; 57625 this.formType = "select"; 57626 this.formSize = "sm"; 57627 this.displayPast = false; 57628 this.display = "default"; 57629 } 57630 connectedCallback() { 57631 this.isFetchEnabled = this.hasAttribute("fetch"); 57632 const cleanDataParameter = this.cleanData ? "&clean_sessions_data=true" : ""; 57633 const nextParameter = !this.displayPast ? "&next=true" : ""; 57634 if (this.isFetchEnabled && this.id) { 57635 this.dataProvider = `shows/${this.id}?view=essential${cleanDataParameter + nextParameter}`; 57636 this.key = "data"; 57637 } 57638 super.connectedCallback(); 57639 } 57640 render() { 57641 if (!this.props) return A$1; 57642 if (this.display == "list") { 57643 return b$1`<sonic-buy-list></sonic-buy-list>`; 57644 } else if (this.display == "calendar") { 57645 return b$1`<sonic-buy-calendar></sonic-buy-calendar>`; 57646 } else { 57647 return b$1`<sonic-list subDataProvider="sessions" class="grid gap-3 grid-cols-1"> 57648 <template> 57649 <sonic-event-session-card></sonic-event-session-card> 57650 </template> 57651 </sonic-list>`; 57652 } 57653 } 57654 }; 57655 BuyEventBlock.styles = [ 57656 tailwind, 57657 i$9` 57658 :host { 57659 display: block; 57660 } 57661 ` 57662 ]; 57663 __decorateClass$16([ 57664 n$5({ type: Array }) 57665 ], BuyEventBlock.prototype, "sessions", 2); 57666 __decorateClass$16([ 57667 n$5({ type: Boolean }) 57668 ], BuyEventBlock.prototype, "cleanData", 2); 57669 __decorateClass$16([ 57670 e$2({ context: formTypeContext }), 57671 n$5({ type: String }) 57672 ], BuyEventBlock.prototype, "formType", 2); 57673 __decorateClass$16([ 57674 n$5({ type: String }) 57675 ], BuyEventBlock.prototype, "formSize", 2); 57676 __decorateClass$16([ 57677 n$5({ type: Boolean }) 57678 ], BuyEventBlock.prototype, "displayPast", 2); 57679 __decorateClass$16([ 57680 n$5({ type: String }) 57681 ], BuyEventBlock.prototype, "display", 2); 57682 __decorateClass$16([ 57683 e$2({ context: alignContext }), 57684 n$5({ type: String }) 57685 ], BuyEventBlock.prototype, "align", 2); 57686 BuyEventBlock = __decorateClass$16([ 57687 t$3(tagName$Q), 57688 awaitConnectedAncestors(APP_TAG_SELECTOR) 57689 ], BuyEventBlock); 57690 var __defProp$12 = Object.defineProperty; 57691 var __getOwnPropDesc$15 = Object.getOwnPropertyDescriptor; 57692 var __decorateClass$15 = (decorators, target, key, kind) => { 57693 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$15(target, key) : target; 57694 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 57695 if (decorator = decorators[i2]) 57696 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 57697 if (kind && result) __defProp$12(target, key, result); 57698 return result; 57699 }; 57700 const tagName$P = "sonic-event-page"; 57701 let EventPage = class extends Fetcher$1(Subscriber$1(i$6)) { 57702 constructor() { 57703 super(...arguments); 57704 this.edito = {}; 57705 this.sessions = []; 57706 this.site_link = ""; 57707 this.noRelated = false;
57708 this.noNavigation = false; 57709 this.staticMode = false; 57710 } 57711 handleIsWaiting(value) { 57712 if (!this.staticMode && !this.fetchedData && value === false) { 57713 this.isFetchEnabled = true; 57714 this.key = "data"; 57715 this._fetchData(); 57716 } 57717 } 57718 connectedCallback() { 57719 this.staticMode = !this.hasAttribute("fetch"); 57720 this.isFetchEnabled = false; 57721 if (this.id) { 57722 this.dataProvider = `shows/${this.id}?clean_sessions_data=true&view=essential&next=true`; 57723 } 57724 super.connectedCallback(); 57725 } 57726 render() { 57727 if (this.isWaiting) return A$1; 57728 const isOnError = this.props === null || this.props?.edito === null && this.props?.sessions === null; 57729 if (isOnError) { 57730 return b$1`<sonic-alert size="lg" status="error" label="${t("error_title")}" 57731 >${t("LIB_event_404")}</sonic-alert 57732 >`; 57733 } 57734 if (!this.props) return A$1; 57735 return b$1` 57736 <div class="@container"> 57737 <div class="grid grid-cols-1 @4xl:grid-cols-2 gap-5 @4xl:gap-12"> 57738 <!-- ILLUSTRATION MOBILE --> 57739 <div class="overflow-hidden rounded-lg @4xl:hidden relative "> 57740 ${!this.noNavigation ? b$1`<div class="absolute top-5 left-4 z-10"> 57741 <sonic-button 57742 data-aria-label=${o$4(t("back"))} 57743 goBack=${appRoute("home")} 57744 shape="circle" 57745 noAutoFill 57746 variant="unstyled" 57747 class="text-2xl text-contrast-content drop-shadow-md" 57748 > 57749 <sonic-icon library="custom" name="arrow-left"></sonic-icon> 57750 </sonic-button> 57751 </div>` : A$1} 57752 57753 <sonic-product-illustration 57754 class="illustrationMobile" 57755 noFallback 57756 objectPosition="center top" 57757 ></sonic-product-illustration> 57758 </div> 57759 57760 <!-- MAIN --> 57761 <div> 57762 ${!this.noNavigation ? b$1`<div class="mb-3 relative hidden @4xl:block "> 57763 <sonic-button 57764 data-aria-label=${o$4(t("back"))} 57765 icon 57766 goBack=${appRoute("home")} 57767 shape="circle" 57768 size="sm" 57769 noAutoFill 57770 > 57771 <sonic-icon library="custom" name="arrow-left"></sonic-icon> 57772 </sonic-button> 57773 </div>` : A$1} 57774 57775 <div class="mb-3"> 57776 <sonic-product-title 57777 class="text-3xl md:text-5xl md:leading-[1.1] font-headings font-weight-headings font-style-headings block" 57778 ></sonic-product-title> 57779 </div> 57780 <div class="text-sm lg:text-base grid grid-cols-1 gap-1 mb-7"> 57781 <div class="flex flex-wrap items-center gap-x-3 gap-y-2 mb-3 lg:mb-5"> 57782 <sonic-event-scheduled-status size="inherit" variant="default"></sonic-event-scheduled-status> 57783 <sonic-event-taxonomies size="inherit" class="contents"></sonic-event-taxonomies> 57784 </div> 57785 <sonic-event-location-hall class="w-full @md:w-auto " addressDisplay="text"></sonic-event-location-hall> 57786 <sonic-event-duration class="w-full @md:w-auto "></sonic-event-duration> 57787 </div> 57788 57789 ${this.edito?.body ? b$1`<div class="block mb-8 prose">${o$6(this.edito?.body)}</div> ` : A$1} 57790 ${this.site_link ? b$1` <sonic-event-site-link 57791 class="block text-sm mb-8 ${this.edito?.body ? "-mt-5" : "-mt-1"} " 57792 ></sonic-event-site-link>` : A$1} 57793 57794 <sonic-buy></sonic-buy> 57795 </div> 57796 57797 <!-- ASIDE --> 57798 <div class="hidden @4xl:block"> 57799 <sonic-product-illustration 57800 transition="fade-scale-out" 57801 rounded="lg" 57802 class="sticky top-4 aspect-square" 57803 noFallback 57804 ></sonic-product-illustration> 57805 </div> 57806 </div> 57807 ${!this.noRelated ? b$1` <sonic-related id="${this.id}" class="mt-12 lg:mt-16"></sonic-related> ` : A$1} 57808 </div> 57809 `; 57810 } 57811 }; 57812 EventPage.styles = [tailwind]; 57813 __decorateClass$15([ 57814 n$5({ type: Object }) 57815 ], EventPage.prototype, "edito", 2); 57816 __decorateClass$15([ 57817 n$5({ type: Array }) 57818 ], EventPage.prototype, "sessions", 2); 57819 __decorateClass$15([ 57820 n$5({ type: String }) 57821 ], EventPage.prototype, "site_link", 2); 57822 __decorateClass$15([ 57823 n$5({ type: Boolean }) 57824 ], EventPage.prototype, "noRelated", 2); 57825 __decorateClass$15([ 57826 n$5({ type: Boolean }) 57827 ], EventPage.prototype, "noNavigation", 2); 57828 __decorateClass$15([ 57829 bind$1("sonicTicketApp.isWaiting"), 57830 r$5() 57831 ], EventPage.prototype, "isWaiting", 2); 57832 __decorateClass$15([ 57833 e$2({ context: staticMode }), 57834 n$5({ type: Boolean }) 57835 ], EventPage.prototype, "staticMode", 2); 57836 __decorateClass$15([ 57837 onAssign$1("sonicTicketApp.isWaiting") 57838 ], EventPage.prototype, "handleIsWaiting", 1); 57839 EventPage = __decorateClass$15([ 57840 t$3(tagName$P) 57841 ], EventPage); 57842 var __defProp$11 = Object.defineProperty; 57843 var __getOwnPropDesc$14 = Object.getOwnPropertyDescriptor; 57844 var __decorateClass$14 = (decorators, target, key, kind) => { 57845 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$14(target, key) : target; 57846 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 57847 if (decorator = decorators[i2]) 57848 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 57849 if (kind && result) __defProp$11(target, key, result); 57850 return result; 57851 }; 57852 const tagName$O = "sonic-agenda-section-featured"; 57853 let SectionFeatured = class extends Fetcher$1(Subscriber$1(i$6)) { 57854 constructor() { 57855 super(...arguments); 57856 this.staticMode = false;
57857 this.displayMode = "card_cover"; 57858 } 57859 handleIsWaiting(value) { 57860 if (!this.staticMode && !this.fetchedData && value === false) { 57861 this.isFetchEnabled = true; 57862 this.key = "data"; 57863 this._fetchData(); 57864 } 57865 } 57866 connectedCallback() { 57867 this.staticMode = !this.hasAttribute("fetch"); 57868 this.isFetchEnabled = false; 57869 this.dataProvider = "/shows?featured=1&next=1&limit=3&clean_sessions_data=true&view=essential"; 57870 super.connectedCallback(); 57871 } 57872 render() { 57873 if (this.isWaiting) return A$1; 57874 if (this.props && Object.keys(this.props).length === 0) return A$1; 57875 return b$1` <div class="@container"> 57876 <sonic-list 57877 loader="inline" 57878 class="${this.displayMode === "page" ? "grid grid-cols-1 gap-16 mb-20" : "grid grid-cols-1 @xl:grid-cols-2 @6xl:grid-cols-3 gap-4"}" 57879 > 57880 ${this.displayMode === "page" ? b$1` <template> 57881 <sonic-event-page noNavigation noRelated></sonic-event-page> 57882 </template> 57883 <template data-value="separator"> <sonic-divider></sonic-divider></template>` : A$1} 57884 ${this.displayMode === "card_cover" ? b$1`<template data-value="skeleton"> 57885 <sonic-event-card-cover skeleton></sonic-event-card-cover> 57886 <sonic-event-card-cover skeleton></sonic-event-card-cover> 57887 <sonic-event-card-cover skeleton></sonic-event-card-cover> 57888 </template> 57889 <template> 57890 <sonic-event-card-cover></sonic-event-card-cover> 57891 </template>` : A$1} 57892 </sonic-list> 57893 </div>`; 57894 } 57895 }; 57896 SectionFeatured.styles = [ 57897 tailwind, 57898 i$9` 57899 :host { 57900 display: block; 57901 } 57902 ` 57903 ]; 57904 __decorateClass$14([ 57905 e$2({ context: staticMode }), 57906 n$5({ type: Boolean }) 57907 ], SectionFeatured.prototype, "staticMode", 2); 57908 __decorateClass$14([ 57909 bind$1("sonicTicketApp.isWaiting"), 57910 r$5() 57911 ], SectionFeatured.prototype, "isWaiting", 2); 57912 __decorateClass$14([ 57913 bind$1("settings.customer_ui.home.featured"), 57914 r$5() 57915 ], SectionFeatured.prototype, "displayMode", 2); 57916 __decorateClass$14([ 57917 onAssign$1("sonicTicketApp.isWaiting") 57918 ], SectionFeatured.prototype, "handleIsWaiting", 1); 57919 SectionFeatured = __decorateClass$14([ 57920 t$3(tagName$O) 57921 ], SectionFeatured); 57922 var __defProp$10 = Object.defineProperty; 57923 var __getOwnPropDesc$13 = Object.getOwnPropertyDescriptor; 57924 var __decorateClass$13 = (decorators, target, key, kind) => { 57925 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$13(target, key) : target; 57926 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 57927 if (decorator = decorators[i2]) 57928 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 57929 if (kind && result) __defProp$10(target, key, result); 57930 return result; 57931 }; 57932 const tagName$N = "sonic-quick-access-cards"; 57933 let SonicComponent$a = class SonicComponent extends i$6 { 57934 constructor() { 57935 super(...arguments); 57936 this.customAgendas = []; 57937 this.allowedModules = [ 57938 "agenda", 57939 "subscription", 57940 "carpooling", 57941 "giftcards", 57942 "accreditations_directory", 57943 "shop", 57944 "custom_agendas" 57945 ]; 57946 this.size = "md"; 57947 this.align = "center"; 57948 } 57949 async willUpdate(_changedProperties) { 57950 if (_changedProperties.has("settings")) { 57951 const hasCustomAgendas = this.settings?.modules?.custom_agendas?.access; 57952 this.customAgendas = hasCustomAgendas ? (await getAgendas(this, true)).filter((agenda) => agenda.isLinkEnabled === true) : []; 57953 } 57954 } 57955 render() { 57956 const { agenda, subscription, carpooling, giftcards, accreditations_directory, shop } = this.settings?.modules || {}; 57957 const agendaAccess = agenda?.access && this.allowedModules.includes("agenda"); 57958 const subscriptionAccess = subscription?.access && this.allowedModules.includes("subscription"); 57959 const carpoolingAccess = carpooling?.access && this.allowedModules.includes("carpooling"); 57960 const giftcardsAccess = giftcards?.access && this.allowedModules.includes("giftcards"); 57961 const shopAccess = shop?.access && this.allowedModules.includes("shop"); 57962 const accreditationDirectoryAccess = accreditations_directory?.access && this.allowedModules.includes("accreditations_directory"); 57963 const customAgendasAccess = this.customAgendas && this.customAgendas?.length > 0 && this.allowedModules.includes("custom_agendas"); 57964 if (!(subscriptionAccess || carpoolingAccess || giftcardsAccess || shopAccess || accreditationDirectoryAccess || agendaAccess || customAgendasAccess)) 57965 return A$1; 57966 const justify = this.align === "left" ? "justify-start" : "justify-center"; 57967 return b$1`<div class="flex gap-4 flex-wrap ${justify}"> 57968 ${agendaAccess ? this.renderCard({ 57969 href: appRoute("agenda").toString(), 57970 title: t("module_agenda_title"), 57971 text: o$4(t("module_agenda_summary")), 57972 icon: "calendar-day" 57973 }) : A$1} 57974 ${customAgendasAccess ? c$1( 57975 this.customAgendas || [], 57976 (agenda2) => agenda2.id, 57977 (agenda2) => this.renderCard({ 57978 href: appRoute("customAgenda").fill({ slug: agenda2.slug }).toString(), 57979 title: agenda2.title || "", 57980 text: agenda2.summary || "", 57981 icon: "calendar-star", 57982 type: "info" 57983 }) 57984 ) : A$1} 57985 ${subscriptionAccess ? this.renderCard({ 57986 href: appRoute("subscription").toString(), 57987 title: t("onglet_home_abonnements"), 57988 text: o$4(t("module_subscription_summary")), 57989 icon: "address-card", 57990 type: "warning" 57991 }) : A$1} 57992 ${shopAccess ? this.renderCard({ 57993 href: appRoute("shop").toString(), 57994 title: t("module_shop_title"), 57995 text: o$4(t("module_shop_summary")), 57996 icon: "bags-shopping", 57997 type: "info" 57998 }) : A$1} 57999 ${giftcardsAccess ? this.renderCard({ 58000 href: appRoute("giftcards").toString(), 58001 title: t("module_giftcards_title"), 58002 text: o$4(t("module_giftcards_summary")), 58003 icon: "gift-card", 58004 type: "danger" 58005 }) : A$1} 58006 ${accreditationDirectoryAccess ? this.renderCard({ 58007 href: appRoute("accreditationsDirectory").toString(), 58008 title: t("accreditations_directory_title"), 58009 text: o$4(t("accreditations_directory_summary")), 58010 icon: "address-book", 58011 type: "default" 58012 }) : A$1} 58013 ${carpoolingAccess ? this.renderCard({ 58014 href: appRoute("carpooling").toString(), 58015 title: t("module_carpooling_title"), 58016 text: o$4(t("module_carpooling_summary")), 58017 icon: "car-side", 58018 type: "success" 58019 }) : A$1} 58020 </div>`; 58021 } 58022 renderCard(options) { 58023 const { type = "default", href, title, text, icon: icon2 } = options; 58024 return b$1`<sonic-quick-access-card 58025 class="flex-grow max-w-[19rem] shrink-0" 58026 type=${type} 58027 href=${href} 58028 title=${title} 58029 text=${text} 58030 icon=${icon2} 58031 .size=${this.size} 58032 ></sonic-quick-access-card>`; 58033 } 58034 }; 58035 SonicComponent$a.styles = [ 58036 tailwind, 58037 i$9` 58038 :host { 58039 display: block; 58040 } 58041 ` 58042 ]; 58043 __decorateClass$13([ 58044 bind$1("settings"), 58045 n$5({ type: Object }) 58046 ], SonicComponent$a.prototype, "settings", 2); 58047 __decorateClass$13([ 58048 r$5() 58049 ], SonicComponent$a.prototype, "customAgendas", 2); 58050 __decorateClass$13([ 58051 n$5({ type: Array }) 58052 ], SonicComponent$a.prototype, "allowedModules", 2); 58053 __decorateClass$13([ 58054 n$5({ type: String }) 58055 ], SonicComponent$a.prototype, "size", 2); 58056 __decorateClass$13([ 58057 n$5({ type: String }) 58058 ], SonicComponent$a.prototype, "align", 2); 58059 SonicComponent$a = __decorateClass$13([ 58060 t$3(tagName$N) 58061 ], SonicComponent$a); 58062 var __defProp$$ = Object.defineProperty; 58063 var __getOwnPropDesc$12 = Object.getOwnPropertyDescriptor; 58064 var __decorateClass$12 = (decorators, target, key, kind) => { 58065 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$12(target, key) : target; 58066 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58067 if (decorator = decorators[i2]) 58068 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58069 if (kind && result) __defProp$$(target, key, result); 58070 return result; 58071 }; 58072 const tagName$M = "sonic-agenda-section-next"; 58073 let SonicComponent$9 = class SonicComponent extends Fetcher$1(Subscriber$1(i$6)) { 58074 constructor() { 58075 super(...arguments); 58076 this.wording_link_title_events_all = ""; 58077 this.wording_module_store_title = ""; 58078 this.wording_strate_title_events_next = ""; 58079 this.staticMode = false;
58080 } 58081 handleIsWaiting(value) { 58082 if (!this.staticMode && !this.fetchedData && value === false) { 58083 this.isFetchEnabled = true; 58084 this.key = "data"; 58085 this._fetchData(); 58086 } 58087 } 58088 connectedCallback() { 58089 this.staticMode = !this.hasAttribute("fetch"); 58090 this.isFetchEnabled = false; 58091 this.dataProvider = "/shows?next=1&limit=6&view=essential"; 58092 super.connectedCallback(); 58093 } 58094 render() { 58095 if (this.props && Object.keys(this.props).length === 0) return A$1; 58096 if (this.isWaiting) return A$1; 58097 return b$1`<h2 class="font-headings font-weight-headings font-style-headings mb-4 text-2xl lg:text-3xl "> 58098 <sonic-icon library="custom" prefix="regular" name="forward" class="mr-[.35em]"></sonic-icon> 58099 ${this.wording_strate_title_events_next} 58100 </h2> 58101 <div class="@container"> 58102 <sonic-list .props=${this.props} class="grid grid-cols-1 @3xl:grid-cols-2 @7xl:grid-cols-3 gap-4 "> 58103 <template data-value="skeleton"> 58104 <sonic-event-card skeleton></sonic-event-card> 58105 <sonic-event-card skeleton></sonic-event-card> 58106 <sonic-event-card skeleton class="@7xl:block hidden"></sonic-event-card> 58107 </template> 58108 <template> 58109 <sonic-event-card link></sonic-event-card> 58110 </template> 58111 </sonic-list> 58112 </div> 58113 58114 <div class="flex gap-x-2 gap-y-1 mt-4 flex-wrap"> 58115 <sonic-app-link type="primary" to="agenda" variant="default"> 58116 <sonic-icon slot="prefix" library="custom" prefix="regular" name="calendar-day"></sonic-icon> 58117 ${this.wording_link_title_events_all} 58118 </sonic-app-link> 58119 <sonic-app-link to="store" variant="ghost"> 58120 <sonic-icon slot="prefix" library="custom" prefix="regular" name="cart-shopping-fast"></sonic-icon> 58121 ${this.wording_module_store_title} 58122 </sonic-app-link> 58123 </div>`; 58124 } 58125 }; 58126 SonicComponent$9.styles = [tailwind]; 58127 __decorateClass$12([ 58128 n$5({ type: String }) 58129 ], SonicComponent$9.prototype, "wording_link_title_events_all", 2); 58130 __decorateClass$12([ 58131 n$5({ type: String }) 58132 ], SonicComponent$9.prototype, "wording_module_store_title", 2); 58133 __decorateClass$12([ 58134 n$5({ type: String }) 58135 ], SonicComponent$9.prototype, "wording_strate_title_events_next", 2); 58136 __decorateClass$12([ 58137 bind$1("sonicTicketApp.isWaiting"), 58138 r$5() 58139 ], SonicComponent$9.prototype, "isWaiting", 2); 58140 __decorateClass$12([ 58141 e$2({ context: staticMode }), 58142 n$5({ type: Boolean }) 58143 ], SonicComponent$9.prototype, "staticMode", 2); 58144 __decorateClass$12([ 58145 onAssign$1("sonicTicketApp.isWaiting") 58146 ], SonicComponent$9.prototype, "handleIsWaiting", 1); 58147 SonicComponent$9 = __decorateClass$12([ 58148 t$3(tagName$M) 58149 ], SonicComponent$9); 58150 var __defProp$_ = Object.defineProperty; 58151 var __getOwnPropDesc$11 = Object.getOwnPropertyDescriptor; 58152 var __decorateClass$11 = (decorators, target, key, kind) => { 58153 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$11(target, key) : target; 58154 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58155 if (decorator = decorators[i2]) 58156 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58157 if (kind && result) __defProp$_(target, key, result); 58158 return result; 58159 }; 58160 let EventStore = class extends Subscriber$1(i$6) { 58161 constructor() { 58162 super(...arguments); 58163 this.formType = "buttons"; 58164 this.displayTitle = false; 58165 this.smallTitle = false; 58166 this.displayText = false; 58167 this.cartProvider = "cart/current"; 58168 } 58169 render() { 58170 if (this.isWaiting) return A$1; 58171 const allowedModules = ["subscription", "giftcards", "shop"]; 58172 return b$1` 58173 <sonic-page-layout 58174 pageTitle=${t("module_store_title")} 58175 ?smallTitle=${this.smallTitle} 58176 ?displayTitle=${this.displayTitle} 58177 ?displayText=${this.displayText} 58178 class="@container block" 58179 > 58180 <sonic-quick-access-cards 58181 class="mb-8" 58182 .allowedModules=${allowedModules} 58183 size="sm" 58184 align="left" 58185 ></sonic-quick-access-cards> 58186 <sonic-event-store-content displayCart cartProvider="${this.cartProvider}"></sonic-event-store-content> 58187 </sonic-page-layout> 58188 `; 58189 } 58190 }; 58191 EventStore.styles = [tailwind]; 58192 __decorateClass$11([ 58193 n$5({ type: String }) 58194 ], EventStore.prototype, "formType", 2); 58195 __decorateClass$11([ 58196 n$5({ type: Boolean }) 58197 ], EventStore.prototype, "displayTitle", 2); 58198 __decorateClass$11([ 58199 n$5({ type: Boolean }) 58200 ], EventStore.prototype, "smallTitle", 2); 58201 __decorateClass$11([ 58202 n$5({ type: Boolean }) 58203 ], EventStore.prototype, "displayText", 2); 58204 __decorateClass$11([ 58205 n$5({ type: Array }) 58206 ], EventStore.prototype, "activity", 2); 58207 __decorateClass$11([ 58208 n$5({ type: Array }) 58209 ], EventStore.prototype, "category", 2); 58210 __decorateClass$11([ 58211 n$5({ type: Number }) 58212 ], EventStore.prototype, "agendaId", 2); 58213 __decorateClass$11([ 58214 n$5({ type: String }) 58215 ], EventStore.prototype, "cartProvider", 2); 58216 __decorateClass$11([ 58217 bind$1("sonicTicketApp.isWaiting"), 58218 r$5() 58219 ], EventStore.prototype, "isWaiting", 2); 58220 EventStore = __decorateClass$11([ 58221 t$3("sonic-event-store") 58222 ], EventStore); 58223 var __defProp$Z = Object.defineProperty; 58224 var __getOwnPropDesc$10 = Object.getOwnPropertyDescriptor; 58225 var __decorateClass$10 = (decorators, target, key, kind) => { 58226 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$10(target, key) : target; 58227 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58228 if (decorator = decorators[i2]) 58229 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58230 if (kind && result) __defProp$Z(target, key, result); 58231 return result; 58232 }; 58233 const tagName$L = "sonic-shop-section-featured"; 58234 let SonicComponent$8 = class SonicComponent extends Fetcher$1(Subscriber$1(i$6)) { 58235 constructor() { 58236 super(...arguments); 58237 this.staticMode = false;
58238 } 58239 handleIsWaiting(value) { 58240 if (!this.staticMode && !this.fetchedData && value === false) { 58241 this.isFetchEnabled = true; 58242 this.key = "data"; 58243 this._fetchData(); 58244 } 58245 } 58246 connectedCallback() { 58247 this.staticMode = !this.hasAttribute("fetch"); 58248 this.isFetchEnabled = false; 58249 this.dataProvider = entityEndPoint({ 58250 entityType: EntityType.Merch, 58251 features: [Feature.Prices, Feature.Picture], 58252 limit: 3, 58253 featured: true 58254 }); 58255 super.connectedCallback(); 58256 } 58257 render() { 58258 if (this.props && Object.keys(this.props).length === 0) return A$1; 58259 if (this.isWaiting) return A$1; 58260 return b$1` <h2 class="font-headings font-weight-headings font-style-headings mb-4 text-2xl lg:text-3xl "> 58261 <sonic-icon library="custom" prefix="regular" name="bags-shopping" class="mr-[.35em]"></sonic-icon> 58262 ${t("module_shop_title")} 58263 </h2> 58264 <div class="@container"> 58265 <sonic-list 58266 .props=${this.props} 58267 class="grid grid-cols-1 @3xl:grid-cols-2 @7xl:grid-cols-3 gap-4 " 58268 .skeleton=${() => b$1`<sonic-event-card skeleton></sonic-event-card>`} 58269 .items=${() => b$1`<sonic-event-card link> </sonic-event-card>`} 58270 > 58271 </sonic-list> 58272 </div> 58273 58274 <div class="flex gap-x-2 gap-y-1 mt-4 flex-wrap"> 58275 <sonic-app-link type="primary" to="shop" variant="default"> 58276 <sonic-icon slot="prefix" library="custom" prefix="regular" name="arrow-right"></sonic-icon> 58277 ${t("link_title_shop_all")} 58278 </sonic-app-link> 58279 </div>`; 58280 } 58281 }; 58282 SonicComponent$8.styles = [tailwind]; 58283 __decorateClass$10([ 58284 bind$1("sonicTicketApp.isWaiting"), 58285 r$5() 58286 ], SonicComponent$8.prototype, "isWaiting", 2); 58287 __decorateClass$10([ 58288 e$2({ context: staticMode }), 58289 n$5({ type: Boolean }) 58290 ], SonicComponent$8.prototype, "staticMode", 2); 58291 __decorateClass$10([ 58292 onAssign$1("sonicTicketApp.isWaiting") 58293 ], SonicComponent$8.prototype, "handleIsWaiting", 1); 58294 SonicComponent$8 = __decorateClass$10([ 58295 t$3(tagName$L) 58296 ], SonicComponent$8); 58297 var __defProp$Y = Object.defineProperty; 58298 var __getOwnPropDesc$$ = Object.getOwnPropertyDescriptor; 58299 var __decorateClass$$ = (decorators, target, key, kind) => { 58300 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$$(target, key) : target; 58301 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58302 if (decorator = decorators[i2]) 58303 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58304 if (kind && result) __defProp$Y(target, key, result); 58305 return result; 58306 }; 58307 let SonicHome = class extends i$6 { 58308 render() { 58309 if (!this.settings) { 58310 return A$1; 58311 } 58312 if (this.settings?.is_online === false) { 58313 return b$1` <sonic-store-status size="2xl"></sonic-store-status> `; 58314 } 58315 const { jumbotron, featured, quick_access, events } = this.settings.customer_ui?.home || {}; 58316 return b$1` 58317 ${jumbotron ? b$1` <sonic-jumbotron home></sonic-jumbotron> ` : A$1} 58318 ${featured ? b$1` <sonic-agenda-section-featured fetch></sonic-agenda-section-featured> ` : A$1} 58319 ${quick_access ? b$1` <sonic-quick-access-cards></sonic-quick-access-cards> ` : A$1} 58320 ${events === "next" ? b$1` <sonic-agenda-section-next fetch></sonic-agenda-section-next> ` : A$1} 58321 ${this.renderProducts()} 58322 ${events === "store" ? b$1` <sonic-event-store displayText displayTitle></sonic-event-store> ` : A$1} 58323 `; 58324 } 58325 renderProducts() { 58326 const { shop, giftcards } = this.settings?.customer_ui?.home || {}; 58327 if (!shop && !giftcards) { 58328 return A$1; 58329 } 58330 return b$1` 58331 <div class="section-products"> 58332 ${shop ? b$1`<sonic-shop-section-featured fetch></sonic-shop-section-featured>` : A$1} 58333 ${giftcards ? b$1`<sonic-giftcards></sonic-giftcards> ` : A$1} 58334 </div> 58335 `; 58336 } 58337 }; 58338 SonicHome.styles = [ 58339 tailwind, 58340 i$9` 58341 :host { 58342 display: block; 58343 --_cgx: var(--sc-container-gutter-x); 58344 --_section-margin: var(--sc-section-margin); 58345 } 58346 sonic-quick-access-cards { 58347 margin: var(--_section-margin) clamp(1rem, 7vw, 3rem); 58348 display: block; 58349 } 58350 58351 sonic-jumbotron, 58352 sonic-event-store, 58353 sonic-agenda-section-next, 58354 sonic-agenda-section-featured, 58355 sonic-shop-section-featured { 58356 display: block; 58357 margin-top: var(--_section-margin); 58358 } 58359 58360 .section-products { 58361 margin-top: var(--_section-margin); 58362 margin-left: calc(var(--_cgx) * -1); 58363 margin-right: calc(var(--_cgx) * -1); 58364 background: var(--sc-base-50); 58365 padding: 4rem var(--_cgx) calc(4rem + var(--_section-margin)); 58366 border-radius: var(--sc-rounded-lg, 2.5rem) var(--sc-rounded-lg, 2.5rem) 0 0; 58367 } 58368 58369 .section-products > * + * { 58370 margin-top: var(--_section-margin); 58371 } 58372 58373 .section-shop + .section-giftcards { 58374 margin-top: calc(var(--_section-margin) * -1 -2px); 58375 border-radius: 0 0; 58376 padding-top: 5px !important; 58377 } 58378 ` 58379 ]; 58380 __decorateClass$$([ 58381 bind$1("settings"), 58382 n$5({ type: Object }) 58383 ], SonicHome.prototype, "settings", 2); 58384 SonicHome = __decorateClass$$([ 58385 t$3("sonic-home"), 58386 awaitConnectedAncestors(APP_TAG_SELECTOR) 58387 ], SonicHome); 58388 var __decorate$4 = function(decorators, target, key, desc) { 58389 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 58390 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 58391 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 58392 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 58393 }; 58394 const tagName$K = "sonic-router"; 58395 let SonicRouter = class SonicRouter extends TemplatesContainer$1(i$6) { 58396 constructor() { 58397 super(...arguments); 58398 this.templateValueAttribute = "data-route"; 58399 this._location = document.location.href.replace(document.location.origin, ""); 58400 } 58401 createRenderRoot() { 58402 return this; 58403 } 58404 connectedCallback() { 58405 LocationHandler$1.onChange(this); 58406 super.connectedCallback(); 58407 } 58408 disconnectedCallback() { 58409 LocationHandler$1.offChange(this); 58410 super.disconnectedCallback(); 58411 } 58412 set location(value) { 58413 this._location = value; 58414 this.requestUpdate(); 58415 } 58416 get location() { 58417 return this._location; 58418 } 58419 get cleanLocation() { 58420 const url = new URL(this.location, document.location.origin); 58421 return url.pathname + url.hash; 58422 } 58423 get patternBasePath() { 58424 if (this.basePath !== void 0) { 58425 return this.basePath; 58426 } 58427 return "(/)*"; 58428 } 58429 get regExpBasePath() { 58430 if (this.basePath !== void 0) { 58431 return "^" + this.basePath; 58432 } 58433 return ""; 58434 } 58435 handleroutes() { 58436 if (!this.routes) 58437 return []; 58438 const templates = []; 58439 for (let [path, renderFn] of Object.entries(this.routes)) { 58440 if (path === "fallback" || !renderFn) 58441 continue; 58442 const regexp = new RegExp(this.regExpBasePath + path); 58443 if (regexp.test(this.cleanLocation)) { 58444 const params = regexp.exec(this.cleanLocation) || [path]; 58445 params.shift(); 58446 templates.push(renderFn([...params])); 58447 } else { 58448 try { 58449 const pattern = new UrlPattern(this.patternBasePath + path); 58450 const match = pattern.match(this.cleanLocation); 58451 if (match) { 58452 const params = match || {}; 58453 templates.push(renderFn(params)); 58454 } 58455 } catch (e2) { 58456 if (this.cleanLocation.indexOf((this.basePath || "") + path.replace(document.location.origin, "")) != -1) { 58457 templates.push(renderFn({})); 58458 } 58459 } 58460 } 58461 } 58462 if (templates.length == 0) { 58463 if (this.routes?.fallback && this.isConnected) { 58464 templates.push(this.routes.fallback()); 58465 } 58466 } 58467 return templates; 58468 } 58469 render() { 58470 const programmaticTemplates = this.handleroutes(); 58471 if (programmaticTemplates.length > 0) { 58472 return b$1`${programmaticTemplates}`; 58473 } 58474 const templates = []; 58475 for (const t2 of this.templatePartsList) { 58476 const path = t2.getAttribute(this.templateValueAttribute) || ""; 58477 const regexp = new RegExp(this.regExpBasePath + path); 58478 if (regexp.test(this.cleanLocation)) { 58479 templates.push(t2); 58480 } else { 58481 try { 58482 if (new UrlPattern(this.patternBasePath + path + "(/*)").match(this.cleanLocation)) { 58483 t2.setAttribute("mode", "patternMatching"); 58484 templates.push(t2); 58485 } 58486 } catch (e2) { 58487 if (this.cleanLocation.indexOf((this.basePath || "") + path.replace(document.location.origin, "")) != -1) { 58488 templates.push(t2); 58489 } 58490 } 58491 } 58492 } 58493 if (templates.length == 0) { 58494 if (this.fallBackRoute && this.isConnected) { 58495 document.location.href = this.fallBackRoute; 58496 } 58497 const fallback = this.templateList.find((t2) => t2.hasAttribute("data-fallback")); 58498 if (fallback) { 58499 templates.push(fallback); 58500 } 58501 } 58502 return b$1`${c$1(templates, (template, index) => { 58503 return index + (/* @__PURE__ */ new Date()).getTime(); 58504 }, (template) => { 58505 if (template.title) 58506 document.title = template.title; 58507 if (template.hasAttribute("dataProviderExpression")) { 58508 let dataProvider = ""; 58509 const dataProviderExpression = template.getAttribute("dataProviderExpression") || ""; 58510 if (template.getAttribute("mode") == "patternMatching") { 58511 const matcher = new UrlPattern("(/)*" + (template.getAttribute(this.templateValueAttribute) || "") + "*"); 58512 const filler = new UrlPattern(dataProviderExpression); 58513 dataProvider = filler.stringify(matcher.match(this.cleanLocation)); 58514 } else { 58515 const regexp = new RegExp(template.getAttribute(this.templateValueAttribute) || ""); 58516 const match = (this.cleanLocation + "").match(regexp); 58517 if (match) { 58518 dataProvider = match.shift()?.replace(regexp, dataProviderExpression) || ""; 58519 } 58520 } 58521 return b$1`<div 58522 style="display:contents" 58523 dataProvider="${dataProvider}" 58524 > 58525 ${o$2(template)} 58526 </div>`; 58527 } 58528 return o$2(template); 58529 })}`; 58530 } 58531 }; 58532 __decorate$4([ 58533 n$5({ type: String }) 58534 ], SonicRouter.prototype, "fallBackRoute", void 0); 58535 __decorate$4([ 58536 n$5({ type: Object, attribute: false }) 58537 ], SonicRouter.prototype, "routes", void 0); 58538 __decorate$4([ 58539 n$5({ type: String }) 58540 ], SonicRouter.prototype, "basePath", void 0); 58541 __decorate$4([ 58542 n$5() 58543 ], SonicRouter.prototype, "location", null); 58544 SonicRouter = __decorate$4([ 58545 t$3(tagName$K) 58546 ], SonicRouter); 58547 var __defProp$X = Object.defineProperty; 58548 var __getOwnPropDesc$_ = Object.getOwnPropertyDescriptor; 58549 var __decorateClass$_ = (decorators, target, key, kind) => { 58550 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$_(target, key) : target; 58551 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58552 if (decorator = decorators[i2]) 58553 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58554 if (kind && result) __defProp$X(target, key, result); 58555 return result; 58556 }; 58557 const tagName$J = "sonic-giftcard-code"; 58558 let SonicComponent$7 = class SonicComponent extends Subscriber$1(i$6) { 58559 constructor() { 58560 super(...arguments); 58561 this.code = null; 58562 this.type = "success"; 58563 } 58564 copyCode(code) { 58565 if (!code) return; 58566 navigator.clipboard?.writeText(code).then(function() { 58567 const toast = { 58568 text: ( 58569 /*html*/ 58570 `<span class="tracking-wide font-bold">${code}</span> a été copié` 58571 ), 58572 status: "success" 58573 }; 58574 SonicToast.add(toast); 58575 }); 58576 if (!navigator.clipboard) { 58577 const toast = { 58578 text: ( 58579 /*html*/ 58580 `Votre navigateur ne supporte pas la copie automatique, veuillez copier manuellement le code : <span class="tracking-wide font-bold">${code}</span>` 58581 ), 58582 status: "error" 58583 }; 58584 SonicToast.add(toast); 58585 } 58586 } 58587 render() { 58588 return b$1`${this.code ? b$1` 58589 <sonic-tooltip label="${t("copy")}"> 58590 <sonic-badge 58591 tabindex="0" 58592 class="cursor-pointer" 58593 @click="${() => this.copyCode(this.code)}" 58594 type="${o$4(this.type)}" 58595 size="${o$4(this.size)}" 58596 class="font-monospace tracking-widest" 58597 >${this.code}</sonic-badge 58598 > 58599 </sonic-tooltip> 58600 ` : A$1}`; 58601 } 58602 }; 58603 SonicComponent$7.styles = [tailwind]; 58604 __decorateClass$_([ 58605 n$5({ type: String }) 58606 ], SonicComponent$7.prototype, "code", 2); 58607 __decorateClass$_([ 58608 n$5({ type: Boolean }) 58609 ], SonicComponent$7.prototype, "copy", 2); 58610 __decorateClass$_([ 58611 n$5({ type: String }) 58612 ], SonicComponent$7.prototype, "size", 2); 58613 __decorateClass$_([ 58614 n$5({ type: String }) 58615 ], SonicComponent$7.prototype, "type", 2); 58616 SonicComponent$7 = __decorateClass$_([ 58617 t$3(tagName$J) 58618 ], SonicComponent$7); 58619 var __defProp$W = Object.defineProperty; 58620 var __getOwnPropDesc$Z = Object.getOwnPropertyDescriptor; 58621 var __decorateClass$Z = (decorators, target, key, kind) => { 58622 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$Z(target, key) : target; 58623 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58624 if (decorator = decorators[i2]) 58625 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58626 if (kind && result) __defProp$W(target, key, result); 58627 return result; 58628 }; 58629 let SonicPurchaseStatus = class extends Subscriber(i$6) { 58630 constructor() { 58631 super(...arguments); 58632 this.status = ""; 58633 this.size = "md"; 58634 this.displayDetail = false;
58635 this.checked = null; 58636 this.checked_at = null; 58637 this.flexDirection = "column"; 58638 this.align = "center"; 58639 this.badgeType = "default"; 58640 this.statusIcon = ""; 58641 this.shouldRender = false; 58642 this.hiddenIfValid = false; 58643 this.checkedLabel = ""; 58644 this.checkedIcon = ""; 58645 this.refund = {}; 58646 this.disabled_at = null; 58647 } 58648 willUpdate(_changedProperties) { 58649 if (_changedProperties.has("status") || _changedProperties.has("checked") || _changedProperties.has("checked_at") || _changedProperties.has("hiddenIfValid") || _changedProperties.has("checkedLabel") || _changedProperties.has("checkedIcon")) { 58650 this.shouldRender = !!this.checked || !!this.checked_at || !!this.status; 58651 if (!this.checked && !this.checked_at) { 58652 switch (this.status) { 58653 case PurchaseStatus.Valid: 58654 case "valide": 58655 this.badgeType = "default"; 58656 this.statusIcon = "check"; 58657 this.label = t("status_valid"); 58658 if (this.hiddenIfValid) { 58659 this.shouldRender = false;
58660 } else { 58661 this.shouldRender = true; 58662 } 58663 break; 58664 case PurchaseStatus.Deleted: 58665 case "supprime": 58666 this.badgeType = "danger"; 58667 this.statusIcon = "xmark"; 58668 this.label = t("status_deleted"); 58669 break; 58670 case "annule": 58671 this.badgeType = "danger"; 58672 this.statusIcon = "xmark"; 58673 this.label = t("status_canceled"); 58674 break; 58675 case PurchaseStatus.Refunded: 58676 case "rembourse": 58677 this.badgeType = "success"; 58678 this.statusIcon = "arrow-rotate-left"; 58679 this.label = t("status_refunded"); 58680 break; 58681 case PurchaseStatus.RefundRequested: 58682 case "demande_remb": 58683 this.badgeType = "warning"; 58684 this.statusIcon = "comment-exclamation"; 58685 this.label = t("status_refund_requested"); 58686 break; 58687 case PurchaseStatus.Exchanged: 58688 case "echange": 58689 this.badgeType = "warning"; 58690 this.statusIcon = "arrows-left-right"; 58691 this.label = t("status_exchanged"); 58692 break; 58693 case PurchaseStatus.Disabled: 58694 case "disabled": 58695 this.badgeType = "danger"; 58696 this.statusIcon = "xmark"; 58697 this.label = t("status_disabled"); 58698 break; 58699 case PurchaseStatus.Expired: 58700 this.badgeType = "danger"; 58701 this.statusIcon = "xmark"; 58702 this.label = t("status_expired"); 58703 break; 58704 case "remboursement_partiel": 58705 case PurchaseStatus.RefundedPartially: 58706 this.badgeType = "warning"; 58707 this.statusIcon = "scale-unbalanced-flip"; 58708 this.label = t("status_refunded_partially"); 58709 break; 58710 case PurchaseStatus.AutoRefundPending: 58711 case "remb_auto_attente": 58712 this.badgeType = "info"; 58713 this.statusIcon = "hourglass-start"; 58714 this.label = t("status_auto_refund_pending"); 58715 break; 58716 } 58717 } else { 58718 this.badgeType = "success"; 58719 this.statusIcon = this.checkedIcon || "barcode-scan"; 58720 this.label = this.checkedLabel ? t(this.checkedLabel) : t("status_checked"); 58721 } 58722 } 58723 super.willUpdate(_changedProperties); 58724 } 58725 render() { 58726 if (!this.shouldRender) return A$1; 58727 let dateDetail; 58728 switch (this.status) { 58729 case "supprime": 58730 case "annule": 58731 dateDetail = this.disabled_at; 58732 break; 58733 case "rembourse": 58734 dateDetail = this.refund.date; 58735 break; 58736 case "demande_remb": 58737 dateDetail = this.refund.askDate; 58738 break; 58739 } 58740 if (this.checked || this.checked_at) { 58741 dateDetail = this.checked; 58742 } 58743 const flexDirectionClass = this.flexDirection === "row" ? "flex-row gap-x-2 flex-wrap" : "flex-col gap-y-[.15em]"; 58744 const alignClass = this.align === "start" ? "items-start" : "items-center"; 58745 const badgeAlignClass = this.align === "start" ? "justify-start" : "justify-center"; 58746 const badgeAlign = this.align === "start" ? "start" : "center"; 58747 const hasDate = dateDetail && this.displayDetail; 58748 return b$1` 58749 <div class="flex ${flexDirectionClass} ${alignClass}"> 58750 <sonic-badge 58751 type=${this.badgeType} 58752 size=${this.size} 58753 noAutoFill 58754 class="${hasDate ? "min-w-[14.5ch]" : ""} ${badgeAlignClass}" 58755 align=${badgeAlign} 58756 > 58757 ${this.statusIcon ? b$1`<sonic-icon name=${this.statusIcon} alignItem="center" library="custom"></sonic-icon>` : A$1} 58758 <span class="font-medium"> ${this.label} </span> 58759 </sonic-badge> 58760 ${dateDetail && this.displayDetail ? b$1`<div> 58761 <sonic-badge variant="ghost" size=${this.size} noAutoFill> 58762 <sonic-date date="${dateDetail}" day="2-digit" month="2-digit" weekday="hidden"></sonic-date> 58763 </sonic-badge> 58764 </div>` : A$1} 58765 </div> 58766 `; 58767 } 58768 }; 58769 SonicPurchaseStatus.styles = [tailwind]; 58770 __decorateClass$Z([ 58771 n$5({ type: String }) 58772 ], SonicPurchaseStatus.prototype, "status", 2); 58773 __decorateClass$Z([ 58774 n$5({ type: String }) 58775 ], SonicPurchaseStatus.prototype, "size", 2); 58776 __decorateClass$Z([ 58777 n$5({ type: Boolean }) 58778 ], SonicPurchaseStatus.prototype, "displayDetail", 2); 58779 __decorateClass$Z([ 58780 n$5({ type: Number }) 58781 ], SonicPurchaseStatus.prototype, "checked", 2); 58782 __decorateClass$Z([ 58783 n$5({ type: Number }) 58784 ], SonicPurchaseStatus.prototype, "checked_at", 2); 58785 __decorateClass$Z([ 58786 n$5({ type: String }) 58787 ], SonicPurchaseStatus.prototype, "flexDirection", 2); 58788 __decorateClass$Z([ 58789 n$5({ type: String }) 58790 ], SonicPurchaseStatus.prototype, "align", 2); 58791 __decorateClass$Z([ 58792 r$5() 58793 ], SonicPurchaseStatus.prototype, "badgeType", 2); 58794 __decorateClass$Z([ 58795 r$5() 58796 ], SonicPurchaseStatus.prototype, "statusIcon", 2); 58797 __decorateClass$Z([ 58798 r$5() 58799 ], SonicPurchaseStatus.prototype, "label", 2); 58800 __decorateClass$Z([ 58801 r$5() 58802 ], SonicPurchaseStatus.prototype, "shouldRender", 2); 58803 __decorateClass$Z([ 58804 n$5({ type: Boolean }) 58805 ], SonicPurchaseStatus.prototype, "hiddenIfValid", 2); 58806 __decorateClass$Z([ 58807 n$5({ type: String }) 58808 ], SonicPurchaseStatus.prototype, "checkedLabel", 2); 58809 __decorateClass$Z([ 58810 n$5({ type: String }) 58811 ], SonicPurchaseStatus.prototype, "checkedIcon", 2); 58812 __decorateClass$Z([ 58813 n$5({ type: Object }) 58814 ], SonicPurchaseStatus.prototype, "refund", 2); 58815 __decorateClass$Z([ 58816 n$5({ type: Number }) 58817 ], SonicPurchaseStatus.prototype, "disabled_at", 2); 58818 SonicPurchaseStatus = __decorateClass$Z([ 58819 t$3("sonic-purchase-status") 58820 ], SonicPurchaseStatus); 58821 var __defProp$V = Object.defineProperty; 58822 var __getOwnPropDesc$Y = Object.getOwnPropertyDescriptor; 58823 var __decorateClass$Y = (decorators, target, key, kind) => { 58824 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$Y(target, key) : target; 58825 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58826 if (decorator = decorators[i2]) 58827 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58828 if (kind && result) __defProp$V(target, key, result); 58829 return result; 58830 }; 58831 const tagName$I = "sonic-purchase-summary-main-info"; 58832 let PurchaseSummaryMainInfo = class extends Subscriber$1(i$6) { 58833 constructor() { 58834 super(...arguments); 58835 this.subscribe = {}; 58836 this.giftcard = {}; 58837 this.entity = {}; 58838 this.owner = {}; 58839 this.session_status = null; 58840 } 58841 render() { 58842 switch (this.props?.entity_type) { 58843 case "event": 58844 return b$1` ${this.render_event()} `; 58845 default: 58846 return b$1` ${this.render_default()} `; 58847 } 58848 } 58849 render_event() { 58850 if (!this.entity) return A$1; 58851 return b$1` 58852 <sonic-date subDataProvider="entity" month="2-digit" class="text-xs mb-1 pt-1 block"></sonic-date> 58853 <sonic-product-title subDataProvider="entity.edito"></sonic-product-title> 58854 58855 ${this.session_status === "canceled" ? b$1`<sonic-badge type="danger" class="mt-1" size="xs">${t("LIB_event_status_canceled")}</sonic-badge>` : A$1} 58856 ${this.session_status === "deferred" ? b$1`<sonic-badge type="warning" class="mt-1" size="xs">${t("LIB_event_status_deferred")}</sonic-badge>` : A$1} 58857 58858 <sonic-event-location-hall
58859 subDataProvider="entity" 58860 isEvent="true" 58861 class="block mt-2 text-xs" 58862 noPlacement 58863 addressDisplay="hoverLink" 58864 ></sonic-event-location-hall> 58865 `; 58866 } 58867 render_default() { 58868 return b$1` 58869 <div class="font-bold mb-1 pt-1"><sonic-product-title subDataProvider="entity.edito"></sonic-product-title></div> 58870 <div class="text-xs"> 58871 ${this.subscribe?.name ? b$1`<div class="font-bold">${this.subscribe?.name}</div>` : A$1} 58872 ${this.subscribe?.email ? b$1`<div>${this.subscribe?.email}</div>` : A$1} 58873 58874 <div class="flex gap-x-1 gap-y-1 flex-wrap items-center mt-1"> 58875 ${this.subscribe?.number ? b$1` <sonic-badge type="info" size="xs">${"N°" + this.subscribe.number}</sonic-badge> ` : A$1} 58876 ${this.giftcard?.code ? b$1` <sonic-giftcard-code copy code="${this.giftcard.code}" size="xs"></sonic-giftcard-code>` : A$1} 58877 ${this.giftcard?.remaining_amount && this.giftcard?.remaining_amount !== null ? b$1`<sonic-badge type="info" size="xs" 58878 >${t("giftcard_remaining_amount")} : ${formatAmount(this.giftcard?.remaining_amount || 0)}</sonic-badge 58879 >` : A$1} 58880 <sonic-purchase-expiration-date size="xs" class="block"></sonic-purchase-expiration-date> 58881 </div> 58882 </div> 58883 `; 58884 } 58885 }; 58886 PurchaseSummaryMainInfo.styles = [tailwind]; 58887 __decorateClass$Y([ 58888 n$5({ type: Object }) 58889 ], PurchaseSummaryMainInfo.prototype, "subscribe", 2); 58890 __decorateClass$Y([ 58891 n$5({ type: Object }) 58892 ], PurchaseSummaryMainInfo.prototype, "giftcard", 2); 58893 __decorateClass$Y([ 58894 n$5({ type: Object }) 58895 ], PurchaseSummaryMainInfo.prototype, "entity", 2); 58896 __decorateClass$Y([ 58897 n$5({ type: Object }) 58898 ], PurchaseSummaryMainInfo.prototype, "owner", 2); 58899 __decorateClass$Y([ 58900 n$5({ type: String }) 58901 ], PurchaseSummaryMainInfo.prototype, "session_status", 2); 58902 PurchaseSummaryMainInfo = __decorateClass$Y([ 58903 t$3(tagName$I) 58904 ], PurchaseSummaryMainInfo); 58905 var __defProp$U = Object.defineProperty; 58906 var __getOwnPropDesc$X = Object.getOwnPropertyDescriptor; 58907 var __decorateClass$X = (decorators, target, key, kind) => { 58908 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$X(target, key) : target; 58909 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58910 if (decorator = decorators[i2]) 58911 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58912 if (kind && result) __defProp$U(target, key, result); 58913 return result; 58914 }; 58915 function isValidStatus(status) { 58916 return status === "valide"; 58917 } 58918 let SonicTransactionPurchaseStatus = class extends Subscriber$1(i$6) { 58919 constructor() { 58920 super(...arguments); 58921 this.size = "xs"; 58922 this.hideValid = false; 58923 } 58924 render() { 58925 const purchase = this.props; 58926 if (!purchase?.entity_type) { 58927 return A$1; 58928 } 58929 switch (purchase.entity_type) { 58930 case EntityType.Event: 58931 return this.renderEventStatus(purchase); 58932 case EntityType.Subscribe: 58933 return this.renderSubscribeStatus(purchase); 58934 case EntityType.Giftcard: 58935 return this.renderGiftcardStatus(purchase); 58936 case EntityType.Merch: 58937 case EntityType.AdditionalProduct: 58938 return this.renderCatalogProductStatus(purchase); 58939 default: 58940 return A$1; 58941 } 58942 } 58943 /** Billets d'événement : statut billet + contrôle. */ 58944 renderEventStatus(purchase) { 58945 return b$1` 58946 <sonic-purchase-status 58947 size=${this.size} 58948 align="start" 58949 flexDirection="column" 58950 displayDetail 58951 ?hiddenIfValid=${this.hideValid} 58952 .status=${purchase.status ?? ""} 58953 .refund=${purchase.refund ?? {}} 58954 .disabled_at=${purchase.disabled_at ?? null} 58955 .checked=${purchase.checked ?? 0} 58956 ></sonic-purchase-status> 58957 `; 58958 } 58959 /** Abonnements : état de validité (pas « billet valide »). */ 58960 renderSubscribeStatus(purchase) { 58961 return b$1` 58962 <sonic-purchase-status 58963 size=${this.size} 58964 align="start" 58965 flexDirection="column" 58966 displayDetail 58967 ?hiddenIfValid=${this.hideValid} 58968 .status=${purchase.status ?? ""} 58969 .refund=${purchase.refund ?? {}} 58970 .disabled_at=${purchase.disabled_at ?? null} 58971 .checked=${0} 58972 ></sonic-purchase-status> 58973 `; 58974 } 58975 /** 58976 * Cartes cadeaux : états métier (expirée, épuisée) ou statut compta si anormal. 58977 * Pas de « billet valide » pour une carte active. 58978 */ 58979 renderGiftcardStatus(purchase) { 58980 if (!isValidStatus(purchase.status)) { 58981 return this.renderRefundStatus(purchase, false); 58982 } 58983 const now = Math.floor(Date.now() / 1e3); 58984 if (purchase.expiration_date && purchase.expiration_date < now) { 58985 return b$1` 58986 <sonic-badge type="danger" size=${this.size} align="start"> 58987 <sonic-icon name="xmark" library="custom"></sonic-icon>
58988 <span class="font-medium">${t("status_expired")}</span> 58989 </sonic-badge> 58990 `; 58991 } 58992 const remaining = purchase.giftcard?.remaining_amount; 58993 if (remaining != null && remaining <= 0) { 58994 return b$1` 58995 <sonic-badge type="warning" size=${this.size} align="start"> 58996 <sonic-icon name="ban" library="custom"></sonic-icon> 58997 <span class="font-medium">${t("This_gift_card_is_empty")}</span> 58998 </sonic-badge> 58999 `; 59000 } 59001 return A$1; 59002 } 59003 /** 59004 * Articles boutique / produits additionnels : masquer le « valide » neutre, 59005 * afficher uniquement les anomalies (remboursement, suppressionâ¦). 59006 */ 59007 renderCatalogProductStatus(purchase) { 59008 if (isValidStatus(purchase.status)) { 59009 if (!purchase.checked) { 59010 return A$1; 59011 } 59012 return b$1` 59013 <sonic-purchase-status 59014 size=${this.size} 59015 align="start" 59016 flexDirection="column" 59017 displayDetail 59018 checkedLabel="request_status_processed" 59019 checkedIcon="check" 59020 .checked=${purchase.checked} 59021 .status=${""} 59022 ></sonic-purchase-status> 59023 `; 59024 } 59025 return this.renderRefundStatus(purchase, false); 59026 } 59027 renderRefundStatus(purchase, displayDetail) { 59028 return b$1` 59029 <sonic-purchase-status 59030 size=${this.size} 59031 align="start" 59032 flexDirection="column" 59033 ?displayDetail=${displayDetail} 59034 hiddenIfValid 59035 .status=${purchase.status ?? ""} 59036 .refund=${purchase.refund ?? {}} 59037 .disabled_at=${purchase.disabled_at ?? null} 59038 .checked=${0} 59039 ></sonic-purchase-status> 59040 `; 59041 } 59042 }; 59043 SonicTransactionPurchaseStatus.styles = [tailwind]; 59044 __decorateClass$X([ 59045 n$5({ type: String }) 59046 ], SonicTransactionPurchaseStatus.prototype, "size", 2); 59047 __decorateClass$X([ 59048 n$5({ type: Boolean }) 59049 ], SonicTransactionPurchaseStatus.prototype, "hideValid", 2); 59050 SonicTransactionPurchaseStatus = __decorateClass$X([ 59051 t$3("sonic-transaction-purchase-status") 59052 ], SonicTransactionPurchaseStatus); 59053 var __defProp$T = Object.defineProperty; 59054 var __getOwnPropDesc$W = Object.getOwnPropertyDescriptor; 59055 var __decorateClass$W = (decorators, target, key, kind) => { 59056 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$W(target, key) : target; 59057 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 59058 if (decorator = decorators[i2]) 59059 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 59060 if (kind && result) __defProp$T(target, key, result); 59061 return result; 59062 }; 59063 const tagName$H = "sonic-purchase-summary-complementary-info"; 59064 let PurchaseSummaryComplementaryInfo = class extends Subscriber$1(i$6) { 59065 constructor() { 59066 super(...arguments); 59067 this.created = 0; 59068 this.price = {}; 59069 this.owner = {}; 59070 this.cancelable = false; 59071 this.changeAllowInDirectory = async () => { 59072 const ownerDp = this.publisher.owner; 59073 const allowInDirectory = ownerDp.allowInDirectory.get(); 59074 const api2 = new API(this.getApiConfiguration()); 59075 const body = { 59076 owner: { 59077 allowInDirectory: !!allowInDirectory 59078 } 59079 }; 59080 const response = await api2.patch(`subscriptions/${this.id}`, body); 59081 if (response.success) { 59082 const data = response.data; 59083 ownerDp.set(data?.owner); 59084 } 59085 }; 59086 } 59087 render() { 59088 const isSubscribe = this.props?.entity_type === "subscribe"; 59089 const barcode = this.props?.barcode; 59090 const eventId = this.props?.entity?.id; 59091 const isInDirectory = this.owner?.allowInDirectory; 59092 return b$1` 59093 <div class="@container"> 59094 <div class="grid @sm:grid-cols-2 grid-cols-1 gap-y-1"> 59095 ${this.price?.label || this.price?.amount ? b$1`<div> 59096 <span class="mr-1 text-2xs">${t("price")}</span><br /> 59097 <strong class="inline-block">${this.price?.label} ${formatAmount(this.price?.amount ?? 0)}</strong> 59098 </div>` : A$1} 59099 59100 <div>
59101 <span class="mr-1 text-2xs"> ${t("purchase_date")}</span><br /> 59102 <strong><sonic-date date=${this.created} weekday="hidden" month="2-digit"></sonic-date></strong> 59103 </div> 59104 ${!isSubscribe && (this.owner?.firstName || this.owner?.lastName) ? b$1`<div> 59105 <span class="mr-1 text-2xs">${t("owner")} </span><br /><strong class="inline-block" 59106 >${this.owner?.firstName} ${this.owner?.lastName}</strong 59107 > 59108 </div>` : A$1} 59109 59110 <!-- Contremarque --> 59111 ${this.price?.isCountermark && !this.props?.checked ? b$1` 59112 <sonic-badge type="danger" class="mt-1 mr-1" size="xs"> 59113 <sonic-icon name="file-exclamation" library="custom" slot="prefix"></sonic-icon> 59114 <div class="text-balance">${t("contremarque_echanger_guichet")}</div> 59115 </sonic-badge> 59116 ` : A$1} 59117 <sonic-transaction-purchase-status 59118 size="xs" 59119 hideValid 59120 class="block justify-self-start mt-1" 59121 ></sonic-transaction-purchase-status> 59122 59123 ${this.cancelable ? b$1`<div class="mt-1"> 59124 <sonic-button 59125 size="xs" 59126 variant="outline" 59127 type="info" 59128 noAutofill 59129 @click="${() => cancelTicket(Number(this.id))}" 59130 > 59131 <sonic-icon library="custom" name="hand-wave"></sonic-icon> 59132 <span class="font-semibold">${t("free_up")}</span> 59133 </sonic-button> 59134 </div>` : A$1} 59135 ${this.props?.cancelable_for_credit ? b$1` <div class="mt-1"> 59136 <sonic-button 59137 size="xs" 59138 variant="outline" 59139 type="info" 59140 noAutofill 59141 @click="${() => cancelTicket(Number(this.id), "credit")}" 59142 > 59143 <sonic-icon library="custom" name="hand-wave"></sonic-icon> 59144 <span class="font-semibold">${t("annuler_contre_avoir")}</span> 59145 </sonic-button> 59146 </div>` : A$1} 59147 ${this.props?.refund?.askEnabled && eventId && barcode ? b$1` 59148 <div class="mt-1"> 59149 <sonic-button 59150 size="xs" 59151 variant="outline" 59152 type="info" 59153 class="whitespace-nowrap" 59154 href="${appRoute("refund").query({ event_id: eventId, barcode })?.toString()}" 59155 > 59156 <sonic-icon name="arrow-rotate-left" library="custom"></sonic-icon> 59157 <b>${t("LIB_refund")}</b> 59158 </sonic-button> 59159 </div> 59160 ` : A$1} 59161 ${this.props?.can_allow_in_directory ? b$1`<div class="mt-1"> 59162 <sonic-checkbox 59163 formDataProvider=${this.dataProvider} 59164 dataProvider="_NONE_" 59165 unique 59166 name="owner.allowInDirectory" 59167 .value=${true} 59168 @change=${this.changeAllowInDirectory} 59169 size="xs" 59170 style="--sc-input-bg: var(--sc-base-300);" 59171 class=" ${!isInDirectory ? "text-neutral-600" : ""}" 59172 > 59173 <div class="flex items-center gap-1"> 59174 <sonic-icon library="custom" name="address-book" size="lg"></sonic-icon> 59175 ${t("LIB_in_directory")} 59176 </div> 59177 </sonic-checkbox> 59178 </div>` : A$1} 59179 </div> 59180 </div> 59181 `; 59182 } 59183 }; 59184 PurchaseSummaryComplementaryInfo.styles = [tailwind]; 59185 __decorateClass$W([ 59186 n$5({ type: Number }) 59187 ], PurchaseSummaryComplementaryInfo.prototype, "created", 2); 59188 __decorateClass$W([ 59189 n$5({ type: Object }) 59190 ], PurchaseSummaryComplementaryInfo.prototype, "price", 2); 59191 __decorateClass$W([ 59192 n$5({ type: Object }) 59193 ], PurchaseSummaryComplementaryInfo.prototype, "owner", 2); 59194 __decorateClass$W([ 59195 n$5({ type: Boolean }) 59196 ], PurchaseSummaryComplementaryInfo.prototype, "cancelable", 2); 59197 PurchaseSummaryComplementaryInfo = __decorateClass$W([ 59198 t$3(tagName$H) 59199 ], PurchaseSummaryComplementaryInfo); 59200 function isPurchasePrintable(purchase) { 59201 const status = purchase.status; 59202 if (!status) { 59203 return !!(purchase.print_url || purchase.pdf_mobile_url); 59204 } 59205 return status === "valide"; 59206 } 59207 ({ 59208 [EntityType.Event]: "/la_billetterie/billet/${id}/transactions", 59209 [EntityType.Giftcard]: "/la_billetterie/carte_cadeau/${id}", 59210 [EntityType.AdditionalProduct]: "/la_billetterie/produits_additionnels/${id}", 59211 [EntityType.Merch]: "/la_billetterie/merchs/${id}" 59212 }); 59213 const TRANSACTION_ROW_ACTIONS_SLOTS_CLASS = "grid grid-cols-[2.25rem_2.25rem] gap-1 justify-end w-full ml-auto"; 59214 var __defProp$S = Object.defineProperty; 59215 var __getOwnPropDesc$V = Object.getOwnPropertyDescriptor; 59216 var __decorateClass$V = (decorators, target, key, kind) => { 59217 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$V(target, key) : target; 59218 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 59219 if (decorator = decorators[i2]) 59220 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 59221 if (kind && result) __defProp$S(target, key, result); 59222 return result; 59223 }; 59224 const tagName$G = "sonic-ticket-info"; 59225 let TicketInfo = class extends Subscriber$1(i$6) { 59226 constructor() { 59227 super(...arguments); 59228 this.label = ""; 59229 this.content = ""; 59230 } 59231 render() { 59232 return b$1`<div> 59233 <div class="text-xs">${this.label}</div> 59234 <div class="font-bold">${o$6(this.content)}<slot></slot></div> 59235 </div>`; 59236 } 59237 }; 59238 TicketInfo.styles = [tailwind]; 59239 __decorateClass$V([ 59240 n$5({ type: String }) 59241 ], TicketInfo.prototype, "label", 2); 59242 __decorateClass$V([ 59243 n$5({ type: String }) 59244 ], TicketInfo.prototype, "content", 2); 59245 TicketInfo = __decorateClass$V([ 59246 t$3(tagName$G) 59247 ], TicketInfo); 59248 var barcodes = {}; 59249 var CODE39 = {}; 59250 var Barcode$1 = {}; 59251 var hasRequiredBarcode; 59252 function requireBarcode() { 59253 if (hasRequiredBarcode) return Barcode$1; 59254 hasRequiredBarcode = 1;
59255 Object.defineProperty(Barcode$1, "__esModule", { 59256 value: true 59257 }); 59258 function _classCallCheck(instance, Constructor) { 59259 if (!(instance instanceof Constructor)) { 59260 throw new TypeError("Cannot call a class as a function"); 59261 } 59262 } 59263 var Barcode2 = function Barcode3(data, options) { 59264 _classCallCheck(this, Barcode3); 59265 this.data = data; 59266 this.text = options.text || data; 59267 this.options = options; 59268 }; 59269 Barcode$1.default = Barcode2; 59270 return Barcode$1; 59271 } 59272 var hasRequiredCODE39; 59273 function requireCODE39() { 59274 if (hasRequiredCODE39) return CODE39; 59275 hasRequiredCODE39 = 1; 59276 Object.defineProperty(CODE39, "__esModule", { 59277 value: true 59278 }); 59279 CODE39.CODE39 = void 0; 59280 var _createClass = /* @__PURE__ */ (function() { 59281 function defineProperties(target, props) { 59282 for (var i2 = 0; i2 < props.length; i2++) { 59283 var descriptor = props[i2]; 59284 descriptor.enumerable = descriptor.enumerable || false; 59285 descriptor.configurable = true; 59286 if ("value" in descriptor) descriptor.writable = true; 59287 Object.defineProperty(target, descriptor.key, descriptor); 59288 } 59289 } 59290 return function(Constructor, protoProps, staticProps) { 59291 if (protoProps) defineProperties(Constructor.prototype, protoProps); 59292 if (staticProps) defineProperties(Constructor, staticProps); 59293 return Constructor; 59294 }; 59295 })(); 59296 var _Barcode2 = requireBarcode(); 59297 var _Barcode3 = _interopRequireDefault(_Barcode2); 59298 function _interopRequireDefault(obj) { 59299 return obj && obj.__esModule ? obj : { default: obj }; 59300 } 59301 function _classCallCheck(instance, Constructor) { 59302 if (!(instance instanceof Constructor)) { 59303 throw new TypeError("Cannot call a class as a function"); 59304 } 59305 } 59306 function _possibleConstructorReturn(self, call) { 59307 if (!self) { 59308 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59309 } 59310 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59311 } 59312 function _inherits(subClass, superClass) { 59313 if (typeof superClass !== "function" && superClass !== null) { 59314 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59315 } 59316 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 59317 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 59318 } 59319 var CODE39$1 = (function(_Barcode) { 59320 _inherits(CODE392, _Barcode); 59321 function CODE392(data, options) { 59322 _classCallCheck(this, CODE392); 59323 data = data.toUpperCase(); 59324 if (options.mod43) { 59325 data += getCharacter(mod43checksum(data)); 59326 } 59327 return _possibleConstructorReturn(this, (CODE392.__proto__ || Object.getPrototypeOf(CODE392)).call(this, data, options)); 59328 } 59329 _createClass(CODE392, [{ 59330 key: "encode", 59331 value: function encode() { 59332 var result = getEncoding("*"); 59333 for (var i2 = 0; i2 < this.data.length; i2++) { 59334 result += getEncoding(this.data[i2]) + "0"; 59335 } 59336 result += getEncoding("*"); 59337 return { 59338 data: result, 59339 text: this.text 59340 }; 59341 } 59342 }, { 59343 key: "valid", 59344 value: function valid() { 59345 return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/) !== -1; 59346 } 59347 }]); 59348 return CODE392; 59349 })(_Barcode3.default); 59350 var characters = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "-", ".", " ", "$", "/", "+", "%", "*"]; 59351 var encodings = [20957, 29783, 23639, 30485, 20951, 29813, 23669, 20855, 29789, 23645, 29975, 23831, 30533, 22295, 30149, 24005, 21623, 29981, 23837, 22301, 30023, 23879, 30545, 22343, 30161, 24017, 21959, 30065, 23921, 22385, 29015, 18263, 29141, 17879, 29045, 18293, 17783, 29021, 18269, 17477, 17489, 17681, 20753, 35770]; 59352 function getEncoding(character) { 59353 return getBinary(characterValue(character)); 59354 } 59355 function getBinary(characterValue2) { 59356 return encodings[characterValue2].toString(2); 59357 } 59358 function getCharacter(characterValue2) { 59359 return characters[characterValue2]; 59360 } 59361 function characterValue(character) { 59362 return characters.indexOf(character); 59363 } 59364 function mod43checksum(data) { 59365 var checksum = 0; 59366 for (var i2 = 0; i2 < data.length; i2++) { 59367 checksum += characterValue(data[i2]); 59368 } 59369 checksum = checksum % 43; 59370 return checksum; 59371 } 59372 CODE39.CODE39 = CODE39$1; 59373 return CODE39; 59374 } 59375 var CODE128$1 = {}; 59376 var CODE128_AUTO = {}; 59377 var CODE128 = {}; 59378 var constants$3 = {}; 59379 var hasRequiredConstants$3; 59380 function requireConstants$3() { 59381 if (hasRequiredConstants$3) return constants$3; 59382 hasRequiredConstants$3 = 1;
59383 Object.defineProperty(constants$3, "__esModule", { 59384 value: true 59385 }); 59386 var _SET_BY_CODE; 59387 function _defineProperty(obj, key, value) { 59388 if (key in obj) { 59389 Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); 59390 } else { 59391 obj[key] = value; 59392 } 59393 return obj; 59394 } 59395 var SET_A = constants$3.SET_A = 0; 59396 var SET_B = constants$3.SET_B = 1; 59397 var SET_C = constants$3.SET_C = 2; 59398 constants$3.SHIFT = 98; 59399 var START_A = constants$3.START_A = 103; 59400 var START_B = constants$3.START_B = 104; 59401 var START_C = constants$3.START_C = 105; 59402 constants$3.MODULO = 103; 59403 constants$3.STOP = 106; 59404 constants$3.FNC1 = 207; 59405 constants$3.SET_BY_CODE = (_SET_BY_CODE = {}, _defineProperty(_SET_BY_CODE, START_A, SET_A), _defineProperty(_SET_BY_CODE, START_B, SET_B), _defineProperty(_SET_BY_CODE, START_C, SET_C), _SET_BY_CODE); 59406 constants$3.SWAP = { 59407 101: SET_A, 59408 100: SET_B, 59409 99: SET_C 59410 }; 59411 constants$3.A_START_CHAR = String.fromCharCode(208); 59412 constants$3.B_START_CHAR = String.fromCharCode(209); 59413 constants$3.C_START_CHAR = String.fromCharCode(210); 59414 constants$3.A_CHARS = "[\0-_Ã-Ã]"; 59415 constants$3.B_CHARS = "[ -�Ã-Ã]"; 59416 constants$3.C_CHARS = "(Ã*[0-9]{2}Ã*)"; 59417 constants$3.BARS = [11011001100, 11001101100, 11001100110, 10010011e3, 10010001100, 10001001100, 10011001e3, 10011000100, 10001100100, 11001001e3, 11001000100, 11000100100, 10110011100, 10011011100, 10011001110, 10111001100, 10011101100, 10011100110, 11001110010, 11001011100, 11001001110, 11011100100, 11001110100, 11101101110, 11101001100, 11100101100, 11100100110, 11101100100, 11100110100, 11100110010, 11011011e3, 11011000110, 11000110110, 10100011e3, 10001011e3, 10001000110, 10110001e3, 10001101e3, 10001100010, 11010001e3, 11000101e3, 11000100010, 10110111e3, 10110001110, 10001101110, 10111011e3, 10111000110, 10001110110, 11101110110, 11010001110, 11000101110, 11011101e3, 11011100010, 11011101110, 11101011e3, 11101000110, 11100010110, 11101101e3, 11101100010, 11100011010, 11101111010, 11001000010, 11110001010, 1010011e4, 10100001100, 1001011e4, 10010000110, 10000101100, 10000100110, 1011001e4, 10110000100, 1001101e4, 10011000010, 10000110100, 10000110010, 11000010010, 1100101e4, 11110111010, 11000010100, 10001111010, 10100111100, 10010111100, 10010011110, 10111100100, 10011110100, 10011110010, 11110100100, 11110010100, 11110010010, 11011011110, 11011110110, 11110110110, 10101111e3, 10100011110, 10001011110, 10111101e3, 10111100010, 11110101e3, 11110100010, 10111011110, 10111101110, 11101011110, 11110101110, 11010000100, 1101001e4, 11010011100, 1100011101011]; 59418 return constants$3; 59419 } 59420 var hasRequiredCODE128$1; 59421 function requireCODE128$1() { 59422 if (hasRequiredCODE128$1) return CODE128; 59423 hasRequiredCODE128$1 = 1; 59424 Object.defineProperty(CODE128, "__esModule", { 59425 value: true 59426 }); 59427 var _createClass = /* @__PURE__ */ (function() { 59428 function defineProperties(target, props) { 59429 for (var i2 = 0; i2 < props.length; i2++) { 59430 var descriptor = props[i2]; 59431 descriptor.enumerable = descriptor.enumerable || false; 59432 descriptor.configurable = true; 59433 if ("value" in descriptor) descriptor.writable = true; 59434 Object.defineProperty(target, descriptor.key, descriptor); 59435 } 59436 } 59437 return function(Constructor, protoProps, staticProps) { 59438 if (protoProps) defineProperties(Constructor.prototype, protoProps); 59439 if (staticProps) defineProperties(Constructor, staticProps); 59440 return Constructor; 59441 }; 59442 })(); 59443 var _Barcode2 = requireBarcode(); 59444 var _Barcode3 = _interopRequireDefault(_Barcode2); 59445 var _constants = requireConstants$3(); 59446 function _interopRequireDefault(obj) { 59447 return obj && obj.__esModule ? obj : { default: obj }; 59448 } 59449 function _classCallCheck(instance, Constructor) { 59450 if (!(instance instanceof Constructor)) { 59451 throw new TypeError("Cannot call a class as a function"); 59452 } 59453 } 59454 function _possibleConstructorReturn(self, call) { 59455 if (!self) { 59456 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59457 } 59458 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59459 } 59460 function _inherits(subClass, superClass) { 59461 if (typeof superClass !== "function" && superClass !== null) { 59462 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59463 } 59464 subClass.prototype = Object.create(superClass && superClass.prototype, { c
59464onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 59465 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 59466 } 59467 var CODE128$12 = (function(_Barcode) { 59468 _inherits(CODE1282, _Barcode); 59469 function CODE1282(data, options) { 59470 _classCallCheck(this, CODE1282); 59471 var _this = _possibleConstructorReturn(this, (CODE1282.__proto__ || Object.getPrototypeOf(CODE1282)).call(this, data.substring(1), options)); 59472 _this.bytes = data.split("").map(function(char) { 59473 return char.charCodeAt(0); 59474 }); 59475 return _this; 59476 } 59477 _createClass(CODE1282, [{ 59478 key: "valid", 59479 value: function valid() { 59480 return /^[\x00-\x7F\xC8-\xD3]+$/.test(this.data); 59481 } 59482 // The public encoding function 59483 }, { 59484 key: "encode", 59485 value: function encode() { 59486 var bytes = this.bytes; 59487 var startIndex = bytes.shift() - 105; 59488 var startSet = _constants.SET_BY_CODE[startIndex]; 59489 if (startSet === void 0) { 59490 throw new RangeError("The encoding does not start with a start character."); 59491 } 59492 if (this.shouldEncodeAsEan128() === true) { 59493 bytes.unshift(_constants.FNC1); 59494 } 59495 var encodingResult = CODE1282.next(bytes, 1, startSet); 59496 return { 59497 text: this.text === this.data ? this.text.replace(/[^\x20-\x7E]/g, "") : this.text, 59498 data: ( 59499 // Add the start bits 59500 CODE1282.getBar(startIndex) + // Add the encoded bits 59501 encodingResult.result + // Add the checksum 59502 CODE1282.getBar((encodingResult.checksum + startIndex) % _constants.MODULO) + // Add the end bits 59503 CODE1282.getBar(_constants.STOP) 59504 ) 59505 }; 59506 } 59507 // GS1-128/EAN-128 59508 }, { 59509 key: "shouldEncodeAsEan128", 59510 value: function shouldEncodeAsEan128() { 59511 var isEAN128 = this.options.ean128 || false; 59512 if (typeof isEAN128 === "string") { 59513 isEAN128 = isEAN128.toLowerCase() === "true"; 59514 } 59515 return isEAN128; 59516 } 59517 // Get a bar symbol by index 59518 }], [{ 59519 key: "getBar", 59520 value: function getBar(index) { 59521 return _constants.BARS[index] ? _constants.BARS[index].toString() : ""; 59522 } 59523 // Correct an index by a set and shift it from the bytes array 59524 }, { 59525 key: "correctIndex", 59526 value: function correctIndex(bytes, set2) { 59527 if (set2 === _constants.SET_A) { 59528 var charCode = bytes.shift(); 59529 return charCode < 32 ? charCode + 64 : charCode - 32; 59530 } else if (set2 === _constants.SET_B) { 59531 return bytes.shift() - 32; 59532 } else { 59533 return (bytes.shift() - 48) * 10 + bytes.shift() - 48; 59534 } 59535 } 59536 }, { 59537 key: "next", 59538 value: function next(bytes, pos, set2) { 59539 if (!bytes.length) { 59540 return { result: "", checksum: 0 }; 59541 } 59542 var nextCode = void 0, index = void 0; 59543 if (bytes[0] >= 200) { 59544 index = bytes.shift() - 105; 59545 var nextSet = _constants.SWAP[index]; 59546 if (nextSet !== void 0) { 59547 nextCode = CODE1282.next(bytes, pos + 1, nextSet); 59548 } else { 59549 if ((set2 === _constants.SET_A || set2 === _constants.SET_B) && index === _constants.SHIFT) { 59550 bytes[0] = set2 === _constants.SET_A ? bytes[0] > 95 ? bytes[0] - 96 : bytes[0] : bytes[0] < 32 ? bytes[0] + 96 : bytes[0]; 59551 } 59552 nextCode = CODE1282.next(bytes, pos + 1, set2); 59553 } 59554 } else { 59555 index = CODE1282.correctIndex(bytes, set2); 59556 nextCode = CODE1282.next(bytes, pos + 1, set2); 59557 } 59558 var enc = CODE1282.getBar(index); 59559 var weight = index * pos; 59560 return { 59561 result: enc + nextCode.result, 59562 checksum: weight + nextCode.checksum 59563 }; 59564 } 59565 }]); 59566 return CODE1282; 59567 })(_Barcode3.default); 59568 CODE128.default = CODE128$12; 59569 return CODE128; 59570 } 59571 var auto = {}; 59572 var hasRequiredAuto; 59573 function requireAuto() { 59574 if (hasRequiredAuto) return auto; 59575 hasRequiredAuto = 1;
59576 Object.defineProperty(auto, "__esModule", { 59577 value: true 59578 }); 59579 var _constants = requireConstants$3(); 59580 var matchSetALength = function matchSetALength2(string) { 59581 return string.match(new RegExp("^" + _constants.A_CHARS + "*"))[0].length; 59582 }; 59583 var matchSetBLength = function matchSetBLength2(string) { 59584 return string.match(new RegExp("^" + _constants.B_CHARS + "*"))[0].length; 59585 }; 59586 var matchSetC = function matchSetC2(string) { 59587 return string.match(new RegExp("^" + _constants.C_CHARS + "*"))[0]; 59588 }; 59589 function autoSelectFromAB(string, isA) { 59590 var ranges = isA ? _constants.A_CHARS : _constants.B_CHARS; 59591 var untilC = string.match(new RegExp("^(" + ranges + "+?)(([0-9]{2}){2,})([^0-9]|$)")); 59592 if (untilC) { 59593 return untilC[1] + String.fromCharCode(204) + autoSelectFromC(string.substring(untilC[1].length)); 59594 } 59595 var chars = string.match(new RegExp("^" + ranges + "+"))[0]; 59596 if (chars.length === string.length) { 59597 return string; 59598 } 59599 return chars + String.fromCharCode(isA ? 205 : 206) + autoSelectFromAB(string.substring(chars.length), !isA); 59600 } 59601 function autoSelectFromC(string) { 59602 var cMatch = matchSetC(string); 59603 var length = cMatch.length; 59604 if (length === string.length) { 59605 return string; 59606 } 59607 string = string.substring(length); 59608 var isA = matchSetALength(string) >= matchSetBLength(string); 59609 return cMatch + String.fromCharCode(isA ? 206 : 205) + autoSelectFromAB(string, isA); 59610 } 59611 auto.default = function(string) { 59612 var newString = void 0; 59613 var cLength = matchSetC(string).length; 59614 if (cLength >= 2) { 59615 newString = _constants.C_START_CHAR + autoSelectFromC(string); 59616 } else { 59617 var isA = matchSetALength(string) > matchSetBLength(string); 59618 newString = (isA ? _constants.A_START_CHAR : _constants.B_START_CHAR) + autoSelectFromAB(string, isA); 59619 } 59620 return newString.replace( 59621 /[\xCD\xCE]([^])[\xCD\xCE]/, 59622 // Any sequence between 205 and 206 characters 59623 function(match, char) { 59624 return String.fromCharCode(203) + char; 59625 } 59626 ); 59627 }; 59628 return auto; 59629 } 59630 var hasRequiredCODE128_AUTO; 59631 function requireCODE128_AUTO() { 59632 if (hasRequiredCODE128_AUTO) return CODE128_AUTO; 59633 hasRequiredCODE128_AUTO = 1; 59634 Object.defineProperty(CODE128_AUTO, "__esModule", { 59635 value: true 59636 }); 59637 var _CODE2 = requireCODE128$1(); 59638 var _CODE3 = _interopRequireDefault(_CODE2); 59639 var _auto = requireAuto(); 59640 var _auto2 = _interopRequireDefault(_auto); 59641 function _interopRequireDefault(obj) { 59642 return obj && obj.__esModule ? obj : { default: obj }; 59643 } 59644 function _classCallCheck(instance, Constructor) { 59645 if (!(instance instanceof Constructor)) { 59646 throw new TypeError("Cannot call a class as a function"); 59647 } 59648 } 59649 function _possibleConstructorReturn(self, call) { 59650 if (!self) { 59651 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59652 } 59653 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59654 } 59655 function _inherits(subClass, superClass) { 59656 if (typeof superClass !== "function" && superClass !== null) { 59657 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59658 } 59659 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 59660 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 59661 } 59662 var CODE128AUTO = (function(_CODE) { 59663 _inherits(CODE128AUTO2, _CODE); 59664 function CODE128AUTO2(data, options) { 59665 _classCallCheck(this, CODE128AUTO2); 59666 if (/^[\x00-\x7F\xC8-\xD3]+$/.test(data)) { 59667 var _this = _possibleConstructorReturn(this, (CODE128AUTO2.__proto__ || Object.getPrototypeOf(CODE128AUTO2)).call(this, (0, _auto2.default)(data), options)); 59668 } else { 59669 var _this = _possibleConstructorReturn(this, (CODE128AUTO2.__proto__ || Object.getPrototypeOf(CODE128AUTO2)).call(this, data, options)); 59670 } 59671 return _possibleConstructorReturn(_this); 59672 } 59673 return CODE128AUTO2; 59674 })(_CODE3.default); 59675 CODE128_AUTO.default = CODE128AUTO; 59676 return CODE128_AUTO; 59677 } 59678 var CODE128A = {}; 59679 var hasRequiredCODE128A; 59680 function requireCODE128A() { 59681 if (hasRequiredCODE128A) return CODE128A; 59682 hasRequiredCODE128A = 1;
59683 Object.defineProperty(CODE128A, "__esModule", { 59684 value: true 59685 }); 59686 var _createClass = /* @__PURE__ */ (function() { 59687 function defineProperties(target, props) { 59688 for (var i2 = 0; i2 < props.length; i2++) { 59689 var descriptor = props[i2]; 59690 descriptor.enumerable = descriptor.enumerable || false; 59691 descriptor.configurable = true; 59692 if ("value" in descriptor) descriptor.writable = true; 59693 Object.defineProperty(target, descriptor.key, descriptor); 59694 } 59695 } 59696 return function(Constructor, protoProps, staticProps) { 59697 if (protoProps) defineProperties(Constructor.prototype, protoProps); 59698 if (staticProps) defineProperties(Constructor, staticProps); 59699 return Constructor; 59700 }; 59701 })(); 59702 var _CODE2 = requireCODE128$1(); 59703 var _CODE3 = _interopRequireDefault(_CODE2); 59704 var _constants = requireConstants$3(); 59705 function _interopRequireDefault(obj) { 59706 return obj && obj.__esModule ? obj : { default: obj }; 59707 } 59708 function _classCallCheck(instance, Constructor) { 59709 if (!(instance instanceof Constructor)) { 59710 throw new TypeError("Cannot call a class as a function"); 59711 } 59712 } 59713 function _possibleConstructorReturn(self, call) { 59714 if (!self) { 59715 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59716 } 59717 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59718 } 59719 function _inherits(subClass, superClass) { 59720 if (typeof superClass !== "function" && superClass !== null) { 59721 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59722 } 59723 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 59724 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 59725 } 59726 var CODE128A$1 = (function(_CODE) { 59727 _inherits(CODE128A2, _CODE); 59728 function CODE128A2(string, options) { 59729 _classCallCheck(this, CODE128A2); 59730 return _possibleConstructorReturn(this, (CODE128A2.__proto__ || Object.getPrototypeOf(CODE128A2)).call(this, _constants.A_START_CHAR + string, options)); 59731 } 59732 _createClass(CODE128A2, [{ 59733 key: "valid", 59734 value: function valid() { 59735 return new RegExp("^" + _constants.A_CHARS + "+$").test(this.data); 59736 } 59737 }]); 59738 return CODE128A2; 59739 })(_CODE3.default); 59740 CODE128A.default = CODE128A$1; 59741 return CODE128A; 59742 } 59743 var CODE128B = {}; 59744 var hasRequiredCODE128B; 59745 function requireCODE128B() { 59746 if (hasRequiredCODE128B) return CODE128B; 59747 hasRequiredCODE128B = 1; 59748 Object.defineProperty(CODE128B, "__esModule", { 59749 value: true 59750 }); 59751 var _createClass = /* @__PURE__ */ (function() { 59752 function defineProperties(target, props) { 59753 for (var i2 = 0; i2 < props.length; i2++) { 59754 var descriptor = props[i2]; 59755 descriptor.enumerable = descriptor.enumerable || false; 59756 descriptor.configurable = true; 59757 if ("value" in descriptor) descriptor.writable = true; 59758 Object.defineProperty(target, descriptor.key, descriptor); 59759 } 59760 } 59761 return function(Constructor, protoProps, staticProps) { 59762 if (protoProps) defineProperties(Constructor.prototype, protoProps); 59763 if (staticProps) defineProperties(Constructor, staticProps); 59764 return Constructor; 59765 }; 59766 })(); 59767 var _CODE2 = requireCODE128$1(); 59768 var _CODE3 = _interopRequireDefault(_CODE2); 59769 var _constants = requireConstants$3(); 59770 function _interopRequireDefault(obj) { 59771 return obj && obj.__esModule ? obj : { default: obj }; 59772 } 59773 function _classCallCheck(instance, Constructor) { 59774 if (!(instance instanceof Constructor)) { 59775 throw new TypeError("Cannot call a class as a function"); 59776 } 59777 } 59778 function _possibleConstructorReturn(self, call) { 59779 if (!self) { 59780 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59781 } 59782 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59783 } 59784 function _inherits(subClass, superClass) { 59785 if (typeof superClass !== "function" && superClass !== null) { 59786 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59787 } 59788 subClass.prototype = Object.create(superClass && superClass.prototype, { c
59788onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 59789 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 59790 } 59791 var CODE128B$1 = (function(_CODE) { 59792 _inherits(CODE128B2, _CODE); 59793 function CODE128B2(string, options) { 59794 _classCallCheck(this, CODE128B2); 59795 return _possibleConstructorReturn(this, (CODE128B2.__proto__ || Object.getPrototypeOf(CODE128B2)).call(this, _constants.B_START_CHAR + string, options)); 59796 } 59797 _createClass(CODE128B2, [{ 59798 key: "valid", 59799 value: function valid() { 59800 return new RegExp("^" + _constants.B_CHARS + "+$").test(this.data); 59801 } 59802 }]); 59803 return CODE128B2; 59804 })(_CODE3.default); 59805 CODE128B.default = CODE128B$1; 59806 return CODE128B; 59807 } 59808 var CODE128C = {}; 59809 var hasRequiredCODE128C; 59810 function requireCODE128C() { 59811 if (hasRequiredCODE128C) return CODE128C; 59812 hasRequiredCODE128C = 1; 59813 Object.defineProperty(CODE128C, "__esModule", { 59814 value: true 59815 }); 59816 var _createClass = /* @__PURE__ */ (function() { 59817 function defineProperties(target, props) { 59818 for (var i2 = 0; i2 < props.length; i2++) { 59819 var descriptor = props[i2]; 59820 descriptor.enumerable = descriptor.enumerable || false; 59821 descriptor.configurable = true; 59822 if ("value" in descriptor) descriptor.writable = true; 59823 Object.defineProperty(target, descriptor.key, descriptor); 59824 } 59825 } 59826 return function(Constructor, protoProps, staticProps) { 59827 if (protoProps) defineProperties(Constructor.prototype, protoProps); 59828 if (staticProps) defineProperties(Constructor, staticProps); 59829 return Constructor; 59830 }; 59831 })(); 59832 var _CODE2 = requireCODE128$1(); 59833 var _CODE3 = _interopRequireDefault(_CODE2); 59834 var _constants = requireConstants$3(); 59835 function _interopRequireDefault(obj) { 59836 return obj && obj.__esModule ? obj : { default: obj }; 59837 } 59838 function _classCallCheck(instance, Constructor) { 59839 if (!(instance instanceof Constructor)) { 59840 throw new TypeError("Cannot call a class as a function"); 59841 } 59842 } 59843 function _possibleConstructorReturn(self, call) { 59844 if (!self) { 59845 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59846 } 59847 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59848 } 59849 function _inherits(subClass, superClass) { 59850 if (typeof superClass !== "function" && superClass !== null) { 59851 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59852 } 59853 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 59854 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 59855 } 59856 var CODE128C$1 = (function(_CODE) { 59857 _inherits(CODE128C2, _CODE); 59858 function CODE128C2(string, options) { 59859 _classCallCheck(this, CODE128C2); 59860 return _possibleConstructorReturn(this, (CODE128C2.__proto__ || Object.getPrototypeOf(CODE128C2)).call(this, _constants.C_START_CHAR + string, options)); 59861 } 59862 _createClass(CODE128C2, [{ 59863 key: "valid", 59864 value: function valid() { 59865 return new RegExp("^" + _constants.C_CHARS + "+$").test(this.data); 59866 } 59867 }]); 59868 return CODE128C2; 59869 })(_CODE3.default); 59870 CODE128C.default = CODE128C$1; 59871 return CODE128C; 59872 } 59873 var hasRequiredCODE128; 59874 function requireCODE128() { 59875 if (hasRequiredCODE128) return CODE128$1; 59876 hasRequiredCODE128 = 1; 59877 Object.defineProperty(CODE128$1, "__esModule", { 59878 value: true 59879 }); 59880 CODE128$1.CODE128C = CODE128$1.CODE128B = CODE128$1.CODE128A = CODE128$1.CODE128 = void 0; 59881 var _CODE128_AUTO = requireCODE128_AUTO(); 59882 var _CODE128_AUTO2 = _interopRequireDefault(_CODE128_AUTO); 59883 var _CODE128A = requireCODE128A(); 59884 var _CODE128A2 = _interopRequireDefault(_CODE128A); 59885 var _CODE128B = requireCODE128B(); 59886 var _CODE128B2 = _interopRequireDefault(_CODE128B); 59887 var _CODE128C = requireCODE128C(); 59888 var _CODE128C2 = _interopRequireDefault(_CODE128C); 59889 function _interopRequireDefault(obj) { 59890 return obj && obj.__esModule ? obj : { default: obj }; 59891 } 59892 CODE128$1.CODE128 = _CODE128_AUTO2.default; 59893 CODE128$1.CODE128A = _CODE128A2.default; 59894 CODE128$1.CODE128B = _CODE128B2.default; 59895 CODE128$1.CODE128C = _CODE128C2.default; 59896 return CODE128$1; 59897 } 59898 var EAN_UPC = {}; 59899 var EAN13 = {}; 59900 var constants$2 = {}; 59901 var hasRequiredConstants$2; 59902 function requireConstants$2() { 59903 if (hasRequiredConstants$2) return constants$2; 59904 hasRequiredConstants$2 = 1;
59905 Object.defineProperty(constants$2, "__esModule", { 59906 value: true 59907 }); 59908 constants$2.SIDE_BIN = "101"; 59909 constants$2.MIDDLE_BIN = "01010"; 59910 constants$2.BINARIES = { 59911 "L": [ 59912 // The L (left) type of encoding 59913 "0001101", 59914 "0011001", 59915 "0010011", 59916 "0111101", 59917 "0100011", 59918 "0110001", 59919 "0101111", 59920 "0111011", 59921 "0110111", 59922 "0001011" 59923 ], 59924 "G": [ 59925 // The G type of encoding 59926 "0100111", 59927 "0110011", 59928 "0011011", 59929 "0100001", 59930 "0011101", 59931 "0111001", 59932 "0000101", 59933 "0010001", 59934 "0001001", 59935 "0010111" 59936 ], 59937 "R": [ 59938 // The R (right) type of encoding 59939 "1110010", 59940 "1100110", 59941 "1101100", 59942 "1000010", 59943 "1011100", 59944 "1001110", 59945 "1010000", 59946 "1000100", 59947 "1001000", 59948 "1110100" 59949 ], 59950 "O": [ 59951 // The O (odd) encoding for UPC-E 59952 "0001101", 59953 "0011001", 59954 "0010011", 59955 "0111101", 59956 "0100011", 59957 "0110001", 59958 "0101111", 59959 "0111011", 59960 "0110111", 59961 "0001011" 59962 ], 59963 "E": [ 59964 // The E (even) encoding for UPC-E 59965 "0100111", 59966 "0110011", 59967 "0011011", 59968 "0100001", 59969 "0011101", 59970 "0111001", 59971 "0000101", 59972 "0010001", 59973 "0001001", 59974 "0010111" 59975 ] 59976 }; 59977 constants$2.EAN2_STRUCTURE = ["LL", "LG", "GL", "GG"]; 59978 constants$2.EAN5_STRUCTURE = ["GGLLL", "GLGLL", "GLLGL", "GLLLG", "LGGLL", "LLGGL", "LLLGG", "LGLGL", "LGLLG", "LLGLG"]; 59979 constants$2.EAN13_STRUCTURE = ["LLLLLL", "LLGLGG", "LLGGLG", "LLGGGL", "LGLLGG", "LGGLLG", "LGGGLL", "LGLGLG", "LGLGGL", "LGGLGL"]; 59980 return constants$2; 59981 } 59982 var EAN = {}; 59983 var encoder = {}; 59984 var hasRequiredEncoder; 59985 function requireEncoder() { 59986 if (hasRequiredEncoder) return encoder; 59987 hasRequiredEncoder = 1; 59988 Object.defineProperty(encoder, "__esModule", { 59989 value: true 59990 }); 59991 var _constants = requireConstants$2(); 59992 var encode = function encode2(data, structure, separator) { 59993 var encoded = data.split("").map(function(val, idx) { 59994 return _constants.BINARIES[structure[idx]]; 59995 }).map(function(val, idx) { 59996 return val ? val[data[idx]] : ""; 59997 }); 59998 if (separator) { 59999 var last = data.length - 1; 60000 encoded = encoded.map(function(val, idx) { 60001 return idx < last ? val + separator : val; 60002 }); 60003 } 60004 return encoded.join(""); 60005 }; 60006 encoder.default = encode; 60007 return encoder; 60008 } 60009 var hasRequiredEAN; 60010 function requireEAN() { 60011 if (hasRequiredEAN) return EAN; 60012 hasRequiredEAN = 1; 60013 Object.defineProperty(EAN, "__esModule", { 60014 value: true 60015 }); 60016 var _createClass = /* @__PURE__ */ (function() { 60017 function defineProperties(target, props) { 60018 for (var i2 = 0; i2 < props.length; i2++) { 60019 var descriptor = props[i2]; 60020 descriptor.enumerable = descriptor.enumerable || false; 60021 descriptor.configurable = true; 60022 if ("value" in descriptor) descriptor.writable = true; 60023 Object.defineProperty(target, descriptor.key, descriptor); 60024 } 60025 } 60026 return function(Constructor, protoProps, staticProps) { 60027 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60028 if (staticProps) defineProperties(Constructor, staticProps); 60029 return Constructor; 60030 }; 60031 })(); 60032 var _constants = requireConstants$2(); 60033 var _encoder = requireEncoder(); 60034 var _encoder2 = _interopRequireDefault(_encoder); 60035 var _Barcode2 = requireBarcode(); 60036 var _Barcode3 = _interopRequireDefault(_Barcode2); 60037 function _interopRequireDefault(obj) { 60038 return obj && obj.__esModule ? obj : { default: obj }; 60039 } 60040 function _classCallCheck(instance, Constructor) { 60041 if (!(instance instanceof Constructor)) { 60042 throw new TypeError("Cannot call a class as a function"); 60043 } 60044 } 60045 function _possibleConstructorReturn(self, call) { 60046 if (!self) { 60047 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60048 } 60049 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60050 } 60051 function _inherits(subClass, superClass) { 60052 if (typeof superClass !== "function" && superClass !== null) { 60053 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60054 } 60055 subClass.prototype = Object.create(superClass && superClass.prototype, { c
60055onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60056 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60057 } 60058 var EAN$1 = (function(_Barcode) { 60059 _inherits(EAN3, _Barcode); 60060 function EAN3(data, options) { 60061 _classCallCheck(this, EAN3); 60062 var _this = _possibleConstructorReturn(this, (EAN3.__proto__ || Object.getPrototypeOf(EAN3)).call(this, data, options)); 60063 _this.fontSize = !options.flat && options.fontSize > options.width * 10 ? options.width * 10 : options.fontSize; 60064 _this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin; 60065 return _this; 60066 } 60067 _createClass(EAN3, [{ 60068 key: "encode", 60069 value: function encode() { 60070 return this.options.flat ? this.encodeFlat() : this.encodeGuarded(); 60071 } 60072 }, { 60073 key: "leftText", 60074 value: function leftText(from, to) { 60075 return this.text.substr(from, to); 60076 } 60077 }, { 60078 key: "leftEncode", 60079 value: function leftEncode(data, structure) { 60080 return (0, _encoder2.default)(data, structure); 60081 } 60082 }, { 60083 key: "rightText", 60084 value: function rightText(from, to) { 60085 return this.text.substr(from, to); 60086 } 60087 }, { 60088 key: "rightEncode", 60089 value: function rightEncode(data, structure) { 60090 return (0, _encoder2.default)(data, structure); 60091 } 60092 }, { 60093 key: "encodeGuarded", 60094 value: function encodeGuarded() { 60095 var textOptions = { fontSize: this.fontSize }; 60096 var guardOptions = { height: this.guardHeight }; 60097 return [{ data: _constants.SIDE_BIN, options: guardOptions }, { data: this.leftEncode(), text: this.leftText(), options: textOptions }, { data: _constants.MIDDLE_BIN, options: guardOptions }, { data: this.rightEncode(), text: this.rightText(), options: textOptions }, { data: _constants.SIDE_BIN, options: guardOptions }]; 60098 } 60099 }, { 60100 key: "encodeFlat", 60101 value: function encodeFlat() { 60102 var data = [_constants.SIDE_BIN, this.leftEncode(), _constants.MIDDLE_BIN, this.rightEncode(), _constants.SIDE_BIN]; 60103 return { 60104 data: data.join(""), 60105 text: this.text 60106 }; 60107 } 60108 }]); 60109 return EAN3; 60110 })(_Barcode3.default); 60111 EAN.default = EAN$1; 60112 return EAN; 60113 } 60114 var hasRequiredEAN13; 60115 function requireEAN13() { 60116 if (hasRequiredEAN13) return EAN13; 60117 hasRequiredEAN13 = 1; 60118 Object.defineProperty(EAN13, "__esModule", { 60119 value: true 60120 }); 60121 var _createClass = /* @__PURE__ */ (function() { 60122 function defineProperties(target, props) { 60123 for (var i2 = 0; i2 < props.length; i2++) { 60124 var descriptor = props[i2]; 60125 descriptor.enumerable = descriptor.enumerable || false; 60126 descriptor.configurable = true; 60127 if ("value" in descriptor) descriptor.writable = true; 60128 Object.defineProperty(target, descriptor.key, descriptor); 60129 } 60130 } 60131 return function(Constructor, protoProps, staticProps) { 60132 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60133 if (staticProps) defineProperties(Constructor, staticProps); 60134 return Constructor; 60135 }; 60136 })(); 60137 var _get = function get2(object2, property2, receiver) { 60138 if (object2 === null) object2 = Function.prototype; 60139 var desc = Object.getOwnPropertyDescriptor(object2, property2); 60140 if (desc === void 0) { 60141 var parent = Object.getPrototypeOf(object2); 60142 if (parent === null) { 60143 return void 0; 60144 } else { 60145 return get2(parent, property2, receiver); 60146 } 60147 } else if ("value" in desc) { 60148 return desc.value; 60149 } else { 60150 var getter = desc.get; 60151 if (getter === void 0) { 60152 return void 0; 60153 } 60154 return getter.call(receiver); 60155 } 60156 }; 60157 var _constants = requireConstants$2(); 60158 var _EAN2 = requireEAN(); 60159 var _EAN3 = _interopRequireDefault(_EAN2); 60160 function _interopRequireDefault(obj) { 60161 return obj && obj.__esModule ? obj : { default: obj }; 60162 } 60163 function _classCallCheck(instance, Constructor) { 60164 if (!(instance instanceof Constructor)) { 60165 throw new TypeError("Cannot call a class as a function"); 60166 } 60167 } 60168 function _possibleConstructorReturn(self, call) { 60169 if (!self) { 60170 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60171 } 60172 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60173 } 60174 function _inherits(subClass, superClass) { 60175 if (typeof superClass !== "function" && superClass !== null) { 60176 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60177 } 60178 subClass.prototype = Object.create(superClass && superClass.prototype, { c
60178onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60179 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60180 } 60181 var checksum = function checksum2(number) { 60182 var res = number.substr(0, 12).split("").map(function(n2) { 60183 return +n2; 60184 }).reduce(function(sum, a2, idx) { 60185 return idx % 2 ? sum + a2 * 3 : sum + a2; 60186 }, 0); 60187 return (10 - res % 10) % 10; 60188 }; 60189 var EAN13$1 = (function(_EAN) { 60190 _inherits(EAN132, _EAN); 60191 function EAN132(data, options) { 60192 _classCallCheck(this, EAN132); 60193 if (data.search(/^[0-9]{12}$/) !== -1) { 60194 data += checksum(data); 60195 } 60196 var _this = _possibleConstructorReturn(this, (EAN132.__proto__ || Object.getPrototypeOf(EAN132)).call(this, data, options)); 60197 _this.lastChar = options.lastChar; 60198 return _this; 60199 } 60200 _createClass(EAN132, [{ 60201 key: "valid", 60202 value: function valid() { 60203 return this.data.search(/^[0-9]{13}$/) !== -1 && +this.data[12] === checksum(this.data); 60204 } 60205 }, { 60206 key: "leftText", 60207 value: function leftText() { 60208 return _get(EAN132.prototype.__proto__ || Object.getPrototypeOf(EAN132.prototype), "leftText", this).call(this, 1, 6); 60209 } 60210 }, { 60211 key: "leftEncode", 60212 value: function leftEncode() { 60213 var data = this.data.substr(1, 6); 60214 var structure = _constants.EAN13_STRUCTURE[this.data[0]]; 60215 return _get(EAN132.prototype.__proto__ || Object.getPrototypeOf(EAN132.prototype), "leftEncode", this).call(this, data, structure); 60216 } 60217 }, { 60218 key: "rightText", 60219 value: function rightText() { 60220 return _get(EAN132.prototype.__proto__ || Object.getPrototypeOf(EAN132.prototype), "rightText", this).call(this, 7, 6); 60221 } 60222 }, { 60223 key: "rightEncode", 60224 value: function rightEncode() { 60225 var data = this.data.substr(7, 6); 60226 return _get(EAN132.prototype.__proto__ || Object.getPrototypeOf(EAN132.prototype), "rightEncode", this).call(this, data, "RRRRRR"); 60227 } 60228 // The "standard" way of printing EAN13 barcodes with guard bars 60229 }, { 60230 key: "encodeGuarded", 60231 value: function encodeGuarded() { 60232 var data = _get(EAN132.prototype.__proto__ || Object.getPrototypeOf(EAN132.prototype), "encodeGuarded", this).call(this); 60233 if (this.options.displayValue) { 60234 data.unshift({ 60235 data: "000000000000", 60236 text: this.text.substr(0, 1), 60237 options: { textAlign: "left", fontSize: this.fontSize } 60238 }); 60239 if (this.options.lastChar) { 60240 data.push({ 60241 data: "00" 60242 }); 60243 data.push({ 60244 data: "00000", 60245 text: this.options.lastChar, 60246 options: { fontSize: this.fontSize } 60247 }); 60248 } 60249 } 60250 return data; 60251 } 60252 }]); 60253 return EAN132; 60254 })(_EAN3.default); 60255 EAN13.default = EAN13$1; 60256 return EAN13; 60257 } 60258 var EAN8 = {}; 60259 var hasRequiredEAN8; 60260 function requireEAN8() { 60261 if (hasRequiredEAN8) return EAN8; 60262 hasRequiredEAN8 = 1; 60263 Object.defineProperty(EAN8, "__esModule", { 60264 value: true 60265 }); 60266 var _createClass = /* @__PURE__ */ (function() { 60267 function defineProperties(target, props) { 60268 for (var i2 = 0; i2 < props.length; i2++) { 60269 var descriptor = props[i2]; 60270 descriptor.enumerable = descriptor.enumerable || false; 60271 descriptor.configurable = true; 60272 if ("value" in descriptor) descriptor.writable = true; 60273 Object.defineProperty(target, descriptor.key, descriptor); 60274 } 60275 } 60276 return function(Constructor, protoProps, staticProps) { 60277 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60278 if (staticProps) defineProperties(Constructor, staticProps); 60279 return Constructor; 60280 }; 60281 })(); 60282 var _get = function get2(object2, property2, receiver) { 60283 if (object2 === null) object2 = Function.prototype; 60284 var desc = Object.getOwnPropertyDescriptor(object2, property2); 60285 if (desc === void 0) { 60286 var parent = Object.getPrototypeOf(object2); 60287 if (parent === null) { 60288 return void 0; 60289 } else { 60290 return get2(parent, property2, receiver); 60291 } 60292 } else if ("value" in desc) { 60293 return desc.value; 60294 } else { 60295 var getter = desc.get; 60296 if (getter === void 0) { 60297 return void 0; 60298 } 60299 return getter.call(receiver); 60300 } 60301 }; 60302 var _EAN2 = requireEAN(); 60303 var _EAN3 = _interopRequireDefault(_EAN2); 60304 function _interopRequireDefault(obj) { 60305 return obj && obj.__esModule ? obj : { default: obj }; 60306 } 60307 function _classCallCheck(instance, Constructor) { 60308 if (!(instance instanceof Constructor)) { 60309 throw new TypeError("Cannot call a class as a function"); 60310 } 60311 } 60312 function _possibleConstructorReturn(self, call) { 60313 if (!self) { 60314 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60315 } 60316 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60317 } 60318 function _inherits(subClass, superClass) { 60319 if (typeof superClass !== "function" && superClass !== null) { 60320 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60321 } 60322 subClass.prototype = Object.create(superClass && superClass.prototype, { c
60322onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60323 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60324 } 60325 var checksum = function checksum2(number) { 60326 var res = number.substr(0, 7).split("").map(function(n2) { 60327 return +n2; 60328 }).reduce(function(sum, a2, idx) { 60329 return idx % 2 ? sum + a2 : sum + a2 * 3; 60330 }, 0); 60331 return (10 - res % 10) % 10; 60332 }; 60333 var EAN8$1 = (function(_EAN) { 60334 _inherits(EAN82, _EAN); 60335 function EAN82(data, options) { 60336 _classCallCheck(this, EAN82); 60337 if (data.search(/^[0-9]{7}$/) !== -1) { 60338 data += checksum(data); 60339 } 60340 return _possibleConstructorReturn(this, (EAN82.__proto__ || Object.getPrototypeOf(EAN82)).call(this, data, options)); 60341 } 60342 _createClass(EAN82, [{ 60343 key: "valid", 60344 value: function valid() { 60345 return this.data.search(/^[0-9]{8}$/) !== -1 && +this.data[7] === checksum(this.data); 60346 } 60347 }, { 60348 key: "leftText", 60349 value: function leftText() { 60350 return _get(EAN82.prototype.__proto__ || Object.getPrototypeOf(EAN82.prototype), "leftText", this).call(this, 0, 4); 60351 } 60352 }, { 60353 key: "leftEncode", 60354 value: function leftEncode() { 60355 var data = this.data.substr(0, 4); 60356 return _get(EAN82.prototype.__proto__ || Object.getPrototypeOf(EAN82.prototype), "leftEncode", this).call(this, data, "LLLL"); 60357 } 60358 }, { 60359 key: "rightText", 60360 value: function rightText() { 60361 return _get(EAN82.prototype.__proto__ || Object.getPrototypeOf(EAN82.prototype), "rightText", this).call(this, 4, 4); 60362 } 60363 }, { 60364 key: "rightEncode", 60365 value: function rightEncode() { 60366 var data = this.data.substr(4, 4); 60367 return _get(EAN82.prototype.__proto__ || Object.getPrototypeOf(EAN82.prototype), "rightEncode", this).call(this, data, "RRRR"); 60368 } 60369 }]); 60370 return EAN82; 60371 })(_EAN3.default); 60372 EAN8.default = EAN8$1; 60373 return EAN8; 60374 } 60375 var EAN5 = {}; 60376 var hasRequiredEAN5; 60377 function requireEAN5() { 60378 if (hasRequiredEAN5) return EAN5; 60379 hasRequiredEAN5 = 1; 60380 Object.defineProperty(EAN5, "__esModule", { 60381 value: true 60382 }); 60383 var _createClass = /* @__PURE__ */ (function() { 60384 function defineProperties(target, props) { 60385 for (var i2 = 0; i2 < props.length; i2++) { 60386 var descriptor = props[i2]; 60387 descriptor.enumerable = descriptor.enumerable || false; 60388 descriptor.configurable = true; 60389 if ("value" in descriptor) descriptor.writable = true; 60390 Object.defineProperty(target, descriptor.key, descriptor); 60391 } 60392 } 60393 return function(Constructor, protoProps, staticProps) { 60394 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60395 if (staticProps) defineProperties(Constructor, staticProps); 60396 return Constructor; 60397 }; 60398 })(); 60399 var _constants = requireConstants$2(); 60400 var _encoder = requireEncoder(); 60401 var _encoder2 = _interopRequireDefault(_encoder); 60402 var _Barcode2 = requireBarcode(); 60403 var _Barcode3 = _interopRequireDefault(_Barcode2); 60404 function _interopRequireDefault(obj) { 60405 return obj && obj.__esModule ? obj : { default: obj }; 60406 } 60407 function _classCallCheck(instance, Constructor) { 60408 if (!(instance instanceof Constructor)) { 60409 throw new TypeError("Cannot call a class as a function"); 60410 } 60411 } 60412 function _possibleConstructorReturn(self, call) { 60413 if (!self) { 60414 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60415 } 60416 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60417 } 60418 function _inherits(subClass, superClass) { 60419 if (typeof superClass !== "function" && superClass !== null) { 60420 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60421 } 60422 subClass.prototype = Object.create(superClass && superClass.prototype, { c
60422onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60423 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60424 } 60425 var checksum = function checksum2(data) { 60426 var result = data.split("").map(function(n2) { 60427 return +n2; 60428 }).reduce(function(sum, a2, idx) { 60429 return idx % 2 ? sum + a2 * 9 : sum + a2 * 3; 60430 }, 0); 60431 return result % 10; 60432 }; 60433 var EAN5$1 = (function(_Barcode) { 60434 _inherits(EAN52, _Barcode); 60435 function EAN52(data, options) { 60436 _classCallCheck(this, EAN52); 60437 return _possibleConstructorReturn(this, (EAN52.__proto__ || Object.getPrototypeOf(EAN52)).call(this, data, options)); 60438 } 60439 _createClass(EAN52, [{ 60440 key: "valid", 60441 value: function valid() { 60442 return this.data.search(/^[0-9]{5}$/) !== -1; 60443 } 60444 }, { 60445 key: "encode", 60446 value: function encode() { 60447 var structure = _constants.EAN5_STRUCTURE[checksum(this.data)]; 60448 return { 60449 data: "1011" + (0, _encoder2.default)(this.data, structure, "01"), 60450 text: this.text 60451 }; 60452 } 60453 }]); 60454 return EAN52; 60455 })(_Barcode3.default); 60456 EAN5.default = EAN5$1; 60457 return EAN5; 60458 } 60459 var EAN2 = {}; 60460 var hasRequiredEAN2; 60461 function requireEAN2() { 60462 if (hasRequiredEAN2) return EAN2; 60463 hasRequiredEAN2 = 1; 60464 Object.defineProperty(EAN2, "__esModule", { 60465 value: true 60466 }); 60467 var _createClass = /* @__PURE__ */ (function() { 60468 function defineProperties(target, props) { 60469 for (var i2 = 0; i2 < props.length; i2++) { 60470 var descriptor = props[i2]; 60471 descriptor.enumerable = descriptor.enumerable || false; 60472 descriptor.configurable = true; 60473 if ("value" in descriptor) descriptor.writable = true; 60474 Object.defineProperty(target, descriptor.key, descriptor); 60475 } 60476 } 60477 return function(Constructor, protoProps, staticProps) { 60478 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60479 if (staticProps) defineProperties(Constructor, staticProps); 60480 return Constructor; 60481 }; 60482 })(); 60483 var _constants = requireConstants$2(); 60484 var _encoder = requireEncoder(); 60485 var _encoder2 = _interopRequireDefault(_encoder); 60486 var _Barcode2 = requireBarcode(); 60487 var _Barcode3 = _interopRequireDefault(_Barcode2); 60488 function _interopRequireDefault(obj) { 60489 return obj && obj.__esModule ? obj : { default: obj }; 60490 } 60491 function _classCallCheck(instance, Constructor) { 60492 if (!(instance instanceof Constructor)) { 60493 throw new TypeError("Cannot call a class as a function"); 60494 } 60495 } 60496 function _possibleConstructorReturn(self, call) { 60497 if (!self) { 60498 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60499 } 60500 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60501 } 60502 function _inherits(subClass, superClass) { 60503 if (typeof superClass !== "function" && superClass !== null) { 60504 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60505 } 60506 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60507 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60508 } 60509 var EAN2$1 = (function(_Barcode) { 60510 _inherits(EAN22, _Barcode); 60511 function EAN22(data, options) { 60512 _classCallCheck(this, EAN22); 60513 return _possibleConstructorReturn(this, (EAN22.__proto__ || Object.getPrototypeOf(EAN22)).call(this, data, options)); 60514 } 60515 _createClass(EAN22, [{ 60516 key: "valid", 60517 value: function valid() { 60518 return this.data.search(/^[0-9]{2}$/) !== -1; 60519 } 60520 }, { 60521 key: "encode", 60522 value: function encode() { 60523 var structure = _constants.EAN2_STRUCTURE[parseInt(this.data) % 4]; 60524 return { 60525 // Start bits + Encode the two digits with 01 in between 60526 data: "1011" + (0, _encoder2.default)(this.data, structure, "01"), 60527 text: this.text 60528 }; 60529 } 60530 }]); 60531 return EAN22; 60532 })(_Barcode3.default); 60533 EAN2.default = EAN2$1; 60534 return EAN2; 60535 } 60536 var UPC = {}; 60537 var hasRequiredUPC; 60538 function requireUPC() { 60539 if (hasRequiredUPC) return UPC; 60540 hasRequiredUPC = 1;
vendor: 12,325 bytes, lines 60541-60865
60541 Object.defineProperty(UPC, "__esModule", { 60542 value: true 60543 }); 60544 var _createClass = /* @__PURE__ */ (function() { 60545 function defineProperties(target, props) { 60546 for (var i2 = 0; i2 < props.length; i2++) { 60547 var descriptor = props[i2]; 60548 descriptor.enumerable = descriptor.enumerable || false; 60549 descriptor.configurable = true; 60550 if ("value" in descriptor) descriptor.writable = true; 60551 Object.defineProperty(target, descriptor.key, descriptor); 60552 } 60553 } 60554 return function(Constructor, protoProps, staticProps) { 60555 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60556 if (staticProps) defineProperties(Constructor, staticProps); 60557 return Constructor; 60558 }; 60559 })(); 60560 UPC.checksum = checksum; 60561 var _encoder = requireEncoder(); 60562 var _encoder2 = _interopRequireDefault(_encoder); 60563 var _Barcode2 = requireBarcode(); 60564 var _Barcode3 = _interopRequireDefault(_Barcode2); 60565 function _interopRequireDefault(obj) { 60566 return obj && obj.__esModule ? obj : { default: obj }; 60567 } 60568 function _classCallCheck(instance, Constructor) { 60569 if (!(instance instanceof Constructor)) { 60570 throw new TypeError("Cannot call a class as a function"); 60571 } 60572 } 60573 function _possibleConstructorReturn(self, call) { 60574 if (!self) { 60575 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60576 } 60577 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60578 } 60579 function _inherits(subClass, superClass) { 60580 if (typeof superClass !== "function" && superClass !== null) { 60581 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60582 } 60583 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60584 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60585 } 60586 var UPC$1 = (function(_Barcode) { 60587 _inherits(UPC2, _Barcode); 60588 function UPC2(data, options) { 60589 _classCallCheck(this, UPC2); 60590 if (data.search(/^[0-9]{11}$/) !== -1) { 60591 data += checksum(data); 60592 } 60593 var _this = _possibleConstructorReturn(this, (UPC2.__proto__ || Object.getPrototypeOf(UPC2)).call(this, data, options)); 60594 _this.displayValue = options.displayValue; 60595 if (options.fontSize > options.width * 10) { 60596 _this.fontSize = options.width * 10; 60597 } else { 60598 _this.fontSize = options.fontSize; 60599 } 60600 _this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin; 60601 return _this; 60602 } 60603 _createClass(UPC2, [{ 60604 key: "valid", 60605 value: function valid() { 60606 return this.data.search(/^[0-9]{12}$/) !== -1 && this.data[11] == checksum(this.data); 60607 } 60608 }, { 60609 key: "encode", 60610 value: function encode() { 60611 if (this.options.flat) { 60612 return this.flatEncoding(); 60613 } else { 60614 return this.guardedEncoding(); 60615 } 60616 } 60617 }, { 60618 key: "flatEncoding", 60619 value: function flatEncoding() { 60620 var result = ""; 60621 result += "101"; 60622 result += (0, _encoder2.default)(this.data.substr(0, 6), "LLLLLL"); 60623 result += "01010"; 60624 result += (0, _encoder2.default)(this.data.substr(6, 6), "RRRRRR"); 60625 result += "101"; 60626 return { 60627 data: result, 60628 text: this.text 60629 }; 60630 } 60631 }, { 60632 key: "guardedEncoding", 60633 value: function guardedEncoding() { 60634 var result = []; 60635 if (this.displayValue) { 60636 result.push({ 60637 data: "00000000", 60638 text: this.text.substr(0, 1), 60639 options: { textAlign: "left", fontSize: this.fontSize } 60640 }); 60641 } 60642 result.push({ 60643 data: "101" + (0, _encoder2.default)(this.data[0], "L"), 60644 options: { height: this.guardHeight } 60645 }); 60646 result.push({ 60647 data: (0, _encoder2.default)(this.data.substr(1, 5), "LLLLL"), 60648 text: this.text.substr(1, 5), 60649 options: { fontSize: this.fontSize } 60650 }); 60651 result.push({ 60652 data: "01010", 60653 options: { height: this.guardHeight } 60654 }); 60655 result.push({ 60656 data: (0, _encoder2.default)(this.data.substr(6, 5), "RRRRR"), 60657 text: this.text.substr(6, 5), 60658 options: { fontSize: this.fontSize } 60659 }); 60660 result.push({ 60661 data: (0, _encoder2.default)(this.data[11], "R") + "101", 60662 options: { height: this.guardHeight } 60663 }); 60664 if (this.displayValue) { 60665 result.push({ 60666 data: "00000000", 60667 text: this.text.substr(11, 1), 60668 options: { textAlign: "right", fontSize: this.fontSize } 60669 }); 60670 } 60671 return result; 60672 } 60673 }]); 60674 return UPC2; 60675 })(_Barcode3.default); 60676 function checksum(number) { 60677 var result = 0; 60678 var i2; 60679 for (i2 = 1; i2 < 11; i2 += 2) { 60680 result += parseInt(number[i2]); 60681 } 60682 for (i2 = 0; i2 < 11; i2 += 2) { 60683 result += parseInt(number[i2]) * 3; 60684 } 60685 return (10 - result % 10) % 10; 60686 } 60687 UPC.default = UPC$1; 60688 return UPC; 60689 } 60690 var UPCE = {}; 60691 var hasRequiredUPCE; 60692 function requireUPCE() { 60693 if (hasRequiredUPCE) return UPCE; 60694 hasRequiredUPCE = 1; 60695 Object.defineProperty(UPCE, "__esModule", { 60696 value: true 60697 }); 60698 var _createClass = /* @__PURE__ */ (function() { 60699 function defineProperties(target, props) { 60700 for (var i2 = 0; i2 < props.length; i2++) { 60701 var descriptor = props[i2]; 60702 descriptor.enumerable = descriptor.enumerable || false; 60703 descriptor.configurable = true; 60704 if ("value" in descriptor) descriptor.writable = true; 60705 Object.defineProperty(target, descriptor.key, descriptor); 60706 } 60707 } 60708 return function(Constructor, protoProps, staticProps) { 60709 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60710 if (staticProps) defineProperties(Constructor, staticProps); 60711 return Constructor; 60712 }; 60713 })(); 60714 var _encoder = requireEncoder(); 60715 var _encoder2 = _interopRequireDefault(_encoder); 60716 var _Barcode2 = requireBarcode(); 60717 var _Barcode3 = _interopRequireDefault(_Barcode2); 60718 var _UPC = requireUPC(); 60719 function _interopRequireDefault(obj) { 60720 return obj && obj.__esModule ? obj : { default: obj }; 60721 } 60722 function _classCallCheck(instance, Constructor) { 60723 if (!(instance instanceof Constructor)) { 60724 throw new TypeError("Cannot call a class as a function"); 60725 } 60726 } 60727 function _possibleConstructorReturn(self, call) { 60728 if (!self) { 60729 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60730 } 60731 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60732 } 60733 function _inherits(subClass, superClass) { 60734 if (typeof superClass !== "function" && superClass !== null) { 60735 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60736 } 60737 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60738 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60739 } 60740 var EXPANSIONS = ["XX00000XXX", "XX10000XXX", "XX20000XXX", "XXX00000XX", "XXXX00000X", "XXXXX00005", "XXXXX00006", "XXXXX00007", "XXXXX00008", "XXXXX00009"]; 60741 var PARITIES = [["EEEOOO", "OOOEEE"], ["EEOEOO", "OOEOEE"], ["EEOOEO", "OOEEOE"], ["EEOOOE", "OOEEEO"], ["EOEEOO", "OEOOEE"], ["EOOEEO", "OEEOOE"], ["EOOOEE", "OEEEOO"], ["EOEOEO", "OEOEOE"], ["EOEOOE", "OEOEEO"], ["EOOEOE", "OEEOEO"]]; 60742 var UPCE$1 = (function(_Barcode) { 60743 _inherits(UPCE2, _Barcode); 60744 function UPCE2(data, options) { 60745 _classCallCheck(this, UPCE2); 60746 var _this = _possibleConstructorReturn(this, (UPCE2.__proto__ || Object.getPrototypeOf(UPCE2)).call(this, data, options)); 60747 _this.isValid = false; 60748 if (data.search(/^[0-9]{6}$/) !== -1) { 60749 _this.middleDigits = data; 60750 _this.upcA = expandToUPCA(data, "0"); 60751 _this.text = options.text || "" + _this.upcA[0] + data + _this.upcA[_this.upcA.length - 1]; 60752 _this.isValid = true; 60753 } else if (data.search(/^[01][0-9]{7}$/) !== -1) { 60754 _this.middleDigits = data.substring(1, data.length - 1); 60755 _this.upcA = expandToUPCA(_this.middleDigits, data[0]); 60756 if (_this.upcA[_this.upcA.length - 1] === data[data.length - 1]) { 60757 _this.isValid = true; 60758 } else { 60759 return _possibleConstructorReturn(_this); 60760 } 60761 } else { 60762 return _possibleConstructorReturn(_this); 60763 } 60764 _this.displayValue = options.displayValue; 60765 if (options.fontSize > options.width * 10) { 60766 _this.fontSize = options.width * 10; 60767 } else { 60768 _this.fontSize = options.fontSize; 60769 } 60770 _this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin; 60771 return _this; 60772 } 60773 _createClass(UPCE2, [{ 60774 key: "valid", 60775 value: function valid() { 60776 return this.isValid; 60777 } 60778 }, { 60779 key: "encode", 60780 value: function encode() { 60781 if (this.options.flat) { 60782 return this.flatEncoding(); 60783 } else { 60784 return this.guardedEncoding(); 60785 } 60786 } 60787 }, { 60788 key: "flatEncoding", 60789 value: function flatEncoding() { 60790 var result = ""; 60791 result += "101"; 60792 result += this.encodeMiddleDigits(); 60793 result += "010101"; 60794 return { 60795 data: result, 60796 text: this.text 60797 }; 60798 } 60799 }, { 60800 key: "guardedEncoding", 60801 value: function guardedEncoding() { 60802 var result = []; 60803 if (this.displayValue) { 60804 result.push({ 60805 data: "00000000", 60806 text: this.text[0], 60807 options: { textAlign: "left", fontSize: this.fontSize } 60808 }); 60809 } 60810 result.push({ 60811 data: "101", 60812 options: { height: this.guardHeight } 60813 }); 60814 result.push({ 60815 data: this.encodeMiddleDigits(), 60816 text: this.text.substring(1, 7), 60817 options: { fontSize: this.fontSize } 60818 }); 60819 result.push({ 60820 data: "010101", 60821 options: { height: this.guardHeight } 60822 }); 60823 if (this.displayValue) { 60824 result.push({ 60825 data: "00000000", 60826 text: this.text[7], 60827 options: { textAlign: "right", fontSize: this.fontSize } 60828 }); 60829 } 60830 return result; 60831 } 60832 }, { 60833 key: "encodeMiddleDigits", 60834 value: function encodeMiddleDigits() { 60835 var numberSystem = this.upcA[0]; 60836 var checkDigit = this.upcA[this.upcA.length - 1]; 60837 var parity = PARITIES[parseInt(checkDigit)][parseInt(numberSystem)]; 60838 return (0, _encoder2.default)(this.middleDigits, parity); 60839 } 60840 }]); 60841 return UPCE2; 60842 })(_Barcode3.default); 60843 function expandToUPCA(middleDigits, numberSystem) { 60844 var lastUpcE = parseInt(middleDigits[middleDigits.length - 1]); 60845 var expansion = EXPANSIONS[lastUpcE]; 60846 var result = ""; 60847 var digitIndex = 0; 60848 for (var i2 = 0; i2 < expansion.length; i2++) { 60849 var c2 = expansion[i2]; 60850 if (c2 === "X") { 60851 result += middleDigits[digitIndex++]; 60852 } else { 60853 result += c2; 60854 } 60855 } 60856 result = "" + numberSystem + result; 60857 return "" + result + (0, _UPC.checksum)(result); 60858 } 60859 UPCE.default = UPCE$1; 60860 return UPCE; 60861 } 60862 var hasRequiredEAN_UPC; 60863 function requireEAN_UPC() { 60864 if (hasRequiredEAN_UPC) return EAN_UPC; 60865 hasRequiredEAN_UPC = 1;
60866 Object.defineProperty(EAN_UPC, "__esModule", { 60867 value: true 60868 }); 60869 EAN_UPC.UPCE = EAN_UPC.UPC = EAN_UPC.EAN2 = EAN_UPC.EAN5 = EAN_UPC.EAN8 = EAN_UPC.EAN13 = void 0; 60870 var _EAN = requireEAN13(); 60871 var _EAN2 = _interopRequireDefault(_EAN); 60872 var _EAN3 = requireEAN8(); 60873 var _EAN4 = _interopRequireDefault(_EAN3); 60874 var _EAN5 = requireEAN5(); 60875 var _EAN6 = _interopRequireDefault(_EAN5); 60876 var _EAN7 = requireEAN2(); 60877 var _EAN8 = _interopRequireDefault(_EAN7); 60878 var _UPC = requireUPC(); 60879 var _UPC2 = _interopRequireDefault(_UPC); 60880 var _UPCE = requireUPCE(); 60881 var _UPCE2 = _interopRequireDefault(_UPCE); 60882 function _interopRequireDefault(obj) { 60883 return obj && obj.__esModule ? obj : { default: obj }; 60884 } 60885 EAN_UPC.EAN13 = _EAN2.default; 60886 EAN_UPC.EAN8 = _EAN4.default; 60887 EAN_UPC.EAN5 = _EAN6.default; 60888 EAN_UPC.EAN2 = _EAN8.default; 60889 EAN_UPC.UPC = _UPC2.default; 60890 EAN_UPC.UPCE = _UPCE2.default; 60891 return EAN_UPC; 60892 } 60893 var ITF$1 = {}; 60894 var ITF = {}; 60895 var constants$1 = {}; 60896 var hasRequiredConstants$1; 60897 function requireConstants$1() { 60898 if (hasRequiredConstants$1) return constants$1; 60899 hasRequiredConstants$1 = 1; 60900 Object.defineProperty(constants$1, "__esModule", { 60901 value: true 60902 }); 60903 constants$1.START_BIN = "1010"; 60904 constants$1.END_BIN = "11101"; 60905 constants$1.BINARIES = ["00110", "10001", "01001", "11000", "00101", "10100", "01100", "00011", "10010", "01010"]; 60906 return constants$1; 60907 } 60908 var hasRequiredITF$1; 60909 function requireITF$1() { 60910 if (hasRequiredITF$1) return ITF; 60911 hasRequiredITF$1 = 1; 60912 Object.defineProperty(ITF, "__esModule", { 60913 value: true 60914 }); 60915 var _createClass = /* @__PURE__ */ (function() { 60916 function defineProperties(target, props) { 60917 for (var i2 = 0; i2 < props.length; i2++) { 60918 var descriptor = props[i2]; 60919 descriptor.enumerable = descriptor.enumerable || false; 60920 descriptor.configurable = true; 60921 if ("value" in descriptor) descriptor.writable = true; 60922 Object.defineProperty(target, descriptor.key, descriptor); 60923 } 60924 } 60925 return function(Constructor, protoProps, staticProps) { 60926 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60927 if (staticProps) defineProperties(Constructor, staticProps); 60928 return Constructor; 60929 }; 60930 })(); 60931 var _constants = requireConstants$1(); 60932 var _Barcode2 = requireBarcode(); 60933 var _Barcode3 = _interopRequireDefault(_Barcode2); 60934 function _interopRequireDefault(obj) { 60935 return obj && obj.__esModule ? obj : { default: obj }; 60936 } 60937 function _classCallCheck(instance, Constructor) { 60938 if (!(instance instanceof Constructor)) { 60939 throw new TypeError("Cannot call a class as a function"); 60940 } 60941 } 60942 function _possibleConstructorReturn(self, call) { 60943 if (!self) { 60944 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60945 } 60946 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60947 } 60948 function _inherits(subClass, superClass) { 60949 if (typeof superClass !== "function" && superClass !== null) { 60950 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60951 } 60952 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60953 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60954 } 60955 var ITF$12 = (function(_Barcode) { 60956 _inherits(ITF2, _Barcode); 60957 function ITF2() { 60958 _classCallCheck(this, ITF2); 60959 return _possibleConstructorReturn(this, (ITF2.__proto__ || Object.getPrototypeOf(ITF2)).apply(this, arguments)); 60960 } 60961 _createClass(ITF2, [{ 60962 key: "valid", 60963 value: function valid() { 60964 return this.data.search(/^([0-9]{2})+$/) !== -1; 60965 } 60966 }, { 60967 key: "encode", 60968 value: function encode() { 60969 var _this2 = this; 60970 var encoded = this.data.match(/.{2}/g).map(function(pair) { 60971 return _this2.encodePair(pair); 60972 }).join(""); 60973 return { 60974 data: _constants.START_BIN + encoded + _constants.END_BIN, 60975 text: this.text 60976 }; 60977 } 60978 // Calculate the data of a number pair 60979 }, { 60980 key: "encodePair", 60981 value: function encodePair(pair) { 60982 var second = _constants.BINARIES[pair[1]]; 60983 return _constants.BINARIES[pair[0]].split("").map(function(first, idx) { 60984 return (first === "1" ? "111" : "1") + (second[idx] === "1" ? "000" : "0"); 60985 }).join(""); 60986 } 60987 }]); 60988 return ITF2; 60989 })(_Barcode3.default); 60990 ITF.default = ITF$12; 60991 return ITF; 60992 } 60993 var ITF14 = {}; 60994 var hasRequiredITF14; 60995 function requireITF14() { 60996 if (hasRequiredITF14) return ITF14; 60997 hasRequiredITF14 = 1;
60998 Object.defineProperty(ITF14, "__esModule", { 60999 value: true 61000 }); 61001 var _createClass = /* @__PURE__ */ (function() { 61002 function defineProperties(target, props) { 61003 for (var i2 = 0; i2 < props.length; i2++) { 61004 var descriptor = props[i2]; 61005 descriptor.enumerable = descriptor.enumerable || false; 61006 descriptor.configurable = true; 61007 if ("value" in descriptor) descriptor.writable = true; 61008 Object.defineProperty(target, descriptor.key, descriptor); 61009 } 61010 } 61011 return function(Constructor, protoProps, staticProps) { 61012 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61013 if (staticProps) defineProperties(Constructor, staticProps); 61014 return Constructor; 61015 }; 61016 })(); 61017 var _ITF2 = requireITF$1(); 61018 var _ITF3 = _interopRequireDefault(_ITF2); 61019 function _interopRequireDefault(obj) { 61020 return obj && obj.__esModule ? obj : { default: obj }; 61021 } 61022 function _classCallCheck(instance, Constructor) { 61023 if (!(instance instanceof Constructor)) { 61024 throw new TypeError("Cannot call a class as a function"); 61025 } 61026 } 61027 function _possibleConstructorReturn(self, call) { 61028 if (!self) { 61029 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61030 } 61031 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61032 } 61033 function _inherits(subClass, superClass) { 61034 if (typeof superClass !== "function" && superClass !== null) { 61035 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61036 } 61037 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61038 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61039 } 61040 var checksum = function checksum2(data) { 61041 var res = data.substr(0, 13).split("").map(function(num) { 61042 return parseInt(num, 10); 61043 }).reduce(function(sum, n2, idx) { 61044 return sum + n2 * (3 - idx % 2 * 2); 61045 }, 0); 61046 return Math.ceil(res / 10) * 10 - res; 61047 }; 61048 var ITF14$1 = (function(_ITF) { 61049 _inherits(ITF142, _ITF); 61050 function ITF142(data, options) { 61051 _classCallCheck(this, ITF142); 61052 if (data.search(/^[0-9]{13}$/) !== -1) { 61053 data += checksum(data); 61054 } 61055 return _possibleConstructorReturn(this, (ITF142.__proto__ || Object.getPrototypeOf(ITF142)).call(this, data, options)); 61056 } 61057 _createClass(ITF142, [{ 61058 key: "valid", 61059 value: function valid() { 61060 return this.data.search(/^[0-9]{14}$/) !== -1 && +this.data[13] === checksum(this.data); 61061 } 61062 }]); 61063 return ITF142; 61064 })(_ITF3.default); 61065 ITF14.default = ITF14$1; 61066 return ITF14; 61067 } 61068 var hasRequiredITF; 61069 function requireITF() { 61070 if (hasRequiredITF) return ITF$1; 61071 hasRequiredITF = 1; 61072 Object.defineProperty(ITF$1, "__esModule", { 61073 value: true 61074 }); 61075 ITF$1.ITF14 = ITF$1.ITF = void 0; 61076 var _ITF = requireITF$1(); 61077 var _ITF2 = _interopRequireDefault(_ITF); 61078 var _ITF3 = requireITF14(); 61079 var _ITF4 = _interopRequireDefault(_ITF3); 61080 function _interopRequireDefault(obj) { 61081 return obj && obj.__esModule ? obj : { default: obj }; 61082 } 61083 ITF$1.ITF = _ITF2.default; 61084 ITF$1.ITF14 = _ITF4.default; 61085 return ITF$1; 61086 } 61087 var MSI$1 = {}; 61088 var MSI = {}; 61089 var hasRequiredMSI$1; 61090 function requireMSI$1() { 61091 if (hasRequiredMSI$1) return MSI; 61092 hasRequiredMSI$1 = 1; 61093 Object.defineProperty(MSI, "__esModule", { 61094 value: true 61095 }); 61096 var _createClass = /* @__PURE__ */ (function() { 61097 function defineProperties(target, props) { 61098 for (var i2 = 0; i2 < props.length; i2++) { 61099 var descriptor = props[i2]; 61100 descriptor.enumerable = descriptor.enumerable || false; 61101 descriptor.configurable = true; 61102 if ("value" in descriptor) descriptor.writable = true; 61103 Object.defineProperty(target, descriptor.key, descriptor); 61104 } 61105 } 61106 return function(Constructor, protoProps, staticProps) { 61107 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61108 if (staticProps) defineProperties(Constructor, staticProps); 61109 return Constructor; 61110 }; 61111 })(); 61112 var _Barcode2 = requireBarcode(); 61113 var _Barcode3 = _interopRequireDefault(_Barcode2); 61114 function _interopRequireDefault(obj) { 61115 return obj && obj.__esModule ? obj : { default: obj }; 61116 } 61117 function _classCallCheck(instance, Constructor) { 61118 if (!(instance instanceof Constructor)) { 61119 throw new TypeError("Cannot call a class as a function"); 61120 } 61121 } 61122 function _possibleConstructorReturn(self, call) { 61123 if (!self) { 61124 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61125 } 61126 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61127 } 61128 function _inherits(subClass, superClass) { 61129 if (typeof superClass !== "function" && superClass !== null) { 61130 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61131 } 61132 subClass.prototype = Object.create(superClass && superClass.prototype, { c
61132onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61133 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61134 } 61135 var MSI$12 = (function(_Barcode) { 61136 _inherits(MSI2, _Barcode); 61137 function MSI2(data, options) { 61138 _classCallCheck(this, MSI2); 61139 return _possibleConstructorReturn(this, (MSI2.__proto__ || Object.getPrototypeOf(MSI2)).call(this, data, options)); 61140 } 61141 _createClass(MSI2, [{ 61142 key: "encode", 61143 value: function encode() { 61144 var ret = "110"; 61145 for (var i2 = 0; i2 < this.data.length; i2++) { 61146 var digit = parseInt(this.data[i2]); 61147 var bin = digit.toString(2); 61148 bin = addZeroes(bin, 4 - bin.length); 61149 for (var b2 = 0; b2 < bin.length; b2++) { 61150 ret += bin[b2] == "0" ? "100" : "110"; 61151 } 61152 } 61153 ret += "1001"; 61154 return { 61155 data: ret, 61156 text: this.text 61157 }; 61158 } 61159 }, { 61160 key: "valid", 61161 value: function valid() { 61162 return this.data.search(/^[0-9]+$/) !== -1; 61163 } 61164 }]); 61165 return MSI2; 61166 })(_Barcode3.default); 61167 function addZeroes(number, n2) { 61168 for (var i2 = 0; i2 < n2; i2++) { 61169 number = "0" + number; 61170 } 61171 return number; 61172 } 61173 MSI.default = MSI$12; 61174 return MSI; 61175 } 61176 var MSI10 = {}; 61177 var checksums = {}; 61178 var hasRequiredChecksums; 61179 function requireChecksums() { 61180 if (hasRequiredChecksums) return checksums; 61181 hasRequiredChecksums = 1; 61182 Object.defineProperty(checksums, "__esModule", { 61183 value: true 61184 }); 61185 checksums.mod10 = mod10; 61186 checksums.mod11 = mod11; 61187 function mod10(number) { 61188 var sum = 0; 61189 for (var i2 = 0; i2 < number.length; i2++) { 61190 var n2 = parseInt(number[i2]); 61191 if ((i2 + number.length) % 2 === 0) { 61192 sum += n2; 61193 } else { 61194 sum += n2 * 2 % 10 + Math.floor(n2 * 2 / 10); 61195 } 61196 } 61197 return (10 - sum % 10) % 10; 61198 } 61199 function mod11(number) { 61200 var sum = 0; 61201 var weights = [2, 3, 4, 5, 6, 7]; 61202 for (var i2 = 0; i2 < number.length; i2++) { 61203 var n2 = parseInt(number[number.length - 1 - i2]); 61204 sum += weights[i2 % weights.length] * n2; 61205 } 61206 return (11 - sum % 11) % 11; 61207 } 61208 return checksums; 61209 } 61210 var hasRequiredMSI10; 61211 function requireMSI10() { 61212 if (hasRequiredMSI10) return MSI10; 61213 hasRequiredMSI10 = 1; 61214 Object.defineProperty(MSI10, "__esModule", { 61215 value: true 61216 }); 61217 var _MSI2 = requireMSI$1(); 61218 var _MSI3 = _interopRequireDefault(_MSI2); 61219 var _checksums = requireChecksums(); 61220 function _interopRequireDefault(obj) { 61221 return obj && obj.__esModule ? obj : { default: obj }; 61222 } 61223 function _classCallCheck(instance, Constructor) { 61224 if (!(instance instanceof Constructor)) { 61225 throw new TypeError("Cannot call a class as a function"); 61226 } 61227 } 61228 function _possibleConstructorReturn(self, call) { 61229 if (!self) { 61230 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61231 } 61232 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61233 } 61234 function _inherits(subClass, superClass) { 61235 if (typeof superClass !== "function" && superClass !== null) { 61236 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61237 } 61238 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61239 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61240 } 61241 var MSI10$1 = (function(_MSI) { 61242 _inherits(MSI102, _MSI); 61243 function MSI102(data, options) { 61244 _classCallCheck(this, MSI102); 61245 return _possibleConstructorReturn(this, (MSI102.__proto__ || Object.getPrototypeOf(MSI102)).call(this, data + (0, _checksums.mod10)(data), options)); 61246 } 61247 return MSI102; 61248 })(_MSI3.default); 61249 MSI10.default = MSI10$1; 61250 return MSI10; 61251 } 61252 var MSI11 = {}; 61253 var hasRequiredMSI11; 61254 function requireMSI11() { 61255 if (hasRequiredMSI11) return MSI11; 61256 hasRequiredMSI11 = 1;
61257 Object.defineProperty(MSI11, "__esModule", { 61258 value: true 61259 }); 61260 var _MSI2 = requireMSI$1(); 61261 var _MSI3 = _interopRequireDefault(_MSI2); 61262 var _checksums = requireChecksums(); 61263 function _interopRequireDefault(obj) { 61264 return obj && obj.__esModule ? obj : { default: obj }; 61265 } 61266 function _classCallCheck(instance, Constructor) { 61267 if (!(instance instanceof Constructor)) { 61268 throw new TypeError("Cannot call a class as a function"); 61269 } 61270 } 61271 function _possibleConstructorReturn(self, call) { 61272 if (!self) { 61273 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61274 } 61275 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61276 } 61277 function _inherits(subClass, superClass) { 61278 if (typeof superClass !== "function" && superClass !== null) { 61279 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61280 } 61281 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61282 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61283 } 61284 var MSI11$1 = (function(_MSI) { 61285 _inherits(MSI112, _MSI); 61286 function MSI112(data, options) { 61287 _classCallCheck(this, MSI112); 61288 return _possibleConstructorReturn(this, (MSI112.__proto__ || Object.getPrototypeOf(MSI112)).call(this, data + (0, _checksums.mod11)(data), options)); 61289 } 61290 return MSI112; 61291 })(_MSI3.default); 61292 MSI11.default = MSI11$1; 61293 return MSI11; 61294 } 61295 var MSI1010 = {}; 61296 var hasRequiredMSI1010; 61297 function requireMSI1010() { 61298 if (hasRequiredMSI1010) return MSI1010; 61299 hasRequiredMSI1010 = 1; 61300 Object.defineProperty(MSI1010, "__esModule", { 61301 value: true 61302 }); 61303 var _MSI2 = requireMSI$1(); 61304 var _MSI3 = _interopRequireDefault(_MSI2); 61305 var _checksums = requireChecksums(); 61306 function _interopRequireDefault(obj) { 61307 return obj && obj.__esModule ? obj : { default: obj }; 61308 } 61309 function _classCallCheck(instance, Constructor) { 61310 if (!(instance instanceof Constructor)) { 61311 throw new TypeError("Cannot call a class as a function"); 61312 } 61313 } 61314 function _possibleConstructorReturn(self, call) { 61315 if (!self) { 61316 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61317 } 61318 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61319 } 61320 function _inherits(subClass, superClass) { 61321 if (typeof superClass !== "function" && superClass !== null) { 61322 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61323 } 61324 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61325 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61326 } 61327 var MSI1010$1 = (function(_MSI) { 61328 _inherits(MSI10102, _MSI); 61329 function MSI10102(data, options) { 61330 _classCallCheck(this, MSI10102); 61331 data += (0, _checksums.mod10)(data); 61332 data += (0, _checksums.mod10)(data); 61333 return _possibleConstructorReturn(this, (MSI10102.__proto__ || Object.getPrototypeOf(MSI10102)).call(this, data, options)); 61334 } 61335 return MSI10102; 61336 })(_MSI3.default); 61337 MSI1010.default = MSI1010$1; 61338 return MSI1010; 61339 } 61340 var MSI1110 = {}; 61341 var hasRequiredMSI1110; 61342 function requireMSI1110() { 61343 if (hasRequiredMSI1110) return MSI1110; 61344 hasRequiredMSI1110 = 1; 61345 Object.defineProperty(MSI1110, "__esModule", { 61346 value: true 61347 }); 61348 var _MSI2 = requireMSI$1(); 61349 var _MSI3 = _interopRequireDefault(_MSI2); 61350 var _checksums = requireChecksums(); 61351 function _interopRequireDefault(obj) { 61352 return obj && obj.__esModule ? obj : { default: obj }; 61353 } 61354 function _classCallCheck(instance, Constructor) { 61355 if (!(instance instanceof Constructor)) { 61356 throw new TypeError("Cannot call a class as a function"); 61357 } 61358 } 61359 function _possibleConstructorReturn(self, call) { 61360 if (!self) { 61361 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61362 } 61363 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61364 } 61365 function _inherits(subClass, superClass) { 61366 if (typeof superClass !== "function" && superClass !== null) { 61367 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61368 } 61369 subClass.prototype = Object.create(superClass && superClass.prototype, { c
61369onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61370 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61371 } 61372 var MSI1110$1 = (function(_MSI) { 61373 _inherits(MSI11102, _MSI); 61374 function MSI11102(data, options) { 61375 _classCallCheck(this, MSI11102); 61376 data += (0, _checksums.mod11)(data); 61377 data += (0, _checksums.mod10)(data); 61378 return _possibleConstructorReturn(this, (MSI11102.__proto__ || Object.getPrototypeOf(MSI11102)).call(this, data, options)); 61379 } 61380 return MSI11102; 61381 })(_MSI3.default); 61382 MSI1110.default = MSI1110$1; 61383 return MSI1110; 61384 } 61385 var hasRequiredMSI; 61386 function requireMSI() { 61387 if (hasRequiredMSI) return MSI$1; 61388 hasRequiredMSI = 1; 61389 Object.defineProperty(MSI$1, "__esModule", { 61390 value: true 61391 }); 61392 MSI$1.MSI1110 = MSI$1.MSI1010 = MSI$1.MSI11 = MSI$1.MSI10 = MSI$1.MSI = void 0; 61393 var _MSI = requireMSI$1(); 61394 var _MSI2 = _interopRequireDefault(_MSI); 61395 var _MSI3 = requireMSI10(); 61396 var _MSI4 = _interopRequireDefault(_MSI3); 61397 var _MSI5 = requireMSI11(); 61398 var _MSI6 = _interopRequireDefault(_MSI5); 61399 var _MSI7 = requireMSI1010(); 61400 var _MSI8 = _interopRequireDefault(_MSI7); 61401 var _MSI9 = requireMSI1110(); 61402 var _MSI10 = _interopRequireDefault(_MSI9); 61403 function _interopRequireDefault(obj) { 61404 return obj && obj.__esModule ? obj : { default: obj }; 61405 } 61406 MSI$1.MSI = _MSI2.default; 61407 MSI$1.MSI10 = _MSI4.default; 61408 MSI$1.MSI11 = _MSI6.default; 61409 MSI$1.MSI1010 = _MSI8.default; 61410 MSI$1.MSI1110 = _MSI10.default; 61411 return MSI$1; 61412 } 61413 var pharmacode = {}; 61414 var hasRequiredPharmacode; 61415 function requirePharmacode() { 61416 if (hasRequiredPharmacode) return pharmacode; 61417 hasRequiredPharmacode = 1; 61418 Object.defineProperty(pharmacode, "__esModule", { 61419 value: true 61420 }); 61421 pharmacode.pharmacode = void 0; 61422 var _createClass = /* @__PURE__ */ (function() { 61423 function defineProperties(target, props) { 61424 for (var i2 = 0; i2 < props.length; i2++) { 61425 var descriptor = props[i2]; 61426 descriptor.enumerable = descriptor.enumerable || false; 61427 descriptor.configurable = true; 61428 if ("value" in descriptor) descriptor.writable = true; 61429 Object.defineProperty(target, descriptor.key, descriptor); 61430 } 61431 } 61432 return function(Constructor, protoProps, staticProps) { 61433 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61434 if (staticProps) defineProperties(Constructor, staticProps); 61435 return Constructor; 61436 }; 61437 })(); 61438 var _Barcode2 = requireBarcode(); 61439 var _Barcode3 = _interopRequireDefault(_Barcode2); 61440 function _interopRequireDefault(obj) { 61441 return obj && obj.__esModule ? obj : { default: obj }; 61442 } 61443 function _classCallCheck(instance, Constructor) { 61444 if (!(instance instanceof Constructor)) { 61445 throw new TypeError("Cannot call a class as a function"); 61446 } 61447 } 61448 function _possibleConstructorReturn(self, call) { 61449 if (!self) { 61450 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61451 } 61452 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61453 } 61454 function _inherits(subClass, superClass) { 61455 if (typeof superClass !== "function" && superClass !== null) { 61456 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61457 } 61458 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61459 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61460 } 61461 var pharmacode$1 = (function(_Barcode) { 61462 _inherits(pharmacode2, _Barcode); 61463 function pharmacode2(data, options) { 61464 _classCallCheck(this, pharmacode2); 61465 var _this = _possibleConstructorReturn(this, (pharmacode2.__proto__ || Object.getPrototypeOf(pharmacode2)).call(this, data, options)); 61466 _this.number = parseInt(data, 10); 61467 return _this; 61468 } 61469 _createClass(pharmacode2, [{ 61470 key: "encode", 61471 value: function encode() { 61472 var z2 = this.number; 61473 var result = ""; 61474 while (!isNaN(z2) && z2 != 0) { 61475 if (z2 % 2 === 0) { 61476 result = "11100" + result; 61477 z2 = (z2 - 2) / 2; 61478 } else { 61479 result = "100" + result; 61480 z2 = (z2 - 1) / 2; 61481 } 61482 } 61483 result = result.slice(0, -2); 61484 return { 61485 data: result, 61486 text: this.text 61487 }; 61488 } 61489 }, { 61490 key: "valid", 61491 value: function valid() { 61492 return this.number >= 3 && this.number <= 131070; 61493 } 61494 }]); 61495 return pharmacode2; 61496 })(_Barcode3.default); 61497 pharmacode.pharmacode = pharmacode$1; 61498 return pharmacode; 61499 } 61500 var codabar = {}; 61501 var hasRequiredCodabar; 61502 function requireCodabar() { 61503 if (hasRequiredCodabar) return codabar; 61504 hasRequiredCodabar = 1;
61505 Object.defineProperty(codabar, "__esModule", { 61506 value: true 61507 }); 61508 codabar.codabar = void 0; 61509 var _createClass = /* @__PURE__ */ (function() { 61510 function defineProperties(target, props) { 61511 for (var i2 = 0; i2 < props.length; i2++) { 61512 var descriptor = props[i2]; 61513 descriptor.enumerable = descriptor.enumerable || false; 61514 descriptor.configurable = true; 61515 if ("value" in descriptor) descriptor.writable = true; 61516 Object.defineProperty(target, descriptor.key, descriptor); 61517 } 61518 } 61519 return function(Constructor, protoProps, staticProps) { 61520 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61521 if (staticProps) defineProperties(Constructor, staticProps); 61522 return Constructor; 61523 }; 61524 })(); 61525 var _Barcode2 = requireBarcode(); 61526 var _Barcode3 = _interopRequireDefault(_Barcode2); 61527 function _interopRequireDefault(obj) { 61528 return obj && obj.__esModule ? obj : { default: obj }; 61529 } 61530 function _classCallCheck(instance, Constructor) { 61531 if (!(instance instanceof Constructor)) { 61532 throw new TypeError("Cannot call a class as a function"); 61533 } 61534 } 61535 function _possibleConstructorReturn(self, call) { 61536 if (!self) { 61537 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61538 } 61539 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61540 } 61541 function _inherits(subClass, superClass) { 61542 if (typeof superClass !== "function" && superClass !== null) { 61543 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61544 } 61545 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61546 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61547 } 61548 var codabar$1 = (function(_Barcode) { 61549 _inherits(codabar2, _Barcode); 61550 function codabar2(data, options) { 61551 _classCallCheck(this, codabar2); 61552 if (data.search(/^[0-9\-\$\:\.\+\/]+$/) === 0) { 61553 data = "A" + data + "A"; 61554 } 61555 var _this = _possibleConstructorReturn(this, (codabar2.__proto__ || Object.getPrototypeOf(codabar2)).call(this, data.toUpperCase(), options)); 61556 _this.text = _this.options.text || _this.text.replace(/[A-D]/g, ""); 61557 return _this; 61558 } 61559 _createClass(codabar2, [{ 61560 key: "valid", 61561 value: function valid() { 61562 return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/) !== -1; 61563 } 61564 }, { 61565 key: "encode", 61566 value: function encode() { 61567 var result = []; 61568 var encodings = this.getEncodings(); 61569 for (var i2 = 0; i2 < this.data.length; i2++) { 61570 result.push(encodings[this.data.charAt(i2)]); 61571 if (i2 !== this.data.length - 1) { 61572 result.push("0"); 61573 } 61574 } 61575 return { 61576 text: this.text, 61577 data: result.join("") 61578 }; 61579 } 61580 }, { 61581 key: "getEncodings", 61582 value: function getEncodings() { 61583 return { 61584 "0": "101010011", 61585 "1": "101011001", 61586 "2": "101001011", 61587 "3": "110010101", 61588 "4": "101101001", 61589 "5": "110101001", 61590 "6": "100101011", 61591 "7": "100101101", 61592 "8": "100110101", 61593 "9": "110100101", 61594 "-": "101001101", 61595 "$": "101100101", 61596 ":": "1101011011", 61597 "/": "1101101011", 61598 ".": "1101101101", 61599 "+": "1011011011", 61600 "A": "1011001001", 61601 "B": "1001001011", 61602 "C": "1010010011", 61603 "D": "1010011001" 61604 }; 61605 } 61606 }]); 61607 return codabar2; 61608 })(_Barcode3.default); 61609 codabar.codabar = codabar$1; 61610 return codabar; 61611 } 61612 var CODE93$1 = {}; 61613 var CODE93 = {}; 61614 var constants = {}; 61615 var hasRequiredConstants; 61616 function requireConstants() { 61617 if (hasRequiredConstants) return constants; 61618 hasRequiredConstants = 1;
61619 Object.defineProperty(constants, "__esModule", { 61620 value: true 61621 }); 61622 constants.SYMBOLS = [ 61623 "0", 61624 "1", 61625 "2", 61626 "3", 61627 "4", 61628 "5", 61629 "6", 61630 "7", 61631 "8", 61632 "9", 61633 "A", 61634 "B", 61635 "C", 61636 "D", 61637 "E", 61638 "F", 61639 "G", 61640 "H", 61641 "I", 61642 "J", 61643 "K", 61644 "L", 61645 "M", 61646 "N", 61647 "O", 61648 "P", 61649 "Q", 61650 "R", 61651 "S", 61652 "T", 61653 "U", 61654 "V", 61655 "W", 61656 "X", 61657 "Y", 61658 "Z", 61659 "-", 61660 ".", 61661 " ", 61662 "$", 61663 "/", 61664 "+", 61665 "%", 61666 // Only used for csum and multi-symbols character encodings 61667 "($)", 61668 "(%)", 61669 "(/)", 61670 "(+)", 61671 // Start/Stop 61672 "ÿ" 61673 ]; 61674 constants.BINARIES = ["100010100", "101001000", "101000100", "101000010", "100101000", "100100100", "100100010", "101010000", "100010010", "100001010", "110101000", "110100100", "110100010", "110010100", "110010010", "110001010", "101101000", "101100100", "101100010", "100110100", "100011010", "101011000", "101001100", "101000110", "100101100", "100010110", "110110100", "110110010", "110101100", "110100110", "110010110", "110011010", "101101100", "101100110", "100110110", "100111010", "100101110", "111010100", "111010010", "111001010", "101101110", "101110110", "110101110", "100100110", "111011010", "111010110", "100110010", "101011110"]; 61675 constants.MULTI_SYMBOLS = { 61676 "\0": ["(%)", "U"], 61677 "�": ["($)", "A"], 61678 "�": ["($)", "B"], 61679 "�": ["($)", "C"], 61680 "�": ["($)", "D"], 61681 "�": ["($)", "E"], 61682 "�": ["($)", "F"], 61683 "\x07": ["($)", "G"], 61684 "\b": ["($)", "H"], 61685 " ": ["($)", "I"], 61686 "\n": ["($)", "J"], 61687 "\v": ["($)", "K"], 61688 "\f": ["($)", "L"], 61689 "\r": ["($)", "M"], 61690 "�": ["($)", "N"], 61691 "�": ["($)", "O"], 61692 "�": ["($)", "P"], 61693 "�": ["($)", "Q"], 61694 "�": ["($)", "R"], 61695 "�": ["($)", "S"], 61696 "�": ["($)", "T"], 61697 "�": ["($)", "U"], 61698 "�": ["($)", "V"], 61699 "�": ["($)", "W"], 61700 "�": ["($)", "X"], 61701 "�": ["($)", "Y"], 61702 "�": ["($)", "Z"], 61703 "\x1B": ["(%)", "A"], 61704 "�": ["(%)", "B"], 61705 "�": ["(%)", "C"], 61706 "�": ["(%)", "D"], 61707 "�": ["(%)", "E"], 61708 "!": ["(/)", "A"], 61709 '"': ["(/)", "B"], 61710 "#": ["(/)", "C"], 61711 "&": ["(/)", "F"], 61712 "'": ["(/)", "G"], 61713 "(": ["(/)", "H"], 61714 ")": ["(/)", "I"], 61715 "*": ["(/)", "J"], 61716 ",": ["(/)", "L"], 61717 ":": ["(/)", "Z"], 61718 ";": ["(%)", "F"], 61719 "<": ["(%)", "G"], 61720 "=": ["(%)", "H"], 61721 ">": ["(%)", "I"], 61722 "?": ["(%)", "J"], 61723 "@": ["(%)", "V"], 61724 "[": ["(%)", "K"], 61725 "\\": ["(%)", "L"], 61726 "]": ["(%)", "M"], 61727 "^": ["(%)", "N"], 61728 "_": ["(%)", "O"], 61729 "`": ["(%)", "W"], 61730 "a": ["(+)", "A"], 61731 "b": ["(+)", "B"], 61732 "c": ["(+)", "C"], 61733 "d": ["(+)", "D"], 61734 "e": ["(+)", "E"], 61735 "f": ["(+)", "F"], 61736 "g": ["(+)", "G"], 61737 "h": ["(+)", "H"], 61738 "i": ["(+)", "I"], 61739 "j": ["(+)", "J"], 61740 "k": ["(+)", "K"], 61741 "l": ["(+)", "L"], 61742 "m": ["(+)", "M"], 61743 "n": ["(+)", "N"], 61744 "o": ["(+)", "O"], 61745 "p": ["(+)", "P"], 61746 "q": ["(+)", "Q"], 61747 "r": ["(+)", "R"], 61748 "s": ["(+)", "S"], 61749 "t": ["(+)", "T"], 61750 "u": ["(+)", "U"], 61751 "v": ["(+)", "V"], 61752 "w": ["(+)", "W"], 61753 "x": ["(+)", "X"], 61754 "y": ["(+)", "Y"], 61755 "z": ["(+)", "Z"], 61756 "{": ["(%)", "P"], 61757 "|": ["(%)", "Q"], 61758 "}": ["(%)", "R"], 61759 "~": ["(%)", "S"], 61760 "�": ["(%)", "T"] 61761 }; 61762 return constants; 61763 } 61764 var hasRequiredCODE93$1; 61765 function requireCODE93$1() { 61766 if (hasRequiredCODE93$1) return CODE93; 61767 hasRequiredCODE93$1 = 1; 61768 Object.defineProperty(CODE93, "__esModule", { 61769 value: true 61770 }); 61771 var _createClass = /* @__PURE__ */ (function() { 61772 function defineProperties(target, props) { 61773 for (var i2 = 0; i2 < props.length; i2++) { 61774 var descriptor = props[i2]; 61775 descriptor.enumerable = descriptor.enumerable || false; 61776 descriptor.configurable = true; 61777 if ("value" in descriptor) descriptor.writable = true; 61778 Object.defineProperty(target, descriptor.key, descriptor); 61779 } 61780 } 61781 return function(Constructor, protoProps, staticProps) { 61782 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61783 if (staticProps) defineProperties(Constructor, staticProps); 61784 return Constructor; 61785 }; 61786 })(); 61787 var _constants = requireConstants(); 61788 var _Barcode2 = requireBarcode(); 61789 var _Barcode3 = _interopRequireDefault(_Barcode2); 61790 function _interopRequireDefault(obj) { 61791 return obj && obj.__esModule ? obj : { default: obj }; 61792 } 61793 function _classCallCheck(instance, Constructor) { 61794 if (!(instance instanceof Constructor)) { 61795 throw new TypeError("Cannot call a class as a function"); 61796 } 61797 } 61798 function _possibleConstructorReturn(self, call) { 61799 if (!self) { 61800 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61801 } 61802 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61803 } 61804 function _inherits(subClass, superClass) { 61805 if (typeof superClass !== "function" && superClass !== null) { 61806 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61807 } 61808 subClass.prototype = Object.create(superClass && superClass.prototype, { c
61808onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61809 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61810 } 61811 var CODE93$12 = (function(_Barcode) { 61812 _inherits(CODE932, _Barcode); 61813 function CODE932(data, options) { 61814 _classCallCheck(this, CODE932); 61815 return _possibleConstructorReturn(this, (CODE932.__proto__ || Object.getPrototypeOf(CODE932)).call(this, data, options)); 61816 } 61817 _createClass(CODE932, [{ 61818 key: "valid", 61819 value: function valid() { 61820 return /^[0-9A-Z\-. $/+%]+$/.test(this.data); 61821 } 61822 }, { 61823 key: "encode", 61824 value: function encode() { 61825 var symbols = this.data.split("").flatMap(function(c2) { 61826 return _constants.MULTI_SYMBOLS[c2] || c2; 61827 }); 61828 var encoded = symbols.map(function(s2) { 61829 return CODE932.getEncoding(s2); 61830 }).join(""); 61831 var csumC = CODE932.checksum(symbols, 20); 61832 var csumK = CODE932.checksum(symbols.concat(csumC), 15); 61833 return { 61834 text: this.text, 61835 data: ( 61836 // Add the start bits 61837 CODE932.getEncoding("ÿ") + // Add the encoded bits 61838 encoded + // Add the checksum 61839 CODE932.getEncoding(csumC) + CODE932.getEncoding(csumK) + // Add the stop bits 61840 CODE932.getEncoding("ÿ") + // Add the termination bit 61841 "1" 61842 ) 61843 }; 61844 } 61845 // Get the binary encoding of a symbol 61846 }], [{ 61847 key: "getEncoding", 61848 value: function getEncoding(symbol) { 61849 return _constants.BINARIES[CODE932.symbolValue(symbol)]; 61850 } 61851 // Get the symbol for a symbol value 61852 }, { 61853 key: "getSymbol", 61854 value: function getSymbol(symbolValue) { 61855 return _constants.SYMBOLS[symbolValue]; 61856 } 61857 // Get the symbol value of a symbol 61858 }, { 61859 key: "symbolValue", 61860 value: function symbolValue(symbol) { 61861 return _constants.SYMBOLS.indexOf(symbol); 61862 } 61863 // Calculate a checksum symbol 61864 }, { 61865 key: "checksum", 61866 value: function checksum(symbols, maxWeight) { 61867 var csum = symbols.slice().reverse().reduce(function(sum, symbol, idx) { 61868 var weight = idx % maxWeight + 1; 61869 return sum + CODE932.symbolValue(symbol) * weight; 61870 }, 0); 61871 return CODE932.getSymbol(csum % 47); 61872 } 61873 }]); 61874 return CODE932; 61875 })(_Barcode3.default); 61876 CODE93.default = CODE93$12; 61877 return CODE93; 61878 } 61879 var CODE93FullASCII = {}; 61880 var hasRequiredCODE93FullASCII; 61881 function requireCODE93FullASCII() { 61882 if (hasRequiredCODE93FullASCII) return CODE93FullASCII; 61883 hasRequiredCODE93FullASCII = 1; 61884 Object.defineProperty(CODE93FullASCII, "__esModule", { 61885 value: true 61886 }); 61887 var _createClass = /* @__PURE__ */ (function() { 61888 function defineProperties(target, props) { 61889 for (var i2 = 0; i2 < props.length; i2++) { 61890 var descriptor = props[i2]; 61891 descriptor.enumerable = descriptor.enumerable || false; 61892 descriptor.configurable = true; 61893 if ("value" in descriptor) descriptor.writable = true; 61894 Object.defineProperty(target, descriptor.key, descriptor); 61895 } 61896 } 61897 return function(Constructor, protoProps, staticProps) { 61898 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61899 if (staticProps) defineProperties(Constructor, staticProps); 61900 return Constructor; 61901 }; 61902 })(); 61903 var _CODE2 = requireCODE93$1(); 61904 var _CODE3 = _interopRequireDefault(_CODE2); 61905 function _interopRequireDefault(obj) { 61906 return obj && obj.__esModule ? obj : { default: obj }; 61907 } 61908 function _classCallCheck(instance, Constructor) { 61909 if (!(instance instanceof Constructor)) { 61910 throw new TypeError("Cannot call a class as a function"); 61911 } 61912 } 61913 function _possibleConstructorReturn(self, call) { 61914 if (!self) { 61915 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61916 } 61917 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61918 } 61919 function _inherits(subClass, superClass) { 61920 if (typeof superClass !== "function" && superClass !== null) { 61921 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61922 } 61923 subClass.prototype = Object.create(superClass && superClass.prototype, { c
61923onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61924 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61925 } 61926 var CODE93FullASCII$1 = (function(_CODE) { 61927 _inherits(CODE93FullASCII2, _CODE); 61928 function CODE93FullASCII2(data, options) { 61929 _classCallCheck(this, CODE93FullASCII2); 61930 return _possibleConstructorReturn(this, (CODE93FullASCII2.__proto__ || Object.getPrototypeOf(CODE93FullASCII2)).call(this, data, options)); 61931 } 61932 _createClass(CODE93FullASCII2, [{ 61933 key: "valid", 61934 value: function valid() { 61935 return /^[\x00-\x7f]+$/.test(this.data); 61936 } 61937 }]); 61938 return CODE93FullASCII2; 61939 })(_CODE3.default); 61940 CODE93FullASCII.default = CODE93FullASCII$1; 61941 return CODE93FullASCII; 61942 } 61943 var hasRequiredCODE93; 61944 function requireCODE93() { 61945 if (hasRequiredCODE93) return CODE93$1; 61946 hasRequiredCODE93 = 1; 61947 Object.defineProperty(CODE93$1, "__esModule", { 61948 value: true 61949 }); 61950 CODE93$1.CODE93FullASCII = CODE93$1.CODE93 = void 0; 61951 var _CODE = requireCODE93$1(); 61952 var _CODE2 = _interopRequireDefault(_CODE); 61953 var _CODE93FullASCII = requireCODE93FullASCII(); 61954 var _CODE93FullASCII2 = _interopRequireDefault(_CODE93FullASCII); 61955 function _interopRequireDefault(obj) { 61956 return obj && obj.__esModule ? obj : { default: obj }; 61957 } 61958 CODE93$1.CODE93 = _CODE2.default; 61959 CODE93$1.CODE93FullASCII = _CODE93FullASCII2.default; 61960 return CODE93$1; 61961 } 61962 var GenericBarcode = {}; 61963 var hasRequiredGenericBarcode; 61964 function requireGenericBarcode() { 61965 if (hasRequiredGenericBarcode) return GenericBarcode; 61966 hasRequiredGenericBarcode = 1; 61967 Object.defineProperty(GenericBarcode, "__esModule", { 61968 value: true 61969 }); 61970 GenericBarcode.GenericBarcode = void 0; 61971 var _createClass = /* @__PURE__ */ (function() { 61972 function defineProperties(target, props) { 61973 for (var i2 = 0; i2 < props.length; i2++) { 61974 var descriptor = props[i2]; 61975 descriptor.enumerable = descriptor.enumerable || false; 61976 descriptor.configurable = true; 61977 if ("value" in descriptor) descriptor.writable = true; 61978 Object.defineProperty(target, descriptor.key, descriptor); 61979 } 61980 } 61981 return function(Constructor, protoProps, staticProps) { 61982 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61983 if (staticProps) defineProperties(Constructor, staticProps); 61984 return Constructor; 61985 }; 61986 })(); 61987 var _Barcode2 = requireBarcode(); 61988 var _Barcode3 = _interopRequireDefault(_Barcode2); 61989 function _interopRequireDefault(obj) { 61990 return obj && obj.__esModule ? obj : { default: obj }; 61991 } 61992 function _classCallCheck(instance, Constructor) { 61993 if (!(instance instanceof Constructor)) { 61994 throw new TypeError("Cannot call a class as a function"); 61995 } 61996 } 61997 function _possibleConstructorReturn(self, call) { 61998 if (!self) { 61999 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 62000 } 62001 return call && (typeof call === "object" || typeof call === "function") ? call : self; 62002 } 62003 function _inherits(subClass, superClass) { 62004 if (typeof superClass !== "function" && superClass !== null) { 62005 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 62006 } 62007 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 62008 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 62009 } 62010 var GenericBarcode$1 = (function(_Barcode) { 62011 _inherits(GenericBarcode2, _Barcode); 62012 function GenericBarcode2(data, options) { 62013 _classCallCheck(this, GenericBarcode2); 62014 return _possibleConstructorReturn(this, (GenericBarcode2.__proto__ || Object.getPrototypeOf(GenericBarcode2)).call(this, data, options)); 62015 } 62016 _createClass(GenericBarcode2, [{ 62017 key: "encode", 62018 value: function encode() { 62019 return { 62020 data: "10101010101010101010101010101010101010101", 62021 text: this.text 62022 }; 62023 } 62024 // Resturn true/false if the string provided is valid for this encoder 62025 }, { 62026 key: "valid", 62027 value: function valid() { 62028 return true; 62029 } 62030 }]); 62031 return GenericBarcode2; 62032 })(_Barcode3.default); 62033 GenericBarcode.GenericBarcode = GenericBarcode$1; 62034 return GenericBarcode; 62035 } 62036 var hasRequiredBarcodes; 62037 function requireBarcodes() { 62038 if (hasRequiredBarcodes) return barcodes; 62039 hasRequiredBarcodes = 1;
62040 Object.defineProperty(barcodes, "__esModule", { 62041 value: true 62042 }); 62043 var _CODE = requireCODE39(); 62044 var _CODE2 = requireCODE128(); 62045 var _EAN_UPC = requireEAN_UPC(); 62046 var _ITF = requireITF(); 62047 var _MSI = requireMSI(); 62048 var _pharmacode = requirePharmacode(); 62049 var _codabar = requireCodabar(); 62050 var _CODE3 = requireCODE93(); 62051 var _GenericBarcode = requireGenericBarcode(); 62052 barcodes.default = { 62053 CODE39: _CODE.CODE39, 62054 CODE128: _CODE2.CODE128, 62055 CODE128A: _CODE2.CODE128A, 62056 CODE128B: _CODE2.CODE128B, 62057 CODE128C: _CODE2.CODE128C, 62058 EAN13: _EAN_UPC.EAN13, 62059 EAN8: _EAN_UPC.EAN8, 62060 EAN5: _EAN_UPC.EAN5, 62061 EAN2: _EAN_UPC.EAN2, 62062 UPC: _EAN_UPC.UPC, 62063 UPCE: _EAN_UPC.UPCE, 62064 ITF14: _ITF.ITF14, 62065 ITF: _ITF.ITF, 62066 MSI: _MSI.MSI, 62067 MSI10: _MSI.MSI10, 62068 MSI11: _MSI.MSI11, 62069 MSI1010: _MSI.MSI1010, 62070 MSI1110: _MSI.MSI1110, 62071 pharmacode: _pharmacode.pharmacode, 62072 codabar: _codabar.codabar, 62073 CODE93: _CODE3.CODE93, 62074 CODE93FullASCII: _CODE3.CODE93FullASCII, 62075 GenericBarcode: _GenericBarcode.GenericBarcode 62076 }; 62077 return barcodes; 62078 } 62079 var merge = {}; 62080 var hasRequiredMerge; 62081 function requireMerge() { 62082 if (hasRequiredMerge) return merge; 62083 hasRequiredMerge = 1; 62084 Object.defineProperty(merge, "__esModule", { 62085 value: true 62086 }); 62087 var _extends = Object.assign || function(target) { 62088 for (var i2 = 1; i2 < arguments.length; i2++) { 62089 var source = arguments[i2]; 62090 for (var key in source) { 62091 if (Object.prototype.hasOwnProperty.call(source, key)) { 62092 target[key] = source[key]; 62093 } 62094 } 62095 } 62096 return target; 62097 }; 62098 merge.default = function(old, replaceObj) { 62099 return _extends({}, old, replaceObj); 62100 }; 62101 return merge; 62102 } 62103 var linearizeEncodings = {}; 62104 var hasRequiredLinearizeEncodings; 62105 function requireLinearizeEncodings() { 62106 if (hasRequiredLinearizeEncodings) return linearizeEncodings; 62107 hasRequiredLinearizeEncodings = 1; 62108 Object.defineProperty(linearizeEncodings, "__esModule", { 62109 value: true 62110 }); 62111 linearizeEncodings.default = linearizeEncodings$1; 62112 function linearizeEncodings$1(encodings) { 62113 var linearEncodings = []; 62114 function nextLevel(encoded) { 62115 if (Array.isArray(encoded)) { 62116 for (var i2 = 0; i2 < encoded.length; i2++) { 62117 nextLevel(encoded[i2]); 62118 } 62119 } else { 62120 encoded.text = encoded.text || ""; 62121 encoded.data = encoded.data || ""; 62122 linearEncodings.push(encoded); 62123 } 62124 } 62125 nextLevel(encodings); 62126 return linearEncodings; 62127 } 62128 return linearizeEncodings; 62129 } 62130 var fixOptions = {}; 62131 var hasRequiredFixOptions; 62132 function requireFixOptions() { 62133 if (hasRequiredFixOptions) return fixOptions; 62134 hasRequiredFixOptions = 1; 62135 Object.defineProperty(fixOptions, "__esModule", { 62136 value: true 62137 }); 62138 fixOptions.default = fixOptions$1; 62139 function fixOptions$1(options) { 62140 options.marginTop = options.marginTop || options.margin; 62141 options.marginBottom = options.marginBottom || options.margin; 62142 options.marginRight = options.marginRight || options.margin; 62143 options.marginLeft = options.marginLeft || options.margin; 62144 return options; 62145 } 62146 return fixOptions; 62147 } 62148 var getRenderProperties = {}; 62149 var getOptionsFromElement = {}; 62150 var optionsFromStrings = {}; 62151 var hasRequiredOptionsFromStrings; 62152 function requireOptionsFromStrings() { 62153 if (hasRequiredOptionsFromStrings) return optionsFromStrings; 62154 hasRequiredOptionsFromStrings = 1; 62155 Object.defineProperty(optionsFromStrings, "__esModule", { 62156 value: true 62157 }); 62158 optionsFromStrings.default = optionsFromStrings$1; 62159 function optionsFromStrings$1(options) { 62160 var intOptions = ["width", "height", "textMargin", "fontSize", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight"]; 62161 for (var intOption in intOptions) { 62162 if (intOptions.hasOwnProperty(intOption)) { 62163 intOption = intOptions[intOption]; 62164 if (typeof options[intOption] === "string") { 62165 options[intOption] = parseInt(options[intOption], 10); 62166 } 62167 } 62168 } 62169 if (typeof options["displayValue"] === "string") { 62170 options["displayValue"] = options["displayValue"] != "false"; 62171 } 62172 return options; 62173 } 62174 return optionsFromStrings; 62175 } 62176 var defaults = {}; 62177 var hasRequiredDefaults; 62178 function requireDefaults() { 62179 if (hasRequiredDefaults) return defaults; 62180 hasRequiredDefaults = 1;
62181 Object.defineProperty(defaults, "__esModule", { 62182 value: true 62183 }); 62184 var defaults$1 = { 62185 width: 2, 62186 height: 100, 62187 format: "auto", 62188 displayValue: true, 62189 fontOptions: "", 62190 font: "monospace", 62191 text: void 0, 62192 textAlign: "center", 62193 textPosition: "bottom", 62194 textMargin: 2, 62195 fontSize: 20, 62196 background: "#ffffff", 62197 lineColor: "#000000", 62198 margin: 10, 62199 marginTop: void 0, 62200 marginBottom: void 0, 62201 marginLeft: void 0, 62202 marginRight: void 0, 62203 valid: function valid() { 62204 } 62205 }; 62206 defaults.default = defaults$1; 62207 return defaults; 62208 } 62209 var hasRequiredGetOptionsFromElement; 62210 function requireGetOptionsFromElement() { 62211 if (hasRequiredGetOptionsFromElement) return getOptionsFromElement; 62212 hasRequiredGetOptionsFromElement = 1; 62213 Object.defineProperty(getOptionsFromElement, "__esModule", { 62214 value: true 62215 }); 62216 var _optionsFromStrings = requireOptionsFromStrings(); 62217 var _optionsFromStrings2 = _interopRequireDefault(_optionsFromStrings); 62218 var _defaults = requireDefaults(); 62219 var _defaults2 = _interopRequireDefault(_defaults); 62220 function _interopRequireDefault(obj) { 62221 return obj && obj.__esModule ? obj : { default: obj }; 62222 } 62223 function getOptionsFromElement$1(element) { 62224 var options = {}; 62225 for (var property2 in _defaults2.default) { 62226 if (_defaults2.default.hasOwnProperty(property2)) { 62227 if (element.hasAttribute("jsbarcode-" + property2.toLowerCase())) { 62228 options[property2] = element.getAttribute("jsbarcode-" + property2.toLowerCase()); 62229 } 62230 if (element.hasAttribute("data-" + property2.toLowerCase())) { 62231 options[property2] = element.getAttribute("data-" + property2.toLowerCase()); 62232 } 62233 } 62234 } 62235 options["value"] = element.getAttribute("jsbarcode-value") || element.getAttribute("data-value"); 62236 options = (0, _optionsFromStrings2.default)(options); 62237 return options; 62238 } 62239 getOptionsFromElement.default = getOptionsFromElement$1; 62240 return getOptionsFromElement; 62241 } 62242 var renderers = {}; 62243 var canvas$1 = {}; 62244 var shared = {}; 62245 var hasRequiredShared; 62246 function requireShared() { 62247 if (hasRequiredShared) return shared; 62248 hasRequiredShared = 1; 62249 Object.defineProperty(shared, "__esModule", { 62250 value: true 62251 }); 62252 shared.getTotalWidthOfEncodings = shared.calculateEncodingAttributes = shared.getBarcodePadding = shared.getEncodingHeight = shared.getMaximumHeightOfEncodings = void 0; 62253 var _merge = requireMerge(); 62254 var _merge2 = _interopRequireDefault(_merge); 62255 function _interopRequireDefault(obj) { 62256 return obj && obj.__esModule ? obj : { default: obj }; 62257 } 62258 function getEncodingHeight(encoding, options) { 62259 return options.height + (options.displayValue && encoding.text.length > 0 ? options.fontSize + options.textMargin : 0) + options.marginTop + options.marginBottom; 62260 } 62261 function getBarcodePadding(textWidth, barcodeWidth, options) { 62262 if (options.displayValue && barcodeWidth < textWidth) { 62263 if (options.textAlign == "center") { 62264 return Math.floor((textWidth - barcodeWidth) / 2); 62265 } else if (options.textAlign == "left") { 62266 return 0; 62267 } else if (options.textAlign == "right") { 62268 return Math.floor(textWidth - barcodeWidth); 62269 } 62270 } 62271 return 0; 62272 } 62273 function calculateEncodingAttributes(encodings, barcodeOptions, context) { 62274 for (var i2 = 0; i2 < encodings.length; i2++) { 62275 var encoding = encodings[i2]; 62276 var options = (0, _merge2.default)(barcodeOptions, encoding.options); 62277 var textWidth; 62278 if (options.displayValue) { 62279 textWidth = messureText(encoding.text, options, context); 62280 } else { 62281 textWidth = 0; 62282 } 62283 var barcodeWidth = encoding.data.length * options.width; 62284 encoding.width = Math.ceil(Math.max(textWidth, barcodeWidth)); 62285 encoding.height = getEncodingHeight(encoding, options); 62286 encoding.barcodePadding = getBarcodePadding(textWidth, barcodeWidth, options); 62287 } 62288 } 62289 function getTotalWidthOfEncodings(encodings) { 62290 var totalWidth = 0; 62291 for (var i2 = 0; i2 < encodings.length; i2++) { 62292 totalWidth += encodings[i2].width; 62293 } 62294 return totalWidth; 62295 } 62296 function getMaximumHeightOfEncodings(encodings) { 62297 var maxHeight = 0; 62298 for (var i2 = 0; i2 < encodings.length; i2++) { 62299 if (encodings[i2].height > maxHeight) { 62300 maxHeight = encodings[i2].height; 62301 } 62302 } 62303 return maxHeight; 62304 } 62305 function messureText(string, options, context) { 62306 var ctx; 62307 if (context) { 62308 ctx = context; 62309 } else if (typeof document !== "undefined") { 62310 ctx = document.createElement("canvas").getContext("2d"); 62311 } else { 62312 return 0; 62313 } 62314 ctx.font = options.fontOptions + " " + options.fontSize + "px " + options.font; 62315 var measureTextResult = ctx.measureText(string); 62316 if (!measureTextResult) { 62317 return 0; 62318 } 62319 var size = measureTextResult.width; 62320 return size; 62321 } 62322 shared.getMaximumHeightOfEncodings = getMaximumHeightOfEncodings; 62323 shared.getEncodingHeight = getEncodingHeight; 62324 shared.getBarcodePadding = getBarcodePadding; 62325 shared.calculateEncodingAttributes = calculateEncodingAttributes; 62326 shared.getTotalWidthOfEncodings = getTotalWidthOfEncodings; 62327 return shared; 62328 } 62329 var hasRequiredCanvas$1; 62330 function requireCanvas$1() { 62331 if (hasRequiredCanvas$1) return canvas$1; 62332 hasRequiredCanvas$1 = 1;
vendor: 12,543 bytes, lines 62333-62647
62333 Object.defineProperty(canvas$1, "__esModule", { 62334 value: true 62335 }); 62336 var _createClass = /* @__PURE__ */ (function() { 62337 function defineProperties(target, props) { 62338 for (var i2 = 0; i2 < props.length; i2++) { 62339 var descriptor = props[i2]; 62340 descriptor.enumerable = descriptor.enumerable || false; 62341 descriptor.configurable = true; 62342 if ("value" in descriptor) descriptor.writable = true; 62343 Object.defineProperty(target, descriptor.key, descriptor); 62344 } 62345 } 62346 return function(Constructor, protoProps, staticProps) { 62347 if (protoProps) defineProperties(Constructor.prototype, protoProps); 62348 if (staticProps) defineProperties(Constructor, staticProps); 62349 return Constructor; 62350 }; 62351 })(); 62352 var _merge = requireMerge(); 62353 var _merge2 = _interopRequireDefault(_merge); 62354 var _shared = requireShared(); 62355 function _interopRequireDefault(obj) { 62356 return obj && obj.__esModule ? obj : { default: obj }; 62357 } 62358 function _classCallCheck(instance, Constructor) { 62359 if (!(instance instanceof Constructor)) { 62360 throw new TypeError("Cannot call a class as a function"); 62361 } 62362 } 62363 var CanvasRenderer = (function() { 62364 function CanvasRenderer2(canvas2, encodings, options) { 62365 _classCallCheck(this, CanvasRenderer2); 62366 this.canvas = canvas2; 62367 this.encodings = encodings; 62368 this.options = options; 62369 } 62370 _createClass(CanvasRenderer2, [{ 62371 key: "render", 62372 value: function render() { 62373 if (!this.canvas.getContext) { 62374 throw new Error("The browser does not support canvas."); 62375 } 62376 this.prepareCanvas(); 62377 for (var i2 = 0; i2 < this.encodings.length; i2++) { 62378 var encodingOptions = (0, _merge2.default)(this.options, this.encodings[i2].options); 62379 this.drawCanvasBarcode(encodingOptions, this.encodings[i2]); 62380 this.drawCanvasText(encodingOptions, this.encodings[i2]); 62381 this.moveCanvasDrawing(this.encodings[i2]); 62382 } 62383 this.restoreCanvas(); 62384 } 62385 }, { 62386 key: "prepareCanvas", 62387 value: function prepareCanvas() { 62388 var ctx = this.canvas.getContext("2d"); 62389 ctx.save(); 62390 (0, _shared.calculateEncodingAttributes)(this.encodings, this.options, ctx); 62391 var totalWidth = (0, _shared.getTotalWidthOfEncodings)(this.encodings); 62392 var maxHeight = (0, _shared.getMaximumHeightOfEncodings)(this.encodings); 62393 this.canvas.width = totalWidth + this.options.marginLeft + this.options.marginRight; 62394 this.canvas.height = maxHeight; 62395 ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); 62396 if (this.options.background) { 62397 ctx.fillStyle = this.options.background; 62398 ctx.fillRect(0, 0, this.canvas.width, this.canvas.height); 62399 } 62400 ctx.translate(this.options.marginLeft, 0); 62401 } 62402 }, { 62403 key: "drawCanvasBarcode", 62404 value: function drawCanvasBarcode(options, encoding) { 62405 var ctx = this.canvas.getContext("2d"); 62406 var binary = encoding.data; 62407 var yFrom; 62408 if (options.textPosition == "top") { 62409 yFrom = options.marginTop + options.fontSize + options.textMargin; 62410 } else { 62411 yFrom = options.marginTop; 62412 } 62413 ctx.fillStyle = options.lineColor; 62414 for (var b2 = 0; b2 < binary.length; b2++) { 62415 var x2 = b2 * options.width + encoding.barcodePadding; 62416 if (binary[b2] === "1") { 62417 ctx.fillRect(x2, yFrom, options.width, options.height); 62418 } else if (binary[b2]) { 62419 ctx.fillRect(x2, yFrom, options.width, options.height * binary[b2]); 62420 } 62421 } 62422 } 62423 }, { 62424 key: "drawCanvasText", 62425 value: function drawCanvasText(options, encoding) { 62426 var ctx = this.canvas.getContext("2d"); 62427 var font = options.fontOptions + " " + options.fontSize + "px " + options.font; 62428 if (options.displayValue) { 62429 var x2, y2; 62430 if (options.textPosition == "top") { 62431 y2 = options.marginTop + options.fontSize - options.textMargin; 62432 } else { 62433 y2 = options.height + options.textMargin + options.marginTop + options.fontSize; 62434 } 62435 ctx.font = font; 62436 if (options.textAlign == "left" || encoding.barcodePadding > 0) { 62437 x2 = 0; 62438 ctx.textAlign = "left"; 62439 } else if (options.textAlign == "right") { 62440 x2 = encoding.width - 1; 62441 ctx.textAlign = "right"; 62442 } else { 62443 x2 = encoding.width / 2; 62444 ctx.textAlign = "center"; 62445 } 62446 ctx.fillText(encoding.text, x2, y2); 62447 } 62448 } 62449 }, { 62450 key: "moveCanvasDrawing", 62451 value: function moveCanvasDrawing(encoding) { 62452 var ctx = this.canvas.getContext("2d"); 62453 ctx.translate(encoding.width, 0); 62454 } 62455 }, { 62456 key: "restoreCanvas", 62457 value: function restoreCanvas() { 62458 var ctx = this.canvas.getContext("2d"); 62459 ctx.restore(); 62460 } 62461 }]); 62462 return CanvasRenderer2; 62463 })(); 62464 canvas$1.default = CanvasRenderer; 62465 return canvas$1; 62466 } 62467 var svg = {}; 62468 var hasRequiredSvg; 62469 function requireSvg() { 62470 if (hasRequiredSvg) return svg; 62471 hasRequiredSvg = 1; 62472 Object.defineProperty(svg, "__esModule", { 62473 value: true 62474 }); 62475 var _createClass = /* @__PURE__ */ (function() { 62476 function defineProperties(target, props) { 62477 for (var i2 = 0; i2 < props.length; i2++) { 62478 var descriptor = props[i2]; 62479 descriptor.enumerable = descriptor.enumerable || false; 62480 descriptor.configurable = true; 62481 if ("value" in descriptor) descriptor.writable = true; 62482 Object.defineProperty(target, descriptor.key, descriptor); 62483 } 62484 } 62485 return function(Constructor, protoProps, staticProps) { 62486 if (protoProps) defineProperties(Constructor.prototype, protoProps); 62487 if (staticProps) defineProperties(Constructor, staticProps); 62488 return Constructor; 62489 }; 62490 })(); 62491 var _merge = requireMerge(); 62492 var _merge2 = _interopRequireDefault(_merge); 62493 var _shared = requireShared(); 62494 function _interopRequireDefault(obj) { 62495 return obj && obj.__esModule ? obj : { default: obj }; 62496 } 62497 function _classCallCheck(instance, Constructor) { 62498 if (!(instance instanceof Constructor)) { 62499 throw new TypeError("Cannot call a class as a function"); 62500 } 62501 } 62502 var svgns = "http://www.w3.org/2000/svg"; 62503 var SVGRenderer = (function() { 62504 function SVGRenderer2(svg2, encodings, options) { 62505 _classCallCheck(this, SVGRenderer2); 62506 this.svg = svg2; 62507 this.encodings = encodings; 62508 this.options = options; 62509 this.document = options.xmlDocument || document; 62510 } 62511 _createClass(SVGRenderer2, [{ 62512 key: "render", 62513 value: function render() { 62514 var currentX = this.options.marginLeft; 62515 this.prepareSVG(); 62516 for (var i2 = 0; i2 < this.encodings.length; i2++) { 62517 var encoding = this.encodings[i2]; 62518 var encodingOptions = (0, _merge2.default)(this.options, encoding.options); 62519 var group = this.createGroup(currentX, encodingOptions.marginTop, this.svg); 62520 this.setGroupOptions(group, encodingOptions); 62521 this.drawSvgBarcode(group, encodingOptions, encoding); 62522 this.drawSVGText(group, encodingOptions, encoding); 62523 currentX += encoding.width; 62524 } 62525 } 62526 }, { 62527 key: "prepareSVG", 62528 value: function prepareSVG() { 62529 while (this.svg.firstChild) { 62530 this.svg.removeChild(this.svg.firstChild); 62531 } 62532 (0, _shared.calculateEncodingAttributes)(this.encodings, this.options); 62533 var totalWidth = (0, _shared.getTotalWidthOfEncodings)(this.encodings); 62534 var maxHeight = (0, _shared.getMaximumHeightOfEncodings)(this.encodings); 62535 var width = totalWidth + this.options.marginLeft + this.options.marginRight; 62536 this.setSvgAttributes(width, maxHeight); 62537 if (this.options.background) { 62538 this.drawRect(0, 0, width, maxHeight, this.svg).setAttribute("fill", this.options.background); 62539 } 62540 } 62541 }, { 62542 key: "drawSvgBarcode", 62543 value: function drawSvgBarcode(parent, options, encoding) { 62544 var binary = encoding.data; 62545 var yFrom; 62546 if (options.textPosition == "top") { 62547 yFrom = options.fontSize + options.textMargin; 62548 } else { 62549 yFrom = 0; 62550 } 62551 var barWidth = 0; 62552 var x2 = 0; 62553 for (var b2 = 0; b2 < binary.length; b2++) { 62554 x2 = b2 * options.width + encoding.barcodePadding; 62555 if (binary[b2] === "1") { 62556 barWidth++; 62557 } else if (barWidth > 0) { 62558 this.drawRect(x2 - options.width * barWidth, yFrom, options.width * barWidth, options.height, parent); 62559 barWidth = 0; 62560 } 62561 } 62562 if (barWidth > 0) { 62563 this.drawRect(x2 - options.width * (barWidth - 1), yFrom, options.width * barWidth, options.height, parent); 62564 } 62565 } 62566 }, { 62567 key: "drawSVGText", 62568 value: function drawSVGText(parent, options, encoding) { 62569 var textElem = this.document.createElementNS(svgns, "text"); 62570 if (options.displayValue) { 62571 var x2, y2; 62572 textElem.setAttribute("font-family", options.font); 62573 textElem.setAttribute("font-size", options.fontSize); 62574 if (options.fontOptions.includes("bold")) { 62575 textElem.setAttribute("font-weight", "bold"); 62576 } 62577 if (options.fontOptions.includes("italic")) { 62578 textElem.setAttribute("font-style", "italic"); 62579 } 62580 if (options.textPosition == "top") { 62581 y2 = options.fontSize - options.textMargin; 62582 } else { 62583 y2 = options.height + options.textMargin + options.fontSize; 62584 } 62585 if (options.textAlign == "left" || encoding.barcodePadding > 0) { 62586 x2 = 0; 62587 textElem.setAttribute("text-anchor", "start"); 62588 } else if (options.textAlign == "right") { 62589 x2 = encoding.width - 1; 62590 textElem.setAttribute("text-anchor", "end"); 62591 } else { 62592 x2 = encoding.width / 2; 62593 textElem.setAttribute("text-anchor", "middle"); 62594 } 62595 textElem.setAttribute("x", x2); 62596 textElem.setAttribute("y", y2); 62597 textElem.appendChild(this.document.createTextNode(encoding.text)); 62598 parent.appendChild(textElem); 62599 } 62600 } 62601 }, { 62602 key: "setSvgAttributes", 62603 value: function setSvgAttributes(width, height) { 62604 var svg2 = this.svg; 62605 svg2.setAttribute("width", width + "px"); 62606 svg2.setAttribute("height", height + "px"); 62607 svg2.setAttribute("x", "0px"); 62608 svg2.setAttribute("y", "0px"); 62609 svg2.setAttribute("viewBox", "0 0 " + width + " " + height); 62610 svg2.setAttribute("xmlns", svgns); 62611 svg2.setAttribute("version", "1.1"); 62612 } 62613 }, { 62614 key: "createGroup", 62615 value: function createGroup(x2, y2, parent) { 62616 var group = this.document.createElementNS(svgns, "g"); 62617 group.setAttribute("transform", "translate(" + x2 + ", " + y2 + ")"); 62618 parent.appendChild(group); 62619 return group; 62620 } 62621 }, { 62622 key: "setGroupOptions", 62623 value: function setGroupOptions(group, options) { 62624 group.setAttribute("fill", options.lineColor); 62625 } 62626 }, { 62627 key: "drawRect", 62628 value: function drawRect(x2, y2, width, height, parent) { 62629 var rect = this.document.createElementNS(svgns, "rect"); 62630 rect.setAttribute("x", x2); 62631 rect.setAttribute("y", y2); 62632 rect.setAttribute("width", width); 62633 rect.setAttribute("height", height); 62634 parent.appendChild(rect); 62635 return rect; 62636 } 62637 }]); 62638 return SVGRenderer2; 62639 })(); 62640 svg.default = SVGRenderer; 62641 return svg; 62642 } 62643 var object = {}; 62644 var hasRequiredObject; 62645 function requireObject() { 62646 if (hasRequiredObject) return object; 62647 hasRequiredObject = 1;
62648 Object.defineProperty(object, "__esModule", { 62649 value: true 62650 }); 62651 var _createClass = /* @__PURE__ */ (function() { 62652 function defineProperties(target, props) { 62653 for (var i2 = 0; i2 < props.length; i2++) { 62654 var descriptor = props[i2]; 62655 descriptor.enumerable = descriptor.enumerable || false; 62656 descriptor.configurable = true; 62657 if ("value" in descriptor) descriptor.writable = true; 62658 Object.defineProperty(target, descriptor.key, descriptor); 62659 } 62660 } 62661 return function(Constructor, protoProps, staticProps) { 62662 if (protoProps) defineProperties(Constructor.prototype, protoProps); 62663 if (staticProps) defineProperties(Constructor, staticProps); 62664 return Constructor; 62665 }; 62666 })(); 62667 function _classCallCheck(instance, Constructor) { 62668 if (!(instance instanceof Constructor)) { 62669 throw new TypeError("Cannot call a class as a function"); 62670 } 62671 } 62672 var ObjectRenderer = (function() { 62673 function ObjectRenderer2(object2, encodings, options) { 62674 _classCallCheck(this, ObjectRenderer2); 62675 this.object = object2; 62676 this.encodings = encodings; 62677 this.options = options; 62678 } 62679 _createClass(ObjectRenderer2, [{ 62680 key: "render", 62681 value: function render() { 62682 this.object.encodings = this.encodings; 62683 } 62684 }]); 62685 return ObjectRenderer2; 62686 })(); 62687 object.default = ObjectRenderer; 62688 return object; 62689 } 62690 var hasRequiredRenderers; 62691 function requireRenderers() { 62692 if (hasRequiredRenderers) return renderers; 62693 hasRequiredRenderers = 1; 62694 Object.defineProperty(renderers, "__esModule", { 62695 value: true 62696 }); 62697 var _canvas = requireCanvas$1(); 62698 var _canvas2 = _interopRequireDefault(_canvas); 62699 var _svg = requireSvg(); 62700 var _svg2 = _interopRequireDefault(_svg); 62701 var _object = requireObject(); 62702 var _object2 = _interopRequireDefault(_object); 62703 function _interopRequireDefault(obj) { 62704 return obj && obj.__esModule ? obj : { default: obj }; 62705 } 62706 renderers.default = { CanvasRenderer: _canvas2.default, SVGRenderer: _svg2.default, ObjectRenderer: _object2.default }; 62707 return renderers; 62708 } 62709 var exceptions = {}; 62710 var hasRequiredExceptions; 62711 function requireExceptions() { 62712 if (hasRequiredExceptions) return exceptions; 62713 hasRequiredExceptions = 1; 62714 Object.defineProperty(exceptions, "__esModule", { 62715 value: true 62716 }); 62717 function _classCallCheck(instance, Constructor) { 62718 if (!(instance instanceof Constructor)) { 62719 throw new TypeError("Cannot call a class as a function"); 62720 } 62721 } 62722 function _possibleConstructorReturn(self, call) { 62723 if (!self) { 62724 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 62725 } 62726 return call && (typeof call === "object" || typeof call === "function") ? call : self; 62727 } 62728 function _inherits(subClass, superClass) { 62729 if (typeof superClass !== "function" && superClass !== null) { 62730 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 62731 } 62732 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 62733 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 62734 } 62735 var InvalidInputException = (function(_Error) { 62736 _inherits(InvalidInputException2, _Error); 62737 function InvalidInputException2(symbology, input) { 62738 _classCallCheck(this, InvalidInputException2); 62739 var _this = _possibleConstructorReturn(this, (InvalidInputException2.__proto__ || Object.getPrototypeOf(InvalidInputException2)).call(this)); 62740 _this.name = "InvalidInputException"; 62741 _this.symbology = symbology; 62742 _this.input = input; 62743 _this.message = '"' + _this.input + '" is not a valid input for ' + _this.symbology; 62744 return _this; 62745 } 62746 return InvalidInputException2; 62747 })(Error); 62748 var InvalidElementException = (function(_Error2) { 62749 _inherits(InvalidElementException2, _Error2); 62750 function InvalidElementException2() { 62751 _classCallCheck(this, InvalidElementException2); 62752 var _this2 = _possibleConstructorReturn(this, (InvalidElementException2.__proto__ || Object.getPrototypeOf(Invali
62752dElementException2)).call(this)); 62753 _this2.name = "InvalidElementException"; 62754 _this2.message = "Not supported type to render on"; 62755 return _this2; 62756 } 62757 return InvalidElementException2; 62758 })(Error); 62759 var NoElementException = (function(_Error3) { 62760 _inherits(NoElementException2, _Error3); 62761 function NoElementException2() { 62762 _classCallCheck(this, NoElementException2); 62763 var _this3 = _possibleConstructorReturn(this, (NoElementException2.__proto__ || Object.getPrototypeOf(NoElementException2)).call(this)); 62764 _this3.name = "NoElementException"; 62765 _this3.message = "No element to render on."; 62766 return _this3; 62767 } 62768 return NoElementException2; 62769 })(Error); 62770 exceptions.InvalidInputException = InvalidInputException; 62771 exceptions.InvalidElementException = InvalidElementException; 62772 exceptions.NoElementException = NoElementException; 62773 return exceptions; 62774 } 62775 var hasRequiredGetRenderProperties; 62776 function requireGetRenderProperties() { 62777 if (hasRequiredGetRenderProperties) return getRenderProperties; 62778 hasRequiredGetRenderProperties = 1; 62779 Object.defineProperty(getRenderProperties, "__esModule", { 62780 value: true 62781 }); 62782 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { 62783 return typeof obj; 62784 } : function(obj) { 62785 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 62786 }; 62787 var _getOptionsFromElement = requireGetOptionsFromElement(); 62788 var _getOptionsFromElement2 = _interopRequireDefault(_getOptionsFromElement); 62789 var _renderers = requireRenderers(); 62790 var _renderers2 = _interopRequireDefault(_renderers); 62791 var _exceptions = requireExceptions(); 62792 function _interopRequireDefault(obj) { 62793 return obj && obj.__esModule ? obj : { default: obj }; 62794 } 62795 function getRenderProperties$1(element) { 62796 if (typeof element === "string") { 62797 return querySelectedRenderProperties(element); 62798 } else if (Array.isArray(element)) { 62799 var returnArray = []; 62800 for (var i2 = 0; i2 < element.length; i2++) { 62801 returnArray.push(getRenderProperties$1(element[i2])); 62802 } 62803 return returnArray; 62804 } else if (typeof HTMLCanvasElement !== "undefined" && element instanceof HTMLImageElement) { 62805 return newCanvasRenderProperties(element); 62806 } else if (element && element.nodeName && element.nodeName.toLowerCase() === "svg" || typeof SVGElement !== "undefined" && element instanceof SVGElement) { 62807 return { 62808 element, 62809 options: (0, _getOptionsFromElement2.default)(element), 62810 renderer: _renderers2.default.SVGRenderer 62811 }; 62812 } else if (typeof HTMLCanvasElement !== "undefined" && element instanceof HTMLCanvasElement) { 62813 return { 62814 element, 62815 options: (0, _getOptionsFromElement2.default)(element), 62816 renderer: _renderers2.default.CanvasRenderer 62817 }; 62818 } else if (element && element.getContext) { 62819 return { 62820 element, 62821 renderer: _renderers2.default.CanvasRenderer 62822 }; 62823 } else if (element && (typeof element === "undefined" ? "undefined" : _typeof(element)) === "object" && !element.nodeName) { 62824 return { 62825 element, 62826 renderer: _renderers2.default.ObjectRenderer 62827 }; 62828 } else { 62829 throw new _exceptions.InvalidElementException(); 62830 } 62831 } 62832 function querySelectedRenderProperties(string) { 62833 var selector = document.querySelectorAll(string); 62834 if (selector.length === 0) { 62835 return void 0; 62836 } else { 62837 var returnArray = []; 62838 for (var i2 = 0; i2 < selector.length; i2++) { 62839 returnArray.push(getRenderProperties$1(selector[i2])); 62840 } 62841 return returnArray; 62842 } 62843 } 62844 function newCanvasRenderProperties(imgElement) { 62845 var canvas2 = document.createElement("canvas"); 62846 return { 62847 element: canvas2, 62848 options: (0, _getOptionsFromElement2.default)(imgElement), 62849 renderer: _renderers2.default.CanvasRenderer,
62850 afterRender: function afterRender() { 62851 imgElement.setAttribute("src", canvas2.toDataURL()); 62852 } 62853 }; 62854 } 62855 getRenderProperties.default = getRenderProperties$1; 62856 return getRenderProperties; 62857 } 62858 var ErrorHandler = {}; 62859 var hasRequiredErrorHandler; 62860 function requireErrorHandler() { 62861 if (hasRequiredErrorHandler) return ErrorHandler; 62862 hasRequiredErrorHandler = 1; 62863 Object.defineProperty(ErrorHandler, "__esModule", { 62864 value: true 62865 }); 62866 var _createClass = /* @__PURE__ */ (function() { 62867 function defineProperties(target, props) { 62868 for (var i2 = 0; i2 < props.length; i2++) { 62869 var descriptor = props[i2]; 62870 descriptor.enumerable = descriptor.enumerable || false; 62871 descriptor.configurable = true; 62872 if ("value" in descriptor) descriptor.writable = true; 62873 Object.defineProperty(target, descriptor.key, descriptor); 62874 } 62875 } 62876 return function(Constructor, protoProps, staticProps) { 62877 if (protoProps) defineProperties(Constructor.prototype, protoProps); 62878 if (staticProps) defineProperties(Constructor, staticProps); 62879 return Constructor; 62880 }; 62881 })(); 62882 function _classCallCheck(instance, Constructor) { 62883 if (!(instance instanceof Constructor)) { 62884 throw new TypeError("Cannot call a class as a function"); 62885 } 62886 } 62887 var ErrorHandler$1 = (function() { 62888 function ErrorHandler2(api2) { 62889 _classCallCheck(this, ErrorHandler2); 62890 this.api = api2; 62891 } 62892 _createClass(ErrorHandler2, [{ 62893 key: "handleCatch", 62894 value: function handleCatch(e2) { 62895 if (e2.name === "InvalidInputException") { 62896 if (this.api._options.valid !== this.api._defaults.valid) { 62897 this.api._options.valid(false); 62898 } else { 62899 throw e2.message; 62900 } 62901 } else { 62902 throw e2; 62903 } 62904 this.api.render = function() { 62905 }; 62906 } 62907 }, { 62908 key: "wrapBarcodeCall", 62909 value: function wrapBarcodeCall(func) { 62910 try { 62911 var result = func.apply(void 0, arguments); 62912 this.api._options.valid(true); 62913 return result; 62914 } catch (e2) { 62915 this.handleCatch(e2); 62916 return this.api; 62917 } 62918 } 62919 }]); 62920 return ErrorHandler2; 62921 })(); 62922 ErrorHandler.default = ErrorHandler$1; 62923 return ErrorHandler; 62924 } 62925 var JsBarcode_1; 62926 var hasRequiredJsBarcode; 62927 function requireJsBarcode() { 62928 if (hasRequiredJsBarcode) return JsBarcode_1; 62929 hasRequiredJsBarcode = 1; 62930 var _barcodes = requireBarcodes(); 62931 var _barcodes2 = _interopRequireDefault(_barcodes); 62932 var _merge = requireMerge(); 62933 var _merge2 = _interopRequireDefault(_merge); 62934 var _linearizeEncodings = requireLinearizeEncodings(); 62935 var _linearizeEncodings2 = _interopRequireDefault(_linearizeEncodings); 62936 var _fixOptions = requireFixOptions(); 62937 var _fixOptions2 = _interopRequireDefault(_fixOptions); 62938 var _getRenderProperties = requireGetRenderProperties(); 62939 var _getRenderProperties2 = _interopRequireDefault(_getRenderProperties); 62940 var _optionsFromStrings = requireOptionsFromStrings(); 62941 var _optionsFromStrings2 = _interopRequireDefault(_optionsFromStrings); 62942 var _ErrorHandler = requireErrorHandler(); 62943 var _ErrorHandler2 = _interopRequireDefault(_ErrorHandler); 62944 var _exceptions = requireExceptions(); 62945 var _defaults = requireDefaults(); 62946 var _defaults2 = _interopRequireDefault(_defaults); 62947 function _interopRequireDefault(obj) { 62948 return obj && obj.__esModule ? obj : { default: obj }; 62949 } 62950 var API2 = function API3() { 62951 }; 62952 var JsBarcode2 = function JsBarcode3(element, text, options) { 62953 var api2 = new API2(); 62954 if (typeof element === "undefined") { 62955 throw Error("No element to render on was provided."); 62956 } 62957 api2._renderProperties = (0, _getRenderProperties2.default)(element); 62958 api2._encodings = []; 62959 api2._options = _defaults2.default; 62960 api2._errorHandler = new _ErrorHandler2.default(api2); 62961 if (typeof text !== "undefined") { 62962 options = options || {}; 62963 if (!options.format) { 62964 options.format = autoSelectBarcode(); 62965 } 62966 api2.options(options)[options.format](text, options).render(); 62967 } 62968 return api2; 62969 }; 62970 JsBarcode2.getModule = function(name2) { 62971 return _barcodes2.default[name2]; 62972 }; 62973 for (var name in _barcodes2.default) { 62974 if (_barcodes2.default.hasOwnProperty(name)) { 62975 registerBarcode(_barcodes2.default, name); 62976 } 62977 } 62978 function registerBarcode(barcodes2, name2) { 62979 API2.prototype[name2] = API2.prototype[name2.toUpperCase()] = API2.prototype[name2.toLowerCase()] = function(text, options) { 62980 var api2 = this; 62981 return api2._errorHandler.wrapBarcodeCall(function() { 62982 options.text = typeof options.text === "undefined" ? void 0 : "" + options.text; 62983 var newOptions = (0, _merge2.default)(api2._options, options); 62984 newOptions = (0, _optionsFromStrings2.default)(newOptions); 62985 var Encoder = barcodes2[name2]; 62986 var encoded = encode(text, Encoder, newOptions); 62987 api2._encodings.push(encoded); 62988 return api2; 62989 }); 62990 }; 62991 } 62992 function encode(text, Encoder, options) { 62993 text = "" + text; 62994 var encoder2 = new Encoder(text, options); 62995 if (!encoder2.valid()) { 62996 throw new _exceptions.InvalidInputException(encoder2.constructor.name, text); 62997 } 62998 var encoded = encoder2.encode(); 62999 encoded = (0, _linearizeEncodings2.default)(encoded); 63000 for (var i2 = 0; i2 < encoded.length; i2++) { 63001 encoded[i2].options = (0, _merge2.default)(options, encoded[i2].options); 63002 } 63003 return encoded; 63004 } 63005 function autoSelectBarcode() { 63006 if (_barcodes2.default["CODE128"]) { 63007 return "CODE128"; 63008 } 63009 return Object.keys(_barcodes2.default)[0]; 63010 } 63011 API2.prototype.options = function(options) { 63012 this._options = (0, _merge2.default)(this._options, options); 63013 return this; 63014 }; 63015 API2.prototype.blank = function(size) { 63016 var zeroes = new Array(size + 1).join("0");
63017 this._encodings.push({ data: zeroes }); 63018 return this; 63019 }; 63020 API2.prototype.init = function() { 63021 if (!this._renderProperties) { 63022 return; 63023 } 63024 if (!Array.isArray(this._renderProperties)) { 63025 this._renderProperties = [this._renderProperties]; 63026 } 63027 var renderProperty; 63028 for (var i2 in this._renderProperties) { 63029 renderProperty = this._renderProperties[i2]; 63030 var options = (0, _merge2.default)(this._options, renderProperty.options); 63031 if (options.format == "auto") { 63032 options.format = autoSelectBarcode(); 63033 } 63034 this._errorHandler.wrapBarcodeCall(function() { 63035 var text = options.value; 63036 var Encoder = _barcodes2.default[options.format.toUpperCase()]; 63037 var encoded = encode(text, Encoder, options); 63038 render(renderProperty, encoded, options); 63039 }); 63040 } 63041 }; 63042 API2.prototype.render = function() { 63043 if (!this._renderProperties) { 63044 throw new _exceptions.NoElementException(); 63045 } 63046 if (Array.isArray(this._renderProperties)) { 63047 for (var i2 = 0; i2 < this._renderProperties.length; i2++) { 63048 render(this._renderProperties[i2], this._encodings, this._options); 63049 } 63050 } else { 63051 render(this._renderProperties, this._encodings, this._options); 63052 } 63053 return this; 63054 }; 63055 API2.prototype._defaults = _defaults2.default; 63056 function render(renderProperties, encodings, options) { 63057 encodings = (0, _linearizeEncodings2.default)(encodings); 63058 for (var i2 = 0; i2 < encodings.length; i2++) { 63059 encodings[i2].options = (0, _merge2.default)(options, encodings[i2].options); 63060 (0, _fixOptions2.default)(encodings[i2].options); 63061 } 63062 (0, _fixOptions2.default)(options); 63063 var Renderer = renderProperties.renderer; 63064 var renderer = new Renderer(renderProperties.element, encodings, options); 63065 renderer.render(); 63066 if (renderProperties.afterRender) { 63067 renderProperties.afterRender(); 63068 } 63069 } 63070 if (typeof window !== "undefined") { 63071 window.JsBarcode = JsBarcode2; 63072 } 63073 if (typeof jQuery !== "undefined") { 63074 jQuery.fn.JsBarcode = function(content, options) { 63075 var elementArray = []; 63076 jQuery(this).each(function() { 63077 elementArray.push(this); 63078 }); 63079 return JsBarcode2(elementArray, content, options); 63080 }; 63081 } 63082 JsBarcode_1 = JsBarcode2; 63083 return JsBarcode_1; 63084 } 63085 var JsBarcodeExports = requireJsBarcode(); 63086 const JsBarcode = /* @__PURE__ */ getDefaultExportFromCjs(JsBarcodeExports); 63087 var __defProp$R = Object.defineProperty; 63088 var __getOwnPropDesc$U = Object.getOwnPropertyDescriptor; 63089 var __decorateClass$U = (decorators, target, key, kind) => { 63090 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$U(target, key) : target; 63091 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 63092 if (decorator = decorators[i2]) 63093 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 63094 if (kind && result) __defProp$R(target, key, result); 63095 return result; 63096 }; 63097 let Barcode = class extends Subscriber$1(i$6) { 63098 constructor() { 63099 super(...arguments); 63100 this.barcode = ""; 63101 this.barWidth = 2; 63102 this.barHeight = 100; 63103 this.hideValue = false; 63104 this.margin = "13 15 13 15"; 63105 } 63106 // @property() hideValue = "true"; 63107 firstUpdated() { 63108 const isSafariIos = navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/AppleWebKit/); 63109 const version2 = navigator.userAgent.match(/Version\/(\d+)/); 63110 if (isSafariIos && version2 && parseInt(version2[1]) <= 15) { 63111 this.setAttribute("blackandwhite", ""); 63112 } else { 63113 const computedStyle = getComputedStyle(this); 63114 let bg = computedStyle.getPropertyValue("background-color"); 63115 let color = computedStyle.getPropertyValue("color"); 63116 if (bg.includes("rgba")) { 63117 bg = this.rgbaToRgb(bg); 63118 } 63119 if (color.includes("rgba")) { 63120 color = this.rgbaToRgb(color); 63121 } 63122 const bgLuminance = this.getLuminance(bg); 63123 const colorLuminance = this.getLuminance(color); 63124 if (colorLuminance > bgLuminance) { 63125 this.setAttribute("invert", ""); 63126 } 63127 } 63128 } 63129 rgbaToRgb(color) { 63130 const rgb = color.match(/\d+/g)?.map(Number); 63131 if (!rgb || rgb.length !== 3) { 63132 throw new Error("Invalid color format"); 63133 } 63134 return `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`; 63135 } 63136 getLuminance(color) { 63137 const rgb = color.match(/\d+/g)?.map(Number); 63138 if (!rgb || rgb.length !== 3) { 63139 throw new Error("Invalid color format"); 63140 } 63141 const [r2, g2, b2] = rgb.map((c2) => { 63142 const sRGB = c2 / 255; 63143 return sRGB <= 0.03928 ? sRGB / 12.92 : Math.pow((sRGB + 0.055) / 1.055, 2.4); 63144 }); 63145 return 0.2126 * r2 + 0.7152 * g2 + 0.0722 * b2; 63146 } 63147 render() { 63148 return b$1`<svg id="barcode"></svg>`; 63149 } 63150 generateBarcode() { 63151 const margins = this.margin.split(" "); 63152 JsBarcode(this.$barcode, this.barcode, { 63153 format: "ean13", 63154 background: "transparent", 63155 lineColor: "currentColor", 63156 font: "var(--sc-barcode-ff)", 63157 displayValue: this.hideValue ? false : true, 63158 width: this.barWidth, 63159 height: this.barHeight, 63160 marginTop: parseInt(margins[0]), 63161 marginRight: parseInt(margins[1]), 63162 marginBottom: parseInt(margins[2]), 63163 marginLeft: parseInt(margins[3]), 63164 valid: (valid) => { 63165 if (valid) { 63166 this.$barcode.style.display = "block"; 63167 } else { 63168 this.$barcode.style.display = "none"; 63169 } 63170 } 63171 }); 63172 } 63173 updated() { 63174 this.generateBarcode(); 63175 } 63176 }; 63177 Barcode.styles = [ 63178 i$9` 63179 :host { 63180 --sc-barcode-bg: var(--sc-base); 63181 --sc-barcode-color: var(--sc-base-900); 63182 --sc-barcode-ff: var(--sc-font-family-base); 63183 background-color: var(--sc-barcode-bg); 63184 color: var(--sc-barcode-color); 63185 border-radius: var(--sc-rounded-md); 63186 display: inline-block; 63187 vertical-align: middle; 63188 } 63189 63190 :host([invert]) { 63191 --sc-barcode-bg: var(--sc-base-900); 63192 --sc-barcode-color: var(--sc-base); 63193 } 63194 :host([blackandwhite]) { 63195 --sc-barcode-bg: #ffffff; 63196 --sc-barcode-color: #000000; 63197 } 63198 63199 svg { 63200 width: 100%; 63201 height: auto; 63202 } 63203 ` 63204 ]; 63205 __decorateClass$U([ 63206 e$7("#barcode") 63207 ], Barcode.prototype, "$barcode", 2); 63208 __decorateClass$U([ 63209 n$5() 63210 ], Barcode.prototype, "barcode", 2); 63211 __decorateClass$U([ 63212 n$5({ type: Number }) 63213 ], Barcode.prototype, "barWidth", 2); 63214 __decorateClass$U([ 63215 n$5({ type: Number }) 63216 ], Barcode.prototype, "barHeight", 2); 63217 __decorateClass$U([ 63218 n$5({ type: Boolean }) 63219 ], Barcode.prototype, "hideValue", 2); 63220 __decorateClass$U([ 63221 n$5({ type: String }) 63222 ], Barcode.prototype, "margin", 2); 63223 Barcode = __decorateClass$U([ 63224 t$3("sonic-barcode") 63225 ], Barcode); 63226 var browser = {}; 63227 var canPromise; 63228 var hasRequiredCanPromise; 63229 function requireCanPromise() { 63230 if (hasRequiredCanPromise) return canPromise; 63231 hasRequiredCanPromise = 1; 63232 canPromise = function() { 63233 return typeof Promise === "function" && Promise.prototype && Promise.prototype.then; 63234 }; 63235 return canPromise; 63236 } 63237 var qrcode = {}; 63238 var utils$1 = {}; 63239 var hasRequiredUtils$1; 63240 function requireUtils$1() { 63241 if (hasRequiredUtils$1) return utils$1; 63242 hasRequiredUtils$1 = 1; 63243 let toSJISFunction; 63244 const CODEWORDS_COUNT = [ 63245 0, 63246 // Not used 63247 26, 63248 44, 63249 70, 63250 100, 63251 134, 63252 172, 63253 196, 63254 242, 63255 292, 63256 346, 63257 404, 63258 466, 63259 532, 63260 581, 63261 655, 63262 733, 63263 815, 63264 901, 63265 991, 63266 1085, 63267 1156, 63268 1258, 63269 1364, 63270 1474, 63271 1588, 63272 1706, 63273 1828, 63274 1921, 63275 2051, 63276 2185, 63277 2323, 63278 2465, 63279 2611,
63280 2761, 63281 2876, 63282 3034, 63283 3196, 63284 3362, 63285 3532, 63286 3706 63287 ]; 63288 utils$1.getSymbolSize = function getSymbolSize(version2) { 63289 if (!version2) throw new Error('"version" cannot be null or undefined'); 63290 if (version2 < 1 || version2 > 40) throw new Error('"version" should be in range from 1 to 40'); 63291 return version2 * 4 + 17; 63292 }; 63293 utils$1.getSymbolTotalCodewords = function getSymbolTotalCodewords(version2) { 63294 return CODEWORDS_COUNT[version2]; 63295 }; 63296 utils$1.getBCHDigit = function(data) { 63297 let digit = 0; 63298 while (data !== 0) { 63299 digit++; 63300 data >>>= 1; 63301 } 63302 return digit; 63303 }; 63304 utils$1.setToSJISFunction = function setToSJISFunction(f2) { 63305 if (typeof f2 !== "function") { 63306 throw new Error('"toSJISFunc" is not a valid function.'); 63307 } 63308 toSJISFunction = f2; 63309 }; 63310 utils$1.isKanjiModeEnabled = function() { 63311 return typeof toSJISFunction !== "undefined"; 63312 }; 63313 utils$1.toSJIS = function toSJIS(kanji) { 63314 return toSJISFunction(kanji); 63315 }; 63316 return utils$1; 63317 } 63318 var errorCorrectionLevel = {}; 63319 var hasRequiredErrorCorrectionLevel; 63320 function requireErrorCorrectionLevel() { 63321 if (hasRequiredErrorCorrectionLevel) return errorCorrectionLevel; 63322 hasRequiredErrorCorrectionLevel = 1; 63323 (function(exports) { 63324 exports.L = { bit: 1 }; 63325 exports.M = { bit: 0 }; 63326 exports.Q = { bit: 3 }; 63327 exports.H = { bit: 2 }; 63328 function fromString(string) { 63329 if (typeof string !== "string") { 63330 throw new Error("Param is not a string"); 63331 } 63332 const lcStr = string.toLowerCase(); 63333 switch (lcStr) { 63334 case "l": 63335 case "low": 63336 return exports.L; 63337 case "m": 63338 case "medium": 63339 return exports.M; 63340 case "q": 63341 case "quartile": 63342 return exports.Q; 63343 case "h": 63344 case "high": 63345 return exports.H; 63346 default: 63347 throw new Error("Unknown EC Level: " + string); 63348 } 63349 } 63350 exports.isValid = function isValid(level) { 63351 return level && typeof level.bit !== "undefined" && level.bit >= 0 && level.bit < 4; 63352 }; 63353 exports.from = function from(value, defaultValue2) { 63354 if (exports.isValid(value)) { 63355 return value; 63356 } 63357 try { 63358 return fromString(value); 63359 } catch (e2) { 63360 return defaultValue2; 63361 } 63362 }; 63363 })(errorCorrectionLevel); 63364 return errorCorrectionLevel; 63365 } 63366 var bitBuffer; 63367 var hasRequiredBitBuffer; 63368 function requireBitBuffer() { 63369 if (hasRequiredBitBuffer) return bitBuffer; 63370 hasRequiredBitBuffer = 1; 63371 function BitBuffer() { 63372 this.buffer = []; 63373 this.length = 0; 63374 } 63375 BitBuffer.prototype = { 63376 get: function(index) { 63377 const bufIndex = Math.floor(index / 8); 63378 return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) === 1; 63379 }, 63380 put: function(num, length) { 63381 for (let i2 = 0; i2 < length; i2++) { 63382 this.putBit((num >>> length - i2 - 1 & 1) === 1); 63383 } 63384 }, 63385 getLengthInBits: function() { 63386 return this.length; 63387 }, 63388 putBit: function(bit) { 63389 const bufIndex = Math.floor(this.length / 8); 63390 if (this.buffer.length <= bufIndex) { 63391 this.buffer.push(0); 63392 } 63393 if (bit) { 63394 this.buffer[bufIndex] |= 128 >>> this.length % 8; 63395 } 63396 this.length++; 63397 } 63398 }; 63399 bitBuffer = BitBuffer; 63400 return bitBuffer; 63401 } 63402 var bitMatrix; 63403 var hasRequiredBitMatrix; 63404 function requireBitMatrix() { 63405 if (hasRequiredBitMatrix) return bitMatrix; 63406 hasRequiredBitMatrix = 1; 63407 function BitMatrix(size) { 63408 if (!size || size < 1) { 63409 throw new Error("BitMatrix size must be defined and greater than 0"); 63410 } 63411 this.size = size; 63412 this.data = new Uint8Array(size * size); 63413 this.reservedBit = new Uint8Array(size * size); 63414 } 63415 BitMatrix.prototype.set = function(row, col, value, reserved) { 63416 const index = row * this.size + col; 63417 this.data[index] = value; 63418 if (reserved) this.reservedBit[index] = true; 63419 }; 63420 BitMatrix.prototype.get = function(row, col) { 63421 return this.data[row * this.size + col]; 63422 }; 63423 BitMatrix.prototype.xor = function(row, col, value) { 63424 this.data[row * this.size + col] ^= value; 63425 }; 63426 BitMatrix.prototype.isReserved = function(row, col) { 63427 return this.reservedBit[row * this.size + col]; 63428 }; 63429 bitMatrix = BitMatrix; 63430 return bitMatrix; 63431 } 63432 var alignmentPattern = {}; 63433 var hasRequiredAlignmentPattern; 63434 function requireAlignmentPattern() { 63435 if (hasRequiredAlignmentPattern) return alignmentPattern; 63436 hasRequiredAlignmentPattern = 1; 63437 (function(exports) { 63438 const getSymbolSize = requireUtils$1().getSymbolSize; 63439 exports.getRowColCoords = function getRowColCoords(version2) { 63440 if (version2 === 1) return []; 63441 const posCount = Math.floor(version2 / 7) + 2; 63442 const size = getSymbolSize(version2); 63443 const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2; 63444 const positions = [size - 7]; 63445 for (let i2 = 1; i2 < posCount - 1; i2++) { 63446 positions[i2] = positions[i2 - 1] - intervals; 63447 } 63448 positions.push(6); 63449 return positions.reverse(); 63450 }; 63451 exports.getPositions = function getPositions(version2) { 63452 const coords = []; 63453 const pos = exports.getRowColCoords(version2); 63454 const posLength = pos.length; 63455 for (let i2 = 0; i2 < posLength; i2++) { 63456 for (let j2 = 0; j2 < posLength; j2++) { 63457 if (i2 === 0 && j2 === 0 || // top-left 63458 i2 === 0 && j2 === posLength - 1 || // bottom-left 63459 i2 === posLength - 1 && j2 === 0) { 63460 continue; 63461 } 63462 coords.push([pos[i2], pos[j2]]); 63463 } 63464 } 63465 return coords; 63466 }; 63467 })(alignmentPattern); 63468 return alignmentPattern; 63469 } 63470 var finderPattern = {}; 63471 var hasRequiredFinderPattern; 63472 function requireFinderPattern() { 63473 if (hasRequiredFinderPattern) return finderPattern; 63474 hasRequiredFinderPattern = 1; 63475 const getSymbolSize = requireUtils$1().getSymbolSize; 63476 const FINDER_PATTERN_SIZE = 7; 63477 finderPattern.getPositions = function getPositions(version2) { 63478 const size = getSymbolSize(version2); 63479 return [ 63480 // top-left 63481 [0, 0], 63482 // top-right 63483 [size - FINDER_PATTERN_SIZE, 0], 63484 // bottom-left 63485 [0, size - FINDER_PATTERN_SIZE] 63486 ]; 63487 }; 63488 return finderPattern; 63489 } 63490 var maskPattern = {}; 63491 var hasRequiredMaskPattern; 63492 function requireMaskPattern() { 63493 if (hasRequiredMaskPattern) return maskPattern; 63494 hasRequiredMaskPattern = 1; 63495 (function(exports) { 63496 exports.Patterns = { 63497 PATTERN000: 0, 63498 PATTERN001: 1, 63499 PATTERN010: 2, 63500 PATTERN011: 3, 63501 PATTERN100: 4, 63502 PATTERN101: 5, 63503 PATTERN110: 6, 63504 PATTERN111: 7 63505 }; 63506 const PenaltyScores = { 63507 N1: 3, 63508 N2: 3, 63509 N3: 40, 63510 N4: 10 63511 }; 63512 exports.isValid = function isValid(mask) { 63513 return mask != null && mask !== "" && !isNaN(mask) && mask >= 0 && mask <= 7; 63514 }; 63515 exports.from = function from(value) { 63516 return exports.isValid(value) ? parseInt(value, 10) : void 0; 63517 }; 63518 exports.getPenaltyN1 = function getPenaltyN1(data) { 63519 const size = data.size; 63520 let points = 0; 63521 let sameCountCol = 0; 63522 let sameCountRow = 0; 63523 let lastCol = null; 63524 let lastRow = null; 63525 for (let row = 0; row < size; row++) { 63526 sameCountCol = sameCountRow = 0; 63527 lastCol = lastRow = null; 63528 for (let col = 0; col < size; col++) { 63529 let module = data.get(row, col); 63530 if (module === lastCol) { 63531 sameCountCol++; 63532 } else { 63533 if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5); 63534 lastCol = module; 63535 sameCountCol = 1; 63536 } 63537 module = data.get(col, row); 63538 if (module === lastRow) { 63539 sameCountRow++; 63540 } else { 63541 if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5); 63542 lastRow = module; 63543 sameCountRow = 1; 63544 } 63545 } 63546 if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5); 63547 if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5); 63548 } 63549 return points; 63550 }; 63551 exports.getPenaltyN2 = function getPenaltyN2(data) { 63552 const size = data.size; 63553 let points = 0; 63554 for (let row = 0; row < size - 1; row++) { 63555 for (let col = 0; col < size - 1; col++) { 63556 const last = data.get(row, col) + data.get(row, col + 1) + data.get(row + 1, col) + data.get(row + 1, col + 1); 63557 if (last === 4 || last === 0) points++; 63558 } 63559 } 63560 return points * PenaltyScores.N2; 63561 }; 63562 exports.getPenaltyN3 = function getPenaltyN3(data) { 63563 const size = data.size; 63564 let points = 0; 63565 let bitsCol = 0; 63566 let bitsRow = 0; 63567 for (let row = 0; row < size; row++) { 63568 bitsCol = bitsRow = 0; 63569 for (let col = 0; col < size; col++) { 63570 bitsCol = bitsCol << 1 & 2047 | data.get(row, col); 63571 if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) points++; 63572 bitsRow = bitsRow << 1 & 2047 | data.get(col, row); 63573 if (col >= 10 && (bitsRow === 1488 || bitsRow === 93)) points++; 63574 } 63575 } 63576 return points * PenaltyScores.N3; 63577 }; 63578 exports.getPenaltyN4 = function getPenaltyN4(data) { 63579 let darkCount = 0; 63580 const modulesCount = data.data.length; 63581 for (let i2 = 0; i2 < modulesCount; i2++) darkCount += data.data[i2];
63582 const k2 = Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10); 63583 return k2 * PenaltyScores.N4; 63584 }; 63585 function getMaskAt(maskPattern2, i2, j2) { 63586 switch (maskPattern2) { 63587 case exports.Patterns.PATTERN000: 63588 return (i2 + j2) % 2 === 0; 63589 case exports.Patterns.PATTERN001: 63590 return i2 % 2 === 0; 63591 case exports.Patterns.PATTERN010: 63592 return j2 % 3 === 0; 63593 case exports.Patterns.PATTERN011: 63594 return (i2 + j2) % 3 === 0; 63595 case exports.Patterns.PATTERN100: 63596 return (Math.floor(i2 / 2) + Math.floor(j2 / 3)) % 2 === 0; 63597 case exports.Patterns.PATTERN101: 63598 return i2 * j2 % 2 + i2 * j2 % 3 === 0; 63599 case exports.Patterns.PATTERN110: 63600 return (i2 * j2 % 2 + i2 * j2 % 3) % 2 === 0; 63601 case exports.Patterns.PATTERN111: 63602 return (i2 * j2 % 3 + (i2 + j2) % 2) % 2 === 0; 63603 default: 63604 throw new Error("bad maskPattern:" + maskPattern2); 63605 } 63606 } 63607 exports.applyMask = function applyMask(pattern, data) { 63608 const size = data.size; 63609 for (let col = 0; col < size; col++) { 63610 for (let row = 0; row < size; row++) { 63611 if (data.isReserved(row, col)) continue; 63612 data.xor(row, col, getMaskAt(pattern, row, col)); 63613 } 63614 } 63615 }; 63616 exports.getBestMask = function getBestMask(data, setupFormatFunc) { 63617 const numPatterns = Object.keys(exports.Patterns).length; 63618 let bestPattern = 0; 63619 let lowerPenalty = Infinity; 63620 for (let p2 = 0; p2 < numPatterns; p2++) { 63621 setupFormatFunc(p2); 63622 exports.applyMask(p2, data); 63623 const penalty = exports.getPenaltyN1(data) + exports.getPenaltyN2(data) + exports.getPenaltyN3(data) + exports.getPenaltyN4(data); 63624 exports.applyMask(p2, data); 63625 if (penalty < lowerPenalty) { 63626 lowerPenalty = penalty; 63627 bestPattern = p2; 63628 } 63629 } 63630 return bestPattern; 63631 }; 63632 })(maskPattern); 63633 return maskPattern; 63634 } 63635 var errorCorrectionCode = {}; 63636 var hasRequiredErrorCorrectionCode; 63637 function requireErrorCorrectionCode() { 63638 if (hasRequiredErrorCorrectionCode) return errorCorrectionCode; 63639 hasRequiredErrorCorrectionCode = 1; 63640 const ECLevel = requireErrorCorrectionLevel(); 63641 const EC_BLOCKS_TABLE = [ 63642 // L M Q H 63643 1, 63644 1, 63645 1, 63646 1, 63647 1, 63648 1, 63649 1, 63650 1, 63651 1, 63652 1, 63653 2, 63654 2, 63655 1, 63656 2, 63657 2, 63658 4, 63659 1, 63660 2, 63661 4, 63662 4, 63663 2, 63664 4, 63665 4, 63666 4, 63667 2, 63668 4, 63669 6, 63670 5, 63671 2, 63672 4, 63673 6, 63674 6, 63675 2, 63676 5, 63677 8, 63678 8, 63679 4, 63680 5, 63681 8, 63682 8, 63683 4, 63684 5, 63685 8, 63686 11, 63687 4, 63688 8, 63689 10, 63690 11, 63691 4, 63692 9, 63693 12, 63694 16, 63695 4, 63696 9, 63697 16, 63698 16, 63699 6, 63700 10, 63701 12, 63702 18, 63703 6, 63704 10, 63705 17, 63706 16, 63707 6, 63708 11, 63709 16, 63710 19, 63711 6, 63712 13, 63713 18, 63714 21, 63715 7, 63716 14, 63717 21, 63718 25, 63719 8, 63720 16, 63721 20, 63722 25, 63723 8, 63724 17, 63725 23, 63726 25, 63727 9, 63728 17, 63729 23, 63730 34, 63731 9, 63732 18, 63733 25, 63734 30, 63735 10, 63736 20, 63737 27, 63738 32, 63739 12, 63740 21, 63741 29, 63742 35, 63743 12, 63744 23, 63745 34, 63746 37, 63747 12, 63748 25, 63749 34, 63750 40, 63751 13, 63752 26, 63753 35, 63754 42, 63755 14, 63756 28, 63757 38, 63758 45, 63759 15, 63760 29, 63761 40, 63762 48, 63763 16, 63764 31, 63765 43, 63766 51, 63767 17, 63768 33, 63769 45, 63770 54, 63771 18, 63772 35, 63773 48, 63774 57, 63775 19, 63776 37, 63777 51, 63778 60, 63779 19, 63780 38, 63781 53, 63782 63, 63783 20, 63784 40, 63785 56, 63786 66, 63787 21, 63788 43, 63789 59, 63790 70, 63791 22, 63792 45, 63793 62, 63794 74, 63795 24, 63796 47, 63797 65, 63798 77, 63799 25, 63800 49, 63801 68, 63802 81 63803 ]; 63804 const EC_CODEWORDS_TABLE = [ 63805 // L M Q H 63806 7, 63807 10, 63808 13, 63809 17, 63810 10, 63811 16, 63812 22, 63813 28, 63814 15, 63815 26, 63816 36, 63817 44, 63818 20, 63819 36, 63820 52, 63821 64, 63822 26, 63823 48, 63824 72, 63825 88, 63826 36, 63827 64, 63828 96, 63829 112, 63830 40, 63831 72, 63832 108, 63833 130, 63834 48, 63835 88, 63836 132, 63837 156, 63838 60, 63839 110, 63840 160, 63841 192, 63842 72, 63843 130, 63844 192, 63845 224, 63846 80, 63847 150, 63848 224, 63849 264, 63850 96, 63851 176, 63852 260, 63853 308, 63854 104, 63855 198, 63856 288, 63857 352, 63858 120, 63859 216, 63860 320, 63861 384, 63862 132, 63863 240, 63864 360, 63865 432, 63866 144, 63867 280, 63868 408, 63869 480, 63870 168, 63871 308, 63872 448, 63873 532, 63874 180, 63875 338, 63876 504, 63877 588, 63878 196, 63879 364, 63880 546, 63881 650, 63882 224, 63883 416, 63884 600, 63885 700, 63886 224, 63887 442, 63888 644, 63889 750, 63890 252, 63891 476, 63892 690, 63893 816, 63894 270, 63895 504, 63896 750, 63897 900, 63898 300, 63899 560, 63900 810, 63901 960, 63902 312, 63903 588, 63904 870, 63905 1050, 63906 336, 63907 644, 63908 952, 63909 1110, 63910 360, 63911 700, 63912 1020, 63913 1200, 63914 390, 63915 728, 63916 1050, 63917 1260, 63918 420, 63919 784, 63920 1140, 63921 1350, 63922 450, 63923 812, 63924 1200, 63925 1440, 63926 480, 63927 868, 63928 1290, 63929 1530, 63930 510, 63931 924, 63932 1350, 63933 1620, 63934 540, 63935 980, 63936 1440, 63937 1710, 63938 570, 63939 1036, 63940 1530, 63941 1800, 63942 570, 63943 1064, 63944 1590, 63945 1890, 63946 600, 63947 1120, 63948 1680, 63949 1980, 63950 630, 63951 1204, 63952 1770, 63953 2100, 63954 660, 63955 1260, 63956 1860, 63957 2220, 63958 720, 63959 1316, 63960 1950, 63961 2310, 63962 750, 63963 1372, 63964 2040, 63965 2430 63966 ]; 63967 errorCorrectionCode.getBlocksCount = function getBlocksCount(version2, errorCorrectionLevel2) { 63968 switch (errorCorrectionLevel2) { 63969 case ECLevel.L: 63970 return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 0]; 63971 case ECLevel.M: 63972 return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 1]; 63973 case ECLevel.Q: 63974 return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 2]; 63975 case ECLevel.H: 63976 return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 3]; 63977 default: 63978 return void 0; 63979 } 63980 }; 63981 errorCorrectionCode.getTotalCodewordsCount = function getTotalCodewordsCount(version2, errorCorrectionLevel2) { 63982 switch (errorCorrectionLevel2) { 63983 case ECLevel.L: 63984 return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 0]; 63985 case ECLevel.M: 63986 return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 1]; 63987 case ECLevel.Q: 63988 return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 2]; 63989 case ECLevel.H: 63990 return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 3]; 63991 default: 63992 return void 0; 63993 } 63994 }; 63995 return errorCorrectionCode; 63996 } 63997 var polynomial = {}; 63998 var galoisField = {}; 63999 var hasRequiredGaloisField; 64000 function requireGaloisField() { 64001 if (hasRequiredGaloisField) return galoisField; 64002 hasRequiredGaloisField = 1; 64003 const EXP_TABLE = new Uint8Array(512); 64004 const LOG_TABLE = new Uint8Array(256); 64005 (function initTables() { 64006 let x2 = 1; 64007 for (let i2 = 0; i2 < 255; i2++) { 64008 EXP_TABLE[i2] = x2; 64009 LOG_TABLE[x2] = i2; 64010 x2 <<= 1; 64011 if (x2 & 256) { 64012 x2 ^= 285; 64013 } 64014 } 64015 for (let i2 = 255; i2 < 512; i2++) { 64016 EXP_TABLE[i2] = EXP_TABLE[i2 - 255]; 64017 } 64018 })(); 64019 galoisField.log = function log2(n2) { 64020 if (n2 < 1) throw new Error("log(" + n2 + ")"); 64021 return LOG_TABLE[n2]; 64022 }; 64023 galoisField.exp = function exp(n2) { 64024 return EXP_TABLE[n2]; 64025 }; 64026 galoisField.mul = function mul(x2, y2) { 64027 if (x2 === 0 || y2 === 0) return 0; 64028 return EXP_TABLE[LOG_TABLE[x2] + LOG_TABLE[y2]]; 64029 }; 64030 return galoisField; 64031 } 64032 var hasRequiredPolynomial; 64033 function requirePolynomial() { 64034 if (hasRequiredPolynomial) return polynomial; 64035 hasRequiredPolynomial = 1; 64036 (function(exports) { 64037 const GF = requireGaloisField(); 64038 exports.mul = function mul(p1, p2) { 64039 const coeff = new Uint8Array(p1.length + p2.length - 1); 64040 for (let i2 = 0; i2 < p1.length; i2++) { 64041 for (let j2 = 0; j2 < p2.length; j2++) { 64042 coeff[i2 + j2] ^= GF.mul(p1[i2], p2[j2]); 64043 } 64044 } 64045 return coeff; 64046 }; 64047 exports.mod = function mod(divident, divisor) { 64048 let result = new Uint8Array(divident); 64049 while (result.length - divisor.length >= 0) { 64050 const coeff = result[0]; 64051 for (let i2 = 0; i2 < divisor.length; i2++) { 64052 result[i2] ^= GF.mul(divisor[i2], coeff); 64053 } 64054 let offset = 0; 64055 while (offset < result.length && result[offset] === 0) offset++; 64056 result = result.slice(offset); 64057 } 64058 return result; 64059 }; 64060 exports.generateECPolynomial = function generateECPolynomial(degree) { 64061 let poly = new Uint8Array([1]); 64062 for (let i2 = 0; i2 < degree; i2++) { 64063 poly = exports.mul(poly, new Uint8Array([1, GF.exp(i2)])); 64064 } 64065 return poly; 64066 }; 64067 })(polynomial); 64068 return polynomial; 64069 } 64070 var reedSolomonEncoder; 64071 var hasRequiredReedSolomonEncoder; 64072 function requireReedSolomonEncoder() { 64073 if (hasRequiredReedSolomonEncoder) return reedSolomonEncoder; 64074 hasRequiredReedSolomonEncoder = 1; 64075 const Polynomial = requirePolynomial(); 64076 function ReedSolomonEncoder(degree) { 64077 this.genPoly = void 0; 64078 this.degree = degree; 64079 if (this.degree) this.initialize(this.degree); 64080 } 64081 ReedSolomonEncoder.prototype.initialize = function initialize(degree) { 64082 this.degree = degree; 64083 this.genPoly = Polynomial.generateECPolynomial(this.degree); 64084 };
64085 ReedSolomonEncoder.prototype.encode = function encode(data) { 64086 if (!this.genPoly) { 64087 throw new Error("Encoder not initialized"); 64088 } 64089 const paddedData = new Uint8Array(data.length + this.degree); 64090 paddedData.set(data); 64091 const remainder = Polynomial.mod(paddedData, this.genPoly); 64092 const start = this.degree - remainder.length; 64093 if (start > 0) { 64094 const buff = new Uint8Array(this.degree); 64095 buff.set(remainder, start); 64096 return buff; 64097 } 64098 return remainder; 64099 }; 64100 reedSolomonEncoder = ReedSolomonEncoder; 64101 return reedSolomonEncoder; 64102 } 64103 var version = {}; 64104 var mode = {}; 64105 var versionCheck = {}; 64106 var hasRequiredVersionCheck; 64107 function requireVersionCheck() { 64108 if (hasRequiredVersionCheck) return versionCheck; 64109 hasRequiredVersionCheck = 1; 64110 versionCheck.isValid = function isValid(version2) { 64111 return !isNaN(version2) && version2 >= 1 && version2 <= 40; 64112 }; 64113 return versionCheck; 64114 } 64115 var regex = {}; 64116 var hasRequiredRegex; 64117 function requireRegex() { 64118 if (hasRequiredRegex) return regex; 64119 hasRequiredRegex = 1; 64120 const numeric = "[0-9]+"; 64121 const alphanumeric = "[A-Z $%*+\\-./:]+"; 64122 let kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+"; 64123 kanji = kanji.replace(/u/g, "\\u"); 64124 const byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+"; 64125 regex.KANJI = new RegExp(kanji, "g"); 64126 regex.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"); 64127 regex.BYTE = new RegExp(byte, "g"); 64128 regex.NUMERIC = new RegExp(numeric, "g"); 64129 regex.ALPHANUMERIC = new RegExp(alphanumeric, "g"); 64130 const TEST_KANJI = new RegExp("^" + kanji + "$"); 64131 const TEST_NUMERIC = new RegExp("^" + numeric + "$"); 64132 const TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$"); 64133 regex.testKanji = function testKanji(str) { 64134 return TEST_KANJI.test(str); 64135 }; 64136 regex.testNumeric = function testNumeric(str) { 64137 return TEST_NUMERIC.test(str); 64138 }; 64139 regex.testAlphanumeric = function testAlphanumeric(str) { 64140 return TEST_ALPHANUMERIC.test(str); 64141 }; 64142 return regex; 64143 } 64144 var hasRequiredMode; 64145 function requireMode() { 64146 if (hasRequiredMode) return mode; 64147 hasRequiredMode = 1; 64148 (function(exports) { 64149 const VersionCheck = requireVersionCheck(); 64150 const Regex = requireRegex(); 64151 exports.NUMERIC = { 64152 id: "Numeric", 64153 bit: 1 << 0, 64154 ccBits: [10, 12, 14] 64155 }; 64156 exports.ALPHANUMERIC = { 64157 id: "Alphanumeric", 64158 bit: 1 << 1, 64159 ccBits: [9, 11, 13] 64160 }; 64161 exports.BYTE = { 64162 id: "Byte", 64163 bit: 1 << 2, 64164 ccBits: [8, 16, 16] 64165 }; 64166 exports.KANJI = { 64167 id: "Kanji", 64168 bit: 1 << 3, 64169 ccBits: [8, 10, 12] 64170 }; 64171 exports.MIXED = { 64172 bit: -1 64173 }; 64174 exports.getCharCountIndicator = function getCharCountIndicator(mode2, version2) { 64175 if (!mode2.ccBits) throw new Error("Invalid mode: " + mode2); 64176 if (!VersionCheck.isValid(version2)) { 64177 throw new Error("Invalid version: " + version2); 64178 } 64179 if (version2 >= 1 && version2 < 10) return mode2.ccBits[0]; 64180 else if (version2 < 27) return mode2.ccBits[1]; 64181 return mode2.ccBits[2]; 64182 }; 64183 exports.getBestModeForData = function getBestModeForData(dataStr) { 64184 if (Regex.testNumeric(dataStr)) return exports.NUMERIC; 64185 else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC; 64186 else if (Regex.testKanji(dataStr)) return exports.KANJI; 64187 else return exports.BYTE; 64188 }; 64189 exports.toString = function toString(mode2) { 64190 if (mode2 && mode2.id) return mode2.id; 64191 throw new Error("Invalid mode"); 64192 }; 64193 exports.isValid = function isValid(mode2) { 64194 return mode2 && mode2.bit && mode2.ccBits; 64195 }; 64196 function fromString(string) { 64197 if (typeof string !== "string") { 64198 throw new Error("Param is not a string"); 64199 } 64200 const lcStr = string.toLowerCase(); 64201 switch (lcStr) { 64202 case "numeric": 64203 return exports.NUMERIC; 64204 case "alphanumeric": 64205 return exports.ALPHANUMERIC; 64206 case "kanji": 64207 return exports.KANJI; 64208 case "byte": 64209 return exports.BYTE; 64210 default: 64211 throw new Error("Unknown mode: " + string); 64212 } 64213 } 64214 exports.from = function from(value, defaultValue2) { 64215 if (exports.isValid(value)) { 64216 return value; 64217 } 64218 try { 64219 return fromString(value); 64220 } catch (e2) { 64221 return defaultValue2; 64222 } 64223 }; 64224 })(mode); 64225 return mode; 64226 } 64227 var hasRequiredVersion; 64228 function requireVersion() { 64229 if (hasRequiredVersion) return version; 64230 hasRequiredVersion = 1; 64231 (function(exports) { 64232 const Utils2 = requireUtils$1(); 64233 const ECCode = requireErrorCorrectionCode(); 64234 const ECLevel = requireErrorCorrectionLevel(); 64235 const Mode = requireMode(); 64236 const VersionCheck = requireVersionCheck(); 64237 const G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0;
64238 const G18_BCH = Utils2.getBCHDigit(G18); 64239 function getBestVersionForDataLength(mode2, length, errorCorrectionLevel2) { 64240 for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { 64241 if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, mode2)) { 64242 return currentVersion; 64243 } 64244 } 64245 return void 0; 64246 } 64247 function getReservedBitsCount(mode2, version2) { 64248 return Mode.getCharCountIndicator(mode2, version2) + 4; 64249 } 64250 function getTotalBitsFromDataArray(segments2, version2) { 64251 let totalBits = 0; 64252 segments2.forEach(function(data) { 64253 const reservedBits = getReservedBitsCount(data.mode, version2); 64254 totalBits += reservedBits + data.getBitsLength(); 64255 }); 64256 return totalBits; 64257 } 64258 function getBestVersionForMixedData(segments2, errorCorrectionLevel2) { 64259 for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { 64260 const length = getTotalBitsFromDataArray(segments2, currentVersion); 64261 if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, Mode.MIXED)) { 64262 return currentVersion; 64263 } 64264 } 64265 return void 0; 64266 } 64267 exports.from = function from(value, defaultValue2) { 64268 if (VersionCheck.isValid(value)) { 64269 return parseInt(value, 10); 64270 } 64271 return defaultValue2; 64272 }; 64273 exports.getCapacity = function getCapacity(version2, errorCorrectionLevel2, mode2) { 64274 if (!VersionCheck.isValid(version2)) { 64275 throw new Error("Invalid QR Code version"); 64276 } 64277 if (typeof mode2 === "undefined") mode2 = Mode.BYTE; 64278 const totalCodewords = Utils2.getSymbolTotalCodewords(version2); 64279 const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); 64280 const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8; 64281 if (mode2 === Mode.MIXED) return dataTotalCodewordsBits; 64282 const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode2, version2); 64283 switch (mode2) { 64284 case Mode.NUMERIC: 64285 return Math.floor(usableBits / 10 * 3); 64286 case Mode.ALPHANUMERIC: 64287 return Math.floor(usableBits / 11 * 2); 64288 case Mode.KANJI: 64289 return Math.floor(usableBits / 13); 64290 case Mode.BYTE: 64291 default: 64292 return Math.floor(usableBits / 8); 64293 } 64294 }; 64295 exports.getBestVersionForData = function getBestVersionForData(data, errorCorrectionLevel2) { 64296 let seg; 64297 const ecl = ECLevel.from(errorCorrectionLevel2, ECLevel.M); 64298 if (Array.isArray(data)) { 64299 if (data.length > 1) { 64300 return getBestVersionForMixedData(data, ecl); 64301 } 64302 if (data.length === 0) { 64303 return 1; 64304 } 64305 seg = data[0]; 64306 } else { 64307 seg = data; 64308 } 64309 return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl); 64310 }; 64311 exports.getEncodedBits = function getEncodedBits(version2) { 64312 if (!VersionCheck.isValid(version2) || version2 < 7) { 64313 throw new Error("Invalid QR Code version"); 64314 } 64315 let d2 = version2 << 12; 64316 while (Utils2.getBCHDigit(d2) - G18_BCH >= 0) { 64317 d2 ^= G18 << Utils2.getBCHDigit(d2) - G18_BCH; 64318 } 64319 return version2 << 12 | d2; 64320 }; 64321 })(version); 64322 return version; 64323 } 64324 var formatInfo = {}; 64325 var hasRequiredFormatInfo; 64326 function requireFormatInfo() { 64327 if (hasRequiredFormatInfo) return formatInfo; 64328 hasRequiredFormatInfo = 1; 64329 const Utils2 = requireUtils$1(); 64330 const G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0; 64331 const G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1; 64332 const G15_BCH = Utils2.getBCHDigit(G15); 64333 formatInfo.getEncodedBits = function getEncodedBits(errorCorrectionLevel2, mask) { 64334 const data = errorCorrectionLevel2.bit << 3 | mask; 64335 let d2 = data << 10; 64336 while (Utils2.getBCHDigit(d2) - G15_BCH >= 0) {
64337 d2 ^= G15 << Utils2.getBCHDigit(d2) - G15_BCH; 64338 } 64339 return (data << 10 | d2) ^ G15_MASK; 64340 }; 64341 return formatInfo; 64342 } 64343 var segments = {}; 64344 var numericData; 64345 var hasRequiredNumericData; 64346 function requireNumericData() { 64347 if (hasRequiredNumericData) return numericData; 64348 hasRequiredNumericData = 1; 64349 const Mode = requireMode(); 64350 function NumericData(data) { 64351 this.mode = Mode.NUMERIC; 64352 this.data = data.toString(); 64353 } 64354 NumericData.getBitsLength = function getBitsLength(length) { 64355 return 10 * Math.floor(length / 3) + (length % 3 ? length % 3 * 3 + 1 : 0); 64356 }; 64357 NumericData.prototype.getLength = function getLength() { 64358 return this.data.length; 64359 }; 64360 NumericData.prototype.getBitsLength = function getBitsLength() { 64361 return NumericData.getBitsLength(this.data.length); 64362 }; 64363 NumericData.prototype.write = function write2(bitBuffer2) { 64364 let i2, group, value; 64365 for (i2 = 0; i2 + 3 <= this.data.length; i2 += 3) { 64366 group = this.data.substr(i2, 3); 64367 value = parseInt(group, 10); 64368 bitBuffer2.put(value, 10); 64369 } 64370 const remainingNum = this.data.length - i2; 64371 if (remainingNum > 0) { 64372 group = this.data.substr(i2); 64373 value = parseInt(group, 10); 64374 bitBuffer2.put(value, remainingNum * 3 + 1); 64375 } 64376 }; 64377 numericData = NumericData; 64378 return numericData; 64379 } 64380 var alphanumericData; 64381 var hasRequiredAlphanumericData; 64382 function requireAlphanumericData() { 64383 if (hasRequiredAlphanumericData) return alphanumericData; 64384 hasRequiredAlphanumericData = 1; 64385 const Mode = requireMode(); 64386 const ALPHA_NUM_CHARS = [ 64387 "0", 64388 "1", 64389 "2", 64390 "3", 64391 "4", 64392 "5", 64393 "6", 64394 "7", 64395 "8", 64396 "9", 64397 "A", 64398 "B", 64399 "C", 64400 "D", 64401 "E", 64402 "F", 64403 "G", 64404 "H", 64405 "I", 64406 "J", 64407 "K", 64408 "L", 64409 "M", 64410 "N", 64411 "O", 64412 "P", 64413 "Q", 64414 "R", 64415 "S", 64416 "T", 64417 "U", 64418 "V", 64419 "W", 64420 "X", 64421 "Y", 64422 "Z", 64423 " ", 64424 "$", 64425 "%", 64426 "*", 64427 "+", 64428 "-", 64429 ".", 64430 "/", 64431 ":" 64432 ]; 64433 function AlphanumericData(data) { 64434 this.mode = Mode.ALPHANUMERIC; 64435 this.data = data; 64436 } 64437 AlphanumericData.getBitsLength = function getBitsLength(length) { 64438 return 11 * Math.floor(length / 2) + 6 * (length % 2); 64439 }; 64440 AlphanumericData.prototype.getLength = function getLength() { 64441 return this.data.length; 64442 }; 64443 AlphanumericData.prototype.getBitsLength = function getBitsLength() { 64444 return AlphanumericData.getBitsLength(this.data.length); 64445 }; 64446 AlphanumericData.prototype.write = function write2(bitBuffer2) { 64447 let i2; 64448 for (i2 = 0; i2 + 2 <= this.data.length; i2 += 2) { 64449 let value = ALPHA_NUM_CHARS.indexOf(this.data[i2]) * 45; 64450 value += ALPHA_NUM_CHARS.indexOf(this.data[i2 + 1]); 64451 bitBuffer2.put(value, 11); 64452 } 64453 if (this.data.length % 2) { 64454 bitBuffer2.put(ALPHA_NUM_CHARS.indexOf(this.data[i2]), 6); 64455 } 64456 }; 64457 alphanumericData = AlphanumericData; 64458 return alphanumericData; 64459 } 64460 var byteData; 64461 var hasRequiredByteData; 64462 function requireByteData() { 64463 if (hasRequiredByteData) return byteData; 64464 hasRequiredByteData = 1; 64465 const Mode = requireMode(); 64466 function ByteData(data) { 64467 this.mode = Mode.BYTE; 64468 if (typeof data === "string") { 64469 this.data = new TextEncoder().encode(data); 64470 } else { 64471 this.data = new Uint8Array(data); 64472 } 64473 } 64474 ByteData.getBitsLength = function getBitsLength(length) { 64475 return length * 8; 64476 }; 64477 ByteData.prototype.getLength = function getLength() { 64478 return this.data.length; 64479 }; 64480 ByteData.prototype.getBitsLength = function getBitsLength() { 64481 return ByteData.getBitsLength(this.data.length); 64482 }; 64483 ByteData.prototype.write = function(bitBuffer2) { 64484 for (let i2 = 0, l2 = this.data.length; i2 < l2; i2++) { 64485 bitBuffer2.put(this.data[i2], 8); 64486 } 64487 }; 64488 byteData = ByteData; 64489 return byteData; 64490 } 64491 var kanjiData; 64492 var hasRequiredKanjiData; 64493 function requireKanjiData() { 64494 if (hasRequiredKanjiData) return kanjiData; 64495 hasRequiredKanjiData = 1; 64496 const Mode = requireMode(); 64497 const Utils2 = requireUtils$1(); 64498 function KanjiData(data) { 64499 this.mode = Mode.KANJI; 64500 this.data = data; 64501 } 64502 KanjiData.getBitsLength = function getBitsLength(length) { 64503 return length * 13; 64504 }; 64505 KanjiData.prototype.getLength = function getLength() { 64506 return this.data.length; 64507 }; 64508 KanjiData.prototype.getBitsLength = function getBitsLength() { 64509 return KanjiData.getBitsLength(this.data.length); 64510 }; 64511 KanjiData.prototype.write = function(bitBuffer2) { 64512 let i2; 64513 for (i2 = 0; i2 < this.data.length; i2++) { 64514 let value = Utils2.toSJIS(this.data[i2]); 64515 if (value >= 33088 && value <= 40956) { 64516 value -= 33088; 64517 } else if (value >= 57408 && value <= 60351) { 64518 value -= 49472; 64519 } else { 64520 throw new Error( 64521 "Invalid SJIS character: " + this.data[i2] + "\nMake sure your charset is UTF-8" 64522 ); 64523 } 64524 value = (value >>> 8 & 255) * 192 + (value & 255); 64525 bitBuffer2.put(value, 13); 64526 } 64527 }; 64528 kanjiData = KanjiData; 64529 return kanjiData; 64530 } 64531 var dijkstra = { exports: {} }; 64532 var hasRequiredDijkstra; 64533 function requireDijkstra() { 64534 if (hasRequiredDijkstra) return dijkstra.exports; 64535 hasRequiredDijkstra = 1; 64536 (function(module) { 64537 var dijkstra2 = { 64538 single_source_shortest_paths: function(graph, s2, d2) { 64539 var predecessors = {}; 64540 var costs = {}; 64541 costs[s2] = 0; 64542 var open = dijkstra2.PriorityQueue.make(); 64543 open.push(s2, 0); 64544 var closest, u2, v2, cost_of_s_to_u, adjacent_nodes, cost_of_e, cost_of_s_to_u_plus_cost_of_e, cost_of_s_to_v, first_visit; 64545 while (!open.empty()) { 64546 closest = open.pop(); 64547 u2 = closest.value; 64548 cost_of_s_to_u = closest.cost; 64549 adjacent_nodes = graph[u2] || {}; 64550 for (v2 in adjacent_nodes) { 64551 if (adjacent_nodes.hasOwnProperty(v2)) { 64552 cost_of_e = adjacent_nodes[v2]; 64553 cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e; 64554 cost_of_s_to_v = costs[v2]; 64555 first_visit = typeof costs[v2] === "undefined"; 64556 if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) { 64557 costs[v2] = cost_of_s_to_u_plus_cost_of_e; 64558 open.push(v2, cost_of_s_to_u_plus_cost_of_e); 64559 predecessors[v2] = u2; 64560 } 64561 } 64562 } 64563 } 64564 if (typeof d2 !== "undefined" && typeof costs[d2] === "undefined") { 64565 var msg = ["Could not find a path from ", s2, " to ", d2, "."].join(""); 64566 throw new Error(msg); 64567 } 64568 return predecessors; 64569 }, 64570 extract_shortest_path_from_predecessor_list: function(predecessors, d2) { 64571 var nodes = []; 64572 var u2 = d2; 64573 while (u2) { 64574 nodes.push(u2); 64575 predecessors[u2]; 64576 u2 = predecessors[u2]; 64577 } 64578 nodes.reverse(); 64579 return nodes; 64580 }, 64581 find_path: function(graph, s2, d2) { 64582 var predecessors = dijkstra2.single_source_shortest_paths(graph, s2, d2); 64583 return dijkstra2.extract_shortest_path_from_predecessor_list( 64584 predecessors, 64585 d2 64586 ); 64587 }, 64588 /** 64589 * A very naive priority queue implementation. 64590 */ 64591 PriorityQueue: { 64592 make: function(opts) { 64593 var T = dijkstra2.PriorityQueue, t2 = {}, key; 64594 opts = opts || {}; 64595 for (key in T) { 64596 if (T.hasOwnProperty(key)) { 64597 t2[key] = T[key]; 64598 } 64599 } 64600 t2.queue = []; 64601 t2.sorter = opts.sorter || T.default_sorter; 64602 return t2; 64603 }, 64604 default_sorter: function(a2, b2) { 64605 return a2.cost - b2.cost; 64606 }, 64607 /** 64608 * Add a new item to the queue and ensure the highest priority element 64609 * is at the front of the queue. 64610 */ 64611 push: function(value, cost) { 64612 var item = { value, cost }; 64613 this.queue.push(item); 64614 this.queue.sort(this.sorter); 64615 }, 64616 /** 64617 * Return the highest priority element in the queue. 64618 */ 64619 pop: function() { 64620 return this.queue.shift(); 64621 }, 64622 empty: function() { 64623 return this.queue.length === 0; 64624 } 64625 } 64626 }; 64627 { 64628 module.exports = dijkstra2; 64629 } 64630 })(dijkstra); 64631 return dijkstra.exports; 64632 } 64633 var hasRequiredSegments; 64634 function requireSegments() { 64635 if (hasRequiredSegments) return segments; 64636 hasRequiredSegments = 1; 64637 (function(exports) { 64638 const Mode = requireMode(); 64639 const NumericData = requireNumericData();
64640 const AlphanumericData = requireAlphanumericData(); 64641 const ByteData = requireByteData(); 64642 const KanjiData = requireKanjiData(); 64643 const Regex = requireRegex(); 64644 const Utils2 = requireUtils$1(); 64645 const dijkstra2 = requireDijkstra(); 64646 function getStringByteLength(str) { 64647 return unescape(encodeURIComponent(str)).length; 64648 } 64649 function getSegments(regex2, mode2, str) { 64650 const segments2 = []; 64651 let result; 64652 while ((result = regex2.exec(str)) !== null) { 64653 segments2.push({ 64654 data: result[0], 64655 index: result.index, 64656 mode: mode2, 64657 length: result[0].length 64658 }); 64659 } 64660 return segments2; 64661 } 64662 function getSegmentsFromString(dataStr) { 64663 const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr); 64664 const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr); 64665 let byteSegs; 64666 let kanjiSegs; 64667 if (Utils2.isKanjiModeEnabled()) { 64668 byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr); 64669 kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr); 64670 } else { 64671 byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr); 64672 kanjiSegs = []; 64673 } 64674 const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs); 64675 return segs.sort(function(s1, s2) { 64676 return s1.index - s2.index; 64677 }).map(function(obj) { 64678 return { 64679 data: obj.data, 64680 mode: obj.mode, 64681 length: obj.length 64682 }; 64683 }); 64684 } 64685 function getSegmentBitsLength(length, mode2) { 64686 switch (mode2) { 64687 case Mode.NUMERIC: 64688 return NumericData.getBitsLength(length); 64689 case Mode.ALPHANUMERIC: 64690 return AlphanumericData.getBitsLength(length); 64691 case Mode.KANJI: 64692 return KanjiData.getBitsLength(length); 64693 case Mode.BYTE: 64694 return ByteData.getBitsLength(length); 64695 } 64696 } 64697 function mergeSegments(segs) { 64698 return segs.reduce(function(acc, curr) { 64699 const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null; 64700 if (prevSeg && prevSeg.mode === curr.mode) { 64701 acc[acc.length - 1].data += curr.data; 64702 return acc; 64703 } 64704 acc.push(curr); 64705 return acc; 64706 }, []); 64707 } 64708 function buildNodes(segs) { 64709 const nodes = []; 64710 for (let i2 = 0; i2 < segs.length; i2++) { 64711 const seg = segs[i2]; 64712 switch (seg.mode) { 64713 case Mode.NUMERIC: 64714 nodes.push([ 64715 seg, 64716 { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length }, 64717 { data: seg.data, mode: Mode.BYTE, length: seg.length } 64718 ]); 64719 break; 64720 case Mode.ALPHANUMERIC: 64721 nodes.push([ 64722 seg, 64723 { data: seg.data, mode: Mode.BYTE, length: seg.length } 64724 ]); 64725 break; 64726 case Mode.KANJI: 64727 nodes.push([ 64728 seg, 64729 { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) } 64730 ]); 64731 break; 64732 case Mode.BYTE: 64733 nodes.push([ 64734 { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) } 64735 ]); 64736 } 64737 } 64738 return nodes; 64739 } 64740 function buildGraph(nodes, version2) { 64741 const table = {}; 64742 const graph = { start: {} }; 64743 let prevNodeIds = ["start"]; 64744 for (let i2 = 0; i2 < nodes.length; i2++) { 64745 const nodeGroup = nodes[i2]; 64746 const currentNodeIds = []; 64747 for (let j2 = 0; j2 < nodeGroup.length; j2++) { 64748 const node = nodeGroup[j2]; 64749 const key = "" + i2 + j2; 64750 currentNodeIds.push(key); 64751 table[key] = { node, lastCount: 0 }; 64752 graph[key] = {}; 64753 for (let n2 = 0; n2 < prevNodeIds.length; n2++) { 64754 const prevNodeId = prevNodeIds[n2]; 64755 if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) { 64756 graph[prevNodeId][key] = getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node.mode); 64757 table[prevNodeId].lastCount += node.length; 64758 } else { 64759 if (table[prevNodeId]) table[prevNodeId].lastCount = node.length; 64760 graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) + 4 + Mode.getCharCountIndicator(node.mode, version2); 64761 } 64762 } 64763 } 64764 prevNodeIds = currentNodeIds; 64765 } 64766 for (let n2 = 0; n2 < prevNodeIds.length; n2++) { 64767 graph[prevNodeIds[n2]].end = 0; 64768 } 64769 return { map: graph, table }; 64770 } 64771 function buildSingleSegment(data, modesHint) { 64772 let mode2; 64773 const bestMode = Mode.getBestModeForData(data); 64774 mode2 = Mode.from(modesHint, bestMode); 64775 if (mode2 !== Mode.BYTE && mode2.bit < bestMode.bit) { 64776 throw new Error('"' + data + '" cannot be encoded with mode ' + Mode.toString(mode2) + ".\n Suggested mode is: " + Mode.toString(bestMode)); 64777 } 64778 if (mode2 === Mode.KANJI && !Utils2.isKanjiModeEnabled()) { 64779 mode2 = Mode.BYTE; 64780 } 64781 switch (mode2) { 64782 case Mode.NUMERIC: 64783 return new NumericData(data); 64784 case Mode.ALPHANUMERIC: 64785 return new AlphanumericData(data); 64786 case Mode.KANJI: 64787 return new KanjiData(data); 64788 case Mode.BYTE: 64789 return new ByteData(data); 64790 } 64791 } 64792 exports.fromArray = function fromArray(array) { 64793 return array.reduce(function(acc, seg) { 64794 if (typeof seg === "string") { 64795 acc.push(buildSingleSegment(seg, null)); 64796 } else if (seg.data) { 64797 acc.push(buildSingleSegment(seg.data, seg.mode)); 64798 } 64799 return acc; 64800 }, []); 64801 }; 64802 exports.fromString = function fromString(data, version2) { 64803 const segs = getSegmentsFromString(data, Utils2.isKanjiModeEnabled()); 64804 const nodes = buildNodes(segs); 64805 const graph = buildGraph(nodes, version2); 64806 const path = dijkstra2.find_path(graph.map, "start", "end"); 64807 const optimizedSegs = []; 64808 for (let i2 = 1; i2 < path.length - 1; i2++) { 64809 optimizedSegs.push(graph.table[path[i2]].node); 64810 } 64811 return exports.fromArray(mergeSegments(optimizedSegs)); 64812 }; 64813 exports.rawSplit = function rawSplit(data) { 64814 return exports.fromArray( 64815 getSegmentsFromString(data, Utils2.isKanjiModeEnabled()) 64816 ); 64817 }; 64818 })(segments); 64819 return segments; 64820 } 64821 var hasRequiredQrcode; 64822 function requireQrcode() { 64823 if (hasRequiredQrcode) return qrcode; 64824 hasRequiredQrcode = 1; 64825 const Utils2 = requireUtils$1(); 64826 const ECLevel = requireErrorCorrectionLevel(); 64827 const BitBuffer = requireBitBuffer(); 64828 const BitMatrix = requireBitMatrix(); 64829 const AlignmentPattern = requireAlignmentPattern(); 64830 const FinderPattern = requireFinderPattern(); 64831 const MaskPattern = requireMaskPattern(); 64832 const ECCode = requireErrorCorrectionCode(); 64833 const ReedSolomonEncoder = requireReedSolomonEncoder(); 64834 const Version = requireVersion(); 64835 const FormatInfo = requireFormatInfo(); 64836 const Mode = requireMode(); 64837 const Segments = requireSegments(); 64838 function setupFinderPattern(matrix, version2) { 64839 const size = matrix.size; 64840 const pos = FinderPattern.getPositions(version2); 64841 for (let i2 = 0; i2 < pos.length; i2++) {
64842 const row = pos[i2][0]; 64843 const col = pos[i2][1]; 64844 for (let r2 = -1; r2 <= 7; r2++) { 64845 if (row + r2 <= -1 || size <= row + r2) continue; 64846 for (let c2 = -1; c2 <= 7; c2++) { 64847 if (col + c2 <= -1 || size <= col + c2) continue; 64848 if (r2 >= 0 && r2 <= 6 && (c2 === 0 || c2 === 6) || c2 >= 0 && c2 <= 6 && (r2 === 0 || r2 === 6) || r2 >= 2 && r2 <= 4 && c2 >= 2 && c2 <= 4) { 64849 matrix.set(row + r2, col + c2, true, true); 64850 } else { 64851 matrix.set(row + r2, col + c2, false, true); 64852 } 64853 } 64854 } 64855 } 64856 } 64857 function setupTimingPattern(matrix) { 64858 const size = matrix.size; 64859 for (let r2 = 8; r2 < size - 8; r2++) { 64860 const value = r2 % 2 === 0; 64861 matrix.set(r2, 6, value, true); 64862 matrix.set(6, r2, value, true); 64863 } 64864 } 64865 function setupAlignmentPattern(matrix, version2) { 64866 const pos = AlignmentPattern.getPositions(version2); 64867 for (let i2 = 0; i2 < pos.length; i2++) { 64868 const row = pos[i2][0]; 64869 const col = pos[i2][1]; 64870 for (let r2 = -2; r2 <= 2; r2++) { 64871 for (let c2 = -2; c2 <= 2; c2++) { 64872 if (r2 === -2 || r2 === 2 || c2 === -2 || c2 === 2 || r2 === 0 && c2 === 0) { 64873 matrix.set(row + r2, col + c2, true, true); 64874 } else { 64875 matrix.set(row + r2, col + c2, false, true); 64876 } 64877 } 64878 } 64879 } 64880 } 64881 function setupVersionInfo(matrix, version2) { 64882 const size = matrix.size; 64883 const bits = Version.getEncodedBits(version2); 64884 let row, col, mod; 64885 for (let i2 = 0; i2 < 18; i2++) { 64886 row = Math.floor(i2 / 3); 64887 col = i2 % 3 + size - 8 - 3; 64888 mod = (bits >> i2 & 1) === 1; 64889 matrix.set(row, col, mod, true); 64890 matrix.set(col, row, mod, true); 64891 } 64892 } 64893 function setupFormatInfo(matrix, errorCorrectionLevel2, maskPattern2) { 64894 const size = matrix.size; 64895 const bits = FormatInfo.getEncodedBits(errorCorrectionLevel2, maskPattern2); 64896 let i2, mod; 64897 for (i2 = 0; i2 < 15; i2++) { 64898 mod = (bits >> i2 & 1) === 1; 64899 if (i2 < 6) { 64900 matrix.set(i2, 8, mod, true); 64901 } else if (i2 < 8) { 64902 matrix.set(i2 + 1, 8, mod, true); 64903 } else { 64904 matrix.set(size - 15 + i2, 8, mod, true); 64905 } 64906 if (i2 < 8) { 64907 matrix.set(8, size - i2 - 1, mod, true); 64908 } else if (i2 < 9) { 64909 matrix.set(8, 15 - i2 - 1 + 1, mod, true); 64910 } else { 64911 matrix.set(8, 15 - i2 - 1, mod, true); 64912 } 64913 } 64914 matrix.set(size - 8, 8, 1, true); 64915 } 64916 function setupData(matrix, data) { 64917 const size = matrix.size; 64918 let inc = -1; 64919 let row = size - 1; 64920 let bitIndex = 7; 64921 let byteIndex = 0; 64922 for (let col = size - 1; col > 0; col -= 2) { 64923 if (col === 6) col--; 64924 while (true) { 64925 for (let c2 = 0; c2 < 2; c2++) { 64926 if (!matrix.isReserved(row, col - c2)) { 64927 let dark2 = false; 64928 if (byteIndex < data.length) { 64929 dark2 = (data[byteIndex] >>> bitIndex & 1) === 1; 64930 } 64931 matrix.set(row, col - c2, dark2); 64932 bitIndex--; 64933 if (bitIndex === -1) { 64934 byteIndex++; 64935 bitIndex = 7; 64936 } 64937 } 64938 } 64939 row += inc; 64940 if (row < 0 || size <= row) { 64941 row -= inc; 64942 inc = -inc; 64943 break; 64944 } 64945 } 64946 } 64947 } 64948 function createData(version2, errorCorrectionLevel2, segments2) { 64949 const buffer = new BitBuffer(); 64950 segments2.forEach(function(data) { 64951 buffer.put(data.mode.bit, 4); 64952 buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version2)); 64953 data.write(buffer); 64954 }); 64955 const totalCodewords = Utils2.getSymbolTotalCodewords(version2); 64956 const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); 64957 const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8;
64958 if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) { 64959 buffer.put(0, 4); 64960 } 64961 while (buffer.getLengthInBits() % 8 !== 0) { 64962 buffer.putBit(0); 64963 } 64964 const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8; 64965 for (let i2 = 0; i2 < remainingByte; i2++) { 64966 buffer.put(i2 % 2 ? 17 : 236, 8); 64967 } 64968 return createCodewords(buffer, version2, errorCorrectionLevel2); 64969 } 64970 function createCodewords(bitBuffer2, version2, errorCorrectionLevel2) { 64971 const totalCodewords = Utils2.getSymbolTotalCodewords(version2); 64972 const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); 64973 const dataTotalCodewords = totalCodewords - ecTotalCodewords; 64974 const ecTotalBlocks = ECCode.getBlocksCount(version2, errorCorrectionLevel2); 64975 const blocksInGroup2 = totalCodewords % ecTotalBlocks; 64976 const blocksInGroup1 = ecTotalBlocks - blocksInGroup2; 64977 const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks); 64978 const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks); 64979 const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1; 64980 const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1; 64981 const rs = new ReedSolomonEncoder(ecCount); 64982 let offset = 0; 64983 const dcData = new Array(ecTotalBlocks); 64984 const ecData = new Array(ecTotalBlocks); 64985 let maxDataSize = 0; 64986 const buffer = new Uint8Array(bitBuffer2.buffer); 64987 for (let b2 = 0; b2 < ecTotalBlocks; b2++) { 64988 const dataSize = b2 < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2; 64989 dcData[b2] = buffer.slice(offset, offset + dataSize); 64990 ecData[b2] = rs.encode(dcData[b2]); 64991 offset += dataSize; 64992 maxDataSize = Math.max(maxDataSize, dataSize); 64993 } 64994 const data = new Uint8Array(totalCodewords); 64995 let index = 0; 64996 let i2, r2; 64997 for (i2 = 0; i2 < maxDataSize; i2++) { 64998 for (r2 = 0; r2 < ecTotalBlocks; r2++) { 64999 if (i2 < dcData[r2].length) { 65000 data[index++] = dcData[r2][i2]; 65001 } 65002 } 65003 } 65004 for (i2 = 0; i2 < ecCount; i2++) { 65005 for (r2 = 0; r2 < ecTotalBlocks; r2++) { 65006 data[index++] = ecData[r2][i2]; 65007 } 65008 } 65009 return data; 65010 } 65011 function createSymbol(data, version2, errorCorrectionLevel2, maskPattern2) { 65012 let segments2; 65013 if (Array.isArray(data)) { 65014 segments2 = Segments.fromArray(data); 65015 } else if (typeof data === "string") { 65016 let estimatedVersion = version2; 65017 if (!estimatedVersion) { 65018 const rawSegments = Segments.rawSplit(data); 65019 estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel2); 65020 } 65021 segments2 = Segments.fromString(data, estimatedVersion || 40); 65022 } else { 65023 throw new Error("Invalid data"); 65024 } 65025 const bestVersion = Version.getBestVersionForData(segments2, errorCorrectionLevel2); 65026 if (!bestVersion) { 65027 throw new Error("The amount of data is too big to be stored in a QR Code"); 65028 } 65029 if (!version2) { 65030 version2 = bestVersion; 65031 } else if (version2 < bestVersion) { 65032 throw new Error( 65033 "\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + bestVersion + ".\n" 65034 ); 65035 } 65036 const dataBits = createData(version2, errorCorrectionLevel2, segments2); 65037 const moduleCount = Utils2.getSymbolSize(version2); 65038 const modules2 = new BitMatrix(moduleCount); 65039 setupFinderPattern(modules2, version2); 65040 setupTimingPattern(modules2); 65041 setupAlignmentPattern(modules2, version2); 65042 setupFormatInfo(modules2, errorCorrectionLevel2, 0); 65043 if (version2 >= 7) { 65044 setupVersionInfo(modules2, version2); 65045 } 65046 setupData(modules2, dataBits); 65047 if (isNaN(maskPattern2)) { 65048 maskPattern2 = MaskPattern.getBestMask( 65049 modules2, 65050 setupFormatInfo.bind(null, modules2, errorCorrectionLevel2) 65051 ); 65052 } 65053 MaskPattern.applyMask(maskPattern2, modules2); 65054 setupFormatInfo(modules2, errorCorrectionLevel2, maskPattern2); 65055 return { 65056 modules: modules2, 65057 version: version2, 65058 errorCorrectionLevel: errorCorrectionLevel2, 65059 maskPattern: maskPattern2, 65060 segments: segments2 65061 }; 65062 } 65063 qrcode.create = function create2(data, options) { 65064 if (typeof data === "undefined" || data === "") { 65065 throw new Error("No input text"); 65066 } 65067 let errorCorrectionLevel2 = ECLevel.M; 65068 let version2; 65069 let mask; 65070 if (typeof options !== "undefined") { 65071 errorCorrectionLevel2 = ECLevel.from(options.errorCorrectionLevel, ECLevel.M); 65072 version2 = Version.from(options.version); 65073 mask = MaskPattern.from(options.maskPattern); 65074 if (options.toSJISFunc) { 65075 Utils2.setToSJISFunction(options.toSJISFunc); 65076 } 65077 } 65078 return createSymbol(data, version2, errorCorrectionLevel2, mask); 65079 }; 65080 return qrcode; 65081 } 65082 var canvas = {}; 65083 var utils = {}; 65084 var hasRequiredUtils; 65085 function requireUtils() { 65086 if (hasRequiredUtils) return utils; 65087 hasRequiredUtils = 1; 65088 (function(exports) { 65089 function hex2rgba(hex) { 65090 if (typeof hex === "number") { 65091 hex = hex.toString(); 65092 } 65093 if (typeof hex !== "string") { 65094 throw new Error("Color should be defined as hex string"); 65095 } 65096 let hexCode = hex.slice().replace("#", "").split(""); 65097 if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) { 65098 throw new Error("Invalid hex color: " + hex); 65099 } 65100 if (hexCode.length === 3 || hexCode.length === 4) { 65101 hexCode = Array.prototype.concat.apply([], hexCode.map(function(c2) { 65102 return [c2, c2]; 65103 })); 65104 } 65105 if (hexCode.length === 6) hexCode.push("F", "F"); 65106 const hexValue = parseInt(hexCode.join(""), 16); 65107 return { 65108 r: hexValue >>
65108 24 & 255, 65109 g: hexValue >> 16 & 255, 65110 b: hexValue >> 8 & 255, 65111 a: hexValue & 255, 65112 hex: "#" + hexCode.slice(0, 6).join("") 65113 }; 65114 } 65115 exports.getOptions = function getOptions(options) { 65116 if (!options) options = {}; 65117 if (!options.color) options.color = {}; 65118 const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin; 65119 const width = options.width && options.width >= 21 ? options.width : void 0; 65120 const scale = options.scale || 4; 65121 return { 65122 width, 65123 scale: width ? 4 : scale, 65124 margin, 65125 color: { 65126 dark: hex2rgba(options.color.dark || "#000000ff"), 65127 light: hex2rgba(options.color.light || "#ffffffff") 65128 }, 65129 type: options.type, 65130 rendererOpts: options.rendererOpts || {} 65131 }; 65132 }; 65133 exports.getScale = function getScale(qrSize, opts) { 65134 return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale; 65135 }; 65136 exports.getImageWidth = function getImageWidth(qrSize, opts) { 65137 const scale = exports.getScale(qrSize, opts); 65138 return Math.floor((qrSize + opts.margin * 2) * scale); 65139 }; 65140 exports.qrToImageData = function qrToImageData(imgData, qr, opts) { 65141 const size = qr.modules.size; 65142 const data = qr.modules.data; 65143 const scale = exports.getScale(size, opts); 65144 const symbolSize = Math.floor((size + opts.margin * 2) * scale); 65145 const scaledMargin = opts.margin * scale; 65146 const palette = [opts.color.light, opts.color.dark]; 65147 for (let i2 = 0; i2 < symbolSize; i2++) { 65148 for (let j2 = 0; j2 < symbolSize; j2++) { 65149 let posDst = (i2 * symbolSize + j2) * 4; 65150 let pxColor = opts.color.light; 65151 if (i2 >= scaledMargin && j2 >= scaledMargin && i2 < symbolSize - scaledMargin && j2 < symbolSize - scaledMargin) { 65152 const iSrc = Math.floor((i2 - scaledMargin) / scale); 65153 const jSrc = Math.floor((j2 - scaledMargin) / scale); 65154 pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0]; 65155 } 65156 imgData[posDst++] = pxColor.r; 65157 imgData[posDst++] = pxColor.g; 65158 imgData[posDst++] = pxColor.b; 65159 imgData[posDst] = pxColor.a; 65160 } 65161 } 65162 }; 65163 })(utils); 65164 return utils; 65165 } 65166 var hasRequiredCanvas; 65167 function requireCanvas() { 65168 if (hasRequiredCanvas) return canvas; 65169 hasRequiredCanvas = 1; 65170 (function(exports) { 65171 const Utils2 = requireUtils(); 65172 function clearCanvas(ctx, canvas2, size) { 65173 ctx.clearRect(0, 0, canvas2.width, canvas2.height); 65174 if (!canvas2.style) canvas2.style = {}; 65175 canvas2.height = size; 65176 canvas2.width = size; 65177 canvas2.style.height = size + "px"; 65178 canvas2.style.width = size + "px"; 65179 } 65180 function getCanvasElement() { 65181 try { 65182 return document.createElement("canvas"); 65183 } catch (e2) { 65184 throw new Error("You need to specify a canvas element"); 65185 } 65186 } 65187 exports.render = function render(qrData, canvas2, options) { 65188 let opts = options; 65189 let canvasEl = canvas2; 65190 if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { 65191 opts = canvas2; 65192 canvas2 = void 0; 65193 } 65194 if (!canvas2) { 65195 canvasEl = getCanvasElement(); 65196 } 65197 opts = Utils2.getOptions(opts); 65198 const size = Utils2.getImageWidth(qrData.modules.size, opts); 65199 const ctx = canvasEl.getContext("2d"); 65200 const image = ctx.createImageData(size, size); 65201 Utils2.qrToImageData(image.data, qrData, opts); 65202 clearCanvas(ctx, canvasEl, size); 65203 ctx.putImageData(image, 0, 0); 65204 return canvasEl; 65205 }; 65206 exports.renderToDataURL = function renderToDataURL(qrData, canvas2, options) { 65207 let opts = options; 65208 if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { 65209 opts = canvas2; 65210 canvas2 = void 0; 65211 } 65212 if (!opts) opts = {}; 65213 const canvasEl = exports.render(qrData, canvas2, opts); 65214 const type = opts.type || "image/png"; 65215 const rendererOpts = opts.rendererOpts || {}; 65216 return canvasEl.toDataURL(type, rendererOpts.quality); 65217 }; 65218 })(canvas); 65219 return canvas; 65220 } 65221 var svgTag = {}; 65222 var hasRequiredSvgTag; 65223 function requireSvgTag() { 65224 if (hasRequiredSvgTag) return svgTag; 65225 hasRequiredSvgTag = 1; 65226 const Utils2 = requireUtils(); 65227 function getColorAttrib(color, attrib) {
65228 const alpha = color.a / 255; 65229 const str = attrib + '="' + color.hex + '"'; 65230 return alpha < 1 ? str + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str; 65231 } 65232 function svgCmd(cmd, x2, y2) { 65233 let str = cmd + x2; 65234 if (typeof y2 !== "undefined") str += " " + y2; 65235 return str; 65236 } 65237 function qrToPath(data, size, margin) { 65238 let path = ""; 65239 let moveBy = 0; 65240 let newRow = false; 65241 let lineLength = 0; 65242 for (let i2 = 0; i2 < data.length; i2++) { 65243 const col = Math.floor(i2 % size); 65244 const row = Math.floor(i2 / size); 65245 if (!col && !newRow) newRow = true; 65246 if (data[i2]) { 65247 lineLength++; 65248 if (!(i2 > 0 && col > 0 && data[i2 - 1])) { 65249 path += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0); 65250 moveBy = 0; 65251 newRow = false; 65252 } 65253 if (!(col + 1 < size && data[i2 + 1])) { 65254 path += svgCmd("h", lineLength); 65255 lineLength = 0; 65256 } 65257 } else { 65258 moveBy++; 65259 } 65260 } 65261 return path; 65262 } 65263 svgTag.render = function render(qrData, options, cb) { 65264 const opts = Utils2.getOptions(options); 65265 const size = qrData.modules.size; 65266 const data = qrData.modules.data; 65267 const qrcodesize = size + opts.margin * 2; 65268 const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + ' d="M0 0h' + qrcodesize + "v" + qrcodesize + 'H0z"/>'; 65269 const path = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size, opts.margin) + '"/>'; 65270 const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"'; 65271 const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" '; 65272 const svgTag2 = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path + "</svg>\n"; 65273 if (typeof cb === "function") { 65274 cb(null, svgTag2); 65275 } 65276 return svgTag2; 65277 }; 65278 return svgTag; 65279 } 65280 var hasRequiredBrowser; 65281 function requireBrowser() { 65282 if (hasRequiredBrowser) return browser; 65283 hasRequiredBrowser = 1; 65284 const canPromise2 = requireCanPromise(); 65285 const QRCode2 = requireQrcode(); 65286 const CanvasRenderer = requireCanvas(); 65287 const SvgRenderer = requireSvgTag(); 65288 function renderCanvas(renderFunc, canvas2, text, opts, cb) { 65289 const args = [].slice.call(arguments, 1); 65290 const argsNum = args.length; 65291 const isLastArgCb = typeof args[argsNum - 1] === "function"; 65292 if (!isLastArgCb && !canPromise2()) { 65293 throw new Error("Callback required as last argument"); 65294 } 65295 if (isLastArgCb) { 65296 if (argsNum < 2) { 65297 throw new Error("Too few arguments provided"); 65298 } 65299 if (argsNum === 2) { 65300 cb = text; 65301 text = canvas2; 65302 canvas2 = opts = void 0; 65303 } else if (argsNum === 3) { 65304 if (canvas2.getContext && typeof cb === "undefined") { 65305 cb = opts; 65306 opts = void 0; 65307 } else { 65308 cb = opts; 65309 opts = text; 65310 text = canvas2; 65311 canvas2 = void 0; 65312 } 65313 } 65314 } else { 65315 if (argsNum < 1) { 65316 throw new Error("Too few arguments provided"); 65317 } 65318 if (argsNum === 1) { 65319 text = canvas2; 65320 canvas2 = opts = void 0; 65321 } else if (argsNum === 2 && !canvas2.getContext) { 65322 opts = text; 65323 text = canvas2; 65324 canvas2 = void 0; 65325 } 65326 return new Promise(function(resolve, reject) { 65327 try { 65328 const data = QRCode2.create(text, opts); 65329 resolve(renderFunc(data, canvas2, opts)); 65330 } catch (e2) { 65331 reject(e2); 65332 } 65333 }); 65334 } 65335 try { 65336 const data = QRCode2.create(text, opts); 65337 cb(null, renderFunc(data, canvas2, opts)); 65338 } catch (e2) { 65339 cb(e2); 65340 } 65341 } 65342 browser.create = QRCode2.create; 65343 browser.toCanvas = renderCanvas.bind(null, CanvasRenderer.render); 65344 browser.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL); 65345 browser.toString = renderCanvas.bind(null, function(data, _2, opts) {
65346 return SvgRenderer.render(data, opts); 65347 }); 65348 return browser; 65349 } 65350 var browserExports = requireBrowser(); 65351 const QRCode = /* @__PURE__ */ getDefaultExportFromCjs(browserExports); 65352 function getLuminance(color) { 65353 const rgbArr = colorToRgbArray(color); 65354 const [r2, g2, b2] = rgbArr.map((c2) => { 65355 const sRGB = c2 / 255; 65356 return sRGB <= 0.03928 ? sRGB / 12.92 : Math.pow((sRGB + 0.055) / 1.055, 2.4); 65357 }); 65358 return 0.2126 * r2 + 0.7152 * g2 + 0.0722 * b2; 65359 } 65360 function colorToRgbArray(color) { 65361 const rgb = colorToRgb(color); 65362 const rgbArr = rgb.match(/\d+/g)?.map(Number); 65363 if (!rgbArr || rgbArr.length !== 3) { 65364 throw new Error("Invalid color format"); 65365 } 65366 return rgbArr; 65367 } 65368 function rgbaToRgb(color) { 65369 const rgb = color.match(/\d+/g)?.map(Number); 65370 if (!rgb || rgb.length !== 3) { 65371 throw new Error("Invalid color format"); 65372 } 65373 return `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`; 65374 } 65375 function hexToRgb(color) { 65376 color = color.replace(/^#/, ""); 65377 if (color.length === 3) { 65378 color = color.split("").map((c2) => c2 + c2).join(""); 65379 } 65380 const rgb = color.match(/\w\w/g)?.map((c2) => parseInt(c2, 16)); 65381 if (!rgb || rgb.length !== 3) { 65382 throw new Error("Invalid color format"); 65383 } 65384 return `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`; 65385 } 65386 function colorToRgb(color) { 65387 if (color.includes("rgba")) { 65388 return rgbaToRgb(color); 65389 } else if (color.includes("#")) { 65390 return hexToRgb(color); 65391 } else { 65392 return color; 65393 } 65394 } 65395 function rgbToHex(color) { 65396 const rgb = color.match(/\d+/g)?.map(Number); 65397 if (!rgb || rgb.length !== 3) { 65398 throw new Error("Invalid color format"); 65399 } 65400 return `#${rgb.map((c2) => c2.toString(16).padStart(2, "0")).join("")}`; 65401 } 65402 function colorToHex(color) { 65403 if (color.includes("rgba")) { 65404 return rgbToHex(rgbaToRgb(color)); 65405 } else if (color.includes("rgb")) { 65406 return rgbToHex(color); 65407 } else { 65408 return color; 65409 } 65410 } 65411 function getContrastRatio(color1, color2) { 65412 const luminance1 = getLuminance(color1); 65413 const luminance2 = getLuminance(color2); 65414 return (Math.max(luminance1, luminance2) + 0.05) / (Math.min(luminance1, luminance2) + 0.05); 65415 } 65416 function darkenColor(color, weight) { 65417 const rgbArr = colorToRgbArray(color); 65418 const darkened = rgbArr.map((c2) => Math.round(c2 * (1 - weight))); 65419 return `rgb(${darkened[0]}, ${darkened[1]}, ${darkened[2]})`; 65420 } 65421 function lightenColor(color, weight) { 65422 const rgbArr = colorToRgbArray(color); 65423 const lightened = rgbArr.map((c2) => Math.round(c2 + (255 - c2) * weight)); 65424 return `rgb(${lightened[0]}, ${lightened[1]}, ${lightened[2]})`; 65425 } 65426 var __defProp$Q = Object.defineProperty; 65427 var __getOwnPropDesc$T = Object.getOwnPropertyDescriptor; 65428 var __decorateClass$T = (decorators, target, key, kind) => { 65429 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$T(target, key) : target; 65430 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 65431 if (decorator = decorators[i2]) 65432 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 65433 if (kind && result) __defProp$Q(target, key, result); 65434 return result; 65435 }; 65436 const tagName$F = "sonic-qrcode"; 65437 let SonicQRcode = class extends Subscriber$1(i$6) { 65438 constructor() { 65439 super(...arguments); 65440 this._resizeController = new h$1(this, {}); 65441 this.barcode = ""; 65442 this.margin = 1; 65443 this.makeContrastReachThreshold = (light2, dark2, threshold = 7) => { 65444 const contrast = getContrastRatio(light2, dark2); 65445 if (contrast < threshold) { 65446 light2 = lightenColor(light2, getLuminance(light2)); 65447 dark2 = darkenColor(dark2, getLuminance(dark2)); 65448 return this.makeContrastReachThreshold(light2, dark2, threshold); 65449 } 65450 return { light: light2, dark: dark2 }; 65451 }; 65452 } 65453 updated(_changedProperties) { 65454 const computedStyle = getComputedStyle(this); 65455 let light2 = computedStyle.getPropertyValue("background-color"); 65456 let dark2 = computedStyle.getPropertyValue("color"); 65457 if (getLuminance(light2) < getLuminance(dark2)) { 65458 [light2, dark2] = [dark2, light2]; 65459 } 65460 const contrastThreshold = 7;
65461 ({ light: light2, dark: dark2 } = this.makeContrastReachThreshold(light2, dark2, contrastThreshold)); 65462 const generateQR = async (text2) => { 65463 try { 65464 await QRCode.toCanvas(this.qrcodeEl, text2, { 65465 margin: this.margin, 65466 width: this.qrcodecontainerEl.clientWidth, 65467 color: { 65468 dark: colorToHex(dark2), 65469 light: colorToHex(light2) 65470 } 65471 }); 65472 } catch (err) { 65473 console.error(err); 65474 } 65475 }; 65476 const text = this.qrCodeContent || this.barcode; 65477 if (text) { 65478 generateQR(text); 65479 } 65480 super.updated(_changedProperties); 65481 } 65482 render() { 65483 return b$1` 65484 <div id="qrcodecontainer" class="canvas-container"> 65485 <canvas id="qrcode"></canvas> 65486 </div> 65487 `; 65488 } 65489 }; 65490 SonicQRcode.styles = [ 65491 // language=CSS 65492 i$9` 65493 :host { 65494 display: block; 65495 width: 100%; 65496 background-color: var(--sc-base, #fff); 65497 color: var(--sc-base-content, #000); 65498 } 65499 65500 .canvas-container { 65501 aspect-ratio: 1 / 1; 65502 } 65503 65504 canvas { 65505 display: block; 65506 width: 100% !important; 65507 height: auto !important; 65508 } 65509 ` 65510 ]; 65511 __decorateClass$T([ 65512 n$5({ type: String }) 65513 ], SonicQRcode.prototype, "barcode", 2); 65514 __decorateClass$T([ 65515 n$5({ type: Number }) 65516 ], SonicQRcode.prototype, "margin", 2); 65517 __decorateClass$T([ 65518 n$5({ type: String }) 65519 ], SonicQRcode.prototype, "qrCodeContent", 2); 65520 __decorateClass$T([ 65521 e$7("#qrcode") 65522 ], SonicQRcode.prototype, "qrcodeEl", 2); 65523 __decorateClass$T([ 65524 e$7("#qrcodecontainer") 65525 ], SonicQRcode.prototype, "qrcodecontainerEl", 2); 65526 SonicQRcode = __decorateClass$T([ 65527 t$3(tagName$F) 65528 ], SonicQRcode); 65529 var __defProp$P = Object.defineProperty; 65530 var __getOwnPropDesc$S = Object.getOwnPropertyDescriptor; 65531 var __decorateClass$S = (decorators, target, key, kind) => { 65532 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$S(target, key) : target; 65533 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 65534 if (decorator = decorators[i2]) 65535 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 65536 if (kind && result) __defProp$P(target, key, result); 65537 return result; 65538 }; 65539 const tagName$E = "sonic-ticket"; 65540 let SonicTicket = class extends Subscriber$1(i$6) { 65541 constructor() { 65542 super(...arguments); 65543 this.entity = {}; 65544 this.created = 0; 65545 this.event = {}; 65546 this.price = {}; 65547 this.owner = {}; 65548 this.barcode = ""; 65549 this.subscribe = {}; 65550 this.giftcard = {}; 65551 this.refund = {}; 65552 this.cancelable = false; 65553 this.barcodeMode = "qrcode"; 65554 this.skeleton = false; 65555 } 65556 renderPlacement() { 65557 if (!this.event?.placement) return A$1; 65558 const content = placementToString(this.event?.placement); 65559 if (!content) return A$1; 65560 return b$1`<sonic-ticket-info 65561 class="text-sm" 65562 label=${t("ticket_placement")} 65563 content="${content}" 65564 ></sonic-ticket-info> `; 65565 } 65566 render() { 65567 if (this.skeleton) return b$1`${this.render_skeleton()}`; 65568 const entityType = this.props?.entity_type; 65569 const displayBarcode = this.refund.status != "pending" && this.refund.status != "accepted" && !this.price.isCountermark; 65570 return b$1` <div> 65571 <div class=" mb-6 pt-3 px-3 lg:px-6"> 65572 <div class="mb-4"> 65573 ${entityType == EntityType.Event ? b$1` 65574 <sonic-date subDataProvider="entity" class="uppercase block mb-1"></sonic-date> 65575 <sonic-product-title 65576 machineName 65577 subDataProvider="entity.edito" 65578 class="text-2xl mb-2" 65579 ></sonic-product-title> 65580 65581 ${this.props?.session_status === "canceled" ? b$1`<sonic-badge type="danger" class="my-1" size="sm" 65582 >${t("LIB_event_status_canceled")}</sonic-badge 65583 >` : A$1} 65584 ${this.props?.session_status === "deferred" ? b$1`<sonic-badge type="warning" class="my-1" size="sm" 65585 >${t("LIB_event_status_deferred")}</sonic-badge 65586 >` : A$1} 65587 <sonic-event-location-hall
65588 subDataProvider="entity" 65589 isEvent="true" 65590 class="block mt-1 text-sm" 65591 addressDisplay="text" 65592 ></sonic-event-location-hall> 65593 ` : b$1`<sonic-product-title subDataProvider="entity.edito" class="text-2xl mb-2"></sonic-product-title> `} 65594 65595 <div class="flex gap-2 items-center flex-wrap "> 65596 ${entityType == "subscribe" && this.subscribe?.number ? b$1` <sonic-badge type="info" size="sm">N° ${this.subscribe?.number}</sonic-badge>` : A$1} 65597 ${this.giftcard?.code ? b$1` <sonic-giftcard-code copy code="${this.giftcard?.code}" size="sm"></sonic-giftcard-code>` : A$1} 65598 65599 <sonic-purchase-expiration-date size="sm" class="block"></sonic-purchase-expiration-date> 65600 </div> 65601 <!-- Contremarque --> 65602 ${this.price?.isCountermark && !this.props?.checked ? b$1` 65603 <sonic-badge type="danger" size="sm" class="mt-1"> 65604 <sonic-icon name="file-exclamation" library="custom"></sonic-icon> ${t( 65605 "contremarque_echanger_guichet" 65606 )}</sonic-badge 65607 > 65608 ` : A$1} 65609 <sonic-purchase-status 65610 size="sm" 65611 class="block mt-1 " 65612 displayDetail 65613 flexDirection="row" 65614 hiddenIfValid 65615 ></sonic-purchase-status> 65616 </div> 65617 65618 <div class="grid grid-cols-[repeat(auto-fit,minmax(min(100%,10rem),1fr))] gap-3"> 65619 ${this.giftcard?.remaining_amount || this.giftcard?.remaining_amount === 0 ? b$1` 65620 <sonic-ticket-info class="text-sm" label=${t("remaining")}> 65621 ${formatAmount(this.giftcard?.remaining_amount || 0)} 65622 </sonic-ticket-info> 65623 ` : A$1} 65624 65625 <!-- Détenteur --> 65626 ${this.owner?.firstName || this.owner?.lastName ? b$1` 65627 <sonic-ticket-info 65628 class="text-sm" 65629 label=${t("LIB_detenteur")} 65630 content="${this.owner?.firstName} ${this.owner?.lastName}" 65631 ></sonic-ticket-info> 65632 ` : A$1} 65633 65634 <!-- Date --> 65635 ${this.created ? b$1` 65636 <sonic-ticket-info class="text-sm" label=${t("purchase_date")}> 65637 <sonic-date date=${this.created} weekday="hidden" month="2-digit"></sonic-date> 65638 </sonic-ticket-info> 65639 ` : A$1} 65640 65641 <!-- Placement --> 65642 ${this.renderPlacement()} 65643 <!-- Catégories --> 65644 65645 <!-- Prix --> 65646 ${this.price?.amount ? b$1` 65647 <sonic-ticket-info 65648 class="text-sm" 65649 label="${t("price")}" 65650 content="${this.price?.label} ${formatAmount(this.price?.amount)}" 65651 ></sonic-ticket-info> 65652 ` : A$1} 65653 </div> 65654 65655 ${this.ticketActions()} 65656 </div> 65657 65658 ${this.barcode && !this.price.isCountermark ? b$1` 65659 <sonic-divider class="mt-6 mb-4"></sonic-divider> 65660 <div class="px-3 lg:px-6 pb-5 flex flex-col items-center lowercase "> 65661 <div class="text-sm tracking-wider leading-none">n° ${this.barcode}</div> 65662 ${displayBarcode ? b$1` 65663 ${this.barcodeMode == "qrcode" ? b$1`<sonic-qrcode class="size-[8rem]" margin="2"></sonic-qrcode>` : b$1`<sonic-barcode 65664 hideValue 65665 barWidth="3" 65666 barHeight="60" 65667 class="w-[max(60%,20rem)] max-w-[90%] " 65668 ></sonic-barcode>`} 65669 65670 <div class="flex gap-1 mt-1"> 65671 <sonic-button 65672 variant="ghost" 65673 size="2xs" 65674 class="font-semibold " 65675 minWidth="6rem" 65676 @click=${() => this.barcodeMode = "qrcode"} 65677 ?active=${this.barcodeMode == "qrcode"} 65678 ><span class="lowercase">${t("qr code")}</span></sonic-button 65679 > 65680 <sonic-button 65681 variant="ghost" 65682 size="2xs" 65683 class="font-semibold " 65684 minWidth="6rem" 65685 @click=${() => this.barcodeMode = "barcode"} 65686 ?active=${this.barcodeMode == "barcode"} 65687 ><span class="lowercase">${t("codebarre")}</span></sonic-button 65688 > 65689 </div> 65690 ` : A$1} 65691 </div> 65692 ` : A$1} 65693 ${entityType == EntityType.Event || entityType == EntityType.Merch ? b$1` 65694 <div class="aspect-[3/2] lg:aspect-[16/9] overflow-hidden "> 65695 <sonic-product-illustration 65696 noAnimation 65697 subdataProvider="entity" 65698 class="w-full block" 65699 ></sonic-product-illustration> 65700 </div> 65701 ` : A$1} 65702 </div>`; 65703 } 65704 ticketActions() { 65705 const displayActions = this.cancelable || this.refund?.askEnabled || this.props?.cancelable_for_credit; 65706 if (!displayActions) return A$1; 65707 const eventId = this.entity?.id; 65708 return b$1` 65709 <div class="col-span-full mt-5"> 65710 ${this.refund?.askEnabled ? b$1` 65711 <sonic-button 65712 class="grow" 65713 size="sm" 65714 shape="block" 65715 variant="outline" 65716 type="info" 65717 @click=${() => { 65718 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 65719 if (parentModal) { 65720 parentModal.hide(); 65721 } 65722 }} 65723 href="${appRoute("refund").query({ event_id: eventId, barcode: this.barcode })}" 65724 > 65725 <sonic-icon name="arrow-rotate-left" library="custom"></sonic-icon> 65726 <b>${t("ask_for_refund")}</b> 65727 </sonic-button> 65728 ` : A$1} 65729 ${this.cancelable ? b$1` 65730 <sonic-button 65731 class="grow" 65732 shape="block" 65733 variant="outline" 65734 size="sm" 65735 type="info" 65736 @click=${() => { 65737 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 65738 if (parentModal) { 65739 parentModal.hide(); 65740 }
65741 cancelTicket(Number(this.id)); 65742 }} 65743 > 65744 <sonic-icon name="hand-wave" library="custom"></sonic-icon> 65745 <b>${t("free_up")}</b> 65746 </sonic-button> 65747 ` : A$1} 65748 ${this.props?.cancelable_for_credit ? b$1` 65749 <sonic-button 65750 class="grow" 65751 shape="block" 65752 variant="outline" 65753 size="sm" 65754 type="info" 65755 @click=${() => cancelTicket(Number(this.id), "credit")} 65756 > 65757 <sonic-icon name="hand-wave" library="custom"></sonic-icon> 65758 <b>${t("annuler_contre_avoir")}</b> 65759 </sonic-button> 65760 ` : A$1} 65761 </div> 65762 `; 65763 } 65764 printCategories(categories) { 65765 const titles = categories.reduce((acc, category) => { 65766 if (category.title) acc.push(category.title); 65767 return acc; 65768 }, []); 65769 return b$1` ${titles.join(", ")} `; 65770 } 65771 render_skeleton() { 65772 return b$1` <div> 65773 <div class=" pt-5 px-3 lg:px-6"> 65774 <div class="mb-4"> 65775 <div class="rounded-sm animate-pulse bg-neutral-300 h-4 max-w-[20ch] mb-1"></div> 65776 <div class="rounded-sm animate-pulse bg-neutral-300 h-7 max-w-[34ch] mb-1"></div> 65777 <div class="rounded-sm animate-pulse bg-neutral-300 h-2 max-w-[15ch] mb-3"></div> 65778 </div> 65779 65780 <div class="grid grid-cols-[repeat(auto-fit,minmax(min(100%,15rem),1fr))] gap-3"> 65781 <div> 65782 <div class="rounded-sm animate-pulse bg-neutral-300 h-2 max-w-[10ch] mb-1"></div> 65783 <div class="rounded-sm animate-pulse bg-neutral-300 h-3 max-w-[23ch] "></div> 65784 </div> 65785 <div> 65786 <div class="rounded-sm animate-pulse bg-neutral-300 h-2 max-w-[12ch] mb-1"></div> 65787 <div class="rounded-sm animate-pulse bg-neutral-300 h-3 max-w-[18ch] "></div> 65788 </div> 65789 </div> 65790 </div> 65791 <sonic-divider class="mt-6 mb-5"></sonic-divider> 65792 <div class="px-3 lg:px-6 pb-6 flex flex-col gap-[3px] items-center"> 65793 <sonic-barcode 65794 barcode="123456789012" 65795 hideValue 65796 barWidth="3" 65797 barHeight="60" 65798 class="w-[max(60%,25rem)] max-w-[90%] animate-pulse text-neutral-300" 65799 ></sonic-barcode> 65800 </div> 65801 <div class="animate-pulse aspect-[3/2] lg:aspect-[16/9] overflow-hidden bg-neutral-200"></div> 65802 </div>`; 65803 } 65804 }; 65805 SonicTicket.styles = [tailwind]; 65806 __decorateClass$S([ 65807 n$5({ type: Object }) 65808 ], SonicTicket.prototype, "entity", 2); 65809 __decorateClass$S([ 65810 n$5({ type: Number }) 65811 ], SonicTicket.prototype, "created", 2); 65812 __decorateClass$S([ 65813 n$5({ type: Object }) 65814 ], SonicTicket.prototype, "event", 2); 65815 __decorateClass$S([ 65816 n$5({ type: Object }) 65817 ], SonicTicket.prototype, "price", 2); 65818 __decorateClass$S([ 65819 n$5({ type: Object }) 65820 ], SonicTicket.prototype, "owner", 2); 65821 __decorateClass$S([ 65822 n$5({ type: String }) 65823 ], SonicTicket.prototype, "barcode", 2); 65824 __decorateClass$S([ 65825 n$5({ type: Object }) 65826 ], SonicTicket.prototype, "subscribe", 2); 65827 __decorateClass$S([ 65828 n$5({ type: Object }) 65829 ], SonicTicket.prototype, "giftcard", 2); 65830 __decorateClass$S([ 65831 n$5({ type: Object }) 65832 ], SonicTicket.prototype, "refund", 2); 65833 __decorateClass$S([ 65834 n$5({ type: Boolean }) 65835 ], SonicTicket.prototype, "cancelable", 2); 65836 __decorateClass$S([ 65837 r$5() 65838 ], SonicTicket.prototype, "barcodeMode", 2); 65839 __decorateClass$S([ 65840 n$5({ type: Boolean }) 65841 ], SonicTicket.prototype, "skeleton", 2); 65842 SonicTicket = __decorateClass$S([ 65843 t$3(tagName$E) 65844 ], SonicTicket); 65845 var __defProp$O = Object.defineProperty; 65846 var __getOwnPropDesc$R = Object.getOwnPropertyDescriptor; 65847 var __decorateClass$R = (decorators, target, key, kind) => { 65848 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$R(target, key) : target; 65849 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 65850 if (decorator = decorators[i2]) 65851 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 65852 if (kind && result) __defProp$O(target, key, result); 65853 return result; 65854 }; 65855 let SonicPurchaseSummaryActions = class extends Subscriber$1(i$6) { 65856 constructor() { 65857 super(...arguments); 65858 this.print_url = ""; 65859 this.barcode = ""; 65860 this.pdf_mobile_url = ""; 65861 this.cancelable = false;
65862 this.refund = {}; 65863 this.detailHref = ""; 65864 this.store_url = ""; 65865 } 65866 willUpdate(changedProperties) { 65867 const entity = this.props?.entity; 65868 if (changedProperties.has("props") && entity?.entity_type === EntityType.Event) { 65869 this._icsUrl = icsCalendarUrl([entity], this.store_url); 65870 this._calendarUrl = googleCalendarUrl(entity); 65871 } 65872 super.willUpdate(changedProperties); 65873 } 65874 get resolvedDetailHref() { 65875 if (!this.detailHref) { 65876 return ""; 65877 } 65878 return this.detailHref.replace(/\$\{id\}/g, String(this.id ?? "")); 65879 } 65880 showDetailAction() { 65881 return !!(this.resolvedDetailHref || this.id); 65882 } 65883 hasDefaultMenuActions() { 65884 const purchase = this.props ?? {}; 65885 if (!isPurchasePrintable(purchase)) { 65886 return false; 65887 } 65888 const refundEnabled = this.refund?.askEnabled; 65889 return !!(this.pdf_mobile_url || this.print_url || this.cancelable || refundEnabled || this._calendarUrl); 65890 } 65891 hasConfiguredMenuActions() { 65892 const purchase = this.props ?? {}; 65893 if (!isPurchasePrintable(purchase)) { 65894 return false; 65895 } 65896 if (this.menuActions) { 65897 const showPdfMobile = purchase.entity_type === EntityType.Event && !!purchase.pdf_mobile_url; 65898 return showPdfMobile || !!purchase.print_url; 65899 } 65900 return !!(purchase.pdf_mobile_url || purchase.print_url || purchase.cancelable || purchase.refund?.askEnabled); 65901 } 65902 get hasMenu() { 65903 return this.menuActions ? this.hasConfiguredMenuActions() : this.hasDefaultMenuActions(); 65904 } 65905 render() { 65906 const menuContent = this.menuActions ? this.menuActions(this.props ?? {}) : this.renderDefaultMenuActions(); 65907 return b$1` 65908 <div class="${TRANSACTION_ROW_ACTIONS_SLOTS_CLASS}"> 65909 <div class="flex items-center justify-center h-9 w-full"> 65910 ${this.hasMenu ? b$1`<sonic-pop placement="bottom"> 65911 <sonic-button noAutofill icon shape="circle" type="default" variant="ghost"> 65912 <sonic-icon library="custom" size="lg" name="ellipsis-vertical"></sonic-icon> 65913 </sonic-button> 65914 <sonic-menu slot="content" minWidth="15rem">${menuContent}</sonic-menu> 65915 </sonic-pop>` : A$1} 65916 </div> 65917 <div class="flex items-center justify-center h-9 w-full"> 65918 ${this.showDetailAction() ? this.renderDetailAction() : A$1} 65919 </div> 65920 </div> 65921 `; 65922 } 65923 renderDetailAction() { 65924 const href = this.resolvedDetailHref; 65925 if (href) { 65926 return b$1` 65927 <sonic-button noAutofill shape="circle" type="neutral" href=${href}> 65928 <sonic-icon name="chevron-right" library="custom"></sonic-icon> 65929 </sonic-button> 65930 `; 65931 } 65932 return b$1` 65933 <sonic-button noAutofill shape="circle" type="neutral" @click=${this.openTicketModal}> 65934 <sonic-icon name="chevron-right" library="custom"></sonic-icon> 65935 </sonic-button> 65936 `; 65937 } 65938 renderDefaultMenuActions() { 65939 const purchase = this.props ?? {}; 65940 if (!isPurchasePrintable(purchase)) { 65941 return A$1; 65942 } 65943 const refundEnabled = this.refund?.askEnabled; 65944 return b$1` 65945 ${this.pdf_mobile_url ? b$1`<sonic-menu-item noAutofill href="${this.pdf_mobile_url}" target="_blank"> 65946 <sonic-icon library="custom" slot="prefix" name="file-pdf"></sonic-icon> 65947 ${t("pdf_mobile")} 65948 </sonic-menu-item>` : A$1} 65949 ${this.print_url ? b$1`<sonic-menu-item noAutofill href="${this.print_url}" target="_blank"> 65950 <sonic-icon library="custom" slot="prefix" name="print"></sonic-icon> 65951 ${t("print")} 65952 </sonic-menu-item>` : A$1} 65953 ${this.print_url && (this.cancelable || refundEnabled) ? b$1`<sonic-divider></sonic-divider>` : A$1} 65954 ${this.cancelLink()} ${refundEnabled ? this.refundLink() : A$1} 65955 ${this.renderAddToCalendar()} 65956 `; 65957 } 65958 renderAddToCalendar() { 65959 if (!this._calendarUrl || !this._icsUrl) { 65960 return A$1; 65961 } 65962 return b$1`<sonic-divider></sonic-divider> 65963 <sonic-menu-item noAutofill href="${this._calendarUrl}" target="_blank"> 65964 <sonic-icon slot="prefix" library="custom" prefix="brands" name="google"></sonic-icon> 65965 ${t("add_to_google_calendar")} 65966 </sonic-menu-item> 65967 <sonic-menu-item noAutofill href="${this._icsUrl}" target="_blank"> 65968 <sonic-icon library="custom" slot="prefix" name="calendar-plus"></sonic-icon> 65969 <div>${t("download_calendar")}</div> 65970 </sonic-menu-item>`; 65971 } 65972 refundLink() { 65973 const entityId = this.props?.entity?.id; 65974 const refundRoute = appRoute("refund").query({ event_id: entityId, barcode: this.barcode })?.toString(); 65975 return b$1`<sonic-menu-item noAutofill href="${refundRoute}" class="whitespace-nowrap"> 65976 <sonic-icon library="custom" slot="prefix" name="arrow-rotate-left"></sonic-icon> 65977 ${t("ask_for_refund")} 65978 </sonic-menu-item>`; 65979 } 65980 cancelLink() { 65981 if (this.cancelable) {
65982 return b$1` <sonic-divider></sonic-divider> 65983 <sonic-menu-item noAutofill @click="${() => cancelTicket(Number(this.id))}"> 65984 <sonic-icon library="custom" slot="prefix" name="hand-wave"></sonic-icon> 65985 ${t("free_up")} 65986 </sonic-menu-item>`; 65987 } else if (this.props?.cancelable_for_credit) { 65988 return b$1` <sonic-divider></sonic-divider> 65989 <sonic-menu-item noAutofill @click="${() => cancelTicket(Number(this.id), "credit")}"> 65990 <sonic-icon library="custom" slot="prefix" name="hand-wave"></sonic-icon> 65991 ${t("annuler_contre_avoir")} 65992 </sonic-menu-item>`; 65993 } 65994 return A$1; 65995 } 65996 openTicketModal() { 65997 Modal.create({ 65998 content: ( 65999 /*html*/ 66000 '<sonic-ticket class="pt-3" dataProvider="' + this.dataProvider + '"></sonic-ticket>' 66001 ), 66002 paddingX: "0", 66003 paddingY: "0", 66004 width: "30rem", 66005 removeOnHide: true 66006 }); 66007 } 66008 }; 66009 SonicPurchaseSummaryActions.styles = [ 66010 tailwind, 66011 i$9` 66012 :host { 66013 display: block; 66014 flex-shrink: 0; 66015 } 66016 ` 66017 ]; 66018 __decorateClass$R([ 66019 n$5({ type: String }) 66020 ], SonicPurchaseSummaryActions.prototype, "print_url", 2); 66021 __decorateClass$R([ 66022 n$5({ type: String }) 66023 ], SonicPurchaseSummaryActions.prototype, "barcode", 2); 66024 __decorateClass$R([ 66025 n$5({ type: String }) 66026 ], SonicPurchaseSummaryActions.prototype, "pdf_mobile_url", 2); 66027 __decorateClass$R([ 66028 n$5({ type: Boolean }) 66029 ], SonicPurchaseSummaryActions.prototype, "cancelable", 2); 66030 __decorateClass$R([ 66031 n$5({ type: Object }) 66032 ], SonicPurchaseSummaryActions.prototype, "refund", 2); 66033 __decorateClass$R([ 66034 n$5({ type: String, attribute: "detail-href" }) 66035 ], SonicPurchaseSummaryActions.prototype, "detailHref", 2); 66036 __decorateClass$R([ 66037 n$5({ type: Function, attribute: false }) 66038 ], SonicPurchaseSummaryActions.prototype, "menuActions", 2); 66039 __decorateClass$R([ 66040 bind$1("settings.store_url"), 66041 n$5({ type: String }) 66042 ], SonicPurchaseSummaryActions.prototype, "store_url", 2); 66043 __decorateClass$R([ 66044 r$5() 66045 ], SonicPurchaseSummaryActions.prototype, "_icsUrl", 2); 66046 __decorateClass$R([ 66047 r$5() 66048 ], SonicPurchaseSummaryActions.prototype, "_calendarUrl", 2); 66049 SonicPurchaseSummaryActions = __decorateClass$R([ 66050 t$3("sonic-purchase-summary-actions") 66051 ], SonicPurchaseSummaryActions); 66052 var __defProp$N = Object.defineProperty; 66053 var __getOwnPropDesc$Q = Object.getOwnPropertyDescriptor; 66054 var __decorateClass$Q = (decorators, target, key, kind) => { 66055 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$Q(target, key) : target; 66056 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66057 if (decorator = decorators[i2]) 66058 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66059 if (kind && result) __defProp$N(target, key, result); 66060 return result; 66061 }; 66062 const tagName$D = "sonic-purchase-summary"; 66063 let PurchaseSummary = class extends Subscriber$1(i$6) { 66064 constructor() { 66065 super(...arguments); 66066 this.print_url = ""; 66067 this.barcode = ""; 66068 this.pdf_mobile_url = ""; 66069 this.direction = "row"; 66070 this.skeleton = false; 66071 this.entity = null; 66072 this.cancelable = false; 66073 this.refund = {}; 66074 this.detailHref = ""; 66075 this._resizeController = new h$1(this, {}); 66076 } 66077 render() { 66078 if (this.skeleton) { 66079 return this.render_skeleton(); 66080 } 66081 return b$1` 66082 <div class="@container"> 66083 <div 66084 class=" 66085 grid gap-4 p-3 @xl:p-4 66086 grid-cols-[max(6rem,_13%)_1fr] 66087 @xl:grid-cols-[max(6rem,_13%)_minmax(0,1fr)_minmax(0,1fr)] 66088 @xl:pr-2 66089 items-center bg-neutral-100 rounded-md" 66090 > 66091 <div class="rounded-md overflow-hidden"> 66092 <div class="aspect-square flex w-full"> 66093 <sonic-product-illustration 66094 noAnimation 66095 subDataProvider="entity" 66096 class="block w-full" 66097 ></sonic-product-illustration> 66098 </div> 66099 </div> 66100 66101 <div> 66102 <sonic-purchase-summary-main-info></sonic-purchase-summary-main-info> 66103 </div> 66104 66105 <div 66106 class="flex gap-x-3 col-span-full pt-3 border-t border-neutral-200 @xl:pt-0 @xl:col-span-1 @xl:border-none @xl:items-center" 66107 > 66108 <div class="col-start-2 @xl:col-auto flex-grow cell-aside self-center text-xs"> 66109 <sonic-purchase-summary-complementary-info></sonic-purchase-summary-complementary-info> 66110 </div> 66111 66112 <sonic-purchase-summary-actions 66113 class="ml-auto" 66114 detail-href=${this.detailHref} 66115 .menuActions=${this.menuActions} 66116 ></sonic-purchase-summary-actions> 66117 </div> 66118 </div> 66119 </div> 66120 `; 66121 } 66122 render_skeleton() { 66123 return b$1`<div class="@container"> 66124 <div 66125 class="grid gap-4 p-3 @xl:p-4 66126 grid-cols-[max(6rem,_13%)_1fr] 66127 @xl:grid-cols-[max(6rem,_13%)_minmax(0,1fr)_minmax(0,1fr)] items-center 66128 bg-neutral-100 rounded-md" 66129 > 66130 <div class="rounded-md overflow-hidden self-start"> 66131 <div class="aspect-square bg-neutral-300 animate-pulse"></div> 66132 </div>
66133 <div class="self-center"> 66134 <div class="rounded-sm animate-pulse bg-neutral-300 h-4 max-w-[15ch] mb-1"></div> 66135 <div class="rounded-sm animate-pulse bg-neutral-300 h-4 max-w-[28ch] mb-3"></div> 66136 <div class="rounded-sm animate-pulse bg-neutral-300 h-4 max-w-[18ch]"></div> 66137 </div> 66138 </div> 66139 </div>`; 66140 } 66141 }; 66142 PurchaseSummary.styles = [tailwind]; 66143 __decorateClass$Q([ 66144 n$5({ type: String }) 66145 ], PurchaseSummary.prototype, "print_url", 2); 66146 __decorateClass$Q([ 66147 n$5({ type: String }) 66148 ], PurchaseSummary.prototype, "barcode", 2); 66149 __decorateClass$Q([ 66150 n$5({ type: String }) 66151 ], PurchaseSummary.prototype, "pdf_mobile_url", 2); 66152 __decorateClass$Q([ 66153 n$5({ type: String }) 66154 ], PurchaseSummary.prototype, "direction", 2); 66155 __decorateClass$Q([ 66156 n$5({ type: Boolean }) 66157 ], PurchaseSummary.prototype, "skeleton", 2); 66158 __decorateClass$Q([ 66159 n$5({ type: Object }) 66160 ], PurchaseSummary.prototype, "entity", 2); 66161 __decorateClass$Q([ 66162 n$5({ type: Boolean }) 66163 ], PurchaseSummary.prototype, "cancelable", 2); 66164 __decorateClass$Q([ 66165 n$5({ type: Object }) 66166 ], PurchaseSummary.prototype, "refund", 2); 66167 __decorateClass$Q([ 66168 n$5({ type: String, attribute: "detail-href" }) 66169 ], PurchaseSummary.prototype, "detailHref", 2); 66170 __decorateClass$Q([ 66171 n$5({ type: Function, attribute: false }) 66172 ], PurchaseSummary.prototype, "menuActions", 2); 66173 PurchaseSummary = __decorateClass$Q([ 66174 t$3(tagName$D) 66175 ], PurchaseSummary); 66176 var __defProp$M = Object.defineProperty; 66177 var __getOwnPropDesc$P = Object.getOwnPropertyDescriptor; 66178 var __decorateClass$P = (decorators, target, key, kind) => { 66179 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$P(target, key) : target; 66180 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66181 if (decorator = decorators[i2]) 66182 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66183 if (kind && result) __defProp$M(target, key, result); 66184 return result; 66185 }; 66186 let OrdersTableLine = class extends Subscriber$1(i$6) { 66187 constructor() { 66188 super(...arguments); 66189 this.id = ""; 66190 this.date = ""; 66191 this.invoice_name = ""; 66192 this.amount = ""; 66193 this.invoice_url = ""; 66194 this.mandate_pdf_url = ""; 66195 } 66196 render() { 66197 return b$1` 66198 <sonic-tr> 66199 <sonic-td> 66200 <sonic-date month="numeric" year="numeric" weekday="hidden"></sonic-date> 66201 </sonic-td> 66202 <sonic-td>${this.invoice_name}</sonic-td> 66203 <sonic-td class="hidden lg:contents">${this.id}</sonic-td> 66204 <sonic-td>${this.amount}â¬</sonic-td> 66205 <sonic-td align="center"> 66206 <sonic-button 66207 href="${this.invoice_url}" 66208 variant="ghost" 66209 icon 66210 shape="circle" 66211 target="_blank" 66212 size="sm" 66213 aria-label="print invoice" 66214 > 66215 <sonic-icon library="custom" name="file-pdf"></sonic-icon> 66216 </sonic-button> 66217 ${this.mandate_pdf_url ? b$1`<sonic-button 66218 href="${this.mandate_pdf_url}" 66219 variant="outline" 66220 type="primary" 66221 icon 66222 target="_blank" 66223 size="xs" 66224 aria-label="download SEPA mandate" 66225 > 66226 SEPA 66227 </sonic-button>` : A$1} 66228 </sonic-td> 66229 </sonic-tr> 66230 `; 66231 } 66232 }; 66233 OrdersTableLine.styles = [ 66234 tailwind, 66235 i$9` 66236 :host { 66237 display: contents; 66238 } 66239 ` 66240 ]; 66241 __decorateClass$P([ 66242 n$5() 66243 ], OrdersTableLine.prototype, "id", 2); 66244 __decorateClass$P([ 66245 n$5() 66246 ], OrdersTableLine.prototype, "date", 2); 66247 __decorateClass$P([ 66248 n$5() 66249 ], OrdersTableLine.prototype, "invoice_name", 2); 66250 __decorateClass$P([ 66251 n$5() 66252 ], OrdersTableLine.prototype, "amount", 2); 66253 __decorateClass$P([ 66254 n$5() 66255 ], OrdersTableLine.prototype, "invoice_url", 2); 66256 __decorateClass$P([ 66257 n$5() 66258 ], OrdersTableLine.prototype, "mandate_pdf_url", 2); 66259 OrdersTableLine = __decorateClass$P([ 66260 t$3("sonic-orders-table-line") 66261 ], OrdersTableLine); 66262 var __defProp$L = Object.defineProperty; 66263 var __getOwnPropDesc$O = Object.getOwnPropertyDescriptor; 66264 var __decorateClass$O = (decorators, target, key, kind) => { 66265 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$O(target, key) : target; 66266 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66267 if (decorator = decorators[i2]) 66268 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66269 if (kind && result) __defProp$L(target, key, result); 66270 return result; 66271 }; 66272 let OrdersTable = class extends Subscriber$1(i$6) { 66273 constructor() { 66274 super(...arguments); 66275 this.userId = ""; 66276 } 66277 render() { 66278 if (!this.userId) return A$1; 66279 return b$1` 66280 <sonic-table bordered maxHeight="50vh" size="sm"> 66281 <sonic-thead> 66282 <sonic-tr class="text-neutral-400 text-normal lowercase "> 66283 <sonic-th>${t("date_buy")}</sonic-th> 66284 <sonic-th>${t("invoice_number")}</sonic-th> 66285 <sonic-th class="hidden lg:contents">${t("transaction_number")}</sonic-th> 66286 <sonic-th>${t("amount")}</sonic-th> 66287 <sonic-th></sonic-th> 66288 </sonic-tr> 66289 </sonic-thead> 66290 <sonic-tbody dataProvider="userInvoicesResults"> 66291 <sonic-queue 66292 displayContents 66293 dataProviderExpression="/user/${this.userId}/orders?limit=$limit&offset=$offset" 66294 targetRequestDuration="1000" 66295 limit="10" 66296 key="data" 66297 > 66298 <template data-value="no-item"> 66299 <sonic-tr> 66300 <sonic-td colspan="5"> 66301 <sonic-no-result></sonic-no-result> 66302 </sonic-td> 66303 </sonic-tr> 66304 </template> 66305 <template> 66306 <sonic-orders-table-line></sonic-orders-table-line> 66307 </template> 66308 </sonic-queue> 66309 </sonic-tbody> 66310 </sonic-table> 66311 `; 66312 } 66313 }; 66314 OrdersTable.styles = [tailwind]; 66315 __decorateClass$O([ 66316 n$5({ type: String }) 66317 ], OrdersTable.prototype, "userId", 2); 66318 OrdersTable = __decorateClass$O([ 66319 t$3("sonic-orders-table") 66320 ], OrdersTable); 66321 function mapSeasonSelectOptions(seasons, { formatValue, isSelected }) { 66322 return [...seasons].reverse().map((season) => ({ 66323 value: formatValue(season), 66324 wording: season.title ?? "", 66325 selected: isSelected(season) 66326 })); 66327 } 66328 var __defProp$K = Object.defineProperty; 66329 var __getOwnPropDesc$N = Object.getOwnPropertyDescriptor; 66330 var __decorateClass$N = (decorators, target, key, kind) => { 66331 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$N(target, key) : target; 66332 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66333 if (decorator = decorators[i2]) 66334 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66335 if (kind && result) __defProp$K(target, key, result); 66336 return result; 66337 }; 66338 const tagName$C = "sonic-season-select"; 66339 let SeasonSelect = class extends Subscriber$1(i$6) { 66340 constructor() { 66341 super(...arguments); 66342 this.name = "season"; 66343 this.onlyId = false;
66344 this.enableAll = false; 66345 this.enableNext = false; 66346 this.selectCurrent = false; 66347 this.selectNext = false; 66348 this.size = "md"; 66349 } 66350 formatValue(season) { 66351 if (this.onlyId && season.id) return season.id.toString(); 66352 return season.id + "|" + season.start_date + "|" + season.end_date + (season.current ? "|current" : "|"); 66353 } 66354 render() { 66355 if (!this.props || Object.entries(this.props).length == 0) return A$1; 66356 let options = mapSeasonSelectOptions(this.props, { 66357 formatValue: (season) => this.formatValue(season), 66358 isSelected: (season) => this.selectCurrent ? Boolean(season.current) : false 66359 }); 66360 if (this.enableAll) { 66361 options = [ 66362 { 66363 value: "", 66364 wording: "Toutes les saisons", 66365 selected: this.selectCurrent ? false : true 66366 }, 66367 ...options 66368 ]; 66369 } 66370 if (this.enableNext) { 66371 options = [ 66372 { 66373 value: "next", 66374 wording: "A venir", 66375 selected: this.selectNext ? false : true 66376 }, 66377 ...options 66378 ]; 66379 } 66380 return b$1`<sonic-select size=${this.size} name="${this.name}" .options=${options}></sonic-select>`; 66381 } 66382 }; 66383 SeasonSelect.styles = [tailwind]; 66384 __decorateClass$N([ 66385 n$5({ type: String }) 66386 ], SeasonSelect.prototype, "name", 2); 66387 __decorateClass$N([ 66388 n$5({ type: Boolean }) 66389 ], SeasonSelect.prototype, "onlyId", 2); 66390 __decorateClass$N([ 66391 n$5({ type: Boolean }) 66392 ], SeasonSelect.prototype, "enableAll", 2); 66393 __decorateClass$N([ 66394 n$5({ type: Boolean }) 66395 ], SeasonSelect.prototype, "enableNext", 2); 66396 __decorateClass$N([ 66397 n$5({ type: Boolean }) 66398 ], SeasonSelect.prototype, "selectCurrent", 2); 66399 __decorateClass$N([ 66400 n$5({ type: Boolean }) 66401 ], SeasonSelect.prototype, "selectNext", 2); 66402 __decorateClass$N([ 66403 n$5({ type: String }) 66404 ], SeasonSelect.prototype, "size", 2); 66405 SeasonSelect = __decorateClass$N([ 66406 t$3(tagName$C) 66407 ], SeasonSelect); 66408 var __defProp$J = Object.defineProperty; 66409 var __getOwnPropDesc$M = Object.getOwnPropertyDescriptor; 66410 var __decorateClass$M = (decorators, target, key, kind) => { 66411 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$M(target, key) : target; 66412 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66413 if (decorator = decorators[i2]) 66414 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66415 if (kind && result) __defProp$J(target, key, result); 66416 return result; 66417 }; 66418 const DP_ACCOUNT_PURCHASES_FILTERS = "accountPurchasesFilters"; 66419 const tagName$B = "sonic-user-account-purchases"; 66420 let UserAccount$4 = class UserAccount extends i$6 { 66421 constructor() { 66422 super(...arguments); 66423 this.activeTab = "history"; 66424 } 66425 toggleTab(tab) { 66426 this.activeTab = tab; 66427 } 66428 render() { 66429 if (!this.userId) return A$1; 66430 return b$1` 66431 <sonic-page-header label="${t("mes_achats")}"></sonic-page-header> 66432 66433 <!-- Search --> 66434 <div class="flex gap-2 -mt-6 mb-8"> 66435 <sonic-button ?active=${this.activeTab == "history"} @click=${() => this.toggleTab("history")} size="md"> 66436 <sonic-icon library="custom" name="clock-rotate-left" class="mr-1"> </sonic-icon> 66437 ${t("history")} 66438 </sonic-button> 66439 <sonic-button ?active=${this.activeTab == "invoice"} @click=${() => this.toggleTab("invoice")} size="md"> 66440 <sonic-icon library="custom" name="file" class="mr-1"> </sonic-icon> 66441 ${t("invoices")} 66442 </sonic-button> 66443 </div> 66444 66445 <!-- HISTORY --> 66446 66447 ${this.activeTab === "history" ? b$1` 66448 <div 66449 formDataProvider="${DP_ACCOUNT_PURCHASES_FILTERS}" 66450 dataProvider="${DP_ACCOUNT_PURCHASES_FILTERS}" 66451 class="mb-8 flex flex-wrap gap-x-3 gap-y-2 items-center " 66452 > 66453 <sonic-input 66454 type="search" 66455 name="search" 66456 inlineContent 66457 placeholder="Rechercher..." 66458 filteredFields="title" 66459 class="grow max-w-[20rem]" 66460 autocomplete="off" 66461 value="" 66462 > 66463 <sonic-icon library="iconoir" slot="prefix" name="search"></sonic-icon> 66464 </sonic-input> 66465 <sonic-select 66466 name="entity_type" 66467 class="min-w-[13rem] " 66468 .options=${[ 66469 { value: "", wording: t("all_purchases") }, 66470 { value: "event", wording: t("tickets") }, 66471 ...this.hasSubscription ? [{ value: "subscribe", wording: t("abonnements") }] : [], 66472 ...this.hasGiftcards ? [{ value: "giftcard", wording: t("LIB_cartes_cadeaux") }] : [], 66473 ...this.hasAdditionalProducts ? [{ value: "additionalProduct", wording: t("LIB_produits_additionnels") }] : [], 66474 ...this.hasShop ? [{ value: "merch", wording: t("LIB_merchs") }] : [] 66475 ]} 66476 > 66477 </sonic-select> 66478 <sonic-fetch dataProvider="SeasonList" endPoint="/season" key="data"> 66479 <sonic-season-select name="ids_season[]" enableAll onlyId class="min-w-[13rem]"></sonic-season-select> 66480 </sonic-fetch> 66481 </div> 66482 <div dataProvider="accountPurchasesFilters"> 66483 <sonic-queue 66484 dataProviderExpression="/user/${this.userId}/purchases?next=1&limit=$limit&offset=$offset&buyer=${this.userId}" 66485 limit="8" 66486 lazyBoundsRatio="4" 66487 targetRequestDuration="1000" 66488 dataFilterProvider="${DP_ACCOUNT_PURCHASES_FILTERS}" 66489 key="data" 66490 > 66491 <template data-value="no-item"> 66492 <sonic-no-result></sonic-no-result> 66493 </template> 66494 <template data-value="skeleton"> 66495 <sonic-purchase-summary class="block mb-3" skeleton></sonic-purchase-summary> 66496 </template> 66497 <template> 66498 <sonic-purchase-summary class="block mb-3"></sonic-purchase-summary> 66499 </template> 66500 </sonic-queue> 66501 </div> 66502 ` : A$1} 66503 66504 <!-- INVOICES --> 66505 ${this.activeTab === "invoice" ? b$1`<sonic-orders-table userId=${this.userId}></sonic-orders-table>` : A$1} 66506 `; 66507 } 66508 }; 66509 UserAccount$4.styles = [tailwind]; 66510 __decorateClass$M([ 66511 bind$1("user.id"), 66512 n$5({ type: Number }) 66513 ], UserAccount$4.prototype, "userId", 2); 66514 __decorateClass$M([ 66515 bind$1("settings.modules.subscription.enabled"), 66516 n$5({ type: Boolean }) 66517 ], UserAccount$4.prototype, "hasSubscription", 2); 66518 __decorateClass$M([ 66519 bind$1("settings.modules.giftcards.enabled"), 66520 n$5({ type: Boolean }) 66521 ], UserAccount$4.prototype, "hasGiftcards", 2); 66522 __decorateClass$M([ 66523 bind$1("settings.modules.additional_products.enabled"), 66524 n$5({ type: Boolean }) 66525 ], UserAccount$4.prototype, "hasAdditionalProducts", 2); 66526 __decorateClass$M([ 66527 bind$1("settings.modules.shop.enabled"), 66528 n$5({ type: Boolean }) 66529 ], UserAccount$4.prototype, "hasShop", 2); 66530 __decorateClass$M([ 66531 r$5() 66532 ], UserAccount$4.prototype, "activeTab", 2); 66533 UserAccount$4 = __decorateClass$M([ 66534 t$3(tagName$B) 66535 ], UserAccount$4); 66536 var __defProp$I = Object.defineProperty; 66537 var __getOwnPropDesc$L = Object.getOwnPropertyDescriptor; 66538 var __decorateClass$L = (decorators, target, key, kind) => { 66539 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$L(target, key) : target; 66540 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66541 if (decorator = decorators[i2]) 66542 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66543 if (kind && result) __defProp$I(target, key, result); 66544 return result; 66545 }; 66546 const tagName$A = "sonic-link-ticket"; 66547 let SonicLinkTicket = class extends i$6 { 66548 constructor() { 66549 super(...arguments); 66550 this.displayTitle = false;
66551 this.displayText = false; 66552 this.smallTitle = false; 66553 this.userId = ""; 66554 } 66555 render() { 66556 if (!this.userId) return A$1; 66557 return b$1` 66558 <sonic-page-layout 66559 pageTitle=${t("LIB_compte_lier_transaction")} 66560 pageText=${t("LIB_compte_lier_transaction_aide")} 66561 ?smallTitle=${this.smallTitle} 66562 ?displayTitle=${this.displayTitle} 66563 ?displayText=${this.displayText} 66564 > 66565 <form method="post" dataProvider="tickets/link-to-account" formDataProvider="LinkTicketForm"> 66566 <sonic-fieldset> 66567 <sonic-input type="hidden" name="user_id" value=${this.userId}></sonic-input> 66568 <sonic-submit onEnterKey @submit=${this.handleSubmit}> 66569 <sonic-input 66570 type="text" 66571 label=${t("barcode_or_ticket_number")} 66572 name="barcode" 66573 required 66574 placeholder="- - - - - - - - - - - -" 66575 ></sonic-input> 66576 </sonic-submit> 66577 </sonic-fieldset> 66578 <sonic-submit onClick @submit=${this.handleSubmit}> 66579 <sonic-button radio noAutoFill type="success"> 66580 <sonic-icon slot="prefix" name="check"></sonic-icon> ${t("confirm")} 66581 </sonic-button> 66582 </sonic-submit> 66583 </form> 66584 </sonic-page-layout> 66585 `; 66586 } 66587 handleSubmit(event) { 66588 if (event.detail.success) { 66589 dp(DP_ACCOUNT_PURCHASES_FILTERS).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 66590 dp(DP_ACCOUNT_TICKETS_FILTERS).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 66591 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 66592 parentModal?.hide(); 66593 } 66594 } 66595 }; 66596 SonicLinkTicket.styles = [tailwind]; 66597 __decorateClass$L([ 66598 n$5({ type: Boolean }) 66599 ], SonicLinkTicket.prototype, "displayTitle", 2); 66600 __decorateClass$L([ 66601 n$5({ type: Boolean }) 66602 ], SonicLinkTicket.prototype, "displayText", 2); 66603 __decorateClass$L([ 66604 n$5({ type: Boolean }) 66605 ], SonicLinkTicket.prototype, "smallTitle", 2); 66606 __decorateClass$L([ 66607 bind$1("user.id"), 66608 r$5() 66609 ], SonicLinkTicket.prototype, "userId", 2); 66610 SonicLinkTicket = __decorateClass$L([ 66611 t$3(tagName$A) 66612 ], SonicLinkTicket); 66613 var __defProp$H = Object.defineProperty; 66614 var __getOwnPropDesc$K = Object.getOwnPropertyDescriptor; 66615 var __decorateClass$K = (decorators, target, key, kind) => { 66616 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$K(target, key) : target; 66617 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66618 if (decorator = decorators[i2]) 66619 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66620 if (kind && result) __defProp$H(target, key, result); 66621 return result; 66622 }; 66623 const DP_ACCOUNT_TICKETS_FILTERS = "accountTicketsFilters"; 66624 const tagName$z = "sonic-user-account-tickets"; 66625 let UserAccount$3 = class UserAccount extends i$6 { 66626 constructor() { 66627 super(...arguments); 66628 this.eventSelection = "past"; 66629 } 66630 linkTicketModal() { 66631 Modal.create({ 66632 content: ( 66633 /*html*/ 66634 `<sonic-link-ticket displayTitle displayText smallTitle></sonic-link-ticket>` 66635 ), 66636 width: "40rem", 66637 removeOnHide: true 66638 }); 66639 } 66640 render() { 66641 if (!this.userId) return A$1; 66642 const todayMinus6hours = /* @__PURE__ */ new Date(); 66643 todayMinus6hours.setHours(todayMinus6hours.getHours() - 6); 66644 const fromDate = Math.floor(todayMinus6hours.getTime() / 1e3); 66645 const dateParam = this.eventSelection == "next" ? `&event_from=${fromDate}&sort=start_date:asc` : `&event_to=${fromDate}&sort=start_date:desc`; 66646 return b$1` 66647 <!-- Search --> 66648 <sonic-page-header label="${t("mes_billets")}"> 66649 <sonic-menu-item @click=${this.linkTicketModal} slot="more"> 66650 <sonic-icon slot="prefix" library="custom" name="link"></sonic-icon> 66651 ${t("LIB_compte_lier_transaction")}</sonic-menu-item 66652 > 66653 </sonic-page-header> 66654 <div 66655 formDataProvider="${DP_ACCOUNT_TICKETS_FILTERS}" 66656 dataProvider="${DP_ACCOUNT_TICKETS_FILTERS}" 66657 class="mb-8 flex flex-wrap gap-x-3 gap-y-2 items-center " 66658 > 66659 <sonic-input 66660 type="search" 66661 name="search" 66662 inlineContent 66663 placeholder="Rechercher..." 66664 filteredFields="title" 66665 class="grow max-w-[20rem]" 66666 autocomplete="off" 66667 value="" 66668 class="grow lg:grow-0" 66669 > 66670 <sonic-icon library="iconoir" slot="prefix" name="search"></sonic-icon> 66671 </sonic-input> 66672 <sonic-select 66673 name="eventSelection" 66674 class="min-w-[13rem]" 66675 .options=${[ 66676 { value: "next", wording: t("next_events") }, 66677 { value: "past", wording: t("past_events") } 66678 ]} 66679 > 66680 </sonic-select> 66681 </div> 66682 <div> 66683 <sonic-queue 66684 dataProviderExpression="/user/${this.userId}/purchases/event?limit=$limit&offset=$offset${dateParam}&owner=${this.userId}&buyer=${this.userId}" 66685 limit="8" 66686 lazyBoundsRatio="4" 66687 targetRequestDuration="1000" 66688 dataFilterProvider="${DP_ACCOUNT_TICKETS_FILTERS}" 66689 key="data" 66690 > 66691 <template data-value="no-item"> 66692 <sonic-no-result></sonic-no-result> 66693 </template> 66694 <template data-value="skeleton"> 66695 <sonic-purchase-summary class="block mb-3" skeleton></sonic-purchase-summary> 66696 </template> 66697 <template> 66698 <sonic-purchase-summary class="block mb-3"></sonic-purchase-summary> 66699 </template> 66700 </sonic-queue> 66701 </div> 66702 66703 <!--AIDE RELIER BILLET AU COMPTE CLIENT--> 66704 <sonic-alert status="info" background class="my-8" dismissible dism
66704issForever id="helpLinkTickets"> 66705 <div class="font-bold mb-1">${t("help_link_tickets")}</div> 66706 <sonic-button @click=${this.linkTicketModal} size="xs" type="info" variant="outline"> 66707 <sonic-icon slot="prefix" library="custom" name="link"></sonic-icon> 66708 ${t("LIB_compte_lier_transaction")}</sonic-button 66709 > 66710 </sonic-alert> 66711 `; 66712 } 66713 }; 66714 UserAccount$3.styles = [tailwind]; 66715 __decorateClass$K([ 66716 bind$1("user.id"), 66717 n$5({ type: Number }) 66718 ], UserAccount$3.prototype, "userId", 2); 66719 __decorateClass$K([ 66720 bind$1(`${DP_ACCOUNT_TICKETS_FILTERS}.eventSelection`), 66721 r$5() 66722 ], UserAccount$3.prototype, "eventSelection", 2); 66723 UserAccount$3 = __decorateClass$K([ 66724 t$3(tagName$z) 66725 ], UserAccount$3); 66726 const cancelTicket = (purchaseId, mode2 = "freeup") => { 66727 if (!purchaseId) return; 66728 dp("cancelTicketConfirmForm").set({}); 66729 const handleSubmit = (event) => { 66730 if (event.detail?.success) { 66731 const target = event.target; 66732 if (target instanceof HTMLElement) { 66733 const parentModal = HTML.getClosestElement(target, "sonic-modal"); 66734 if (parentModal) { 66735 parentModal.hide(); 66736 } 66737 } 66738 dp("user").invalidate(); 66739 dp(DP_ACCOUNT_PURCHASES_FILTERS).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 66740 dp(DP_ACCOUNT_TICKETS_FILTERS).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 66741 dp("accountHomeTickets")?.invalidate(); 66742 } 66743 }; 66744 const title = mode2 === "freeup" ? t("free_up_confirm") : t("annuler_contre_avoir_confirm"); 66745 const content = mode2 === "freeup" ? t("free_up_short_text") : t("annuler_contre_avoir_short_text"); 66746 const endpoint = mode2 === "freeup" ? "tickets" : "tickets/cancel-for-credit"; 66747 const method = mode2 === "freeup" ? "delete" : "post"; 66748 Modal.create({ 66749 title, 66750 content, 66751 actions: b$1` 66752 <sonic-submit 66753 endpoint=${endpoint} 66754 method=${method} 66755 @submit=${handleSubmit} 66756 formDataProvider="cancelTicketConfirmForm" 66757 onClick 66758 > 66759 <sonic-input type="hidden" name="id" value="${purchaseId}"></sonic-input> 66760 <sonic-button minWidth="13rem" hideModal noAutoFill type="success"> 66761 <sonic-icon name="check" slot="prefix" library="custom"></sonic-icon> ${t("confirm")} 66762 </sonic-button> 66763 </sonic-submit> 66764 <sonic-button noAutoFill hideModal type="default">${t("cancel")} </sonic-button> 66765 ` 66766 }); 66767 }; 66768 const googleCalendarUrl = (session) => { 66769 const entity = session; 66770 const { edito, start_date, end_date, location: location2, settings } = entity; 66771 if (!start_date) return ""; 66772 const toGoogleDate = (timestamp) => new Date(timestamp * 1e3).toISOString().replace(/[-:]/g, "").replace(/\.\d+/, ""); 66773 const googleStartDate = toGoogleDate(start_date); 66774 const computedDuration = (settings?.duration || 0) * 60; 66775 const endDate = end_date ? toGoogleDate(end_date) : toGoogleDate(start_date + computedDuration); 66776 const title = edito?.alt_title || edito?.title; 66777 const subtitle = edito?.sub_title || ""; 66778 const body = edito?.body?.replaceAll("</p>", "\n").replace(/<[^>]*>?/g, "").trim() || ""; 66779 const truncadedBody = body.length > 259 ? body.slice(0, 259) + "..." : body; 66780 const googleCalendarUrl2 = new URLSearchParams({ 66781 action: "TEMPLATE", 66782 text: title + " " + subtitle || "", 66783 dates: `${googleStartDate}/${endDate}`, 66784 details: truncadedBody, 66785 location: [location2?.title, location2?.address, location2?.city, location2?.postal_code].filter(Boolean).join(" ") 66786 }); 66787 return `https://www.google.com/calendar/render?${googleCalendarUrl2}`; 66788 }; 66789 const icsCalendarUrl = (sessions, store_url) => { 66790 const urlWithoutLastSlash = store_url.replace(/\/$/, ""); 66791 return `${urlWithoutLastSlash}/calendar?${sessions.map((session) => `event_id[]=${session.id}`).join("&")}.ics`; 66792 }; 66793 var __defProp$G = Object.defineProperty; 66794 var __getOwnPropDesc$J = Object.getOwnPropertyDescriptor; 66795 var __decorateClass$J = (decorators, target, key, kind) => { 66796 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$J(target, key) : target; 66797 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66798 if (decorator = decorators[i2]) 66799 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66800 if (kind && result) __defProp$G(target, key, result); 66801 return result; 66802 }; 66803 const tagName$y = "sonic-add-to-calendar-list"; 66804 let AddToCalendarList = class extends Subscriber$1(i$6) { 66805 constructor() { 66806 super(...arguments); 66807 this.session = null; 66808 this.sessions = []; 66809 this.store_url = ""; 66810 this.uniqueSessions = []; 66811 } 66812 willUpdate(changedProperties) { 66813 if (changedProperties.has("sessions")) { 66814 this.sessions.forEach((session) => { 66815 if (session.id && !this.uniqueSessions.some((s2) => s2.id === session.id)) { 66816 this.uniqueSessions.push(session); 66817 } 66818 }); 66819 } 66820 if (changedProperties.has("store_url") || changedProperties.has("uniqueSessions")) { 66821 this.icsUrl = icsCalendarUrl(this.uniqueSessions, this.store_url); 66822 } 66823 } 66824 render() { 66825 return b$1`
66826 <sonic-button noAutofill variant="outline" class="grow" href="${this.icsUrl}" shape="block"> 66827 <sonic-icon library="custom" name="download"></sonic-icon> 66828 ${t("download_all_calendar_ics")} 66829 </sonic-button> 66830 <sonic-divider class="mt-6 mb-3"> 66831 <sonic-icon library="custom" prefix="brands" name="google"></sonic-icon> Google Agenda</sonic-divider 66832 > 66833 ${c$1( 66834 this.uniqueSessions, 66835 (session) => session.id, 66836 (session, _index) => { 66837 const googleUrl = googleCalendarUrl(session); 66838 return b$1` 66839 <sonic-product-summary 66840 class="mb-1 p-1 hover:bg-neutral-50 rounded" 66841 size="xs" 66842 .props=${session} 66843 noAutofill 66844 dataProvider="PurchaseSession/${session.id}" 66845 > 66846 <sonic-button 66847 target="_blank" 66848 href="${googleUrl}" 66849 slot="actions" 66850 noAutofill 66851 variant="outline" 66852 class="grow" 66853 shape="circle" 66854 > 66855 <sonic-icon library="custom" name="calendar-plus"></sonic-icon> 66856 </sonic-button> 66857 </sonic-product-summary> 66858 `; 66859 } 66860 )} 66861 `; 66862 } 66863 }; 66864 AddToCalendarList.styles = [tailwind]; 66865 __decorateClass$J([ 66866 n$5({ type: Object }) 66867 ], AddToCalendarList.prototype, "session", 2); 66868 __decorateClass$J([ 66869 n$5({ type: Array }) 66870 ], AddToCalendarList.prototype, "sessions", 2); 66871 __decorateClass$J([ 66872 bind$1("settings.store_url"), 66873 n$5({ type: String }) 66874 ], AddToCalendarList.prototype, "store_url", 2); 66875 __decorateClass$J([ 66876 r$5() 66877 ], AddToCalendarList.prototype, "uniqueSessions", 2); 66878 __decorateClass$J([ 66879 r$5() 66880 ], AddToCalendarList.prototype, "icsUrl", 2); 66881 AddToCalendarList = __decorateClass$J([ 66882 t$3(tagName$y) 66883 ], AddToCalendarList); 66884 var __defProp$F = Object.defineProperty; 66885 var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor; 66886 var __decorateClass$I = (decorators, target, key, kind) => { 66887 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$I(target, key) : target; 66888 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66889 if (decorator = decorators[i2]) 66890 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66891 if (kind && result) __defProp$F(target, key, result); 66892 return result; 66893 }; 66894 let PurchaseCompletion = class extends Fetcher$1(Subscriber$1(i$6)) { 66895 constructor() { 66896 super(...arguments); 66897 this.purchase_id = 0; 66898 this.forceError = false; 66899 this.wecount_link = false; 66900 this.hasAlreadyPurchased = false; 66901 this.hasLoadedOnce = false; 66902 this.data = null; 66903 this.eventIds = []; 66904 this.pixelAdded = false; 66905 } 66906 connectedCallback() { 66907 this.isFetchEnabled = false; 66908 if (!this.purchase_id) { 66909 const urlParams = new URLSearchParams(window.location.search); 66910 this.purchase_id = parseInt(urlParams.get("sonic_purchase_id") || "0"); 66911 } 66912 if (this.purchase_id) { 66913 this.setAttribute("fetch", ""); 66914 this.isFetchEnabled = true; 66915 if (this.isFetchEnabled && this.purchase_id) { 66916 this.dataProvider = `orders/${this.purchase_id}?features[]=purchases`; 66917 } 66918 const lastPurchaseId = localStorage.getItem("lastPurchaseId"); 66919 if (lastPurchaseId && lastPurchaseId === this.purchase_id.toString()) { 66920 this.hasAlreadyPurchased = true; 66921 } 66922 } else { 66923 this.forceError = true; 66924 } 66925 super.connectedCallback(); 66926 } 66927 willUpdate(changedProperties) { 66928 if (changedProperties.has("data")) { 66929 if (this.data?.status === "success") { 66930 localStorage.setItem("lastPurchaseId", this.purchase_id.toString()); 66931 this.addTracking(); 66932 } 66933 if (this.data?.status === "pending") { 66934 this.fetchEvery4s(); 66935 } 66936 if (this.data?.purchases) { 66937 this.eventIds = this.data.purchases.filter((purchase) => purchase.entity_type === EntityType.Event && purchase.entity?.id).map((purchase) => purchase.entity?.id?.toString() || ""); 66938 } 66939 } 66940 if (!this.hasLoadedOnce && this.data?.status) { 66941 this.hasLoadedOnce = true; 66942 } 66943 super.willUpdate(changedProperties); 66944 } 66945 fetchEvery4s() { 66946 setTimeout(() => { 66947 this._fetchData(); 66948 }, 7e3); 66949 } 66950 addTracking() { 66951 if (this.pixelAdded) return; 66952 this.pixelAdded = true; 66953 const orderId = this.purchase_id.toString(); 66954 const revenue = String(this.data?.amount ?? 0); 66955 TrackingManager.getTrackingManager((trackingManager) => { 66956 trackingManager.trackingOnPurchase(orderId, revenue); 66957 }); 66958 } 66959 render() { 66960 if (this.isLoading && !this.hasLoadedOnce) { 66961 return b$1`<sonic-loader align="left" mode="inline"></sonic-loader>`; 66962 } 66963 let status = this.data?.status || "need_login"; 66964 let title; 66965 let subtitle; 66966 switch (status) { 66967 case "waiting": 66968 goTo("cart"); 66969 return A$1; 66970 case "success": 66971 if (this.hasAlreadyPurchased) { 66972 title = t("purchase_completion_title_already_purchased"); 66973 } else { 66974 title = this.data?.amount ? t("purchase_completion_title") : t("purchase_completion_title_free"); 66975 } 66976 if (this.userId) { 66977 subtitle = t("purchase_completion_message_loggedIn"); 66978 } else { 66979 subtitle = t("purchase_completion_message_notLoggedIn"); 66980 } 66981 break; 66982 case "rejected": 66983 title = t("paiement_en_erreur"); 66984 subtitle = t("retry_order"); 66985 break; 66986 case "error": 66987 title = t("error_occurred"); 66988 subtitle = t("paiement_erreur"); 66989 break; 66990 case "expired": 66991 title = t("LIB_panier_expire"); 66992 subtitle = t("retry_order"); 66993 break; 66994 case "pending": 66995 title = t("payment_processing"); 66996 subtitle = t("payment_wait_reload_request"); 66997 break; 66998 case "need_login": 66999 title = t("error_occurred"); 67000 subtitle = t("purchase_completion_title_need_login"); 67001 break; 67002 default: 67003 title = t("error_occurred"); 67004 break; 67005 } 67006 return b$1` 67007 <div class="max-w-prose container"> 67008 <sonic-page-header .label="${title}" .subtitle="${subtitle}"> </sonic-page-header> 67009 67010 <!-- SI erreur --> 67011 ${status == "error" ? b$1` 67012 ${this.settingsInfos?.email_contact ? b$1`<sonic-button href="mailto:${this.settingsInfos?.email_contact}"> 67013 <sonic-icon slot="prefix" name="envelope" library="custom"></sonic-icon> 67014 ${this.settingsInfos?.email_contact}</sonic-button 67015 > ` : A$1} 67016 ` : A$1} 67017 67018 <!-- SI EN COURS -->
67019 ${status == "pending" ? b$1`<sonic-loader align="left" mode="inline"></sonic-loader> ` : A$1} 67020 ${status == "need_login" ? b$1` 67021 <sonic-app-link to="account" variant="default" type="primary"> 67022 <sonic-icon library="custom" name="user"></sonic-icon> 67023 ${t("se_connecter")} 67024 </sonic-app-link> 67025 ` : A$1} 67026 <!-- SI success --> 67027 67028 ${status == "success" ? b$1` 67029 <div class="flex flex-wrap gap-2"> 67030 ${this.data?.pdf_url ? b$1` <sonic-button target="_blank" type="primary" href="${this.data.pdf_url}" 67031 ><sonic-icon library="custom" name="file-pdf" slot="prefix"></sonic-icon>${t( 67032 "purchase_completion_download" 67033 )}</sonic-button 67034 >` : A$1} 67035 ${this.data?.mandate_pdf_url ? b$1`<sonic-button target="_blank" href="${this.data.mandate_pdf_url}" 67036 ><sonic-icon library="custom" name="file-pdf" slot="prefix"></sonic-icon>${t( 67037 "mandat_imprimer" 67038 )}</sonic-button 67039 >` : A$1} 67040 ${this.renderAddToCalendar()} 67041 </div> 67042 <!-- SI loggé + pas d'email envoyé --> 67043 ${this.userId && this.send_order_mail === false ? b$1` 67044 <sonic-alert 67045 status="success" 67046 class="mt-12" 67047 background 67048 label="${t("purchase_completion_alert_label_loggedIn")}" 67049 text="${t("purchase_completion_alert_text_loggedIn")}" 67050 > 67051 <sonic-icon slot="icon" name="envelope" library="custom" size="lg"></sonic-icon> 67052 </sonic-alert> 67053 ` : A$1} 67054 67055 <!-- SI on envoie les email ou utilisateur achat sans compte --> 67056 ${!this.userId || this.send_order_mail === true ? b$1` 67057 <sonic-alert 67058 status="info" 67059 class="mt-12" 67060 background 67061 label="${t("purchase_completion_alert_label_notLoggedIn")}" 67062 text="${t("purchase_completion_alert_text_notLoggedIn")}" 67063 > 67064 <sonic-icon slot="icon" name="envelope" library="custom" size="lg"></sonic-icon> 67065 </sonic-alert> 67066 ` : A$1} 67067 ${this.wecount_link && this.settingsInfos?.store_url ? b$1` <a 67068 href="https://mep.wecount.io/campaigns/8ed50c2b-3295-445c-b5d4-56ee12b1b0c1/form" 67069 target="_blank" 67070 class="block mt-2 hover:shadow-[0px_0px_0_3px_#ffb71d] transition rounded-md overflow-hidden" 67071 ><sonic-image 67072 src="${this.settingsInfos?.store_url}/sites/all/themes/superstrap/img/wecount.png" 67073 ></sonic-image 67074 ></a>` : A$1} 67075 ` : A$1} 67076 </div> 67077 `; 67078 } 67079 renderAddToCalendar() { 67080 const eventPurchases = this.data?.purchases?.filter( 67081 (purchase) => purchase.entity_type === EntityType.Event && purchase.entity?.id 67082 ); 67083 const sessions = eventPurchases?.map((purchase) => purchase.entity); 67084 if (!sessions || sessions.length === 0) return A$1; 67085 return b$1`<sonic-button @click=${() => this.renderAddToCalendarModal(sessions)}> 67086 <sonic-icon library="custom" slot="prefix" name="calendar-plus"></sonic-icon> 67087 ${t("add_to_calendar")} 67088 </sonic-button>`; 67089 } 67090 renderAddToCalendarModal(sessions) { 67091 Modal.create({ 67092 title: t("add_to_calendar"), 67093 content: b$1`<sonic-add-to-calendar-list .sessions=${sessions}></sonic-add-to-calendar-list>`, 67094 maxWidth: "40rem", 67095 removeOnHide: true 67096 }); 67097 } 67098 }; 67099 PurchaseCompletion.styles = [tailwind]; 67100 __decorateClass$I([ 67101 bind$1("user.id"), 67102 n$5({ type: String }) 67103 ], PurchaseCompletion.prototype, "userId", 2); 67104 __decorateClass$I([ 67105 bind$1("settings.send_order_mail"), 67106 n$5({ type: Boolean }) 67107 ], PurchaseCompletion.prototype, "send_order_mail", 2); 67108 __decorateClass$I([ 67109 bind$1("settings.infos"), 67110 n$5({ type: Object }) 67111 ], PurchaseCompletion.prototype, "settingsInfos", 2); 67112 __decorateClass$I([ 67113 n$5({ type: Number }) 67114 ], PurchaseCompletion.prototype, "purchase_id", 2); 67115 __decorateClass$I([ 67116 n$5({ type: Boolean }) 67117 ], PurchaseCompletion.prototype, "forceError", 2); 67118 __decorateClass$I([ 67119 bind$1("settings.wecount_link"), 67120 n$5({ type: Boolean }) 67121 ], PurchaseCompletion.prototype, "wecount_link", 2); 67122 __decorateClass$I([ 67123 n$5({ type: Boolean }) 67124 ], PurchaseCompletion.prototype, "hasAlreadyPurchased", 2); 67125 __decorateClass$I([ 67126 n$5({ type: Boolean }) 67127 ], PurchaseCompletion.prototype, "hasLoadedOnce", 2); 67128 __decorateClass$I([ 67129 n$5({ type: Object }) 67130 ], PurchaseCompletion.prototype, "data", 2); 67131 __decorateClass$I([ 67132 r$5() 67133 ], PurchaseCompletion.prototype, "eventIds", 2); 67134 __decorateClass$I([ 67135 r$5() 67136 ], PurchaseCompletion.prototype, "pixelAdded", 2); 67137 PurchaseCompletion = __decorateClass$I([ 67138 t$3("sonic-checkout-process-end") 67139 ], PurchaseCompletion); 67140 var __defProp$E = Object.defineProperty; 67141 var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor; 67142 var __decorateClass$H = (decorators, target, key, kind) => { 67143 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$H(target, key) : target; 67144 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67145 if (decorator = decorators[i2]) 67146 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67147 if (kind && result) __defProp$E(target, key, result); 67148 return result; 67149 }; 67150 let instanceCounter$1 = 0; 67151 let SonicRefundForm = class extends Subscriber$1(i$6) { 67152 constructor() { 67153 super(...arguments); 67154 this.id = ""; 67155 this.barcode = ""; 67156 this.entity_type = "event";
67157 this.success = false; 67158 this._editBankingInfo = false; 67159 this._hasBankingInfo = false; 67160 this.formDataProvider = "refundForm" + instanceCounter$1++; 67161 this.ribInfoFormDataProvider = "ribInfoForm" + instanceCounter$1++; 67162 } 67163 handleSubmit(event) { 67164 this.success = !!event.detail.success; 67165 } 67166 handleSubmitBankingInfo(event) { 67167 if (event.detail.success) { 67168 this._editBankingInfo = false; 67169 dp("user").invalidate(); 67170 } 67171 } 67172 willUpdate(changedProperties) { 67173 if (changedProperties.has("user")) { 67174 const { iban, bic, rib_uploaded_at } = this.user ?? {}; 67175 if (!iban && !bic && !rib_uploaded_at) { 67176 this._hasBankingInfo = false; 67177 } else { 67178 this._hasBankingInfo = true; 67179 } 67180 } 67181 } 67182 render() { 67183 const userId = this.user?.id; 67184 const { enable_iban_bic_txt, enable_iban_bic_pdf } = this.settings?.refund_form ?? {}; 67185 const bothFormatAreEnabled = enable_iban_bic_txt && enable_iban_bic_pdf; 67186 const { iban, bic, rib_uploaded_at } = this.user ?? {}; 67187 if (!this.id || !userId) return A$1; 67188 if (this.success) { 67189 return b$1`<sonic-alert 67190 status="success" 67191 label=${t("LIB_remboursement_confirme")} 67192 class="my-6" 67193 background 67194 ></sonic-alert> 67195 <sonic-app-link noAutoFill to="account.purchases" variant="default" type="primary" autoActive="disabled"> 67196 <sonic-icon name="clock-rotate-left" slot="prefix" library="custom"></sonic-icon> 67197 ${t("mes_achats")}</sonic-app-link 67198 > 67199 <sonic-button 67200 noAutoFill 67201 variant="ghost" 67202 @click=${() => { 67203 this.success = false; 67204 dp(this.formDataProvider).barcode.set(""); 67205 this.barcode = ""; 67206 }} 67207 > 67208 <sonic-icon name="plus" slot="prefix" library="custom"></sonic-icon> 67209 ${t("LIB_nouvelle_demande")}</sonic-button 67210 > `; 67211 } 67212 if (this._editBankingInfo) { 67213 return b$1` 67214 <form formDataProvider=${this.ribInfoFormDataProvider}> 67215 <sonic-fieldset label=${t("LIB_remboursement_infos_bancaires")} iconName="file-invoice" iconLibrary="custom"> 67216 <sonic-form-layout> 67217 ${enable_iban_bic_txt ? b$1` 67218 <sonic-input 67219 ?required=${enable_iban_bic_txt} 67220 type="text" 67221 label=${t("IBAN")} 67222 name="iban" 67223 placeholder="FR00 0000 0000 0000 0000 0000 0000 000" 67224 value=${iban} 67225 ></sonic-input> 67226 <sonic-input 67227 ?required=${enable_iban_bic_txt} 67228 type="text" 67229 label=${t("BIC")} 67230 name="bic" 67231 placeholder="- - - - - - -" 67232 value=${bic} 67233 ></sonic-input> 67234 ` : A$1} 67235 ${bothFormatAreEnabled ? b$1` <sonic-divider></sonic-divider> ` : A$1} 67236 ${enable_iban_bic_pdf ? b$1` 67237 <sonic-file-upload 67238 label=${t("RIB")} 67239 name="rib" 67240 .accept=${["image/jpeg", "image/png", "image/jpg", "application/pdf", "image/gif"]} 67241 ?required=${enable_iban_bic_pdf} 67242 ></sonic-file-upload> 67243 ` : A$1} 67244 </sonic-form-layout> 67245 </sonic-fieldset> 67246 <div class="flex gap-2"> 67247 <sonic-submit 67248 onClick 67249 endpoint="user/${userId}/banking-info" 67250 @submit=${this.handleSubmitBankingInfo} 67251 method="post" 67252 > 67253 <sonic-button noAutoFill type="success" 67254 ><sonic-icon slot="prefix" name="check" library="custom"></sonic-icon> ${t("mettre_a_jour")} 67255 </sonic-button> 67256 </sonic-submit> 67257 67258 ${this._hasBankingInfo ? b$1` 67259 <sonic-button 67260 @click=${() => { 67261 this._editBankingInfo = false;
67262 dp("user").invalidate(); 67263 }} 67264 > 67265 <sonic-icon name="arrow-rotate-left" slot="prefix" library="custom"></sonic-icon> 67266 ${t("annuler")} 67267 </sonic-button> 67268 ` : A$1} 67269 </div> 67270 </form> 67271 `; 67272 } 67273 const ribIsMissing = this.user && !rib_uploaded_at && enable_iban_bic_pdf; 67274 const ibanOrBicIsMissing = this.user && (!iban || !bic) && enable_iban_bic_txt; 67275 return b$1`<sonic-fieldset 67276 label=${t("LIB_remboursement_infos_bancaires")} 67277 iconName="file-invoice" 67278 iconLibrary="custom" 67279 > 67280 ${iban ? b$1`<div><b>${t("IBAN")}</b> : ${iban}</div>` : A$1} 67281 ${bic ? b$1`<div><b>${t("BIC")}</b> : ${bic}</div>` : A$1} 67282 ${rib_uploaded_at ? b$1`<div> 67283 <b>${t("RIB")}</b> : ${t("LIB_updated_at")} <sonic-date date=${rib_uploaded_at}></sonic-date> 67284 </div>` : A$1} 67285 ${ribIsMissing || ibanOrBicIsMissing ? b$1`<sonic-alert 67286 status="error" 67287 label=${t("LIB_remboursement_infos_bancaires_incompletes")} 67288 class="mt-2 animate-pulse" 67289 ></sonic-alert>` : A$1} 67290 <sonic-button 67291 size="sm" 67292 class="mt-2" 67293 variant="outline" 67294 @click=${() => { 67295 this._editBankingInfo = true; 67296 }} 67297 type="${ribIsMissing || ibanOrBicIsMissing ? "danger" : "default"}" 67298 > 67299 <sonic-icon name="pencil" slot="prefix" library="custom"></sonic-icon> 67300 ${t("Modifier")} 67301 </sonic-button> 67302 </sonic-fieldset> 67303 <form formDataProvider=${this.formDataProvider}> 67304 <sonic-input type="hidden" name="event_id" value=${this.id}></sonic-input> 67305 ${userId ? b$1`<sonic-input type="hidden" name="user_id" value=${userId}></sonic-input>` : A$1} 67306 <sonic-input type="hidden" name="entity_type" value=${this.entity_type}></sonic-input> 67307 67308 <sonic-fieldset> 67309 <sonic-form-layout> 67310 <sonic-input 67311 type="text" 67312 label=${t("barcode_or_ticket_number")} 67313 name="barcode" 67314 placeholder="- - - - - - - - - - - -" 67315 required 67316 value=${this.barcode} 67317 > 67318 <sonic-app-link slot="description" noAutoFill to="account.purchases" variant="link" autoActive="disabled"> 67319 <sonic-icon name="arrow-right" slot="prefix" library="custom"></sonic-icon> 67320 ${t("LIB_rechercher_mon_billet")} 67321 </sonic-app-link> 67322 </sonic-input> 67323 </sonic-form-layout> 67324 </sonic-fieldset> 67325 <sonic-submit 67326 onClick 67327 endpoint="refunds/ask" 67328 @submit=${this.handleSubmit} 67329 method="post" 67330 ?disabled=${ribIsMissing || ibanOrBicIsMissing} 67331 > 67332 <sonic-button noAutoFill type="success" ?disabled=${ribIsMissing || ibanOrBicIsMissing} 67333 ><sonic-icon slot="prefix" name="check" library="custom"></sonic-icon> ${t("confirm")} 67334 </sonic-button> 67335 </sonic-submit> 67336 </form> `; 67337 } 67338 }; 67339 SonicRefundForm.styles = [tailwind]; 67340 __decorateClass$H([ 67341 n$5({ type: String, attribute: "data-id" }) 67342 ], SonicRefundForm.prototype, "id", 2); 67343 __decorateClass$H([ 67344 n$5({ type: String }) 67345 ], SonicRefundForm.prototype, "barcode", 2); 67346 __decorateClass$H([ 67347 n$5({ type: String }) 67348 ], SonicRefundForm.prototype, "entity_type", 2); 67349 __decorateClass$H([ 67350 bind$1("user"), 67351 n$5({ type: Object }) 67352 ], SonicRefundForm.prototype, "user", 2); 67353 __decorateClass$H([ 67354 bind$1("settings"), 67355 n$5({ type: Object }) 67356 ], SonicRefundForm.prototype, "settings", 2); 67357 __decorateClass$H([ 67358 r$5() 67359 ], SonicRefundForm.prototype, "success", 2); 67360 __decorateClass$H([ 67361 r$5() 67362 ], SonicRefundForm.prototype, "_editBankingInfo", 2); 67363 __decorateClass$H([ 67364 r$5() 67365 ], SonicRefundForm.prototype, "_hasBankingInfo", 2); 67366 SonicRefundForm = __decorateClass$H([ 67367 t$3("sonic-refund-form") 67368 ], SonicRefundForm); 67369 var __defProp$D = Object.defineProperty; 67370 var __getOwnPropDesc$G = Object.getOwnPropertyDescriptor; 67371 var __decorateClass$G = (decorators, target, key, kind) => { 67372 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$G(target, key) : target; 67373 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67374 if (decorator = decorators[i2]) 67375 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67376 if (kind && result) __defProp$D(target, key, result); 67377 return result; 67378 }; 67379 const tagName$x = "sonic-refund"; 67380 let SonicRefund = class extends i$6 { 67381 constructor() { 67382 super(...arguments); 67383 this.event_id = ""; 67384 this.barcode = ""; 67385 this.displayTitle = false;
67386 this.displayText = false; 67387 this.smallTitle = false; 67388 } 67389 connectedCallback() { 67390 const urlParams = new URLSearchParams(window.location.search); 67391 if (!this.event_id) { 67392 this.event_id = urlParams.get("event_id") || ""; 67393 } 67394 if (!this.barcode) { 67395 this.barcode = urlParams.get("barcode") || ""; 67396 } 67397 super.connectedCallback(); 67398 } 67399 async willUpdate(changedProperties) { 67400 if (changedProperties.has("event_id") && this.event_id) { 67401 this.sessionResult = await this.fetchEvent(); 67402 } 67403 } 67404 async fetchEvent() { 67405 const api2 = new API(HTML$1.getApiConfiguration(this)); 67406 const endpoint = entityEndPoint({ 67407 entityType: EntityType.Event, 67408 entityId: Number(this.event_id), 67409 view: entityView.essential, 67410 features: [Feature.Status] 67411 }); 67412 const result = await api2.get(endpoint); 67413 return result; 67414 } 67415 render() { 67416 return b$1`<sonic-page-layout 67417 ?smallTitle=${this.smallTitle} 67418 ?displayTitle=${this.displayTitle} 67419 ?displayText=${this.displayText} 67420 pageTitle=${t("remboursement")} 67421 pageText=${t("LIB_remboursement_texte_aide")} 67422 > 67423 <div class="max-w-[60rem]"> 67424 <!-- intro selon évènement --> 67425 ${this.renderForm()} 67426 67427 <!-- Si connecté pas d'évènement passé, la liste est affichée --> 67428 ${this.renderList()} 67429 </div> 67430 </sonic-page-layout>`; 67431 } 67432 renderForm() { 67433 const isLogged = !!this.userId; 67434 const sessionData = this.sessionResult?.data; 67435 const displayEvent = isLogged && this.event_id; 67436 const displayForm = displayEvent && sessionData?.settings?.refund?.enabled === true; 67437 const displayRefundIsNotEnabled = displayEvent && sessionData?.settings?.refund?.enabled === false; 67438 const display404 = displayEvent && this.sessionResult?.success === false; 67439 return b$1` 67440 ${sessionData ? b$1` 67441 <sonic-product-summary 67442 dataProvider="sessionRefundData/${this.event_id}" 67443 noAutoFill 67444 .props=${sessionData} 67445 class="mb-5 block" 67446 .featureDisplay=${[ProductDisplay.Status, ProductDisplay.Location]} 67447 ></sonic-product-summary> 67448 ` : A$1} 67449 67450 <!-- Si Pas connecté --> 67451 ${!isLogged ? b$1`<sonic-user-form-login 67452 class="mt-8 w-full" 67453 createSubTitle="${t("LIB_remboursement_pas_de_compte_2")}" 67454 createAccount 67455 ></sonic-user-form-login>` : A$1} 67456 67457 <!-- Si connecté et eventId en contexte du composant --> 67458 ${displayForm ? b$1`<sonic-refund-form .id="${this.event_id}" barcode="${this.barcode}"></sonic-refund-form> ` : A$1} 67459 ${display404 ? b$1`<sonic-alert status="error" background label=${t("LIB_event_404")} class="my-5"></sonic-alert>` : A$1} 67460 ${displayRefundIsNotEnabled ? b$1`<sonic-alert 67461 status="error" 67462 background 67463 label=${t("LIB_event_refund_not_enabled")} 67464 class="my-5" 67465 ></sonic-alert>` : A$1} 67466 `; 67467 } 67468 renderList() { 67469 const isLogged = !!this.userId; 67470 if (!isLogged || this.event_id) return A$1; 67471 return b$1` <sonic-queue 67472 dataProviderExpression="sessions?limit=$limit&offset=$offset&refund=1&features[]=picture&features[]=location" 67473 key="data" 67474 limit="5" 67475 targetRequestDuration="1000" 67476 class="mt-8" 67477 .noItems=${() => b$1`<sonic-no-result .text=${t("LIB_remboursement_aucun_evenement")}></sonic-no-result>`} 67478 .items=${(_item) => b$1`<sonic-button 67479 variant="unstyled" 67480 class="w-full" 67481 @click=${() => this.event_id = _item.id?.toString() || ""} 67482 ><sonic-product-summary .featureDisplay=${[ProductDisplay.Status, ProductDisplay.Location]} class="w-full"> 67483 <sonic-button slot="actions" icon shape="circle"> 67484 <sonic-icon name="chevron-right" library="custom"></sonic-icon> 67485 </sonic-button> </sonic-product-summary 67486 ></sonic-button> 67487 <sonic-divider class="my-4"></sonic-divider>`} 67488 > 67489 </sonic-queue>`; 67490 } 67491 }; 67492 SonicRefund.styles = [tailwind]; 67493 __decorateClass$G([ 67494 n$5({ type: String }) 67495 ], SonicRefund.prototype, "event_id", 2); 67496 __decorateClass$G([ 67497 n$5({ type: String }) 67498 ], SonicRefund.prototype, "barcode", 2); 67499 __decorateClass$G([ 67500 n$5({ type: Boolean }) 67501 ], SonicRefund.prototype, "displayTitle", 2); 67502 __decorateClass$G([ 67503 n$5({ type: Boolean }) 67504 ], SonicRefund.prototype, "displayText", 2); 67505 __decorateClass$G([ 67506 n$5({ type: Boolean }) 67507 ], SonicRefund.prototype, "smallTitle", 2); 67508 __decorateClass$G([ 67509 bind$1("user.id"), 67510 n$5({ type: String }) 67511 ], SonicRefund.prototype, "userId", 2); 67512 __decorateClass$G([ 67513 r$5() 67514 ], SonicRefund.prototype, "sessionResult", 2); 67515 SonicRefund = __decorateClass$G([ 67516 t$3(tagName$x) 67517 ], SonicRefund); 67518 var __defProp$C = Object.defineProperty; 67519 var __getOwnPropDesc$F = Object.getOwnPropertyDescriptor; 67520 var __decorateClass$F = (decorators, target, key, kind) => { 67521 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$F(target, key) : target; 67522 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67523 if (decorator = decorators[i2]) 67524 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67525 if (kind && result) __defProp$C(target, key, result); 67526 return result; 67527 }; 67528 let SonicComponent$6 = class SonicComponent extends Subscriber$1(i$6) { 67529 constructor() { 67530 super(...arguments); 67531 this.logoFallback = false;
67532 } 67533 render() { 67534 const theme = this.props; 67535 if (!theme) return A$1; 67536 const bannerDesktop = theme.banners?.banner_desktop?.ratio_auto_1920 || theme.banners?.banner_desktop?.src; 67537 const bannerMobile = theme.banners?.banner_mobile?.ratio_auto_1000 || theme.banners?.banner_mobile?.src; 67538 const logo = theme.banners?.banner_mobile?.ratio_auto_640 || theme.logos?.logo_billetterie?.src; 67539 let LogoVisiblityClass = "flex"; 67540 if (bannerDesktop && !bannerMobile) { 67541 LogoVisiblityClass = "flex lg:hidden"; 67542 } 67543 if (!bannerDesktop && bannerMobile) { 67544 LogoVisiblityClass = "hidden lg:flex"; 67545 } 67546 return b$1` 67547 ${bannerDesktop ? b$1` 67548 <a href="/" class="lb_banner-desktop overflow-hidden rounded-lg w-full mb-10 [display:none] lg:block "> 67549 <img loading="eager" src="${bannerDesktop}" class="block w-full" alt="" /> 67550 </a> 67551 ` : ""} 67552 ${bannerMobile ? b$1` 67553 <a href="/" class="lb_banner-mobile overflow-hidden rounded-md w-full mb-7 block lg:hidden"> 67554 <img loading="eager" src="${bannerMobile}" class="block w-full" alt="" /> 67555 </a> 67556 ` : ""} 67557 ${this.logoFallback && logo && !(bannerDesktop && bannerMobile) ? b$1` 67558 <div class=" justify-center items-center my-4 lg:mt-8 lg:mb-12 ${LogoVisiblityClass}"> 67559 <a href="/" class="contents"> 67560 <img 67561 loading="eager" 67562 src="${logo}" 67563 alt="" 67564 class="block max-w-[16rem] lg:max-w-[32rem] max-h-[10rem] object-contain w-10/12" 67565 /> 67566 </a> 67567 </div> 67568 ` : ""} 67569 `; 67570 } 67571 }; 67572 SonicComponent$6.styles = [tailwind]; 67573 __decorateClass$F([ 67574 n$5({ type: Boolean }) 67575 ], SonicComponent$6.prototype, "logoFallback", 2); 67576 SonicComponent$6 = __decorateClass$F([ 67577 t$3("sonic-banner") 67578 ], SonicComponent$6); 67579 var __defProp$B = Object.defineProperty; 67580 var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor; 67581 var __decorateClass$E = (decorators, target, key, kind) => { 67582 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$E(target, key) : target; 67583 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67584 if (decorator = decorators[i2]) 67585 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67586 if (kind && result) __defProp$B(target, key, result); 67587 return result; 67588 }; 67589 const tagName$w = "sonic-fullscreen-layout"; 67590 let SonicComponent$5 = class SonicComponent extends Subscriber$1(i$6) { 67591 constructor() { 67592 super(...arguments); 67593 this.largeAside = false;
67594 this.forceZindex = false; 67595 this.displayBanner = false; 67596 this.noAside = false; 67597 this.noHeader = false; 67598 this.alwaysTwoColumns = false; 67599 this.isWaiting = false; 67600 } 67601 connectedCallback() { 67602 super.connectedCallback(); 67603 document.documentElement.scrollTop; 67604 document.body.style.overflow = "hidden"; 67605 if (this.forceZindex) { 67606 const yolos = document.querySelectorAll("*"); 67607 yolos.forEach((el) => { 67608 const zIndex = window.getComputedStyle(el, null).getPropertyValue("z-index"); 67609 if (el instanceof HTMLElement && zIndex && el != this) { 67610 el.classList.add("sc-disable-zindex"); 67611 } 67612 document.head.insertAdjacentHTML( 67613 "beforeend", 67614 `<style>body{height:0 !important;overflow:hidden !important;}.sc-disable-zindex{z-index: auto !important; position: initial !important;}</style>` 67615 ); 67616 }); 67617 } 67618 } 67619 disconnectedCallback() { 67620 if (this.forceZindex) { 67621 document.querySelectorAll(".sc-disable-zindex").forEach((el) => { 67622 if (el instanceof HTMLElement && el != this) { 67623 el.classList.remove("sc-disable-zindex"); 67624 } 67625 }); 67626 } 67627 document.body.style.removeProperty("overflow"); 67628 super.disconnectedCallback(); 67629 } 67630 ensureScrollGuard() { 67631 const el = this.renderRoot.querySelector(".custom-scroll"); 67632 if (!el) return; 67633 watchScrollRoot(el); 67634 restoreScrollRoot(el); 67635 requestAnimationFrame(() => { 67636 restoreScrollRoot(el); 67637 requestAnimationFrame(() => restoreScrollRoot(el)); 67638 }); 67639 } 67640 updated(_changedProperties) { 67641 this.ensureScrollGuard(); 67642 super.updated(_changedProperties); 67643 } 67644 render() { 67645 if (this.isWaiting) return A$1; 67646 const defaultImageSrc = this.defaultImage?.is_animated ? this.defaultImage?.src : this.defaultImage?.ratio_1x1_1000; 67647 const gridClasses = this.alwaysTwoColumns ? "grid-cols-[minmax(0,1fr)_minmax(0,1.5fr)]" : this.largeAside ? "lg:grid-cols-[minmax(0,1fr)_minmax(0,1.5fr)]" : "lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]"; 67648 const asideHeightClass = this.alwaysTwoColumns ? "h-full" : this.noHeader ? "lg:h-full" : "lg:h-[c
67648alc(100vh-4rem)]"; 67649 const defaultAsideClass = this.alwaysTwoColumns ? "relative h-full bg-neutral-100 rounded-lg overflow-hidden block" : "relative h-full bg-neutral-100 rounded-lg overflow-hidden hidden lg:block"; 67650 return b$1`<div class="wrapper grid ${gridClasses} gap-y-6 lg:gap-y-8 custom-scroll h-full gap-x-9 py-cgy px-cgx "> 67651 <div class="flex flex-col min-w-0 relative z-[2]"> 67652 ${this.noHeader ? A$1 : b$1`<sonic-header showOffCanvas noPaddingX class="mb-10"></sonic-header>`} 67653 <slot></slot> 67654 </div> 67655 67656 <!-- affiche la banniere (exemple campagne) --> 67657 ${this.displayBanner ? b$1`<div class=""> 67658 ${this.bannerDesktopSrc ? b$1`<div 67659 class="hidden lg:block overflow-clip rounded-bl-lg -mt-cgy -ml-[calc(var(--sc-container-gutter-x)/2)] -mr-cgx mb-8" 67660 > 67661 <img src="${this.bannerDesktopSrc}" class="max-h-[11rem] w-full h-full object-cover" alt="" /> 67662 </div>` : A$1} 67663 <slot name="aside"></slot> 67664 </div> ` : A$1} 67665 67666 <!-- pas de banniere --> 67667 ${!this.displayBanner ? b$1` <div 67668 class="aside 67669 sticky 67670 top-0 67671 ${asideHeightClass} 67672 lg:-mr-[calc(var(--sc-container-gutter-x)_-_var(--sc-container-gutter-y))] 67673 " 67674 > 67675 <slot name="aside"> 67676 <div class="${defaultAsideClass}"> 67677 ${defaultImageSrc ? b$1`<sonic-image cover src="${defaultImageSrc}" />` : b$1` 67678 <sonic-fetch dataProvider="shows?featured=1&next=1&limit=1" key="data.0"> 67679 <sonic-product-illustration cover></sonic-product-illustration> 67680 </sonic-fetch> 67681 `} 67682 </div> 67683 </slot> 67684 </div>` : A$1} 67685 </div>`; 67686 } 67687 }; 67688 SonicComponent$5.styles = [ 67689 tailwind, 67690 customScroll, 67691 i$9` 67692 :host { 67693 position: fixed !important; 67694 top: 0 !important; 67695 left: 0 !important; 67696 right: 0 !important; 67697 bottom: 0 !important; 67698 background-color: var(--sc-base); 67699 color: var(--sc-base-content); 67700 z-index: 900 !important; 67701 } 67702 ` 67703 ]; 67704 __decorateClass$E([ 67705 bind$1("theme.banners.banner_desktop.ratio_auto_1920"), 67706 n$5({ type: String }) 67707 ], SonicComponent$5.prototype, "bannerDesktopSrc", 2); 67708 __decorateClass$E([ 67709 bind$1("theme.banners.default_image"), 67710 n$5({ type: String }) 67711 ], SonicComponent$5.prototype, "defaultImage", 2); 67712 __decorateClass$E([ 67713 n$5({ type: Boolean }) 67714 ], SonicComponent$5.prototype, "largeAside", 2); 67715 __decorateClass$E([ 67716 n$5({ type: Boolean }) 67717 ], SonicComponent$5.prototype, "forceZindex", 2); 67718 __decorateClass$E([ 67719 n$5({ type: Boolean }) 67720 ], SonicComponent$5.prototype, "displayBanner", 2); 67721 __decorateClass$E([ 67722 n$5({ type: Boolean }) 67723 ], SonicComponent$5.prototype, "noAside", 2); 67724 __decorateClass$E([ 67725 n$5({ type: Boolean }) 67726 ], SonicComponent$5.prototype, "noHeader", 2); 67727 __decorateClass$E([ 67728 n$5({ type: Boolean }) 67729 ], SonicComponent$5.prototype, "alwaysTwoColumns", 2); 67730 __decorateClass$E([ 67731 bind$1("sonicTicketApp.isWaiting"), 67732 r$5() 67733 ], SonicComponent$5.prototype, "isWaiting", 2); 67734 SonicComponent$5 = __decorateClass$E([ 67735 t$3(tagName$w) 67736 ], SonicComponent$5); 67737 var __defProp$A = Object.defineProperty; 67738 var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor; 67739 var __decorateClass$D = (decorators, target, key, kind) => { 67740 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target; 67741 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67742 if (decorator = decorators[i2]) 67743 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67744 if (kind && result) __defProp$A(target, key, result); 67745 return result; 67746 }; 67747 let UserFormCreate = class extends Subscriber$1(i$6) { 67748 constructor() { 67749 super(...arguments); 67750 this.paymentId = 0; 67751 } 67752 connectedCallback() { 67753 const urlParams = new URLSearchParams(window.location.search);
67754 this.mailHash = urlParams.get("sonic_mail_hash") || void 0; 67755 super.connectedCallback(); 67756 } 67757 render() { 67758 let iframeSrc = "/inscription?no_title=true"; 67759 if (this.paymentId) { 67760 iframeSrc += `&payment_id=${this.paymentId}`; 67761 } 67762 if (this.mailHash) { 67763 iframeSrc = `/inscription/rel:${this.mailHash}?no_title=true`; 67764 } 67765 return b$1` <div class="prose prose-sm mb-8">${t("info_form_inscription_acces_direct", true)}</div> 67766 <sonic-iframe src="${iframeSrc}"></sonic-iframe>`; 67767 } 67768 }; 67769 UserFormCreate.styles = [tailwind]; 67770 __decorateClass$D([ 67771 n$5({ type: Number }) 67772 ], UserFormCreate.prototype, "paymentId", 2); 67773 __decorateClass$D([ 67774 n$5({ type: String }) 67775 ], UserFormCreate.prototype, "mailHash", 2); 67776 UserFormCreate = __decorateClass$D([ 67777 t$3("sonic-user-form-create") 67778 ], UserFormCreate); 67779 var __defProp$z = Object.defineProperty; 67780 var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor; 67781 var __decorateClass$C = (decorators, target, key, kind) => { 67782 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target; 67783 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67784 if (decorator = decorators[i2]) 67785 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67786 if (kind && result) __defProp$z(target, key, result); 67787 return result; 67788 }; 67789 const tagName$v = "sonic-sepa-schedule"; 67790 function renderPaymentIcon(entityType) { 67791 let iconName = "credit-card"; 67792 switch (entityType) { 67793 case EntityType.Credit: 67794 iconName = "wallet"; 67795 break; 67796 case EntityType.Giftcard: 67797 iconName = "gift-card"; 67798 break; 67799 case "sepa": 67800 iconName = "pen-nib"; 67801 break; 67802 } 67803 return b$1`<sonic-icon size="xs" name="${iconName}" library="custom"></sonic-icon>`; 67804 } 67805 let SonicSepaSchedule = class extends Subscriber$1(i$6) { 67806 constructor() { 67807 super(...arguments); 67808 this.cartId = "current"; 67809 this.total = 0; 67810 this.schedules = "[]"; 67811 this.pspTitle = t("LIB_carte_bancaire"); 67812 this.sepaTitle = t("LIB_mandat_sepa"); 67813 } 67814 render() { 67815 let scheduleDates = [];
67816 try { 67817 scheduleDates = JSON.parse(this.schedules); 67818 } catch { 67819 scheduleDates = []; 67820 } 67821 if (!Array.isArray(scheduleDates) || scheduleDates.length < 2) { 67822 return A$1; 67823 } 67824 const cart = this._cartData; 67825 const initialTotal = Number(this.total || 0); 67826 let grossTotal = Number(cart?.total ?? 0); 67827 if (grossTotal <= 0 && initialTotal > 0) { 67828 grossTotal = initialTotal; 67829 } 67830 const extrasList = []; 67831 let extrasTotal = 0; 67832 cart?.extras?.forEach((extra) => { 67833 const amt = Math.abs(Number(extra.price?.amount)); 67834 if (amt <= 0) { 67835 return; 67836 } 67837 extrasTotal += amt; 67838 extrasList.push(extra); 67839 }); 67840 if (grossTotal <= 0 && Number(cart?.subTotal ?? 0) > 0) { 67841 grossTotal = Number(cart?.subTotal ?? 0) + extrasTotal; 67842 } 67843 const netAmount = Math.max(0, grossTotal - extrasTotal); 67844 const count = scheduleDates.length; 67845 const baseAmount = Math.round(netAmount / count * 100) / 100; 67846 const lastAmount = Math.round((netAmount - baseAmount * (count - 1)) * 100) / 100; 67847 return b$1` 67848 <sonic-table size="sm"> 67849 <sonic-thead> 67850 <sonic-tr> 67851 <sonic-th>${t("LIB_sepa_moyen_de_paiement")}</sonic-th> 67852 <sonic-th>${t("LIB_sepa_date_de_prelevement")}</sonic-th> 67853 <sonic-th align="right">${t("LIB_sepa_montant")}</sonic-th> 67854 </sonic-tr> 67855 </sonic-thead> 67856 67857 <sonic-tbody> 67858 <!-- 1st installment: due today --> 67859 <sonic-tr> 67860 <sonic-td class="text-info"> 67861 ${renderPaymentIcon(null)} 67862 <span class="font-bold text-info">${this.pspTitle}</span> 67863 </sonic-td> 67864 <sonic-td class="font-bold text-info"> ${t("LIB_sepa_aujourdhui")} </sonic-td> 67865 <sonic-td align="right"> <span class="font-bold text-info">
67865${formatAmount(baseAmount)}</span> </sonic-td> 67866 </sonic-tr> 67867 67868 <!-- Extras (Credits, Vouchers, etc.): light gray --> 67869 ${extrasList.map( 67870 (item) => b$1` 67871 <sonic-tr> 67872 <sonic-td> 67873 ${renderPaymentIcon(item.entity_type)} 67874 <span>${item.price?.label}</span> 67875 </sonic-td> 67876 <sonic-td>${t("LIB_sepa_aujourdhui")}</sonic-td> 67877 <sonic-td align="right"> ${formatAmount(Math.abs(item.price?.amount ?? 0))} </sonic-td> 67878 </sonic-tr> 67879 ` 67880 )} 67881 67882 <!-- Future SEPA schedules: bold --> 67883 ${scheduleDates.slice(1).map( 67884 (date2, index) => b$1` 67885 <sonic-tr> 67886 <sonic-td> 67887 ${renderPaymentIcon("sepa")} 67888 <span>${this.sepaTitle}</span> 67889 </sonic-td> 67890 <sonic-td> <sonic-date date=${date2}></sonic-date> </sonic-td> 67891 <sonic-td align="right"> ${formatAmount(index === count - 2 ? lastAmount : baseAmount)} </sonic-td> 67892 </sonic-tr> 67893 ` 67894 )} 67895 </sonic-tbody> 67896 </sonic-table> 67897 `; 67898 } 67899 }; 67900 SonicSepaSchedule.styles = [tailwind]; 67901 __decorateClass$C([ 67902 n$5({ type: String }) 67903 ], SonicSepaSchedule.prototype, "cartId", 2); 67904 __decorateClass$C([ 67905 n$5({ type: Number }) 67906 ], SonicSepaSchedule.prototype, "total", 2); 67907 __decorateClass$C([ 67908 n$5({ type: String }) 67909 ], SonicSepaSchedule.prototype, "schedules", 2); 67910 __decorateClass$C([ 67911 n$5({ type: String }) 67912 ], SonicSepaSchedule.prototype, "pspTitle", 2); 67913 __decorateClass$C([ 67914 n$5({ type: String }) 67915 ], SonicSepaSchedule.prototype, "sepaTitle", 2); 67916 __decorateClass$C([ 67917 bind$1("cart/${cartId}.data"), 67918 r$5() 67919 ], SonicSepaSchedule.prototype, "_cartData", 2); 67920 SonicSepaSchedule = __decorateClass$C([ 67921 t$3(tagName$v) 67922 ], SonicSepaSchedule); 67923 var __defProp$y = Object.defineProperty; 67924 var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor; 67925 var __decorateClass$B = (decorators, target, key, kind) => { 67926 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target; 67927 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67928 if (decorator = decorators[i2]) 67929 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67930 if (kind && result) __defProp$y(target, key, result); 67931 return result; 67932 }; 67933 const tagName$u = "sonic-checkout"; 67934 let SonicComponent$4 = class SonicComponent extends Subscriber$1(i$6) { 67935 constructor() { 67936 super(...arguments); 67937 this.online_payment_id = 0; 67938 this.cart_id = ""; 67939 this.quickBuy = false; 67940 this.create_account = false; 67941 this.wording_create_account = ""; 67942 } 67943 connectedCallback() { 67944 const urlParams = new URLSearchParams(window.location.search); 67945 if (!this.online_payment_id) { 67946 this.online_payment_id = Number(urlParams.get("payment_id") || get("settings.online_payment_id") || 0); 67947 } 67948 if (!this.cart_id) { 67949 this.cart_id = urlParams.get("cart_id") || urlParams.get("sonic_cart_id") || ""; 67950 } 67951 if (!this.create_account) { 67952 this.create_account = !!urlParams.get("create_account") || false; 67953 } 67954 if (!this.quickBuy) { 67955 this.quickBuy = !!urlParams.get("quick_buy"); 67956 } 67957 super.connectedCallback(); 67958 } 67959 render() { 67960 const checkoutRoute = appRoute("checkout"); 67961 const cartRoute = appRoute("cart"); 67962 const displayLoginForm = !this.userId && !this.quickBuy && !this.cart_id; 67963 if (this.create_account && !this.quickBuy && !this.cart_id) 67964 return b$1`<sonic-page-header goBack label="${this.wording_create_account}"></sonic-page-header> 67965 <sonic-user-form-create paymentId=${this.online_payment_id}></sonic-user-form-create>`; 67966 if (displayLoginForm) 67967 return b$1`<sonic-user-form-login 67968 createAccount 67969 checkout 67970 online_payment_id=${this.online_payment_id} 67971 class="mt-2 lg:mt-8 mx-auto block w-full" 67972 ></sonic-user-form-login>`; 67973 if (this.cart_id) return b$1`<sonic-iframe src="/paiement/${this.cart_id}"></sonic-iframe>`; 67974 if (this.quickBuy) 67975 return b$1`<sonic-page-header
67976 goBackHref="${this.hash && cartRoute ? cartRoute : checkoutRoute}" 67977 label="${t("link_title_quick_purchase")}" 67978 ></sonic-page-header 67979 ><sonic-iframe src="/validation/${this.online_payment_id}?no_title=true&quick_buy=true"></sonic-iframe>`; 67980 if (!this.cart_id && !this.quickBuy) 67981 return b$1` <sonic-iframe src="/validation/${this.online_payment_id}"></sonic-iframe>`; 67982 return A$1; 67983 } 67984 }; 67985 SonicComponent$4.styles = [tailwind]; 67986 __decorateClass$B([ 67987 n$5({ type: Number }) 67988 ], SonicComponent$4.prototype, "online_payment_id", 2); 67989 __decorateClass$B([ 67990 n$5({ type: String }) 67991 ], SonicComponent$4.prototype, "cart_id", 2); 67992 __decorateClass$B([ 67993 n$5({ type: Boolean }) 67994 ], SonicComponent$4.prototype, "quickBuy", 2); 67995 __decorateClass$B([ 67996 n$5({ type: Boolean }) 67997 ], SonicComponent$4.prototype, "create_account", 2); 67998 __decorateClass$B([ 67999 n$5({ type: String }) 68000 ], SonicComponent$4.prototype, "wording_create_account", 2); 68001 __decorateClass$B([ 68002 bind$1("user.id"), 68003 n$5({ type: String }) 68004 ], SonicComponent$4.prototype, "userId", 2); 68005 __decorateClass$B([ 68006 bind$1("cart/current.data.payment_link_hash"), 68007 n$5({ type: String }) 68008 ], SonicComponent$4.prototype, "hash", 2); 68009 SonicComponent$4 = __decorateClass$B([ 68010 t$3(tagName$u) 68011 ], SonicComponent$4); 68012 var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor; 68013 var __decorateClass$A = (decorators, target, key, kind) => { 68014 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target; 68015 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68016 if (decorator = decorators[i2]) 68017 result = decorator(result) || result; 68018 return result; 68019 }; 68020 let SonicCartFull = class extends i$6 { 68021 connectedCallback() { 68022 this.setAttribute("dataProvider", "cart/current"); 68023 super.connectedCallback(); 68024 } 68025 willUpdate(_changedProperties) { 68026 this.urlCheckout = appRoute("checkout"); 68027 this.urlCart = appRoute("cart"); 68028 } 68029 render() { 68030 const urlCheckoutIsUrlCart = this.urlCart?.hasSameBaseAs(this.urlCheckout); 68031 return b$1` 68032 <sonic-fullscreen-layout> 68033 ${urlCheckoutIsUrlCart && this.urlCheckout?.hasHash() ? b$1` 68034 <sonic-router class="contents"> 68035 <template data-fallback data-route="${this.urlCart}$"> 68036 <sonic-cart-full subDataProvider="data" goBack></sonic-cart-full> 68037 </template> 68038 <template data-route="${this.urlCheckout.getHash()}"> 68039 <sonic-checkout subDataProvider="data"></sonic-checkout> 68040 </template> 68041 </sonic-router> 68042 ` : b$1`<sonic-cart-full subDataProvider="data" goBack></sonic-cart-full>`} 68043 </sonic-fullscreen-layout> 68044 `; 68045 } 68046 }; 68047 SonicCartFull.styles = [tailwind]; 68048 SonicCartFull = __decorateClass$A([ 68049 t$3("sonic-cart") 68050 ], SonicCartFull); 68051 var __defProp$x = Object.defineProperty; 68052 var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor; 68053 var __decorateClass$z = (decorators, target, key, kind) => { 68054 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target; 68055 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68056 if (decorator = decorators[i2]) 68057 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68058 if (kind && result) __defProp$x(target, key, result); 68059 return result; 68060 }; 68061 const tagName$t = "sonic-agenda"; 68062 let SonicComponent$3 = class SonicComponent extends i$6 { 68063 constructor() { 68064 super(...arguments); 68065 this.displayTitle = false; 68066 this.smallTitle = false; 68067 this.displayText = false; 68068 this._dataProviderExpression = "shows?offset=$offset&limit=$limit&next=1&ids_agenda=0"; 68069 this._formDataProvider = `eventFrontFilters/${this.agendaId ?? 0}`; 68070 this.isWaiting = false; 68071 this._resizeController = new h$1(this, {}); 68072 this.agenda = null; 68073 } 68074 connectedCallback() { 68075 this._formDataProvider = `eventFrontFilters/${this.agendaId ?? 0}`; 68076 super.connectedCallback(); 68077 } 68078 async willUpdate(_changedProperties) { 68079 if (_changedProperties.has("agendaId")) { 68080 if (this.agendaId) { 68081 this.agenda = await getAgenda(this.agendaId, this); 68082 dp(this._formDataProvider).set({ 68083 ids_agenda: this.agendaId 68084 }); 68085 } else { 68086 this.agenda = null; 68087 dp(this._formDataProvider).set({ 68088 ids_agenda: 0 68089 }); 68090 } 68091 } 68092 } 68093 render() { 68094 if (this.isWaiting) return A$1; 68095 if (this.agendaId && !this.agenda) { 68096 return A$1; 68097 } 68098 const title = this.agenda ? this.agenda.title : t("module_agenda_title"); 68099 const text = this.agenda ? this.agenda.description : t("info_message_interface_billets_front"); 68100 return b$1`<sonic-page-layout 68101 pageTitle=${title} 68102 pageText=${text} 68103 ?smallTitle=${this.smallTitle} 68104 ?displayTitle=${this.displayTitle} 68105 ?displayText=${this.displayText} 68106 > 68107 <div class="mb-8"> 68108 <sonic-form-event-filter 68109 formDataProvider="${this._formDataProvider}" 68110 ?filterCategory=${!this.agendaId} 68111 .agendaId=${this.agendaId} 68112 class="block max-w-[36rem] w-full z-10" 68113 ></sonic-form-event-filter> 68114 </div> 68115 68116 ${this.clientWidth < 768 ? b$1` 68117 <sonic-queue 68118 limit="10" 68119 lazyBoundsRatio="4" 68120 targetRequestDuration="2000" 68121 dataProvider="searchResults" 68122 dataFilterProvider="${this._formDataProvider}" 68123 dataProviderExpression="${this._dataProviderExpression}" 68124 key="data" 68125 > 68126 <template data-value="skeleton"> 68127 <sonic-event-card class="block mb-4" skeleton></sonic-event-card> 68128 <sonic-event-card class="block mb-4" skeleton></sonic-event-card> 68129 </template> 68130 <template data-value="no-item"> 68131 <sonic-no-result></sonic-no-result> 68132 </template> 68133 <template> 68134 <sonic-event-card class="block mb-4" link></sonic-event-card> 68135 </template> 68136 </sonic-queue> 68137 ` : b$1`<sonic-queue 68138 limit="10" 68139 lazyBoundsRatio="4" 68140 targetRequestDuration="2000" 68141 dataProvider="searchResults" 68142 dataFilterProvider="${this._formDataProvider}" 68143 dataProviderExpression="${this._dataProviderExpression}" 68144 key="data" 68145 class="grid grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 gap-x-3 gap-y-6 lg:gap-4 lg:gap-y-8" 68146 > 68147 <template data-value="skeleton"> 68148 <sonic-event-card-vertical skeleton></sonic-event-card-vertical> 68149 <sonic-event-card-vertical skeleton></sonic-event-card-vertical> 68150 <sonic-event-card-vertical skeleton></sonic-event-card-vertical> 68151 <sonic-event-card-vertical skeleton></sonic-event-card-vertical> 68152 </template> 68153 <template data-value="no-item"> 68154 <sonic-no-result></sonic-no-result> 68155 </template> 68156 <template> 68157 <sonic-event-card-vertical></sonic-event-card-vertical> 68158 </template> 68159 </sonic-queue>`} 68160 </sonic-page-layout>`; 68161 } 68162 }; 68163 SonicComponent$3.styles = [ 68164 tailwind, 68165 i$9` 68166 :host { 68167 display: block; 68168 } 68169 ` 68170 ]; 68171 __decorateClass$z([ 68172 n$5({ type: Boolean }) 68173 ], SonicComponent$3.prototype, "displayTitle", 2); 68174 __decorateClass$z([ 68175 n$5({ type: Boolean }) 68176 ], SonicComponent$3.prototype, "smallTitle", 2); 68177 __decorateClass$z([ 68178 n$5({ type: Boolean }) 68179 ], SonicComponent$3.prototype, "displayText", 2); 68180 __decorateClass$z([ 68181 n$5({ type: Number }) 68182 ], SonicComponent$3.prototype, "agendaId", 2); 68183 __decorateClass$z([ 68184 bind$1("sonicTicketApp.isWaiting"), 68185 r$5() 68186 ], SonicComponent$3.prototype, "isWaiting", 2); 68187 __decorateClass$z([ 68188 r$5() 68189 ], SonicComponent$3.prototype, "agenda", 2); 68190 SonicComponent$3 = __decorateClass$z([ 68191 t$3(tagName$t) 68192 ], SonicComponent$3); 68193 var __defProp$w = Object.defineProperty; 68194 var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor; 68195 var __decorateClass$y = (decorators, target, key, kind) => { 68196 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target; 68197 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68198 if (decorator = decorators[i2]) 68199 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68200 if (kind && result) __defProp$w(target, key, result); 68201 return result; 68202 }; 68203 const tagName$s = "sonic-multisession-nav"; 68204 let MultisessionNav = class extends i$6 { 68205 constructor() { 68206 super(...arguments); 68207 this.mode = "default"; 68208 this._sessionsList = []; 68209 } 68210 async willUpdate(changed) { 68211 if (!changed.has("currentSession") && !changed.has("accessParams")) return; 68212 const multisessionId = Number(this.currentSession?.multisession?.id); 68213 if (!Number.isFinite(multisessionId)) { 68214 this._sessionsList = []; 68215 this._loadedMultisessionId = void 0; 68216 return; 68217 } 68218 const needFetch = multisessionId !== this._loadedMultisessionId || changed.has("accessParams"); 68219 if (!needFetch) return; 68220 const sessions = await this.fetchSessions(multisessionId); 68221 if (multisessionId !== Number(this.currentSession?.multisession?.id)) return; 68222 this._loadedMultisessionId = multisessionId; 68223 this._sessionsList = Array.isArray(sessions) ? sessions : []; 68224 } 68225 async fetchSessions(multisessionId) { 68226 const api2 = new API(HTML.getApiConfiguration(this)); 68227 const endpoint = entityEndPoint({ 68228 entityType: EntityType.Event, 68229 accessParams: this.accessParams, 68230 view: entityView.mini, 68231 multisessionId, 68232 next: true 68233 }); 68234 const result = await api2.get(endpoint); 68235 return result.data; 68236 } 68237 cleanDate(date2, displayHours = false) { 68238 if (!date2) return ""; 68239 const lang = document.documentElement.lang || "fr-FR"; 68240 return new Date(date2 * 1e3).toLocaleDateString(lang, { 68241 weekday: "short", 68242 year: "numeric", 68243 month: "short", 68244 day: "numeric", 68245 hour: displayHours ? "2-digit" : void 0, 68246 minute: displayHours ? "2-digit" : void 0 68247 }); 68248 } 68249 getSessionHref(session) { 68250 if (this.mode === "seatmap") { 68251 return appRoute("seatmap").fill({ slug: session.slug, id: session.id?.toString() }).toString(); 68252 } 68253 return appRoute("event").fill({ slug: session.slug, id: session.id?.toString() }).query({ session: session.id?.toString() }).toString(); 68254 } 68255 renderAllSessionsButton() { 68256 return b$1` 68257 <sonic-app-link to="event" .slug=${this.currentSession?.slug} size="sm" variant="ghost"> 68258 ${t("link_title_sessions_all")} 68259 </sonic-app-link> 68260 `; 68261 } 68262 render() { 68263 const currentId = Number(this.currentSession?.id); 68264 if (!currentId) return A$1; 68265 const hasMultipleSessions = this._sessionsList.length >= 2; 68266 if (!hasMultipleSessions) { 68267 return this.renderAllSessionsButton(); 68268 } 68269 const currentIndex = this._sessionsList.findIndex((session) => Number(session.id) === currentId); 68270 const previousSession = currentIndex > 0 ? this._sessionsList[currentIndex - 1] : null; 68271 const nextSession = currentIndex >= 0 && currentIndex < this._sessionsList.length - 1 ? this._sessionsList[currentIndex + 1] : null; 68272 const previousDate = this.cleanDate(previousSession?.start_date, true); 68273 const nextDate = this.cleanDate(nextSession?.start_date, true);
68274 const previousHref = previousSession ? this.getSessionHref(previousSession) : null; 68275 const nextHref = nextSession ? this.getSessionHref(nextSession) : null; 68276 return b$1` 68277 <div class="flex items-center"> 68278 ${this.renderAllSessionsButton()} 68279 68280 <div class="inline-flex items-center"> 68281 <sonic-pop> 68282 <sonic-tooltip label="${this._sessionsList.length} ${t("LIB_seances")}"> 68283 <sonic-button size="sm" variant="ghost" shape="circle" icon> 68284 <sonic-icon name="chevron-down" library="custom"></sonic-icon> 68285 </sonic-button> 68286 </sonic-tooltip> 68287 <sonic-menu slot="content" class="w-[18rem] lg:w-[25rem]"> 68288 ${c$1( 68289 this._sessionsList, 68290 (session) => session.id, 68291 (session, index) => { 68292 if (!session.slug || !session.id) return A$1; 68293 const href = this.getSessionHref(session); 68294 const isActive = Number(session.id) === currentId; 68295 const isLast = index === this._sessionsList.length - 1; 68296 return b$1`<sonic-menu-item href=${href} autoActive="disabled" ?active=${isActive}> 68297 <div class="font-bold capitalize">${this.cleanDate(session.start_date, true)}</div> 68298 <sonic-event-additional-status 68299 variant="ghost" 68300 fetch 68301 size="xs" 68302 key="data" 68303 dataProvider=${entityEndPoint({ 68304 entityType: EntityType.Event, 68305 entityId: Number(session.id), 68306 accessParams: this.accessParams, 68307 view: entityView.status 68308 })} 68309 class="flex gap-x-3 " 68310 ></sonic-event-additional-status> 68311 </sonic-menu-item> 68312 68313 ${!isLast ? b$1`<sonic-divider></sonic-divider>` : A$1} `; 68314 } 68315 )} 68316 </sonic-menu> 68317 </sonic-pop> 68318 <sonic-divider vertical></sonic-divider> 68319 <sonic-tooltip label=${previousDate}> 68320 <sonic-button 68321 variant="ghost" 68322 ?disabled=${!previousSession} 68323 href=${o$4(previousHref?.toString())} 68324 size="sm" 68325 shape="circle" 68326 icon 68327 noAutoFill 68328 > 68329 <sonic-icon name="chevron-left" library="custom"></sonic-icon> 68330 </sonic-button> 68331 </sonic-tooltip> 68332 <sonic-tooltip label=${nextDate}> 68333 <sonic-button 68334 ?disabled=${!nextSession} 68335 href=${o$4(nextHref)} 68336 size="sm" 68337 variant="ghost" 68338 shape="circle" 68339 icon 68340 noAutoFill 68341 > 68342 <sonic-icon name="chevron-right" library="custom"></sonic-icon> 68343 </sonic-button> 68344 </sonic-tooltip> 68345 </div> 68346 </div> 68347 `; 68348 } 68349 }; 68350 MultisessionNav.styles = [tailwind]; 68351 __decorateClass$y([ 68352 n$5({ type: Object }) 68353 ], MultisessionNav.prototype, "currentSession", 2); 68354 __decorateClass$y([ 68355 c({ context: accessParamsContext, subscribe: true }), 68356 n$5({ type: Object }) 68357 ], MultisessionNav.prototype, "accessParams", 2); 68358 __decorateClass$y([ 68359 n$5({ type: String }) 68360 ], MultisessionNav.prototype, "mode", 2); 68361 __decorateClass$y([ 68362 r$5() 68363 ], MultisessionNav.prototype, "_sessionsList", 2); 68364 MultisessionNav = __decorateClass$y([ 68365 t$3(tagName$s) 68366 ], MultisessionNav); 68367 var __defProp$v = Object.defineProperty; 68368 var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor; 68369 var __decorateClass$x = (decorators, target, key, kind) => { 68370 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target; 68371 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68372 if (decorator = decorators[i2]) 68373 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68374 if (kind && result) __defProp$v(target, key, result); 68375 return result; 68376 }; 68377 const buttonViewClass = "border border-neutral-100 [&:hover]:border-neutral-800 [&[active]]:border-neutral-800 rounded-md [&[active]]:shadow-[0_0_0_2px_var(--sc-base-800)] transition"; 68378 const tagName$r = "sonic-seatmap"; 68379 let Seatmap = class extends Fetcher$1(Subscriber$1(i$6)) { 68380 constructor() { 68381 super(...arguments); 68382 this.slug = ""; 68383 this.places_categories = []; 68384 this.hidePromoForm = false;
68385 this.multisession = null; 68386 this.quotas = []; 68387 this.success = null; 68388 this.cartProvider = "cart/current"; 68389 this.seatmapProvider = "seatmap"; 68390 this.isMobile = false; 68391 this._resizeController = new h$1(this, { 68392 callback: () => { 68393 this.isMobile = this.clientWidth < 768; 68394 if (this.isMobile) { 68395 this.changeSeatmapView({ 68396 type: "category" 68397 }); 68398 } 68399 } 68400 }); 68401 this.changeSeatmapView = (view) => { 68402 let colorMode = null; 68403 let currentSeatFilter = { 68404 field: null, 68405 value: null, 68406 subField: null 68407 }; 68408 if (view.type === "category") { 68409 colorMode = SeatColorMode.CATEGORY; 68410 this._selectedCategoryId = view.id ?? null; 68411 if (view.id) { 68412 currentSeatFilter = { 68413 field: "range", 68414 value: view.id, 68415 subField: null 68416 }; 68417 } 68418 } else if (view.type === "quota") { 68419 colorMode = SeatColorMode.QUOTAS; 68420 if (view.id) { 68421 currentSeatFilter = { 68422 field: "contingentementInterne", 68423 value: view.id, 68424 subField: null 68425 }; 68426 } 68427 } 68428 seatmapPublisher(this.seatmapProvider).viewerState.seatFilter?.set(currentSeatFilter); 68429 seatmapPublisher(this.seatmapProvider).conf.seatsColorsMode?.set(colorMode ?? ""); 68430 }; 68431 } 68432 handleSeatmapSeatFilterChange(seatfilter) { 68433 this._activeFilter = seatfilter; 68434 } 68435 handleSeatmapSeatColorModeChange(colorMode) { 68436 this._activeColorMode = colorMode; 68437 } 68438 connectedCallback() { 68439 this.isFetchEnabled = this.hasAttribute("fetch"); 68440 if (!this.accessParams) { 68441 this.accessParams = getAccessParamsFromUrl(); 68442 } 68443 if (this.isFetchEnabled) { 68444 this.dataProvider = entityEndPoint({ 68445 entityType: EntityType.Event, 68446 entityId: Number(this.id), 68447 accessParams: this.accessParams, 68448 view: entityView.full 68449 }); 68450 this.key = "data"; 68451 } 68452 window.requestAnimationFrame(() => { 68453 super.connectedCallback(); 68454 }); 68455 } 68456 updated(changedProperties) { 68457 if (changedProperties.has("placementType") && this.placementType === PlacementType.AUTO) { 68458 this.changeSeatmapView({ type: "category" }); 68459 } 68460 super.updated(changedProperties); 68461 } 68462 render() { 68463 const isError = this.success === false; 68464 const statusDataProvider = entityEndPoint({ 68465 entityType: EntityType.Event, 68466 entityId: Number(this.id), 68467 accessParams: this.accessParams, 68468 view: entityView.status 68469 }); 68470 if (isError) { 68471 return b$1`<sonic-fullscreen-layout> 68472 <div> 68473 <sonic-alert status="error" class="py-3" size="lg" label=${t("error_title")} background> 68474 <div>${t("error_seatmap_description")}</div> 68475 <sonic-button 68476 goBack=${appRoute("agenda").toString()} 68477 icon 68478 size="xs" 68479 class="mt-2" 68480 variant="outline" 68481 type="danger" 68482 > 68483 <sonic-icon library="custom" name="arrow-left"></sonic-icon> ${t("back")} 68484 </sonic-button> 68485 </sonic-alert> 68486 </div> 68487 </sonic-fullscreen-layout>`; 68488 } 68489 const isMobile = this.clientWidth < 768; 68490 const isAutoSeating = this.placementType === PlacementType.AUTO; 68491 return b$1`<sonic-fullscreen-layout largeAside> 68492 <div> 68493 <div class="flex items-center gap-x-1 mb-3"> 68494 <sonic-button 68495 data-aria-label=${o$4(t("back"))} 68496 goBack=${appRoute("agenda")} 68497 icon 68498 size="sm" 68499 shape="circle" 68500 > 68501 <sonic-icon library="custom" name="arrow-left"></sonic-icon> 68502 </sonic-button> 68503 68504 ${this.multisession && !hasAccessParams(this.accessParams) ? b$1`<sonic-multisession-nav mode="seatmap" .currentSession=${this.props}></sonic-multisession-nav> ` : A$1} 68505 ${this.accessParams?.customListSlug ? b$1`<sonic-app-link 68506 dataProvider="customLinkAllEventsLink" 68507 noAutoFill 68508 to="customList" 68509 slug="${this.accessParams?.customListSlug}" 68510 class="hover:underline text-sm ml-2" 68511 >${t("tous_les_evenements")}</sonic-app-link 68512 >` : A$1} 68513 </div> 68514 68515 <sonic-product-title 68516 class="text-3xl md:text-4xl md:leading-[1.1] font-headings font-weight-headings font-style-headings block mb-3" 68517 ></sonic-product-title> 68518 <div class="flex flex-wrap items-center gap-x-2 gap-y-1"> 68519 <sonic-event-additional-status 68520 fetch 68521 dataProvider=${statusDataProvider} 68522 class="flex flex-wrap gap-x-3" 68523 key="data" 68524 ></sonic-event-additional-status> 68525 <sonic-event-taxonomies class="contents"></sonic-event-taxonomies> 68526 </div> 68527 68528 <div class="mt-[1.5rem] mb-4 grid gap-y-1"> 68529 <sonic-date 68530 class="text-[1.5rem] font-bold [&_.hour]:font-normal [&_.minute]:font-normal [&_.literal]:font-normal" 68531 noshadowdom 68532 ></sonic-date> 68533 <sonic-event-location-hall isEvent="true" class="block w-full mt-1 text-sm"></sonic-event-location-hall> 68534 <sonic-price-range displayIcon class="text-sm"></sonic-price-range> 68535 </div> 68536 68537 <sonic-placement-choice 68538 formDataProvider=${SEATMAP_PLACEMENT_PREFERENCES_DP} 68539 class="my-4" 68540 ></sonic-placement-choice> 68541 ${this.placementType === PlacementType.MANUAL ? b$1` ${this.renderCategories(this.places_categories)}` : A$1} 68542 <sonic-buy-event-block 68543 seatmapProvider=${this.seatmapProvider} 68544 .categoryId=${this._selectedCategoryId} 68545 size="sm"
68546 .buyMode="${this.placementType === PlacementType.MANUAL ? BuyMode.SEATMAPVIEW : BuyMode.AUTOSEATING}" 68547 > 68548 </sonic-buy-event-block> 68549 </div> 68550 68551 <div 68552 slot="aside" 68553 class=" 68554 ${isMobile && isAutoSeating ? "hidden" : ""} 68555 min-h-[40rem] -mt-6 lg:-mt-0 lg:h-full bg-neutral-50 border border-neutral-50 rounded-lg relative overflow-hidden z-10" 68556 > 68557 ${this.id ? b$1`<sonic-seatmap-view 68558 cover 68559 class="absolute h-full w-full" 68560 eventId=${this.id} 68561 seatmapProvider=${this.seatmapProvider} 68562 ></sonic-seatmap-view>` : A$1} 68563 </div> 68564 </sonic-fullscreen-layout>`; 68565 } 68566 renderCategories(categories) { 68567 if (!categories.length) return A$1; 68568 const totalTotal = categories.reduce((acc, category) => acc + Number(category.total_places_nb), 0); 68569 const totalSold = categories.reduce( 68570 (acc, category) => acc + (Number(category.total_places_nb) - Number(category.remaining_places_nb)), 68571 0 68572 ); 68573 const displayAll = categories.length > 1; 68574 const pricesInHC = this.props?.quotas?.find((quota) => quota.id === 1)?.prices?.filter((price) => price.visible); 68575 const idsOfPricesInHC = pricesInHC?.map((price) => price.price_id); 68576 const isCounter = this.appType === "counter"; 68577 return b$1` <div class="@container mt-5 hidden lg:block"> 68578 <div class="flex items-center gap-x-2"> 68579 <sonic-divider align="left" class="w-full">${t("LIB_categories")}</sonic-divider> 68580 <sonic-seatmap-help-button 68581 eventId=${this.id} 68582 mode="inlineButton" 68583 size="xs" 68584 variant="ghost" 68585 class="shrink-0" 68586 ></sonic-seatmap-help-button> 68587 </div> 68588 <div 68589 class="items-start grid grid-cols-1 ${isCounter ? "@2xl:grid-cols-3 @lg:grid-cols-2" : "@xl:grid-cols-3 @sm:grid-cols-2"} gap-2 " 68590 > 68591 ${displayAll ? b$1`<sonic-button 68592 noAutoFill 68593 size="sm" 68594 shape="block" 68595 variant="unstyled" 68596 class=${buttonViewClass} 68597 @click=${() => this.changeSeatmapView({ 68598 type: "category" 68599 })} 68600 align="left" 68601 ?active=${this._activeColorMode === SeatColorMode.CATEGORY && this._activeFilter?.value === null} 68602 > 68603 ${this.buttonContent({ 68604 label: t("LIB_all"), 68605 value: totalSold, 68606 max: totalTotal, 68607 prices: this.props?.prices?.filter((price) => idsOfPricesInHC?.includes(Number(price.id))) || [] 68608 })} 68609 </sonic-button>` : A$1} 68610 ${c$1( 68611 categories, 68612 (category) => category.id, 68613 (category) => { 68614 const { remaining_places_nb, total_places_nb } = category; 68615 const sold = Number(total_places_nb) - Number(remaining_places_nb); 68616 const pricesMatchesCategory = this.props?.prices?.filter((price) => { 68617 const priceId = Number(price.id); 68618 return price.place_category?.id === category.id && idsOfPricesInHC?.includes(priceId); 68619 }); 68620 const categoryFromSeatmap = this.seatMapData?.conf?.categorie?.find( 68621 (item) => Number(item.id) === Number(category.id) 68622 ); 68623 const color = "#" + categoryFromSeatmap?.couleur?.toString(); 68624 return b$1` 68625 <sonic-button 68626 noAutoFill 68627 size="sm" 68628 shape="block" 68629 variant="unstyled" 68630 class=${buttonViewClass} 68631 @click=${() => this.changeSeatmapView({ 68632 type: "category", 68633 id: Number(category.id) 68634 })} 68635 align="left" 68636 ?active=${this._activeFilter?.field === "range" && this._activeFilter?.value === category.id} 68637 > 68638 ${this.buttonContent({ 68639 label: category.title || "", 68640 value: sold, 68641 max: total_places_nb || 0, 68642 color: color || "", 68643 prices: pricesMatchesCategory || [] 68644 })} 68645 </sonic-button> 68646 `; 68647 } 68648 )} 68649 </div> 68650 </div>`; 68651 } 68652 buttonContent({ 68653 label: label2, 68654 value, 68655 max, 68656 color, 68657 prices 68658 }) { 68659 const displayRemaining = this.appType === "counter" ? true : false;
68660 const isFull = value >= max; 68661 return b$1` 68662 <div class="relative px-3 py-2 "> 68663 <div class="flex items-center gap-x-1"> 68664 ${color ? b$1`<div class="size-3 rounded-full shrink-0 " style="background-color: ${color}"></div>` : A$1} 68665 <div class="truncate">${label2}</div> 68666 </div> 68667 68668 ${displayRemaining ? b$1` 68669 <sonic-progress 68670 value=${value} 68671 max=${max} 68672 class="mt-1" 68673 size="xs" 68674 style="${color ? `--sc-progress-color: ${color}` : ""}" 68675 > 68676 <span slot="remaining">Reste : ${Math.max(0, max - value)} / ${max}</span> 68677 </sonic-progress> 68678 68679 ${prices?.length && !isFull ? b$1` 68680 <sonic-badge size="2xs"> 68681 <sonic-price-range 68682 class="white-space-nowrap lowercase" 68683 .prices=${prices || []} 68684 dataProvider=${`pricesRange/${prices?.map((price) => price.id).join(",")}`} 68685 ></sonic-price-range> 68686 </sonic-badge> 68687 ` : A$1} 68688 ` : A$1} 68689 </div> 68690 `; 68691 } 68692 }; 68693 Seatmap.styles = [ 68694 tailwind, 68695 i$9` 68696 :host { 68697 display: block; 68698 } 68699 ` 68700 ]; 68701 __decorateClass$x([ 68702 n$5({ type: String }) 68703 ], Seatmap.prototype, "slug", 2); 68704 __decorateClass$x([ 68705 n$5({ type: Array }) 68706 ], Seatmap.prototype, "places_categories", 2); 68707 __decorateClass$x([ 68708 n$5({ type: Boolean }) 68709 ], Seatmap.prototype, "hidePromoForm", 2); 68710 __decorateClass$x([ 68711 n$5({ type: Object }) 68712 ], Seatmap.prototype, "multisession", 2); 68713 __decorateClass$x([ 68714 n$5({ type: Array }) 68715 ], Seatmap.prototype, "quotas", 2); 68716 __decorateClass$x([ 68717 n$5({ type: Boolean }) 68718 ], Seatmap.prototype, "success", 2); 68719 __decorateClass$x([ 68720 c({ context: accessParamsContext, subscribe: true }), 68721 e$2({ context: accessParamsContext }), 68722 n$5({ type: Object }) 68723 ], Seatmap.prototype, "accessParams", 2); 68724 __decorateClass$x([ 68725 ancestorAttribute("cartProvider"), 68726 n$5({ type: String }) 68727 ], Seatmap.prototype, "cartProvider", 2); 68728 __decorateClass$x([ 68729 c({ context: appType, subscribe: true }), 68730 r$5() 68731 ], Seatmap.prototype, "appType", 2); 68732 __decorateClass$x([ 68733 bind(seatmapKey), 68734 r$5() 68735 ], Seatmap.prototype, "seatMapData", 2); 68736 __decorateClass$x([ 68737 r$5() 68738 ], Seatmap.prototype, "_activeFilter", 2); 68739 __decorateClass$x([ 68740 r$5() 68741 ], Seatmap.prototype, "_activeColorMode", 2); 68742 __decorateClass$x([ 68743 r$5() 68744 ], Seatmap.prototype, "isMobile", 2); 68745 __decorateClass$x([ 68746 r$5() 68747 ], Seatmap.prototype, "_selectedCategoryId", 2); 68748 __decorateClass$x([ 68749 onAssign(seatmapKey.viewerState.seatFilter.path) 68750 ], Seatmap.prototype, "handleSeatmapSeatFilterChange", 1); 68751 __decorateClass$x([ 68752 onAssign(seatmapKey.conf.seatsColorsMode.path) 68753 ], Seatmap.prototype, "handleSeatmapSeatColorModeChange", 1); 68754 __decorateClass$x([ 68755 bind(SEATMAP_PLACEMENT_PREFERENCES_DP + ".placement_type"), 68756 r$5() 68757 ], Seatmap.prototype, "placementType", 2); 68758 Seatmap = __decorateClass$x([ 68759 t$3(tagName$r) 68760 ], Seatmap); 68761 var __defProp$u = Object.defineProperty; 68762 var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor; 68763 var __decorateClass$w = (decorators, target, key, kind) => { 68764 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target; 68765 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68766 if (decorator = decorators[i2]) 68767 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68768 if (kind && result) __defProp$u(target, key, result); 68769 return result; 68770 }; 68771 const tagName$q = "sonic-infos-prices"; 68772 let SonicComponent$2 = class SonicComponent extends Subscriber$1(i$6) { 68773 constructor() { 68774 super(...arguments); 68775 this.displayTitle = false; 68776 this.displayText = false; 68777 this.wording_module_infos_title = ""; 68778 this.wording_texte_infos_et_tarifs = ""; 68779 this.smallTitle = false; 68780 } 68781 render() { 68782 return b$1`<sonic-page-layout 68783 pageTitle=${this.wording_module_infos_title} 68784 pageText=${this.wording_texte_infos_et_tarifs} 68785 ?smallTitle=${this.smallTitle} 68786 ?displayTitle=${this.displayTitle} 68787 ?displayText=${this.displayText} 68788 > 68789 </sonic-page-layout>`; 68790 } 68791 }; 68792 SonicComponent$2.styles = [tailwind]; 68793 __decorateClass$w([ 68794 n$5({ type: Boolean }) 68795 ], SonicComponent$2.prototype, "displayTitle", 2); 68796 __decorateClass$w([ 68797 n$5({ type: Boolean }) 68798 ], SonicComponent$2.prototype, "displayText", 2); 68799 __decorateClass$w([ 68800 n$5({ type: String }) 68801 ], SonicComponent$2.prototype, "wording_module_infos_title", 2); 68802 __decorateClass$w([ 68803 n$5({ type: String }) 68804 ], SonicComponent$2.prototype, "wording_texte_infos_et_tarifs", 2); 68805 __decorateClass$w([ 68806 n$5({ type: Boolean }) 68807 ], SonicComponent$2.prototype, "smallTitle", 2); 68808 SonicComponent$2 = __decorateClass$w([ 68809 t$3(tagName$q) 68810 ], SonicComponent$2); 68811 var __defProp$t = Object.defineProperty; 68812 var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor; 68813 var __decorateClass$v = (decorators, target, key, kind) => { 68814 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target; 68815 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68816 if (decorator = decorators[i2]) 68817 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68818 if (kind && result) __defProp$t(target, key, result); 68819 return result; 68820 }; 68821 let OrderRecover = class extends Subscriber$1(i$6) { 68822 constructor() { 68823 super(...arguments); 68824 this.endPoint = "recover-orders"; 68825 this.wording_LIB_recup_commande_front = ""; 68826 this.wording_LIB_recup_commande_title = ""; 68827 this.wording_LIB_recup_commande_aide_new = ""; 68828 this.wording_abonnements = ""; 68829 this.wording_billets = ""; 68830 this.wording_Valider = ""; 68831 this.displayTitle = false;
68832 this.displayText = true; 68833 this.smallTitle = false; 68834 } 68835 removeHtmlTags(text) { 68836 if (!text) return ""; 68837 return text.replace(/(<([^>]+)>)/gi, ""); 68838 } 68839 render() { 68840 const componentTitle = this.removeHtmlTags(this.wording_LIB_recup_commande_front); 68841 const cleanTitleMarkup = this.removeHtmlTags(this.wording_LIB_recup_commande_title); 68842 const cleanTextMarkup = this.removeHtmlTags(this.wording_LIB_recup_commande_aide_new); 68843 const text = `<p>${cleanTitleMarkup ? `<b class="text-[1.2em] leading-tight">${cleanTitleMarkup}</b><br>` : ""} 68844 ${cleanTextMarkup}</p> `; 68845 return b$1` 68846 <sonic-page-layout 68847 pageTitle=${componentTitle} 68848 pageText=${text} 68849 ?smallTitle=${this.smallTitle} 68850 ?displayTitle=${this.displayTitle} 68851 ?displayText=${this.displayText} 68852 formDataProvider="order/recover/form" 68853 > 68854 <div class="flex gap-3 flex-col" dataProvider="recoverOrder" submitResultDataProvider="order/recover/result"> 68855 <sonic-select 68856 name="send_type" 68857 class="min-w-[13rem]" 68858 value="all" 68859 .options=${[ 68860 { value: "all", wording: this.wording_abonnements + " + " + this.wording_billets }, 68861 { value: "abonnements", wording: this.wording_abonnements }, 68862 { value: "billets", wording: this.wording_billets } 68863 ]} 68864 > 68865 </sonic-select> 68866 <sonic-submit onEnterKey endPoint=${this.endPoint}> 68867 <sonic-input name="email" placeholder="[email protected]" value=""></sonic-input> 68868 </sonic-submit> 68869 <sonic-submit onClick endPoint=${this.endPoint}> 68870 <sonic-button shape="block" type="primary"> 68871 <sonic-icon name="paper-plane" library="custom"></sonic-icon> 68872 ${this.wording_Valider} 68873 </sonic-button> 68874 </sonic-submit> 68875 </div> 68876 </sonic-page-layout> 68877 `; 68878 } 68879 }; 68880 OrderRecover.styles = [ 68881 tailwind, 68882 i$9` 68883 :host { 68884 display: block; 68885 max-width: 90ch; 68886 } 68887 ` 68888 ]; 68889 __decorateClass$v([ 68890 n$5() 68891 ], OrderRecover.prototype, "endPoint", 2); 68892 __decorateClass$v([ 68893 n$5({ type: String }) 68894 ], OrderRecover.prototype, "wording_LIB_recup_commande_front", 2); 68895 __decorateClass$v([ 68896 n$5({ type: String }) 68897 ], OrderRecover.prototype, "wording_LIB_recup_commande_title", 2); 68898 __decorateClass$v([ 68899 n$5({ type: String }) 68900 ], OrderRecover.prototype, "wording_LIB_recup_commande_aide_new", 2); 68901 __decorateClass$v([ 68902 n$5({ type: String }) 68903 ], OrderRecover.prototype, "wording_abonnements", 2); 68904 __decorateClass$v([ 68905 n$5({ type: String }) 68906 ], OrderRecover.prototype, "wording_billets", 2); 68907 __decorateClass$v([ 68908 n$5({ type: String }) 68909 ], OrderRecover.prototype, "wording_Valider", 2); 68910 __decorateClass$v([ 68911 n$5({ type: Boolean }) 68912 ], OrderRecover.prototype, "displayTitle", 2); 68913 __decorateClass$v([ 68914 n$5({ type: Boolean }) 68915 ], OrderRecover.prototype, "displayText", 2); 68916 __decorateClass$v([ 68917 n$5({ type: Boolean }) 68918 ], OrderRecover.prototype, "smallTitle", 2); 68919 OrderRecover = __decorateClass$v([ 68920 t$3("sonic-order-recover") 68921 ], OrderRecover); 68922 var __defProp$s = Object.defineProperty; 68923 var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor; 68924 var __decorateClass$u = (decorators, target, key, kind) => { 68925 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target; 68926 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68927 if (decorator = decorators[i2]) 68928 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68929 if (kind && result) __defProp$s(target, key, result); 68930 return result; 68931 }; 68932 const tagName$p = "sonic-promo"; 68933 let SonicPagePromo$1 = class SonicPagePromo extends Subscriber$1(i$6) { 68934 constructor() { 68935 super(...arguments); 68936 this.wording_LIB_code_promo = ""; 68937 this.displayTitle = false; 68938 this.displayText = false; 68939 this.smallTitle = false; 68940 } 68941 render() { 68942 return b$1`<sonic-page-layout 68943 pageTitle=${this.wording_LIB_code_promo} 68944 ?smallTitle=${this.smallTitle} 68945 ?displayTitle=${this.displayTitle} 68946 ?displayText=${this.displayText} 68947 > 68948 <div class="my-8 max-w-[30rem]"> 68949 <sonic-promo-form></sonic-promo-form> 68950 </div> 68951 </sonic-page-layout>`; 68952 } 68953 }; 68954 SonicPagePromo$1.styles = [tailwind]; 68955 __decorateClass$u([ 68956 n$5() 68957 ], SonicPagePromo$1.prototype, "wording_LIB_code_promo", 2); 68958 __decorateClass$u([ 68959 n$5({ type: Boolean }) 68960 ], SonicPagePromo$1.prototype, "displayTitle", 2); 68961 __decorateClass$u([ 68962 n$5({ type: Boolean }) 68963 ], SonicPagePromo$1.prototype, "displayText", 2); 68964 __decorateClass$u([ 68965 n$5({ type: Boolean }) 68966 ], SonicPagePromo$1.prototype, "smallTitle", 2); 68967 SonicPagePromo$1 = __decorateClass$u([ 68968 t$3(tagName$p) 68969 ], SonicPagePromo$1); 68970 var __decorate$3 = function(decorators, target, key, desc) { 68971 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 68972 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 68973 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 68974 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 68975 }; 68976 const tagName$o = "sonic-alert-messages"; 68977 let AlertMessages = class AlertMessages extends Subscriber$1(i$6) { 68978 constructor() { 68979 super(...arguments); 68980 this.size = "md"; 68981 this.background = false;
68982 this.noIcon = false; 68983 this.messages = []; 68984 } 68985 render() { 68986 if (!this.messages?.length) 68987 return A$1; 68988 return b$1`<div class="container"> 68989 ${o$1(this.messages, (message) => { 68990 if (message.type == "public") { 68991 return b$1`<sonic-alert 68992 status=${message.status || "default"} 68993 text=${o$4(message.content)} 68994 size=${this.size} 68995 ?noIcon=${this.noIcon} 68996 ?background=${this.background} 68997 ></sonic-alert>`; 68998 } else 68999 return A$1; 69000 })} 69001 </div>`; 69002 } 69003 }; 69004 AlertMessages.styles = [ 69005 i$9` 69006 .container { 69007 display: grid; 69008 gap: 0.5em; 69009 grid-template-columns: minmax(0, 1fr); 69010 width: 100%; 69011 } 69012 ` 69013 ]; 69014 __decorate$3([ 69015 n$5({ type: String }) 69016 ], AlertMessages.prototype, "size", void 0); 69017 __decorate$3([ 69018 n$5({ type: Boolean }) 69019 ], AlertMessages.prototype, "background", void 0); 69020 __decorate$3([ 69021 n$5({ type: Boolean }) 69022 ], AlertMessages.prototype, "noIcon", void 0); 69023 __decorate$3([ 69024 n$5({ type: Array }) 69025 ], AlertMessages.prototype, "messages", void 0); 69026 AlertMessages = __decorate$3([ 69027 t$3(tagName$o) 69028 ], AlertMessages); 69029 var __defProp$r = Object.defineProperty; 69030 var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor; 69031 var __decorateClass$t = (decorators, target, key, kind) => { 69032 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target; 69033 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69034 if (decorator = decorators[i2]) 69035 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69036 if (kind && result) __defProp$r(target, key, result); 69037 return result; 69038 }; 69039 const tagName$n = "sonic-ticket-freeup"; 69040 let SonicFreeUp = class extends Subscriber$1(i$6) { 69041 constructor() { 69042 super(...arguments); 69043 this.displayTitle = false; 69044 this.smallTitle = false; 69045 this.displayText = false; 69046 this.formDataProvider = "FreeupTicketFormNotLoggedIn"; 69047 this.messages = []; 69048 } 69049 handleSubmit(event) { 69050 if (event.detail.success === false) { 69051 this.messages = event.detail.messages; 69052 } else { 69053 dp(this.formDataProvider).barcode.set(""); 69054 this.messages = []; 69055 } 69056 } 69057 render() { 69058 const isLoggedIn = !!this.user?.id; 69059 const userEmail = this.user?.email; 69060 return b$1`<sonic-page-layout 69061 pageTitle=${t("free_up")} 69062 pageSubtitle=${t("free_up_short_text")} 69063 ?smallTitle=${this.smallTitle} 69064 ?displayTitle=${this.displayTitle} 69065 ?displayText=${this.displayText} 69066 > 69067 ${isLoggedIn ? b$1`<sonic-quick-access-card 69068 class="block mb-8" 69069 type="warning" 69070 href=${appRoute("account.tickets")} 69071 title=${t("LIB_retrouvez_vos_billets_depuis_votre_compte")} 69072 text=${t("LIB_et_liberez_rapidement_et_simplement_vos_billets")} 69073 icon="ticket" 69074 ></sonic-quick-access-card> 69075 </sonic-app-link>` : b$1`<sonic-quick-access-card 69076 class="block mb-8" 69077 type="success" 69078 href=${appRoute("account")} 69079 title=${t("LIB_connectez_vous_a_votre_compte")} 69080 text=${t("LIB_et_retrouvez_rapidement_et_simplement_vos_billets_a_liberer")} 69081 icon="user" 69082 ></sonic-quick-access-card> `} 69083 69084 <div formDataProvider=${this.formDataProvider}> 69085 <form> 69086 <sonic-divider align="left" class="mb-5 text-neutral-500">${t("LIB_billets_sans_compte")}</sonic-divider> 69087 <sonic-submit onEnterKey endpoint="tickets" method="delete" @submit=${this.handleSubmit}> 69088 <sonic-form-layout> 69089 <sonic-input 69090 type="email" 69091 label=${t("email")} 69092 name="email" 69093 placeholder="[email protected]" 69094 value=${userEmail} 69095 required 69096 ></sonic-input> 69097 <sonic-input 69098 type="text" 69099 label=${t("barcode_or_ticket_number")} 69100 name="barcode" 69101 placeholder="- - - - - - - - - - - -" 69102 ></sonic-input> 69103 </sonic-form-layout> 69104 </sonic-submit> 69105 69106 ${this.messages.length > 0 ? b$1`<sonic-alert-messages 69107 size="inherit" 69108 class="block my-4 text-pretty" 69109 background 69110 .messages=${this.messages}
69111 dismissible 69112 dataProvider="FreeupTicketFormMessages" 69113 ></sonic-alert-messages>` : A$1} 69114 <sonic-submit onClick endpoint="tickets" method="delete" @submit=${this.handleSubmit} class="mt-4 block"> 69115 <sonic-button radio noAutoFill type="success" 69116 ><sonic-icon slot="prefix" name="check"></sonic-icon> ${t("confirm")} 69117 </sonic-button> 69118 </sonic-submit> 69119 </form> 69120 </div> 69121 </sonic-page-layout>`; 69122 } 69123 }; 69124 SonicFreeUp.styles = [tailwind]; 69125 __decorateClass$t([ 69126 n$5({ type: Boolean }) 69127 ], SonicFreeUp.prototype, "displayTitle", 2); 69128 __decorateClass$t([ 69129 n$5({ type: Boolean }) 69130 ], SonicFreeUp.prototype, "smallTitle", 2); 69131 __decorateClass$t([ 69132 n$5({ type: Boolean }) 69133 ], SonicFreeUp.prototype, "displayText", 2); 69134 __decorateClass$t([ 69135 bind$1("user"), 69136 r$5() 69137 ], SonicFreeUp.prototype, "user", 2); 69138 __decorateClass$t([ 69139 n$5({ type: Array }) 69140 ], SonicFreeUp.prototype, "messages", 2); 69141 SonicFreeUp = __decorateClass$t([ 69142 t$3(tagName$n) 69143 ], SonicFreeUp); 69144 var __defProp$q = Object.defineProperty; 69145 var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor; 69146 var __decorateClass$s = (decorators, target, key, kind) => { 69147 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target; 69148 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69149 if (decorator = decorators[i2]) 69150 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69151 if (kind && result) __defProp$q(target, key, result); 69152 return result; 69153 }; 69154 const tagName$m = "sonic-campaign-content"; 69155 let SonicCampaignContent = class extends Subscriber$1(i$6) { 69156 constructor() { 69157 super(...arguments); 69158 this.edito = {}; 69159 } 69160 render() { 69161 const endPoint = entityEndPoint({ 69162 entityType: EntityType.Event, 69163 isQueue: true, 69164 next: true, 69165 accessParams: this.accessParams, 69166 view: entityView.essential 69167 }); 69168 return b$1`<sonic-page-layout 69169 pageTitle=${o$4(this.edito?.title)} 69170 pageText=${o$4(this.edito?.body)} 69171 pageSubtitle=${o$4(this.edito?.sub_title)} 69172 displayTitle 69173 displayText 69174 > 69175 <sonic-form-event-filter 69176 formDataProvider="campaignFormFilter" 69177 filterCategory 69178 class="block max-w-[40rem] w-full z-10 min-w-0 mb-6" 69179 ></sonic-form-event-filter> 69180 <div> 69181 <sonic-queue 69182 dataProviderExpression="${endPoint}" 69183 key="data" 69184 limit="5" 69185 targetRequestDuration="1000" 69186 dataProvider="campainResults" 69187 dataFilterProvider="campaignFormFilter" 69188 .items=${(_item, _metadata) => { 69189 const onlyOneResult = _metadata.firstChild && _metadata.lastChild; 69190 return b$1`<sonic-event-store-item 69191 showAllSessionsButton 69192 formType="select" 69193 ?alwaysExpanded=${onlyOneResult} 69194 class="mb-4 block" 69195 ></sonic-event-store-item>`; 69196 }} 69197 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 69198 > 69199 </sonic-queue></div 69200 ></sonic-page-layout>`; 69201 } 69202 }; 69203 SonicCampaignContent.styles = [tailwind]; 69204 __decorateClass$s([ 69205 n$5({ type: Object }) 69206 ], SonicCampaignContent.prototype, "edito", 2); 69207 __decorateClass$s([ 69208 c({ context: accessParamsContext, subscribe: true }), 69209 n$5({ type: Object }) 69210 ], SonicCampaignContent.prototype, "accessParams", 2); 69211 SonicCampaignContent = __decorateClass$s([ 69212 t$3(tagName$m) 69213 ], SonicCampaignContent); 69214 var __defProp$p = Object.defineProperty; 69215 var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor; 69216 var __decorateClass$r = (decorators, target, key, kind) => { 69217 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target; 69218 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69219 if (decorator = decorators[i2]) 69220 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69221 if (kind && result) __defProp$p(target, key, result); 69222 return result; 69223 }; 69224 const tagName$l = "sonic-campaign"; 69225 let SonicCampaign = class extends Fetcher$1(Subscriber$1(i$6)) { 69226 constructor() { 69227 super(...arguments); 69228 this.success = false;
69229 } 69230 connectedCallback() { 69231 if (!this.accessParams) { 69232 this.accessParams = getAccessParamsFromUrl(); 69233 } 69234 this.initDataProvider(); 69235 super.connectedCallback(); 69236 } 69237 willUpdate(changedProperties) { 69238 if (changedProperties.has("success")) { 69239 dp$1("user").invalidate(); 69240 } 69241 } 69242 initDataProvider() { 69243 const urlParams = new URLSearchParams(); 69244 appendAccessParams(urlParams, this.accessParams); 69245 const { campaignId, campaignHash } = this.accessParams || {}; 69246 const fragment = campaignHash || campaignId; 69247 if (fragment) { 69248 this.setAttribute("dataProvider", `campaign/${fragment}?${urlParams.toString()}`); 69249 } 69250 } 69251 render() { 69252 return b$1`${this.success ? b$1`<sonic-fullscreen-layout displayBanner> 69253 <sonic-campaign-content subDataProvider="data" ></sonic-campaign-content> 69254 </sonic-page-layout> 69255 <sonic-cart-full dataProvider="cart/current" subDataProvider="data" layout="condensed" slot="aside" class="shadow-lg py-8 px-6 rounded-lg hidden lg:block sticky top-0"></sonic-cart-full> 69256 </sonic-fullscreen-layout 69257 >` : A$1}`; 69258 } 69259 }; 69260 SonicCampaign.styles = [tailwind]; 69261 __decorateClass$r([ 69262 e$2({ context: accessParamsContext }), 69263 n$5({ type: Object }) 69264 ], SonicCampaign.prototype, "accessParams", 2); 69265 __decorateClass$r([ 69266 n$5({ type: Boolean }) 69267 ], SonicCampaign.prototype, "success", 2); 69268 SonicCampaign = __decorateClass$r([ 69269 t$3(tagName$l) 69270 ], SonicCampaign); 69271 var __defProp$o = Object.defineProperty; 69272 var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor; 69273 var __decorateClass$q = (decorators, target, key, kind) => { 69274 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target; 69275 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69276 if (decorator = decorators[i2]) 69277 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69278 if (kind && result) __defProp$o(target, key, result); 69279 return result; 69280 }; 69281 const tagName$k = "sonic-ask-pro-account"; 69282 let SonicComponent$1 = class SonicComponent extends Subscriber$1(i$6) { 69283 constructor() { 69284 super(...arguments); 69285 this.displayTitle = false; 69286 this.displayText = false; 69287 this.smallTitle = false; 69288 this.updateAccount = false; 69289 this.accessAskProAccount = false; 69290 this.create_pro_account = false; 69291 } 69292 render() { 69293 return b$1`<sonic-page-layout 69294 ?smallTitle=${this.smallTitle} 69295 ?displayTitle=${this.displayTitle} 69296 ?displayText=${this.displayText} 69297 pageTitle=${this.create_pro_account ? t("create_account") : this.updateAccount ? t("LIB_formulaire_pro_actualiser") : t("LIB_compte_pro_formulaire_demande")} 69298 pageText=${this.accessAskProAccount ? t("LIB_compte_pro_formulaire_body") : ""} 69299 ><sonic-iframe src="/ask_pro_account?no_title=true"></sonic-iframe 69300 ></sonic-page-layout>`; 69301 } 69302 }; 69303 __decorateClass$q([ 69304 n$5({ type: Boolean }) 69305 ], SonicComponent$1.prototype, "displayTitle", 2); 69306 __decorateClass$q([ 69307 n$5({ type: Boolean }) 69308 ], SonicComponent$1.prototype, "displayText", 2); 69309 __decorateClass$q([ 69310 n$5({ type: Boolean }) 69311 ], SonicComponent$1.prototype, "smallTitle", 2); 69312 __decorateClass$q([ 69313 n$5({ type: Boolean }) 69314 ], SonicComponent$1.prototype, "updateAccount", 2); 69315 __decorateClass$q([ 69316 bind$1("settings.modules.ask_pro_account.access"), 69317 r$5() 69318 ], SonicComponent$1.prototype, "accessAskProAccount", 2); 69319 __decorateClass$q([ 69320 bind$1("settings.modules.create_pro_account.access"), 69321 r$5() 69322 ], SonicComponent$1.prototype, "create_pro_account", 2); 69323 SonicComponent$1 = __decorateClass$q([ 69324 t$3(tagName$k) 69325 ], SonicComponent$1); 69326 var __defProp$n = Object.defineProperty; 69327 var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor; 69328 var __decorateClass$p = (decorators, target, key, kind) => { 69329 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target; 69330 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69331 if (decorator = decorators[i2]) 69332 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69333 if (kind && result) __defProp$n(target, key, result); 69334 return result; 69335 }; 69336 const tagName$j = "sonic-custom-list-content"; 69337 let SonicCustomList$1 = class SonicCustomList extends Subscriber$1(i$6) { 69338 constructor() { 69339 super(...arguments); 69340 this.edito = {}; 69341 this.sessions = []; 69342 } 69343 render() { 69344 if (!this.props) return A$1; 69345 return b$1` 69346 <sonic-page-header .label=${this.edito.title}></sonic-page-header> 69347 69348 ${this.edito.body ? b$1`<div class="prose mb-10">${o$6(this.edito.body)}</div>` : A$1} 69349 ${this.props?.scheduledAt ? b$1`<sonic-alert status="warning" class="mb-3"> 69350 ${t("en_ligne_a_partir_du")} 69351 <sonic-date date=${this.props?.scheduledAt}></sonic-date> 69352 </sonic-alert>` : A$1} 69353 ${this.props?.quickAccess?.subscriptions ? b$1`<sonic-subscription-help class="block "></sonic-subscription-help>` : A$1} 69354 ${this.renderQuickAccess()} 69355 <sonic-list 69356 subDataProvider="sessions" 69357 class="grid gap-3 grid-cols-1" 69358 .items=${() => b$1`<sonic-event-store-item formType="buttons" formSize="sm"></sonic-event-store-item>`} 69359 > 69360 </sonic-list> 69361 `; 69362 } 69363 renderQuickAccess() { 69364 const quickAccess = this.props?.quickAccess; 69365 if (!quickAccess?.subscriptions && !quickAccess?.giftcards) return A$1; 69366 return b$1` 69367 <div class="flex gap-2 mb-3"> 69368 ${quickAccess?.subscriptions ? b$1`<sonic-cart-add-entity .entityType=${EntityType.Subscribe} class="block grow"></sonic-cart-add-entity>` : A$1} 69369 ${quickAccess?.giftcards ? b$1`<sonic-cart-add-entity .entityType=${EntityType.Giftcard} class="block grow"></sonic-cart-add-entity>` : A$1} 69370 </div> 69371 `; 69372 } 69373 }; 69374 SonicCustomList$1.styles = [tailwind]; 69375 __decorateClass$p([ 69376 n$5({ type: Object }) 69377 ], SonicCustomList$1.prototype, "edito", 2); 69378 __decorateClass$p([ 69379 n$5({ type: Array }) 69380 ], SonicCustomList$1.prototype, "sessions", 2); 69381 SonicCustomList$1 = __decorateClass$p([ 69382 t$3(tagName$j) 69383 ], SonicCustomList$1); 69384 var __defProp$m = Object.defineProperty; 69385 var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor; 69386 var __decorateClass$o = (decorators, target, key, kind) => { 69387 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target; 69388 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69389 if (decorator = decorators[i2]) 69390 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69391 if (kind && result) __defProp$m(target, key, result); 69392 return result; 69393 }; 69394 const tagName$i = "sonic-custom-list"; 69395 let SonicCustomList = class extends Fetcher(Subscriber$1(i$6)) { 69396 constructor() { 69397 super(...arguments); 69398 this.success = null; 69399 } 69400 connectedCallback() { 69401 if (!this.accessParams) { 69402 this.accessParams = getAccessParamsFromUrl(); 69403 } 69404 if (!this.accessParams?.customListSlug) { 69405 const slug = decodeURI(window.location.href.split("/").pop() || ""); 69406 this.accessParams.customListSlug = appRoute("customList").extract()?.slug || slug;
69407 } 69408 this.noErrorsRecordings = true; 69409 super.connectedCallback(); 69410 } 69411 render() { 69412 const hasPictureSrc = !!this.publisher.get().data?.picture?.src; 69413 return b$1` <sonic-fullscreen-layout> 69414 ${this.success === false ? b$1` 69415 <form 69416 formDataProvider="customListLogin" 69417 submitResultDataProvider="${this.dataProvider || ""}" 69418 dataProvider="customListLogin" 69419 > 69420 <sonic-fieldset class="max-w-[25rem]"> 69421 <sonic-legend iconLibrary="custom" iconName="lock" label=${t("password")}></sonic-legend> 69422 <sonic-form-layout> 69423 <sonic-submit onEnterKey endpoint="custom-list/login" method="post"> 69424 <sonic-form-layout> 69425 <sonic-input type="hidden" name="list" value=${this.accessParams?.customListSlug}></sonic-input> 69426 <sonic-input type="password" data-aria-label=${t("password")} name="password"></sonic-input> 69427 </sonic-form-layout> 69428 </sonic-submit> 69429 <sonic-form-actions> 69430 <sonic-submit onClick endpoint="custom-list/login" method="post"> 69431 <sonic-button radio noAutoFill type="success"> 69432 <sonic-icon slot="prefix" name="check"></sonic-icon> 69433 ${t("confirm")} 69434 </sonic-button> 69435 </sonic-submit> 69436 </sonic-form-actions> 69437 </sonic-form-layout> 69438 </sonic-fieldset> 69439 </form> 69440 ` : A$1} 69441 ${this.success ? b$1`<sonic-custom-list-content subDataProvider="data"></sonic-custom-list-content> ${hasPictureSrc ? b$1`<div 69442 slot="aside" 69443 class="relative h-full bg-neutral-100 rounded-lg overflow-hidden hidden lg:block" 69444 > 69445 <sonic-product-illustration subDataProvider="data" cover></sonic-product-illustration> 69446 </div> ` : A$1}` : A$1} 69447 </sonic-fullscreen-layout>`; 69448 } 69449 }; 69450 SonicCustomList.styles = [tailwind]; 69451 __decorateClass$o([ 69452 r$5() 69453 ], SonicCustomList.prototype, "success", 2); 69454 __decorateClass$o([ 69455 e$2({ context: accessParamsContext }), 69456 n$5({ type: Object }) 69457 ], SonicCustomList.prototype, "accessParams", 2); 69458 SonicCustomList = __decorateClass$o([ 69459 t$3(tagName$i) 69460 ], SonicCustomList); 69461 var __decorate$2 = function(decorators, target, key, desc) { 69462 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 69463 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 69464 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 69465 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 69466 }; 69467 const tagName$h = "sonic-redirect"; 69468 let SonicRedirect = class SonicRedirect extends Subscriber$1(i$6) { 69469 connectedCallback() { 69470 this.noShadowDom = ""; 69471 this.style.display = "none"; 69472 super.connectedCallback(); 69473 this.udpateCallBack = () => this.update(); 69474 if (this.publisher) 69475 this.publisher.onInternalMutation(this.udpateCallBack); 69476 } 69477 disconnectedCallback() { 69478 if (this.publisher) 69479 this.publisher.offInternalMutation(this.udpateCallBack); 69480 super.disconnectedCallback(); 69481 } 69482 update() { 69483 if (this.hasAttribute("onAdded")) { 69484 LocationHandler$1.changeFromComponent(this); 69485 return; 69486 } 69487 if (!this.props) 69488 return; 69489 const onDataPath = this.getAttribute("onData").split("."); 69490 const searchedData = Objects$1.traverse(this.props, onDataPath); 69491 if (searchedData && !(Objects$1.isObject(searchedData) && searchedData)) { 69492 LocationHandler$1.changeFromComponent(this); 69493 } 69494 } 69495 }; 69496 SonicRedirect = __decorate$2([ 69497 t$3(tagName$h) 69498 ], SonicRedirect); 69499 const checkbox = { "tagName": "sonic-checkbox" }; 69500 const date = { "tagName": "sonic-input", "attributes": { "type": "date" } }; 69501 const fieldset = { "tagName": "sonic-fieldset", "nodes": [{ "libraryKey": "formLayout" }], "contentElementSelector": "sonic-form-layout" }; 69502 const managed_file = { "tagName": "sonic-input", "attributes": { "variant": "ghost", "type": "file" } }; 69503 const password = { "tagName": "sonic-input", "attributes": { "type": "password" } }; 69504 const radio = { "tagName": "sonic-radio" }; 69505 const select = { "tagName": "sonic-select" }; 69506 const textarea = { "tagName": "sonic-textarea" }; 69507 const textfield = { "tagName": "sonic-input", "attributes": { "type": "text" } }; 69508 const hidden = { "tagName": "sonic-input", "attributes": { "type": "hidden" } }; 69509 const button = { "tagName": "sonic-button" }; 69510 const form = { "tagName": "sonic-submit", "attributes": { "onEnterKey": true } }; 69511 const submit = { "tagName": "sonic-submit", "attributes": { "onClick": true }, "contentElementSelector": "sonic-button", "nodes": [{ "libraryKey": "button", "attributes": { "type": "success" }, "nodes": [{ "tagName": "sonic-icon", "attributes": { "name": "check", "slot": "prefix" } }] }] }; 69512 const email = { "tagName": "sonic-input", "attributes": { "type": "email" } }; 69513 const formItemContainer = { "tagName": "div", "attributes": { "class": "form-item-container" } }; 69514 const formLayout = { "tagName": "sonic-form-layout" }; 69515 const formActions = { "tagName": "sonic-form-actions" }; 69516 const passwordHelper = { "tagName": "sonic-password-helper" }; 69517 const sameValueHelper = { "tagName": "sonic-same-value-helper" };
69518 const divider = { "tagName": "sonic-divider" }; 69519 const default_library = { 69520 checkbox, 69521 date, 69522 fieldset, 69523 managed_file, 69524 password, 69525 radio, 69526 select, 69527 textarea, 69528 textfield, 69529 hidden, 69530 button, 69531 form, 69532 submit, 69533 email, 69534 formItemContainer, 69535 formLayout, 69536 formActions, 69537 passwordHelper, 69538 sameValueHelper, 69539 divider 69540 }; 69541 class SDUIDescriptorTransformer { 69542 /** 69543 * Tranform un SDUIDescriptor via une SDUITransformDescription 69544 * Attention fonction non pure : la sduiDescriptor est modifiée en place. 69545 * * La librarie de la sduiDescriptor est mise à jour avec celle présente dans SDUITransformDescription<br> 69546 * Si des clefs de librairie correspondent, celles de SDUITransformDescription ecrasent celles existantes 69547 * * Ensuite des actions de transformations sont menées sur les nodes du SDUIDescriptor 69548 * 69549 */ 69550 async transform(sduiDescriptor, transformDescriptor) { 69551 this.sduiDescriptor = sduiDescriptor; 69552 if (this.sduiDescriptor.library) { 69553 for (const key in transformDescriptor.library) { 69554 this.sduiDescriptor.library[key] = transformDescriptor.library[key]; 69555 } 69556 } 69557 for (const item of transformDescriptor.transforms) { 69558 this.transformAction(item); 69559 } 69560 } 69561 /** 69562 * Effectue une actions de transformation sur les noeuds (nodes) de la sduiDescriptor (SDUIDescriptor) 69563 * La des noeuds impacté est sélectionnée via pattern matching (voir SDUITransformAction.pattern et getNodesMatchingPatterns); 69564 * Voir le détail des actions de transformations dns les fonctions appellées dans le switch. 69565 */ 69566 transformAction(transformAction) { 69567 const uis = this.getNodesMatchingPatterns(transformAction.patterns, this.sduiDescriptor); 69568 this[transformAction.action](transformAction, uis); 69569 } 69570 /** 69571 * Retourne les noeuds du SDUIDescriptor qui matche la liste de patterns fournis, dans l'ordre des patterns fournis 69572 */ 69573 getNodesMatchingPatterns(patterns, node) { 69574 if (!patterns) 69575 return []; 69576 if (!node) 69577 return []; 69578 const nodes = node.nodes; 69579 if (!nodes) 69580 return []; 69581 let result = []; 69582 let index = 0; 69583 for (const pattern of patterns) { 69584 for (const child of nodes) { 69585 if (this.nodeMatchesPattern(pattern, child)) { 69586 result.push({ parent: node, child, index }); 69587 } 69588 result = result.concat(this.getNodesMatchingPatterns([pattern], child)); 69589 index++; 69590 } 69591 } 69592 return result; 69593 } 69594 /** 69595 * Utilisé pour voir si un élément du pattern match le même élement du noeud en cours de traitement 69596 */ 69597 stringMatchesExpression(stringToTest, regExpString) { 69598 return !regExpString || stringToTest && stringToTest.match(regExpString); 69599 } 69600 /** 69601 * Return true si le pattern match avec le noeud, false sinon. 69602 */ 69603 nodeMatchesPattern(pattern, node) { 69604 const patternDynamic = pattern; 69605 const nodeDynamic = node; 69606 const keys2 = ["libraryKey", "innerHTML", "prefix", "suffix", "markup"]; 69607 for (const key of keys2) { 69608 if (!this.stringMatchesExpression(nodeDynamic[key], patternDynamic[key])) { 69609 return false; 69610 } 69611 } 69612 const patternAttributes = pattern.attributes; 69613 const nodeAttributes = node.attributes; 69614 if (patternAttributes && !nodeAttributes) 69615 return false; 69616 if (patternAttributes) { 69617 for (const name in patternAttributes) { 69618 if (!nodeAttributes || !this.stringMatchesExpression(nodeAttributes[name], patternAttributes[name])) { 69619 return false; 69620 } 69621 } 69622 } 69623 return true; 69624 } 69625 /** 69626 * Pour chaque élément de la liste, remplace l'élément par ses enfants 69627 */ 69628 unwrap(transformAction, list) { 69629 for (const item of list) { 69630 item.parent.nodes?.splice(item.parent.nodes.indexOf(item.child), 1); 69631 if (item.child.nodes) { 69632 item.parent.nodes?.splice(item.parent.nodes.indexOf(item.child), 0, ...item.child.nodes); 69633 } 69634 } 69635 } 69636 /** 69637 * Regroupe tous les éléments de la liste dans l'élément fourni via la prop `ui` de transformAction 69638 * L'élément créé est inséré en lieu et place du premier élément de la liste 69639 */ 69640 wrap(transformAction, list) { 69641 const wrapper = { ...transformAction.ui }; 69642 if (!wrapper.nodes) 69643 wrapper.nodes = []; 69644 let i2 = 0; 69645 for (const item of list) { 69646 wrapper.nodes?.push(item.child); 69647 if (i2 > 0) { 69648 item.parent.nodes?.splice(item.parent.nodes.indexOf(item.child), 1); 69649 } 69650 i2++; 69651 } 69652 const idx = list[0]?.parent.nodes?.indexOf(list[0].child); 69653 if (idx) { 69654 list[0].parent.nodes?.splice(idx, 1); 69655 list[0].parent.nodes?.splice(idx, 0, wrapper); 69656 } 69657 } 69658 /** 69659 * Déplace tous les noeuds de la liste avant ou après le noeuds sélectionné par pattern matching via l'attribut correspondant `before` ou `after` 69660 */ 69661 move(transformAction, list) { 69662 for (const item of list) { 69663 item.parent.nodes?.splice(item.parent.nodes.indexOf(item.child), 1); 69664 let list2 = []; 69665 if (transformAction.after) 69666 list2 = this.getNodesMatchingPatterns([transformAction.after], this.sduiDescriptor); 69667 if (transformAction.before) 69668 list2 = this.getNodesMatchingPatterns([transformAction.before], this.sduiDescriptor); 69669 const element = list2[0]; 69670 if (element) { 69671 element.parent.nodes?.splice(element.parent.nodes.indexOf(element.child) + (transformAction.after ? 1 : 0), 0, item.child); 69672 } 69673 } 69674 } 69675 /** 69676 * Transform ous les éléments fourni dans la liste en un élément créé a partir du model fourni dans ui. 69677 * Les props attributs et autre props de chaque élément sont conservés si non remapés 69678 */ 69679 remap(transformAction, list) { 69680 for (const item of list) { 69681 const newUI = { ...transformAction.ui }; 69682 if (!newUI.attributes) { 69683 newUI.attributes = {}; 69684 } 69685 const childAttributes = item.child.attributes; 69686 if (childAttributes) { 69687 for (const key in childAttributes) { 69688 if (!Object.prototype.hasOwnProperty.call(newUI.attributes, "key")) 69689 newUI.attributes[key] = childAttributes[key]; 69690 } 69691 }
69692 const keys2 = ["libraryKey", "innerHTML", "prefix", "suffix", "markup"]; 69693 const childDynamic = item.child; 69694 const newUIDynamic = newUI; 69695 for (const key of keys2) { 69696 if (!Object.prototype.hasOwnProperty.call(newUI, key) && childDynamic[key]) 69697 newUIDynamic[key] = childDynamic[key]; 69698 } 69699 if (!newUI.nodes) { 69700 newUI.nodes = []; 69701 } 69702 const childNodes = item.child.nodes; 69703 if (childNodes) { 69704 for (const node of childNodes) { 69705 newUI.nodes.push(node); 69706 } 69707 } 69708 const idx = item.parent.nodes?.indexOf(item.child) || -1; 69709 if (idx != -1) { 69710 item.parent.nodes?.splice(idx, 1); 69711 item.parent.nodes?.splice(idx, 0, newUI); 69712 } 69713 } 69714 } 69715 /** 69716 * Supprime tous les éléments de la liste. 69717 */ 69718 delete(transformAction, list) { 69719 for (const item of list) { 69720 item.parent.nodes?.splice(item.parent.nodes.indexOf(item.child), 1); 69721 } 69722 } 69723 /** 69724 * Ajoute une copie de l'élément décrit dans la propriété ui de transformAction avant ou après chaque élément de la liste 69725 * La positione st déterminée par l'attribute before ou after ou in qui est un pattern permettant la sélection de l'élément de référence pur l'ajout 69726 */ 69727 insert(transformAction, list) { 69728 const positionType = transformAction.after ? "after" : transformAction.before ? "before" : "in"; 69729 list = []; 69730 if (transformAction.after) { 69731 list = this.getNodesMatchingPatterns([transformAction.after], this.sduiDescriptor); 69732 } else if (transformAction.before) { 69733 list = this.getNodesMatchingPatterns([transformAction.before], this.sduiDescriptor); 69734 } else if (transformAction.in) { 69735 list = this.getNodesMatchingPatterns([transformAction.in], this.sduiDescriptor); 69736 } 69737 const node = list[0]; 69738 if (node) { 69739 if (positionType == "in") { 69740 if (!node.child.nodes) 69741 node.child.nodes = []; 69742 node.child.nodes.push({ ...transformAction.ui }); 69743 } else { 69744 node.parent.nodes?.splice(node.parent.nodes.indexOf(node.child) + (positionType == "after" ? 1 : 0), 0, { 69745 ...transformAction.ui 69746 }); 69747 } 69748 } 69749 } 69750 } 69751 var __decorate$1 = function(decorators, target, key, desc) { 69752 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 69753 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 69754 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 69755 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 69756 }; 69757 const tagName$g = "sonic-sdui"; 69758 let SonicSDUI = class SonicSDUI extends Fetcher(Subscriber(i$6)) { 69759 constructor() { 69760 super(...arguments); 69761 this.sduiDescriptor = {}; 69762 } 69763 connectedCallback() { 69764 this.noShadowDom = ""; 69765 this.displayContents = true; 69766 this.isFetchEnabled = this.hasAttribute("fetch"); 69767 super.connectedCallback(); 69768 } 69769 /** 69770 * On peut passer la description sous form de props, sinon il faut utiliser l'attribut fetch 69771 */ 69772 willUpdate(changedProperties) { 69773 if (this.props == null) { 69774 this.sduiDescriptor = {}; 69775 } 69776 { 69777 const newSduiDescriptor = this.sduiKey ? this.props[this.sduiKey] : this.props; 69778 if (this.sduiDescriptor == newSduiDescriptor) 69779 return; 69780 this.sduiDescriptor = newSduiDescriptor; 69781 this.updateContents(); 69782 } 69783 super.willUpdate(changedProperties); 69784 } 69785 /** 69786 * updateContents est déclenché quand les sduiDescriptor sont renseignées 69787 * Le contenu du composant est regénéré en fonction du descripteur fourni 69788 */ 69789 async updateContents() { 69790 if (!this.sduiDescriptor) 69791 return; 69792 const library = {}; 69793 Object.assign(library, default_library, this.sduiDescriptor.library); 69794 this.sduiDescriptor.library = library; 69795 this.loadAssets(); 69796 await this.loadLibrary(); 69797 await this.transformSDUIDescriptor(); 69798 this.parseRootNodes(); 69799 } 69800 /** 69801 * Suppressiond du contenu du composant avant le génération de la nouvelle ui 69802 */ 69803 removeChildren() { 69804 while ([...this.children].filter((elt) => elt.nodeName != "SLOT").length > 0) { 69805 this.removeChild(this.children[0]); 69806 } 69807 } 69808 /**
69809 * Chargement de fichiers js et css associés si besoin 69810 **/ 69811 loadAssets() { 69812 if (!this.sduiDescriptor) 69813 return; 69814 if (this.sduiDescriptor.js) { 69815 for (const src of this.sduiDescriptor.js) 69816 HTML.loadJS(src); 69817 } 69818 if (this.sduiDescriptor.css) { 69819 for (const src of this.sduiDescriptor.css) 69820 HTML.loadCSS(src); 69821 } 69822 } 69823 /** 69824 * Transformation de la data fournie via sduiDescriptor si il y a un attribut transformation 69825 * */ 69826 async transformSDUIDescriptor() { 69827 if (!this.hasAttribute("transformation")) 69828 return; 69829 const result = await fetch(this.getAttribute("transformation")); 69830 const json = await result.json(); 69831 const transformer = new SDUIDescriptorTransformer(); 69832 await transformer.transform(this.sduiDescriptor, json); 69833 } 69834 /** 69835 * Charge la library à utiliser 69836 * */ 69837 async loadLibrary() { 69838 if (!this.hasAttribute("library")) 69839 return; 69840 const result = await fetch(this.getAttribute("library")); 69841 const json = await result.json(); 69842 this.sduiDescriptor.library = json; 69843 } 69844 /** 69845 * Point d'entrée : transformation des noeuds fournis en éléments graphiques 69846 **/ 69847 parseRootNodes() { 69848 this.removeChildren(); 69849 if (!this.sduiDescriptor) 69850 return; 69851 let nodes = this.sduiDescriptor.nodes; 69852 if (!nodes) 69853 nodes = []; 69854 const messageProvider = { 69855 tagName: "sonic-toast-message-subscriber", 69856 attributes: {} 69857 }; 69858 if (this.messagesKey) { 69859 messageProvider.attributes = { subDataProvider: this.messagesKey }; 69860 } 69861 nodes.push(messageProvider); 69862 nodes.forEach((node) => this.appendChild(this.parseChild(node))); 69863 } 69864 /** 69865 * On parse un noeud ce qui crée un éléments graphique et ses enfants par recursivité via `handleChildNodes` 69866 */ 69867 parseChild(node) { 69868 const tagName2 = node.tagName || "div"; 69869 let { element, contentElement } = this.handleLibrary(node, tagName2); 69870 this.handleAttributes(node, element); 69871 element = this.handleMarkup(node, element); 69872 if (!contentElement) 69873 contentElement = element; 69874 this.handleChildNodes(node, contentElement, element); 69875 this.handleInnerHTML(node, contentElement); 69876 if (node.prefix || node.suffix) { 69877 const container = this.handlePrefixSuffix(node, element); 69878 return container; 69879 } 69880 return element; 69881 } 69882 /** 69883 * Si le noeud courant a des propriétés prefix et ou suffix il est entouré des markups fournis dans ces sduiDescriptor. 69884 * Le tout est inclu dans une div en display contents 69885 */ 69886 handlePrefixSuffix(node, element) { 69887 const container = document.createElement("div"); 69888 container.innerHTML = (node.prefix || "") + element.outerHTML + (node.suffix || ""); 69889 container.style.display = "contents"; 69890 return container; 69891 } 69892 /** 69893 * Création des enfants du noeud courant 69894 * Si l'enfant à un attribut parentElementSelector, il est ajouté dans le noeud correspondant au sélecteur css associé et non pas dans l'élément directement. 69895 */ 69896 handleChildNodes(node, contentElement, element) { 69897 if (node.nodes) { 69898 const children = node.nodes; 69899 for (const child of children) { 69900 const childElement = this.parseChild(child); 69901 let nodeToAppendOn = contentElement; 69902 if (child.parentElementSelector) { 69903 nodeToAppendOn = element.querySelector(child.parentElementSelector) || contentElement; 69904 } 69905 if (nodeToAppendOn.shadowRoot) 69906 nodeToAppendOn.shadowRoot.appendChild(childElement); 69907 else if (nodeToAppendOn.tagName.toLocaleLowerCase() == "template") { 69908 const template = nodeToAppendOn; 69909 template.content.appendChild(childElement); 69910 } else 69911 nodeToAppendOn.appendChild(childElement); 69912 } 69913 } 69914 } 69915 /** 69916 * Gestion de librarie : 69917 * * Si l'élément référence un élément de la librairie, on se sert de cet élément comme model pour créer le composant graphique.
69918 * * Sa propriété contentElement retournée vaut element par défaut. 69919 * * Si contentElementSelector est definit, alors contentElement correspond à l'élément obtenu par selection css d'après la valeurs de contentElementSelector 69920 * * Les éléments enfants seront ensuite ajoutés dans contentElement 69921 */ 69922 handleLibrary(node, tagName2) { 69923 let element; 69924 let contentElement; 69925 if (node.libraryKey && this.sduiDescriptor.library) { 69926 element = this.parseChild(this.sduiDescriptor.library[node.libraryKey] || { tagName: "div" }); 69927 const selector = (this.sduiDescriptor.library[node.libraryKey] || {}).contentElementSelector; 69928 if (selector) 69929 contentElement = element.querySelector(selector); 69930 } else 69931 element = document.createElement(tagName2); 69932 return { element, contentElement }; 69933 } 69934 /** 69935 * Remplissage des attributs html avec les attributs fournis dans le noeud 69936 */ 69937 handleAttributes(node, element) { 69938 const attributes = node.attributes; 69939 for (const k2 in attributes) { 69940 const attrData = attributes[k2]; 69941 const attr = Objects.isObject(attrData) ? JSON.stringify(attrData) : attrData; 69942 element.setAttribute(k2, attr); 69943 } 69944 } 69945 /** 69946 * Si une propriété markup est fournie, l'élément est créé à partir de la chaine html fournie avant d'être configuré 69947 */ 69948 handleMarkup(node, element) { 69949 if (node.markup) { 69950 element = document.createElement("div"); 69951 element.style.display = "contents"; 69952 element.innerHTML = node.markup; 69953 } 69954 return element; 69955 } 69956 /** 69957 * si le noeud à une propriété innerHTML, on l'ajout ay innerHTML de l'élément html en cours de création 69958 */ 69959 handleInnerHTML(node, contentElement) { 69960 if (!node.innerHTML) 69961 return; 69962 if (node.innerHTML.indexOf("wording_") != -1) { 69963 const wordingProvider = this.getAncestorAttributeValue("wordingProvider"); 69964 this.api?.post(wordingProvider, { labels: [node.innerHTML.substring(8)] }).then((value) => { 69965 if (contentElement) 69966 contentElement.innerHTML += value; 69967 }); 69968 } else if (contentElement) { 69969 contentElement.innerHTML += node.innerHTML; 69970 } 69971 } 69972 }; 69973 __decorate$1([ 69974 n$5() 69975 ], SonicSDUI.prototype, "sduiKey", void 0); 69976 __decorate$1([ 69977 n$5() 69978 ], SonicSDUI.prototype, "messagesKey", void 0); 69979 SonicSDUI = __decorate$1([ 69980 t$3(tagName$g) 69981 ], SonicSDUI); 69982 var __defProp$l = Object.defineProperty; 69983 var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor; 69984 var __decorateClass$n = (decorators, target, key, kind) => { 69985 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target; 69986 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69987 if (decorator = decorators[i2]) 69988 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69989 if (kind && result) __defProp$l(target, key, result); 69990 return result; 69991 }; 69992 const tagName$f = "sonic-carpooling"; 69993 let SonicPageCarpooling = class extends CovoitLoad(i$6) { 69994 constructor() { 69995 super(...arguments); 69996 this.displayTitle = false; 69997 this.smallTitle = false; 69998 this.displayText = false; 69999 } 70000 render() { 70001 const covoitURL = this.carpoolingSettings?.url; 70002 const token = this.carpoolingSettings?.token || ""; 70003 if (!covoitURL) return A$1; 70004 return b$1`<sonic-page-layout 70005 pageTitle=${t("module_carpooling_title")} 70006 pageText=${t("module_carpooling_text")} 70007 ?smallTitle=${this.smallTitle} 70008 ?displayTitle=${this.displayTitle} 70009 ?displayText=${this.displayText} 70010 > 70011 <covoit-app 70012 covoitURL="${covoitURL}" 70013 baseURL=${appRoute("carpooling")} 70014 token="${o$4(token)}" 70015 encryptedUid=${o$4(this.encryptedUid)} 70016 customRoutes=${JSON.stringify(this.customRoutes)} 70017 ></covoit-app> 70018 </sonic-page-layout>`; 70019 } 70020 }; 70021 __decorateClass$n([ 70022 n$5({ type: Boolean }) 70023 ], SonicPageCarpooling.prototype, "displayTitle", 2); 70024 __decorateClass$n([ 70025 n$5({ type: Boolean }) 70026 ], SonicPageCarpooling.prototype, "smallTitle", 2); 70027 __decorateClass$n([ 70028 n$5({ type: Boolean }) 70029 ], SonicPageCarpooling.prototype, "displayText", 2); 70030 SonicPageCarpooling = __decorateClass$n([ 70031 t$3(tagName$f) 70032 ], SonicPageCarpooling); 70033 var __defProp$k = Object.defineProperty; 70034 var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor; 70035 var __decorateClass$m = (decorators, target, key, kind) => { 70036 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target; 70037 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70038 if (decorator = decorators[i2]) 70039 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70040 if (kind && result) __defProp$k(target, key, result); 70041 return result; 70042 }; 70043 const tagName$e = "sonic-reservation-request-config-status"; 70044 let SonicReservationRequestStatus = class extends Subscriber$1(i$6) { 70045 willUpdate(changedProperties) {
70046 const isPro = this.props?.access_restriction === "pros"; 70047 const isSpecificPro = this.props?.access_restriction === "pros_types"; 70048 const customerHasProAccess = this.userProAccess === "yes"; 70049 this.type = "warning"; 70050 let textToDisplay = void 0; 70051 if (!customerHasProAccess && (isPro || isSpecificPro)) { 70052 textToDisplay = t("LIB_abo_pro_warning"); 70053 } else { 70054 if (isSpecificPro) { 70055 const structureTypeId = this.userStructureTypeId ?? 0; 70056 const structureIsAllowed = this.props?.structure_types?.includes(structureTypeId); 70057 textToDisplay = !structureIsAllowed ? t("LIB_unauthorized_warning") : void 0; 70058 this.type = !structureIsAllowed ? "danger" : "warning"; 70059 } 70060 } 70061 this.text = textToDisplay; 70062 super.willUpdate(changedProperties); 70063 } 70064 render() { 70065 if (!this.text) { 70066 return A$1; 70067 } 70068 return b$1`<sonic-badge type="warning" class="inline-block"> ${this.text}</sonic-badge>`; 70069 } 70070 }; 70071 SonicReservationRequestStatus.styles = [tailwind]; 70072 __decorateClass$m([ 70073 bind$1("user.proAccess"), 70074 n$5({ type: Number }) 70075 ], SonicReservationRequestStatus.prototype, "userProAccess", 2); 70076 __decorateClass$m([ 70077 bind$1("user.structureType.id"), 70078 n$5({ type: Number }) 70079 ], SonicReservationRequestStatus.prototype, "userStructureTypeId", 2); 70080 __decorateClass$m([ 70081 r$5() 70082 ], SonicReservationRequestStatus.prototype, "text", 2); 70083 __decorateClass$m([ 70084 r$5() 70085 ], SonicReservationRequestStatus.prototype, "type", 2); 70086 SonicReservationRequestStatus = __decorateClass$m([ 70087 t$3(tagName$e) 70088 ], SonicReservationRequestStatus); 70089 var __defProp$j = Object.defineProperty; 70090 var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor; 70091 var __decorateClass$l = (decorators, target, key, kind) => { 70092 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target; 70093 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70094 if (decorator = decorators[i2]) 70095 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70096 if (kind && result) __defProp$j(target, key, result); 70097 return result; 70098 }; 70099 const tagName$d = "sonic-request-link-item"; 70100 let SonicRequestLinkItem = class extends Subscriber$1(i$6) { 70101 constructor() { 70102 super(...arguments); 70103 this.active = false; 70104 } 70105 render() { 70106 const { title, body, sub_title } = this.props?.edito || {}; 70107 return b$1` 70108 <button 70109 id=${this.id} 70110 ?disabled=${this.active} 70111 class="mb-4 w-full flex text-left gap-4 border-2 rounded-lg p-5 70112 ${this.active ? "border-neutral-900 hover:bg-transparent" : "border-neutral-100 hover:bg-neutral-50 focus:border-2 focus:border-neutral-900"}" 70113 > 70114 <div class="grow flex flex-col gap-1"> 70115 <div class="text-2xl font-bold max-w-[60rem] ">${title}</div> 70116 ${sub_title ? b$1`<div class="text-xl max-w-[60rem] prose text-neutral-800 ">${sub_title}</div>` : A$1} 70117 ${body && this.active ? b$1`<div class="text-lg max-w-[60rem] prose text-neutral-800 mt-5">${o$6(body)}</div>` : A$1} 70118 70119 <sonic-reservation-request-config-status></sonic-reservation-request-config-status> 70120 </div> 70121 70122 <slot name="actions"> 70123 <sonic-button class="shrink-0 self-center" shape="circle" size="xl"> 70124 <sonic-icon library="custom" name="arrow-right" color="currentColor"></sonic-icon> </sonic-button 70125 ></slot> 70126 </button> 70127 `; 70128 } 70129 }; 70130 SonicRequestLinkItem.styles = [ 70131 tailwind, 70132 i$9` 70133 :host { 70134 display: block; 70135 } 70136 ` 70137 ]; 70138 __decorateClass$l([ 70139 n$5({ type: Boolean }) 70140 ], SonicRequestLinkItem.prototype, "active", 2); 70141 SonicRequestLinkItem = __decorateClass$l([ 70142 t$3(tagName$d) 70143 ], SonicRequestLinkItem); 70144 var __defProp$i = Object.defineProperty; 70145 var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor; 70146 var __decorateClass$k = (decorators, target, key, kind) => { 70147 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target; 70148 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70149 if (decorator = decorators[i2]) 70150 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70151 if (kind && result) __defProp$i(target, key, result); 70152 return result; 70153 }; 70154 const tagName$c = "sonic-request-event-form"; 70155 let instanceCounter = 0; 70156 let SonicRequestEventForm = class extends i$6 { 70157 constructor() { 70158 super(...arguments); 70159 this.formKey = "formInfos/reservation-request" + instanceCounter++; 70160 this.cartProvider = ""; 70161 this.testMode = false;
70162 this._mode = RequestMode.Uninitialized; 70163 } 70164 async deleteWithConfim(api2, dataProvider) { 70165 if (!this._cartData?.id) { 70166 this.dispatchEvent(new CustomEvent("deleted")); 70167 return; 70168 } 70169 Modal.create({ 70170 title: t("LIB_confirmer_la_suppression"), 70171 subtitle: t("LIB_attention_toutes_les_donnees_seront_perdues"), 70172 actions: b$1`<sonic-button 70173 minWidth="10rem" 70174 shape="block" 70175 type="danger" 70176 @click=${(e2) => { 70177 const target = e2.currentTarget; 70178 const parentModal = HTML$1.getClosestElement(target, "sonic-modal"); 70179 Cart.delete(api2, dataProvider).then(() => { 70180 parentModal?.hide(); 70181 this.dispatchEvent(new CustomEvent("deleted")); 70182 }); 70183 }} 70184 > 70185 <sonic-icon library="custom" name="trash"></sonic-icon> 70186 ${t("supprimer")}</sonic-button 70187 ><sonic-button shape="block" minWidtremh="10" hideModal> 70188 <sonic-icon library="custom" name="arrow-rotate-left"></sonic-icon>${t("annuler")}</sonic-button 70189 >`, 70190 removeOnHide: true 70191 }); 70192 } 70193 async willUpdate(changedProperties) { 70194 if (changedProperties.has("userId") || changedProperties.has("testMode")) { 70195 if (this.userId) { 70196 this.initFromUserId(this.userId); 70197 } else if (this.testMode) { 70198 this._mode = RequestMode.Create; 70199 } else { 70200 this._mode = RequestMode.Login; 70201 } 70202 } 70203 const previousStatus = changedProperties.get("_cartData")?.status; 70204 const currentStatus = this._cartData?.status; 70205 const incompleteToSubmitted = previousStatus === ReservationStatus.Incomplete && currentStatus === ReservationStatus.Submitted; 70206 if (incompleteToSubmitted) { 70207 this._mode = RequestMode.Ending; 70208 } 70209 super.willUpdate(changedProperties); 70210 } 70211 async initFromUserId(userId) { 70212 const userRequests = await getUserCarts(this, { 70213 cartType: CartType.ReservationRequest, 70214 userId, 70215 statuses: [ReservationStatus.Incomplete] 70216 }); 70217 const userRequestsForConfig = userRequests.filter( 70218 (reservation) => reservation.reservationRequestConfigId === Number(this.config?.id) 70219 ); 70220 if (userRequestsForConfig.length > 0) { 70221 const urlParams = new URLSearchParams(window.location.search); 70222 const requestId = urlParams.get("sonic_request_id"); 70223 const configId = urlParams.get("sonic_reservation_request_config_id"); 70224 if (requestId && configId) { 70225 this._cartData = userRequestsForConfig.find( 70226 (reservation) => reservation.id === Number(requestId) && reservation.reservationRequestConfigId === Number(configId) 70227 ) ?? void 0; 70228 } else { 70229 this._cartData = userRequestsForConfig[0]; 70230 } 70231 this.cartProvider = this.getCartProviderKey(); 70232 await this.initFormData(this.cartProvider); 70233 this._mode = RequestMode.Selection; 70234 } else if (this.config?.has_password_restriction) { 70235 const hasAccess = await this.hasAccess(); 70236 this._mode = hasAccess ? RequestMode.Create : RequestMode.Password; 70237 } else if (this.config?.access_restriction === "pros" || this.config?.access_restriction === "pros_types") { 70238 const hasAccess = await this.hasAccess(); 70239 this._mode = hasAccess ? RequestMode.Create : RequestMode.NotAuthorized; 70240 } else { 70241 this._mode = RequestMode.Create; 70242 } 70243 } 70244 async hasAccess() { 70245 const api2 = new API(HTML$1.getApiConfiguration(this)); 70246 const result = await api2.get(`reservation-request-config/${this.config?.id}/has-access`); 70247 return result?.data?.has_access || false; 70248 } 70249 getCartProviderKey(id) { 70250 const _id = id || this._cartData?.id; 70251 if (!_id) return ""; 70252 return `reservation-request/${_id}`; 70253 } 70254 async initFormData(cartProvider) { 70255 const api2 = new API(HTML$1.getApiConfiguration(this)); 70256 const result = await api2.get(cartProvider); 70257 const cartData = result?.data; 70258 if (cartData && result.success) { 70259 dp(cartProvider).set(structuredClone(result)); 70260 dp(this.formKey).set(structuredClone(cartData)); 70261 } 70262 } 70263 render() { 70264 if (!this._mode) return b$1`<sonic-loader mode="inline"></sonic-loader>`; 70265 return b$1`${r(this._mode, [
70266 [RequestMode.Login, () => b$1`${this.renderLogin()}`], 70267 [RequestMode.Uninitialized, () => b$1`<sonic-loader mode="inline"></sonic-loader>`], 70268 [RequestMode.Create, () => b$1`${this.renderIntro()} ${this.renderForm()}`], 70269 [RequestMode.UpdateData, () => b$1`${this.renderIntro()} ${this.renderForm()}`], 70270 [RequestMode.Ending, () => b$1`${this.renderEndingMessage()}`], 70271 [RequestMode.Password, () => b$1`${this.renderPassword()}`], 70272 [RequestMode.Selection, () => b$1`${this.renderIntro()} ${this.renderSelection()}`], 70273 [RequestMode.NotAuthorized, () => b$1`${this.renderNotAuthorized()}`] 70274 ])} `; 70275 } 70276 updated(changedProperties) { 70277 if (changedProperties.has("_mode")) { 70278 const previousMode = changedProperties.get("_mode"); 70279 const hasPreviousMode = previousMode !== void 0 && previousMode !== RequestMode.Uninitialized; 70280 if (hasPreviousMode && previousMode !== this._mode && this._mode === RequestMode.Selection) { 70281 this.storeSelectionElement?.scrollIntoView({ behavior: "smooth" }); 70282 } 70283 } 70284 super.updated(changedProperties); 70285 } 70286 async updateOrCreateReservationRequest(mode2 = "update") { 70287 const api2 = new API(HTML$1.getApiConfiguration(this)); 70288 const formPublisher = dp(this.formKey); 70289 formPublisher.isFormValid.set(true); 70290 formPublisher.invalidateForm(); 70291 if (!formPublisher.isFormValid.get()) return; 70292 const formData = formPublisher.get(); 70293 const { title, publicNotes, passCulture } = formData || {}; 70294 const formDataToUpdate = { 70295 title, 70296 publicNotes, 70297 passCulture 70298 }; 70299 const customFormsData = formPublisher?.[CUSTOM_FORMS_KEY]?.get(); 70300 if (!formDataToUpdate && !customFormsData) return; 70301 if (mode2 === "create") { 70302 const result = await api2.post("reservation-request", { 70303 buyer: { 70304 uid: this.userId 70305 }, 70306 reservationRequestConfigId: Number(this.config?.id), 70307 ...formDataToUpdate, 70308 ...customFormsData ? { [CUSTOM_FORMS_KEY]: customFormsData } : {} 70309 }); 70310 if (result?.data && result.success) { 70311 const cartId = result.data.id; 70312 if (cartId) { 70313 this.cartProvider = this.getCartProviderKey(cartId); 70314 dp(this.cartProvider).set(structuredClone(result)); 70315 dp(this.formKey).set(structuredClone(result.data)); 70316 } 70317 this._mode = RequestMode.Selection; 70318 } 70319 } else { 70320 const result = await api2.patch(this.cartProvider, { 70321 ...formDataToUpdate, 70322 ...customFormsData ? { [CUSTOM_FORMS_KEY]: customFormsData } : {} 70323 }); 70324 if (result?.data && result.success) { 70325 Cart.updateCart(api2, this.cartProvider); 70326 this._mode = RequestMode.Selection; 70327 } 70328 } 70329 } 70330 renderNotAuthorized() { 70331 return b$1` <sonic-alert status="warning" label=${t("LIB_access_denied")} size="lg" background> 70332 <div>${t("LIB_access_denied_description_request")}</div> 70333 <sonic-button 70334 class="mt-1" 70335 size="sm" 70336 type="warning" 70337 variant="outline" 70338 @click=${() => this.deleteWithConfim(new API(HTML$1.getApiConfiguration(this)), this.cartProvider)} 70339 > 70340 <sonic-icon name="arrow-left" library="custom"></sonic-icon> 70341 ${t("back")}</sonic-button 70342 > 70343 </sonic-alert>`; 70344 } 70345 renderEndingMessage() { 70346 return b$1` <sonic-alert 70347 status="success" 70348 label=${t("LIB_reservation_request_created_message")} 70349 size="lg" 70350 background 70351 > 70352 <sonic-app-link to="home" type="success" variant="default" autoActive="disabled" class="mt-2"> 70353 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 70354 ${t("LIB_retour_accueil")} 70355 </sonic-app-link> 70356 <sonic-app-link 70357 to="account.reservationRequests" 70358 variant="outline" 70359 type="success" 70360 autoActive="disabled" 70361 class="mt-2" 70362 > 70363 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 70364 ${t("LIB_mes_demandes")} 70365 </sonic-app-link> 70366 </sonic-alert>`; 70367 } 70368 renderPassword() { 70369 const endpoint = `reservation-request-config/${this.config?.id}/login`; 70370 const formDataProvider = `reservationRequestLogin/${this.config?.id}`; 70371 return b$1` <form formDataProvider=${formDataProvider} dataProvider=${formDataProvider}> 70372 <sonic-fieldset class="max-w-[25rem]"> 70373 <sonic-legend iconLibrary="custom" iconName="lock" label=${t("password")}></sonic-legend> 70374 <sonic-form-layout> 70375 <sonic-submit onEnterKey @submit=${this.handleSubmitPassWord} endpoint=${endpoint} method="post"> 70376 <sonic-form-layout> 70377 <sonic-input type="password" data-aria-label=${t("password")} name="password"></sonic-input> 70378 </sonic-form-layout> 70379 </sonic-submit> 70380 <sonic-form-actions> 70381 <sonic-submit onClick @submit=${this.handleSubmitPassWord} endpoint=${endpoint} method="post"> 70382 <sonic-button radio noAutoFill type="success"> 70383 <sonic-icon slot="prefix" name="check"></sonic-icon> 70384 ${t("confirm")} 70385 </sonic-button> 70386 </sonic-submit> 70387 </sonic-form-actions> 70388 </sonic-form-layout> 70389 </sonic-fieldset> 70390 </form>`; 70391 } 70392 handleSubmitPassWord(e2) { 70393 if (e2.detail.success) { 70394 if (this.userId) { 70395 this.initFromUserId(this.userId); 70396 } else { 70397 this._mode = RequestMode.Login; 70398 } 70399 } 70400 } 70401 renderIntro() { 70402 return b$1`<sonic-request-link-item 70403 class="mb-8" 70404 dataProvider="reservationRequestConfigs/${this.config?.id}" 70405 noAutoFill 70406 .props=${this.config} 70407 ?active=${true} 70408 > 70409 <sonic-button 70410 slot="actions" 70411 class="shrink-0 self-start" 70412 shape="circle" 70413 size="xl" 70414 type="danger" 70415 @click=${() => this.deleteWithConfim(new API(HTML$1.getApiConfiguration(this)), this.cartProvider)} 70416 > 70417 <sonic-icon library="custom" name="trash" color="currentColor"></sonic-icon> 70418 </sonic-button> 70419 </sonic-request-link-item>`; 70420 } 70421 renderLogin() { 70422 const isForPros = this.config?.access_restriction === "pros" || this.config?.access_restriction === "pros_types"; 70423 return b$1`<sonic-user-form-login 70424 class="mt-8 w-full" 70425 createSubTitle="${t("LIB_reservation_request_pas_de_compte_2")}" 70426 createAccount 70427 customerType=${isForPros ? "pros" : "all"} 70428 ></sonic-user-form-login>`; 70429 } 70430 renderCustomForms() { 70431 const customForms = this.config?.customForms; 70432 if (!customForms) return A$1; 70433 return b$1` 70434 ${c$1( 70435 customForms || [], 70436 (customForm) => customForm.id, 70437 (customForm) => b$1`<sonic-custom-form 70438 class="-mx-5" 70439 variant="ghost" 70440 .namePrefix=${CUSTOM_FORMS_KEY} 70441 .customForm=${customForm} 70442 ></sonic-custom-form> ` 70443 )} 70444 `; 70445 } 70446 renderForm() { 70447 const hasFileInCustomForms = this.config?.customForms?.some( 70448 (customForm) => customForm.inputs?.some((input) => input.type === InputType.File) 70449 ); 70450 return b$1` 70451 <sonic-fieldset class="shadow-lg" formDataProvider=${this.formKey} dataProvider=${this.formKey}> 70452 <div class="flex flex-col gap-6 mb-6"> 70453 ${this.config?.force_request_title ? b$1` 70454 <sonic-input type="hidden" name="title" value=${this.config?.default_request_title}> </sonic-input> 70455 ` : b$1` 70456 <sonic-input label="${this.config?.request_title_label}" type="text" name="title" required> 70457 ${requiredMark(true)} 70458 </sonic-input> 70459 `} 70460 ${this.config?.display_public_notes ? b$1` 70461 <sonic-textarea 70462 label="${t("LIB_precisions")}" 70463 rows="4" 70464 name="publicNotes" 70465 description="${t("LIB_indications_pmr_publiques_specifiques_financements")}" 70466 ></sonic-textarea> 70467 ` : A$1} 70468 ${this.config?.display_pass_culture ? b$1` 70469 <div class="flex items-center gap-x-3"> 70470 ${svgPassCulture({ color: "currentColor", width: 53, height: 53 })} 70471 <div class="border-l border-neutral-200 pl-3"> 70472 <div class="flex items-center gap-x-5 py-3 font-bold"> 70473 <sonic-checkbox unique value="true" name="passCulture.enabled" 70474 >${t("LIB_prise_en_charge_pass_culture")} 70475 </sonic-checkbox> 70476 </div> 70477 </div> 70478 </div> 70479 ` : A$1} 70480 ${this.renderCustomForms()} 70481 </div> 70482 ${hasFileInCustomForms ? b$1`<sonic-alert status="info" size="sm" class="mb-6 ">${t("LIB_rgpd_file_upload_warning")}</sonic-alert>` : A$1} 70483 <div class="flex gap-2 flex-col md:flex-row items-center"> 70484 ${this._mode === RequestMode.Create ? b$1`<sonic-button 70485 type="success" 70486 @click=${() => this.updateOrCreateReservationRequest("create")} 70487 minWidth="13rem" 70488 class="w-full md:w-auto" 70489 > 70490 <sonic-icon name="check" library="custom"></sonic-icon> ${t("LIB_commencer")} 70491 </sonic-button>` : b$1`<sonic-button 70492 type="success" 70493 @click=${() => this.updateOrCreateReservationRequest("update")} 70494 minWidth="13rem" 70495 class="w-full md:w-auto" 70496 > 70497 <sonic-icon name="check" library="custom"></sonic-icon> ${t("LIB_mettre_a_jour")} 70498 </sonic-button> 70499 <sonic-button variant="ghost" size="sm" @click=${() => this._mode = RequestMode.Selection}> 70500 ${t("cancel")} 70501 </sonic-button>`} 70502 </div> 70503 </sonic-fieldset> 70504 `; 70505 } 70506 renderSelection() { 70507 return b$1`<div class="relative"> 70508 ${renderFormData({ 70509 reservationRequest: this._cartData, 70510 reservationRequestConfig: this.config, 70511 displayLegends: true, 70512 displayTitle: true 70513 })} 70514 <sonic-button 70515 icon 70516 shape="circle" 70517 @click=${() => this._mode = RequestMode.UpdateData} 70518 class="absolute top-4 right-4" 70519 > 70520 <sonic-icon name="pencil" library="custom"></sonic-icon 70521 ></sonic-button> 70522 </div> 70523 <sonic-event-store-content 70524 id="storeSelection" 70525 displayCart 70526 formType="select" 70527 cartProvider=${this.cartProvider} 70528 class="mt-8 block" 70529 > 70530 </sonic-event-store-content>`; 70531 } 70532 }; 70533 SonicRequestEventForm.styles = [ 70534 tailwind, 70535 i$9` 70536 :host { 70537 display: block; 70538 } 70539 ` 70540 ]; 70541 __decorateClass$k([ 70542 bind$1("user.id"), 70543 n$5({ type: Number }) 70544 ], SonicRequestEventForm.prototype, "userId", 2); 70545 __decorateClass$k([ 70546 n$5({ type: Object }) 70547 ], SonicRequestEventForm.prototype, "config", 2); 70548 __decorateClass$k([ 70549 n$5({ type: String }) 70550 ], SonicRequestEventForm.prototype, "cartProvider", 2); 70551 __decorateClass$k([ 70552 bind$1("${cartProvider}.data"), 70553 r$5()
70554 ], SonicRequestEventForm.prototype, "_cartData", 2); 70555 __decorateClass$k([ 70556 n$5({ attribute: false }) 70557 ], SonicRequestEventForm.prototype, "testMode", 2); 70558 __decorateClass$k([ 70559 r$5() 70560 ], SonicRequestEventForm.prototype, "_mode", 2); 70561 __decorateClass$k([ 70562 e$7("#storeSelection") 70563 ], SonicRequestEventForm.prototype, "storeSelectionElement", 2); 70564 SonicRequestEventForm = __decorateClass$k([ 70565 t$3(tagName$c) 70566 ], SonicRequestEventForm); 70567 var __defProp$h = Object.defineProperty; 70568 var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor; 70569 var __decorateClass$j = (decorators, target, key, kind) => { 70570 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target; 70571 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70572 if (decorator = decorators[i2]) 70573 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70574 if (kind && result) __defProp$h(target, key, result); 70575 return result; 70576 }; 70577 const tagName$b = "sonic-reservation-request"; 70578 const RESERVATION_REQUEST_CONFIGS_DP_KEY = "reservationRequestConfigs"; 70579 let SonicReservationRequest = class extends i$6 { 70580 constructor() { 70581 super(...arguments); 70582 this.displayTitle = false; 70583 this.displayText = false; 70584 this.smallTitle = false; 70585 this._selectedConfig = null; 70586 this._testMode = false; 70587 } 70588 firstUpdated() { 70589 this.initFromUrl(); 70590 } 70591 async initFromUrl() { 70592 const accessParams = getAccessParamsFromUrl(); 70593 const configIdFromRoute = appRoute("reservationRequest").extract()?.id; 70594 const { reservationRequestConfigId, reservationRequestConfigHash } = accessParams; 70595 const hasHash = !!reservationRequestConfigHash; 70596 let hashOrParam = reservationRequestConfigHash || configIdFromRoute || reservationRequestConfigId; 70597 this._testMode = !!reservationRequestConfigHash?.startsWith("test_"); 70598 if (hashOrParam) { 70599 const api2 = new API(HTML.getApiConfiguration(this)); 70600 const config = await api2.get(`reservation-request-config/${hashOrParam}`); 70601 if (config?.data && config.success) { 70602 dp("user").invalidate(); 70603 this._selectedConfig = config.data; 70604 this.accessParams = { 70605 ...this.accessParams, 70606 reservationRequestConfigHash: reservationRequestConfigHash || void 0, 70607 reservationRequestConfigId: Number(configIdFromRoute || reservationRequestConfigId) || void 0 70608 }; 70609 if (hasHash) { 70610 this._selectedConfig = config.data; 70611 } 70612 } 70613 } 70614 } 70615 async willUpdate(changedProperties) { 70616 if (changedProperties.has("userId")) { 70617 dp(RESERVATION_REQUEST_CONFIGS_DP_KEY).invalidate(); 70618 } 70619 super.willUpdate(changedProperties); 70620 } 70621 selectReservationRequestConfig(requestConfig) { 70622 this._selectedConfig = requestConfig; 70623 this.accessParams = { 70624 ...this.accessParams, 70625 reservationRequestConfigId: Number(requestConfig.id) 70626 }; 70627 } 70628 resetSelectedConfig() { 70629 this._selectedConfig = null; 70630 this.accessParams = void 0; 70631 } 70632 render() { 70633 return b$1`<sonic-page-layout 70634 pageTitle="${t("LIB_reservation_request_title")}" 70635 pageText="${t("LIB_reservation_request_text")}" 70636 ?smallTitle=${this.smallTitle} 70637 ?displayTitle=${this.displayTitle} 70638 ?displayText=${this.displayText} 70639 > 70640 ${this.renderPageContent()} 70641 </sonic-page-layout>`; 70642 } 70643 renderPageContent() { 70644 if (this._selectedConfig) { 70645 return this.renderForm(); 70646 } else { 70647 return this.renderMenu(); 70648 } 70649 } 70650 renderForm() { 70651 return b$1`<sonic-request-event-form 70652 @deleted=${() => this.resetSelectedConfig()} 70653 .config=${this._selectedConfig} 70654 .testMode=${this._testMode} 70655 ></sonic-request-event-form>`; 70656 } 70657 renderMenu() { 70658 return b$1` 70659 <sonic-list 70660 class=" block" 70661 fetch 70662 dataProvider=${RESERVATION_REQUEST_CONFIGS_DP_KEY} 70663 endPoint="reservation-request-config" 70664 key="data" 70665 .items=${(item) => b$1`<sonic-request-link-item 70666 @click=${() => this.selectReservationRequestConfig(item)} 70667 ></sonic-request-link-item>`} 70668 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 70669 > 70670 </sonic-list> 70671 `; 70672 } 70673 }; 70674 SonicReservationRequest.styles = [ 70675 tailwind, 70676 i$9` 70677 :host { 70678 display: block; 70679 --page-max-width: 65rem; 70680 } 70681 ` 70682 ]; 70683 __decorateClass$j([ 70684 n$5({ type: Boolean }) 70685 ], SonicReservationRequest.prototype, "displayTitle", 2); 70686 __decorateClass$j([ 70687 n$5({ type: Boolean }) 70688 ], SonicReservationRequest.prototype, "displayText", 2); 70689 __decorateClass$j([ 70690 n$5({ type: Boolean }) 70691 ], SonicReservationRequest.prototype, "smallTitle", 2); 70692 __decorateClass$j([ 70693 r$5() 70694 ], SonicReservationRequest.prototype, "_selectedConfig", 2); 70695 __decorateClass$j([ 70696 r$5() 70697 ], SonicReservationRequest.prototype, "_testMode", 2); 70698 __decorateClass$j([ 70699 e$2({ context: accessParamsContext }), 70700 n$5({ type: Object }) 70701 ], SonicReservationRequest.prototype, "accessParams", 2); 70702 SonicReservationRequest = __decorateClass$j([ 70703 t$3(tagName$b) 70704 ], SonicReservationRequest); 70705 var __defProp$g = Object.defineProperty; 70706 var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor; 70707 var __decorateClass$i = (decorators, target, key, kind) => { 70708 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target; 70709 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70710 if (decorator = decorators[i2]) 70711 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70712 if (kind && result) __defProp$g(target, key, result); 70713 return result; 70714 }; 70715 let UserAccount$2 = class UserAccount extends i$6 { 70716 constructor() { 70717 super(...arguments); 70718 this.modules = {}; 70719 this._hasAccountRequest = false;
70720 this._hasReservation = false; 70721 this._hasWaitingList = false; 70722 } 70723 async willUpdate(_changedProperties) { 70724 if (_changedProperties.has("userId")) { 70725 const userRequests = await getUserCarts(this, { 70726 cartType: CartType.ReservationRequest, 70727 userId: Number(this.userId), 70728 limit: 1 70729 }); 70730 this._hasAccountRequest = userRequests.length > 0; 70731 const userWaitingLists = await getUserCarts(this, { 70732 cartType: CartType.WaitingLists, 70733 userId: Number(this.userId), 70734 limit: 1 70735 }); 70736 this._hasWaitingList = userWaitingLists.length > 0; 70737 const reservations = await getUserCarts(this, { 70738 cartType: CartType.Reservation, 70739 userId: Number(this.userId), 70740 limit: 1, 70741 statuses: [ 70742 ReservationStatus.Pending, 70743 ReservationStatus.Confirmed, 70744 ReservationStatus.Processing, 70745 ReservationStatus.PartiallyProcessed 70746 ] 70747 }); 70748 this._hasReservation = reservations.length > 0; 70749 } 70750 super.willUpdate(_changedProperties); 70751 } 70752 render() { 70753 const currentHash = window.location.hash; 70754 if (currentHash === "") { 70755 window.location.hash = appRoute("account.home").toString(); 70756 } 70757 return b$1` 70758 <sonic-menu scrollable direction="row" gap=".5rem"> 70759 <sonic-menu-item size="xl" variant="default" type="default" shape="circle" href=${appRoute("account.home")}> 70760 <sonic-icon library="custom" name="house"> </sonic-icon> 70761 </sonic-menu-item> 70762 <sonic-menu-item 70763 icon 70764 autoActive="strict" 70765 size="xl" 70766 variant="default" 70767 type="default" 70768 shape="circle" 70769 href=${appRoute("account.tickets")} 70770 > 70771 <sonic-icon library="custom" name="ticket"> </sonic-icon> 70772 </sonic-menu-item> 70773 <sonic-menu-item 70774 icon 70775 autoActive="strict" 70776 size="xl" 70777 variant="default" 70778 type="default" 70779 shape="circle" 70780 href=${appRoute("account.purchases")} 70781 > 70782 <sonic-icon library="custom" name="clock-rotate-left"> </sonic-icon> 70783 </sonic-menu-item> 70784 70785 ${this._hasWaitingList ? b$1` 70786 <sonic-menu-item 70787 icon 70788 autoActive="strict" 70789 size="xl" 70790 variant="default" 70791 type="default" 70792 shape="circle" 70793 href=${appRoute("account.waitingLists")} 70794 > 70795 <sonic-icon library="custom" name="list-ol"> </sonic-icon> 70796 </sonic-menu-item> 70797 ` : A$1} 70798 ${this._hasReservation ? b$1` 70799 <sonic-menu-item 70800 icon 70801 class="relative" 70802 autoActive="strict" 70803 size="xl" 70804 variant="default" 70805 type="default" 70806 shape="circle" 70807 href=${appRoute("account.reservations")} 70808 > 70809 <sonic-badge 70810 class="absolute -top-[3px] -left-[3px] animate-heartbeat" 70811 type="danger" 70812 size="2xs" 70813 ></sonic-badge> 70814 <sonic-icon library="custom" name="badge-check"> </sonic-icon> 70815 </sonic-menu-item> 70816 ` : A$1} 70817 ${this.modules?.reservationRequest?.access && this._hasAccountRequest ? b$1` 70818 <sonic-menu-item 70819 icon 70820 autoActive="strict" 70821 size="xl" 70822 variant="default" 70823 type="default" 70824 shape="circle" 70825 href=${appRoute("account.reservationRequests")} 70826 > 70827 <sonic-icon library="custom" name="file-heart"> </sonic-icon> 70828 </sonic-menu-item> 70829 ` : A$1} 70830 ${this.modules?.carpooling?.access ? b$1` 70831 <sonic-menu-item 70832 icon 70833 autoActive="strict" 70834 size="xl" 70835 variant="default" 70836 type="default" 70837 shape="circle" 70838 href=${appRoute("account.trips")} 70839 > 70840 <sonic-icon library="custom" name="car-side"> </sonic-icon> 70841 </sonic-menu-item> 70842 ` : A$1} 70843 <sonic-menu-item 70844 icon 70845 autoActive="strict" 70846 size="xl" 70847 variant="default" 70848 type="default" 70849 shape="circle" 70850 href=${appRoute("account.edit")} 70851 > 70852 <sonic-icon library="custom" name="pen"> </sonic-icon> 70853 </sonic-menu-item> 70854 <sonic-menu-item 70855 icon 70856 autoActive="strict" 70857 size="xl" 70858 variant="default" 70859 type="default" 70860 shape="circle" 70861 href=${appRoute("account.editPassword")} 70862 > 70863 <sonic-icon library="custom" name="lock"> </sonic-icon> 70864 </sonic-menu-item>
70865 <sonic-divider vertical class="hidden md:block"></sonic-divider> 70866 <sonic-menu-item 70867 icon 70868 autoActive="strict" 70869 size="xl" 70870 variant="default" 70871 type="default" 70872 @click=${() => logout(this)} 70873 shape="circle" 70874 > 70875 <sonic-icon library="custom" name="power-off"> </sonic-icon> 70876 </sonic-menu-item> 70877 </sonic-menu> 70878 `; 70879 } 70880 }; 70881 UserAccount$2.styles = [tailwind]; 70882 __decorateClass$i([ 70883 bind$1("settings.modules"), 70884 n$5({ type: Object }) 70885 ], UserAccount$2.prototype, "modules", 2); 70886 __decorateClass$i([ 70887 bind$1("user.id"), 70888 n$5({ type: String }) 70889 ], UserAccount$2.prototype, "userId", 2); 70890 __decorateClass$i([ 70891 r$5() 70892 ], UserAccount$2.prototype, "_hasAccountRequest", 2); 70893 __decorateClass$i([ 70894 r$5() 70895 ], UserAccount$2.prototype, "_hasReservation", 2); 70896 __decorateClass$i([ 70897 r$5() 70898 ], UserAccount$2.prototype, "_hasWaitingList", 2); 70899 UserAccount$2 = __decorateClass$i([ 70900 t$3("sonic-user-account-menu") 70901 ], UserAccount$2); 70902 var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor; 70903 var __decorateClass$h = (decorators, target, key, kind) => { 70904 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target; 70905 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70906 if (decorator = decorators[i2]) 70907 result = decorator(result) || result; 70908 return result; 70909 }; 70910 let GiftcardAd = class extends i$6 { 70911 render() { 70912 return b$1` 70913 <sonic-alert 70914 noIcon 70915 status="success" 70916 class="mb-3 relative overflow-hidden min-h-[5rem]" 70917 dismissible 70918 dismissForever 70919 id="ad-alert" 70920 > 70921 <div class="grid grid-cols-1 gap-1 mb-3 max-w-[50ch] "> 70922 <div class="text-xl font-bold leading-tight">${t("LIB_cartes_cadeaux")}</div> 70923 <div>${o$4(t("module_giftcards_summary"))}</div> 70924 </div> 70925 <sonic-app-link to="giftcards" variant="outline" type="success" size="sm"> 70926 <sonic-icon library="custom" name="arrow-right" slot="prefix"></sonic-icon> 70927 ${t("link_title_more_about")} 70928 </sonic-app-link> 70929 <div class="absolute -bottom-2 -right-2 opacity-30 "> 70930 <svg xmlns="http://www.w3.org/2000/svg" class="h-20 w-auto" viewB
70930ox="0 0 640 512"> 70931 <!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --> 70932 <path 70933 d="M200.6 32C205 19.5 198.5 5.8 186 1.4S159.8 3.5 155.4 16L144.7 46.2l-9.9-29.8C130.6 3.8 117-3 104.4 1.2S85 19 89.2 31.6l8.3 25-27.4-20c-10.7-7.8-25.7-5.4-33.5 5.3s-5.4 25.7 5.3 33.5L70.2 96H48C21.5 96 0 117.5 0 144V464c0 26.5 21.5 48 48 48H200.6c-5.4-9.4-8.6-20.3-8.6-32V256c0-29.9 20.5-55 48.2-62c1.8-31 17.1-58.2 40.1-76.1C271.7 104.7 256.9 96 240 96H217.8l28.3-20.6c10.7-7.8 13.1-22.8 5.3-33.5s-22.8-13.1-33.5-5.3L192.5 55.1 200.6 32zM363.5 185.5L393.1 224H344c-13.3 0-24-10.7-24-24c0-13.1 10.8-24 24.2-24c7.6 0 14.7 3.5 19.3 9.5zM272 200c0 8.4 1.4 16.5 4.1 24H272c-26.5 0-48 21.5-48 48v80H416V256h32v96H640V272c0-26.5-21.5-48-48-48h-4.1c2.7-7.5 4.1-15.6 4.1-24c0-39.9-32.5-72-72.2-72c-22.4 0-43.6 10.4-57.3 28.2L432 195.8l-30.5-39.6c-13.7-17.8-35-28.2-57.3-28.2c-39.7 0-72.2 32.1-72.2 72zM224 464c0 26.5 21.5 48 48 48H416V384H224v80zm224 48H592c26.5 0 48-21.5 48-48V384H448V512zm96-312c0 13.3-10.7 24-24 24H470.9l29.6-38.5c4.6-5.9 11.7-9.5 19.3-9.5c13.4 0 24.2 10.9 24.2 24z" 70934 fill="currentColor" 70935 /> 70936 </svg> 70937 </div> 70938 </sonic-alert> 70939 `; 70940 } 70941 }; 70942 GiftcardAd.styles = [tailwind]; 70943 GiftcardAd = __decorateClass$h([ 70944 t$3("sonic-giftcard-ad") 70945 ], GiftcardAd); 70946 var __defProp$f = Object.defineProperty; 70947 var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor; 70948 var __decorateClass$g = (decorators, target, key, kind) => { 70949 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target; 70950 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70951 if (decorator = decorators[i2]) 70952 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70953 if (kind && result) __defProp$f(target, key, result); 70954 return result; 70955 }; 70956 const tagName$a = "sonic-giftcard-link"; 70957 let SonicComponent = class extends Subscriber$1(i$6) { 70958 constructor() { 70959 super(...arguments); 70960 this.tight = false; 70961 } 70962 handleSubmit(e2) { 70963 if (e2.detail.success) { 70964 this.dispatchEvent(new CustomEvent("linked")); 70965 } 70966 } 70967 render() { 70968 if (!this.hasGiftcards) return A$1; 70969 return b$1` <sonic-fieldset 70970 formDataProvider="giftcard" 70971 submitResultDataProvider="defaultMessages" 70972 endPoint="/giftcards/link" 70973 dataProvider="giftcards/link" 70974 formDataProvider="giftcardsLink" 70975 ?tight=${this.tight} 70976 > 70977 <sonic-legend iconlibrary="custom" iconname="gift-card" label="${t("I_have_a_gift_card")}"></sonic-legend> 70978 <div class="mb-3 flex items-end gap-3"> 70979 <sonic-submit @submit=${this.handleSubmit} method="POST" onEnterkey> 70980 <sonic-input name="code" label="${t("Enter_your_gift_card_code")}" placeholder="- - - - - -"></sonic-input> 70981 </sonic-submit> 70982 <sonic-submit @submit=${this.handleSubmit} method="POST" onClick> 70983 <sonic-button type="primary" class="whitespace-nowrap"> 70984 <sonic-icon library="custom" name="link" slot="prefix"></sonic-icon> 70985 <span class="hidden lg:block"> ${t("LIB_giftcard_relier")} </span> 70986 <span class="block lg:hidden"> ${t("LIB_giftcard_relier_mobile")} </span> 70987 </sonic-button> 70988 </sonic-submit> 70989 </div> 70990 </sonic-fieldset>`; 70991 } 70992 }; 70993 SonicComponent.styles = [tailwind]; 70994 __decorateClass$g([ 70995 n$5({ type: Boolean }) 70996 ], SonicComponent.prototype, "tight", 2); 70997 __decorateClass$g([ 70998 bind$1("settings.modules.giftcards.enabled"), 70999 n$5({ type: Boolean }) 71000 ], SonicComponent.prototype, "hasGiftcards", 2); 71001 SonicComponent = __decorateClass$g([ 71002 t$3(tagName$a) 71003 ], SonicComponent); 71004 var __decorate = function(decorators, target, key, desc) { 71005 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 71006 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 71007 else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; 71008 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 71009 }; 71010 const tagName$9 = "sonic-t"; 71011 let SonicT = class SonicT extends i$6 { 71012 render() { 71013 if (!this.key) 71014 return A$1; 71015 return b$1`${t(this.key, this.unsafeHTML)}`; 71016 } 71017 }; 71018 __decorate([ 71019 n$5({ type: String }) 71020 ], SonicT.prototype, "key", void 0); 71021 __decorate([ 71022 n$5({ type: Boolean }) 71023 ], SonicT.prototype, "unsafeHTML", void 0); 71024 SonicT = __decorate([ 71025 t$3(tagName$9) 71026 ], SonicT); 71027 var __defProp$e = Object.defineProperty; 71028 var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor; 71029 var __decorateClass$f = (decorators, target, key, kind) => { 71030 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target; 71031 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71032 if (decorator = decorators[i2]) 71033 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71034 if (kind && result) __defProp$e(target, key, result); 71035 return result; 71036 }; 71037 const tagName$8 = "sonic-account-my-giftcards"; 71038 let SonicAccountMyGiftcards = class extends Fetcher$1(Subscriber$1(i$6)) { 71039 constructor() { 71040 super(...arguments); 71041 this.tight = false;
71042 this.data = null; 71043 this.dataProvider = "my-giftcards"; 71044 } 71045 connectedCallback() { 71046 this.isFetchEnabled = false; 71047 super.connectedCallback(); 71048 } 71049 getEndPoint() { 71050 if (!this.userId) return ""; 71051 return `/user/${this.userId}/purchases/giftcard?owner=${this.userId}&available=true`; 71052 } 71053 willUpdate(changedProperties) { 71054 if (changedProperties.has("userId") && this.userId) { 71055 this.endPoint = this.getEndPoint(); 71056 this.isFetchEnabled = true; 71057 this._fetchData(); 71058 } 71059 super.willUpdate(changedProperties); 71060 } 71061 render() { 71062 if (!this.data || this.data.length == 0) return A$1; 71063 return b$1`<sonic-fieldset ?tight=${this.tight}> 71064 <sonic-legend iconlibrary="custom" iconName="gift-card" label="${t("LIB_cartes_cadeaux")}"></sonic-legend> 71065 <sonic-list subDataProvider="data" class="grid grid-cols-1 gap-y-3"> 71066 <template> 71067 <sonic-purchase-summary></sonic-purchase-summary> 71068 </template> 71069 </sonic-list> 71070 </sonic-fieldset>`; 71071 } 71072 }; 71073 SonicAccountMyGiftcards.styles = [tailwind]; 71074 __decorateClass$f([ 71075 n$5({ type: Boolean }) 71076 ], SonicAccountMyGiftcards.prototype, "tight", 2); 71077 __decorateClass$f([ 71078 bind$1("user.id"), 71079 n$5({ type: Number }) 71080 ], SonicAccountMyGiftcards.prototype, "userId", 2); 71081 __decorateClass$f([ 71082 n$5({ type: Array }) 71083 ], SonicAccountMyGiftcards.prototype, "data", 2); 71084 SonicAccountMyGiftcards = __decorateClass$f([ 71085 t$3(tagName$8) 71086 ], SonicAccountMyGiftcards); 71087 var __defProp$d = Object.defineProperty; 71088 var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor; 71089 var __decorateClass$e = (decorators, target, key, kind) => { 71090 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target; 71091 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71092 if (decorator = decorators[i2]) 71093 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71094 if (kind && result) __defProp$d(target, key, result); 71095 return result; 71096 }; 71097 let UserFormEdit = class extends Subscriber$1(i$6) { 71098 constructor() { 71099 super(...arguments); 71100 this.accessAskProAccount = false; 71101 } 71102 render() { 71103 return b$1` 71104 <sonic-page-header label="${t("mes_informations")}"> 71105 ${this.isPro === true && this.accessAskProAccount ? b$1` <sonic-menu-item @click=${updateProAccountModal} slot="more"> 71106 <sonic-icon slot="prefix" library="custom" name="link"></sonic-icon> 71107 ${t("LIB_formulaire_pro_actualiser")}</sonic-menu-item 71108 >` : A$1} 71109 </sonic-page-header> 71110 <sonic-iframe src="/mon-compte/mes-informations?no_title=true&no_navigation=true"></sonic-iframe> 71111 `; 71112 } 71113 }; 71114 __decorateClass$e([ 71115 bind$1("user.is_pro"), 71116 n$5({ type: Boolean }) 71117 ], UserFormEdit.prototype, "isPro", 2); 71118 __decorateClass$e([ 71119 bind$1("settings.modules.ask_pro_account.access"), 71120 r$5() 71121 ], UserFormEdit.prototype, "accessAskProAccount", 2); 71122 UserFormEdit = __decorateClass$e([ 71123 t$3("sonic-user-form-edit") 71124 ], UserFormEdit); 71125 const updateProAccountModal = () => { 71126 Modal.create({ 71127 content: ( 71128 /*html*/ 71129 `<sonic-ask-pro-account updateAccount smallTitle displayTitle displayText ></sonic-ask-pro-account>` 71130 ), 71131 width: "45rem", 71132 removeOnHide: true 71133 }); 71134 }; 71135 var __defProp$c = Object.defineProperty; 71136 var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor; 71137 var __decorateClass$d = (decorators, target, key, kind) => { 71138 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target; 71139 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71140 if (decorator = decorators[i2]) 71141 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71142 if (kind && result) __defProp$c(target, key, result); 71143 return result; 71144 }; 71145 const tagName$7 = "sonic-user-account-home"; 71146 let UserAccount$1 = class UserAccount extends i$6 { 71147 constructor() { 71148 super(...arguments); 71149 this.balance = 0; 71150 this._resizeController = new h$1(this, {}); 71151 this._canUseCredit = false;
71152 } 71153 willUpdate(changedProperties) { 71154 if (changedProperties.has("currentUser") || changedProperties.has("creditAccess")) { 71155 this._canUseCredit = checkCanUseCredit(this.currentUser?.proAccess, this.creditAccess); 71156 } 71157 super.willUpdate(changedProperties); 71158 } 71159 render() { 71160 const todayMinus6hours = /* @__PURE__ */ new Date(); 71161 todayMinus6hours.setHours(todayMinus6hours.getHours() - 6); 71162 const fromDate = Math.floor(todayMinus6hours.getTime() / 1e3); 71163 const isSmall = this.clientWidth < 500; 71164 const userId = this.currentUser?.id; 71165 const subscriptionIsEnabled = this.settings?.modules?.subscription?.enabled; 71166 const accessGiftcard = this.settings?.modules?.giftcards?.access; 71167 const accessAskProAccount = this.settings?.modules?.ask_pro_account?.access; 71168 const displayRenewSubscriptionMessage = accessAskProAccount && this.currentUser?.can_renew && this.currentUser?.is_pro; 71169 const oneYearAgo = /* @__PURE__ */ new Date(); 71170 oneYearAgo.setFullYear(oneYearAgo.getFullYear() - 1); 71171 const oneYearAgoTimestamp = Math.floor(oneYearAgo.getTime() / 1e3); 71172 const userBalance = this.currentUser?.balance ?? 0; 71173 let messageType; 71174 if (displayRenewSubscriptionMessage && this.currentUser?.proAccess == "disabled") { 71175 messageType = "renew"; 71176 } else if (displayRenewSubscriptionMessage && this.currentUser?.proAccess == "pending") { 71177 messageType = "pending"; 71178 } 71179 if (!userId) return A$1; 71180 return b$1` 71181 <div class="mb-6"> 71182 <div class="text-4xl font-bold">${t("bonjour")} ${this.currentUser?.firstName}</div> 71183 ${this.renderSubTitle()} 71184 </div> 71185 71186 <!--Message de renouvellement d'abonnement--> 71187 ${messageType == "renew" ? b$1` <sonic-alert background status="error" label=${t("LIB_pro_access_disabled")}> 71188 <sonic-button 71189 align="left" 71190 type="danger" 71191 @click=${updateProAccountModal} 71192 size="sm" 71193 class="mt-1" 71194 variant="outline" 71195 > 71196 <sonic-icon slot="prefix" library="custom" name="arrow-right"></sonic-icon>${t( 71197 "LIB_formulaire_pro_actualiser" 71198 )}</sonic-button 71199 ></sonic-alert 71200 >` : A$1} 71201 ${messageType == "pending" ? b$1` <sonic-alert background status="success" label=${t("LIB_pro_access_pending")}> 71202 <p>${t("LIB_pro_access_pending_text")}</p> 71203 <sonic-button 71204 align="left" 71205 type="success" 71206 @click=${updateProAccountModal} 71207 size="sm" 71208 class="mt-3" 71209 variant="outline" 71210 > 71211 <sonic-icon slot="prefix" library="custom" name="arrow-right"></sonic-icon>${t( 71212 "LIB_pro_access_new_request" 71213 )}</sonic-button 71214 ></sonic-alert 71215 >` : A$1} 71216 ${accessGiftcard ? b$1` <sonic-giftcard-ad class="block mb-3"></sonic-giftcard-ad> ` : A$1} 71217 ${userBalance > 0 ? b$1` 71218 <sonic-alert status="info" class="mb-3" background> 71219 <strong>
71219${formatAmount(this.balance)} ${t("available_as_a_credit")}</strong><br /> 71220 ${this._canUseCredit ? b$1`${t("balance_use_info_text_enabled_online")}` : b$1`${t("balance_use_info_text_new")}`} 71221 </sonic-alert> 71222 ` : A$1} 71223 71224 <sonic-fetch 71225 dataProvider="accountHomeTickets" 71226 key="data" 71227 endpoint="/user/${userId}/purchases/event?limit=4&next=1&sort=start_date:asc&event_from=${fromDate}&owner=${userId}" 71228 ></sonic-fetch> 71229 ${this.accountHomeTickets?.length ? b$1` 71230 <sonic-fieldset ?tight=${isSmall}> 71231 ${this.accountHomeTickets?.length ? b$1`<sonic-legend 71232 iconlibrary="custom" 71233 iconName="forward" 71234 label="${t("coming_soon")}" 71235 ></sonic-legend>` : A$1} 71236 <sonic-list dataProvider="accountHomeTickets" class="grid grid-cols-1 gap-3"> 71237 <template> 71238 <sonic-purchase-summary></sonic-purchase-summary> 71239 </template> 71240 <template data-value="skeleton"> 71241 <sonic-purchase-summary skeleton></sonic-purchase-summary> 71242 </template> 71243 </sonic-list> 71244 <sonic-app-link to="account.tickets" size="sm" variant="default" class="mt-3 w-full"> 71245 <sonic-icon library="custom" name="arrow-right"></sonic-icon> 71246 <sonic-t key="tous_mes_billets"></sonic-t> 71247 </sonic-app-link> 71248 </sonic-fieldset> 71249 ` : this.agendaCard()} 71250 71251 <sonic-fetch 71252 endpoint="/user/${userId}/purchases/subscribe?owner=${userId}&valid_from=${oneYearAgoTimestamp}" 71253 dataProvider="accountHomeSubscriptions" 71254 key="data" 71255 ></sonic-fetch> 71256 ${subscriptionIsEnabled && this.accountHomeSubscriptions?.length ? b$1` 71257 <sonic-fieldset ?tight=${isSmall}> 71258 <sonic-legend iconlibrary="custom" iconName="id-card" label="${t("abonnements")}"></sonic-legend> 71259 <sonic-list dataProvider="accountHomeSubscriptions" class="grid grid-cols-1 gap-3"> 71260 <template> 71261 <sonic-purchase-summary></sonic-purchase-summary> 71262 </template> 71263 <template data-value="skeleton"> 71264 <sonic-purchase-summary skeleton></sonic-purchase-summary> 71265 </template> 71266 </sonic-list> 71267 <sonic-app-link 71268 to="subscription" 71269 size="${this.accountHomeSubscriptions?.length ? "sm" : "2xl"}" 71270 variant="default" 71271 class="w-full ${this.accountHomeSubscriptions?.length ? "mt-3" : ""}" 71272 > 71273 <sonic-icon library="custom" name="arrow-right"></sonic-icon> 71274 <sonic-t key="onglet_home_abonnements"></sonic-t> 71275 </sonic-app-link> 71276 </sonic-fieldset> 71277 ` : A$1} 71278 ${!this.accountHomeSubscriptions?.length ? this.subscriptionCard() : A$1} 71279 71280 <sonic-account-my-giftcards id=${userId} ?tight=${isSmall}></sonic-account-my-giftcards> 71281 <sonic-giftcard-link ?tight=${isSmall} @linked=${() => dp("my-giftcards").invalidate()}></sonic-giftcard-link> 71282 `; 71283 } 71284 agendaCard() { 71285 const agendaAccess = this.settings?.modules?.agenda?.access; 71286 return agendaAccess ? b$1`<div class="block mb-6"> 71287 <sonic-quick-access-card 71288 type="default" 71289 href=${appRoute("agenda")} 71290 title=${t("module_agenda_title")} 71291 text=${o$4(t("module_agenda_summary"))} 71292 icon="calendar-day" 71293 ></sonic-quick-access-card> 71294 </div>` : A$1; 71295 } 71296 subscriptionCard() { 71297 const subscriptionAccess = this.settings?.modules?.subscription?.access; 71298 return subscriptionAccess ? b$1`<div class="block mb-6"> 71299 <sonic-quick-access-card 71300 type="warning" 71301 href=${appRoute("subscription")} 71302 title=${t("onglet_home_abonnements")} 71303 text=${o$4(t("module_subscription_summary"))} 71304 icon="address-card" 71305 ></sonic-quick-access-card> 71306 </div>` : A$1; 71307 } 71308 renderSubTitle() { 71309 const is_pro = this.currentUser?.is_pro; 71310 const createdAt = Number(this.currentUser?.created_at); 71311 const createdDate = new Date(createdAt * 1e3 || 0); 71312 const createdDateWasToday = createdDate.toDateString() === (/* @__PURE__ */ new Date()).toDateString(); 71313 if (is_pro) return A$1; 71314 return b$1`<div class="text-xl mt-1"> 71315 ${createdDateWasToday ? b$1`${t("LIB_account_welcome_message")} ð ` : b$1`${t("ravi_de_vous_revoir")} âï¸`} 71316 </div>`; 71317 } 71318 }; 71319 UserAccount$1.styles = [tailwind]; 71320 __decorateClass$d([ 71321 bind$1("user"), 71322 n$5({ type: Object }) 71323 ], UserAccount$1.prototype, "currentUser", 2); 71324 __decorateClass$d([ 71325 bind$1("user.balance"), 71326 n$5({ type: Number }) 71327 ], UserAccount$1.prototype, "balance", 2); 71328 __decorateClass$d([ 71329 bind$1("accountHomeTickets"), 71330 r$5() 71331 ], UserAccount$1.prototype, "accountHomeTickets", 2); 71332 __decorateClass$d([ 71333 bind$1("accountHomeSubscriptions"), 71334 r$5() 71335 ], UserAccount$1.prototype, "accountHomeSubscriptions", 2); 71336 __decorateClass$d([ 71337 bind$1("settings"), 71338 n$5({ type: Object }) 71339 ], UserAccount$1.prototype, "settings", 2); 71340 __decorateClass$d([ 71341 bind$1("settings.credit"), 71342 n$5({ type: Object }) 71343 ], UserAccount$1.prototype, "creditAccess", 2); 71344 __decorateClass$d([ 71345 r$5()
71346 ], UserAccount$1.prototype, "_canUseCredit", 2); 71347 UserAccount$1 = __decorateClass$d([ 71348 t$3(tagName$7) 71349 ], UserAccount$1); 71350 var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor; 71351 var __decorateClass$c = (decorators, target, key, kind) => { 71352 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target; 71353 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71354 if (decorator = decorators[i2]) 71355 result = decorator(result) || result; 71356 return result; 71357 }; 71358 const tagName$6 = "sonic-account-carpooling"; 71359 let SonicPagePromo = class extends CovoitLoad(i$6) { 71360 render() { 71361 const covoitURL = this.carpoolingSettings?.url; 71362 const token = this.carpoolingSettings?.token || ""; 71363 if (!covoitURL) return A$1; 71364 return b$1` 71365 <sonic-page-header label="${t("my_trips")}"></sonic-page-header> 71366 71367 <covoit-app 71368 covoitURL=${covoitURL} 71369 baseURL=${appRoute("carpooling")} 71370 token=${o$4(token)} 71371 encryptedUid=${o$4(this.encryptedUid)} 71372 customRoutes=${JSON.stringify(this.customRoutes)} 71373 view="myTrips" 71374 ></covoit-app> 71375 `; 71376 } 71377 }; 71378 SonicPagePromo.styles = [tailwind]; 71379 SonicPagePromo = __decorateClass$c([ 71380 t$3(tagName$6) 71381 ], SonicPagePromo); 71382 var __defProp$b = Object.defineProperty; 71383 var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor; 71384 var __decorateClass$b = (decorators, target, key, kind) => { 71385 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target; 71386 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71387 if (decorator = decorators[i2]) 71388 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71389 if (kind && result) __defProp$b(target, key, result); 71390 return result; 71391 }; 71392 let SonicCartItemsCondensed = class extends Subscriber$1(i$6) { 71393 constructor() { 71394 super(...arguments); 71395 this.items = null; 71396 this.entities = null; 71397 this.groupedItems = null; 71398 this.total = 0; 71399 this.productsWithQuantity = []; 71400 this.mode = "default"; 71401 } 71402 willUpdate(changedProperties) { 71403 super.willUpdate(changedProperties); 71404 if (changedProperties.has("items") || changedProperties.has("entities")) { 71405 if (this.items && this.entities) { 71406 this.total = this.items.reduce((acc, item) => acc + (item.price?.amount || 0), 0); 71407 const productMap = /* @__PURE__ */ new Map(); 71408 this.entities.forEach((entity) => { 71409 const key = entity.id; 71410 const items = this.items?.filter((item) => item.entity_id === entity.id) || []; 71411 const messages2 = items.flatMap((item) => item.messages || []); 71412 const uniqueMessagesMap = /* @__PURE__ */ new Map(); 71413 for (const message of messages2) { 71414 uniqueMessagesMap.set(message.content, message); 71415 } 71416 const uniqueMessagesByContent = Array.from(uniqueMessagesMap.values()); 71417 if (items.length > 0) { 71418 productMap.set(key, { 71419 entity, 71420 quantity: items.reduce((acc, item) => acc + (item.quantity || 0), 0), 71421 total: items.reduce((acc, item) => acc + (item.price?.amount || 0), 0), 71422 messages: uniqueMessagesByContent 71423 }); 71424 } 71425 }); 71426 this.productsWithQuantity = Array.from(productMap.values()); 71427 } 71428 } 71429 } 71430 render() { 71431 if (!this.productsWithQuantity?.length) { 71432 const status = this.props && "status" in this.props ? this.props?.status : void 0; 71433 return b$1`<sonic-cart-empty 71434 .status="${status}" 71435 .cartType="${this.props?.cartType}" 71436 .mode="${this.mode}" 71437 class="text-neutral-400 text-base " 71438 ></sonic-cart-empty>`; 71439 } 71440 return b$1`<div class="flex items-center mb-2"> 71441 <sonic-cart-summary class="font-medium text-sm block grow"></sonic-cart-summary> 71442 <div class="font-bold text-base ml-auto text-nowrap leading-none"> 71443 Total : ${this.total ? formatAmount(this.total) : "gratuit"} 71444 </div> 71445 </div> 71446 <div class="mb-[2px] w-full border-t border-t-neutral-200"></div> 71447 ${o$1(this.productsWithQuantity, (product, index) => { 71448 let icon2 = iconFromEntityType(product.entity?.entity_type); 71449 const isLast = index === this.productsWithQuantity.length - 1;
71450 return b$1`<div class="flex gap-2 items-center rounded p-[2px] py-[3px] min-h-6"> 71451 <sonic-subscriber 71452 dataProvider="groupedCartItem/${this.id}/${product.entity?.id}" 71453 .props="${product.entity}" 71454 > 71455 <div class="w-12 @xl:w-14 rounded overflow-hidden shrink-0 hidden @lg:block"> 71456 <sonic-product-illustration noAnimation></sonic-product-illustration> 71457 </div> 71458 <div> 71459 <sonic-date class="text-xs"></sonic-date> 71460 <sonic-product-title machineName noOverTitle class="text-xs"></sonic-product-title> 71461 ${c$1( 71462 product.messages, 71463 (message) => message, 71464 (message) => { 71465 if (isRequest(this.props?.cartType)) return A$1; 71466 if (isReservation(this.props?.cartType) && this.appType === "customer") return A$1; 71467 return b$1`<sonic-alert status="error" size="xs" class="mt-px" 71468 >${o$6(message.content)}</sonic-alert 71469 >`; 71470 } 71471 )} 71472 </div> 71473 </sonic-subscriber> 71474 <div class="flex ml-auto items-center"> 71475 <div class="text-neutral-500 text-sm text-nowrap"> 71476 <sonic-icon name="${icon2}" library="custom"></sonic-icon> 71477 <span class="@lg:min-w-[3ch] inline-block text-center">${product.quantity}</span> 71478 </div> 71479 <div class="font-medium text-sm min-w-[5.8ch] @lg:min-w-20 ml-5 text-right"> 71480 ${product.total ? formatAmount(product.total) : "gratuit"} 71481 </div> 71482 </div> 71483 </div> 71484 ${isLast ? A$1 : b$1`<div class="my-[2px] w-full border-t border-t-neutral-200"></div>`} `; 71485 })}`; 71486 } 71487 }; 71488 SonicCartItemsCondensed.styles = [tailwind]; 71489 __decorateClass$b([ 71490 n$5({ type: Array }) 71491 ], SonicCartItemsCondensed.prototype, "items", 2); 71492 __decorateClass$b([ 71493 n$5({ type: Array }) 71494 ], SonicCartItemsCondensed.prototype, "entities", 2); 71495 __decorateClass$b([ 71496 r$5() 71497 ], SonicCartItemsCondensed.prototype, "groupedItems", 2); 71498 __decorateClass$b([ 71499 r$5() 71500 ], SonicCartItemsCondensed.prototype, "total", 2); 71501 __decorateClass$b([ 71502 r$5() 71503 ], SonicCartItemsCondensed.prototype, "productsWithQuantity", 2); 71504 __decorateClass$b([ 71505 e$2({ context: modeContext }), 71506 n$5({ type: String }) 71507 ], SonicCartItemsCondensed.prototype, "mode", 2); 71508 __decorateClass$b([ 71509 c({ context: appType, subscribe: true }) 71510 ], SonicCartItemsCondensed.prototype, "appType", 2); 71511 SonicCartItemsCondensed = __decorateClass$b([ 71512 t$3("sonic-cart-items-condensed") 71513 ], SonicCartItemsCondensed); 71514 var __defProp$a = Object.defineProperty; 71515 var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor; 71516 var __decorateClass$a = (decorators, target, key, kind) => { 71517 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target; 71518 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71519 if (decorator = decorators[i2]) 71520 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71521 if (kind && result) __defProp$a(target, key, result); 71522 return result; 71523 }; 71524 let SonicReservationStatus = class extends Subscriber(i$6) { 71525 constructor() { 71526 super(...arguments); 71527 this.status = ReservationStatus.Draft; 71528 this.size = "md"; 71529 this.ellipsis = false; 71530 this.badgeType = "default"; 71531 this.statusIcon = ""; 71532 this.label = ""; 71533 } 71534 willUpdate(_changedProperties) { 71535 if (_changedProperties.has("status") || _changedProperties.has("appType")) { 71536 const prefix = isRequest(this.props?.cartType) ? "request_" : "cart_"; 71537 switch (this.status) { 71538 case ReservationStatus.Draft: 71539 this.badgeType = "default"; 71540 this.statusIcon = "pencil"; 71541 this.label = t(`cart_status_draft`); 71542 break; 71543 case ReservationStatus.Pending: 71544 this.badgeType = "info"; 71545 this.statusIcon = "clock"; 71546 this.label = t(`cart_status_pending`); 71547 break; 71548 case ReservationStatus.PartiallyProcessed:
71549 this.badgeType = "warning"; 71550 this.statusIcon = "clock"; 71551 this.label = t(`${prefix}status_partially_processed`); 71552 if (["xs", "sm", "2xs"].includes(this.size)) { 71553 this.label = t(`${prefix}status_partially_processed_short`); 71554 } 71555 break; 71556 case ReservationStatus.Processed: 71557 this.badgeType = "success"; 71558 this.statusIcon = "check"; 71559 this.label = t(`${prefix}status_processed`); 71560 break; 71561 case ReservationStatus.Confirmed: 71562 this.badgeType = "success"; 71563 this.statusIcon = "check"; 71564 this.label = t(`${prefix}status_confirmed`); 71565 break; 71566 case ReservationStatus.Expired: 71567 this.badgeType = "danger"; 71568 this.statusIcon = "xmark"; 71569 this.label = t("cart_status_expired"); 71570 break; 71571 case ReservationStatus.Deleted: 71572 this.badgeType = "danger"; 71573 this.statusIcon = "xmark"; 71574 this.label = t("cart_status_deleted"); 71575 break; 71576 case ReservationStatus.Declined: 71577 this.badgeType = "danger"; 71578 this.statusIcon = "xmark"; 71579 this.label = t("cart_status_temporary_declined"); 71580 break; 71581 case ReservationStatus.DeclinedForever: 71582 this.badgeType = "danger"; 71583 this.statusIcon = "ban"; 71584 this.label = t("cart_status_declined"); 71585 break; 71586 case ReservationStatus.Incomplete: 71587 this.badgeType = "danger"; 71588 this.statusIcon = "triangle-exclamation"; 71589 this.label = t("cart_status_incomplete"); 71590 break; 71591 case ReservationStatus.Processing: 71592 this.badgeType = "warning"; 71593 this.statusIcon = "credit-card"; 71594 this.label = "En cours de règlement"; 71595 if (["xs", "sm", "2xs"].includes(this.size)) { 71596 this.label = t("cart_status_processing"); 71597 } 71598 break; 71599 case ReservationStatus.Error: 71600 this.badgeType = "danger"; 71601 this.statusIcon = "circle-exclamation"; 71602 this.label = t("cart_status_error"); 71603 break; 71604 case ReservationStatus.Disabled: 71605 this.badgeType = "danger"; 71606 this.statusIcon = "ban"; 71607 this.label = t("cart_status_disabled"); 71608 break; 71609 case ReservationStatus.Submitted: 71610 this.badgeType = "info"; 71611 this.statusIcon = "clock"; 71612 this.label = t("LIB_awaiting_processing"); 71613 break; 71614 default: 71615 this.badgeType = "default"; 71616 break; 71617 } 71618 const processingStatuses = [ 71619 ReservationStatus.Draft, 71620 ReservationStatus.PartiallyProcessed, 71621 ReservationStatus.Confirmed, 71622 ReservationStatus.Pending, 71623 ReservationStatus.Declined 71624 ]; 71625 const requestForCustomer = isRequest(this.props?.cartType) && this.appType === "customer"; 71626 if (requestForCustomer && processingStatuses.includes(this.status)) { 71627 this.badgeType = "warning"; 71628 this.statusIcon = "lock"; 71629 this.label = t("LIB_en_cours_de_traitement"); 71630 } 71631 } 71632 super.willUpdate(_changedProperties); 71633 } 71634 render() { 71635 if (!this.status) return A$1; 71636 return b$1`<sonic-badge type=${this.badgeType} size=${this.size} ?ellipsis=${this.ellipsis} 71637 >${this.statusIcon ? b$1`<sonic-icon name=${this.statusIcon} library="custom"></sonic-icon>` : A$1} 71638 ${this.label}</sonic-badge 71639 >`; 71640 } 71641 }; 71642 SonicReservationStatus.styles = [tailwind]; 71643 __decorateClass$a([ 71644 n$5({ type: String }) 71645 ], SonicReservationStatus.prototype, "status", 2); 71646 __decorateClass$a([ 71647 n$5({ type: String }) 71648 ], SonicReservationStatus.prototype, "size", 2); 71649 __decorateClass$a([ 71650 n$5({ type: Boolean }) 71651 ], SonicReservationStatus.prototype, "ellipsis", 2); 71652 __decorateClass$a([ 71653 r$5() 71654 ], SonicReservationStatus.prototype, "badgeType", 2); 71655 __decorateClass$a([ 71656 r$5() 71657 ], SonicReservationStatus.prototype, "statusIcon", 2); 71658 __decorateClass$a([ 71659 r$5() 71660 ], SonicReservationStatus.prototype, "label", 2); 71661 __decorateClass$a([ 71662 c({ context: appType, subscribe: true }), 71663 r$5() 71664 ], SonicReservationStatus.prototype, "appType", 2); 71665 SonicReservationStatus = __decorateClass$a([ 71666 t$3("sonic-reservation-status") 71667 ], SonicReservationStatus); 71668 var __defProp$9 = Object.defineProperty; 71669 var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor; 71670 var __decorateClass$9 = (decorators, target, key, kind) => { 71671 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target; 71672 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71673 if (decorator = decorators[i2]) 71674 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71675 if (kind && result) __defProp$9(target, key, result); 71676 return result; 71677 }; 71678 const tagName$5 = "sonic-user-account-request-detail"; 71679 let UserAccountRequestDetail = class extends Subscriber(i$6) { 71680 constructor() { 71681 super(...arguments); 71682 this.initialized = false;
71683 } 71684 async willUpdate() { 71685 if (this.props?.id && !this.initialized) { 71686 const apiConfiguration = HTML.getApiConfiguration(this); 71687 const api2 = new API(apiConfiguration); 71688 const result = await api2.get(`reservation-request-config/${this.props?.reservationRequestConfigId}`); 71689 if (result?.data && result.success) { 71690 this.config = result.data; 71691 this.initialized = true; 71692 } 71693 } 71694 } 71695 render() { 71696 if (!this.props) return A$1; 71697 return b$1` ${renderFormData({ 71698 reservationRequest: this.props, 71699 reservationRequestConfig: this.config, 71700 displayLegends: false, 71701 displayTitle: false, 71702 size: "sm" 71703 })} 71704 <sonic-cart-items displaySummary noDetailButton mode="readonly" class="mt-3"></sonic-cart-items>`; 71705 } 71706 }; 71707 UserAccountRequestDetail.styles = [tailwind]; 71708 __decorateClass$9([ 71709 n$5({ type: Object }) 71710 ], UserAccountRequestDetail.prototype, "config", 2); 71711 UserAccountRequestDetail = __decorateClass$9([ 71712 t$3(tagName$5) 71713 ], UserAccountRequestDetail); 71714 var __defProp$8 = Object.defineProperty; 71715 var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor; 71716 var __decorateClass$8 = (decorators, target, key, kind) => { 71717 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target; 71718 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71719 if (decorator = decorators[i2]) 71720 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71721 if (kind && result) __defProp$8(target, key, result); 71722 return result; 71723 }; 71724 let SonicRequestItem = class extends Subscriber(i$6) { 71725 constructor() { 71726 super(...arguments); 71727 this._display = "current"; 71728 this._reservationTargetData = null; 71729 } 71730 async willUpdate(changedProperties) { 71731 if (changedProperties.has("props")) { 71732 const hasInitialRequest = this.props?.cart_origin?.type === CartType.ReservationRequest || this.props?.cart_origin?.type === CartType.WaitingLists; 71733 this._display = hasInitialRequest ? "initial" : "current"; 71734 if (this.props?.cart_target && this.props.cart_target.type === CartType.Reservation) { 71735 const api2 = new API(HTML$1.getApiConfiguration(this)); 71736 const result = await api2.get(`reservations/${this.props.cart_target.id}`); 71737 if (result?.data && result.success) { 71738 this._reservationTargetData = result.data; 71739 } 71740 } 71741 } 71742 } 71743 deleteRequest(dataProvider) { 71744 const api2 = new API(HTML$1.getApiConfiguration(this)); 71745 Modal.create({ 71746 title: t("LIB_confirmer_la_suppression"), 71747 subtitle: t("LIB_attention_toutes_les_donnees_seront_perdues"), 71748 actions: b$1`<sonic-button 71749 minWidth="10rem" 71750 shape="block" 71751 type="danger" 71752 @click=${(e2) => { 71753 const target = e2.currentTarget; 71754 const parentModal = HTML$1.getClosestElement(target, "sonic-modal"); 71755 Cart.delete(api2, dataProvider).then(() => { 71756 parentModal?.hide(); 71757 if (this.filterDataProvider) { 71758 dp(this.filterDataProvider).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 71759 } 71760 }); 71761 }} 71762 > 71763 <sonic-icon library="custom" name="trash"></sonic-icon> 71764 ${t("supprimer")}</sonic-button 71765 ><sonic-button shape="block" minWidth="10rem" hideModal> 71766 <sonic-icon library="custom"></sonic-icon>${t("annuler")}</sonic-button 71767 >`, 71768 removeOnHide: true 71769 }); 71770 } 71771 editRequest(cart) { 71772 const api2 = new API(HTML$1.getApiConfiguration(this)); 71773 Modal.create({ 71774 title: t("LIB_modifier_la_demande"), 71775 subtitle: t("LIB_attention_vous_devrez_la_confirmer_de_nouveau"), 71776 actions: b$1`<sonic-button 71777 minWidth="10rem" 71778 shape="block" 71779 type="success" 71780 @click=${async () => { 71781 const response = await api2.put(`reservation-request/${cart.id}/cancel-submission`, {}); 71782 if (response?.success) { 71783 Modal.modals[Modal.modals.length - 1].hide(); 71784 if (cart.cart_origin?.type === CartType.ReservationRequest) { 71785 appRoute("reservationRequest").fill({ 71786 id: cart.reservationRequestConfigId 71787 }).query({ 71788 sonic_request_id: cart.id, 71789 sonic_reservation_request_config_id: cart.reservationRequestConfigId 71790 }).goTo(); 71791 } else { 71792 appRoute("waitingList").fill({ 71793 id: cart.id 71794 }).goTo(); 71795 } 71796 } 71797 }} 71798 > 71799 <sonic-icon library="custom" name="pen"></sonic-icon> 71800 ${t("modifier")}</sonic-button 71801 ><sonic-button shape="block" minWidth="10rem" hideModal> 71802 <sonic-icon library="custom"></sonic-icon>${t("annuler")}</sonic-button 71803 >`, 71804 removeOnHide: true 71805 }); 71806 } 71807 render() { 71808 const cart = this.props; 71809 if (!cart) return A$1; 71810 const currentQuote = cart.quotes?.current; 71811 const lastUpdate = currentQuote?.created_at || cart?.updated_at; 71812 const pdfURL = currentQuote?.pdf_url; 71813 const canEdit = cart.status === ReservationStatus.Incomplete || cart.status === ReservationStatus.Submitted; 71814 const cartOriginId = Number(cart.cart_origin?.id); 71815 const displayDetailButton = this._display === "current" ? !!cart?.items?.length : true; 71816 const displayPdfDownload = cart?.cartType !== CartType.WaitingLists; 71817 return b$1`<div class="mb-3 rounded-md p-3 border border-neutral-100 @container"> 71818 <div class="flex items-center gap-2 mb-3"> 71819 <div class="mr-auto"> 71820 <div class="font-bold pr-2">${cart?.title || cartTitle(cart.cartType)}</div> 71821 <div class="text-xs mt-1"> 71822 n°${getCartNumber(cart)} â ${t("mis_a_jour_le")} <sonic-date date=${lastUpdate}></sonic-date> 71823 </div> 71824 71825 <sonic-reservation-status 71826 size="xs" 71827 class="block @md:hidden mt-1 ${cart.status === ReservationStatus.Incomplete ? "animate-pulse" : ""}" 71828 ></sonic-reservation-status> 71829 71830 ${this.renderMessage(cart.status, this._reservationTargetData)} 71831 </div> 71832
71833 <div class="self-start flex items-center gap-1"> 71834 <sonic-reservation-status 71835 size="xs" 71836 class="hidden @md:block ${cart.status === ReservationStatus.Incomplete ? "animate-pulse" : ""}" 71837 ></sonic-reservation-status> 71838 <sonic-pop> 71839 <sonic-button shape="circle" size="xs" icon ?disabled=${!canEdit}> 71840 <sonic-icon library="custom" name="ellipsis-vertical"></sonic-icon> 71841 </sonic-button> 71842 <sonic-menu slot="content" size="sm"> 71843 <sonic-menu-item target="_blank" ?disabled=${!canEdit} @click=${() => this.editRequest(cart)}> 71844 <sonic-icon library="custom" name="pen" slot="prefix"></sonic-icon> 71845 ${t("modifier")} 71846 </sonic-menu-item> 71847 71848 ${displayPdfDownload ? b$1` 71849 <sonic-menu-item href=${pdfURL} target="_blank" ?disabled=${!pdfURL}> 71850 <sonic-icon library="custom" name="file-pdf" slot="prefix"></sonic-icon> 71851 ${t("telecharger")} 71852 </sonic-menu-item> 71853 ` : A$1} 71854 <sonic-divider></sonic-divider> 71855 <sonic-menu-item type="danger" @click=${() => this.deleteRequest("reservation-request/" + cart.id)}> 71856 <sonic-icon library="custom" name="trash" slot="prefix"></sonic-icon> 71857 ${t("supprimer")} 71858 </sonic-menu-item> 71859 </sonic-menu> 71860 </sonic-pop> 71861 </div> 71862 </div> 71863 71864 ${this._display === "initial" ? b$1` 71865 <sonic-fetch dataProvider="reservation-request/${cartOriginId}" key="data"> 71866 <sonic-cart-items-condensed></sonic-cart-items-condensed> 71867 </sonic-fetch> 71868 ` : b$1`<sonic-cart-items-condensed></sonic-cart-items-condensed>`} 71869 71870 <div class="flex items-center gap-2 mt-3 flex-wrap"> 71871 ${displayDetailButton ? b$1` 71872 <sonic-button @click=${() => this.showDetail()} variant="link" size="xs"> 71873 <sonic-icon library="custom" slot="prefix" name="eye"></sonic-icon> 71874 ${t("LIB_voir_le_detail")} 71875 </sonic-button> 71876 ` : A$1} 71877 ${cartOriginId && this._display === "current" ? b$1`<sonic-button variant="link" size="xs" @click=${() => this.showOriginalRequest(cartOriginId)}> 71878 <sonic-icon library="custom" slot="prefix" name="clock-rotate-left"></sonic-icon> 71879 ${t("LIB_voir_la_demande_initiale")}</sonic-button 71880 >` : A$1} 71881 </div> 71882 </div>`; 71883 } 71884 showOriginalRequest(cartOriginId) { 71885 const subtitle = this.props?.title || cartTitle(this.props?.cartType); 71886 Modal.create({ 71887 title: subtitle, 71888 content: b$1`<div style="display: grid; grid-template-columns: 1fr 1fr;grid-gap:2rem;"> 71889 <div> 71890 <sonic-fetch dataProvider="reservation-request/${cartOriginId}" key="data"> 71891 <sonic-cart-items displaySummary noDetailButton mode="readonly"> 71892 <div slot="title" style="font-weight: bold; font-size: 1.25rem; margin-bottom:.3rem;"> 71893 Demande initiale 71894 </div> 71895 </sonic-cart-items> 71896 </sonic-fetch> 71897 </div> 71898 <sonic-cart-items dataProvider="${this.dataProvider}" displaySummary noDetailButton mode="readonly"> 71899 <div slot="title" style="font-weight: bold; font-size: 1.25rem; margin-bottom:.3rem;">Demande actuelle</div> 71900 </sonic-cart-items> 71901 </div>`, 71902 maxWidth: "85vw", 71903 removeOnHide: true 71904 }); 71905 } 71906 async showDetail() { 71907 const cartOriginId = Number(this.props?.cart_origin?.id); 71908 const dataProvider = this._display === "initial" ? `reservation-request/${cartOriginId}` : this.dataProvider; 71909 Modal.create({ 71910 title: this.props?.title || cartTitle(this.props?.cartType), 71911 content: b$1`<sonic-user-account-request-detail 71912 dataProvider="${dataProvider}" 71913 cartProvider="${this.dataProvider}" 71914 ></sonic-user-account-request-detail>`, 71915 removeOnHide: true 71916 }); 71917 } 71918 renderMessage(status, reservationTargetData) { 71919 if (!status) return A$1; 71920 const isProcessed = status === ReservationStatus.Processed; 71921 const isDeclinedForever = status === ReservationStatus.DeclinedForever; 71922 const isAvailableInAccount = reservationTargetData?.displayOnline === true; 71923 const reservationIsProcessed = reservationTargetData?.status === ReservationStatus.Processed || reservationTargetData?.status === ReservationStatus.Deleted || !reservationTargetData; 71924 const requestHasBeenModified = this.props?.cart_origin?.type === CartType.ReservationRequest; 71925 if (isProcessed) { 71926 if (reservationIsProcessed) { 71927 return A$1; 71928 } else if (isAvailableInAccount) { 71929 return b$1`<sonic-alert class="my-2" size="sm" status="success" 71930 >${t("LIB_reservation_available_in_account")} 71931 </sonic-alert> 71932 ${requestHasBeenModified ? b$1`<sonic-alert class="my-2 font-bold" size="sm" status="warning" 71933 >${t("LIB_demande_modifiee_warning")}</sonic-alert 71934 >` : A$1}`; 71935 } else { 71936 return b$1`<sonic-alert class="my-2" size="sm" status="success"> 71937 ${t("LIB_account_request_processed_message")} 71938 </sonic-alert>`; 71939 } 71940 } else if (isDeclinedForever) { 71941 return b$1`<sonic-alert class="my-2" size="sm" status="error" 71942 >${t("LIB_account_request_declined_forever_message")}</sonic-alert 71943 >`; 71944 } 71945 return A$1; 71946 } 71947 }; 71948 SonicRequestItem.styles = [tailwind]; 71949 __decorateClass$8([ 71950 n$5({ type: String }) 71951 ], SonicRequestItem.prototype, "filterDataProvider", 2); 71952 __decorateClass$8([ 71953 r$5() 71954 ], SonicRequestItem.prototype, "_display", 2); 71955 __decorateClass$8([ 71956 r$5() 71957 ], SonicRequestItem.prototype, "_reservationTargetData", 2); 71958 SonicRequestItem = __decorateClass$8([ 71959 t$3("sonic-user-account-request-item") 71960 ], SonicRequestItem); 71961 var __defProp$7 = Object.defineProperty; 71962 var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor; 71963 var __decorateClass$7 = (decorators, target, key, kind) => { 71964 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target; 71965 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71966 if (decorator = decorators[i2]) 71967 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71968 if (kind && result) __defProp$7(target, key, result); 71969 return result; 71970 }; 71971 const tagName$4 = "sonic-user-account-requests"; 71972 const DATA_FILTER_REQUESTS_PROVIDER = "accountRequestsFilters"; 71973 let UserAccountReservationRequests = class extends i$6 { 71974 constructor() { 71975 super(...arguments); 71976 this.dataProvider = "account/my-requests"; 71977 this.cartType = CartType.ReservationRequest; 71978 } 71979 async willUpdate(changedProperties) { 71980 if (changedProperties.has("userId") && this.userId && this.cartType) { 71981 this._dataEndpoint = getCartEndpoint({ 71982 type: this.cartType, 71983 userId: this.userId, 71984 statuses: [ 71985 ReservationStatus.Incomplete, 71986 ReservationStatus.Pending, 71987 ReservationStatus.Submitted, 71988 ReservationStatus.Draft, 71989 ReservationStatus.Confirmed, 71990 ReservationStatus.Processed, 71991 ReservationStatus.Declined, 71992 ReservationStatus.DeclinedForever 71993 ], 71994 isQueue: true 71995 }); 71996 } 71997 } 71998 renderHeader(cartType) { 71999 if (cartType === CartType.ReservationRequest) { 72000 return b$1` 72001 <sonic-page-header label=${t("LIB_mes_demandes_de_reservation")}></sonic-page-header> 72002 <div class=" prose mb-8 ">${t("LIB_reservation_request_account_help_message", true)}</div> 72003 `; 72004 } else if (cartType === CartType.WaitingLists) { 72005 return b$1` 72006 <sonic-page-header label=${t("LIB_mes_listes_d_attente")}></sonic-page-header> 72007 <div class=" prose mb-8 ">${t("LIB_waiting_list_account_help_message", true)}</div> 72008 `; 72009 } 72010 return A$1; 72011 } 72012 render() { 72013 if (!this._dataEndpoint) return A$1; 72014 const isReservationRequest2 = this.cartType === CartType.ReservationRequest; 72015 return b$1` 72016 ${this.renderHeader(this.cartType)} 72017 <sonic-queue 72018 dataFilterProvider="${DATA_FILTER_REQUESTS_PROVIDER}" 72019 key="data" 72020 limit="5" 72021 dataProviderExpression=${this._dataEndpoint} 72022 .items=${() => b$1`<sonic-user-account-request-item 72023 .filterDataProvider=${DATA_FILTER_REQUESTS_PROVIDER} 72024 ></sonic-user-account-request-item>`} 72025 .noItems=${() => b$1`<sonic-no-result> 72026 ${isReservationRequest2 ? b$1` 72027 <sonic-app-link to="reservationRequest" size="xs" variant="default" class="mt-2" 72028 ><sonic-icon library="custom" name="arrow-right"></sonic-icon> ${t( 72029 "LIB_nouvelle_demande" 72030 )}</sonic-app-link 72031 > 72032 ` : A$1} 72033 </sonic-no-result>`} 72034 > 72035 </sonic-queue> 72036 `; 72037 } 72038 }; 72039 UserAccountReservationRequests.styles = [tailwind, sonicProse]; 72040 __decorateClass$7([ 72041 bind$1("user.id"), 72042 n$5({ type: Number }) 72043 ], UserAccountReservationRequests.prototype, "userId", 2); 72044 __decorateClass$7([ 72045 r$5() 72046 ], UserAccountReservationRequests.prototype, "_dataEndpoint", 2); 72047 __decorateClass$7([ 72048 n$5() 72049 ], UserAccountReservationRequests.prototype, "cartType", 2); 72050 UserAccountReservationRequests = __decorateClass$7([ 72051 t$3(tagName$4) 72052 ], UserAccountReservationRequests); 72053 var __defProp$6 = Object.defineProperty; 72054 var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor; 72055 var __decorateClass$6 = (decorators, target, key, kind) => { 72056 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target; 72057 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72058 if (decorator = decorators[i2]) 72059 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72060 if (kind && result) __defProp$6(target, key, result); 72061 return result; 72062 }; 72063 const tagName$3 = "sonic-user-account-reservations"; 72064 const DATA_FILTER_RESERVATIONS_PROVIDER = "accountReservationsFilters"; 72065 let UserAccountReservations = class extends i$6 { 72066 constructor() { 72067 super(...arguments); 72068 this.dataProvider = "account/my-reservations"; 72069 } 72070 async willUpdate(changedProperties) { 72071 if (changedProperties.has("userId") && this.userId) { 72072 this._dataEndpoint = getCartEndpoint({ 72073 type: CartType.Reservation, 72074 userId: this.userId, 72075 statuses: [ 72076 ReservationStatus.Pending, 72077 ReservationStatus.Confirmed, 72078 ReservationStatus.Processing, 72079 ReservationStatus.PartiallyProcessed 72080 ], 72081 isQueue: true 72082 }); 72083 } 72084 } 72085 render() { 72086 if (!this._dataEndpoint) return A$1; 72087 return b$1` 72088 <sonic-page-header label=${t("LIB_mes_reservations")}></sonic-page-header> 72089 <sonic-queue 72090 dataFilterProvider="${DATA_FILTER_RESERVATIONS_PROVIDER}" 72091 key="data" 72092 limit="5" 72093 dataProviderExpression=${this._dataEndpoint} 72094 .items=${(reservation) => this.renderItem(reservation)} 72095 } 72096 .noItems=${() => b$1`<sonic-no-result size="md"> </sonic-no-result>`} 72097 > 72098 </sonic-queue> 72099 `; 72100 } 72101 renderItem(reservation) { 72102 const paymentLinkHref = reservation?.quotes?.current?.payment_link?.url ?? ""; 72103 const quoteTitle = reservation?.quotes?.current?.title ?? ""; 72104 const quoteUrl = reservation?.quotes?.current?.pdf_url ?? ""; 72105 const reservationNumber = reservation?.id; 72106 const hasItems = reservation?.items && reservation?.items.length > 0 || reservation?.extras && reservation?.extras.length > 0; 72107 const cartId = reservation?.quotes?.current?.payment_link?.cart_id?.toString() ?? ""; 72108 const total = reservation?.quotes?.current?.total ?? 0; 72109 const btnText = total > 0 ? t("LIB_payer_maintenant") : t("LIB_get_my_tickets"); 72110 return b$1`<div class="p-4 border border-neutral-100 rounded-md mb-3"> 72111 <div class="mb-3"> 72112 <div class="font-bold mb-1 text-lg">${reservation.title ?? "Réservation n°" + reservationNumber}</div> 72113 <div class="text-sm my-1">Devis ${quoteTitle}</div> 72114 </div> 72115 72116 ${reservation.status === ReservationStatus.PartiallyProcessed ? b$1`<sonic-cart-items-condensed></sonic-cart-items-condensed>` : b$1`<sonic-cart-items-condensed 72117 subDataProvider="quotes.current" 72118 .props=${reservation.quotes?.current} 72119 ></sonic-cart-items-condensed> `} 72120 ${paymentLinkHref && hasItems ? b$1`<sonic-button href=${paymentLinkHref} size="xs" type="success" class="mt-2"> 72121 <sonic-icon library="custom" name="credit-card"></sonic-icon> ${btnText} 72122 </sonic-button>` : A$1} 72123 ${reservation.status === ReservationStatus.Processing ? b$1` 72124 <sonic-alert 72125 background 72126 class="my-3" 72127 size="sm" 72128 status="warning" 72129 label="${t("LIB_alert_reservation_en_cours_de_paiement")}" 72130 > 72131 <div class="flex items-center gap-2">
72132 <span>${t("LIB_remaining_time")} : </span> 72133 <sonic-fetch dataProvider="orders/${cartId}" key="data"> 72134 <sonic-cart-remaining-time></sonic-cart-remaining-time> 72135 </sonic-fetch></div 72136 ></sonic-alert> 72137 ` : A$1} 72138 ${quoteUrl ? b$1`<sonic-button href=${quoteUrl} size="xs" class="mt-2" target="_blank"> 72139 <sonic-icon library="custom" name="file-pdf"></sonic-icon> ${t("LIB_telecharger_le_devis")} 72140 </sonic-button>` : A$1} 72141 </div>`; 72142 } 72143 }; 72144 UserAccountReservations.styles = [tailwind, sonicProse]; 72145 __decorateClass$6([ 72146 bind$1("user.id"), 72147 n$5({ type: Number }) 72148 ], UserAccountReservations.prototype, "userId", 2); 72149 __decorateClass$6([ 72150 r$5() 72151 ], UserAccountReservations.prototype, "_dataEndpoint", 2); 72152 UserAccountReservations = __decorateClass$6([ 72153 t$3(tagName$3) 72154 ], UserAccountReservations); 72155 var __defProp$5 = Object.defineProperty; 72156 var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor; 72157 var __decorateClass$5 = (decorators, target, key, kind) => { 72158 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target; 72159 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72160 if (decorator = decorators[i2]) 72161 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72162 if (kind && result) __defProp$5(target, key, result); 72163 return result; 72164 }; 72165 const matchAnyQuery = (route2) => { 72166 return appRoute(route2).toString().split("#").join(".*?#"); 72167 }; 72168 const tagName$2 = "sonic-account"; 72169 const user = new DataProviderKey("user"); 72170 let UserAccount = class extends i$6 { 72171 constructor() { 72172 super(...arguments); 72173 this._userId = null; 72174 this._shouldRender = false;
72175 } 72176 userIdChanged(user2) { 72177 if (!user2) { 72178 this._userId = null; 72179 this._shouldRender = false; 72180 return; 72181 } 72182 const userId = user2 && "id" in user2 ? user2.id : null; 72183 this._userId = userId; 72184 const hasFetch = "success" in user2; 72185 this._shouldRender = !!(userId || hasFetch); 72186 } 72187 getLoggedInRoutes() { 72188 return { 72189 [`${matchAnyQuery("account.tickets")}$`]: () => b$1`<sonic-user-account-tickets></sonic-user-account-tickets>`, 72190 [`${matchAnyQuery("account.purchases")}$`]: () => b$1`<sonic-user-account-purchases></sonic-user-account-purchases>`, 72191 [`${matchAnyQuery("account.edit")}$`]: () => b$1`<sonic-user-form-edit></sonic-user-form-edit>`, 72192 [`${matchAnyQuery("account.editPassword")}$`]: () => b$1` 72193 <div dataProvider="sonic-wording"> 72194 <sonic-page-header label="${t("my_password")}"></sonic-page-header> 72195 </div> 72196 <sonic-sdui 72197 fetch 72198 sduiKey="data" 72199 dataProvider="sdui-provider" 72200 endPoint="/user/form/change-password/" 72201 headersDataProvider="ticketsAppHeadersProvider" 72202 ></sonic-sdui> 72203 `, 72204 [`${matchAnyQuery("account.trips")}$`]: () => b$1`<sonic-account-carpooling></sonic-account-carpooling>`, 72205 [`${matchAnyQuery("account.waitingLists")}$`]: () => b$1`<sonic-user-account-requests .cartType=${CartType.WaitingLists}></sonic-user-account-requests>`, 72206 [`${matchAnyQuery("account.reservationRequests")}$`]: () => b$1`<sonic-user-account-requests></sonic-user-account-requests>`, 72207 [`${matchAnyQuery("account.reservations")}$`]: () => b$1`<sonic-user-account-reservations></sonic-user-account-reservations>`, 72208 fallback: () => b$1`<sonic-user-account-home></sonic-user-account-home>` 72209 }; 72210 } 72211 getNotLoggedInRoutes() { 72212 return { 72213 [matchAnyQuery("account.create")]: () => b$1` 72214 <div dataProvider="sonic-wording"> 72215 <sonic-page-header goBack label="${t("create_account")}"></sonic-page-header> 72216 </div> 72217 <sonic-user-form-create></sonic-user-form-create> 72218 `, 72219 [`${matchAnyQuery("account.missingPassword")}$`]: () => b$1` 72220 <div class="mt-2 lg:mt-8 mx-auto max-w-[32rem] block w-full"> 72221 <div dataProvider="sonic-wording"> 72222 <sonic-page-header goBack label="${t("mot_de_passe_oublie")}"></sonic-page-header> 72223 </div> 72224 <sonic-sdui 72225 fetch 72226 sduiKey="data" 72227 dataProvider="sdui-provider" 72228 endPoint="/user/form/change-password/" 72229 headersDataProvider="ticketsAppHeadersProvider" 72230 ></sonic-sdui> 72231 </div> 72232 `, 72233 fallback: () => b$1` 72234 <sonic-user-form-login createAccount class="mt-2 lg:mt-8 mx-auto block w-full"></sonic-user-form-login> 72235 ` 72236 }; 72237 } 72238 render() { 72239 if (!this._shouldRender) return A$1; 72240 return b$1` 72241 <sonic-fullscreen-layout> 72242 ${this._userId ? b$1` 72243 <sonic-user-account-menu class="mb-8 block"></sonic-user-account-menu> 72244 <sonic-router class="contents" .routes=${this.getLoggedInRoutes()}></sonic-router> 72245 ` : b$1`<sonic-router class="contents" .routes=${this.getNotLoggedInRoutes()}></sonic-router>`} 72246 </sonic-fullscreen-layout> 72247 `; 72248 } 72249 }; 72250 UserAccount.styles = [tailwind]; 72251 __decorateClass$5([ 72252 handle(user) 72253 ], UserAccount.prototype, "userIdChanged", 1); 72254 __decorateClass$5([ 72255 r$5() 72256 ], UserAccount.prototype, "_userId", 2); 72257 __decorateClass$5([ 72258 r$5() 72259 ], UserAccount.prototype, "_shouldRender", 2); 72260 UserAccount = __decorateClass$5([ 72261 t$3(tagName$2) 72262 ], UserAccount); 72263 var __defProp$4 = Object.defineProperty; 72264 var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor; 72265 var __decorateClass$4 = (decorators, target, key, kind) => { 72266 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target; 72267 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72268 if (decorator = decorators[i2]) 72269 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72270 if (kind && result) __defProp$4(target, key, result); 72271 return result; 72272 }; 72273 let accreditationCard = class extends Subscriber(i$6) { 72274 constructor() { 72275 super(...arguments); 72276 this.noContactButton = false;
72277 this.skeleton = false; 72278 } 72279 render() { 72280 if (this.props === null) return A$1; 72281 if (this.skeleton) { 72282 return b$1` 72283 <div 72284 class=" p-4 border-2 border-solid border-neutral-100 rounded-lg animate-pulse grid grid-cols-[auto,_minmax(0,1fr),_auto] gap-3" 72285 > 72286 <div class="w-20 aspect-square bg-neutral-100 rounded flex items-center justify-center"></div> 72287 <div class="mt-2"> 72288 <div class="w-28 h-3 bg-neutral-100 rounded mb-2"></div> 72289 <div class="w-28 h-3 bg-neutral-100 rounded mb-2"></div> 72290 <div class="w-28 h-3 bg-neutral-100 rounded"></div> 72291 </div> 72292 <div class="w-8 h-8 bg-neutral-100 rounded-full"></div> 72293 </div> 72294 `; 72295 } 72296 this.accreditation = this.props; 72297 return b$1` 72298 <div class="@container"> 72299 <div class="p-3 @md:p-4 border border-solid border-neutral-200 rounded-lg"> 72300 <div class="grid grid-cols-[auto,_minmax(0,1fr),_auto] gap-3 @md:gap-4 mb-3 "> 72301 <div class="photo"> 72302 ${this.accreditation.picture ? b$1`<sonic-image 72303 src=${this.accreditation.picture} 72304 ratio="1/1" 72305 class="w-16 @md:w-20 rounded overflow-hidden" 72306 ></sonic-image>` : b$1`<div class="w-16 @md:w-20 aspect-square bg-neutral-200 rounded flex items-center justify-center"> 72307 <sonic-icon library="custom" name="user" size="xl" class="text-neutral-0"></sonic-icon> 72308 </div>`} 72309 </div> 72310 <div class="mt-2 text-[.85rem] @md:text-[1.05rem]"> 72311 ${this.accreditation.structureName ? b$1` 72312 <sonic-button 72313 variant="unstyled" 72314 radio 72315 name="search" 72316 value="${this.accreditation.structureName}" 72317 class="font-bold text-[.75em] mb-2" 72318 > 72319 ${this.accreditation.structureName} 72320 </sonic-button> 72321 ` : A$1} 72322 <div>${this.accreditation.firstName} ${this.accreditation.lastName}</div> 72323 ${this.accreditation.function ? b$1` 72324 <sonic-button 72325 radio 72326 variant="unstyled" 72327 name="search" 72328 value="${this.accreditation.function}" 72329 class="text-[.75em] text-neutral-400" 72330 > 72331 ${this.accreditation.function} 72332 </sonic-button> 72333 ` : A$1} 72334 </div> 72335 ${!this.noContactButton && this.accreditation.contact ? b$1` <sonic-button shape="circle" @click="${this.setAccreditationContactModal}"> 72336 <sonic-icon library="heroicons" name="envelope"></sonic-icon> 72337 </sonic-button>` : A$1} 72338 </div> 72339 <div class="flex flex-wrap gap-4 text-[.78rem] @md:text-[.9rem] "> 72340 <div class="flex"> 72341 <sonic-icon library="custom" name="location-dot"></sonic-icon> 72342 <!-- POSTALCODE--> 72343 ${this.accreditation.postalCode ? b$1` 72344 <sonic-button 72345 class="mr-1 text-[1em]" 72346 variant="unstyled" 72347 radio 72348 name="search" 72349 value="${this.accreditation.postalCode}" 72350 > 72351 ${this.accreditation.postalCode} 72352 </sonic-button> 72353 ` : A$1} 72354 <!-- CITY--> 72355 ${this.accreditation.city ? b$1` <sonic-button 72356 radio 72357 variant="unstyled" 72358 name="search" 72359 class="text-[1em]" 72360 value="${this.accreditation.city}" 72361 > 72362 <!-- Capitalize word --> 72363 ${this.accreditation.city.split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ")} 72364 </sonic-button>` : A$1} 72365 , ${this.accreditation.country} 72366 </div> 72367 ${this.accreditation.structureTypeId ? b$1` 72368 <sonic-button 72369 radio 72370 class="text-[1em]" 72371 variant="unstyled" 72372 name="structureTypeID" 72373 value="${this.accreditation.structureTypeId}" 72374 > 72375 <sonic-icon library="custom" name="tags"></sonic-icon> 72376 ${this.accreditation.structureType} 72377 </sonic-button> 72378 ` : A$1} 72379 </div> 72380 </div> 72381 </div> 72382 `; 72383 } 72384 setAccreditationContactModal() { 72385 PublisherManager.get(`accreditationContact`).set(this.accreditation); 72386 } 72387 }; 72388 accreditationCard.styles = [tailwind]; 72389 __decorateClass$4([ 72390 n$5({ type: Boolean }) 72391 ], accreditationCard.prototype, "noContactButton", 2); 72392 __decorateClass$4([ 72393 n$5({ type: Boolean }) 72394 ], accreditationCard.prototype, "skeleton", 2); 72395 accreditationCard = __decorateClass$4([ 72396 t$3("accreditation-card") 72397 ], accreditationCard); 72398 var __defProp$3 = Object.defineProperty; 72399 var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor; 72400 var __decorateClass$3 = (decorators, target, key, kind) => { 72401 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target; 72402 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72403 if (decorator = decorators[i2]) 72404 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72405 if (kind && result) __defProp$3(target, key, result); 72406 return result; 72407 }; 72408 const tagName$1 = "sonic-accreditations-directory"; 72409 let SonicAccreditationsDirectory = class extends Subscriber$1(i$6) { 72410 constructor() { 72411 super(...arguments); 72412 this.displayTitle = false;
72413 this.displayText = false; 72414 this.invalidateCurrentAccreditation = (_value) => { 72415 dp(`currentAccreditation`).invalidate(); 72416 }; 72417 } 72418 connectedCallback() { 72419 super.connectedCallback(); 72420 dp(`accreditationLoginResult`).onAssign(this.invalidateCurrentAccreditation); 72421 } 72422 disconnectedCallback() { 72423 super.disconnectedCallback(); 72424 dp(`accreditationLoginResult`).offAssign(this.invalidateCurrentAccreditation); 72425 } 72426 render() { 72427 return b$1` <!-- Test si l'utilisateur a accès à la liste ou s'il doit s'authentifier --> 72428 <sonic-fetch 72429 dataProvider="currentAccreditation" 72430 endPoint="accreditations/current" 72431 noErrorsRecordings 72432 ></sonic-fetch> 72433 72434 <sonic-page-layout 72435 pageTitle=${t("accreditations_directory_title")} 72436 pageText=${t("accreditations_directory_text")} 72437 ?displayTitle=${this.displayTitle} 72438 ?displayText=${this.displayText} 72439 > 72440 <!-- Pas connecté - Formulaire de login --> 72441 ${!this.currentAccreditation ? this.showLoginForm() : A$1} 72442 72443 <!-- Connecté - Liste des accreditations --> 72444 ${this.currentAccreditation ? this.showAccreditationsList() : A$1} 72445 </sonic-page-layout>`; 72446 } 72447 showLoginForm() { 72448 return b$1` 72449 <form formDataProvider="accreditationLogin" submitResultDataProvider="accreditationLoginResult"> 72450 <sonic-fieldset class="max-w-[25rem]"> 72451 <sonic-legend iconLibrary="custom" iconName="lock" label=${t("LIB_annuaire_access_accreditations_directory")}> 72452 </sonic-legend> 72453 <sonic-form-layout> 72454 <sonic-submit onEnterKey endpoint="accreditations/login" method="post"> 72455 <sonic-form-layout> 72456 <sonic-input type="email" label=${t("email")} name="mail" placeholder="[email protected]"></sonic-input> 72457 <sonic-input 72458 type="text" 72459 label="${t("accreditation_number")}" 72460 name="number" 72461 placeholder="- - - - -" 72462 ></sonic-input> 72463 </sonic-form-layout> 72464 </sonic-submit> 72465 <sonic-form-actions> 72466 <sonic-submit onClick endpoint="accreditations/login" method="post"> 72467 <sonic-button radio noAutoFill type="success"> 72468 <sonic-icon slot="prefix" name="check"></sonic-icon> 72469 ${t("confirm")} 72470 </sonic-button> 72471 </sonic-submit> 72472 </sonic-form-actions> 72473 </sonic-form-layout> 72474 </sonic-fieldset> 72475 </form> 72476 `; 72477 } 72478 showAccreditationsList() { 72479 return b$1` 72480 <!-- Connecté - Bouton déconnexion --> 72481 ${this.showHeader()} 72482 <sonic-divider class="mt-5 mb-8"></sonic-divider> 72483 <div 72484 formDataProvider="accreditationsFilters" 72485 dataProvider="accreditationsFilters" 72486 class="flex flex-wrap gap-3 mb-8 max-w-[40rem]" 72487 > 72488 <sonic-input inlineContent name="search" type="search" placeholder="${t("Search...")}" class="grow"> 72489 <sonic-icon library="custom" name="magnifying-glass" slot="prefix"></sonic-icon> 72490 </sonic-input> 72491 72492 <!-- Récupération des types de structure pour remplir le select --> 72493 <sonic-fetch 72494 endpoint="/accreditations/structures_types" 72495 dataProvider="optionsAccreditationsTypes" 72496 key="data" 72497 ></sonic-fetch> 72498 ${this.optionsAccreditationsTypes?.length ? b$1` <sonic-select 72499 name="structureTypeID" 72500 valueKey="id" 72501 wordingKey="title" 72502 class="min-w-[15rem]" 72503 .options=${[{ id: "", title: t("accreditation_structure_types") }, ...this.optionsAccreditationsTypes]} 72504 ></sonic-select>` : A$1} 72505 <!-- TODO ajouter un sorter --> 72506 </div> 72507 72508 <sonic-queue 72509 dataProvider="accreditations" 72510 dataFilterProvider="accreditationsFilters" 72511 dataProviderExpression="/accreditations?offset=$offset&limit=$limit" 72512 key="data" 72513 class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4" 72514 > 72515 <template data-value="no-item"> 72516 <sonic-no-result></sonic-no-result> 72517 </template> 72518 <template> 72519 <accreditation-card formDataProvider="accreditationsFilters"></accreditation-card> 72520 </template> 72521 <template data-value="skeleton"> 72522 <accreditation-card formDataProvider="accreditationsFilters" skeleton></accreditation-card> 72523 </template> 72524 </sonic-queue> 72525 72526 ${this.showContactModal()} 72527 `; 72528 } 72529 showHeader() { 72530 return b$1`<div class=" flex gap-x-5 items-center flex-wrap"> 72531 <div> 72532 <div class="text-sm ">${t("LIB_connected_as")} :</div> 72533 <div> 72534 <sonic-icon library="custom" name="id-card"></sonic-icon>
72535 <span class="font-bold"> 72536 ${this.currentAccreditation?.firstName} ${this.currentAccreditation?.lastName} â N° 72537 ${this.currentAccreditation?.number}</span 72538 > 72539 </div> 72540 </div> 72541 72542 <sonic-button @click=${() => this.handleLogout()} size="inherit" variant="outline" class="text-xs lg:text-sm"> 72543 <sonic-icon library="custom" name="arrow-right-arrow-left"></sonic-icon> 72544 ${t("LIB_switch")} 72545 </sonic-button> 72546 </div> `; 72547 } 72548 showContactModal() { 72549 if (!this.accreditationContact?.contact) { 72550 return A$1; 72551 } 72552 return b$1` <sonic-modal @hidden="${this.unsetAccreditationContact}" visible width="36rem"> 72553 <sonic-modal-title class="flex gap-2" 72554 ><sonic-icon library="custom" name="envelope" size="lg"></sonic-icon> ${t("LIB_annuaire_contacter")} 72555 ${this.accreditationContact.firstName} ${this.accreditationContact.lastName}</sonic-modal-title 72556 > 72557 72558 <accreditation-card 72559 dataProvider="accreditationContact" 72560 noContactButton 72561 class="pointer-events-none w-full mb-4" 72562 ></accreditation-card> 72563 72564 <form formDataProvider="accreditationContactForm" class="w-full"> 72565 <sonic-fieldset label="${t("LIB_annuaire_your_information")}"> 72566 <sonic-form-layout> 72567 <sonic-input 72568 required 72569 type="email" 72570 name="mail" 72571 label="${t("email")}" 72572 value="${this.currentAccreditation?.email}" 72573 ></sonic-input> 72574 <sonic-input 72575 required 72576 name="fullname" 72577 label="${t("LIB_annuaire_full_name")}" 72578 placeholder="${t("LIB_annuaire_full_name_placeholder")}" 72579 value="${this.currentAccreditation?.firstName} ${this.currentAccreditation?.lastName}" 72580 ></sonic-input> 72581 <sonic-textarea 72582 required 72583 name="message" 72584 label="${t("LIB_annuaire_your_message")}" 72585 resize="vertical" 72586 ></sonic-textarea> 72587 <sonic-input type="hidden" name="contact" value="${this.accreditationContact.contact}"></sonic-input> 72588 </sonic-form-layout> 72589 </sonic-fieldset> 72590 <sonic-form-actions> 72591 <sonic-submit 72592 endPoint="/accreditations/contact" 72593 method="POST" 72594 submitResultDataProvider="accreditationContactResult" 72595 onclick 72596 > 72597 <sonic-button type="neutral"> 72598 <sonic-icon library="custom" name="paper-plane"></sonic-icon> 72599 ${t("LIB_annuaire_send")} 72600 </sonic-button> 72601 </sonic-submit> 72602 </sonic-form-actions> 72603 </form> 72604 </sonic-modal>`; 72605 } 72606 handleLogout() { 72607 const api2 = new API(HTML.getApiConfiguration(this)); 72608 api2.get(`/accreditations/logout`).then(() => { 72609 dp(`currentAccreditation`).invalidate(); 72610 }); 72611 } 72612 unsetAccreditationContact() { 72613 dp(`accreditationContact`).set({}); 72614 } 72615 }; 72616 SonicAccreditationsDirectory.styles = [tailwind]; 72617 __decorateClass$3([ 72618 n$5({ type: Boolean }) 72619 ], SonicAccreditationsDirectory.prototype, "displayTitle", 2); 72620 __decorateClass$3([ 72621 n$5({ type: Boolean }) 72622 ], SonicAccreditationsDirectory.prototype, "displayText", 2); 72623 __decorateClass$3([ 72624 bind$1("currentAccreditation.data"), 72625 r$5() 72626 ], SonicAccreditationsDirectory.prototype, "currentAccreditation", 2); 72627 __decorateClass$3([ 72628 bind$1("accreditationContact"), 72629 r$5() 72630 ], SonicAccreditationsDirectory.prototype, "accreditationContact", 2); 72631 __decorateClass$3([ 72632 bind$1("optionsAccreditationsTypes"), 72633 r$5() 72634 ], SonicAccreditationsDirectory.prototype, "optionsAccreditationsTypes", 2); 72635 SonicAccreditationsDirectory = __decorateClass$3([ 72636 t$3(tagName$1) 72637 ], SonicAccreditationsDirectory); 72638 var __defProp$2 = Object.defineProperty; 72639 var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor; 72640 var __decorateClass$2 = (decorators, target, key, kind) => { 72641 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target; 72642 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72643 if (decorator = decorators[i2]) 72644 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72645 if (kind && result) __defProp$2(target, key, result); 72646 return result; 72647 }; 72648 const tagName = "sonic-default-router"; 72649 let SonicDefaultRouter = class extends Subscriber$1(i$6) { 72650 constructor() { 72651 super(...arguments); 72652 this.defaultRoutes = defaultAppRoutes; 72653 } 72654 getRouterRoutes() { 72655 const routes = this.defaultRoutes; 72656 const routerRoutes = { 72657 // -- PANIER 72658 [routes.cart]: () => b$1`<sonic-cart></sonic-cart>`, 72659 // -- PLACEMENT 72660 [routes.seatmap]: ({ slug }) => { 72661 const id = idFromSlug(slug); 72662 const endpoint = entityEndPoint({ 72663 entityType: EntityType.Event, 72664 entityId: Number(id), 72665 view: entityView.full 72666 }); 72667 return b$1`<sonic-fetch dataProvider="default/seatmap/view" endpoint=${endpoint} key="data" 72668 ><sonic-seatmap></sonic-seatmap 72669 ></sonic-fetch>`; 72670 }, 72671 // -- AGENDA 72672 [`${routes.agenda}$`]: () => b$1` 72673 <sonic-modal visible removeHashOnHide maxWidth="95vw"> 72674 <sonic-modal-content><sonic-agenda></sonic-agenda></sonic-modal-content> 72675 </sonic-modal> 72676 `, 72677 // -- INFOS PRICES 72678 [`${routes.infosPrices}$`]: () => b$1` 72679 <sonic-modal visible removeHashOnHide maxWidth="42rem"> 72680 <sonic-modal-content 72681 ><sonic-infos-prices displayTitle smallTitle displayText></sonic-infos-prices 72682 ></sonic-modal-content> 72683 </sonic-modal> 72684 `, 72685 // -- RECUPERER UNE COMMANDE 72686 [`${routes.orderRecover}$`]: () => b$1` 72687 <sonic-modal visible removeHashOnHide maxWidth="42rem"> 72688 <sonic-modal-content 72689 ><sonic-order-recover displayTitle smallTitle displayText></sonic-order-recover 72690 ></sonic-modal-content> 72691 </sonic-modal> 72692 `, 72693 // -- CARTE CADEAU 72694 [`${routes.giftcards}$`]: () => b$1` 72695 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="60rem"> 72696 <sonic-modal-content 72697 ><sonic-giftcards displayTitle smallTitle displayText></sonic-giftcards 72698 ></sonic-modal-content> 72699 </sonic-modal> 72700 `, 72701 // -- CODE PROMO 72702 [`${routes.promo}$`]: () => b$1` 72703 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="30rem"> 72704 <sonic-modal-content><sonic-promo displayTitle smallTitle></sonic-promo></sonic-modal-content> 72705 </sonic-modal> 72706 `, 72707 // -- DEMANDE DE REMBOURSEMENT 72708 [`${routes.refund}$`]: () => b$1` 72709 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="42rem"> 72710 <sonic-modal-content><sonic-refund displayTitle displayText></sonic-refund></sonic-modal-content> 72711 </sonic-modal> 72712 `, 72713 // -- ABONNEMENT 72714 [`${routes.subscription}$`]: () => b$1` 72715 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="90rem"> 72716 <sonic-modal-content><sonic-subscription displayTitle displayText></sonic-subscription></sonic-modal-content> 72717 </sonic-modal> 72718 `, 72719 // -- ÃVÃNEMENT 72720 [routes.event]: ({ slug }) => { 72721 const id = idFromSlug(slug); 72722 const endpoint = entityEndPoint({ 72723 entityType: "show", 72724 entityId: Number(id), 72725 view: entityView.essential, 72726 next: true, 72727 customSearchParams: new URLSearchParams({ 72728 clean_sessions_data: "true" 72729 }) 72730 }); 72731 return b$1` 72732 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="100rem"> 72733 <sonic-modal-content> 72734 <sonic-fetch dataProvider=${endpoint} key="data"> 72735 <sonic-event-page noRelated noNavigation></sonic-event-page> 72736 </sonic-fetch> 72737 </sonic-modal-content> 72738 </sonic-modal> 72739 `; 72740 }, 72741 // -- LISTE D'ATTENTE 72742 [`${routes.waitingList}`]: ({ id }) => { 72743 return b$1` 72744 <sonic-modal visible forceAction removeHashOnHide maxWidth="60rem"> 72745 <sonic-modal-content> 72746 <sonic-waiting-list-form .requestId=${Number(id)}></sonic-waiting-list-form> 72747 </sonic-modal-content> 72748 </sonic-modal> 72749 `; 72750 }, 72751 // -- LIBÃRER UNE PLACE GRATUITE 72752 [`${routes.freeup}$`]: () => b$1` 72753 <sonic-modal visible removeHashOnHide maxWidth="38rem"> 72754 <sonic-modal-content 72755 ><sonic-ticket-freeup displayTitle smallTitle displayText></sonic-ticket-freeup 72756 ></sonic-modal-content> 72757 </sonic-modal> 72758 `, 72759 // -- CAMPAIGN 72760 [routes.campaign]: () => b$1`<sonic-campaign></sonic-campaign>`, 72761 // -- DEMANDE DE COMPTE PRO 72762 [`${routes.askProAccount}$`]: () => b$1` 72763 <sonic-modal visible removeHashOnHide maxWidth="42rem"> 72764 <sonic-modal-content 72765 ><sonic-ask-pro-account displayTitle smallTitle displayText></sonic-ask-pro-account 72766 ></sonic-modal-content> 72767 </sonic-modal> 72768 `, 72769 // -- LISTE d'attente 72770 [routes.customList]: ({ slug }) => b$1` 72771 <sonic-custom-list dataProvider="custom-list/${slug}"></sonic-custom-list> 72772 `, 72773 // -- CHANGER DE MOT DE PASSE 72774 [routes.changePassword]: () => { 72775 const searchParams = new URLSearchParams(window.location.search); 72776 const hashFromUrl = searchParams.get("sonic_hash"); 72777 return b$1` 72778 <sonic-redirect 72779 to="./" 72780 pushState 72781 dataprovider="change-password-result" 72782 subDataProvider="_sonic_http_response_" 72783 ondata="ok" 72784 ></sonic-redirect> 72785 <sonic-modal addHTTPResponse visible removeHashOnHide maxWidth="42rem"> 72786 <sonic-modal-content> 72787 <div dataProvider="sonic-wording"> 72788 <sonic-page-header label="${t("my_password")}"></sonic-page-header> 72789 </div> 72790 <sonic-sdui 72791 fetch 72792 sduiKey="data" 72793 dataProvider="sdui-provider" 72794 submitResultDataProvider="change-password-result" 72795 endPoint="/user/form/change-password/${hashFromUrl ?? ""}" 72796 headersDataProvider="ticketsAppHeadersProvider" 72797 ></sonic-sdui> 72798 </sonic-modal-content> 72799 </sonic-modal> 72800 `; 72801 },
72802 [routes["checkout.end"]]: () => b$1` 72803 <sonic-modal visible removeHashOnHide maxWidth="42rem"> 72804 <sonic-modal-content> 72805 <sonic-checkout-process-end></sonic-checkout-process-end> 72806 </sonic-modal-content> 72807 </sonic-modal> 72808 `, 72809 [routes.carpooling]: () => b$1` 72810 <sonic-fullscreen-layout> 72811 <sonic-carpooling></sonic-carpooling> 72812 </sonic-fullscreen-layout> 72813 `, 72814 [routes.accreditationsDirectory]: () => b$1` 72815 <sonic-fullscreen-layout> 72816 <sonic-accreditations-directory></sonic-accreditations-directory> 72817 </sonic-fullscreen-layout> 72818 `, 72819 // -- STORE 72820 [routes.store]: () => b$1` 72821 <sonic-modal visible removeHashOnHide maxWidth="90rem"> 72822 <sonic-modal-content> 72823 <sonic-event-store displayTitle displayText formDataProvider="defaultEventStoreFilters"></sonic-event-store> 72824 </sonic-modal-content> 72825 </sonic-modal> 72826 `, 72827 // -- DEMANDE DE RÃSERVATION 72828 [routes.reservationRequest]: () => b$1` 72829 <sonic-modal visible removeHashOnHide maxWidth="95vw" height="90vh"> 72830 <sonic-modal-content> 72831 <sonic-reservation-request displayText displayTitle smallTitle></sonic-reservation-request> 72832 </sonic-modal-content> 72833 </sonic-modal> 72834 `, 72835 // -- SHOP 72836 [`${routes.shop}$`]: () => b$1` 72837 <sonic-modal visible removeHashOnHide maxWidth="90rem"> 72838 <sonic-modal-content><sonic-shop displayTitle displayText noRouting></sonic-shop></sonic-modal-content> 72839 </sonic-modal> 72840 `, 72841 // -- MERCH 72842 [routes.merch]: ({ slug }) => { 72843 const id = idFromSlug(slug); 72844 const endpoint = entityEndPoint({ 72845 entityType: EntityType.Merch, 72846 entityId: Number(id), 72847 view: entityView.full 72848 }); 72849 return b$1` 72850 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="60rem"> 72851 <sonic-modal-content> 72852 <sonic-fetch key="data" dataProvider=${endpoint}> 72853 <sonic-merch displayTitle displayText></sonic-merch> 72854 </sonic-fetch> 72855 </sonic-modal-content> 72856 </sonic-modal> 72857 `; 72858 } 72859 }; 72860 if (!this.customRoutes?.["account"]) { 72861 routerRoutes[routes.account] = () => b$1`<sonic-account></sonic-account>`; 72862 } 72863 return routerRoutes; 72864 } 72865 render() { 72866 return b$1`<sonic-router .routes=${this.getRouterRoutes()}></sonic-router>`; 72867 } 72868 }; 72869 __decorateClass$2([ 72870 n$5({ type: Object }) 72871 ], SonicDefaultRouter.prototype, "defaultRoutes", 2); 72872 __decorateClass$2([ 72873 n$5({ type: Object }) 72874 ], SonicDefaultRouter.prototype, "customRoutes", 2); 72875 SonicDefaultRouter = __decorateClass$2([ 72876 t$3(tagName), 72877 awaitConnectedAncestors(APP_TAG_SELECTOR) 72878 ], SonicDefaultRouter); 72879 const cleanCartMessages = (result) => { 72880 const muteCartSuccessMessages = dp("toastSettings").muteCartSuccessMessages?.get() ? true : false; 72881 const counterContext = document.querySelector("sonic-counter-app"); 72882 const isIframeContext = window.self !== window.top; 72883 if (!muteCartSuccessMessages && !counterContext && !isIframeContext) { 72884 return result; 72885 } 72886 const textToExclude = [ 72887 "ajouté au panier", 72888 "retiré du panier", 72889 "mis à jour dans votre panier", 72890 "has been added to the cart", 72891 "has been removed from the cart", 72892 "has been updated in your cart", 72893 "wurde dem Warenkorb hinzugefügt", 72894 "wurde aus dem Warenkorb entfernt", 72895 "wurde in Ihrem Warenkorb aktualisiert", 72896 "toegevoegd aan het mandje", 72897 "verwijderd uit het mandje", 72898 "bijgewerkt in uw mandje" 72899 ]; 72900 if (result?.messages && result.messages?.length > 0) { 72901 result.messages = result.messages.filter((message) => { 72902 const messageContent = message?.content?.toLowerCase(); 72903 if (messageContent) { 72904 return !textToExclude.some((term) => messageContent.includes(term.toLowerCase())); 72905 } 72906 return true; 72907 }); 72908 } 72909 return result; 72910 }; 72911 dp("sonic-api").lastResponse.processed.onAssign((processed) => { 72912 if (processed?.data && "cartType" in processed.data) { 72913 processed = cleanCartMessages(processed); 72914 } 72915 const hasSuccessMessage = processed?.messages?.some((message) => message.status === "success"); 72916 if (hasSuccessMessage && typeof SonicToast !== "undefined") { 72917 SonicToast.removeTemporaryItems(); 72918 } 72919 set("defaultMessages", processed); 72920 }); 72921 (() => { 72922 const seq = ["ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight", "b", "a"]; 72923 let idx = 0; 72924 window.addEventListener("keydown", (e2) => {
72925 const k2 = e2.key.length === 1 ? e2.key.toLowerCase() : e2.key; 72926 const target = seq[idx].length === 1 ? seq[idx].toLowerCase() : seq[idx]; 72927 if (k2 === target) { 72928 idx++; 72929 if (idx === seq.length) { 72930 idx = 0; 72931 if (!document.getElementById("guichet-easter-egg-script")) { 72932 const s2 = document.createElement("script"); 72933 s2.id = "guichet-easter-egg-script"; 72934 s2.src = `/sites/all/modules/la-billetterie/traitements/mockups/guichet_easter_egg.js?v=${Date.now()}`; 72935 document.body.appendChild(s2); 72936 } 72937 } 72938 } else { 72939 idx = 0; 72940 } 72941 }); 72942 })(); 72943 var __defProp$1 = Object.defineProperty; 72944 var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor; 72945 var __decorateClass$1 = (decorators, target, key, kind) => { 72946 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target; 72947 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72948 if (decorator = decorators[i2]) 72949 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72950 if (kind && result) __defProp$1(target, key, result); 72951 return result; 72952 }; 72953 let SonicReservationSummary = class extends Fetcher$1(Subscriber$1(i$6)) { 72954 constructor() { 72955 super(...arguments); 72956 this.skeleton = false; 72957 this.can_split = false; 72958 this.showLastQuote = false; 72959 } 72960 // @property({type: String, attribute: "data-id"}) id = ""; 72961 connectedCallback() { 72962 this.isFetchEnabled = this.hasAttribute("fetch"); 72963 this.setAttribute("invalidateOnPageShow", "invalidateOnPageShow"); 72964 super.connectedCallback(); 72965 } 72966 willUpdate(_changedProperties) { 72967 if (_changedProperties.has("props")) { 72968 this.can_split = !isLockedForever(this.props?.status ?? ReservationStatus.Draft) && !isRequest(this.props?.cartType); 72969 } 72970 } 72971 renderSkeleton() { 72972 return b$1`<div class="flex @container py-6"> 72973 <div 72974 class="animate-pulse flex-grow grid @3xl:grid-cols-[8.4rem_10rem_1fr_auto] @5xl:grid-cols-[8.4rem_20rem_1fr_auto] gap-3 @5xl:gap-7 min-w-0" 72975 > 72976 <div class=""> 72977 <div class=" w-20 h-4 bg-neutral-100 rounded mb-1"></div> 72978 <div class=" w-10 h-3 bg-neutral-100 rounded"></div> 72979 </div> 72980 <div> 72981 <div class=" w-20 h-4 bg-neutral-100 rounded mb-1"></div> 72982 <div class=" w-30 h-4 bg-neutral-100 rounded"></div> 72983 </div> 72984 <div> 72985 <div class="flex h-6"> 72986 <div class=" w-30 h-4 bg-neutral-200 rounded mb-1"></div> 72987 <div class=" w-30 h-6 bg-neutral-200 rounded mb-1 ml-auto"></div> 72988 </div> 72989 <div class="mb-[2px] w-full border-t border-t-neutral-200"></div> 72990 </div> 72991 </div> 72992 <div class="ml-auto text-right"> 72993 <div class=" w-9 h-9 bg-neutral-100 rounded-full"></div> 72994 </div> 72995 </div>`; 72996 } 72997 render() { 72998 if (this.skeleton) { 72999 return this.renderSkeleton(); 73000 } 73001 if (!this.props?.id) { 73002 return A$1; 73003 } 73004 let routeName = "reservation"; 73005 if (isWaitingList(this.props?.cartType)) { 73006 routeName = "admin.waitingList"; 73007 } else if (isReservationRequest(this.props?.cartType)) { 73008 routeName = "admin.reservation-request"; 73009 } 73010 return b$1`<div class="flex @container py-4 text-sm"> 73011 <div 73012 class="flex-grow grid @3xl:grid-cols-[8.4rem_10rem_1fr_auto] @5xl:grid-cols-[8.4rem_20rem_1fr_auto] gap-3 @5xl:gap-7 min-w-0" 73013 > 73014 <div> 73015 <div class="font-bold text-sm uppercase">N° ${getCartNumber(this.props)}</div> 73016 <sonic-date 73017 date="${this.props?.created_at}" 73018 class="leading-none w-20 inline-block whitespace-nowrap" 73019 day="2-digit" 73020 weekday="hidden" 73021 month="2-digit" 73022 > 73023 </sonic-date> 73024 73025 <div class="mt-2"> 73026 ${isInitialRequest(this.props) ? b$1`<sonic-badge type="neutral" class="mb-1" size="xs"> 73027 <sonic-icon name="circle-info" library="custom"></sonic-icon> 73028 ${t("initial_request")} 73029 </sonic-badge>` : A$1} 73030 73031 <sonic-reservation-status size="xs"></sonic-reservation-status> 73032 73033 ${this.currentQuoteInfos()} 73034 ${displayExpired(this.props?.status ?? ReservationStatus.Draft) ? b$1`<sonic-cart-remaining-time class=" mt-1" badge></sonic-cart-remaining-time> ` : A$1} 73035 </div> 73036 ${this.props.canCheckout === false ? b$1`<sonic-tooltip label="${t("cart_payement_buttons_error_reservation")}" class="my-2 mx-2"> 73037 <sonic-icon 73038 name="triangle-exclamation" 73039 library="custom" 73040 class="text-danger " 73041 size="xl" 73042 tabindex="0" 73043 ></sonic-icon> 73044 </sonic-tooltip>` : A$1} 73045 ${this.props?.passCulture?.enabled ? b$1`<div class="mt-2"> 73046 <sonic-tooltip label="Prise en charge pass culture"> 73047 ${svgPassCulture({ 73048 color: "currentColor" 73049 })} 73050 </sonic-tooltip> 73051 </div>` : A$1} 73052 </div> 73053 <div> 73054 <sonic-user-info subDataProvider="buyer"></sonic-user-info> 73055 73056 ${this.props?.publicNotes ? b$1`<div class="hidden @5xl:flex my-3 gap-x-2 text-info items-start"> 73057 <sonic-icon name="comment" library="custom" class="shrink-0" size="lg" prefix="light"></sonic-icon> 73058 <div class=" text-xs leading-tight" style="overflow-wrap: break-word;word-break:break-word"> 73059 <div class="whitespace-pre-line">${this.props.publicNotes}</div> 73060 </div> 73061 </div>` : A$1} 73062 ${this.props?.admin && this.props?.admin.id !== 1 ? b$1` 73063 <div class="hidden mt-3 mb-3 gap-2 @3xl:flex @5xl:flex"> 73064 <sonic-icon name="face-smile" library="custom" class="shrink-0" size="lg" prefix="light"></sonic-icon> 73065 <div> 73066 <div class="text-2xs text-neutral-500 uppercase">Opérateur</div> 73067 <div class="font-bold">${this.props.admin.name}</div> 73068 </div> 73069 </div> 73070 ` : A$1} 73071 ${this.props?.notes ? b$1`<div class="hidden @5xl:flex gap-x-2 text-info items-start"> 73072 <sonic-icon 73073 name="comment-exclamation" 73074 library="custom" 73075 class="shrink-0" 73076 size="lg" 73077 prefix="light" 73078 ></sonic-icon> 73079 <div class=" text-xs leading-tight " style="overflow-wrap: break-word;word-break:break-word"> 73080 <div class="whitespace-pre-line">${this.props.notes}</div> 73081 </div> 73082 </div>` : A$1} 73083 </div> 73084 <div class="@5xl:pl-4 justify-center"> 73085 ${this.props?.title ? b$1`<div class="text-lg font-bold mb-2">${this.props.title}</div>` : A$1} 73086 <sonic-cart-items-condensed mode="readonly"></sonic-cart-items-condensed> 73087 ${this.renderLastQuote()} 73088 </div> 73089 </div> 73090 <div class="ml-auto text-right flex flex-col gap-2 items-center"> 73091 <sonic-tooltip label="Modifier"> 73092 <sonic-app-link 73093 variant="default" 73094 shape="circle" 73095 type="neutral" 73096 to=${routeName} 73097 .id="${this.props.id.toString()}" 73098 size="sm" 73099 ><sonic-icon name="pen" library="custom"></sonic-icon 73100 ></sonic-app-link> 73101 </sonic-tooltip> 73102 73103 ${this.can_split ? b$1`<sonic-tooltip label="Retrait partiel" placement="bottom"> 73104 <sonic-app-link 73105 icon 73106 variant="outline" 73107 shape="circle" 73108 type="neutral" 73109 to=${routeName} 73110 .id="${this.props.id.toString()}" 73111 .query=${{ display_split: true }} 73112 size="xs" 73113 ><sonic-icon name="split" library="custom"></sonic-icon 73114 ></sonic-app-link> 73115 </sonic-tooltip>` : A$1} 73116 </div> 73117 </div>`; 73118 } 73119 toggleLastQuote() { 73120 this.showLastQuote = !this.showLastQuote; 73121 } 73122 currentQuoteInfos() { 73123 const currentQuote = this.props?.quotes?.current; 73124 if (!currentQuote?.email_history?.length) return A$1; 73125 const { email_history } = currentQuote; 73126 const hasPaymentLink = email_history.some((item) => item.has_payment_link); 73127 const hasQuote = email_history.length > 0; 73128 if (!hasPaymentLink && !hasQuote) return A$1; 73129 return b$1`<div class="flex items-center gap-x-5 gap-y-1 text-sm flex-wrap my-3 text-info"> 73130 ${hasQuote ? b$1`<sonic-badge type="info" variant="ghost" class="flex items-start gap-[.35em] text-xs"> 73131 <sonic-icon name="envelope-open-text" library="custom"></sonic-icon> ${getQuoteTypeLabel( 73132 this.props?.cartType 73133 )} 73134 envoyé 73135 </sonic-badge>` : A$1} 73136 ${hasPaymentLink ? b$1`<sonic-badge type="info" variant="ghost" class="flex items-start gap-[.35em] text-xs"> 73137 <sonic-icon name="square-arrow-up-right" library="custom"></sonic-icon> Lien de paiement envoyé 73138 </sonic-badge>` : A$1} 73139 </div>`; 73140 } 73141 renderLastQuote() { 73142 if (isRequest(this.props?.cartType)) return A$1; 73143 const lastQuote = this.props?.quotes?.current || this.props?.quotes?.all?.[0]; 73144 const isPendingOrConfirmed = this.props?.status === ReservationStatus.Pending || this.props?.status === ReservationStatus.Confirmed || this.props?.status === ReservationStatus.Submitted; 73145 const lastQuotePrefix = isPendingOrConfirmed ? "Devis en cours" : "Dernier devis"; 73146 const renderLastQuote = lastQuote && this.props?.status !== ReservationStatus.Draft; 73147 if (!renderLastQuote) return A$1; 73148 return b$1` 73149 <div class="flex gap-3 items-center mt-5 mb-3 "> 73150 <sonic-button 73151 @click=${() => this.toggleLastQuote()} 73152 variant="outline" 73153 size="xs" 73154 class="shrink-0 ${isPendingOrConfirmed ? "pointer-events-none" : ""}" 73155 ><span class="font-bold">${lastQuotePrefix} : ${lastQuote.title}</span> 73156 ${!isPendingOrConfirmed ? b$1`<sonic-icon 73157 name=${this.showLastQuote ? "chevron-up" : "chevron-down"} 73158 class="ml-2" 73159 library="custom" 73160 ></sonic-icon>` : A$1} 73161 </sonic-button> 73162 <div class="border-t w-full"></div> 73163 </div> 73164 ${this.showLastQuote ? b$1`<sonic-cart-items-condensed class="mb-2 " subDataProvider="quotes.all.0"></sonic-cart-items-condensed>` : A$1} 73165 `; 73166 } 73167 }; 73168 SonicReservationSummary.styles = [ 73169 tailwind, 73170 i$9` 73171 :host([skeleton]) { 73172 min-height: 8rem; 73173 display: block; 73174 } 73175 ` 73176 ]; 73177 __decorateClass$1([ 73178 n$5({ type: Boolean }) 73179 ], SonicReservationSummary.prototype, "skeleton", 2); 73180 __decorateClass$1([ 73181 r$5() 73182 ], SonicReservationSummary.prototype, "can_split", 2); 73183 __decorateClass$1([ 73184 r$5() 73185 ], SonicReservationSummary.prototype, "showLastQuote", 2); 73186 SonicReservationSummary = __decorateClass$1([ 73187 t$3("sonic-reservation-summary") 73188 ], SonicReservationSummary); 73189 var __defProp = Object.defineProperty; 73190 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 73191 var __decorateClass = (decorators, target, key, kind) => { 73192 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; 73193 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 73194 if (decorator = decorators[i2]) 73195 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 73196 if (kind && result) __defProp(target, key, result); 73197 return result; 73198 }; 73199 let SonicUserCartList = class extends i$6 { 73200 constructor() { 73201 super(...arguments); 73202 this.userId = 0; 73203 this.userEmail = ""; 73204 this.cartType = CartType.Cart; 73205 this.dataProviderExpression = ""; 73206 this._count = 0; 73207 this.statuses = [ 73208 ReservationStatus.Pending, 73209 ReservationStatus.Confirmed, 73210 ReservationStatus.Processing, 73211 ReservationStatus.Submitted, 73212 ReservationStatus.Declined, 73213 ReservationStatus.PartiallyProcessed, 73214 ReservationStatus.Draft 73215 ]; 73216 } 73217 async willUpdate(changedProperties) { 73218 if (changedProperties.has("userId")) { 73219 this.dataProviderExpression = getCartEndpoint({ 73220 type: this.cartType, 73221 userId: this.userId, 73222 statuses: this.statuses, 73223 isQueue: true 73224 }); 73225 await this.setCount(); 73226 } 73227 } 73228 async setCount() { 73229 const api2 = new API(HTML.getApiConfiguration(this)); 73230 const endpoint = getCartEndpoint({ 73231 type: this.cartType, 73232 userId: this.userId, 73233 statuses: this.statuses, 73234 isQueue: true, 73235 limit: 1 73236 }); 73237 const response = await api2.get(endpoint); 73238 this._count = response?.total ?? 0; 73239 } 73240 getTitle() { 73241 switch (this.cartType) { 73242 case CartType.WaitingLists: 73243 return "Listes d'attente"; 73244 case CartType.ReservationRequest: 73245 return "Demandes de réservation"; 73246 case CartType.Reservation: 73247 return "Réservations / Invitations"; 73248 case CartType.Cart: 73249 return "Paniers"; 73250 default: 73251 return "Paniers"; 73252 } 73253 } 73254 getCartTypeIconName() { 73255 switch (this.cartType) { 73256 case CartType.WaitingLists: 73257 return "list-ol"; 73258 case CartType.ReservationRequest: 73259 return "file-heart"; 73260 case CartType.Reservation: 73261 return "badge-check"; 73262 case CartType.Cart: 73263 return "shopping-basket"; 73264 default: 73265 return "cart"; 73266 } 73267 } 73268 getLinkHref() { 73269 if (!this.userEmail) { 73270 return void 0; 73271 } 73272 switch (this.cartType) { 73273 case CartType.WaitingLists: 73274 return appRoute("admin.waitingLists").query({ "reset-filtres": 1, nom_prenom_email: this.userEmail }); 73275 case CartType.ReservationRequest: 73276 return appRoute("admin.reservation-requests").query({ "reset-filtres": 1, nom_prenom_email: this.userEmail }); 73277 case CartType.Reservation: 73278 return appRoute("reservations").query({ "reset-filtres": 1, nom_prenom_email: this.userEmail }); 73279 } 73280 return void 0; 73281 } 73282 render() { 73283 return b$1`<div class="text-2xl font-normal mb-2 flex items-center gap-2"> 73284 <sonic-icon library="custom" name=${this.getCartTypeIconName()} variant="ghost" shape="circle"></sonic-icon> 73285 ${this._count} ${this.getTitle()}
73286 ${this.getLinkHref() ? b$1` <sonic-divider vertical></sonic-divider> 73287 <sonic-tooltip label="Voir tous"> 73288 <sonic-button shape="circle" variant="outline" icon size="xs" href=${this.getLinkHref()}> 73289 <sonic-icon library="custom" name="arrow-right" variant="ghost" shape="circle"></sonic-icon> 73290 </sonic-button> 73291 </sonic-tooltip>` : A$1} 73292 </div> 73293 ${this.renderQueue()}`; 73294 } 73295 renderQueue() { 73296 if (!this.dataProviderExpression || this._count === 0) { 73297 return A$1; 73298 } 73299 return b$1`<sonic-queue 73300 lazyload 73301 dataProviderExpression=${this.dataProviderExpression} 73302 key="data" 73303 class="border border-neutral-100 block rounded-md" 73304 .noItems=${() => b$1`<div class="text-neutral-500 bg-neutral-50 p-4 px-5 text-left text-lg rounded-md">Aucun résultat</div>`} 73305 .items=${(_item, metadata) => { 73306 const { firstChild, lastChild, odd } = metadata; 73307 return b$1`<sonic-reservation-summary 73308 class=" ${odd ? "bg-neutral-50" : ""} ${firstChild ? "rounded-t-md" : ""} ${lastChild ? "rounded-b-md" : ""} block p-2" 73309 ></sonic-reservation-summary>`; 73310 }} 73311 > 73312 </sonic-queue>`; 73313 } 73314 }; 73315 SonicUserCartList.styles = [tailwind]; 73316 __decorateClass([ 73317 n$5({ type: Number }) 73318 ], SonicUserCartList.prototype, "userId", 2); 73319 __decorateClass([ 73320 n$5({ type: String }) 73321 ], SonicUserCartList.prototype, "userEmail", 2); 73322 __decorateClass([ 73323 n$5({ type: String }) 73324 ], SonicUserCartList.prototype, "cartType", 2); 73325 __decorateClass([ 73326 r$5() 73327 ], SonicUserCartList.prototype, "dataProviderExpression", 2); 73328 __decorateClass([ 73329 r$5() 73330 ], SonicUserCartList.prototype, "_count", 2); 73331 SonicUserCartList = __decorateClass([ 73332 t$3("sonic-user-cart-list"), 73333 awaitConnectedAncestors(APP_TAG_SELECTOR) 73334 ], SonicUserCartList); 73335 const windowAny = window;
73336 windowAny["concordeIsLoaded"] = true; 73337 window.dispatchEvent(new CustomEvent("concorde-loaded")); 73338})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.