vendor: 8,767 bytes, lines 1-193
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;
vendor: 9,541 bytes, lines 1000-1248
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() {
vendor: 13,487 bytes, lines 1362-1730
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 = "Thu Sep 24 2026 10:46:17 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
vendor: 4,964 bytes, lines 2369-2482
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;
vendor: 6,114 bytes, lines 2858-3019
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;
vendor: 4,164 bytes, lines 4601-4738
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$2S = "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$2S) 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$2R = "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$2R) 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$2Q = "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$2Q) 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$2P = "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$2P) 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$2O = "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$2O) 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() {
vendor: 4,064 bytes, lines 6715-6819
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()
vendor: 5,388 bytes, lines 6820-6956
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$2N = "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;
vendor: 13,134 bytes, lines 7149-7597
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$2N) 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;
vendor: 4,295 bytes, lines 7802-7922
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$2M = "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$2M) 8182 ], Fetch); 8183 class Route {
vendor: 6,469 bytes, lines 8184-8389
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$3P = Object.defineProperty; 9157 var __getOwnPropDesc$3S = Object.getOwnPropertyDescriptor; 9158 var __decorateClass$3T = (decorators, target, key, kind) => { 9159 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3S(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$3P(target, key, result); 9164 return result; 9165 }; 9166 const tagName$2L = "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$3T([ 9260 n$5({ type: String }) 9261 ], SonicAppLink.prototype, "to", 2); 9262 __decorateClass$3T([ 9263 n$5({ type: String }) 9264 ], SonicAppLink.prototype, "slotActiveClass", 2); 9265 __decorateClass$3T([ 9266 n$5({ type: String }) 9267 ], SonicAppLink.prototype, "slotActiveAttribute", 2); 9268 __decorateClass$3T([ 9269 n$5({ type: String }) 9270 ], SonicAppLink.prototype, "slug", 2); 9271 __decorateClass$3T([ 9272 n$5({ type: String }) 9273 ], SonicAppLink.prototype, "hash", 2); 9274 __decorateClass$3T([ 9275 n$5({ type: Boolean }) 9276 ], SonicAppLink.prototype, "hideIfCurrentRoute", 2); 9277 __decorateClass$3T([ 9278 n$5({ type: Boolean }) 9279 ], SonicAppLink.prototype, "toShow", 2); 9280 __decorateClass$3T([ 9281 n$5({ type: Boolean }) 9282 ], SonicAppLink.prototype, "alwaysDisplay", 2); 9283 __decorateClass$3T([ 9284 n$5({ type: Object }) 9285 ], SonicAppLink.prototype, "query", 2); 9286 __decorateClass$3T([ 9287 bind$1("admin/current.data.permissions"), 9288 r$5() 9289 ], SonicAppLink.prototype, "currentAdminPermissions", 2); 9290 __decorateClass$3T([ 9291 bind$1("settings.modules"), 9292 r$5() 9293 ], SonicAppLink.prototype, "modulesSettings", 2); 9294 __decorateClass$3T([ 9295 c({ context: appType, subscribe: true }) 9296 ], SonicAppLink.prototype, "appType", 2); 9297 __decorateClass$3T([ 9298 o$8({ flatten: true }) 9299 ], SonicAppLink.prototype, "_slottedItems", 2); 9300 __decorateClass$3T([ 9301 r$5() 9302 ], SonicAppLink.prototype, "isEnabled", 2); 9303 SonicAppLink = __decorateClass$3T([ 9304 t$3(tagName$2L), 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$2K = "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$2K) 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$2J = "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$2J) 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$2I = "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$2I) 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$2H = "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$2H) 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$2G = "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$2G) 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 }
vendor: 5,780 bytes, lines 9510-9665
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$2F = "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$2F); 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$2F) 10039 ], Modal); 10040 if (typeof window !== "undefined") { 10041 window.SonicModal = Modal; 10042 } 10043 var __defProp$3O = Object.defineProperty; 10044 var __getOwnPropDesc$3R = Object.getOwnPropertyDescriptor; 10045 var __decorateClass$3S = (decorators, target, key, kind) => { 10046 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3R(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$3O(target, key, result); 10051 return result; 10052 }; 10053 const tagName$2E = "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$3S([ 10121 bind$1("settings.prefer_website"), 10122 n$5({ type: Boolean }) 10123 ], SonicPreferWebsiteMessage.prototype, "preferWebsite", 2); 10124 __decorateClass$3S([ 10125 r$5() 10126 ], SonicPreferWebsiteMessage.prototype, "continueNavigation", 2); 10127 SonicPreferWebsiteMessage = __decorateClass$3S([ 10128 t$3(tagName$2E) 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\\.5rem\\] { 12438 min-height: 3.5rem; 12439} 12440.min-h-\\[3\\.8rem\\] { 12441 min-height: 3.8rem; 12442} 12443.min-h-\\[300px\\] { 12444 min-height: 300px; 12445} 12446.min-h-\\[32rem\\] { 12447 min-height: 32rem; 12448} 12449.min-h-\\[3rem\\] { 12450 min-height: 3rem; 12451} 12452.min-h-\\[40rem\\] { 12453 min-height: 40rem; 12454} 12455.min-h-\\[40vh\\] { 12456 min-height: 40vh; 12457} 12458.min-h-\\[4rem\\] { 12459 min-height: 4rem; 12460} 12461.min-h-\\[5rem\\] { 12462 min-height: 5rem; 12463} 12464.min-h-\\[6rem\\] { 12465 min-height: 6rem; 12466} 12467.min-h-\\[7\\.5rem\\] { 12468 min-height: 7.5rem; 12469} 12470.min-h-\\[7rem\\] { 12471 min-height: 7rem; 12472} 12473.min-h-\\[8\\.1rem\\] { 12474 min-height: 8.1rem; 12475} 12476.min-h-\\[8rem\\] { 12477 min-height: 8rem; 12478} 12479.min-h-full { 12480 min-height: 100%; 12481} 12482.w-1 { 12483 width: 0.25rem; 12484} 12485.w-1\\/2 { 12486 width: 50%; 12487} 12488.w-1\\/3 { 12489 width: 33.333333%; 12490} 12491.w-10 { 12492 width: 2.5rem; 12493} 12494.w-10\\/12 { 12495 width: 83.333333%; 12496} 12497.w-12 { 12498 width: 3rem; 12499} 12500.w-16 { 12501 width: 4rem; 12502} 12503.w-2\\/3 { 12504 width: 66.666667%; 12505} 12506.w-20 { 12507 width: 5rem; 12508} 12509.w-28 { 12510 width: 7rem; 12511} 12512.w-3 { 12513 width: 0.75rem; 12514} 12515.w-32 { 12516 width: 8rem; 12517} 12518.w-4\\/5 { 12519 width: 80%; 12520} 12521.w-5 { 12522 width: 1.25rem; 12523} 12524.w-56 { 12525 width: 14rem; 12526} 12527.w-6 { 12528 width: 1.5rem; 12529} 12530.w-8 { 12531 width: 2rem; 12532} 12533.w-80 { 12534 width: 20rem; 12535} 12536.w-9 { 12537 width: 2.25rem; 12538} 12539.w-\\[--_event-width\\] { 12540 width: var(--_event-width); 12541} 12542.w-\\[1\\.6rem\\] { 12543 width: 1.6rem; 12544} 12545.w-\\[10rem\\] { 12546 width: 10rem; 12547} 12548.w-\\[11ch\\] { 12549 width: 11ch; 12550} 12551.w-\\[12rem\\] { 12552 width: 12rem; 12553} 12554.w-\\[13px\\] { 12555 width: 13px; 12556} 12557.w-\\[13rem\\] { 12558 width: 13rem; 12559} 12560.w-\\[14rem\\] { 12561 width: 14rem; 12562} 12563.w-\\[17rem\\] { 12564 width: 17rem; 12565} 12566.w-\\[18rem\\] { 12567 width: 18rem; 12568} 12569.w-\\[19rem\\] { 12570 width: 19rem; 12571} 12572.w-\\[1em\\] { 12573 width: 1em; 12574} 12575.w-\\[2\\.2rem\\] { 12576 width: 2.2rem; 12577} 12578.w-\\[20rem\\] { 12579 width: 20rem; 12580} 12581.w-\\[2em\\] { 12582 width: 2em; 12583} 12584.w-\\[2rem\\] { 12585 width: 2rem; 12586} 12587.w-\\[30\\%\\] { 12588 width: 30%; 12589} 12590.w-\\[3rem\\] { 12591 width: 3rem; 12592} 12593.w-\\[4\\.45rem\\] { 12594 width: 4.45rem; 12595} 12596.w-\\[4rem\\] { 12597 width: 4rem; 12598} 12599.w-\\[5rem\\] { 12600 width: 5rem; 12601} 12602.w-\\[6\\.5rem\\] { 12603 width: 6.5rem; 12604} 12605.w-\\[60\\%\\] { 12606 width: 60%; 12607} 12608.w-\\[70px\\] { 12609 width: 70px; 12610} 12611.w-\\[7px\\] { 12612 width: 7px; 12613} 12614.w-\\[7rem\\] { 12615 width: 7rem; 12616} 12617.w-\\[80vw\\] { 12618 width: 80vw; 12619} 12620.w-\\[max\\(60\\%\\2c 20rem\\)\\] { 12621 width: max(60%, 20rem); 12622} 12623.w-\\[max\\(60\\%\\2c 25rem\\)\\] { 12624 width: max(60%, 25rem); 12625} 12626.w-\\[min\\(90vw\\2c 22rem\\)\\] { 12627 width: min(90vw, 22rem); 12628} 12629.w-auto { 12630 width: auto; 12631} 12632.w-full { 12633 width: 100%; 12634} 12635.w-min { 12636 width: -moz-min-content; 12637 width: min-content; 12638} 12639.min-w-0 { 12640 min-width: 0px; 12641} 12642.min-w-40 { 12643 min-width: 10rem; 12644} 12645.min-w-60 { 12646 min-width: 15rem; 12647} 12648.min-w-64 { 12649 min-width: 16rem; 12650} 12651.min-w-72 { 12652 min-width: 18rem; 12653} 12654.min-w-\\[\\.5rem\\] { 12655 min-width: .5rem; 12656} 12657.min-w-\\[1\\.7rem\\] { 12658 min-width: 1.7rem; 12659} 12660.min-w-\\[10rem\\] { 12661 min-width: 10rem; 12662} 12663.min-w-\\[12rem\\] { 12664 min-width: 12rem; 12665} 12666.min-w-\\[13rem\\] { 12667 min-width: 13rem; 12668} 12669.min-w-\\[14\\.5ch\\] { 12670 min-width: 14.5ch; 12671} 12672.min-w-\\[14rem\\] { 12673 min-width: 14rem; 12674} 12675.min-w-\\[15rem\\] { 12676 min-width: 15rem; 12677} 12678.min-w-\\[1ch\\] { 12679 min-width: 1ch; 12680} 12681.min-w-\\[24rem\\] { 12682 min-width: 24rem; 12683} 12684.min-w-\\[25ch\\] { 12685 min-width: 25ch; 12686} 12687.min-w-\\[2ch\\] { 12688 min-width: 2ch; 12689} 12690.min-w-\\[3\\.2rem\\] { 12691 min-width: 3.2rem; 12692} 12693.min-w-\\[30ch\\] { 12694 min-width: 30ch; 12695} 12696.min-w-\\[3ch\\] { 12697 min-width: 3ch; 12698} 12699.min-w-\\[4\\.5rem\\] { 12700 min-width: 4.5rem; 12701} 12702.min-w-\\[4rem\\] { 12703 min-width: 4rem; 12704} 12705.min-w-\\[5\\.7rem\\] { 12706 min-width: 5.7rem; 12707} 12708.min-w-\\[5\\.8ch\\] { 12709 min-width: 5.8ch; 12710} 12711.min-w-\\[5ch\\] { 12712 min-width: 5ch; 12713} 12714.min-w-\\[5em\\] { 12715 min-width: 5em; 12716} 12717.min-w-\\[5rem\\] { 12718 min-width: 5rem; 12719} 12720.min-w-\\[6ch\\] { 12721 min-width: 6ch; 12722} 12723.min-w-\\[7\\.5rem\\] { 12724 min-width: 7.5rem; 12725} 12726.min-w-\\[7ch\\] { 12727 min-width: 7ch; 12728} 12729.min-w-\\[min\\(7\\.8ch\\2c _4\\.5em\\)\\] { 12730 min-width: min(7.8ch, 4.5em); 12731} 12732.max-w-40 { 12733 max-width: 10rem; 12734} 12735.max-w-48 { 12736 max-width: 12rem; 12737} 12738.max-w-60 { 12739 max-width: 15rem; 12740} 12741.max-w-96 { 12742 max-width: 24rem; 12743} 12744.max-w-\\[10ch\\] { 12745 max-width: 10ch; 12746} 12747.max-w-\\[10em\\] { 12748 max-width: 10em; 12749} 12750.max-w-\\[10rem\\] { 12751 max-width: 10rem; 12752} 12753.max-w-\\[120px\\] { 12754 max-width: 120px; 12755} 12756.max-w-\\[12ch\\] { 12757 max-width: 12ch; 12758} 12759.max-w-\\[12rem\\] { 12760 max-width: 12rem; 12761} 12762.max-w-\\[13ch\\] { 12763 max-width: 13ch; 12764} 12765.max-w-\\[13rem\\] { 12766 max-width: 13rem; 12767} 12768.max-w-\\[150px\\] { 12769 max-width: 150px; 12770} 12771.max-w-\\[15ch\\] { 12772 max-width: 15ch; 12773} 12774.max-w-\\[16rem\\] { 12775 max-width: 16rem; 12776} 12777.max-w-\\[18ch\\] { 12778 max-width: 18ch; 12779} 12780.max-w-\\[18rem\\] { 12781 max-width: 18rem; 12782} 12783.max-w-\\[19rem\\] { 12784 max-width: 19rem; 12785} 12786.max-w-\\[20ch\\] { 12787 max-width: 20ch; 12788} 12789.max-w-\\[20rem\\] { 12790 max-width: 20rem; 12791} 12792.max-w-\\[22ch\\] { 12793 max-width: 22ch; 12794} 12795.max-w-\\[23ch\\] { 12796 max-width: 23ch; 12797} 12798.max-w-\\[23rem\\] { 12799 max-width: 23rem; 12800} 12801.max-w-\\[24rem\\] { 12802 max-width: 24rem; 12803} 12804.max-w-\\[250px\\] { 12805 max-width: 250px; 12806} 12807.max-w-\\[25rem\\] { 12808 max-width: 25rem; 12809} 12810.max-w-\\[260px\\] { 12811 max-width: 260px; 12812} 12813.max-w-\\[26rem\\] { 12814 max-width: 26rem; 12815} 12816.max-w-\\[28ch\\] { 12817 max-width: 28ch; 12818} 12819.max-w-\\[29ch\\] { 12820 max-width: 29ch; 12821} 12822.max-w-\\[300px\\] { 12823 max-width: 300px; 12824} 12825.max-w-\\[30ch\\] { 12826 max-width: 30ch; 12827} 12828.max-w-\\[30rem\\] { 12829 max-width: 30rem; 12830} 12831.max-w-\\[32rem\\] { 12832 max-width: 32rem; 12833} 12834.max-w-\\[34ch\\] { 12835 max-width: 34ch; 12836} 12837.max-w-\\[35rem\\] { 12838 max-width: 35rem; 12839}
12840.max-w-\\[36rem\\] { 12841 max-width: 36rem; 12842} 12843.max-w-\\[400px\\] { 12844 max-width: 400px; 12845} 12846.max-w-\\[40ch\\] { 12847 max-width: 40ch; 12848} 12849.max-w-\\[40rem\\] { 12850 max-width: 40rem; 12851} 12852.max-w-\\[450px\\] { 12853 max-width: 450px; 12854} 12855.max-w-\\[5\\.7rem\\] { 12856 max-width: 5.7rem; 12857} 12858.max-w-\\[50ch\\] { 12859 max-width: 50ch; 12860} 12861.max-w-\\[50rem\\] { 12862 max-width: 50rem; 12863} 12864.max-w-\\[55rem\\] { 12865 max-width: 55rem; 12866} 12867.max-w-\\[60rem\\] { 12868 max-width: 60rem; 12869} 12870.max-w-\\[64ch\\] { 12871 max-width: 64ch; 12872} 12873.max-w-\\[64rem\\] { 12874 max-width: 64rem; 12875} 12876.max-w-\\[70ch\\] { 12877 max-width: 70ch; 12878} 12879.max-w-\\[80ch\\] { 12880 max-width: 80ch; 12881} 12882.max-w-\\[80rem\\] { 12883 max-width: 80rem; 12884} 12885.max-w-\\[80vw\\] { 12886 max-width: 80vw; 12887} 12888.max-w-\\[85ch\\] { 12889 max-width: 85ch; 12890} 12891.max-w-\\[8rem\\] { 12892 max-width: 8rem; 12893} 12894.max-w-\\[90\\%\\] { 12895 max-width: 90%; 12896} 12897.max-w-full { 12898 max-width: 100%; 12899} 12900.max-w-none { 12901 max-width: none; 12902} 12903.max-w-prose { 12904 max-width: 65ch; 12905} 12906.max-w-sm { 12907 max-width: 24rem; 12908} 12909.flex-1 { 12910 flex: 1 1 0%; 12911} 12912.flex-shrink { 12913 flex-shrink: 1; 12914} 12915.flex-shrink-0 { 12916 flex-shrink: 0; 12917} 12918.shrink-0 { 12919 flex-shrink: 0; 12920} 12921.flex-grow { 12922 flex-grow: 1; 12923} 12924.flex-grow-0 { 12925 flex-grow: 0; 12926} 12927.grow { 12928 flex-grow: 1; 12929} 12930.origin-center { 12931 transform-origin: center; 12932} 12933.-translate-x-1\\/2 { 12934 --tw-translate-x: -50%; 12935 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)); 12936} 12937.-translate-y-1 { 12938 --tw-translate-y: -0.25rem; 12939 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)); 12940} 12941.-translate-y-1\\/2 { 12942 --tw-translate-y: -50%; 12943 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)); 12944} 12945.-translate-y-3\\/4 { 12946 --tw-translate-y: -75%; 12947 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)); 12948} 12949.-translate-y-4 { 12950 --tw-translate-y: -1rem; 12951 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)); 12952} 12953.-translate-y-\\[\\.05em\\] { 12954 --tw-translate-y: -.05em; 12955 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)); 12956} 12957.translate-x-1 { 12958 --tw-translate-x: 0.25rem; 12959 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)); 12960} 12961.translate-x-\\[\\.1em\\] { 12962 --tw-translate-x: .1em; 12963 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)); 12964} 12965.translate-x-\\[1px\\] { 12966 --tw-translate-x: 1px; 12967 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)); 12968} 12969.translate-y-\\[-1px\\] { 12970 --tw-translate-y: -1px; 12971 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)); 12972} 12973.translate-y-\\[-50\\%\\] { 12974 --tw-translate-y: -50%; 12975 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)); 12976} 12977.translate-y-full { 12978 --tw-translate-y: 100%; 12979 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)); 12980} 12981.-rotate-45 { 12982 --tw-rotate: -45deg; 12983 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)); 12984} 12985.rotate-90 { 12986 --tw-rotate: 90deg; 12987 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)); 12988} 12989.scale-0 { 12990 --tw-scale-x: 0; 12991 --tw-scale-y: 0; 12992 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)); 12993} 12994.scale-100 { 12995 --tw-scale-x: 1; 12996 --tw-scale-y: 1; 12997 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)); 12998} 12999.scale-110 { 13000 --tw-scale-x: 1.1; 13001 --tw-scale-y: 1.1; 13002 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)); 13003} 13004.scale-50 { 13005 --tw-scale-x: .5; 13006 --tw-scale-y: .5; 13007 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)); 13008} 13009.scale-\\[\\.90\\] { 13010 --tw-scale-x: .90; 13011 --tw-scale-y: .90; 13012 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)); 13013} 13014.scale-\\[\\.97\\] { 13015 --tw-scale-x: .97; 13016 --tw-scale-y: .97; 13017 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)); 13018} 13019.scale-\\[50\\%\\] { 13020 --tw-scale-x: 50%; 13021 --tw-scale-y: 50%; 13022 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)); 13023} 13024.scale-x-0 { 13025 --tw-scale-x: 0; 13026 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)); 13027} 13028.scale-x-100 { 13029 --tw-scale-x: 1; 13030 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)); 13031} 13032.transform { 13033 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)); 13034} 13035.animate-\\[pulse\\.5s_ease-in-out_infinite_\\.5s\\] { 13036 animation: pulse.5s ease-in-out infinite .5s; 13037} 13038@keyframes heartbeat { 13039 13040 0% { 13041 transform: scale(1); 13042 } 13043 13044 14% { 13045 transform: scale(1.3); 13046 } 13047 13048 28% { 13049 transform: scale(1); 13050 } 13051 13052 42% { 13053 transform: scale(1.3); 13054 } 13055 13056 70% { 13057 transform: scale(1); 13058 } 13059} 13060.animate-heartbeat { 13061 animation: heartbeat 1.15s ease-in-out infinite; 13062} 13063@keyframes pulse { 13064 13065 50% { 13066 opacity: .5; 13067 } 13068} 13069.animate-pulse { 13070 animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; 13071} 13072@keyframes spin { 13073 13074 to { 13075 transform: rotate(360deg); 13076 } 13077} 13078.animate-spin { 13079 animation: spin 1s linear infinite; 13080} 13081.cursor-default { 13082 cursor: default; 13083} 13084.cursor-pointer { 13085 cursor: pointer; 13086} 13087.select-none { 13088 -webkit-user-select: none; 13089 -moz-user-select: none; 13090 user-select: none; 13091} 13092.resize { 13093 resize: both; 13094} 13095.list-inside { 13096 list-style-position: inside; 13097} 13098.list-decimal { 13099 list-style-type: decimal; 13100} 13101.list-disc { 13102 list-style-type: disc; 13103} 13104.break-inside-avoid { 13105 -moz-column-break-inside: avoid; 13106 break-inside: avoid; 13107} 13108.grid-cols-1 { 13109 grid-template-columns: repeat(1, minmax(0, 1fr)); 13110} 13111.grid-cols-2 { 13112 grid-template-columns: repeat(2, minmax(0, 1fr)); 13113} 13114.grid-cols-3 { 13115 grid-template-columns: repeat(3, minmax(0, 1fr)); 13116} 13117.grid-cols-\\[2\\.25rem_2\\.25rem\\] { 13118 grid-template-columns: 2.25rem 2.25rem; 13119} 13120.grid-cols-\\[2\\.5rem_minmax\\(0\\2c 1fr\\)\\] { 13121 grid-template-columns: 2.5rem minmax(0,1fr); 13122} 13123.grid-cols-\\[2\\.7rem_minmax\\(0\\2c 1fr\\)\\] { 13124 grid-template-columns: 2.7rem minmax(0,1fr); 13125} 13126.grid-cols-\\[3\\.2rem_minmax\\(0\\2c 1fr\\)\\] { 13127 grid-template-columns: 3.2rem minmax(0,1fr); 13128} 13129.grid-cols-\\[4rem_minmax\\(0\\2c 1fr\\)\\] { 13130 grid-template-columns: 4rem minmax(0,1fr); 13131} 13132.grid-cols-\\[5\\.2rem_minmax\\(0\\2c 1fr\\)\\] { 13133 grid-template-columns: 5.2rem minmax(0,1fr); 13134} 13135.grid-cols-\\[5\\.5rem_auto\\] { 13136 grid-template-columns: 5.5rem auto; 13137} 13138.grid-cols-\\[5rem_auto\\] { 13139 grid-template-columns: 5rem auto; 13140} 13141.grid-cols-\\[6rem_minmax\\(0\\2c 1fr\\)\\] { 13142 grid-template-columns: 6rem minmax(0,1fr); 13143} 13144.grid-cols-\\[8rem\\2c 1fr\\] { 13145 grid-template-columns: 8rem 1fr; 13146} 13147.grid-cols-\\[auto\\2c 1fr\\] { 13148 grid-template-columns: auto 1fr; 13149} 13150.grid-cols-\\[auto\\2c _minmax\\(0\\2c 1fr\\)\\2c _auto\\] { 13151 grid-template-columns: auto minmax(0,1fr) auto; 13152} 13153.grid-cols-\\[max\\(6rem\\2c _13\\%\\)_1fr\\] { 13154 grid-template-columns: max(6rem, 13%) 1fr; 13155} 13156.grid-cols-\\[minmax\\(0\\2c 1fr\\)_auto\\] { 13157 grid-template-columns: minmax(0,1fr) auto; 13158} 13159.grid-cols-\\[minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 1\\.5fr\\)\\] { 13160 grid-template-columns: minmax(0,1fr) minmax(0,1.5fr); 13161} 13162.grid-cols-\\[minmax\\(0\\2c 2fr\\)_90px_minmax\\(0\\2c 3fr\\)_60px\\] { 13163 grid-template-columns: minmax(0,2fr) 90px minmax(0,3fr) 60px; 13164} 13165.grid-cols-\\[minmax\\(0\\2c 3fr\\)_minmax\\(0\\2c 1\\.5fr\\)_6rem\\] { 13166 grid-template-columns: minmax(0,3fr) minmax(0,1.5fr) 6rem; 13167} 13168.grid-cols-\\[minmax\\(0\\2c _3fr\\)_1fr\\] { 13169 grid-template-columns: minmax(0, 3fr) 1fr; 13170} 13171.grid-cols-\\[minmax\\(10rem\\2c 15rem\\)_minmax\\(0\\2c 1fr\\)\\] { 13172 grid-template-columns: minmax(10rem,15rem) minmax(0,1fr); 13173} 13174.grid-cols-\\[minmax\\(15rem\\2c 1fr\\)_minmax\\(0\\2c 2\\.5fr\\)\\] { 13175 grid-template-columns: minmax(15rem,1fr) minmax(0,2.5fr); 13176} 13177.grid-cols-\\[minmax\\(35\\%\\2c 1fr\\)_auto_minmax\\(0\\2c max-content\\)\\] { 13178 grid-template-columns: minmax(35%,1fr) auto minmax(0,max-content); 13179} 13180.grid-cols-\\[minmax\\(4\\.5rem\\2c 7rem\\)_minmax\\(7rem\\2c 10rem\\)_minmax\\(0\\2c 1\\.2fr\\)_minmax\\(4\\.5rem\\2c 6\\.5rem\\)_4\\.75rem\\] { 13181 grid-template-columns: minmax(4.5rem,7rem) minmax(7rem,10rem) minmax(0,1.2fr) minmax(4.5rem,6.5rem) 4.75rem; 13182} 13183.grid-cols-\\[repeat\\(auto-fill\\2c minmax\\(200px\\2c 1fr\\)\\)\\] { 13184 grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); 13185} 13186.grid-cols-\\[repeat\\(auto-fill\\2c minmax\\(260px\\2c 1fr\\)\\)\\] { 13187 grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); 13188} 13189.grid-cols-\\[repeat\\(auto-fit\\2c minmax\\(min\\(100\\%\\2c 10rem\\)\\2c 1fr\\)\\)\\] { 13190 grid-template-columns: repeat(auto-fit,minmax(min(100%, 10rem),1fr)); 13191} 13192.grid-cols-\\[repeat\\(auto-fit\\2c minmax\\(min\\(100\\%\\2c 15rem\\)\\2c 1fr\\)\\)\\] { 13193 grid-template-columns: repeat(auto-fit,minmax(min(100%, 15rem),1fr)); 13194} 13195.grid-cols-\\[repeat\\(auto-fit\\2c minmax\\(min\\(100\\%\\2c 16rem\\)\\2c 1fr\\)\\)\\] { 13196 grid-template-columns: repeat(auto-fit,minmax(min(100%, 16rem),1fr)); 13197} 13198.grid-rows-\\[0fr\\] { 13199 grid-template-rows: 0fr; 13200} 13201.grid-rows-\\[1fr\\] { 13202 grid-template-rows: 1fr; 13203} 13204.grid-rows-\\[max-content_1fr\\] { 13205 grid-template-rows: max-content 1fr; 13206} 13207.flex-row { 13208 flex-direction: row; 13209} 13210.flex-row-reverse { 13211 flex-direction: row-reverse; 13212} 13213.flex-col { 13214 flex-direction: column; 13215} 13216.flex-wrap { 13217 flex-wrap: wrap; 13218} 13219.flex-nowrap { 13220 flex-wrap: nowrap; 13221} 13222.items-start { 13223 align-items: flex-start; 13224} 13225.items-end { 13226 align-items: flex-end; 13227} 13228.items-center { 13229 align-items: center; 13230} 13231.items-baseline { 13232 align-items: baseline; 13233} 13234.items-stretch { 13235 align-items: stretch; 13236} 13237.justify-start { 13238 justify-content: flex-start; 13239} 13240.justify-end { 13241 justify-content: flex-end; 13242} 13243.justify-center { 13244 justify-content: center; 13245} 13246.justify-between { 13247 justify-content: space-between; 13248} 13249.gap-0 { 13250 gap: 0px; 13251} 13252.gap-0\\.5 { 13253 gap: 0.125rem; 13254} 13255.gap-1 { 13256 gap: 0.25rem; 13257} 13258.gap-1\\.5 { 13259 gap: 0.375rem; 13260} 13261.gap-10 { 13262 gap: 2.5rem; 13263} 13264.gap-12 { 13265 gap: 3rem; 13266} 13267.gap-16 { 13268 gap: 4rem; 13269} 13270.gap-2 { 13271 gap: 0.5rem; 13272} 13273.gap-2\\.5 { 13274 gap: 0.625rem; 13275} 13276.gap-3 { 13277 gap: 0.75rem; 13278} 13279.gap-4 {
13280 gap: 1rem; 13281} 13282.gap-5 { 13283 gap: 1.25rem; 13284} 13285.gap-6 { 13286 gap: 1.5rem; 13287} 13288.gap-7 { 13289 gap: 1.75rem; 13290} 13291.gap-8 { 13292 gap: 2rem; 13293} 13294.gap-\\[\\.15em\\] { 13295 gap: .15em; 13296} 13297.gap-\\[\\.25em\\] { 13298 gap: .25em; 13299} 13300.gap-\\[\\.2em\\] { 13301 gap: .2em; 13302} 13303.gap-\\[\\.35em\\] { 13304 gap: .35em; 13305} 13306.gap-\\[\\.3em\\] { 13307 gap: .3em; 13308} 13309.gap-\\[\\.4em\\] { 13310 gap: .4em; 13311} 13312.gap-\\[\\.5em\\] { 13313 gap: .5em; 13314} 13315.gap-\\[\\.75em\\] { 13316 gap: .75em; 13317} 13318.gap-\\[0\\.35em\\] { 13319 gap: 0.35em; 13320} 13321.gap-\\[1px\\] { 13322 gap: 1px; 13323} 13324.gap-\\[2px\\] { 13325 gap: 2px; 13326} 13327.gap-\\[2rem\\] { 13328 gap: 2rem; 13329} 13330.gap-\\[3px\\] { 13331 gap: 3px; 13332} 13333.gap-x-1 { 13334 -moz-column-gap: 0.25rem; 13335 column-gap: 0.25rem; 13336} 13337.gap-x-10 { 13338 -moz-column-gap: 2.5rem; 13339 column-gap: 2.5rem; 13340} 13341.gap-x-12 { 13342 -moz-column-gap: 3rem; 13343 column-gap: 3rem; 13344} 13345.gap-x-2 { 13346 -moz-column-gap: 0.5rem; 13347 column-gap: 0.5rem; 13348} 13349.gap-x-3 { 13350 -moz-column-gap: 0.75rem; 13351 column-gap: 0.75rem; 13352} 13353.gap-x-4 { 13354 -moz-column-gap: 1rem; 13355 column-gap: 1rem; 13356} 13357.gap-x-5 { 13358 -moz-column-gap: 1.25rem; 13359 column-gap: 1.25rem; 13360} 13361.gap-x-6 { 13362 -moz-column-gap: 1.5rem; 13363 column-gap: 1.5rem; 13364} 13365.gap-x-8 { 13366 -moz-column-gap: 2rem; 13367 column-gap: 2rem; 13368} 13369.gap-x-9 { 13370 -moz-column-gap: 2.25rem; 13371 column-gap: 2.25rem; 13372} 13373.gap-x-\\[\\.35em\\] { 13374 -moz-column-gap: .35em; 13375 column-gap: .35em; 13376} 13377.gap-x-\\[\\.3em\\] { 13378 -moz-column-gap: .3em; 13379 column-gap: .3em; 13380} 13381.gap-x-\\[\\.5em\\] { 13382 -moz-column-gap: .5em; 13383 column-gap: .5em; 13384} 13385.gap-x-\\[\\.8em\\] { 13386 -moz-column-gap: .8em; 13387 column-gap: .8em; 13388} 13389.gap-x-\\[0\\.35em\\] { 13390 -moz-column-gap: 0.35em; 13391 column-gap: 0.35em; 13392} 13393.gap-x-\\[13px\\] { 13394 -moz-column-gap: 13px; 13395 column-gap: 13px; 13396} 13397.gap-x-\\[14px\\] { 13398 -moz-column-gap: 14px; 13399 column-gap: 14px; 13400} 13401.gap-x-\\[1em\\] { 13402 -moz-column-gap: 1em; 13403 column-gap: 1em; 13404} 13405.gap-x-\\[2\\.5rem\\] { 13406 -moz-column-gap: 2.5rem; 13407 column-gap: 2.5rem; 13408} 13409.gap-y-1 { 13410 row-gap: 0.25rem; 13411} 13412.gap-y-2 { 13413 row-gap: 0.5rem; 13414} 13415.gap-y-3 { 13416 row-gap: 0.75rem; 13417} 13418.gap-y-4 { 13419 row-gap: 1rem; 13420} 13421.gap-y-5 { 13422 row-gap: 1.25rem; 13423} 13424.gap-y-6 { 13425 row-gap: 1.5rem; 13426} 13427.gap-y-8 { 13428 row-gap: 2rem; 13429} 13430.gap-y-\\[\\.15em\\] { 13431 row-gap: .15em; 13432} 13433.gap-y-\\[\\.2em\\] { 13434 row-gap: .2em; 13435} 13436.gap-y-\\[\\.3em\\] { 13437 row-gap: .3em; 13438} 13439.gap-y-\\[0\\.125em\\] { 13440 row-gap: 0.125em; 13441} 13442.space-y-1 > :not([hidden]) ~ :not([hidden]) { 13443 --tw-space-y-reverse: 0; 13444 margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse))); 13445 margin-bottom: calc(0.25rem * var(--tw-space-y-reverse)); 13446} 13447.space-y-2 > :not([hidden]) ~ :not([hidden]) { 13448 --tw-space-y-reverse: 0; 13449 margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse))); 13450 margin-bottom: calc(0.5rem * var(--tw-space-y-reverse)); 13451} 13452.space-y-3 > :not([hidden]) ~ :not([hidden]) { 13453 --tw-space-y-reverse: 0; 13454 margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse))); 13455 margin-bottom: calc(0.75rem * var(--tw-space-y-reverse)); 13456} 13457.divide-x > :not([hidden]) ~ :not([hidden]) { 13458 --tw-divide-x-reverse: 0; 13459 border-right-width: calc(var(--sc-border-width) * var(--tw-divide-x-reverse)); 13460 border-left-width: calc(var(--sc-border-width) * calc(1 - var(--tw-divide-x-reverse))); 13461} 13462.divide-x-\\[1px\\] > :not([hidden]) ~ :not([hidden]) { 13463 --tw-divide-x-reverse: 0; 13464 border-right-width: calc(1px * var(--tw-divide-x-reverse)); 13465 border-left-width: calc(1px * calc(1 - var(--tw-divide-x-reverse))); 13466} 13467.divide-neutral-200 > :not([hidden]) ~ :not([hidden]) { 13468 border-color: var(--sc-base-200); 13469} 13470.self-auto { 13471 align-self: auto; 13472} 13473.self-start { 13474 align-self: flex-start; 13475} 13476.self-end { 13477 align-self: flex-end; 13478} 13479.self-center { 13480 align-self: center; 13481} 13482.self-stretch { 13483 align-self: stretch; 13484} 13485.justify-self-start { 13486 justify-self: start; 13487} 13488.justify-self-end { 13489 justify-self: end; 13490} 13491.justify-self-center { 13492 justify-self: center; 13493} 13494.overflow-auto { 13495 overflow: auto; 13496} 13497.overflow-hidden { 13498 overflow: hidden; 13499} 13500.overflow-clip { 13501 overflow: clip; 13502} 13503.\\!overflow-y-auto { 13504 overflow-y: auto !important; 13505} 13506.overflow-y-auto { 13507 overflow-y: auto; 13508} 13509.overflow-x-hidden { 13510 overflow-x: hidden; 13511} 13512.truncate { 13513 overflow: hidden; 13514 text-overflow: ellipsis; 13515 white-space: nowrap; 13516} 13517.text-ellipsis { 13518 text-overflow: ellipsis; 13519} 13520.whitespace-normal { 13521 white-space: normal; 13522} 13523.whitespace-nowrap { 13524 white-space: nowrap; 13525} 13526.whitespace-pre-line { 13527 white-space: pre-line; 13528} 13529.text-wrap { 13530 text-wrap: wrap; 13531} 13532.text-nowrap { 13533 text-wrap: nowrap; 13534} 13535.text-balance { 13536 text-wrap: balance; 13537} 13538.text-pretty { 13539 text-wrap: pretty; 13540} 13541.break-words { 13542 overflow-wrap: break-word; 13543} 13544.rounded { 13545 border-radius: var(--sc-rounded); 13546} 13547.rounded-\\[--sc-btn-rounded\\] { 13548 border-radius: var(--sc-btn-rounded); 13549} 13550.rounded-\\[\\.3rem\\] { 13551 border-radius: .3rem; 13552} 13553.rounded-\\[var\\(--sc-rounded\\)\\] { 13554 border-radius: var(--sc-rounded); 13555} 13556.rounded-full { 13557 border-radius: 9999px; 13558} 13559.rounded-lg { 13560 border-radius: var(--sc-rounded-lg); 13561} 13562.rounded-md { 13563 border-radius: var(--sc-rounded-md); 13564} 13565.rounded-sm { 13566 border-radius: var(--sc-rounded-sm); 13567} 13568.rounded-b-lg { 13569 border-bottom-right-radius: var(--sc-rounded-lg); 13570 border-bottom-left-radius: var(--sc-rounded-lg); 13571} 13572.rounded-b-md { 13573 border-bottom-right-radius: var(--sc-rounded-md); 13574 border-bottom-left-radius: var(--sc-rounded-md); 13575} 13576.rounded-t-lg { 13577 border-top-left-radius: var(--sc-rounded-lg); 13578 border-top-right-radius: var(--sc-rounded-lg); 13579} 13580.rounded-t-md { 13581 border-top-left-radius: var(--sc-rounded-md); 13582 border-top-right-radius: var(--sc-rounded-md); 13583} 13584.rounded-bl-lg { 13585 border-bottom-left-radius: var(--sc-rounded-lg); 13586} 13587.rounded-br-md { 13588 border-bottom-right-radius: var(--sc-rounded-md); 13589} 13590.rounded-tr-md { 13591 border-top-right-radius: var(--sc-rounded-md); 13592} 13593.border { 13594 border-width: var(--sc-border-width); 13595} 13596.border-0 { 13597 border-width: 0px; 13598} 13599.border-2 { 13600 border-width: 2px; 13601} 13602.border-b { 13603 border-bottom-width: var(--sc-border-width); 13604} 13605.border-b-\\[\\.3rem\\] { 13606 border-bottom-width: .3rem; 13607} 13608.border-b-\\[1px\\] { 13609 border-bottom-width: 1px; 13610} 13611.border-l { 13612 border-left-width: var(--sc-border-width); 13613} 13614.border-l-4 { 13615 border-left-width: 4px; 13616} 13617.border-l-\\[1px\\] { 13618 border-left-width: 1px; 13619} 13620.border-r { 13621 border-right-width: var(--sc-border-width); 13622} 13623.border-r-0 { 13624 border-right-width: 0px; 13625} 13626.border-r-4 { 13627 border-right-width: 4px; 13628} 13629.border-t { 13630 border-top-width: var(--sc-border-width); 13631} 13632.border-t-\\[1px\\] { 13633 border-top-width: 1px; 13634} 13635.border-solid { 13636 border-style: solid; 13637} 13638.border-dashed { 13639 border-style: dashed; 13640} 13641.border-dotted { 13642 border-style: dotted; 13643} 13644.border-\\[\\#c77dff\\] { 13645 --tw-border-opacity: 1; 13646 border-color: rgb(199 125 255 / var(--tw-border-opacity, 1)); 13647} 13648.border-\\[var\\(--sc-input-border-color\\2c var\\(--sc-base-content\\2c \\#000\\)\\)\\] { 13649 border-color: var(--sc-input-border-color,var(--sc-base-content,#000)); 13650} 13651.border-content { 13652 border-color: var(--sc-base-content); 13653} 13654.border-current { 13655 border-color: currentColor; 13656} 13657.border-neutral-0 { 13658 border-color: var(--sc-base); 13659} 13660.border-neutral-100 { 13661 border-color: var(--sc-base-100); 13662} 13663.border-neutral-200 { 13664 border-color: var(--sc-base-200); 13665} 13666.border-neutral-300 { 13667 border-color: var(--sc-base-300); 13668} 13669.border-neutral-50 { 13670 border-color: var(--sc-base-50); 13671} 13672.border-neutral-500 { 13673 border-color: var(--sc-base-500); 13674} 13675.border-neutral-900 { 13676 border-color: var(--sc-base-900); 13677} 13678.border-success { 13679 border-color: var(--sc-success); 13680} 13681.border-transparent { 13682 border-color: transparent; 13683} 13684.border-b-neutral-100 { 13685 border-bottom-color: var(--sc-base-100); 13686} 13687.border-b-neutral-300 { 13688 border-bottom-color: var(--sc-base-300); 13689} 13690.border-l-danger { 13691 border-left-color: var(--sc-danger); 13692} 13693.border-l-transparent { 13694 border-left-color: transparent; 13695} 13696.border-t-neutral-100 { 13697 border-top-color: var(--sc-base-100); 13698} 13699.border-t-neutral-200 { 13700 border-top-color: var(--sc-base-200); 13701} 13702.bg-\\[\\#1e1e1e\\] { 13703 --tw-bg-opacity: 1; 13704 background-color: rgb(30 30 30 / var(--tw-bg-opacity, 1)); 13705} 13706.bg-\\[\\#222\\] { 13707 --tw-bg-opacity: 1; 13708 background-color: rgb(34 34 34 / var(--tw-bg-opacity, 1)); 13709} 13710.bg-\\[color-mix\\(in_srgb\\2c _var\\(--sc-danger\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 13711 background-color: color-mix(in srgb, var(--sc-danger) 15%, var(--sc-base)); 13712} 13713.bg-\\[color-mix\\(in_srgb\\2c _var\\(--sc-info\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 13714 background-color: color-mix(in srgb, var(--sc-info) 15%, var(--sc-base)); 13715} 13716.bg-\\[color-mix\\(in_srgb\\2c _var\\(--sc-success\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 13717 background-color: color-mix(in srgb, var(--sc-success) 15%, var(--sc-base)); 13718} 13719.bg-\\[color-mix\\(in_srgb\\2c _var\\(--sc-warning\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 13720 background-color: color-mix(in srgb, var(--sc-warning) 15%, var(--sc-base)); 13721} 13722.bg-\\[var\\(--sc-base\\)\\] { 13723 background-color: var(--sc-base); 13724} 13725.bg-\\[yellow\\] { 13726 --tw-bg-opacity: 1; 13727 background-color: rgb(255 255 0 / var(--tw-bg-opacity, 1)); 13728} 13729.bg-content { 13730 background-color: var(--sc-base-content); 13731} 13732.bg-contrast { 13733 background-color: var(--sc-contrast); 13734} 13735.bg-current { 13736 background-color: currentColor; 13737} 13738.bg-danger { 13739 background-color: var(--sc-danger); 13740} 13741.bg-info { 13742 background-color: var(--sc-info); 13743} 13744.bg-neutral-0 { 13745 background-color: var(--sc-base); 13746} 13747.bg-neutral-100 { 13748 background-color: var(--sc-base-100); 13749} 13750.bg-neutral-200 { 13751 background-color: var(--sc-base-200); 13752} 13753.bg-neutral-300 { 13754 background-color: var(--sc-base-300); 13755} 13756.bg-neutral-50 { 13757 background-color: var(--sc-base-50); 13758} 13759.bg-success { 13760 background-color: var(--sc-success); 13761} 13762.bg-warning { 13763 background-color: var(--sc-warning); 13764} 13765.bg-gradient-to-br { 13766 background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); 13767} 13768.bg-gradient-to-r { 13769 background-image: linear-gradient(to right, var(--tw-gradient-stops)); 13770} 13771.bg-gradient-to-t { 13772 background-image: linear-gradient(to top, var(--tw-gradient-stops)); 13773} 13774.from-\\[\\#e10057\\] { 13775 --tw-gradient-from: #e10057 var(--tw-gradient-from-position); 13776 --tw-gradient-to: rgb(225 0 87 / 0) var(--tw-gradient-to-position); 13777 --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); 13778} 13779.from-\\[rgba\\(0\\2c 0\\2c 0\\2c \\.25\\)\\] { 13780 --tw-gradient-from: rgba(0,0,0,.25) var(--tw-gradient-from-position); 13781 --tw-gradient-to: rgba(0, 0, 0, 0) var(--tw-gradient-to-position); 13782 --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); 13783} 13784.to-\\[\\#4f0090\\] { 13785 --tw-gradient-to: #4f0090 var(--tw-gradient-to-position); 13786} 13787.to-\\[rgba\\(0\\2c 0\\2c 0\\2c 0\\)\\] { 13788 --tw-gradient-to: rgba(0,0,0,0) var(--tw-gradient-to-position); 13789} 13790.fill-current { 13791 fill: currentColor; 13792} 13793.object-contain { 13794 -o-object-fit: contain; 13795 object-fit: contain; 13796} 13797.object-cover { 13798 -o-object-fit: cover; 13799 object-fit: cover; 13800} 13801.object-center { 13802 -o-object-position: center; 13803 object-position: center; 13804} 13805.p-0 { 13806 padding: 0px; 13807} 13808.p-1 { 13809 padding: 0.25rem; 13810} 13811.p-2 { 13812 padding: 0.5rem; 13813} 13814.p-2\\.5 { 13815 padding: 0.625rem; 13816} 13817.p-3 { 13818 padding: 0.75rem; 13819} 13820.p-4 { 13821 padding: 1rem; 13822} 13823.p-5 { 13824 padding: 1.25rem; 13825} 13826.p-6 { 13827 padding: 1.5rem; 13828} 13829.p-8 { 13830 padding: 2rem; 13831} 13832.p-\\[10px\\] { 13833 padding: 10px; 13834} 13835.p-\\[12px\\] { 13836 padding: 12px; 13837} 13838.p-\\[15px\\] { 13839 padding: 15px; 13840} 13841.p-\\[2px\\] { 13842 padding: 2px; 13843} 13844.p-\\[clamp\\(0\\.5rem\\2c 5\\%\\2c 1\\.5rem\\)\\] { 13845 padding: clamp(0.5rem, 5%, 1.5rem); 13846} 13847.p-cgx { 13848 padding: var(--sc-container-gutter-x); 13849} 13850.px-0 { 13851 padding-left: 0px; 13852 padding-right: 0px; 13853} 13854.px-1 { 13855 padding-left: 0.25rem; 13856 padding-right: 0.25rem; 13857} 13858.px-10 { 13859 padding-left: 2.5rem; 13860 padding-right: 2.5rem; 13861} 13862.px-2 { 13863 padding-left: 0.5rem; 13864 padding-right: 0.5rem; 13865} 13866.px-2\\.5 { 13867 padding-left: 0.625rem; 13868 padding-right: 0.625rem; 13869} 13870.px-3 { 13871 padding-left: 0.75rem; 13872 padding-right: 0.75rem; 13873} 13874.px-4 { 13875 padding-left: 1rem; 13876 padding-right: 1rem; 13877} 13878.px-5 { 13879 padding-left: 1.25rem; 13880 padding-right: 1.25rem; 13881} 13882.px-6 { 13883 padding-left: 1.5rem; 13884 padding-right: 1.5rem; 13885} 13886.px-8 { 13887 padding-left: 2rem; 13888 padding-right: 2rem; 13889} 13890.px-\\[\\.35em\\] { 13891 padding-left: .35em; 13892 padding-right: .35em; 13893} 13894.px-\\[5vw\\] { 13895 padding-left: 5vw; 13896 padding-right: 5vw; 13897} 13898.px-cgx { 13899 padding-left: var(--sc-container-gutter-x); 13900 padding-right: var(--sc-container-gutter-x); 13901} 13902.py-0 { 13903 padding-top: 0px; 13904 padding-bottom: 0px; 13905} 13906.py-1 { 13907 padding-top: 0.25rem; 13908 padding-bottom: 0.25rem; 13909} 13910.py-1\\.5 { 13911 padding-top: 0.375rem; 13912 padding-bottom: 0.375rem; 13913} 13914.py-12 { 13915 padding-top: 3rem; 13916 padding-bottom: 3rem; 13917} 13918.py-16 { 13919 padding-top: 4rem; 13920 padding-bottom: 4rem; 13921} 13922.py-2 { 13923 padding-top: 0.5rem; 13924 padding-bottom: 0.5rem; 13925} 13926.py-3 { 13927 padding-top: 0.75rem; 13928 padding-bottom: 0.75rem; 13929} 13930.py-4 { 13931 padding-top: 1rem; 13932 padding-bottom: 1rem; 13933} 13934.py-5 { 13935 padding-top: 1.25rem; 13936 padding-bottom: 1.25rem; 13937} 13938.py-6 { 13939 padding-top: 1.5rem; 13940 padding-bottom: 1.5rem; 13941} 13942.py-8 { 13943 padding-top: 2rem; 13944 padding-bottom: 2rem; 13945} 13946.py-\\[--sc-header-gy\\] { 13947 padding-top: var(--sc-header-gy); 13948 padding-bottom: var(--sc-header-gy); 13949} 13950.py-\\[1px\\] { 13951 padding-top: 1px; 13952 padding-bottom: 1px; 13953} 13954.py-\\[2em\\] { 13955 padding-top: 2em; 13956 padding-bottom: 2em; 13957} 13958.py-\\[2px\\] { 13959 padding-top: 2px; 13960 padding-bottom: 2px; 13961} 13962.py-\\[3px\\] { 13963 padding-top: 3px; 13964 padding-bottom: 3px; 13965} 13966.py-\\[4px\\] { 13967 padding-top: 4px; 13968 padding-bottom: 4px; 13969} 13970.py-\\[max\\(1\\.5\\%\\2c \\.5rem\\)\\] { 13971 padding-top: max(1.5%, .5rem); 13972 padding-bottom: max(1.5%, .5rem); 13973} 13974.py-cgy { 13975 padding-top: var(--sc-container-gutter-y); 13976 padding-bottom: var(--sc-container-gutter-y); 13977} 13978.pb-1 { 13979 padding-bottom: 0.25rem; 13980} 13981.pb-2 { 13982 padding-bottom: 0.5rem; 13983} 13984.pb-20 { 13985 padding-bottom: 5rem; 13986} 13987.pb-3 { 13988 padding-bottom: 0.75rem; 13989} 13990.pb-4 { 13991 padding-bottom: 1rem; 13992} 13993.pb-5 { 13994 padding-bottom: 1.25rem; 13995} 13996.pb-6 { 13997 padding-bottom: 1.5rem; 13998} 13999.pb-8 { 14000 padding-bottom: 2rem; 14001} 14002.pl-1 { 14003 padding-left: 0.25rem; 14004} 14005.pl-2 { 14006 padding-left: 0.5rem; 14007} 14008.pl-3 { 14009 padding-left: 0.75rem; 14010} 14011.pl-4 { 14012 padding-left: 1rem; 14013} 14014.pl-5 { 14015 padding-left: 1.25rem; 14016} 14017.pl-6 { 14018 padding-left: 1.5rem; 14019} 14020.pl-cgx { 14021 padding-left: var(--sc-container-gutter-x); 14022} 14023.pr-1 { 14024 padding-right: 0.25rem; 14025} 14026.pr-12 { 14027 padding-right: 3rem; 14028} 14029.pr-2 { 14030 padding-right: 0.5rem; 14031} 14032.pr-3 { 14033 padding-right: 0.75rem; 14034} 14035.pr-4 { 14036 padding-right: 1rem; 14037} 14038.pr-5 { 14039 padding-right: 1.25rem; 14040} 14041.pr-6 { 14042 padding-right: 1.5rem; 14043} 14044.pr-8 { 14045 padding-right: 2rem; 14046} 14047.pr-\\[var\\(--publication-size\\)\\] { 14048 padding-right: var(--publication-size); 14049} 14050.pt-1 { 14051 padding-top: 0.25rem; 14052} 14053.pt-2 { 14054 padding-top: 0.5rem; 14055} 14056.pt-3 { 14057 padding-top: 0.75rem; 14058} 14059.pt-4 { 14060 padding-top: 1rem; 14061} 14062.pt-5 { 14063 padding-top: 1.25rem; 14064} 14065.pt-8 { 14066 padding-top: 2rem; 14067} 14068.pt-\\[\\.1em\\] { 14069 padding-top: .1em; 14070} 14071.text-left { 14072 text-align: left; 14073} 14074.text-center { 14075 text-align: center; 14076} 14077.text-right { 14078 text-align: right; 14079} 14080.align-baseline { 14081 vertical-align: baseline; 14082} 14083.align-middle { 14084 vertical-align: middle; 14085} 14086.font-headings { 14087 font-family: var(--sc-headings-font-family); 14088} 14089.font-mono { 14090 font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 14091} 14092.font-monospace { 14093 font-family: var(--sc-font-family-monospace, monospace); 14094} 14095.text-2xl { 14096 font-size: 1.5rem; 14097} 14098.text-2xs { 14099 font-size: 0.70rem; 14100} 14101.text-3xl { 14102 font-size: 1.875rem; 14103} 14104.text-4xl { 14105 font-size: 2.25rem; 14106} 14107.text-6xl { 14108 font-size: 3.75rem; 14109} 14110.text-\\[\\.75em\\] { 14111 font-size: .75em; 14112} 14113.text-\\[\\.78rem\\] { 14114 font-size: .78rem; 14115} 14116.text-\\[\\.7em\\] { 14117 font-size: .7em; 14118} 14119.text-\\[\\.82em\\] { 14120 font-size: .82em; 14121} 14122.text-\\[\\.85em\\] { 14123 font-size: .85em; 14124} 14125.text-\\[\\.85rem\\] { 14126 font-size: .85rem; 14127} 14128.text-\\[\\.8em\\] { 14129 font-size: .8em; 14130} 14131.text-\\[\\.8rem\\] { 14132 font-size: .8rem; 14133} 14134.text-\\[\\.9em\\] { 14135 font-size: .9em; 14136} 14137.text-\\[\\.9rem\\] { 14138 font-size: .9rem; 14139} 14140.text-\\[1\\.125em\\] { 14141 font-size: 1.125em; 14142} 14143.text-\\[1\\.15em\\] { 14144 font-size: 1.15em; 14145} 14146.text-\\[1\\.1em\\] { 14147 font-size: 1.1em; 14148} 14149.text-\\[1\\.2em\\] { 14150 font-size: 1.2em; 14151} 14152.text-\\[1\\.35rem\\] { 14153 font-size: 1.35rem; 14154} 14155.text-\\[1\\.3em\\] { 14156 font-size: 1.3em; 14157} 14158.text-\\[1\\.5em\\] { 14159 font-size: 1.5em; 14160} 14161.text-\\[1\\.5rem\\] { 14162 font-size: 1.5rem; 14163} 14164.text-\\[1\\.6em\\] { 14165 font-size: 1.6em; 14166} 14167.text-\\[1\\.8em\\] { 14168 font-size: 1.8em; 14169} 14170.text-\\[10px\\] { 14171 font-size: 10px; 14172} 14173.text-\\[11px\\] { 14174 font-size: 11px; 14175} 14176.text-\\[1em\\] { 14177 font-size: 1em; 14178} 14179.text-\\[2\\.25em\\] { 14180 font-size: 2.25em; 14181} 14182.text-\\[2\\.2em\\] { 14183 font-size: 2.2em; 14184} 14185.text-\\[40cqw\\] { 14186 font-size: 40cqw; 14187} 14188.text-\\[4rem\\] { 14189 font
14189-size: 4rem; 14190} 14191.text-\\[max\\(\\.65rem\\2c 10px\\)\\] { 14192 font-size: max(.65rem, 10px); 14193} 14194.text-\\[max\\(12px\\2c \\.8em\\)\\] { 14195 font-size: max(12px, .8em); 14196} 14197.text-\\[max\\(16px\\2c 1em\\)\\] { 14198 font-size: max(16px, 1em); 14199} 14200.text-base { 14201 font-size: 1rem; 14202} 14203.text-lg { 14204 font-size: 1.125rem; 14205} 14206.text-sm { 14207 font-size: 0.875rem; 14208} 14209.text-xl { 14210 font-size: 1.25rem; 14211} 14212.text-xs { 14213 font-size: 0.75rem; 14214} 14215.font-bold { 14216 font-weight: 700; 14217} 14218.font-extrabold { 14219 font-weight: 800; 14220} 14221.font-headings { 14222 font-weight: var(--sc-headings-font-weight); 14223} 14224.font-medium { 14225 font-weight: 500; 14226} 14227.font-normal { 14228 font-weight: 400; 14229} 14230.font-semibold { 14231 font-weight: 600; 14232} 14233.uppercase { 14234 text-transform: uppercase; 14235} 14236.lowercase { 14237 text-transform: lowercase; 14238} 14239.capitalize { 14240 text-transform: capitalize; 14241} 14242.normal-case { 14243 text-transform: none; 14244} 14245.italic { 14246 font-style: italic; 14247} 14248.leading-\\[1\\.1\\] { 14249 line-height: 1.1; 14250} 14251.leading-none { 14252 line-height: 1; 14253} 14254.leading-relaxed { 14255 line-height: 1.625; 14256} 14257.leading-snug { 14258 line-height: 1.375; 14259} 14260.leading-tight { 14261 line-height: 1.25; 14262} 14263.leading-tighter { 14264 line-height: 1.15; 14265} 14266.tracking-normal { 14267 letter-spacing: 0em; 14268} 14269.tracking-tight { 14270 letter-spacing: -0.025em; 14271} 14272.tracking-tighter { 14273 letter-spacing: -0.05em; 14274} 14275.tracking-wide { 14276 letter-spacing: 0.025em; 14277} 14278.tracking-wider { 14279 letter-spacing: 0.05em; 14280} 14281.tracking-widest { 14282 letter-spacing: 0.1em; 14283} 14284.text-\\[\\#222222\\] { 14285 --tw-text-opacity: 1; 14286 color: rgb(34 34 34 / var(--tw-text-opacity, 1)); 14287} 14288.text-\\[\\#4fc1ff\\] { 14289 --tw-text-opacity: 1; 14290 color: rgb(79 193 255 / var(--tw-text-opacity, 1)); 14291} 14292.text-\\[\\#9cdcfe\\] { 14293 --tw-text-opacity: 1; 14294 color: rgb(156 220 254 / var(--tw-text-opacity, 1)); 14295} 14296.text-\\[\\#b5cea8\\] { 14297 --tw-text-opacity: 1; 14298 color: rgb(181 206 168 / var(--tw-text-opacity, 1)); 14299} 14300.text-\\[\\#c586c0\\] { 14301 --tw-text-opacity: 1; 14302 color: rgb(197 134 192 / var(--tw-text-opacity, 1)); 14303} 14304.text-\\[\\#ce9178\\] { 14305 --tw-text-opacity: 1; 14306 color: rgb(206 145 120 / var(--tw-text-opacity, 1)); 14307} 14308.text-\\[\\#f92672\\] { 14309 --tw-text-opacity: 1; 14310 color: rgb(249 38 114 / var(--tw-text-opacity, 1)); 14311} 14312.text-\\[color-mix\\(in_srgb\\2c _var\\(--sc-danger\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 14313 color: color-mix(in srgb, var(--sc-danger) 15%, var(--sc-base)); 14314} 14315.text-\\[color-mix\\(in_srgb\\2c _var\\(--sc-info\\)_15\\%\\2c _var\\(--sc-base\\)\\)\\] { 14316 color: color-mix(in srgb, var(--sc-info) 15%, var(--sc-base)); 14317} 14318.text-\\[tomato\\] { 14319 --tw-text-opacity: 1; 14320 color: rgb(255 99 71 / var(--tw-text-opacity, 1)); 14321} 14322.text-\\[var\\(--sc-base-content\\2c \\#000\\)\\] { 14323 color: var(--sc-base-content,#000); 14324} 14325.text-content { 14326 color: var(--sc-base-content); 14327} 14328.text-contrast-content { 14329 color: var(--sc-contrast-content); 14330} 14331.text-current { 14332 color: currentColor; 14333} 14334.text-danger { 14335 color: var(--sc-danger); 14336} 14337.text-danger-content { 14338 color: var(--sc-danger-content); 14339} 14340.text-info { 14341 color: var(--sc-info); 14342} 14343.text-info-content { 14344 color: var(--sc-info-content); 14345} 14346.text-neutral-0 { 14347 color: var(--sc-base); 14348} 14349.text-neutral-200 { 14350 color: var(--sc-base-200); 14351} 14352.text-neutral-300 { 14353 color: var(--sc-base-300); 14354} 14355.text-neutral-400 { 14356 color: var(--sc-base-400); 14357} 14358.text-neutral-500 { 14359 color: var(--sc-base-500); 14360} 14361.text-neutral-600 { 14362 color: var(--sc-base-600); 14363} 14364.text-neutral-700 { 14365 color: var(--sc-base-700); 14366} 14367.text-neutral-800 { 14368 color: var(--sc-base-800); 14369} 14370.text-neutral-900 { 14371 color: var(--sc-base-900); 14372} 14373.text-primary { 14374 color: var(--sc-primary); 14375} 14376.text-success { 14377 color: var(--sc-success); 14378} 14379.text-success-content { 14380 color: var(--sc-success-content); 14381} 14382.text-warning { 14383 color: var(--sc-warning); 14384} 14385.underline { 14386 text-decoration-line: underline; 14387} 14388.no-underline { 14389 text-decoration-line: none; 14390} 14391.underline-offset-2 { 14392 text-underline-offset: 2px; 14393} 14394.opacity-0 { 14395 opacity: 0; 14396} 14397.opacity-100 { 14398 opacity: 1; 14399} 14400.opacity-20 { 14401 opacity: 0.2; 14402} 14403.opacity-30 { 14404 opacity: 0.3; 14405} 14406.opacity-40 { 14407 opacity: 0.4; 14408} 14409.opacity-50 { 14410 opacity: 0.5; 14411} 14412.opacity-60 { 14413 opacity: 0.6; 14414} 14415.opacity-75 { 14416 opacity: 0.75; 14417} 14418.opacity-80 { 14419 opacity: 0.8; 14420} 14421.opacity-\\[\\.1\\] { 14422 opacity: .1; 14423} 14424.mix-blend-multiply { 14425 mix-blend-mode: multiply; 14426} 14427.shadow { 14428 --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
14429 --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); 14430 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14431} 14432.shadow-\\[0_-1rem_1rem_-1rem_rgba\\(0\\2c 0\\2c 0\\2c 0\\.1\\)\\] { 14433 --tw-shadow: 0 -1rem 1rem -1rem rgba(0,0,0,0.1); 14434 --tw-shadow-colored: 0 -1rem 1rem -1rem var(--tw-shadow-color); 14435 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14436} 14437.shadow-\\[0_-4px_16px_rgba\\(0\\2c 0\\2c 0\\2c 0\\.08\\)\\] { 14438 --tw-shadow: 0 -4px 16px rgba(0,0,0,0.08); 14439 --tw-shadow-colored: 0 -4px 16px var(--tw-shadow-color); 14440 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14441} 14442.shadow-\\[0_0_0_2px_var\\(--sc-base\\)\\] { 14443 --tw-shadow: 0 0 0 2px var(--sc-base); 14444 --tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color); 14445 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14446} 14447.shadow-\\[0_40px_50px_-70px_rgb\\(0_0_0_\\/_0\\.35\\)\\] { 14448 --tw-shadow: 0 40px 50px -70px rgb(0 0 0 / 0.35);
14449 --tw-shadow-colored: 0 40px 50px -70px var(--tw-shadow-color); 14450 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14451} 14452.shadow-lg { 14453 --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 14454 --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); 14455 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14456} 14457.shadow-md { 14458 --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); 14459 --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color); 14460 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14461} 14462.shadow-sm { 14463 --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); 14464 --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color); 14465 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14466} 14467.outline { 14468 outline-style: solid; 14469} 14470.blur { 14471 --tw-blur: blur(8px); 14472 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); 14473} 14474.blur-2xl { 14475 --tw-blur: blur(40px); 14476 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); 14477} 14478.drop-shadow-lg { 14479 --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)); 14480 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); 14481} 14482.drop-shadow-md { 14483 --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)); 14484 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); 14485} 14486.invert { 14487 --tw-invert: invert(100%); 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.\\!filter { 14491 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; 14492} 14493.filter { 14494 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); 14495} 14496.backdrop-blur { 14497 --tw-backdrop-blur: blur(8px); 14498 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); 14499} 14500.transition { 14501 transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; 14502 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14503 transition-duration: 150ms; 14504} 14505.transition-\\[boxShadow_\\.2s\\] { 14506 transition-property: boxShadow .2s; 14507 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14508 transition-duration: 150ms; 14509} 14510.transition-all { 14511 transition-property: all; 14512 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14513 transition-duration: 150ms; 14514} 14515.transition-colors { 14516 transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; 14517 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14518 transition-duration: 150ms; 14519} 14520.transition-opacity { 14521 transition-property: opacity; 14522 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14523 transition-duration: 150ms; 14524} 14525.transition-transform { 14526 transition-property: transform; 14527 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14528 transition-duration: 150ms; 14529} 14530.delay-200 { 14531 transition-delay: 200ms; 14532} 14533.delay-\\[160ms\\] { 14534 transition-delay: 160ms; 14535} 14536.delay-\\[80ms\\] { 14537 transition-delay: 80ms; 14538} 14539.duration-100 { 14540 transition-duration: 100ms; 14541} 14542.duration-200 { 14543 transition-duration: 200ms; 14544} 14545.duration-300 { 14546 transition-duration: 300ms; 14547} 14548.duration-500 { 14549 transition-duration: 500ms; 14550} 14551.duration-75 { 14552 transition-duration: 75ms; 14553} 14554.duration-\\[400ms\\] { 14555 transition-duration: 400ms; 14556} 14557.ease-\\[cubic-bezier\\(0\\.16\\2c 0\\.69\\2c 0\\.54\\2c 1\\.15\\)\\] { 14558 transition-timing-function: cubic-bezier(0.16,0.69,0.54,1.15); 14559} 14560.ease-in-out { 14561 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 14562} 14563.ease-linear { 14564 transition-timing-function: linear; 14565} 14566.ease-out { 14567 transition-timing-function: cubic-bezier(0, 0, 0.2, 1); 14568} 14569.will-change-transform { 14570 will-change: transform; 14571} 14572.\\@container { 14573 container-type: inline-size; 14574} 14575.\\[display\\:none\\] { 14576 display: none; 14577} 14578 14579.prose-xs svg[height="24"][width="24"], 14580.prose-sm svg[height="24"][width="24"], 14581.prose svg[height="24"][width="24"] { 14582 width: 1em; 14583 display: inline-block; 14584 height: 1em; 14585 vertical-align: -0.25em; 14586} 14587 14588@media (min-width: 1024px) { 14589 14590 .lg\\:prose-lg { 14591 font-size: 1.125rem; 14592 line-height: 1.7777778; 14593 } 14594 14595 .lg\\:prose-lg :where(p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14596 margin-top: 1.3333333em; 14597 margin-bottom: 1.3333333em; 14598 } 14599 14600 .lg\\:prose-lg :where([class~="lead"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14601 font-size: 1.2222222em; 14602 line-height: 1.4545455; 14603 margin-top: 1.0909091em; 14604 margin-bottom: 1.0909091em; 14605 } 14606 14607 .lg\\:prose-lg :where(blockquote):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14608 margin-top: 1.6666667em; 14609 margin-bottom: 1.6666667em; 14610 padding-inline-start: 1em; 14611 } 14612 14613 .lg\\:prose-lg :where(h1):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14614 font-size: 2.6666667em; 14615 margin-top: 0; 14616 margin-bottom: 0.8333333em; 14617 line-height: 1; 14618 } 14619 14620 .lg\\:prose-lg :where(h2):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14621 font-size: 1.6666667em; 14622 margin-top: 1.8666667em; 14623 margin-bottom: 1.0666667em; 14624 line-height: 1.3333333; 14625 } 14626 14627 .lg\\:prose-lg :where(h3):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14628 font-size: 1.3333333em; 14629 margin-top: 1.6666667em; 14630 margin-bottom: 0.6666667em; 14631 line-height: 1.5; 14632 } 14633 14634 .lg\\:prose-lg :where(h4):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14635 margin-top: 1.7777778em; 14636 margin-bottom: 0.4444444em; 14637 line-height: 1.5555556; 14638 } 14639 14640 .lg\\:prose-lg :where(img):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14641 margin-top: 1.7777778em; 14642 margin-bottom: 1.7777778em; 14643 } 14644 14645 .lg\\:prose-lg :where(picture):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14646 margin-top: 1.7777778em; 14647 margin-bottom: 1.7777778em; 14648 } 14649 14650 .lg\\:prose-lg :where(picture > img):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14651 margin-top: 0; 14652 margin-bottom: 0; 14653 } 14654 14655 .lg\\:prose-lg :where(video):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14656 margin-top: 1.7777778em; 14657 margin-bottom: 1.7777778em; 14658 } 14659 14660 .lg\\:prose-lg :where(kbd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14661 font-size: 0.8888889em; 14662 border-radius: 0.3125rem; 14663 padding-top: 0.2222222em; 14664 padding-inline-end: 0.4444444em; 14665 padding-bottom: 0.2222222em; 14666 padding-inline-start: 0.4444444em; 14667 } 14668 14669 .lg\\:prose-lg :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14670 font-size: 0.8888889em; 14671 } 14672 14673 .lg\\:prose-lg :where(h2 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14674 font-size: 0.8666667em; 14675 } 14676 14677 .lg\\:prose-lg :where(h3 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14678 font-size: 0.875em; 14679 } 14680 14681 .lg\\:prose-lg :where(pre):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14682 font-size: 0.8888889em; 14683 line-height: 1.75; 14684 margin-top: 2em; 14685 margin-bottom: 2em; 14686 border-radius: 0.375rem; 14687 padding-top: 1em; 14688 padding-inline-end: 1.5em; 14689 padding-bottom: 1em; 14690 padding-inline-start: 1.5em; 14691 } 14692 14693 .lg\\:prose-lg :where(ol):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(ul):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14700 margin-top: 1.3333333em; 14701 margin-bottom: 1.3333333em; 14702 padding-inline-start: 1.5555556em; 14703 } 14704 14705 .lg\\:prose-lg :where(li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14706 margin-top: 0.6666667em; 14707 margin-bottom: 0.6666667em; 14708 } 14709 14710 .lg\\:prose-lg :where(ol > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14711 padding-inline-start: 0.4444444em; 14712 } 14713 14714 .lg\\:prose-lg :where(ul > li):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14715 padding-inline-start: 0.4444444em; 14716 } 14717 14718 .lg\\:prose-lg :where(.lg\\:prose-lg > ul > li p):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14719 margin-top: 0.8888889em; 14720 margin-bottom: 0.8888889em; 14721 } 14722 14723 .lg\\:prose-lg :where(.lg\\:prose-lg > ul > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14724 margin-top: 1.3333333em; 14725 } 14726 14727 .lg\\:prose-lg :where(.lg\\:prose-lg > ul > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14728 margin-bottom: 1.3333333em; 14729 } 14730 14731 .lg\\:prose-lg :where(.lg\\:prose-lg > ol > li > p:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14732 margin-top: 1.3333333em; 14733 } 14734 14735 .lg\\:prose-lg :where(.lg\\:prose-lg > ol > li > p:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14736 margin-bottom: 1.3333333em; 14737 } 14738 14739 .lg\\:prose-lg :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14740 margin-top: 0.8888889em; 14741 margin-bottom: 0.8888889em; 14742 } 14743 14744 .lg\\:prose-lg :where(dl):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14745 margin-top: 1.3333333em; 14746 margin-bottom: 1.3333333em; 14747 } 14748 14749 .lg\\:prose-lg :where(dt):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14750 margin-top: 1.3333333em; 14751 } 14752
14753 .lg\\:prose-lg :where(dd):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14754 margin-top: 0.6666667em; 14755 padding-inline-start: 1.5555556em; 14756 } 14757 14758 .lg\\:prose-lg :where(hr):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14759 margin-top: 3.1111111em; 14760 margin-bottom: 3.1111111em; 14761 } 14762 14763 .lg\\:prose-lg :where(hr + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14764 margin-top: 0; 14765 } 14766 14767 .lg\\:prose-lg :where(h2 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14768 margin-top: 0; 14769 } 14770 14771 .lg\\:prose-lg :where(h3 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14772 margin-top: 0; 14773 } 14774 14775 .lg\\:prose-lg :where(h4 + *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14776 margin-top: 0; 14777 } 14778 14779 .lg\\:prose-lg :where(table):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14780 font-size: 0.8888889em; 14781 line-height: 1.5; 14782 } 14783 14784 .lg\\:prose-lg :where(thead th):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14785 padding-inline-end: 0.75em; 14786 padding-bottom: 0.75em; 14787 padding-inline-start: 0.75em; 14788 } 14789 14790 .lg\\:prose-lg :where(thead th:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14791 padding-inline-start: 0; 14792 } 14793 14794 .lg\\:prose-lg :where(thead th:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14795 padding-inline-end: 0; 14796 } 14797 14798 .lg\\:prose-lg :where(tbody td, tfoot td):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14799 padding-top: 0.75em; 14800 padding-inline-end: 0.75em; 14801 padding-bottom: 0.75em; 14802 padding-inline-start: 0.75em; 14803 } 14804 14805 .lg\\:prose-lg :where(tbody td:first-child, tfoot td:first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14806 padding-inline-start: 0; 14807 } 14808 14809 .lg\\:prose-lg :where(tbody td:last-child, tfoot td:last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14810 padding-inline-end: 0; 14811 } 14812 14813 .lg\\:prose-lg :where(figure):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14814 margin-top: 1.7777778em; 14815 margin-bottom: 1.7777778em; 14816 } 14817 14818 .lg\\:prose-lg :where(figure > *):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14819 margin-top: 0; 14820 margin-bottom: 0; 14821 } 14822 14823 .lg\\:prose-lg :where(figcaption):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14824 font-size: 0.8888889em; 14825 line-height: 1.5; 14826 margin-top: 1em; 14827 } 14828 14829 .lg\\:prose-lg :where(.lg\\:prose-lg > :first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14830 margin-top: 0; 14831 } 14832 14833 .lg\\:prose-lg :where(.lg\\:prose-lg > :last-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) { 14834 margin-bottom: 0; 14835 } 14836} 14837 14838.before\\:content-\\[\\'\\25B8_\\'\\]::before { 14839 --tw-content: '⸠'; 14840 content: var(--tw-content); 14841} 14842 14843.hover\\:scale-110:hover { 14844 --tw-scale-x: 1.1; 14845 --tw-scale-y: 1.1; 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-\\[\\.95\\]:hover { 14850 --tw-scale-x: .95; 14851 --tw-scale-y: .95; 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\\:scale-\\[103\\%\\]:hover { 14856 --tw-scale-x: 103%; 14857 --tw-scale-y: 103%; 14858 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)); 14859} 14860 14861.hover\\:border-neutral-200:hover { 14862 border-color: var(--sc-base-200); 14863} 14864 14865.hover\\:border-neutral-300:hover { 14866 border-color: var(--sc-base-300); 14867} 14868 14869.hover\\:border-neutral-400:hover { 14870 border-color: var(--sc-base-400); 14871} 14872 14873.hover\\:border-neutral-600:hover { 14874 border-color: var(--sc-base-600); 14875} 14876 14877.hover\\:bg-\\[rgba\\(0\\2c 0\\2c 0\\2c \\.02\\)\\]:hover { 14878 background-color: rgba(0,0,0,.02); 14879} 14880 14881.hover\\:bg-neutral-100:hover { 14882 background-color: var(--sc-base-100); 14883} 14884 14885.hover\\:bg-neutral-50:hover { 14886 background-color: var(--sc-base-50); 14887} 14888 14889.hover\\:bg-transparent:hover { 14890 background-color: transparent; 14891} 14892 14893.hover\\:text-current:hover {
14894 color: currentColor; 14895} 14896 14897.hover\\:text-neutral-600:hover { 14898 color: var(--sc-base-600); 14899} 14900 14901.hover\\:text-neutral-700:hover { 14902 color: var(--sc-base-700); 14903} 14904 14905.hover\\:text-neutral-800:hover { 14906 color: var(--sc-base-800); 14907} 14908 14909.hover\\:text-primary:hover { 14910 color: var(--sc-primary); 14911} 14912 14913.hover\\:underline:hover { 14914 text-decoration-line: underline; 14915} 14916 14917.hover\\:no-underline:hover { 14918 text-decoration-line: none; 14919} 14920 14921.hover\\:opacity-100:hover { 14922 opacity: 1; 14923} 14924 14925.hover\\:opacity-60:hover { 14926 opacity: 0.6; 14927} 14928 14929.hover\\:opacity-85:hover { 14930 opacity: 0.85; 14931} 14932 14933.hover\\:shadow:hover { 14934 --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); 14935 --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -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-shadow); 14937} 14938 14939.hover\\:shadow-\\[0_0_0_1px_rgba\\(0\\2c 0\\2c 0\\2c \\.02\\)\\]:hover { 14940 --tw-shadow: 0 0 0 1px rgba(0,0,0,.02); 14941 --tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color); 14942 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-sha
14942dow); 14943} 14944 14945.hover\\:shadow-\\[0_0_0_2px_var\\(--sc-base-50\\)\\]:hover { 14946 --tw-shadow: 0 0 0 2px var(--sc-base-50); 14947 --tw-shadow-colored: 0 0 0 2px 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-\\[0px_0px_0_3px_\\#ffb71d\\]:hover { 14952 --tw-shadow: 0px 0px 0 3px #ffb71d; 14953 --tw-shadow-colored: 0px 0px 0 3px 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-lg:hover { 14958 --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 14959 --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-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.hover\\:shadow-xl:hover { 14964 --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); 14965 --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-sha
14965dow-color); 14966 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 14967} 14968 14969.focus\\:border-2:focus { 14970 border-width: 2px; 14971} 14972 14973.focus\\:border-neutral-300:focus { 14974 border-color: var(--sc-base-300); 14975} 14976 14977.focus\\:border-neutral-900:focus { 14978 border-color: var(--sc-base-900); 14979} 14980 14981.focus\\:opacity-100:focus { 14982 opacity: 1; 14983} 14984 14985.group:focus-within .group-focus-within\\:scale-110 { 14986 --tw-scale-x: 1.1; 14987 --tw-scale-y: 1.1; 14988 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)); 14989} 14990 14991.group:focus-within .group-focus-within\\:opacity-100 { 14992 opacity: 1; 14993} 14994 14995.group:hover .group-hover\\:inline-flex { 14996 display: inline-flex; 14997} 14998 14999.group:hover .group-hover\\:hidden { 15000 display: none; 15001} 15002 15003.group:hover .group-hover\\:scale-110 { 15004 --tw-scale-x: 1.1; 15005 --tw-scale-y: 1.1; 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\\.15\\] { 15010 --tw-scale-x: 1.15; 15011 --tw-scale-y: 1.15; 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\\:scale-\\[1\\.1\\] { 15016 --tw-scale-x: 1.1; 15017 --tw-scale-y: 1.1; 15018 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)); 15019} 15020 15021.group:hover .group-hover\\:border { 15022 border-width: var(--sc-border-width); 15023} 15024 15025.group:hover .group-hover\\:border-\\[\\#4f0090\\] { 15026 --tw-border-opacity: 1; 15027 border-color: rgb(79 0 144 / var(--tw-border-opacity, 1)); 15028} 15029 15030.group:hover .group-hover\\:border-\\[\\#ff9b85\\] { 15031 --tw-border-opacity: 1; 15032 border-color: rgb(255 155 133 / var(--tw-border-opacity, 1)); 15033} 15034 15035.group:hover .group-hover\\:border-neutral-200 { 15036 border-color: var(--sc-base-200); 15037} 15038 15039.group:hover .group-hover\\:text-neutral-500 { 15040 color: var(--sc-base-500); 15041} 15042 15043.group:hover .group-hover\\:underline { 15044 text-decoration-line: underline; 15045} 15046 15047.group:hover .group-hover\\:opacity-0 { 15048 opacity: 0; 15049} 15050 15051.group:hover .group-hover\\:opacity-100 { 15052 opacity: 1; 15053} 15054 15055.group:hover .group-hover\\:opacity-70 { 15056 opacity: 0.7; 15057} 15058 15059.group:focus .group-focus\\:border-neutral-300 { 15060 border-color: var(--sc-base-300); 15061} 15062 15063@container (min-width: 20rem) { 15064 15065 .\\@xs\\:left-5 { 15066 left: 1.25rem; 15067 } 15068 15069 .\\@xs\\:top-5 { 15070 top: 1.25rem; 15071 } 15072 15073 .\\@xs\\:inline-block { 15074 display: inline-block; 15075 } 15076 15077 .\\@xs\\:p-5 { 15078 padding: 1.25rem; 15079 } 15080 15081 .\\@xs\\:text-xl { 15082 font-size: 1.25rem; 15083 } 15084 15085 .\\@xs\\:leading-tight { 15086 line-height: 1.25; 15087 } 15088} 15089 15090@container (min-width: 24rem) { 15091 15092 .\\@sm\\:left-6 { 15093 left: 1.5rem; 15094 } 15095 15096 .\\@sm\\:top-6 { 15097 top: 1.5rem; 15098 } 15099 15100 .\\@sm\\:w-\\[12rem\\] { 15101 width: 12rem; 15102 } 15103 15104 .\\@sm\\:grid-cols-2 { 15105 grid-template-columns: repeat(2, minmax(0, 1fr)); 15106 } 15107 15108 .\\@sm\\:flex-row { 15109 flex-direction: row; 15110 } 15111 15112 .\\@sm\\:gap-2 { 15113 gap: 0.5rem; 15114 } 15115 15116 .\\@sm\\:rounded-lg { 15117 border-radius: var(--sc-rounded-lg); 15118 } 15119 15120 .\\@sm\\:border { 15121 border-width: var(--sc-border-width); 15122 } 15123 15124 .\\@sm\\:p-3 { 15125 padding: 0.75rem; 15126 } 15127 15128 .\\@sm\\:p-4 { 15129 padding: 1rem; 15130 } 15131 15132 .\\@sm\\:p-5 { 15133 padding: 1.25rem; 15134 } 15135 15136 .\\@sm\\:p-6 { 15137 padding: 1.5rem; 15138 } 15139 15140 .\\@sm\\:text-2xl { 15141 font-size: 1.5rem; 15142 } 15143 15144 .\\@sm\\:text-\\[4\\.75rem\\] { 15145 font-size: 4.75rem; 15146 } 15147 15148 .\\@sm\\:text-base { 15149 font-size: 1rem; 15150 } 15151 15152 .\\@sm\\:text-sm { 15153 font-size: 0.875rem; 15154 } 15155 15156 .\\@sm\\:leading-none { 15157 line-height: 1; 15158 } 15159 15160 .\\@sm\\:leading-tight { 15161 line-height: 1.25; 15162 } 15163 15164 .\\@sm\\:hover\\:border-neutral-300:hover { 15165 border-color: var(--sc-base-300); 15166 } 15167 15168 .\\@sm\\:focus\\:border-neutral-300:focus { 15169 border-color: var(--sc-base-300); 15170 } 15171} 15172 15173@container (min-width: 28rem) { 15174 15175 .\\@md\\:right-3 { 15176 right: 0.75rem; 15177 } 15178 15179 .\\@md\\:top-3 { 15180 top: 0.75rem; 15181 } 15182 15183 .\\@md\\:row-span-1 {
15184 grid-row: span 1 / span 1; 15185 } 15186 15187 .\\@md\\:block { 15188 display: block; 15189 } 15190 15191 .\\@md\\:inline-block { 15192 display: inline-block; 15193 } 15194 15195 .\\@md\\:flex { 15196 display: flex; 15197 } 15198 15199 .\\@md\\:hidden { 15200 display: none; 15201 } 15202 15203 .\\@md\\:w-1\\/3 { 15204 width: 33.333333%; 15205 } 15206 15207 .\\@md\\:w-1\\/4 { 15208 width: 25%; 15209 } 15210 15211 .\\@md\\:w-20 { 15212 width: 5rem; 15213 } 15214 15215 .\\@md\\:w-auto { 15216 width: auto; 15217 } 15218 15219 .\\@md\\:grid-cols-3 { 15220 grid-template-columns: repeat(3, minmax(0, 1fr)); 15221 } 15222 15223 .\\@md\\:grid-cols-\\[1fr\\2c 2\\.5rem\\] { 15224 grid-template-columns: 1fr 2.5rem; 15225 } 15226 15227 .\\@md\\:grid-cols-\\[6rem\\2c 1fr\\2c 2\\.5rem\\] { 15228 grid-template-columns: 6rem 1fr 2.5rem; 15229 } 15230 15231 .\\@md\\:grid-cols-\\[minmax\\(0\\2c 1fr\\)_10rem\\] { 15232 grid-template-columns: minmax(0,1fr) 10rem; 15233 } 15234 15235 .\\@md\\:grid-cols-\\[minmax\\(0\\2c _12rem\\)\\2c _minmax\\(0\\2c _3fr\\)\\] { 15236 grid-template-columns: minmax(0, 12rem) minmax(0, 3fr); 15237 } 15238 15239 .\\@md\\:gap-4 { 15240 gap: 1rem; 15241 } 15242 15243 .\\@md\\:border-l { 15244 border-left-width: var(--sc-border-width); 15245 } 15246 15247 .\\@md\\:border-l-neutral-200 { 15248 border-left-color: var(--sc-base-200); 15249 } 15250 15251 .\\@md\\:p-4 { 15252 padding: 1rem; 15253 } 15254 15255 .\\@md\\:p-6 { 15256 padding: 1.5rem; 15257 } 15258 15259 .\\@md\\:px-0 { 15260 padding-left: 0px; 15261 padding-right: 0px; 15262 } 15263 15264 .\\@md\\:py-2 { 15265 padding-top: 0.5rem; 15266 padding-bottom: 0.5rem; 15267 } 15268 15269 .\\@md\\:pl-3 { 15270 padding-left: 0.75rem; 15271 } 15272 15273 .\\@md\\:text-\\[\\.9rem\\] { 15274 font-size: .9rem; 15275 } 15276 15277 .\\@md\\:text-\\[1\\.05rem\\] { 15278 font-size: 1.05rem; 15279 } 15280 15281 .\\@md\\:text-base { 15282 font-size: 1rem; 15283 } 15284 15285 .\\@md\\:text-sm { 15286 font-size: 0.875rem; 15287 } 15288 15289 .\\@md\\:leading-none { 15290 line-height: 1; 15291 } 15292 15293 .\\@md\\:leading-tight { 15294 line-height: 1.25; 15295 } 15296} 15297 15298@container (min-width: 32rem) { 15299 15300 .\\@lg\\:col-start-1 { 15301 grid-column-start: 1; 15302 } 15303 15304 .\\@lg\\:ml-1 { 15305 margin-left: 0.25rem; 15306 } 15307 15308 .\\@lg\\:mt-0 { 15309 margin-top: 0px; 15310 } 15311 15312 .\\@lg\\:block { 15313 display: block; 15314 } 15315 15316 .\\@lg\\:inline-block { 15317 display: inline-block; 15318 } 15319 15320 .\\@lg\\:flex { 15321 display: flex; 15322 } 15323 15324 .\\@lg\\:grid { 15325 display: grid; 15326 } 15327 15328 .\\@lg\\:min-h-\\[2rem\\] { 15329 min-height: 2rem; 15330 } 15331 15332 .\\@lg\\:w-\\[12rem\\] { 15333 width: 12rem; 15334 } 15335 15336 .\\@lg\\:min-w-20 { 15337 min-width: 5rem; 15338 } 15339 15340 .\\@lg\\:min-w-\\[3ch\\] { 15341 min-width: 3ch; 15342 } 15343 15344 .\\@lg\\:min-w-\\[6ch\\] { 15345 min-width: 6ch; 15346 } 15347 15348 .\\@lg\\:min-w-\\[8\\.5ch\\] { 15349 min-width: 8.5ch; 15350 } 15351 15352 .\\@lg\\:grid-cols-2 { 15353 grid-template-columns: repeat(2, minmax(0, 1fr)); 15354 } 15355 15356 .\\@lg\\:grid-cols-3 { 15357 grid-template-columns: repeat(3, minmax(0, 1fr)); 15358 } 15359 15360 .\\@lg\\:grid-cols-5 { 15361 grid-template-columns: repeat(5, minmax(0, 1fr)); 15362 } 15363 15364 .\\@lg\\:flex-row { 15365 flex-direction: row; 15366 } 15367 15368 .\\@lg\\:flex-col { 15369 flex-direction: column; 15370 } 15371 15372 .\\@lg\\:flex-nowrap { 15373 flex-wrap: nowrap; 15374 } 15375 15376 .\\@lg\\:items-end { 15377 align-items: flex-end; 15378 } 15379 15380 .\\@lg\\:justify-center { 15381 justify-content: center; 15382 } 15383 15384 .\\@lg\\:gap-2 { 15385 gap: 0.5rem; 15386 } 15387 15388 .\\@lg\\:gap-x-3 { 15389 -moz-column-gap: 0.75rem; 15390 column-gap: 0.75rem; 15391 } 15392 15393 .\\@lg\\:px-4 { 15394 padding-left: 1rem; 15395 padding-right: 1rem; 15396 } 15397 15398 .\\@lg\\:pb-2 { 15399 padding-bottom: 0.5rem; 15400 } 15401 15402 .\\@lg\\:pr-2 { 15403 padding-right: 0.5rem; 15404 } 15405 15406 .\\@lg\\:text-left { 15407 text-align: left; 15408 } 15409 15410 .\\@lg\\:text-3xl { 15411 font-size: 1.875rem; 15412 } 15413 15414 .\\@lg\\:text-lg { 15415 font-size: 1.125rem; 15416 } 15417 15418 .\\@lg\\:text-sm { 15419 font-size: 0.875rem; 15420 } 15421 15422 .\\@lg\\:text-xs { 15423 font-size: 0.75rem; 15424 } 15425 15426 .\\@lg\\:leading-tight { 15427 line-height: 1.25; 15428 } 15429} 15430 15431@container (min-width: 36rem) { 15432 15433 .\\@xl\\:col-\\[2\\/-1\\] { 15434 grid-column: 2/-1; 15435 } 15436 15437 .\\@xl\\:col-auto { 15438 grid-column: auto; 15439 } 15440 15441 .\\@xl\\:col-span-1 { 15442 grid-column: span 1 / span 1; 15443 } 15444 15445 .\\@xl\\:col-span-2 { 15446 grid-column: span 2 / span 2; 15447 } 15448 15449 .\\@xl\\:mb-5 { 15450 margin-bottom: 1.25rem; 15451 } 15452 15453 .\\@xl\\:block { 15454 display: block; 15455 } 15456 15457 .\\@xl\\:inline-block { 15458 display: inline-block; 15459 } 15460 15461 .\\@xl\\:flex { 15462 display: flex; 15463 } 15464 15465 .\\@xl\\:grid { 15466 display: grid; 15467 } 15468 15469 .\\@xl\\:hidden { 15470 display: none; 15471 } 15472 15473 .\\@xl\\:w-14 { 15474 width: 3.5rem; 15475 } 15476 15477 .\\@xl\\:w-\\[15rem\\] { 15478 width: 15rem; 15479 } 15480 15481 .\\@xl\\:max-w-60 { 15482 max-width: 15rem; 15483 } 15484 15485 .\\@xl\\:max-w-\\[30rem\\] { 15486 max-width: 30rem; 15487 } 15488 15489 .\\@xl\\:grid-cols-2 { 15490 grid-template-columns: repeat(2, minmax(0, 1fr)); 15491 } 15492 15493 .\\@xl\\:grid-cols-3 { 15494 grid-template-columns: repeat(3, minmax(0, 1fr)); 15495 } 15496 15497 .\\@xl\\:grid-cols-\\[4rem\\2c 7\\.5rem\\2c 1fr\\2c 2\\.5rem\\] { 15498 grid-template-columns: 4rem 7.5rem 1fr 2.5rem; 15499 } 15500 15501 .\\@xl\\:grid-cols-\\[7\\.5rem\\2c 1fr\\2c 2\\.5rem\\] { 15502 grid-template-columns: 7.5rem 1fr 2.5rem; 15503 } 15504 15505 .\\@xl\\:grid-cols-\\[max\\(6rem\\2c _13\\%\\)_minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 1fr\\)\\] { 15506 grid-template-columns: max(6rem, 13%) minmax(0,1fr) minmax(0,1fr); 15507 } 15508 15509 .\\@xl\\:grid-cols-\\[minmax\\(0\\2c _12rem\\)\\2c _minmax\\(0\\2c _1fr\\)\\] { 15510 grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); 15511 } 15512 15513 .\\@xl\\:grid-rows-4 { 15514 grid-template-rows: repeat(4, minmax(0, 1fr)); 15515 } 15516 15517 .\\@xl\\:flex-row { 15518 flex-direction: row; 15519 } 15520 15521 .\\@xl\\:items-center {
15522 align-items: center; 15523 } 15524 15525 .\\@xl\\:gap-4 { 15526 gap: 1rem; 15527 } 15528 15529 .\\@xl\\:gap-6 { 15530 gap: 1.5rem; 15531 } 15532 15533 .\\@xl\\:gap-x-4 { 15534 -moz-column-gap: 1rem; 15535 column-gap: 1rem; 15536 } 15537 15538 .\\@xl\\:gap-y-7 { 15539 row-gap: 1.75rem; 15540 } 15541 15542 .\\@xl\\:border-none { 15543 border-style: none; 15544 } 15545 15546 .\\@xl\\:p-4 { 15547 padding: 1rem; 15548 } 15549 15550 .\\@xl\\:pl-3 { 15551 padding-left: 0.75rem; 15552 } 15553 15554 .\\@xl\\:pr-2 { 15555 padding-right: 0.5rem; 15556 } 15557 15558 .\\@xl\\:pt-0 { 15559 padding-top: 0px; 15560 } 15561 15562 .\\@xl\\:text-2xl { 15563 font-size: 1.5rem; 15564 } 15565 15566 .\\@xl\\:text-base { 15567 font-size: 1rem; 15568 } 15569 15570 .\\@xl\\:text-lg { 15571 font-size: 1.125rem; 15572 } 15573 15574 .\\@xl\\:text-sm { 15575 font-size: 0.875rem; 15576 } 15577 15578 .\\@xl\\:text-xl { 15579 font-size: 1.25rem; 15580 } 15581 15582 .\\@xl\\:leading-tight { 15583 line-height: 1.25; 15584 } 15585} 15586 15587@container (min-width: 42rem) { 15588 15589 .\\@2xl\\:mt-2 { 15590 margin-top: 0.5rem; 15591 } 15592 15593 .\\@2xl\\:block { 15594 display: block; 15595 } 15596 15597 .\\@2xl\\:flex { 15598 display: flex; 15599 } 15600 15601 .\\@2xl\\:hidden { 15602 display: none; 15603 } 15604 15605 .\\@2xl\\:grid-cols-2 { 15606 grid-template-columns: repeat(2, minmax(0, 1fr)); 15607 } 15608 15609 .\\@2xl\\:grid-cols-3 { 15610 grid-template-columns: repeat(3, minmax(0, 1fr)); 15611 } 15612 15613 .\\@2xl\\:grid-cols-\\[minmax\\(0\\2c _12rem\\)\\2c _minmax\\(0\\2c _1fr\\)\\] { 15614 grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); 15615 } 15616 15617 .\\@2xl\\:flex-nowrap { 15618 flex-wrap: nowrap; 15619 } 15620 15621 .\\@2xl\\:pl-6 { 15622 padding-left: 1.5rem; 15623 } 15624 15625 .\\@2xl\\:text-2xl { 15626 font-size: 1.5rem; 15627 } 15628 15629 .\\@2xl\\:text-xl { 15630 font-size: 1.25rem; 15631 } 15632} 15633 15634@container (min-width: 48rem) { 15635 15636 .\\@3xl\\:mb-3 { 15637 margin-bottom: 0.75rem; 15638 } 15639 15640 .\\@3xl\\:block { 15641 display: block; 15642 } 15643 15644 .\\@3xl\\:flex { 15645 display: flex; 15646 } 15647 15648 .\\@3xl\\:hidden { 15649 display: none; 15650 } 15651 15652 .\\@3xl\\:grid-cols-2 { 15653 grid-template-columns: repeat(2, minmax(0, 1fr)); 15654 } 15655 15656 .\\@3xl\\:grid-cols-3 { 15657 grid-template-columns: repeat(3, minmax(0, 1fr)); 15658 } 15659 15660 .\\@3xl\\:grid-cols-4 { 15661 grid-template-columns: repeat(4, minmax(0, 1fr)); 15662 } 15663 15664 .\\@3xl\\:grid-cols-\\[8\\.4rem_10rem_1fr_auto\\] { 15665 grid-template-columns: 8.4rem 10rem 1fr auto; 15666 } 15667 15668 .\\@3xl\\:grid-rows-2 { 15669 grid-template-rows: repeat(2, minmax(0, 1fr)); 15670 } 15671 15672 .\\@3xl\\:flex-row { 15673 flex-direction: row; 15674 } 15675 15676 .\\@3xl\\:justify-normal { 15677 justify-content: normal; 15678 } 15679 15680 .\\@3xl\\:gap-x-12 { 15681 -moz-column-gap: 3rem; 15682 column-gap: 3rem; 15683 } 15684 15685 .\\@3xl\\:gap-x-8 { 15686 -moz-column-gap: 2rem; 15687 column-gap: 2rem; 15688 } 15689 15690 .\\@3xl\\:gap-y-12 { 15691 row-gap: 3rem; 15692 } 15693 15694 .\\@3xl\\:pr-3 { 15695 padding-right: 0.75rem; 15696 } 15697 15698 .\\@3xl\\:text-3xl { 15699 font-size: 1.875rem; 15700 } 15701 15702 .\\@3xl\\:leading-tight { 15703 line-height: 1.25; 15704 } 15705} 15706 15707@container (min-width: 56rem) { 15708 15709 .\\@4xl\\:block { 15710 display: block; 15711 } 15712 15713 .\\@4xl\\:hidden { 15714 display: none; 15715 } 15716 15717 .\\@4xl\\:grid-cols-2 { 15718 grid-template-columns: repeat(2, minmax(0, 1fr)); 15719 } 15720 15721 .\\@4xl\\:grid-cols-\\[minmax\\(0\\2c 2fr\\)_minmax\\(0\\2c 1\\.2fr\\)\\] { 15722 grid-template-columns: minmax(0,2fr) minmax(0,1.2fr); 15723 } 15724 15725 .\\@4xl\\:gap-12 { 15726 gap: 3rem; 15727 } 15728} 15729 15730@container (min-width: 64rem) { 15731 15732 .\\@5xl\\:col-span-2 { 15733 grid-column: span 2 / span 2; 15734 } 15735 15736 .\\@5xl\\:block { 15737 display: block; 15738 } 15739 15740 .\\@5xl\\:flex { 15741 display: flex; 15742 } 15743 15744 .\\@5xl\\:grid-cols-2 { 15745 grid-template-columns: repeat(2, minmax(0, 1fr)); 15746 } 15747 15748 .\\@5xl\\:grid-cols-3 { 15749 grid-template-columns: repeat(3, minmax(0, 1fr)); 15750 } 15751 15752 .\\@5xl\\:grid-cols-\\[8\\.4rem_20rem_1fr_auto\\] { 15753 grid-template-columns: 8.4rem 20rem 1fr auto; 15754 } 15755 15756 .\\@5xl\\:grid-cols-\\[minmax\\(0\\2c 2fr\\)_minmax\\(0\\2c 1fr\\)\\] { 15757 grid-template-columns: minmax(0,2fr) minmax(0,1fr); 15758 } 15759 15760 .\\@5xl\\:grid-cols-\\[minmax\\(0\\2c _12rem\\)\\2c _auto\\2c _minmax\\(0\\2c _1fr\\)\\] { 15761 grid-template-columns: minmax(0, 12rem) auto minmax(0, 1fr); 15762 } 15763 15764 .\\@5xl\\:gap-7 { 15765 gap: 1.75rem; 15766 } 15767 15768 .\\@5xl\\:pl-4 { 15769 padding-left: 1rem; 15770 } 15771} 15772 15773@container (min-width: 72rem) { 15774 15775 .\\@6xl\\:grid-cols-3 { 15776 grid-template-columns: repeat(3, minmax(0, 1fr)); 15777 } 15778 15779 .\\@6xl\\:grid-cols-4 { 15780 grid-template-columns: repeat(4, minmax(0, 1fr)); 15781 } 15782} 15783 15784@container (min-width: 80rem) { 15785 15786 .\\@7xl\\:block { 15787 display: block; 15788 } 15789 15790 .\\@7xl\\:grid-cols-3 { 15791 grid-template-columns: repeat(3, minmax(0, 1fr)); 15792 } 15793} 15794 15795@container (min-width: 660px) { 15796 15797 .\\@\\[660px\\]\\:block { 15798 display: block; 15799 } 15800 15801 .\\@\\[660px\\]\\:gap-\\[13px\\] { 15802 gap: 13px; 15803 } 15804 15805 .\\@\\[660px\\]\\:gap-\\[14px\\] { 15806 gap: 14px; 15807 } 15808 15809 .\\@\\[660px\\]\\:p-\\[13px\\] { 15810 padding: 13px; 15811 } 15812 15813 .\\@\\[660px\\]\\:p-\\[14px\\] { 15814 padding: 14px; 15815 } 15816 15817 .\\@\\[660px\\]\\:px-0 { 15818 padding-left: 0px; 15819 padding-right: 0px; 15820 } 15821 15822 .\\@\\[660px\\]\\:py-1 { 15823 padding-top: 0.25rem; 15824 padding-bottom: 0.25rem; 15825 } 15826 15827 .\\@\\[660px\\]\\:text-\\[1\\.15em\\] { 15828 font-size: 1.15em; 15829 } 15830 15831 .\\@\\[660px\\]\\:text-\\[1em\\] { 15832 font-size: 1em; 15833 } 15834} 15835 15836@container (min-width: 1500px) { 15837 15838 .\\@\\[1500px\\]\\:grid-cols-2 { 15839 grid-template-columns: repeat(2, minmax(0, 1fr)); 15840 } 15841} 15842 15843@media (min-width: 640px) { 15844 15845 .sm\\:grid-cols-2 { 15846 grid-template-columns: repeat(2, minmax(0, 1fr)); 15847 } 15848 15849 .sm\\:flex-row { 15850 flex-direction: row; 15851 } 15852 15853 .sm\\:items-center {
15854 align-items: center; 15855 } 15856 15857 .sm\\:justify-between { 15858 justify-content: space-between; 15859 } 15860} 15861 15862@media (min-width: 768px) { 15863 15864 .md\\:mb-2 { 15865 margin-bottom: 0.5rem; 15866 } 15867 15868 .md\\:block { 15869 display: block; 15870 } 15871 15872 .md\\:w-auto { 15873 width: auto; 15874 } 15875 15876 .md\\:grid-cols-2 { 15877 grid-template-columns: repeat(2, minmax(0, 1fr)); 15878 } 15879 15880 .md\\:grid-cols-\\[1fr_9\\.75rem\\] { 15881 grid-template-columns: 1fr 9.75rem; 15882 } 15883 15884 .md\\:flex-row { 15885 flex-direction: row; 15886 } 15887 15888 .md\\:rounded-md { 15889 border-radius: var(--sc-rounded-md); 15890 } 15891 15892 .md\\:border { 15893 border-width: var(--sc-border-width); 15894 } 15895 15896 .md\\:px-2 { 15897 padding-left: 0.5rem; 15898 padding-right: 0.5rem; 15899 } 15900 15901 .md\\:pb-0 { 15902 padding-bottom: 0px; 15903 } 15904 15905 .md\\:pt-2 { 15906 padding-top: 0.5rem; 15907 } 15908 15909 .md\\:text-3xl { 15910 font-size: 1.875rem; 15911 } 15912 15913 .md\\:text-4xl { 15914 font-size: 2.25rem; 15915 } 15916 15917 .md\\:text-5xl { 15918 font-size: 3rem; 15919 } 15920 15921 .md\\:text-sm { 15922 font-size: 0.875rem; 15923 } 15924 15925 .md\\:leading-\\[1\\.1\\] { 15926 line-height: 1.1; 15927 } 15928} 15929 15930@media (min-width: 1024px) { 15931 15932 .lg\\:sticky { 15933 position: sticky; 15934 } 15935 15936 .lg\\:col-span-2 { 15937 grid-column: span 2 / span 2; 15938 } 15939 15940 .lg\\:col-span-4 { 15941 grid-column: span 4 / span 4; 15942 } 15943 15944 .lg\\:-mx-0 { 15945 margin-left: -0px; 15946 margin-right: -0px; 15947 } 15948 15949 .lg\\:mx-2 { 15950 margin-left: 0.5rem; 15951 margin-right: 0.5rem; 15952 } 15953 15954 .lg\\:my-2 { 15955 margin-top: 0.5rem; 15956 margin-bottom: 0.5rem; 15957 } 15958 15959 .lg\\:-mr-\\[calc\\(var\\(--sc-container-gutter-x\\)_-_var\\(--sc-container-gutter-y\\)\\)\\] { 15960 margin-right: calc(calc(var(--sc-container-gutter-x) - var(--sc-container-gutter-y)) * -1); 15961 } 15962 15963 .lg\\:-mt-0 { 15964 margin-top: -0px; 15965 } 15966 15967 .lg\\:mb-12 { 15968 margin-bottom: 3rem; 15969 } 15970 15971 .lg\\:mb-2 { 15972 margin-bottom: 0.5rem; 15973 } 15974 15975 .lg\\:mb-3 { 15976 margin-bottom: 0.75rem; 15977 } 15978 15979 .lg\\:mb-5 { 15980 margin-bottom: 1.25rem; 15981 } 15982 15983 .lg\\:mb-\\[2\\.5rem\\] { 15984 margin-bottom: 2.5rem; 15985 } 15986 15987 .lg\\:mr-3 { 15988 margin-right: 0.75rem; 15989 } 15990 15991 .lg\\:mt-16 { 15992 margin-top: 4rem; 15993 } 15994 15995 .lg\\:mt-8 { 15996 margin-top: 2rem; 15997 } 15998 15999 .lg\\:block { 16000 display: block; 16001 } 16002 16003 .lg\\:flex { 16004 display: flex; 16005 } 16006 16007 .lg\\:grid { 16008 display: grid; 16009 } 16010 16011 .lg\\:contents { 16012 display: contents; 16013 } 16014 16015 .lg\\:hidden { 16016 display: none; 16017 } 16018 16019 .lg\\:aspect-\\[16\\/9\\] { 16020 aspect-ratio: 16/9; 16021 } 16022 16023 .lg\\:h-\\[calc\\(100vh-4rem\\)\\] { 16024 height: calc(100vh - 4rem); 16025 } 16026 16027 .lg\\:h-full { 16028 height: 100%; 16029 } 16030 16031 .lg\\:max-h-\\[50vh\\] { 16032 max-height: 50vh; 16033 } 16034 16035 .lg\\:min-h-\\[calc\\(100vh_-_11rem\\)\\] { 16036 min-height: calc(100vh - 11rem); 16037 } 16038 16039 .lg\\:w-\\[25rem\\] { 16040 width: 25rem; 16041 } 16042 16043 .lg\\:w-auto { 16044 width: auto; 16045 } 16046 16047 .lg\\:min-w-\\[10rem\\] { 16048 min-width: 10rem; 16049 } 16050 16051 .lg\\:min-w-\\[11rem\\] { 16052 min-width: 11rem; 16053 } 16054 16055 .lg\\:min-w-\\[30rem\\] { 16056 min-width: 30rem; 16057 } 16058 16059 .lg\\:max-w-\\[15rem\\] { 16060 max-width: 15rem; 16061 } 16062 16063 .lg\\:max-w-\\[19ch\\] { 16064 max-width: 19ch; 16065 } 16066 16067 .lg\\:max-w-\\[25rem\\] { 16068 max-width: 25rem; 16069 } 16070 16071 .lg\\:max-w-\\[32rem\\] { 16072 max-width: 32rem; 16073 } 16074 16075 .lg\\:grow-0 { 16076 flex-grow: 0; 16077 } 16078 16079 .lg\\:grid-cols-2 { 16080 grid-template-columns: repeat(2, minmax(0, 1fr)); 16081 } 16082 16083 .lg\\:grid-cols-3 { 16084 grid-template-columns: repeat(3, minmax(0, 1fr)); 16085 } 16086 16087 .lg\\:grid-cols-4 { 16088 grid-template-columns: repeat(4, minmax(0, 1fr)); 16089 } 16090 16091 .lg\\:grid-cols-\\[1fr\\2c _2fr\\] { 16092 grid-template-columns: 1fr 2fr; 16093 } 16094 16095 .lg\\:grid-cols-\\[2fr_1fr\\] { 16096 grid-template-columns: 2fr 1fr; 16097 } 16098 16099 .lg\\:grid-cols-\\[minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 1\\.2fr\\)\\] { 16100 grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); 16101 } 16102 16103 .lg\\:grid-cols-\\[minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 1\\.5fr\\)\\] { 16104 grid-template-columns: minmax(0,1fr) minmax(0,1.5fr); 16105 } 16106 16107 .lg\\:grid-cols-\\[minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 10fr\\)\\] { 16108 grid-template-columns: minmax(0,1fr) minmax(0,10fr); 16109 } 16110 16111 .lg\\:grid-cols-\\[minmax\\(0\\2c 1fr\\)_minmax\\(0\\2c 1fr\\)\\] { 16112 grid-template-columns: minmax(0,1fr) minmax(0,1fr); 16113 } 16114 16115 .lg\\:grid-cols-\\[minmax\\(0\\2c 3fr\\)_minmax\\(0\\2c 1fr\\)\\] { 16116 grid-template-columns: minmax(0,3fr) minmax(0,1fr); 16117 } 16118 16119 .lg\\:grid-cols-\\[minmax\\(0\\2c 4fr\\)_16\\.2rem\\] { 16120 grid-template-columns: minmax(0,4fr) 16.2rem; 16121 } 16122 16123 .lg\\:grid-cols-\\[minmax\\(0\\2c 5fr\\)_minmax\\(0\\2c _1\\.75fr\\)\\] { 16124 grid-template-columns: minmax(0,5fr) minmax(0, 1.75fr); 16125 } 16126 16127 .lg\\:grid-cols-\\[minmax\\(0\\2c _3fr\\)_minmax\\(0\\2c _2fr\\)\\] { 16128 grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); 16129 } 16130 16131 .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\\)\\] { 16132 grid-template-columns: minmax(0, 5fr) minmax(0, 3.5fr) minmax(0, 3fr) minmax(0, 1.8fr) minmax(0, 1.8fr); 16133 } 16134 16135 .lg\\:flex-row { 16136 flex-direction: row; 16137 } 16138 16139 .lg\\:gap-4 { 16140 gap: 1rem; 16141 } 16142 16143 .lg\\:gap-5 { 16144 gap: 1.25rem; 16145 } 16146 16147 .lg\\:gap-x-14 { 16148 -moz-column-gap: 3.5rem; 16149 column-gap: 3.5rem; 16150 } 16151 16152 .lg\\:gap-x-5 { 16153 -moz-column-gap: 1.25rem; 16154 column-gap: 1.25rem; 16155 } 16156 16157 .lg\\:gap-y-8 { 16158 row-gap: 2rem; 16159 } 16160 16161 .lg\\:divide-x > :not([hidden]) ~ :not([hidden]) { 16162 --tw-divide-x-reverse: 0; 16163 border-right-width: calc(var(--sc-border-width) * var(--tw-divide-x-reverse)); 16164 border-left-width: calc(var(--sc-border-width) * calc(1 - var(--tw-divide-x-reverse))); 16165 } 16166 16167 .lg\\:divide-neutral-200 > :not([hidden]) ~ :not([hidden]) { 16168 border-color: var(--sc-base-200); 16169 } 16170 16171 .lg\\:border-l { 16172 border-left-width: var(--sc-border-width); 16173 } 16174 16175 .lg\\:px-20 { 16176 padding-left: 5rem; 16177 padding-right: 5rem; 16178 } 16179 16180 .lg\\:px-3 { 16181 padding-left: 0.75rem; 16182 padding-right: 0.75rem; 16183 } 16184 16185 .lg\\:px-6 { 16186 padding-left: 1.5rem; 16187 padding-right: 1.5rem; 16188 } 16189 16190 .lg\\:px-\\[--sc-modal-px\\] { 16191 padding-left: var(--sc-modal-px); 16192 padding-right: var(--sc-modal-px); 16193 } 16194 16195 .lg\\:py-2 { 16196 padding-top: 0.5rem; 16197 padding-bottom: 0.5rem; 16198 } 16199 16200 .lg\\:pl-4 { 16201 padding-left: 1rem; 16202 } 16203 16204 .lg\\:pl-6 { 16205 padding-left: 1.5rem; 16206 } 16207 16208 .lg\\:pl-7 { 16209 padding-left: 1.75rem; 16210 } 16211 16212 .lg\\:text-2xl { 16213 font-size: 1.5rem; 16214 } 16215 16216 .lg\\:text-3xl { 16217 font-size: 1.875rem; 16218 } 16219 16220 .lg\\:text-4xl { 16221 font-size: 2.25rem; 16222 } 16223 16224 .lg\\:text-5xl { 16225 font-size: 3rem; 16226 } 16227 16228 .lg\\:text-7xl { 16229 font-size: 4.5rem; 16230 } 16231 16232 .lg\\:text-\\[1rem\\] { 16233 font-size: 1rem; 16234 } 16235 16236 .lg\\:text-base { 16237 font-size: 1rem; 16238 } 16239 16240 .lg\\:text-sm { 16241 font-size: 0.875rem; 16242 } 16243 16244 .lg\\:text-xl { 16245 font-size: 1.25rem; 16246 } 16247 16248 .lg\\:text-xs { 16249 font-size: 0.75rem; 16250 } 16251 16252 .lg\\:leading-\\[1\\.1\\] { 16253 line-height: 1.1; 16254 } 16255 16256 .lg\\:leading-none { 16257 line-height: 1; 16258 } 16259 16260 .lg\\:leading-tight { 16261 line-height: 1.25; 16262 } 16263} 16264 16265@media (min-width: 1280px) { 16266 16267 .xl\\:block { 16268 display: block; 16269 } 16270 16271 .xl\\:grid-cols-3 { 16272 grid-template-columns: repeat(3, minmax(0, 1fr)); 16273 } 16274 16275 .xl\\:grid-cols-5 { 16276 grid-template-columns: repeat(5, minmax(0, 1fr)); 16277 } 16278 16279 .xl\\:grid-cols-\\[40\\%\\2c 1fr\\] { 16280 grid-template-columns: 40% 1fr; 16281 } 16282 16283 .xl\\:grid-cols-\\[minmax\\(0\\2c 3fr\\)_35rem\\] { 16284 grid-template-columns: minmax(0,3fr) 35rem; 16285 } 16286 16287 .xl\\:grid-cols-\\[minmax\\(0\\2c _1fr\\)_minmax\\(0\\2c _1\\.5fr\\)\\] { 16288 grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); 16289 } 16290 16291 .xl\\:text-3xl { 16292 font-size: 1.875rem; 16293 } 16294 16295 .xl\\:text-8xl { 16296 font-size: 6rem; 16297 } 16298 16299 .xl\\:text-xl { 16300 font-size: 1.25rem; 16301 } 16302 16303 .xl\\:leading-tight { 16304 line-height: 1.25; 16305 } 16306} 16307 16308@media (min-width: 1536px) { 16309 16310 .\\32xl\\:gap-x-10 { 16311 -moz-column-gap: 2.5rem; 16312 column-gap: 2.5rem; 16313 } 16314} 16315 16316@media print { 16317 16318 .print\\:block { 16319 display: block; 16320 } 16321 16322 .print\\:inline-block { 16323 display: inline-block; 16324 } 16325 16326 .print\\:flex { 16327 display: flex; 16328 } 16329 16330 .print\\:grid { 16331 display: grid; 16332 } 16333 16334 .print\\:hidden { 16335 display: none; 16336 } 16337 16338 .print\\:w-full { 16339 width: 100%; 16340 } 16341 16342 .print\\:max-w-\\[25\\%\\] { 16343 max-width: 25%; 16344 } 16345 16346 .print\\:shrink-0 { 16347 flex-shrink: 0; 16348 } 16349 16350 .print\\:flex-grow { 16351 flex-grow: 1; 16352 } 16353 16354 .print\\:grow { 16355 flex-grow: 1; 16356 } 16357 16358 .print\\:basis-3\\/12 { 16359 flex-basis: 25%; 16360 } 16361 16362 .print\\:basis-5\\/12 { 16363 flex-basis: 41.666667%; 16364 } 16365 16366 .print\\:grid-cols-\\[minmax\\(0\\2c _3fr\\)_minmax\\(0\\2c _2fr\\)\\] { 16367 grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); 16368 } 16369 16370 .print\\:gap-\\[1rem\\] { 16371 gap: 1rem; 16372 } 16373 16374 .print\\:gap-x-\\[2rem\\] { 16375 -moz-column-gap: 2rem; 16376 column-gap: 2rem; 16377 } 16378 16379 .print\\:self-start {
16380 align-self: flex-start; 16381 } 16382 16383 .print\\:opacity-100 { 16384 opacity: 1; 16385 } 16386} 16387 16388.\\[\\&\\.open\\]\\:before\\:content-\\[\\'\\25BE_\\'\\].open::before { 16389 --tw-content: 'â¾ '; 16390 content: var(--tw-content); 16391} 16392 16393.\\[\\&\\:first-child\\]\\:hidden:first-child { 16394 display: none; 16395} 16396 16397.\\[\\&\\:hover\\]\\:border-neutral-800:hover { 16398 border-color: var(--sc-base-800); 16399} 16400 16401.\\[\\&\\:not\\(\\[alwaysExpanded\\]\\)\\]\\:hover\\:cursor-pointer:hover:not([alwaysExpanded]) { 16402 cursor: pointer; 16403} 16404 16405.\\[\\&\\>\\*\\:only-child\\]\\:col-span-2>*:only-child { 16406 grid-column: span 2 / span 2; 16407} 16408 16409.\\[\\&\\>p\\:not\\(\\:last-child\\)\\]\\:mb-2>p:not(:last-child) { 16410 margin-bottom: 0.5rem; 16411} 16412 16413.\\[\\&\\>p\\]\\:mb-2>p { 16414 margin-bottom: 0.5rem; 16415} 16416 16417.\\[\\&\\[active\\]\\]\\:pointer-events-none[active] { 16418 pointer-events: none; 16419} 16420 16421.\\[\\&\\[active\\]\\]\\:border-neutral-800[active] { 16422 border-color: var(--sc-base-800); 16423} 16424 16425.\\[\\&\\[active\\]\\]\\:font-bold[active] { 16426 font-weight: 700; 16427} 16428 16429.\\[\\&\\[active\\]\\]\\:text-content[active] { 16430 color: var(--sc-base-content); 16431} 16432 16433.\\[\\&\\[active\\]\\]\\:text-primary[active] { 16434 color: var(--sc-primary); 16435} 16436 16437.\\[\\&\\[active\\]\\]\\:underline[active] { 16438 text-decoration-line: underline; 16439} 16440 16441.\\[\\&\\[active\\]\\]\\:shadow-\\[0_0_0_2px_var\\(--sc-base-800\\)\\][active] { 16442 --tw-shadow: 0 0 0 2px var(--sc-base-800);
16443 --tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color); 16444 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 16445} 16446 16447.\\[\\&_\\*\\]\\:fill-current * { 16448 fill: currentColor; 16449} 16450 16451.\\[\\&_\\*\\]\\:fill-neutral-0 * { 16452 fill: var(--sc-base); 16453} 16454 16455.\\[\\&_\\.hour\\]\\:font-normal .hour { 16456 font-weight: 400; 16457} 16458 16459.\\[\\&_\\.literal\\]\\:font-normal .literal { 16460 font-weight: 400; 16461} 16462 16463.\\[\\&_\\.minute\\]\\:font-normal .minute { 16464 font-weight: 400; 16465} 16466 16467.\\[\\&_a\\]\\:underline a { 16468 text-decoration-line: underline; 16469} 16470`; 16471 const tailwind = i$9` 16472 ${r$9(tailwindImport)} 16473`; 16474 const inline = i$9` 16475 :host([align="left"]) .sonic-loader--inline { 16476 margin-left: 0; 16477 } 16478 16479 :host([align="right"]) .sonic-loader--inline { 16480 margin-left: auto; 16481 margin-right: 0; 16482 } 16483 .sonic-loader--inline { 16484 display: block; 16485 position: relative; 16486 width: 80px; 16487 height: 24px; 16488 margin: auto; 16489 z-index: 20; 16490 } 16491 .sonic-loader--inline div { 16492 position: absolute; 16493 top: 5px; 16494 width: 13px; 16495 height: 13px; 16496 border-radius: 50%; 16497 background: var(--sc-_loader-bg); 16498 animation-timing-function: cubic-bezier(0, 1, 1, 0); 16499 } 16500 .sonic-loader--inline div:nth-child(1) { 16501 left: 8px; 16502 animation: lds-ellipsis1 0.6s infinite; 16503 } 16504 .sonic-loader--inline div:nth-child(2) { 16505 left: 8px; 16506 animation: lds-ellipsis2 0.6s infinite; 16507 } 16508 .sonic-loader--inline div:nth-child(3) { 16509 left: 32px; 16510 animation: lds-ellipsis2 0.6s infinite; 16511 } 16512 .sonic-loader--inline div:nth-child(4) { 16513 left: 56px; 16514 animation: lds-ellipsis3 0.6s infinite; 16515 } 16516 16517 @keyframes lds-ellipsis1 { 16518 0% { 16519 transform: scale(0); 16520 } 16521 100% { 16522 transform: scale(1); 16523 } 16524 } 16525 @keyframes lds-ellipsis3 { 16526 0% { 16527 transform: scale(1); 16528 } 16529 100% { 16530 transform: scale(0); 16531 } 16532 } 16533 @keyframes lds-ellipsis2 { 16534 0% { 16535 transform: translate(0, 0); 16536 } 16537 100% { 16538 transform: translate(24px, 0); 16539 } 16540 } 16541`; 16542 const fixed = i$9` 16543 @keyframes sonic-loader--fixed { 16544 0% { 16545 transform: scale(0); 16546 opacity: 0; 16547 } 16548 5% { 16549 opacity: 1; 16550 } 16551 70% { 16552 opacity: 90%; 16553 } 16554 100% { 16555 transform: scale(1); 16556 opacity: 0; 16557 } 16558 } 16559 16560 .sonic-loader--fixed { 16561 position: fixed; 16562 top: 50%; 16563 left: 50%; 16564 transform: transateY(-50%) translateX(-50%); 16565 z-index: 999; 16566 } 16567 16568 .sonic-loader--fixed > div:nth-child(2) { 16569 animation-delay: -0.5s; 16570 } 16571 .sonic-loader--fixed > div:nth-child(3) { 16572 animation-delay: -0.2s; 16573 } 16574 16575 .sonic-loader--fixed > div:nth-child(4) { 16576 display: none !important; 16577 } 16578 .sonic-loader--fixed > div { 16579 background-color: var(--sc-_loader-bg); 16580 width: 5rem; 16581 height: 5rem; 16582 border-radius: 100%; 16583 margin: 2px; 16584 animation-fill-mode: both; 16585 position: absolute; 16586 top: 0px; 16587 opacity: 0; 16588 margin: 0; 16589 top: -2.5rem; 16590 left: -2.5rem; 16591 width: 5rem; 16592 height: 5rem; 16593 animation: sonic-loader--fixed 1s 0s linear infinite; 16594 } 16595`; 16596 var __decorate$H = function(decorators, target, key, desc) { 16597 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 16598 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 16599 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; 16600 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 16601 }; 16602 var Loader_1; 16603 const tagName$2D = "sonic-loader"; 16604 let Loader = Loader_1 = class Loader extends i$6 { 16605 constructor() { 16606 super(...arguments); 16607 this.mode = "fixed"; 16608 this.noDelay = false; 16609 } 16610 static show(conf) { 16611 if (!Loader_1.loader) 16612 Loader_1.loader = document.createElement("sonic-loader"); 16613 const loader = Loader_1.loader; 16614 if (!conf) 16615 conf = {}; 16616 if (conf.mode) 16617 loader.setAttribute("mode", conf.mode); 16618 if (conf.noDelay) 16619 loader.setAttribute("noDelay", ""); 16620 if (!conf.container) { 16621 conf.container = Theme.getPopContainer(); 16622 conf.mode = "fixed"; 16623 } 16624 conf.container.appendChild(loader); 16625 Loader_1.callCounter++; 16626 } 16627 static hide() { 16628 Loader_1.callCounter--; 16629 if (Loader_1.callCounter > 0) 16630 return; 16631 if (Loader_1.loader) 16632 Loader_1.loader.remove(); 16633 } 16634 render() { 16635 return b$1`<div 16636 class="sonic-loader sonic-loader--${this.mode} ${this.noDelay ? "sonic-loader--nodelay" : ""} " 16637 > 16638 <div></div> 16639 <div></div> 16640 <div></div> 16641 <div></div> 16642 </div>`; 16643 } 16644 }; 16645 Loader.styles = [ 16646 inline, 16647 fixed, 16648 i$9` 16649 :host { 16650 --sc-_loader-bg: var(--sc-primary, currentColor); 16651 pointer-events: none; 16652 } 16653 16654 :host([currentColor]) { 16655 --sc-_loader-bg: currentColor; 16656 } 16657 16658 .sonic-loader { 16659 opacity: 0; 16660 animation: showLoader 0.5s 0.5s forwards; 16661 } 16662 .sonic-loader--inline, 16663 .sonic-loader--nodelay { 16664 animation-delay: 0s; 16665 } 16666 16667 @keyframes showLoader { 16668 0% { 16669 opacity: 0; 16670 } 16671 16672 100% { 16673 opacity: 1; 16674 } 16675 } 16676 ` 16677 ]; 16678 Loader.callCounter = 0; 16679 __decorate$H([ 16680 n$5({ type: String }) 16681 ], Loader.prototype, "mode", void 0); 16682 __decorate$H([ 16683 n$5({ type: Boolean }) 16684 ], Loader.prototype, "noDelay", void 0); 16685 Loader = Loader_1 = __decorate$H([ 16686 t$3(tagName$2D) 16687 ], Loader); 16688 var __decorate$G = function(decorators, target, key, desc) { 16689 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 16690 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 16691 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; 16692 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 16693 }; 16694 const tagName$2C = "sonic-if"; 16695 let SonicIF = class SonicIF extends i$6 { 16696 constructor() { 16697 super(...arguments); 16698 this.condition = false;
16699 } 16700 render() { 16701 if (!this.condition) 16702 return A$1; 16703 return b$1` <slot></slot> `; 16704 } 16705 }; 16706 SonicIF.styles = i$9` 16707 :host { 16708 display: contents; 16709 } 16710 `; 16711 __decorate$G([ 16712 n$5({ type: Boolean }) 16713 ], SonicIF.prototype, "condition", void 0); 16714 SonicIF = __decorate$G([ 16715 t$3(tagName$2C) 16716 ], SonicIF); 16717 var __decorate$F = function(decorators, target, key, desc) { 16718 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 16719 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 16720 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; 16721 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 16722 }; 16723 const icon = { 16724 warning: "warning-circled-outline", 16725 success: "check-circled-outline", 16726 error: "warning-circled-outline", 16727 info: "info-empty", 16728 default: "info-empty" 16729 }; 16730 const tagName$2B = "sonic-alert"; 16731 let Alert = class Alert extends i$6 { 16732 constructor() { 16733 super(...arguments); 16734 this.label = ""; 16735 this.noIcon = false; 16736 this.text = ""; 16737 this.id = (/* @__PURE__ */ new Date()).getTime().toString(); 16738 this.dismissible = false; 16739 this.background = false; 16740 this.status = "default"; 16741 this.dismissForever = false; 16742 } 16743 connectedCallback() { 16744 if (this.dismissForever) { 16745 const dismissed = localStorage.getItem("sonic-alert-dismissed") || "{}"; 16746 const dismissedObj = JSON.parse(dismissed); 16747 if (dismissedObj[this.id]) { 16748 this.remove(); 16749 } 16750 } 16751 super.connectedCallback(); 16752 } 16753 render() { 16754 return b$1` 16755 <slot name="icon" class="${this.noIcon ? "hidden" : ""}" 16756 >${!this.noIcon ? b$1`<div> 16757 ${this.status && b$1`<sonic-icon name=${icon[this.status]}></sonic-icon>`} 16758 </div>` : A$1}</slot 16759 > 16760 <div class="content"> 16761 ${this.label ? b$1`<span class="label">${o$6(this.label)}</span>` : A$1} 16762 <div>${this.text}<slot></slot></div> 16763 </div> 16764 ${this.dismissible ? b$1`<sonic-button 16765 @click=${this.close} 16766 class="close-btn" 16767 variant="unstyled" 16768 shape="circle" 16769 icon 16770 > 16771 <sonic-icon name="cancel"></sonic-icon> 16772 </sonic-button>` : A$1} 16773 `; 16774 } 16775 close() { 16776 this.remove(); 16777 if (this.dismissForever) { 16778 const dismissed = localStorage.getItem("sonic-alert-dismissed") || "{}"; 16779 const dismissedObj = JSON.parse(dismissed); 16780 dismissedObj[this.id] = true; 16781 localStorage.setItem("sonic-alert-dismissed", JSON.stringify(dismissedObj)); 16782 } 16783 } 16784 }; 16785 Alert.styles = [ 16786 fontSize, 16787 i$9` 16788 :host { 16789 --sc_color: var(--sc-base-content, #000); 16790 --sc_rounded: var(--sc-rounded); 16791 --sc_fw: var(--sc-font-weight-base, 400); 16792 --sc_fst: var(--sc-font-style-base, normal); 16793 --sc_label-fw: bold; 16794 16795 font-weight: var(--sc_fw); 16796 font-style: var(--sc_fst); 16797 color: var(--sc_color); 16798 position: relative; 16799 display: flex; 16800 gap: 0.4em; 16801 border-radius: var(--sc_rounded); 16802 } 16803 16804 .label { 16805 font-weight: var(--sc_label-fw); 16806 margin-bottom: 0.15em; 16807 display: block; 16808 } 16809 16810 :host([status="warning"]) { 16811 --sc_color: var(--sc-warning, var(--sc-base-content, #000)); 16812 } 16813 :host([status="error"]) { 16814 --sc_color: var(--sc-danger, var(--sc-base-content, #000)); 16815 } 16816 :host([status="info"]) { 16817 --sc_color: var(--sc-info, var(--sc-base-content, #000)); 16818 } 16819 :host([status="success"]) { 16820 --sc_color: var(--sc-success, var(--sc-base-content, #000)); 16821 } 16822 16823 /*background*/ 16824 :host([dismissible]), 16825 :host([background]) { 16826 background: var(--sc-base, #fff); 16827 padding: 0.8em 1.15em; 16828 } 16829 :host([dismissible]):before, 16830 :host([background]):before { 16831 background-color: currentColor; 16832 content: ""; 16833 display: block; 16834 position: absolute; 16835 left: 0; 16836 top: 0; 16837 right: 0; 16838 bottom: 0; 16839 opacity: 0.08; 16840 border-radius: var(--sc_rounded); 16841 pointer-events: none; 16842 } 16843 16844 .content { 16845 z-index: 2; 16846 position: relative; 16847 flex: 1; 16848 } 16849 16850 slot { 16851 display: block; 16852 } 16853 16854 .hidden { 16855 display: none !important; 16856 } 16857 16858 /*Rounded*/ 16859 :host([size="2xs"]), 16860 :host([size="xs"]), 16861 :host([size="sm"]) { 16862 --sc_rounded: var(--sc-rounded-sm); 16863 } 16864 16865 /*Dismissible*/ 16866 :host([dismissible]) { 16867 padding-right: 3rem; 16868 } 16869 :host([dismissible]) .close-btn { 16870 position: absolute; 16871 top: 0.4rem; 16872 right: 0.3rem; 16873 } 16874 ` 16875 ]; 16876 __decorate$F([ 16877 n$5({ type: String }) 16878 ], Alert.prototype, "label", void 0); 16879 __decorate$F([ 16880 n$5({ type: Boolean, reflect: true }) 16881 ], Alert.prototype, "noIcon", void 0); 16882 __decorate$F([ 16883 n$5({ type: String }) 16884 ], Alert.prototype, "text", void 0); 16885 __decorate$F([ 16886 n$5({ type: String }) 16887 ], Alert.prototype, "id", void 0); 16888 __decorate$F([ 16889 n$5({ type: String, reflect: true }) 16890 ], Alert.prototype, "size", void 0); 16891 __decorate$F([ 16892 n$5({ type: Boolean, reflect: true }) 16893 ], Alert.prototype, "dismissible", void 0); 16894 __decorate$F([ 16895 n$5({ type: Boolean, reflect: true }) 16896 ], Alert.prototype, "background", void 0); 16897 __decorate$F([ 16898 n$5({ type: String, reflect: true }) 16899 ], Alert.prototype, "status", void 0); 16900 __decorate$F([ 16901 n$5({ type: Boolean, reflect: true }) 16902 ], Alert.prototype, "dismissForever", void 0); 16903 Alert = __decorate$F([ 16904 t$3(tagName$2B) 16905 ], Alert); 16906 var __defProp$3N = Object.defineProperty; 16907 var __getOwnPropDesc$3Q = Object.getOwnPropertyDescriptor; 16908 var __decorateClass$3R = (decorators, target, key, kind) => { 16909 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3Q(target, key) : target; 16910 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 16911 if (decorator = decorators[i2]) 16912 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 16913 if (kind && result) __defProp$3N(target, key, result); 16914 return result; 16915 }; 16916 let SonicLogo = class extends Subscriber$1(i$6) { 16917 constructor() { 16918 super(...arguments); 16919 this.noLink = false;
16920 this.src = ""; 16921 this.ratio_auto_360 = ""; 16922 this.href = "/"; 16923 } 16924 async onThemeUpdate(url) { 16925 if (url) { 16926 sessionStorage.setItem("SonicDefaultLogoSrc", url); 16927 this.defaultLogoSrc = url; 16928 } 16929 } 16930 connectedCallback() { 16931 this.href = appRoute("home").toString(); 16932 this.logoSrc = this.getAncestorAttributeValue("logoSrc") || ""; 16933 if (!this.logoSrc && sessionStorage.getItem("SonicDefaultLogoSrc") !== null) { 16934 this.logoSrc = sessionStorage.getItem("SonicDefaultLogoSrc") || ""; 16935 } 16936 super.connectedCallback(); 16937 } 16938 logo(src) { 16939 return b$1`<img loading="eager" src=${o$4(src)} class="logo" alt="logo - ${this.editor_name}" /> `; 16940 } 16941 render() { 16942 const logoSrc = this.logoSrc || this.ratio_auto_360 || this.src || this.defaultLogoSrc; 16943 if (!logoSrc) return b$1`<sonic-fetch dataProvider="theme"></sonic-fetch>`; 16944 if (this.noLink || !this.href) { 16945 return this.logo(logoSrc); 16946 } 16947 return b$1`<a href="${this.href}">${this.logo(logoSrc)}</a> `; 16948 } 16949 }; 16950 SonicLogo.styles = [ 16951 tailwind, 16952 i$9` 16953 :host() { 16954 display: flex; 16955 width: 100%; 16956 position: relative; 16957 } 16958 .logo { 16959 display: block; 16960 width: 100%; 16961 height: 100%; 16962 object-fit: contain; 16963 object-position: left center; 16964 } 16965 ` 16966 ]; 16967 __decorateClass$3R([ 16968 n$5({ type: Boolean }) 16969 ], SonicLogo.prototype, "noLink", 2); 16970 __decorateClass$3R([ 16971 n$5({ type: String }) 16972 ], SonicLogo.prototype, "src", 2); 16973 __decorateClass$3R([ 16974 n$5({ type: String }) 16975 ], SonicLogo.prototype, "ratio_auto_360", 2); 16976 __decorateClass$3R([ 16977 n$5({ type: String }) 16978 ], SonicLogo.prototype, "href", 2); 16979 __decorateClass$3R([ 16980 n$5({ type: String }) 16981 ], SonicLogo.prototype, "logoSrc", 2); 16982 __decorateClass$3R([ 16983 onAssign$1("theme.logos.logo_billetterie.ratio_auto_360") 16984 ], SonicLogo.prototype, "onThemeUpdate", 1); 16985 __decorateClass$3R([ 16986 n$5({ type: String }) 16987 ], SonicLogo.prototype, "defaultLogoSrc", 2); 16988 __decorateClass$3R([ 16989 bind$1("settings.infos.editor_name"), 16990 n$5({ type: String }) 16991 ], SonicLogo.prototype, "editor_name", 2); 16992 SonicLogo = __decorateClass$3R([ 16993 t$3("sonic-theme-logo") 16994 ], SonicLogo); 16995 var __defProp$3M = Object.defineProperty; 16996 var __getOwnPropDesc$3P = Object.getOwnPropertyDescriptor; 16997 var __decorateClass$3Q = (decorators, target, key, kind) => { 16998 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3P(target, key) : target; 16999 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 17000 if (decorator = decorators[i2]) 17001 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 17002 if (kind && result) __defProp$3M(target, key, result); 17003 return result; 17004 }; 17005 const tagName$2A = "sonic-waiting-line"; 17006 let SonicWaitingLine = class extends Fetcher$1(Subscriber$1(i$6)) { 17007 constructor() { 17008 super(...arguments); 17009 this.wording_waiting_line_allowed_text = ""; 17010 this.wording_waiting_line_expired_text = ""; 17011 this.wording_waiting_line_allowed_text_time_warning = ""; 17012 this.wording_waiting_line_estimated_waiting_time_long = ""; 17013 this.wording_waiting_line_people_before_you = ""; 17014 this.status = ""; 17015 this.open = false; 17016 this.position = 0; 17017 this.remaining_time_sec = 0; 17018 this.message = ""; 17019 this.hasBeenAllowed = false; 17020 this.allowedWording = ""; 17021 this.timeWarningWording = ""; 17022 this.showPageReloadedInfo = false; 17023 this.remaining_time_sec_ref = 0; 17024 this.remainingCounterStartTime = 0; 17025 this.remainingCounterStarted = false; 17026 this.onReload = (e2) => { 17027 if (!["waiting", "", null].includes(this.status)) { 17028 return; 17029 } 17030 sessionStorage.setItem("waiting-line-F5", "true"); 17031 e2.preventDefault(); 17032 }; 17033 this._endPoint = "waiting-line"; 17034 this.hasError = false; 17035 this.previousProps = null; 17036 } 17037 setDefaults() { 17038 this.refetchEveryMs = 1e4; 17039 this.setAttribute("key", "data"); 17040 this.setAttribute("dataProvider", "waiting_line_infos"); 17041 } 17042 handleUserReloadingPage() { 17043 if (sessionStorage.getItem("waiting-line-F5")) { 17044 sessionStorage.removeItem("waiting-line-F5"); 17045 this.showPageReloadedInfo = true; 17046 } 17047 window.addEventListener("beforeunload", this.onReload); 17048 } 17049 connectedCallback() { 17050 this.handleUserReloadingPage(); 17051 this.setDefaults(); 17052 super.connectedCallback(); 17053 } 17054 disconnectedCallback() { 17055 window.removeEventListener("beforeunload", this.onReload); 17056 super.disconnectedCallback(); 17057 } 17058 async updateTimeWarning(status, remaining_time_sec, wording2) { 17059 if (status != "waiting") return; 17060 await Utils.queueTaskPromise(); 17061 const minutes = Math.ceil((remaining_time_sec || 600) / 60); 17062 this.timeWarningWording = wording2.replace("%s", Format.minutesDuration(minutes)); 17063 } 17064 async onStatusUpdate(status) { 17065 await Utils.queueTaskPromise(); 17066 this.startCountDownIfNeeded(status); 17067 this.handleExpiredStatusOnLoad(status); 17068 if (status == "entered") { 17069 sessionStorage.setItem("waiting-line-previously-entered", "true"); 17070 } else { 17071 window.requestAnimationFrame(() => sessionStorage.removeItem("waiting-line-previously-entered")); 17072 } 17073 } 17074 handleExpiredStatusOnLoad(status) { 17075 if (status == "expired" && !this.hasBeenAllowed) { 17076 this.publisher.status = "waiting"; 17077 } 17078 } 17079 startCountDownIfNeeded(status) { 17080 this.stopCountDown(); 17081 if (status == "allowed") { 17082 this.hasBeenAllowed = true; 17083 this.startCountDown(); 17084 } 17085 } 17086 async udpateCountDown() { 17087 if (!this.remainingCounterStarted) return; 17088 this.remaining_time_sec = this.remaining_time_sec_ref - Math.floor((Date.now() - this.remainingCounterStartTime) / 1e3); 17089 const minutes = Math.ceil(this.remaining_time_sec / 60); 17090 this.allowedWording = this.wording_waiting_line_allowed_text.replace("%s", Format.minutesDuration(minutes)); 17091 if (this.remaining_time_sec <= 0) { 17092 this.publisher.status = "expired"; 17093 } 17094 await Utils.delayPromise(1e3); 17095 this.udpateCountDown(); 17096 } 17097 startCountDown() { 17098 if (this.remainingCounterStarted) return; 17099 this.remainingCounterStarted = true; 17100 this.remaining_time_sec_ref = this.remaining_time_sec; 17101 this.remainingCounterStartTime = Date.now(); 17102 this.udpateCountDown(); 17103 } 17104 async stopCountDown() { 17105 if (!this.remainingCounterStarted) return; 17106 this.remainingCounterStarted = false;
17107 this.remaining_time_sec = 0; 17108 await super._fetchData(); 17109 } 17110 set endPoint(_2) { 17111 return; 17112 } 17113 get endPoint() { 17114 if (this.status == "entered") { 17115 return `${this._endPoint}?change_status_request=entered`; 17116 } 17117 if (this.status == "expired" && this.hasBeenAllowed) { 17118 return `${this._endPoint}?change_status_request=expired`; 17119 } 17120 return this._endPoint; 17121 } 17122 shouldfetchData() { 17123 return (["waiting", "", "expired"].includes(this.status) || this.hasError) && !this.isLoading; 17124 } 17125 willBeFetchedLater() { 17126 if (!sessionStorage.getItem("waiting-line-dont-fetch-before-ms") || !this.showPageReloadedInfo) return false; 17127 const fetchDelayMs = parseInt(sessionStorage.getItem("waiting-line-dont-fetch-before-ms") || "0") - Date.now(); 17128 if (fetchDelayMs < 0) return false; 17129 sessionStorage.removeItem("waiting-line-dont-fetch-before-ms"); 17130 setTimeout(async () => { 17131 this._fetchData(); 17132 }, fetchDelayMs); 17133 return true; 17134 } 17135 async _fetchData() { 17136 if (this.willBeFetchedLater()) return; 17137 if (!this.shouldfetchData()) return; 17138 const ms = Date.now(); 17139 this.hasError = false; 17140 const status = this.status; 17141 const result = await super._fetchData(); 17142 await Utils.queueTaskPromise(); 17143 this.hasError = this.status === null; 17144 if (this.hasError && ["waiting", "expired"].includes(status) && this.previousProps) { 17145 this.publisher.set({ ...this.previousProps }); 17146 } 17147 this.previousProps = this.publisher.get(); 17148 let minTime = 1e4; 17149 if (this.hasError) { 17150 minTime = 3e4; 17151 } else { 17152 this.showPageReloadedInfo = false; 17153 } 17154 const responseTime = Date.now() - ms; 17155 const maxTime = 6e4; 17156 this.refetchEveryMs = Math.min(maxTime, Math.max(minTime + Math.random() * 1e3, responseTime * 3)); 17157 this.showPageReloadedInfo = false; 17158 sessionStorage.setItem("waiting-line-dont-fetch-before-ms", (Date.now() + this.refetchEveryMs).toString()); 17159 return result; 17160 } 17161 async enter() { 17162 this.publisher.status = "entered"; 17163 await super._fetchData(); 17164 if (!dp("settings").get().is_online && this.open) { 17165 window.location.reload(); 17166 return; 17167 } 17168 this.dispatchEvent(new CustomEvent("enter")); 17169 } 17170 refreshPage() { 17171 window.location.reload(); 17172 } 17173 getFallbackErrorLabel() { 17174 const language = HTML.getLanguage(); 17175 if (language == "fr") { 17176 return b$1`Veuillez patienter.`; 17177 } 17178 return b$1`Please wait.`; 17179 } 17180 renderWaiting() { 17181 if (this.status != "waiting" && !(this.showPageReloadedInfo && this.status === "") && this.status !== null) { 17182 return A$1; 17183 } 17184 if (this.open && (this.status == "waiting" && this.position == 0 || this.status == null) && !this.showPageReloadedInfo) { 17185 return b$1` 17186 <sonic-modal-content> 17187 <div class="flex gap-3 items-center mt-5"> 17188 <div class="flex items-center shrink-0 flex-col w-[70px] pt-1"> 17189 <sonic-icon name="hourglass-half" library="custom" size="2xl"></sonic-icon> 17190 <sonic-loader mode="inline" class="pointer-events-none origin-center scale-[50%]"></sonic-loader> 17191 </div> 17192 <div> 17193 <div class="text-lg">${this.getFallbackErrorLabel()}</div> 17194 </div> 17195 </div> 17196 </sonic-modal-content> 17197 `; 17198 } 17199 const openOrNoStatus = this.open || this.status == ""; 17200 return b$1` <sonic-modal-title class="mb-2">${t("waiting_line_title")}</sonic-modal-title> 17201 <sonic-modal-content> 17202 <sonic-if .condition=${this.open}> 17203 ${t("waiting_line_text")} 17204 <div class="mt-2">${this.timeWarningWording}</div> 17205 </sonic-if> 17206 ${this.renderMessage()} 17207 17208 <sonic-if .condition=${openOrNoStatus}> 17209 <div class="flex gap-3 items-center mt-5"> 17210 <div class="flex items-center shrink-0 flex-col w-[70px] pt-1"> 17211 <sonic-icon name="hourglass-half" library="custom" size="2xl"></sonic-icon> 17212 <sonic-loader mode="inline" class="pointer-events-none origin-center scale-[50%]"></sonic-loader> 17213 </div> 17214 <div> 17215 <sonic-if .condition=${this.position > 0}> 17216 <div class="text-lg"> 17217 ${this.wording_waiting_line_people_before_you.replace("%s", this.position.toString())} 17218 </div> 17219 </sonic-if> 17220 <sonic-if .condition=${this.showPageReloadedInfo}> 17221 <div class="text-lg">${t("waiting_line_page_reload_info")}</div> 17222 </sonic-if> 17223 </div> 17224 </div> 17225 </sonic-if> 17226 </sonic-modal-content>`; 17227 } 17228 /** TODO Ajouter au différents états */ 17229 renderMessage() { 17230 if (!this.message) return A$1; 17231 if (this.open) { 17232 return b$1` 17233 <sonic-alert status="info" background class="mt-3 [&>
17233p:not(:last-child)]:mb-2 text-pretty" 17234 >${o$6(this.message)}</sonic-alert 17235 > 17236 `; 17237 } 17238 return b$1` <div class="mt-2 [&>p]:mb-2 text-lg">${o$6(this.message)}</div> `; 17239 } 17240 renderAllowed() { 17241 if (this.status != "allowed") return A$1; 17242 return b$1`<sonic-modal-title class="mb-2"> 17243 <sonic-icon library="custom" name="face-laugh-beam"></sonic-icon> ${t( 17244 "waiting_line_allowed_title" 17245 )}</sonic-modal-title 17246 ><sonic-modal-content> ${this.allowedWording} ${this.renderMessage()} </sonic-modal-content> 17247 <div class="w-full mt-8"> 17248 <sonic-button @click=${this.enter} type="success" shape="block" class="w-full"> 17249 <sonic-icon library="custom" name="arrow-right"></sonic-icon> 17250 ${t("waiting_line_allowed_btn")}</sonic-button 17251 > 17252 </div>`; 17253 } 17254 renderExpired() { 17255 if (this.status != "expired") return A$1; 17256 return b$1`<sonic-modal-title class="mb-2"> 17257 <sonic-icon library="custom" name="face-grimace"></sonic-icon> ${t( 17258 "waiting_line_expired_title" 17259 )}</sonic-modal-title 17260 ><sonic-modal-content> 17261 ${this.wording_waiting_line_expired_text.replace( 17262 "%s", 17263 Format.minutesDuration(Math.ceil(this.remaining_time_sec_ref / 60)) 17264 )} 17265 ${this.renderMessage()} 17266 </sonic-modal-content> 17267 <div class="w-full mt-8"> 17268 <sonic-button variant="outline" type="neutral" shape="block" @click=${this.refreshPage}> 17269 <sonic-icon library="custom" name="rotate-right"></sonic-icon> 17270 ${t("waiting_line_expired_btn")}</sonic-button 17271 > 17272 </div>`; 17273 } 17274 render() { 17275 if (["entered", ""].includes(this.status) && !this.showPageReloadedInfo) return A$1; 17276 return b$1`<sonic-modal forceAction visible width="30rem"> 17277 <sonic-theme-logo noLink class="max-w-[8rem] -mt-2 mb-5"></sonic-theme-logo> 17278 ${this.renderWaiting()} 17279 <!-- --> 17280 ${this.renderAllowed()} 17281 <!-- --> 17282 ${this.renderExpired()} 17283 </sonic-modal>`; 17284 } 17285 }; 17286 SonicWaitingLine.styles = [tailwind]; 17287 __decorateClass$3Q([ 17288 r$5() 17289 ], SonicWaitingLine.prototype, "wording_waiting_line_allowed_text", 2); 17290 __decorateClass$3Q([ 17291 r$5() 17292 ], SonicWaitingLine.prototype, "wording_waiting_line_expired_text", 2); 17293 __decorateClass$3Q([ 17294 r$5() 17295 ], SonicWaitingLine.prototype, "wording_waiting_line_allowed_text_time_warning", 2); 17296 __decorateClass$3Q([ 17297 r$5() 17298 ], SonicWaitingLine.prototype, "wording_waiting_line_estimated_waiting_time_long", 2); 17299 __decorateClass$3Q([ 17300 r$5() 17301 ], SonicWaitingLine.prototype, "wording_waiting_line_people_before_you", 2); 17302 __decorateClass$3Q([ 17303 r$5() 17304 ], SonicWaitingLine.prototype, "status", 2); 17305 __decorateClass$3Q([ 17306 r$5() 17307 ], SonicWaitingLine.prototype, "open", 2); 17308 __decorateClass$3Q([ 17309 r$5() 17310 ], SonicWaitingLine.prototype, "position", 2); 17311 __decorateClass$3Q([ 17312 r$5() 17313 ], SonicWaitingLine.prototype, "remaining_time_sec", 2); 17314 __decorateClass$3Q([ 17315 r$5() 17316 ], SonicWaitingLine.prototype, "message", 2); 17317 __decorateClass$3Q([ 17318 r$5() 17319 ], SonicWaitingLine.prototype, "hasBeenAllowed", 2); 17320 __decorateClass$3Q([ 17321 r$5() 17322 ], SonicWaitingLine.prototype, "allowedWording", 2); 17323 __decorateClass$3Q([ 17324 r$5() 17325 ], SonicWaitingLine.prototype, "timeWarningWording", 2); 17326 __decorateClass$3Q([ 17327 r$5() 17328 ], SonicWaitingLine.prototype, "showPageReloadedInfo", 2); 17329 __decorateClass$3Q([ 17330 r$5() 17331 ], SonicWaitingLine.prototype, "remaining_time_sec_ref", 2); 17332 __decorateClass$3Q([ 17333 onAssign$1( 17334 "waiting_line_infos.status", 17335 "waiting_line_infos.remaining_time_sec", 17336 "sonic-wording.wording_waiting_line_allowed_text_time_warning" 17337 ) 17338 ], SonicWaitingLine.prototype, "updateTimeWarning", 1); 17339 __decorateClass$3Q([ 17340 onAssign$1("waiting_line_infos.status") 17341 ], SonicWaitingLine.prototype, "onStatusUpdate", 1); 17342 __decorateClass$3Q([ 17343 n$5({ type: String }) 17344 ], SonicWaitingLine.prototype, "endPoint", 1); 17345 SonicWaitingLine = __decorateClass$3Q([ 17346 t$3(tagName$2A) 17347 ], SonicWaitingLine); 17348 const DP_PINNED_ITEM = "pinnedItem"; 17349 const pinContext = n("pinCounter"); 17350 const QUOTA_ID_OUT_OF_CONTINGENT = 1; 17351 const OTHER_OWNERS_TAB_ID = "other_owners"; 17352 function isOutOfContingentQuotaId(quotaId) { 17353 return Number(quotaId) === QUOTA_ID_OUT_OF_CONTINGENT; 17354 } 17355 function isOtherOwnersTabId(selectedId) { 17356 return selectedId === OTHER_OWNERS_TAB_ID; 17357 } 17358 const isLargeContext = n("isLargeContext"); 17359 const selectedSubscriptionIdContext = n("selectedSubscriptionId"); 17360 const preferredQuotaIdContext = n("preferredQuotaId"); 17361 var PlacementType = /* @__PURE__ */ ((PlacementType2) => { 17362 PlacementType2["AUTO"] = "auto"; 17363 PlacementType2["MANUAL"] = "manual"; 17364 return PlacementType2; 17365 })(PlacementType || {}); 17366 const QUICK_SELECT_DISPLAY_DP = "quickSelectPreferences"; 17367 const QUICK_SELECT_PLACEMENT_DP = "quickSelectPlacementPreferences"; 17368 const QUICK_SELECT_DISPLAY_IS_CONDENSED = `${QUICK_SELECT_DISPLAY_DP}.isCondensed`;
17369 const QUICK_SELECT_PLACEMENT_TYPE = `${QUICK_SELECT_PLACEMENT_DP}.placement_type`; 17370 const quickSelectDisplayFormKey = new DataProviderKey( 17371 "${formDataProvider}" 17372 ); 17373 const showOtherOwnersContext = n("showOtherOwners"); 17374 const SEATMAP_PLACEMENT_PREFERENCES_DP = "seatmapPlacementPreferences"; 17375 const CLIENT_PREFERENCE_STORAGE_KEYS = [ 17376 QUICK_SELECT_DISPLAY_DP, 17377 QUICK_SELECT_PLACEMENT_DP, 17378 SEATMAP_PLACEMENT_PREFERENCES_DP 17379 ]; 17380 const COUNTER_PREFERENCE_STORAGE_KEYS = [DP_PINNED_ITEM, ...CLIENT_PREFERENCE_STORAGE_KEYS]; 17381 function clearPreferences(scope = "client") { 17382 const keys2 = scope === "counter" ? COUNTER_PREFERENCE_STORAGE_KEYS : CLIENT_PREFERENCE_STORAGE_KEYS; 17383 keys2.forEach((key) => localStorage.removeItem(key)); 17384 } 17385 const logout = (component) => { 17386 clearPreferences("client"); 17387 const homeUrl = appRoute("home"); 17388 const api2 = new API(HTML$1.getApiConfiguration(component)); 17389 api2.get("/user/logout", {}).then(() => window.location.replace(homeUrl.toString())); 17390 }; 17391 var __defProp$3L = Object.defineProperty; 17392 var __getOwnPropDesc$3O = Object.getOwnPropertyDescriptor; 17393 var __decorateClass$3P = (decorators, target, key, kind) => { 17394 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3O(target, key) : target; 17395 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 17396 if (decorator = decorators[i2]) 17397 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 17398 if (kind && result) __defProp$3L(target, key, result); 17399 return result; 17400 }; 17401 const tagName$2z = "sonic-administrator-force-logout"; 17402 let SonicAdministratorForceLayout = class extends Subscriber$1(i$6) { 17403 constructor() { 17404 super(...arguments); 17405 this.isGuichet = false; 17406 } 17407 connectedCallback() { 17408 this.isGuichet = this.hasAncestorAttribute("is_guichet"); 17409 super.connectedCallback(); 17410 } 17411 render() { 17412 if (!this.isAdmin || this.isGuichet) return A$1; 17413 return b$1`<sonic-modal forceAction visible maxWidth="30rem"> 17414 <sonic-icon library="custom" name="hand" size="3xl" prefix="light" class="mb-2"></sonic-icon> 17415 <sonic-modal-title>Vous êtes connecté en tant qu'administrateur ou au guichet</sonic-modal-title> 17416 <sonic-modal-content>Il est obligatoire de vous déconnecter pour continuer !</sonic-modal-content> 17417 17418 <sonic-modal-actions> 17419 <sonic-button type="danger" @click=${() => logout(this)} hideModal> 17420 <sonic-icon library="custom" name="circle-xmark"></sonic-icon> 17421 Se déconnecter</sonic-button 17422 > 17423 </sonic-modal-actions> 17424 </sonic-modal>`; 17425 } 17426 }; 17427 SonicAdministratorForceLayout.styles = [ 17428 tailwind, 17429 i$9` 17430 .message-content { 17431 text-align: center; 17432 padding: 2rem 0 0; 17433 font-size: 1.3rem; 17434 width: 100%; 17435 } 17436 .message-content p { 17437 margin: 0.25em 0; 17438 } 17439 .message-content a { 17440 text-decoration: none; 17441 border: 2px solid; 17442 border-radius: var(--sc-btn-radius); 17443 font-weight: bold; 17444 padding: 0.25em 0.5em; 17445 margin: 0.25em auto; 17446 color: inherit; 17447 display: block; 17448 width: fit-content; 17449 } 17450 .message-content a:only-child { 17451 display: block; 17452 } 17453 ` 17454 ]; 17455 __decorateClass$3P([ 17456 bind$1("user.data.is_admin"), 17457 n$5({ type: Boolean }) 17458 ], SonicAdministratorForceLayout.prototype, "isAdmin", 2); 17459 __decorateClass$3P([ 17460 n$5({ type: Boolean }) 17461 ], SonicAdministratorForceLayout.prototype, "isGuichet", 2); 17462 SonicAdministratorForceLayout = __decorateClass$3P([ 17463 t$3(tagName$2z) 17464 ], SonicAdministratorForceLayout); 17465 var __decorate$E = function(decorators, target, key, desc) { 17466 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 17467 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 17468 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; 17469 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 17470 }; 17471 const tagName$2y = "sonic-states"; 17472 let SonicStates = class SonicStates extends Subscriber$1(TemplatesContainer$1(i$6)) { 17473 constructor() { 17474 super(...arguments); 17475 this.state = ""; 17476 this.inverted = false;
17477 this.statePath = ""; 17478 this.onStateAssign = (value) => { 17479 this.state = value; 17480 this.requestUpdate(); 17481 }; 17482 } 17483 connectedCallback() { 17484 this.noShadowDom = ""; 17485 super.connectedCallback(); 17486 if (this.hasAttribute("data-path")) { 17487 this.statePath = this.getAttribute("data-path"); 17488 } 17489 if (this.statePath) { 17490 this.statePublisher = this.publisher; 17491 const split = this.statePath.split("."); 17492 for (const s2 of split) { 17493 this.statePublisher = this.statePublisher[s2]; 17494 } 17495 this.statePublisher.onAssign(this.onStateAssign); 17496 } 17497 } 17498 disconnectedCallback() { 17499 if (this.statePath) { 17500 this.statePublisher?.offAssign(this.onStateAssign); 17501 } 17502 super.disconnectedCallback(); 17503 } 17504 handleStates(state) { 17505 if (!this.states) 17506 return []; 17507 const templates = []; 17508 for (const [stateExpression, renderFn] of Object.entries(this.states)) { 17509 if (stateExpression === "fallback" || !renderFn) 17510 continue; 17511 const regexp = new RegExp(stateExpression); 17512 if (regexp.test(state)) { 17513 const params = regexp.exec(state) || [stateExpression]; 17514 params.shift(); 17515 templates.push(renderFn([...params])); 17516 } else { 17517 try { 17518 const pattern = new UrlPattern("(/)*" + stateExpression + "*"); 17519 if (pattern.match(state)) { 17520 const params = pattern.match(state) || {}; 17521 templates.push(renderFn(params)); 17522 } 17523 } catch (e2) { 17524 if (state.indexOf(stateExpression.replace(document.location.origin, "")) != -1) { 17525 templates.push(renderFn({})); 17526 } 17527 } 17528 } 17529 } 17530 if (templates.length == 0) { 17531 if (this.states?.fallback && this.isConnected) { 17532 templates.push(this.states.fallback()); 17533 } 17534 } 17535 return templates; 17536 } 17537 render() { 17538 let state = this.state; 17539 if (!Array.isArray(state) && Objects$1.isObject(state) || state === void 0) { 17540 state = ""; 17541 } 17542 const programmaticTemplates = this.handleStates(state); 17543 if (programmaticTemplates.length > 0) { 17544 return b$1`${programmaticTemplates}`; 17545 } 17546 const templates = []; 17547 for (const t2 of this.templatePartsList) { 17548 let path = t2.getAttribute(this.templateValueAttribute); 17549 let stateToMatch = state; 17550 if (this.inverted) { 17551 stateToMatch = path; 17552 path = state; 17553 } 17554 if (path == "") 17555 path = this.inverted ? ".*?" : "^$"; 17556 const regexp = new RegExp(path); 17557 if (regexp.test(stateToMatch + "")) { 17558 templates.push(t2); 17559 t2.removeAttribute("mode"); 17560 } else { 17561 const urlPattern2 = new UrlPattern(path); 17562 if (urlPattern2.names.length > 0 && urlPattern2.match(stateToMatch)) { 17563 t2.setAttribute("mode", "patternMatching"); 17564 templates.push(t2); 17565 } 17566 } 17567 } 17568 return b$1`${c$1(templates, (template, index) => { 17569 return index + (/* @__PURE__ */ new Date()).getTime(); 17570 }, (template) => { 17571 if (template?.hasAttribute("dataProviderExpression")) { 17572 const dataProviderExpression = template.getAttribute("dataProviderExpression"); 17573 let dataProvider = ""; 17574 let stateToMatch = state; 17575 let path = template.getAttribute(this.templateValueAttribute); 17576 if (this.inverted) { 17577 stateToMatch = path; 17578 path = state; 17579 } 17580 if (path == "") 17581 path = this.inverted ? "*" : "^$"; 17582 if (template.getAttribute("mode") == "patternMatching") { 17583 const matcher = new UrlPattern(path); 17584 const filler = new UrlPattern(dataProviderExpression); 17585 dataProvider = filler.stringify(matcher.match(stateToMatch)); 17586 } else { 17587 const regexp = new RegExp(path); 17588 const match = (stateToMatch + "").match(regexp); 17589 if (match) { 17590 dataProvider = match.shift()?.replace(regexp, dataProviderExpression); 17591 } 17592 } 17593 return b$1`<div 17594 style="display:contents" 17595 dataProvider="${dataProvider}" 17596 > 17597 ${o$2(template)} 17598 </div>`; 17599 } 17600 return o$2(template); 17601 })}`; 17602 } 17603 }; 17604 __decorate$E([ 17605 n$5() 17606 ], SonicStates.prototype, "state", void 0); 17607 __decorate$E([ 17608 n$5({ type: Boolean, reflect: true }) 17609 ], SonicStates.prototype, "inverted", void 0); 17610 __decorate$E([ 17611 n$5({ type: Object }) 17612 ], SonicStates.prototype, "states", void 0); 17613 SonicStates = __decorate$E([ 17614 t$3(tagName$2y) 17615 ], SonicStates); 17616 function* o$1(o2, f2) { 17617 if (void 0 !== o2) { 17618 let i2 = 0; 17619 for (const t2 of o2) yield f2(t2, i2++); 17620 } 17621 } 17622 var __decorate$D = function(decorators, target, key, desc) { 17623 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 17624 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 17625 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; 17626 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 17627 }; 17628 const tagName$2x = "sonic-subscriber"; 17629 let SonicSubscriber = class SonicSubscriber extends Subscriber$1(i$6) { 17630 constructor() { 17631 super(...arguments); 17632 this.noAutofill = true; 17633 } 17634 connectedCallback() { 17635 this.noShadowDom = ""; 17636 super.connectedCallback(); 17637 } 17638 updated(changedProperties) { 17639 super.updated(changedProperties); 17640 if (this.children.length == 0) 17641 this.style.display = "none"; 17642 else 17643 this.style.display = "contents"; 17644 } 17645 render() { 17646 return b$1`<slot></slot> `; 17647 } 17648 }; 17649 SonicSubscriber = __decorate$D([ 17650 t$3(tagName$2x) 17651 ], SonicSubscriber); 17652 var __decorate$C = function(decorators, target, key, desc) { 17653 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 17654 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 17655 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; 17656 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 17657 }; 17658 const tagName$2w = "sonic-list"; 17659 let List = class List extends Fetcher$1(Subscriber$1(TemplatesContainer$1(i$6))) { 17660 constructor() { 17661 super(...arguments); 17662 this.templateKey = "template"; 17663 this.idKey = "id"; 17664 this.limit = Number.POSITIVE_INFINITY; 17665 this.offset = 0; 17666 this.loadingSize = { width: 0, height: 0 }; 17667 } 17668 get items() { 17669 return this._items; 17670 } 17671 set items(value) { 17672 if (typeof value !== "function" && value !== void 0) 17673 return; 17674 this._items = value; 17675 this.requestUpdate(); 17676 } 17677 connectedCallback() { 17678 this.noShadowDom = ""; 17679 this.defferedDebug = this.hasAttribute("debug") || null; 17680 this.isFetchEnabled = this.hasAttribute("fetch"); 17681 if (this.isFetchEnabled) 17682 this.isLoading = true; 17683 super.connectedCallback(); 17684 } 17685 disconnectedCallback() { 17686 super.disconnectedCallback(); 17687 } 17688 renderLoader() { 17689 if (!(this.isLoading && this.loader !== void 0)) 17690 return A$1; 17691 const template = this.templateParts["skeleton"]; 17692 if (template) 17693 return A$1; 17694 const loader = this.loader === true || this.loader === "" ? "fixed" : this.loader; 17695 return b$1`<sonic-loader mode=${loader}></sonic-loader>`; 17696 } 17697 renderSkeleton() { 17698 if (this.skeleton) { 17699 return this.skeleton(); 17700 } 17701 const template = this.templateParts["skeleton"]; 17702 if (!(this.isLoading && template)) 17703 return A$1; 17704 return o$2(template); 17705 } 17706 renderSeparator() { 17707 if (this.separator) { 17708 return this.separator(); 17709 } 17710 const template = this.templateParts["separator"]; 17711 if (!template) 17712 return A$1; 17713 return o$2(template); 17714 } 17715 renderLoadingState() { 17716 return b$1`${this.renderSkeleton()} ${this.renderLoader()} `; 17717 } 17718 renderNoResultState() { 17719 return b$1` <div 17720 style="color: var(--sc-base-400); 17721 font-size: 1.5em; 17722 margin: 4rem 0; 17723 display: flex; 17724 gap: 0.5rem;" 17725 > 17726 <sonic-icon name="emoji-puzzled" size="lg"></sonic-icon 17727 ><span class="sonic-no-result-text" 17728 >${typeof this.props === "string" && this.props == "" ? "Aucun résultat" : this.props}</span 17729 > 17730 </div>`; 17731 } 17732 formatProps() { 17733 let props = this.props; 17734 if (props == null) { 17735 return null; 17736 } 17737 const response = props._sonic_http_response_; 17738 const extractValues = this.hasAttribute("extractValues"); 17739 if (!Array.isArray(props)) { 17740 if (extractValues) { 17741 props = Object.entries(props).map(([k2, v2]) => ({ key: k2, value: v2 })); 17742 } else { 17743 if (Objects$1.isObject(props) && Object.keys(props).length > 0 && (!response || response.ok)) 17744 props = [props]; 17745 else { 17746 props = []; 17747 } 17748 } 17749 } 17750 props = props.filter((e2) => e2 != null); 17751 if (response) 17752 props._sonic_http_response_ = response; 17753 return props; 17754 } 17755 updated(_changedProperties) { 17756 window.requestAnimationFrame(() => { 17757 if (!this.isLoading) { 17758 this.style.setProperty("--list-loader-height-display", "none"); 17759 return; 17760 } 17761 this.style.setProperty("--list-loader-height-display", "block"); 17762 this.loadingSize = this.getDisplayContentsSize(this); 17763 }); 17764 super.updated(_changedProperties); 17765 } 17766 getAllRenderableElements(root) { 17767 let elements = []; 17768 function collectElements(node) { 17769 if (node.nodeType === Node.ELEMENT_NODE) {
vendor: 5,711 bytes, lines 17770-17934
17770 const rect = node.getBoundingClientRect(); 17771 if (rect.width > 0 || rect.height > 0) { 17772 elements.push(node); 17773 } 17774 node.childNodes.forEach(collectElements); 17775 if (node.shadowRoot) { 17776 node.shadowRoot.childNodes.forEach(collectElements); 17777 } 17778 } 17779 } 17780 collectElements(root); 17781 return elements; 17782 } 17783 getDisplayContentsSize(element) { 17784 const elements = this.getAllRenderableElements(element); 17785 if (elements.length === 0) 17786 return { width: 0, height: 0 }; 17787 const rects = elements.map((el) => el.getBoundingClientRect()); 17788 const minX = Math.min(...rects.map((r2) => r2.left)); 17789 const maxX = Math.max(...rects.map((r2) => r2.right)); 17790 const minY = Math.min(...rects.map((r2) => r2.top)); 17791 const maxY = Math.max(...rects.map((r2) => r2.bottom)); 17792 return { width: maxX - minX, height: maxY - minY }; 17793 } 17794 render() { 17795 return b$1` 17796 ${this.renderContent()} 17797 <div 17798 style="grid-column: 1 / -1;min-height:${this.isLoading ? 0 : this.loadingSize.height}px; width:0;float:left;display: var(--list-loader-height-display);" 17799 ></div> 17800 `; 17801 } 17802 handleProgrammaticTemplates(item, metadata, key) { 17803 if (!this.items) 17804 return null; 17805 return b$1`<sonic-subscriber 17806 ?debug=${this.defferedDebug === true} 17807 .bindPublisher=${() => this.publisher[key]} 17808 .propertyMap?=${this.itemPropertyMap} 17809 dataProvider="${this.dataProvider}/list-item/${key}" 17810 > 17811 ${this.items(item, metadata)} 17812 </sonic-subscriber>`; 17813 } 17814 renderContent() { 17815 const isLoadingState = this.isLoading && !Array.isArray(this.props); 17816 if (isLoadingState) 17817 return this.renderLoadingState(); 17818 const isString = typeof this.props === "string"; 17819 if (isString) 17820 return this.renderNoResultState(); 17821 const propsIsBaddlyFormatted = !Objects$1.isObject(this.props); 17822 if (propsIsBaddlyFormatted) 17823 return b$1`<div></div>`; 17824 const props = this.formatProps(); 17825 if ((props?.length || 0) == 0) { 17826 if (this.noItems) { 17827 return this.noItems(); 17828 } 17829 this.templateParts["no-items"] = this.templateParts["no-items"] || this.templateParts["no-item"]; 17830 if (this.templateParts["no-items"]) { 17831 return o$2(this.templateParts["no-items"]); 17832 } 17833 } 17834 const templateCount = this.templateList.length; 17835 let counter = -1; 17836 const extractValues = this.hasAttribute("extractValues"); 17837 const separator = this.renderSeparator(); 17838 const length = props?.length || 0; 17839 const items = props?.slice(this.offset, this.offset + this.limit); 17840 return b$1` 17841 ${items?.map((item, index) => { 17842 if (item == null) 17843 return A$1; 17844 let key = index; 17845 let templatePart = null; 17846 if (typeof item == "object" && !Array.isArray(item)) { 17847 if (extractValues) 17848 key = item?.["key"]; 17849 const templatePartName = item[this.templateKey]; 17850 if (templatePartName && typeof templatePartName == "string") { 17851 templatePart = this.templateParts[templatePartName]; 17852 } 17853 } 17854 if (key == "_sonic_http_response_") 17855 return A$1; 17856 if (typeof key != "string" && typeof key != "number") 17857 return A$1; 17858 const isLastChild = index >= length - 1; 17859 const indexMod2 = index % 2; 17860 const childPublisher = this.publisher[key]; 17861 const metadata = { 17862 key, 17863 even: indexMod2 == 0, 17864 odd: indexMod2 == 1, 17865 onlyChild: length == 1, 17866 firstChild: index == 0, 17867 lastChild: isLastChild 17868 }; 17869 childPublisher._key_ = key + ""; 17870 childPublisher._metadata_ = { 17871 ...childPublisher._metadata_.get(), 17872 ...metadata 17873 }; 17874 const programmaticTemplate = this.handleProgrammaticTemplates(item, metadata, key); 17875 if (programmaticTemplate) { 17876 return b$1`${programmaticTemplate}${!isLastChild ? separator : A$1}`; 17877 } 17878 counter++; 17879 if (templatePart) 17880 counter = -1; 17881 return b$1` 17882 <sonic-subscriber 17883 ?debug=${this.defferedDebug === true} 17884 .bindPublisher=${function() { 17885 return childPublisher; 17886 }} 17887 .propertyMap?=${this.itemPropertyMap} 17888 dataProvider="${this.dataProvider}/list-item/${key}" 17889 > 17890 ${templatePart ? o$2(templatePart) : o$2(this.templateList[counter % templateCount])} 17891 </sonic-subscriber> 17892 ${!isLastChild ? separator : A$1} 17893 `; 17894 })} 17895 `; 17896 } 17897 }; 17898 __decorate$C([ 17899 n$5({ type: Object }) 17900 ], List.prototype, "itemPropertyMap", void 0); 17901 __decorate$C([ 17902 n$5({ type: String }) 17903 ], List.prototype, "templateKey", void 0); 17904 __decorate$C([ 17905 n$5({ type: String }) 17906 ], List.prototype, "idKey", void 0); 17907 __decorate$C([ 17908 n$5() 17909 ], List.prototype, "loader", void 0); 17910 __decorate$C([ 17911 n$5() 17912 ], List.prototype, "limit", void 0); 17913 __decorate$C([ 17914 n$5() 17915 ], List.prototype, "offset", void 0); 17916 __decorate$C([ 17917 n$5({ 17918 type: Function, 17919 attribute: false 17920 }) 17921 /**add a getter setter check if the value is a ListItems befor assignation */ 17922 ], List.prototype, "items", null); 17923 __decorate$C([ 17924 n$5({ type: Function, attribute: false }) 17925 ], List.prototype, "noItems", void 0); 17926 __decorate$C([ 17927 n$5({ type: Function, attribute: false }) 17928 ], List.prototype, "skeleton", void 0); 17929 __decorate$C([ 17930 n$5({ type: Function, attribute: false }) 17931 ], List.prototype, "separator", void 0); 17932 List = __decorate$C([ 17933 t$3(tagName$2w) 17934 ], List);
vendor: 11,128 bytes, lines 17935-18218
17935 var __decorate$B = function(decorators, target, key, desc) { 17936 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 17937 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 17938 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; 17939 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 17940 }; 17941 var Queue_1; 17942 const tagName$2v = "sonic-queue"; 17943 let Queue = Queue_1 = class Queue extends Subscriber$1(i$6) { 17944 constructor() { 17945 super(...arguments); 17946 this.templates = null; 17947 this.items = null; 17948 this.noItems = null; 17949 this.skeleton = null; 17950 this.lastRequestTime = 0; 17951 this.key = ""; 17952 this.itemPropertyMap = null; 17953 this.cache = "default"; 17954 this.targetRequestDuration = 500; 17955 this.limit = 5; 17956 this.lazyBoundsRatio = 1; 17957 this.offset = 0; 17958 this.resultCount = 0; 17959 this.noLazyload = false; 17960 this.loader = "inline"; 17961 this.filteredFields = ""; 17962 this.instanceId = 0; 17963 this.localStorage = "disabled"; 17964 this.filterPublisher = null; 17965 this.filterTimeoutMs = 400; 17966 this.searchHash = ""; 17967 this.requestId = 0; 17968 this.isFirstRequest = true; 17969 this.updateFilteredContent = () => { 17970 const dataProvider = this.dataProviderExpression; 17971 const split = dataProvider.split("?"); 17972 split.shift(); 17973 const searchParams = new URLSearchParams(split.join("?")); 17974 const filterData = this.filterPublisher?.get(); 17975 const filteredFieldsArray = this.filteredFields.split(" "); 17976 for (const f2 in filterData) { 17977 let value = filterData[f2]; 17978 if (Array.isArray(value)) 17979 value = value.filter((v2) => v2 !== null); 17980 if (this.filteredFields && filteredFieldsArray.includes(f2) || value == null || value.toString() === "") 17981 continue; 17982 searchParams.set(f2, filterData[f2].toString()); 17983 } 17984 const searchHash = searchParams.toString(); 17985 if (searchHash == this.searchHash && !this.isFirstRequest) 17986 return; 17987 this.searchHash = searchHash; 17988 resetScrollRoot(this.resolveScrollRoot(), { x: 0, y: 0 }); 17989 for (const dataProvider2 of this.listDataProviders) { 17990 PublisherManager.getInstance().delete(dataProvider2); 17991 } 17992 this.listDataProviders = []; 17993 clearTimeout(this.filterTimeoutId); 17994 this.filterTimeoutId = setTimeout(async () => { 17995 const count = this.resultCount; 17996 this.props = null; 17997 this.requestId++; 17998 this.resultCount = count; 17999 await PublisherManager.getInstance().isLocalStrorageReady; 18000 window.requestAnimationFrame(() => this.next()); 18001 }, this.isFirstRequest ? 0 : this.filterTimeoutMs); 18002 this.isFirstRequest = false; 18003 }; 18004 this.scrollRoot = null; 18005 this.scrollSyncActive = false; 18006 this.mutationObserver = null; 18007 this.restoreGeneration = 0; 18008 this.dataProviderExpression = ""; 18009 this.invalidateOnPageShow = false; 18010 this.idKey = "id"; 18011 this.listDataProviders = []; 18012 this.nextHadEvent = false; 18013 } 18014 disconnectedCallback() { 18015 for (const dataProvider of this.listDataProviders) { 18016 PublisherManager.getInstance().delete(dataProvider); 18017 this.listDataProviders = []; 18018 } 18019 this.filterPublisher?.offInternalMutation(this.updateFilteredContent); 18020 this.props = null; 18021 this.limit = 5; 18022 this.offset = 0; 18023 this.resultCount = 0; 18024 this.searchHash = ""; 18025 this.requestId = 0; 18026 this.isFirstRequest = true; 18027 this.nextHadEvent = false; 18028 this.teardownScrollSync(); 18029 this.publisher.set({}); 18030 super.disconnectedCallback(); 18031 return; 18032 } 18033 async connectedCallback() { 18034 this.instanceId = Queue_1.instanceCounter++; 18035 this.localStorage = this.getAttribute("localStorage") || this.localStorage; 18036 this.filterTimeoutMs = parseInt(this.getAttribute("filterTimeoutMs") || "400"); 18037 this.removeAttribute("localStorage"); 18038 this.noShadowDom = ""; 18039 this.defferedDebug = this.hasAttribute("debug") || null; 18040 if (!this.dataProvider) 18041 this.dataProvider = this.dataProviderExpression || "sonic-queue-" + this.instanceId + "-" + Math.random().toString(36).substring(7); 18042 if (!this.dataProviderExpression) { 18043 this.dataProviderExpression = HTML.getAncestorAttributeValue(this.parentElement, "dataProvider") || ""; 18044 } 18045 this.ensureScrollSync(); 18046 super.connectedCallback(); 18047 this.publisher.set({}); 18048 this.key = this.getAttribute("key"); 18049 await PublisherManager.getInstance().isLocalStrorageReady; 18050 if (!this.templates) 18051 this.templates = Array.from(this.querySelectorAll("template")); 18052 this.lastRequestTime = (/* @__PURE__ */ new Date()).getTime(); 18053 this.configFilter(); 18054 } 18055 configFilter() { 18056 const dataFilterProvider = this.getAncestorAttributeValue("dataFilterProvider"); 18057 if (!dataFilterProvider) { 18058 this.next(); 18059 return; 18060 } 18061 this.filterPublisher = PublisherManager.getInstance().get(dataFilterProvider); 18062 this.filterPublisher?.onInternalMutation(this.updateFilteredContent); 18063 } 18064 resolveScrollRoot() { 18065 const ancestor = HTML.getScrollingAncestor(this); 18066 if (!ancestor || ancestor === document.documentElement || ancestor === document.body) { 18067 return window; 18068 } 18069 return ancestor; 18070 } 18071 isSafari() { 18072 return isSafariScrollEngine(); 18073 } 18074 ensureScrollSync() { 18075 if (!isSafariScrollEngine() || !this.isConnected) { 18076 return; 18077 } 18078 const root = this.resolveScrollRoot(); 18079 this.scrollRoot = root; 18080 watchScrollRoot(root); 18081 if (this.scrollSyncActive) { 18082 return; 18083 } 18084 this.scrollSyncActive = true; 18085 this.mutationObserver = new MutationObserver(() => { 18086 this.scheduleRestoreAfterChildren(); 18087 }); 18088 this.mutationObserver.observe(this, { 18089 childList: true, 18090 subtree: true, 18091 characterData: true 18092 }); 18093 } 18094 teardownScrollSync() { 18095 this.restoreGeneration++; 18096 this.mutationObserver?.disconnect(); 18097 this.mutationObserver = null; 18098 this.scrollSyncActive = false; 18099 this.scrollRoot = null; 18100 } 18101 /** 18102 * Attend la fin des updates Lit de la queue + sonic-list, puis 2 rAF (layout Safari). 18103 * Ne pas await updateComplete *dans* updated (deadlock) â on sort du cycle via void async. 18104 */ 18105 scheduleRestoreAfterChildren() { 18106 if (!isSafariScrollEngine() || !this.isConnected) { 18107 return; 18108 } 18109 const generation = ++this.restoreGeneration; 18110 void (async () => { 18111 await this.updateComplete; 18112 if (generation !== this.restoreGeneration || !this.isConnected) 18113 return; 18114 const lists = Array.from(this.querySelectorAll("sonic-list")); 18115 if (lists.length) { 18116 await Promise.all(lists.map((list) => list.updateComplete)); 18117 } 18118 if (generation !== this.restoreGeneration || !this.isConnected) 18119 return; 18120 await new Promise((r2) => requestAnimationFrame(() => r2())); 18121 await new Promise((r2) => requestAnimationFrame(() => r2())); 18122 if (generation !== this.restoreGeneration || !this.isConnected) 18123 return; 18124 const root = this.scrollRoot ?? this.resolveScrollRoot(); 18125 watchScrollRoot(root); 18126 restoreScrollRoot(root); 18127 })(); 18128 } 18129 updated(_changedProperties) { 18130 if (isSafariScrollEngine()) { 18131 this.ensureScrollSync(); 18132 const root = this.scrollRoot ?? this.resolveScrollRoot(); 18133 restoreScrollRoot(root); 18134 this.scheduleRestoreAfterChildren(); 18135 } 18136 super.updated(_changedProperties); 18137 } 18138 resetDuration() { 18139 this.lastRequestTime = (/* @__PURE__ */ new Date()).getTime(); 18140 } 18141 next(e2) { 18142 let offset = this.offset; 18143 const newTime = (/* @__PURE__ */ new Date()).getTime(); 18144 const requestDuration = newTime - this.lastRequestTime; 18145 if (!this.nextHadEvent && e2) { 18146 this.publisher.resultCount = 0; 18147 this.resultCount = 0; 18148 } 18149 this.nextHadEvent = !!e2; 18150 if (e2) { 18151 this.publisher.lastFetchedData = e2.detail.fetchedData; 18152 if (e2.detail.requestId < this.requestId) 18153 return; 18154 this.resultCount += e2.detail.props?.length || 0; 18155 if (!e2.detail.isFirstLoad || !e2.detail.props?.length || this.dataProviderExpression.indexOf("$offset") == -1) { 18156 this.publisher.resultCount = this.resultCount; 18157 return; 18158 } 18159 } 18160 if (!Array.isArray(this.props)) { 18161 const newProps2 = []; 18162 newProps2.resultCount = this.resultCount; 18163 newProps2.lastFetchedData = e2?.detail.fetchedData || {}; 18164 this.props = newProps2; 18165 } else { 18166 const props = this.props; 18167 const item = props[props.length - 1]; 18168 offset = parseInt(item.offset.toString()) + parseInt(item.limit.toString()); 18169 } 18170 if (requestDuration > 0 && e2 && !this.localStorage) { 18171 this.limit = Math.round(this.limit / requestDuration * this.targetRequestDuration); 18172 } 18173 if (this.limit < 1) 18174 this.limit = 1; 18175 if (this.limit > 15) 18176 this.limit = 15; 18177 let dataProvider = this.dataProviderExpression.replace("$offset", offset + "").replace("$limit", this.limit + ""); 18178 const split = dataProvider.split("?"); 18179 let endpoint = split.shift(); 18180 const searchParams = new URLSearchParams(split.join("?")); 18181 const filterData = this.filterPublisher?.get(); 18182 const filteredFieldsArray = this.filteredFields.split(" "); 18183 for (const f2 in filterData) { 18184 if (this.filteredFields && filteredFieldsArray.includes(f2) || filterData[f2] == null || filterData[f2] == "") 18185 continue; 18186 searchParams.set(f2, filterData[f2]); 18187 } 18188 if (!this.searchHash) 18189 this.searchHash = searchParams.toString(); 18190 endpoint = endpoint + "?" + searchParams.toString(); 18191 dataProvider = dataProvider + "_item_from_queue_" + this.instanceId; 18192 this.listDataProviders.push(dataProvider); 18193 const newProps = [ 18194 ...this.props, 18195 { 18196 id: searchParams.toString() + "/" + this.props.length, 18197 dataProvider, 18198 endPoint: endpoint, 18199 offset, 18200 limit: this.limit 18201 } 18202 ]; 18203 newProps.resultCount = this.resultCount; 18204 newProps.lastFetchedData = e2?.detail.fetchedData || {}; 18205 this.props = newProps; 18206 this.lastRequestTime = (/* @__PURE__ */ new Date()).getTime(); 18207 } 18208 render() { 18209 if (this.isSafari()) { 18210 this.scrollRoot = this.resolveScrollRoot(); 18211 this.ensureScrollSync(); 18212 } 18213 if (!Array.isArray(this.props)) { 18214 return A$1; 18215 } 18216 let lazyload = !this.noLazyload; 18217 if (this.props.length == 1) { 18218 lazyload = false;
18219 } 18220 this.style.display = "block"; 18221 return b$1` 18222 ${o$1(this.props, (item, index) => { 18223 const templates = index == 0 ? this.templates : this.templates?.filter((elt) => elt.getAttribute("data-value") != "no-item"); 18224 return b$1` 18225 <sonic-list 18226 fetch 18227 loader="${this.loader}" 18228 cache=${this.cache} 18229 displayContents 18230 lazyBoundsRatio=${this.lazyBoundsRatio} 18231 ?lazyload=${lazyload} 18232 ?invalidateOnPageShow=${this.invalidateOnPageShow} 18233 localStorage=${this.localStorage} 18234 requestId=${this.requestId} 18235 .itemPropertyMap=${this.itemPropertyMap} 18236 ?debug=${this.defferedDebug === true} 18237 @load=${this.next} 18238 key=${this.key} 18239 @loading=${this.resetDuration} 18240 dataProvider="${item.dataProvider}" 18241 endPoint="${item.endPoint}" 18242 idKey=${this.idKey} 18243 .templates=${templates} 18244 .items=${this.items} 18245 .noItems=${index == 0 ? this.noItems : void 0} 18246 .skeleton=${this.skeleton} 18247 > 18248 </sonic-list> 18249 `; 18250 })} 18251 `; 18252 } 18253 }; 18254 Queue.instanceCounter = 0; 18255 __decorate$B([ 18256 n$5({ type: Array }) 18257 ], Queue.prototype, "templates", void 0); 18258 __decorate$B([ 18259 n$5({ type: Function, attribute: false }) 18260 ], Queue.prototype, "items", void 0); 18261 __decorate$B([ 18262 n$5({ type: Function, attribute: false }) 18263 ], Queue.prototype, "noItems", void 0); 18264 __decorate$B([ 18265 n$5({ type: Function, attribute: false }) 18266 ], Queue.prototype, "skeleton", void 0); 18267 __decorate$B([ 18268 n$5({ type: Object }) 18269 ], Queue.prototype, "itemPropertyMap", void 0); 18270 __decorate$B([ 18271 n$5() 18272 ], Queue.prototype, "cache", void 0); 18273 __decorate$B([ 18274 n$5() 18275 ], Queue.prototype, "targetRequestDuration", void 0); 18276 __decorate$B([ 18277 n$5() 18278 ], Queue.prototype, "limit", void 0); 18279 __decorate$B([ 18280 n$5() 18281 ], Queue.prototype, "lazyBoundsRatio", void 0); 18282 __decorate$B([ 18283 n$5() 18284 ], Queue.prototype, "offset", void 0); 18285 __decorate$B([ 18286 n$5() 18287 ], Queue.prototype, "resultCount", void 0); 18288 __decorate$B([ 18289 n$5({ type: Boolean }) 18290 ], Queue.prototype, "noLazyload", void 0); 18291 __decorate$B([ 18292 n$5({ type: String }) 18293 ], Queue.prototype, "loader", void 0); 18294 __decorate$B([ 18295 n$5() 18296 ], Queue.prototype, "filteredFields", void 0); 18297 __decorate$B([ 18298 n$5({ type: String }) 18299 ], Queue.prototype, "dataProviderExpression", void 0); 18300 __decorate$B([ 18301 n$5({ type: Boolean }) 18302 ], Queue.prototype, "invalidateOnPageShow", void 0); 18303 __decorate$B([ 18304 n$5({ type: String }) 18305 ], Queue.prototype, "idKey", void 0); 18306 Queue = Queue_1 = __decorate$B([ 18307 t$3(tagName$2v) 18308 ], Queue); 18309 var __defProp$3K = Object.defineProperty; 18310 var __getOwnPropDesc$3N = Object.getOwnPropertyDescriptor; 18311 var __decorateClass$3O = (decorators, target, key, kind) => { 18312 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3N(target, key) : target; 18313 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18314 if (decorator = decorators[i2]) 18315 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18316 if (kind && result) __defProp$3K(target, key, result); 18317 return result; 18318 }; 18319 const tagName$2u = "sonic-no-result"; 18320 let SonicComponent$j = class SonicComponent extends Subscriber$1(i$6) { 18321 constructor() { 18322 super(...arguments); 18323 this.wording_aucun_resultats = ""; 18324 this.size = "xl"; 18325 this.align = "left"; 18326 } 18327 render() { 18328 return b$1`<div> 18329 <div class="flex gap-[.3em] ${this.align == "center" ? "justify-center text-center" : ""}"> 18330 <sonic-icon library="custom" name="face-thinking" size="lg"></sonic-icon> 18331 <div> 18332 <div>${this.text || this.wording_aucun_resultats}</div> 18333 <slot></slot> 18334 </div> 18335 </div> 18336 <slot name="suffix"></slot> 18337 </div> `; 18338 } 18339 }; 18340 SonicComponent$j.styles = [ 18341 tailwind, 18342 fontSize, 18343 i$9` 18344 :host { 18345 grid-column: 1 / -1; 18346 margin-top: 2em; 18347 margin-bottom: 2em; 18348 padding-left: 0.25em; 18349 display: block; 18350 color: var(--sc-base-400); 18351 } 18352 ` 18353 ]; 18354 __decorateClass$3O([ 18355 n$5({ type: String }) 18356 ], SonicComponent$j.prototype, "text", 2); 18357 __decorateClass$3O([ 18358 n$5({ type: String }) 18359 ], SonicComponent$j.prototype, "wording_aucun_resultats", 2); 18360 __decorateClass$3O([ 18361 n$5({ type: String, reflect: true }) 18362 ], SonicComponent$j.prototype, "size", 2); 18363 __decorateClass$3O([ 18364 n$5({ type: String }) 18365 ], SonicComponent$j.prototype, "align", 2); 18366 SonicComponent$j = __decorateClass$3O([ 18367 t$3(tagName$2u) 18368 ], SonicComponent$j); 18369 var __defProp$3J = Object.defineProperty; 18370 var __getOwnPropDesc$3M = Object.getOwnPropertyDescriptor; 18371 var __decorateClass$3N = (decorators, target, key, kind) => { 18372 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3M(target, key) : target; 18373 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18374 if (decorator = decorators[i2]) 18375 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18376 if (kind && result) __defProp$3J(target, key, result); 18377 return result; 18378 }; 18379 let Title = class extends Subscriber$1(i$6) { 18380 constructor() { 18381 super(...arguments); 18382 this.machineName = false;
18383 this.title = ""; 18384 this.over_title = ""; 18385 this.sub_title = ""; 18386 this.alt_title = ""; 18387 this.noOverTitle = false; 18388 } 18389 getTitle() { 18390 const altTitle = this.alt_title; 18391 return altTitle ? altTitle : this.title; 18392 } 18393 connectedCallback() { 18394 if (!this.hasAttribute("subDataProvider")) this.setAttribute("subDataProvider", "edito"); 18395 super.connectedCallback(); 18396 } 18397 render() { 18398 if (this.machineName) { 18399 return b$1`<div class="title">${this.title}</div> `; 18400 } 18401 return b$1` 18402 ${this.over_title && !this.noOverTitle ? b$1`<div class="surtitle">${this.over_title}</div>` : A$1} 18403 <div class="title">${o$6(this.getTitle())}</div> 18404 ${this.sub_title ? b$1`<div class="subtitle">${this.sub_title}</div>` : A$1} 18405 `; 18406 } 18407 }; 18408 Title.styles = [ 18409 fontSize, 18410 i$9` 18411 :host { 18412 line-height: 1.15; 18413 display: block; 18414 } 18415 18416 .surtitle { 18417 font-size: clamp(11px, 0.7em, 16px); 18418 margin-bottom: 0.35em; 18419 line-height: 1.15; 18420 font-family: var(--sc-font-family-base); 18421 font-weight: var(--sc-font-weight-base); 18422 } 18423 18424 .title { 18425 font-size: max(13px, 1em); 18426 max-width: 64ch; 18427 font-weight: bold; 18428 line-height: 1.15; 18429 text-wrap: pretty; 18430 /*margin-bottom: 0.15em;*/ 18431 } 18432 18433 .subtitle { 18434 font-size: max(11px, 0.8em); 18435 font-weight: bold; 18436 line-height: 1.15; 18437 text-wrap: pretty; 18438 } 18439 ` 18440 ]; 18441 __decorateClass$3N([ 18442 n$5({ type: String, reflect: true }) 18443 ], Title.prototype, "size", 2); 18444 __decorateClass$3N([ 18445 n$5({ type: Boolean, reflect: true }) 18446 ], Title.prototype, "machineName", 2); 18447 __decorateClass$3N([ 18448 n$5({ type: String }) 18449 ], Title.prototype, "title", 2); 18450 __decorateClass$3N([ 18451 n$5({ type: String }) 18452 ], Title.prototype, "over_title", 2); 18453 __decorateClass$3N([ 18454 n$5({ type: String }) 18455 ], Title.prototype, "sub_title", 2); 18456 __decorateClass$3N([ 18457 n$5({ type: String }) 18458 ], Title.prototype, "alt_title", 2); 18459 __decorateClass$3N([ 18460 n$5({ type: Boolean }) 18461 ], Title.prototype, "noOverTitle", 2); 18462 Title = __decorateClass$3N([ 18463 t$3("sonic-product-title") 18464 ], Title); 18465 var __defProp$3I = Object.defineProperty; 18466 var __getOwnPropDesc$3L = Object.getOwnPropertyDescriptor; 18467 var __decorateClass$3M = (decorators, target, key, kind) => { 18468 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3L(target, key) : target; 18469 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18470 if (decorator = decorators[i2]) 18471 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18472 if (kind && result) __defProp$3I(target, key, result); 18473 return result; 18474 }; 18475 let eventLink = class extends Button { 18476 constructor() { 18477 super(...arguments); 18478 this.slug = ""; 18479 this.hash = ""; 18480 this.multiple = null; 18481 } 18482 connectedCallback() { 18483 if (this.customHref) { 18484 this.href = this.customHref; 18485 } 18486 super.connectedCallback(); 18487 } 18488 willUpdate(changedProperties) { 18489 const id = this.id; 18490 let href = null; 18491 if (changedProperties.has("slug") || changedProperties.has("multiple")) { 18492 if (!this.customHref) { 18493 href = appRoute(this.subPath ? `event.${this.subPath}` : "event"); 18494 const isSessionLink = this.multiple === null; 18495 if (isSessionLink) href.query({ session: this.id }); 18496 href.fill({ id, slug: this.slug }); 18497 } 18498 } 18499 this.href = href?.toString() || this.href; 18500 super.willUpdate(changedProperties); 18501 } 18502 }; 18503 __decorateClass$3M([ 18504 n$5({ type: String }) 18505 ], eventLink.prototype, "slug", 2); 18506 __decorateClass$3M([ 18507 n$5({ type: String }) 18508 ], eventLink.prototype, "customHref", 2); 18509 __decorateClass$3M([ 18510 n$5({ type: String }) 18511 ], eventLink.prototype, "entity_type", 2); 18512 __decorateClass$3M([ 18513 n$5({ type: String }) 18514 ], eventLink.prototype, "hash", 2); 18515 __decorateClass$3M([ 18516 n$5({ type: String }) 18517 ], eventLink.prototype, "subPath", 2); 18518 __decorateClass$3M([ 18519 n$5({ type: Boolean }) 18520 ], eventLink.prototype, "multiple", 2); 18521 eventLink = __decorateClass$3M([ 18522 t$3("sonic-event-link") 18523 ], eventLink); 18524 const styles$3 = i$9` 18525 :host { 18526 display: inline-flex; 18527 align-items: center; 18528 gap:.35em; 18529 flex-wrap:wrap; 18530 } 18531 .city-name { 18532 font-weight: 600; 18533 } 18534 sonic-icon{ 18535 margin-right:.2em; 18536 } 18537`; 18538 var __defProp$3H = Object.defineProperty; 18539 var __getOwnPropDesc$3K = Object.getOwnPropertyDescriptor; 18540 var __decorateClass$3L = (decorators, target, key, kind) => { 18541 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3K(target, key) : target; 18542 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18543 if (decorator = decorators[i2]) 18544 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18545 if (kind && result) __defProp$3H(target, key, result); 18546 return result; 18547 }; 18548 let SonicLocation = class extends i$6 { 18549 constructor() { 18550 super(...arguments); 18551 this.displayCity = false;
18552 this.location_city_name = ""; 18553 this.location_name = ""; 18554 } 18555 render() { 18556 const showCity = this.location_city_name && this.displayCity; 18557 return b$1` 18558 <sonic-if ?condition=${showCity === true}> 18559 <span class="city-name"> ${this.location_city_name}</span> 18560 <sonic-if ?condition=${!!this.location_name}> ⢠</sonic-if> 18561 </sonic-if> 18562 <span>${this.location_name}</span> 18563 `; 18564 } 18565 }; 18566 SonicLocation.styles = [styles$3]; 18567 __decorateClass$3L([ 18568 n$5({ type: Boolean }) 18569 ], SonicLocation.prototype, "displayCity", 2); 18570 __decorateClass$3L([ 18571 n$5({ type: String }) 18572 ], SonicLocation.prototype, "location_city_name", 2); 18573 __decorateClass$3L([ 18574 n$5({ type: String }) 18575 ], SonicLocation.prototype, "location_name", 2); 18576 SonicLocation = __decorateClass$3L([ 18577 t$3("sonic-event-location") 18578 ], SonicLocation); 18579 var __defProp$3G = Object.defineProperty; 18580 var __getOwnPropDesc$3J = Object.getOwnPropertyDescriptor; 18581 var __decorateClass$3K = (decorators, target, key, kind) => { 18582 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3J(target, key) : target; 18583 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18584 if (decorator = decorators[i2]) 18585 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18586 if (kind && result) __defProp$3G(target, key, result); 18587 return result; 18588 }; 18589 let Hall = class extends /*Subscriber*/ 18590 i$6 { 18591 constructor() { 18592 super(...arguments); 18593 this.room_display_name = false; 18594 this.room_name = ""; 18595 this.room_placing_type_label = ""; 18596 this.room_free_placing_add_on_label = ""; 18597 this.noPlacement = false; 18598 } 18599 render() { 18600 const name = this.room_display_name == true ? b$1`<span class="inline">${this.room_name}</span>` : ""; 18601 const separator1 = this.room_name && this.room_display_name && this.room_placing_type_label ? " â " : ""; 18602 const separator2 = this.room_free_placing_add_on_label && (this.room_name && this.room_display_name || this.room_placing_type_label) ? " â " : ""; 18603 const firstPart = name ? b$1` ${name} ${separator1} ` : ``; 18604 if (this.noPlacement && name) return b$1`${name}`; 18605 return b$1`${firstPart}<span class="inline" 18606 >${this.room_placing_type_label} ${separator2} ${this.room_free_placing_add_on_label}</span 18607 >`; 18608 } 18609 }; 18610 Hall.styles = [tailwind]; 18611 __decorateClass$3K([ 18612 n$5({ type: Boolean }) 18613 ], Hall.prototype, "room_display_name", 2); 18614 __decorateClass$3K([ 18615 n$5({ type: String }) 18616 ], Hall.prototype, "room_name", 2); 18617 __decorateClass$3K([ 18618 n$5({ type: String }) 18619 ], Hall.prototype, "room_placing_type_label", 2); 18620 __decorateClass$3K([ 18621 n$5({ type: String }) 18622 ], Hall.prototype, "room_free_placing_add_on_label", 2); 18623 __decorateClass$3K([ 18624 n$5({ type: Boolean }) 18625 ], Hall.prototype, "noPlacement", 2); 18626 Hall = __decorateClass$3K([ 18627 t$3("sonic-event-hall") 18628 ], Hall); 18629 var __decorate$A = function(decorators, target, key, desc) { 18630 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 18631 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 18632 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; 18633 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 18634 }; 18635 const tagName$2t = "sonic-tooltip"; 18636 let Tooltip = class Tooltip extends i$6 { 18637 constructor() { 18638 super(); 18639 this.label = ""; 18640 this.disabled = false; 18641 this.focusable = false; 18642 this.lastKeyWasTab = false; 18643 this.handleKeyDown = (e2) => { 18644 if (e2.key === "Tab") { 18645 this.lastKeyWasTab = true; 18646 } 18647 }; 18648 this.handleMouseDown = () => { 18649 this.lastKeyWasTab = false; 18650 this.classList.remove("keyboard-focus"); 18651 }; 18652 this.handleFocusIn = () => { 18653 if (this.lastKeyWasTab) { 18654 this.classList.add("keyboard-focus"); 18655 } 18656 this.lastKeyWasTab = false;
vendor: 5,265 bytes, lines 18657-18831
18657 }; 18658 this.handleFocusOut = () => { 18659 this.classList.remove("keyboard-focus"); 18660 this.lastKeyWasTab = false; 18661 }; 18662 this.boundHandleKeyDown = this.handleKeyDown.bind(this); 18663 this.boundHandleMouseDown = this.handleMouseDown.bind(this); 18664 } 18665 connectedCallback() { 18666 super.connectedCallback(); 18667 this.addEventListener("focusin", this.handleFocusIn); 18668 this.addEventListener("focusout", this.handleFocusOut); 18669 document.addEventListener("keydown", this.boundHandleKeyDown, true); 18670 document.addEventListener("mousedown", this.boundHandleMouseDown, true); 18671 } 18672 disconnectedCallback() { 18673 super.disconnectedCallback(); 18674 this.removeEventListener("focusin", this.handleFocusIn); 18675 this.removeEventListener("focusout", this.handleFocusOut); 18676 document.removeEventListener("keydown", this.boundHandleKeyDown, true); 18677 document.removeEventListener("mousedown", this.boundHandleMouseDown, true); 18678 } 18679 willUpdate(_changedProperties) { 18680 if (_changedProperties.has("disabled")) { 18681 const wasDisabledBefore = _changedProperties.get("disabled") === true; 18682 if (this.disabled) { 18683 this.setAttribute("tabindex", "-1"); 18684 this.classList.remove("keyboard-focus"); 18685 } else if (!this.disabled && wasDisabledBefore) { 18686 if (this.focusable) { 18687 this.setAttribute("tabindex", "0"); 18688 } else { 18689 this.removeAttribute("tabindex"); 18690 } 18691 } 18692 } 18693 if (_changedProperties.has("focusable")) { 18694 if (this.focusable && !this.disabled) { 18695 this.setAttribute("tabindex", "0"); 18696 } else if (!this.focusable && !this.disabled) { 18697 this.removeAttribute("tabindex"); 18698 } 18699 } 18700 super.willUpdate(_changedProperties); 18701 } 18702 render() { 18703 const disabledClass = this.disabled || this.label == "" ? "disabled" : ""; 18704 return b$1`<div 18705 data-tooltip-text="${this.label.trim().replace(" ", " ")}" 18706 class="tooltip ${disabledClass}" 18707 > 18708 <slot></slot> 18709 </div>`; 18710 } 18711 }; 18712 Tooltip.styles = [ 18713 i$9` 18714 :host { 18715 position: relative; 18716 display: inline-flex; 18717 align-items: center; 18718 text-align: center; 18719 --sc-tooltip-fw: var(--sc-font-weight-base, 400); 18720 --sc-tooltip-position: calc(100% + 0.25rem); 18721 } 18722 18723 .tooltip:before { 18724 position: absolute; 18725 content: attr(data-tooltip-text); 18726 font-size: 0.85rem; 18727 display: block; 18728 opacity: 0; 18729 pointer-events: none; 18730 background: var(--sc-base-content, #000); 18731 padding: 0.32rem 0.55rem; 18732 border-radius: var(--sc-rounded); 18733 color: var(--sc-base, #fff); 18734 z-index: 999; 18735 line-height: 1.1; 18736 width: max-content; 18737 max-width: 18rem; 18738 white-space: pre-line; 18739 font-weight: var(--sc-tooltip-fw); 18740 transition: 0.2s; 18741 scale: 0.9; 18742 will-change: opacity, transform; 18743 } 18744 18745 :host(:focus-visible) .tooltip:before, 18746 :host(.keyboard-focus) .tooltip:before, 18747 .tooltip:hover:before { 18748 opacity: 1; 18749 scale: 1; 18750 } 18751 18752 .disabled:before { 18753 opacity: 0 !important; 18754 scale: 0.9 !important; 18755 } 18756 18757 :host(:not([placement])) .tooltip:before, 18758 :host([placement="top"]) .tooltip:before { 18759 bottom: var(--sc-tooltip-position); 18760 left: 50%; 18761 transform: translateX(-50%); 18762 } 18763 18764 :host([placement="top-end"]) .tooltip:before { 18765 bottom: var(--sc-tooltip-position); 18766 right: 0; 18767 } 18768 :host([placement="top-start"]) .tooltip:before { 18769 bottom: var(--sc-tooltip-position); 18770 left: 0; 18771 } 18772 18773 :host([placement="bottom"]) .tooltip:before { 18774 top: var(--sc-tooltip-position); 18775 left: 50%; 18776 transform: translateX(-50%); 18777 } 18778 18779 :host([placement="bottom-start"]) .tooltip:before { 18780 top: var(--sc-tooltip-position); 18781 left: 0; 18782 } 18783 :host([placement="bottom-end"]) .tooltip:before { 18784 top: var(--sc-tooltip-position); 18785 right: 0; 18786 } 18787 18788 :host([placement="left"]) .tooltip:before { 18789 top: 50%; 18790 right: var(--sc-tooltip-position); 18791 transform: translateY(-50%); 18792 } 18793 18794 :host([placement="left-start"]) .tooltip:before { 18795 top: 0; 18796 right: var(--sc-tooltip-position); 18797 } 18798 18799 :host([placement="left-end"]) .tooltip:before { 18800 bottom: 0; 18801 right: var(--sc-tooltip-position); 18802 } 18803 18804 :host([placement="right"]) .tooltip:before { 18805 top: 50%; 18806 transform: translateY(-50%); 18807 left: var(--sc-tooltip-position); 18808 } 18809 18810 :host([placement="right-start"]) .tooltip:before { 18811 top: 0; 18812 left: var(--sc-tooltip-position); 18813 } 18814 18815 :host([placement="right-end"]) .tooltip:before { 18816 bottom: 0; 18817 left: var(--sc-tooltip-position); 18818 } 18819 ` 18820 ]; 18821 __decorate$A([ 18822 n$5({ type: String }) 18823 ], Tooltip.prototype, "label", void 0); 18824 __decorate$A([ 18825 n$5({ type: String, reflect: true }) 18826 ], Tooltip.prototype, "placement", void 0); 18827 __decorate$A([ 18828 n$5({ type: Boolean }) 18829 ], Tooltip.prototype, "disabled", void 0); 18830 __decorate$A([ 18831 n$5({ type: Boolean })
18832 ], Tooltip.prototype, "focusable", void 0); 18833 Tooltip = __decorate$A([ 18834 t$3(tagName$2t) 18835 ], Tooltip); 18836 var __defProp$3F = Object.defineProperty; 18837 var __getOwnPropDesc$3I = Object.getOwnPropertyDescriptor; 18838 var __decorateClass$3J = (decorators, target, key, kind) => { 18839 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3I(target, key) : target; 18840 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 18841 if (decorator = decorators[i2]) 18842 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 18843 if (kind && result) __defProp$3F(target, key, result); 18844 return result; 18845 }; 18846 let LocationHall = class extends Subscriber$1(i$6) { 18847 constructor() { 18848 super(...arguments); 18849 this.room = null; 18850 this.location = null; 18851 this.placing_type = null; 18852 this.placing_addon = null; 18853 this.noPlacement = false; 18854 this.noIcon = false; 18855 this.size = "inherit"; 18856 this.addressDisplay = "none"; 18857 this.hasAddress = false; 18858 this.mapLink = null; 18859 } 18860 getMapsLink(location2) { 18861 const address = this.getAddress(location2); 18862 const addressWithAddress2 = this.getAddress(location2, true); 18863 const encoded = encodeURIComponent(location2?.title + " " + address); 18864 const isIOS = /iPhone|iPad|iPod/.test(navigator.userAgent); 18865 return { 18866 label: isIOS ? t("LIB_search_in_maps_apple") : t("LIB_search_in_maps_google"), 18867 link: isIOS ? `http://maps.apple.com/?q=${encoded}` : `https://www.google.com/maps/search/?api=1&query=${encoded}`, 18868 addressFull: addressWithAddress2 18869 }; 18870 } 18871 getAddress(location2, withAddress2 = false) { 18872 if (!location2) return ""; 18873 if (withAddress2) { 18874 return `${location2.address} ${location2.address2} ${location2.postal_code} ${location2.city}`; 18875 } 18876 return `${location2.address} ${location2.postal_code} ${location2.city}`; 18877 } 18878 willUpdate(_changedProperties) { 18879 if (_changedProperties.has("location")) { 18880 this.hasAddress = !!(this.location?.address || this.location?.address2 || this.location?.city || this.location?.postal_code); 18881 this.mapLink = this.hasAddress ? this.getMapsLink(this.location) : null; 18882 } 18883 } 18884 handleClickMaps(e2) { 18885 e2.stopPropagation(); 18886 } 18887 render() { 18888 this.placing_type = this.placing_type || this.room; 18889 this.placing_addon = this.placing_addon || this.room; 18890 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)) { 18891 this.style.display = "none"; 18892 return A$1; 18893 } 18894 this.style.removeProperty("display"); 18895 return b$1` 18896 <div class="inline-flex gap-[.35em] "> 18897 ${!this.noIcon ? b$1` 18898 <div class="shrink-0"> 18899 <sonic-icon library="custom" name="location-dot" class="text-center"></sonic-icon> 18900 </div> 18901 ` : A$1} 18902 18903 <div class="self-center"> 18904 <slot name="prefix"></slot> 18905 <sonic-if .condition=${!!this.location}> ${this.renderLocation()} </sonic-if> 18906 <sonic-if 18907 .condition=${!!(this.room && this.room.display_name || this.placing_type || this.placing_addon?.free_placing_add_on_label)} 18908 > 18909 <sonic-if 18910 .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))} 18911 > / </sonic-if 18912 > 18913 <sonic-event-hall 18914 ?noPlacement=${this.noPlacement} 18915 .room_display_name=${this.room?.display_name} 18916 room_name=${this.room?.title || ""} 18917 room_placing_type_label=${this.placing_type?.placing_type_label || ""} 18918 room_free_placing_add_on_label=${this.placing_addon?.free_placing_add_on_label || ""} 18919 ></sonic-event-hall> 18920 </sonic-if> 18921 18922 ${this.renderTextAddress()} 18923 </div> 18924 </div> 18925 `; 18926 } 18927 renderTextAddress() { 18928 return this.addressDisplay === "text" && this.hasAddress ? b$1` 18929 <div class=" text-neutral-500 "> 18930 <sonic-tooltip label=${this.mapLink?.label} class="text-left"> 18931 <a href=${this.mapLink?.link} target="_blank" class="hover:underline "> ${this.mapLink?.addressFull} </a> 18932 </sonic-tooltip> 18933 </div> 18934 ` : A$1; 18935 } 18936 renderLocation() { 18937 if (this.addressDisplay === "hoverLink" && this.hasAddress) { 18938 return b$1`<sonic-tooltip label="${this.mapLink?.addressFull} ${this.mapLink?.label}"> 18939 <a 18940 class="underline hover:no-underline" 18941 @click=${this.handleClickMaps} 18942 href=${this.mapLink?.link} 18943 target="_blank" 18944 > 18945 <sonic-event-location 18946 class="block" 18947 location_city_name=${this.location?.city || ""} 18948 location_name=${this.location?.title || ""} 18949 ?displayCity=${this.room?.display_city} 18950 ></sonic-event-location> 18951 </a> 18952 </sonic-tooltip>`; 18953 } else { 18954 return b$1` 18955 <sonic-event-location 18956 location_city_name=${this.location?.city || ""} 18957 location_name=${this.location?.title || ""} 18958 ?displayCity=${this.room?.display_city} 18959 ></sonic-event-location> 18960 `; 18961 } 18962 } 18963 }; 18964 LocationHall.styles = [tailwind, fontSize]; 18965 __decorateClass$3J([ 18966 n$5({ type: Object }) 18967 ], LocationHall.prototype, "room", 2); 18968 __decorateClass$3J([ 18969 n$5({ type: Object }) 18970 ], LocationHall.prototype, "location", 2); 18971 __decorateClass$3J([ 18972 n$5({ type: Object }) 18973 ], LocationHall.prototype, "placing_type", 2); 18974 __decorateClass$3J([ 18975 n$5({ type: Object }) 18976 ], LocationHall.prototype, "placing_addon", 2); 18977 __decorateClass$3J([ 18978 n$5({ type: Boolean }) 18979 ], LocationHall.prototype, "noPlacement", 2); 18980 __decorateClass$3J([ 18981 n$5({ type: Boolean }) 18982 ], LocationHall.prototype, "noIcon", 2); 18983 __decorateClass$3J([ 18984 n$5({ type: String, reflect: true }) 18985 ], LocationHall.prototype, "size", 2); 18986 __decorateClass$3J([ 18987 n$5({ type: String }) 18988 ], LocationHall.prototype, "addressDisplay", 2); 18989 __decorateClass$3J([ 18990 r$5() 18991 ], LocationHall.prototype, "hasAddress", 2); 18992 __decorateClass$3J([ 18993 r$5() 18994 ], LocationHall.prototype, "mapLink", 2); 18995 LocationHall = __decorateClass$3J([ 18996 t$3("sonic-event-location-hall") 18997 ], LocationHall); 18998 var __decorate$z = function(decorators, target, key, desc) { 18999 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 19000 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 19001 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; 19002 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 19003 }; 19004 const tagName$2s = "sonic-image"; 19005 let Image = class Image extends i$6 { 19006 constructor() { 19007 super(...arguments); 19008 this.rounded = "none"; 19009 this.src = ""; 19010 this.alt = ""; 19011 this.loading = "lazy"; 19012 this.ratio = "auto"; 19013 this.objectPosition = "center center"; 19014 this.imageRendering = "auto"; 19015 this.cover = false;
19016 } 19017 firstUpdated(changedProperties) { 19018 if (this.transition) { 19019 const img = this.shadowRoot?.querySelector("img"); 19020 if (!img) 19021 return; 19022 img.onload = function() { 19023 img.classList.add("loaded"); 19024 }; 19025 } 19026 super.firstUpdated(changedProperties); 19027 } 19028 render() { 19029 const imgStyles = { 19030 aspectRatio: this.cover ? "auto" : this.ratio, 19031 imageRendering: this.imageRendering, 19032 objectPosition: this.objectPosition 19033 }; 19034 return b$1`<div part="image"> 19035 <picture part="picture" 19036 ><img 19037 part="img" 19038 src="${this.src}" 19039 loading="${this.loading}" 19040 alt="${this.alt}" 19041 style=${o$3(imgStyles)} 19042 /></picture> 19043 </div>`; 19044 } 19045 }; 19046 Image.styles = [ 19047 i$9` 19048 :host { 19049 --sc-img-radius: 0; 19050 --sc-img-bg: var(--sc-placeholder-bg, rgba(12, 12, 12, 0.05)); 19051 border-radius: var(--sc-img-radius); 19052 display: block; 19053 width: 100%; 19054 background: var(--sc-img-bg); 19055 } 19056 19057 img { 19058 width: 100%; 19059 vertical-align: middle; 19060 object-fit: cover; 19061 } 19062 19063 img[src=""] { 19064 visibility: hidden; 19065 } 19066 19067 /*Rounded*/ 19068 :host([rounded]) { 19069 --sc-img-radius: var(--sc-rounded); 19070 overflow: hidden; 19071 } 19072 :host([rounded="sm"]) { 19073 --sc-img-radius: var(--sc-rounded-sm); 19074 } 19075 19076 :host([rounded="md"]) { 19077 --sc-img-radius: var(--sc-rounded-md); 19078 } 19079 19080 :host([rounded="lg"]) { 19081 --sc-img-radius: var(--sc-rounded-lg); 19082 } 19083 :host([rounded="xl"]) { 19084 --sc-img-radius: var(--sc-rounded-xl); 19085 } 19086 19087 /*Cercle*/ 19088 :host([rounded="full"]) { 19089 --sc-img-radius: 50% !important; 19090 } 19091 :host([rounded="none"]) { 19092 --sc-img-radius: 0 !important; 19093 } 19094 19095 :host([cover]), 19096 :host([cover]) > div, 19097 :host([cover]) img { 19098 position: absolute !important; 19099 left: 0 !important; 19100 top: 0 !important; 19101 right: 0 !important; 19102 bottom: 0 !important; 19103 height: 100% !important; 19104 width: 100% !important; 19105 } 19106 19107 :host([transition]) img { 19108 opacity: 0; 19109 transition: 0.25s; 19110 } 19111 19112 :host([transition="fade-scale-out"]) img { 19113 scale: 1.08; 19114 transition: opacity 0.3s linear, 19115 scale 0.3s cubic-bezier(0.16, 1, 0.3, 1); 19116 } 19117 :host([transition]) img.loaded { 19118 opacity: 1; 19119 scale: 1; 19120 } 19121 ` 19122 ]; 19123 __decorate$z([ 19124 n$5({ type: String }) 19125 ], Image.prototype, "rounded", void 0); 19126 __decorate$z([ 19127 n$5({ type: String }) 19128 ], Image.prototype, "src", void 0); 19129 __decorate$z([ 19130 n$5({ type: String }) 19131 ], Image.prototype, "alt", void 0); 19132 __decorate$z([ 19133 n$5({ type: String }) 19134 ], Image.prototype, "loading", void 0); 19135 __decorate$z([ 19136 n$5({ type: String, reflect: true }) 19137 ], Image.prototype, "transition", void 0); 19138 __decorate$z([ 19139 n$5({ type: String }) 19140 ], Image.prototype, "ratio", void 0); 19141 __decorate$z([ 19142 n$5({ type: String }) 19143 ], Image.prototype, "objectPosition", void 0); 19144 __decorate$z([ 19145 n$5({ type: String }) 19146 ], Image.prototype, "imageRendering", void 0); 19147 __decorate$z([ 19148 n$5({ type: Boolean, reflect: true }) 19149 ], Image.prototype, "cover", void 0); 19150 Image = __decorate$z([ 19151 t$3(tagName$2s) 19152 ], Image); 19153 let h$1 = class h { 19154 constructor(t2, { target: s2, config: h2, callback: e2, skipInitial: r2 }) { 19155 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) => { 19156 this.handleChanges(t3), this.h.requestUpdate(); 19157 }), t2.addController(this)) : console.warn("ResizeController error: browser does not support ResizeObserver."); 19158 } 19159 handleChanges(t2) { 19160 this.value = this.callback?.(t2, this.u); 19161 } 19162 hostConnected() { 19163 for (const t2 of this.t) this.observe(t2); 19164 } 19165 hostDisconnected() { 19166 this.disconnect(); 19167 } 19168 async hostUpdated() { 19169 !this.o && this.i && this.handleChanges([]), this.i = false;
19170 } 19171 observe(t2) { 19172 this.t.add(t2), this.u.observe(t2, this.l), this.i = true, this.h.requestUpdate(); 19173 } 19174 unobserve(t2) { 19175 this.t.delete(t2), this.u.unobserve(t2); 19176 } 19177 disconnect() { 19178 this.u.disconnect(); 19179 } 19180 target(t2) { 19181 return e$1(this, t2); 19182 } 19183 }; 19184 const e$1 = e$5(class extends f$1 { 19185 constructor() { 19186 super(...arguments), this.observing = false; 19187 } 19188 render(t2, s2) { 19189 } 19190 update(t2, [s2, i2]) { 19191 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); 19192 } 19193 disconnected() { 19194 this.controller?.unobserve(this.part.element), this.observing = false; 19195 } 19196 reconnected() { 19197 false !== this.observe && false === this.observing && (this.controller?.observe(this.part.element), this.observing = true); 19198 } 19199 }); 19200 var __defProp$3E = Object.defineProperty; 19201 var __getOwnPropDesc$3H = Object.getOwnPropertyDescriptor; 19202 var __decorateClass$3I = (decorators, target, key, kind) => { 19203 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3H(target, key) : target; 19204 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 19205 if (decorator = decorators[i2]) 19206 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 19207 if (kind && result) __defProp$3E(target, key, result); 19208 return result; 19209 }; 19210 let ProductIllustration = class extends Subscriber$1(i$6) { 19211 constructor() { 19212 super(...arguments); 19213 this.cover = false; 19214 this.noFallback = false; 19215 this.noAnimation = false; 19216 this.ratio = "1 / 1"; 19217 this.transition = "fade"; 19218 this.picture = null; 19219 this.entity_type = null; 19220 this._resizeController = new h$1(this, {}); 19221 } 19222 willUpdate(_changedProperties) { 19223 super.willUpdate(_changedProperties); 19224 this._imgSrc = this.getSrc(); 19225 } 19226 getSrc() { 19227 const { 19228 ratio_1x1_120, 19229 ratio_1x1_360, 19230 ratio_1x1_640, 19231 ratio_1x1_1000, 19232 ratio_1x1_1920, 19233 src, 19234 ratio_auto_120, 19235 ratio_auto_360, 19236 ratio_auto_640, 19237 ratio_auto_1000, 19238 ratio_auto_1920 19239 } = this.picture || {}; 19240 if (this.picture?.is_animated && !this.noAnimation) { 19241 return src; 19242 } 19243 if (this.shouldPreserveAspectRatio()) { 19244 if (this.offsetWidth <= 120) { 19245 return ratio_auto_120 || ratio_auto_360 || src; 19246 } else if (this.offsetWidth <= 360) { 19247 return ratio_auto_360 || src; 19248 } else if (this.offsetWidth <= 640) { 19249 return ratio_auto_640 || src; 19250 } else if (this.offsetWidth <= 900) { 19251 return ratio_auto_1000 || src; 19252 } else { 19253 return ratio_auto_1920 || src; 19254 } 19255 } 19256 if (this.offsetWidth <= 120) { 19257 return ratio_1x1_120 || ratio_1x1_360 || src; 19258 } else if (this.offsetWidth <= 360) { 19259 return ratio_1x1_360 || src; 19260 } else if (this.offsetWidth <= 640) { 19261 return ratio_1x1_640 || src; 19262 } else if (this.offsetWidth <= 900) { 19263 return ratio_1x1_1000 || src; 19264 } else { 19265 return ratio_1x1_1920 || src; 19266 } 19267 } 19268 shouldPreserveAspectRatio() { 19269 return this.picture?.shouldPreserveAspectRatio && !this.picture?.is_default; 19270 } 19271 render() { 19272 const roundedClass = this.getRoundedClass(); 19273 const shadowClass = this.offsetWidth <= 640 ? "drop-shadow-md" : "drop-shadow-lg"; 19274 if (!this._imgSrc && !this.noFallback) { 19275 return this.renderFallback(); 19276 } 19277 if (this.shouldPreserveAspectRatio()) { 19278 return b$1` <div class="p-[clamp(0.5rem,5%,1.5rem)] relative aspect-[1/1] bg-neutral-50 ${roundedClass}"> 19279 <img src=${this._imgSrc} class="h-full w-full object-contain ${shadowClass}" /> 19280 </div>`; 19281 } 19282 return b$1` 19283 <sonic-image 19284 src=${this._imgSrc} 19285 class="w-full" 19286 ?cover=${this.cover} 19287 ratio=${this.ratio} 19288 rounded="${o$4(this.rounded)}" 19289 transition=${o$4(this.transition)} 19290 objectPosition=${o$4(this.objectPosition)} 19291 ></sonic-image> 19292 `; 19293 } 19294 getRoundedClass() { 19295 let roundedClass = ""; 19296 switch (this.rounded) { 19297 case "full": 19298 roundedClass = "rounded-full"; 19299 break; 19300 case "sm": 19301 roundedClass = "rounded-sm"; 19302 break; 19303 case "md": 19304 roundedClass = "rounded-md"; 19305 break; 19306 case "lg": 19307 roundedClass = "rounded-lg"; 19308 break; 19309 case "": 19310 roundedClass = "rounded"; 19311 break; 19312 default: 19313 roundedClass = ""; 19314 break; 19315 } 19316 return roundedClass; 19317 } 19318 renderFallback() { 19319 const roundedClass = this.getRoundedClass(); 19320 return b$1` 19321 <div
19322 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" 19323 > 19324 ${this.entity_type ? b$1`<sonic-icon 19325 class="text-[40cqw]" 19326 library="custom" 19327 prefix="light" 19328 name=${iconFromEntityType(this.entity_type)} 19329 ></sonic-icon>` : A$1} 19330 </div> 19331 `; 19332 } 19333 }; 19334 ProductIllustration.styles = [ 19335 tailwind, 19336 i$9` 19337 :host { 19338 display: block; 19339 } 19340 ` 19341 ]; 19342 __decorateClass$3I([ 19343 n$5({ type: Boolean }) 19344 ], ProductIllustration.prototype, "cover", 2); 19345 __decorateClass$3I([ 19346 n$5({ type: Boolean }) 19347 ], ProductIllustration.prototype, "noFallback", 2); 19348 __decorateClass$3I([ 19349 n$5({ type: Boolean }) 19350 ], ProductIllustration.prototype, "noAnimation", 2); 19351 __decorateClass$3I([ 19352 n$5({ type: String }) 19353 ], ProductIllustration.prototype, "ratio", 2); 19354 __decorateClass$3I([ 19355 n$5({ type: String }) 19356 ], ProductIllustration.prototype, "rounded", 2); 19357 __decorateClass$3I([ 19358 n$5({ type: String }) 19359 ], ProductIllustration.prototype, "objectPosition", 2); 19360 __decorateClass$3I([ 19361 n$5({ type: String, reflect: true }) 19362 ], ProductIllustration.prototype, "transition", 2); 19363 __decorateClass$3I([ 19364 n$5({ type: Object }) 19365 ], ProductIllustration.prototype, "picture", 2); 19366 __decorateClass$3I([ 19367 r$5() 19368 ], ProductIllustration.prototype, "_imgSrc", 2); 19369 __decorateClass$3I([ 19370 n$5({ type: String }) 19371 ], ProductIllustration.prototype, "entity_type", 2); 19372 ProductIllustration = __decorateClass$3I([ 19373 t$3("sonic-product-illustration") 19374 ], ProductIllustration); 19375 const iconFromEntityType = (entityType) => { 19376 const iconNames = { 19377 subscribe: "id-card", 19378 giftcard: "gift-card", 19379 event: "ticket", 19380 additionalProduct: "circle-plus", 19381 extra: "circle-plus", 19382 merch: "bags-shopping", 19383 credit: "wallet" 19384 }; 19385 if (!entityType) return "ticket"; 19386 return iconNames[entityType]; 19387 }; 19388 var Publication = /* @__PURE__ */ ((Publication2) => { 19389 Publication2["Unpublished"] = "unpublished"; 19390 Publication2["Counter"] = "counter"; 19391 Publication2["OnlyVisible"] = "only_visible"; 19392 Publication2["OnSale"] = "on_sale"; 19393 return Publication2; 19394 })(Publication || {}); 19395 var QuoteTypeEnum = /* @__PURE__ */ ((QuoteTypeEnum2) => { 19396 QuoteTypeEnum2["Quote"] = "quote"; 19397 QuoteTypeEnum2["Proof"] = "proof"; 19398 return QuoteTypeEnum2; 19399 })(QuoteTypeEnum || {}); 19400 var PurchaseStatus = /* @__PURE__ */ ((PurchaseStatus2) => { 19401 PurchaseStatus2["All"] = "all"; 19402 PurchaseStatus2["Valid"] = "valid"; 19403 PurchaseStatus2["Deleted"] = "deleted"; 19404 PurchaseStatus2["Cancelled"] = "cancelled"; 19405 PurchaseStatus2["Refunded"] = "refunded"; 19406 PurchaseStatus2["RefundRequested"] = "refund_requested"; 19407 PurchaseStatus2["Exchanged"] = "exchanged"; 19408 PurchaseStatus2["FullyUsed"] = "fully_used"; 19409 PurchaseStatus2["AutoRefundPending"] = "auto_refund_pending"; 19410 PurchaseStatus2["Checked"] = "checked"; 19411 PurchaseStatus2["RefundedPartially"] = "refunded_partially"; 19412 PurchaseStatus2["Disabled"] = "disabled"; 19413 PurchaseStatus2["Neutralized"] = "neutralized"; 19414 PurchaseStatus2["Expired"] = "expired"; 19415 return PurchaseStatus2; 19416 })(PurchaseStatus || {}); 19417 var Feature = /* @__PURE__ */ ((Feature2) => { 19418 Feature2["Taxonomies"] = "taxonomies"; 19419 Feature2["Picture"] = "picture"; 19420 Feature2["Prices"] = "prices"; 19421 Feature2["Stock"] = "stock"; 19422 Feature2["Quotas"] = "quotas"; 19423 Feature2["Status"] = "status"; 19424 Feature2["Season"] = "season"; 19425 Feature2["Location"] = "location"; 19426 Feature2["Multisessions"] = "multisessions"; 19427 Feature2["Settings"] = "settings"; 19428 Feature2["Range"] = "range"; 19429 Feature2["Refund"] = "refund"; 19430 Feature2["Cancelable"] = "cancelable"; 19431 Feature2["Entity"] = "entity"; 19432 Feature2["Exchange"] = "exchange"; 19433 Feature2["PlacesCategories"] = "places_categories"; 19434 Feature2["Producers"] = "producers"; 19435 Feature2["Rules"] = "rules"; 19436 Feature2["OwnerForm"] = "owner_form"; 19437 return Feature2; 19438 })(Feature || {}); 19439 var InputType = /* @__PURE__ */ ((InputType2) => { 19440 InputType2["Text"] = "text"; 19441 InputType2["Select"] = "select"; 19442 InputType2["File"] = "file"; 19443 InputType2["Checkbox"] = "checkbox"; 19444 InputType2["Email"] = "email"; 19445 InputType2["Tel"] = "tel"; 19446 InputType2["Number"] = "number"; 19447 InputType2["Date"] = "date"; 19448 InputType2["Textarea"] = "textarea"; 19449 InputType2["Radio"] = "radio"; 19450 InputType2["Checkboxes"] = "checkboxes"; 19451 InputType2["Repeatable"] = "repeatable"; 19452 InputType2["TextSection"] = "text_section"; 19453 return InputType2; 19454 })(InputType || {}); 19455 var ReservationStatus = /* @__PURE__ */ ((ReservationStatus2) => { 19456 ReservationStatus2["Disabled"] = "disabled"; 19457 ReservationStatus2["Draft"] = "draft"; 19458 ReservationStatus2["Processed"] = "processed"; 19459 ReservationStatus2["Confirmed"] = "confirmed"; 19460 ReservationStatus2["Pending"] = "pending"; 19461 ReservationStatus2["PartiallyProcessed"] = "partially_processed"; 19462 ReservationStatus2["Deleted"] = "deleted"; 19463 ReservationStatus2["Expired"] = "expired"; 19464 ReservationStatus2["Processing"] = "processing"; 19465 ReservationStatus2["Error"] = "error"; 19466 ReservationStatus2["Todo"] = "todo"; 19467 ReservationStatus2["Submitted"] = "submitted"; 19468 ReservationStatus2["Incomplete"] = "incomplete"; 19469 ReservationStatus2["Declined"] = "declined"; 19470 ReservationStatus2["DeclinedForever"] = "declined_forever"; 19471 return ReservationStatus2; 19472 })(ReservationStatus || {}); 19473 var EntityType = /* @__PURE__ */ ((EntityType2) => { 19474 EntityType2["Subscribe"] = "subscribe"; 19475 EntityType2["Extra"] = "extra"; 19476 EntityType2["Giftcard"] = "giftcard"; 19477 EntityType2["Event"] = "event";
vendor: 9,237 bytes, lines 19478-19726
19478 EntityType2["AdditionalProduct"] = "additionalProduct"; 19479 EntityType2["Credit"] = "credit"; 19480 EntityType2["Merch"] = "merch"; 19481 return EntityType2; 19482 })(EntityType || {}); 19483 var CartType = /* @__PURE__ */ ((CartType2) => { 19484 CartType2["Cart"] = "cart"; 19485 CartType2["Split"] = "split"; 19486 CartType2["ReservationRequest"] = "reservation_request"; 19487 CartType2["WaitingLists"] = "waiting_lists"; 19488 CartType2["Reservation"] = "reservation"; 19489 CartType2["Order"] = "order"; 19490 return CartType2; 19491 })(CartType || {}); 19492 var __decorate$y = function(decorators, target, key, desc) { 19493 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 19494 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 19495 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; 19496 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 19497 }; 19498 var SonicDate_1; 19499 const tagName$2r = "sonic-date"; 19500 detecHTMLLanguageChange(() => SonicDate.updateComponentsLanguage()); 19501 let SonicDate = SonicDate_1 = class SonicDate extends Subscriber$1(TemplatesContainer$1(i$6)) { 19502 constructor() { 19503 super(...arguments); 19504 this.pageLanguage = "fr"; 19505 this.duAu = []; 19506 this._wording_billet_periode_validite = ""; 19507 this.designMode = null; 19508 this.time_zone = null; 19509 this.date = null; 19510 this.date_string = null; 19511 this.start_date_string = null; 19512 this.end_date_string = null; 19513 this.start_date = 0; 19514 this.computedStartDate = 0; 19515 this.end_date = 0; 19516 this.computedEndDate = 0; 19517 this.hide_hours = false; 19518 this.era = ""; 19519 this.year = "numeric"; 19520 this.month = "short"; 19521 this.day = "2-digit"; 19522 this.weekday = "short"; 19523 this.hour = "2-digit"; 19524 this.hour12 = false; 19525 this.minute = "2-digit"; 19526 this.language = ""; 19527 this.renderIf = true; 19528 this.now = false; 19529 this.startDateObject = /* @__PURE__ */ new Date(); 19530 this.endDateObject = /* @__PURE__ */ new Date(); 19531 } 19532 static updateComponentsLanguage() { 19533 SonicDate_1.dateCompnents.forEach((component) => component.pageLanguage = HTML$1.getLanguage()); 19534 } 19535 get wording_billet_periode_validite() { 19536 return this._wording_billet_periode_validite; 19537 } 19538 set wording_billet_periode_validite(value) { 19539 if (!value) 19540 value = "Du %s au %s"; 19541 this._wording_billet_periode_validite = value; 19542 this.duAu = this.wording_billet_periode_validite?.split("%s").map((str) => str.trim()); 19543 this.duAu.pop(); 19544 this.requestUpdate(); 19545 } 19546 connectedCallback() { 19547 if (!this.hasAttribute("wording_billet_periode_validite")) 19548 this.wording_billet_periode_validite = "Du %s au %s"; 19549 this.pageLanguage = HTML$1.getLanguage(); 19550 SonicDate_1.dateCompnents.add(this); 19551 super.connectedCallback(); 19552 } 19553 disconnectedCallback() { 19554 super.disconnectedCallback(); 19555 SonicDate_1.dateCompnents.delete(this); 19556 } 19557 /** 19558 * 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. 19559 */ 19560 getDatesParts(start_date, end_date, options) { 19561 const start = this.startDateObject; 19562 start.setTime(start_date * 1e3); 19563 let parts = []; 19564 if (end_date > 0) { 19565 const end = this.endDateObject; 19566 end.setTime(end_date * 1e3); 19567 const isSameDay = start.toDateString() == end.toDateString(); 19568 if (!isSameDay || this.hide_hours) { 19569 delete options.hour; 19570 delete options.minute; 19571 } 19572 const format = new Intl.DateTimeFormat(this.language || this.pageLanguage, options); 19573 parts = format.formatRangeToParts(start, end); 19574 if (!isSameDay) { 19575 const to = parts.find((part) => part.type == "literal" && part.source == "shared" && part.value.trim().length > 0); 19576 if (to) { 19577 to.value = " " + this.duAu[1] + " "; 19578 to.type = "to"; 19579 } 19580 if (!this.designMode) 19581 parts.unshift({ 19582 type: "from", 19583 value: this.duAu[0] + " ", 19584 source: "shared" 19585 }); 19586 } 19587 } else { 19588 const format = new Intl.DateTimeFormat(this.language || this.pageLanguage, options); 19589 parts = format.formatToParts(start); 19590 } 19591 if (this.designMode) { 19592 parts.forEach((part) => part.value = part.value.replace(/,/g, " ")); 19593 } 19594 parts[0].value = Format$1.ucFirst(parts[0].value); 19595 return parts.filter((p2) => p2.hidden !== true); 19596 } 19597 dateStringToSeconds(dateString) { 19598 return new Date(dateString).getTime() / 1e3; 19599 } 19600 willUpdate(_changedProperties) { 19601 this.computedStartDate = 0; 19602 this.computedEndDate = 0; 19603 if (this.date_string) 19604 this.date = this.dateStringToSeconds(this.date_string); 19605 if (this.date) 19606 this.computedStartDate = this.date; 19607 if (this.start_date_string) 19608 this.computedStartDate = this.dateStringToSeconds(this.start_date_string); 19609 if (this.end_date_string) 19610 this.end_date = this.dateStringToSeconds(this.end_date_string); 19611 if (this.start_date) 19612 this.computedStartDate = this.start_date; 19613 if (!this.computedStartDate && !this.now && !this.end_date) 19614 return; 19615 if (!this.computedStartDate) 19616 this.computedStartDate = Date.now() / 1e3; 19617 if (this.end_date) 19618 this.computedEndDate = this.end_date; 19619 if (this.computedEndDate > 0 && this.computedEndDate < this.computedStartDate) { 19620 const copy = this.computedStartDate; 19621 this.computedStartDate = this.computedEndDate; 19622 this.computedEndDate = copy; 19623 } 19624 } 19625 render() { 19626 if (!this.renderIf) 19627 return A$1; 19628 if (!this.computedStartDate && !this.now && !this.computedEndDate) 19629 return A$1; 19630 const options = { 19631 year: this.year || "numeric", 19632 month: this.month || "short", 19633 day: this.day || "2-digit", 19634 hour12: this.hour12 || false 19635 }; 19636 if (this.weekday !== "hidden") 19637 options.weekday = this.weekday || "short"; 19638 if (this.hour !== "hidden") 19639 options.hour = this.hour || "2-digit"; 19640 if (this.minute !== "hidden") 19641 options.minute = this.minute || "2-digit"; 19642 if (this.era) 19643 options.era = this.era; 19644 if (this.time_zone) 19645 options.timeZone = this.time_zone; 19646 const parts = this.getDatesParts(this.computedStartDate, this.computedEndDate, options); 19647 return o$6(`${parts.map((part) => { 19648 const template = this.templateParts[part.type]; 19649 if (template) { 19650 const clone = document.importNode(template.content, true); 19651 const child = clone.children[0]; 19652 if (child.innerText.trim() == "") 19653 child.innerText = part.value; 19654 return child.outerHTML; 19655 } 19656 const span = document.createElement("span"); 19657 span.innerText = part.value; 19658 span.className = part.type; 19659 return `<span class="${part.type}">${part.value}</span>`; 19660 }).join("")}`); 19661 } 19662 }; 19663 SonicDate.dateCompnents = /* @__PURE__ */ new Set(); 19664 __decorate$y([ 19665 n$5() 19666 ], SonicDate.prototype, "wording_billet_periode_validite", null); 19667 __decorate$y([ 19668 n$5({ type: Boolean }) 19669 ], SonicDate.prototype, "designMode", void 0); 19670 __decorate$y([ 19671 n$5({ type: String }) 19672 ], SonicDate.prototype, "time_zone", void 0); 19673 __decorate$y([ 19674 n$5({ type: Number }) 19675 ], SonicDate.prototype, "date", void 0); 19676 __decorate$y([ 19677 n$5({ type: String }) 19678 ], SonicDate.prototype, "date_string", void 0); 19679 __decorate$y([ 19680 n$5({ type: String }) 19681 ], SonicDate.prototype, "start_date_string", void 0); 19682 __decorate$y([ 19683 n$5({ type: String }) 19684 ], SonicDate.prototype, "end_date_string", void 0); 19685 __decorate$y([ 19686 n$5({ type: Number }) 19687 ], SonicDate.prototype, "start_date", void 0); 19688 __decorate$y([ 19689 n$5({ type: Number }) 19690 ], SonicDate.prototype, "end_date", void 0); 19691 __decorate$y([ 19692 n$5({ type: Boolean }) 19693 ], SonicDate.prototype, "hide_hours", void 0); 19694 __decorate$y([ 19695 n$5({ type: String }) 19696 ], SonicDate.prototype, "era", void 0); 19697 __decorate$y([ 19698 n$5({ type: String }) 19699 ], SonicDate.prototype, "year", void 0); 19700 __decorate$y([ 19701 n$5({ type: String }) 19702 ], SonicDate.prototype, "month", void 0); 19703 __decorate$y([ 19704 n$5({ type: String }) 19705 ], SonicDate.prototype, "day", void 0); 19706 __decorate$y([ 19707 n$5({ type: String }) 19708 ], SonicDate.prototype, "weekday", void 0); 19709 __decorate$y([ 19710 n$5({ type: String }) 19711 ], SonicDate.prototype, "hour", void 0); 19712 __decorate$y([ 19713 n$5({ type: Boolean }) 19714 ], SonicDate.prototype, "hour12", void 0); 19715 __decorate$y([ 19716 n$5({ type: String }) 19717 ], SonicDate.prototype, "minute", void 0); 19718 __decorate$y([ 19719 n$5({ type: String }) 19720 ], SonicDate.prototype, "language", void 0); 19721 __decorate$y([ 19722 n$5({ type: Boolean }) 19723 ], SonicDate.prototype, "renderIf", void 0); 19724 __decorate$y([ 19725 n$5({ type: Boolean }) 19726 ], SonicDate.prototype, "now", void 0);
19727 SonicDate = SonicDate_1 = __decorate$y([ 19728 t$3(tagName$2r) 19729 ], SonicDate); 19730 var __decorate$x = function(decorators, target, key, desc) { 19731 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 19732 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 19733 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; 19734 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 19735 }; 19736 const tagName$2q = "sonic-badge"; 19737 let Badge = class Badge extends i$6 { 19738 constructor() { 19739 super(...arguments); 19740 this.type = "default"; 19741 this.variant = "default"; 19742 this.ellipsis = false; 19743 } 19744 render() { 19745 return b$1` 19746 <slot name="prefix"></slot> 19747 <slot></slot> 19748 <slot name="suffix"></slot> 19749 `; 19750 } 19751 }; 19752 Badge.styles = [ 19753 fontSize, 19754 i$9` 19755 :host { 19756 --sc-badge-gap: 0.3em; 19757 --sc-badge-py: 0.35em; 19758 --sc-badge-px: 0.67em; 19759 19760 --sc-badge-color: var(--sc-base-content, #000); 19761 --sc-badge-bg: var(--sc-base-100, rgba(0, 0, 0, 0.07)); 19762 19763 /*--sc-badge-border-width: var(--sc-form-border-width, 0.1rem);*/ 19764 --sc-badge-border-width: 1px; 19765 --sc-badge-border-color: transparent; 19766 --sc-badge-border: var(--sc-badge-border-width) solid 19767 var(--sc-badge-border-color); 19768 19769 --sc-badge-rounded: 0.85em; 19770 --sc-badge-fw: var(--sc-font-weight-base, 400); 19771 19772 display: inline-flex; 19773 align-items: center; 19774 box-sizing: border-box; 19775 line-height: var(--sc-_lh); 19776 border-radius: var(--sc-badge-rounded); 19777 19778 background: var(--sc-badge-bg); 19779 color: var(--sc-badge-color); 19780 font-family: var(--sc-badge-ff, var(--sc-font-family-base, sans-serif)); 19781 font-weight: var(--sc-badge-fw); 19782 line-height: 1; 19783 19784 padding-top: var(--sc-badge-py); 19785 padding-bottom: var(--sc-badge-py); 19786 padding-left: var(--sc-badge-px); 19787 padding-right: var(--sc-badge-px); 19788 /**Round pour lissage px */ 19789 min-height: round(calc(var(--sc-badge-px) * 2), 1px); 19790 min-width: round(calc(var(--sc-badge-px) * 2), 1px); 19791 border: var(--sc-badge-border); 19792 -webkit-print-color-adjust: exact; 19793 } 19794 19795 /*TYPES*/ 19796 :host([type="primary"]) { 19797 --sc-badge-color: var(--sc-primary-content, var(--sc-base, #fff)); 19798 --sc-badge-bg: var(--sc-primary, var(--sc-base-content, #000)); 19799 } 19800 :host([type="warning"]) { 19801 --sc-badge-color: var(--sc-warning-content, var(--sc-base, #fff)); 19802 --sc-badge-bg: var(--sc-warning, var(--sc-base-content, #000)); 19803 } 19804 :host([type="danger"]) { 19805 --sc-badge-color: var(--sc-danger-content, var(--sc-base, #fff)); 19806 --sc-badge-bg: var(--sc-danger, var(--sc-base-content, #000)); 19807 } 19808 :host([type="info"]) { 19809 --sc-badge-color: var(--sc-info-content, var(--sc-base, #fff)); 19810 --sc-badge-bg: var(--sc-info, var(--sc-base-content, #000)); 19811 } 19812 :host([type="success"]) { 19813 --sc-badge-color: var(--sc-success-content, var(--sc-base, #fff)); 19814 --sc-badge-bg: var(--sc-success, var(--sc-base-content, #000)); 19815 } 19816 :host([type="neutral"]) { 19817 --sc-badge-color: var(--sc-base, #fff); 19818 --sc-badge-bg: var(--sc-base-content, #000); 19819 } 19820 19821 :host([contrast]), 19822 :host([type="contrast"]) { 19823 --sc-badge-color: var(--sc-contrast-content, #fff); 19824 --sc-badge-bg: var(--sc-contrast, #000); 19825 } 19826 19827 /*SIZE*/ 19828 :host { 19829 gap: var(--sc-badge-gap); 19830 } 19831 19832 :host([size="2xs"]), 19833 :host([size="xs"]), 19834 :host([size="sm"]) { 19835 --sc-badge-gap: 0.35em; 19836 } 19837 19838 :host([size="lg"]), 19839 :host([size="xl"]) { 19840 --sc-_lh: 1.2; 19841 --sc-badge-gap: 0.5em; 19842 } 19843 19844 /*OUTLINE*/ 19845 :host([variant="outline"][type]) { 19846 border-width: var(--sc-badge-border-width) !important; 19847 border-color: var(--sc-badge-bg); 19848 color: var(--sc-badge-bg); 19849 background: transparent; 19850 } 19851 19852 :host([variant="outline"][type="default"]) { 19853 border-color: var(--sc-base-content, #000); 19854 color: var(--sc-base-content, #000); 19855 background: transparent; 19856 } 19857 19858 /*GHOST*/ 19859 :host([variant="ghost"][type]) { 19860 color: var(--sc-badge-bg); 19861 background: transparent; 19862 padding: 0; 19863 } 19864 19865 @media (forced-colors: active) { 19866 :host([variant="ghost"][type]) { 19867 padding: var(--sc-badge-py) var(--sc-badge-px); 19868 } 19869 } 19870 19871 :host([variant="ghost"][type="default"]) { 19872 color: var(--sc-badge-color); 19873 background: transparent; 19874 } 19875 19876 :host([ellipsis]) { 19877 flex-wrap: nowrap; 19878 white-space: nowrap; 19879 max-width: 100%; 19880 } 19881 19882 :host([ellipsis]) slot { 19883 overflow: hidden; 19884 display: block; 19885 text-overflow: ellipsis; 19886 white-space: nowrap; 19887 max-width: 100%; 19888 } 19889 19890 slot[name="suffix"], 19891 slot[name="prefix"] { 19892 flex-shrink: 0; 19893 } 19894 ` 19895 ]; 19896 __decorate$x([ 19897 n$5({ type: String, reflect: true }) 19898 ], Badge.prototype, "type", void 0); 19899 __decorate$x([ 19900 n$5({ type: String, reflect: true }) 19901 ], Badge.prototype, "variant", void 0); 19902 __decorate$x([ 19903 n$5({ type: String, reflect: true }) 19904 ], Badge.prototype, "size", void 0); 19905 __decorate$x([ 19906 n$5({ type: Boolean, reflect: true }) 19907 ], Badge.prototype, "ellipsis", void 0); 19908 Badge = __decorate$x([ 19909 t$3(tagName$2q) 19910 ], Badge); 19911 var __defProp$3D = Object.defineProperty; 19912 var __getOwnPropDesc$3G = Object.getOwnPropertyDescriptor; 19913 var __decorateClass$3H = (decorators, target, key, kind) => { 19914 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3G(target, key) : target; 19915 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 19916 if (decorator = decorators[i2]) 19917 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 19918 if (kind && result) __defProp$3D(target, key, result); 19919 return result; 19920 }; 19921 let SonicRange = class extends Subscriber$1(i$6) { 19922 constructor() { 19923 super(...arguments); 19924 this.size = "xs"; 19925 this.variant = "outline"; 19926 this.range = null; 19927 this.ellipsis = false;
19928 } 19929 render() { 19930 if (!this.range) return A$1; 19931 return b$1` 19932 <sonic-badge variant=${this.variant} size=${this.size} ?ellipsis=${this.ellipsis}> 19933 Gamme : ${this.range?.title} 19934 </sonic-badge> 19935 `; 19936 } 19937 }; 19938 SonicRange.styles = [ 19939 i$9` 19940 :host([ellipsis]) { 19941 max-width: 100%; 19942 } 19943 ` 19944 ]; 19945 __decorateClass$3H([ 19946 n$5({ type: String }) 19947 ], SonicRange.prototype, "size", 2); 19948 __decorateClass$3H([ 19949 n$5({ type: String }) 19950 ], SonicRange.prototype, "variant", 2); 19951 __decorateClass$3H([ 19952 n$5({ type: Object }) 19953 ], SonicRange.prototype, "range", 2); 19954 __decorateClass$3H([ 19955 n$5({ type: Boolean, reflect: true }) 19956 ], SonicRange.prototype, "ellipsis", 2); 19957 SonicRange = __decorateClass$3H([ 19958 t$3("sonic-event-range") 19959 ], SonicRange); 19960 const styles$2 = i$9` 19961 :host { 19962 display: inline-flex; 19963 flex-wrap: wrap; 19964 gap: 0.25rem; 19965 } 19966 19967 .wording { 19968 display: block; 19969 } 19970 19971 .separator:last-child { 19972 display: none; 19973 } 19974`; 19975 var __defProp$3C = Object.defineProperty; 19976 var __getOwnPropDesc$3F = Object.getOwnPropertyDescriptor; 19977 var __decorateClass$3G = (decorators, target, key, kind) => { 19978 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3F(target, key) : target; 19979 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 19980 if (decorator = decorators[i2]) 19981 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 19982 if (kind && result) __defProp$3C(target, key, result); 19983 return result; 19984 }; 19985 const EventContext = (superClass, propsType) => { 19986 class EventContextElement extends superClass { 19987 constructor(...args) { 19988 super(); 19989 this.multisession = null; 19990 this._isGuichet = false; 19991 this.dataProvider = ""; 19992 } 19993 get isGuichet() { 19994 return this._isGuichet || (this._isGuichet = this.hasAncestorAttribute("is_guichet")); 19995 } 19996 set isGuichet(value) { 19997 this._isGuichet = value; 19998 } 19999 } 20000 __decorateClass$3G([ 20001 n$5({ type: Object }) 20002 ], EventContextElement.prototype, "multisession", 2); 20003 __decorateClass$3G([ 20004 n$5({ type: Boolean }) 20005 ], EventContextElement.prototype, "isGuichet", 1); 20006 return EventContextElement; 20007 }; 20008 var __defProp$3B = Object.defineProperty; 20009 var __getOwnPropDesc$3E = Object.getOwnPropertyDescriptor; 20010 var __decorateClass$3F = (decorators, target, key, kind) => { 20011 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3E(target, key) : target; 20012 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 20013 if (decorator = decorators[i2]) 20014 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 20015 if (kind && result) __defProp$3B(target, key, result); 20016 return result; 20017 }; 20018 let AditionalStatus = class extends EventContext(Fetcher$1(Subscriber$1(i$6))) { 20019 constructor() { 20020 super(...arguments); 20021 this.infos_status = {}; 20022 this.size = ""; 20023 this.separator = ""; 20024 this.warnAndDangerAsPill = false; 20025 this.keepOnlyKeys = null; 20026 this.ellipsis = false; 20027 this.hasForcedVisibility = false; 20028 this.enableRefetch = (data) => { 20029 }; 20030 } 20031 static getDisplayConfForStatus(key) { 20032 switch (key) { 20033 case "soon_on_sale": 20034 return { icon: "circle-info", type: "info", visibility: "public" }; 20035 case "remaining_places": 20036 return { icon: "circle-info", type: "info", visibility: "private" }; 20037 case "remaining_places_warning": 20038 return { icon: "triangle-exclamation", type: "warning", visibility: "public" }; 20039 case "waiting": 20040 case "deferred": 20041 return { icon: "triangle-exclamation", type: "warning", visibility: "public" }; 20042 case "almost_full_here": 20043 case "almost_full": 20044 return { icon: "triangle-exclamation", type: "warning", visibility: "public" }; 20045 case "full": 20046 case "full_here": 20047 return { icon: "circle-minus", type: "danger", visibility: "public" }; 20048 case "pro_need_login": 20049 return { icon: "circle-minus", type: "danger", visibility: "public" }; 20050 case "unauthorized": 20051 return { icon: "circle-minus", type: "danger", visibility: "public" }; 20052 case "canceled": 20053 return { icon: "ban", type: "danger", visibility: "public" }; 20054 case "only_visible": 20055 return { icon: "triangle-exclamation", type: "danger", visibility: "public" }; 20056 case "end_sale": 20057 return { icon: "", type: "danger", visibility: "public" }; 20058 case "forced_to_full": 20059 return { icon: "circle-minus", type: "danger", visibility: "private" }; 20060 case "full_in_no_quota": 20061 return { icon: "ban", type: "warning", visibility: "public" }; 20062 case "full_here_in_no_quota": 20063 return { icon: "ban", type: "warning", visibility: "public" }; 20064 default: 20065 return { icon: "", type: "danger", visibility: "private" }; 20066 } 20067 } 20068 connectedCallback() { 20069 if (!this.visibility) { 20070 this.visibility = "public"; 20071 } else { 20072 this.hasForcedVisibility = true; 20073 } 20074 this.isFetchEnabled = this.hasAttribute("fetch"); 20075 this.lazyLoad = true; 20076 if (this.isFetchEnabled) { 20077 this.propertyMap = { data: "infos_status" }; 20078 this.style.removeProperty("display"); 20079 } 20080 super.connectedCallback(); 20081 this.handleAutoRefetchActivation(); 20082 } 20083 getParentPublisher() { 20084 const dataProvider = HTML.getAncestorAttributeValue(this.parentElement, "dataProvider"); 20085 if (!dataProvider) return; 20086 return dp(dataProvider); 20087 } 20088 disconnectedCallback() { 20089 this.getParentPublisher()?.offAssign(this.enableRefetch); 20090 super.disconnectedCallback(); 20091 } 20092 willUpdate() { 20093 if (this.appType == "counter" && !this.variant) { 20094 this.variant = "ghost"; 20095 } 20096 if (this.appType == "counter" && !this.hasForcedVisibility) { 20097 this.visibility = "all"; 20098 } 20099 } 20100 handleAutoRefetchActivation() { 20101 const publisher = this.getParentPublisher(); 20102 publisher?.offAssign(this.enableRefetch); 20103 this.enableRefetch = (value) => { 20104 if (!value) return; 20105 if ("start_date" in value && "end_date" in value) { 20106 const startDate = value.start_date || 0; 20107 const endDate = value.end_date || startDate; 20108 const now = Date.now() / 1e3;
20109 const startDateExtended = startDate - 24 * 60 * 60; 20110 const endDateExtended = endDate + 24 * 60 * 60; 20111 if (endDateExtended - startDateExtended > 96 * 60 * 60) return; 20112 const msStr = "10000"; 20113 if (this.appType === "counter" && now > startDateExtended && now < endDateExtended && this.getAttribute("refetchEveryMs") !== msStr) { 20114 this.setAttribute("refetchEveryMs", msStr); 20115 this.publisher?.invalidate(); 20116 } else { 20117 this.removeAttribute("refetchEveryMs"); 20118 } 20119 } 20120 }; 20121 publisher?.onAssign(this.enableRefetch); 20122 } 20123 render() { 20124 let additionals = this.infos_status?.additionnals || []; 20125 additionals = additionals.filter((additional) => { 20126 return additional.key && (!this.keepOnlyKeys || this.keepOnlyKeys.includes(additional.key)); 20127 }); 20128 if (this.excludeKeys) { 20129 additionals = additionals.filter((additional) => { 20130 if (!additional.key) return false; 20131 return !this.excludeKeys?.includes(additional.key); 20132 }); 20133 } 20134 if (this.visibility && this.visibility != "all") { 20135 additionals = additionals.filter((elt) => { 20136 return AditionalStatus.getDisplayConfForStatus(elt.key).visibility == this.visibility; 20137 }); 20138 } 20139 if (additionals.length == 0) { 20140 this.style.display = "none"; 20141 this.style.position = "absolute"; 20142 this.style.pointerEvents = "none"; 20143 return b$1`<slot></slot>`; 20144 } 20145 this.style.removeProperty("display"); 20146 this.style.removeProperty("position"); 20147 this.style.removeProperty("pointer-events"); 20148 return b$1`<slot name="prefix"></slot> 20149 ${c$1( 20150 additionals, 20151 (additional) => additional.key, 20152 (additional) => { 20153 const displayConf = AditionalStatus.getDisplayConfForStatus(additional.key); 20154 const isForcedAsPill = this.warnAndDangerAsPill && (displayConf.type === "danger" || displayConf.type === "warning"); 20155 return b$1` 20156 <sonic-badge 20157 ?ellipsis=${this.ellipsis} 20158 type=${displayConf.type} 20159 .variant=${isForcedAsPill ? "default" : this.variant} 20160 .size=${this.size} 20161 class=${this.variant == "ghost" ? "font-medium" : ""} 20162 ${this.isFetchEnabled ? F({ 20163 in: v 20164 }) : A$1} 20165 > 20166 ${displayConf.icon ? b$1`<sonic-icon library="custom" name=${displayConf.icon} slot="prefix"></sonic-icon>` : A$1} 20167 ${o$6(additional.libelle)}</sonic-badge 20168 > 20169 ${this.separator ? b$1`<span class="separator">${this.separator}</span>` : A$1} 20170 `; 20171 } 20172 )} `; 20173 } 20174 }; 20175 AditionalStatus.styles = [tailwind, styles$2]; 20176 __decorateClass$3F([ 20177 n$5({ type: Object }) 20178 ], AditionalStatus.prototype, "infos_status", 2); 20179 __decorateClass$3F([ 20180 n$5({ type: String }) 20181 ], AditionalStatus.prototype, "variant", 2); 20182 __decorateClass$3F([ 20183 n$5({ type: String }) 20184 ], AditionalStatus.prototype, "size", 2); 20185 __decorateClass$3F([ 20186 n$5({ type: String }) 20187 ], AditionalStatus.prototype, "separator", 2); 20188 __decorateClass$3F([ 20189 n$5({ type: Boolean }) 20190 ], AditionalStatus.prototype, "warnAndDangerAsPill", 2); 20191 __decorateClass$3F([ 20192 n$5({ type: String }) 20193 ], AditionalStatus.prototype, "visibility", 2); 20194 __decorateClass$3F([ 20195 n$5({ type: Array }) 20196 ], AditionalStatus.prototype, "keepOnlyKeys", 2); 20197 __decorateClass$3F([ 20198 n$5({ type: Array }) 20199 ], AditionalStatus.prototype, "excludeKeys", 2); 20200 __decorateClass$3F([ 20201 c({ context: appType, subscribe: true }) 20202 ], AditionalStatus.prototype, "appType", 2); 20203 __decorateClass$3F([ 20204 n$5({ type: Boolean, reflect: true }) 20205 ], AditionalStatus.prototype, "ellipsis", 2); 20206 AditionalStatus = __decorateClass$3F([ 20207 t$3("sonic-event-additional-status") 20208 ], AditionalStatus); 20209 var __defProp$3A = Object.defineProperty; 20210 var __getOwnPropDesc$3D = Object.getOwnPropertyDescriptor; 20211 var __decorateClass$3E = (decorators, target, key, kind) => { 20212 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3D(target, key) : target; 20213 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 20214 if (decorator = decorators[i2]) 20215 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 20216 if (kind && result) __defProp$3A(target, key, result); 20217 return result; 20218 }; 20219 var AccessType = /* @__PURE__ */ ((AccessType2) => { 20220 AccessType2["CAMPAIGN"] = "campaign"; 20221 AccessType2["RESERVATION_REQUEST"] = "reservationRequest";
20222 AccessType2["CUSTOM_LIST"] = "customList"; 20223 AccessType2["WAITING_LIST"] = "waitingList"; 20224 return AccessType2; 20225 })(AccessType || {}); 20226 const appendAccessParams = (params, access) => { 20227 if (!access) return; 20228 if (access.customListSlug) params.append("list", access.customListSlug); 20229 if (access.campaignHash) params.append("campaign_hash", access.campaignHash); 20230 if (access.campaignId) params.append("campaign_id", access.campaignId.toString()); 20231 if (access.reservationRequestConfigId) 20232 params.append("reservation_request_config_id", access.reservationRequestConfigId.toString()); 20233 if (access.reservationRequestConfigHash) 20234 params.append("reservation_request_config_hash", access.reservationRequestConfigHash); 20235 if (access.isWaitingList) params.append("is_waiting_list", access.isWaitingList.toString()); 20236 }; 20237 const accessParamsToQueryObject = (access) => { 20238 if (!access) return {}; 20239 const { 20240 customListSlug, 20241 campaignHash, 20242 campaignId, 20243 reservationRequestConfigId, 20244 reservationRequestConfigHash, 20245 isWaitingList: isWaitingList2 20246 } = access; 20247 let query = {}; 20248 if (customListSlug) query.sonic_custom_list_slug = customListSlug; 20249 if (campaignHash) query.sonic_campaign_hash = campaignHash; 20250 if (campaignId) query.sonic_campaign_id = campaignId.toString(); 20251 if (reservationRequestConfigId) query.sonic_reservation_request_config_id = reservationRequestConfigId.toString(); 20252 if (reservationRequestConfigHash) query.sonic_reservation_request_config_hash = reservationRequestConfigHash; 20253 if (isWaitingList2) query.sonic_is_waiting_list = isWaitingList2.toString(); 20254 return query; 20255 }; 20256 const getAccessParamsFromUrl = (url) => { 20257 const urlParams = new URLSearchParams(window.location.search); 20258 return { 20259 customListSlug: urlParams.get("sonic_custom_list_slug") || void 0, 20260 campaignHash: urlParams.get("sonic_campaign_hash") || void 0, 20261 campaignId: urlParams.get("sonic_campaign_id") ? Number(urlParams.get("sonic_campaign_id")) : void 0, 20262 reservationRequestConfigId: urlParams.get("sonic_reservation_request_config_id") ? Number(urlParams.get("sonic_reservation_request_config_id")) : void 0, 20263 reservationRequestConfigHash: urlParams.get("sonic_reservation_request_config_hash") || void 0, 20264 isWaitingList: urlParams.get("sonic_is_waiting_list") === "true" ? true : void 0 20265 }; 20266 }; 20267 const getAccessType = (accessParams) => { 20268 if (accessParams?.campaignHash) return "campaign"; 20269 if (accessParams?.campaignId) return "campaign"; 20270 if (accessParams?.reservationRequestConfigId) return "reservationRequest";
20271 if (accessParams?.reservationRequestConfigHash) return "reservationRequest"; 20272 if (accessParams?.customListSlug) return "customList"; 20273 if (accessParams?.isWaitingList) return "waitingList"; 20274 return null; 20275 }; 20276 const hasAccessParams = (accessParams) => { 20277 return accessParams && Object.values(accessParams).some((value) => value !== void 0); 20278 }; 20279 const accessParamsContext = n("accessParamsContext"); 20280 const withAccessParams = (accessParams, content) => b$1`<sonic-access-params-provider .accessParams=${accessParams}>${content}</sonic-access-params-provider>`; 20281 let SonicAccessParamsProvider = class extends i$6 { 20282 render() { 20283 return b$1`<slot></slot>`; 20284 } 20285 }; 20286 __decorateClass$3E([ 20287 e$2({ context: accessParamsContext }), 20288 n$5({ type: Object }) 20289 ], SonicAccessParamsProvider.prototype, "accessParams", 2); 20290 SonicAccessParamsProvider = __decorateClass$3E([ 20291 t$3("sonic-access-params-provider") 20292 ], SonicAccessParamsProvider); 20293 var entityView = /* @__PURE__ */ ((entityView2) => { 20294 entityView2["prices"] = "prices"; 20295 entityView2["mini"] = "mini"; 20296 entityView2["essential"] = "essential"; 20297 entityView2["full"] = "full"; 20298 entityView2["status"] = "status"; 20299 return entityView2; 20300 })(entityView || {}); 20301 const entityTypeToEndpoint = { 20302 show: "shows", 20303 [EntityType.Event]: "sessions", 20304 [EntityType.Subscribe]: "subscription-types", 20305 [EntityType.Giftcard]: "giftcards", 20306 [EntityType.AdditionalProduct]: "additional_products", 20307 [EntityType.Extra]: "extras", 20308 [EntityType.Credit]: "credits", 20309 // c'est assez con, il n'y a pas encore de route pour voir la liste des crédits 20310 [EntityType.Merch]: "merchs" 20311 }; 20312 const entityViewToFeatures = { 20313 [ 20314 "prices" 20315 /* prices */ 20316 ]: [ 20317 Feature.Prices, 20318 Feature.Quotas, 20319 Feature.Range, 20320 Feature.Multisessions, 20321 Feature.PlacesCategories, 20322 Feature.Picture, 20323 Feature.Settings 20324 ], 20325 [ 20326 "mini" 20327 /* mini */ 20328 ]: [Feature.Picture, Feature.Taxonomies], 20329 [ 20330 "essential" 20331 /* essential */ 20332 ]: [ 20333 Feature.Location, 20334 Feature.Taxonomies, 20335 Feature.Picture, 20336 Feature.Settings, 20337 Feature.Multisessions 20338 ], 20339 [ 20340 "full" 20341 /* full */ 20342 ]: [ 20343 Feature.Location, 20344 Feature.Taxonomies, 20345 Feature.Picture, 20346 Feature.Settings, 20347 Feature.Multisessions, 20348 Feature.Prices, 20349 Feature.Stock, 20350 Feature.Quotas, 20351 Feature.Range, 20352 Feature.PlacesCategories, 20353 Feature.Status, 20354 Feature.Producers, 20355 Feature.Rules, 20356 Feature.OwnerForm 20357 ], 20358 [ 20359 "status" 20360 /* status */ 20361 ]: [Feature.Status] 20362 }; 20363 const entityEndPoint = (options) => { 20364 const { 20365 entityType, 20366 entityId, 20367 accessParams, 20368 features, 20369 next, 20370 view, 20371 isQueue, 20372 limit, 20373 featured, 20374 isWaitingList: isWaitingList2, 20375 hasWaitingListRequest, 20376 hasReservationRequest, 20377 forTreatment 20378 } = options; 20379 const urlParams = new URLSearchParams(); 20380 if (next) urlParams.append("next", "1"); 20381 if (view) { 20382 const viewFeatures = entityViewToFeatures[view]; 20383 if (viewFeatures) viewFeatures.forEach((feature) => urlParams.append("features[]", feature)); 20384 } 20385 if (options.customSearchParams) options.customSearchParams.forEach((value, key) => urlParams.append(key, value)); 20386 if (features) features.forEach((feature) => urlParams.append("features[]", feature)); 20387 if (featured) urlParams.append("featured", "1"); 20388 if (isWaitingList2) urlParams.append("is_waiting_list", "1"); 20389 if (hasWaitingListRequest) urlParams.append("has_waiting_list_request", "1"); 20390 if (hasReservationRequest) urlParams.append("has_reservation_request", "1"); 20391 if (forTreatment) urlParams.append("for_treatment", "1"); 20392 if (options.subscriptionTypeIds) 20393 options.subscriptionTypeIds.forEach((id) => urlParams.append("subscription_type_id[]", id.toString())); 20394 if (options.subscriptionPriceIds) 20395 options.subscriptionPriceIds.forEach((id) => urlParams.append("subscription_price_id[]", id.toString())); 20396 if (options.excludedIds) options.excludedIds.forEach((id) =>
20396 urlParams.append("excluded_ids[]", id.toString())); 20397 if (options.multisessionId) urlParams.append("multisession_id", options.multisessionId.toString()); 20398 appendAccessParams(urlParams, accessParams); 20399 if (view === "full" && entityType === "show") { 20400 urlParams.append( 20401 "view", 20402 "full" 20403 /* full */ 20404 ); 20405 } else if (view === "essential" && entityType === "show") { 20406 urlParams.append( 20407 "view", 20408 "essential" 20409 /* essential */ 20410 ); 20411 } 20412 const endpoint = entityTypeToEndpoint[entityType]; 20413 const queueParams = isQueue ? `&limit=$limit&offset=$offset` : ""; 20414 return `${endpoint}${entityId ? `/${entityId}` : ""}?${urlParams.toString()}${queueParams}${limit ? `&limit=${limit}` : ""}`; 20415 }; 20416 const entityStatusEndPoint = (options) => { 20417 const { entityType, entityId, accessParams } = options; 20418 const urlParams = new URLSearchParams(); 20419 appendAccessParams(urlParams, accessParams); 20420 const endpoint = entityTypeToEndpoint[entityType]; 20421 if (entityType === "show") { 20422 return `${endpoint}/${entityId}/status?${urlParams.toString()}`; 20423 } else { 20424 return entityEndPoint({ 20425 ...options, 20426 view: "status" 20427 /* status */ 20428 }); 20429 } 20430 }; 20431 const idFromSlug = (slug) => { 20432 return slug.split("-")[0]; 20433 }; 20434 var __defProp$3z = Object.defineProperty; 20435 var __getOwnPropDesc$3C = Object.getOwnPropertyDescriptor; 20436 var __decorateClass$3D = (decorators, target, key, kind) => { 20437 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3C(target, key) : target; 20438 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 20439 if (decorator = decorators[i2]) 20440 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 20441 if (kind && result) __defProp$3z(target, key, result); 20442 return result; 20443 }; 20444 var ProductDisplay = /* @__PURE__ */ ((ProductDisplay2) => { 20445 ProductDisplay2["Location"] = "location"; 20446 ProductDisplay2["Status"] = "status"; 20447 ProductDisplay2["Range"] = "range"; 20448 ProductDisplay2["LocationFull"] = "locationFull"; 20449 return ProductDisplay2; 20450 })(ProductDisplay || {}); 20451 let SonicProductSummary = class extends Subscriber$1( 20452 i$6 20453 ) { 20454 constructor() { 20455 super(...arguments); 20456 this.link = false; 20457 this.textOnly = false; 20458 this.noOverTitle = false; 20459 this.size = "md"; 20460 this.id = ""; 20461 this.hash = ""; 20462 this.fixedActions = false; 20463 this.hasAction = false; 20464 this.hasInfos = false; 20465 } 20466 // SWITCH LAYOUTS 20467 render() { 20468 const entityType = this.props?.entity_type; 20469 const entityId = this.props?.id; 20470 const entitySlug = this.props?.slug; 20471 if (!entityId) { 20472 return A$1; 20473 } 20474 if (this.link) { 20475 const enableLinkToEvent = entityType === EntityType.Event && entityId; 20476 const enableLinkToGiftcard = entityType === EntityType.Giftcard; 20477 const enableLinkToSubscribe = entityType === EntityType.Subscribe; 20478 const enableLinkToMerch = entityType === EntityType.Merch; 20479 if (enableLinkToEvent || enableLinkToMerch) { 20480 const to = enableLinkToEvent ? "event" : "merch"; 20481 return b$1`<sonic-app-link noAutoFill class="contents group" to=${to} .slug=${entitySlug} id=${entityId} 20482 >${this.renderContent()}</sonic-app-link 20483 >`; 20484 } 20485 if (enableLinkToSubscribe) { 20486 return b$1`<sonic-app-link class="contents" to="subscription">${this.renderContent()}</sonic-app-link>`; 20487 } 20488 if (enableLinkToGiftcard) { 20489 return b$1`<sonic-app-link class="contents" to="giftcards">${this.renderContent()}</sonic-app-link>`; 20490 } 20491 } 20492 return b$1`${this.renderContent()} `; 20493 } 20494 actionsChange() { 20495 this.hasAction = !!this.actionsElement?.length; 20496 } 20497 renderContent() { 20498 if (this.textOnly) { 20499 return b$1`<div class="@container">${this.renderText()}</div>`; 20500 } 20501 let gridClass; 20502 switch (this.size) { 20503 case "2xs": 20504 gridClass = "grid-cols-[2.7rem_minmax(0,1fr)] gap-2"; 20505 break; 20506 case "xs": 20507 gridClass = "grid-cols-[3.2rem_minmax(0,1fr)] gap-3"; 20508 break; 20509 case "sm": 20510 gridClass = "grid-cols-[4rem_minmax(0,1fr)] gap-3"; 20511 break; 20512 case "lg": 20513 gridClass = "grid-cols-[6rem_minmax(0,1fr)] gap-3"; 20514 break; 20515 default: 20516 gridClass = "grid-cols-[5.2rem_minmax(0,1fr)] gap-4"; 20517 break; 20518 } 20519 return b$1` 20520 <div class="@container grid ${gridClass} gap-4 items-center w-full"> 20521 ${this.headerImage()} ${this.renderText()} 20522 </div> 20523 `; 20524 } 20525 // CONTENUS TEXTE DES PRODUITS 20526 headerImage() { 20527 let rounded = ""; 20528 switch (this.size) { 20529 case "2xs": 20530 case "sm": 20531 case "xs": 20532 rounded = ""; 20533 break; 20534 default: 20535 rounded = "md"; 20536 break; 20537 } 20538 return b$1`<sonic-product-illustration
20539 rounded="${rounded}" 20540 class="self-start" 20541 .entity_type=${this.props?.entity_type} 20542 ></sonic-product-illustration>`; 20543 } 20544 infosChange() { 20545 this.hasInfos = !!this.infosElement?.length; 20546 } 20547 renderText() { 20548 let titleClass; 20549 let dateClass; 20550 let locationClass; 20551 switch (this.size) { 20552 case "2xs": 20553 dateClass = "text-[max(.65rem,10px)]"; 20554 titleClass = "text-xs"; 20555 locationClass = "text-xs"; 20556 break; 20557 case "xs": 20558 dateClass = "text-2xs"; 20559 titleClass = "text-sm"; 20560 locationClass = "text-xs"; 20561 break; 20562 case "sm": 20563 dateClass = "text-xs mb-1"; 20564 titleClass = "text-base"; 20565 locationClass = "text-xs"; 20566 break; 20567 case "lg": 20568 dateClass = "text-sm mb-1"; 20569 titleClass = "text-xl"; 20570 locationClass = "text-base"; 20571 break; 20572 default: 20573 dateClass = "text-xs mb-1"; 20574 titleClass = "text-lg"; 20575 locationClass = "text-sm"; 20576 break; 20577 } 20578 const displayStatus = this.featureDisplay?.includes( 20579 "status" 20580 /* Status */ 20581 ); 20582 const displayLocation = this.featureDisplay?.includes( 20583 "location" 20584 /* Location */ 20585 ) || this.featureDisplay?.includes( 20586 "locationFull" 20587 /* LocationFull */ 20588 ); 20589 const displayRange = this.featureDisplay?.includes( 20590 "range" 20591 /* Range */ 20592 ); 20593 const featuresWithoutLocation = this.featureDisplay?.filter( 20594 (feature) => feature !== "location" && feature !== "locationFull" 20595 /* LocationFull */ 20596 ); 20597 const hasFeatures = featuresWithoutLocation?.length; 20598 return b$1`<div class="w-full gap-x-4 ${this.fixedActions ? "flex" : ""} @lg:flex items-center @lg:flex-row "> 20599 <div class="flex-grow py-[2px] ${hasFeatures || this.hasInfos ? "max-w-[23rem]" : "max-w-full"}"> 20600 <sonic-date class="${dateClass} block uppercase "></sonic-date> 20601 <sonic-product-title 20602 class="${titleClass}" 20603 ?noOverTitle=${["2xs", "xs", "sm"].includes(this.size) || this.noOverTitle} 20604 ></sonic-product-title> 20605 <slot name="subTitle"></slot> 20606 ${displayLocation ? b$1`<sonic-event-location-hall 20607 ?noPlacement=${!this.featureDisplay?.includes( 20608 "locationFull" 20609 /* LocationFull */ 20610 )} 20611 class="${locationClass} block text-neutral-500 mt-1 " 20612 ></sonic-event-location-hall>` : A$1} 20613 </div> 20614 20615 <div 20616 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" 20617 > 20618 ${this.featureDisplay ? b$1` 20619 ${displayRange ? b$1`<sonic-event-range size="inherit"></sonic-event-range>` : A$1} 20620 ${this.id && displayStatus && this.props?.entity_type === EntityType.Event ? b$1`<sonic-event-additional-status 20621 fetch 20622 dataProvider="${entityEndPoint({ 20623 entityType: EntityType.Event, 20624 entityId: Number(this.id), 20625 accessParams: this.accessParams, 20626 view: entityView.status 20627 })}" 20628 size="inherit" 20629 class="flex flex-wrap gap-x-3 " 20630 variant="ghost" 20631 key="data" 20632 ></sonic-event-additional-status>` : A$1} 20633 ` : A$1} 20634 <slot name="infos" @slotchange=${this.infosChange}></slot> 20635 </div> 20636 <slot 20637 name="actions" 20638 class="ml-auto ${this.hasAction ? "block" : "hidden"}" 20639 @slotchange=${this.actionsChange} 20640 ></slot> 20641 </div>`; 20642 } 20643 }; 20644 SonicProductSummary.styles = [ 20645 tailwind, 20646 i$9` 20647 :host { 20648 display: block; 20649 } 20650 ` 20651 ]; 20652 __decorateClass$3D([ 20653 n$5({ type: Boolean }) 20654 ], SonicProductSummary.prototype, "link", 2); 20655 __decorateClass$3D([ 20656 n$5({ type: Boolean }) 20657 ], SonicProductSummary.prototype, "textOnly", 2); 20658 __decorateClass$3D([ 20659 n$5({ type: Boolean }) 20660 ], SonicProductSummary.prototype, "noOverTitle", 2); 20661 __decorateClass$3D([ 20662 n$5({ type: String }) 20663 ], SonicProductSummary.prototype, "size", 2); 20664 __decorateClass$3D([ 20665 n$5({ type: String, attribute: "data-id" }) 20666 ], SonicProductSummary.prototype, "id", 2); 20667 __decorateClass$3D([ 20668 n$5({ type: Array }) 20669 ], SonicProductSummary.prototype, "featureDisplay", 2); 20670 __decorateClass$3D([ 20671 n$5({ type: String }) 20672 ], SonicProductSummary.prototype, "hash", 2); 20673 __decorateClass$3D([ 20674 n$5({ type: Boolean }) 20675 ], SonicProductSummary.prototype, "fixedActions", 2); 20676 __decorateClass$3D([ 20677 c({ context: accessParamsContext, subscribe: true }), 20678 n$5({ type: Object }) 20679 ], SonicProductSummary.prototype, "accessParams", 2); 20680 __decorateClass$3D([ 20681 o$8({ selector: "*", slot: "actions" }) 20682 ], SonicProductSummary.prototype, "actionsElement", 2); 20683 __decorateClass$3D([ 20684 r$5() 20685 ], SonicProductSummary.prototype, "hasAction", 2); 20686 __decorateClass$3D([ 20687 o$8({ selector: "*", slot: "infos" }) 20688 ], SonicProductSummary.prototype, "infosElement", 2); 20689 __decorateClass$3D([ 20690 r$5() 20691 ], SonicProductSummary.prototype, "hasInfos", 2); 20692 SonicProductSummary = __decorateClass$3D([ 20693 t$3("sonic-product-summary") 20694 ], SonicProductSummary); 20695 var __decorate$w = function(decorators, target, key, desc) { 20696 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 20697 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 20698 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; 20699 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 20700 };
20701 const tagName$2p = "sonic-divider"; 20702 let Divider = class Divider extends i$6 { 20703 constructor() { 20704 super(...arguments); 20705 this.label = ""; 20706 this.align = "center"; 20707 this.vertical = false; 20708 this.noMargin = false; 20709 this.dashed = false; 20710 this.dotted = false; 20711 } 20712 firstUpdated(changedProperties) { 20713 super.firstUpdated(changedProperties); 20714 if (this.label || this.slotNodes?.length) { 20715 this.divider?.classList.add("has-text"); 20716 } 20717 } 20718 render() { 20719 return b$1`<div part="divider"> 20720 <span class="text" 20721 >${o$6(this.label ? this.label : "")}<slot></slot 20722 ></span> 20723 </div>`; 20724 } 20725 }; 20726 Divider.styles = [ 20727 i$9` 20728 :host { 20729 --sc-divider-my: 0.5rem; 20730 --sc-divider-mx: 0; 20731 --sc-divider-border-width: max( 20732 1px, 20733 var(--sc-border-width, max(1px, 0.12rem)) 20734 ); 20735 --sc-divider-border-color: var(--sc-border-color); 20736 --sc-divider-border-style: solid; 20737 --sc-divider-color: currentColor; 20738 --sc-divider-ff: var(--sc-font-family-base, sans-serif); 20739 --sc-divider-fs: 1rem; 20740 --sc-divider-fw: var(--sc-font-weight-base, 400); 20741 --sc-divider-fst: var(--sc-font-style-base, normal); 20742 20743 margin: var(--sc-divider-my) var(--sc-divider-mx); 20744 font-size: var(--sc-divider-fs); 20745 font-style: var(--sc-divider-fst); 20746 font-family: var(--sc-divider-ff); 20747 font-weight: var(--sc-divider-fw); 20748 color: var(--sc-divider-color); 20749 display: block; 20750 } 20751 20752 /*SIZE*/ 20753 :host([size="2xs"]) { 20754 --sc-divider-my: 0.35rem; 20755 --sc-divider-fs: 0.68rem; 20756 } 20757 20758 :host([size="xs"]) { 20759 --sc-divider-my: 0.5rem; 20760 --sc-divider-fs: 0.75rem; 20761 } 20762 20763 :host([size="sm"]) { 20764 --sc-divider-my: 0.75rem; 20765 --sc-divider-fs: 0.875rem; 20766 } 20767 20768 :host([size="md"]) { 20769 --sc-divider-my: 1.25rem; 20770 } 20771 20772 :host([size="lg"]) { 20773 --sc-divider-my: 1.85rem; 20774 } 20775 20776 :host([size="xl"]) { 20777 --sc-divider-my: 2.25rem; 20778 } 20779 20780 :host([size="2xl"]) { 20781 --sc-divider-my: 3.35rem; 20782 } 20783 20784 div { 20785 display: flex; 20786 align-items: center; 20787 width: 100%; 20788 } 20789 20790 div::before, 20791 div::after { 20792 content: ""; 20793 flex-grow: 1; 20794 border-top: var(--sc-divider-border-width) 20795 var(--sc-divider-border-style) var(--sc-divider-border-color); 20796 width: 100%; 20797 opacity: var(--sc-divider-opacity, 1); 20798 } 20799 20800 /*ALIGNEMENT*/ 20801 :host([align="left"]) div:before { 20802 display: none; 20803 } 20804 20805 :host([align="right"]) div:after { 20806 display: none; 20807 } 20808 20809 :host([vertical]) { 20810 margin: var(--sc-divider-mx) var(--sc-divider-my); 20811 } 20812 20813 :host([vertical]) div { 20814 flex-direction: column; 20815 height: 100%; 20816 min-height: var(--sc-form-height, 2.5em); 20817 } 20818 20819 :host([vertical]) .has-text { 20820 gap: 0.25rem; 20821 } 20822 20823 :host([vertical]) div::before, 20824 :host([vertical]) div::after { 20825 border-top: none; 20826 border-left: var(--sc-divider-border-width) 20827 var(--sc-divider-border-style) var(--sc-divider-border-color); 20828 width: auto; 20829 height: 100%; 20830 opacity: var(--sc-divider-opacity, 1); 20831 } 20832 20833 :host([noMargin]) { 20834 margin: 0; 20835 } 20836 20837 /*TEXT*/ 20838 .text { 20839 flex-shrink: 0; 20840 line-height: 1.1; 20841 max-width: 80%; 20842 } 20843 20844 .no-text .text { 20845 display: none; 20846 } 20847 20848 .has-text { 20849 gap: 0.5rem; 20850 } 20851 20852 :host([dotted]) { 20853 --sc-divider-border-style: dotted; 20854 } 20855 :host([dashed]) { 20856 --sc-divider-border-style: dashed; 20857 } 20858 ` 20859 ]; 20860 __decorate$w([ 20861 n$4({ flatten: true }) 20862 ], Divider.prototype, "slotNodes", void 0); 20863 __decorate$w([ 20864 e$7("div") 20865 ], Divider.prototype, "divider", void 0); 20866 __decorate$w([ 20867 n$5({ type: String }) 20868 ], Divider.prototype, "label", void 0); 20869 __decorate$w([ 20870 n$5({ type: String, reflect: true }) 20871 ], Divider.prototype, "size", void 0); 20872 __decorate$w([ 20873 n$5({ type: String, reflect: true }) 20874 ], Divider.prototype, "align", void 0); 20875 __decorate$w([ 20876 n$5({ type: Boolean, reflect: true }) 20877 ], Divider.prototype, "vertical", void 0); 20878 __decorate$w([ 20879 n$5({ type: Boolean, reflect: true }) 20880 ], Divider.prototype, "noMargin", void 0); 20881 __decorate$w([ 20882 n$5({ type: Boolean, reflect: true }) 20883 ], Divider.prototype, "dashed", void 0); 20884 __decorate$w([ 20885 n$5({ type: Boolean, reflect: true }) 20886 ], Divider.prototype, "dotted", void 0); 20887 Divider = __decorate$w([ 20888 t$3(tagName$2p) 20889 ], Divider); 20890 const passwordToggle = i$9` 20891 .password-toggle { 20892 color: var(--sc-input-c); 20893 font-size: var(--sc-input-fs); 20894 cursor: pointer; 20895 margin-right: calc(-0.5 * var(--sc-input-px)); 20896 } 20897 20898 :host([inlineContent]) .has-suffix .password-toggle { 20899 margin-right: 0; 20900 } 20901`; 20902 const label = i$9` 20903 :host { 20904 --sc-label-fs: var(--sc-_fs, 1rem);
20905 --sc-label-fw: var(--sc-label-font-weight, 500); 20906 } 20907 label { 20908 font-size: var(--sc-label-fs); 20909 font-weight: var(--sc-label-fw); 20910 line-height: 1.2; 20911 } 20912 .form-label { 20913 margin-bottom: 0.22em; 20914 display: block; 20915 } 20916`; 20917 const description = i$9` 20918 .form-description { 20919 color: var(--sc-base-400, var(--sc-base-content, #000)); 20920 font-size: 0.85em; 20921 margin-top: 0.2em; 20922 display: block; 20923 } 20924`; 20925 const formControl = i$9` 20926 * { 20927 box-sizing: border-box; 20928 } 20929 20930 :host { 20931 --sc-input-height: var(--sc-form-height, 2.5em); 20932 --sc-input-c: var(--sc-input-color, var(--sc-base-content, #000)); 20933 --sc-input-b-width: var(--sc-form-border-width); 20934 --sc-input-b-color: var( 20935 --sc-input-border-color, 20936 var(--sc-base-content, #000) 20937 ); 20938 20939 --sc-item-rounded-tr: var(--sc-input-rounded); 20940 --sc-item-rounded-tl: var(--sc-input-rounded); 20941 --sc-item-rounded-bl: var(--sc-input-rounded); 20942 --sc-item-rounded-br: var(--sc-input-rounded); 20943 20944 --sc-input-fs: var(--sc-_fs, 1rem); 20945 --sc-input-ff: var( 20946 --sc-input-font-family, 20947 var(--sc-font-family-base, sans-serif) 20948 ); 20949 --sc-input-py: 0.55em; 20950 --sc-input-px: clamp(0.3em, 8%, 1.1em); 20951 20952 --sc-input-background: var(--sc-input-bg); 20953 --sc-input-addon-c: var(--sc-input-addon-color, var(--sc-base, #fff)); 20954 --sc-input-addon-bg: var(--sc-input-c); 20955 } 20956 20957 .form-element { 20958 display: block; 20959 flex-grow: 1; 20960 width: 100%; 20961 20962 line-height: 1.1; 20963 color: var(--sc-input-c); 20964 border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) 20965 var(--sc-item-rounded-br) var(--sc-item-rounded-bl); 20966 20967 font-family: var(--sc-input-ff); 20968 background-color: var(--sc-input-background); 20969 border: var(--sc-input-b-width) solid 20970 var(--sc-input-b-color, var(--sc-base-300, #aaa)); 20971 width: 100%; 20972 font-size: var(--sc-input-fs); 20973 20974 padding-top: var(--sc-input-py); 20975 padding-bottom: var(--sc-input-py); 20976 padding-left: var(--sc-input-px); 20977 padding-right: var(--sc-input-px); 20978 20979 transition: border-color 0.15s ease-in-out, color 0.15s ease-in-out, 20980 box-shadow 0.15s ease-in-out; 20981 min-height: var(--sc-input-height); 20982 } 20983 20984 .form-control { 20985 display: flex; 20986 width: 100%; 20987 } 20988 20989 /*Suffix*/ 20990 :host(:not([inlineContent])) .has-suffix slot[name="suffix"], 20991 :host(:not([inlineContent])) .has-prefix slot[name="prefix"] { 20992 min-width: var(--sc-input-height); 20993 box-sizing: border-box; 20994 display: flex; 20995 align-items: center; 20996 justify-content: center; 20997 line-height: 1.1; 20998 flex-shrink: 0; 20999 border: var(--sc-input-b-width) solid transparent; 21000 padding-left: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px))); 21001 padding-right: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px))); 21002 } 21003 21004 :host(:not([inlineContent])) slot[name="prefix"] { 21005 border-radius: var(--sc-item-rounded-tl) 0 0 var(--sc-item-rounded-bl); 21006 background-color: var(--sc-input-addon-bg); 21007 color: var(--sc-input-addon-c); 21008 /*margin-right: calc(-1 * var(--sc-input-b-width)); 21009 border: none;*/ 21010 } 21011 21012 :host(:not([inlineContent])) slot[name="suffix"] { 21013 border-radius: 0 var(--sc-item-rounded-tr) var(--sc-item-rounded-br) 0; 21014 background-color: var(--sc-input-addon-bg); 21015 color: var(--sc-input-addon-c); 21016 /*margin-left: calc(-1 * var(--sc-input-b-width)); 21017 border: none;*/ 21018 } 21019 21020 :host(:not([inlineContent])[disabled]) .has-suffix slot[name="suffix"], 21021 :host(:not([inlineContent])[disabled]) .has-prefix slot[name="prefix"] { 21022 opacity: 0.43; 21023 } 21024 21025 :host(:not([inlineContent])) .has-prefix .form-element { 21026 border-top-left-radius: 0; 21027 border-bottom-left-radius: 0; 21028 } 21029 21030 :host(:not([inlineContent])) .has-suffix .form-element { 21031 border-top-right-radius: 0; 21032 border-bottom-right-radius: 0; 21033 } 21034 21035 slot[name="suffix"]::slotted(sonic-icon), 21036 slot[name="prefix"]::slotted(sonic-icon) { 21037 font-size: 1.2em; 21038 } 21039 21040 /*InlineCONTENT */ 21041 21042 .form-element > slot, 21043 .form-element .form-element { 21044 all: unset; 21045 } 21046 21047 :host([inlineContent]) .form-element { 21048 display: flex; 21049 align-items: center; 21050 gap: 0.35em; 21051 min-height: var(--sc-form-height, 2.5em); 21052 } 21053 21054 :host([inlineContent]) .form-element .form-element { 21055 appearance: none; 21056 background: transparent; 21057 border: none; 21058 padding: 0; 21059 display: block; 21060 width: 50%; 21061 min-width: 0; 21062 flex: 1 1 auto; 21063 height: auto; 21064 min-height: auto; 21065 border-radius: 0; 21066 } 21067 :host([inlineContent]) slot[name="prefix"]::slotted(*), 21068 :host([inlineContent]) slot[name="suffix"]::slotted(*) { 21069 display: block; 21070 flex: 0 0 auto; 21071 max-width: 100%; 21072 max-width: 100%; 21073 white-space: nowrap; 21074 } 21075 21076 :host([inlineContent]) .has-suffix slot[name="suffix"] { 21077 margin-right: calc(-0.5 * var(--sc-input-px)); 21078 } 21079 :host([inlineContent]) .has-prefix slot[name="prefix"] { 21080 margin-left: calc(-0.5 * var(--sc-input-px)); 21081 } 21082 21083 :host([inlineContent]) slot[name="suffix"]::slotted(*) { 21084 margin-left: auto; 21085 } 21086 21087 :host([inlineContent]) .no-suffix slot[name="suffix"], 21088 :host([inlineContent]) .no-prefix slot[name="prefix"] { 21089 display: none; 21090 } 21091 21092 /* :host([inlineContent]) .input { 21093 21094 }*/ 21095 /*Disabled */ 21096 :host([disabled]) .form-control {
21097 cursor: not-allowed; 21098 } 21099 21100 :host([variant="ghost"]) .form-element { 21101 --sc-input-bg: transparent; 21102 } 21103 21104 /*Disbaled*/ 21105 :host([disabled]) .form-element { 21106 pointer-events: none; 21107 opacity: 0.43; 21108 /* border-color: transparent;*/ 21109 } 21110 :host([disabled]) .select-chevron { 21111 display: none; 21112 /* border-color: transparent;*/ 21113 } 21114 21115 /*PLACEHOLDER*/ 21116 ::placeholder { 21117 color: inherit; 21118 opacity: 0.6; 21119 } 21120 21121 :host([placehoderAsLabel]) ::placeholder { 21122 opacity: 1; 21123 } 21124 21125 :focus::placeholder { 21126 opacity: 0 !important; 21127 } 21128 21129 /*HOVER*/ 21130 :host(:not([disabled])) .form-element:hover, 21131 .form-element:focus-visible, 21132 .form-element:focus { 21133 background-color: hsl(from var(--sc-input-bg) h s calc(l * 0.97)); 21134 } 21135 21136 .form-label { 21137 margin-bottom: 0.22em; 21138 display: block; 21139 } 21140 21141 /*Utilitaires*/ 21142 .hidden { 21143 display: none; 21144 } 21145 .contents { 21146 display: contents; 21147 } 21148 21149 /*ERROR*/ 21150 :host([error]) { 21151 --sc-input-b-color: var(--sc-danger, var(--sc-base-content, #000)); 21152 } 21153 21154 :host input:visited { 21155 display: none; 21156 } 21157 21158 :host([touched][required]) :not(:focus):invalid { 21159 --sc-input-b-color: var(--sc-danger, var(--sc-base-content, #000)); 21160 --sc-input-c: var(--sc-danger, var(--sc-base-content, #000)); 21161 } 21162 21163 :host([touched][required]) :not(:focus):invalid + .select-chevron { 21164 --sc-input-c: var(--sc-danger, var(--sc-base-content, #000)); 21165 } 21166 21167 /*VALID*/ 21168 :host([touched][required]) :not([value=""]):not(:focus):valid { 21169 --sc-input-b-color: var(--sc-success, var(--sc-base-content, #000)); 21170 --sc-input-c: var(--sc-success, var(--sc-base-content, #000)); 21171 } 21172 21173 :host([touched][required]) :not(:focus):valid + .select-chevron { 21174 --sc-input-c: var(--sc-success, var(--sc-base-content, #000)); 21175 } 21176 /*active*/ 21177 :host([active]) { 21178 --sc-input-b-color: var(--sc-primary, var(--sc-base-content, #000)); 21179 --sc-input-c: var(--sc-primary, var(--sc-base-content, #000)); 21180 } 21181 :host([active]) .select-chevron { 21182 --sc-input-c: var(--sc-primary, var(--sc-base-content, #000)); 21183 } 21184 21185 /*Input COLOR*/ 21186 :host([type="color"]) .form-element { 21187 padding: 0; 21188 border: 0; 21189 min-width: var(--sc-input-height); 21190 } 21191 input[type="color"]::-webkit-color-swatch-wrapper { 21192 padding: 0; 21193 } 21194 input[type="color"]::-webkit-color-swatch { 21195 border: none; 21196 border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) 21197 var(--sc-item-rounded-br) var(--sc-item-rounded-bl); 21198 } 21199 21200 /*Input Image*/ 21201 :host([type="image"]) .form-element { 21202 padding: 0; 21203 border: none; 21204 } 21205 21206 /*Input reset & image*/ 21207 input[type="reset"], 21208 input[type="submit"] { 21209 cursor: pointer; 21210 } 21211 21212 /*Input search*/ 21213 :host([type="search"]) { 21214 appearance: none !important; 21215 } 21216 21217 input[type="search"]::-webkit-search-cancel-button { 21218 appearance: none; 21219 cursor: pointer; 21220 height: 0.65em; 21221 width: 0.65em; 21222 background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE2LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgd2lkdGg9IjEyMy4wNXB4IiBoZWlnaHQ9IjEyMy4wNXB4IiB2aWV3Qm94PSIwIDAgMTIzLjA1IDEyMy4wNSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTIzLjA1IDEyMy4wNTsiDQoJIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGc+DQoJPHBhdGggZD0iTTEyMS4zMjUsMTAuOTI1bC04LjUtOC4zOTljLTIuMy0yLjMtNi4xLTIuMy04LjUsMGwtNDIuNCw0Mi4zOTlMMTguNzI2LDEuNzI2Yy0yLjMwMS0yLjMwMS02LjEwMS0yLjMwMS04LjUsMGwtOC41LDguNQ0KCQljLTIuMzAxLDIuMy0yLjMwMSw2LjEsMCw4LjVsNDMuMSw0My4xbC00Mi4zLDQyLjVjLTIuMywyLjMtMi4zLDYuMSwwLDguNWw4LjUsOC41YzIuMywyLjMsNi4xLDIuMyw4LjUsMGw0Mi4zOTktNDIuNGw0Mi40LDQyLjQNCgkJYzIuMywyLjMsNi4xLDIuMyw4LjUsMGw4LjUtOC41YzIuMy0yLjMsMi4zLTYuMSwwLTguNWwtNDIuNS00Mi40bDQyLjQtNDIuMzk5QzEyMy42MjUsMTcuMTI1LDEyMy42MjUsMTMuMzI1LDEyMS4zMjUsMTAuOTI1eiIvPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPC9zdmc+DQo=); 21223 background-size: contain; 21224 background-repeat: no-repeat; 21225 } 21226 21227 /* Text align */ 21228 :host([align="center"]) .form-element { 21229 text-align: center; 21230 } 21231 :host([align="left"]) .form-element { 21232 text-align: left; 21233 } 21234 :host([align="right"]) .form-element { 21235 text-align: right; 21236 } 21237 21238 /* No arrows ion input Number */ 21239 :host([noAppearance]) input[type="number"]::-webkit-outer-spin-button, 21240 :host([noAppearance]) input[type="number"]::-webkit-inner-spin-button { 21241 -webkit-appearance: none; 21242 margin: 0; 21243 } 21244 21245 :host([noAppearance]) input[type="number"] { 21246 -moz-appearance: textfield !important; 21247 } 21248 21249 /*type color "default" | "success" | "error" | "warning" | "info" */ 21250 :host([status="success"]) { 21251 --sc-input-b-color: var(--sc-success, var(--sc-base-content, #000)); 21252 --sc-input-c: var(--sc-success, var(--sc-base-content, #000)); 21253 --sc-input-addon-bg: var(--sc-success, var(--sc-base-content, #000)); 21254 --sc-input-addon-color: var(--sc-success-content, var(--sc-base, #fff)); 21255 } 21256 :host([status="error"]) { 21257 --sc-input-b-color: var(--sc-danger, var(--sc-base-content, #000)); 21258 --sc-input-c: var(--sc-danger, var(--sc-base-content, #000)); 21259 --sc-input-addon-bg: var(--sc-danger, var(--sc-base-content, #000)); 21260 --sc-input-addon-color: var(--sc-danger-content, var(--sc-base, #fff)); 21261 } 21262 :host([status="warning"]) { 21263 --sc-input-b-color: var(--sc-warning); 21264 --sc-input-c: var(--sc-warning, var(--sc-base-content, #000)); 21265 --sc-input-addon-bg: var(--sc-warning, var(--sc-base-content, #000)); 21266 --sc-input-addon-color: var(--sc-warning-content, var(--sc-base, #fff)); 21267 } 21268 :host([status="info"]) { 21269 --sc-input-b-color: var(--sc-info, var(--sc-base-content, #000)); 21270 --sc-input-c: var(--sc-info, var(--sc-base-content, #000)); 21271 --sc-input-addon-bg: var(--sc-info, var(--sc-base-content, #000)); 21272 --sc-input-addon-color: var(--sc-info-content, var(--sc-base, #fff)); 21273 } 21274 :host([status="primary"]) { 21275 --sc-input-b-color: var(--sc-primary, var(--sc-base-content, #000)); 21276 --sc-input-c: var(--sc-primary, var(--sc-base-content, #000)); 21277 --sc-input-addon-bg: var(--sc-primary, var(--sc-base-content, #000)); 21278 --sc-input-addon-color: var(--sc-primary-content, var(--sc-base, #fff)); 21279 } 21280`; 21281 var __decorate$v = function(decorators, target, key, desc) { 21282 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 21283 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 21284 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; 21285 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 21286 };
21287 const tagName$2o = "sonic-group"; 21288 let Group = class Group extends i$6 { 21289 constructor() { 21290 super(...arguments); 21291 this.alignItems = "center"; 21292 this.hasDescription = false; 21293 this.hasLabel = false; 21294 } 21295 updated() { 21296 const children = this.querySelectorAll("sonic-input, sonic-button, sonic-select"); 21297 const nbChildren = children.length; 21298 if (nbChildren > 1) { 21299 children.forEach((item, index) => { 21300 const htmlElement = item; 21301 if (index === 0) { 21302 htmlElement.style.setProperty("--sc-item-rounded-tr", "0"); 21303 htmlElement.style.setProperty("--sc-item-rounded-br", "0"); 21304 } else if (index === nbChildren - 1) { 21305 htmlElement.style.setProperty("--sc-item-rounded-tl", "0"); 21306 htmlElement.style.setProperty("--sc-item-rounded-bl", "0"); 21307 } else { 21308 htmlElement.style.setProperty("--sc-item-rounded-tr", "0"); 21309 htmlElement.style.setProperty("--sc-item-rounded-br", "0"); 21310 htmlElement.style.setProperty("--sc-item-rounded-tl", "0"); 21311 htmlElement.style.setProperty("--sc-item-rounded-bl", "0"); 21312 } 21313 }); 21314 } 21315 } 21316 connectedCallback() { 21317 super.connectedCallback(); 21318 this.hasSlotOrProps(); 21319 } 21320 willUpdate(changedProperties) { 21321 this.hasSlotOrProps(); 21322 super.willUpdate(changedProperties); 21323 } 21324 hasSlotOrProps() { 21325 this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false; 21326 this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false; 21327 } 21328 render() { 21329 const slotStyle = { 21330 alignItems: this.alignItems 21331 }; 21332 return b$1`<span class="${this.hasLabel ? "form-label" : "hidden"}" 21333 >${this.label ? o$6( 21334 this.label 21335 /*+ labelStarSuffix*/ 21336 ) : ""}<slot 21337 name="label" 21338 @slotchange=${this.hasSlotOrProps} 21339 ></slot 21340 ></span> 21341 <slot class="main-slot" style=${o$3(slotStyle)}></slot> 21342 <slot 21343 name="description" 21344 @slotchange=${this.hasSlotOrProps} 21345 class="${this.hasDescription ? "form-description" : "hidden"}" 21346 > 21347 ${this.description ? b$1`${o$6(this.description)}` : ""} 21348 </slot>`; 21349 } 21350 }; 21351 Group.styles = [ 21352 fontSize, 21353 label, 21354 description, 21355 i$9` 21356 :host { 21357 display: inline-block; 21358 vertical-align: middle; 21359 } 21360 21361 .main-slot { 21362 width: 100%; 21363 display: flex; 21364 min-width: 0; 21365 } 21366 .hidden { 21367 display: none; 21368 } 21369 21370 ::slotted(sonic-button), 21371 ::slotted(sonic-input), 21372 ::slotted(sonic-select) { 21373 flex-grow: 1; 21374 } 21375 ` 21376 ]; 21377 __decorate$v([ 21378 n$5({ type: String }) 21379 ], Group.prototype, "alignItems", void 0); 21380 __decorate$v([ 21381 n$5({ type: String }) 21382 ], Group.prototype, "label", void 0); 21383 __decorate$v([ 21384 n$5({ type: String }) 21385 ], Group.prototype, "description", void 0); 21386 __decorate$v([ 21387 n$4({ slot: "label", flatten: true }) 21388 ], Group.prototype, "slotLabelNodes", void 0); 21389 __decorate$v([ 21390 n$4({ slot: "description", flatten: true }) 21391 ], Group.prototype, "slotDescriptionNodes", void 0); 21392 __decorate$v([ 21393 r$5() 21394 ], Group.prototype, "hasDescription", void 0); 21395 __decorate$v([ 21396 r$5() 21397 ], Group.prototype, "hasLabel", void 0); 21398 Group = __decorate$v([ 21399 t$3(tagName$2o) 21400 ], Group); 21401 const promoCodeModal = (promoCode) => { 21402 const { code, events, subscription_types } = promoCode; 21403 const eventIds = events?.join(","); 21404 const subscriptionIds = subscription_types?.join(","); 21405 let dataProvider = ""; 21406 let subtitle = t("LIB_code_promo_modal_subtitle"); 21407 if (eventIds) { 21408 dataProvider = `sessions?ids=${eventIds}&next=1&limit=$limit&offset=$offset&features[]=picture&features[]=location&features[]=range`; 21409 } else if (subscriptionIds) { 21410 subtitle = t("LIB_code_promo_modal_subtitle_subscription"); 21411 dataProvider = `subscription-types?ids=${subscriptionIds}`; 21412 } 21413 Modal.create({ 21414 maxHeight: "80svh", 21415 maxWidth: "70rem", 21416 width: "90%", 21417 title: b$1` 21418 ${t("LIB_code_promo")} :
21419 <span style="font-family: var(--sc-font-family-monospace, monospace); font-weight: 600; font-size: 1.25rem;" 21420 >${code}</span 21421 > 21422 `, 21423 content: b$1`<sonic-divider size="lg" align="left" style="margin-top:0">${subtitle}</sonic-divider 21424 ><sonic-queue 21425 dataProviderExpression=${dataProvider} 21426 fetch 21427 key="data" 21428 .noItems=${() => b$1`<sonic-no-result size="lg"></sonic-no-result>`} 21429 .items=${() => b$1`<sonic-product-summary 21430 link 21431 size="sm" 21432 featureDisplay='["status","location"]' 21433 @click=${(e2) => { 21434 const parentModal = HTML.getClosestElement(e2.target, "sonic-modal"); 21435 parentModal?.hide(); 21436 }} 21437 > 21438 <sonic-button slot="actions" shape="circle" class="hidden lg:block" 21439 ><sonic-icon library="custom" name="arrow-right"></sonic-icon 21440 ></sonic-button> 21441 </sonic-product-summary> 21442 <sonic-divider size="md"></sonic-divider> `} 21443 > 21444 </sonic-queue>` 21445 }).addEventListener("hidden", () => { 21446 dp("promo-active-code").invalidate(); 21447 }); 21448 }; 21449 var __defProp$3y = Object.defineProperty; 21450 var __getOwnPropDesc$3B = Object.getOwnPropertyDescriptor; 21451 var __decorateClass$3C = (decorators, target, key, kind) => { 21452 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3B(target, key) : target; 21453 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 21454 if (decorator = decorators[i2]) 21455 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 21456 if (kind && result) __defProp$3y(target, key, result); 21457 return result; 21458 }; 21459 const tagName$2n = "sonic-promo-active-code-item"; 21460 let SonicPromoActiveCodeItem = class extends i$6 { 21461 constructor() { 21462 super(...arguments); 21463 this.showItems = () => { 21464 if (!this.promoCode) return; 21465 this.hideParentToast(); 21466 promoCodeModal(this.promoCode); 21467 }; 21468 this.hideParentToast = () => { 21469 const parentToast = this.closest("sonic-toast-item"); 21470 if (parentToast) { 21471 parentToast.hide(); 21472 } 21473 }; 21474 this.removePromoCode = () => { 21475 if (!this.apiConf) return; 21476 const api2 = new API(this.apiConf); 21477 api2.delete("promotion-code", { 21478 promo_code_id: this.promoCode?.promo_code_id 21479 }).then(() => { 21480 this.hideParentToast(); 21481 setTimeout(() => { 21482 dp("promo-active-code").invalidate(); 21483 }, 1e3); 21484 }); 21485 }; 21486 } 21487 render() { 21488 if (!this.promoCode || !this.promoCode.promo_code_id) return; 21489 const hasSubscriptions = this.promoCode.subscription_types?.length; 21490 let seeMsg = t("LIB_code_promo_toast_msg"); 21491 if (hasSubscriptions) { 21492 seeMsg = t("LIB_code_promo_toast_msg_subscription"); 21493 } 21494 const removeMsg = t("LIB_code_promo_remove"); 21495 const { promo_code_id, code } = this.promoCode; 21496 return b$1` 21497 <div class="relative"> 21498 <sonic-button 21499 @click=${this.showItems} 21500 name="promo_code_id" 21501 value="${promo_code_id}" 21502 size="xs" 21503 variant="outline" 21504 noAutofill 21505 align="left" 21506 > 21507 <div slot="prefix" class="border-r pr-2 mr-2 "> 21508 <sonic-icon library="custom" name="circle-arrow-right" size="xl"></sonic-icon> 21509 </div> 21510 <div class="my-1"> 21511 <b class="font-mono uppercase">${code}</b> 21512 <div class="hidden md:block">${seeMsg}</div> 21513 </div> 21514 </sonic-button> 21515 21516 <sonic-button 21517 class="absolute -right-2 -top-2" 21518 title=${removeMsg} 21519 data-aria-label=${removeMsg} 21520 @click=${this.removePromoCode} 21521 size="2xs" 21522 shape="circle" 21523 name="promo_code_id" 21524 type="danger" 21525 value=${promo_code_id} 21526 noAutofill 21527 icon 21528 > 21529 <sonic-icon library="custom" name="trash-can"></sonic-icon> 21530 </sonic-button> 21531 </div> 21532 `; 21533 } 21534 }; 21535 SonicPromoActiveCodeItem.styles = [tailwind]; 21536 __decorateClass$3C([ 21537 r$5() 21538 ], SonicPromoActiveCodeItem.prototype, "_modal", 2); 21539 __decorateClass$3C([ 21540 n$5({ type: Object }) 21541 ], SonicPromoActiveCodeItem.prototype, "promoCode", 2); 21542 __decorateClass$3C([ 21543 n$5({ type: Object }) 21544 ], SonicPromoActiveCodeItem.prototype, "apiConf", 2); 21545 SonicPromoActiveCodeItem = __decorateClass$3C([ 21546 t$3(tagName$2n) 21547 ], SonicPromoActiveCodeItem); 21548 var __defProp$3x = Object.defineProperty; 21549 var __getOwnPropDesc$3A = Object.getOwnPropertyDescriptor; 21550 var __decorateClass$3B = (decorators, target, key, kind) => { 21551 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3A(target, key) : target; 21552 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 21553 if (decorator = decorators[i2]) 21554 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 21555 if (kind && result) __defProp$3x(target, key, result); 21556 return result; 21557 }; 21558 const tagName$2m = "sonic-promo-active-code"; 21559 let SonicPromoActiveCode = class extends Fetcher(Subscriber$1(i$6)) { 21560 constructor() { 21561 super(...arguments); 21562 this.wording_LIB_codes_promo_actives = ""; 21563 this.data = []; 21564 this.previousToast = null; 21565 } 21566 connectedCallback() { 21567 if (document.documentElement.matches(".iframe-context")) { 21568 return; 21569 } 21570 this.setAttribute("dataProvider", "promo-active-code"); 21571 this.setAttribute("endPoint", "promotion-code?actives=true"); 21572 super.connectedCallback(); 21573 } 21574 willUpdate(changedProperties) { 21575 if (changedProperties.has("data")) { 21576 if (this.data.length) { 21577 this.addToast(); 21578 } 21579 } 21580 super.willUpdate(changedProperties); 21581 } 21582 updateToast() { 21583 PublisherManager.get("promo-active-code").invalidate(); 21584 } 21585 addToast() { 21586 const apiConf = this.getApiConfiguration(); 21587 if (this.data.length) { 21588 const newToast = { 21589 text: ( 21590 /*html*/ 21591 ` 21592 <sonic-t style="font-weight:bold;" key="LIB_codes_promo_actives"></sonic-t> 21593 <div style="display:flex; align-items:center; flex-wrap:wrap; gap:.25rem 1rem; margin-top:.3rem;" > 21594 ${this.data.map( 21595 (promoCode) => ( 21596 /*html*/ 21597 ` 21598 <sonic-promo-active-code-item 21599 apiConf='${JSON.stringify(apiConf).replace(/'/g, "'")}' 21600 promoCode='${JSON.stringify(promoCode).replace(/'/g, "'")}'></sonic-promo-active-code-item>` 21601 ) 21602 ).join("")} 21603 </div>` 21604 ), 21605 status: "success", 21606 preserve: true 21607 }; 21608 if (this.previousToast) { 21609 SonicToast.removeItem(this.previousToast); 21610 } 21611 this.previousToast = newToast; 21612 SonicToast.add(newToast); 21613 } 21614 } 21615 render() { 21616 return A$1; 21617 } 21618 }; 21619 SonicPromoActiveCode.styles = [tailwind]; 21620 __decorateClass$3B([ 21621 n$5({ type: String }) 21622 ], SonicPromoActiveCode.prototype, "wording_LIB_codes_promo_actives", 2); 21623 __decorateClass$3B([ 21624 r$5() 21625 ], SonicPromoActiveCode.prototype, "data", 2); 21626 SonicPromoActiveCode = __decorateClass$3B([ 21627 t$3(tagName$2m) 21628 ], SonicPromoActiveCode); 21629 const decodeParam = (s2) => { 21630 let r2 = s2; 21631 for (let i2 = 0; i2 < 8; i2++) {
21632 try { 21633 const t2 = decodeURIComponent(r2.replace(/\+/g, " ")); 21634 if (t2 === r2) break; 21635 r2 = t2; 21636 } catch { 21637 break; 21638 } 21639 } 21640 return r2; 21641 }; 21642 const isSonicFillKey = (key) => { 21643 const k2 = decodeParam(key); 21644 return k2 === "sonic_fill[]" || /^sonic_fill\[\d+\]$/.test(k2); 21645 }; 21646 const handleRedirect = () => { 21647 const urlParams = new URLSearchParams(window.location.search); 21648 const sonic_to_raw = urlParams.get("sonic_to"); 21649 const sonic_to = sonic_to_raw != null ? decodeParam(sonic_to_raw) : null; 21650 const otherParams = new URLSearchParams(); 21651 const sonicFill = []; 21652 for (const [key, value] of urlParams) { 21653 if (isSonicFillKey(key)) { 21654 sonicFill.push(decodeParam(value)); 21655 } else if (key !== "sonic_to") { 21656 otherParams.append(key, value); 21657 } 21658 } 21659 if (sonic_to) { 21660 const routeName = sonic_to.split("(")[0]; 21661 let routeParams = sonic_to.split("(")[1]?.split(")")[0] || routeName; 21662 routeParams = routeParams.replace(/%20/g, " ").replace(/ /g, ""); 21663 let app_route = appRoute(routeName).toString(); 21664 const pattern = new URLPattern(app_route); 21665 if (app_route) { 21666 let baseUrl; 21667 pattern?.names.forEach((name) => { 21668 const value = routeParams.match(new RegExp(`${name}:(.*?)(,|$)`)); 21669 if (value) { 21670 app_route = app_route.replace(`:${name}`, value[1]); 21671 } 21672 }); 21673 app_route = app_route.replace("(:id)", ""); 21674 for (const param of sonicFill) { 21675 const colon = param.indexOf(":"); 21676 if (colon === -1) continue; 21677 const k2 = param.slice(0, colon); 21678 const v2 = param.slice(colon + 1); 21679 if (k2) app_route = app_route.replace(`:${k2}`, v2); 21680 } 21681 if (!app_route.startsWith("#")) { 21682 baseUrl = new URL(location.protocol + "//" + location.host + app_route); 21683 baseUrl.search = otherParams.toString(); 21684 window.location.href = baseUrl.toString(); 21685 } else { 21686 window.location.hash = app_route; 21687 } 21688 } 21689 } 21690 }; 21691 const goTo = (route2) => { 21692 appRoute(route2).goTo(); 21693 }; 21694 let defaultApiConf = { 21695 serviceURL: "", 21696 token: null, 21697 userName: "", 21698 password: "", 21699 authToken: "", 21700 tokenProvider: "" 21701 }; 21702 const setDefaultApiConf = (conf) => { 21703 defaultApiConf = conf; 21704 }; 21705 const getDefaultApiConfiguration = () => { 21706 return defaultApiConf; 21707 }; 21708 const getDefaultApi = () => { 21709 return new API(defaultApiConf); 21710 }; 21711 const dpKeys$1 = { 21712 Settings: "settings", 21713 CgvLink: "cgv_link", 21714 CustomerUi: "customer_ui", 21715 Infos: "infos", 21716 IsOnline: "is_online", 21717 IsAuthorizedIp: "is_authorized_ip", 21718 Maintenance: "maintenance", 21719 Wording: "wording", 21720 Langs: "langs", 21721 Modules: "modules", 21722 OnlinePaymentId: "online_payment_id", 21723 PromotionCode: "promotion_code", 21724 QuickPurchase: "quick_purchase", 21725 LoginEnabled: "login_enabled", 21726 PreferWebsite: "prefer_website", 21727 StoreUi: "store_ui", 21728 SendOrderMail: "send_order_mail", 21729 WecountLink: "wecount_link", 21730 Theme: "theme", 21731 UserForm: "user_form", 21732 Brand: "brand", 21733 Trackings: "trackings", 21734 TestMode: "test_mode", 21735 RefundForm: "refund_form" 21736 }; 21737 dp(dpKeys$1.Settings); 21738 dp(`settings.${dpKeys$1.CgvLink}`); 21739 dp(`settings.${dpKeys$1.CustomerUi}`); 21740 dp(`settings.${dpKeys$1.Infos}`); 21741 dp(`settings.${dpKeys$1.IsOnline}`); 21742 dp(`settings.${dpKeys$1.IsAuthorizedIp}`); 21743 dp(`settings.${dpKeys$1.Maintenance}`); 21744 dp(`settings.${dpKeys$1.Wording}`); 21745 dp(`settings.${dpKeys$1.Langs}`); 21746 dp(`settings.${dpKeys$1.Modules}`); 21747 dp(`settings.${dpKeys$1.OnlinePaymentId}`); 21748 dp(`settings.${dpKeys$1.PromotionCode}`); 21749 dp(`settings.${dpKeys$1.QuickPurchase}`); 21750 dp(`settings.${dpKeys$1.LoginEnabled}`); 21751 dp(`settings.${dpKeys$1.PreferWebsite}`); 21752 dp(`settings.${dpKeys$1.StoreUi}`); 21753 dp(`settings.${dpKeys$1.SendOrderMail}`); 21754 dp(`settings.${dpKeys$1.WecountLink}`); 21755 dp(`settings.${dpKeys$1.Theme}`); 21756 dp(`settings.${dpKeys$1.UserForm}`); 21757 dp(`settings.${dpKeys$1.Brand}`); 21758 dp(`settings.${dpKeys$1.Trackings}`); 21759 dp(`settings.${dpKeys$1.TestMode}`); 21760 dp(`settings.${dpKeys$1.RefundForm}`);
21761 const customerUiEventExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event"); 21762 customerUiEventExport.layout = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.layout"); 21763 customerUiEventExport.onLayout = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.layout"); 21764 customerUiEventExport.filterByCategory = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.filter_by_category"); 21765 customerUiEventExport.onFilterByCategory = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.filter_by_category"); 21766 customerUiEventExport.filterByDay = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.filter_by_day"); 21767 customerUiEventExport.onFilterByDay = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event.filter_by_day"); 21768 const customerUiHomeExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home"); 21769 customerUiHomeExport.jumbotron = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.jumbotron"); 21770 customerUiHomeExport.onJumbotron = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.jumbotron"); 21771 customerUiHomeExport.featured = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.featured"); 21772 customerUiHomeExport.onFeatured = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.featured"); 21773 customerUiHomeExport.quickAccess = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.quick_access"); 21774 customerUiHomeExport.onQuickAccess = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.quick_access"); 21775 customerUiHomeExport.events = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.events"); 21776 customerUiHomeExport.onEvents = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home.events"); 21777 const customerUiExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi); 21778 customerUiExport.event = customerUiEventExport; 21779 customerUiExport.onEvent = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".event"); 21780 customerUiExport.home = customerUiHomeExport; 21781 customerUiExport.onHome = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.CustomerUi + ".home"); 21782 const storeUiEventExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event"); 21783 storeUiEventExport.layout = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.layout"); 21784 storeUiEventExport.onLayout = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.layout"); 21785 storeUiEventExport.filterByCategory = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.filter_by_category"); 21786 storeUiEventExport.onFilterByCategory = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.filter_by_category"); 21787 storeUiEventExport.filterByDay = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.filter_by_day"); 21788 storeUiEventExport.onFilterByDay = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event.filter_by_day"); 21789 const storeUiHomeExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home"); 21790 storeUiHomeExport.jumbotron = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.jumbotron"); 21791 storeUiHomeExport.onJumbotron = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.jumbotron"); 21792 storeUiHomeExport.featured = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.featured"); 21793 storeUiHomeExport.onFeatured = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.featured"); 21794 storeUiHomeExport.quickAccess = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.quick_access"); 21795 storeUiHomeExport.onQuickAccess = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.quick_access"); 21796 storeUiHomeExport.events = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.events"); 21797 storeUiHomeExport.onEvents = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home.events");
21798 const storeUiExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi); 21799 storeUiExport.event = storeUiEventExport; 21800 storeUiExport.onEvent = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".event"); 21801 storeUiExport.home = storeUiHomeExport; 21802 storeUiExport.onHome = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.StoreUi + ".home"); 21803 const infosAddressExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address"); 21804 infosAddressExport.street = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.street"); 21805 infosAddressExport.onStreet = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.street"); 21806 infosAddressExport.street2 = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.street_2"); 21807 infosAddressExport.onStreet2 = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.street_2"); 21808 infosAddressExport.phoneNumber = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.phone_number"); 21809 infosAddressExport.onPhoneNumber = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.phone_number"); 21810 infosAddressExport.zipCode = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.zip_code"); 21811 infosAddressExport.onZipCode = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.zip_code"); 21812 infosAddressExport.city = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.city"); 21813 infosAddressExport.onCity = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.city"); 21814 infosAddressExport.country = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.country"); 21815 infosAddressExport.onCountry = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address.country");
21816 const infosExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos); 21817 infosExport.siteName = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".site_name"); 21818 infosExport.onSiteName = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".site_name"); 21819 infosExport.editorName = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".editor_name"); 21820 infosExport.onEditorName = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".editor_name"); 21821 infosExport.siret = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".siret"); 21822 infosExport.onSiret = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".siret"); 21823 infosExport.TVA = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".TVA"); 21824 infosExport.onTVA = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".TVA"); 21825 infosExport.emailContact = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".email_contact"); 21826 infosExport.onEmailContact = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".email_contact"); 21827 infosExport.address = infosAddressExport; 21828 infosExport.onAddress = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".address"); 21829 infosExport.cgvLink = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".cgv_link"); 21830 infosExport.onCgvLink = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".cgv_link"); 21831 infosExport.metaDescription = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".meta_description"); 21832 infosExport.onMetaDescription = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".meta_description"); 21833 infosExport.website = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".website"); 21834 infosExport.onWebsite = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".website"); 21835 infosExport.storeUrl = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".store_url"); 21836 infosExport.onStoreUrl = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".store_url"); 21837 infosExport.legalTerms = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".legal_terms"); 21838 infosExport.onLegalTerms = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".legal_terms"); 21839 infosExport.zoneType = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".zone_type"); 21840 infosExport.onZoneType = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".zone_type"); 21841 infosExport.structureType = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".structure_type"); 21842 infosExport.onStructureType = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".structure_type"); 21843 infosExport.activityType = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".activity_type"); 21844 infosExport.onActivityType = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".activity_type"); 21845 infosExport.capacity = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".capacity"); 21846 infosExport.onCapacity = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".capacity"); 21847 infosExport.capacityType = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".capacity_type"); 21848 infosExport.onCapacityType = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Infos + ".capacity_type"); 21849 const createModuleExport = (modulePath) => { 21850 const moduleExport = bind$1(modulePath); 21851 moduleExport.enabled = () => bind$1(modulePath + ".enabled"); 21852 moduleExport.onEnabled = () => onAssign$1(modulePath + ".enabled"); 21853 moduleExport.access = () => bind$1(modulePath + ".access"); 21854 moduleExport.onAccess = () => onAssign$1(modulePath + ".access"); 21855 moduleExport.adminAccess = () => bind$1(modulePath + ".adminAccess"); 21856 moduleExport.onAdminAccess = () => onAssign$1(modulePath + ".adminAccess"); 21857 moduleExport.url = () => bind$1(modulePath + ".url"); 21858 moduleExport.onUrl = () => onAssign$1(modulePath + ".url"); 21859 moduleExport.token = () => bind$1(modulePath + ".token"); 21860 moduleExport.onToken = () => onAssign$1(modulePath + ".token"); 21861 return moduleExport; 21862 }; 21863 const modulesBasePath = dpKeys$1.Settings + "." + dpKeys$1.Modules;
21864 const modulesExport = bind$1(modulesBasePath); 21865 modulesExport.agenda = createModuleExport(modulesBasePath + ".agenda"); 21866 modulesExport.onAgenda = () => onAssign$1(modulesBasePath + ".agenda"); 21867 modulesExport.giftcards = createModuleExport(modulesBasePath + ".giftcards"); 21868 modulesExport.onGiftcards = () => onAssign$1(modulesBasePath + ".giftcards"); 21869 modulesExport.carpooling = createModuleExport(modulesBasePath + ".carpooling"); 21870 modulesExport.onCarpooling = () => onAssign$1(modulesBasePath + ".carpooling"); 21871 modulesExport.shop = createModuleExport(modulesBasePath + ".shop"); 21872 modulesExport.onShop = () => onAssign$1(modulesBasePath + ".shop"); 21873 modulesExport.relatedEvents = createModuleExport(modulesBasePath + ".related_events"); 21874 modulesExport.onRelatedEvents = () => onAssign$1(modulesBasePath + ".related_events"); 21875 modulesExport.subscription = createModuleExport(modulesBasePath + ".subscription"); 21876 modulesExport.onSubscription = () => onAssign$1(modulesBasePath + ".subscription"); 21877 modulesExport.reelax = createModuleExport(modulesBasePath + ".reelax"); 21878 modulesExport.onReelax = () => onAssign$1(modulesBasePath + ".reelax"); 21879 modulesExport.waitingLine = createModuleExport(modulesBasePath + ".waiting_line"); 21880 modulesExport.onWaitingLine = () => onAssign$1(modulesBasePath + ".waiting_line"); 21881 modulesExport.queue = createModuleExport(modulesBasePath + ".queue"); 21882 modulesExport.onQueue = () => onAssign$1(modulesBasePath + ".queue"); 21883 modulesExport.promotion = createModuleExport(modulesBasePath + ".promotion"); 21884 modulesExport.onPromotion = () => onAssign$1(modulesBasePath + ".promotion"); 21885 modulesExport.additionalProducts = createModuleExport(modulesBasePath + ".additional_products"); 21886 modulesExport.onAdditionalProducts = () => onAssign$1(modulesBasePath + ".additional_products"); 21887 modulesExport.askProAccount = createModuleExport(modulesBasePath + ".ask_pro_account"); 21888 modulesExport.onAskProAccount = () => onAssign$1(modulesBasePath + ".ask_pro_account"); 21889 modulesExport.refundRequest = createModuleExport(modulesBasePath + ".refund_request"); 21890 modulesExport.onRefundRequest = () => onAssign$1(modulesBasePath + ".refund_request"); 21891 modulesExport.freeupTickets = createModuleExport(modulesBasePath + ".freeup_tickets"); 21892 modulesExport.onFreeupTickets = () => onAssign$1(modulesBasePath + ".freeup_tickets"); 21893 modulesExport.accreditationsDirectory = createModuleExport(modulesBasePath + ".accreditations_directory"); 21894 modulesExport.onAccreditationsDirectory = () => onAssign$1(modulesBasePath + ".accreditations_directory"); 21895 modulesExport.waitingList = createModuleExport(modulesBasePath + ".waiting_list"); 21896 modulesExport.onWaitingList = () => onAssign$1(modulesBasePath + ".waiting_list"); 21897 modulesExport.logsRoute = createModuleExport(modulesBasePath + ".logs_route"); 21898 modulesExport.onLogsRoute = () => onAssign$1(modulesBasePath + ".logs_route"); 21899 modulesExport.sliderTv = createModuleExport(modulesBasePath + ".slider_tv"); 21900 modulesExport.onSliderTv = () => onAssign$1(modulesBasePath + ".slider_tv"); 21901 modulesExport.customAgendas = createModuleExport(modulesBasePath + ".custom_agendas"); 21902 modulesExport.onCustomAgendas = () => onAssign$1(modulesBasePath + ".custom_agendas"); 21903 const modules = modulesExport; 21904 const brandExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Brand); 21905 brandExport.id = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".id"); 21906 brandExport.onId = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".id"); 21907 brandExport.title = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".title"); 21908 brandExport.onTitle = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".title"); 21909 brandExport.url = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".url"); 21910 brandExport.onUrl = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Brand + ".url"); 21911 const refundFormExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.RefundForm); 21912 refundFormExport.enableIbanBicTxt = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.RefundForm + ".enable_iban_bic_txt"); 21913 refundFormExport.onEnableIbanBicTxt = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.RefundForm + ".enable_iban_bic_txt"); 21914 refundFormExport.enableIbanBicPdf = () =>
21914 bind$1(dpKeys$1.Settings + "." + dpKeys$1.RefundForm + ".enable_iban_bic_pdf"); 21915 refundFormExport.onEnableIbanBicPdf = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.RefundForm + ".enable_iban_bic_pdf"); 21916 const themeColorsExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors"); 21917 themeColorsExport.primary = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.primary"); 21918 themeColorsExport.onPrimary = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.primary"); 21919 themeColorsExport.primaryContent = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.primary_content"); 21920 themeColorsExport.onPrimaryContent = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.primary_content"); 21921 themeColorsExport.info = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.info"); 21922 themeColorsExport.onInfo = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.info"); 21923 themeColorsExport.danger = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.danger"); 21924 themeColorsExport.onDanger = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.danger"); 21925 themeColorsExport.warning = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.warning"); 21926 themeColorsExport.onWarning = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.warning"); 21927 themeColorsExport.success = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.success"); 21928 themeColorsExport.onSuccess = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.success"); 21929 themeColorsExport.base = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base"); 21930 themeColorsExport.onBase = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base"); 21931 themeColorsExport.base900 = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base_900"); 21932 themeColorsExport.onBase900 = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base_900"); 21933 themeColorsExport.baseContent = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base_content"); 21934 themeColorsExport.onBaseContent = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors.base_content"); 21935 const themeFontsExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts"); 21936 themeFontsExport.titleFont = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts.title_font"); 21937 themeFontsExport.onTitleFont = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts.title_font"); 21938 themeFontsExport.textFont = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts.text_font"); 21939 themeFontsExport.onTextFont = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts.text_font");
vendor: 6,577 bytes, lines 21940-22062
21940 const themeExtrasExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".extras"); 21941 themeExtrasExport.enableBorderRadius = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".extras.enable_border_radius"); 21942 themeExtrasExport.onEnableBorderRadius = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".extras.enable_border_radius"); 21943 const themeExport = bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme); 21944 themeExport.colors = themeColorsExport; 21945 themeExport.onColors = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".colors"); 21946 themeExport.logos = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".logos"); 21947 themeExport.onLogos = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".logos"); 21948 themeExport.banners = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".banners"); 21949 themeExport.onBanners = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".banners"); 21950 themeExport.fonts = themeFontsExport; 21951 themeExport.onFonts = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".fonts"); 21952 themeExport.tickets = () => bind$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".tickets"); 21953 themeExport.onTickets = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".tickets"); 21954 themeExport.extras = themeExtrasExport; 21955 themeExport.onExtras = () => onAssign$1(dpKeys$1.Settings + "." + dpKeys$1.Theme + ".extras"); 21956 var __decorate$u = function(decorators, target, key, desc) { 21957 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 21958 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 21959 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; 21960 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 21961 }; 21962 const tagName$2l = "sonic-submit"; 21963 let Submit = class Submit extends Subscriber$1(i$6) { 21964 constructor() { 21965 super(...arguments); 21966 this.submitResultKey = null; 21967 this.disabled = false; 21968 this.endPoint = null; 21969 this.name = ""; 21970 this.value = ""; 21971 this.api = null; 21972 this.clickTimeStamp = 0; 21973 this.submit = async (e2) => { 21974 if (this.disabled) 21975 return; 21976 if (e2 instanceof KeyboardEvent && !(e2.key === "Enter")) 21977 return; 21978 if (e2 instanceof MouseEvent) { 21979 e2.stopPropagation(); 21980 } 21981 const formPublisher = PublisherManager.getInstance().get(this.getAncestorAttributeValue("formDataProvider")); 21982 formPublisher.isFormValid.set(true); 21983 formPublisher.invalidateForm(); 21984 if (!formPublisher.isFormValid.get()) 21985 return; 21986 this.disabled = true; 21987 Loader.show(); 21988 formPublisher.isFormValid; 21989 const native = this.hasAttribute("native"); 21990 if (native) { 21991 this.submitNativeForm(); 21992 Loader.hide(); 21993 this.disabled = false; 21994 return; 21995 } 21996 const method = this.getAttribute("method")?.toLocaleLowerCase() || "post"; 21997 const sendAsFormData = this.hasAttribute("sendAsFormData"); 21998 const formData = formPublisher.get(); 21999 delete formData.isFormValid; 22000 const headesDataProvider = this.getAncestorAttributeValue("headersDataProvider"); 22001 const headerPublisher = headesDataProvider ? PublisherManager.getInstance().get(headesDataProvider) : null; 22002 let headerData = {}; 22003 if (headerPublisher) 22004 headerData = headerPublisher.get(); 22005 let result = null; 22006 const dataProvider = this.getAncestorAttributeValue("dataProvider"); 22007 const endPoint = this.endPoint || dataProvider; 22008 const sendData = async () => { 22009 const dataToSend = { ...formData }; 22010 delete dataToSend.needsCaptchaValidation; 22011 delete headerData.needsCaptchaValidation; 22012 if (sendAsFormData) { 22013 result = await this.api?.submitFormData(endPoint, dataToSend, method, headerData); 22014 } else { 22015 switch (method) { 22016 case "put": 22017 result = await this.api?.put(endPoint, dataToSend, headerData); 22018 break; 22019 case "patch": 22020 result = await this.api?.patch(endPoint, dataToSend, headerData); 22021 break; 22022 case "delete": 22023 result = await this.api?.delete(endPoint, dataToSend, headerData); 22024 break; 22025 case "get": 22026 const params = new URLSearchParams(); 22027 if (dataToSend) { 22028 for (const key in dataToSend) { 22029 params.append(key, dataToSend[key]); 22030 } 22031 } 22032 const paramString = "?" + params.toString(); 22033 result = await this.api?.get(endPoint + paramString, headerData); 22034 break; 22035 default: 22036 result = await this.api?.post(endPoint, dataToSend, headerData); 22037 break; 22038 } 22039 } 22040 Loader.hide(); 22041 if (!result) 22042 result = { 22043 messages: [{ content: "Network Error", status: "error" }] 22044 }; 22045 else if (result._sonic_http_response_ && !result._sonic_http_response_.ok && Object.keys(result).length === 1) 22046 result.messages = [{ content: "Network Error", status: "error" }]; 22047 const clearedDataProvider = this.getAncestorAttributeValue("clearedDataOnSuccess"); 22048 if (clearedDataProvider) { 22049 clearedDataProvider.split(" ").forEach((dataProvider2) => PublisherManager.get(dataProvider2).set({})); 22050 } 22051 const username_key = this.hasAttribute("usernameKey") ? this.getAttribute("usernameKey") : "username"; 22052 const password_key = this.hasAttribute("passwordKey") ? this.getAttribute("passwordKey") : "password"; 22053 if (this.api?.lastResult?.ok && dataToSend[username_key] && dataToSend[password_key]) { 22054 this.saveCredentials(dataToSend[username_key], dataToSend[password_key]); 22055 } 22056 if (this.submitResultKey) { 22057 result = Objects$1.traverse(result, this.submitResultKey.split("."), true); 22058 } 22059 const submitResultDataProvider = this.getAncestorAttributeValue("submitResultDataProvider"); 22060 if (submitResultDataProvider) 22061 PublisherManager.get(submitResultDataProvider).set(result); 22062 this.disabled = false;
22063 this.dispatchEvent(new CustomEvent("submit", { 22064 detail: result, 22065 bubbles: true, 22066 composed: true 22067 })); 22068 }; 22069 const captchaPublisher = ( 22070 // TODO Comprendre pourquoi header publisher 22071 headerPublisher?.needsCaptchaValidation.get() ? headerPublisher : formPublisher.needsCaptchaValidation.get() ? formPublisher : null 22072 ); 22073 if (captchaPublisher) { 22074 captchaPublisher.captchaToken.set("request_token"); 22075 const captchaAssign = (token) => { 22076 if (token != "request_token") { 22077 sendData(); 22078 captchaPublisher.captchaToken.offAssign(captchaAssign); 22079 } else { 22080 Loader.hide(); 22081 this.disabled = false; 22082 } 22083 }; 22084 captchaPublisher.captchaToken.onAssign(captchaAssign); 22085 } else { 22086 sendData(); 22087 } 22088 }; 22089 } 22090 connectedCallback() { 22091 if (this.hasAttribute("onClick")) { 22092 this.addEventListener("click", this.submit); 22093 } 22094 if (this.hasAttribute("onEnterKey")) { 22095 this.addEventListener("keydown", this.submit); 22096 } 22097 super.connectedCallback(); 22098 this.api = new API(this.getApiConfiguration()); 22099 } 22100 submitNativeForm() { 22101 const form2 = HTML.getClosestForm(this); 22102 if (!form2) 22103 return; 22104 const formDataProvider = this.getAncestorAttributeValue("formDataProvider"); 22105 const dataToSend = { ...PublisherManager.get(formDataProvider).get() }; 22106 delete dataToSend.needsCaptchaValidation; 22107 for (const name in dataToSend) { 22108 if (name == "isFormValid") 22109 continue; 22110 let control = form2.querySelector('input[name="' + name + '"], select[name="' + name + '"], textarea[name="' + name + '"]'); 22111 if (!control) { 22112 control = document.createElement("input"); 22113 control.type = "hidden"; 22114 control.name = name; 22115 form2.appendChild(control); 22116 } 22117 let value = dataToSend[name]; 22118 if (Array.isArray(value)) 22119 value = value.join(","); 22120 if (control.type === "checkbox" || control.type === "radio") { 22121 if (value) 22122 control.checked = true; 22123 } else { 22124 control.value = value; 22125 } 22126 } 22127 const submitButton = document.createElement("input"); 22128 submitButton.name = this.name; 22129 submitButton.style.display = "none"; 22130 submitButton.value = this.value; 22131 submitButton.type = "submit"; 22132 form2.appendChild(submitButton); 22133 if (submitButton) 22134 submitButton.click(); 22135 } 22136 async saveCredentials(username, password2) { 22137 if ("PasswordCredential" in window) { 22138 const credential = new window.PasswordCredential({ 22139 id: username, 22140 // name: "Carina Anand", // In case of a login, the name comes from the server. 22141 password: password2 22142 }); 22143 await navigator.credentials.store(credential); 22144 } 22145 } 22146 render() { 22147 return b$1`<div ?data-disabled=${this.disabled}><slot></slot></div>`; 22148 } 22149 }; 22150 Submit.styles = i$9` 22151 [data-disabled] { 22152 opacity: 0.3; 22153 pointer-events: none; 22154 user-select: none; 22155 } 22156 `; 22157 __decorate$u([ 22158 n$5({ type: String }) 22159 ], Submit.prototype, "submitResultKey", void 0); 22160 __decorate$u([ 22161 n$5({ type: Boolean }) 22162 ], Submit.prototype, "disabled", void 0); 22163 __decorate$u([ 22164 n$5({ type: String }) 22165 ], Submit.prototype, "endPoint", void 0); 22166 __decorate$u([ 22167 n$5() 22168 ], Submit.prototype, "name", void 0); 22169 __decorate$u([ 22170 n$5() 22171 ], Submit.prototype, "value", void 0); 22172 Submit = __decorate$u([ 22173 t$3(tagName$2l) 22174 ], Submit); 22175 var __decorate$t = function(decorators, target, key, desc) { 22176 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 22177 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 22178 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; 22179 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 22180 }; 22181 const tagName$2k = "sonic-progress"; 22182 let Progress = class Progress extends i$6 { 22183 constructor() { 22184 super(...arguments); 22185 this.max = 100; 22186 this.invert = false;
22187 this.type = "default"; 22188 } 22189 render() { 22190 return b$1` 22191 <progress value=${o$4(this.value)} max=${this.max}></progress> 22192 <div class="slot-container"> 22193 <slot></slot> 22194 <slot name="remaining"></slot> 22195 </div> 22196 `; 22197 } 22198 }; 22199 Progress.styles = [ 22200 fontSize, 22201 i$9` 22202 :host { 22203 --sc-progress-bg: var( 22204 --sc-input-bg, 22205 var(--sc-base-100, rgba(0, 0, 0, 0.07)) 22206 ); 22207 --sc-progress-color: var(--sc-base-content, #000); 22208 --sc-progress-height: 0.6em; 22209 --sc-progress-fs: var(--sc-_fs, 1rem); 22210 --sc-progress-fw: 500; 22211 --sc-progress-rounded: var(--sc-rounded-lg); 22212 display: block; 22213 line-height: 1.2; 22214 font-weight: var(--sc-progress-fw); 22215 font-size: var(--sc-progress-fs); 22216 } 22217 22218 progress { 22219 display: block; 22220 position: relative; 22221 width: 100%; 22222 -webkit-appearance: none; 22223 appearance: none; 22224 overflow: hidden; 22225 border: none; 22226 height: var(--sc-progress-height); 22227 border-radius: var(--sc-progress-rounded); 22228 background-color: var(--sc-progress-bg); 22229 color: var(--sc-progress-color); 22230 } 22231 progress::-moz-progress-bar { 22232 background-color: var(--sc-progress-color); 22233 border-radius: var(--sc-progress-rounded); 22234 } 22235 22236 progress:not([value])::-moz-progress-bar { 22237 background-color: var(--sc-progress-bg); 22238 } 22239 22240 progress::-webkit-progress-bar { 22241 background-color: var(--sc-progress-bg); 22242 } 22243 progress::-webkit-progress-value { 22244 background-color: var(--sc-progress-color); 22245 border-radius: var(--sc-progress-rounded); 22246 } 22247 22248 /* Indeterminate */ 22249 progress:indeterminate:after { 22250 background-color: var(--sc-progress-color); 22251 content: ""; 22252 position: absolute; 22253 top: 0; 22254 bottom: 0; 22255 left: -40%; 22256 width: 33.333333%; 22257 border-radius: var(--sc-progress-rounded); 22258 animation: progress-loading 3s infinite ease-in-out; 22259 } 22260 22261 @keyframes progress-loading { 22262 50% { 22263 left: 107%; 22264 } 22265 } 22266 22267 /* COLOR TYPES */ 22268 :host([type="warning"]) { 22269 --sc-progress-color: var(--sc-warning, var(--sc-base-content, #000)); 22270 } 22271 :host([type="danger"]) { 22272 --sc-progress-color: var(--sc-danger, var(--sc-base-content, #000)); 22273 } 22274 :host([type="info"]) { 22275 --sc-progress-color: var(--sc-info, var(--sc-base-content, #000)); 22276 } 22277 :host([type="success"]) { 22278 --sc-progress-color: var(--sc-success, var(--sc-base-content, #000)); 22279 } 22280 22281 :host([type="invert"]) { 22282 --sc-progress-bg: rgba(190, 190, 190, 0.125); 22283 --sc-progress-color: var(--sc-base, #fff); 22284 } 22285 22286 :host([invert]) { 22287 --sc-progress-bg: rgba(190, 190, 190, 0.125); 22288 } 22289 22290 :host([type="default"][invert]) { 22291 --sc-progress-color: var(--sc-base, #fff); 22292 } 22293 22294 slot[name="remaining"] { 22295 font-weight: var(--sc-font-weight-base, 400); 22296 font-size: 0.85em; 22297 margin-top: 0.5em; 22298 } 22299 slot[name="remaining"]::slotted(*) { 22300 margin-left: auto; 22301 } 22302 22303 slot:not([name]) { 22304 color: var(--sc-progress-color); 22305 } 22306 22307 .slot-container { 22308 display: flex; 22309 justify-content: space-between; 22310 gap: 0.5em; 22311 margin-top: 0.15em; 22312 } 22313 ` 22314 ]; 22315 __decorate$t([ 22316 n$5({ type: Number }) 22317 ], Progress.prototype, "value", void 0); 22318 __decorate$t([ 22319 n$5({ type: Number }) 22320 ], Progress.prototype, "max", void 0); 22321 __decorate$t([ 22322 n$5({ type: Boolean }) 22323 ], Progress.prototype, "invert", void 0); 22324 __decorate$t([ 22325 n$5({ type: String, reflect: true }) 22326 ], Progress.prototype, "type", void 0); 22327 __decorate$t([ 22328 n$5({ type: String, reflect: true }) 22329 ], Progress.prototype, "size", void 0); 22330 Progress = __decorate$t([ 22331 t$3(tagName$2k) 22332 ], Progress); 22333 var endpoints$1 = /* @__PURE__ */ ((endpoints2) => { 22334 endpoints2["SessionQueueAuthorised"] = "queue/authorized"; 22335 endpoints2["SessionQueueConfig"] = "queue/front/config"; 22336 endpoints2["SessionQueue"] = "queue/session"; 22337 return endpoints2; 22338 })(endpoints$1 || {}); 22339 var dpKeys = /* @__PURE__ */ ((dpKeys2) => { 22340 dpKeys2["SessionQueue"] = "sessionQueue"; 22341 dpKeys2["SessionQueueAuthorised"] = "sessionQueueAuthorised"; 22342 dpKeys2["SessionQueueConfig"] = "sessionQueueConfig"; 22343 dpKeys2["IdleStatus"] = "idleStatus"; 22344 return dpKeys2; 22345 })(dpKeys || {}); 22346 const sessionQueueAuthorised$1 = dp$1( 22347 "sessionQueueAuthorised" 22348 /* SessionQueueAuthorised */ 22349 ); 22350 const sessionQueueConfig$1 = dp$1( 22351 "sessionQueueConfig" 22352 /* SessionQueueConfig */ 22353 ); 22354 const idleStatus$2 = dp$1( 22355 "idleStatus" 22356 /* IdleStatus */ 22357 );
22358 const sessionQueueAuthorisedExport = bind$1(dpKeys.SessionQueueAuthorised); 22359 sessionQueueAuthorisedExport.authorized = () => bind$1(dpKeys.SessionQueueAuthorised + ".authorized"); 22360 sessionQueueAuthorisedExport.onAuthorized = () => onAssign$1(dpKeys.SessionQueueAuthorised + ".authorized"); 22361 sessionQueueAuthorisedExport.redirection = () => bind$1(dpKeys.SessionQueueAuthorised + ".redirection"); 22362 sessionQueueAuthorisedExport.onRedirection = () => onAssign$1(dpKeys.SessionQueueAuthorised + ".redirection"); 22363 sessionQueueAuthorisedExport.token = () => bind$1(dpKeys.SessionQueueAuthorised + ".token"); 22364 sessionQueueAuthorisedExport.onToken = () => onAssign$1(dpKeys.SessionQueueAuthorised + ".token"); 22365 const sessionQueueAuthorised = sessionQueueAuthorisedExport; 22366 const onSessionQueueAuthorised = () => onAssign$1(dpKeys.SessionQueueAuthorised); 22367 const stillHereExport = bind$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere"); 22368 stillHereExport.show = () => bind$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere.show"); 22369 stillHereExport.onShow = () => onAssign$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere.show"); 22370 stillHereExport.countdownMs = () => bind$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere.countdownMs"); 22371 stillHereExport.onCountdownMs = () => onAssign$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere.countdownMs"); 22372 const onInactivityExport = bind$1(dpKeys.SessionQueueConfig + ".onInactivity"); 22373 onInactivityExport.stillHere = stillHereExport; 22374 onInactivityExport.onStillHere = () => onAssign$1(dpKeys.SessionQueueConfig + ".onInactivity.stillHere"); 22375 onInactivityExport.thresholdMs = () => bind$1(dpKeys.SessionQueueConfig + ".onInactivity.thresholdMs"); 22376 onInactivityExport.onThresholdMs = () => onAssign$1(dpKeys.SessionQueueConfig + ".onInactivity.thresholdMs"); 22377 const sessionQueueConfigExport = bind$1(dpKeys.SessionQueueConfig); 22378 sessionQueueConfigExport.onInactivity = onInactivityExport; 22379 sessionQueueConfigExport.ononInactivity = () => onAssign$1(dpKeys.SessionQueueConfig + ".onInactivity"); 22380 const sessionQueueConfig = sessionQueueConfigExport; 22381 const onSessionQueueConfig = () => onAssign$1(dpKeys.SessionQueueConfig); 22382 const idleStatusExport$1 = bind$1(dpKeys.IdleStatus); 22383 idleStatusExport$1.isIdle = () => bind$1(dpKeys.IdleStatus + ".isIdle"); 22384 idleStatusExport$1.onIsIdle = () => onAssign$1(dpKeys.IdleStatus + ".isIdle"); 22385 idleStatusExport$1.ratioBeforeSessionDelete = () => bind$1(dpKeys.IdleStatus + ".ratioBeforeSessionDelete"); 22386 idleStatusExport$1.onRatioBeforeSessionDelete = () => onAssign$1(dpKeys.IdleStatus + ".ratioBeforeSessionDelete"); 22387 idleStatusExport$1.sessionDeleteProgressType = () => bind$1(dpKeys.IdleStatus + ".sessionDeleteProgressType"); 22388 idleStatusExport$1.onSessionDeleteProgressType = () => onAssign$1(dpKeys.IdleStatus + ".sessionDeleteProgressType"); 22389 idleStatusExport$1.timeSinceLastInteractionMs = () => bind$1(dpKeys.IdleStatus + ".timeSinceLastInteractionMs"); 22390 idleStatusExport$1.onTimeSinceLastInteractionMs = () => onAssign$1(dpKeys.IdleStatus + ".timeSinceLastInteractionMs"); 22391 const idleStatus$1 = idleStatusExport$1; 22392 const idleStatusExport = { 22393 isIdle: () => subscribe(`${dpKeys.IdleStatus}.isIdle`), 22394 ratioBeforeSessionDelete: () => subscribe(`${dpKeys.IdleStatus}.ratioBeforeSessionDelete`), 22395 sessionDeleteProgressType: () => subscribe(`${dpKeys.IdleStatus}.sessionDeleteProgressType`) 22396 }; 22397 const idleStatus = idleStatusExport; 22398 const queueSession = { 22399 dpKeys, 22400 authorised: { 22401 dp: sessionQueueAuthorised$1, 22402 bind: sessionQueueAuthorised, 22403 onAssign: onSessionQueueAuthorised 22404 }, 22405 config: { 22406 dp: sessionQueueConfig$1, 22407 bind: sessionQueueConfig, 22408 onAssign: onSessionQueueConfig 22409 }, 22410 idle: { 22411 dp: idleStatus$2, 22412 bind: idleStatus$1, 22413 subscribe: idleStatus 22414 } 22415 }; 22416 const queueTokenHeaderName = "Sonic-Queue-Token"; 22417 const getEmbeddedToken = () => { 22418 const params = new URLSearchParams(document.location.search); 22419 const urlToken = params.get(queueTokenHeaderName); 22420 if (urlToken) { 22421 return urlToken; 22422 } 22423 const headers = document.head.querySelectorAll(`meta[name='${queueTokenHeaderName}']`); 22424 if (headers.length > 0) { 22425 return headers[0].getAttribute("content"); 22426 } 22427 return null; 22428 }; 22429 const reloadWithoutTokenInURL = () => { 22430 const params = new URLSearchParams(document.location.search); 22431 params.delete(queueTokenHeaderName); 22432 window.location.href = window.location.pathname + "?" + params.toString(); 22433 }; 22434 const expiredParamName = "queue-session-expired"; 22435 function clearExpiredQueueSessionFromLocation() { 22436 const params = new URLSearchParams(document.location.search); 22437 if (!params.has(expiredParamName)) { 22438 return; 22439 } 22440 localStorage.removeItem(queueTokenHeaderName); 22441 params.delete(expiredParamName); 22442 const url = new URL(window.location.href); 22443 url.search = params.toString(); 22444 history.replaceState(null, "", url.toString()); 22445 } 22446 const isCheckoutEnd = () => { 22447 const matches = appRoute("checkout.end").withoutQuery().matchesCurrentPath();
22448 const urlParams = new URLSearchParams(window.location.search); 22449 const hasSonicPurchaseId = (urlParams.get("sonic_purchase_id") || "") !== ""; 22450 const hasSonicTo = (urlParams.get("sonic_to") || "").trim() === "checkout.end"; 22451 return matches && hasSonicPurchaseId || hasSonicTo; 22452 }; 22453 const DEFAULT_DELETE_SESSION_DELAY_MS = 3e4; 22454 const COUNTDOWN_TICK_MS = 100; 22455 function progressTypeFromRatio(ratio) { 22456 if (ratio > 66) { 22457 return ""; 22458 } 22459 if (ratio > 33) { 22460 return "warning"; 22461 } 22462 return "danger"; 22463 } 22464 function createInactivitySessionCountdown(options) { 22465 let intervalId; 22466 let startTime; 22467 function stop() { 22468 if (intervalId !== void 0) { 22469 clearInterval(intervalId); 22470 intervalId = void 0; 22471 } 22472 startTime = void 0; 22473 } 22474 function start() { 22475 stop(); 22476 queueSession.idle.dp.ratioBeforeSessionDelete.set(100); 22477 queueSession.idle.dp.sessionDeleteProgressType.set("success"); 22478 startTime = Date.now(); 22479 intervalId = window.setInterval(() => { 22480 if (startTime === void 0) { 22481 return; 22482 } 22483 const elapsed = Date.now() - startTime; 22484 let delayMs = options.getDelayMs(); 22485 if (typeof delayMs !== "number") { 22486 delayMs = DEFAULT_DELETE_SESSION_DELAY_MS; 22487 } 22488 const ratio = Math.max(0, 100 - elapsed / delayMs * 100); 22489 queueSession.idle.dp.ratioBeforeSessionDelete.set(ratio); 22490 if (ratio <= 0) { 22491 stop(); 22492 options.onElapsed(); 22493 } 22494 }, COUNTDOWN_TICK_MS); 22495 } 22496 return { start, stop }; 22497 } 22498 async function deleteInactiveQueueSession(host) { 22499 try { 22500 const apiConfiguration = HTML$1.getApiConfiguration(host); 22501 const headersDataProvider = HTML$1.getAncestorAttributeValue(host, "headersDataProvider"); 22502 const headers = { ...dp(headersDataProvider).get() }; 22503 const api2 = new API(apiConfiguration); 22504 await api2.delete(endpoints$1.SessionQueue, {}, headers); 22505 } catch (error) { 22506 console.debug("Error deleting session:", error); 22507 } 22508 queueSession.authorised.dp.token.set(""); 22509 } 22510 var __defProp$3w = Object.defineProperty; 22511 var __getOwnPropDesc$3z = Object.getOwnPropertyDescriptor; 22512 var __decorateClass$3A = (decorators, target, key, kind) => { 22513 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3z(target, key) : target; 22514 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 22515 if (decorator = decorators[i2]) 22516 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 22517 if (kind && result) __defProp$3w(target, key, result); 22518 return result; 22519 }; 22520 const tagName$2j = "sonic-inactivity-detected"; 22521 const ratioBeforeSessionDelete = queueSession.idle.subscribe.ratioBeforeSessionDelete(); 22522 const sessionDeleteProgressType = queueSession.idle.subscribe.sessionDeleteProgressType(); 22523 let SonicInactivityDetected = class extends i$6 { 22524 constructor() { 22525 super(...arguments); 22526 this.deleteSessionDelayMs = DEFAULT_DELETE_SESSION_DELAY_MS; 22527 this.showReloadButton = false; 22528 this.isModalVisible = false; 22529 this.isIdle = false; 22530 this.headersDataProvider = null; 22531 this.countdown = createInactivitySessionCountdown({ 22532 getDelayMs: () => this.deleteSessionDelayMs, 22533 onElapsed: () => { 22534 void this.onCountdownElapsed(); 22535 } 22536 }); 22537 this.reload = () => { 22538 const embeddedToken = getEmbeddedToken(); 22539 if (embeddedToken !== null) { 22540 reloadWithoutTokenInURL(); 22541 } else { 22542 queueSession.authorised.dp.invalidate(); 22543 this.resetCountDown(); 22544 } 22545 this.hideModal(); 22546 }; 22547 } 22548 onIsIdleChange(isIdle) { 22549 if (isIdle) { 22550 queueSession.config.dp.invalidate(); 22551 } else { 22552 queueSession.config.dp.onInactivity.stillHere.show.set(false); 22553 } 22554 } 22555 onSessionQueueConfigChange(config) { 22556 if (config.onInactivity.stillHere.show == false) { 22557 this.resetCountDown(); 22558 } 22559 } 22560 onRatioChange(ratio) { 22561 queueSession.idle.dp.sessionDeleteProgressType.set(progressTypeFromRatio(ratio)); 22562 } 22563 onStillHereShowChange(show, isIdle) { 22564 if (show === true && isIdle === true) { 22565 this.showModal(); 22566 } else { 22567 this.hideModal(); 22568 } 22569 } 22570 connectedCallback() { 22571 this.headersDataProvider = HTML$1.getAncestorAttributeValue(this, "headersDataProvider"); 22572 super.connectedCallback(); 22573 } 22574 disconnectedCallback() { 22575 super.disconnectedCallback(); 22576 this.countdown.stop(); 22577 this.hideModal(); 22578 } 22579 showModal() { 22580 if (this.isModalVisible) { 22581 return; 22582 } 22583 this.isModalVisible = true; 22584 this.showReloadButton = false;
22585 this.countdown.start(); 22586 } 22587 hideModal() { 22588 this.isModalVisible = false; 22589 } 22590 resetCountDown() { 22591 this.countdown.stop(); 22592 queueSession.idle.dp.isIdle.set(false); 22593 queueSession.config.dp.onInactivity.stillHere.show.set(false); 22594 this.hideModal(); 22595 } 22596 async onCountdownElapsed() { 22597 await deleteInactiveQueueSession(this); 22598 this.showReloadButton = true; 22599 } 22600 getModalContent() { 22601 if (this.showReloadButton) { 22602 return A$1; 22603 } 22604 return b$1`<sonic-progress 22605 type="${sessionDeleteProgressType}" 22606 value="${ratioBeforeSessionDelete}" 22607 max="100" 22608 ></sonic-progress>`; 22609 } 22610 getModalActions() { 22611 if (this.showReloadButton) { 22612 return b$1`<sonic-button type="success" @click=${this.reload}> 22613 <sonic-icon library="custom" slot="prefix" name="arrows-rotate"></sonic-icon> 22614 ${t("waiting_line_expired_btn")} 22615 </sonic-button>`; 22616 } 22617 return b$1`<sonic-submit 22618 endpoint=${endpoints$1.SessionQueue} 22619 method="patch" 22620 onClick 22621 @click=${() => this.resetCountDown()} 22622 > 22623 <sonic-button type="success"> 22624 <sonic-icon library="custom" slot="prefix" name="thumbs-up"></sonic-icon> 22625 ${t("inactivity_modal_confirm")} 22626 </sonic-button> 22627 </sonic-submit>`; 22628 } 22629 render() { 22630 if (this.isIdle) { 22631 return b$1` 22632 <sonic-fetch 22633 endpoint=${endpoints$1.SessionQueueConfig} 22634 dataProvider=${queueSession.dpKeys.SessionQueueConfig} 22635 key="data" 22636 ></sonic-fetch> 22637 <sonic-modal 22638 zIndex="1000" 22639 headersDataProvider=${this.headersDataProvider} 22640 ?visible=${this.isModalVisible} 22641 maxWidth="32rem" 22642 forceAction 22643 > 22644 <sonic-modal-title 22645 ><sonic-icon 22646 library="custom" 22647 name=${this.showReloadButton ? "face-grimace" : "clock-rotate-left"} 22648 ></sonic-icon> 22649 ${t(this.showReloadButton ? "waiting_line_expired_title" : "inactivity_modal_title")} 22650 </sonic-modal-title> 22651 <sonic-modal-content>${this.getModalContent()}</sonic-modal-content> 22652 <sonic-modal-actions> ${this.getModalActions()} </sonic-modal-actions> 22653 </sonic-modal> 22654 `; 22655 } 22656 return A$1; 22657 } 22658 }; 22659 SonicInactivityDetected.styles = [tailwind]; 22660 __decorateClass$3A([ 22661 queueSession.config.bind.onInactivity.stillHere.countdownMs() 22662 ], SonicInactivityDetected.prototype, "deleteSessionDelayMs", 2); 22663 __decorateClass$3A([ 22664 r$5() 22665 ], SonicInactivityDetected.prototype, "showReloadButton", 2); 22666 __decorateClass$3A([ 22667 r$5() 22668 ], SonicInactivityDetected.prototype, "isModalVisible", 2); 22669 __decorateClass$3A([ 22670 queueSession.idle.bind.isIdle(), 22671 r$5() 22672 ], SonicInactivityDetected.prototype, "isIdle", 2); 22673 __decorateClass$3A([ 22674 queueSession.idle.bind.onIsIdle() 22675 ], SonicInactivityDetected.prototype, "onIsIdleChange", 1); 22676 __decorateClass$3A([ 22677 queueSession.config.onAssign() 22678 ], SonicInactivityDetected.prototype, "onSessionQueueConfigChange", 1); 22679 __decorateClass$3A([ 22680 queueSession.idle.bind.onRatioBeforeSessionDelete() 22681 ], SonicInactivityDetected.prototype, "onRatioChange", 1); 22682 __decorateClass$3A([ 22683 onAssign$1("sessionQueueConfig.onInactivity.stillHere.show", "idleStatus.isIdle") 22684 ], SonicInactivityDetected.prototype, "onStillHereShowChange", 1); 22685 SonicInactivityDetected = __decorateClass$3A([ 22686 t$3(tagName$2j) 22687 ], SonicInactivityDetected); 22688 var __defProp$3v = Object.defineProperty; 22689 var __getOwnPropDesc$3y = Object.getOwnPropertyDescriptor; 22690 var __decorateClass$3z = (decorators, target, key, kind) => { 22691 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3y(target, key) : target; 22692 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 22693 if (decorator = decorators[i2]) 22694 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 22695 if (kind && result) __defProp$3v(target, key, result); 22696 return result; 22697 }; 22698 const tagName$2i = "sonic-user-activity"; 22699 const DEFAULT_INACTIVITY_THRESHOLD_MS = 3e4; 22700 queueSession.idle.dp.isIdle.set(false); 22701 queueSession.idle.dp.ratioBeforeSessionDelete.set(100); 22702 queueSession.idle.dp.timeSinceLastInteractionMs.set(0); 22703 queueSession.config.dp.onInactivity.thresholdMs.set(DEFAULT_INACTIVITY_THRESHOLD_MS); 22704 let SonicUserActivity = class extends i$6 { 22705 constructor() { 22706 super(...arguments); 22707 this.inactivityThresholdMs = DEFAULT_INACTIVITY_THRESHOLD_MS; 22708 this.checkIntervalMs = 1e3; 22709 this.lastInteractionTime = Date.now(); 22710 this.location = ""; 22711 this.pendingCartMutation = false;
22712 this.handleCartMutation = () => { 22713 if (this.pendingCartMutation) return; 22714 this.pendingCartMutation = true; 22715 this.rafId = requestAnimationFrame(() => { 22716 this.pendingCartMutation = false; 22717 this.rafId = void 0; 22718 this.initializeDataProvider(); 22719 }); 22720 }; 22721 } 22722 onIsIdleChange(isIdle) { 22723 if (!isIdle) { 22724 this.lastInteractionTime = Date.now(); 22725 queueSession.idle.dp.timeSinceLastInteractionMs.set(0); 22726 } 22727 } 22728 onTimeSinceLastInteractionMsChange(_timeSinceLastInteraction) { 22729 this.updateRatioBeforeIdle(); 22730 } 22731 updateRatioBeforeIdle() { 22732 let inactivityThresholdMs = queueSession.config.dp.onInactivity.thresholdMs.get(); 22733 if (typeof inactivityThresholdMs !== "number") { 22734 inactivityThresholdMs = DEFAULT_INACTIVITY_THRESHOLD_MS; 22735 } 22736 const timeSinceLastInteractionMs = queueSession.idle.dp.timeSinceLastInteractionMs.get(); 22737 queueSession.idle.dp.ratioBeforeIdle.set( 22738 inactivityThresholdMs > 0 ? timeSinceLastInteractionMs / inactivityThresholdMs : 0 22739 ); 22740 } 22741 connectedCallback() { 22742 super.connectedCallback(); 22743 this.initializeDataProvider(); 22744 this.startTracking(); 22745 this.startChecking(); 22746 } 22747 disconnectedCallback() { 22748 super.disconnectedCallback(); 22749 this.stopTracking(); 22750 this.stopChecking(); 22751 } 22752 /** 22753 * Initialise le data provider avec les valeurs par défaut 22754 */ 22755 initializeDataProvider() { 22756 this.lastInteractionTime = Date.now(); 22757 queueSession.idle.dp.isIdle.set(false); 22758 queueSession.idle.dp.timeSinceLastInteractionMs.set(0); 22759 queueSession.idle.dp.ratioBeforeIdle.set(0); 22760 } 22761 /** 22762 * Démarre le suivi des interactions utilisateur 22763 */ 22764 startTracking() { 22765 LocationHandler$1.onChange(this); 22766 const cartProvider = HTML$1.getAncestorAttributeValue(this, "cartProvider"); 22767 if (cartProvider) { 22768 this.cartProvider = cartProvider || void 0; 22769 dp(cartProvider).onInternalMutation(this.handleCartMutation); 22770 } 22771 } 22772 /** 22773 * Arrête le suivi des interactions utilisateur 22774 */ 22775 stopTracking() { 22776 LocationHandler$1.offChange(this); 22777 if (this.cartProvider) { 22778 dp(this.cartProvider).offInternalMutation(this.handleCartMutation); 22779 } 22780 if (this.rafId !== void 0) { 22781 cancelAnimationFrame(this.rafId); 22782 this.rafId = void 0; 22783 } 22784 } 22785 /** 22786 * Démarre la vérification périodique de l'inactivité 22787 */ 22788 startChecking() { 22789 this.checkIntervalId = window.setInterval(() => this.checkInactivity(), this.checkIntervalMs); 22790 } 22791 /** 22792 * Arrête la vérification périodique 22793 */ 22794 stopChecking() { 22795 if (this.checkIntervalId) { 22796 clearInterval(this.checkIntervalId); 22797 this.checkIntervalId = void 0; 22798 } 22799 } 22800 /** 22801 * Vérifie l'état d'inactivité et met à jour le data provider 22802 */ 22803 checkInactivity() { 22804 const timeSinceLastInteraction = Date.now() - this.lastInteractionTime; 22805 queueSession.idle.dp.timeSinceLastInteractionMs.set(timeSinceLastInteraction); 22806 queueSession.idle.dp.isIdle.set(timeSinceLastInteraction >= this.inactivityThresholdMs); 22807 } 22808 willUpdate(changedProperties) { 22809 super.willUpdate(changedProperties); 22810 if (changedProperties.has("location")) { 22811 this.initializeDataProvider(); 22812 } 22813 if (changedProperties.has("inactivityThresholdMs")) { 22814 if (typeof this.inactivityThresholdMs !== "number") { 22815 this.inactivityThresholdMs = DEFAULT_INACTIVITY_THRESHOLD_MS; 22816 } 22817 queueSession.config.dp.onInactivity.thresholdMs.set(this.inactivityThresholdMs); 22818 } 22819 } 22820 render() { 22821 return b$1`<sonic-inactivity-detected></sonic-inactivity-detected>`; 22822 } 22823 }; 22824 SonicUserActivity.styles = [tailwind]; 22825 __decorateClass$3z([ 22826 queueSession.config.bind.onInactivity.thresholdMs(), 22827 n$5({ type: Number }) 22828 ], SonicUserActivity.prototype, "inactivityThresholdMs", 2); 22829 __decorateClass$3z([ 22830 n$5({ type: Number }) 22831 ], SonicUserActivity.prototype, "checkIntervalMs", 2); 22832 __decorateClass$3z([ 22833 r$5() 22834 ], SonicUserActivity.prototype, "lastInteractionTime", 2); 22835 __decorateClass$3z([ 22836 r$5() 22837 ], SonicUserActivity.prototype, "location", 2); 22838 __decorateClass$3z([ 22839 queueSession.idle.bind.onIsIdle() 22840 ], SonicUserActivity.prototype, "onIsIdleChange", 1); 22841 __decorateClass$3z([ 22842 queueSession.idle.bind.onTimeSinceLastInteractionMs() 22843 ], SonicUserActivity.prototype, "onTimeSinceLastInteractionMsChange", 1); 22844 SonicUserActivity = __decorateClass$3z([ 22845 t$3(tagName$2i) 22846 ], SonicUserActivity); 22847 var __getOwnPropDesc$3x = Object.getOwnPropertyDescriptor; 22848 var __decorateClass$3y = (decorators, target, key, kind) => { 22849 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3x(target, key) : target; 22850 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 22851 if (decorator = decorators[i2]) 22852 result = decorator(result) || result; 22853 return result; 22854 }; 22855 const tagName$2h = "sonic-user-leave"; 22856 let SonicUserLeave = class extends i$6 { 22857 constructor() { 22858 super(...arguments); 22859 this.hasSentBeacon = false;
22860 this.isInternalNavigation = false; 22861 this.INTERNAL_NAV_TIMEOUT_MS = 1e3; 22862 this.handleLinkClick = (event) => { 22863 const composedPath = event.composedPath(); 22864 for (const element of composedPath) { 22865 if (element instanceof HTMLAnchorElement) { 22866 if (this.isSameSite(element.href)) { 22867 this.markInternalNavigation(); 22868 } 22869 } 22870 } 22871 }; 22872 this.handleFormSubmit = (event) => { 22873 const form2 = event.target; 22874 if (form2 && form2.action) { 22875 if (this.isSameSite(form2.action)) { 22876 this.markInternalNavigation(); 22877 } 22878 } 22879 }; 22880 this.handlePopState = () => { 22881 this.markInternalNavigation(); 22882 }; 22883 this.handleBeforeUnload = () => { 22884 if (this.isInternalNavigation || document.visibilityState === "visible") { 22885 return; 22886 } 22887 this.sendLeaveBeacon(); 22888 }; 22889 } 22890 connectedCallback() { 22891 if (window.parent !== window) { 22892 return; 22893 } 22894 if (this.cleanupTimeoutId) { 22895 clearTimeout(this.cleanupTimeoutId); 22896 this.cleanupTimeoutId = void 0; 22897 } 22898 super.connectedCallback(); 22899 this.initializeAttributes(); 22900 this.setupLeaveDetection(); 22901 } 22902 disconnectedCallback() { 22903 super.disconnectedCallback(); 22904 this.cleanupTimeoutId = window.setTimeout(() => { 22905 this.cleanupLeaveDetection(); 22906 this.cleanupTimeoutId = void 0; 22907 }, 1e3); 22908 } 22909 /** 22910 * Initialise les attributs depuis les ancêtres 22911 */ 22912 initializeAttributes() { 22913 this.setAttribute("keepAlive", "true"); 22914 } 22915 /** 22916 * Vérifie si une URL est sur le même site que la page actuelle 22917 */ 22918 isSameSite(url) { 22919 try { 22920 const currentOrigin = window.location.origin; 22921 const targetUrl = new URL(url, window.location.href); 22922 return targetUrl.origin === currentOrigin; 22923 } catch { 22924 return false; 22925 } 22926 } 22927 /** 22928 * Marque qu'une navigation interne est en cours 22929 */ 22930 markInternalNavigation() { 22931 this.isInternalNavigation = true; 22932 if (this.internalNavigationTimeout) { 22933 clearTimeout(this.internalNavigationTimeout); 22934 } 22935 this.internalNavigationTimeout = window.setTimeout(() => { 22936 this.isInternalNavigation = false; 22937 }, this.INTERNAL_NAV_TIMEOUT_MS); 22938 } 22939 /** 22940 * Configure la détection de sortie de l'utilisateur via plusieurs événements 22941 */ 22942 setupLeaveDetection() { 22943 document.addEventListener("click", this.handleLinkClick, true); 22944 document.addEventListener("submit", this.handleFormSubmit, true); 22945 window.addEventListener("popstate", this.handlePopState); 22946 window.addEventListener("beforeunload", this.handleBeforeUnload); 22947 } 22948 /** 22949 * Nettoie les event listeners 22950 */ 22951 cleanupLeaveDetection() { 22952 if (this.cleanupTimeoutId) { 22953 clearTimeout(this.cleanupTimeoutId); 22954 this.cleanupTimeoutId = void 0; 22955 } 22956 document.removeEventListener("click", this.handleLinkClick, true); 22957 document.removeEventListener("submit", this.handleFormSubmit, true); 22958 window.removeEventListener("popstate", this.handlePopState); 22959 window.removeEventListener("beforeunload", this.handleBeforeUnload); 22960 if (this.internalNavigationTimeout) { 22961 clearTimeout(this.internalNavigationTimeout); 22962 } 22963 } 22964 /** 22965 * Envoie le beacon pour signaler que l'utilisateur a quitté 22966 */ 22967 async sendLeaveBeacon() { 22968 if (this.hasSentBeacon) { 22969 return; 22970 } 22971 this.hasSentBeacon = true; 22972 try { 22973 const apiConfiguration = HTML$1.getApiConfiguration(this); 22974 const headersDataProvider = HTML$1.getAncestorAttributeValue(this, "headersDataProvider"); 22975 const headers = { ...dp(headersDataProvider).get() }; 22976 const api2 = new API(apiConfiguration); 22977 await api2.delete(endpoints$1.SessionQueue, {}, headers); 22978 } catch (error) { 22979 console.debug("Erreur lors de l'envoi du beacon de sortie:", error); 22980 } 22981 } 22982 render() { 22983 return A$1; 22984 } 22985 }; 22986 SonicUserLeave.styles = [tailwind]; 22987 SonicUserLeave = __decorateClass$3y([ 22988 t$3(tagName$2h) 22989 ], SonicUserLeave); 22990 var __defProp$3u = Object.defineProperty; 22991 var __getOwnPropDesc$3w = Object.getOwnPropertyDescriptor; 22992 var __decorateClass$3x = (decorators, target, key, kind) => { 22993 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3w(target, key) : target; 22994 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 22995 if (decorator = decorators[i2]) 22996 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 22997 if (kind && result) __defProp$3u(target, key, result); 22998 return result; 22999 }; 23000 const tagName$2g = "sonic-stay-or-leave"; 23001 let SonicStayOrLeave = class extends i$6 { 23002 constructor() { 23003 super(...arguments); 23004 this.visible = false;
23005 this.stay = () => { 23006 this.visible = false; 23007 if (document.location.hash.toString().trim() === "#") { 23008 document.location.hash = ""; 23009 } else { 23010 document.location.hash = "#"; 23011 } 23012 }; 23013 } 23014 render() { 23015 return b$1` 23016 <sonic-modal ?visible=${this.visible} forceAction> 23017 <sonic-modal-title> 23018 <sonic-icon library="custom" name="flag"></sonic-icon> 23019 <span>${t("stay_or_leave_modal_title")}</span> 23020 </sonic-modal-title> 23021 <sonic-modal-content> 23022 <span>${t("stay_or_leave_modal_content", true)}</span> 23023 </sonic-modal-content> 23024 <sonic-modal-actions> 23025 <sonic-button type="primary" @click=${this.stay}> 23026 <sonic-icon library="custom" slot="prefix" name="arrows-rotate"></sonic-icon> 23027 ${t("stay_or_leave_modal_btn_stay")}</sonic-button 23028 > 23029 </sonic-modal-actions> 23030 </sonic-modal> 23031 `; 23032 } 23033 }; 23034 SonicStayOrLeave.styles = [tailwind]; 23035 __decorateClass$3x([ 23036 n$5({ type: Boolean }) 23037 ], SonicStayOrLeave.prototype, "visible", 2); 23038 SonicStayOrLeave = __decorateClass$3x([ 23039 t$3(tagName$2g) 23040 ], SonicStayOrLeave); 23041 const TITLE_KEY = "waiting_line_error_title"; 23042 const CONTENT_KEY = "waiting_line_error_content"; 23043 const WORDING_PATHS = { 23044 [TITLE_KEY]: "sonic-wording.wording_waiting_line_error_title", 23045 [CONTENT_KEY]: "sonic-wording.wording_waiting_line_error_content" 23046 }; 23047 const ERROR_WORDING_KEYS = [TITLE_KEY, CONTENT_KEY]; 23048 const FALLBACKS = { 23049 fr: { 23050 [TITLE_KEY]: "Accès temporairement restreint", 23051 [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." 23052 }, 23053 en: { 23054 [TITLE_KEY]: "Access temporarily restricted", 23055 [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." 23056 }, 23057 de: { 23058 [TITLE_KEY]: "Zugang vorübergehend eingeschränkt", 23059 [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." 23060 }, 23061 nl: { 23062 [TITLE_KEY]: "Tijdelijk beperkte toegang", 23063 [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." 23064 } 23065 }; 23066 function getDocumentLang() { 23067 const lang = document.documentElement.lang?.split("-")[0] || "fr"; 23068 return lang in FALLBACKS ? lang : "fr"; 23069 } 23070 function prefetch(host) { 23071 for (const key of ERROR_WORDING_KEYS) { 23072 WordingDirective.callApi(host, key); 23073 } 23074 } 23075 function getWording(key) { 23076 const fallback = FALLBACKS[getDocumentLang()][key]; 23077 if (!isWordingReady(key)) { 23078 return fallback; 23079 } 23080 const value = get$2(WORDING_PATHS[key]); 23081 if (typeof value === "string" && value.length > 0) { 23082 return value; 23083 } 23084 return fallback; 23085 } 23086 const waitingLineErrorWording = { 23087 TITLE_KEY, 23088 CONTENT_KEY, 23089 prefetch, 23090 get: getWording 23091 }; 23092 const HTTP_SERVER_ERROR_MIN = 500; 23093 const ERROR_MODAL_AUTO_HIDE_MS = 2e4; 23094 const SLOW_AUTHORIZE_FEEDBACK_MS = 1e4; 23095 let restrictionModal = null; 23096 let restrictionModalRetryTimeout = null; 23097 function clearRestrictionModalRetryTimeout() { 23098 if (restrictionModalRetryTimeout !== null) {
23099 clearTimeout(restrictionModalRetryTimeout); 23100 restrictionModalRetryTimeout = null; 23101 } 23102 } 23103 function showRestrictionModal() { 23104 if (restrictionModal) { 23105 return; 23106 } 23107 const title = waitingLineErrorWording.get(waitingLineErrorWording.TITLE_KEY); 23108 const content = waitingLineErrorWording.get(waitingLineErrorWording.CONTENT_KEY); 23109 const restrictionModalOptions = { 23110 title: b$1` <sonic-icon library="custom" name="clock-rotate-left"></sonic-icon> 23111 <span>${title}</span>`, 23112 content: b$1`${o$6(content)}`, 23113 removeOnHide: true, 23114 noCloseButton: true, 23115 forceAction: true, 23116 maxWidth: "32rem" 23117 }; 23118 restrictionModal = Modal.create(restrictionModalOptions); 23119 } 23120 function hideRestrictionModal() { 23121 clearRestrictionModalRetryTimeout(); 23122 if (!restrictionModal) { 23123 return; 23124 } 23125 restrictionModal.hide(); 23126 restrictionModal = null; 23127 } 23128 function onRestrictionModalAutoRetry() { 23129 restrictionModalRetryTimeout = null; 23130 hideRestrictionModal(); 23131 invalidateFetchersInError(); 23132 } 23133 function scheduleRestrictionModalRetry() { 23134 clearRestrictionModalRetryTimeout(); 23135 restrictionModalRetryTimeout = setTimeout(onRestrictionModalAutoRetry, ERROR_MODAL_AUTO_HIDE_MS); 23136 } 23137 onFetchError((error) => { 23138 const isQueueAuthorisedServerError = error.status >= HTTP_SERVER_ERROR_MIN && error.url.includes(endpoints$1.SessionQueueAuthorised); 23139 if (!isQueueAuthorisedServerError) { 23140 return; 23141 } 23142 showRestrictionModal(); 23143 scheduleRestrictionModalRetry(); 23144 }); 23145 function clearSlowAuthorizeTimer(timerId) { 23146 if (timerId !== null) { 23147 clearTimeout(timerId); 23148 } 23149 return null; 23150 } 23151 function startSlowAuthorizeTimer(previousTimerId, shouldRun) { 23152 clearSlowAuthorizeTimer(previousTimerId); 23153 hideRestrictionModal(); 23154 if (!shouldRun) { 23155 return null; 23156 } 23157 return setTimeout(() => { 23158 showRestrictionModal(); 23159 }, SLOW_AUTHORIZE_FEEDBACK_MS); 23160 } 23161 var __defProp$3t = Object.defineProperty; 23162 var __getOwnPropDesc$3v = Object.getOwnPropertyDescriptor; 23163 var __decorateClass$3w = (decorators, target, key, kind) => { 23164 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3v(target, key) : target; 23165 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 23166 if (decorator = decorators[i2]) 23167 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 23168 if (kind && result) __defProp$3t(target, key, result); 23169 return result; 23170 }; 23171 clearExpiredQueueSessionFromLocation(); 23172 queueSession.authorised.dp.authorized.set(false); 23173 const tagName$2f = "sonic-queue-session"; 23174 let SonicQueueLine = class extends i$6 { 23175 constructor() { 23176 super(...arguments); 23177 this.slowAuthorizeTimerId = null; 23178 this.currentIsCheckoutEnd = false; 23179 this.previousIsCheckoutEnd = false; 23180 this.queueEnabled = false; 23181 this.queueToken = null; 23182 this.isWaiting = false; 23183 this.location = ""; 23184 this.bypassQueueAuthorize = false; 23185 } 23186 async updateQueueTokenResponse(response) { 23187 this.slowAuthorizeTimerId = clearSlowAuthorizeTimer(this.slowAuthorizeTimerId); 23188 hideRestrictionModal(); 23189 if (response.token) { 23190 localStorage.setItem(queueTokenHeaderName, response.token); 23191 this.queueToken = response.token; 23192 } 23193 if (this.bypassQueueAuthorize) { 23194 return; 23195 } 23196 if (this.queueEnabled !== true) { 23197 return; 23198 } 23199 if (!response.authorized && response.redirection) { 23200 window.location.href = response.redirection; 23201 } 23202 } 23203 connectedCallback() { 23204 super.connectedCallback(); 23205 queueSession.authorised.dp.token.set(localStorage.getItem(queueTokenHeaderName) || ""); 23206 LocationHandler$1.onChange(this); 23207 waitingLineErrorWording.prefetch(this); 23208 } 23209 disconnectedCallback() { 23210 super.disconnectedCallback(); 23211 LocationHandler$1.offChange(this); 23212 this.slowAuthorizeTimerId = clearSlowAuthorizeTimer(this.slowAuthorizeTimerId); 23213 } 23214 willUpdate(changedProperties) { 23215 const locationChanged = changedProperties.has("location"); 23216 const queueTokenChanged = changedProperties.has("queueToken"); 23217 const queueEnabledChanged = changedProperties.has("queueEnabled"); 23218 if (locationChanged) { 23219 this.bypassQueueAuthorize = isCheckoutEnd() || this.currentIsCheckoutEnd; 23220 this.previousIsCheckoutEnd = this.currentIsCheckoutEnd; 23221 this.currentIsCheckoutEnd = isCheckoutEnd(); 23222 queueSession.authorised.dp.invalidate(); 23223 } 23224 if (locationChanged || queueTokenChanged || queueEnabledChanged) { 23225 this.updateToken(); 23226 } 23227 if (locationChanged || queueEnabledChanged) { 23228 if (this.queueEnabled === true) { 23229 const headersDataProvider = HTML$1.getAncestorAttributeValue(this, "headersDataProvider"); 23230 this.slowAuthorizeTimerId = startSlowAuthorizeTimer( 23231 this.slowAuthorizeTimerId, 23232 Boolean(headersDataProvider) 23233 ); 23234 } else { 23235 this.slowAuthorizeTimerId = clearSlowAuthorizeTimer(this.slowAuthorizeTimerId); 23236 hideRestrictionModal(); 23237 } 23238 } 23239 super.willUpdate(changedProperties); 23240 } 23241 async updateToken() { 23242 if (this.queueEnabled !== true) { 23243 return; 23244 } 23245 const headersDataProvider = HTML$1.getAncestorAttributeValue(this, "headersDataProvider"); 23246 if (!headersDataProvider) { 23247 return; 23248 } 23249 const headersPublisher = dp$1(headersDataProvider); 23250 headersPublisher[queueTokenHeaderName].set(this.computeQueueToken() || ""); 23251 } 23252 computeQueueToken() { 23253 return getEmbeddedToken() ?? this.queueToken; 23254 } 23255 render() { 23256 if (this.queueEnabled !== true) { 23257 return A$1; 23258 } 23259 const headersDataProvider = HTML$1.getAncestorAttributeValue(this, "headersDataProvider"); 23260 if (!headersDataProvider) { 23261 return A$1; 23262 } 23263 return b$1`<sonic-fetch 23264 headersDataProvider=${headersDataProvider} 23265 blockUntilDone 23266 credentials="omit" 23267 endpoint=${endpoints$1.SessionQueueAuthorised} 23268 dataProvider=${queueSession.dpKeys.SessionQueueAuthorised} 23269 key="data" 23270 ></sonic-fetch> 23271 <sonic-stay-or-leave ?visible=${this.previousIsCheckoutEnd}></sonic-stay-or-leave> 23272 ${this.isWaiting === false ? b$1` <sonic-fetch 23273 endpoint=${endpoints$1.SessionQueueConfig} 23274 dataProvider=${queueSession.dpKeys.SessionQueueConfig} 23275 key="data" 23276 ></sonic-fetch> 23277 <sonic-user-activity></sonic-user-activity> 23278 <sonic-user-leave></sonic-user-leave>` : A$1} `; 23279 } 23280 }; 23281 SonicQueueLine.styles = [tailwind]; 23282 __decorateClass$3w([ 23283 queueSession.authorised.onAssign() 23284 ], SonicQueueLine.prototype, "updateQueueTokenResponse", 1); 23285 __decorateClass$3w([ 23286 r$5() 23287 ], SonicQueueLine.prototype, "currentIsCheckoutEnd", 2); 23288 __decorateClass$3w([ 23289 r$5() 23290 ], SonicQueueLine.prototype, "previousIsCheckoutEnd", 2); 23291 __decorateClass$3w([ 23292 modules.queue.enabled(), 23293 r$5() 23294 ], SonicQueueLine.prototype, "queueEnabled", 2); 23295 __decorateClass$3w([ 23296 r$5() 23297 ], SonicQueueLine.prototype, "queueToken", 2); 23298 __decorateClass$3w([ 23299 bind$1("sonicTicketApp.isWaiting"), 23300 r$5() 23301 ], SonicQueueLine.prototype, "isWaiting", 2); 23302 __decorateClass$3w([ 23303 r$5() 23304 ], SonicQueueLine.prototype, "location", 2); 23305 __decorateClass$3w([ 23306 r$5() 23307 ], SonicQueueLine.prototype, "bypassQueueAuthorize", 2); 23308 SonicQueueLine = __decorateClass$3w([ 23309 t$3(tagName$2f) 23310 ], SonicQueueLine); 23311 const headersName = "X-Cache-Control-Key"; 23312 const dataProviderPath = `ticketsAppHeadersProvider.${headersName}`;
23313 const sessionStoragePath = `ticketsApp.${dataProviderPath}`; 23314 let currentCacheKey = sessionStorage.getItem(sessionStoragePath); 23315 set(dataProviderPath, currentCacheKey); 23316 dp("sonic-api").lastResponse.http.onAssign((http) => { 23317 const cacheKey = http?.headers?.get(headersName); 23318 if (!cacheKey) return; 23319 if (cacheKey === currentCacheKey) return; 23320 currentCacheKey = cacheKey; 23321 sessionStorage.setItem(sessionStoragePath, cacheKey); 23322 set(dataProviderPath, cacheKey); 23323 }); 23324 function getCacheKey() { 23325 return sessionStorage.getItem(sessionStoragePath); 23326 } 23327 class AbstractTracking { 23328 constructor(tracking) { 23329 this.tracking = tracking; 23330 } 23331 createService() { 23332 } 23333 addJob(jobKey) { 23334 if (!window.tarteaucitron.job) { 23335 window.tarteaucitron.job = []; 23336 } 23337 if (!window.tarteaucitron.job.includes(jobKey)) { 23338 window.tarteaucitron.job.push(jobKey); 23339 } 23340 } 23341 initConfig() { 23342 window.tarteaucitron.user = { ...window.tarteaucitron.user, ...this.tracking.config ?? {} }; 23343 } 23344 loadService() { 23345 return new Promise((resolve) => resolve(true)); 23346 } 23347 } 23348 class AdWordsConversion extends AbstractTracking { 23349 trackingOnAllPages() { 23350 this.addJob("googleadwordsconversion"); 23351 } 23352 trackingOnCart() { 23353 } 23354 trackingOnPurchase(orderId, revenue) { 23355 if (window.tarteaucitron.state.googleadwordsconversion === true) { 23356 this.initConfig(); 23357 window.tarteaucitron.user.adwordsconversionOrderId = orderId; 23358 window.tarteaucitron.user.adwordsconversionValue = revenue; 23359 window.tarteaucitron.user.adwordsconversionCurrency = "EUR"; 23360 window.tarteaucitron.services.googleadwordsconversion.js(); 23361 } 23362 } 23363 } 23364 class CustomTracking extends AbstractTracking { 23365 createService() { 23366 window.tarteaucitron.services.custom_tracking = { 23367 key: "custom_tracking", 23368 type: "other", 23369 name: "Tracking personnalisé", 23370 needConsent: false, 23371 cookies: [], 23372 js: function() { 23373 const statusInfo = document.querySelector(".tarteaucitronStatusInfo"); 23374 let next = statusInfo?.nextSibling; 23375 while (next) { 23376 let toRemove = next; 23377 next = next.nextSibling; 23378 toRemove.remove(); 23379 } 23380 const userCode = window.tarteaucitron.user.custom_tracking; 23381 if (!userCode) return; 23382 const container = document.createElement("div"); 23383 container.innerHTML = userCode; 23384 const pixels = container.querySelectorAll("img"); 23385 pixels.forEach((oldPixel) => { 23386 const pixel = document.createElement("img"); 23387 for (let attr of oldPixel.attributes) { 23388 pixel.setAttribute(attr.name, attr.value); 23389 } 23390 pixel.style.display = "none"; 23391 document.body.appendChild(pixel); 23392 }); 23393 const div = container.querySelectorAll("div"); 23394 div.forEach((oldDiv) => { 23395 const div2 = document.createElement("div"); 23396 for (let attr of oldDiv.attributes) { 23397 div2.setAttribute(attr.name, attr.value); 23398 } 23399 div2.style.display = "none"; 23400 document.body.appendChild(div2); 23401 }); 23402 const scripts = container.querySelectorAll("script"); 23403 scripts.forEach((oldScript) => { 23404 const script = document.createElement("script"); 23405 for (let attr of oldScript.attributes) { 23406 script.setAttribute(attr.name, attr.value); 23407 } 23408 if (oldScript.text) { 23409 script.text = oldScript.text; 23410 } 23411 document.body.appendChild(script); 23412 }); 23413 }, 23414 fallback: function() { 23415 const statusInfo = document.querySelector(".tarteaucitronStatusInfo"); 23416 let next = statusInfo?.nextSibling; 23417 while (next) { 23418 let toRemove = next; 23419 next = next.nextSibling; 23420 toRemove.remove(); 23421 } 23422 } 23423 }; 23424 this.initConfig(); 23425 } 23426 trackingOnAllPages() { 23427 const onView = this?.tracking?.config?.["on_view"]; 23428 if (onView) { 23429 window.tarteaucitron.user.custom_tracking = onView; 23430 } 23431 this.addJob("custom_tracking"); 23432 } 23433 trackingOnCart(trackingCartItem) { 23434 const onCart = this.tracking.config?.["on_cart"]; 23435 if (!onCart) return; 23436 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)); 23437 window.tarteaucitron.services.custom_tracking.js(); 23438 } 23439 trackingOnPurchase(orderId, revenue) { 23440 const onPurchase = this.tracking.config?.["on_purchase"]; 23441 if (!onPurchase) return; 23442 window.tarteaucitron.user.custom_tracking = onPurchase.replace(/\[ORDER_ID]/g, orderId).replace(/\[REVENUE]/g, revenue); 23443 window.tarteaucitron.services.custom_tracking.js(); 23444 } 23445 } 23446 class GoogleAnalytics extends AbstractTracking { 23447 trackingOnAllPages() { 23448 const googleId = this.tracking.config?.googleAnalyticsId; 23449 const more = this.tracking.config?.googleAnalyticsMore; 23450 const type = this.getGoogleType(); 23451 if (!googleId || !type) { 23452 return; 23453 } 23454 switch (type) { 23455 case "GTM": 23456 window.tarteaucitron.user.googletagmanagerId = googleId; 23457 window.tarteaucitron.user.googletagmanagerMore = more; 23458 break; 23459 case "GA4": 23460 case "ADS": 23461 window.tarteaucitron.user.gtagUa = googleId; 23462 window.tarteaucitron.user.gtagMore = more; 23463 break; 23464 case "GAJS": 23465 window.tarteaucitron.user.gajsUa = googleId; 23466 window.tarteaucitron.user.gajsMore = more; 23467 break; 23468 } 23469 const service = this.getTarteAuCitronService(type); 23470 if (service) { 23471 this.addJob(service); 23472 } 23473 } 23474 trackingOnCart(trackingCartItem) { 23475 const type = this.getGoogleType(); 23476 if (!this.hasConsent(type)) { 23477 return; 23478 } 23479 const payload = { 23480 currency: "EUR", 23481 value: trackingCartItem.item.price?.amount ?? 0, 23482 items: [ 23483 { 23484 item_id: trackingCartItem.item.entity_id, 23485 item_name: trackingCartItem.title, 23486 price: trackingCartItem.item.price?.amount ?? 0, 23487 quantity: trackingCartItem.item.quantity 23488 } 23489 ] 23490 }; 23491 switch (type) { 23492 case "GTM": 23493 this.pushDataLayer("add_to_cart", payload); 23494 break; 23495 case "GA4": 23496 window.gtag("event", "add_to_cart", payload); 23497 break; 23498 case "ADS": 23499 break; 23500 case "GAJS": 23501 console.warn("Universal Analytics n'est plus supporté."); 23502 break; 23503 } 23504 } 23505 trackingOnPurchase(orderId, revenue) { 23506 const type = this.getGoogleType(); 23507 const conversionId = this.getAdsConversionId(); 23508 if (!conversionId) { 23509 return; 23510 } 23511 if (!this.hasConsent(type)) { 23512 return; 23513 } 23514 const value = Number(revenue) || 0; 23515 switch (type) { 23516 case "GTM": 23517 this.pushDataLayer("purchase", { 23518 transaction_id: orderId, 23519 value, 23520 currency: "EUR" 23521 }); 23522 break; 23523 case "GA4": 23524 window.gtag("event", "purchase", { 23525 transaction_id: orderId, 23526 value, 23527 currency: "EUR" 23528 }); 23529 break; 23530 case "ADS": 23531 window.gtag("event", "conversion", { 23532 send_to: conversionId, 23533 value, 23534 currency: "EUR", 23535 transaction_id: orderId 23536 }); 23537 break; 23538 case "GAJS": 23539 console.warn("Universal Analytics n'est plus supporté."); 23540 break; 23541 } 23542 } 23543 loadService() { 23544 return new Promise((resolve) => { 23545 const start = Date.now(); 23546 const timeout = 3e3; 23547 const timer = window.setInterval(() => { 23548 if (this.isReady()) { 23549 clearInterval(timer); 23550 resolve(true); 23551 return; 23552 } 23553 if (Date.now() - start >= timeout) { 23554 clearInterval(timer); 23555 console.warn(`${this.getGoogleType()}
23555 non prêt à temps`); 23556 resolve(false); 23557 } 23558 }, 50); 23559 }); 23560 } 23561 getGoogleType() { 23562 const googleId = this.tracking.config?.googleAnalyticsId; 23563 if (!googleId) { 23564 return; 23565 } 23566 if (googleId.startsWith("GTM-")) { 23567 return "GTM"; 23568 } 23569 if (googleId.startsWith("G-")) { 23570 return "GA4"; 23571 } 23572 if (googleId.startsWith("AW-")) { 23573 return "ADS"; 23574 } 23575 if (googleId.startsWith("UA-")) { 23576 return "GAJS"; 23577 } 23578 return void 0; 23579 } 23580 getTarteAuCitronService(type) { 23581 switch (type) { 23582 case "GTM": 23583 return "googletagmanager"; 23584 case "GA4": 23585 case "ADS": 23586 return "gtag"; 23587 case "GAJS": 23588 return "gajs"; 23589 default: 23590 return void 0; 23591 } 23592 } 23593 hasConsent(type) { 23594 const service = this.getTarteAuCitronService(type); 23595 return !!service && window.tarteaucitron.state[service] === true; 23596 } 23597 pushDataLayer(event, ecommerce) { 23598 window.dataLayer = window.dataLayer || []; 23599 window.dataLayer.push({ 23600 event, 23601 ecommerce 23602 }); 23603 } 23604 getAdsConversionId() { 23605 const id = this.tracking.config?.googleAnalyticsId; 23606 const label2 = this.tracking.config?.conversionLabel; 23607 if (!id) { 23608 return; 23609 } 23610 return label2 ? `${id}/${label2}` : id; 23611 } 23612 isReady() { 23613 switch (this.getGoogleType()) { 23614 case "GA4": 23615 case "ADS": 23616 return typeof window.gtag === "function"; 23617 case "GTM": 23618 return Array.isArray(window.dataLayer); 23619 case "GAJS": 23620 return typeof window.ga === "function"; 23621 default: 23622 return false; 23623 } 23624 } 23625 } 23626 class XandrConversion extends AbstractTracking { 23627 trackingOnAllPages() { 23628 this.addJob("xandrconversion"); 23629 } 23630 trackingOnCart() { 23631 } 23632 trackingOnPurchase(orderId, revenue) { 23633 const id = this.tracking.config?.["xandrconversionId"]; 23634 const seg = this.tracking.config?.["xandrconversionSeg"]; 23635 if (!id) { 23636 return; 23637 } 23638 const div = document.createElement("div"); 23639 div.className = "xandrconversion-canvas"; 23640 div.setAttribute("xandrconversionId", id); 23641 div.setAttribute("xandrconversionOrderId", orderId); 23642 div.setAttribute("xandrconversionValue", revenue); 23643 if (seg) { 23644 div.setAttribute("xandrconversionSeg", seg); 23645 } 23646 document.body.appendChild(div); 23647 window.tarteaucitron.services.xandrconversion?.js(); 23648 } 23649 } 23650 class Tradedoubler extends AbstractTracking { 23651 createService() { 23652 window.tarteaucitron.services.tradedoubler = { 23653 key: "tradedoubler", 23654 type: "ads", 23655 name: "Tradedoubler", 23656 needConsent: true, 23657 cookies: ["td_*", "tradedoubler"], 23658 uri: "https://www.tradedoubler.com/en/privacy-policy/", 23659 js: function() { 23660 const orderId = window.tarteaucitron.user.tradedoublerOrderId; 23661 const revenue = window.tarteaucitron.user.tradedoublerRevenue; 23662 const organization = window.tarteaucitron.user.tradedoublerOrganization; 23663 const event = window.tarteaucitron.user.tradedoublerEvent; 23664 if (!organization || !event) { 23665 return; 23666 } 23667 const img = document.createElement("img"); 23668 img.src = `https://tbs.tradedoubler.com/report?organization=${organization}&event=${event}&orderNumber=${orderId}&orderValue=${revenue}`; 23669 img.width = 1; 23670 img.height = 1; 23671 img.style.display = "none"; 23672 document.body.appendChild(img); 23673 } 23674 }; 23675 } 23676 trackingOnAllPages() { 23677 this.addJob("tradedoubler"); 23678 } 23679 trackingOnCart() { 23680 } 23681 trackingOnPurchase(orderId, revenue) { 23682 this.initConfig(); 23683 window.tarteaucitron.user.tradedoublerOrderId = orderId; 23684 window.tarteaucitron.user.tradedoublerRevenue = revenue; 23685 window.tarteaucitron.services.tradedoubler.js(); 23686 } 23687 } 23688 class XandrSegment extends AbstractTracking { 23689 trackingOnAllPages() { 23690 const add = this.tracking.config?.["xandrsegmentAdd"]; 23691 if (!add) { 23692 return; 23693 } 23694 const div = document.createElement("div"); 23695 div.className = "xandrsegment-canvas"; 23696 div.setAttribute("xandrsegmentAdd", add); 23697 document.body.appendChild(div); 23698 this.addJob("xandrsegment"); 23699 } 23700 trackingOnCart() { 23701 } 23702 trackingOnPurchase() { 23703 } 23704 } 23705 class AdWordsRemarketing extends AbstractTracking { 23706 trackingOnAllPages() { 23707 this.initConfig(); 23708 this.addJob("googleadwordsremarketing"); 23709 } 23710 trackingOnCart() { 23711 } 23712 trackingOnPurchase() { 23713 } 23714 } 23715 class PixelMeta extends AbstractTracking { 23716 trackingOnAllPages() { 23717 this.initConfig(); 23718 this.addJob("facebookpixel"); 23719 } 23720 trackingOnCart(trackingCartItem) { 23721 if (window.tarteaucitron.state.facebookpixel === true) { 23722 window.fbq("track", "AddToCart", { 23723 content_ids: [trackingCartItem.item.entity_id], 23724 content_name: trackingCartItem.title, 23725 value: trackingCartItem.item.price?.amount ?? 0, 23726 currency: "EUR", 23727 quantity: trackingCartItem.item.quantity 23728 }); 23729 } 23730 } 23731 trackingOnPurchase(orderId, revenue) { 23732 if (window.tarteaucitron.state.facebookpixel === true) { 23733 window.fbq("track", "Purchase", { 23734 order_id: orderId, 23735 value: revenue, 23736 currency: "EUR" 23737 }); 23738 } 23739 } 23740 } 23741 class Xandr extends AbstractTracking { 23742 trackingOnAllPages() { 23743 this.initConfig(); 23744 this.addJob("xandr"); 23745 } 23746 trackingOnCart() { 23747 } 23748 trackingOnPurchase() { 23749 } 23750 } 23751 class Matomo extends AbstractTracking { 23752 trackingOnAllPages() { 23753 this.initConfig(); 23754 this.addJob("matomocloud"); 23755 } 23756 trackingOnCart(trackingCartItem) { 23757 if (window.tarteaucitron.state.matomocloud === true) { 23758 window._paq.push([ 23759 "addEcommerceItem", 23760 trackingCartItem.item.entity_id, 23761 trackingCartItem.title, 23762 trackingCartItem.item.entity_type, 23763 trackingCartItem.item.price?.amount ?? 0, 23764 trackingCartItem.item.quantity 23765 ]); 23766 window._paq.push(["trackEcommerceCartUpdate", trackingCartItem.total]); 23767 } 23768 } 23769 trackingOnPurchase(orderId, revenue) { 23770 if (window.tarteaucitron.state.matomocloud === true) { 23771 window._paq.push(["trackEcommerceOrder", orderId, revenue]); 23772 } 23773 } 23774 } 23775 const InitTrackingEventKey = "tracking-manager-initialized"; 23776 class TrackingManager { 23777 constructor() { 23778 this.trackings = []; 23779 } 23780 async init(givenTrackings) { 23781 const isReady = await this.loadTAC(); 23782 if (isReady) {
23783 givenTrackings.forEach((tracking) => { 23784 const trackingService = this.getMappedTracking(tracking); 23785 if (trackingService) { 23786 this.trackings.push(trackingService); 23787 } 23788 }); 23789 if (this.trackings.length > 0 && Object.values(window.tarteaucitron.services).length > 0) { 23790 this.createService(); 23791 this.trackingOnAllPages(); 23792 await this.loadServices(); 23793 } 23794 } 23795 } 23796 static getTrackingManager(callback) { 23797 const tryManager = () => { 23798 const trackingManager = window?.__SonicTrackingManager; 23799 if (trackingManager) { 23800 callback(trackingManager); 23801 return true; 23802 } 23803 return false; 23804 }; 23805 if (!tryManager()) { 23806 const handler = (event) => { 23807 const trackingManager = event.detail; 23808 if (trackingManager) { 23809 callback(trackingManager); 23810 } 23811 window.removeEventListener(InitTrackingEventKey, handler); 23812 }; 23813 window.addEventListener(InitTrackingEventKey, handler); 23814 } 23815 } 23816 loadTAC() { 23817 return new Promise((resolve) => { 23818 const start = Date.now(); 23819 const timeout = 3e3; 23820 const t2 = setInterval(() => { 23821 const tac = window.tarteaucitron; 23822 if (tac?.services && Object.keys(tac.services).length) { 23823 clearInterval(t2); 23824 resolve(true); 23825 return; 23826 } 23827 if (Date.now() - start > timeout) { 23828 clearInterval(t2); 23829 console.warn("tarteaucitron non prêt à temps"); 23830 resolve(false); 23831 } 23832 }, 50); 23833 }); 23834 } 23835 getMappedTracking(tracking) { 23836 switch (tracking.trackingKey) { 23837 case "pixel_meta": 23838 return new PixelMeta(tracking); 23839 case "google_analytics": 23840 return new GoogleAnalytics(tracking); 23841 case "adwords_remarketing": 23842 return new AdWordsRemarketing(tracking); 23843 case "adwords_conversion": 23844 return new AdWordsConversion(tracking); 23845 case "xandr": 23846 return new Xandr(tracking); 23847 case "xandr_segment": 23848 return new XandrSegment(tracking); 23849 case "xandr_conversion": 23850 return new XandrConversion(tracking); 23851 case "tradedoubler": 23852 return new Tradedoubler(tracking); 23853 case "custom_tracking": 23854 return new CustomTracking(tracking); 23855 case "matomo": 23856 return new Matomo(tracking); 23857 default: 23858 console.warn(`Unknown tracking key: ${tracking.trackingKey}`); 23859 return; 23860 } 23861 } 23862 createService() { 23863 this.trackings.forEach((tracking) => tracking.createService()); 23864 } 23865 trackingOnAllPages() { 23866 this.trackings.forEach((tracking) => tracking.trackingOnAllPages()); 23867 } 23868 trackingOnPurchase(orderId, revenue) { 23869 this.trackings.forEach((tracking) => tracking.trackingOnPurchase(orderId, revenue)); 23870 } 23871 trackingOnCart(trackingCartItem) { 23872 this.trackings.forEach((tracking) => tracking.trackingOnCart(trackingCartItem)); 23873 } 23874 async loadServices() { 23875 for (const tracking of this.trackings) { 23876 await tracking.loadService(); 23877 } 23878 } 23879 } 23880 var __defProp$3s = Object.defineProperty; 23881 var __getOwnPropDesc$3u = Object.getOwnPropertyDescriptor; 23882 var __decorateClass$3v = (decorators, target, key, kind) => { 23883 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3u(target, key) : target; 23884 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 23885 if (decorator = decorators[i2]) 23886 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 23887 if (kind && result) __defProp$3s(target, key, result); 23888 return result; 23889 }; 23890 dp("waiting_line_infos").status.set(""); 23891 dp("sonicTicketApp").isWaiting.set(true); 23892 const tagName$2e = "sonic-tickets-app"; 23893 let SonicTicketApp = class extends Subscriber$1(i$6) { 23894 constructor() { 23895 super(...arguments); 23896 this.token = null; 23897 this.customRoutes = {}; 23898 this.wordingVersionProvider = "settings.wording.version"; 23899 this.headersDataProvider = "ticketsAppHeadersProvider"; 23900 this.serviceUrl = "/api/v2"; 23901 this.cartProvider = "cart/current"; 23902 this.credentials = "include"; 23903 this.theme = "light"; 23904 this.wordingProvider = "translate"; 23905 this.customIconLibraryPath = "https://cdn.supersoniks.com/concorde/icons/fontawesome/v6/$prefix/$name.svg"; 23906 this.customIconDefaultPrefix = "regular"; 23907 this.defaultFrontend = false;
23908 this.noFetchSettings = false; 23909 this.noFetchTheme = false; 23910 this.waitingLineStatus = ""; 23911 this.appType = "customer"; 23912 this.statusResetCounter = 0; 23913 this.onFetchError = (apiResponse) => { 23914 if (this.statusResetCounter > 5) { 23915 return; 23916 } 23917 const status = dp("waiting_line_infos").status.get(); 23918 if (apiResponse.status === 403 && this.hasWaitingLine && status != "") { 23919 dp("waiting_line_infos").status.set(""); 23920 this.statusResetCounter++; 23921 } 23922 }; 23923 } 23924 onWaitingLineStatus(status, enabled, queueEnabled, authorized) { 23925 const isWaiting = status != "entered" && enabled; 23926 const isQueued = queueEnabled === true && authorized === false; 23927 dp("sonicTicketApp").isWaiting.set(isWaiting || isQueued); 23928 } 23929 onLogRoute(value) { 23930 if (value === true) { 23931 configLog(HTML$1.getApiConfiguration(this)); 23932 } 23933 } 23934 connectedCallback() { 23935 onFetchError(this.onFetchError); 23936 const baseURL = this.customRoutes.home || defaultAppRoutes.home; 23937 Routes.register(defaultAppRoutes, baseURL); 23938 for (const key in this.customRoutes) { 23939 if (this.customRoutes[key] === null) delete this.customRoutes[key]; 23940 } 23941 Routes.register(this.customRoutes, baseURL); 23942 const customAccountBaseUrl = this.customRoutes["account"]; 23943 const hasCustomAccountBaseUrl = customAccountBaseUrl !== defaultAppRoutes.account; 23944 const accountBaseUrl = hasCustomAccountBaseUrl ? customAccountBaseUrl : defaultAppRoutes.home; 23945 Routes.register(accountRoutes, accountBaseUrl, "account."); 23946 if (this.storeUrl && !this.getAttribute("serviceURL")) { 23947 const urlWithoutLastSlash = this.storeUrl.replace(/\/$/, ""); 23948 this.serviceUrl = urlWithoutLastSlash + this.serviceUrl; 23949 } 23950 this.setAttribute("serviceUrl", this.serviceUrl); 23951 this.setAttribute( 23952 "cartProvider", 23953 new URL(document.location.href).searchParams.get("cartProvider") || this.cartProvider 23954 ); 23955 this.setAttribute("credentials", this.credentials); 23956 this.setAttribute("wordingProvider", this.wordingProvider); 23957 this.setAttribute("customIconLibraryPath", this.customIconLibraryPath); 23958 this.setAttribute("customIconDefaultPrefix", this.customIconDefaultPrefix); 23959 setDefaultApiConf({ 23960 serviceURL: this.serviceUrl, 23961 token: this.token, 23962 credentials: this.credentials, 23963 userName: "", 23964 password: "", 23965 authToken: "", 23966 tokenProvider: "" 23967 }); 23968 const appHome = appRoute("home"); 23969 PublisherManager.get("ticketsAppHeadersProvider")["Sonic-Tickets-App-Home"].set(appHome); 23970 PublisherManager.get(`user`).onAssign((response) => { 23971 if (response._sonic_http_response_) { 23972 PublisherManager.get(`carpooling_user_id`).encrypted_uid.set(response._sonic_http_response_.headers.get("Uid")); 23973 } 23974 }); 23975 handleRedirect(); 23976 super.connectedCallback(); 23977 this.dispatchEvent( 23978 new CustomEvent("sonic-routes-ready", { 23979 bubbles: true, 23980 composed: true 23981 }) 23982 ); 23983 } 23984 disconnectedCallback() { 23985 offFetchError(this.onFetchError); 23986 super.disconnectedCallback(); 23987 } 23988 showWaitingLine() { 23989 return this.hasWaitingLine && this.waitingLineStatus != "entered"; 23990 } 23991 showAppContent() { 23992 return !this.showWaitingLine() || sessionStorage.getItem("waiting-line-previously-entered") === "true" && this.waitingLineStatus == ""; 23993 } 23994 async willUpdate(_changedProperties) { 23995 invalidateFetchersInError(); 23996 await this.initTracking(_changedProperties); 23997 super.willUpdate(_changedProperties); 23998 } 23999 async initTracking(_changedProperties) { 24000 if (typeof window === "undefined" || window.self !== window.top || !!window?.__SonicTrackingManager) { 24001 return; 24002 } 24003 if (_changedProperties.has("trackings") && this.trackings && this.trackings.length > 0) { 24004 const manager = new TrackingManager(); 24005 await manager.init(this.trackings); 24006 window.__SonicTrackingManager = manager; 24007 const initEvent = new CustomEvent(InitTrackingEventKey, { detail: manager }); 24008 window.dispatchEvent(initEvent); 24009 } 24010 } 24011 render() { 24012 return b$1` ${!this.noFetchSettings ? b$1`<sonic-fetch dataprovider="settings" blockUntilDone localStorage="enabled"></sonic-fetch> ` : A$1} 24013 <sonic-theme part="theme" theme=${this.theme}> 24014 <sonic-queue-session></sonic-queue-session> 24015 ${!this.noFetchTheme ? b$1`<sonic-fetch dataprovider="theme"></sonic-fetch>` : A$1} 24016 ${this.preferWebsite && this.defaultFrontend ? b$1`<sonic-prefer-website-message></sonic-prefer-website-message>` : A$1} 24017 ${this.showWaitingLine() ? b$1`<sonic-waiting-line></sonic-waiting-line>` : A$1} 24018 ${!this.isWaiting ? b$1`<sonic-fetch addHTTPResponse dataprovider="user" endpoint="user/current"></sonic-fetch>` : A$1} 24019 ${!this.isWaiting ? b$1`<sonic-fetch dataprovider="cart/current" endpoint="cart/current"></sonic-fetch>` : A$1} 24020 ${this.showAppContent() ? b$1` 24021 <slot></slot> 24022 24023 <!-- Routes auto-implémentées --> 24024 <sonic-default-router .customRoutes=${this.customRoutes}></sonic-default-router> 24025 24026 ${!this.isWaiting ? b$1`<sonic-promo-active-code></sonic-promo-active-code> ` : A$1} 24027 24028 <!-- message subscriber --> 24029 <sonic-toast-message-subscriber dataProvider="cart/current"></sonic-toast-message-subscriber> 24030 <sonic-toast-message-subscriber dataProvider="defaultMessages"></sonic-toast-message-subscriber> 24031 <sonic-administrator-force-logout></sonic-administrator-force-logout> 24032 ` : A$1} 24033 </sonic-theme>`; 24034 } 24035 }; 24036 SonicTicketApp.styles = [ 24037 i$9` 24038 :host { 24039 display: contents; 24040 --sc-container-gutter-x: 1rem; 24041 --sc-container-gutter-y: 2rem; 24042 --sc-header-baseline-height: 1rem; 24043 --sc-header-gy: 1rem; 24044 --sc-header-height: calc(4.5rem + var(--sc-header-gy) * 2 + var(--sc-header-baseline-height, 0px)); 24045 --sc-header-mb: 2rem; 24046 } 24047 @media (min-width: 480px) { 24048 :host { 24049 --sc-container-gutter-x: clamp(1rem, 5vw, 5rem); 24050 } 24051 } 24052 24053 @media (min-width: 1024px) { 24054 :host { 24055 --sc-container-gutter-x: clamp(1rem, 5vw, 5rem); 24056 --sc-header-gy: 2rem; 24057 --sc-header-mb: 0px; 24058 } 24059 } 24060 ` 24061 ]; 24062 __decorateClass$3v([ 24063 n$5({ type: String }) 24064 ], SonicTicketApp.prototype, "token", 2); 24065 __decorateClass$3v([ 24066 n$5({ type: Object }) 24067 ], SonicTicketApp.prototype, "customRoutes", 2); 24068 __decorateClass$3v([ 24069 n$5({ type: String, reflect: true }) 24070 ], SonicTicketApp.prototype, "wordingVersionProvider", 2); 24071 __decorateClass$3v([ 24072 n$5({ type: String, reflect: true }) 24073 ], SonicTicketApp.prototype, "headersDataProvider", 2); 24074 __decorateClass$3v([ 24075 n$5({ type: String }) 24076 ], SonicTicketApp.prototype, "storeUrl", 2); 24077 __decorateClass$3v([ 24078 n$5({ type: String }) 24079 ], SonicTicketApp.prototype, "serviceUrl", 2); 24080 __decorateClass$3v([ 24081 n$5({ type: String }) 24082 ], SonicTicketApp.prototype, "cartProvider", 2); 24083 __decorateClass$3v([ 24084 n$5({ type: String }) 24085 ], SonicTicketApp.prototype, "credentials", 2); 24086 __decorateClass$3v([ 24087 n$5({ type: String }) 24088 ], SonicTicketApp.prototype, "theme", 2); 24089 __decorateClass$3v([ 24090 n$5({ type: String }) 24091 ], SonicTicketApp.prototype, "wordingProvider", 2); 24092 __decorateClass$3v([ 24093 n$5({ type: String }) 24094 ], SonicTicketApp.prototype, "customIconLibraryPath", 2); 24095 __decorateClass$3v([ 24096 n$5({ type: String }) 24097 ], SonicTicketApp.prototype, "customIconDefaultPrefix", 2); 24098 __decorateClass$3v([ 24099 n$5({ type: Boolean }) 24100 ], SonicTicketApp.prototype, "defaultFrontend", 2); 24101 __decorateClass$3v([ 24102 n$5({ type: Boolean }) 24103 ], SonicTicketApp.prototype, "noFetchSettings", 2); 24104 __decorateClass$3v([ 24105 n$5({ type: Boolean }) 24106 ], SonicTicketApp.prototype, "noFetchTheme", 2); 24107 __decorateClass$3v([ 24108 bind$1("settings.prefer_website"), 24109 n$5({ type: Boolean }) 24110 ], SonicTicketApp.prototype, "preferWebsite", 2); 24111 __decorateClass$3v([ 24112 bind$1("waiting_line_infos.status"), 24113 r$5() 24114 ], SonicTicketApp.prototype, "waitingLineStatus", 2); 24115 __decorateClass$3v([ 24116 bind$1("settings.modules.waiting_line.enabled"), 24117 n$5({ type: Boolean }) 24118 ], SonicTicketApp.prototype, "hasWaitingLine", 2); 24119 __decorateClass$3v([ 24120 bind$1("sonicTicketApp.isWaiting"), 24121 r$5() 24122 ], SonicTicketApp.prototype, "isWaiting", 2); 24123 __decorateClass$3v([ 24124 onAssign$1( 24125 "waiting_line_infos.status", 24126 "settings.modules.waiting_line.enabled", 24127 "settings.modules.queue.enabled", 24128 "sessionQueueAuthorised.authorized" 24129 ) 24130 ], SonicTicketApp.prototype, "onWaitingLineStatus", 1); 24131 __decorateClass$3v([ 24132 e$2({ context: appType }), 24133 n$5({ type: String }) 24134 ], SonicTicketApp.prototype, "appType", 2); 24135 __decorateClass$3v([ 24136 onAssign$1("settings.modules.logs_route.enabled") 24137 ], SonicTicketApp.prototype, "onLogRoute", 1); 24138 __decorateClass$3v([ 24139 bind$1("settings.trackings"), 24140 n$5({ type: Array }) 24141 ], SonicTicketApp.prototype, "trackings", 2); 24142 SonicTicketApp = __decorateClass$3v([ 24143 t$3(tagName$2e), 24144 dispatchConnectedEvent() 24145 ], SonicTicketApp); 24146 var __defProp$3r = Object.defineProperty; 24147 var __getOwnPropDesc$3t = Object.getOwnPropertyDescriptor; 24148 var __decorateClass$3u = (decorators, target, key, kind) => { 24149 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3t(target, key) : target; 24150 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 24151 if (decorator = decorators[i2]) 24152 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 24153 if (kind && result) __defProp$3r(target, key, result); 24154 return result; 24155 }; 24156 const tagName$2d = "sonic-tickets-app-legacy"; 24157 let SonicTicketAppLegacy = class extends Subscriber$1(i$6) { 24158 constructor() { 24159 super(...arguments); 24160 this.customRoutes = {}; 24161 this.appType = "customer"; 24162 } 24163 createRenderRoot() { 24164 return this; 24165 } 24166 connectedCallback() { 24167 dp("sonicTicketApp").isWaiting.set(false); 24168 const baseURL = this.customRoutes.home || defaultAppRoutes.home; 24169 Routes.register(defaultAppRoutes, baseURL); 24170 for (const key in this.customRoutes) { 24171 if (this.customRoutes[key] === null) delete this.customRoutes[key]; 24172 } 24173 Routes.register(this.customRoutes, baseURL); 24174 const customAccountBaseUrl = this.customRoutes["account"]; 24175 const hasCustomAccountBaseUrl = customAccountBaseUrl !== defaultAppRoutes.account; 24176 const accountBaseUrl = hasCustomAccountBaseUrl ? customAccountBaseUrl : defaultAppRoutes.home; 24177 Routes.register(accountRoutes, accountBaseUrl, "account."); 24178 this.setAttribute("serviceUrl", "/api/v2"); 24179 this.setAttribute("cartProvider", "cart/current"); 24180 this.setAttribute("credentials", "include"); 24181 this.setAttribute("wordingProvider", "translate"); 24182 this.setAttribute( 24183 "customIconLibraryPath", 24184 "https://cdn.supersoniks.com/concorde/icons/fontawesome/v6/$prefix/$name.svg" 24185 ); 24186 this.setAttribute("wordingVersionProvider", "settings.wording.ver
24186sion"); 24187 this.setAttribute( 24188 "customIconLibraryPath", 24189 "https://cdn.supersoniks.com/concorde/icons/fontawesome/v6/$prefix/$name.svg" 24190 ); 24191 this.setAttribute("customIconDefaultPrefix", "regular"); 24192 handleRedirect(); 24193 super.connectedCallback(); 24194 } 24195 render() { 24196 return b$1` <sonic-theme part="theme"> 24197 <sonic-fetch dataprovider="theme"></sonic-fetch> 24198 <sonic-fetch dataprovider="settings" localStorage="enabled"></sonic-fetch> 24199 <sonic-fetch dataprovider="user" endpoint="user/current"></sonic-fetch> 24200 <sonic-fetch dataprovider="cart/current" endpoint="cart/current"></sonic-fetch> 24201 <slot></slot> 24202 24203 <!-- message subscriber --> 24204 <sonic-toast-message-subscriber dataProvider="cart/current"></sonic-toast-message-subscriber> 24205 <sonic-toast-message-subscriber dataProvider="defaultMessages"></sonic-toast-message-subscriber> 24206 </sonic-theme>`; 24207 } 24208 }; 24209 __decorateClass$3u([ 24210 n$5({ type: Object }) 24211 ], SonicTicketAppLegacy.prototype, "customRoutes", 2); 24212 __decorateClass$3u([ 24213 e$2({ context: appType }), 24214 n$5({ type: String }) 24215 ], SonicTicketAppLegacy.prototype, "appType", 2); 24216 SonicTicketAppLegacy = __decorateClass$3u([ 24217 t$3(tagName$2d) 24218 ], SonicTicketAppLegacy); 24219 var __defProp$3q = Object.defineProperty; 24220 var __getOwnPropDesc$3s = Object.getOwnPropertyDescriptor; 24221 var __decorateClass$3t = (decorators, target, key, kind) => { 24222 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3s(target, key) : target; 24223 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 24224 if (decorator = decorators[i2]) 24225 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 24226 if (kind && result) __defProp$3q(target, key, result); 24227 return result; 24228 }; 24229 let ItemCount = class extends Subscriber$1(i$6) { 24230 constructor() { 24231 super(...arguments); 24232 this.quantity = null; 24233 this.payment_link_hash = null; 24234 this.quantityChanged = false; 24235 this.quantityIsInit = false; 24236 } 24237 willUpdate(_changedProperties) { 24238 if (_changedProperties.has("quantity")) { 24239 this.quantityIsInit = this.quantity !== null; 24240 if (Number(this.quantity) > 0 && this.quantityIsInit && Number(this.quantity) !== Number(_changedProperties.get("quantity"))) { 24241 this.triggerQuantityAnimation(); 24242 } 24243 } 24244 } 24245 triggerQuantityAnimation() { 24246 this.quantityChanged = true; 24247 setTimeout(() => { 24248 this.quantityChanged = false; 24249 }, 600); 24250 } 24251 render() { 24252 if (this.payment_link_hash) { 24253 return b$1`<span>!</span>`; 24254 } 24255 const count = Number(this.quantity); 24256 return b$1`<span>${count}</span>`; 24257 } 24258 }; 24259 ItemCount.styles = [ 24260 tailwind, 24261 i$9` 24262 :host { 24263 display: inline-flex; 24264 align-items: center; 24265 justify-content: center; 24266 line-height: 1; 24267 font-size: clamp(10px, 0.5em, 0.85rem); 24268 } 24269 24270 span { 24271 display: inline-flex; 24272 background-color: var(--sc-danger); 24273 color: var(--sc-danger-content); 24274 border-radius: 100px; 24275 padding: 0.35em; 24276 font-weight: bold; 24277 justify-content: center; 24278 align-items: center; 24279 line-height: 1; 24280 white-space: nowrap; 24281 min-width: 1.7em; 24282 height: 1.7em; 24283 /* fix bug #42622 */ 24284 transition: 24285 opacity 0.3s ease, 24286 scale 0.3s ease, 24287 box-shadow 0.3s ease; 24288 transform-origin: center center; 24289 font-weight: bold; 24290 line-height: 1.15; 24291 opacity: 0; 24292 scale: 0; 24293 } 24294 24295 :host([quantity="0"]) span { 24296 opacity: 0 !important; 24297 scale: 0 !important; 24298 } 24299 24300 :host([quantity]:not([quantity="0"])) span { 24301 opacity: 1; 24302 scale: 1; 24303 } 24304 :host([quantityChanged]) span { 24305 animation: quantityPulse 0.6s ease-in-out; 24306 } 24307 24308 @keyframes quantityPulse { 24309 0% { 24310 box-shadow: 0 0 0 0px var(--sc-danger); 24311 } 24312 25% { 24313 box-shadow: 0 0 0 3px var(--sc-danger); 24314 } 24315 50% { 24316 box-shadow: 0 0 0 0px var(--sc-danger); 24317 } 24318 75% { 24319 box-shadow: 0 0 0 1px var(--sc-danger); 24320 } 24321 100% { 24322 box-shadow: 0 0 0 0px var(--sc-danger); 24323 } 24324 } 24325 ` 24326 ]; 24327 __decorateClass$3t([ 24328 n$5({ type: Number, reflect: true }) 24329 ], ItemCount.prototype, "quantity", 2); 24330 __decorateClass$3t([ 24331 n$5({ type: String }) 24332 ], ItemCount.prototype, "payment_link_hash", 2); 24333 __decorateClass$3t([ 24334 n$5({ type: Boolean, reflect: true }) 24335 ], ItemCount.prototype, "quantityChanged", 2);
24336 ItemCount = __decorateClass$3t([ 24337 t$3("sonic-cart-item-count") 24338 ], ItemCount); 24339 var __defProp$3p = Object.defineProperty; 24340 var __getOwnPropDesc$3r = Object.getOwnPropertyDescriptor; 24341 var __decorateClass$3s = (decorators, target, key, kind) => { 24342 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3r(target, key) : target; 24343 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 24344 if (decorator = decorators[i2]) 24345 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 24346 if (kind && result) __defProp$3p(target, key, result); 24347 return result; 24348 }; 24349 let SonicCartRemaining = class extends Subscriber$1(i$6) { 24350 constructor() { 24351 super(...arguments); 24352 this.remaining_time = false; 24353 this.expired_at = null; 24354 this.noIcon = false; 24355 this.displayExpired = true; 24356 this.expired = false; 24357 this.remaining_time_string = ""; 24358 this.wording_expire = ""; 24359 } 24360 willUpdate(changedProperties) { 24361 super.willUpdate(changedProperties); 24362 if (changedProperties.has("expired_at") && this.expired_at) { 24363 this.remaining_time = this.expired_at; 24364 } 24365 if (changedProperties.has("remaining_time")) { 24366 if (this.remaining_time) { 24367 const update_countdown_id = setInterval(() => { 24368 this.updateCartCountdown(update_countdown_id); 24369 }, 1e3); 24370 } else { 24371 this.remaining_time_string = ""; 24372 } 24373 } 24374 } 24375 updateCartCountdown(update_countdown_id) { 24376 const endTimestamp = this.remaining_time; 24377 if (!endTimestamp) { 24378 clearInterval(update_countdown_id); 24379 return; 24380 } 24381 const endDate = new Date(endTimestamp * 1e3).getTime(); 24382 const startDate = Date.now(); 24383 const countdown = (endDate - startDate) / 1e3; 24384 this.formatCountdown(countdown); 24385 } 24386 formatCountdown(countdown) { 24387 this.expired = countdown < 0; 24388 if (countdown >= 0) { 24389 const hours = Math.floor(countdown / 3600); 24390 const mins = Math.floor(countdown % 3600 / 60); 24391 const secs = Math.floor(countdown % 60); 24392 const renderHour = hours ? `${hours.toString().padStart(2, "0")}:` : ""; 24393 this.remaining_time_string = `${renderHour}${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`; 24394 } 24395 } 24396 render() { 24397 if (this.expired && this.displayExpired) { 24398 return b$1` <span> 24399 ${!this.noIcon ? b$1`<sonic-icon library="custom" name="arrow-rotate-left"></sonic-icon>` : A$1} 24400 ${this.wording_expire} 24401 </span>`; 24402 } 24403 if (this.remaining_time_string) { 24404 return b$1`<span class="flex items-center gap-1" 24405 >${!this.noIcon ? b$1`<sonic-icon library="custom" name="clock" size="sm"></sonic-icon>` : A$1} 24406 ${this.remaining_time_string}</span 24407 >`; 24408 } 24409 return A$1; 24410 } 24411 }; 24412 SonicCartRemaining.styles = [ 24413 i$9` 24414 :host { 24415 display: inline-flex; 24416 align-items: center; 24417 min-width: 8ch; 24418 font-weight: bold; 24419 line-height: 1; 24420 gap: 0.25em; 24421 } 24422 24423 :host([badge]) { 24424 display: inline-flex; 24425 background-color: var(--sc-danger); 24426 color: var(--sc-danger-content); 24427 border-radius: 100px; 24428 padding: calc(1px + max(0.15em, 2.5px)) 0.4em max(0.15em, 2.5px); 24429 font-weight: bold; 24430 justify-content: center; 24431 align-items: center; 24432 line-height: 1; 24433 min-width: 8ch; 24434 font-family: "Roboto Mono", "Consolas", monospace; 24435 } 24436 24437 span { 24438 white-space: nowrap; 24439 display: flex; 24440 gap: 0.25em; 24441 } 24442 ` 24443 ]; 24444 __decorateClass$3s([ 24445 n$5({ type: Number }) 24446 ], SonicCartRemaining.prototype, "remaining_time", 2); 24447 __decorateClass$3s([ 24448 n$5({ type: Number }) 24449 ], SonicCartRemaining.prototype, "expired_at", 2); 24450 __decorateClass$3s([ 24451 n$5({ type: Boolean }) 24452 ], SonicCartRemaining.prototype, "noIcon", 2); 24453 __decorateClass$3s([ 24454 n$5({ type: Boolean }) 24455 ], SonicCartRemaining.prototype, "displayExpired", 2); 24456 __decorateClass$3s([ 24457 r$5() 24458 ], SonicCartRemaining.prototype, "expired", 2); 24459 __decorateClass$3s([ 24460 n$5({ type: String }) 24461 ], SonicCartRemaining.prototype, "remaining_time_string", 2); 24462 __decorateClass$3s([ 24463 n$5({ type: String }) 24464 ], SonicCartRemaining.prototype, "wording_expire", 2); 24465 SonicCartRemaining = __decorateClass$3s([ 24466 t$3("sonic-cart-remaining-time") 24467 ], SonicCartRemaining); 24468 var __defProp$3o = Object.defineProperty; 24469 var __getOwnPropDesc$3q = Object.getOwnPropertyDescriptor; 24470 var __decorateClass$3r = (decorators, target, key, kind) => { 24471 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3q(target, key) : target; 24472 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 24473 if (decorator = decorators[i2]) 24474 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 24475 if (kind && result) __defProp$3o(target, key, result); 24476 return result; 24477 }; 24478 let WaitingCart = class extends Subscriber$1(i$6) { 24479 constructor() { 24480 super(...arguments); 24481 this.link = null; 24482 } 24483 updateBadge() { 24484 this.publisher.invalidate(); 24485 } 24486 render() { 24487 if (this.link) { 24488 return b$1`<span> ! </span>`;
24489 } 24490 return A$1; 24491 } 24492 }; 24493 WaitingCart.styles = [ 24494 tailwind, 24495 i$9` 24496 :host { 24497 display: inline-flex; 24498 font-size: clamp(10px, 0.5em, 1rem); 24499 background-color: var(--sc-danger); 24500 color: var(--sc-danger-content); 24501 border-radius: 100px; 24502 width: 1.5em; 24503 height: 1.5em; 24504 font-weight: bold; 24505 justify-content: center; 24506 align-items: center; 24507 line-height: 1; 24508 white-space: nowrap; /* fix bug #42622 */ 24509 } 24510 ` 24511 ]; 24512 __decorateClass$3r([ 24513 n$5({ type: String }) 24514 ], WaitingCart.prototype, "link", 2); 24515 __decorateClass$3r([ 24516 onAssign$1("cart/current.data.quantity") 24517 ], WaitingCart.prototype, "updateBadge", 1); 24518 WaitingCart = __decorateClass$3r([ 24519 t$3("sonic-waiting-cart") 24520 ], WaitingCart); 24521 const r = (r2, o2, t2) => { 24522 for (const t3 of o2) if (t3[0] === r2) return (0, t3[1])(); 24523 return t2?.(); 24524 }; 24525 function* o(o2, t2) { 24526 const f2 = "function" == typeof t2; 24527 if (void 0 !== o2) { 24528 let i2 = -1; 24529 for (const n2 of o2) i2 > -1 && (yield f2 ? t2(i2) : t2), i2++, yield n2; 24530 } 24531 } 24532 var __decorate$s = function(decorators, target, key, desc) { 24533 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 24534 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 24535 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; 24536 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 24537 }; 24538 const tagName$2c = "sonic-menu-item"; 24539 let MenuItem = class MenuItem extends Button { 24540 constructor() { 24541 super(); 24542 } 24543 connectedCallback() { 24544 if (!this.hasAttribute("variant")) { 24545 this.variant = "ghost"; 24546 } 24547 if (!this.hasAttribute("type")) { 24548 this.type = "default"; 24549 } 24550 if (!this.hasAttribute("shape")) { 24551 this.shape = "block"; 24552 } 24553 const isSquareOrCircle = this.shape === "square" || this.shape === "circle"; 24554 if (!this.hasAttribute("align") && !isSquareOrCircle) { 24555 this.align = "left"; 24556 } 24557 super.connectedCallback(); 24558 } 24559 }; 24560 MenuItem = __decorate$s([ 24561 t$3(tagName$2c) 24562 ], MenuItem); 24563 var __defProp$3n = Object.defineProperty; 24564 var __getOwnPropDesc$3p = Object.getOwnPropertyDescriptor; 24565 var __decorateClass$3q = (decorators, target, key, kind) => { 24566 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3p(target, key) : target; 24567 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 24568 if (decorator = decorators[i2]) 24569 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 24570 if (kind && result) __defProp$3n(target, key, result); 24571 return result; 24572 }; 24573 const tagName$2b = "sonic-form-event-category-item"; 24574 let SonicFormEventCategoryItem = class extends Subscriber$1(i$6) { 24575 constructor() { 24576 super(...arguments); 24577 this.title = ""; 24578 this.id = ""; 24579 this.display = false; 24580 this.filter = false; 24581 this.type = "filter"; 24582 this.size = "inherit"; 24583 } 24584 render() { 24585 if (this.type === "display" && !this.display) return A$1; 24586 if (this.type === "filter" && !this.filter) return A$1; 24587 return b$1`<sonic-menu-item 24588 .size=${this.size || "sm"} 24589 type="default" 24590 radio 24591 value="${this.id}" 24592 id="category_${this.id}" 24593 name="ids_category" 24594 > 24595 ${this.title} 24596 </sonic-menu-item>`; 24597 } 24598 }; 24599 __decorateClass$3q([ 24600 n$5({ type: String }) 24601 ], SonicFormEventCategoryItem.prototype, "title", 2); 24602 __decorateClass$3q([ 24603 n$5({ type: String }) 24604 ], SonicFormEventCategoryItem.prototype, "id", 2); 24605 __decorateClass$3q([ 24606 n$5({ type: Boolean }) 24607 ], SonicFormEventCategoryItem.prototype, "display", 2); 24608 __decorateClass$3q([ 24609 n$5({ type: Boolean }) 24610 ], SonicFormEventCategoryItem.prototype, "filter", 2); 24611 __decorateClass$3q([ 24612 n$5({ type: String }) 24613 ], SonicFormEventCategoryItem.prototype, "type", 2); 24614 __decorateClass$3q([ 24615 n$5({ type: String }) 24616 ], SonicFormEventCategoryItem.prototype, "size", 2); 24617 SonicFormEventCategoryItem = __decorateClass$3q([ 24618 t$3(tagName$2b) 24619 ], SonicFormEventCategoryItem); 24620 const shadowable = i$9` 24621 /*OMBRE*/ 24622 :host([shadow]) .shadowable, 24623 :host([shadow="md"]) .shadowable, 24624 :host([shadow="true"]) .shadowable { 24625 box-shadow: var(--sc-shadow); 24626 } 24627 24628 :host([shadow="sm"]) .shadowable { 24629 box-shadow: var(--sc-shadow-sm); 24630 } 24631 24632 :host([shadow="lg"]) .shadowable { 24633 box-shadow: var(--sc-shadow-lg); 24634 } 24635 24636 :host([shadow="none"]) .shadowable { 24637 box-shadow: none; 24638 } 24639`; 24640 var __decorate$r = function(decorators, target, key, desc) { 24641 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 24642 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 24643 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; 24644 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 24645 }; 24646 var Pop_1; 24647 const tagName$2a = "sonic-pop"; 24648 let Pop = Pop_1 = class Pop extends i$6 { 24649 constructor() { 24650 super(...arguments); 24651 this.open = false;
vendor: 5,490 bytes, lines 24652-24797
24652 this.noToggle = false; 24653 this.inline = false; 24654 this.manual = false; 24655 this.shadow = "lg"; 24656 this.placement = "bottom"; 24657 this.positioningRuns = false; 24658 this.lastContentX = 0; 24659 this.lastContentY = 0; 24660 this.resizeObserver = new ResizeObserver(() => this.computePosition(this.placement)); 24661 this.triggerElement = null; 24662 this.ancestorsHavingZIndex = /* @__PURE__ */ new Set(); 24663 this._handleKeyDown = (e2) => { 24664 if (e2.key === "Escape" && this.open) { 24665 e2.stopPropagation(); 24666 this.hide(); 24667 } 24668 }; 24669 } 24670 runPositioningLoop() { 24671 if (!this.positioningRuns) 24672 return; 24673 this.positioningRuns = true; 24674 this.computePosition(this.placement); 24675 window.requestAnimationFrame(() => this.runPositioningLoop()); 24676 } 24677 toggle(e2) { 24678 if (this.open && this.noToggle) 24679 return; 24680 const keyboardEvent = e2; 24681 if (e2.type == "keydown" && (keyboardEvent.key != "ArrowDown" || this.open)) 24682 return; 24683 if (!this.open) { 24684 this.triggerElement = e2.target; 24685 } 24686 this.open = !this.open; 24687 this.open ? this.show() : this.hide(); 24688 } 24689 show() { 24690 this.setMaxZindex(); 24691 this.popContent?.style?.removeProperty("display"); 24692 this.open = true; 24693 this.popContent.setAttribute("tabindex", "0"); 24694 if (this.popBtn && this.popContent && !this.positioningRuns) { 24695 this.positioningRuns = true; 24696 this.lastContentX = 0; 24697 this.lastContentY = 0; 24698 this.runPositioningLoop(); 24699 } 24700 this.dispatchEvent(new CustomEvent("show")); 24701 } 24702 hide() { 24703 this.resetZindexes(); 24704 this.open = false; 24705 this.popContent.setAttribute("tabindex", "-1"); 24706 this.positioningRuns = false; 24707 if (this.triggerElement) { 24708 this.triggerElement.focus(); 24709 this.triggerElement = null; 24710 } 24711 Object.assign(this.popContent.style, { 24712 left: `${this.lastContentX}px`, 24713 top: `${this.lastContentY}px` 24714 }); 24715 this.dispatchEvent(new CustomEvent("hide")); 24716 } 24717 setMaxZindex() { 24718 HTML$1.everyAncestors(this, (parent) => { 24719 const htmlElement = parent; 24720 if (!htmlElement.className) 24721 return true; 24722 if ([...htmlElement.classList].includes("@container")) { 24723 const style = htmlElement.style; 24724 style.zIndex = "999999999"; 24725 const computedStyle = getComputedStyle(htmlElement); 24726 if (computedStyle.position !== "relative" && computedStyle.position !== "absolute") { 24727 style.position = "relative"; 24728 } 24729 this.ancestorsHavingZIndex.add(parent); 24730 return false; 24731 } 24732 return true; 24733 }); 24734 } 24735 resetZindexes() { 24736 this.ancestorsHavingZIndex.forEach((elt) => { 24737 elt.style.removeProperty("position"); 24738 elt.style.removeProperty("z-index"); 24739 }); 24740 this.ancestorsHavingZIndex.clear(); 24741 } 24742 _handleClosePop(e2) { 24743 const path = e2.composedPath(); 24744 const target = path[0]; 24745 Pop_1.pops.forEach((pop) => { 24746 const popContainsTarget = path.includes(pop); 24747 const popContentContainsTarget = path.includes(pop.querySelector('[slot="content"]')); 24748 const isCloseManual = HTML$1.getAncestorAttributeValue(target, "data-on-select") === "keep"; 24749 if (e2.type == "pointerdown" && popContainsTarget) 24750 return; 24751 if (e2.type == "click" && (popContainsTarget && isCloseManual || !popContentContainsTarget)) 24752 return; 24753 pop.hide(); 24754 }); 24755 } 24756 connectedCallback() { 24757 super.connectedCallback(); 24758 if (Pop_1.pops.size == 0) { 24759 document.addEventListener("pointerdown", this._handleClosePop); 24760 document.addEventListener("click", this._handleClosePop); 24761 document.addEventListener("keydown", this._handleKeyDown); 24762 } 24763 Pop_1.pops.add(this); 24764 } 24765 // /* 24766 // On attends le premier rendu pour observer les changements de taille car popup content n'est pas encore défini sinon 24767 // */ 24768 firstUpdated(_changedProperties) { 24769 super.firstUpdated(_changedProperties); 24770 this.resizeObserver.observe(this.popContent); 24771 } 24772 disconnectedCallback() { 24773 if (this.popContent) { 24774 this.resizeObserver.unobserve(this.popContent); 24775 } 24776 super.disconnectedCallback(); 24777 Pop_1.pops.delete(this); 24778 if (Pop_1.pops.size == 0) { 24779 document.removeEventListener("pointerdown", this._handleClosePop); 24780 document.removeEventListener("click", this._handleClosePop); 24781 document.removeEventListener("keydown", this._handleKeyDown); 24782 } 24783 } 24784 computePosition(placement) { 24785 const placementSplit = placement.split(" "); 24786 const placementBase = placementSplit[0]; 24787 let placementSec = placementSplit[1]; 24788 const padding = 5; 24789 const thisRect = this.getBoundingClientRect(); 24790 const scrollableAncestor = HTML$1.getScrollableAncestor(this.popContent); 24791 const scrollableAncestorRect = scrollableAncestor?.getBoundingClientRect(); 24792 const minX = Math.max(0, scrollableAncestorRect?.left || 0) + padding; 24793 const minY = Math.max(0, scrollableAncestorRect?.top || 0) + padding; 24794 const maxX = Math.min(window.innerWidth, scrollableAncestorRect?.right || window.innerWidth) - padding; 24795 const maxY = Math.min(window.innerHeight, scrollableAncestorRect?.bottom || window.innerHeight) - padding; 24796 const x0 = thisRect.left; 24797 const y0 = thisRect.top;
24798 let x2 = x0, y2 = y0; 24799 let contentRect = this.popContent?.getBoundingClientRect(); 24800 const yTop = y0 - contentRect.height; 24801 const xLeft = x0 - contentRect.width; 24802 const xRight = x0 + thisRect.width; 24803 const yBottom = y0 + thisRect.height; 24804 const xCenter = x0 + (thisRect.width - contentRect.width) * 0.5; 24805 const yCenter = y0 + (thisRect.height - contentRect.height) * 0.5; 24806 switch (placementBase) { 24807 case "bottom": 24808 y2 = yBottom; 24809 if (placementSec == "center") { 24810 x2 = xCenter; 24811 } 24812 break; 24813 case "top": 24814 y2 = yTop; 24815 if (placementSec == "center") { 24816 x2 = xCenter; 24817 } 24818 break; 24819 case "left": 24820 x2 = xLeft; 24821 if (placementSec == "center") { 24822 y2 = yCenter; 24823 } 24824 break; 24825 case "right": 24826 x2 = xRight; 24827 if (placementSec == "center") { 24828 y2 = yCenter; 24829 } 24830 break; 24831 } 24832 this.lastContentX += x2 - contentRect.x; 24833 this.lastContentY += y2 - contentRect.y; 24834 Object.assign(this.popContent.style, { 24835 left: `${this.lastContentX}px`, 24836 top: `${this.lastContentY}px` 24837 }); 24838 contentRect = this.popContent?.getBoundingClientRect(); 24839 if (contentRect.x < minX && placementBase == "left") 24840 x2 = xRight; 24841 if (contentRect.y < minY && placementBase == "top") 24842 y2 = yBottom; 24843 if (contentRect.x + contentRect.width > maxX && placementBase == "right") 24844 x2 = xLeft; 24845 if (contentRect.y + contentRect.height > maxY && placementBase == "bottom") 24846 y2 = yTop; 24847 this.lastContentX += x2 - contentRect.x; 24848 this.lastContentY += y2 - contentRect.y; 24849 Object.assign(this.popContent.style, { 24850 left: `${this.lastContentX}px`, 24851 top: `${this.lastContentY}px` 24852 }); 24853 contentRect = this.popContent?.getBoundingClientRect(); 24854 if (contentRect.x < minX) { 24855 this.lastContentX += minX - contentRect.x; 24856 } 24857 if (contentRect.y < minY) { 24858 this.lastContentY += minY - contentRect.y; 24859 } 24860 Object.assign(this.popContent.style, { 24861 left: `${this.lastContentX}px`, 24862 top: `${this.lastContentY}px` 24863 }); 24864 contentRect = this.popContent?.getBoundingClientRect(); 24865 if (contentRect.x + contentRect.width > maxX) { 24866 this.lastContentX += maxX - (contentRect.x + contentRect.width); 24867 } 24868 if (contentRect.y + contentRect.height > maxY) { 24869 this.lastContentY += maxY - (contentRect.y + contentRect.height); 24870 } 24871 Object.assign(this.popContent.style, { 24872 left: `${this.lastContentX}px`, 24873 top: `${this.lastContentY}px` 24874 }); 24875 } 24876 render() { 24877 return b$1` 24878 <slot 24879 @click=${this.manual ? () => { 24880 } : this.toggle} 24881 @keydown=${this.manual ? () => { 24882 } : this.toggle} 24883 class="contents" 24884 ></slot> 24885 <slot 24886 name="content" 24887 tabindex="-1" 24888 part="content" 24889 style="display: none;" 24890 class="shadowable 24891 ${this.open ? "is-open" : ""}" 24892 ></slot> 24893 `; 24894 } 24895 }; 24896 Pop.pops = /* @__PURE__ */ new Set(); 24897 Pop.styles = [ 24898 i$9` 24899 :host { 24900 display: inline-block; 24901 vertical-align: middle; 24902 } 24903 24904 slot[name="content"] { 24905 max-width: 100vw; 24906 background-color: var(--sc-base, #fff); 24907 position: fixed; 24908 z-index: 99999; 24909 display: block; 24910 transform: translateY(1rem) scale(0.95); 24911 opacity: 0; 24912 pointer-events: none; 24913 transition-duration: 0.15s; 24914 transition-timing-function: ease; 24915 transition-property: all; 24916 border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em); 24917 } 24918 24919 slot[name="content"].is-open:not(.is-empty) { 24920 transform: translateY(0) scale(1); 24921 opacity: 1; 24922 pointer-events: auto; 24923 transition-property: scale, opacity; 24924 transition-timing-function: cubic-bezier(0.25, 0.25, 0.42, 1.225); 24925 } 24926 24927 :host([inline]) { 24928 vertical-align: baseline; 24929 } 24930 `, 24931 shadowable 24932 ]; 24933 __decorate$r([ 24934 r$5() 24935 ], Pop.prototype, "open", void 0); 24936 __decorate$r([ 24937 e$7("slot:not([name=content])") 24938 ], Pop.prototype, "popBtn", void 0); 24939 __decorate$r([ 24940 e$7("slot[name=content]") 24941 ], Pop.prototype, "popContent", void 0); 24942 __decorate$r([ 24943 n$5({ type: Boolean }) 24944 ], Pop.prototype, "noToggle", void 0); 24945 __decorate$r([ 24946 n$5({ type: Boolean, reflect: true }) 24947 ], Pop.prototype, "inline", void 0); 24948 __decorate$r([ 24949 n$5({ type: Boolean }) 24950 ], Pop.prototype, "manual", void 0); 24951 __decorate$r([ 24952 n$5({ type: String, reflect: true }) 24953 ], Pop.prototype, "shadow", void 0); 24954 __decorate$r([ 24955 n$5({ type: String }) 24956 ], Pop.prototype, "placement", void 0); 24957 __decorate$r([ 24958 r$5() 24959 ], Pop.prototype, "triggerElement", void 0); 24960 Pop = Pop_1 = __decorate$r([ 24961 t$3(tagName$2a) 24962 ], Pop); 24963 var __decorate$q = function(decorators, target, key, desc) { 24964 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 24965 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 24966 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; 24967 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 24968 }; 24969 const queryAssignedElements = (options) => { 24970 return o$8(options); 24971 }; 24972 const tagName$29 = "sonic-menu"; 24973 let MenuItems = class MenuItems extends i$6 { 24974 constructor() { 24975 super(...arguments); 24976 this.direction = "column"; 24977 this.gap = "var(--sc-menu-gap)"; 24978 this.align = "left"; 24979 this.shadow = null; 24980 this.moreShape = "circle"; 24981 this.scrollable = false;
vendor: 4,721 bytes, lines 24982-25122
24982 this.observer = null; 24983 this.attributeObserver = null; 24984 this.minWidth = "0"; 24985 this.hasMoreElements = false; 24986 this.handleScrollEnd = () => { 24987 this.setScrollShadow(this.menuContent, this.direction); 24988 }; 24989 this.updateIsScollable = () => { 24990 if (this.scrollable) { 24991 this.initScrollable(); 24992 this.setScrollShadow(this.menuContent, this.direction); 24993 } 24994 }; 24995 } 24996 checkIfMore() { 24997 this.hasMoreElements = !!this.moreElements?.length; 24998 } 24999 moreSlotChange() { 25000 this.checkIfMore(); 25001 this.updateIsScollable(); 25002 } 25003 updated(_changedProperties) { 25004 const moreBtn = this.querySelector(".more-btn"); 25005 if (this.size && moreBtn) { 25006 moreBtn.setAttribute("size", this.size); 25007 } 25008 super.updated(_changedProperties); 25009 } 25010 setDividersSize(assignedElements) { 25011 assignedElements.forEach((elt) => { 25012 elt.setAttribute("size", "sm"); 25013 this.direction == "row" ? elt.style.setProperty("margin", "0 .1rem ") : elt.style.setProperty("margin", " 0.1rem 0"); 25014 }); 25015 } 25016 mainSlotChange() { 25017 this.setChildrenSize(this.menuChildren); 25018 this.setDividersSize(this.menuChildren); 25019 this.updateIsScollable(); 25020 this.updateScrollPosition(); 25021 this.observeMenuItemsAttributes(); 25022 } 25023 observeMenuItemsAttributes() { 25024 this.attributeObserver?.disconnect(); 25025 this.attributeObserver = new MutationObserver(() => { 25026 this.updateScrollPosition(); 25027 }); 25028 this.menuChildren.forEach((item) => { 25029 this.attributeObserver.observe(item, { 25030 attributes: true, 25031 attributeFilter: ["active"] 25032 }); 25033 }); 25034 } 25035 updateScrollPosition() { 25036 if (this.scrollable) { 25037 const activeItems = this.menuChildren.filter((item) => item.hasAttribute("active") && item.getAttribute("active") !== "false"); 25038 if (activeItems.length === 1) { 25039 requestAnimationFrame(() => { 25040 activeItems[0].scrollIntoView({ 25041 behavior: "smooth", 25042 block: "nearest", 25043 inline: "center" 25044 }); 25045 }); 25046 } 25047 } 25048 } 25049 connectedCallback() { 25050 this.observer = new ResizeObserver(this.updateIsScollable); 25051 this.observer.observe(this); 25052 super.connectedCallback(); 25053 } 25054 firstUpdated(_changedProperties) { 25055 this.menuContent.addEventListener("scrollend", this.handleScrollEnd); 25056 } 25057 disconnectedCallback() { 25058 this.observer?.disconnect(); 25059 this.attributeObserver?.disconnect(); 25060 this.menuContent.removeEventListener("scrollend", this.handleScrollEnd); 25061 super.disconnectedCallback(); 25062 } 25063 initScrollable() { 25064 let isDown = false; 25065 let startX; 25066 let scrollLeft; 25067 if (this.scrollable) { 25068 this.addEventListener("mousedown", (e2) => { 25069 isDown = true; 25070 this.classList.add("active"); 25071 startX = e2.pageX - this.menuContent.offsetLeft; 25072 scrollLeft = this.menuContent.scrollLeft; 25073 }); 25074 this.addEventListener("mouseleave", () => { 25075 isDown = false; 25076 this.classList.remove("active"); 25077 }); 25078 this.addEventListener("mouseup", () => { 25079 isDown = false; 25080 this.classList.remove("active"); 25081 }); 25082 this.addEventListener("mousemove", (e2) => { 25083 if (!isDown) 25084 return; 25085 e2.preventDefault(); 25086 const x2 = e2.pageX - this.menuContent.offsetLeft; 25087 const walk = (x2 - startX) * 1.5; 25088 this.menuContent.scrollLeft = scrollLeft - walk; 25089 this.setScrollShadow(this.menuContent, this.direction); 25090 }); 25091 this.addEventListener("scroll", (e2) => { 25092 e2.preventDefault(); 25093 this.setScrollShadow(this.menuContent, this.direction); 25094 }); 25095 } 25096 } 25097 setScrollShadow(target, direction) { 25098 if (direction == "row") { 25099 if (target.scrollLeft > 0) { 25100 this.classList.add("shadow-left"); 25101 } else { 25102 this.classList.remove("shadow-left"); 25103 } 25104 if (target.scrollLeft < target.scrollWidth - target.offsetWidth) { 25105 this.classList.add("shadow-right"); 25106 } else { 25107 this.classList.remove("shadow-right"); 25108 } 25109 } else if (direction == "column") { 25110 if (target.scrollTop > 0) { 25111 this.classList.add("shadow-top"); 25112 } else { 25113 this.classList.remove("shadow-top"); 25114 } 25115 if (target.scrollTop < target.scrollHeight - (target.offsetHeight + 1)) { 25116 this.classList.add("shadow-bottom"); 25117 } else { 25118 this.classList.remove("shadow-bottom"); 25119 } 25120 } 25121 } 25122 setChildrenSize(menuItems) {
25123 menuItems.forEach((elt) => { 25124 if (this.size) { 25125 elt.setAttribute("size", this.size); 25126 } 25127 if (this.align) { 25128 if (elt.getAttribute("shape") != "square" && elt.getAttribute("shape") != "circle") { 25129 elt.setAttribute("align", this.align); 25130 } 25131 } 25132 if (this.direction == "row") { 25133 if (elt.getAttribute("shape") == "block") { 25134 elt.setAttribute("shape", "default"); 25135 } 25136 } 25137 }); 25138 } 25139 render() { 25140 const menuStyles = { 25141 minWidth: this.minWidth, 25142 flexDirection: this.direction 25143 }; 25144 const isMenuRow = this.direction == "row"; 25145 const menuContentStyles = { 25146 gap: this.gap, 25147 flexDirection: this.direction 25148 }; 25149 const popStyles = { 25150 display: "block", 25151 alignSelf: isMenuRow ? "center" : "flex-start", 25152 justifySelf: "center", 25153 flexDirection: this.direction 25154 }; 25155 const popBtnStyles = { 25156 marginLeft: isMenuRow ? "" : ".55em" 25157 }; 25158 return b$1`<menu 25159 part="menu" 25160 class="shadowable" 25161 style=${o$3(menuStyles)} 25162 > 25163 <slot 25164 @slotchange=${this.mainSlotChange} 25165 id="menu-content" 25166 style=${o$3(menuContentStyles)} 25167 ></slot> 25168 <sonic-pop 25169 style=${o$3(popStyles)} 25170 class=${!this.hasMoreElements ? "hidden" : ""} 25171 > 25172 <sonic-menu-item 25173 style=${o$3(popBtnStyles)} 25174 class="more-btn" 25175 shape=${this.moreShape} 25176 align="center" 25177 > 25178 <sonic-icon 25179 size="xl" 25180 name=${isMenuRow ? "more-vert" : "more-horiz"} 25181 ></sonic-icon> 25182 </sonic-menu-item> 25183 <slot 25184 name="more" 25185 @slotchange=${this.moreSlotChange} 25186 slot="content" 25187 ></slot> 25188 </sonic-pop> 25189 </menu>`; 25190 } 25191 }; 25192 MenuItems.styles = [ 25193 i$9` 25194 :host { 25195 display: block; 25196 --sc-menu-gap: 0.15rem; 25197 } 25198 25199 :host > menu { 25200 display: flex; 25201 padding: 0; 25202 margin: 0; 25203 } 25204 25205 .hidden { 25206 display: none !important; 25207 } 25208 25209 /* SCROLLABLE*/ 25210 #menu-content { 25211 display: flex; 25212 padding: 0.35em; 25213 margin: 0; 25214 } 25215 25216 :host([scrollable]) #menu-content { 25217 scrollbar-width: none; 25218 max-width: 100%; 25219 -ms-overflow-style: none; 25220 scroll-snap-align: start; 25221 white-space: nowrap; 25222 border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em); 25223 transition: mask-image 0.15s linear; 25224 } 25225 25226 :host([scrollable][direction="row"]) #menu-content { 25227 overflow-x: scroll; 25228 scroll-snap-align: start; 25229 scroll-snap-type: x mandatory; 25230 } 25231 :host([scrollable][direction="column"]) #menu-content { 25232 overflow-y: scroll; 25233 scroll-snap-align: start; 25234 scroll-snap-type: y mandatory; 25235 } 25236 :host([scrollable])::-webkit-scrollbar {
25237 display: none !important; 25238 } 25239 :host([scrollable][direction="row"].shadow-right) #menu-content { 25240 -webkit-mask-image: linear-gradient( 25241 to left, 25242 rgba(0, 0, 0, 0), 25243 rgba(0, 0, 0, 1) 10% 25244 ); 25245 mask-image: linear-gradient( 25246 to left, 25247 rgba(0, 0, 0, 0), 25248 rgba(0, 0, 0, 1) 10% 25249 ); 25250 } 25251 :host([scrollable][direction="row"].shadow-left) #menu-content { 25252 -webkit-mask-image: linear-gradient( 25253 to right, 25254 rgba(0, 0, 0, 0), 25255 rgba(0, 0, 0, 1) 10% 25256 ); 25257 mask-image: linear-gradient( 25258 to right, 25259 rgba(0, 0, 0, 0), 25260 rgba(0, 0, 0, 1) 10% 25261 ); 25262 } 25263 :host([scrollable][direction="row"].shadow-left.shadow-right) 25264 #menu-content { 25265 -webkit-mask-image: linear-gradient( 25266 to right, 25267 rgba(0, 0, 0, 0) 0%, 25268 rgba(0, 0, 0, 1) 10%, 25269 rgba(0, 0, 0, 1) 90%, 25270 rgba(0, 0, 0, 0) 100% 25271 ); 25272 mask-image: linear-gradient( 25273 to right, 25274 rgba(0, 0, 0, 0) 0%, 25275 rgba(0, 0, 0, 1) 10%, 25276 rgba(0, 0, 0, 1) 90%, 25277 rgba(0, 0, 0, 0) 100% 25278 ); 25279 } 25280 :host([scrollable][direction="column"].shadow-top) #menu-content { 25281 -webkit-mask-image: linear-gradient( 25282 to bottom, 25283 rgba(0, 0, 0, 0), 25284 rgba(0, 0, 0, 1) 10% 25285 );queryAssignedElements 25286 mask-image: linear-gradient( 25287 to bottom, 25288 rgba(0, 0, 0, 0), 25289 rgba(0, 0, 0, 1) 10% 25290 ); 25291 } 25292 :host([scrollable][direction="column"].shadow-bottom) #menu-content { 25293 -webkit-mask-image: linear-gradient( 25294 to top, 25295 rgba(0, 0, 0, 0), 25296 rgba(0, 0, 0, 1) 10% 25297 ); 25298 mask-image: linear-gradient( 25299 to top, 25300 rgba(0, 0, 0, 0), 25301 rgba(0, 0, 0, 1) 10% 25302 ); 25303 } 25304 :host([scrollable][direction="column"].shadow-top.shadow-bottom) 25305 #menu-content { 25306 -webkit-mask-image: linear-gradient( 25307 to top, 25308 rgba(0, 0, 0, 0) 0%, 25309 rgba(0, 0, 0, 1) 10%, 25310 rgba(0, 0, 0, 1) 90%, 25311 rgba(0, 0, 0, 0) 100% 25312 ); 25313 mask-image: linear-gradient( 25314 to bottom, 25315 rgba(0, 0, 0, 0) 0%, 25316 rgba(0, 0, 0, 1) 10%, 25317 rgba(0, 0, 0, 1) 90%, 25318 rgba(0, 0, 0, 0) 100% 25319 ); 25320 } 25321 `, 25322 shadowable 25323 ]; 25324 __decorate$q([ 25325 n$5({ type: String, reflect: true }) 25326 ], MenuItems.prototype, "size", void 0); 25327 __decorate$q([ 25328 n$5({ type: String, reflect: true }) 25329 ], MenuItems.prototype, "direction", void 0); 25330 __decorate$q([ 25331 n$5({ type: String }) 25332 ], MenuItems.prototype, "gap", void 0); 25333 __decorate$q([ 25334 n$5({ type: String, reflect: true }) 25335 ], MenuItems.prototype, "align", void 0); 25336 __decorate$q([ 25337 n$5({ type: String, reflect: true }) 25338 ], MenuItems.prototype, "shadow", void 0); 25339 __decorate$q([ 25340 n$5({ type: String }) 25341 ], MenuItems.prototype, "moreShape", void 0); 25342 __decorate$q([ 25343 n$5({ type: Boolean }) 25344 ], MenuItems.prototype, "scrollable", void 0); 25345 __decorate$q([ 25346 n$5({ type: String }) 25347 ], MenuItems.prototype, "minWidth", void 0); 25348 __decorate$q([ 25349 e$7("menu") 25350 ], MenuItems.prototype, "menu", void 0); 25351 __decorate$q([ 25352 e$7("#menu-content") 25353 ], MenuItems.prototype, "menuContent", void 0); 25354 __decorate$q([ 25355 queryAssignedElements({ selector: "*" }) 25356 ], MenuItems.prototype, "menuChildren", void 0); 25357 __decorate$q([ 25358 queryAssignedElements({ slot: "more", selector: "*" }) 25359 ], MenuItems.prototype, "moreElements", void 0); 25360 __decorate$q([ 25361 r$5() 25362 ], MenuItems.prototype, "hasMoreElements", void 0); 25363 MenuItems = __decorate$q([ 25364 t$3(tagName$29) 25365 ], MenuItems); 25366 var __defProp$3m = Object.defineProperty; 25367 var __getOwnPropDesc$3o = Object.getOwnPropertyDescriptor; 25368 var __decorateClass$3p = (decorators, target, key, kind) => { 25369 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3o(target, key) : target; 25370 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 25371 if (decorator = decorators[i2]) 25372 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 25373 if (kind && result) __defProp$3m(target, key, result); 25374 return result; 25375 }; 25376 let SonicFormEventCategory = class extends Fetcher$1(Subscriber$1(i$6)) { 25377 constructor() { 25378 super(...arguments); 25379 this.dataProvider = "category"; 25380 this.hasCategory = false;
25381 this.onlyFilterCategories = []; 25382 this.data = null; 25383 } 25384 willUpdate(_changedProperties) { 25385 if (_changedProperties.has("data") && this.data) { 25386 this.onlyFilterCategories = this.data.filter((category) => category.filter === true); 25387 } else if (!this.data) { 25388 this.onlyFilterCategories = []; 25389 } 25390 super.willUpdate(_changedProperties); 25391 } 25392 render() { 25393 const isMobile = window?.innerWidth < 1024; 25394 return b$1` 25395 ${this.onlyFilterCategories?.length ? b$1`<sonic-pop> 25396 <div class="relative"> 25397 <sonic-button 25398 size="${this.size || "md"}" 25399 data-aria-label=${o$4(t("filter"))} 25400 .shape=${isMobile ? "square" : "default"} 25401 > 25402 ${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> 25403 <span> ${t("filter")} </span> `} 25404 </sonic-button> 25405 ${this.hasCategory ? b$1` <sonic-badge class="absolute top-[-.3em] left-[.3em]" size="xs" type="danger"></sonic-badge>` : A$1} 25406 </div> 25407 <sonic-menu class="max-h-[45vh] lg:max-h-[50vh] overflow-auto" slot="content" minWidth="15rem"> 25408 <sonic-menu-item size=${this.size || "sm"} type="default" name="ids_category" value="" radio 25409 >${t("all_categories")}</sonic-menu-item 25410 > 25411 <sonic-list 25412 displayContents 25413 dataProvider="categories_filtered" 25414 .props=${this.onlyFilterCategories} 25415 .items=${() => b$1`<sonic-form-event-category-item size=${this.size || "sm"}></sonic-form-event-category-item>`} 25416 > 25417 </sonic-list> 25418 </sonic-menu> 25419 </sonic-pop>` : A$1} 25420 `; 25421 } 25422 }; 25423 SonicFormEventCategory.styles = [ 25424 tailwind, 25425 i$9` 25426 :host { 25427 display: block; 25428 } 25429 ` 25430 ]; 25431 __decorateClass$3p([ 25432 n$5({ type: Boolean }) 25433 ], SonicFormEventCategory.prototype, "hasCategory", 2); 25434 __decorateClass$3p([ 25435 n$5({ type: String }) 25436 ], SonicFormEventCategory.prototype, "size", 2); 25437 __decorateClass$3p([ 25438 r$5() 25439 ], SonicFormEventCategory.prototype, "onlyFilterCategories", 2); 25440 __decorateClass$3p([ 25441 r$5() 25442 ], SonicFormEventCategory.prototype, "data", 2); 25443 SonicFormEventCategory = __decorateClass$3p([ 25444 t$3("sonic-form-event-category") 25445 ], SonicFormEventCategory); 25446 var __defProp$3l = Object.defineProperty; 25447 var __getOwnPropDesc$3n = Object.getOwnPropertyDescriptor; 25448 var __decorateClass$3o = (decorators, target, key, kind) => { 25449 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3n(target, key) : target; 25450 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 25451 if (decorator = decorators[i2]) 25452 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 25453 if (kind && result) __defProp$3l(target, key, result); 25454 return result; 25455 }; 25456 let SonicFormEventDays = class extends Subscriber$1(i$6) { 25457 constructor() { 25458 super(...arguments); 25459 this.wording_tous = "Tous"; 25460 } 25461 render() { 25462 if (!this.props) return A$1; 25463 const days = Object.keys(this.props); 25464 return b$1` 25465 <sonic-menu class="inline-flex max-w-full" direction="row" scrollable> 25466 <sonic-menu-item 25467 variant="unstyled" 25468 radio 25469 name="day" 25470 value="" 25471 class="py-2 px-2 text-neutral-400 [&[active]]:font-bold [&[active]]:text-content hover:bg-neutral-100 transition-all rounded font-medium " 25472 > 25473 <span swap="on" class="leading-tight"> 25474 <sonic-icon library="iconoir" name="calendar"></sonic-icon> 25475 ${this.wording_tous} 25476 </span> 25477 <span swap="off" class="leading-tight"> 25478 <sonic-icon library="iconoir" name="calendar"></sonic-icon> 25479 ${this.wording_tous} 25480 </span> 25481 </sonic-menu-item> 25482 25483 ${days.length > 0 ? days.map( 25484 (day) => b$1`<sonic-form-event-days-day 25485 dataProvider="sonic-form-event-days-day/${day}" 25486 lazyRendering 25487 day=${day} 25488 ></sonic-form-event-days-day>` 25489 ) : A$1} 25490 </sonic-menu> 25491 `; 25492 } 25493 }; 25494 SonicFormEventDays.styles = [ 25495 i$9` 25496 :host { 25497 display: block; 25498 } 25499 `, 25500 tailwind 25501 ]; 25502 __decorateClass$3o([ 25503 n$5({ type: String }) 25504 ], SonicFormEventDays.prototype, "wording_tous", 2); 25505 SonicFormEventDays = __decorateClass$3o([ 25506 t$3("sonic-form-event-days") 25507 ], SonicFormEventDays); 25508 let SonicFormEventDaysDay = class extends Subscriber$1(i$6) { 25509 constructor() { 25510 super(...arguments); 25511 this.day = ""; 25512 } 25513 render() { 25514 const day = this.day; 25515 if (this.shouldRenderLazy) { 25516 return b$1`<div class="w-16"></div>`; 25517 } 25518 return b$1` <sonic-menu-item 25519 name="day" 25520 value=${day} 25521 type="default" 25522 variant="unstyled" 25523 radio 25524 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" 25525 > 25526 <sonic-date 25527 swap="on" 25528 designMode 25529 noShadowDom 25530 .date=${parseInt(day)} 25531 weekday="long" 25532 day="2-digit" 25533 month="short" 25534 hour="hidden" 25535 minute="hidden" 25536 second="hidden" 25537 year="numeric" 25538 > 25539 <template data-value="weekday">
25540 <span></span> 25541 </template> 25542 <template data-value="day"> 25543 <span class="uppercase font-bold"></span> 25544 </template> 25545 <template data-value="month"> 25546 <span class="font-bold capitalize"></span> 25547 </template> 25548 <template data-value="year"> 25549 <span class="uppercase font-bold hidden"></span> 25550 </template> 25551 </sonic-date> 25552 <sonic-date 25553 swap="off" 25554 designMode 25555 noShadowDom 25556 .date=${parseInt(day)} 25557 weekday="narrow" 25558 day="2-digit" 25559 month="short" 25560 hour="hidden" 25561 minute="hidden" 25562 second="hidden" 25563 year="2-digit" 25564 class="flex items-center" 25565 > 25566 <template data-value="weekday"> 25567 <span></span> 25568 </template> 25569 <template data-value="day"> 25570 <span class="uppercase"></span> 25571 </template> 25572 <template data-value="month"> 25573 <span class="hidden"></span> 25574 </template> 25575 <template data-value="year"> 25576 <span class="hidden"></span> 25577 </template> 25578 </sonic-date> 25579 </sonic-menu-item>`; 25580 } 25581 }; 25582 SonicFormEventDaysDay.styles = [ 25583 i$9` 25584 :host { 25585 display: block; 25586 } 25587 `, 25588 tailwind 25589 ]; 25590 __decorateClass$3o([ 25591 n$5({ type: String }) 25592 ], SonicFormEventDaysDay.prototype, "day", 2); 25593 SonicFormEventDaysDay = __decorateClass$3o([ 25594 t$3("sonic-form-event-days-day") 25595 ], SonicFormEventDaysDay); 25596 const e = e$5(class extends i$4 { 25597 constructor(t2) { 25598 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."); 25599 } 25600 render(t2) { 25601 return " " + Object.keys(t2).filter((s2) => t2[s2]).join(" ") + " "; 25602 } 25603 update(s2, [i2]) { 25604 if (void 0 === this.st) { 25605 this.st = /* @__PURE__ */ new Set(), void 0 !== s2.strings && (this.nt = new Set(s2.strings.join(" ").split(/\s/).filter((t2) => "" !== t2))); 25606 for (const t2 in i2) i2[t2] && !this.nt?.has(t2) && this.st.add(t2); 25607 return this.render(i2); 25608 } 25609 const r2 = s2.element.classList; 25610 for (const t2 of this.st) t2 in i2 || (r2.remove(t2), this.st.delete(t2)); 25611 for (const t2 in i2) { 25612 const s3 = !!i2[t2]; 25613 s3 === this.st.has(t2) || this.nt?.has(t2) || (s3 ? (r2.add(t2), this.st.add(t2)) : (r2.remove(t2), this.st.delete(t2))); 25614 } 25615 return E; 25616 } 25617 }); 25618 var __decorate$p = function(decorators, target, key, desc) { 25619 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 25620 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 25621 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; 25622 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 25623 }; 25624 const tagName$28 = "sonic-input"; 25625 let Input = class Input extends Form(Form$2(Subscriber$1(i$6))) { 25626 constructor() { 25627 super(...arguments); 25628 this.readonly = false; 25629 this.inlineContent = false; 25630 this.disableInlineContentFocus = false; 25631 this.showPasswordToggle = false; 25632 this.autoActive = false; 25633 this.active = false; 25634 this.hasDescription = false; 25635 this.hasLabel = false; 25636 this.hasSuffix = false; 25637 this.hasPrefix = false; 25638 this.isPassword = false; 25639 } 25640 connectedCallback() { 25641 super.connectedCallback(); 25642 this.hasSlotOrProps(); 25643 if (this.hasAttribute("sameValueAs")) { 25644 this.sameValueAsName = this.getAttribute("sameValueAs"); 25645 this.sameValueAsHandle = (v2) => this.pattern = this.escapeRegExp(v2); 25646 const formPublisher = this.getFormPublisher(); 25647 if (!formPublisher) 25648 return; 25649 formPublisher[this.sameValueAsName].onAssign(this.sameValueAsHandle); 25650 } 25651 if (this.type == "password") { 25652 this.isPassword = true; 25653 this.showPasswordToggle = true; 25654 this.inlineContent = true; 25655 } 25656 } 25657 disconnectedCallback() { 25658 super.disconnectedCallback(); 25659 if (this.hasAttribute("sameValueAs") && this.sameValueAsName) { 25660 const formPublisher = this.getFormPublisher(); 25661 if (!formPublisher) 25662 return; 25663 formPublisher[this.sameValueAsName].offAssign(this.sameValueAsHandle); 25664 } 25665 } 25666 escapeRegExp(string) { 25667 return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); 25668 } 25669 willUpdate(changedProperties) { 25670 this.hasSlotOrProps(); 25671 if (this.autoActive && changedProperties.has("value")) { 25672 this.active = !!this.value; 25673 } 25674 super.willUpdate(changedProperties); 25675 } 25676 setSelectionRange(start, end) { 25677 this.input.setSelectionRange(start, end); 25678 } 25679 hasSlotOrProps() { 25680 this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false;
25681 this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false; 25682 this.hasSuffix = this.slotSuffixNodes?.length ? true : false; 25683 this.hasPrefix = this.slotPrefixNodes?.length ? true : false; 25684 } 25685 inlineContentFocus() { 25686 if (!this.inlineContent || this.disableInlineContentFocus) 25687 return; 25688 this.input?.focus(); 25689 } 25690 handleChange(e2) { 25691 if (!this.hasAttribute("inputDelayMs")) { 25692 super.handleChange(e2); 25693 return; 25694 } 25695 if (this.changeTimeoutId) 25696 clearTimeout(this.changeTimeoutId); 25697 this.changeTimeoutId = setTimeout(() => super.handleChange(e2), parseInt(this.getAttribute("inputDelayMs"))); 25698 } 25699 // toggle password visibility 25700 togglePasswordVisibility(e2) { 25701 e2.preventDefault(); 25702 e2.stopPropagation(); 25703 this.isPassword = !this.isPassword; 25704 this._type = this.isPassword ? "password" : "text"; 25705 } 25706 /** 25707 * Code a réfléchir et tester a l'occasion : 25708 * le changement programmatique de la valeur de l'input ne renvoie pas d'événement change. 25709 * On pourrait le faire en surchargeant la propriété value de l'input. 25710 */ 25711 // protected firstUpdated(_changedProperties: PropertyValues): void { 25712 // super.firstUpdated(_changedProperties); 25713 // const descriptor = Object.getOwnPropertyDescriptor( 25714 // HTMLInputElement.prototype, 25715 // "value" 25716 // ); 25717 // const that = this; 25718 // Object.defineProperty(this.input, "value", { 25719 // get() { 25720 // return descriptor?.get?.call(this); 25721 // }, 25722 // set(val) { 25723 // const oldValue = this.value; 25724 // if (val !== oldValue) { 25725 // descriptor?.set?.call(this, val); 25726 // that.input.dispatchEvent(new Event("input")); 25727 // } 25728 // }, 25729 // }); 25730 // } 25731 render() { 25732 const slotClasses = { 25733 "has-prefix": this.hasPrefix, 25734 "has-suffix": this.hasSuffix, 25735 "no-suffix": !this.hasSuffix, 25736 "no-prefix": !this.hasPrefix 25737 }; 25738 return b$1` 25739 <label for="${this.id || "form-element"}" class="${this.hasLabel ? "form-label" : "hidden"}" 25740 >${this.label ? o$6( 25741 this.label 25742 /*+ labelStarSuffix*/ 25743 ) : ""}<slot 25744 name="label" 25745 @slotchange=${this.hasSlotOrProps} 25746 ></slot 25747 ></label> 25748 25749 <div @click=${this.inlineContentFocus} class="form-control ${e(slotClasses)}"> 25750 <div part="content" class="${this.inlineContent ? "form-element form-element-wrapper" : "contents"}"> 25751 <slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot> 25752 <input 25753 data-form-element 25754 part="input" 25755 id=${o$4(this.id || "form-element")} 25756 part="input" 25757 class="form-element input" 25758 @input=${this.handleChange} 25759 @blur=${this.handleBlur} 25760 type=${this.type} 25761 ?disabled=${this.disabled} 25762 ?readonly=${this.readonly} 25763 ?autofocus=${this.autofocus} 25764 list=${o$4(this.list)} 25765 tabindex=${o$4(this.tabindex)} 25766 pattern=${o$4(this.pattern)} 25767 min=${o$4(this.min)} 25768 max=${o$4(this.max)} 25769 step=${o$4(this.step)} 25770 inputmode=${o$4(this.inputmode)} 25771 src=${o$4(this.src)} 25772 minlength=${o$4(this.minlength)} 25773 maxlength=${o$4(this.maxlength)} 25774 placeholder=${o$4(this.placeholder)} 25775 ?required=${this.required} 25776 autocomplete=${o$4(this.autocomplete)} 25777 aria-label=${o$4(this.ariaLabel)} 25778 aria-labelledby=${o$4(this.ariaLabelledby)} 25779 .name=${this.name} 25780 .value=${this.value} 25781 /> 25782 ${this.showPasswordToggle ? b$1`<sonic-button 25783 shape="circle" 25784 class="password-toggle" 25785 @click=${this.togglePasswordVisibility} 25786 data-aria-label="Toggle password visibility" 25787 variant="unstyled" 25788 > 25789 <sonic-icon 25790 library="heroicons" 25791 name=${this.isPassword ? "eye" : "eye-slash"} 25792 ></sonic-icon> 25793 </sonic-button>` : ""} 25794 <slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot> 25795 </div> 25796 </div> 25797 25798 <!-- le slot ne doit pas avoir d'espace--> 25799 <slot 25800 name="description" 25801 @slotchange=${this.hasSlotOrProps} 25802 class="${this.hasDescription ? "form-description" : "hidden"}" 25803 >${this.description ? b$1`${o$6(this.description)}` : A$1}</slot> 25804 <slot name="list"></slot> 25805 </div> 25806 `; 25807 } 25808 }; 25809 Input.styles = [ 25810 fontSize, 25811 formControl, 25812 label, 25813 description, 25814 passwordToggle, 25815 i$9` 25816 :host([type="hidden"]) { 25817 appearance: none !important; 25818 display: none !important; 25819 } 25820 :host > .form-control { 25821 position: relative; 25822 } 25823 ` 25824 ]; 25825 __decorate$p([ 25826 n$5({ type: String, reflect: true }) 25827 ], Input.prototype, "size", void 0); 25828 __decorate$p([ 25829 n$5({ type: String }) 25830 ], Input.prototype, "inputmode", void 0); 25831 __decorate$p([ 25832 n$5({ type: String }) 25833 ], Input.prototype, "list", void 0); 25834 __decorate$p([ 25835 n$5({ type: String }) 25836 ], Input.prototype, "placeholder", void 0); 25837 __decorate$p([ 25838 n$5({ type: String }) 25839 ], Input.prototype, "pattern", void 0); 25840 __decorate$p([ 25841 n$5({ type: String }) 25842 ], Input.prototype, "min", void 0); 25843 __decorate$p([ 25844 n$5({ type: String }) 25845 ], Input.prototype, "max", void 0); 25846 __decorate$p([ 25847 n$5({ type: Boolean, reflect: true }) 25848 ], Input.prototype, "readonly", void 0); 25849 __decorate$p([ 25850 n$5({ type: Number }) 25851 ], Input.prototype, "step", void 0); 25852 __decorate$p([ 25853 n$5({ type: Number }) 25854 ], Input.prototype, "minlength", void 0); 25855 __decorate$p([ 25856 n$5({ type: Number }) 25857 ], Input.prototype, "maxlength", void 0); 25858 __decorate$p([ 25859 n$5({ type: String }) 25860 ], Input.prototype, "src", void 0); 25861 __decorate$p([ 25862 n$5({ type: Boolean, reflect: true }) 25863 ], Input.prototype, "inlineContent", void 0); 25864 __decorate$p([ 25865 n$5({ type: Boolean }) 25866 ], Input.prototype, "disableInlineContentFocus", void 0); 25867 __decorate$p([ 25868 n$5({ type: Boolean }) 25869 ], Input.prototype, "showPasswordToggle", void 0); 25870 __decorate$p([ 25871 n$5({ type: Boolean }) 25872 ], Input.prototype, "autoActive", void 0); 25873 __decorate$p([ 25874 n$5({ type: Boolean, reflect: true }) 25875 ], Input.prototype, "active", void 0); 25876 __decorate$p([ 25877 n$4({ slot: "label", flatten: true }) 25878 ], Input.prototype, "slotLabelNodes", void 0); 25879 __decorate$p([ 25880 n$4({ slot: "description", flatten: true }) 25881 ], Input.prototype, "slotDescriptionNodes", void 0); 25882 __decorate$p([ 25883 n$4({ slot: "suffix", flatten: true }) 25884 ], Input.prototype, "slotSuffixNodes", void 0); 25885 __decorate$p([ 25886 n$4({ slot: "prefix", flatten: true }) 25887 ], Input.prototype, "slotPrefixNodes", void 0); 25888 __decorate$p([ 25889 e$7("input") 25890 ], Input.prototype, "input", void 0); 25891 __decorate$p([ 25892 r$5() 25893 ], Input.prototype, "hasDescription", void 0); 25894 __decorate$p([ 25895 r$5() 25896 ], Input.prototype, "hasLabel", void 0); 25897 __decorate$p([ 25898 r$5() 25899 ], Input.prototype, "hasSuffix", void 0); 25900 __decorate$p([ 25901 r$5() 25902 ], Input.prototype, "hasPrefix", void 0); 25903 __decorate$p([ 25904 r$5() 25905 ], Input.prototype, "isPassword", void 0); 25906 Input = __decorate$p([ 25907 t$3(tagName$28) 25908 ], Input); 25909 var __decorate$o = function(decorators, target, key, desc) { 25910 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 25911 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 25912 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; 25913 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 25914 }; 25915 const tagName$27 = "sonic-value"; 25916 let SonicValue = class SonicValue extends Subscriber(i$6) { 25917 connectedCallback() { 25918 this.setAttribute("subDataProvider", this.getAttribute("key")); 25919 super.connectedCallback(); 25920 } 25921 render() { 25922 if (typeof this.props === "object" || this.props === void 0) 25923 return b$1`<slot name="prefix"></slot><slot></slot><slot name="suffix"></slot>`; 25924 return b$1`${o$6(this.props.toString())}<slot name="prefix"></slot><slot></slot 25925 ><slot name="suffix"></slot>`; 25926 } 25927 }; 25928 SonicValue = __decorate$o([ 25929 t$3(tagName$27) 25930 ], SonicValue); 25931 var __defProp$3k = Object.defineProperty; 25932 var __getOwnPropDesc$3m = Object.getOwnPropertyDescriptor; 25933 var __decorateClass$3n = (decorators, target, key, kind) => { 25934 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3m(target, key) : target; 25935 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 25936 if (decorator = decorators[i2]) 25937 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 25938 if (kind && result) __defProp$3k(target, key, result); 25939 return result; 25940 }; 25941 let SonicFormEventFilter = class extends Subscriber$1(i$6) { 25942 constructor() { 25943 super(...arguments); 25944 this.counterFilterByDay = false;
25945 this.customerFilterByDay = false; 25946 this.filterCategory = false; 25947 this.filterDays = false; 25948 this.gap = "var(--form-gutter)"; 25949 this._selectedCategory = ""; 25950 this.formDataProvider = "eventFrontFilters"; 25951 this.entityType = EntityType.Event; 25952 this.resetOnSearch = (searchValue) => { 25953 if (searchValue && searchValue.length > 0) { 25954 this.form.ids_category = []; 25955 this.form.day = []; 25956 } 25957 }; 25958 } 25959 connectedCallback() { 25960 this.form = PublisherManager.get(this.formDataProvider); 25961 super.connectedCallback(); 25962 this.form.onInternalMutation(() => { 25963 const formData = this.form.get(); 25964 let selectedCategory = formData.ids_category; 25965 let selectedDay = formData.day; 25966 if (Array.isArray(selectedCategory)) { 25967 selectedCategory = selectedCategory.join(","); 25968 } 25969 if (Array.isArray(selectedDay)) { 25970 selectedDay = selectedDay.join(","); 25971 } 25972 this._selectedCategory = selectedCategory; 25973 const urlParams = new URLSearchParams(window.location.search); 25974 if (selectedCategory) urlParams.set("id_categ", selectedCategory); 25975 else urlParams.delete("id_categ"); 25976 if (selectedDay) { 25977 urlParams.set("day", selectedDay); 25978 } else { 25979 urlParams.delete("day"); 25980 } 25981 const currentFragment = window.location.hash; 25982 if (selectedCategory || selectedDay) { 25983 window.history.replaceState(null, "", `${window.location.pathname}?${urlParams.toString()}${currentFragment}`); 25984 } 25985 }); 25986 this.initFromUrl(); 25987 this.form.search.onAssign(this.resetOnSearch); 25988 } 25989 disconnectedCallback() { 25990 this.form.search.offAssign(this.resetOnSearch); 25991 super.disconnectedCallback(); 25992 } 25993 initFromUrl() { 25994 const urlParams = new URLSearchParams(window.location.search); 25995 const selectedCategory = urlParams.get("id_categ"); 25996 const selectedDay = urlParams.get("day"); 25997 this.form.ids_category = [selectedCategory]; 25998 this.form.day = [selectedDay]; 25999 } 26000 resetCategory() { 26001 this.form.ids_category = []; 26002 const urlParams = new URLSearchParams(window.location.search); 26003 urlParams.delete("id_categ"); 26004 window.history.replaceState(null, "", `${window.location.pathname}?${urlParams.toString()}${window.location.hash}`); 26005 } 26006 render() { 26007 const formStyles = { 26008 gap: this.gap 26009 }; 26010 const hasCategory = this._selectedCategory ? true : false; 26011 const today = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3); 26012 let settingsFilterDays; 26013 if (this.appType === "counter") { 26014 settingsFilterDays = this.counterFilterByDay; 26015 } else { 26016 settingsFilterDays = this.customerFilterByDay; 26017 } 26018 const displayFilterDays = (this.filterDays || settingsFilterDays) && this.entityType === EntityType.Event; 26019 return b$1` 26020 <div 26021 formDataProvider=${this.formDataProvider} 26022 class="flex min-w-0 flex-col w-full @container" 26023 style=${o$3(formStyles)} 26024 > 26025 <div class="flex flex-wrap @2xl:flex-nowrap" style=${o$3(formStyles)}> 26026 <div class="flex items-center" style=${o$3(formStyles)}> 26027 <!-- Search --> 26028 <sonic-input 26029 type="search" 26030 name="search" 26031 inlineContent 26032 placeholder="${t("Search...")}" 26033 filteredFields="title" 26034 class="grow" 26035 autocomplete="off" 26036 value="" 26037 size="inherit" 26038 > 26039 <sonic-icon library="iconoir" slot="prefix" name="search" size="lg"></sonic-icon> 26040 </sonic-input> 26041 26042 <!-- Categories --> 26043 ${this.filterCategory ? b$1`<sonic-form-event-category ?hasCategory=${hasCategory} size="inherit"></sonic-form-event-category>` : A$1} 26044 </div> 26045 <slot name="formSuffix"></slot> 26046 </div> 26047 26048 <!-- Days --> 26049 ${displayFilterDays ? b$1`<sonic-fetch 26050 dataProvider="events/filters/days?from=${today}${this.agendaId ? `&ids_agenda=${this.agendaId}` : ""}" 26051 key="data" 26052 > 26053 <sonic-form-event-days></sonic-form-event-days 26054 ></sonic-fetch>` : A$1} 26055 ${hasCategory ? b$1`<sonic-fetch dataProvider="selectedCategory" endPoint="category/${this._selectedCategory}" key="data"> 26056 <div class="inline-flex items-center gap-4 divide-x divide-neutral-200 pl-3 text-[max(16px,1em)] "> 26057 <div class=" font-bold mr-2 inline-flex gap-2 items-center leading-tight"> 26058 <sonic-icon library="custom" name="tag"></sonic-icon> 26059 <sonic-value key="title"></sonic-value> 26060 </div> 26061 <div class="px-2 py-2"> 26062 <sonic-button 26063 @click=${this.resetCategory} 26064 variant="unstyled" 26065 shape="circle" 26066 size="inherit" 26067 class="text-neutral-400 hover:text-neutral-600 flex-grow-0" 26068 > 26069 <sonic-icon library="custom" name="xmark"></sonic-icon> 26070 </sonic-button> 26071 </div> 26072 </div> 26073 </sonic-fetch>` : ""} 26074 </div> 26075 `; 26076 } 26077 }; 26078 SonicFormEventFilter.styles = [ 26079 i$9` 26080 :host { 26081 display: block; 26082 --form-gutter: 0.5rem; 26083 } 26084 `, 26085 tailwind 26086 ]; 26087 __decorateClass$3n([ 26088 c({ context: appType, subscribe: true }) 26089 ], SonicFormEventFilter.prototype, "appType", 2); 26090 __decorateClass$3n([ 26091 bind$1("settings.store_ui.event.filter_by_day"), 26092 r$5() 26093 ], SonicFormEventFilter.prototype, "counterFilterByDay", 2); 26094 __decorateClass$3n([ 26095 bind$1("settings.customer_ui.event.filter_by_day"), 26096 r$5() 26097 ], SonicFormEventFilter.prototype, "customerFilterByDay", 2); 26098 __decorateClass$3n([ 26099 n$5({ type: Boolean }) 26100 ], SonicFormEventFilter.prototype, "filterCategory", 2); 26101 __decorateClass$3n([ 26102 n$5({ type: Boolean }) 26103 ], SonicFormEventFilter.prototype, "filterDays", 2); 26104 __decorateClass$3n([ 26105 n$5({ type: String }) 26106 ], SonicFormEventFilter.prototype, "gap", 2); 26107 __decorateClass$3n([ 26108 n$5({ type: Array }) 26109 ], SonicFormEventFilter.prototype, "_selectedCategory", 2); 26110 __decorateClass$3n([ 26111 n$5({ type: String }) 26112 ], SonicFormEventFilter.prototype, "formDataProvider", 2); 26113 __decorateClass$3n([ 26114 n$5({ type: Number }) 26115 ], SonicFormEventFilter.prototype, "agendaId", 2); 26116 __decorateClass$3n([ 26117 n$5({ type: String }) 26118 ], SonicFormEventFilter.prototype, "entityType", 2); 26119 SonicFormEventFilter = __decorateClass$3n([ 26120 t$3("sonic-form-event-filter") 26121 ], SonicFormEventFilter); 26122 const d = (t2) => d$1(t2) ? t2._$litType$.h : t2.strings, h = e$5(class extends i$4 { 26123 constructor(t2) { 26124 super(t2), this.et = /* @__PURE__ */ new WeakMap(); 26125 } 26126 render(t2) { 26127 return [t2]; 26128 } 26129 update(s2, [e2]) { 26130 const u2 = l(this.it) ? d(this.it) : null, h2 = l(e2) ? d(e2) : null; 26131 if (null !== u2 && (null === h2 || u2 !== h2)) { 26132 const e3 = M(s2).pop(); 26133 let o2 = this.et.get(u2); 26134 if (void 0 === o2) { 26135 const s3 = document.createDocumentFragment(); 26136 o2 = D(A$1, s3), o2.setConnected(false), this.et.set(u2, o2); 26137 } 26138 p(o2, [e3]), v$1(o2, void 0, e3); 26139 } 26140 if (null !== h2) { 26141 if (null === u2 || u2 !== h2) { 26142 const t2 = this.et.get(h2); 26143 if (void 0 !== t2) { 26144 const i2 = M(t2).pop(); 26145 j$1(s2), v$1(s2, void 0, i2), p(s2, [i2]); 26146 } 26147 } 26148 this.it = e2; 26149 } else this.it = void 0; 26150 return this.render(e2); 26151 } 26152 }); 26153 var __defProp$3j = Object.defineProperty; 26154 var __getOwnPropDesc$3l = Object.getOwnPropertyDescriptor; 26155 var __decorateClass$3m = (decorators, target, key, kind) => { 26156 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3l(target, key) : target; 26157 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26158 if (decorator = decorators[i2]) 26159 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26160 if (kind && result) __defProp$3j(target, key, result); 26161 return result; 26162 }; 26163 const tagName$26 = "sonic-event-taxonomy"; 26164 let Taxonomy = class extends i$6 { 26165 constructor() { 26166 super(...arguments); 26167 this.icon = { name: "" }; 26168 this.taxonomy = []; 26169 this.separator = ", "; 26170 this.key = null; 26171 this.displayAll = false;
26172 this.contrast = false; 26173 this.type = "default"; 26174 this.variant = "default"; 26175 this.size = "md"; 26176 this.ellipsis = false; 26177 this.isScolar = false; 26178 } 26179 willUpdate(_changedProperties) { 26180 if (this.appType == "counter" && this.key == "range") { 26181 this.displayAll = true; 26182 } 26183 if (_changedProperties.has("taxonomy") && this.taxonomy && this.key == "label") { 26184 this.taxonomy.forEach((label2) => { 26185 if (typeof label2.title == "string" && label2.title?.toLowerCase().includes("scolaire")) { 26186 this.isScolar = true; 26187 this.icon = { library: "custom", prefix: "solid", name: "child-reaching" }; 26188 this.type = "primary"; 26189 } 26190 }); 26191 } 26192 super.willUpdate(_changedProperties); 26193 } 26194 render() { 26195 if (!Array.isArray(this.taxonomy)) return A$1; 26196 const key = this.key + "_display"; 26197 const taxo = this.displayAll ? this.taxonomy : this.taxonomy.filter( 26198 (elt) => elt != null && (elt[key] === true || elt[key] == "1" || !Object.hasOwnProperty.call(elt, key)) 26199 ); 26200 if (taxo.length === 0) { 26201 this.style.display = "none"; 26202 return A$1; 26203 } 26204 this.style.removeProperty("display"); 26205 return h(b$1` 26206 <sonic-badge 26207 ?ellipsis=${this.ellipsis} 26208 type=${this.type} 26209 variant=${this.variant} 26210 size=${this.size} 26211 class="min-w-0" 26212 ?contrast=${this.contrast} 26213 > 26214 ${this.icon.name ? b$1` 26215 <sonic-icon 26216 slot="prefix" 26217 library=${o$4(this.icon.library)} 26218 prefix=${o$4(this.icon.prefix)} 26219 name=${o$4(this.icon.name)} 26220 ></sonic-icon> 26221 ` : A$1} 26222 <div> 26223 ${o( 26224 o$1(taxo, (i2) => { 26225 const name = i2[this.key + "_name"] || i2["name"]; 26226 return b$1`${name}`; 26227 }), 26228 b$1`${o$6(this.separator)}` 26229 )} 26230 </div> 26231 </sonic-badge> 26232 `); 26233 } 26234 }; 26235 Taxonomy.styles = i$9` 26236 :host { 26237 line-height: 1; 26238 min-width: 0; 26239 } 26240 .taxonomy-list span { 26241 min-width: 0; 26242 display: inline-block; 26243 } 26244 `; 26245 __decorateClass$3m([ 26246 n$5({ type: Object }) 26247 ], Taxonomy.prototype, "icon", 2); 26248 __decorateClass$3m([ 26249 n$5({ type: Array }) 26250 ], Taxonomy.prototype, "taxonomy", 2); 26251 __decorateClass$3m([ 26252 n$5({ type: String }) 26253 ], Taxonomy.prototype, "separator", 2); 26254 __decorateClass$3m([ 26255 n$5({ type: String }) 26256 ], Taxonomy.prototype, "key", 2); 26257 __decorateClass$3m([ 26258 n$5({ type: Boolean }) 26259 ], Taxonomy.prototype, "displayAll", 2); 26260 __decorateClass$3m([ 26261 n$5({ type: Boolean }) 26262 ], Taxonomy.prototype, "contrast", 2); 26263 __decorateClass$3m([ 26264 n$5({ type: String, reflect: true }) 26265 ], Taxonomy.prototype, "type", 2); 26266 __decorateClass$3m([ 26267 n$5({ type: String, reflect: true }) 26268 ], Taxonomy.prototype, "variant", 2); 26269 __decorateClass$3m([ 26270 n$5({ type: String, reflect: true }) 26271 ], Taxonomy.prototype, "size", 2); 26272 __decorateClass$3m([ 26273 c({ context: appType, subscribe: true }) 26274 ], Taxonomy.prototype, "appType", 2); 26275 __decorateClass$3m([ 26276 n$5({ type: Boolean }) 26277 ], Taxonomy.prototype, "ellipsis", 2); 26278 __decorateClass$3m([ 26279 r$5() 26280 ], Taxonomy.prototype, "isScolar", 2); 26281 Taxonomy = __decorateClass$3m([ 26282 t$3(tagName$26) 26283 ], Taxonomy); 26284 class Electron { 26285 static fixBlankLink(link) { 26286 const electronStr = "electron"; 26287 const electron = typeof require == "undefined" || typeof process != "object" ? null : require(electronStr); 26288 if (link.target == "_blank") { 26289 link.addEventListener("click", () => { 26290 electron?.shell.openExternal(link.href); 26291 }); 26292 } 26293 } 26294 } 26295 var __decorate$n = function(decorators, target, key, desc) { 26296 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 26297 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 26298 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; 26299 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 26300 }; 26301 const tagName$25 = "sonic-link"; 26302 let Link = class Link extends i$6 { 26303 constructor() { 26304 super(...arguments); 26305 this.href = ""; 26306 this._location = ""; 26307 this.ariaLabel = null; 26308 this.autoActive = "partial"; 26309 this._target = null; 26310 this.pushState = null; 26311 } 26312 get location() { 26313 return this._location; 26314 } 26315 set location(value) { 26316 this._location = value; 26317 LocationHandler$1.updateComponentActiveState(this); 26318 } 26319 connectedCallback() { 26320 if (this.href && this.href.indexOf("http") != 0) { 26321 LocationHandler$1.onChange(this); 26322 this.location = document.location.href.replace(document.location.origin, ""); 26323 } 26324 this.addEventListener("keypress", (e2) => {
26325 if (e2.key === "Enter") { 26326 this.shadowRoot?.querySelector("a")?.click(); 26327 } 26328 }); 26329 this.setFocusable(); 26330 super.connectedCallback(); 26331 } 26332 setFocusable() { 26333 if (this.href) { 26334 this.setAttribute("tabIndex", "0"); 26335 } else { 26336 this.removeAttribute("tabIndex"); 26337 } 26338 } 26339 disconnectedCallback() { 26340 LocationHandler$1.offChange(this); 26341 super.disconnectedCallback(); 26342 } 26343 set target(newTarget) { 26344 this._target = newTarget; 26345 Electron.fixBlankLink(this); 26346 this.requestUpdate(); 26347 } 26348 get target() { 26349 return this._target; 26350 } 26351 handlePushState(e2) { 26352 e2.preventDefault(); 26353 LocationHandler$1.changeFromComponent(this); 26354 } 26355 updated(changedProperties) { 26356 if (changedProperties.has("href")) { 26357 this.setFocusable(); 26358 } 26359 } 26360 render() { 26361 if (!this.href) 26362 return b$1`<slot></slot>`; 26363 return b$1` 26364 <a 26365 href="${this.href}" 26366 aria-label=${this.ariaLabel || A$1} 26367 target=${o$4(this.target)} 26368 @click=${this.pushState ? this.handlePushState : null} 26369 > 26370 <slot></slot> 26371 </a> 26372 `; 26373 } 26374 }; 26375 Link.styles = [ 26376 i$9` 26377 a { 26378 color: inherit; 26379 text-decoration: none; 26380 display: contents; 26381 } 26382 ` 26383 ]; 26384 __decorate$n([ 26385 n$5({ type: String }) 26386 ], Link.prototype, "href", void 0); 26387 __decorate$n([ 26388 n$5({ type: String, attribute: "data-aria-label" }) 26389 ], Link.prototype, "ariaLabel", void 0); 26390 __decorate$n([ 26391 n$5({ type: String }) 26392 ], Link.prototype, "autoActive", void 0); 26393 __decorate$n([ 26394 n$5({ type: String }) 26395 ], Link.prototype, "target", null); 26396 __decorate$n([ 26397 n$5({ type: Boolean }) 26398 ], Link.prototype, "pushState", void 0); 26399 Link = __decorate$n([ 26400 t$3(tagName$25) 26401 ], Link); 26402 var __defProp$3i = Object.defineProperty; 26403 var __getOwnPropDesc$3k = Object.getOwnPropertyDescriptor; 26404 var __decorateClass$3l = (decorators, target, key, kind) => { 26405 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3k(target, key) : target; 26406 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26407 if (decorator = decorators[i2]) 26408 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26409 if (kind && result) __defProp$3i(target, key, result); 26410 return result; 26411 }; 26412 const tagName$24 = "sonic-event-site-link"; 26413 let SonicComponent$i = class SonicComponent extends Subscriber$1(i$6) { 26414 constructor() { 26415 super(...arguments); 26416 this.site_link = ""; 26417 } 26418 render() { 26419 if (!this.site_link) return A$1; 26420 const siteLinkDomain = this.site_link.replace("https://", "").replace("http://", "").replace("www.", "").split("/")[0]; 26421 return b$1`<sonic-tooltip label=${siteLinkDomain} placement=${this.tooltipPlacement || "top-start"}> 26422 <sonic-link href=${this.site_link} target="_blank" class="group"> 26423 <sonic-icon name="arrow-up-right" library="custom" class="mr-[.25em]"></sonic-icon 26424 ><span class="underline hover:no-underline font-medium">${this.customText || t("site_link_info")} </span> 26425 </sonic-link> 26426 </sonic-tooltip>`; 26427 } 26428 }; 26429 SonicComponent$i.styles = [tailwind]; 26430 __decorateClass$3l([ 26431 n$5({ type: String }) 26432 ], SonicComponent$i.prototype, "site_link", 2); 26433 __decorateClass$3l([ 26434 n$5({ type: String }) 26435 ], SonicComponent$i.prototype, "customText", 2); 26436 __decorateClass$3l([ 26437 n$5({ type: String }) 26438 ], SonicComponent$i.prototype, "tooltipPlacement", 2); 26439 SonicComponent$i = __decorateClass$3l([ 26440 t$3(tagName$24) 26441 ], SonicComponent$i); 26442 var __defProp$3h = Object.defineProperty; 26443 var __getOwnPropDesc$3j = Object.getOwnPropertyDescriptor; 26444 var __decorateClass$3k = (decorators, target, key, kind) => { 26445 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3j(target, key) : target; 26446 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26447 if (decorator = decorators[i2]) 26448 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26449 if (kind && result) __defProp$3h(target, key, result); 26450 return result; 26451 }; 26452 let VerticalDate = class extends Subscriber$1(i$6) { 26453 constructor() { 26454 super(...arguments); 26455 this.start_date = 0; 26456 this.end_date = 0; 26457 } 26458 render() { 26459 return b$1` 26460 <sonic-date 26461 designMode 26462 noshadowdom 26463 year="numeric" 26464 month="short" 26465 weekday="short" 26466 class="block text-center leading-none ${this.end_date ? "text-[.82em]" : ""}" 26467 > 26468 <template data-value="weekday">
26469 <span class="uppercase font-bold text-[1.1em]"></span> 26470 </template> 26471 <template data-value="day"> 26472 <span class="text-[2.2em] block uppercase font-bold"></span> 26473 </template> 26474 <template data-value="month"> 26475 <span class="text-[1.1em] block uppercase font-bold"></span> 26476 </template> 26477 <template data-value="year"> 26478 <span class="mt-[.2em] mb-[.3em] font-bold block uppercase text-[.82em]"></span> 26479 </template> 26480 <template data-value="to"> 26481 <sonic-icon 26482 name="chevron-down" 26483 class="justify-center flex w-full mb-[.3em] -mt-[.15em]" 26484 library="custom" 26485 ></sonic-icon> 26486 </template> 26487 <template data-value="literal"> 26488 <span class="text-[.82em]"></span> 26489 </template> 26490 <template data-value="hour"> 26491 <span class="text-[.82em]"></span> 26492 </template> 26493 <template data-value="minute"> 26494 <span class="text-[.82em]"></span> 26495 </template> 26496 </sonic-date> 26497 `; 26498 } 26499 }; 26500 VerticalDate.styles = [tailwind]; 26501 __decorateClass$3k([ 26502 n$5({ type: Number }) 26503 ], VerticalDate.prototype, "start_date", 2); 26504 __decorateClass$3k([ 26505 n$5({ type: Number }) 26506 ], VerticalDate.prototype, "end_date", 2); 26507 VerticalDate = __decorateClass$3k([ 26508 t$3("sonic-vertical-date") 26509 ], VerticalDate); 26510 var __defProp$3g = Object.defineProperty; 26511 var __getOwnPropDesc$3i = Object.getOwnPropertyDescriptor; 26512 var __decorateClass$3j = (decorators, target, key, kind) => { 26513 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3i(target, key) : target; 26514 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26515 if (decorator = decorators[i2]) 26516 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26517 if (kind && result) __defProp$3g(target, key, result); 26518 return result; 26519 }; 26520 const tagName$23 = "sonic-reelax-link"; 26521 let SonicReelaxLink = class extends Subscriber$1(i$6) { 26522 constructor() { 26523 super(...arguments); 26524 this.isDuotone = false; 26525 this.svgReelax = b$1`<svg 26526 xmlns="http://www.w3.org/2000/svg" 26527 xmlns:xlink="http://www.w3.org/1999/xlink" 26528 viewBox="0 0 37.08 39.46" 26529 class="transform translate-z-0 fill-current" 26530 > 26531 <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" /> 26532 <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" /> 26533 </svg>`; 26534 } 26535 updated() { 26536 this.checkIfDuotone(); 26537 } 26538 checkIfDuotone() { 26539 const duotoneChecker = this.shadowRoot?.getElementById("contextDuotoneChecker"); 26540 if (duotoneChecker) { 26541 const bgColor = window.getComputedStyle(duotoneChecker).backgroundColor; 26542 const textColor = window.getComputedStyle(duotoneChecker).color; 26543 if (bgColor === textColor) { 26544 this.isDuotone = true; 26545 } else { 26546 this.isDuotone = false; 26547 } 26548 } 26549 } 26550 render() { 26551 const urlReelax = this.props?.settings?.reelax_info?.all; 26552 if (!urlReelax) { 26553 return A$1; 26554 } 26555 return b$1` 26556 <div id="contextDuotoneChecker" class="bg-success text-danger hidden"></div> 26557 <sonic-tooltip label=${t("module_reelax_tooltip")} class="align-center" 26558 ><sonic-link href=${urlReelax} target="_blank" class="inline-flex gap-[.35em] items-center group"> 26559 <div 26560 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]"}" 26561 > 26562 ${this.svgReelax} 26563 </div> 26564 <span class="font-bold">${t("module_reelax_title")}</span></sonic-link 26565 > 26566 </sonic-tooltip> 26567 `; 26568 } 26569 }; 26570 SonicReelaxLink.styles = [tailwind]; 26571 __decorateClass$3j([ 26572 r$5() 26573 ], SonicReelaxLink.prototype, "isDuotone", 2); 26574 SonicReelaxLink = __decorateClass$3j([ 26575 t$3(tagName$23) 26576 ], SonicReelaxLink); 26577 var __defProp$3f = Object.defineProperty; 26578 var __getOwnPropDesc$3h = Object.getOwnPropertyDescriptor; 26579 var __decorateClass$3i = (decorators, target, key, kind) => { 26580 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3h(target, key) : target; 26581 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26582 if (decorator = decorators[i2]) 26583 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26584 if (kind && result) __defProp$3f(target, key, result); 26585 return result; 26586 }; 26587 let RefundLink = class extends Subscriber$1(i$6) { 26588 constructor() { 26589 super(...arguments); 26590 this.variant = "outline"; 26591 this.type = "default"; 26592 this.size = "xs"; 26593 } 26594 render() {
26595 const mustDisplayUrl = this.props?.settings?.refund?.display_url || this.refund?.display_url; 26596 if (!mustDisplayUrl) return A$1; 26597 const refundUrl = appRoute("refund").query({ event_id: this.id }); 26598 return b$1` 26599 <sonic-link class="inline-flex gap-[.35em] items-center group font-bold" href=${refundUrl}> 26600 <div 26601 class="rounded-full w-[2em] h-[2em] flex items-center justify-center bg-info text-info-content 26602 group-hover:opacity-70" 26603 > 26604 <sonic-icon library="custom" name="arrow-rotate-left"></sonic-icon> 26605 </div> 26606 ${t("LIB_refund")} 26607 </sonic-link> 26608 `; 26609 } 26610 }; 26611 RefundLink.styles = [tailwind]; 26612 __decorateClass$3i([ 26613 n$5({ type: Object }) 26614 ], RefundLink.prototype, "refund", 2); 26615 __decorateClass$3i([ 26616 n$5({ type: String }) 26617 ], RefundLink.prototype, "variant", 2); 26618 __decorateClass$3i([ 26619 n$5({ type: String }) 26620 ], RefundLink.prototype, "type", 2); 26621 __decorateClass$3i([ 26622 n$5({ type: String }) 26623 ], RefundLink.prototype, "size", 2); 26624 RefundLink = __decorateClass$3i([ 26625 t$3("sonic-refund-link") 26626 ], RefundLink); 26627 var __defProp$3e = Object.defineProperty; 26628 var __getOwnPropDesc$3g = Object.getOwnPropertyDescriptor; 26629 var __decorateClass$3h = (decorators, target, key, kind) => { 26630 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3g(target, key) : target; 26631 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26632 if (decorator = decorators[i2]) 26633 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26634 if (kind && result) __defProp$3e(target, key, result); 26635 return result; 26636 }; 26637 let SonicPromo$1 = class SonicPromo extends Subscriber$1(i$6) { 26638 constructor() { 26639 super(...arguments); 26640 this.promotion_code = false; 26641 this.event_id = null; 26642 this.has_promo = false; 26643 } 26644 handleSubmit(e2) { 26645 const data = e2.detail?.data || null; 26646 if (!data) return; 26647 const isCartCode = data.cart == true && data.success == true; 26648 if (isCartCode) { 26649 dp("cart/current").invalidate(); 26650 if (!appRoute("cart").matchesCurrentPath()) { 26651 goTo("cart"); 26652 } 26653 } else if (data?.success == true) { 26654 this.publisher?.invalidate(); 26655 promoCodeModal(data); 26656 } 26657 } 26658 render() { 26659 if (this.promotion_code || this.event_id && this.has_promo) { 26660 return b$1` 26661 <div formdataprovider="promoForm" dataProvider="promotion-code" method="post"> 26662 <sonic-submit onEnterKey @submit=${this.handleSubmit}> 26663 <sonic-input 26664 size=${o$4(this.size)} 26665 name="promo_code" 26666 placehoderAsLabel 26667 placeholder=${t("LIB_code_promo")} 26668 inlineContent 26669 > 26670 <sonic-icon library="custom" name="gift" slot="prefix"></sonic-icon> 26671 26672 <sonic-submit onClick slot="suffix"> 26673 <sonic-tooltip label="${t("submit")}"> 26674 <sonic-button 26675 size=${o$4(this.size)} 26676 shape="square" 26677 icon 26678 variant="unstyled" 26679 data-aria-label=${t("submit")} 26680 > 26681 <sonic-icon 26682 library="iconoir" 26683 name="check" 26684 class="${this.promoCodeValue ? "opacity-100 animate-[pulse.5s_ease-in-out_infinite_.5s] inline-block" : "opacity-30"}" 26685 ></sonic-icon> 26686 </sonic-button> 26687 </sonic-tooltip> 26688 </sonic-submit> 26689 </sonic-input> 26690 </sonic-submit> 26691 </div> 26692 `; 26693 } else { 26694 return A$1; 26695 } 26696 } 26697 }; 26698 SonicPromo$1.styles = [tailwind]; 26699 __decorateClass$3h([ 26700 bind$1("settings.promotion_code"), 26701 n$5({ type: Boolean }) 26702 ], SonicPromo$1.prototype, "promotion_code", 2); 26703 __decorateClass$3h([ 26704 n$5({ type: Number }) 26705 ], SonicPromo$1.prototype, "event_id", 2); 26706 __decorateClass$3h([ 26707 n$5({ type: Boolean }) 26708 ], SonicPromo$1.prototype, "has_promo", 2); 26709 __decorateClass$3h([ 26710 n$5({ type: String }) 26711 ], SonicPromo$1.prototype, "size", 2); 26712 __decorateClass$3h([ 26713 bind$1("promoForm.promo_code"), 26714 n$5({ type: String }) 26715 ], SonicPromo$1.prototype, "promoCodeValue", 2); 26716 SonicPromo$1 = __decorateClass$3h([ 26717 t$3("sonic-promo-form") 26718 ], SonicPromo$1); 26719 var __defProp$3d = Object.defineProperty; 26720 var __decorateClass$3g = (decorators, target, key, kind) => { 26721 var result = void 0; 26722 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26723 if (decorator = decorators[i2]) 26724 result = decorator(target, key, result) || result; 26725 if (result) __defProp$3d(target, key, result); 26726 return result; 26727 }; 26728 const CovoitLoad = (superClass) => { 26729 class CovoitElement extends superClass { 26730 constructor() { 26731 super(...arguments); 26732 this.scriptType = "front"; 26733 this.scriptIsLoaded = !!document.getElementById("sonic-covoit-script"); 26734 } 26735 connectedCallback() { 26736 super.connectedCallback(); 26737 this.setupCustomRoutes(); 26738 document.addEventListener("sonic-routes-ready", this.setupCustomRoutes.bind(this), { once: true }); 26739 this.addCovoitScript(); 26740 } 26741 setupCustomRoutes() { 26742 const LoginRoute = appRoute("account")?.toString(); 26743 if (LoginRoute) { 26744 this.customRoutes = { 26745 login: LoginRoute 26746 }; 26747 } 26748 } 26749 updated(changedProperties) { 26750 if (changedProperties.has("carpoolingSettings") && !this.scriptIsLoaded) { 26751 this.addCovoitScript(); 26752 } 26753 } 26754 addCovoitScript() { 26755 if (this.scriptIsLoaded) return; 26756 if (this.carpoolingSettings?.url) { 26757 let scriptURL = this.carpoolingSettings.url; 26758 if (scriptURL.endsWith("/")) { 26759 scriptURL = scriptURL.slice(0, -1); 26760 } 26761 const date2 = /* @__PURE__ */ new Date(); 26762 date2.setMinutes(0, 0, 0); 26763 const unixTimestamp = Math.floor(date2.getTime() / 1e3); 26764 scriptURL += "/dist/main.umd.js?" + unixTimestamp; 26765 const script = document.createElement("script"); 26766 script.id = "sonic-covoit-script"; 26767 script.src = scriptURL; 26768 script.type = "module"; 26769 document.head.appendChild(script); 26770 this.scriptIsLoaded = true; 26771 } 26772 } 26773 } 26774 __decorateClass$3g([ 26775 bind$1("carpooling_user_id.encrypted_uid"), 26776 n$5({ type: String }) 26777 ], CovoitElement.prototype, "encryptedUid"); 26778 __decorateClass$3g([ 26779 bind$1("settings.modules.carpooling"), 26780 n$5({ type: Object }) 26781 ], CovoitElement.prototype, "carpoolingSettings"); 26782 __decorateClass$3g([ 26783 n$5({ type: Object }) 26784 ], CovoitElement.prototype, "customRoutes"); 26785 return CovoitElement; 26786 }; 26787 var __defProp$3c = Object.defineProperty; 26788 var __getOwnPropDesc$3f = Object.getOwnPropertyDescriptor; 26789 var __decorateClass$3f = (decorators, target, key, kind) => { 26790 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3f(target, key) : target; 26791 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26792 if (decorator = decorators[i2]) 26793 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26794 if (kind && result) __defProp$3c(target, key, result); 26795 return result; 26796 }; 26797 const tagName$22 = "sonic-carpooling-event-widget"; 26798 let CarpoolingEventWidget = class extends CovoitLoad(Subscriber$1(i$6)) { 26799 constructor() { 26800 super(...arguments); 26801 this.id = ""; 26802 } 26803 render() { 26804 if (!this.carpoolingSettings) return A$1; 26805 const { url, token } = this.carpoolingSettings;
26806 if (!url || !this.id) return A$1; 26807 return b$1`<covoit-event-widget 26808 covoitURL="${url}" 26809 baseURL="${o$4(appRoute("carpooling"))}" 26810 token="${o$4(token)}" 26811 eventId=${o$4(this.id)} 26812 customTitle="${t("module_carpooling_title")}" 26813 class="leading-none" 26814 ></covoit-event-widget>`; 26815 } 26816 }; 26817 CarpoolingEventWidget.styles = [tailwind]; 26818 __decorateClass$3f([ 26819 n$5({ type: String }) 26820 ], CarpoolingEventWidget.prototype, "id", 2); 26821 CarpoolingEventWidget = __decorateClass$3f([ 26822 t$3(tagName$22) 26823 ], CarpoolingEventWidget); 26824 const alignContext = n("alignContext"); 26825 const flexJustify = (align) => { 26826 let justifyClass = "justify-start"; 26827 if (align === "center") justifyClass = "justify-center"; 26828 if (align === "right") justifyClass = "justify-end"; 26829 return justifyClass; 26830 }; 26831 var __defProp$3b = Object.defineProperty; 26832 var __getOwnPropDesc$3e = Object.getOwnPropertyDescriptor; 26833 var __decorateClass$3e = (decorators, target, key, kind) => { 26834 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3e(target, key) : target; 26835 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26836 if (decorator = decorators[i2]) 26837 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26838 if (kind && result) __defProp$3b(target, key, result); 26839 return result; 26840 }; 26841 const svgPassCulture = (options) => { 26842 const defaultOptions = { color: "#fff", width: 28, height: 28 }; 26843 const mergedOptions = { ...defaultOptions, ...options }; 26844 return b$1`<svg 26845 width=${mergedOptions.width} 26846 height=${mergedOptions.height} 26847 class=${mergedOptions.className} 26848 viewBox="0 0 ${defaultOptions.width} ${defaultOptions.height}" 26849 fill="none" 26850 xmlns="http://www.w3.org/2000/svg" 26851 > 26852 <path 26853 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
26853ZM9.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" 26854 fill="${mergedOptions.color}" 26855 /> 26856 <path 26857 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
26857ZM9.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" 26858 stroke="${mergedOptions.color}" 26859 stroke-width=".25" 26860 /> 26861 </svg>`; 26862 }; 26863 const tagName$21 = "sonic-passculture-link"; 26864 let SonicPassCultureLink = class extends Subscriber$1(i$6) { 26865 constructor() { 26866 super(...arguments); 26867 this.isDuotone = false; 26868 } 26869 updated() { 26870 this.checkIfDuotone(); 26871 } 26872 checkIfDuotone() { 26873 const duotoneChecker = this.shadowRoot?.getElementById("contextDuotoneChecker"); 26874 if (duotoneChecker) { 26875 const bgColor = window.getComputedStyle(duotoneChecker).backgroundColor; 26876 const textColor = window.getComputedStyle(duotoneChecker).color; 26877 if (bgColor === textColor) { 26878 this.isDuotone = true; 26879 } else { 26880 this.isDuotone = false; 26881 } 26882 } 26883 } 26884 render() { 26885 const passCultureUrl = this.pass_culture?.url || this.props?.settings?.pass_culture?.url; 26886 if (!passCultureUrl) { 26887 return A$1; 26888 } 26889 return b$1` 26890 <div id="contextDuotoneChecker" class="bg-success text-danger hidden"></div> 26891 <sonic-link 26892 data-aria-label=${t("pass_culture")} 26893 href=${passCultureUrl} 26894 target="_blank" 26895 class="inline-flex gap-[.35em] items-center group" 26896 > 26897 <div 26898 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] "}" 26899 > 26900 ${svgPassCulture({ width: 40, height: 40 })} 26901 </div> 26902 <span class="font-bold ">${t("pass_culture")}</span></sonic-link 26903 > 26904 `; 26905 } 26906 }; 26907 SonicPassCultureLink.styles = [tailwind]; 26908 __decorateClass$3e([ 26909 r$5() 26910 ], SonicPassCultureLink.prototype, "isDuotone", 2); 26911 __decorateClass$3e([ 26912 n$5({ type: Object }) 26913 ], SonicPassCultureLink.prototype, "pass_culture", 2); 26914 SonicPassCultureLink = __decorateClass$3e([ 26915 t$3(tagName$21) 26916 ], SonicPassCultureLink); 26917 var __defProp$3a = Object.defineProperty; 26918 var __getOwnPropDesc$3d = Object.getOwnPropertyDescriptor; 26919 var __decorateClass$3d = (decorators, target, key, kind) => { 26920 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3d(target, key) : target; 26921 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 26922 if (decorator = decorators[i2]) 26923 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 26924 if (kind && result) __defProp$3a(target, key, result); 26925 return result; 26926 }; 26927 const tagName$20 = "sonic-buy-event-block-suffix";
26928 let BuyEventBlockSuffix = class extends EventContext(Subscriber$1(i$6)) { 26929 constructor() { 26930 super(...arguments); 26931 this.settings = null; 26932 this.displayBottomArea = false; 26933 this.displayTopArea = false; 26934 this.displayCarpooling = false; 26935 } 26936 willUpdate(changedProperties) { 26937 if ((changedProperties.has("settings") || changedProperties.has("carpoolingSettings")) && this.settings) { 26938 const { reelax_info, pass_culture, carpooling, refund, has_promo } = this.settings; 26939 this.displayCarpooling = !!(this.carpoolingSettings?.access && carpooling?.enabled); 26940 this.displayTopArea = !!(reelax_info?.buy || pass_culture?.url || refund?.url); 26941 this.displayBottomArea = !!(this.displayCarpooling || has_promo); 26942 } 26943 super.willUpdate(changedProperties); 26944 } 26945 render() { 26946 if (this._isGuichet || !this.settings) return A$1; 26947 if (!this.displayTopArea && !this.displayBottomArea) { 26948 this.style.display = "none"; 26949 return A$1; 26950 } 26951 this.style.removeProperty("display"); 26952 const displayReelax = !!this.settings.reelax_info?.all; 26953 const displayPassCulture = !!this.settings.pass_culture?.url; 26954 const displayRefund = !!this.settings.refund?.url; 26955 return b$1` 26956 ${this.displayTopArea ? b$1` <div 26957 class="flex flex-wrap gap-x-6 gap-y-2 text-sm lg:text-base lg:leading-tight ${flexJustify(this.align)}" 26958 > 26959 ${displayReelax ? b$1`<sonic-reelax-link></sonic-reelax-link>` : A$1} 26960 ${displayPassCulture ? b$1`<sonic-passculture-link></sonic-passculture-link>` : A$1} 26961 ${displayRefund ? b$1`<sonic-refund-link></sonic-refund-link>` : A$1} 26962 </div>` : A$1} 26963 ${this.displayTopArea && this.displayBottomArea ? b$1`<sonic-divider class="my-4"></sonic-divider>` : A$1} 26964 ${this.displayBottomArea ? b$1` 26965 <div class="flex flex-wrap gap-x-8 2xl:gap-x-10 gap-y-5 items-end ${flexJustify(this.align)}"> 26966 ${this.displayCarpooling ? b$1`<sonic-carpooling-event-widget class="text-sm"></sonic-carpooling-event-widget>` : A$1} 26967 ${this.settings.has_promo ? b$1`<sonic-promo-form class="inline-block w-[10rem]" size="sm"></sonic-promo-form>` : A$1} 26968 </div> 26969 ` : A$1} 26970 `; 26971 } 26972 }; 26973 BuyEventBlockSuffix.styles = [tailwind]; 26974 __decorateClass$3d([ 26975 c({ context: alignContext, subscribe: true }), 26976 n$5({ type: String }) 26977 ], BuyEventBlockSuffix.prototype, "align", 2); 26978 __decorateClass$3d([ 26979 bind$1("settings.modules.carpooling"), 26980 n$5({ type: Object }) 26981 ], BuyEventBlockSuffix.prototype, "carpoolingSettings", 2); 26982 __decorateClass$3d([ 26983 n$5({ type: Object }) 26984 ], BuyEventBlockSuffix.prototype, "settings", 2); 26985 __decorateClass$3d([ 26986 r$5() 26987 ], BuyEventBlockSuffix.prototype, "displayBottomArea", 2); 26988 __decorateClass$3d([ 26989 r$5()
26990 ], BuyEventBlockSuffix.prototype, "displayTopArea", 2); 26991 __decorateClass$3d([ 26992 r$5() 26993 ], BuyEventBlockSuffix.prototype, "displayCarpooling", 2); 26994 BuyEventBlockSuffix = __decorateClass$3d([ 26995 t$3(tagName$20) 26996 ], BuyEventBlockSuffix); 26997 const formatAmount = (value) => { 26998 return new Intl.NumberFormat("fr-FR", { 26999 style: "currency", 27000 currency: "EUR", 27001 minimumFractionDigits: value % 1 !== 0 ? 2 : 0, 27002 maximumFractionDigits: value % 1 !== 0 ? 2 : 0 27003 }).format(value); 27004 }; 27005 const placementToString = (placementData) => { 27006 if (!placementData) return ""; 27007 const firstPartArray = []; 27008 const record = placementData; 27009 ["area", "door", "type_of_seat"].forEach((key) => { 27010 if (record[key]) firstPartArray.push(record[key]); 27011 }); 27012 const firstPart = firstPartArray.join(" / "); 27013 const secondPartArray = []; 27014 ["row", "seat"].forEach((key) => { 27015 if (record[key]) secondPartArray.push(record[key]); 27016 }); 27017 const secondPart = secondPartArray.join("-"); 27018 const contentArray = []; 27019 if (firstPart) contentArray.push(firstPart); 27020 if (secondPart) contentArray.push(secondPart); 27021 const content = contentArray.join(" - "); 27022 return content; 27023 }; 27024 function getAvailablePrices(allPrices, quota, filterByQuota) { 27025 if (!allPrices) return []; 27026 if (filterByQuota && quota) { 27027 const availablePriceIds = quota.prices?.filter((p2) => p2.visible).map((p2) => p2.price_id); 27028 return allPrices.filter((price) => availablePriceIds?.includes(Number(price?.id) || 0)); 27029 } 27030 return allPrices.filter((price) => price?.price_available); 27031 } 27032 function meaningfulPriceCategories(categories) { 27033 return categories.filter((category) => category.id !== 0); 27034 } 27035 function shouldShowCategorySelect(categories) { 27036 const meaningful = meaningfulPriceCategories(categories); 27037 if (meaningful.length > 1) return true; 27038 return meaningful.length === 1 && !!meaningful[0].title; 27039 } 27040 function getPricesForSelectedCategory(showCategorySelect, priceCategories, selectedCategoryId, availablePrices) { 27041 if (!priceCategories.length) { 27042 return availablePrices; 27043 } 27044 const pool = meaningfulPriceCategories(priceCategories); 27045 const categories = pool.length ? pool : priceCategories; 27046 if (categories.length === 1) { 27047 return categories[0].prices; 27048 } 27049 if (showCategorySelect) { 27050 return categories.find((category) => category.id === selectedCategoryId)?.prices ?? categories[0]?.prices ?? []; 27051 } 27052 return categories.flatMap((category) => category.prices); 27053 } 27054 function findMatchingPriceInCategory(categoryPrices, currentPriceId, allPrices) { 27055 if (!categoryPrices.length) return void 0; 27056 const currentPrice = allPrices.find((price) => Number(price.id) === currentPriceId); 27057 if (!currentPrice?.title) return categoryPrices[0]; 27058 return categoryPrices.find((price) => price.title === currentPrice.title) ?? categoryPrices.find((price) => price.id === currentPrice.id) ?? categoryPrices[0]; 27059 } 27060 function syncFormSelection(state, mutators, scope) { 27061 const { selection, selectedCategoryId, selectedPriceId } = state; 27062 if (scope === "quota") { 27063 const aligned = selection.alignAfterQuotaChange(selectedCategoryId, selectedPriceId); 27064 if (aligned.categoryId !== selectedCategoryId) { 27065 mutators.setCategoryId(aligned.categoryId); 27066 } 27067 if (aligned.priceId !== selectedPriceId) { 27068 mutators.setPriceId(aligned.priceId); 27069 } 27070 } 27071 if (scope === "category") { 27072 const alignedPriceId = selection.alignPriceInCategory(selectedCategoryId, selectedPriceId); 27073 if (alignedPriceId !== selectedPriceId) { 27074 mutators.setPriceId(alignedPriceId); 27075 } 27076 } 27077 if (state.shouldShowQuantitySelect) { 27078 const clamped = Math.min(Math.max(state.selectedQuantity, state.minQuantity), state.maxQuantity); 27079 if (clamped !== state.selectedQuantity) { 27080 mutators.setQuantity(clamped); 27081 } 27082 } 27083 } 27084 function buildQuotaPriceSelection(input) { 27085 const quotaId = Number(input.quota?.id) || 0; 27086 const availablePrices = getAvailablePrices(input.allPrices, input.quota, input.filterByQuota); 27087 const categories = buildCategoriesFromStock( 27088 availablePrices, 27089 input.stock, 27090 quotaId, 27091 input.placesCategories, 27092 input.editCategoryId 27093 ); 27094 const displayCategories = meaningfulPriceCategories(categories); 27095 const showCategorySelect = shouldShowCategorySelect(categories); 27096 const defaultCategoryId = () => displayCategories[0]?.id ?? categories[0]?.id ?? 0; 27097 const pricesInCategory = (categoryId) => getPricesForSelectedCategory(showCategorySelect, categories, categoryId, availablePrices); 27098 const alignPriceInCategory = (categoryId, priceId) => { 27099 const pool = pricesInCategory(categoryId); 27100 if (!pool.length) return priceId;
27101 if (pool.some((price) => Number(price.id) === priceId)) return priceId; 27102 return Number(findMatchingPriceInCategory(pool, priceId, input.allPrices)?.id) || Number(pool[0]?.id) || 0; 27103 }; 27104 const alignAfterQuotaChange = (categoryId, priceId) => { 27105 let effectiveCategoryId = categoryId; 27106 if (showCategorySelect || categories.length === 1) { 27107 if (!categories.some((category) => category.id === effectiveCategoryId)) { 27108 effectiveCategoryId = defaultCategoryId(); 27109 } 27110 } else if (!categories.length) { 27111 effectiveCategoryId = 0; 27112 } 27113 return { 27114 categoryId: effectiveCategoryId, 27115 priceId: alignPriceInCategory(effectiveCategoryId, priceId) 27116 }; 27117 }; 27118 const resolvePrice = (categoryId, priceId) => { 27119 const pool = pricesInCategory(categoryId); 27120 return pool.find((price) => Number(price.id) === priceId) ?? findMatchingPriceInCategory(pool, priceId, input.allPrices); 27121 }; 27122 const isCategoryAvailable = (categoryId) => isStockCategoryAvailable(input.stock, quotaId, categoryId); 27123 return { 27124 availablePrices, 27125 categories, 27126 displayCategories, 27127 showCategorySelect, 27128 pricesInCategory, 27129 resolvePrice, 27130 alignAfterQuotaChange, 27131 alignPriceInCategory, 27132 isCategoryAvailable 27133 }; 27134 } 27135 function buildPriceFormView(input) { 27136 const selection = buildQuotaPriceSelection({ 27137 allPrices: input.allPrices, 27138 placesCategories: input.placesCategories, 27139 stock: input.stock, 27140 quota: input.quota, 27141 filterByQuota: input.filterByQuota, 27142 editCategoryId: input.editCategoryId 27143 }); 27144 const selectedPrice = selection.resolvePrice(input.form.categoryId, input.form.priceId) ?? {}; 27145 const prices = selection.pricesInCategory(input.form.categoryId); 27146 const minQuantity = Math.max(1, Number(selectedPrice.price_min_places) || 1); 27147 const maxQuantity = getMaxQuantity(selectedPrice, input.quota); 27148 const quantity = input.form.quantity || minQuantity; 27149 const validation = getPriceFormValidation({ 27150 selectedQuota: input.quota, 27151 mode: input.mode, 27152 initialQuotaId: input.initialQuotaId, 27153 initialCategoryId: input.editCategoryId, 27154 selectedQuotaId: input.form.quotaId, 27155 isCustomerMode: input.isCustomerMode, 27156 selection, 27157 categoryId: input.form.categoryId 27158 }); 27159 const shouldShowQuantitySelect = validation.canSubmit && input.mode === "add" && !input.parentSubscriptionId && prices.length > 0 && maxQuantity > 1 && maxQuantity > minQuantity; 27160 return { 27161 selection, 27162 selectedQuota: input.quota, 27163 selectedPrice, 27164 prices, 27165 validation, 27166 minQuantity, 27167 maxQuantity, 27168 shouldShowQuantitySelect, 27169 submitQuantity: shouldShowQuantitySelect ? quantity : minQuantity, 27170 freePriceAmount: selectedPrice.is_free_price ? input.form.freePriceAmount : void 0 27171 }; 27172 } 27173 function getStockDetailsForQuota(stock, quotaId) { 27174 if (!stock?.details?.length || !quotaId) return []; 27175 return stock.details.filter((detail) => Number(detail.quota_id) === quotaId); 27176 } 27177 function getStockDetailForCategory(stock, quotaId, categoryId) { 27178 const detailsForQuota = getStockDetailsForQuota(stock, quotaId); 27179 const categoryDetail = detailsForQuota.find((detail) => Number(detail.places_category_id) === categoryId); 27180 if (categoryDetail) return categoryDetail; 27181 return detailsForQuota.find((detail) => !detail.places_category_id); 27182 } 27183 function isStockCategoryAvailable(stock, quotaId, categoryId) { 27184 const detail = getStockDetailForCategory(stock, quotaId, categoryId); 27185 if (!detail) return true; 27186 return detail.has_available !== false; 27187 } 27188 function buildCategoriesFromStock(availablePrices, stock, quotaId, placesCategories, editCategoryId) { 27189 const pricesByCategory = groupPricesByCategory(availablePrices, placesCategories); 27190 const metaById = new Map(placesCategories?.map((c2) => [Number(c2.id) || 0, c2]) ?? []); 27191 const pricesById = new Map(pricesByCategory.map((category) => [category.id, category]));
27192 const stockDetails = getStockDetailsForQuota(stock, quotaId); 27193 if (!stockDetails.length) { 27194 return pricesByCategory; 27195 } 27196 const categoryIds = /* @__PURE__ */ new Set(); 27197 for (const detail of stockDetails) { 27198 const id = Number(detail.places_category_id); 27199 if (id) categoryIds.add(id); 27200 } 27201 if (editCategoryId) categoryIds.add(editCategoryId); 27202 return [...categoryIds].sort( 27203 (a2, b2) => (metaById.get(a2)?.weight ?? Infinity) - (metaById.get(b2)?.weight ?? Infinity) || a2 - b2 27204 ).map((categoryId) => { 27205 const fromGrouped = pricesById.get(categoryId); 27206 const meta = metaById.get(categoryId); 27207 return { 27208 id: categoryId, 27209 title: meta?.title || fromGrouped?.title || "", 27210 prices: fromGrouped?.prices ?? [] 27211 }; 27212 }); 27213 } 27214 function groupPricesByCategory(prices, placesCategories) { 27215 const metaById = new Map(placesCategories?.map((c2) => [Number(c2.id) || 0, c2]) ?? []); 27216 const grouped = /* @__PURE__ */ new Map(); 27217 for (const price of prices) { 27218 const id = Number(price.place_category?.id) || 0; 27219 if (!grouped.has(id)) { 27220 const meta = metaById.get(id); 27221 grouped.set(id, { 27222 id, 27223 title: meta?.title || price.place_category?.title || "", 27224 prices: [] 27225 }); 27226 } 27227 grouped.get(id).prices.push(price); 27228 } 27229 return [...grouped.values()].sort( 27230 (a2, b2) => (metaById.get(a2.id)?.weight ?? Infinity) - (metaById.get(b2.id)?.weight ?? Infinity) || a2.id - b2.id 27231 ); 27232 } 27233 function categoriesToOptions(categories, selectedCategoryId) { 27234 return categories.map((category) => { 27235 const wording2 = category.id !== 0 && category.title ? category.title : category.title || t("prices"); 27236 return { 27237 value: String(category.id), 27238 wording: wording2, 27239 selected: category.id === selectedCategoryId 27240 }; 27241 }); 27242 } 27243 function quantityToOptions(max, min = 1, selectedQuantity) { 27244 const cappedMax = Math.min(Math.max(max, min), 50); 27245 return Array.from({ length: cappedMax - min + 1 }, (_2, index) => { 27246 const value = min + index; 27247 return { 27248 value: String(value), 27249 wording: String(value), 27250 selected: selectedQuantity ? value === selectedQuantity : value === min 27251 }; 27252 }); 27253 } 27254 function getMaxQuantity(price, quota, defaultMax = 50) { 27255 let max = defaultMax; 27256 const priceLimits = [price?.price_max_places, price?.price_places_nb].filter( 27257 (value) => value != null && value > 0 27258 ); 27259 if (priceLimits.length) { 27260 max = Math.min(max, ...priceLimits); 27261 } 27262 const quotaRemaining = quota?.remaining_places_nb; 27263 if (quotaRemaining != null && quotaRemaining >= 0) { 27264 max = Math.min(max, quotaRemaining); 27265 } 27266 const min = Math.max(1, Number(price?.price_min_places) || 1); 27267 return Math.max(min, max); 27268 } 27269 function pricesToOptions(prices, { includeCategory = false, selectedPriceId } = {}) { 27270 if (prices.length === 0) { 27271 return [ 27272 { 27273 value: "", 27274 wording: t("no_price_available"), 27275 selected: true 27276 } 27277 ]; 27278 } 27279 return prices.map((price) => { 27280 const categoryTitle = includeCategory && price.place_category?.id !== 0 && price.place_category?.title ? `${price.place_category.title} â ` : ""; 27281 const amountText = price.is_free_price ? "" : ` ⢠${formatAmount(price.amount_display || 0)}`; 27282 const hasAdditionalProducts = price?.additional_products?.length && price?.additional_products?.length > 0; 27283 const additionnalProductsText = hasAdditionalProducts ? `
27283+ ${price?.additional_products?.map((product) => product.name).join(" + ")}` : ""; 27284 return { 27285 value: String(price.id), 27286 wording: `${categoryTitle}${price.title} ${additionnalProductsText} ${amountText}`, 27287 ...selectedPriceId != null && { selected: Number(price.id) === selectedPriceId } 27288 }; 27289 }); 27290 } 27291 function quotasToOptions(quotas, selectedQuotaId, isCounterMode, isCustomerMode) { 27292 return quotas.map((quota) => { 27293 const { remaining_places_nb, total_places_nb } = quota; 27294 let remainingInfo = ""; 27295 if (isCounterMode) { 27296 remainingInfo = `(reste : ${remaining_places_nb}/${total_places_nb})`; 27297 } else if (isCustomerMode) { 27298 remainingInfo = quota.has_remaining === false || remaining_places_nb === 0 ? b$1` â (${t("indisponible")})` : ""; 27299 } 27300 return { 27301 value: String(quota.id), 27302 wording: b$1`${quota.title} ${remainingInfo}`, 27303 selected: quota.id === selectedQuotaId 27304 }; 27305 }); 27306 } 27307 function isQuotaUnavailable(quota, isCustomerMode) { 27308 if (!quota) return false; 27309 if (isCustomerMode) { 27310 if (quota.has_remaining === false) return true; 27311 if (quota.has_remaining === true) return false; 27312 } 27313 return quota.remaining_places_nb === 0; 27314 } 27315 function filterQuotasForCustomer(quotas) { 27316 return quotas.filter((quota) => quota.prices?.some((p2) => p2.visible)); 27317 } 27318 function createItemsToAdd({ 27319 entity_id, 27320 entity_type, 27321 parent_id, 27322 selectedQuotaId, 27323 selectedPriceId, 27324 freePriceAmount, 27325 quantity = 1 27326 }) { 27327 return [ 27328 { 27329 entity_type, 27330 entity_id, 27331 parent_id, 27332 quantity, 27333 quota: { id: selectedQuotaId }, 27334 price: { 27335 id: selectedPriceId, 27336 ...freePriceAmount && { is_free_price: true, amount: freePriceAmount } 27337 } 27338 } 27339 ]; 27340 } 27341 const PRICE_MESSAGES = { 27342 noPriceAvailable: t("no_price_available"), 27343 noPriceAvailableOnline: t("titre_fallback_tarifs_placement"),
27344 noPriceAvailableOnlineSubtitle: t("fallback_tarifs_placement"), 27345 pricesSoldOut: t("prices_sold_out"), 27346 save: t("enregistrer"), 27347 add: t("LIB_add") 27348 }; 27349 function isEditOnInitialConfig(input) { 27350 const { mode: mode2, initialQuotaId, selectedQuotaId, initialCategoryId, categoryId } = input; 27351 if (mode2 !== "edit" || initialQuotaId == null) return false; 27352 if (Number(initialQuotaId) !== Number(selectedQuotaId)) return false; 27353 if (initialCategoryId != null && initialCategoryId > 0) { 27354 return Number(categoryId) === Number(initialCategoryId); 27355 } 27356 return true; 27357 } 27358 function getPriceFormValidation(input) { 27359 const { 27360 selectedQuota, 27361 mode: mode2, 27362 initialQuotaId, 27363 initialCategoryId, 27364 selectedQuotaId, 27365 isCustomerMode, 27366 selection, 27367 categoryId 27368 } = input; 27369 const editOnInitialConfig = isEditOnInitialConfig({ 27370 mode: mode2, 27371 initialQuotaId, 27372 selectedQuotaId, 27373 initialCategoryId, 27374 categoryId 27375 }); 27376 const quotaUnavailable = isQuotaUnavailable(selectedQuota, isCustomerMode); 27377 const noPriceInQuota = selectedQuota?.prices?.length === 0; 27378 const cantAddPrice = mode2 === "add" && quotaUnavailable || quotaUnavailable && initialQuotaId !== selectedQuotaId; 27379 const noPriceAndCustomer = !editOnInitialConfig && (noPriceInQuota || quotaUnavailable) && isCustomerMode; 27380 if (cantAddPrice || noPriceAndCustomer) { 27381 const selectedQuotaMatchUFR = titleMatchesUFR(selectedQuota); 27382 const noPriceMessage = selectedQuotaMatchUFR ? PRICE_MESSAGES.noPriceAvailableOnline : PRICE_MESSAGES.noPriceAvailable; 27383 return { 27384 canSubmit: false, 27385 errorMessage: noPriceInQuota || quotaUnavailable ? noPriceMessage : PRICE_MESSAGES.pricesSoldOut, 27386 errorSubtitle: selectedQuotaMatchUFR ? PRICE_MESSAGES.noPriceAvailableOnlineSubt
27386itle : void 0 27387 }; 27388 } 27389 if (!editOnInitialConfig && selection?.showCategorySelect && categoryId && !selection.isCategoryAvailable(categoryId)) { 27390 return { canSubmit: false, errorMessage: PRICE_MESSAGES.pricesSoldOut }; 27391 } 27392 return { canSubmit: true }; 27393 } 27394 function titleMatchesUFR(quota) { 27395 const textToTest = ["ufr", "pmr", "mobilité réduite", "handicapé", "fauteuil roulant", "U.F.R.", "P.M.R."]; 27396 return textToTest.some((text) => quota?.title?.toLowerCase().includes(text) ?? false); 27397 } 27398 const priceRange = ({ min, max, is_free_price }) => { 27399 const minAmount = min || 0; 27400 const maxAmount = is_free_price ? max || void 0 : max || 0; 27401 if (min === max && !is_free_price) return b$1`${formatAmount(minAmount)}`; 27402 if (minAmount && !maxAmount) return b$1`${t("pl_from_price_long")} ${formatAmount(minAmount)}`; 27403 if (!min && maxAmount) return b$1`${t("pl_to_price_long")} ${formatAmount(maxAmount || 0)}`; 27404 if (min && maxAmount) return b$1`${formatAmount(minAmount)} ${t("pl_to_price")} ${formatAmount(maxAmount || 0)}`; 27405 return A$1; 27406 }; 27407 var __defProp$39 = Object.defineProperty; 27408 var __getOwnPropDesc$3c = Object.getOwnPropertyDescriptor; 27409 var __decorateClass$3c = (decorators, target, key, kind) => { 27410 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3c(target, key) : target; 27411 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 27412 if (decorator = decorators[i2]) 27413 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 27414 if (kind && result) __defProp$39(target, key, result); 27415 return result; 27416 }; 27417 let PriceRange = class extends Subscriber$1(i$6) { 27418 constructor() { 27419 super(...arguments); 27420 this.prices = []; 27421 this.displayIcon = false; 27422 } 27423 render() { 27424 const availablePrices = this.prices?.filter((price) => price.price_available) || []; 27425 if (!availablePrices.length) return A$1; 27426 const allPricesAreZero = availablePrices.every((price) => price?.amount === 0); 27427 const nonNullPrices = availablePrices.filter((price) => price.amount && price.amount > 0); 27428 const minValue = Math.min(...nonNullPrices.map((price) => price.amount || 0)); 27429 const maxValue = Math.max(...nonNullPrices.map((price) => price.amount || 0)); 27430 const priceRangeContent = this.appType === "counter" ? b$1`${priceRange({ min: minValue, max: maxValue })} ` : b$1`${priceRange({ min: minValue })}`; 27431 return b$1`<div class="flex gap-x-[.35em]"> 27432 ${this.displayIcon ? b$1`<div> 27433 <sonic-icon library="custom" name="circle-euro" class="w-[1em] text-center"></sonic-icon> 27434 </div>` : A$1} 27435 27436 <div>${allPricesAreZero ? b$1`${t("free")}` : priceRangeContent}</div> 27437 </div>`; 27438 } 27439 }; 27440 PriceRange.styles = [tailwind]; 27441 __decorateClass$3c([ 27442 c({ context: appType, subscribe: true }), 27443 r$5() 27444 ], PriceRange.prototype, "appType", 2); 27445 __decorateClass$3c([ 27446 n$5({ type: Array }) 27447 ], PriceRange.prototype, "prices", 2); 27448 __decorateClass$3c([ 27449 n$5({ type: Boolean }) 27450 ], PriceRange.prototype, "displayIcon", 2); 27451 PriceRange = __decorateClass$3c([ 27452 t$3("sonic-price-range") 27453 ], PriceRange); 27454 const seatmapKey = new DataProviderKey("${seatmapProvider}"); 27455 const cartKey = new DataProviderKey("${cartProvider}"); 27456 const seatmapFormKey = new DataProviderKey("${dataProvider}"); 27457 const counterSeatmapKey = new DataProviderKey("counter/seatmapView"); 27458 dp$1(counterSeatmapKey.path); 27459 const seatmapPublisher = (seatmapProvider) => dp$1(seatmapProvider); 27460 const cartPublisher = (cartProvider) => dp$1(cartProvider); 27461 const typeColor = i$9` 27462 :host { 27463 --sc-_color: inherit; 27464 color: var(--sc-_color); 27465 } 27466 27467 :host([type="primary"]) { 27468 --sc-_color: var(--sc-primary, var(--sc-base-content, #000)); 27469 } 27470 :host([type="warning"]) { 27471 --sc-_color: var(--sc-warning, var(--sc-base-content, #000)); 27472 } 27473 :host([type="danger"]) { 27474 --sc-_color: var(--sc-danger, var(--sc-base-content, #000)); 27475 } 27476 :host([type="info"]) { 27477 --sc-_color: var(--sc-info, var(--sc-base-content, #000)); 27478 } 27479 :host([type="success"]) { 27480 --sc-_color: var(--sc-success, var(--sc-base-content, #000)); 27481 } 27482 27483 .inherit-color { 27484 color: var(--sc-_color); 27485 } 27486`; 27487 i$9` 27488 :host { 27489 --sc-_color: inherit; 27490 --sc-_bg: inherit; 27491 color: var(--sc-_color); 27492 background: var(--sc-_bg); 27493 } 27494 27495 /*TYPES*/ 27496 :host([type="primary"]) { 27497 --sc-_bg: var(--sc-primary, var(--sc-base-content, #000)); 27498 --sc-_color: var(--sc-primary-content, var(--sc-base, #fff)); 27499 } 27500 :host([type="warning"]) { 27501 --sc-_bg: var(--sc-warning, var(--sc-base-content, #000)); 27502 --sc-_color: var(--sc-warning-content, var(--sc-base, #fff)); 27503 } 27504 :host([type="danger"]) { 27505 --sc-_bg: var(--sc-danger, var(--sc-base-content, #000)); 27506 --sc-_color: var(--sc-danger-content, var(--sc-base, #fff)); 27507 } 27508 :host([type="info"]) { 27509 --sc-_bg: var(--sc-info, var(--sc-base-content, #000)); 27510 --sc-_color: var(--sc-info-content, var(--sc-base, #fff)); 27511 } 27512 :host([type="success"]) { 27513 --sc-_bg: var(--sc-success, var(--sc-base-content, #000)); 27514 --sc-_color: var(--sc-success-content, var(--sc-base, #fff)); 27515 } 27516
27517 /* dans un contexte de couleur - divider color*/ 27518 :host([type="primary"]), 27519 :host([type="warning"]), 27520 :host([type="danger"]), 27521 :host([type="info"]), 27522 :host([type="success"]) { 27523 --sc-border-color: currentColor; 27524 --sc-divider-opacity: 0.2; 27525 } 27526 27527 :host([type="base"]) { 27528 --sc-_bg: var(--sc-base, #fff); 27529 --sc-_color: var(--sc-base-content, #000); 27530 } 27531 :host([type="default"]), 27532 :host([type="light"]) { 27533 --sc-_bg: var(--sc-base-100, rgba(0, 0, 0, 0.07)); 27534 --sc-_color: var(--sc-base-content, #000); 27535 } 27536 27537 :host([type="neutral"]) { 27538 --sc-_bg: var(--sc-base-content, #000); 27539 --sc-_color: var(--sc-base, #fff); 27540 } 27541 27542 :host([type="invert"]) { 27543 --sc-_bg: var(--sc-base-900, var(--sc-base-content, #000)); 27544 --sc-_color: var(--sc-base, #fff); 27545 } 27546 27547 .inherit-bg { 27548 color: inherit; 27549 } 27550`; 27551 var __decorate$m = function(decorators, target, key, desc) { 27552 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27553 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27554 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; 27555 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27556 }; 27557 const tagName$1$ = "sonic-tr"; 27558 let TableTr = class TableTr extends Subscriber$1(i$6) { 27559 constructor() { 27560 super(...arguments); 27561 this._metadata_ = {}; 27562 } 27563 willUpdate(changedProperties) { 27564 if (changedProperties.has("_metadata_")) { 27565 this.even = !!this._metadata_.even; 27566 this.odd = !!this._metadata_.odd; 27567 this.last = !!this._metadata_.lastChild; 27568 } 27569 super.willUpdate(changedProperties); 27570 } 27571 render() { 27572 return b$1`<slot></slot>`; 27573 } 27574 }; 27575 TableTr.styles = [ 27576 typeColor, 27577 i$9` 27578 :host { 27579 display: table-row; 27580 } 27581 27582 :host([odd]) { 27583 background: var(--sc-table-accent-bg) !important; 27584 } 27585 :host([even]) { 27586 background: var(--sc-table-bg) !important; 27587 } 27588 27589 :host([last]) { 27590 --sc-table-td-border-b: none; 27591 } 27592 :host(:hover) { 27593 background: var(--sc-table-hover-bg) !important; 27594 } 27595 ` 27596 ]; 27597 __decorate$m([ 27598 n$5({ type: Object }) 27599 ], TableTr.prototype, "_metadata_", void 0); 27600 __decorate$m([ 27601 n$5({ type: Boolean, reflect: true }) 27602 ], TableTr.prototype, "even", void 0); 27603 __decorate$m([ 27604 n$5({ type: Boolean, reflect: true }) 27605 ], TableTr.prototype, "odd", void 0); 27606 __decorate$m([ 27607 n$5({ type: Boolean, reflect: true }) 27608 ], TableTr.prototype, "last", void 0); 27609 TableTr = __decorate$m([ 27610 t$3(tagName$1$) 27611 ], TableTr); 27612 var __decorate$l = function(decorators, target, key, desc) { 27613 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27614 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27615 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; 27616 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27617 }; 27618 const tagName$1_ = "sonic-th"; 27619 let TableTh = class TableTh extends i$6 { 27620 render() { 27621 const styles2 = { 27622 textAlign: this.align, 27623 minWidth: this.minWidth, 27624 maxWidth: this.maxWidth, 27625 width: this.width 27626 }; 27627 return b$1`<th 27628 part="th" 27629 style=${o$3(styles2)} 27630 colspan=${o$4(this.colSpan)} 27631 rowspan=${o$4(this.rowSpan)} 27632 > 27633 <slot></slot> 27634 </th> `; 27635 } 27636 }; 27637 TableTh.styles = [ 27638 typeColor, 27639 i$9` 27640 :host { 27641 display: contents; 27642 background: var(--sc-table-bg); 27643 position: sticky; 27644 top: 0; 27645 z-index: 20; 27646 } 27647 27648 th { 27649 all: inherit; 27650 display: table-cell; 27651 border-bottom: calc(var(--sc-border-width, max(1px, 0.12rem)) * 1.5) 27652 solid var(--sc-table-border-color); 27653 text-transform: var(--sc-table-th-tt); 27654 font-weight: var(--sc-table-th-fw); 27655 font-size: var(--sc-table-th-fs); 27656 padding: var(--sc-table-th-py) var(--sc-table-th-px); 27657 } 27658 27659 :host([noBorder]) th { 27660 border-bottom: none; 27661 } 27662 ` 27663 ]; 27664 __decorate$l([ 27665 n$5({ type: Number }) 27666 ], TableTh.prototype, "colSpan", void 0); 27667 __decorate$l([ 27668 n$5({ type: Number }) 27669 ], TableTh.prototype, "rowSpan", void 0); 27670 __decorate$l([ 27671 n$5({ type: String }) 27672 ], TableTh.prototype, "align", void 0); 27673 __decorate$l([ 27674 n$5({ type: String }) 27675 ], TableTh.prototype, "minWidth", void 0); 27676 __decorate$l([ 27677 n$5({ type: String }) 27678 ], TableTh.prototype, "maxWidth", void 0); 27679 __decorate$l([ 27680 n$5({ type: String }) 27681 ], TableTh.prototype, "width", void 0); 27682 TableTh = __decorate$l([ 27683 t$3(tagName$1_) 27684 ], TableTh); 27685 var __decorate$k = function(decorators, target, key, desc) { 27686 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27687 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27688 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; 27689 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27690 }; 27691 const tagName$1Z = "sonic-td"; 27692 let TableTd = class TableTd extends i$6 { 27693 render() { 27694 const styles2 = { 27695 textAlign: this.align, 27696 verticalAlign: this.vAlign, 27697 minWidth: this.minWidth, 27698 maxWidth: this.maxWidth, 27699 width: this.width 27700 }; 27701 return b$1`<td part="td" style=${o$3(styles2)} colspan=${o$4(this.colSpan)} rowspan=${o$4(this.rowSpan)}> 27702 <slot></slot> 27703 </td>`; 27704 } 27705 }; 27706 TableTd.styles = [ 27707 typeColor, 27708 i$9` 27709 :host { 27710 display: contents; 27711 } 27712 td { 27713 all: inherit; 27714 display: table-cell; 27715 padding: var(--sc-table-td-py) var(--sc-table-td-px); 27716 border-top: var(--sc-table-td-border-t, none); 27717 border-bottom: var(--sc-table-td-border-b, none); 27718 border-right: var(--sc-table-td-border-r, none); 27719 border-left: var(--sc-table-td-border-l, none); 27720 } 27721 ` 27722 ]; 27723 __decorate$k([ 27724 n$5({ type: Number }) 27725 ], TableTd.prototype, "colSpan", void 0); 27726 __decorate$k([ 27727 n$5({ type: Number }) 27728 ], TableTd.prototype, "rowSpan", void 0); 27729 __decorate$k([ 27730 n$5({ type: String }) 27731 ], TableTd.prototype, "align", void 0); 27732 __decorate$k([ 27733 n$5({ type: String }) 27734 ], TableTd.prototype, "vAlign", void 0); 27735 __decorate$k([ 27736 n$5({ type: String }) 27737 ], TableTd.prototype, "minWidth", void 0); 27738 __decorate$k([ 27739 n$5({ type: String }) 27740 ], TableTd.prototype, "maxWidth", void 0); 27741 __decorate$k([ 27742 n$5({ type: String }) 27743 ], TableTd.prototype, "width", void 0); 27744 TableTd = __decorate$k([ 27745 t$3(tagName$1Z) 27746 ], TableTd); 27747 var __decorate$j = function(decorators, target, key, desc) { 27748 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27749 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27750 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; 27751 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27752 }; 27753 const tagName$1Y = "sonic-thead"; 27754 let TableThead = class TableThead extends i$6 { 27755 render() { 27756 return b$1`<slot></slot>`; 27757 } 27758 }; 27759 TableThead.styles = [ 27760 i$9` 27761 :host { 27762 display: table-header-group; 27763 } 27764 ` 27765 ]; 27766 TableThead = __decorate$j([ 27767 t$3(tagName$1Y) 27768 ], TableThead); 27769 var __decorate$i = function(decorators, target, key, desc) { 27770 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27771 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27772 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; 27773 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27774 }; 27775 const tagName$1X = "sonic-tbody"; 27776 let TableTbody = class TableTbody extends i$6 { 27777 render() { 27778 return b$1`<tbody part="tbody"> 27779 <slot></slot> 27780 </tbody>`; 27781 } 27782 }; 27783 TableTbody.styles = [ 27784 i$9` 27785 :host { 27786 display: table-row-group; 27787 } 27788 27789 ::slotted(sonic-tr:nth-child(odd)) { 27790 background: var(--sc-table-accent-bg); 27791 } 27792 27793 ::slotted(sonic-tr:hover) { 27794 background: var(--sc-table-hover-bg); 27795 } 27796 27797 ::slotted(sonic-tr:not(:last-child)) { 27798 border-bottom: var(--sc-form-border-width) solid 27799 var(--sc-base-200, rgba(0, 0, 0, 0.12)) !important; 27800 } 27801 ` 27802 ]; 27803 TableTbody = __decorate$i([ 27804 t$3(tagName$1X) 27805 ], TableTbody); 27806 var __decorate$h = function(decorators, target, key, desc) { 27807 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27808 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27809 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; 27810 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27811 }; 27812 const tagName$1W = "sonic-tfoot";
27813 let TableTfoot = class TableTfoot extends i$6 { 27814 render() { 27815 return b$1`<tfoot> 27816 <slot></slot> 27817 </tfoot>`; 27818 } 27819 }; 27820 TableTfoot.styles = [ 27821 i$9` 27822 :host { 27823 display: contents; 27824 } 27825 ` 27826 ]; 27827 TableTfoot = __decorate$h([ 27828 t$3(tagName$1W) 27829 ], TableTfoot); 27830 var __decorate$g = function(decorators, target, key, desc) { 27831 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27832 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27833 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; 27834 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27835 }; 27836 const tagName$1V = "sonic-caption"; 27837 let TableCaption = class TableCaption extends i$6 { 27838 render() { 27839 return b$1`<slot></slot>`; 27840 } 27841 }; 27842 TableCaption.styles = [ 27843 i$9` 27844 :host { 27845 display: table-caption; 27846 font-size: 0.75rem; 27847 color: var(--sc-table-caption-color); 27848 padding: var(--sc-table-td-py) var(--sc-table-td-px) calc(2 * var(--sc-table-td-py)); 27849 } 27850 ` 27851 ]; 27852 TableCaption = __decorate$g([ 27853 t$3(tagName$1V) 27854 ], TableCaption); 27855 var __decorate$f = function(decorators, target, key, desc) { 27856 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 27857 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 27858 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; 27859 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 27860 }; 27861 const tagName$1U = "sonic-table"; 27862 let Table = class Table extends i$6 { 27863 render() { 27864 const containerStyles = { 27865 maxHeight: this.maxHeight 27866 }; 27867 return b$1` 27868 <div 27869 class="table-container ${!this.noCustomScroll ? "custom-scroll" : ""}" 27870 style=${o$3(containerStyles)} 27871 > 27872 <div class="table"> 27873 <slot></slot> 27874 </div> 27875 </div> 27876 `; 27877 } 27878 }; 27879 Table.styles = [ 27880 customScroll, 27881 fontSize, 27882 i$9` 27883 :host { 27884 --sc-table-fw: var(--sc-font-weight-base, 400); 27885 --sc-table-fst: var(--sc-font-style-base, normal); 27886 --sc-table-fs: 1rem; 27887 --sc-table-border-color: var(--sc-border-color); 27888 --sc-table-caption-color: var( 27889 --sc-base-500, 27890 var(--sc-base-content, #000) 27891 ); 27892 --sc-table-bg: var(--sc-base, #fff); 27893 --sc-table-accent-bg: var(--sc-base-50, rgba(0, 0, 0, 0.04)); 27894 --sc-table-hover-bg: var(--sc-base-100, rgba(0, 0, 0, 0.07)); 27895 --sc-table-th-fs: 0.85em; 27896 --sc-table-th-fw: bold; 27897 --sc-table-th-tt: uppercase; 27898 --sc-table-th-px: var(--sc-table-td-px); 27899 --sc-table-th-py: calc(1.8 * var(--sc-table-td-py)); 27900 --sc-table-td-px: 0.5em; 27901 --sc-table-td-py: 0.5em; 27902 --sc-table-bw: var(--sc-border-width, max(1px, 0.12rem)); 27903 display: block; 27904 } 27905 27906 .table-container { 27907 overflow-x: auto; 27908 -webkit-overflow-scrolling: touch; 27909 } 27910 27911 :host([noCustomScroll]) .table-container { 27912 overflow: initial; 27913 } 27914 27915 .table { 27916 width: 100%; 27917 display: table; 27918 box-sizing: border-box; 27919 } 27920 27921 :host([bordered]) .table-container { 27922 border: var(--sc-table-bw) solid var(--sc-table-border-color); 27923 border-radius: var(--sc-rounded); 27924 --sc-table-td-border-b: var(--sc-table-bw) solid 27925 var(--sc-table-border-color); 27926 } 27927 ` 27928 ]; 27929 __decorate$f([ 27930 n$5({ type: String, reflect: true }) 27931 ], Table.prototype, "size", void 0); 27932 __decorate$f([ 27933 n$5({ type: Boolean, reflect: true }) 27934 ], Table.prototype, "bordered", void 0); 27935 __decorate$f([ 27936 n$5({ type: Boolean, reflect: true }) 27937 ], Table.prototype, "rounded", void 0); 27938 __decorate$f([ 27939 n$5({ type: Boolean, reflect: true }) 27940 ], Table.prototype, "noCustomScroll", void 0); 27941 __decorate$f([ 27942 n$5({ type: String }) 27943 ], Table.prototype, "maxHeight", void 0); 27944 Table = __decorate$f([ 27945 t$3(tagName$1U) 27946 ], Table); 27947 const secondScreenDpKeys = { 27948 activePlan: new DataProviderKey("secondScreen/activePlan"), 27949 /** 27950 * Compteur monotone : plan miroir recharge quand la valeur change. 27951 * @example secondScreen.dpKeys.shareMapRevision 27952 */ 27953 shareMapRevision: new DataProviderKey("secondScreen/shareMapRevision") 27954 }; 27955 var SecondScreenStorageKey = /* @__PURE__ */ ((SecondScreenStorageKey2) => { 27956 SecondScreenStorageKey2["Enabled"] = "SecondScreen:enabled";
27957 SecondScreenStorageKey2["Loaded"] = "SecondScreen:Loaded"; 27958 SecondScreenStorageKey2["EventId"] = "SecondScreen:EventId"; 27959 SecondScreenStorageKey2["ShareMapId"] = "SecondScreen:ShareMapId"; 27960 SecondScreenStorageKey2["CartSnapshot"] = "SecondScreen:CartSnapshot"; 27961 SecondScreenStorageKey2["WindowBounds"] = "SecondScreen:WindowBounds"; 27962 return SecondScreenStorageKey2; 27963 })(SecondScreenStorageKey || {}); 27964 const secondScreenStorage = { 27965 enabledValue: "true", 27966 defaultValue: "0", 27967 keys: SecondScreenStorageKey 27968 }; 27969 const { keys, enabledValue, defaultValue } = secondScreenStorage; 27970 const activePlanKey = secondScreenDpKeys.activePlan; 27971 const shareMapRevisionKey = secondScreenDpKeys.shareMapRevision; 27972 const isSecondScreenPage = () => /\/second-screen(?:[?#]|$)/.test(window.location.pathname); 27973 const VIEWPORT_BUMP_DEBOUNCE_MS = 200; 27974 const MIRROR_SOURCE_ID = "main"; 27975 const STORAGE_INT_RADIX = 10; 27976 let viewportBumpTimer = 0; 27977 function readStorageInt(key) { 27978 return parseInt(localStorage.getItem(key) || defaultValue, STORAGE_INT_RADIX); 27979 } 27980 function isMainWindowSecondScreenActive() { 27981 if (isSecondScreenPage()) return false; 27982 return localStorage.getItem(keys.Enabled) === enabledValue; 27983 } 27984 function nextShareMapRevision() { 27985 return readStorageInt(keys.ShareMapId) + 1; 27986 } 27987 function pushActivePlanToStorage(plan) { 27988 if (localStorage.getItem(keys.Enabled) !== enabledValue) return; 27989 const nextEventId = plan?.eventId ?? 0; 27990 const prev = localStorage.getItem(keys.EventId); 27991 localStorage.setItem(keys.EventId, String(nextEventId)); 27992 if (String(nextEventId) === prev) return; 27993 const revision = nextShareMapRevision(); 27994 localStorage.setItem(keys.ShareMapId, String(revision)); 27995 set$1(shareMapRevisionKey, revision); 27996 } 27997 const secondScreenPlan = { 27998 /** 27999 * Plusieurs seatmap-view : sourceId désigne le plan actif. 28000 * @example secondScreen.plan.set(eventId, sourceId) 28001 */ 28002 set(eventId, sourceId) { 28003 if (isSecondScreenPage() || !eventId) return; 28004 set$1(activePlanKey, { eventId, sourceId }); 28005 }, 28006 clear(sourceId) { 28007 if (isSecondScreenPage()) return; 28008 const activePlan = get$2(activePlanKey); 28009 if (activePlan?.sourceId !== sourceId) return; 28010 set$1(activePlanKey, null); 28011 }, 28012 /** 28013 * Le 2e écran ignore les événements canvas Haxe du plan principal. 28014 * @example secondScreen.plan.bumpRevision() 28015 */ 28016 bumpRevision() { 28017 if (!isMainWindowSecondScreenActive()) return; 28018 const revision = nextShareMapRevision(); 28019 localStorage.setItem(keys.ShareMapId, String(revision)); 28020 set$1(shareMapRevisionKey, revision); 28021 }, 28022 /** 28023 * planChanged Haxe rafale : debounce avant ShareMapId. 28024 * @example secondScreen.plan.scheduleViewportBump() 28025 */ 28026 scheduleViewportBump() { 28027 if (!isMainWindowSecondScreenActive()) return; 28028 clearTimeout(viewportBumpTimer); 28029 viewportBumpTimer = window.setTimeout(() => secondScreenPlan.bumpRevision(), VIEWPORT_BUMP_DEBOUNCE_MS); 28030 }, 28031 /** 28032 * Réécrit localStorage si activePlan inchangé (activation 2e écran). 28033 * @example secondScreenPlan.flushToStorage() 28034 */ 28035 flushToStorage() { 28036 const activePlan = get$2(activePlanKey); 28037 pushActivePlanToStorage(activePlan); 28038 }, 28039 /** 28040 * Fenêtre 2e écran : storage event â DP (pas de DP partagé). 28041 * @example secondScreen.plan.syncFromStorage() 28042 */ 28043 syncFromStorage() { 28044 const eventId = readStorageInt(keys.EventId); 28045 const revision = readStorageInt(keys.ShareMapId); 28046 const activePlan = eventId > 0 ? { eventId, sourceId: MIRROR_SOURCE_ID } : null; 28047 set$1(activePlanKey, activePlan); 28048 set$1(shareMapRevisionKey, revision); 28049 }, 28050 /** 28051 * Branche activePlan â localStorage (fenêtre principale). 28052 * @example secondScreenPlan.installBridge() 28053 */ 28054 installBridge() { 28055 if (isSecondScreenPage()) return; 28056 dp$1(activePlanKey.path).onAssign(pushActivePlanToStorage); 28057 } 28058 }; 28059 const secondScreen = { 28060 plan: { 28061 set: secondScreenPlan.set, 28062 clear: secondScreenPlan.clear, 28063 bumpRevision: secondScreenPlan.bumpRevision, 28064 scheduleViewportBump: secondScreenPlan.scheduleViewportBump, 28065 syncFromStorage: secondScreenPlan.syncFromStorage 28066 } 28067 }; 28068 function getCounterSeatmapActions(seatMapDataOrProvider) { 28069 if (seatMapDataOrProvider == null) { 28070 return void 0; 28071 } 28072 if (typeof seatMapDataOrProvider === "string") { 28073 return getCounterSeatmapActions(seatmapPublisher(seatMapDataOrProvider).get()); 28074 } 28075 return seatMapDataOrProvider.counterSeatmapActions; 28076 }
28077 const allSeatsInCartContext = (seats, cartProvider) => { 28078 if (!seats || seats.length === 0 || !cartProvider) { 28079 return false; 28080 } 28081 const isCurrentCart = cartProvider === "cart/current"; 28082 const isReservation2 = cartProvider.startsWith("reservations"); 28083 if (isCurrentCart) { 28084 return seats.every((seat) => seat.panier); 28085 } else if (isReservation2) { 28086 return seats.every((seat) => seat.reserved); 28087 } else { 28088 const cartId = cartProvider.split("/")[1]; 28089 return seats.every((seat) => seat.id_panier === Number(cartId)); 28090 } 28091 }; 28092 const getUrl = (pathName) => { 28093 const containerElement = document.querySelector("sonic-tickets-app, sonic-counter-app, sonic-tickets-app-legacy"); 28094 const serviceURL = containerElement?.getAttribute("serviceURL") || document.location.origin; 28095 let url = new URL(serviceURL, document.location.origin); 28096 if (serviceURL?.startsWith("http")) { 28097 url = new URL(serviceURL); 28098 } 28099 url.pathname = pathName; 28100 return url; 28101 }; 28102 const publishPlanActionMessage = (content) => { 28103 set("defaultMessages", { 28104 messages: [{ content, status: "error" }] 28105 }); 28106 }; 28107 const parsePlanApiResponse = async (response) => { 28108 const raw = await response.text(); 28109 let message = ""; 28110 try { 28111 const parsed = JSON.parse(raw); 28112 message = (parsed.message || "").trim(); 28113 } catch { 28114 message = raw.trim(); 28115 } 28116 const ok = response.ok && (message === "" || message.toLowerCase() === "ok" || message.toLowerCase() === "lib_success"); 28117 return { ok, message: message || (response.ok ? "" : response.statusText) }; 28118 }; 28119 const updateSeatmapStatus = (seatmapProvider) => { 28120 const publisher = seatmapPublisher(seatmapProvider); 28121 const updateStatusRequestIndex = publisher.updateStatusRequestIndex?.get() ?? 0; 28122 publisher.updateStatusRequestIndex?.set(updateStatusRequestIndex + 1); 28123 secondScreen.plan.scheduleViewportBump(); 28124 }; 28125 const confirmSeatmapAction = (options) => { 28126 const { 28127 title, 28128 content = "", 28129 onConfirm, 28130 confirmLabel = t("confirm"), 28131 confirmType = "primary", 28132 confirmIcon = "check", 28133 maxWidth 28134 } = options; 28135 const handleConfirmClick = () => { 28136 void onConfirm(); 28137 }; 28138 const actions = b$1` 28139 <sonic-button 28140 minWidth="10rem" 28141 shape="block" 28142 type=${confirmType} 28143 hideModal 28144 @click=${handleConfirmClick} 28145 > 28146 <sonic-icon name=${confirmIcon} slot="prefix" library="custom"></sonic-icon> 28147 ${confirmLabel} 28148 </sonic-button> 28149 <sonic-button minWidth="10rem" shape="block" hideModal>${t("cancel")}</sonic-button> 28150 `; 28151 const modalOptions = { 28152 title, 28153 content, 28154 maxWidth, 28155 actions, 28156 removeOnHide: true 28157 }; 28158 return Modal.create(modalOptions); 28159 }; 28160 const seatsSelectionInfos = (seatMapProvider, seats) => { 28161 if (!seats.length) return A$1; 28162 if (seats.length === 1) { 28163 const isPlacementLibre = seats[0].positioningType === "2"; 28164 return seatCondensedSummary(seatToSeatingType(seatMapProvider, seats[0]), "md", isPlacementLibre); 28165 } 28166 return seatsTable(seatMapProvider, seats); 28167 }; 28168 const removeSeatSelection = async (options) => { 28169 const { seats, cartProvider, element, entity_id } = options; 28170 const seatmapProvider = element.getSeatmapProvider(); 28171 if (seatmapProvider) { 28172 seats.forEach((seat) => { 28173 seat.panier = false; 28174 seat.enCours = false; 28175 }); 28176 } 28177 await Cart.removeItems({ 28178 apiConfiguration: HTML.getApiConfiguration(element), 28179 cartProvider, 28180 query: { 28181 seat_ids: seats.map((seat) => Number(seat.name)), 28182 entity_type: EntityType.Event, 28183 ...entity_id ? { entity_id } : {} 28184 } 28185 }); 28186 updateSeatmapStatus(seatmapProvider); 28187 }; 28188 const neutraliser = async (seats, eventId, seatmapProvider) => { 28189 const place_ids = seats?.map((seat) => seat.name); 28190 const url = getUrl(`/la_billetterie/plan/api/neutraliser`) + `?id_evenement=${eventId}&id_place=${place_ids?.join(",")}`; 28191 const response = await fetch(url, { 28192 credentials: "include", 28193 mode: "cors" 28194 }); 28195 const { ok, message } = await parsePlanApiResponse(response); 28196 if (ok) { 28197 updateSeatmapStatus(seatmapProvider); 28198 } else if (message) { 28199 publishPlanActionMessage(message); 28200 } 28201 }; 28202 const deNeutraliser = async (seats, eventId, seatmapProvider) => { 28203 const id_place = seats?.map((seat) => seat.name) || []; 28204 const id_evenement = eventId; 28205 const url = getUrl("/la_billetterie/plan/api/decontingenter");
28206 const urlParams = new URLSearchParams(); 28207 for (const id of id_place) { 28208 urlParams.append("id_place[]", id.toString()); 28209 } 28210 if (id_evenement) { 28211 urlParams.append("id_evenement", id_evenement.toString()); 28212 } 28213 url.search = urlParams.toString(); 28214 const response = await fetch(url.toString(), { 28215 credentials: "include", 28216 mode: "cors" 28217 }); 28218 const { ok, message } = await parsePlanApiResponse(response); 28219 if (ok) { 28220 updateSeatmapStatus(seatmapProvider); 28221 } else if (message) { 28222 publishPlanActionMessage(message); 28223 } 28224 }; 28225 const isSeatNeutralised = (seat) => { 28226 return Number(seat.availability) === 1; 28227 }; 28228 const seatsTable = (seatMapProvider, seats) => { 28229 if (!seats?.length) return A$1; 28230 const hasZone = seats.some((place) => place.zone); 28231 const hasPorte = seats.some((place) => place.door); 28232 const hasRang = seats.some((place) => place.range); 28233 return b$1` 28234 <sonic-table bordered maxHeight="10rem" size="sm"> 28235 <sonic-thead> 28236 <sonic-tr> 28237 ${hasZone ? b$1`<sonic-th align="center"> ${t("pl_zone")} </sonic-th>` : A$1} 28238 ${hasPorte ? b$1`<sonic-th align="center"> ${t("pl_porte")} </sonic-th>` : A$1} 28239 ${hasRang ? b$1`<sonic-th align="center"> ${t("pl_rang")} </sonic-th>` : A$1} 28240 <sonic-th align="center"> ${t("pl_numero")} </sonic-th> 28241 <sonic-th align="center"> ${t("pl_type_siege")} </sonic-th> 28242 </sonic-tr> 28243 </sonic-thead> 28244 <sonic-tbody> 28245 ${seats.map((place) => { 28246 const seating = seatToSeatingType(seatMapProvider, place); 28247 const { area, door, row, number, type_of_seat } = seating; 28248 return b$1` <sonic-tr> 28249 ${hasZone ? b$1`<sonic-td align="center"> ${area} </sonic-td>` : A$1} 28250 ${hasPorte ? b$1`<sonic-td align="center"> ${door} </sonic-td>` : A$1} 28251 ${hasRang ? b$1`<sonic-td align="center"> ${row} </sonic-td>` : A$1} 28252 <sonic-td align="center"> ${number} </sonic-td> 28253 <sonic-td align="center"> ${type_of_seat} </sonic-td> 28254 </sonic-tr>`; 28255 })} 28256 </sonic-tbody> 28257 </sonic-table> 28258 `; 28259 }; 28260 const seatToSeatingType = (seatMapProvider, seat) => { 28261 const conf = seatmapPublisher(seatMapProvider).conf?.get(); 28262 if (!conf) { 28263 return { id: Number(seat.name), seatMapId: seat.id_detail }; 28264 } 28265 function getPublicName(key, id) { 28266 const item = conf[key]?.find((item2) => Number(item2.id) === Number(id)); 28267 return item?.nom; 28268 } 28269 const infos = { 28270 area: getPublicName("zone", seat.zone), 28271 rang: getPublicName("rang", seat.row), 28272 numero: getPublicName("numero", seat.seat), 28273 type_siege: getPublicName("type_siege", seat.seatType), 28274 porte: getPublicName("porte", seat.door) 28275 }; 28276 return { 28277 id: Number(seat.name), 28278 area: infos.area, 28279 row: infos.rang, 28280 number: infos.numero, 28281 type_of_seat: infos.type_siege, 28282 door: infos.porte, 28283 seatMapId: seat.id_detail, 28284 common_name: `${infos.area || ""} ${infos.rang || ""}${infos.rang && infos.numero ? "-" : ""}${infos.numero || ""}` 28285 }; 28286 }; 28287 const seatCondensedSummary = (seat, size = "md", isPlacementLibre = false) => { 28288 const { area, door, row, number, type_of_seat } = seat; 28289 const hasArea = !!area; 28290 const hasDoor = !!door; 28291 const hasRow = !!row; 28292 const hasNumber = !!number; 28293 const hasTypeOfSeat = !!type_of_seat; 28294 const labelTextSize = size === "sm" ? "text-2xs" : "text-xs"; 28295 const valueTextSize = size === "sm" ? "text-sm" : "text-base"; 28296 const isChair = type_of_seat && typeOfSeatIsChair(type_of_seat); 28297 return b$1` 28298 <div class="${valueTextSize}"> 28299 ${hasTypeOfSeat ? b$1` 28300 <div 28301 class="text-center ${size === "sm" ? "text-xs" : "text-sm"} ${isChair ? "text-neutral-500" : "text-danger font-bold "}" 28302 > 28303 <sonic-icon name="loveseat" library="custom"></sonic-icon> ${type_of_seat} 28304 </div> 28305 <div class="h-[1px] bg-neutral-200 mt-1 mb-2"></div> 28306 ` : A$1} 28307 <div class="flex divide-x-[1px] divide-neutral-200 w-full justify-center pb-1"> 28308 ${hasArea ? b$1` 28309 <div class="flex flex-col gap-1 items-center pr-3"> 28310 <div class="${labelTextSize} text-neutral-500">${t("pl_zone")}</div> 28311 <div class="font-bold whitespace-nowrap leading-none">${area}</div> 28312 </div> 28313 ` : A$1} 28314 ${hasRow && !isPlacementLibre ? b$1` 28315 <div class="flex flex-col gap-1 items-center px-3"> 28316 <div class="${labelTextSize} text-neutral-500">${t("pl_rang")}</div> 28317 <div class="font-bold whitespace-nowrap leading-none">${row}</div> 28318 </div> 28319 ` : A$1} 28320 ${hasNumber && !isPlacementLibre ? b$1` 28321 <div class="flex flex-col gap-1 items-center px-3"> 28322 <div class="${labelTextSize} text-neutral-500">${t("pl_numero")}</div> 28323 <div class="font-bold whitespace-nowrap leading-none">${number}</div> 28324 </div> 28325 ` : A$1} 28326 ${isPlacementLibre ? b$1` 28327 <div class="flex flex-col gap-1 items-center px-3"> 28328 <div class="${labelTextSize} text-neutral-500">${t("pl_type_placement")}</div> 28329 <div class="font-bold whitespace-nowrap leading-none">${t("placement_libre")}</div> 28330 </div> 28331 ` : A$1} 28332 ${hasDoor ? b$1` 28333 <div class="flex flex-col gap-1 items-center pl-3"> 28334 <div class="${labelTextSize} text-neutral-500">${t("pl_porte")}</div> 28335 <div class="font-bold whitespace-nowrap leading-none">${door}</div> 28336 </div> 28337 ` : A$1} 28338 </div> 28339 </div> 28340 `; 28341 };
28342 const getCategoryFromSeatmapRange = (seatMapProvider, range) => { 28343 const conf = seatmapPublisher(seatMapProvider).conf?.get(); 28344 const category = conf?.categorie?.find((item) => Number(item.id) === Number(range)); 28345 return category ? { id: Number(category.id), title: category.nom.toString(), color: category.couleur?.toString() } : null; 28346 }; 28347 const getQuotaFromSeatmap = (seatMapProvider, seat) => { 28348 const conf = seatmapPublisher(seatMapProvider).conf?.get(); 28349 const quota = conf?.contingentement_interne?.find((item) => Number(item.id) === Number(seat.contingentementInterne)); 28350 return quota ? { 28351 id: Number(quota.id), 28352 title: quota.nom.toString(), 28353 color: quota.couleur?.toString(), 28354 is_public: quota.en_ligne === "1" ? true : false 28355 } : null; 28356 }; 28357 const getCartSeats = (seatmapProvider, cartProvider) => { 28358 const cartId = cartPublisher(cartProvider).get()?.data?.id || 0; 28359 const seats = seatmapPublisher(seatmapProvider).get()?.mainState?.selectedLevel?.chairs || []; 28360 return cartId > 0 ? seats.filter((seat) => Number(seat.id_panier) === Number(cartId)) : seats.filter((seat) => seat.panier); 28361 }; 28362 const selectCartSeats = (seatmapProvider, cartProvider) => { 28363 const cartSeats = getCartSeats(seatmapProvider, cartProvider); 28364 seatmapPublisher(seatmapProvider).selectedSeats?.set(cartSeats); 28365 }; 28366 const resetSelection = (seatmapProvider) => { 28367 seatmapPublisher(seatmapProvider).selectedSeats?.set([]); 28368 }; 28369 const isLockedForever = (status) => { 28370 return [ 28371 ReservationStatus.Deleted, 28372 ReservationStatus.Expired, 28373 ReservationStatus.Processing, 28374 ReservationStatus.Processed, 28375 ReservationStatus.Error, 28376 ReservationStatus.Disabled, 28377 ReservationStatus.DeclinedForever 28378 ].includes(status ?? ReservationStatus.Draft); 28379 }; 28380 const displayExpired = (status) => { 28381 return [ 28382 ReservationStatus.Draft, 28383 ReservationStatus.Pending, 28384 ReservationStatus.PartiallyProcessed, 28385 ReservationStatus.Processed 28386 ].includes(status ?? ReservationStatus.Draft); 28387 }; 28388 const getQuoteTypeLabel = (type) => { 28389 if (type === CartType.ReservationRequest) return "justificatif"; 28390 if (type === QuoteTypeEnum.Proof) return "justificatif"; 28391 return "devis"; 28392 }; 28393 const isReservation = (cartType) => { 28394 return cartType === CartType.Reservation; 28395 }; 28396 const isReservationRequest = (cartType) => { 28397 return cartType === CartType.ReservationRequest; 28398 }; 28399 const isWaitingList = (cartType) => { 28400 return cartType === CartType.WaitingLists; 28401 }; 28402 const isRequest = (cartType) => { 28403 return isReservationRequest(cartType) || isWaitingList(cartType); 28404 }; 28405 const isInitialRequest = (cart) => { 28406 if (!cart) return false; 28407 const noCartOrigin = !cart.cart_origin?.id; 28408 return isRequest(cart?.cartType) && noCartOrigin; 28409 }; 28410 const getCartNumber = (cart) => { 28411 if (!(cart && "id" in cart)) return ""; 28412 const cartOriginId = cart?.cart_origin?.id; 28413 const hasOrigin = isRequest(cart?.cartType) && cartOriginId; 28414 const id = hasOrigin ? cartOriginId : cart?.id; 28415 return id; 28416 }; 28417 const closeParentModal = (element) => { 28418 if (!element) return; 28419 const parentModal = HTML.getClosestElement(element, "sonic-modal"); 28420 parentModal?.hide(); 28421 }; 28422 const getEventsForSubscriptions = async (options) => { 28423 const { apiConfiguration, subscriptions, accessParams, limit } = options; 28424 const api2 = new API(apiConfiguration); 28425 const allSubscriptionIds = subscriptions.map((item) => item?.entity_id?.toString() || ""); 28426 const events = await api2.get( 28427 entityEndPoint({ 28428 entityType: EntityType.Event, 28429 subscriptionTypeIds: allSubscriptionIds, 28430 accessParams, 28431 limit 28432 }) 28433 ); 28434 if (!events.success) return []; 28435 return events.data; 28436 }; 28437 const isSubscriptionRequired = (subscriptionRequirement, appType2) => { 28438 return subscriptionRequirement?.active && appType2 === "customer" ? true : false; 28439 }; 28440 const renderEndingMessage = (cartType, appType2) => { 28441 const label2 = t("LIB_request_created_message"); 28442 const route2 = isReservationRequest(cartType) ? "account.reservationRequests" : "account.waitingLists"; 28443 return b$1`<sonic-alert status="success" label=${label2} size="lg" background> 28444 ${isReservationRequest(cartType) ? b$1` 28445 <sonic-app-link 28446 to="home" 28447 type="success" 28448 variant="default" 28449 autoActive="disabled" 28450 class="mt-2" 28451 @click=${(e2) => {
28452 closeParentModal(e2.target); 28453 }} 28454 > 28455 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 28456 ${t("LIB_retour_accueil")} 28457 </sonic-app-link> 28458 ` : A$1} 28459 ${isWaitingList(cartType) ? b$1` 28460 <sonic-button 28461 to="home" 28462 type="success" 28463 variant="default" 28464 autoActive="disabled" 28465 class="mt-2" 28466 @click=${(e2) => { 28467 closeParentModal(e2.target); 28468 }} 28469 > 28470 <sonic-icon name="check" library="custom"></sonic-icon> 28471 ${t("LIB_terminer")} 28472 </sonic-app-link> 28473 ` : A$1} 28474 ${appType2 === "customer" ? b$1` 28475 <sonic-app-link 28476 to=${route2} 28477 @click=${(e2) => { 28478 closeParentModal(e2.target); 28479 }} 28480 variant="outline" 28481 type="success" 28482 autoActive="disabled" 28483 class="mt-2" 28484 > 28485 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 28486 ${t("LIB_mes_demandes")} 28487 </sonic-app-link> 28488 ` : A$1} 28489 </sonic-alert>`; 28490 }; 28491 var __defProp$38 = Object.defineProperty; 28492 var __getOwnPropDesc$3b = Object.getOwnPropertyDescriptor; 28493 var __decorateClass$3b = (decorators, target, key, kind) => { 28494 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3b(target, key) : target; 28495 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 28496 if (decorator = decorators[i2]) 28497 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 28498 if (kind && result) __defProp$38(target, key, result); 28499 return result; 28500 }; 28501 let SonicSeatSuggest = class extends i$6 { 28502 constructor() { 28503 super(...arguments); 28504 this.sessionId = 0; 28505 this.cartProvider = "cart/current"; 28506 this.cartItems = []; 28507 this.cartEntities = []; 28508 this.seatmapProvider = "seatmap"; 28509 this._seatmapId = 0; 28510 this._suggestions = []; 28511 this._hasSeatsInCart = false; 28512 this._busy = false; 28513 this._fetchKey = ""; 28514 this._refreshGen = 0; 28515 this._fetchPromiseKey = ""; 28516 this._fetchPromise = null; 28517 this._lastAvailability = { available_seats: [], unavailable_seats: [], total_checked: 0 }; 28518 } 28519 updated(changed) { 28520 if (changed.has("sessionId")) { 28521 this._seatmapId = 0; 28522 this._suggestions = []; 28523 this._fetchKey = ""; 28524 this._fetchPromiseKey = ""; 28525 this._fetchPromise = null; 28526 ++this._refreshGen; 28527 } 28528 if (changed.has("sessionId") || changed.has("cartItems") || changed.has("cartEntities")) { 28529 void this.refresh(); 28530 } 28531 } 28532 async refresh() { 28533 if (!this.sessionId) return; 28534 if (!this._seatmapId) { 28535 const sessionId = this.sessionId; 28536 const cached = SonicSeatSuggest.seatmapIdBySession.get(sessionId); 28537 if (cached) { 28538 this._seatmapId = cached; 28539 } else { 28540 const result = await getDefaultApi().get( 28541 entityEndPoint({ 28542 entityType: EntityType.Event, 28543 entityId: sessionId, 28544 accessParams: this.accessParams, 28545 features: [Feature.Settings] 28546 }) 28547 ); 28548 if (sessionId !== this.sessionId) return; 28549 const seatmapId = result?.data?.settings?.seatmapId || 0; 28550 if (seatmapId > 0) SonicSeatSuggest.seatmapIdBySession.set(sessionId, seatmapId); 28551 this._seatmapId = seatmapId; 28552 } 28553 } 28554 if (!this._seatmapId || !this.cartItems.length) { 28555 this._suggestions = []; 28556 this._hasSeatsInCart = false; 28557 return; 28558 } 28559 const suggestions = this.buildSuggestions(this._seatmapId); 28560 if (!suggestions.length) { 28561 this._suggestions = []; 28562 this._hasSeatsInCart = false; 28563 return; 28564 } 28565 const fetchKey = `${this.sessionId}:${this._seatmapId}:${suggestions.map((s2) => s2.seatsSlug).join("|")}`; 28566 if (fetchKey !== this._fetchKey) { 28567 if (this._fetchPromiseKey !== fetchKey) { 28568 this._fetchPromiseKey = fetchKey; 28569 const gen = ++this._refreshGen; 28570 this._fetchPromise = this.checkSeatsAvailability(suggestions).then((availability) => { 28571 if (gen !== this._refreshGen) return; 28572 this._fetchKey = fetchKey; 28573 this._lastAvailability = availability; 28574 }); 28575 } 28576 await this._fetchPromise; 28577 } 28578 this._suggestions = this.filterUnavailableSuggestions(suggestions, this._lastAvailability); 28579 } 28580 hasCartSeatsOnSeatmap(seatmapId) { 28581 return this.cartItems.some((item) => item.seat?.id && item.seat.seatMapId === seatmapId); 28582 } 28583 buildSuggestions(seatmapId) { 28584 if (!this.hasCartSeatsOnSeatmap(seatmapId)) { 28585 return []; 28586 } 28587 const suggestionsMap = /* @__PURE__ */ new Map(); 28588 for (const item of this.cartItems) { 28589 const seatId = item.seat?.id; 28590 if (!seatId || !item.entity_id || item.seat?.seatMapId !== seatmapId) continue; 28591 const sourceSessionId = item.entity_id; 28592 if (!suggestionsMap.has(sourceSessionId)) { 28593 suggestionsMap.set(sourceSessionId, { 28594 sessionId: sourceSessionId,
28595 sessionTitle: this.getSessionTitle(sourceSessionId), 28596 seats: [], 28597 seatsSlug: "", 28598 seatmapId 28599 }); 28600 } 28601 const sessionSuggestion = suggestionsMap.get(sourceSessionId); 28602 sessionSuggestion.seats.push({ 28603 seatId, 28604 shortName: item.seat?.short_name || "", 28605 seat: item.seat, 28606 quotaId: item.quota?.id || 0, 28607 parent: getParentItem(item, this.cartProvider) || {}, 28608 price: item.price 28609 }); 28610 } 28611 const itemsInCart = this.getCurrentSessionCartItems(); 28612 this._hasSeatsInCart = itemsInCart.length > 0; 28613 const suggestionsBySlug = /* @__PURE__ */ new Map(); 28614 for (const suggestion of suggestionsMap.values()) { 28615 suggestion.seats.sort((a2, b2) => a2.shortName.localeCompare(b2.shortName)); 28616 suggestion.seatsSlug = `${suggestion.seatmapId}-${suggestion.seats.map((s2) => s2.seatId).join("-")}`; 28617 suggestionsBySlug.set(suggestion.seatsSlug, suggestion); 28618 } 28619 let suggestions = [...suggestionsBySlug.values()]; 28620 let sortedSuggestionsArray = suggestions.sort((a2, b2) => this.compareSuggestions(a2, b2)); 28621 if (isSubscriptionRequired(this.subscriptionRequirement, this.appType)) { 28622 sortedSuggestionsArray = sortedSuggestionsArray.filter( 28623 (suggestion) => suggestion.seats?.every((seat) => seat.parent.id) 28624 ); 28625 } 28626 return sortedSuggestionsArray; 28627 } 28628 countSubscriptionSeats(suggestion) { 28629 return suggestion.seats.filter((seat) => seat.parent.id).length; 28630 } 28631 compareSuggestions(a2, b2) { 28632 const bySeatCount = b2.seats.length - a2.seats.length; 28633 if (bySeatCount !== 0) { 28634 return bySeatCount; 28635 } 28636 const bySubscriptionCount = this.countSubscriptionSeats(b2) - this.countSubscriptionSeats(a2); 28637 if (bySubscriptionCount !== 0) { 28638 return bySubscriptionCount; 28639 } 28640 return a2.sessionTitle.localeCompare(b2.sessionTitle); 28641 } 28642 getSessionTitle(sessionId) { 28643 const session = this.cartEntities.find( 28644 (entity) => entity.id === sessionId && entity.entity_type === EntityType.Event 28645 ); 28646 return session?.edito?.title || ""; 28647 } 28648 async checkSeatsAvailability(suggestions) { 28649 const empty = { available_seats: [], unavailable_seats: [], total_checked: 0 }; 28650 const seatIds = [...new Set(suggestions.flatMap((s2) => s2.seats.map((seat) => seat.seatId)))]; 28651 if (!seatIds.length) return empty; 28652 const result = await getDefaultApi().post(`/seat-availability/check`, { 28653 event_id: this.sessionId, 28654 seat_ids: seatIds 28655 }); 28656 return result?.data || empty; 28657 } 28658 getCurrentSessionCartItems() { 28659 return this.cartItems.filter( 28660 (item) => Number(item.entity_id) === Number(this.sessionId) && item.entity_type === EntityType.Event && item.seat?.id 28661 ); 28662 } 28663 suggestionMatchesCurrentSessionCart(suggestion) { 28664 const itemsInCart = this.getCurrentSessionCartItems(); 28665 if (!itemsInCart.length || suggestion.seats.length !== itemsInCart.length) return false; 28666 return itemsInCart.every( 28667 (item) => suggestion.seats.some( 28668 (seat) => seat.seatId === item.seat?.id && String(seat.parent.id || "") === String(item.parent_id || "") 28669 ) 28670 ); 28671 } 28672 filterUnavailableSuggestions(suggestions, availability) { 28673 const currentSessionSeatIds = new Set( 28674 this.getCurrentSessionCartItems().map((item) => item.seat?.id).filter((id) => !!id) 28675 ); 28676 const unavailableSeatIds = new Set( 28677 availability.unavailable_seats.filter((seat) => seat.reason !== "in_cart").map((seat) => seat.seat_id) 28678 ); 28679 return suggestions.filter((suggestion) => { 28680 const seatIds = suggestion.seats.map((seat) => seat.seatId); 28681 const isAvailable = !seatIds.some((id) => unavailableSeatIds.has(id) && !currentSessionSeatIds.has(id)); 28682 return isAvailable && !this.suggestionMatchesCurrentSessionCart(suggestion); 28683 }); 28684 } 28685 hasSeatsForCurrentSession() { 28686 return this.getCurrentSessionCartItems().length > 0; 28687 } 28688 async selectSeats(suggestion) { 28689 if (this._busy) return; 28690 this._busy = true;
28691 try { 28692 if (this.hasSeatsForCurrentSession()) { 28693 await Cart.removeItems({ 28694 apiConfiguration: getDefaultApiConfiguration(), 28695 cartProvider: this.cartProvider, 28696 query: { 28697 entity_type: EntityType.Event, 28698 entity_id: this.sessionId 28699 } 28700 }); 28701 } 28702 await Cart.addItems({ 28703 apiConfiguration: getDefaultApiConfiguration(), 28704 cartProvider: this.cartProvider, 28705 items: suggestion.seats.map((seat) => ({ 28706 entity_type: EntityType.Event, 28707 entity_id: this.sessionId, 28708 places_ids: [seat.seatId.toString()], 28709 quota: { id: seat.quotaId || 1 }, 28710 parent_id: seat.parent.id || void 0 28711 })) 28712 }); 28713 updateSeatmapStatus(this.seatmapProvider); 28714 } finally { 28715 this._busy = false; 28716 } 28717 } 28718 render() { 28719 if (!this.sessionId || !this._suggestions.length) return A$1; 28720 const text = this._hasSeatsInCart ? t("change_seats_for") : t("select_seats_quickly"); 28721 const shortText = this._hasSeatsInCart ? t("LIB_change") : t("LIB_add"); 28722 const visibleSuggestions = this._suggestions.slice(0, 2); 28723 return b$1`<sonic-alert background dismissible noIcon> 28724 <div class="flex gap-x-2 gap-y-1 flex-wrap"> 28725 ${o$1(visibleSuggestions, (suggestion) => { 28726 const count = suggestion.seats.length; 28727 return b$1`<sonic-tooltip 28728 label='${text} 28729 ${t("LIB_same_as")} "${suggestion.sessionTitle}"' 28730 > 28731 <sonic-button 28732 ?disabled=${this._busy} 28733 ?loading=${this._busy} 28734 @click=${() => this.selectSeats(suggestion)} 28735 align="left" 28736 size="sm" 28737 variant="outline" 28738 class="w-full lg:w-auto" 28739 > 28740 <div class="py-1"> 28741 <sonic-badge size="xs" type="${this._hasSeatsInCart ? "danger" : "success"}"> 28742 <div class="leading-none font-bold"> 28743 ${shortText} : ${count} 28744 <sonic-icon name="xmark" library="custom" size="sm" class="-mx-1"></sonic-icon> 28745 <sonic-icon name="ticket" library="custom"></sonic-icon> 28746 </div> 28747 </sonic-badge> 28748 28749 <div class=" mt-1 font-bold truncate lg:max-w-[15rem]"> 28750 ${t("LIB_same_as")} "${suggestion.sessionTitle}" 28751 </div> 28752 <div class="truncate"> 28753 <div class="flex gap-x-3 items-center text-xs flex-wrap"> 28754 ${o$1(suggestion.seats, (seat) => { 28755 const { firstName } = seat.parent.owner || {}; 28756 const label2 = getSeatPlacementLabel(seat.seat, "condensed"); 28757 if (!label2) return A$1; 28758 return b$1`<span>${o$6(label2)} ${firstName}</span>`; 28759 })} 28760 </div> 28761 </div> 28762 </div> 28763 </sonic-button> 28764 </sonic-tooltip>`; 28765 })} 28766 </div> 28767 </sonic-alert>`; 28768 } 28769 }; 28770 SonicSeatSuggest.seatmapIdBySession = /* @__PURE__ */ new Map(); 28771 SonicSeatSuggest.styles = [ 28772 tailwind, 28773 i$9` 28774 :host { 28775 display: block; 28776 } 28777 ` 28778 ]; 28779 __decorateClass$3b([ 28780 n$5({ type: Number }) 28781 ], SonicSeatSuggest.prototype, "sessionId", 2); 28782 __decorateClass$3b([ 28783 ancestorAttribute("cartProvider"), 28784 n$5({ type: String, reflect: true }) 28785 ], SonicSeatSuggest.prototype, "cartProvider", 2); 28786 __decorateClass$3b([ 28787 bind$1("${cartProvider}.data.items"), 28788 n$5({ type: Array }) 28789 ], SonicSeatSuggest.prototype, "cartItems", 2); 28790 __decorateClass$3b([ 28791 bind$1("${cartProvider}.data.entities"), 28792 n$5({ type: Array }) 28793 ], SonicSeatSuggest.prototype, "cartEntities", 2); 28794 __decorateClass$3b([ 28795 ancestorAttribute("seatmapProvider"), 28796 n$5({ type: String }) 28797 ], SonicSeatSuggest.prototype, "seatmapProvider", 2); 28798 __decorateClass$3b([ 28799 c({ context: accessParamsContext, subscribe: true }), 28800 n$5({ type: Object }) 28801 ], SonicSeatSuggest.prototype, "accessParams", 2); 28802 __decorateClass$3b([ 28803 c({ context: appType, subscribe: true }) 28804 ], SonicSeatSuggest.prototype, "appType", 2); 28805 __decorateClass$3b([ 28806 r$5() 28807 ], SonicSeatSuggest.prototype, "_seatmapId", 2); 28808 __decorateClass$3b([ 28809 r$5() 28810 ], SonicSeatSuggest.prototype, "_suggestions", 2); 28811 __decorateClass$3b([ 28812 r$5() 28813 ], SonicSeatSuggest.prototype, "_hasSeatsInCart", 2); 28814 __decorateClass$3b([ 28815 r$5() 28816 ], SonicSeatSuggest.prototype, "_busy", 2); 28817 __decorateClass$3b([ 28818 bind$1("settings.subscriptionRequirement"), 28819 r$5() 28820 ], SonicSeatSuggest.prototype, "subscriptionRequirement", 2); 28821 SonicSeatSuggest = __decorateClass$3b([ 28822 t$3("sonic-seat-suggest") 28823 ], SonicSeatSuggest); 28824 const priceEndPoint = (priceContext, accessParams) => {
28825 const { entityType, entityId, parentSubscription } = priceContext ?? {}; 28826 const currentType = entityType || EntityType.Event; 28827 if (!entityId) return ""; 28828 return entityEndPoint({ 28829 entityType: currentType, 28830 entityId, 28831 accessParams, 28832 view: entityView.prices, 28833 subscriptionTypeIds: parentSubscription?.entity_id ? [parentSubscription.entity_id.toString()] : void 0, 28834 subscriptionPriceIds: parentSubscription?.price?.id ? [Number(parentSubscription.price.id)] : void 0 28835 }); 28836 }; 28837 const buyContext = n("buyContext"); 28838 var __defProp$37 = Object.defineProperty; 28839 var __getOwnPropDesc$3a = Object.getOwnPropertyDescriptor; 28840 var __decorateClass$3a = (decorators, target, key, kind) => { 28841 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3a(target, key) : target; 28842 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 28843 if (decorator = decorators[i2]) 28844 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 28845 if (kind && result) __defProp$37(target, key, result); 28846 return result; 28847 }; 28848 let SeatmapSeatPopover = class extends Subscriber$1(i$6) { 28849 constructor() { 28850 super(...arguments); 28851 this.hoveredSeat = null; 28852 this.dataProvider = "seatmap"; 28853 this._isPlacementLibre = false; 28854 this._seatInfos = null; 28855 this.visible = false; 28856 this._mouseMoveHandler = null; 28857 this._lastMousePosition = null; 28858 this._seatmapViewContainer = null; 28859 } 28860 handleHoveredSeatContactChange(contact) { 28861 if (!this._seatInfos) return; 28862 this._seatInfos.owner = contact || {}; 28863 this.requestUpdate(); 28864 if (this._lastMousePosition) { 28865 this.updatePopoverPosition( 28866 new MouseEvent("mousemove", { 28867 clientX: this._lastMousePosition.clientX, 28868 clientY: this._lastMousePosition.clientY 28869 }) 28870 ); 28871 } 28872 } 28873 handleHoveredSeatInfoControlChange(control) { 28874 if (!this._seatInfos) return; 28875 this._seatInfos.control = control || void 0; 28876 this.requestUpdate(); 28877 if (this._lastMousePosition) { 28878 this.updatePopoverPosition( 28879 new MouseEvent("mousemove", { 28880 clientX: this._lastMousePosition.clientX, 28881 clientY: this._lastMousePosition.clientY 28882 }) 28883 ); 28884 } 28885 } 28886 connectedCallback() { 28887 super.connectedCallback(); 28888 this._seatmapViewContainer = HTML.getClosestElement(this, "sonic-seatmap-view"); 28889 this.style.visibility = "hidden"; 28890 this._mouseMoveHandler = (e2) => { 28891 this.updatePopoverPosition(e2); 28892 this._lastMousePosition = { clientX: e2.clientX, clientY: e2.clientY }; 28893 }; 28894 window.addEventListener("mousemove", this._mouseMoveHandler); 28895 } 28896 /** 28897 * Met à jour la position du popover en fonction de la position de la souris, 28898 * en évitant les débordements du conteneur et de la fenêtre. 28899 */ 28900 updatePopoverPosition(e2) { 28901 if (!this._seatmapViewContainer) return; 28902 const OFFSET_Y = 20; 28903 const MARGIN = 10; 28904 const containerRect = this._seatmapViewContainer.getBoundingClientRect(); 28905 const popoverRect = this.getBoundingClientRect(); 28906 const relativeX = e2.clientX - containerRect.left; 28907 const relativeY = e2.clientY - containerRect.top; 28908 const popoverWidth = popoverRect.width || 200; 28909 const popoverHeight = popoverRect.height || 100; 28910 let left = relativeX; 28911 let top = relativeY + OFFSET_Y; 28912 let transformX = "translateX(-50%)"; 28913 const halfWidth = popoverWidth / 2; 28914 const minLeft = MARGIN; 28915 const maxLeft = containerRect.width - MARGIN; 28916 if (left - halfWidth < minLeft) { 28917 left = minLeft + halfWidth; 28918 transformX = "translateX(-50%)"; 28919 } else if (left + halfWidth > maxLeft) { 28920 left = maxLeft - halfWidth; 28921 transformX = "translateX(-50%)"; 28922 } 28923 const minTop = MARGIN; 28924 const maxTop = containerRect.height - popoverHeight - MARGIN; 28925 if (top < minTop) { 28926 top = minTop; 28927 } else if (top + popoverHeight > maxTop) { 28928 top = relativeY - popoverHeight - OFFSET_Y; 28929 if (top < minTop) { 28930 top = minTop; 28931 } 28932 } 28933 this.style.left = `${left}px`; 28934 this.style.top = `${top}px`; 28935 this.style.transform = transformX; 28936 } 28937 disconnectedCallback() { 28938 super.disconnectedCallback(); 28939 if (this._mouseMoveHandler) { 28940 window.removeEventListener("mousemove", this._mouseMoveHandler); 28941 } 28942 } 28943 willUpdate(changedProperties) { 28944 if (changedProperties.has("hoveredSeat")) { 28945 if (this.hoveredSeat?.seat) { 28946 const scorePointPreview = this.hoveredSeat.info?.scorePointPreview === true; 28947 if (scorePointPreview) { 28948 this._seatInfos = { 28949 seating: {}, 28950 theoreticalScore: this.hoveredSeat.info?.theoreticalScore, 28951 scorePointPreview: true 28952 }; 28953 } else { 28954 const ownerFromCart = getSeatOwnerFromCart( 28955 Number(this.hoveredSeat.seat.name), 28956 this.getAncestorAttributeValue("cartProvider") 28957 ); 28958 const hasOwnerFromCart = Object.keys(ownerFromCart || {}).length > 0; 28959 const owner = hasOwnerFromCart ? ownerFromCart : this.hoveredSeat.contact;
28960 const seatMapProvider = this.dataProvider || "seatmap"; 28961 const category = getCategoryFromSeatmapRange(seatMapProvider, this.hoveredSeat.seat.range); 28962 const quota = getQuotaFromSeatmap(seatMapProvider, this.hoveredSeat.seat); 28963 const modifiedQuota = this.hoveredSeat?.info?.modifications?.properties?.find( 28964 (property2) => property2.name === "Quota" 28965 ); 28966 this._seatInfos = { 28967 seating: seatToSeatingType(seatMapProvider, this.hoveredSeat.seat), 28968 owner, 28969 category: category ?? void 0, 28970 quota: quota ?? void 0, 28971 previousQuotaName: modifiedQuota?.newValue ? modifiedQuota.value : void 0, 28972 control: this.hoveredSeat.info?.control ?? void 0, 28973 theoreticalScore: this.hoveredSeat.info?.theoreticalScore 28974 }; 28975 } 28976 this.visible = true; 28977 this._isPlacementLibre = this.hoveredSeat.seat.positioningType === "2"; 28978 this.style.visibility = "visible"; 28979 } else { 28980 this.visible = false; 28981 this._isPlacementLibre = false; 28982 this.style.visibility = "hidden"; 28983 } 28984 } 28985 } 28986 render() { 28987 if (!this._seatInfos) { 28988 return A$1; 28989 } 28990 if (this._seatInfos.scorePointPreview) { 28991 return b$1` 28992 <div class="shadow-md bg-neutral-0 rounded-md px-3 py-2 ">${this.renderTheoreticalScore(true)}</div> 28993 `; 28994 } 28995 return b$1` 28996 <div class="shadow-md bg-neutral-0 rounded-md px-3 py-2 "> 28997 ${seatCondensedSummary(this._seatInfos.seating, "sm", this._isPlacementLibre)} ${this.renderCategory()} 28998 ${this.renderQuota()} ${this.renderOwner()} ${this.renderControl()} ${this.renderTheoreticalScore()} 28999 </div> 29000 `; 29001 } 29002 renderTheoreticalScore(standalone = false) { 29003 const score = this._seatInfos?.theoreticalScore; 29004 if (score == null) return A$1; 29005 const value = Number.isFinite(score) ? String(Math.round(score * 100) / 100) : "â"; 29006 const borderClass = standalone ? "" : "border-t-[1px] border-neutral-200 pt-2 mt-2"; 29007 const title = standalone || this._seatInfos?.scorePointPreview ? "Score hors donnée de siège" : "Score calculé"; 29008 return b$1`<div class="text-xs ${borderClass} text-center whitespace-nowrap"> 29009 ${title} : <span class="font-bold">${value}</span> 29010 </div>`; 29011 } 29012 renderCategory() { 29013 if (!this._seatInfos?.category) return A$1; 29014 const { title, color } = this._seatInfos.category; 29015 return b$1`<div 29016 class="text-xs border-t-[1px] border-neutral-200 pt-2 mt-2 text-center flex gap-2 justify-center whitespace-nowrap " 29017 > 29018 <div class="w-[13px] h-[13px] rounded-full" style="background-color: ${"#" + color}"></div> 29019 ${title} ${this.renderAmount()} 29020 </div>`; 29021 } 29022 renderQuota() { 29023 if (!this._seatInfos?.quota) return A$1; 29024 const { title, color, is_public } = this._seatInfos.quota; 29025 const isCustomer = this.appType === "customer"; 29026 const isCounter = this.appType === "counter"; 29027 const isHorsContingent = this._seatInfos.quota.id === 1; 29028 if (isCustomer && !is_public) return A$1; 29029 if (isCustomer && isHorsContingent) return A$1; 29030 return b$1`<div class="text-2xs mt-1 text-center whitespace-nowrap leading-tight"> 29031 <div class="flex items-center gap-2 justify-center"> 29032 ${isCounter && !isHorsContingent ? b$1` <div class="w-[7px] h-[7px] rounded mb-[1px]" style="background-color: ${"#" + color}"></div>` : A$1} 29033 <div class="uppercase">${title}</div> 29034 </div> 29035 ${isCounter && this._seatInfos.previousQuotaName ? b$1`<div class="text-neutral-500 text-2xs"> 29036 <sonic-icon name="clock-rotate-left" library="custom" class="shrink-0 mr-1"></sonic-icon>${this._seatInfos.previousQuotaName} 29037 </div>` : A$1} 29038 </div>`; 29039 } 29040 renderControl() { 29041 if (this.appType !== "counter" || !this._seatInfos?.control) return A$1; 29042 const createrAt = Number(this._seatInfos.control.created); 29043 const formattedDate = new Date(createrAt).toLocaleDateString("fr-FR", { 29044 day: "2-digit", 29045 month: "2-digit", 29046 year: "numeric", 29047 hour: "2-digit", 29048 minute: "2-digit" 29049 }); 29050 if (!createrAt) return A$1; 29051 return b$1`<div class="text-2xs mt-1 text-center whitespace-nowrap leading-tight text-neutral-500"> 29052 <div class="flex items-center gap-1 justify-center"> 29053 <sonic-icon name="barcode-scan" library="custom" class="shrink-0"></sonic-icon>${formattedDate} 29054 </div> 29055 </div>`; 29056 } 29057 renderOwner() { 29058 if (!this._seatInfos?.owner || Object.keys(this._seatInfos.owner).length === 0) return A$1; 29059 const { firstName, lastName, structure, isProfessional } = this._seatInfos.owner; 29060 const isAnonymous = !firstName && !lastName && !structure; 29061 return b$1`<div 29062 class="text-xs border-t-[1px] border-neutral-200 pt-2 mt-2 text-center flex gap-2 justify-center whitespace-nowrap" 29063 > 29064 <sonic-icon name="${isProfessional ? "user-tie" : "user"}" library="custom" class="shrink-0"></sonic-icon> 29065 <div> 29066 ${isAnonymous ? t("Anonyme") : b$1`${firstName} ${lastName} ${structure ? b$1`<div>${structure}</div>` : A$1}`} 29067 </div> 29068 </div>`; 29069 } 29070 renderAmount() { 29071 const noOwner = !this._seatInfos?.owner || Object.keys(this._seatInfos.owner).length === 0; 29072 const categoryId = this._seatInfos?.category?.id; 29073 if (noOwner) return b$1`⢠${this.renderPriceRangeForCategory(categoryId || 0)}`; 29074 const lineItemCart = getLineItemCartForSeat( 29075 Number(this.hoveredSeat?.seat?.name), 29076 this.getAncestorAttributeValue("cartProvider") 29077 ); 29078 if (!lineItemCart) return A$1; 29079 const price = lineItemCart.price; 29080 if (!price) return A$1; 29081 const amount = price.amount; 29082 if (!amount) return A$1;
29083 return b$1`⢠${formatAmount(amount)}`; 29084 } 29085 renderPriceRangeForCategory(categoryId) { 29086 if (!this.availablePrices) return A$1; 29087 const allPricesAreZero = this.availablePrices.every((price) => price.amount === 0); 29088 const pricesForCategory = this.availablePrices.filter((price) => { 29089 const matchCategory = price.place_category?.id === categoryId; 29090 if (allPricesAreZero) { 29091 return matchCategory; 29092 } 29093 return matchCategory && price.amount && price.amount > 0; 29094 }); 29095 if (pricesForCategory.length === 0) return b$1`<span class="text-danger">${t("no_price_available")}</span>`; 29096 const minPrice = Math.min(...pricesForCategory.map((price) => price.amount || 0)); 29097 if (this.appType === "counter") { 29098 const maxPrice = Math.max(...pricesForCategory.map((price) => price.amount || 0)); 29099 return priceRange({ min: minPrice, max: maxPrice, is_free_price: false }); 29100 } 29101 return priceRange({ min: minPrice }); 29102 } 29103 }; 29104 SeatmapSeatPopover.styles = [ 29105 tailwind, 29106 i$9` 29107 :host { 29108 position: absolute; 29109 pointer-events: none; 29110 z-index: 1000; 29111 visibility: hidden; 29112 display: block; 29113 opacity: 0; 29114 transition: opacity 0.2s linear; 29115 } 29116 :host([visible]) { 29117 opacity: 1; 29118 } 29119 ` 29120 ]; 29121 __decorateClass$3a([ 29122 n$5({ type: Object }) 29123 ], SeatmapSeatPopover.prototype, "hoveredSeat", 2); 29124 __decorateClass$3a([ 29125 ancestorAttribute("dataProvider") 29126 ], SeatmapSeatPopover.prototype, "dataProvider", 2); 29127 __decorateClass$3a([ 29128 c({ context: appType, subscribe: true }), 29129 r$5() 29130 ], SeatmapSeatPopover.prototype, "appType", 2); 29131 __decorateClass$3a([ 29132 r$5() 29133 ], SeatmapSeatPopover.prototype, "_isPlacementLibre", 2); 29134 __decorateClass$3a([ 29135 onAssign(seatmapFormKey.hoveredSeat.contact.path) 29136 ], SeatmapSeatPopover.prototype, "handleHoveredSeatContactChange", 1); 29137 __decorateClass$3a([ 29138 onAssign(seatmapFormKey.hoveredSeat.info.control.path) 29139 ], SeatmapSeatPopover.prototype, "handleHoveredSeatInfoControlChange", 1); 29140 __decorateClass$3a([ 29141 r$5() 29142 ], SeatmapSeatPopover.prototype, "_seatInfos", 2); 29143 __decorateClass$3a([ 29144 n$5({ type: Boolean, reflect: true }) 29145 ], SeatmapSeatPopover.prototype, "visible", 2); 29146 __decorateClass$3a([ 29147 n$5({ type: Array }) 29148 ], SeatmapSeatPopover.prototype, "availablePrices", 2); 29149 SeatmapSeatPopover = __decorateClass$3a([ 29150 t$3("sonic-seatmap-seat-popover") 29151 ], SeatmapSeatPopover); 29152 const seatsContext = n("seatsContext"); 29153 var BuyMode = /* @__PURE__ */ ((BuyMode2) => { 29154 BuyMode2["DEFAULT"] = "default"; 29155 BuyMode2["AUTOSEATING"] = "autoseating"; 29156 BuyMode2["SEAT"] = "seat"; 29157 BuyMode2["SEATMAPVIEW"] = "seatmapview"; 29158 return BuyMode2; 29159 })(BuyMode || {}); 29160 function isDefaultMode(buyMode) { 29161 return buyMode === "default"; 29162 } 29163 function isAutoseatingMode(buyMode) { 29164 return buyMode === "autoseating"; 29165 } 29166 function isSeatMode(buyMode) { 29167 return buyMode === "seat"; 29168 } 29169 function isSeatmapviewMode(buyMode) { 29170 return buyMode === "seatmapview"; 29171 } 29172 function showsInlineRates(buyMode, hasSeatmap = false) { 29173 if (isAutoseatingMode(buyMode) || isSeatMode(buyMode)) { 29174 return true; 29175 } 29176 return !hasSeatmap; 29177 } 29178 function showsEventMapLink(buyMode, hasSeatmap = false) { 29179 return hasSeatmap && isDefaultMode(buyMode); 29180 } 29181 var __defProp$36 = Object.defineProperty; 29182 var __getOwnPropDesc$39 = Object.getOwnPropertyDescriptor; 29183 var __decorateClass$39 = (decorators, target, key, kind) => { 29184 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$39(target, key) : target; 29185 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 29186 if (decorator = decorators[i2]) 29187 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 29188 if (kind && result) __defProp$36(target, key, result); 29189 return result; 29190 }; 29191 let PlacementBuyBlock = class extends i$6 { 29192 constructor() { 29193 super(...arguments); 29194 this.seatsContext = [];
29195 this.seatMapProvider = "seatmap"; 29196 this.disablePrices = false; 29197 } 29198 connectedCallback() { 29199 if (!this.accessParams) { 29200 this.accessParams = getAccessParamsFromUrl(); 29201 } 29202 super.connectedCallback(); 29203 } 29204 willUpdate(_changedProperties) { 29205 this.disablePrices = false; 29206 const isCustomer = this.appType === "customer"; 29207 if (_changedProperties.has("seatsContext") || _changedProperties.has("appType") || _changedProperties.has("seatMapProvider")) { 29208 if (!this.seatsContext?.length) { 29209 return; 29210 } 29211 const seatmapConf = seatmapPublisher(this.seatMapProvider).conf?.get(); 29212 if (!seatmapConf) { 29213 return; 29214 } 29215 const seatTypeId = this.seatsContext[0].seatType; 29216 const seatTypeVueIsUfr = seatmapConf.type_siege.find((item) => Number(item.id) === Number(seatTypeId))?.vue === "ufr"; 29217 const currentQuotaId = this.seatsContext[0].contingentementInterne; 29218 const currentQuotaIsPublic = seatmapConf.contingentement_interne.find((item) => Number(item.id) === Number(currentQuotaId))?.en_ligne === "1"; 29219 this.disablePrices = isCustomer && seatTypeVueIsUfr && !currentQuotaIsPublic; 29220 } 29221 super.willUpdate(_changedProperties); 29222 } 29223 render() { 29224 return b$1`
29225 ${seatsSelectionInfos(this.seatMapProvider, this.seatsContext)} ${this.renderRates()} 29226 ${this.renderCounterActions()} 29227 `; 29228 } 29229 renderRates() { 29230 if (!this.priceContext?.entityId) return A$1; 29231 const oneSeat = this.seatsContext.length === 1; 29232 const allSeatsAreNeutralised = this.seatsContext.every((seat) => isSeatNeutralised(seat)); 29233 if (allSeatsAreNeutralised) { 29234 return A$1; 29235 } 29236 const endpoint = priceEndPoint(this.priceContext, this.accessParams); 29237 const categoryId = Number(this.seatsContext?.[0].range); 29238 const quotaId = Number(this.seatsContext?.[0].contingentementInterne); 29239 const counterActions = getCounterSeatmapActions(this.seatMapProvider); 29240 const lockSeatContingentSelection = this.appType === "counter" && !!counterActions && counterActions.canChangeSeatContingent === false; 29241 return b$1` 29242 <div class="flex gap-4 flex-col pt-5 ${oneSeat ? "border-t-[1px] border-neutral-200 mt-1" : ""}"> 29243 ${this.disablePrices ? this.renderFallback() : b$1` 29244 <sonic-fetch loader="inline" dataProvider=${endpoint} key="data"> 29245 <sonic-buy-event-block 29246 cartProvider=${this.cartProvider} 29247 categoryId=${o$4(categoryId)} 29248 .selectedQuota=${{ id: quotaId }} 29249 formType="buttons" 29250 disableButtonMultiSelect 29251 .buyMode=${BuyMode.SEAT} 29252 ?lockSeatContingentSelection=${lockSeatContingentSelection} 29253 noSuffix 29254 size="sm" 29255 ></sonic-buy-event-block> 29256 </sonic-fetch> 29257 `} 29258 </div> 29259 `; 29260 } 29261 renderFallback() { 29262 return b$1` 29263 <sonic-alert label="${t("titre_fallback_tarifs_placement")}" status="warning" class="my-3" background> 29264 ${t("fallback_tarifs_placement")} 29265 </sonic-alert> 29266 `; 29267 } 29268 renderCounterActions() { 29269 if (this.appType !== "counter") return A$1; 29270 const eventId = this.priceContext?.entityId; 29271 const actions = getCounterSeatmapActions(this.seatMapProvi
29271der); 29272 const mayUnneutralize = !actions || actions.canUnneutralizeSeats; 29273 const mayNeutralize = !actions || actions.canNeutralizeSeats; 29274 const displayDeneutralise = mayUnneutralize && this.seatsContext.length > 0 && this.seatsContext.every((seat) => isSeatNeutralised(seat)); 29275 const displayNeutralise = mayNeutralize && this.seatsContext.length > 0 && this.seatsContext.every((seat) => { 29276 return Number(seat.availability) === 2 && !seat.panier && !seat.reserved && !seat.enCours && !seat.vendu; 29277 }); 29278 if (!eventId) return A$1; 29279 return b$1` 29280 ${displayDeneutralise ? b$1` 29281 <sonic-button 29282 variant="outline" 29283 shape="block" 29284 class="mt-6" 29285 @click=${async () => { 29286 await deNeutraliser(this.seatsContext, eventId, this.seatMapProvider); 29287 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 29288 parentModal?.hide(); 29289 }} 29290 > 29291 <sonic-icon library="custom" name="unlock"></sonic-icon> 29292 ${t("LIB_deneutraliser")}</sonic-button 29293 > 29294 ` : A$1} 29295 ${displayNeutralise ? b$1` 29296 <sonic-divider class="my-6"></sonic-divider> 29297 <sonic-button 29298 variant="outline" 29299 shape="block" 29300 @click=${async () => { 29301 await neutraliser(this.seatsContext, eventId, this.seatMapProvi
29301der); 29302 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 29303 parentModal?.hide(); 29304 }} 29305 > 29306 <sonic-icon library="custom" name="lock"></sonic-icon> 29307 ${t("LIB_neutraliser")}</sonic-button 29308 > 29309 ` : A$1} 29310 `; 29311 } 29312 }; 29313 PlacementBuyBlock.styles = [ 29314 tailwind, 29315 i$9` 29316 :host { 29317 position: relative; 29318 z-index: 0; 29319 } 29320 .remove-space { 29321 margin-top: -1rem; 29322 } 29323 ` 29324 ]; 29325 __decorateClass$39([ 29326 e$2({ context: seatsContext }), 29327 n$5({ type: Array }) 29328 ], PlacementBuyBlock.prototype, "seatsContext", 2); 29329 __decorateClass$39([ 29330 e$2({ context: buyContext }), 29331 n$5({ type: Object }) 29332 ], PlacementBuyBlock.prototype, "priceContext", 2); 29333 __decorateClass$39([ 29334 ancestorAttribute("seatmapProvider"), 29335 n$5({ type: String }) 29336 ], PlacementBuyBlock.prototype, "seatMapProvider", 2); 29337 __decorateClass$39([ 29338 n$5({ type: String }) 29339 ], PlacementBuyBlock.prototype, "cartProvider", 2); 29340 __decorateClass$39([ 29341 c({ context: accessParamsContext, subscribe: true }), 29342 n$5({ type: Object }) 29343 ], PlacementBuyBlock.prototype, "accessParams", 2); 29344 __decorateClass$39([ 29345 c({ context: appType, subscribe: true }), 29346 r$5() 29347 ], PlacementBuyBlock.prototype, "appType", 2); 29348 __decorateClass$39([ 29349 r$5() 29350 ], PlacementBuyBlock.prototype, "disablePrices", 2); 29351 PlacementBuyBlock = __decorateClass$39([ 29352 t$3("sonic-placing-buy-block") 29353 ], PlacementBuyBlock); 29354 var CounterMode = /* @__PURE__ */ ((CounterMode2) => { 29355 CounterMode2["BUY"] = "COUNTER_MODE_BUY"; 29356 CounterMode2["MOVE"] = "COUNTER_MODE_MOVE"; 29357 return CounterMode2; 29358 })(CounterMode || {}); 29359 var SeatmapMode = /* @__PURE__ */ ((SeatmapMode2) => { 29360 SeatmapMode2["CART_ADD"] = "cart-add"; 29361 SeatmapMode2["CART_EDIT"] = "cart-edit"; 29362 SeatmapMode2["TRANSACTION"] = "transaction"; 29363 return SeatmapMode2; 29364 })(SeatmapMode || {}); 29365 const SEATMAP_MODES = { 29366 [ 29367 "cart-add" 29368 /* CART_ADD */ 29369 ]: { 29370 initialCounterMode: "COUNTER_MODE_BUY", 29371 allowModeSwitch: true, 29372 allowAddToCart: true 29373 }, 29374 [ 29375 "cart-edit" 29376 /* CART_EDIT */ 29377 ]: { 29378 initialCounterMode: "COUNTER_MODE_MOVE", 29379 allowModeSwitch: true, 29380 allowAddToCart: true 29381 }, 29382 [ 29383 "transaction" 29384 /* TRANSACTION */ 29385 ]: { 29386 initialCounterMode: "COUNTER_MODE_MOVE", 29387 allowModeSwitch: false, 29388 allowAddToCart: false 29389 } 29390 }; 29391 function getSeatmapModeOptions(mode2) { 29392 return SEATMAP_MODES[mode2]; 29393 } 29394 var SeatColorMode = /* @__PURE__ */ ((SeatColorMode2) => { 29395 SeatColorMode2["CATEGORY"] = "categorie"; 29396 SeatColorMode2["QUOTAS"] = "contingent"; 29397 return SeatColorMode2; 29398 })(SeatColorMode || {}); 29399 var __defProp$35 = Object.defineProperty; 29400 var __getOwnPropDesc$38 = Object.getOwnPropertyDescriptor; 29401 var __decorateClass$38 = (decorators, target, key, kind) => { 29402 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$38(target, key) : target; 29403 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 29404 if (decorator = decorators[i2]) 29405 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 29406 if (kind && result) __defProp$35(target, key, result); 29407 return result; 29408 };
29409 let PricesTable = class extends i$6 { 29410 constructor() { 29411 super(...arguments); 29412 this.seatmapProvider = "seatmap"; 29413 this.eventId = 0; 29414 this._places_categories = []; 29415 this._prices = []; 29416 } 29417 willUpdate(changedProperties) { 29418 if (changedProperties.has("eventId") && this.eventId) { 29419 this.getPrices(); 29420 } 29421 } 29422 async getPrices() { 29423 if (!this.eventId) { 29424 return; 29425 } 29426 const api2 = new API(HTML.getApiConfiguration(this)); 29427 const endpoint = entityEndPoint({ 29428 entityType: EntityType.Event, 29429 entityId: this.eventId, 29430 accessParams: this.accessParams, 29431 view: entityView.prices 29432 }); 29433 const result = await api2.get(endpoint); 29434 if (result?.success && result?.data) { 29435 this._prices = result.data.prices || []; 29436 this._places_categories = result.data.places_categories || []; 29437 } 29438 } 29439 render() { 29440 const nbCategories = this._places_categories.length; 29441 return b$1`<div class="@container"> 29442 <div 29443 class="grid grid-cols-1 ${nbCategories > 1 ? "@lg:grid-cols-2" : ""} ${nbCategories > 2 ? "@2xl:grid-cols-3" : ""} gap-3 mb-4" 29444 > 29445 ${c$1( 29446 this._places_categories, 29447 (category) => category.id, 29448 (category) => { 29449 const categoryFromSeatmap = this.seatMapData?.conf?.categorie?.find( 29450 (item) => Number(item.id) === Number(category.id) 29451 ); 29452 const color = "#" + categoryFromSeatmap?.couleur?.toString(); 29453 const pricesMatchesCategory = this._prices?.filter((price) => { 29454 return price.place_category?.id === category.id; 29455 }); 29456 const pricesMatchesCategoryAvailable = pricesMatchesCategory?.filter((price) => price.price_available) || []; 29457 return b$1`<sonic-table size="xs" bordered> 29458 <sonic-thead> 29459 <sonic-tr> 29460 <sonic-th colspan="2"> 29461 <div class="text-sm flex items-center gap-x-2 w-full"> 29462 <div class="size-3 rounded-full inline-flex " style="background-color: ${color}"></div> 29463 ${category.title} 29464 ${pricesMatchesCategoryAvailable?.length ? b$1` <sonic-badge size="2xs" class="ml-auto"> 29465 <sonic-price-range 29466 class="white-space-nowrap lowercase" 29467 .prices=${pricesMatchesCategory || []} 29468 dataProvider=${`pricesRange/${pricesMatchesCategory?.map((price) => price.id).join(",")}`} 29469 ></sonic-price-range 29470 ></sonic-badge>` : A$1} 29471 </div> 29472 </sonic-th> 29473 </sonic-tr> 29474 </sonic-thead> 29475 29476 <sonic-tbody> 29477 ${c$1( 29478 pricesMatchesCategory || [], 29479 (price) => price.id, 29480 (price) => { 29481 return b$1` 29482 <sonic-tr class="${price.price_available ? "" : "opacity-50"}"> 29483 <sonic-td>${price.title}</sonic-td> 29484 <sonic-td align="right">
29484${formatAmount(price.amount_display || 0)}</sonic-td> 29485 </sonic-tr> 29486 `; 29487 } 29488 )} 29489 </sonic-tbody> 29490 </sonic-table>`; 29491 } 29492 )} 29493 </div> 29494 </div>`; 29495 } 29496 }; 29497 PricesTable.styles = [tailwind]; 29498 __decorateClass$38([ 29499 bind(seatmapKey), 29500 n$5({ type: Object }) 29501 ], PricesTable.prototype, "seatMapData", 2); 29502 __decorateClass$38([ 29503 ancestorAttribute("seatmapProvider"), 29504 n$5({ type: String }) 29505 ], PricesTable.prototype, "seatmapProvider", 2); 29506 __decorateClass$38([ 29507 n$5({ type: Number }) 29508 ], PricesTable.prototype, "eventId", 2); 29509 __decorateClass$38([ 29510 r$5() 29511 ], PricesTable.prototype, "_places_categories", 2); 29512 __decorateClass$38([ 29513 r$5() 29514 ], PricesTable.prototype, "_prices", 2); 29515 __decorateClass$38([ 29516 c({ context: accessParamsContext, subscribe: true }), 29517 n$5({ type: Object }) 29518 ], PricesTable.prototype, "accessParams", 2); 29519 PricesTable = __decorateClass$38([ 29520 t$3("sonic-prices-table") 29521 ], PricesTable); 29522 var __defProp$34 = Object.defineProperty; 29523 var __getOwnPropDesc$37 = Object.getOwnPropertyDescriptor; 29524 var __decorateClass$37 = (decorators, target, key, kind) => { 29525 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$37(target, key) : target; 29526 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 29527 if (decorator = decorators[i2]) 29528 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 29529 if (kind && result) __defProp$34(target, key, result); 29530 return result; 29531 }; 29532 let SonicSeatmapHelpButton = class extends i$6 { 29533 constructor() { 29534 super(...arguments); 29535 this.variant = "default"; 29536 this.size = "sm"; 29537 this.seatmapProvider = "seatmap"; 29538 this.eventId = 0; 29539 this.mode = "icon"; 29540 } 29541 openModal() { 29542 if (this.appType === "counter") { 29543 this.openModalCounter(); 29544 } else { 29545 this.openModalCustomer(); 29546 } 29547 } 29548 openModalCounter() { 29549 Modal.create({ 29550 title: "Utilisation du plan au guichet", 29551 content: b$1` 29552 <div style="font-size:1.25rem; font-weight: bold;">Sélection multiple par rectangle</div> 29553 Maintenir la touche <b>Maj</b> et le bouton gauche de la souris enfoncés.<br /> 29554 Faire glisser la souris pour définir le rectangle de sélection.<br /> 29555 Relâcher le bouton pour sélectionner effectivement les places entourées par le rectangle. 29556 <div style="font-size:1.25rem; font-weight: bold; margin-top:.8rem;">Sélection multiple par dessin.</div> 29557 Maintenir la touche <b>Ctrl</b> et le bouton gauche de la souris enfoncés.<br /> 29558 Dessiner la sélection en passant sur les places choisies.<br /> 29559 <div style="font-size:1.25rem; font-weight: bold; margin-top:.8rem;">Désélectionner des places</div> 29560 Si l'on maintient la touche <b>Alt</b> enfoncée pendant une sélection par rectangle ou par dessin, alors les 29561 places choisies seront retirées de la sélection en cours. Si on clique dans le plan en dehors d'un place 29562 sélectionnée sans maintenir soit la touche <b>Maj</b> soit la touche <b>Ctrl</b> enfoncée, alors la sélection en 29563 cours est annulée. 29564 <div style="font-size:1.25rem; font-weight: bold; margin-top:.8rem;">Ajout au panier</div> 29565 Si aucune place n'est sélectionnée le clique sur une place quelcqonque l'ajoute directement au panier.<br /> 29566 L'ajout au panier d'une sélection multiple se fait en cliquant sur une des places de la sélection. 29567 `, 29568 removeOnHide: true 29569 }); 29570 } 29571 legendContent() { 29572 return b$1`<div class="text-xs "> 29573 <sonic-divider></sonic-divider> 29574 <div class="flex items-center gap-2 mb-2"> 29575 <div class="shrink-0 size-6 bg-success rounded-full flex items-center justify-center"></div> 29576 <div>${t("LIB_help_seatmap_available")}</div> 29577 </div> 29578 <sonic-divider></sonic-divider> 29579 <div class="flex items-center gap-2 mb-2"> 29580 <div class="shrink-0 size-6 bg-neutral-100 rounded-full flex items-center justify-center"></div> 29581 <div>${t("LIB_help_seatmap_unavailable")}</div> 29582 </div>
29583 <sonic-divider></sonic-divider> 29584 <div class="flex items-center gap-2 mb-2"> 29585 <div class="shrink-0 size-6 bg-info text-info-content rounded-full flex items-center justify-center"> 29586 <sonic-icon name="wheelchair" library="custom"></sonic-icon> 29587 </div> 29588 <div class="text-balance">${t("LIB_help_seatmap_wheelchair_users")}</div> 29589 </div> 29590 <sonic-divider></sonic-divider> 29591 <div class="flex items-center gap-2 mb-2"> 29592 <div class="shrink-0 size-6 bg-info text-info-content rounded-full flex items-center justify-center"> 29593 <img 29594 class="w-5" 29595 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" 29596 /> 29597 </div> 29598 <div class="text-balance">${t("LIB_help_seatmap_wheelchair_helpers")}</div> 29599 </div> 29600 <sonic-divider></sonic-divider> 29601 </div> `; 29602 } 29603 openModalCustomer() { 29604 Modal.create({ 29605 styleSheet: [tailwind], 29606 title: b$1`${unsafeWording("titre_aide_placement")}`, 29607 content: b$1`${withAccessParams( 29608 this.accessParams, 29609 b$1`<sonic-prices-table seatmapProvider=${this.seatmapProvider} eventId=${this.eventId}></sonic-prices-table>` 29610 )} 29611 ${this.legendContent()} ${unsafeWording("aide_placement")}`, 29612 removeOnHide: true 29613 }); 29614 } 29615 render() { 29616 if (!this.appType) return A$1; 29617 if (this.mode === "icon") { 29618 return b$1` 29619 <sonic-tooltip placement="left" label=${t("pl_aide_tarif")} class="pointer-events-auto"> 29620 <sonic-button 29621 variant=${this.variant} 29622 size=${this.size} 29623 type="default" 29624 @click=${this.openModal} 29625 shape="circle" 29626 icon 29627 > 29628 <sonic-icon name="question" library="custom"></sonic-icon> 29629 </sonic-button> 29630 </sonic-tooltip> 29631 `; 29632 } 29633 return b$1` 29634 <sonic-button variant=${this.variant} size=${this.size} type="default" @click="${this.openModal}"> 29635 <sonic-icon name="circle-question" library="custom"></sonic-icon> ${t("pl_aide_tarif")} 29636 </sonic-button> 29637 `; 29638 } 29639 }; 29640 SonicSeatmapHelpButton.styles = [tailwind]; 29641 __decorateClass$37([ 29642 n$5({ type: String }) 29643 ], SonicSeatmapHelpButton.prototype, "variant", 2); 29644 __decorateClass$37([ 29645 n$5({ type: String }) 29646 ], SonicSeatmapHelpButton.prototype, "size", 2); 29647 __decorateClass$37([ 29648 c({ context: appType, subscribe: true }), 29649 r$5() 29650 ], SonicSeatmapHelpButton.prototype, "appType", 2); 29651 __decorateClass$37([ 29652 n$5({ type: String }) 29653 ], SonicSeatmapHelpButton.prototype, "seatmapProvider", 2); 29654 __decorateClass$37([ 29655 n$5({ type: Number }) 29656 ], SonicSeatmapHelpButton.prototype, "eventId", 2); 29657 __decorateClass$37([ 29658 n$5({ type: String }) 29659 ], SonicSeatmapHelpButton.prototype, "mode", 2); 29660 __decorateClass$37([ 29661 c({ context: accessParamsContext, subscribe: true }), 29662 n$5({ type: Object }) 29663 ], SonicSeatmapHelpButton.prototype, "accessParams", 2); 29664 SonicSeatmapHelpButton = __decorateClass$37([ 29665 t$3("sonic-seatmap-help-button") 29666 ], SonicSeatmapHelpButton); 29667 const SEATMAP_CANVAS_EVENT = { 29668 seatmapEventId: "seatmapEventId", 29669 planChanged: "planChanged", 29670 seatmapDestroy: "seatmapDestroy" 29671 }; 29672 let sourceSeq = 0; 29673 class SeatmapToSecondScreenBridge { 29674 constructor(host) { 29675 this.host = host; 29676 this.sourceId = `seatmap-${++sourceSeq}`; 29677 this.canvas = null; 29678 this.lastPublishedEventId = 0; 29679 this.onInteract = () => { 29680 if (!this.host.eventId) return; 29681 secondScreen.plan.set(this.host.eventId, this.sourceId); 29682 }; 29683 this.onSeatmapConfChanged = (conf) => { 29684 const eventId = conf?.eventId ?? 0; 29685 if (!eventId) return; 29686 this.publishEventId(eventId); 29687 }; 29688 this.onSeatmapEventId = (e2) => { 29689 const seatmapEvent = e2; 29690 const eventId = Number(seatmapEvent.detail?.eventId) || this.host.eventId; 29691 if (!eventId) return; 29692 this.publishEventId(eventId); 29693 secondScreen.plan.bumpRevision(); 29694 }; 29695 this.onSeatmapPlanChanged = () => { 29696 secondScreen.plan.scheduleViewportBump(); 29697 }; 29698 this.onSeatmapDestroy = () => { 29699 secondScreen.plan.clear(this.sourceId); 29700 }; 29701 if (host.isSecondScreen) return; 29702 this.publishEventId(host.eventId); 29703 host.addEventListener("pointerdown", this.onInteract, true); 29704 host.addEventListener("focusin", this.onInteract); 29705 dp$1(`${host.seatmapProvider}.conf`).onAssign(this.onSeatmapConfChanged); 29706 this.watchCanvas(); 29707 } 29708 dispose() { 29709 if (this.host.isSecondScreen) return; 29710 this.host.removeEventListener("pointerdown", this.onInteract, true); 29711 this.host.removeEventListener("focusin", this.onInteract); 29712 this.unbindCanvasEvents(); 29713 this.canvasObserver?.disconnect(); 29714 this.canvasObserver = void 0; 29715 secondScreen.plan.clear(this.sourceId); 29716 } 29717 publishEventId(eventId) { 29718 if (!eventId || eventId === this.lastPublishedEventId) return; 29719 this.lastPublishedEventId = eventId; 29720 secondScreen.plan.set(eventId, this.sourceId); 29721 } 29722 watchCanvas() { 29723 const root = this.host.shadowRoot; 29724 if (!root) return; 29725 this.canvasObserver = new MutationObserver(() => this.bindCanvasEvents()); 29726 this.canvasObserver.observe(root, { childList: true, subtree: true }); 29727 this.bindCanvasEvents(); 29728 } 29729 bindCanvasEvents() { 29730 const canvas2 = this.host.shadowRoot?.querySelector("canvas") ?? null; 29731 if (canvas2 === this.canvas) return; 29732 this.unbindCanvasEvents(); 29733 if (!canvas2) return; 29734 this.canvas = canvas2; 29735 canvas2.addEventListener(SEATMAP_CANVAS_EVENT.seatmapEventId, this.onSeatmapEventId); 29736 canvas2.addEventListener(SEATMAP_CANVAS_EVENT.planChanged, this.onSeatmapPlanChanged); 29737 canvas2.addEventListener(SEATMAP_CANVAS_EVENT.seatmapDestroy, this.onSeatmapDestroy); 29738 } 29739 unbindCanvasEvents() { 29740 if (!this.canvas) return; 29741 this.canvas.removeEventListener(SEATMAP_CANVAS_EVENT.seatmapEventId, this.onSeatmapEventId); 29742 this.canvas.removeEventListener(SEATMAP_CANVAS_EVENT.planChanged, this.onSeatmapPlanChanged); 29743 this.canvas.removeEventListener(SEATMAP_CANVAS_EVENT.seatmapDestroy, this.onSeatmapDestroy); 29744 this.canvas = null; 29745 } 29746 } 29747 function resolveAppType$1(appType2) { 29748 if (appType2) { 29749 return appType2; 29750 } 29751 if (typeof document !== "undefined" && document.querySelector("sonic-counter-app, sonic-counter-app-legacy")) { 29752 return "counter"; 29753 } 29754 return "customer"; 29755 } 29756 ({ 29757 placement_type: PlacementType.AUTO 29758 }); 29759 function isStoredPlacementType(value) { 29760 return value === PlacementType.AUTO || value === PlacementType.MANUAL; 29761 } 29762 function normalizeSwitchPlacementType(placementType) { 29763 return placementType === PlacementType.AUTO ? PlacementType.AUTO : PlacementType.MANUAL; 29764 } 29765 function resolvePlacementPreferences(config, stored = {}) { 29766 return { 29767 placement_type: resolvePlacementType({ 29768 config, 29769 storedPlacementType: isStoredPlacementType(stored.placement_type) ? stored.placement_type : void 0 29770 }) 29771 }; 29772 } 29773 function getVisiblePlacementTypes(config) { 29774 const availableModes = config?.available_modes ?? "both"; 29775 if (availableModes === PlacementType.AUTO) { 29776 return [PlacementType.AUTO]; 29777 } 29778 if (availableModes === PlacementType.MANUAL) { 29779 return []; 29780 } 29781 const isManualDefault = config?.default_mode === PlacementType.MANUAL; 29782 return isManualDefault ? [PlacementType.MANUAL, PlacementType.AUTO] : [PlacementType.AUTO, PlacementType.MANUAL]; 29783 } 29784 function isAutoOnlyPlacement(config) { 29785 return config?.available_modes === PlacementType.AUTO; 29786 } 29787 function resolvePlacementType({ 29788 config, 29789 storedPlacementType, 29790 fallback = PlacementType.AUTO 29791 }) { 29792 const availableModes = config?.available_modes ?? "both"; 29793 const defaultMode = config?.default_mode === PlacementType.MANUAL ? PlacementType.MANUAL : PlacementType.AUTO; 29794 if (availableModes === PlacementType.AUTO) { 29795 return PlacementType.AUTO; 29796 } 29797 if (availableModes === PlacementType.MANUAL) { 29798 return PlacementType.MANUAL; 29799 } 29800 if (storedPlacementType === PlacementType.AUTO || storedPlacementType === PlacementType.MANUAL) { 29801 return storedPlacementType; 29802 } 29803 return defaultMode ?? fallback; 29804 } 29805 var __defProp$33 = Object.defineProperty; 29806 var __getOwnPropDesc$36 = Object.getOwnPropertyDescriptor; 29807 var __decorateClass$36 = (decorators, target, key, kind) => { 29808 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$36(target, key) : target; 29809 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 29810 if (decorator = decorators[i2]) 29811 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 29812 if (kind && result) __defProp$33(target, key, result); 29813 return result; 29814 }; 29815 const scriptId = "seatmap-view-script"; 29816 const AUTO_ONLY_HINT_KEY = "LIB_seatmap_auto_only_hint"; 29817 const AUTO_ONLY_HINT_FALLBACK = "Seul le placement automatique est autorisé."; 29818 let SonicSeatmapView = class extends i$6 { 29819 constructor() { 29820 super(...arguments); 29821 this.eventId = 0; 29822 this.seatmapId = 0; 29823 this.roomId = 0; 29824 this.seatId = 0; 29825 this.move = 0; 29826 this.clickService = ""; 29827 this.editMode = SeatmapMode.CART_ADD; 29828 this._selectedSeats = []; 29829 this.isSecondScreen = false;
29830 this._availablePrices = []; 29831 this._items = null; 29832 this._displayMove = false; 29833 this._highlightAutoButton = false; 29834 this.cartProvider = "cart/current"; 29835 this.seatmapProvider = "seatmap"; 29836 this._lastAutoOnlyHintAt = 0; 29837 this.updateSeats = async (e2) => { 29838 if (!this.allowsSeatClickHandler()) { 29839 return; 29840 } 29841 const seats = e2.detail; 29842 if (allSeatsInCartContext(seats, this.cartProvider)) { 29843 this.confirmRemoveSeatsFromCart(seats); 29844 return; 29845 } 29846 if (this.isAutoOnlyCustomer) { 29847 resetSelection(this.seatmapProvider); 29848 this.getSeatmapInstanceRenderer()?.updateFromRoomData(false); 29849 this.showAutoOnlyHint(); 29850 return; 29851 } 29852 const addToCartModal = () => { 29853 Modal.create({ 29854 maxWidth: "50rem", 29855 content: withAccessParams( 29856 this.accessParams, 29857 b$1` 29858 <sonic-placing-buy-block 29859 .priceContext=${this.priceContext || { 29860 entityType: EntityType.Event, 29861 entityId: this.eventId 29862 }} 29863 seatmapProvider=${this.seatmapProvider} 29864 .seatsContext=${seats} 29865 .cartProvider=${this.cartProvider} 29866 ></sonic-placing-buy-block> 29867 ` 29868 ) 29869 }); 29870 }; 29871 const isSubscriptionContext = !!this.priceContext?.parentSubscription; 29872 if (isSubscriptionContext) { 29873 const currentPlaceCategory = Number(seats[0].range); 29874 const prices = this._availablePrices?.filter( 29875 (price) => Number(price.place_category?.id) === currentPlaceCategory && price.price_available 29876 ); 29877 if (prices?.length === 1) { 29878 const seatmap = this.getSeatmapInstanceRenderer(); 29879 if (seatmap) { 29880 const roomControl = seatmap.get_roomCtrl(); 29881 seats.forEach((seat) => { 29882 const seatData = roomControl.getChairData(seat.name); 29883 seatData.panier = true; 29884 seatData.enCours = true; 29885 }); 29886 seatmap.updateFromRoomData(false); 29887 } 29888 const items = seats.map((seat) => { 29889 return { 29890 entity_type: EntityType.Event, 29891 entity_id: this.priceContext?.entityId, 29892 quantity: 1, 29893 parent_id: this.priceContext?.parentSubscription?.id, 29894 price: { id: prices[0].id }, 29895 places_ids: [seat.name.toString()], 29896 quota: { 29897 id: Number(seat.contingentementInterne) || 1 29898 } 29899 }; 29900 }); 29901 const addToCartRequest = await Cart.addItems({ 29902 apiConfiguration: HTML.getApiConfiguration(this), 29903 cartProvider: this.cartProvider, 29904 items, 29905 accessParams: this.accessParams 29906 }); 29907 if (addToCartRequest === "asRequested") { 29908 const cartItemsAddedEvent = new CustomEvent("cartItemsAdded", { 29909 detail: { 29910 cartItems: items 29911 } 29912 }); 29913 this.dispatchEvent(cartItemsAddedEvent); 29914 }
29915 this.getSeatmapInstanceRenderer()?.reloadOnlindeChairsData(seats); 29916 } else { 29917 addToCartModal(); 29918 } 29919 } else { 29920 addToCartModal(); 29921 } 29922 this.getSeatmapInstanceRenderer()?.reloadOnlindeChairsData(seats); 29923 }; 29924 this.setupMap = () => { 29925 const win = window; 29926 if (this.isEditMode()) { 29927 win.Editor.init(this, PublisherManager, HTML); 29928 } else { 29929 if (this.mapInstance) { 29930 this.mapInstance.destroy(); 29931 this.mapInstance = void 0; 29932 } 29933 this.mapInstance = new win.placement.front.Initializer(this, PublisherManager, HTML); 29934 } 29935 }; 29936 this.timeoutId = null; 29937 } 29938 handleCounterModeChange(counterMode) { 29939 if (!counterMode) { 29940 return; 29941 } 29942 this._counterMode = counterMode; 29943 } 29944 getSeatmapInstanceRenderer() { 29945 return this.mapInstance?.renderer; 29946 } 29947 getSeatmapProvider() { 29948 return this.seatmapProvider || "seatmap"; 29949 } 29950 get modeOptions() { 29951 return getSeatmapModeOptions(this.editMode); 29952 } 29953 get isAutoOnlyCustomer() { 29954 return this.appType === "customer" && isAutoOnlyPlacement(this._customerPlacementConfig); 29955 } 29956 allowsBuyMode() { 29957 if (this.isAutoOnlyCustomer) { 29958 return false; 29959 } 29960 return this.modeOptions.allowModeSwitch; 29961 } 29962 allowsMoveMode() { 29963 return !this.isAutoOnlyCustomer; 29964 } 29965 /** Ãcoute les clics plan : retrait panier en auto-only, ajout/retrait sinon selon le mode. */ 29966 allowsSeatClickHandler() { 29967 if (this.isAutoOnlyCustomer) { 29968 return true; 29969 } 29970 return this.modeOptions.allowAddToCart; 29971 } 29972 getAutoOnlyHintMessage() { 29973 if (isWordingReady(AUTO_ONLY_HINT_KEY)) { 29974 const translated = get$2(`sonic-wording.wording_${AUTO_ONLY_HINT_KEY}`); 29975 if (typeof translated === "string" && translated.length > 0) { 29976 return translated; 29977 } 29978 } 29979 return AUTO_ONLY_HINT_FALLBACK; 29980 } 29981 showAutoOnlyHint() { 29982 const now = Date.now(); 29983 if (now - this._lastAutoOnlyHintAt < 2e3) { 29984 return; 29985 } 29986 this._lastAutoOnlyHintAt = now; 29987 const toast = { 29988 text: this.getAutoOnlyHintMessage(), 29989 status: "info" 29990 }; 29991 SonicToast.add(toast); 29992 this.pulseAutoPlacementButton(); 29993 } 29994 pulseAutoPlacementButton() { 29995 if (this._highlightAutoButtonTimeout) { 29996 clearTimeout(this._highlightAutoButtonTimeout); 29997 } 29998 this._highlightAutoButton = true; 29999 this._highlightAutoButtonTimeout = setTimeout(() => { 30000 this._highlightAutoButton = false; 30001 this._highlightAutoButtonTimeout = void 0; 30002 }, 1700); 30003 } 30004 clearAutoPlacementHighlight() { 30005 if (this._highlightAutoButtonTimeout) { 30006 clearTimeout(this._highlightAutoButtonTimeout); 30007 this._highlightAutoButtonTimeout = void 0; 30008 } 30009 this._highlightAutoButton = false; 30010 } 30011 handleSelectedSeatsChange(selectedSeats) { 30012 this._selectedSeats = selectedSeats; 30013 } 30014 // 30015 confirmRemoveSeatsFromCart(seats) { 30016 const title = seats.length > 1 ? t("pl_confirm_remove_seats_from_cart") : t("pl_confirm_remove_seat_from_cart"); 30017 const removeOptions = { 30018 seats, 30019 cartProvider: this.cartProvider, 30020 element: this, 30021 entity_id: Number(this.priceContext?.entityId) || this.eventId || void 0 30022 }; 30023 const onConfirm = () => removeSeatSelection(removeOptions); 30024 const confirmOptions = { 30025 title, 30026 content: seatsTable(this.getSeatmapProvider(), seats), 30027 confirmLabel: t("LIB_remove"), 30028 confirmType: "danger", 30029 confirmIcon: "trash", 30030 maxWidth: "50rem", 30031 onConfirm 30032 }; 30033 confirmSeatmapAction(confirmOptions); 30034 } 30035 isEditMode() { 30036 return this.hasAttribute("edit"); 30037 } 30038 async loadScript() { 30039 const mode2 = this.isEditMode() ? "edit" : "front"; 30040 const modedScriptId = `${scriptId}-${mode2}`; 30041 const existingScript = document.getElementById(modedScriptId); 30042 if (existingScript && SonicSeatmapView.isSeatMapCodeLoaded) { 30043 await SonicSeatmapView.isSeatMapCodeLoaded; 30044 this.setupMap(); 30045 return; 30046 } 30047 if (SonicSeatmapView.isLoadingScript && SonicSeatmapView.isSeatMapCodeLoaded) { 30048 await SonicSeatmapView.isSeatMapCodeLoaded; 30049 this.setupMap(); 30050 return; 30051 } 30052 SonicSeatmapView.isLoadingScript = true; 30053 SonicSeatmapView.isSeatMapCodeLoaded = new Promise((resolve, reject) => { 30054 const path = "/sites/all/modules/lb_placement/plan_interactif/bin/"; 30055 const fileName = this.isEditMode() ? "salle-edit" : "salle-front"; 30056 let serviceURL = HTML.getAncestorAttributeValue(this, "serviceURL"); 30057 if (!serviceURL) { 30058 serviceURL = document.location.origin; 30059 } 30060 let baseURL = path; 30061 if (serviceURL.startsWith("http")) { 30062 const url = new URL(serviceURL); 30063 baseURL = url.origin + path; 30064 } 30065 const script = document.createElement("script"); 30066 script.id = modedScriptId; 30067 script.type = "text/javascript"; 30068 script.src = baseURL + fileName + ".js?" + getCacheKey(); 30069 script.addEventListener("error", () => { 30070 SonicSeatmapView.isLoadingScript = false;
30071 reject(new Error(`Failed to load script: ${script.src}`)); 30072 }); 30073 script.addEventListener("load", () => { 30074 SonicSeatmapView.isLoadingScript = false; 30075 this.setupMap(); 30076 resolve(true); 30077 }); 30078 document.head.appendChild(script); 30079 }); 30080 } 30081 isVisible() { 30082 return this.getBoundingClientRect().width > 0; 30083 } 30084 syncSeatmapProviderAttribute() { 30085 if (!this.seatmapProvider) { 30086 this.seatmapProvider = "seatmap"; 30087 } 30088 this.setAttribute("seatmapProvider", this.seatmapProvider); 30089 } 30090 connectedCallback() { 30091 super.connectedCallback(); 30092 const appType2 = HTML.getAncestorAttributeValue(this, "appType"); 30093 if (appType2 && appType2 === "counter") { 30094 this.appType = "counter"; 30095 } 30096 if (this.timeoutId) { 30097 cancelAnimationFrame(this.timeoutId); 30098 this.timeoutId = null; 30099 return; 30100 } 30101 try { 30102 this.syncSeatmapProviderAttribute(); 30103 } catch (e2) { 30104 console.error(e2); 30105 } 30106 if (!this.priceContext && this.eventId) { 30107 this.priceContext = { 30108 entityType: EntityType.Event, 30109 entityId: this.eventId 30110 }; 30111 } 30112 this.secondScreenBridge = new SeatmapToSecondScreenBridge(this); 30113 } 30114 firstUpdated(_changedProperties) { 30115 this.loadScript(); 30116 } 30117 configEventSeats(_selectedSeats) { 30118 this.syncSeatClickHandler(); 30119 } 30120 syncSeatClickHandler() { 30121 const canvas2 = this.shadowRoot?.querySelector("canvas"); 30122 canvas2?.removeEventListener("addToCartRequest", this.updateSeats); 30123 if (!this.allowsSeatClickHandler()) { 30124 return; 30125 } 30126 canvas2?.addEventListener("addToCartRequest", this.updateSeats); 30127 } 30128 disconnectedCallback() { 30129 if (this.timeoutId) { 30130 cancelAnimationFrame(this.timeoutId); 30131 this.timeoutId = null; 30132 } 30133 this.timeoutId = requestAnimationFrame(() => { 30134 this.timeoutId = null; 30135 if (this.mapInstance) { 30136 this.mapInstance.destroy(); 30137 this.mapInstance = void 0; 30138 } 30139 this.secondScreenBridge?.dispose(); 30140 this.secondScreenBridge = void 0; 30141 this.clearAutoPlacementHighlight(); 30142 super.disconnectedCallback(); 30143 }); 30144 } 30145 updateConfigBase() { 30146 if (!this.eventId && !this.roomId && !this.seatmapId) { 30147 return; 30148 } 30149 const publisher = seatmapPublisher(this.seatmapProvider); 30150 publisher.isSecondScreen?.set(this.isSecondScreen); 30151 publisher.conf?.set({ 30152 eventId: this.eventId, 30153 roomId: this.roomId, 30154 id: this.seatmapId, 30155 seatId: this.seatId, 30156 move: this.move || 0, 30157 clickService: this.clickService, 30158 counterMode: this._counterMode ?? this.modeOptions.initialCounterMode 30159 }); 30160 } 30161 reloadStatus() {
30162 this.getSeatmapInstanceRenderer()?.updateStatus(); 30163 } 30164 async willUpdate(_changedProperties) { 30165 if (_changedProperties.has("priceContext")) { 30166 this._availablePrices = await this.getAvailablePrices(this.priceContext); 30167 if (this.eventId !== this.priceContext?.entityId) { 30168 this.eventId = this.priceContext?.entityId || 0; 30169 } 30170 } 30171 if (["eventId", "seatId", "move", "clickService", "editMode", "roomId", "seatmapId", "isSecondScreen"].some( 30172 (p2) => _changedProperties.has(p2) 30173 )) { 30174 this.updateConfigBase(); 30175 } 30176 if (_changedProperties.has("_items")) { 30177 const cartItems = this._items; 30178 const hasEventInCart = cartItems?.some((item) => item.entity_type === EntityType.Event && item.entity_id === this.eventId) ?? false; 30179 this._displayMove = hasEventInCart; 30180 } 30181 if (this.isAutoOnlyCustomer && (this._counterMode === CounterMode.MOVE || _changedProperties.has("_customerPlacementConfig"))) { 30182 resetSelection(this.seatmapProvider); 30183 seatmapPublisher(this.seatmapProvider).conf.counterMode?.set(CounterMode.BUY); 30184 } 30185 if (_changedProperties.has("_customerPlacementConfig") || _changedProperties.has("appType") || _changedProperties.has("editMode")) { 30186 this.syncSeatClickHandler(); 30187 } 30188 } 30189 async getAvailablePrices(priceContext) { 30190 if (!priceContext) return []; 30191 const api2 = new API(HTML.getApiConfiguration(this)); 30192 const endpoint = priceEndPoint(priceContext, this.accessParams); 30193 const result = (await api2.get(endpoint))?.data; 30194 return result?.prices; 30195 } 30196 renderControls() { 30197 if (this.isSecondScreen || this.move > 0) { 30198 return A$1; 30199 } 30200 const selectedSeatsCount = this._selectedSeats?.length || 0; 30201 if (this.isEditMode()) { 30202 return b$1` 30203 <div id="plan-controls" class="print:hidden flex flex-col gap-1 absolute top-4 left-3 z-10 pointer-events-none"> 30204 <sonic-button noAutoFill size="sm" shape="circle" data-action="zoomIn" class="pointer-events-auto"> 30205 <sonic-icon name="plus" library="custom"></sonic-icon> 30206 </sonic-button> 30207 <sonic-button size="sm" shape="circle" data-action="zoomOut" class="pointer-events-auto"> 30208 <sonic-icon name="minus" library="custom"></sonic-icon> 30209 </sonic-button> 30210 </div> 30211 `; 30212 } 30213 return b$1` 30214 <div class="flex items-center gap-1 flex-col absolute top-4 right-3 z-10 "> 30215 <sonic-seatmap-help-button 30216 .seatmapProvider=${this.seatmapProvider} 30217 .eventId=${this.eventId} 30218 ></sonic-seatmap-help-button> 30219 ${this.renderViewOptions()} 30220 </div> 30221 30222 <div 30223 id="plan-controls" 30224 class="print:hidden flex flex-col gap-1 absolute top-4 bottom-4 left-3 z-10 pointer-events-none " 30225 > 30226 ${this.allowsBuyMode() ? b$1`<sonic-tooltip 30227 placement="right" 30228 label=${t("LIB_seatmap_mode_buy")} 30229 class=" ${this.displayButtonClasses(this._displayMove || this._counterMode !== CounterMode.BUY)} " 30230 > 30231 <sonic-button 30232 noAutoFill 30233 size="sm" 30234 radio 30235 shape="circle" 30236 name="conf.counterMode" 30237 value=${CounterMode.BUY} 30238 class="pointer-events-auto" 30239 @click=${() => { 30240 resetSelection(this.seatmapProvider); 30241 }} 30242 > 30243 <sonic-icon name="basket-shopping" library="custom"></sonic-icon> 30244 </sonic-button> 30245 </sonic-tooltip>` : A$1} 30246 ${this.allowsMoveMode() ? b$1`<div class="relative z-10"> 30247 <sonic-tooltip 30248 placement="right" 30249 label=${t("LIB_seatmap_mode_move")} 30250 class="${this.displayButtonClasses( 30251 this._displayMove || this._counterMode === CounterMode.MOVE 30252 )}} delay-[80ms]" 30253 > 30254 <sonic-button 30255 noAutoFill 30256 size="sm" 30257 radio 30258 shape="circle" 30259 name="conf.counterMode"
30260 value=${CounterMode.MOVE} 30261 class="pointer-events-auto" 30262 @click=${() => { 30263 selectCartSeats(this.seatmapProvider, this.cartProvider); 30264 }} 30265 > 30266 <sonic-badge 30267 size="2xs" 30268 type="info" 30269 class="z-10 absolute -bottom-1 -right-1 transition duration-100 pointer-events-none 30270 ${selectedSeatsCount ? "opacity-100 scale-100" : "opacity-0 scale-0"} " 30271 > 30272 ${selectedSeatsCount} 30273 </sonic-badge> 30274 <sonic-icon name="right-left" library="custom"></sonic-icon 30275 ><!-- Déplacement--> 30276 </sonic-button> 30277 </sonic-tooltip> 30278 30279 ${this._counterMode === CounterMode.MOVE ? b$1`<sonic-button 30280 class=" absolute top-0 left-full ml-2 ${this.displayButtonClasses( 30281 this._displayMove || this._counterMode === CounterMode.MOVE 30282 )} " 30283 style="--sc-btn-rounded:99px;" 30284 noAutoFill 30285 size="sm" 30286 shape="circle" 30287 align="left" 30288 type="default" 30289 @click=${() => { 30290 const selectedSeats = this._selectedSeats || []; 30291 if (selectedSeats.length === 0) { 30292 selectCartSeats(this.seatmapProvider, this.cartProvider); 30293 } else { 30294 resetSelection(this.seatmapProvider); 30295 } 30296 }} 30297 > 30298 ${selectedSeatsCount ? b$1`<sonic-icon name="xmark" library="custom"></sonic-icon>` : b$1`<sonic-icon name="check-double" library="custom"></sonic-icon>`} 30299 <div 30300 class="absolute left-full text-left ml-2 top-1/2 -translate-y-1/2 30301 translate-z-0 30302 text-[10px] max-w-[5.7rem] min-w-[5.7rem] pointer-events-none" 30303 style="text-shadow: 1px 1px 0 rgba(255, 255, 255,1);" 30304 > 30305 ${selectedSeatsCount ? b$1` ${t("LIB_unselect_all_tickets_with_seating")}` : b$1` ${t("LIB_select_all_tickets_with_seating")}`} 30306 </div> 30307 </sonic-button>` : A$1} 30308 </div>` : A$1} 30309 30310 <sonic-tooltip 30311 placement="right" 30312 label=${t("LIB_seatmap_mode_auto")} 30313 class="${this.displayButtonClasses(this._displayMove)} delay-[160ms]" 30314 > 30315 <span class="inline-flex rounded-full ${this._highlightAutoButton ? "auto-placement-highlight" : ""}"> 30316 <sonic-button 30317 noAutoFill 30318 size="sm" 30319 radio 30320 shape="circle" 30321 @click=${() => { 30322 this.clearAutoPlacementHighlight(); 30323 this.mapInstance?.renderer?.setPlacesInCartToBestPosition(); 30324 }} 30325 > 30326 <sonic-icon name="sparkles" library="custom"></sonic-icon 30327 ><!-- Placement auto--> 30328 </sonic-button> 30329 </span> 30330 </sonic-tooltip> 30331 30332 <div class="flex items-center gap-1 flex-col mt-auto pointer-events-auto"> 30333 <sonic-tooltip placement="right" label=${t("LIB_zoom_in")} class=""> 30334 <sonic-button noAutoFill size="xs" shape="circle" data-action="zoomIn"> 30335 <sonic-icon name="plus" library="custom"></sonic-icon> 30336 </sonic-button> 30337 </sonic-tooltip> 30338 <sonic-tooltip placement="right" label=${t("LIB_zoom_out")}> 30339 <sonic-button noAutoFill size="xs" shape="circle" data-action="zoomOut"> 30340 <sonic-icon name="minus" library="custom"></sonic-icon> 30341 </sonic-button> 30342 </sonic-tooltip> 30343 </div> 30344 </div> 30345 `; 30346 } 30347 displayButtonClasses(display) { 30348 return `transition duration-300 ${display ? "opacity-100 pointer-events-auto scale-100" : "scale-0 opacity-0 pointer-events-none "}`; 30349 } 30350 renderViewOptions() { 30351 if (this.appType !== "counter") { 30352 return A$1; 30353 } 30354 return b$1` 30355 <sonic-pop> 30356 <sonic-tooltip placement="left" label=${t("LIB_view_mode_options")}>
30357 <sonic-button noAutoFill size="sm" shape="circle" icon> 30358 <sonic-icon name="gear" library="custom"></sonic-icon> 30359 </sonic-button> 30360 </sonic-tooltip> 30361 30362 <div slot="content"> 30363 <sonic-menu class="w-56"> 30364 <sonic-divider size="sm" label=${t("LIB_view_mode_global_arrangement")}></sonic-divider> 30365 <sonic-menu-item size="xs" radio name="conf.viewMode" value="MAP_VIEW" checked> 30366 <sonic-icon slot="prefix" name="map" library="custom"></sonic-icon> ${t("LIB_view_mode_map")} 30367 </sonic-menu-item> 30368 <sonic-menu-item size="xs" radio name="conf.viewMode" value="RANGE_VIEW"> 30369 <sonic-icon slot="prefix" name="list" library="custom"></sonic-icon> ${t("LIB_view_mode_list")} 30370 </sonic-menu-item> 30371 <sonic-divider size="sm" label=${t("LIB_view_mode_places_rendering")}></sonic-divider> 30372 <sonic-menu-item size="xs" radio name="conf.seatsColorsMode" value="categorie"> 30373 <sonic-icon slot="prefix" name="circle" library="custom"></sonic-icon> ${t( 30374 "LIB_view_mode_colors_category" 30375 )} 30376 </sonic-menu-item> 30377 <sonic-menu-item size="xs" radio name="conf.seatsColorsMode" value="contingent"> 30378 <sonic-icon slot="prefix" name="users-viewfinder" library="custom"></sonic-icon> ${t( 30379 "LIB_view_mode_colors_contingent" 30380 )} 30381 </sonic-menu-item> 30382 <sonic-menu-item size="xs" radio name="conf.seatsColorsMode" value="rows"> 30383 <sonic-icon slot="prefix" name="arrow-up-a-z" library="custom"></sonic-icon> ${t( 30384 "LIB_view_mode_colors_rows" 30385 )} 30386 </sonic-menu-item> 30387 <sonic-menu-item size="xs" radio name="conf.seatsColorsMode" value="seatNumbers"> 30388 <sonic-icon slot="prefix" name="arrow-up-1-9" library="custom"></sonic-icon> ${t( 30389 "LIB_view_mode_colors_seat_numbers" 30390 )} 30391 </sonic-menu-item> 30392 <sonic-menu-item size="xs" radio name="conf.seatsColorsMode" value="offlineView"> 30393 <sonic-icon slot="prefix" name="eye" library="custom"></sonic-icon> Vue publique 30394 </sonic-menu-item> 30395 </sonic-menu> 30396 </div> 30397 </sonic-pop> 30398 `; 30399 } 30400 render() { 30401 const planClasses = "min-h-[300px] h-full flex-1 relative"; 30402 return b$1`<sonic-fetch dataProvider=${this.cartProvider}></sonic-fetch> 30403 <div id="plan" class=${planClasses} formDataProvider=${this.seatmapProvider}> 30404 <div 30405 class="hidden absolute z-10 pointer-events-none bg-neutral-0 rounded px-2 py-4 text-neutral-900 shadow-md text-xs" 30406 id="plan-tooltip" 30407 ></div> 30408 <slot></slot> 30409 ${this.renderControls()} 30410 ${!this.isEditMode() ? b$1` 30411 <div class="absolute w-full"> 30412 <form class="form-sm mt-xs col-xs-8" style="max-width: 50rem"> 30413 <select aria-label="palier" class="hidden" id="plan-palier" name="plan-palier"></select> 30414 </form> 30415 </div> 30416 ` : A$1} 30417 </div> 30418 <sonic-seatmap-seat-popover 30419 dataProvider=${this.seatmapProvider} 30420 .availablePrices=${this._availablePrices} 30421 ></sonic-seatmap-seat-popover> `; 30422 } 30423 }; 30424 SonicSeatmapView.styles = [ 30425 tailwind, 30426 i$9` 30427 :host { 30428 display: block; 30429 position: relative; 30430 } 30431 30432 @keyframes auto-placement-highlight { 30433 0%, 30434 100% { 30435 box-shadow: 0 0 0 0 color-mix(in srgb, var(--sc-base-800, #1f2937) 40%, transparent); 30436 transform: scale(1); 30437 } 30438 50% { 30439 box-shadow: 0 0 0 0.5rem color-mix(in srgb, var(--sc-base-800, #1f2937) 0%, transparent); 30440 transform: scale(1.08); 30441 } 30442 } 30443 30444 .auto-placement-highlight { 30445 animation: auto-placement-highlight 0.55s ease-in-out 3; 30446 border-radius: 9999px; 30447 } 30448 ` 30449 ]; 30450 SonicSeatmapView.isLoadingScript = false; 30451 __decorateClass$36([ 30452 c({ context: appType, subscribe: true }), 30453 r$5() 30454 ], SonicSeatmapView.prototype, "appType", 2); 30455 __decorateClass$36([ 30456 c({ context: accessParamsContext, subscribe: true }), 30457 r$5() 30458 ], SonicSeatmapView.prototype, "accessParams", 2); 30459 __decorateClass$36([ 30460 bind("settings.customer_ui.event.placement"), 30461 r$5()
30462 ], SonicSeatmapView.prototype, "_customerPlacementConfig", 2); 30463 __decorateClass$36([ 30464 n$5({ type: Object }) 30465 ], SonicSeatmapView.prototype, "priceContext", 2); 30466 __decorateClass$36([ 30467 n$5({ type: Number }) 30468 ], SonicSeatmapView.prototype, "eventId", 2); 30469 __decorateClass$36([ 30470 n$5({ type: Number }) 30471 ], SonicSeatmapView.prototype, "seatmapId", 2); 30472 __decorateClass$36([ 30473 n$5({ type: Number }) 30474 ], SonicSeatmapView.prototype, "roomId", 2); 30475 __decorateClass$36([ 30476 n$5({ type: Number }) 30477 ], SonicSeatmapView.prototype, "seatId", 2); 30478 __decorateClass$36([ 30479 n$5({ type: Number }) 30480 ], SonicSeatmapView.prototype, "move", 2); 30481 __decorateClass$36([ 30482 n$5({ type: String }) 30483 ], SonicSeatmapView.prototype, "clickService", 2); 30484 __decorateClass$36([ 30485 n$5({ type: String, attribute: "edit-mode" }) 30486 ], SonicSeatmapView.prototype, "editMode", 2); 30487 __decorateClass$36([ 30488 r$5() 30489 ], SonicSeatmapView.prototype, "_counterMode", 2); 30490 __decorateClass$36([ 30491 r$5() 30492 ], SonicSeatmapView.prototype, "_selectedSeats", 2); 30493 __decorateClass$36([ 30494 n$5({ type: Boolean }) 30495 ], SonicSeatmapView.prototype, "isSecondScreen", 2); 30496 __decorateClass$36([ 30497 r$5() 30498 ], SonicSeatmapView.prototype, "_availablePrices", 2); 30499 __decorateClass$36([ 30500 bind(cartKey.data.items), 30501 r$5() 30502 ], SonicSeatmapView.prototype, "_items", 2); 30503 __decorateClass$36([ 30504 r$5() 30505 ], SonicSeatmapView.prototype, "_displayMove", 2); 30506 __decorateClass$36([ 30507 r$5() 30508 ], SonicSeatmapView.prototype, "_highlightAutoButton", 2); 30509 __decorateClass$36([ 30510 ancestorAttribute("cartProvider") 30511 ], SonicSeatmapView.prototype, "cartProvider", 2); 30512 __decorateClass$36([ 30513 ancestorAttribute("seatmapProvider") 30514 ], SonicSeatmapView.prototype, "seatmapProvider", 2); 30515 __decorateClass$36([ 30516 onAssign(seatmapKey.conf.counterMode.path) 30517 ], SonicSeatmapView.prototype, "handleCounterModeChange", 1); 30518 __decorateClass$36([ 30519 onAssign(seatmapKey.selectedSeats.path) 30520 ], SonicSeatmapView.prototype, "handleSelectedSeatsChange", 1); 30521 __decorateClass$36([ 30522 onAssign(seatmapKey.selectedSeats.path) 30523 ], SonicSeatmapView.prototype, "configEventSeats", 1); 30524 SonicSeatmapView = __decorateClass$36([ 30525 t$3("sonic-seatmap-view") 30526 ], SonicSeatmapView); 30527 var __defProp$32 = Object.defineProperty; 30528 var __getOwnPropDesc$35 = Object.getOwnPropertyDescriptor; 30529 var __decorateClass$35 = (decorators, target, key, kind) => { 30530 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$35(target, key) : target; 30531 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 30532 if (decorator = decorators[i2]) 30533 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 30534 if (kind && result) __defProp$32(target, key, result); 30535 return result; 30536 }; 30537 let SonicSessionNavigation = class extends i$6 { 30538 constructor() { 30539 super(...arguments); 30540 this.currentSessionId = 0; 30541 } 30542 get currentIndex() { 30543 return this.sessionsList?.findIndex((session) => Number(session.id) === Number(this.currentSessionId)) ?? -1; 30544 } 30545 get previousSession() { 30546 const index = this.currentIndex; 30547 if (index <= 0) return void 0; 30548 return this.sessionsList?.[index - 1]; 30549 } 30550 get nextSession() { 30551 const index = this.currentIndex; 30552 const list = this.sessionsList; 30553 if (!list || index === -1 || index >= list.length - 1) return void 0; 30554 return list[index + 1]; 30555 } 30556 render() { 30557 if (!this.sessionsList || this.sessionsList.length < 2) return A$1; 30558 return b$1` 30559 <div class="flex gap-x-1 items-center "> 30560 <sonic-tooltip label=${this.tooltipLabel(this.previousSession)} ?disabled=${!this.previousSession}> 30561 <sonic-button 30562 variant="outline" 30563 size="xs" 30564 minWidth="6rem" 30565 @click=${() => this.selectSession(this.previousSession?.id)} 30566 ?disabled=${!this.previousSession} 30567 > 30568 <sonic-icon name="chevron-left" library="custom" slot="prefix"></sonic-icon> 30569 ${t("previous")} 30570 </sonic-button> 30571 </sonic-tooltip> 30572 <sonic-tooltip label=${this.tooltipLabel(this.nextSession)} ?disabled=${!this.nextSession}> 30573 <sonic-button 30574 variant="outline" 30575 size="xs" 30576 minWidth="6rem" 30577 @click=${() => this.selectSession(this.nextSession?.id)} 30578 ?disabled=${!this.nextSession} 30579 > 30580 ${t("next")} 30581 <sonic-icon name="chevron-right" library="custom" slot="suffix"></sonic-icon> 30582 </sonic-button> 30583 </sonic-tooltip> 30584 </div> 30585 `; 30586 } 30587 selectSession(sessionId) { 30588 const newSessionId = Number(sessionId); 30589 if (!newSessionId) return; 30590 const event = new CustomEvent("selectSession", { 30591 detail: { sessionId: newSessionId } 30592 }); 30593 this.dispatchEvent(event); 30594 } 30595 tooltipLabel(session) { 30596 let label2 = session?.edito?.title ? session.edito.title : ""; 30597 label2 = label2.length > 30 ? label2.substring(0, 30) + "..." : label2; 30598 return label2; 30599 } 30600 }; 30601 SonicSessionNavigation.styles = [tailwind]; 30602 __decorateClass$35([ 30603 n$5() 30604 ], SonicSessionNavigation.prototype, "currentSessionId", 2); 30605 __decorateClass$35([ 30606 n$5({ type: Array }) 30607 ], SonicSessionNavigation.prototype, "sessionsList", 2); 30608 SonicSessionNavigation = __decorateClass$35([ 30609 t$3("sonic-session-navigation") 30610 ], SonicSessionNavigation); 30611 var __defProp$31 = Object.defineProperty; 30612 var __getOwnPropDesc$34 = Object.getOwnPropertyDescriptor; 30613 var __decorateClass$34 = (decorators, target, key, kind) => { 30614 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$34(target, key) : target; 30615 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 30616 if (decorator = decorators[i2]) 30617 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 30618 if (kind && result) __defProp$31(target, key, result); 30619 return result; 30620 }; 30621 let instanceCounter$e = 0; 30622 let SonicEventSeatSelector = class extends i$6 { 30623 constructor() { 30624 super(...arguments); 30625 this.cartProvider = "cart/current"; 30626 this.seatmapProvider = "seatmap"; 30627 this.summaryDataProvider = `seatmapSelectorPreview-${instanceCounter$e++}`; 30628 this.displaySummary = false;
30629 this.editMode = SeatmapMode.CART_ADD; 30630 this._subscriptions = []; 30631 this._items = []; 30632 this.handleCartMutation = () => { 30633 const cart = cartPublisher(this.cartProvider); 30634 this._items = cart.data?.items?.get() || []; 30635 const linked_subscriptions = cart.data?.linked_subscriptions?.get() || []; 30636 this._subscriptions = getCartSubscriptions({ items: this._items, linked_subscriptions }).filter( 30637 (sub2) => sub2.can_attach_events 30638 ); 30639 this.ensureSubscriptionSelected(); 30640 this.handleCartItemsChanged(); 30641 }; 30642 } 30643 handleCounterModeChange(counterMode) { 30644 this._counterMode = counterMode; 30645 } 30646 get currentEntityId() { 30647 return this.priceContext?.entityId || 0; 30648 } 30649 get isAutoOnlyPlacementMode() { 30650 const config = this.appType === "counter" ? this._storePlacementConfig : this._customerPlacementConfig; 30651 return isAutoOnlyPlacement(config); 30652 } 30653 connectedCallback() { 30654 super.connectedCallback(); 30655 cartPublisher(this.cartProvider).data?.onInternalMutation(this.handleCartMutation); 30656 this.handleCartMutation(); 30657 window.addEventListener("resize", this.seatmapViewHeight); 30658 requestAnimationFrame(() => { 30659 this.setupResizeObserver(); 30660 }); 30661 } 30662 setupResizeObserver() { 30663 if (!this._resizeObserver) { 30664 this._resizeObserver = new ResizeObserver(() => { 30665 this.seatmapViewHeight(); 30666 }); 30667 this._resizeObserver.observe(this); 30668 } 30669 const parentModal = HTML.getClosestElement(this, "dialog"); 30670 if (parentModal && parentModal !== this._observedModal && this._resizeObserver) { 30671 this._resizeObserver.observe(parentModal); 30672 this._observedModal = parentModal; 30673 this.seatmapViewHeight(); 30674 } 30675 } 30676 get canSelectOtherOwners() { 30677 const { subscriptionRequirement, disallowEventsForSoldSubscription } = this.settings || {}; 30678 const onlyNewSubscriptionAllowed = isSubscriptionRequired(subscriptionRequirement, this.appType) && disallowEventsForSoldSubscription?.active; 30679 return !onlyNewSubscriptionAllowed; 30680 } 30681 ensureSubscriptionSelected() { 30682 if (this.canSelectOtherOwners || this._subscriptions.length === 0) return; 30683 if (this.priceContext?.parentSubscription?.id) return; 30684 this.selectSubscription(this._subscriptions[0]); 30685 } 30686 disconnectedCallback() { 30687 window.removeEventListener("resize", this.seatmapViewHeight); 30688 if (this._resizeObserver) { 30689 this._resizeObserver.disconnect(); 30690 this._resizeObserver = void 0; 30691 } 30692 this._observedModal = void 0; 30693 cartPublisher(this.cartProvider).data?.offInternalMutation(this.handleCartMutation); 30694 super.disconnectedCallback(); 30695 } 30696 updated(_changedProperties) { 30697 if (this.isAutoOnlyPlacementMode && this.priceContext?.parentSubscription && (_changedProperties.has("_customerPlacementConfig") || _changedProperties.has("_storePlacementConfig") || _changedProperties.has("appType") || _changedProperties.has("priceContext"))) { 30698 this.unSelectSubscription(); 30699 } 30700 this.setupResizeObserver(); 30701 if (_changedProperties.has("settings") || _changedProperties.has("appType")) { 30702 this.ensureSubscriptionSelected(); 30703 } 30704 } 30705 seatmapViewHeight() { 30706 const parentModal = HTML.getClosestElement(this, "dialog"); 30707 if (!parentModal) return; 30708 const parentModalHeight = parentModal?.clientHeight || 0; 30709 const modalContent = parentModal.querySelector("#modal-content"); 30710 const modalClose = parentModal.querySelector("sonic-modal-close"); 30711 if (!modalContent) return; 30712 modalContent.style.paddingBottom = "0"; 30713 const closeComputedStyle = modalClose ? window.getComputedStyle(modalClose) : void 0; 30714 const closeMarginBottom = closeComputedStyle ? Math.abs(parseFloat(closeComputedStyle.marginBottom)) || 0 : 0; 30715 const computedStyle = window.getComputedStyle(modalContent); 30716 const paddingTop = parseFloat(computedStyle.paddingTop) || 0; 30717 const paddingBottom = parseFloat(computedStyle.paddingBottom) || 0;
30718 const availableHeight = parentModalHeight - paddingTop - paddingBottom - closeMarginBottom - 5; 30719 this._availableHeight = availableHeight; 30720 } 30721 render() { 30722 if (!this.currentEntityId) return A$1; 30723 return b$1`<div 30724 data-seatmap-container 30725 class="@container flex flex-col flex-1" 30726 style="${this._availableHeight ? `min-height: ${this._availableHeight}px;` : ""}" 30727 > 30728 <div data-seatmap-header>${this.renderSummary()} ${this.renderSeatSuggest()} ${this.renderSubscription()}</div> 30729 <sonic-seatmap-view 30730 class="min-h-[32rem] bg-neutral-50 30731 -mb-[var(--sc-modal-py)] 30732 -mx-[var(--sc-modal-px)] 30733 border border-neutral-50 rounded-lg relative overflow-hidden flex flex-col grow" 30734 .priceContext=${this.priceContext} 30735 edit-mode=${this.editMode} 30736 cartProvider=${this.cartProvider} 30737 ></sonic-seatmap-view> 30738 </div>`; 30739 } 30740 renderSummary() { 30741 const productEndpoint = entityEndPoint({ 30742 entityType: EntityType.Event, 30743 entityId: this.currentEntityId, 30744 accessParams: this.accessParams, 30745 view: entityView.mini 30746 }); 30747 if (!this.displaySummary) return A$1; 30748 return b$1`<div class="block @xl:flex justify-between items-center gap-x-4 mb-3"> 30749 <div class="min-h-[4rem] block w-full"> 30750 <sonic-fetch dataProvider="${this.summaryDataProvider}" endpoint="${productEndpoint}" key="data"> 30751 <sonic-product-summary size="sm"> </sonic-product-summary> 30752 </sonic-fetch> 30753 </div> 30754 <sonic-session-navigation 30755 class="shrink-0 self-end mt-3 block" 30756 @selectSession=${(e2) => this.updateSession(e2.detail.sessionId)} 30757 .sessionsList=${this.sessionsList} 30758 .currentSessionId=${this.currentEntityId} 30759 ></sonic-session-navigation> 30760 </div>`; 30761 } 30762 renderSeatSuggest() { 30763 if (this.isAutoOnlyPlacementMode) { 30764 return A$1; 30765 } 30766 return b$1`<sonic-seat-suggest .sessionId="${this.currentEntityId}" class="mb-3"></sonic-seat-suggest>`; 30767 } 30768 // renderPriceSelectionForm() { 30769 // if (!this.isAutoOnlyPlacementMode) { 30770 // return nothing; 30771 // } 30772 // return html`<sonic-fetch 30773 // dataProvider="${entityEndPoint({ 30774 // entityType: EntityType.Event, 30775 // entityId: this.currentEntityId, 30776 // accessParams: this.accessParams, 30777 // view: entityView.prices, 30778 // })}" 30779 // dataProvider="poauzpzaoue" 30780 // key="data" 30781 // ><sonic-buy-event-block 30782 // class="max-w-96 mx-auto block"
30783 // buyMode="${BuyMode.AUTOSEATING}" 30784 // .fallbackAvailableQuota=${false} 30785 // .priceContext=${this.priceContext} 30786 // ></sonic-buy-event-block 30787 // ></sonic-fetch>`; 30788 // } 30789 handleCartItemsChanged() { 30790 if (this.isAutoOnlyPlacementMode) { 30791 return; 30792 } 30793 const selectedSubscription = this.priceContext?.parentSubscription; 30794 if (!selectedSubscription?.id || !selectedSubscription.entity_id) return; 30795 const rules = getSubscriptionRules(selectedSubscription.entity_id, this.cartProvider); 30796 const maxPerSession = rules?.[0]?.conditions?.[0]?.ticketsPerSession?.max; 30797 if (!maxPerSession) return; 30798 if (this.countSessionTickets(selectedSubscription.id) < maxPerSession) return; 30799 const currentIndex = this._subscriptions.findIndex((sub2) => sub2.id === selectedSubscription.id); 30800 if (currentIndex === -1) return; 30801 const nextAvailable = this._subscriptions.slice(currentIndex + 1).find((sub2) => this.countSessionTickets(sub2.id) === 0); 30802 if (nextAvailable) { 30803 this.selectSubscription(nextAvailable); 30804 } else if (this.canSelectOtherOwners) { 30805 this.unSelectSubscription(); 30806 } else { 30807 const firstWithCapacity = this._subscriptions.find((sub2) => this.countSessionTickets(sub2.id) < maxPerSession); 30808 if (firstWithCapacity) { 30809 this.selectSubscription(firstWithCapacity); 30810 } 30811 } 30812 } 30813 countSessionTickets(subscriptionId) { 30814 if (!subscriptionId) return 0; 30815 return getSessionItems(this._items, this.currentEntityId, String(subscriptionId)).length; 30816 } 30817 renderSubscription() { 30818 if (this.isAutoOnlyPlacementMode || this._subscriptions.length === 0) { 30819 return A$1; 30820 } 30821 const isOtherOwner = !this.priceContext?.parentSubscription?.id; 30822 return b$1` 30823 <div 30824 class="shadow-lg relative z-10 bg-neutral-0 -mx-[var(--sc-modal-px)] lg:mx-2 rounded-md 30825 overflow-hidden transition-all duration-300 30826 ${this._counterMode !== CounterMode.BUY ? "h-0 mb-0" : "h-auto -mb-2"}" 30827 style="interpolate-size:allow-keywords" 30828 > 30829 <div class="px-2 mb-0 font-bold text-sm">${t("my_tickets_are_for")}</div> 30830 <sonic-menu 30831 size="sm" 30832 class="flex gap-x-1 items-center shrink-0 self-end justify-start " 30833 direction="row" 30834 scrollable 30835 > 30836 ${c$1( 30837 this._subscriptions, 30838 (subscription) => subscription.id, 30839 (subscription) => { 30840 const { firstName, lastName } = subscription.owner || {}; 30841 const fullname = firstName || lastName ? b$1`${firstName} 30842 <div class="font-normal text-xs leading-tight">${lastName}</div>` : t("anonymous"); 30843 const active = subscription.id === this.priceContext?.parentSubscription?.id; 30844 return b$1` 30845 <sonic-menu-item 30846 variant="default" 30847 noAutoFill 30848 type=${active ? "neutral" : "default"} 30849 ?active=${active} 30850 @click=${() => { 30851 this.selectSubscription(subscription); 30852 }} 30853 > 30854 <div class="flex items-start gap-x-1 py-1"> 30855 <sonic-icon 30856 name="${active ? "circle-check" : "circle"}" 30857 library="custom" 30858 class="self-auto" 30859 size="lg" 30860 ></sonic-icon> 30861 <div> 30862 <div class="font-bold">${fullname}</div> 30863 <div class="text-xs font-normal"> 30864 ${getSubscriptionName(subscription.entity_id, this.cartProvider)} 30865 </div> 30866 </div> 30867 ${this.renderTicketCount(subscription.id)} 30868 </div> 30869 </sonic-menu-item> 30870 `; 30871 } 30872 )} 30873 ${this.canSelectOtherOwners ? b$1`<sonic-menu-item 30874 variant="default" 30875 noAutoFill 30876 type="default" 30877 ?active=${isOtherOwner} 30878 @click=${() => this.unSelectSubscription()} 30879 > 30880 <div class="flex items-start gap-x-1 py-3"> 30881 <sonic-icon 30882 name=${isOtherOwner ? "circle-check" : "circle"} 30883 library="custom"
30884 class="self-auto" 30885 size="lg" 30886 ></sonic-icon> 30887 <div class="font-bold w-min whitespace-normal">${t("LIB_other_owners")}</div> 30888 ${this.renderTicketCount()} 30889 </div> 30890 </sonic-menu-item>` : A$1} 30891 </sonic-menu> 30892 </div> 30893 `; 30894 } 30895 renderTicketCount(parent_id) { 30896 const itemsCountWithParentId = getSessionItems(this._items, this.currentEntityId, parent_id).length; 30897 let borderClass = "border-current"; 30898 if (itemsCountWithParentId) { 30899 borderClass = "border-transparent"; 30900 } 30901 return b$1` 30902 <sonic-badge 30903 size="xs" 30904 type="${itemsCountWithParentId ? "success" : "default"}" 30905 class="self-center border ${borderClass} ml-1" 30906 > 30907 <div class="flex items-center "> 30908 <sonic-icon name="ticket" library="custom"></sonic-icon> 30909 <sonic-icon name="xmark" size="xs" library="custom"></sonic-icon> 30910 <span class="min-w-[1ch] text-center inline-block">${itemsCountWithParentId}</span> 30911 </div> 30912 </sonic-badge> 30913 `; 30914 } 30915 selectSubscription(subscription) { 30916 const isCurrentSubscription = subscription.id === this.priceContext?.parentSubscription?.id; 30917 if (!this.priceContext) return; 30918 if (isCurrentSubscription && !this.canSelectOtherOwners) return; 30919 this.updatePriceContext({ parentSubscription: isCurrentSubscription ? void 0 : subscription }); 30920 } 30921 unSelectSubscription() { 30922 if (!this.canSelectOtherOwners || !this.priceContext) return; 30923 this.updatePriceContext({ parentSubscription: void 0 }); 30924 } 30925 // Nav précédent ou suivant 30926 updateSession(sessionId) { 30927 const newSessionId = Number(sessionId); 30928 if (!newSessionId) return; 30929 if (this.priceContext) { 30930 this.updatePriceContext({ entityId: newSessionId }); 30931 } else { 30932 this.updatePriceContext({ entityType: EntityType.Event, entityId: newSessionId }); 30933 } 30934 } 30935 updatePriceContext(newPriceContext) { 30936 if (!this.priceContext) { 30937 this.priceContext = { 30938 entityType: EntityType.Event, 30939 entityId: Number(newPriceContext.entityId) 30940 }; 30941 } 30942 this.priceContext = { 30943 ...this.priceContext, 30944 ...newPriceContext 30945 }; 30946 } 30947 }; 30948 SonicEventSeatSelector.styles = [ 30949 tailwind, 30950 i$9` 30951 :host { 30952 display: block; 30953 } 30954 ` 30955 ]; 30956 __decorateClass$34([ 30957 ancestorAttribute("cartProvider"), 30958 n$5({ type: String, reflect: true }) 30959 ], SonicEventSeatSelector.prototype, "cartProvider", 2); 30960 __decorateClass$34([ 30961 c({ context: accessParamsContext, subscribe: true }), 30962 n$5({ type: Object }) 30963 ], SonicEventSeatSelector.prototype, "accessParams", 2); 30964 __decorateClass$34([ 30965 e$2({ context: buyContext }), 30966 n$5({ type: Object }) 30967 ], SonicEventSeatSelector.prototype, "priceContext", 2); 30968 __decorateClass$34([ 30969 n$5({ type: Array }) 30970 ], SonicEventSeatSelector.prototype, "sessionsList", 2); 30971 __decorateClass$34([ 30972 ancestorAttribute("seatmapProvider"), 30973 n$5({ type: String, reflect: true }) 30974 ], SonicEventSeatSelector.prototype, "seatmapProvider", 2); 30975 __decorateClass$34([ 30976 n$5({ type: Boolean }) 30977 ], SonicEventSeatSelector.prototype, "displaySummary", 2); 30978 __decorateClass$34([ 30979 n$5({ type: String, attribute: "edit-mode" }) 30980 ], SonicEventSeatSelector.prototype, "editMode", 2); 30981 __decorateClass$34([ 30982 c({ context: appType, subscribe: true }), 30983 r$5() 30984 ], SonicEventSeatSelector.prototype, "appType", 2); 30985 __decorateClass$34([ 30986 bind$1("settings.customer_ui.event.placement"), 30987 r$5() 30988 ], SonicEventSeatSelector.prototype, "_customerPlacementConfig", 2); 30989 __decorateClass$34([ 30990 bind$1("settings.store_ui.event.placement"), 30991 r$5() 30992 ], SonicEventSeatSelector.prototype, "_storePlacementConfig", 2); 30993 __decorateClass$34([ 30994 bind$1("settings"), 30995 r$5() 30996 ], SonicEventSeatSelector.prototype, "settings", 2); 30997 __decorateClass$34([ 30998 r$5() 30999 ], SonicEventSeatSelector.prototype, "_subscriptions", 2); 31000 __decorateClass$34([ 31001 r$5() 31002 ], SonicEventSeatSelector.prototype, "_items", 2); 31003 __decorateClass$34([ 31004 r$5()
31005 ], SonicEventSeatSelector.prototype, "_counterMode", 2); 31006 __decorateClass$34([ 31007 onAssign(seatmapKey.conf.counterMode.path) 31008 ], SonicEventSeatSelector.prototype, "handleCounterModeChange", 1); 31009 __decorateClass$34([ 31010 r$5() 31011 ], SonicEventSeatSelector.prototype, "_availableHeight", 2); 31012 SonicEventSeatSelector = __decorateClass$34([ 31013 t$3("sonic-event-seat-selector") 31014 ], SonicEventSeatSelector); 31015 var __defProp$30 = Object.defineProperty; 31016 var __getOwnPropDesc$33 = Object.getOwnPropertyDescriptor; 31017 var __decorateClass$33 = (decorators, target, key, kind) => { 31018 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$33(target, key) : target; 31019 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 31020 if (decorator = decorators[i2]) 31021 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 31022 if (kind && result) __defProp$30(target, key, result); 31023 return result; 31024 }; 31025 let MapLink = class extends Subscriber$1(i$6) { 31026 constructor() { 31027 super(...arguments); 31028 this.slug = ""; 31029 this.infos_status = {}; 31030 this.room = {}; 31031 this.prices = []; 31032 this._href = ""; 31033 } 31034 connectedCallback() { 31035 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 31036 super.connectedCallback(); 31037 } 31038 willUpdate(changedProperties) { 31039 if (this.accessParams) { 31040 this._href = appRoute("seatmap").fill({ slug: this.slug, id: this.id }).query(accessParamsToQueryObject(this.accessParams)).toString(); 31041 } else { 31042 this._href = appRoute("seatmap").fill({ slug: this.slug, id: this.id }).toString(); 31043 } 31044 super.willUpdate(changedProperties); 31045 } 31046 async createModalSeatMap(id) { 31047 if (Modal?.modals) { 31048 await Promise.all([...Modal.modals].map((modal) => modal.dispose())); 31049 } 31050 Modal.create({ 31051 content: b$1` 31052 ${withAccessParams( 31053 this.accessParams, 31054 b$1` <sonic-event-seat-selector 31055 displaySummary 31056 cartProvider=${o$4(this._cartProvider)} 31057 seatmapProvider="seatmapModal/${id}" 31058 .priceContext=${{ entityType: EntityType.Event, entityId: Number(id) }} 31059 ></sonic-event-seat-selector>` 31060 )} 31061 `, 31062 maxWidth: "60rem", 31063 height: "92svh", 31064 maxHeight: "92svh", 31065 removeOnHide: true 31066 }); 31067 } 31068 handleClick(e2) { 31069 if (this.id && this._cartProvider !== "cart/current") { 31070 e2.preventDefault(); 31071 this.createModalSeatMap(parseInt(this.id.toString())); 31072 } 31073 } 31074 render() { 31075 const hasPrices = this.prices && this.prices.length > 0; 31076 const text = hasPrices ? t("pl_reserver_sur_plan") : t("LIB_voir_le_plan"); 31077 const isPLaced = this.room && ["place", "mixte"].includes(this.room.placing_type_key || ""); 31078 if (!isPLaced) return A$1; 31079 return b$1` 31080 <sonic-button type="primary" href="${this._href}" @click=${this.handleClick}> 31081 <div class="reserver-plan-wording"> 31082 <sonic-icon library="custom" name="location-dot"></sonic-icon> 31083 <div class="text-left">${text} ${this.renderPriceInfo()}</div> 31084 </div> 31085 </sonic-button> 31086 `; 31087 } 31088 renderPriceInfo() { 31089 const eventIsFull = this.infos_status?.additionnals && this.infos_status.additionnals.filter((x2) => x2.key && ["full", "full_here", "canceled"].includes(x2.key)).length > 0; 31090 if (eventIsFull) return A$1; 31091 return b$1`<sonic-price-range class="mt-1 block text-sm leading-tight font-normal"></sonic-price-range>`; 31092 } 31093 }; 31094 MapLink.styles = [ 31095 tailwind, 31096 i$9` 31097 sonic-button { 31098 --sc-btn-py: 0.8em; 31099 } 31100 31101 sonic-icon { 31102 margin-right: 0.3em; 31103 } 31104 31105 .reserver-plan-wording { 31106 display: flex; 31107 justify-content: flex-start; 31108 font-weight: 600; 31109 } 31110 ` 31111 ]; 31112 __decorateClass$33([ 31113 n$5({ type: String }) 31114 ], MapLink.prototype, "slug", 2); 31115 __decorateClass$33([ 31116 n$5({ type: Object }) 31117 ], MapLink.prototype, "infos_status", 2); 31118 __decorateClass$33([ 31119 n$5({ type: Object }) 31120 ], MapLink.prototype, "room", 2); 31121 __decorateClass$33([
31122 n$5({ type: Array }) 31123 ], MapLink.prototype, "prices", 2); 31124 __decorateClass$33([ 31125 c({ context: accessParamsContext, subscribe: true }), 31126 n$5({ type: Object }) 31127 ], MapLink.prototype, "accessParams", 2); 31128 __decorateClass$33([ 31129 r$5() 31130 ], MapLink.prototype, "_href", 2); 31131 __decorateClass$33([ 31132 bind$1("settings.subscriptionRequirement"), 31133 r$5() 31134 ], MapLink.prototype, "subscriptionRequirement", 2); 31135 __decorateClass$33([ 31136 c({ context: appType, subscribe: true }), 31137 r$5() 31138 ], MapLink.prototype, "appType", 2); 31139 MapLink = __decorateClass$33([ 31140 t$3("sonic-event-map-link") 31141 ], MapLink); 31142 var __decorate$e = function(decorators, target, key, desc) { 31143 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 31144 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 31145 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; 31146 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 31147 }; 31148 const tagName$1T = "sonic-select"; 31149 let Select = class Select extends Form$2(Subscriber$1(i$6)) { 31150 constructor() { 31151 super(...arguments); 31152 this.valueKey = "value"; 31153 this.wordingKey = "wording"; 31154 this.multiple = false; 31155 this.status = "default"; 31156 this._options = []; 31157 this.hasDoneFirstUpdate = false; 31158 this._value = ""; 31159 this.updateOptions = () => { 31160 const options = this.querySelectorAll("option"); 31161 if (options.length > 0) { 31162 this.options = Array.from(options).map((option) => { 31163 return { 31164 value: option.value, 31165 wording: option.text, 31166 selected: option.hasAttribute("selected") 31167 }; 31168 }); 31169 } 31170 }; 31171 this.forceAutoFill = false; 31172 this.hasDescription = false; 31173 this.hasLabel = false; 31174 this.hasSuffix = false; 31175 this.hasPrefix = false; 31176 } 31177 set options(options) { 31178 this._options = options; 31179 for (const option of options) { 31180 if (option.selected) { 31181 this.value = option[this.valueKey] || ""; 31182 } 31183 } 31184 const value = this.value || this.getAttribute("value"); 31185 if (!value && this._options.length > 0) { 31186 this.value = this._options[0][this.valueKey]; 31187 } 31188 this.requestUpdate(); 31189 } 31190 get options() { 31191 return this._options; 31192 } 31193 firstUpdated(changedProperties) { 31194 this.hasDoneFirstUpdate = true; 31195 super.firstUpdated(changedProperties); 31196 } 31197 set value(value) { 31198 if (value == null && !this.hasDoneFirstUpdate) 31199 return; 31200 if (!value) 31201 value = ""; 31202 if (this._value == value) 31203 return; 31204 this._value = value; 31205 this.updateFormPublisherValue(); 31206 this.requestUpdate(); 31207 } 31208 get value() { 31209 return this._value; 31210 } 31211 updateFormPublisherValue() { 31212 this.setFormPublisherValue(this.value); 31213 } 31214 connectedCallback() { 31215 super.connectedCallback(); 31216 this.hasSlotOrProps(); 31217 this.updateOptions(); 31218 } 31219 get description() { 31220 return this._description; 31221 } 31222 set description(value) { 31223 if (this.hasAttribute("description") && !this.forceAutoFill) 31224 value = this.getAttribute("description"); 31225 this._description = value; 31226 this.requestUpdate(); 31227 } 31228 get label() { 31229 return this._label; 31230 } 31231 set label(value) { 31232 if (this.hasAttribute("label") && !this.forceAutoFill) 31233 value = this.getAttribute("label"); 31234 this._label = value; 31235 this.requestUpdate(); 31236 } 31237 willUpdate(changedProperties) { 31238 this.hasSlotOrProps(); 31239 super.willUpdate(changedProperties); 31240 } 31241 hasSlotOrProps() { 31242 this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false; 31243 this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false; 31244 this.hasSuffix = this.slotSuffixNodes?.length ? true : false;
31245 this.hasPrefix = this.slotPrefixNodes?.length ? true : false; 31246 } 31247 validateFormElement() { 31248 const select2 = this.shadowRoot?.querySelector("select"); 31249 if (!select2 || select2.checkValidity()) 31250 return; 31251 const formPublisher = this.getFormPublisher(); 31252 if (formPublisher) { 31253 formPublisher.isFormValid = false; 31254 } 31255 select2.reportValidity(); 31256 } 31257 render() { 31258 const slotClasses = { 31259 "has-prefix": this.hasPrefix, 31260 "has-suffix": this.hasSuffix 31261 }; 31262 return b$1` 31263 <label 31264 for="form-element" 31265 class="${this.hasLabel ? "form-label" : "hidden"}" 31266 >${this.label ? o$6( 31267 this.label 31268 /*+ labelStarSuffix*/ 31269 ) : ""}<slot 31270 name="label" 31271 @slotchange=${this.hasSlotOrProps} 31272 ></slot 31273 ></label> 31274 31275 <div class="form-control ${e(slotClasses)}"> 31276 <slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot> 31277 <div class="form-select-wrapper"> 31278 <select 31279 data-form-element 31280 id="form-element" 31281 @change=${this.handleChange} 31282 @blur=${this.handleBlur} 31283 ?disabled=${this.disabled} 31284 ?required=${this.required} 31285 ?multiple=${this.multiple} 31286 size=${o$4(this.selectSize)} 31287 ?autofocus=${this.autofocus} 31288 .value="${this.value}" 31289 class="form-element" 31290 aria-label=${o$4(this.ariaLabel)} 31291 aria-labelledby=${o$4(this.ariaLabelledby)} 31292 > 31293 ${c$1(this.options, (option) => option[this.valueKey], (option) => { 31294 const isSelected = this.value == option[this.valueKey] ? true : false; 31295 return b$1`<option 31296 ?selected=${isSelected} 31297 value="${option[this.valueKey]}" 31298 > 31299 ${option[this.wordingKey]} 31300 </option>`; 31301 })} 31302 <slot></slot> 31303 </select> 31304 <sonic-icon 31305 class="select-chevron" 31306 name="nav-arrow-down" 31307 .size=${this.size} 31308 ></sonic-icon> 31309 </div> 31310 <slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot> 31311 </div> 31312 31313 <slot 31314 name="description" 31315 @slotchange=${this.hasSlotOrProps} 31316 class="${this.hasDescription ? "form-description" : "hidden"}" 31317 >${this.description ? b$1`${o$6(this.description)}` : ""}</slot 31318 > 31319 `; 31320 } 31321 }; 31322 Select.styles = [ 31323 fontSize, 31324 formControl, 31325 label, 31326 description, 31327 i$9` 31328 .form-element { 31329 appearance: none; 31330 white-space: nowrap; 31331 overflow: hidden; 31332 text-overflow: ellipsis; 31333 } 31334 31335 :host([disabled]) sonic-icon { 31336 opacity: 0; 31337 } 31338 31339 @supports selector(:has(*)) { 31340 :host(:not([disabled]):not([align="center"])) 31341 .form-element:not(:has(option:only-child)) { 31342 padding-right: max(1.5em, calc(1.5 * var(--sc-input-px))); 31343 } 31344 } 31345 /*Firefox etc.*/ 31346 @supports not selector(:has(*)) { 31347 :host(:not([disabled]):not([align="center"])) .form-element { 31348 padding-right: max(1.5em, calc(1.5 * var(--sc-input-px))); 31349 } 31350 } 31351 31352 .form-select-wrapper { 31353 position: relative; 31354 width: 100%; 31355 } 31356 31357 sonic-icon { 31358 position: absolute; 31359 top: 50%; 31360 pointer-events: none; 31361 transform: translateY(-50%); 31362 color: var(--sc-input-c); 31363 right: 0.1em; 31364 width: 1.275em; 31365 } 31366 31367 option { 31368 padding: 0.1rem var(--sc-input-px, 0); 31369 color: var(--sc-base-content, #000); 31370 background: var(--sc-base, #fff); 31371 } 31372 31373 select[multiple] option { 31374 background: transparent; 31375 padding: 0; 31376 } 31377 :host([multiple]) sonic-icon { 31378 display: none !important; 31379 } 31380 ` 31381 ]; 31382 __decorate$e([ 31383 n$5({ type: String }) 31384 ], Select.prototype, "valueKey", void 0); 31385 __decorate$e([ 31386 n$5({ type: String }) 31387 ], Select.prototype, "wordingKey", void 0); 31388 __decorate$e([ 31389 n$5({ type: Boolean }) 31390 ], Select.prototype, "multiple", void 0); 31391 __decorate$e([ 31392 n$5({ type: String, reflect: true }) 31393 ], Select.prototype, "size", void 0); 31394 __decorate$e([ 31395 n$5({ type: Number }) 31396 ], Select.prototype, "selectSize", void 0); 31397 __decorate$e([ 31398 n$5({ type: String, reflect: true }) 31399 ], Select.prototype, "status", void 0); 31400 __decorate$e([ 31401 n$5({ type: Array }) 31402 ], Select.prototype, "options", null); 31403 __decorate$e([ 31404 n$5({ reflect: true }) 31405 ], Select.prototype, "value", null); 31406 __decorate$e([ 31407 n$5({ type: Boolean }) 31408 ], Select.prototype, "forceAutoFill", void 0); 31409 __decorate$e([ 31410 n$5() 31411 ], Select.prototype, "description", null); 31412 __decorate$e([ 31413 n$5() 31414 ], Select.prototype, "label", null); 31415 __decorate$e([ 31416 n$4({ slot: "label", flatten: true }) 31417 ], Select.prototype, "slotLabelNodes", void 0); 31418 __decorate$e([ 31419 n$4({ slot: "description", flatten: true }) 31420 ], Select.prototype, "slotDescriptionNodes", void 0); 31421 __decorate$e([ 31422 n$4({ slot: "suffix", flatten: true }) 31423 ], Select.prototype, "slotSuffixNodes", void 0); 31424 __decorate$e([ 31425 n$4({ slot: "prefix", flatten: true }) 31426 ], Select.prototype, "slotPrefixNodes", void 0); 31427 __decorate$e([ 31428 r$5() 31429 ], Select.prototype, "hasDescription", void 0); 31430 __decorate$e([ 31431 r$5() 31432 ], Select.prototype, "hasLabel", void 0); 31433 __decorate$e([ 31434 r$5() 31435 ], Select.prototype, "hasSuffix", void 0); 31436 __decorate$e([ 31437 r$5() 31438 ], Select.prototype, "hasPrefix", void 0); 31439 Select = __decorate$e([ 31440 t$3(tagName$1T) 31441 ], Select); 31442 var __defProp$2$ = Object.defineProperty; 31443 var __getOwnPropDesc$32 = Object.getOwnPropertyDescriptor; 31444 var __decorateClass$32 = (decorators, target, key, kind) => { 31445 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$32(target, key) : target; 31446 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 31447 if (decorator = decorators[i2]) 31448 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 31449 if (kind && result) __defProp$2$(target, key, result); 31450 return result; 31451 }; 31452 const tagName$1S = "sonic-iframe"; 31453 let SonicIframe = class extends i$6 { 31454 constructor() { 31455 super(...arguments); 31456 this.src = ""; 31457 this.title = ""; 31458 this.urlBase = ""; 31459 this.lang = "fr"; 31460 this.loading = true; 31461 this.error = false;
31462 this.nbOfLoad = 0; 31463 this.scollIsInitialized = false; 31464 this.configureTheme = (theme) => { 31465 if (!theme) return; 31466 if (this._iframe) { 31467 this._iframe.contentWindow?.postMessage({ type: "SonicTheme", ...theme }, "*"); 31468 } 31469 }; 31470 this.handleIframeMessage = (e2) => { 31471 if (e2.data.invalidate) { 31472 const dataProviders = e2.data.invalidate; 31473 if (Array.isArray(dataProviders)) { 31474 dataProviders.forEach((dataProvider) => { 31475 PublisherManager.get(dataProvider).invalidate(); 31476 }); 31477 } else { 31478 PublisherManager.get(dataProviders).invalidate(); 31479 } 31480 } 31481 if (e2.data.goTo) { 31482 { 31483 let redirectUrl = ""; 31484 const absoluteGoTo = e2.data.goTo.startsWith("http"); 31485 if (absoluteGoTo) { 31486 redirectUrl = decodeURIComponent(e2.data.goTo); 31487 } else { 31488 redirectUrl = appRoute(e2.data.goTo || "home").query(e2.data.params || {}).toString(); 31489 } 31490 if (redirectUrl) { 31491 window.location.href = redirectUrl; 31492 } 31493 } 31494 } 31495 if (e2.data.closeModal) { 31496 closeParentModal(this); 31497 } 31498 if (e2.data.isLoaded == true) { 31499 this._iframe?.contentWindow?.postMessage({ type: "iframeContext", value: "v2" }, "*"); 31500 if (this.nbOfLoad > 0) { 31501 this.scrollTopIframe(); 31502 } 31503 this.nbOfLoad += 1; 31504 } 31505 if (e2.data.goToPayment == true || e2.data.eventType === "popup" && window?.matchMedia("(max-width: 640px)").matches) { 31506 this.scrollTopIframe(); 31507 } 31508 if (e2.data.type == "SonicIframeResquestParentScrollPosition") { 31509 this.sendIframePosition(); 31510 if (!this.scollIsInitialized) { 31511 window.addEventListener("scroll", () => { 31512 this.sendIframePosition(); 31513 }); 31514 window.addEventListener("resize", () => { 31515 this.sendIframePosition(); 31516 }); 31517 } 31518 } 31519 if (e2.data.type == "iframeBodySize") { 31520 if (this._iframe) { 31521 this._iframe.style.height = e2.data.value.height + "px"; 31522 } 31523 } 31524 }; 31525 this.observer = new MutationObserver((mutationsList) => { 31526 mutationsList.forEach((mutation) => { 31527 if (mutation.type === "attributes") { 31528 this.lang = this.getHTMLlang(); 31529 } 31530 }); 31531 }); 31532 } 31533 connectedCallback() { 31534 const serviceURL = HTML$1.getAncestorAttributeValue(this, "serviceURL") || ""; 31535 this.urlBase = new URL(serviceURL, document.location.href).origin; 31536 this.lang = this.getHTMLlang(); 31537 this.observer.observe(document.documentElement, { attributes: true }); 31538 PublisherManager.get("sonic-theme").onAssign(this.configureTheme); 31539 window.addEventListener("message", this.handleIframeMessage, false); 31540 super.connectedCallback(); 31541 } 31542 getHTMLlang() { 31543 return document.documentElement.lang.split("-")[0] || "fr"; 31544 } 31545 sendIframePosition() { 31546 if (this._iframe) { 31547 const iframeWrapperRect = this._iframe.getBoundingClientRect(); 31548 const iframeWrapperTop = iframeWrapperRect.top; 31549 this._iframe.contentWindow?.postMessage( 31550 { 31551 type: "SonicIframeScrollPosition", 31552 scrollY: window.scrollY, 31553 iframeWrapperTop, 31554 parentInnerHeight: window.innerHeight 31555 }, 31556 "*" 31557 ); 31558 } 31559 } 31560 disconnectedCallback() { 31561 PublisherManager.get("sonic-theme").offAssign(this.configureTheme); 31562 this.observer.disconnect(); 31563 super.disconnectedCallback(); 31564 } 31565 scrollTopIframe() { 31566 if (this._iframe) { 31567 if (this._iframeAnchor) { 31568 const iframeAnchorRect = this._iframeAnchor.getBoundingClientRect(); 31569 const iframeAnchorTop = iframeAnchorRect.top; 31570 if (iframeAnchorTop < 0) { 31571 this._iframeAnchor.scrollIntoView({ block: "start", behavior: "smooth" }); 31572 } 31573 } 31574 } 31575 } 31576 handleLoad() { 31577 this.loading = false;
31578 } 31579 handleError() { 31580 this.error = true; 31581 } 31582 willUpdate(_changedProperties) { 31583 if (_changedProperties.has("src")) { 31584 this.loading = true; 31585 } 31586 super.willUpdate(_changedProperties); 31587 } 31588 render() { 31589 let src = this.src; 31590 const isUrlBackOffice = src.includes("/la_billetterie/"); 31591 const srcParams = `lang=${this.lang}&noredirect=1${!isUrlBackOffice ? "&iframe=true" : ""}&iframe_v2=true`; 31592 src = src.includes("?") ? `${src}&${srcParams}` : `${src}?${srcParams}`; 31593 return b$1` 31594 <span id="iframeAnchor" class="absolute -translate-y-4 pointer-events-none"></span> 31595 ${this.error ? b$1`<sonic-alert status="error">${t("error_title")}</sonic-alert>` : A$1} 31596 <iframe 31597 id="iframe" 31598 referrerpolicy="origin" 31599 src="${this.urlBase + src}" 31600 title="${this.title}" 31601 frameborder="0" 31602 scrolling="no" 31603 allowtransparency="true" 31604 width="100%" 31605 height="500" 31606 class="iframe-billetterie relative z-10 transition-opacity duration-300 opacity-1 ${this.loading ? "opacity-30 pointer-events-none duration-500" : ""}" 31607 @load="${this.handleLoad}" 31608 @error="${this.handleError}" 31609 ></iframe> 31610 ${this.loading ? b$1`<sonic-loader></sonic-loader>` : A$1} 31611 `; 31612 } 31613 }; 31614 SonicIframe.styles = [ 31615 tailwind, 31616 i$9` 31617 iframe { 31618 width: 100%; 31619 min-width: 100%; 31620 border: none; 31621 } 31622 31623 :host() { 31624 display: block; 31625 min-height: 1px; 31626 } 31627 31628 :host([cover]) iframe { 31629 min-height: 100% !important; 31630 position: absolute; 31631 top: 0; 31632 left: 0; 31633 right: 0; 31634 bottom: 0; 31635 } 31636 ` 31637 ]; 31638 __decorateClass$32([ 31639 n$5() 31640 ], SonicIframe.prototype, "src", 2); 31641 __decorateClass$32([ 31642 n$5() 31643 ], SonicIframe.prototype, "title", 2); 31644 __decorateClass$32([ 31645 e$7("#iframe") 31646 ], SonicIframe.prototype, "_iframe", 2); 31647 __decorateClass$32([ 31648 e$7("#iframeAnchor") 31649 ], SonicIframe.prototype, "_iframeAnchor", 2); 31650 __decorateClass$32([ 31651 n$5({ type: String }) 31652 ], SonicIframe.prototype, "urlBase", 2); 31653 __decorateClass$32([ 31654 n$5({ type: String }) 31655 ], SonicIframe.prototype, "lang", 2); 31656 __decorateClass$32([ 31657 n$5({ type: Boolean }) 31658 ], SonicIframe.prototype, "loading", 2); 31659 __decorateClass$32([ 31660 n$5({ type: Boolean }) 31661 ], SonicIframe.prototype, "error", 2); 31662 SonicIframe = __decorateClass$32([ 31663 t$3(tagName$1S) 31664 ], SonicIframe);
31665 const buyModeContext = n("buyModeContext"); 31666 async function fetchEntityQuotasStock(element, entityType, entityId) { 31667 if (!entityId) return []; 31668 const api2 = new API(HTML.getApiConfiguration(element)); 31669 const endpoint = entityEndPoint({ entityType, entityId, features: [Feature.Quotas] }); 31670 const result = await api2.get(endpoint); 31671 const data = result?.data; 31672 if (!data || !("quotas" in data)) return []; 31673 return data.quotas ?? []; 31674 } 31675 function shouldFetchQuotasStockDisplay(appType2, accessParams) { 31676 return appType2 === "counter" && accessParams?.isWaitingList === true; 31677 } 31678 function applyQuotasStockDisplay(logicQuotas, stockQuotas) { 31679 if (!stockQuotas.length) return logicQuotas; 31680 const stockById = new Map(stockQuotas.map((quota) => [Number(quota.id), quota])); 31681 return logicQuotas.map((quota) => { 31682 const stock = stockById.get(Number(quota.id)); 31683 if (!stock) return quota; 31684 return { 31685 ...quota, 31686 remaining_places_nb: stock.remaining_places_nb, 31687 total_places_nb: stock.total_places_nb, 31688 has_remaining: stock.has_remaining 31689 }; 31690 }); 31691 } 31692 function buildQuotaSelectOptions({ 31693 quotas, 31694 stockQuotas, 31695 selectedQuotaId, 31696 isCounterMode, 31697 isCustomerMode 31698 }) { 31699 const displayQuotas = stockQuotas?.length ? applyQuotasStockDisplay(quotas, stockQuotas) : quotas; 31700 return quotasToOptions(displayQuotas, selectedQuotaId, isCounterMode, isCustomerMode); 31701 } 31702 var __defProp$2_ = Object.defineProperty; 31703 var __getOwnPropDesc$31 = Object.getOwnPropertyDescriptor; 31704 var __decorateClass$31 = (decorators, target, key, kind) => { 31705 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$31(target, key) : target; 31706 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 31707 if (decorator = decorators[i2]) 31708 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 31709 if (kind && result) __defProp$2_(target, key, result); 31710 return result; 31711 }; 31712 let QuotaSelector = class extends Subscriber$1(i$6) { 31713 constructor() { 31714 super(...arguments); 31715 this.room = {}; 31716 this._quotas = []; 31717 this.selectedQuota = null; 31718 this._initialSelectedQuota = null; 31719 this.display = "select"; 31720 this.buyMode = BuyMode.DEFAULT; 31721 this.lockSeatContingentSelection = false; 31722 this._stockQuotas = []; 31723 this._stockQuotasRequestId = 0; 31724 this.seatmapProvider = "seatmap"; 31725 this.pricesTerms = { 31726 fr: "Tarifs public", 31727 en: "Public prices", 31728 de: "Ãffentliche Preise", 31729 nl: "Publieke prijzen" 31730 }; 31731 this.firstUpdatedQuota = false; 31732 } 31733 get quotas() { 31734 return this._quotas; 31735 } 31736 set quotas(value) { 31737 this._quotas = value; 31738 const selectedSeats = get("seatmap.selectedSeats") || []; 31739 if (selectedSeats.length) { 31740 this.selectQuotaById(parseInt(selectedSeats[0].contingentementInterne)); 31741 this.requestUpdate(); 31742 return; 31743 } 31744 this.selectQuotaById(this.selectedQuota?.id); 31745 this.requestUpdate(); 31746 } 31747 connectedCallback() { 31748 super.connectedCallback(); 31749 this._initialSelectedQuota = structuredClone(this.selectedQuota); 31750 } 31751 selectQuotaById(id) { 31752 const quota = this.quotas.find((q) => q.id == parseInt(id + "")); 31753 const index = quota ? this.quotas.indexOf(quota) : 0; 31754 this.useQuotaAtIndex(index); 31755 } 31756 handleQuotaSelection(e2) { 31757 let elementValue = ""; 31758 if (e2.target instanceof HTMLSelectElement) { 31759 elementValue = e2.target.value; 31760 } else { 31761 elementValue = e2.currentTarget.value; 31762 } 31763 this.selectQuotaById(parseInt(elementValue)); 31764 } 31765 onSelectedSeatsChange(selectedSeats) { 31766 if (!selectedSeats?.length) { 31767 return; 31768 } 31769 this.selectQuotaById(parseInt(selectedSeats[0].contingentementInterne)); 31770 } 31771 useQuotaAtIndex(index) { 31772 if (!this.quotas || !this.props) return; 31773 const itemId = this.props.id; 31774 if (!itemId) return; 31775 const selectedQuota = this.quotas.length > 1 ? this.quotas[index] : null; 31776 this.selectedQuota = selectedQuota || {}; 31777 this.dispatchEvent(new CustomEvent("selectQuota", { detail: selectedQuota })); 31778 const showAll = this.quotas.length < 2 || !this.quotas[index]; 31779 PublisherManager.get("product/" + itemId + "/PricesFilter").set({ 31780 selectedQuota, 31781 showAll, 31782 quotas: this.quotas 31783 }); 31784 } 31785 editQuota(url) { 31786 Modal.create({ 31787 content: ( 31788 /*html*/ 31789 `<sonic-iframe src="${url}"></sonic-iframe>` 31790 ), 31791 width: "90%", 31792 paddingX: "1.25rem", 31793 paddingY: "1.25rem", 31794 maxWidth: "65rem", 31795 height: "90svh", 31796 maxHeight: "90svh", 31797 removeOnHide: true 31798 // zIndex: 10, 31799 }); 31800 } 31801 replaceTabTitle(title) { 31802 const currentHtmlLang = document.documentElement.lang; 31803 const cleanTitle = this.pricesTerms?.[currentHtmlLang] ? this.pricesTerms[currentHtmlLang] : "Tarifs public"; 31804 return title?.replace("Hors contingentement", cleanTitle); 31805 } 31806 // preferredQuotaInit = false;
31807 async willUpdate(changedProperties) { 31808 if (changedProperties.has("selectedQuota") && !this.firstUpdatedQuota) { 31809 this.selectFirstQuotaWithPrices(); 31810 this.firstUpdatedQuota = true; 31811 } 31812 if (changedProperties.has("props") || changedProperties.has("appType") || changedProperties.has("accessParams")) { 31813 await this.loadStockQuotas(); 31814 } 31815 super.willUpdate(changedProperties); 31816 } 31817 async loadStockQuotas() { 31818 if (!shouldFetchQuotasStockDisplay(this.appType, this.accessParams)) { 31819 this._stockQuotas = []; 31820 return; 31821 } 31822 const entityId = Number(this.props?.id); 31823 if (!entityId) { 31824 this._stockQuotas = []; 31825 return; 31826 } 31827 const requestId = ++this._stockQuotasRequestId; 31828 const stockQuotas = await fetchEntityQuotasStock(this, EntityType.Event, entityId); 31829 if (requestId !== this._stockQuotasRequestId) return; 31830 this._stockQuotas = stockQuotas; 31831 } 31832 buildQuotaOptions() { 31833 return buildQuotaSelectOptions({ 31834 quotas: this.quotas, 31835 stockQuotas: this._stockQuotas, 31836 selectedQuotaId: Number(this.selectedQuota?.id) || 0, 31837 isCounterMode: this.appType === "counter", 31838 isCustomerMode: this.appType === "customer" 31839 }); 31840 } 31841 selectFirstQuotaWithPrices() { 31842 if (this.appType !== "customer") { 31843 return; 31844 } 31845 if (this.props && !("settings" in this.props)) { 31846 return; 31847 } 31848 const settings = this.props?.settings; 31849 const no_seatmap = settings && "has_seatmap" in settings && settings?.has_seatmap === false; 31850 if (!no_seatmap) { 31851 return; 31852 } 31853 const firstQuotaWithPrice = this.getFirstQuotaWithPrice(); 31854 if (firstQuotaWithPrice) { 31855 this.useQuotaAtIndex(this.quotas.indexOf(firstQuotaWithPrice)); 31856 } 31857 } 31858 getFirstQuotaWithPrice() { 31859 return this.quotas.find((quota) => { 31860 const hasPrices = quota.prices && quota.prices?.length > 0; 31861 const hasVisiblePrices = hasPrices && quota.prices?.some((price) => price.visible == true); 31862 return hasVisiblePrices; 31863 }); 31864 } 31865 renderDescription() { 31866 if (!this.selectedQuota?.description) return A$1; 31867 return b$1`<div class="mt-5 prose prose-sm prose-tight">${o$6(this.selectedQuota.description)}</div>`; 31868 } 31869 /** 31870 * Place contingentée : id > 1 (hors « Hors contingentement »). 31871 * Indépendant du caractère public ou privé du contingent. 31872 */ 31873 shouldRenderContingentedPlacementAlert() { 31874 const isContingented = Number(this._initialSelectedQuota?.id) > 1; 31875 if (!isSeatMode(this.buyMode) || this.appType !== "counter" || !isContingented) { 31876 return false; 31877 } 31878 return true; 31879 } 31880 renderContingentAlert() { 31881 if (!this.shouldRenderContingentedPlacementAlert()) { 31882 return A$1; 31883 } 31884 const quotaHasChanged = this._initialSelectedQuota?.id !== this.selectedQuota?.id; 31885 return b$1`<sonic-badge 31886 type="${quotaHasChanged ? "warning" : "info"}" 31887 class="relative ml-3 mb-1 pointer-events-none" 31888 > 31889 <sonic-icon name="${quotaHasChanged ? "face-surprise" : "circle-info"}" library="custom"></sonic-icon> 31890 ${quotaHasChanged ? "Vous allez modifier le contingent de la place" : t("places_contingentees")} 31891 </sonic-badge> `; 31892 } 31893 render() { 31894 if (!this.quotas) return A$1; 31895 const isPlaced = this.room && ["place", "mixte"].includes(this.room.placing_type_key || ""); 31896 const isSeat = isSeatMode(this.buyMode); 31897 const isCounter = this.appType === "counter"; 31898 if (isPlaced && isDefaultMode(this.buyMode)) return A$1; 31899 if (isSeat && !isCounter) return this.renderDescription(); 31900 const options = this.buildQuotaOptions(); 31901 const mustRender = options.length > 1 && !this.lockSeatContingentSelection; 31902 const routeContingent = appRoute("event.edit.quotas")?.fill({ id: this.props?.id }).query({ dataProvider: this.dataProvider ?? "" }).toString(); 31903 const showContingentEditButton = routeContingent && isDefaultMode(this.buyMode) && this.currentAdminPermissions?.event?.edit_quotas === true ? true : false;
31904 return b$1` 31905 <sonic-if .condition=${mustRender}> 31906 <!--Onglets--> 31907 ${this.display === "tabs" ? b$1` 31908 <div class="flex gap-2 w-full relative ${flexJustify(this.align)}"> 31909 ${o$1(this.quotas, (quota) => { 31910 return b$1` 31911 <button @click=${this.handleQuotaSelection} value=${quota.id} class="relative"> 31912 <div class="font-bold px-2 py-1">${this.replaceTabTitle(quota.title)}</div> 31913 <div 31914 class="${this.selectedQuota?.id == quota.id ? "scale-x-100" : "scale-x-0"} transition absolute h-[4px] -bottom-[4px] bg-current w-full rounded" 31915 ></div> 31916 </button> 31917 `; 31918 })} 31919 </div> 31920 <div class="h-[4px] w-full rounded bg-neutral-100"></div> 31921 ` : A$1} 31922 31923 <!--SELECT--> 31924 ${this.display === "select" ? b$1` ${this.renderContingentAlert()} ${this.renderDescription()} 31925 <div class="flex gap-x-2 items-center"> 31926 <sonic-select 31927 @change=${this.handleQuotaSelection} 31928 .options=${options} 31929 dataProvider=${this.dataProvider + "/quota-selector"} 31930 class="grow ${isSeat ? "" : "max-w-[26rem]"}" 31931 size="${isSeat ? "md" : "sm"}" 31932 name="quota" 31933 ></sonic-select> 31934 ${showContingentEditButton && this.appType === "counter" ? b$1` <sonic-button @click=${() => this.editQuota(routeContingent)} icon shape="circle" size="sm"> 31935 <sonic-icon name="pen" library="custom"></sonic-icon> 31936 </sonic-button>` : A$1} 31937 </div>` : A$1} 31938 </sonic-if> 31939 `; 31940 } 31941 }; 31942 QuotaSelector.styles = [tailwind]; 31943 __decorateClass$31([ 31944 n$5() 31945 ], QuotaSelector.prototype, "room", 2); 31946 __decorateClass$31([ 31947 n$5() 31948 ], QuotaSelector.prototype, "quotas", 1); 31949 __decorateClass$31([ 31950 n$5({ type: Object }) 31951 ], QuotaSelector.prototype, "selectedQuota", 2); 31952 __decorateClass$31([ 31953 n$5({ type: String }) 31954 ], QuotaSelector.prototype, "display", 2); 31955 __decorateClass$31([ 31956 c({ context: buyModeContext, subscribe: true }), 31957 n$5({ type: String }) 31958 ], QuotaSelector.prototype, "buyMode", 2); 31959 __decorateClass$31([ 31960 n$5({ type: Boolean }) 31961 ], QuotaSelector.prototype, "lockSeatContingentSelection", 2); 31962 __decorateClass$31([ 31963 c({ context: alignContext, subscribe: true }), 31964 n$5({ type: String, reflect: true }) 31965 ], QuotaSelector.prototype, "align", 2); 31966 __decorateClass$31([ 31967 c({ context: appType, subscribe: true }), 31968 r$5() 31969 ], QuotaSelector.prototype, "appType", 2); 31970 __decorateClass$31([ 31971 c({ context: accessParamsContext, subscribe: true }), 31972 n$5({ type: Object }) 31973 ], QuotaSelector.prototype, "accessParams", 2); 31974 __decorateClass$31([ 31975 r$5() 31976 ], QuotaSelector.prototype, "_stockQuotas", 2); 31977 __decorateClass$31([ 31978 bind$1("admin/current.data.permissions"), 31979 r$5() 31980 ], QuotaSelector.prototype, "currentAdminPermissions", 2); 31981 __decorateClass$31([ 31982 ancestorAttribute("seatmapProvider") 31983 ], QuotaSelector.prototype, "seatmapProvider", 2); 31984 __decorateClass$31([ 31985 onAssign(seatmapKey.selectedSeats.path) 31986 ], QuotaSelector.prototype, "onSelectedSeatsChange", 1); 31987 QuotaSelector = __decorateClass$31([ 31988 t$3("sonic-event-quota-selector") 31989 ], QuotaSelector); 31990 const styles$1 = i$9` 31991 .sonic-categorized-prices-form:not(:last-child) { 31992 margin-bottom: 1.1em; 31993 } 31994`; 31995 const styles = i$9` 31996 :host { 31997 display: flex; 31998 flex: 1; 31999 } 32000 32001 sonic-button { 32002 display: content; 32003 flex: 1; 32004 display: flex; 32005 position: relative; 32006 --sc-btn-py: 1em; 32007 --sc-btn-px: 0.7em; 32008 --sc-btn-gap: 0; 32009 --sc-btn-hover-filter: none; 32010 --sc-btn-active-filter: none; 32011 } 32012 32013 :host([size="sm"]) sonic-button { 32014 --sc-btn-py: 0.6em; 32015 } 32016 32017 .name { 32018 display: block; 32019 overflow-wrap: break-word; 32020 word-wrap: break-word; 32021 word-break: break-word; 32022 } 32023 32024 sonic-pop { 32025 position: absolute; 32026 right: 0; 32027 top: 0; 32028 } 32029 32030 :host svg { 32031 width: 0.3em; 32032 } 32033`; 32034 const disableButtonMultiSelectContext = n("disableButtonMultiSelectContext"); 32035 var __decorate$d = function(decorators, target, key, desc) { 32036 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 32037 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 32038 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; 32039 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 32040 }; 32041 let LegendDescription = class LegendDescription extends i$6 { 32042 render() { 32043 return b$1`<slot></slot>`; 32044 } 32045 }; 32046 LegendDescription.styles = [ 32047 i$9` 32048 :host { 32049 font-size: 1.15rem; 32050 line-height: 1.2; 32051 display: block; 32052 color: var(--sc-base-500, var(--sc-base-content, #000)); 32053 font-weight: var(--sc-font-weight-base, 400); 32054 font-style: var(--sc-font-style-base, normal); 32055 margin-top: 0.2em; 32056 container-type: inline-size; 32057 } 32058 32059 @container (max-inline-size: 28rem) { 32060 :host { 32061 font-size: 1rem; 32062 } 32063 } 32064 ` 32065 ]; 32066 LegendDescription = __decorate$d([ 32067 t$3("sonic-legend-description") 32068 ], LegendDescription); 32069 var __decorate$c = function(decorators, target, key, desc) { 32070 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 32071 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 32072 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; 32073 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 32074 }; 32075 const tagName$1R = "sonic-legend"; 32076 let Legend = class Legend extends i$6 { 32077 constructor() { 32078 super(...arguments); 32079 this.forceAutoFill = false;
32080 } 32081 get description() { 32082 return this._description; 32083 } 32084 set description(value) { 32085 if (this.hasAttribute("description") && !this.forceAutoFill) 32086 value = this.getAttribute("description"); 32087 this._description = value; 32088 this.requestUpdate(); 32089 } 32090 get label() { 32091 return this._label; 32092 } 32093 set label(value) { 32094 if (this.hasAttribute("label") && !this.forceAutoFill) 32095 value = this.getAttribute("label"); 32096 this._label = value; 32097 this.requestUpdate(); 32098 } 32099 render() { 32100 return b$1`<legend part="legend"> 32101 ${this.iconName ? b$1`<div class="icon"> 32102 <sonic-icon 32103 name=${this.iconName} 32104 prefix=${o$4(this.iconPrefix)} 32105 library=${o$4(this.iconLibrary)} 32106 ></sonic-icon> 32107 </div>` : ""} 32108 32109 <div class="legend-content"> 32110 ${o$6(this.label ? this.label : "")} 32111 ${this.description ? b$1`<sonic-legend-description 32112 >${o$6(this.description)}</sonic-legend-description 32113 >` : ""} 32114 <slot></slot> 32115 </div> 32116 <slot name="suffix"></slot> 32117 </legend>`; 32118 } 32119 }; 32120 Legend.styles = [ 32121 i$9` 32122 :host { 32123 --sc-legend-font-size: 1.5rem; 32124 --sc-legend-font-weight: var(--sc-font-weight-base, 400); 32125 --sc-legend-font-style: var(--sc-headings-font-style, normal); 32126 --sc-legend-family: var( 32127 --sc-headings-font-family, 32128 var(--sc-font-family-base, sans-serif) 32129 ); 32130 --sc-legend-line-height: var(--sc-headings-line-height, 1.1); 32131 --sc-legend-color: var(--sc-base-content, #000); 32132 display: flex; 32133 width: 100%; 32134 container-type: inline-size; 32135 } 32136 32137 @container (max-inline-size: 28rem) { 32138 legend { 32139 --sc-legend-font-size: 1.3rem; 32140 } 32141 } 32142 legend { 32143 font-size: var(--sc-legend-font-size); 32144 font-weight: var(--sc-legend-font-weight); 32145 font-style: var(--sc-legend-font-style); 32146 font-family: var(--sc-legend-font-family); 32147 line-height: var(--sc-legend-line-height); 32148 color: var(--sc-legend-color); 32149 padding: 0; 32150 display: flex; 32151 width: 100%; 32152 align-items: flex-start; 32153 gap: 0.35em; 32154 } 32155 32156 slot[name="suffix"] { 32157 display: block; 32158 margin-left: auto; 32159 flex-shrink: 0; 32160 } 32161 32162 .legend-content { 32163 flex-grow: 1; 32164 } 32165 ` 32166 ]; 32167 __decorate$c([ 32168 n$5({ type: Boolean }) 32169 ], Legend.prototype, "forceAutoFill", void 0); 32170 __decorate$c([ 32171 n$5() 32172 ], Legend.prototype, "description", null); 32173 __decorate$c([ 32174 n$5() 32175 ], Legend.prototype, "label", null); 32176 __decorate$c([ 32177 n$5({ type: String }) 32178 ], Legend.prototype, "iconName", void 0); 32179 __decorate$c([ 32180 n$5({ type: String }) 32181 ], Legend.prototype, "iconLibrary", void 0); 32182 __decorate$c([ 32183 n$5({ type: String }) 32184 ], Legend.prototype, "iconPrefix", void 0); 32185 Legend = __decorate$c([ 32186 t$3(tagName$1R) 32187 ], Legend); 32188 var __decorate$b = function(decorators, target, key, desc) { 32189 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 32190 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 32191 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; 32192 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 32193 }; 32194 const tagName$1Q = "sonic-fieldset"; 32195 let Fieldset = class Fieldset extends Subscriber$1(i$6) { 32196 constructor() { 32197 super(...arguments); 32198 this.disabled = false; 32199 this.variant = "default"; 32200 } 32201 render() { 32202 return b$1`<fieldset 32203 form="${o$4(this.form)}" 32204 ?disabled="${this.disabled}" 32205 > 32206 ${this.label ? b$1` <sonic-legend 32207 label=${o$4(this.label)} 32208 description=${o$4(this.description)} 32209 iconName=${o$4(this.iconName)} 32210 iconPrefix=${o$4(this.iconPrefix)} 32211 iconLibrary=${o$4(this.iconLibrary)} 32212 ></sonic-legend>` : A$1} 32213 <slot></slot> 32214 </fieldset>`; 32215 } 32216 }; 32217 Fieldset.styles = [ 32218 i$9` 32219 :host { 32220 --sc-fieldset-mt: 0; 32221 --sc-fieldset-mb: 1rem; 32222 --sc-fieldset-border-color: var(--sc-border-color); 32223 --sc-fieldset-border-width: var(--sc-form-border-width); 32224 --sc-fieldset-px: 1.25rem; 32225 --sc-fieldset-py: 1.8rem; 32226 32227 margin-top: var(--sc-fieldset-mt); 32228 margin-bottom: var(--sc-fieldset-mb); 32229 display: block; 32230 border: var(--sc-fieldset-border-width) solid 32231 var(--sc-fieldset-border-color) !important; 32232 padding: var(--sc-fieldset-py) var(--sc-fieldset-px); 32233 border-radius: var(--sc-rounded-lg); 32234 } 32235 32236 fieldset { 32237 all: unset; 32238 display: contents; 32239 } 32240 32241 :host([variant="shadow"]), 32242 :host([variant="ghost"]) { 32243 --sc-fieldset-border-color: transparent; 32244 } 32245 :host([variant="shadow"]) { 32246 --sc-fieldset-border-color: transparent; 32247 box-shadow: var(--sc-shadow-lg); 32248 } 32249 32250 :host([tight]) { 32251 --sc-fieldset-px: 0; 32252 border-left: none !important;
32253 border-right: none !important; 32254 border-radius: 0; 32255 } 32256 32257 sonic-legend, 32258 ::slotted(sonic-legend) { 32259 margin-bottom: 1.5rem; 32260 display: block; 32261 } 32262 32263 sonic-legend:last-child, 32264 ::slotted(sonic-legend:last-child) { 32265 margin-bottom: 0; 32266 } 32267 ` 32268 ]; 32269 __decorate$b([ 32270 n$5({ type: Boolean, reflect: true }) 32271 ], Fieldset.prototype, "disabled", void 0); 32272 __decorate$b([ 32273 n$5({ type: String }) 32274 ], Fieldset.prototype, "form", void 0); 32275 __decorate$b([ 32276 n$5({ type: String }) 32277 ], Fieldset.prototype, "label", void 0); 32278 __decorate$b([ 32279 n$5({ type: String }) 32280 ], Fieldset.prototype, "description", void 0); 32281 __decorate$b([ 32282 n$5({ type: String }) 32283 ], Fieldset.prototype, "iconName", void 0); 32284 __decorate$b([ 32285 n$5({ type: String }) 32286 ], Fieldset.prototype, "iconLibrary", void 0); 32287 __decorate$b([ 32288 n$5({ type: String }) 32289 ], Fieldset.prototype, "iconPrefix", void 0); 32290 __decorate$b([ 32291 n$5({ type: Boolean, reflect: true }) 32292 ], Fieldset.prototype, "tight", void 0); 32293 __decorate$b([ 32294 n$5({ type: String, reflect: true }) 32295 ], Fieldset.prototype, "variant", void 0); 32296 Fieldset = __decorate$b([ 32297 t$3(tagName$1Q) 32298 ], Fieldset); 32299 var __defProp$2Z = Object.defineProperty; 32300 var __getOwnPropDesc$30 = Object.getOwnPropertyDescriptor; 32301 var __decorateClass$30 = (decorators, target, key, kind) => { 32302 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$30(target, key) : target; 32303 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 32304 if (decorator = decorators[i2]) 32305 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 32306 if (kind && result) __defProp$2Z(target, key, result); 32307 return result; 32308 }; 32309 const tagName$1P = "sonic-login-saml"; 32310 let SonicComponent$h = class SonicComponent extends Subscriber$1(i$6) { 32311 constructor() { 32312 super(...arguments); 32313 this.samlAccess = false; 32314 } 32315 render() { 32316 if (!this.samlAccess) return A$1; 32317 return b$1`<sonic-fieldset> 32318 <sonic-legend 32319 iconLibrary="custom" 32320 iconName="star" 32321 label="${t("LIB_connexion_annuaire_SAML")}" 32322 description="${t("LIB_connexion_annuaire_SAML_description")}" 32323 > 32324 </sonic-legend> 32325 <div> 32326 <sonic-button href=${getSamlUrl(this)} minWidth="12rem" type="info" class="w-full"> 32327 <sonic-icon library="custom" name="arrow-up-right"></sonic-icon> 32328 ${t("se_connecter")}</sonic-button 32329 > 32330 </div> 32331 </sonic-fieldset>`; 32332 } 32333 }; 32334 SonicComponent$h.styles = [tailwind]; 32335 __decorateClass$30([ 32336 bind$1("settings.modules.saml.access"), 32337 n$5({ type: Boolean }) 32338 ], SonicComponent$h.prototype, "samlAccess", 2); 32339 SonicComponent$h = __decorateClass$30([ 32340 t$3(tagName$1P) 32341 ], SonicComponent$h); 32342 const getSamlUrl = (contextElement) => { 32343 const currentLocationHref = window.location.href; 32344 const storeUrl = HTML.getAncestorAttributeValue(contextElement, "storeUrl") || ""; 32345 return `${storeUrl}/lb-saml?sonic_saml_destination=${currentLocationHref}`; 32346 }; 32347 const primaryIsEqualToBaseContent = (element) => { 32348 const baseContent = getComputedStyle(element).getPropertyValue("--sc-base-content"); 32349 const primary = getComputedStyle(element).getPropertyValue("--sc-primary"); 32350 return baseContent === primary; 32351 }; 32352 var __defProp$2Y = Object.defineProperty; 32353 var __getOwnPropDesc$2$ = Object.getOwnPropertyDescriptor; 32354 var __decorateClass$2$ = (decorators, target, key, kind) => { 32355 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2$(target, key) : target; 32356 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 32357 if (decorator = decorators[i2]) 32358 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 32359 if (kind && result) __defProp$2Y(target, key, result); 32360 return result; 32361 }; 32362 let instanceCounter$d = 0; 32363 let subscriptionButtonType$1; 32364 let PriceButton = class extends EventContext(Subscriber$1(i$6)) { 32365 constructor() { 32366 super(...arguments); 32367 this.quantityFormDataProvider = "PriceButtonQuantity/" + instanceCounter$d++; 32368 this.disabled = false;
32369 this.saml_auth_required = false; 32370 this.amount = 0; 32371 this.amount_display = 0; 32372 this.counter = false; 32373 this.price_online = false; 32374 this.item_id = 0; 32375 this.title = ""; 32376 this.need_subscription = false; 32377 this.need_partner_subscription = false; 32378 this.additional_products = []; 32379 this.buttonType = "neutral"; 32380 this.type = null; 32381 this.noPriceName = false; 32382 this.price_available = true; 32383 this.is_triggering_promo = true; 32384 this.price_is_promo = true; 32385 this.help_text = ""; 32386 this.size = "lg"; 32387 this.loading = false; 32388 this.settings = {}; 32389 this.price_min_places = 1; 32390 this.is_free_price = false; 32391 this.free_price = {}; 32392 this.displayQuantitySelector = false; 32393 this.disableButtonMultiSelect = false; 32394 this.seatsContext = []; 32395 this.buyMode = BuyMode.DEFAULT; 32396 this.longClickTimer = null; 32397 this.longClickTriggered = false; 32398 this.LONG_CLICK_DURATION = 300; 32399 this.pressProgress = 0; 32400 this.pressAnimationFrame = null; 32401 this.pressStartTime = null; 32402 this.seatmapProvider = "seatmap"; 32403 this.handlePointerDown = (_e) => { 32404 if (this.loading) return; 32405 if (this.saml_auth_required) { 32406 this.goToSaml(); 32407 return; 32408 } 32409 if (this.disableButtonMultiSelect) { 32410 return; 32411 } 32412 this.longClickTriggered = false; 32413 this.pressProgress = 0; 32414 this.pressStartTime = performance.now(); 32415 const animate = (now) => { 32416 if (this.pressStartTime === null) return; 32417 const elapsed = now - this.pressStartTime; 32418 this.pressProgress = Math.min(elapsed / this.LONG_CLICK_DURATION, 1); 32419 this.requestUpdate(); 32420 if (this.pressProgress < 1) { 32421 this.pressAnimationFrame = requestAnimationFrame(animate); 32422 } 32423 }; 32424 this.pressAnimationFrame = requestAnimationFrame(animate); 32425 this.longClickTimer = window.setTimeout(() => { 32426 this.longClickTriggered = true; 32427 this.selectQuantity(); 32428 this.resetPressProgress(); 32429 }, this.LONG_CLICK_DURATION); 32430 }; 32431 this.handlePointerUp = (e2) => { 32432 e2.stopPropagation(); 32433 e2.preventDefault(); 32434 if (this.disableButtonMultiSelect) { 32435 this.addToCart(); 32436 return; 32437 } 32438 if (this.longClickTimer) { 32439 clearTimeout(this.longClickTimer); 32440 this.longClickTimer = null; 32441 if (!this.longClickTriggered) { 32442 this.addToCart(); 32443 } 32444 } 32445 this.resetPressProgress(); 32446 }; 32447 this.handlePointerLeave = (e2) => { 32448 e2.stopPropagation(); 32449 e2.preventDefault(); 32450 if (this.longClickTimer) { 32451 clearTimeout(this.longClickTimer); 32452 this.longClickTimer = null; 32453 } 32454 this.resetPressProgress(); 32455 }; 32456 this.onFilterMutation = () => { 32457 this.requestUpdate(); 32458 this.updateDisabledState(); 32459 }; 32460 this.isDisabled = false; 32461 } 32462 resetPressProgress() { 32463 this.pressProgress = 0; 32464 this.pressStartTime = null; 32465 if (this.pressAnimationFrame) { 32466 cancelAnimationFrame(this.pressAnimationFrame); 32467 this.pressAnimationFrame = null; 32468 } 32469 this.requestUpdate(); 32470 } 32471 selectQuantity() { 32472 dp(this.quantityFormDataProvider).quantity.set(this.price_min_places || 1); 32473 this.popElement.show(); 32474 this.displayQuantitySelector = true; 32475 } 32476 async addToCart(quantity) { 32477 this.loading = true; 32478 const filter = PublisherManager.get("product/" + this.item_id + "/PricesFilter").get(); 32479 let currentQuota = filter.selectedQuota; 32480 if (!currentQuota && filter.quotas) { 32481 currentQuota = filter.quotas[0]; 32482 } 32483 const seats = this.seatsContext ? this.seatsContext.map((seat) => seat.name) : []; 32484 let quota; 32485 if (currentQuota) { 32486 quota = { 32487 id: parseInt(currentQuota.id) 32488 }; 32489 } 32490 const cartItem = { 32491 entity_type: this.type || void 0, 32492 entity_id: this.item_id, 32493 quantity: quantity || seats.length || 1,
32494 price: { id: parseInt(this.id), ...this.is_free_price && { is_free_price: true, amount: this.amount } }, 32495 places_ids: seats, 32496 parent_id: this.priceContext?.parentSubscription?.id, 32497 quota 32498 }; 32499 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 32500 await Cart.addItems({ 32501 apiConfiguration: this.getApiConfiguration(), 32502 cartProvider, 32503 items: [cartItem], 32504 attachOwnersAfterRequest: true, 32505 editFreePriceAfterRequest: true, 32506 accessParams: this.accessParams 32507 }).then(() => { 32508 if (seats.length > 0) { 32509 updateSeatmapStatus(this.seatmapProvider); 32510 this.closeParentModal(); 32511 } 32512 }); 32513 this.loading = false; 32514 } 32515 closeParentModal() { 32516 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 32517 parentModal?.hide(); 32518 } 32519 goToSaml() { 32520 const samlUrl = getSamlUrl(this); 32521 if (samlUrl) document.location = samlUrl; 32522 } 32523 updateDisabledState() { 32524 const selectedQuota = this.filterPublisher?.get()?.selectedQuota; 32525 const isDisabled = !this.price_available || selectedQuota && selectedQuota.remaining_places_nb === 0; 32526 this.isDisabled = isSeatMode(this.buyMode) && this.appType === "counter" ? false : isDisabled; 32527 this.requestUpdate(); 32528 } 32529 willUpdate(properties) { 32530 if (properties.has("item_id")) { 32531 this.filterPublisher?.offInternalMutation(this.onFilterMutation); 32532 this.filterPublisher = PublisherManager.get("product/" + this.item_id + "/PricesFilter"); 32533 this.filterPublisher?.onInternalMutation(this.onFilterMutation); 32534 } 32535 if (properties.has("price_available") || properties.has("item_id") || properties.has("disabled")) { 32536 this.updateDisabledState(); 32537 } 32538 super.willUpdate(properties); 32539 } 32540 disconnectedCallback() { 32541 this.filterPublisher?.offInternalMutation(this.onFilterMutation); 32542 super.disconnectedCallback(); 32543 } 32544 preventContextMenu(e2) { 32545 e2.preventDefault(); 32546 } 32547 addSpecificQuantity() { 32548 const quantity = dp(this.quantityFormDataProvider).quantity.get(); 32549 this.addToCart(Number(quantity)); 32550 dp(this.quantityFormDataProvider).quantity.set(this.price_min_places || 1); 32551 this.popElement.hide(); 32552 } 32553 connectedCallback() { 32554 super.connectedCallback(); 32555 if (!subscriptionButtonType$1) { 32556 const hostElement = this.shadowRoot?.host; 32557 subscriptionButtonType$1 = primaryIsEqualToBaseContent(hostElement) ? "info" : "primary"; 32558 } 32559 this._subTypeButton = subscriptionButtonType$1; 32560 } 32561 render() { 32562 if (!this.props) return; 32563 if (!this.counter && this.isGuichet) { 32564 return; 32565 } 32566 const defaultType = this.buttonType || "neutral"; 32567 const hasInfo = this.help_text !== ""; 32568 const subType = this._subTypeButton ?? "primary"; 32569 let type = this.need_subscription || this.need_partner_subscription ? subType : defaultType; 32570 if (this.is_triggering_promo || this.price_is_promo) { 32571 type = "success"; 32572 } 32573 let pressClass; 32574 if (this.pressProgress > 0 && this.pressProgress < 1) { 32575 pressClass = "scale-[.97]"; 32576 } else if (this.pressProgress === 1) { 32577 pressClass = "scale-[.90]"; 32578 } 32579 return b$1` 32580 <sonic-pop 32581 @hide=${() => this.displayQuantitySelector = false} 32582 class="flex relative w-full h-full" 32583 placement="top" 32584 manual 32585 > 32586 <sonic-button 32587 type="${type}" 32588 rounded="sm" 32589 size="${this.size}" 32590 align="left" 32591 alignItems="stretch" 32592 @mousedown="${this.handlePointerDown}" 32593 @mouseup="${this.handlePointerUp}" 32594 @mouseleave="${this.handlePointerLeave}" 32595 @touchstart="${this.handlePointerDown}" 32596 @touchend="${this.handlePointerUp}" 32597 @touchcancel="${this.handlePointerLeave}" 32598 @contextmenu="${this.preventContextMenu}" 32599 @keydown=${(e2) => { 32600 if (e2.key === "Enter" || e2.key === " ") { 32601 e2.preventDefault(); 32602 this.addToCart(1); 32603 } 32604 }} 32605 ?disabled=${this.loading || this.isDisabled} 32606 class="group ${pressClass} transition-all duration-200 " 32607 > 32608 ${this.pressProgress > 0 ? b$1`<div
32609 style="transform:scaleX(${this.pressProgress})" 32610 class="absolute left-1 bottom-1 right-1 h-[2px] rounded bg-neutral-0 wz-2" 32611 ></div>` : A$1} 32612 <div class="h-full flex flex-col"> 32613 ${!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 "> 32614 ${this.additional_products.map( 32615 (product) => b$1`<span class="inline-block"> + ${product.name} </span> ` 32616 )} 32617 </div>` : A$1}` : A$1} 32618 32619 <span 32620 class="${!this.noPriceName ? "pt-2" : ""} mt-auto leading-none font-bold flex gap-[.4em] items-center " 32621 > 32622 <sonic-if 32623 .condition=${(this.need_partner_subscription || this.need_subscription) && !(this.is_triggering_promo || this.price_is_promo)} 32624 > 32625 <sonic-icon 32626 library="custom" 32627 prefix="solid" 32628 name="id-card" 32629 size="xl" 32630 class="mr-[.25em] inline-block transition group-hover:scale-110 group-focus-within:scale-110" 32631 ></sonic-icon> 32632 </sonic-if> 32633 <sonic-if .condition=${this.is_free_price}> 32634 <sonic-icon 32635 size="lg" 32636 library="custom" 32637 name="hand-holding-heart" 32638 class="transition group-hover:scale-110 group-focus-within:scale-110" 32639 ></sonic-icon> 32640 </sonic-if> 32641 <sonic-if .condition=${this.is_triggering_promo}> 32642 <sonic-icon 32643 size="sm" 32644 library="custom" 32645 name="stars" 32646 class="mr-[.25em] animate-heartbeat inline-block" 32647 ></sonic-icon> 32648 </sonic-if> 32649 32650 <sonic-if .condition=${this.price_is_promo}> 32651 <sonic-icon 32652 size="sm" 32653 library="custom" 32654 name="gift" 32655 class="mr-[.25em] animate-heartbeat inline-block" 32656 ></sonic-icon> 32657 </sonic-if> 32658 32659 <sonic-if .condition=${this.saml_auth_required}> 32660 <sonic-icon size="sm" library="custom" prefix="solid" name="user" class="mr-[.25em]"></sonic-icon> 32661 </sonic-if> 32662 32663 <sonic-if 32664 .condition=${!this.saml_auth_required && !this.price_is_promo && !this.is_triggering_promo && !this.need_partner_subscription && !this.need_subscription && !this.is_free_price} 32665 } 32666 > 32667 <sonic-icon 32668 size="lg" 32669 library="custom" 32670 name="circle-plus" 32671 prefix="light" 32672 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 " 32673 ></sonic-icon> 32674 </sonic-if> 32675 <span class="leading-none inline-block"> 32676 ${this.is_free_price ? priceRange({ 32677 min: this.free_price.min || 0, 32678 max: this.free_price.max, 32679 is_free_price: this.is_free_price 32680 }) : formatAmount(this.amount_display)} 32681 </span> 32682 </span> 32683 <sonic-if .condition=${hasInfo}> 32684 <sonic-pop 32685 @mousedown=${(e2) => e2.stopPropagation()} 32686 @touchstart=${(e2) => e2.stopPropagation()} 32687 @click=${(e2) => e2.stopPropagation()} 32688 @touchend=${(e2) => e2.stopPropagation()} 32689 @touchcancel=${(e2) => e2.stopPropagation()} 32690 @mouseup=${(e2) => e2.stopPropagation()} 32691 @mouseleave=${(e2) => e2.stopPropagation()} 32692 placement="top" 32693 > 32694 <div class="p-1 transform translate-z-0 cursor-pointer hover:scale-110"> 32695 <sonic-icon library="custom" name="circle-info" prefix="solid" size="md"></sonic-icon> 32696 </div> 32697 <div 32698 slot="content" 32699 class="p-3 px-2 shadow-md text-xs text-content min-w-[25ch] max-w-[40ch] rounded-md" 32700 placement="top" 32701 > 32702 ${o$6(this.help_text)} 32703 </div> 32704 </sonic-pop> 32705 </sonic-if> 32706 </div> 32707 </sonic-button> 32708 32709 <div 32710 slot="content" 32711 formDataProvider="${this.quantityFormDataProvider}" 32712 dataProvider="${this.quantityFormDataProvider}" 32713 class="p-3 w-32 " 32714 > 32715 <div class="not-sr-only text-base mb-1">${t("quantity")}</div> 32716 <div class="flex gap-1 items-end"> 32717 <sonic-input 32718 @keydown=${(e2) => {
32719 if (e2.key === "Enter") { 32720 e2.preventDefault(); 32721 this.addSpecificQuantity(); 32722 } 32723 if (e2.key === "Escape") { 32724 this.popElement.hide(); 32725 } 32726 }} 32727 name="quantity" 32728 data-aria-label="${t("quantity")}" 32729 type="number" 32730 value="${this.price_min_places || 1}" 32731 min="1" 32732 ></sonic-input> 32733 <sonic-button type="primary" shape="circle" icon @click=${this.addSpecificQuantity} class="shrink-0" 32734 ><sonic-icon library="custom" name="basket-shopping" prefix="light"></sonic-icon 32735 ></sonic-button> 32736 </div> 32737 </div> 32738 </sonic-pop> 32739 `; 32740 } 32741 }; 32742 PriceButton.styles = [tailwind, styles]; 32743 __decorateClass$2$([ 32744 n$5({ type: Boolean, reflect: true }) 32745 ], PriceButton.prototype, "disabled", 2); 32746 __decorateClass$2$([ 32747 n$5({ type: Boolean }) 32748 ], PriceButton.prototype, "saml_auth_required", 2); 32749 __decorateClass$2$([ 32750 n$5({ type: Number }) 32751 ], PriceButton.prototype, "amount", 2); 32752 __decorateClass$2$([ 32753 n$5({ type: Number }) 32754 ], PriceButton.prototype, "amount_display", 2); 32755 __decorateClass$2$([ 32756 n$5({ type: Boolean }) 32757 ], PriceButton.prototype, "counter", 2); 32758 __decorateClass$2$([ 32759 n$5({ type: Boolean }) 32760 ], PriceButton.prototype, "price_online", 2); 32761 __decorateClass$2$([ 32762 n$5({ type: Number }) 32763 ], PriceButton.prototype, "item_id", 2); 32764 __decorateClass$2$([ 32765 n$5({ type: String }) 32766 ], PriceButton.prototype, "title", 2); 32767 __decorateClass$2$([ 32768 n$5({ type: Boolean }) 32769 ], PriceButton.prototype, "need_subscription", 2); 32770 __decorateClass$2$([ 32771 n$5({ type: Boolean }) 32772 ], PriceButton.prototype, "need_partner_subscription", 2); 32773 __decorateClass$2$([ 32774 n$5({ type: Array }) 32775 ], PriceButton.prototype, "additional_products", 2); 32776 __decorateClass$2$([ 32777 n$5({ type: String }) 32778 ], PriceButton.prototype, "buttonType", 2); 32779 __decorateClass$2$([ 32780 n$5({ type: String }) 32781 ], PriceButton.prototype, "type", 2); 32782 __decorateClass$2$([ 32783 n$5({ type: Boolean }) 32784 ], PriceButton.prototype, "noPriceName", 2); 32785 __decorateClass$2$([ 32786 n$5({ type: Boolean }) 32787 ], PriceButton.prototype, "price_available", 2); 32788 __decorateClass$2$([ 32789 n$5({ type: Boolean }) 32790 ], PriceButton.prototype, "is_triggering_promo", 2); 32791 __decorateClass$2$([ 32792 n$5({ type: Boolean }) 32793 ], PriceButton.prototype, "price_is_promo", 2); 32794 __decorateClass$2$([ 32795 n$5({ type: String }) 32796 ], PriceButton.prototype, "help_text", 2); 32797 __decorateClass$2$([ 32798 n$5({ type: String }) 32799 ], PriceButton.prototype, "size", 2); 32800 __decorateClass$2$([ 32801 n$5({ type: Boolean }) 32802 ], PriceButton.prototype, "loading", 2); 32803 __decorateClass$2$([ 32804 n$5({ type: Object }) 32805 ], PriceButton.prototype, "settings", 2); 32806 __decorateClass$2$([ 32807 n$5({ type: Number }) 32808 ], PriceButton.prototype, "price_min_places", 2); 32809 __decorateClass$2$([ 32810 n$5({ type: Boolean }) 32811 ], PriceButton.prototype, "is_free_price", 2); 32812 __decorateClass$2$([ 32813 n$5({ type: Object }) 32814 ], PriceButton.prototype, "free_price", 2); 32815 __decorateClass$2$([ 32816 e$7("sonic-pop") 32817 ], PriceButton.prototype, "popElement", 2); 32818 __decorateClass$2$([ 32819 r$5() 32820 ], PriceButton.prototype, "displayQuantitySelector", 2); 32821 __decorateClass$2$([ 32822 c({ context: disableButtonMultiSelectContext, subscribe: true }), 32823 n$5({ type: Boolean }) 32824 ], PriceButton.prototype, "disableButtonMultiSelect", 2); 32825 __decorateClass$2$([ 32826 c({ context: seatsContext, subscribe: true }), 32827 n$5({ type: Array }) 32828 ], PriceButton.prototype, "seatsContext", 2); 32829 __decorateClass$2$([ 32830 c({ context: accessParamsContext, subscribe: true }), 32831 n$5({ type: Object }) 32832 ], PriceButton.prototype, "accessParams", 2); 32833 __decorateClass$2$([ 32834 c({ context: buyContext, subscribe: true }), 32835 n$5({ type: Object }) 32836 ], PriceButton.prototype, "priceContext", 2); 32837 __decorateClass$2$([ 32838 c({ context: buyModeContext, subscribe: true }), 32839 n$5({ type: String }) 32840 ], PriceButton.prototype, "buyMode", 2); 32841 __decorateClass$2$([ 32842 r$5() 32843 ], PriceButton.prototype, "longClickTimer", 2); 32844 __decorateClass$2$([ 32845 n$5({ type: Number }) 32846 ], PriceButton.prototype, "pressProgress", 2); 32847 __decorateClass$2$([ 32848 ancestorAttribute("seatmapProvider") 32849 ], PriceButton.prototype, "seatmapProvider", 2); 32850 __decorateClass$2$([ 32851 c({ context: appType, subscribe: true }), 32852 n$5({ type: String }) 32853 ], PriceButton.prototype, "appType", 2); 32854 __decorateClass$2$([ 32855 r$5() 32856 ], PriceButton.prototype, "isDisabled", 2); 32857 __decorateClass$2$([ 32858 r$5() 32859 ], PriceButton.prototype, "_subTypeButton", 2); 32860 PriceButton = __decorateClass$2$([ 32861 t$3("sonic-price-button") 32862 ], PriceButton); 32863 var __defProp$2X = Object.defineProperty; 32864 var __getOwnPropDesc$2_ = Object.getOwnPropertyDescriptor; 32865 var __decorateClass$2_ = (decorators, target, key, kind) => { 32866 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2_(target, key) : target; 32867 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 32868 if (decorator = decorators[i2]) 32869 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 32870 if (kind && result) __defProp$2X(target, key, result); 32871 return result; 32872 }; 32873 let subscriptionButtonType;
32874 let PriceSelect = class extends EventContext(Subscriber$1(i$6)) { 32875 constructor() { 32876 super(...arguments); 32877 this.disabled = false; 32878 this.saml_auth_required = false; 32879 this.amount = 0; 32880 this.amount_display = 0; 32881 this.item_id = ""; 32882 this.need_subscription = false; 32883 this.need_partner_subscription = false; 32884 this.additional_products = []; 32885 this.id = ""; 32886 this.type = ""; 32887 this.noPriceName = false; 32888 this.price_available = false; 32889 this.is_triggering_promo = false; 32890 this.price_is_promo = false; 32891 this.help_text = ""; 32892 this.price_min_places = 0; 32893 this.price_max_places = 0; 32894 this.price_places_nb = 0; 32895 this.price_max = 10; 32896 this.is_free_price = false; 32897 this.free_price = {}; 32898 this.size = "lg"; 32899 this.wording_LIB_connexion_required = ""; 32900 this.onFilterMutation = () => { 32901 this.updateDisabledState(); 32902 this.requestUpdate(); 32903 }; 32904 this.isSoldOut = false; 32905 } 32906 updateDisabledState() { 32907 const selectedQuota = this.filterPublisher?.get()?.selectedQuota; 32908 this.isSoldOut = !this.price_available || selectedQuota && selectedQuota.remaining_places_nb === 0; 32909 this.requestUpdate(); 32910 } 32911 connectedCallback() { 32912 super.connectedCallback(); 32913 if (!subscriptionButtonType) { 32914 const hostElement = this.shadowRoot?.host; 32915 subscriptionButtonType = primaryIsEqualToBaseContent(hostElement) ? "info" : "primary"; 32916 } 32917 this._subTypeButton = subscriptionButtonType; 32918 } 32919 willUpdate(properties) { 32920 if (properties.has("item_id")) { 32921 this.filterPublisher?.offInternalMutation(this.onFilterMutation); 32922 this.filterPublisher = PublisherManager.get("product/" + this.item_id + "/PricesFilter"); 32923 this.filterPublisher?.onInternalMutation(this.onFilterMutation); 32924 this.requestUpdate(); 32925 } 32926 if (properties.has("price_min_places") && this.price_min_places > this.price_max) { 32927 this.price_max = this.price_min_places + 10; 32928 } 32929 if ((properties.has("price_max_places") || properties.has("price_places_nb")) && (this.price_max_places || this.price_places_nb)) { 32930 if (this.price_max_places && this.price_places_nb) { 32931 this.price_max = Math.min(this.price_max_places, this.price_places_nb, this.price_max); 32932 } else { 32933 this.price_max = this.price_max_places || this.price_places_nb; 32934 } 32935 } 32936 if (properties.has("price_available") || properties.has("item_id")) { 32937 this.updateDisabledState(); 32938 } 32939 super.willUpdate(properties); 32940 } 32941 getOptions() { 32942 const optionsValues = [{ value: "", wording: 0 }]; 32943 const max = this.price_max > 50 ? 50 : this.price_max; 32944 for (let i2 = this.price_min_places; i2 <= max; i2++) { 32945 optionsValues.push({ value: i2.toString(), wording: i2 }); 32946 } 32947 return optionsValues; 32948 } 32949 firstUpdated() { 32950 if (!subscriptionButtonType) { 32951 const hostElement = this.shadowRoot?.host; 32952 subscriptionButtonType = primaryIsEqualToBaseContent(hostElement) ? "info" : "primary"; 32953 } 32954 } 32955 render() { 32956 if (!this.props) return; 32957 let ariaLabel = this.title + "Choisissez le nombre de places"; 32958 if (this.isSoldOut) { 32959 ariaLabel = this.title + " â épuisé"; 32960 } 32961 const isSubscription = this.need_partner_subscription || this.need_subscription; 32962 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} 32963 ${this.is_triggering_promo ? b$1`<sonic-icon 32964 size="sm" 32965 library="custom" 32966 prefix="solid" 32967 name="${isSubscription ? "star" : "stars"}" 32968 class="mr-[.25em] animate-heartbeat inline-block ${isSubscription ? " -ml-[.4em] text-[.75em] relative -top-[.1em]" : ""}" 32969 ></sonic-icon>` : A$1} 32970 ${this.price_is_promo ? b$1`<sonic-icon 32971 size="sm" 32972 library="custom" 32973 prefix="solid" 32974 name="gift" 32975 class="mr-[.25em] animate-heartbeat inline-block ${isSubscription ? " -ml-[.4em] text-[.75em] relative -top-[.1em]" : ""}" 32976 ></sonic-icon>` : A$1} 32977 ${this.is_free_price ? b$1`<sonic-icon library="custom" name="hand-holding-heart" size="lg"></sonic-icon>
32977` : b$1`${formatAmount(this.amount_display)}`}`; 32978 const subType = this._subTypeButton ?? "primary"; 32979 let status = this.need_subscription || this.need_partner_subscription ? subType : "default"; 32980 if (this.is_triggering_promo || this.price_is_promo) { 32981 status = "success"; 32982 } 32983 return b$1` 32984 <sonic-group size="${this.size}" class="w-full"> 32985 <div slot="label" class="text-left"> 32986 <sonic-if .condition=${!this.noPriceName}> 32987 <div class="flex items-end gap-[.25em] w-full"> 32988 <div class="min-w-0"> 32989 <div 32990 class="leading-[1.1] lg:leading-[1.1] min-w-0 break-words ${this.price_is_promo ? "font-bold" : ""}" 32991 > 32992 ${this.title} 32993 </div> 32994 ${this.additional_products.length > 0 ? b$1`<div class="text-[.85em] leading-[1.1] flex gap-[.25em] flex-wrap "> 32995 ${this.additional_products.map( 32996 (product) => b$1`<span class="inline-block">+ ${product.name} </span> ` 32997 )} 32998 </div>` : A$1} 32999 ${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]"> 33000 ⢠33001 ${priceRange({ 33002 min: this.free_price?.min || 0, 33003 max: this.free_price?.max, 33004 is_free_price: this.is_free_price 33005 })} 33006 </div>` : A$1} 33007 </div> 33008 ${this.help_text ? b$1`<div class="ml-auto"> 33009 <sonic-if .condition=${this.help_text !== ""}> 33010 <sonic-pop @click=${(e2) => e2.stopPropagation()} placement="top" class="inline-flex"> 33011 <div class=" cursor-pointer inline-flex"> 33012 <sonic-icon library="custom" name="circle-info" size="md"></sonic-icon> 33013 </div> 33014 <div 33015 slot="content" 33016 class="p-3 px-2 text-xs text-content min-w-[30ch] max-w-[40ch] rounded-md" 33017 placement="top" 33018 > 33019 ${o$6(this.help_text)} 33020 </div> 33021 </sonic-pop> 33022 </sonic-if> 33023 </div> ` : A$1} 33024 </div> 33025 </sonic-if> 33026 </div> 33027 33028 ${this.saml_auth_required ? b$1` 33029 <sonic-button href=${getSamlUrl(this)} size="${this.size}" variant="default" type="primary" noAutoFill> 33030 <div class="flex items-center justify-center gap-[.75em] w-full"> 33031 <div class="flex">${amountMarkup}</div> 33032 <div class="border-l h-[1em]"></div> 33033 <sonic-tooltip label="${this.wording_LIB_connexion_required}"> 33034 <div class="flex items-end"> 33035 <sonic-icon library="custom" name="user"></sonic-icon> 33036 <sonic-icon library="custom" name="arrow-right" class="-ml-[.5em]" size="xs"></sonic-icon> 33037 </div> 33038 </sonic-tooltip> 33039 </div> 33040 </sonic-button> 33041 ` : b$1` 33042 ${!this.isSoldOut ? b$1`<sonic-select 33043 rounded="sm" 33044 size="${this.size}" 33045 ?disabled=${this.disabled} 33046 data-aria-label=${o$4(ariaLabel)} 33047 align="center" 33048 name="${this.id}" 33049 status=${status} 33050 > 33051 <span class="min-w-[min(7.8ch,_4.5em)] text-center font-bold" slot="prefix" status="success"> 33052 ${amountMarkup} 33053 </span> 33054 ${this.disabled ? b$1`<option selected>â</option>` : c$1( 33055 this.getOptions(), 33056 (option) => b$1`<option value="${option.value}">${option.wording}</option>` 33057 )} 33058 </sonic-select>` : b$1`<sonic-tooltip 33059 focusable 33060 placement="bottom" 33061 label="${t("initial_amount")}
33062 ${formatAmount(this.amount_display)}" 33063 class="block w-full font-bold" 33064 > 33065 <sonic-input 33066 align="center" 33067 shape="block" 33068 size="${this.size}" 33069 value="${t("sold_out")}" 33070 class="pointer-events-none" 33071 readonly 33072 tabindex="-1" 33073 ></sonic-input 33074 ></sonic-tooltip>`} 33075 `} 33076 </sonic-group> 33077 `; 33078 } 33079 }; 33080 PriceSelect.styles = [tailwind]; 33081 __decorateClass$2_([ 33082 n$5({ type: Boolean, reflect: true }) 33083 ], PriceSelect.prototype, "disabled", 2); 33084 __decorateClass$2_([ 33085 n$5({ type: Boolean }) 33086 ], PriceSelect.prototype, "saml_auth_required", 2); 33087 __decorateClass$2_([ 33088 n$5({ type: Number }) 33089 ], PriceSelect.prototype, "amount", 2); 33090 __decorateClass$2_([ 33091 n$5({ type: Number }) 33092 ], PriceSelect.prototype, "amount_display", 2); 33093 __decorateClass$2_([ 33094 n$5({ type: Number }) 33095 ], PriceSelect.prototype, "item_id", 2); 33096 __decorateClass$2_([ 33097 n$5({ type: Boolean }) 33098 ], PriceSelect.prototype, "need_subscription", 2); 33099 __decorateClass$2_([ 33100 n$5({ type: Boolean }) 33101 ], PriceSelect.prototype, "need_partner_subscription", 2); 33102 __decorateClass$2_([ 33103 n$5({ type: Array }) 33104 ], PriceSelect.prototype, "additional_products", 2); 33105 __decorateClass$2_([ 33106 n$5({ type: String }) 33107 ], PriceSelect.prototype, "id", 2); 33108 __decorateClass$2_([ 33109 n$5({ type: String }) 33110 ], PriceSelect.prototype, "type", 2); 33111 __decorateClass$2_([ 33112 n$5({ type: Boolean }) 33113 ], PriceSelect.prototype, "noPriceName", 2); 33114 __decorateClass$2_([ 33115 n$5({ type: Boolean }) 33116 ], PriceSelect.prototype, "price_available", 2); 33117 __decorateClass$2_([ 33118 n$5({ type: Boolean }) 33119 ], PriceSelect.prototype, "is_triggering_promo", 2); 33120 __decorateClass$2_([ 33121 n$5({ type: Boolean }) 33122 ], PriceSelect.prototype, "price_is_promo", 2); 33123 __decorateClass$2_([ 33124 n$5({ type: String }) 33125 ], PriceSelect.prototype, "help_text", 2); 33126 __decorateClass$2_([ 33127 n$5({ type: Number }) 33128 ], PriceSelect.prototype, "price_min_places", 2); 33129 __decorateClass$2_([ 33130 n$5({ type: Number }) 33131 ], PriceSelect.prototype, "price_max_places", 2); 33132 __decorateClass$2_([ 33133 n$5({ type: Number }) 33134 ], PriceSelect.prototype, "price_places_nb", 2); 33135 __decorateClass$2_([ 33136 n$5({ type: Number }) 33137 ], PriceSelect.prototype, "price_max", 2); 33138 __decorateClass$2_([ 33139 n$5({ type: Boolean }) 33140 ], PriceSelect.prototype, "is_free_price", 2); 33141 __decorateClass$2_([ 33142 n$5({ type: Object }) 33143 ], PriceSelect.prototype, "free_price", 2); 33144 __decorateClass$2_([ 33145 n$5({ type: String }) 33146 ], PriceSelect.prototype, "size", 2); 33147 __decorateClass$2_([ 33148 n$5({ type: String }) 33149 ], PriceSelect.prototype, "wording_LIB_connexion_required", 2); 33150 __decorateClass$2_([ 33151 r$5() 33152 ], PriceSelect.prototype, "isSoldOut", 2); 33153 __decorateClass$2_([ 33154 r$5() 33155 ], PriceSelect.prototype, "_subTypeButton", 2); 33156 PriceSelect = __decorateClass$2_([ 33157 t$3("sonic-price-select") 33158 ], PriceSelect); 33159 const i = e$5(class extends i$4 { 33160 constructor() { 33161 super(...arguments), this.key = A$1; 33162 } 33163 render(r2, t2) { 33164 return this.key = r2, t2; 33165 } 33166 update(r2, [t2, e2]) { 33167 return t2 !== this.key && (p(r2), this.key = t2), e2; 33168 } 33169 }); 33170 function computeFilteredPrices(prices, filter) { 33171 if (!prices?.length) return []; 33172 let result = prices.slice(); 33173 if (!filter) return result; 33174 let filterPrices = filter.showAll !== true; 33175 const selectedQuota = filter.selectedQuota; 33176 if (!selectedQuota || !selectedQuota.id) filterPrices = false; 33177 if (!filterPrices) return result; 33178 const quotaPrices = selectedQuota?.prices?.filter((price) => price.visible) || []; 33179 return result.filter((price) => { 33180 const id = price.id; 33181 if (!quotaPrices) return true; 33182 return quotaPrices.some((quotaPrice) => quotaPrice.price_id == id); 33183 }); 33184 } 33185 var __defProp$2W = Object.defineProperty; 33186 var __getOwnPropDesc$2Z = Object.getOwnPropertyDescriptor; 33187 var __decorateClass$2Z = (decorators, target, key, kind) => { 33188 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2Z(target, key) : target; 33189 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33190 if (decorator = decorators[i2]) 33191 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33192 if (kind && result) __defProp$2W(target, key, result); 33193 return result; 33194 };
33195 let PricesForm = class extends EventContext(Subscriber$1(i$6)) { 33196 constructor() { 33197 super(...arguments); 33198 this.buttonType = ""; 33199 this.formType = "select"; 33200 this.type = EntityType.Event; 33201 this.item_id = ""; 33202 this.prices = []; 33203 this.noPriceName = false; 33204 this.loading = false; 33205 this.size = "lg"; 33206 this.onFilterMutation = () => { 33207 this.requestUpdate(); 33208 }; 33209 this.filteredPrices = []; 33210 } 33211 willUpdate(properties) { 33212 if (properties.has("item_id")) { 33213 this.filterPublisher?.offInternalMutation(this.onFilterMutation); 33214 this.filterPublisher = PublisherManager.get("product/" + this.item_id + "/PricesFilter"); 33215 this.filterPublisher?.onInternalMutation(this.onFilterMutation); 33216 } 33217 this.filteredPrices = this.filterPublisher ? computeFilteredPrices(this.prices, this.filterPublisher.get()) : []; 33218 super.willUpdate(properties); 33219 } 33220 disconnectedCallback() { 33221 this.filterPublisher?.offInternalMutation(this.onFilterMutation); 33222 super.disconnectedCallback(); 33223 } 33224 showAll() { 33225 if (!this.filterPublisher) return; 33226 this.filterPublisher.showAll = true; 33227 this.requestUpdate(); 33228 } 33229 getPriceItem(price) { 33230 switch (this.formType) { 33231 case "buttons": 33232 return i( 33233 price.id, 33234 b$1` 33235 <sonic-price-button 33236 type=${this.type} 33237 size=${this.size} 33238 buttonType=${this.buttonType} 33239 dataProvider=${this.dataProvider + "/price/" + price.id} 33240 .props=${price} 33241 item_id="${this.item_id}" 33242 ?noPriceName=${this.noPriceName} 33243 ></sonic-price-button> 33244 ` 33245 ); 33246 case "select": 33247 return i( 33248 price.id, 33249 b$1` 33250 <sonic-price-select 33251 type=${this.type} 33252 buttonType=${this.buttonType} 33253 dataProvider=${this.dataProvider + "/price/" + price.id} 33254 .props=${price} 33255 class=${price.price_is_promo ? "order-first" : ""} 33256 size=${this.size} 33257 item_id="${this.item_id}" 33258 ?noPriceName=${this.noPriceName} 33259 ></sonic-price-select> 33260 ` 33261 ); 33262 } 33263 } 33264 // RENDER 33265 render() { 33266 if (this.prices?.length === 0) return A$1; 33267 const prices = this.filteredPrices; 33268 const showShowAllButton = this.isGuichet && this.prices?.length != prices?.length; 33269 return b$1` 33270 <div class="@container"> 33271 <div class="sonic-prices-list ${"prices-list-" + this.formType}"> 33272 ${c$1( 33273 prices, 33274 (price) => price.id, 33275 (price) => this.getPriceItem(price) 33276 )} 33277 </div> 33278 </div> 33279 33280 <sonic-if .condition=${showShowAllButton}> 33281 <sonic-button @click=${this.showAll} variant="ghost" type="primary" size="sm" class="btn-show-all" noAutoFill> 33282 <sonic-icon 33283 library="custom" 33284 slot="prefix" 33285 @click=${this.showAll} 33286 class="show-all-icon" 33287 name="plus" 33288 ></sonic-icon> 33289 Tous les tarifs 33290 </sonic-button> 33291 </sonic-if> 33292 `; 33293 } 33294 }; 33295 PricesForm.styles = [ 33296 fontSize, 33297 tailwind, 33298 i$9` 33299 .prices-list-buttons { 33300 --_prices-item-mw: 8.5em; 33301 display: grid; 33302 grid-gap: 0.25em; 33303 } 33304 33305 .prices-list-select { 33306 --_prices-item-mw: 9.2em; 33307 display: grid; 33308 grid-gap: 1.25rem 0.7rem; 33309 /*margin-bottom: 1rem;*/ 33310 align-items: flex-end; 33311 } 33312 33313 .sonic-prices-list { 33314 grid-template-columns: repeat(auto-fill, minmax(min(var(--_prices-item-mw), 100%), 1fr)); 33315 } 33316 33317 :host([align="center"]) .sonic-prices-list { 33318 display: flex !important; 33319 justify-content: center; 33320 flex-wrap: wrap; 33321 grid-gap: 1.25rem; 33322 } 33323 33324 :host([align="center"]) sonic-price-select, 33325 :host([align="center"]) sonic-price-button { 33326 min-width: 12em; 33327 } 33328 33329 .btn-show-all { 33330 margin-top: 0.5em; 33331 } 33332 33333 :host([size="sm"]) .prices-list-buttons { 33334 --_prices-item-mw: 12em; 33335 } 33336 33337 @container (min-width: 60rem) { 33338 .prices-list-select { 33339 --_prices-item-mw: 9.2em; 33340 } 33341 } 33342 33343 @container (min-width: 80rem) { 33344 .prices-list-select { 33345 --_prices-item-mw: 10em; 33346 } 33347 } 33348 ` 33349 ]; 33350 __decorateClass$2Z([ 33351 n$5({ type: String }) 33352 ], PricesForm.prototype, "buttonType", 2); 33353 __decorateClass$2Z([ 33354 n$5({ type: String }) 33355 ], PricesForm.prototype, "formType", 2); 33356 __decorateClass$2Z([ 33357 n$5({ type: String }) 33358 ], PricesForm.prototype, "type", 2); 33359 __decorateClass$2Z([ 33360 n$5({ type: String }) 33361 ], PricesForm.prototype, "item_id", 2); 33362 __decorateClass$2Z([ 33363 n$5({ type: Array }) 33364 ], PricesForm.prototype, "prices", 2); 33365 __decorateClass$2Z([ 33366 n$5({ type: Boolean }) 33367 ], PricesForm.prototype, "noPriceName", 2); 33368 __decorateClass$2Z([ 33369 n$5({ type: Boolean }) 33370 ], PricesForm.prototype, "loading", 2); 33371 __decorateClass$2Z([ 33372 n$5({ type: String }) 33373 ], PricesForm.prototype, "size", 2); 33374 __decorateClass$2Z([ 33375 c({ context: alignContext, subscribe: true }), 33376 n$5({ type: String, reflect: true }) 33377 ], PricesForm.prototype, "align", 2);
33378 PricesForm = __decorateClass$2Z([ 33379 t$3("sonic-prices-form") 33380 ], PricesForm); 33381 var __defProp$2V = Object.defineProperty; 33382 var __getOwnPropDesc$2Y = Object.getOwnPropertyDescriptor; 33383 var __decorateClass$2Y = (decorators, target, key, kind) => { 33384 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2Y(target, key) : target; 33385 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33386 if (decorator = decorators[i2]) 33387 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33388 if (kind && result) __defProp$2V(target, key, result); 33389 return result; 33390 }; 33391 let PriceInSitu = class extends Subscriber$1(i$6) { 33392 constructor() { 33393 super(...arguments); 33394 this.prices_in_situ = []; 33395 this.inline = false; 33396 } 33397 render() { 33398 if (!this.prices_in_situ) return A$1; 33399 return b$1`<div class="${this.inline ? "contents" : "mt-3"}"> 33400 ${this.prices_in_situ.map( 33401 (price) => !this.category?.id || price.place_category?.id == this.category?.id ? b$1`<div class="mr-3 inline-block"> 33402 ${price.title} : ${price.amount ? formatAmount(price.amount) : t("free")} 33403 </div>` : A$1 33404 )} 33405 </div> `; 33406 } 33407 }; 33408 PriceInSitu.styles = [tailwind]; 33409 __decorateClass$2Y([ 33410 n$5() 33411 ], PriceInSitu.prototype, "prices_in_situ", 2); 33412 __decorateClass$2Y([ 33413 n$5() 33414 ], PriceInSitu.prototype, "category", 2); 33415 __decorateClass$2Y([ 33416 n$5({ type: Boolean }) 33417 ], PriceInSitu.prototype, "inline", 2); 33418 PriceInSitu = __decorateClass$2Y([ 33419 t$3("sonic-price-in-situ") 33420 ], PriceInSitu); 33421 function getFilteredCategories(options) { 33422 const { prices, selectedQuota } = options; 33423 if (!prices?.length) return []; 33424 let filteredPrices = prices; 33425 if (selectedQuota?.id && selectedQuota.prices?.length && true) { 33426 const quotaPriceIds = selectedQuota.prices.filter((p2) => p2.visible).map((p2) => p2.price_id); 33427 filteredPrices = prices.filter((price) => quotaPriceIds.includes(Number(price.id))); 33428 } 33429 const categoriesMap = /* @__PURE__ */ new Map(); 33430 filteredPrices.forEach((price) => { 33431 const categoryId = Number(price.place_category?.id) || 0; 33432 const categoryTitle = price.place_category?.title || ""; 33433 if (!categoriesMap.has(categoryId)) { 33434 categoriesMap.set(categoryId, { 33435 id: categoryId, 33436 title: categoryTitle, 33437 prices: [] 33438 }); 33439 } 33440 categoriesMap.get(categoryId).prices.push(price); 33441 }); 33442 return Array.from(categoriesMap.values()).sort((a2, b2) => a2.id - b2.id); 33443 } 33444 var __defProp$2U = Object.defineProperty; 33445 var __getOwnPropDesc$2X = Object.getOwnPropertyDescriptor; 33446 var __decorateClass$2X = (decorators, target, key, kind) => { 33447 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2X(target, key) : target; 33448 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33449 if (decorator = decorators[i2]) 33450 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33451 if (kind && result) __defProp$2U(target, key, result); 33452 return result; 33453 }; 33454 const tagName$1O = "sonic-price-list-info"; 33455 let SonicPricesInfos = class extends i$6 { 33456 constructor() { 33457 super(...arguments); 33458 this.displaySoldOut = false; 33459 this.prices = []; 33460 this._renderableCategories = []; 33461 } 33462 willUpdate(properties) { 33463 if (properties.has("selectedQuota") || properties.has("prices")) { 33464 this._renderableCategories = getFilteredCategories({ 33465 prices: this.prices, 33466 selectedQuota: this.selectedQuota 33467 }); 33468 } 33469 super.willUpdate(properties); 33470 } 33471 render() { 33472 const justifyClass = flexJustify(this.align); 33473 if (!this._renderableCategories.some((c2) => c2.prices.length)) return A$1; 33474 return b$1`${this.displaySoldOut ? b$1` <span class="font-bold uppercase mb-2 block">${t("prices_sold_out")}</span> ` : A$1} 33475 <div class="grid grid-cols-1 gap-y-2"> 33476 ${c$1( 33477 this._renderableCategories, 33478 (category) => category.id, 33479 (category) => { 33480 return b$1` 33481 <div> 33482 ${category.title && category.id !== 0 ? b$1`<div class="font-bold mb-1">â ${category.title}</div>` : A$1} 33483 <div class="flex flex-wrap items-start gap-x-6 leading-tight ${justifyClass}"> 33484 ${o$1(category.prices, (price) => { 33485 return b$1`<div>
33486 <span class="font-bold mr-[.85em]">${price.title}</span>${price.amount ? formatAmount(price.amount) : t("free")} 33487 </div>`; 33488 })} 33489 <sonic-price-in-situ inline></sonic-price-in-situ> 33490 </div> 33491 </div> 33492 `; 33493 } 33494 )} 33495 </div>`; 33496 } 33497 }; 33498 SonicPricesInfos.styles = [tailwind, fontSize]; 33499 __decorateClass$2X([ 33500 n$5({ type: String }) 33501 ], SonicPricesInfos.prototype, "size", 2); 33502 __decorateClass$2X([ 33503 n$5({ type: Boolean }) 33504 ], SonicPricesInfos.prototype, "displaySoldOut", 2); 33505 __decorateClass$2X([ 33506 c({ context: alignContext, subscribe: true }), 33507 n$5({ type: String }) 33508 ], SonicPricesInfos.prototype, "align", 2); 33509 __decorateClass$2X([ 33510 n$5({ type: Object }) 33511 ], SonicPricesInfos.prototype, "selectedQuota", 2); 33512 __decorateClass$2X([ 33513 n$5({ type: Array }) 33514 ], SonicPricesInfos.prototype, "prices", 2); 33515 __decorateClass$2X([ 33516 r$5() 33517 ], SonicPricesInfos.prototype, "_renderableCategories", 2); 33518 SonicPricesInfos = __decorateClass$2X([ 33519 t$3(tagName$1O) 33520 ], SonicPricesInfos); 33521 var __defProp$2T = Object.defineProperty; 33522 var __getOwnPropDesc$2W = Object.getOwnPropertyDescriptor; 33523 var __decorateClass$2W = (decorators, target, key, kind) => { 33524 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2W(target, key) : target; 33525 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33526 if (decorator = decorators[i2]) 33527 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33528 if (kind && result) __defProp$2T(target, key, result); 33529 return result; 33530 }; 33531 let PageHeader = class extends i$6 { 33532 constructor() { 33533 super(...arguments); 33534 this.hasActions = false; 33535 this.hasSubtitle = false; 33536 this.hasMore = false; 33537 this._resizeController = new h$1(this, {}); 33538 } 33539 checkIfActions() { 33540 this.hasActions = !!this.actionsElement?.length; 33541 } 33542 checkIfMore() { 33543 this.hasMore = !!this.moreElement?.length; 33544 } 33545 willUpdate(_changedProperties) { 33546 if (_changedProperties.has("subtitle")) { 33547 this.checkIfSubtitle(); 33548 } 33549 } 33550 checkIfSubtitle() { 33551 this.hasSubtitle = !!this.subtitle || !!this.slotSubtitleNodes?.length; 33552 } 33553 render() { 33554 const isSmall = this.clientWidth < 500; 33555 return b$1` 33556 <div class="header"> 33557 ${this.goBack !== void 0 || this.goBackHref ? b$1` 33558 <div 33559 class="${isSmall ? "text-3xl" : "text-4xl"} leading-none flex items-center shrink-0 mr-3 pr-2 border-r" 33560 > 33561 <sonic-button 33562 ?goBack=${!this.goBackHref} 33563 href=${o$4(this.goBackHref)} 33564 variant="ghost" 33565 shape="square" 33566 size="${isSmall ? "md" : "lg"}" 33567 > 33568 <sonic-icon library="custom" name="arrow-left" size="${isSmall ? "lg" : "xl"}"></sonic-icon> 33569 </sonic-button> 33570 </div> 33571 ` : A$1} 33572 33573 <div class="header-content"> 33574 <div class="flex flex-wrap items-center pt-1"> 33575 <div class="${this.hasActions ? "mr-auto " : ""}"> 33576 <div> 33577 <span class="${isSmall ? "text-3xl" : "text-4xl"} leading-none font-bold mr-4 inline-block text-pretty" 33578 >${this.label}</span 33579 > 33580 <slot name="status"></slot> 33581 </div> 33582 33583 <slot 33584 name="subtitle" 33585 @slotchange=${this.checkIfSubtitle} 33586 class="mt-[.25em] w-full text-lg ${this.hasSubtitle ? "block" : "hidden"}" 33587 > 33588 ${this.subtitle ?? A$1} 33589 </slot> 33590 </div> 33591 <div class=${this.hasActions ? " block self-start " : "hidden"}> 33592 <slot 33593 name="actions" 33594 @slotchange=${this.checkIfActions} 33595 class=${this.hasActions ? "min-h-[2.8rem] inline-flex gap-1 items-center flex-wrap" : "hidden"} 33596 ></slot> 33597 </div> 33598 </div> 33599 <slot></slot> 33600 </div> 33601 33602 <div class=${this.hasMore ? "block" : "hidden"}> 33603 <sonic-pop class="block ml-2 mt-1"> 33604 <sonic-button shape="circle" size="${isSmall ? "md" : "lg"}"> 33605 <sonic-icon library="custom" name="ellipsis-vertical" size="${isSmall ? "md" : "lg"}"></sonic-icon> 33606 </sonic-button> 33607 <slot @slotchange=${this.checkIfMore} name="more" slot="content"></slot> 33608 </sonic-pop> 33609 </div> 33610 </div> 33611 `; 33612 } 33613 }; 33614 PageHeader.styles = [ 33615 tailwind, 33616 i$9` 33617 :host { 33618 display: block; 33619 margin-bottom: 2rem; 33620 } 33621 33622 .header { 33623 display: flex; 33624 align-items: flex-start; 33625 } 33626 33627 .header-content { 33628 flex-grow: 1; 33629 } 33630 ` 33631 ]; 33632 __decorateClass$2W([ 33633 n$5({ type: String }) 33634 ], PageHeader.prototype, "label", 2); 33635 __decorateClass$2W([ 33636 n$5({ type: String }) 33637 ], PageHeader.prototype, "subtitle", 2); 33638 __decorateClass$2W([ 33639 n$5({ type: String }) 33640 ], PageHeader.prototype, "goBack", 2); 33641 __decorateClass$2W([ 33642 n$5({ type: String }) 33643 ], PageHeader.prototype, "goBackHref", 2); 33644 __decorateClass$2W([ 33645 o$8({ selector: "*", slot: "actions" }) 33646 ], PageHeader.prototype, "actionsElement", 2); 33647 __decorateClass$2W([ 33648 r$5() 33649 ], PageHeader.prototype, "hasActions", 2); 33650 __decorateClass$2W([ 33651 r$5() 33652 ], PageHeader.prototype, "hasSubtitle", 2); 33653 __decorateClass$2W([ 33654 n$4({ slot: "subtitle", flatten: true }) 33655 ], PageHeader.prototype, "slotSubtitleNodes", 2); 33656 __decorateClass$2W([ 33657 o$8({ selector: "*", slot: "more" }) 33658 ], PageHeader.prototype, "moreElement", 2); 33659 __decorateClass$2W([ 33660 r$5() 33661 ], PageHeader.prototype, "hasMore", 2); 33662 PageHeader = __decorateClass$2W([ 33663 t$3("sonic-page-header") 33664 ], PageHeader); 33665 const ownerIcon = (owner, className) => { 33666 let length = 0; 33667 if (owner?.firstName) { 33668 length = owner?.firstName?.length ?? 0; 33669 } 33670 if (owner?.lastName) { 33671 length += owner?.lastName.length ?? 0; 33672 } 33673 let icon2; 33674 switch (length) { 33675 case 8: 33676 case 9: 33677 icon2 = "face-grin-wink"; 33678 break; 33679 case 10: 33680 icon2 = "face-sunglasses"; 33681 break; 33682 case 11: 33683 icon2 = "face-smile-beam"; 33684 break; 33685 case 12: 33686 icon2 = "face-grin"; 33687 break; 33688 case 13: 33689 icon2 = "face-laugh-wink"; 33690 break; 33691 case 14: 33692 icon2 = "face-party"; 33693 break; 33694 case 15: 33695 icon2 = "face-laugh-wink"; 33696 break; 33697 case 16: 33698 icon2 = "face-laugh-beam"; 33699 break; 33700 case 17: 33701 icon2 = "face-sunglasses"; 33702 break; 33703 case 18: 33704 icon2 = "face-awesome"; 33705 break; 33706 case 19: 33707 icon2 = "face-smile-relaxed"; 33708 break; 33709 case 20: 33710 icon2 = "face-glasses"; 33711 break; 33712 case 26: 33713 icon2 = "face-smirking"; 33714 break; 33715 case 21: 33716 icon2 = "face-surprise"; 33717 break; 33718 default: 33719 icon2 = "face-smile"; 33720 break; 33721 } 33722 return b$1`<sonic-icon name="${icon2}" library="custom" class="${o$4(className)}"></sonic-icon>`; 33723 }; 33724 const contactContext = n("contactContext"); 33725 var __defProp$2S = Object.defineProperty; 33726 var __getOwnPropDesc$2V = Object.getOwnPropertyDescriptor; 33727 var __decorateClass$2V = (decorators, target, key, kind) => { 33728 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2V(target, key) : target; 33729 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33730 if (decorator = decorators[i2]) 33731 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33732 if (kind && result) __defProp$2S(target, key, result); 33733 return result; 33734 }; 33735 let UserInfo = class extends Subscriber$1(i$6) { 33736 constructor() { 33737 super(...arguments); 33738 this.link = false;
33739 this.showAddress = false; 33740 this.showInfos = false; 33741 this.size = "md"; 33742 this.mode = "user"; 33743 this.contactContext = "user"; 33744 } 33745 render() { 33746 if (!this.props) return A$1; 33747 const { email: email2, phoneNumber, service } = this.props; 33748 return b$1`<div class="flex gap-2 leading-tight min-w-0 "> 33749 <div class="shrink-0 text-center">${this.renderIcon()}</div> 33750 <div class="min-w-0 grow"> 33751 <div class="font-bold">${this.renderName()}</div> 33752 ${service && !(this.size == "sm" || this.size === "xs") ? b$1`<div class="text-2xs uppercase leading-0 mt-1 text-neutral-500">Contact</div> 33753 ${service}` : A$1} 33754 ${email2 ? b$1`<div class="truncate block"> 33755 <sonic-link class="hover:underline" title="${email2}" href="mailto:${email2}">${email2}</sonic-link> 33756 </div>` : A$1} 33757 ${phoneNumber && this.size !== "xs" ? b$1`<a class="hover:underline" href="tel:${phoneNumber.replaceAll(" ", "")}">${phoneNumber}</a>` : A$1} 33758 ${this.size !== "xs" ? b$1` ${this.renderAddress()} ${this.renderInfos()}` : A$1} 33759 <slot></slot> 33760 </div> 33761 </div>`; 33762 } 33763 renderName() { 33764 const isProfessional = this.props?.isProfessional; 33765 const uid = this.props?.uid; 33766 const isAnonymous = !this.props?.firstName && !this.props?.lastName && !this.props?.structure; 33767 const route2 = isProfessional ? appRoute("pro") : appRoute("user"); 33768 const routeIsDefined = route2.toString() !== "" && route2.toString() !== "/"; 33769 const path = uid && routeIsDefined ? route2?.fill({ id: uid?.toString() }).toString() : null; 33770 const lastName = this.props?.lastName?.toUpperCase(); 33771 if (isAnonymous) { 33772 return b$1`Anonyme`; 33773 } 33774 const nameMarkup = b$1`<div class="text-left"> 33775 ${lastName} ${this.props?.firstName} 33776 ${this.props?.firstName || lastName ? b$1` <br />` : A$1}${this.props?.structure} 33777 </div>`; 33778 if (path) { 33779 return b$1`<sonic-tooltip label="Voir le compte ${isProfessional ? "pro" : "client"}" class=""> 33780 <sonic-link href=${path} class="hover:underline ">${nameMarkup}</sonic-link> 33781 </sonic-tooltip>`; 33782 } else { 33783 return nameMarkup; 33784 } 33785 } 33786 renderIcon() { 33787 if (!this.props) return A$1; 33788 let iconName = "user"; 33789 if (this.mode === "subscription") { 33790 iconName = "id-card"; 33791 } else { 33792 let { uid, isProfessional, firstName, lastName, isPiggyBank } = this.props; 33793 if (uid == 0 && !firstName && !lastName) { 33794 iconName = "user-secret"; 33795 } else if (uid == 0) { 33796 iconName = "cart-shopping-fast"; 33797 } else if (isPiggyBank) { 33798 iconName = "piggy-bank"; 33799 } else if (isProfessional) { 33800 iconName = "user-tie"; 33801 } 33802 if (!uid && this.contactContext === "owner") { 33803 return b$1`${ownerIcon(this.props)} `; 33804 } 33805 } 33806 return b$1`<sonic-icon library="custom" name="${iconName}" size="lg" prefix="light"></sonic-icon>`; 33807 } 33808 renderAddress() { 33809 if (!this.props) return A$1; 33810 const { address, address2, postalCode, city } = this.props; 33811 const hasAtLeastOneValue = address || address2 || postalCode || city; 33812 if (this.showAddress && hasAtLeastOneValue) { 33813 return b$1` 33814 <div class="text-xs mt-2"> 33815 ${address ? b$1`<div>${address}</div>` : A$1} ${address2 ? b$1`<div>${address2}</div>` : A$1} 33816 ${postalCode ? b$1`<span>${postalCode}</span>` : A$1} ${city ? b$1`<span> â ${city}</span>` : A$1} 33817 </div> 33818 `; 33819 } else { 33820 return A$1; 33821 } 33822 } 33823 renderInfos() { 33824 if (!this.props) return A$1; 33825 const { gender, birthdate } = this.props; 33826 const currentLang = document.documentElement.lang ?? "fr-FR"; 33827 const cleanBirthdate = birthdate ? new Date(birthdate).toLocaleDateString(currentLang) : null; 33828 const hasAtLeastOneValue = gender || birthdate; 33829 if (this.showInfos && hasAtLeastOneValue) { 33830 return b$1` 33831 <div class="text-xs mt-2 text-neutral-500"> 33832 ${gender ? b$1`<div>Genre : ${gender}</div>` : A$1} 33833 ${birthdate ? b$1`<div>Né·e le : ${cleanBirthdate}</div>` : A$1} 33834 </div> 33835 `; 33836 } else { 33837 return A$1; 33838 } 33839 } 33840 }; 33841 UserInfo.styles = [ 33842 tailwind, 33843 i$9` 33844 :host() { 33845 display: block; 33846 min-width: 0; 33847 max-width: 100%; 33848 } 33849 ` 33850 ]; 33851 __decorateClass$2V([ 33852 n$5({ type: Boolean }) 33853 ], UserInfo.prototype, "link", 2); 33854 __decorateClass$2V([ 33855 n$5({ type: Boolean }) 33856 ], UserInfo.prototype, "showAddress", 2); 33857 __decorateClass$2V([ 33858 n$5({ type: Boolean }) 33859 ], UserInfo.prototype, "showInfos", 2); 33860 __decorateClass$2V([ 33861 n$5({ type: String }) 33862 ], UserInfo.prototype, "size", 2); 33863 __decorateClass$2V([ 33864 n$5({ type: String }) 33865 ], UserInfo.prototype, "mode", 2); 33866 __decorateClass$2V([ 33867 c({ context: contactContext, subscribe: true }), 33868 n$5({ type: String }) 33869 ], UserInfo.prototype, "contactContext", 2); 33870 UserInfo = __decorateClass$2V([ 33871 t$3("sonic-user-info") 33872 ], UserInfo); 33873 var __defProp$2R = Object.defineProperty; 33874 var __getOwnPropDesc$2U = Object.getOwnPropertyDescriptor; 33875 var __decorateClass$2U = (decorators, target, key, kind) => { 33876 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2U(target, key) : target; 33877 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 33878 if (decorator = decorators[i2]) 33879 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 33880 if (kind && result) __defProp$2R(target, key, result); 33881 return result; 33882 }; 33883 let SonicUserToggle = class extends i$6 { 33884 constructor() { 33885 super(...arguments); 33886 this.selectedId = 0; 33887 this.canCreateAccount = false;
33888 this.handleCreateAccount = () => { 33889 Modal.create({ 33890 content: b$1`<sonic-iframe src="/inscription-guichet?popup=true&sonic_modal=true"></sonic-iframe>`, 33891 maxWidth: "62rem", 33892 removeOnHide: true 33893 }); 33894 }; 33895 this.dispatch = (uid) => { 33896 const event = new CustomEvent("select", { 33897 detail: { uid } 33898 }); 33899 this.dispatchEvent(event); 33900 this.selectedId = uid; 33901 }; 33902 this.handleSelect = (e2) => { 33903 this.dispatch(e2.detail.uid); 33904 }; 33905 } 33906 clear() { 33907 this.selectedId = 0; 33908 this.dispatch(0); 33909 } 33910 render() { 33911 const displaySearch = !this.selectedId; 33912 return b$1` 33913 ${displaySearch ? b$1`<div class="flex gap-3 w-full"> 33914 <sonic-user-selector @select=${this.handleSelect} class="grow"></sonic-user-selector> 33915 ${this.canCreateAccount ? b$1`<sonic-button @click=${this.handleCreateAccount} variant="outline" class="self-start"> 33916 <sonic-icon name="user-plus" library="custom"></sonic-icon> ${t("create_account")} 33917 </sonic-button> ` : A$1} 33918 </div> ` : b$1`<sonic-fetch dataProvider="user/${this.selectedId}"> 33919 <div 33920 noAutoFill 33921 variant="outline" 33922 align="left" 33923 class="flex gap-1 items-start border border-neutral-200 px-2 py-2 rounded-md" 33924 > 33925 <sonic-user-info 33926 inert 33927 dataProvider="user/${this.selectedId}" 33928 size="md" 33929 class="relative py-2 block flex-grow " 33930 ></sonic-user-info> 33931 <sonic-button slot="suffix" shape="circle" icon size="sm" noAutoFill @click=${this.clear}> 33932 <sonic-icon library="custom" name="trash"></sonic-icon 33933 ></sonic-button> 33934 </div> 33935 </sonic-fetch>`} 33936 `; 33937 } 33938 }; 33939 SonicUserToggle.styles = [tailwind]; 33940 __decorateClass$2U([ 33941 n$5({ type: String }) 33942 ], SonicUserToggle.prototype, "name", 2); 33943 __decorateClass$2U([ 33944 n$5({ type: Number }) 33945 ], SonicUserToggle.prototype, "selectedId", 2); 33946 __decorateClass$2U([ 33947 n$5({ type: Boolean }) 33948 ], SonicUserToggle.prototype, "canCreateAccount", 2); 33949 SonicUserToggle = __decorateClass$2U([ 33950 t$3("sonic-user-toggle") 33951 ], SonicUserToggle); 33952 var __decorate$a = function(decorators, target, key, desc) { 33953 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 33954 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 33955 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; 33956 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 33957 }; 33958 const tagName$1N = "sonic-textarea"; 33959 let Textarea = class Textarea extends Form(Form$2(Subscriber$1(i$6))) { 33960 constructor() { 33961 super(...arguments); 33962 this.size = "md"; 33963 this.readonly = false; 33964 this.resize = "vertical"; 33965 this.hasDescription = false; 33966 this.hasLabel = false; 33967 } 33968 connectedCallback() { 33969 super.connectedCallback(); 33970 this.hasSlotOrProps(); 33971 } 33972 willUpdate(changedProperties) { 33973 this.hasSlotOrProps(); 33974 super.willUpdate(changedProperties); 33975 } 33976 hasSlotOrProps() { 33977 this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false; 33978 this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false; 33979 } 33980 validateFormElement() { 33981 const textarea2 = this.shadowRoot?.querySelector("textarea"); 33982 if (!textarea2 || textarea2.checkValidity()) 33983 return; 33984 const formPublisher = this.getFormPublisher(); 33985 if (formPublisher) { 33986 formPublisher.isFormValid = false; 33987 } 33988 textarea2.reportValidity(); 33989 } 33990 render() { 33991 const textAreaStyle = { 33992 resize: this.resize 33993 }; 33994 return b$1` 33995 <label 33996 for="${this.id || "form-element"}" 33997 class="${this.hasLabel ? "form-label" : "hidden"}" 33998 >${this.label ? o$6( 33999 this.label 34000 /*+ labelStarSuffix*/ 34001 ) : ""}<slot 34002 name="label" 34003 @slotchange=${this.hasSlotOrProps} 34004 ></slot 34005 ></label> 34006 34007 <div class="form-control"> 34008 <textarea 34009 data-form-element 34010 id="${this.id || "form-element"}"
34011 @input=${this.handleChange} 34012 @blur=${this.handleBlur} 34013 ?disabled=${this.disabled} 34014 ?required=${this.required} 34015 ?autofocus=${this.autofocus} 34016 rows=${o$4(this.rows)} 34017 cols=${o$4(this.cols)} 34018 maxlength=${o$4(this.maxlength)} 34019 minlength=${o$4(this.minlength)} 34020 ?readonly=${this.readonly} 34021 spellcheck=${o$4(this.spellcheck)} 34022 autocomplete=${o$4(this.autocomplete)} 34023 tabindex=${o$4(this.tabindex)} 34024 wrap=${o$4(this.wrap)} 34025 placeholder="${this.placeholder}" 34026 class="form-element textarea custom-scroll" 34027 aria-label=${o$4(this.ariaLabel)} 34028 aria-labelledby=${o$4(this.ariaLabelledby)} 34029 style=${o$3(textAreaStyle)} 34030 > 34031${this.value}</textarea 34032 > 34033 </div> 34034 34035 <slot 34036 name="description" 34037 @slotchange=${this.hasSlotOrProps} 34038 class="${this.hasDescription ? "form-description" : "hidden"}" 34039 >${this.description ? b$1`${o$6(this.description)}` : ""}</slot 34040 > 34041 `; 34042 } 34043 }; 34044 Textarea.styles = [ 34045 fontSize, 34046 formControl, 34047 label, 34048 description, 34049 customScroll, 34050 i$9` 34051 textarea { 34052 overflow-y: auto !important; 34053 font-size: inherit; 34054 } 34055 ` 34056 ]; 34057 __decorate$a([ 34058 n$5({ type: String }) 34059 ], Textarea.prototype, "size", void 0); 34060 __decorate$a([ 34061 n$5({ type: Number }) 34062 ], Textarea.prototype, "rows", void 0); 34063 __decorate$a([ 34064 n$5({ type: Number }) 34065 ], Textarea.prototype, "cols", void 0); 34066 __decorate$a([ 34067 n$5({ type: Number }) 34068 ], Textarea.prototype, "maxlength", void 0); 34069 __decorate$a([ 34070 n$5({ type: Number }) 34071 ], Textarea.prototype, "minlength", void 0); 34072 __decorate$a([ 34073 n$5({ type: String }) 34074 ], Textarea.prototype, "wrap", void 0); 34075 __decorate$a([ 34076 n$5({ type: Boolean }) 34077 ], Textarea.prototype, "readonly", void 0); 34078 __decorate$a([ 34079 n$5({ type: String }) 34080 ], Textarea.prototype, "placeholder", void 0); 34081 __decorate$a([ 34082 n$5({ type: String }) 34083 ], Textarea.prototype, "resize", void 0); 34084 __decorate$a([ 34085 n$4({ slot: "label", flatten: true }) 34086 ], Textarea.prototype, "slotLabelNodes", void 0); 34087 __decorate$a([ 34088 n$4({ slot: "description", flatten: true }) 34089 ], Textarea.prototype, "slotDescriptionNodes", void 0); 34090 __decorate$a([ 34091 r$5() 34092 ], Textarea.prototype, "hasDescription", void 0); 34093 __decorate$a([ 34094 r$5() 34095 ], Textarea.prototype, "hasLabel", void 0); 34096 Textarea = __decorate$a([ 34097 t$3(tagName$1N) 34098 ], Textarea); 34099 var __decorate$9 = function(decorators, target, key, desc) { 34100 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 34101 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 34102 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; 34103 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 34104 }; 34105 const tagName$1M = "sonic-checkbox"; 34106 let Checkbox = class Checkbox extends Form$1(Form(Form$2(Subscriber$1(i$6)))) { 34107 constructor() { 34108 super(...arguments); 34109 this.touched = false; 34110 this.iconName = "check"; 34111 this.indeterminateIconName = "minus-small"; 34112 this.showAsIndeterminate = false; 34113 this.hasDescription = false; 34114 this.hasLabel = false; 34115 } 34116 connectedCallback() { 34117 this.type = "checkbox"; 34118 this.hasSlotOrProps(); 34119 super.connectedCallback(); 34120 } 34121 willUpdate(changedProperties) { 34122 this.hasSlotOrProps(); 34123 super.willUpdate(changedProperties); 34124 if (changedProperties.has("type")) { 34125 this.type = "checkbox"; 34126 } 34127 } 34128 hasSlotOrProps() { 34129 this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false; 34130 this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false; 34131 } 34132 render() { 34133 return b$1` 34134 <label class="checkbox-container ${this.disabled ? "disabled" : ""}"> 34135
34136 <span class="icon-container"> 34137 <input 34138 type="${this.type}" 34139 @click=${this.handleChange} 34140 @blur=${this.handleBlur} 34141 ?required=${this.required} 34142 ?data-indeterminate=${this.showAsIndeterminate} 34143 ?disabled=${this.disabled} 34144 .checked=${o$4(this.checked)} 34145 .name=${this.name} 34146 .value=${this.value} 34147 ?autofocus=${this.autofocus} 34148 aria-label=${o$4(this.ariaLabel)} 34149 aria-labelledby=${o$4(this.ariaLabelledby)} 34150 /> 34151 <sonic-icon name="${this.checked == "indeterminate" || this.showAsIndeterminate ? this.indeterminateIconName : this.iconName}" class="sc-input-icon"></sonic-icon> 34152 </span> 34153 34154 <div class="checkbox-text ${!this.hasDescription && !this.hasLabel ? "hidden" : "checkbox-text"}"> 34155 ${this.label ? o$6( 34156 this.label 34157 /*+ labelStarSuffix*/ 34158 ) : ""} 34159 <slot @slotchange=${this.hasSlotOrProps}></slot> 34160 <slot @slotchange=${this.hasSlotOrProps} name="description" class="${this.hasDescription ? "description" : "hidden"} ">${this.description ? b$1`${o$6(this.description)}` : ""}</slot> 34161 </div> 34162 </label> 34163 </label> 34164 `; 34165 } 34166 }; 34167 Checkbox.styles = [ 34168 fontSize, 34169 i$9` 34170 :host { 34171 --sc-checkbox-border-width: var(--sc-form-border-width); 34172 --sc-checkbox-border-color: var( 34173 --sc-input-border-color, 34174 var(--sc-base-content, #000) 34175 ); 34176 --sc-checkbox-bg: var(--sc-input-bg); 34177 --sc-checkbox-color: transparent; 34178 font-size: var(--sc-_fs); 34179 } 34180 34181 * { 34182 box-sizing: border-box; 34183 } 34184 34185 .checkbox-container { 34186 min-height: 1.4em; 34187 display: flex; 34188 gap: 0.5em; 34189 line-height: 1.2; 34190 align-items: flex-start; 34191 } 34192 34193 .icon-container { 34194 position: relative; 34195 display: flex; 34196 flex-shrink: 0; 34197 } 34198 34199 input { 34200 box-sizing: border-box; 34201 appearance: none; 34202 flex-shrink: 0; 34203 height: calc(var(--sc-_fs) * 1.25); 34204 width: calc(var(--sc-_fs) * 1.25); 34205 display: block; 34206 cursor: pointer; 34207 border-radius: 0.25em; 34208 transition: 0.2s; 34209 outline: none; 34210 margin: 0; 34211 background-color: var(--sc-checkbox-bg); 34212 border: var(--sc-checkbox-border-width) solid 34213 var(--sc-checkbox-border-color); 34214 } 34215 34216 input:focus-visible, 34217 :host(:not([disabled])) input:active { 34218 box-shadow: 0 0 0 2px var(--sc-primary, var(--sc-base-content, #000)); 34219 } 34220 34221 :host(:not([disabled])) label { 34222 cursor: pointer; 34223 } 34224 34225 sonic-icon { 34226 line-height: 0; 34227 position: absolute; 34228 top: 50%; 34229 left: 50%; 34230 transform: translateX(-50%) translateY(-50%) scale(0); 34231 transition: transform 0.2s ease-in-out; 34232 color: var(--sc-checkbox-color); 34233 } 34234 34235 /* .checkbox-text { 34236 align-self: center; 34237 } */ 34238 34239 .description { 34240 color: var(--sc-base-400, var(--sc-base-content, #000)); 34241 font-size: 0.85em; 34242 margin-top: 0.2em; 34243 display: block; 34244 } 34245 34246 /*Active */ 34247 input:checked, 34248 input[data-indeterminate], 34249 input[checked] { 34250 --sc-checkbox-border-color: var( 34251 --sc-primary, 34252 var(--sc-base-content, #000) 34253 ); 34254 --sc-checkbox-bg: var(--sc-primary, var(--sc-base-content, #000)); 34255 } 34256 input:checked + sonic-icon, 34257 input[data-indeterminate] + sonic-icon, 34258 input[checked] + sonic-icon { 34259 --sc-checkbox-color: var(--sc-primary-content, var(--sc-base, #fff)); 34260 transform: translateX(-50%) translateY(-50%) scale(1); 34261 } 34262 /*DISABLED */ 34263 .disabled { 34264 cursor: not-allowed; 34265 } 34266 .disabled input { 34267 opacity: 0.4; 34268 } 34269 34270 .disabled .checkbox-text { 34271 opacity: 0.6; 34272 } 34273 34274 /*INPUT HOVER*/ 34275 :host(:not([disabled])) label:hover input { 34276 background-color: hsl(from var(--sc-checkbox-bg) h s calc(l * 0.97)); 34277 } 34278 34279 ::slotted(a) { 34280 color: inherit; 34281 text-decoration: underline !important; 34282 } 34283 34284 ::slotted(a:hover) { 34285 text-decoration: none !important; 34286 } 34287 /*Utils */ 34288 .hidden { 34289 display: none; 34290 } 34291 ` 34292 ]; 34293 __decorate$9([ 34294 n$5({ type: Boolean, reflect: true }) 34295 ], Checkbox.prototype, "touched", void 0); 34296 __decorate$9([ 34297 n$5({ type: String }) 34298 ], Checkbox.prototype, "iconName", void 0); 34299 __decorate$9([ 34300 n$5({ type: String }) 34301 ], Checkbox.prototype, "indeterminateIconName", void 0); 34302 __decorate$9([ 34303 n$5({ type: Boolean }) 34304 ], Checkbox.prototype, "showAsIndeterminate", void 0); 34305 __decorate$9([ 34306 n$5({ type: Boolean }) 34307 ], Checkbox.prototype, "hasDescription", void 0); 34308 __decorate$9([ 34309 n$5({ type: Boolean }) 34310 ], Checkbox.prototype, "hasLabel", void 0); 34311 __decorate$9([ 34312 n$4({ flatten: true }) 34313 ], Checkbox.prototype, "slotLabelNodes", void 0); 34314 __decorate$9([ 34315 n$4({ slot: "description", flatten: true }) 34316 ], Checkbox.prototype, "slotDescriptionNodes", void 0); 34317 Checkbox = __decorate$9([ 34318 t$3(tagName$1M) 34319 ], Checkbox); 34320 const layoutContext = n("cartLayout"); 34321 const modeContext = n("cartMode"); 34322 const cartTypeContext = n("cartType"); 34323 const detailContext = n("detailContext"); 34324 var __defProp$2Q = Object.defineProperty; 34325 var __getOwnPropDesc$2T = Object.getOwnPropertyDescriptor; 34326 var __decorateClass$2T = (decorators, target, key, kind) => { 34327 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2T(target, key) : target; 34328 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 34329 if (decorator = decorators[i2]) 34330 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 34331 if (kind && result) __defProp$2Q(target, key, result); 34332 return result; 34333 }; 34334 const tagName$1L = "sonic-cart-move-items-button"; 34335 let SonicCartMoveItemsButton = class extends i$6 { 34336 constructor() { 34337 super(...arguments); 34338 this.mode = "default"; 34339 this.lineItems = []; 34340 this.size = "md"; 34341 } 34342 render() { 34343 if (!(this.mode == "split" || this.mode == "splitResult")) { 34344 return A$1; 34345 } 34346 const options = { 34347 sourceDataProvider: this.mode == "split" ? "splitSource" : "splitResult", 34348 targetDataProvider: this.mode == "split" ? "splitResult" : "splitSource" 34349 }; 34350 return b$1`<sonic-button 34351 noAutoFill 34352 .size="${this.size}" 34353 shape="circle" 34354 variant="ghost" 34355 icon 34356 @click=${() => moveCartItems(this.lineItems, options)} 34357 > 34358 ${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>`} 34359 </sonic-button>`; 34360 } 34361 }; 34362 SonicCartMoveItemsButton.styles = [ 34363 tailwind, 34364 i$9` 34365 :host { 34366 display: flex; 34367 justify-content: center; 34368 min-width: 3rem; 34369 } 34370 ` 34371 ]; 34372 __decorateClass$2T([ 34373 c({ context: modeContext, subscribe: true }), 34374 n$5({ type: String }) 34375 ], SonicCartMoveItemsButton.prototype, "mode", 2); 34376 __decorateClass$2T([ 34377 c({ context: cartTypeContext, subscribe: true }), 34378 n$5({ type: String }) 34379 ], SonicCartMoveItemsButton.prototype, "cartType", 2); 34380 __decorateClass$2T([ 34381 n$5({ type: Array }) 34382 ], SonicCartMoveItemsButton.prototype, "lineItems", 2); 34383 __decorateClass$2T([ 34384 n$5({ type: String }) 34385 ], SonicCartMoveItemsButton.prototype, "size", 2); 34386 SonicCartMoveItemsButton = __decorateClass$2T([ 34387 t$3(tagName$1L) 34388 ], SonicCartMoveItemsButton);
34389 const isSession = (entity) => { 34390 return entity.entity_type === EntityType.Event; 34391 }; 34392 var __defProp$2P = Object.defineProperty; 34393 var __getOwnPropDesc$2S = Object.getOwnPropertyDescriptor; 34394 var __decorateClass$2S = (decorators, target, key, kind) => { 34395 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2S(target, key) : target; 34396 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 34397 if (decorator = decorators[i2]) 34398 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 34399 if (kind && result) __defProp$2P(target, key, result); 34400 return result; 34401 }; 34402 const tagName$1K = "sonic-event-filter-taxonomy"; 34403 let EventFilterTaxonomy = class extends Fetcher(Subscriber$1(i$6)) { 34404 constructor() { 34405 super(...arguments); 34406 this.hasTerm = false; 34407 this.vocabulary = "category"; 34408 this.defaultTitle = ""; 34409 this.icon = "tag"; 34410 this.onlyFilter = false; 34411 this.formPublisher = null; 34412 this.updateHasTerm = (value) => { 34413 this.hasTerm = !!value?.length; 34414 }; 34415 } 34416 connectedCallback() { 34417 this.setAttribute("endPoint", this.vocabulary + "?sort=title:asc"); 34418 this.setAttribute("dataProvider", "event_filter_" + this.vocabulary); 34419 switch (this.vocabulary) { 34420 case "category": 34421 this.defaultTitle = "Toutes les catégories"; 34422 this.icon = "tag"; 34423 break; 34424 case "activity": 34425 this.defaultTitle = "Toutes les activités"; 34426 this.icon = "layer-group"; 34427 this.key = "data"; 34428 this.setAttribute("key", "data"); 34429 break; 34430 case "range": 34431 this.defaultTitle = "Toutes les gammes"; 34432 this.icon = "square-a"; 34433 this.setAttribute("key", "data"); 34434 break; 34435 } 34436 super.connectedCallback(); 34437 this.formPublisher = PublisherManager.get(this.getAncestorAttributeValue("formDataProvider")); 34438 if (this.formPublisher) { 34439 this.formPublisher["ids_" + this.vocabulary].onAssign(this.updateHasTerm); 34440 } 34441 } 34442 disconnectedCallback() { 34443 if (this.formPublisher) { 34444 this.formPublisher["ids_" + this.vocabulary].offAssign(this.updateHasTerm); 34445 } 34446 super.disconnectedCallback(); 34447 } 34448 render() { 34449 if (!this.vocabulary || !this.props) return A$1; 34450 const items = "data" in this.props ? this.props.data : this.props; 34451 const filterName = "ids_" + this.vocabulary; 34452 return b$1`<sonic-pop class="d-inline-block"> 34453 <div class="relative"> 34454 <sonic-button shape="circle"> 34455 <sonic-icon library="custom" name="${this.icon}"></sonic-icon> 34456 </sonic-button> 34457 ${this.hasTerm ? b$1` <sonic-badge class="absolute top-[.10em] right-[.10em]" size="2xs" type="danger"></sonic-badge>` : A$1} 34458 </div> 34459 <sonic-menu slot="content" size="sm" class="w-[14rem] overflow-auto max-h-[50vh]"> 34460 <sonic-menu-item radio size="sm" type="default" value="" name="${filterName}" 34461 >${this.defaultTitle}</sonic-menu-item 34462 > 34463 34464 ${items.length ? o$1(items, (item) => { 34465 const filterName2 = "ids_" + this.vocabulary; 34466 if (this.onlyFilter && "filter" in item && item?.filter === false) { 34467 return A$1; 34468 } 34469 return b$1`<sonic-menu-item radio size="sm" value="${item?.id || ""}" name="${filterName2}" 34470 >${item?.title}</sonic-menu-item 34471 >`; 34472 }) : A$1} 34473 </sonic-menu> 34474 </sonic-pop>`; 34475 } 34476 }; 34477 EventFilterTaxonomy.styles = [tailwind]; 34478 __decorateClass$2S([ 34479 n$5({ type: Boolean }) 34480 ], EventFilterTaxonomy.prototype, "hasTerm", 2); 34481 __decorateClass$2S([ 34482 n$5({ type: String }) 34483 ], EventFilterTaxonomy.prototype, "vocabulary", 2); 34484 __decorateClass$2S([ 34485 n$5({ type: String }) 34486 ], EventFilterTaxonomy.prototype, "defaultTitle", 2); 34487 __decorateClass$2S([ 34488 n$5({ type: String }) 34489 ], EventFilterTaxonomy.prototype, "icon", 2); 34490 __decorateClass$2S([ 34491 n$5({ type: Boolean }) 34492 ], EventFilterTaxonomy.prototype, "onlyFilter", 2); 34493 EventFilterTaxonomy = __decorateClass$2S([ 34494 t$3(tagName$1K) 34495 ], EventFilterTaxonomy); 34496 var __defProp$2O = Object.defineProperty; 34497 var __getOwnPropDesc$2R = Object.getOwnPropertyDescriptor; 34498 var __decorateClass$2R = (decorators, target, key, kind) => { 34499 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2R(target, key) : target; 34500 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 34501 if (decorator = decorators[i2]) 34502 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 34503 if (kind && result) __defProp$2O(target, key, result); 34504 return result; 34505 }; 34506 const tagName$1J = "sonic-event-selection-filters"; 34507 let EventSelectionFilters = class extends Subscriber$1(i$6) { 34508 constructor() { 34509 super(...arguments); 34510 this.category = false;
34511 this.range = false; 34512 this.activity = false; 34513 this.text = false; 34514 this.reservationRequestConfigs = false; 34515 this.waitingLists = false; 34516 this.forTreatment = false; 34517 this.onlyFilter = false; 34518 this.canFilterDays = false; 34519 this.entityType = EntityType.Event; 34520 this.hasActiveFilter = false; 34521 this.hasSearch = false; 34522 this.counterFilterByDay = false; 34523 this.form = null; 34524 this.checkIfActiveFilter = () => { 34525 if (!this.form) return; 34526 if (this.waitingLists) { 34527 this.form.has_waiting_list_request.set(true); 34528 } else if (this.reservationRequestConfigs) { 34529 this.form.has_reservation_request.set(true); 34530 } 34531 if (this.forTreatment) { 34532 this.form.for_treatment.set(true); 34533 } 34534 const formData = this.form.get(); 34535 if (formData.search?.length > 0) { 34536 this.hasActiveFilter = true; 34537 this.hasSearch = true; 34538 return; 34539 } else { 34540 this.hasSearch = false; 34541 } 34542 const filterKeys = ["ids_category", "ids_activity", "ids_range"]; 34543 this.hasActiveFilter = filterKeys.some((key) => { 34544 const value = formData[key]; 34545 const isArray = Array.isArray(value); 34546 if (isArray) { 34547 const hasItemsArray = value.length > 0; 34548 if (hasItemsArray) { 34549 return true; 34550 } else { 34551 return false; 34552 } 34553 } 34554 if (value !== null && value !== void 0 && value !== "") { 34555 return true; 34556 } 34557 return false; 34558 }); 34559 }; 34560 this.today = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3); 34561 this.resetFilterOnSearch = (searchValue) => { 34562 if (searchValue && searchValue.length > 0 && this.form) { 34563 this.form.ids_category = []; 34564 this.form.ids_activity = []; 34565 this.form.ids_range = []; 34566 } 34567 }; 34568 this.reservationRequestConfigsOptions = []; 34569 this.initReservationRequestConfigsOptions = async () => { 34570 const api2 = new API(this.getApiConfiguration()); 34571 const result = await api2.get("reservation-request-config"); 34572 const isSuccess = result.success ?? false; 34573 if (isSuccess) { 34574 const data = result.data; 34575 const options = data.map((config) => ({ 34576 value: config.id?.toString() || "", 34577 wording: config.edito?.title || "" 34578 })); 34579 this.reservationRequestConfigsOptions = [ 34580 { 34581 value: "", 34582 wording: "Toutes les demandes" 34583 }, 34584 ...options 34585 ]; 34586 } 34587 }; 34588 } 34589 connectedCallback() { 34590 const formDataProvider = this.getAttribute("formDataProvider") || "filterEventSelection"; 34591 this.form = PublisherManager.get(formDataProvider); 34592 if (this.form) { 34593 this.form.onInternalMutation(this.checkIfActiveFilter); 34594 this.form.search.onAssign(this.resetFilterOnSearch); 34595 if (this.waitingLists) { 34596 this.form.has_waiting_list_request.set(true); 34597 } else if (this.reservationRequestConfigs) { 34598 this.form.has_reservation_request.set(true); 34599 } 34600 if (this.forTreatment) { 34601 this.form.for_treatment.set(true); 34602 } 34603 } 34604 super.connectedCallback(); 34605 } 34606 disconnectedCallback() { 34607 if (this.form) { 34608 this.form.search.offAssign(this.resetFilterOnSearch); 34609 this.form.offInternalMutation(this.checkIfActiveFilter); 34610 } 34611 super.disconnectedCallback(); 34612 } 34613 willUpdate(_changedProperties) { 34614 if (_changedProperties.has("reservationRequestConfigs") && this.reservationRequestConfigs) { 34615 this.initReservationRequestConfigsOptions(); 34616 } 34617 } 34618 renderReservationRequestConfigsFilter() { 34619 if (!this.reservationRequestConfigsOptions.length || !this.reservationRequestConfigs) return A$1; 34620 return b$1`<sonic-select 34621 name="campaign_id" 34622 .options=${this.reservationRequestConfigsOptions} 34623 class="w-[13rem]" 34624 ></sonic-select>`; 34625 } 34626 render() { 34627 const displayFilterDays = this.canFilterDays && this.counterFilterByDay && this.entityType === EntityType.Event; 34628 return b$1` 34629 <div class="flex gap-2 flex-wrap max-w-[50rem]"> 34630 <sonic-input 34631 class="grow" 34632 inlineContent 34633 type="search" 34634 name="search" 34635 placeholder="Rechercher..." 34636 value="" 34637 autocomplete="off" 34638 autoActive 34639 > 34640 <sonic-icon name="magnifying-glass" library="custom" slot="prefix"></sonic-icon> 34641 </sonic-input> 34642 34643 <div class="inline-flex gap-2"> 34644 ${this.renderReservationRequestConfigsFilter()} 34645 ${this.category ? b$1`<sonic-event-filter-taxonomy 34646 dataProvider="event_filter_category" 34647 vocabulary="category" 34648 ?onlyFilter=${this.onlyFilter} 34649 ></sonic-event-filter-taxonomy>` : A$1} 34650 ${this.range ? b$1`<sonic-event-filter-taxonomy 34651 dataProvider="event_filter_range" 34652 vocabulary="range" 34653 ></sonic-event-filter-taxonomy>` : A$1} 34654 ${this.activity ? b$1`<sonic-event-filter-taxonomy 34655 dataProvider="event_filter_activity" 34656 vocabulary="activity" 34657 ></sonic-event-filter-taxonomy>` : A$1}
34658 <sonic-divider 34659 vertical 34660 class="${this.hasActiveFilter ? "opacity-100" : "opacity-0 pointer-events-none"}" 34661 ></sonic-divider> 34662 <sonic-button 34663 variant="ghost" 34664 shape="circle" 34665 class="-ml-2 transition ease-linear ${this.hasActiveFilter ? "opacity-100 scale-100 " : "opacity-0 scale-50 -rotate-45 "}" 34666 reset 34667 ><sonic-icon name="arrow-rotate-left" library="custom" prefix="solid"></sonic-icon 34668 ></sonic-button> 34669 </div> 34670 </div> 34671 <!-- Days --> 34672 ${displayFilterDays ? b$1`<sonic-fetch 34673 dataProvider="events/filters/days?from=${this.today}" 34674 class="block w-full min-w-0 min-h-[3rem]" 34675 key="data" 34676 > 34677 <sonic-form-event-days></sonic-form-event-days 34678 ></sonic-fetch>` : A$1} 34679 `; 34680 } 34681 }; 34682 EventSelectionFilters.styles = [tailwind]; 34683 __decorateClass$2R([ 34684 n$5({ type: Boolean }) 34685 ], EventSelectionFilters.prototype, "category", 2); 34686 __decorateClass$2R([ 34687 n$5({ type: Boolean }) 34688 ], EventSelectionFilters.prototype, "range", 2); 34689 __decorateClass$2R([ 34690 n$5({ type: Boolean }) 34691 ], EventSelectionFilters.prototype, "activity", 2); 34692 __decorateClass$2R([ 34693 n$5({ type: Boolean }) 34694 ], EventSelectionFilters.prototype, "text", 2); 34695 __decorateClass$2R([ 34696 n$5({ type: Boolean }) 34697 ], EventSelectionFilters.prototype, "reservationRequestConfigs", 2); 34698 __decorateClass$2R([ 34699 n$5({ type: Boolean }) 34700 ], EventSelectionFilters.prototype, "waitingLists", 2); 34701 __decorateClass$2R([ 34702 n$5({ type: Boolean }) 34703 ], EventSelectionFilters.prototype, "forTreatment", 2); 34704 __decorateClass$2R([ 34705 n$5({ type: Boolean }) 34706 ], EventSelectionFilters.prototype, "onlyFilter", 2); 34707 __decorateClass$2R([ 34708 n$5({ type: Boolean }) 34709 ], EventSelectionFilters.prototype, "canFilterDays", 2); 34710 __decorateClass$2R([ 34711 n$5({ type: String }) 34712 ], EventSelectionFilters.prototype, "entityType", 2); 34713 __decorateClass$2R([ 34714 r$5() 34715 ], EventSelectionFilters.prototype, "hasActiveFilter", 2); 34716 __decorateClass$2R([ 34717 r$5() 34718 ], EventSelectionFilters.prototype, "hasSearch", 2); 34719 __decorateClass$2R([ 34720 bind$1("settings.store_ui.event.filter_by_day"), 34721 r$5() 34722 ], EventSelectionFilters.prototype, "counterFilterByDay", 2); 34723 __decorateClass$2R([ 34724 r$5() 34725 ], EventSelectionFilters.prototype, "reservationRequestConfigsOptions", 2); 34726 EventSelectionFilters = __decorateClass$2R([ 34727 t$3(tagName$1J) 34728 ], EventSelectionFilters); 34729 var __defProp$2N = Object.defineProperty; 34730 var __getOwnPropDesc$2Q = Object.getOwnPropertyDescriptor; 34731 var __decorateClass$2Q = (decorators, target, key, kind) => { 34732 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2Q(target, key) : target; 34733 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 34734 if (decorator = decorators[i2]) 34735 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 34736 if (kind && result) __defProp$2N(target, key, result); 34737 return result; 34738 }; 34739 let instanceCounter$c = 0; 34740 let SonicEventSelector = class extends i$6 { 34741 constructor() { 34742 super(...arguments); 34743 this.id = ""; 34744 this.formDataProvider = "eventSelection" + instanceCounter$c++; 34745 this.excludeCurrent = false; 34746 this.selectedIds = []; 34747 this.subscriptionTypeIds = []; 34748 this.subscriptionPriceIds = []; 34749 this.searchFormDataProvider = "searchFormDataProvider/eventSelection" + instanceCounter$c++; 34750 this.selectSession = (id) => { 34751 const event = new CustomEvent("select", { 34752 detail: { id, entity_type: EntityType.Event } 34753 }); 34754 this.pushId(id); 34755 this.dispatchEvent(event); 34756 }; 34757 this.unselectSession = (id) => { 34758 const event = new CustomEvent("unselect", { 34759 detail: { id, entity_type: EntityType.Event } 34760 }); 34761 this.removeId(id); 34762 this.dispatchEvent(event); 34763 }; 34764 this.removeId = (id) => { 34765 if (this.selectedIds.includes(id)) { 34766 this.selectedIds = this.selectedIds.filter((item) => item !== id); 34767 } 34768 }; 34769 this.pushId = (id) => { 34770 if (!this.selectedIds.includes(id)) { 34771 this.selectedIds.push(id); 34772 } 34773 }; 34774 this.itemsMarkup = (session) => { 34775 if (!session.id) return A$1; 34776 const isSelected = this.selectedIds.includes(Number(session.id)); 34777 return b$1`<sonic-button
34778 class="block w-full rounded-md hover:bg-neutral-50 mb-3" 34779 variant="unstyled" 34780 @click=${() => isSelected ? this.unselectSession(Number(session.id)) : this.selectSession(Number(session.id))} 34781 > 34782 <sonic-product-summary size="sm" .featureDisplay=${[ProductDisplay.Status, ProductDisplay.Range]}> 34783 ${isSelected ? b$1`<sonic-button slot="actions" noAutoFill class="group" shape="circle" size="sm" icon> 34784 <sonic-icon name="check" library="custom"></sonic-icon> 34785 </sonic-button>` : A$1} 34786 </sonic-product-summary> 34787 </sonic-button>`; 34788 }; 34789 this.noResultMarkup = () => { 34790 return b$1`<sonic-no-result size="md"></sonic-no-result>`; 34791 }; 34792 } 34793 render() { 34794 const queueEndpoint = entityEndPoint({ 34795 entityType: EntityType.Event, 34796 accessParams: this.accessParams, 34797 view: entityView.essential, 34798 features: [Feature.Status], 34799 isQueue: true, 34800 next: true, 34801 subscriptionTypeIds: this.subscriptionTypeIds, 34802 subscriptionPriceIds: this.subscriptionPriceIds, 34803 excludedIds: this.excludeCurrent ? [Number(this.id)] : [] 34804 }); 34805 return b$1` 34806 ${this.id ? b$1` 34807 <sonic-fetch 34808 dataProvider="${entityEndPoint({ 34809 entityType: EntityType.Event, 34810 entityId: Number(this.id), 34811 accessParams: this.accessParams, 34812 view: entityView.essential, 34813 features: [Feature.Status] 34814 })}" 34815 key="data" 34816 > 34817 <sonic-product-summary 34818 data-id=${this.id} 34819 size="lg" 34820 .featureDisplay=${[ProductDisplay.Status, ProductDisplay.Range]} 34821 ></sonic-product-summary> 34822 </sonic-fetch> 34823 <sonic-divider class="my-3"></sonic-divider> 34824 ` : A$1} 34825 34826 <div id="formContainer" class="mb-4"> 34827 <sonic-event-selection-filters 34828 formDataProvider="${this.searchFormDataProvider}" 34829 class=" block max-w-[40rem] w-full z-10 " 34830 category 34831 activity 34832 range 34833 ></sonic-event-selection-filters> 34834 </div> 34835 34836 <sonic-queue 34837 dataProviderExpression="${queueEndpoint}" 34838 key="data" 34839 limit="5" 34840 targetRequestDuration="1000" 34841 dataFilterProvider="${this.searchFormDataProvider}" 34842 .items=${this.itemsMarkup} 34843 .noItems=${this.noResultMarkup} 34844 > 34845 </sonic-queue> 34846 `; 34847 } 34848 }; 34849 SonicEventSelector.styles = [tailwind]; 34850 __decorateClass$2Q([ 34851 n$5({ type: String, attribute: "data-id" }) 34852 ], SonicEventSelector.prototype, "id", 2); 34853 __decorateClass$2Q([ 34854 n$5({ type: String }) 34855 ], SonicEventSelector.prototype, "formDataProvider", 2); 34856 __decorateClass$2Q([ 34857 n$5({ type: Boolean }) 34858 ], SonicEventSelector.prototype, "excludeCurrent", 2); 34859 __decorateClass$2Q([ 34860 n$5({ type: Array }) 34861 ], SonicEventSelector.prototype, "selectedIds", 2); 34862 __decorateClass$2Q([ 34863 n$5({ type: Array }) 34864 ], SonicEventSelector.prototype, "subscriptionTypeIds", 2); 34865 __decorateClass$2Q([ 34866 n$5({ type: Array }) 34867 ], SonicEventSelector.prototype, "subscriptionPriceIds", 2); 34868 __decorateClass$2Q([ 34869 c({ context: accessParamsContext, subscribe: true }), 34870 e$2({ context: accessParamsContext }), 34871 n$5({ type: Object }) 34872 ], SonicEventSelector.prototype, "accessParams", 2); 34873 SonicEventSelector = __decorateClass$2Q([ 34874 t$3("sonic-event-selector") 34875 ], SonicEventSelector); 34876 var __defProp$2M = Object.defineProperty; 34877 var __getOwnPropDesc$2P = Object.getOwnPropertyDescriptor; 34878 var __decorateClass$2P = (decorators, target, key, kind) => { 34879 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2P(target, key) : target; 34880 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 34881 if (decorator = decorators[i2]) 34882 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 34883 if (kind && result) __defProp$2M(target, key, result); 34884 return result; 34885 }; 34886 const tagName$1I = "sonic-session-selector"; 34887 let SonicSessionSelector = class extends i$6 { 34888 constructor() { 34889 super(...arguments); 34890 this.id = ""; 34891 this.subscriptionTypeIds = []; 34892 this.subscriptionPriceIds = []; 34893 this.markupNoItem = () => { 34894 return b$1`<sonic-no-result size="sm" class="my-8 mx-4"></sonic-no-result>`; 34895 }; 34896 this.dispatch = (id) => {
34897 if (!id || id == Number(this.id)) return; 34898 const event = new CustomEvent("select", { 34899 detail: { id, entity_type: EntityType.Event } 34900 }); 34901 this.dispatchEvent(event); 34902 }; 34903 this.markupItems = (item) => { 34904 const itemId = Number(item.id); 34905 if (!itemId) return A$1; 34906 const isActive = Number(this.id) === Number(itemId); 34907 return b$1` 34908 <sonic-button 34909 class="w-full gap-x-4 rounded-md hover:bg-neutral-50 group @container [&[active]]:pointer-events-none" 34910 variant="unstyled" 34911 value=${itemId} 34912 @click=${() => this.dispatch(itemId)} 34913 > 34914 <div class="flex items-center w-full"> 34915 <div class="py-2 px-2 @lg:px-4 grow "> 34916 <div class="flex items-center"> 34917 <sonic-date class="text-base @lg:text-lg font-bold" noShadowDom> </sonic-date> 34918 </div> 34919 <div class="mt-px flex items-center flex-wrap gap-x-5 gap-y-1 text-xs"> 34920 <sonic-event-location-hall noPlacement class="block text-neutral-500"></sonic-event-location-hall> 34921 ${item?.labels && item?.labels?.length > 0 ? b$1` <sonic-event-taxonomy 34922 .taxonomy=${item?.labels} 34923 key="label" 34924 size="inherit" 34925 class="inline-flex" 34926 ></sonic-event-taxonomy>` : A$1} 34927 ${itemId ? ( 34928 // on ne passe pas les accessParams 34929 // car on veut les statuts sans bypass des accessParams 34930 b$1`<sonic-event-additional-status 34931 dataProvider="${entityEndPoint({ 34932 entityType: EntityType.Event, 34933 entityId: itemId, 34934 view: entityView.status, 34935 ...this.appType !== "counter" ? { accessParams: this.accessParams } : {} 34936 })}" 34937 fetch 34938 size="inherit" 34939 class="flex flex-wrap gap-x-3 gap-y-1" 34940 variant="ghost" 34941 key="data" 34942 ></sonic-event-additional-status>` 34943 ) : A$1} 34944 </div> 34945 </div> 34946 ${isActive ? b$1`<sonic-icon 34947 name="circle-check" 34948 library="custom" 34949 prefix="solid" 34950 slot="suffix" 34951 class="mr-2 text-2xl" 34952 ></sonic-icon>` : A$1} 34953 </div> 34954 </sonic-button> 34955 <sonic-divider noMargin></sonic-divider> 34956 `; 34957 }; 34958 } 34959 render() { 34960 if (!this.id) return A$1; 34961 return b$1` 34962 <sonic-fetch 34963 dataProvider="${entityEndPoint({ 34964 entityType: "show", 34965 entityId: Number(this.id), 34966 next: true, 34967 accessParams: this.accessParams, 34968 subscriptionTypeIds: this.subscriptionTypeIds, 34969 subscriptionPriceIds: this.subscriptionPriceIds 34970 })}" 34971 key="data" 34972 > 34973 <sonic-product-summary></sonic-product-summary> 34974 <sonic-divider class="mt-4 mb-1"></sonic-divider> 34975 <sonic-list 34976 class="grid grid-cols-1 gap-1" 34977 subDataProvider="sessions" 34978 .items=${this.markupItems} 34979 .noItems=${this.markupNoItem} 34980 > 34981 </sonic-list> 34982 </sonic-fetch> 34983 `; 34984 } 34985 }; 34986 SonicSessionSelector.styles = [tailwind]; 34987 __decorateClass$2P([ 34988 n$5({ type: String, attribute: "data-id" }) 34989 ], SonicSessionSelector.prototype, "id", 2); 34990 __decorateClass$2P([ 34991 n$5({ type: Array }) 34992 ], SonicSessionSelector.prototype, "subscriptionTypeIds", 2); 34993 __decorateClass$2P([ 34994 n$5({ type: Array }) 34995 ], SonicSessionSelector.prototype, "subscriptionPriceIds", 2); 34996 __decorateClass$2P([ 34997 c({ context: accessParamsContext, subscribe: true }), 34998 e$2({ context: accessParamsContext }), 34999 n$5({ type: Object }) 35000 ], SonicSessionSelector.prototype, "accessParams", 2); 35001 __decorateClass$2P([ 35002 c({ context: appType, subscribe: true }), 35003 n$5({ type: String }) 35004 ], SonicSessionSelector.prototype, "appType", 2); 35005 SonicSessionSelector = __decorateClass$2P([ 35006 t$3(tagName$1I) 35007 ], SonicSessionSelector); 35008 function canEditPrice(mode2, entityType) { 35009 return mode2 === "default" && entityType !== EntityType.AdditionalProduct && entityType !== EntityType.Subscribe; 35010 } 35011 function canChangeEventSession(cartType, cartProvider) { 35012 return cartType !== "order" && cartProvider !== "cart/current"; 35013 } 35014 function sessionHasSeatmap(session) { 35015 return !!session?.room && ["place", "mixte"].includes(session.room.placing_type_key || ""); 35016 } 35017 function canShowSeatmapActions(accessParams, session) { 35018 const isRequestOrCampaign = getAccessType(accessParams) === AccessType.RESERVATION_REQUEST || getAccessType(accessParams) === AccessType.CAMPAIGN; 35019 return !isRequestOrCampaign && sessionHasSeatmap(session); 35020 } 35021 function isMultiSessionEntity(entity) { 35022 return !!entity && "multisession" in entity && !!entity.multisession; 35023 }
35024 function getSessionFromCart(cartProvider, entityId) { 35025 if (!entityId) return void 0; 35026 const entities = dp(cartProvider).data.entities.get(); 35027 return entities?.find((entity) => isSession(entity) && Number(entity.id) === entityId); 35028 } 35029 function isMultiSessionLineItem(cartProvider, item) { 35030 if (item.multisession_id) return true; 35031 return isMultiSessionEntity(getSessionFromCart(cartProvider, item.entity_id)); 35032 } 35033 function buildLineGroupQuery(items) { 35034 const first = items[0]; 35035 if (!first) return void 0; 35036 const { entity_type, entity_id, price, quota, parent_id } = first; 35037 const { id, amount } = price || {}; 35038 return { 35039 entity_type, 35040 entity_id, 35041 price: { id, amount }, 35042 quota, 35043 parent_id: parent_id || "null" 35044 }; 35045 } 35046 function buildEntityChangeQuery(firstItem) { 35047 return { 35048 parent_id: firstItem.parent_id || "null", 35049 entity_type: firstItem.entity_type, 35050 entity_id: firstItem.entity_id 35051 }; 35052 } 35053 function buildDetailRemoveQuery(itemId) { 35054 return { ids: [itemId] }; 35055 } 35056 function getSubscriptionFilterFromLineItems(lineItems, cartProvider) { 35057 const firstItem = lineItems[0]; 35058 if (!firstItem) { 35059 return { subscriptionTypeIds: [], subscriptionPriceIds: [] }; 35060 } 35061 const parentSubscription = getParentItem(firstItem, cartProvider); 35062 if (!parentSubscription?.entity_id) { 35063 return { subscriptionTypeIds: [], subscriptionPriceIds: [] }; 35064 } 35065 return { 35066 subscriptionTypeIds: [parentSubscription.entity_id.toString()], 35067 subscriptionPriceIds: parentSubscription.price?.id ? [Number(parentSubscription.price.id)] : [] 35068 }; 35069 } 35070 async function changeCartItemEvent(options) { 35071 const result = await Cart.set({ 35072 apiConfiguration: options.api.getApiConfiguration(), 35073 cartProvider: options.cartProvider, 35074 body: { entity_id: options.entity_id, entity_type: options.entity_type }, 35075 query: options.query 35076 }); 35077 if (result === "asRequested") { 35078 options.modal?.hide(); 35079 } 35080 } 35081 function removeCartItems(api2, cartProvider, query) { 35082 return Cart.removeItems({ 35083 apiConfiguration: api2.getApiConfiguration(), 35084 cartProvider, 35085 query 35086 }); 35087 } 35088 function openChangeEventModal(options) { 35089 const subscriptionFilter = getSubscriptionFilterFromLineItems(options.lineItems, options.cartProvider); 35090 return Modal.create({ 35091 title: t("change_event"), 35092 content: withAccessParams( 35093 options.accessParams, 35094 b$1`<sonic-event-selector 35095 .id=${options.lineItems[0].entity_id} 35096 excludeCurrent 35097 .subscriptionTypeIds=${subscriptionFilter.subscriptionTypeIds} 35098 .subscriptionPriceIds=${subscriptionFilter.subscriptionPriceIds} 35099 @select=${(event) => options.onSelect(event.detail.id, event.detail.entity_type)} 35100 ></sonic-event-selector>` 35101 ), 35102 maxWidth: "60rem", 35103 removeOnHide: true 35104 }); 35105 } 35106 function openChangeSessionModal(options) { 35107 const subscriptionFilter = getSubscriptionFilterFromLineItems(options.lineItems, options.cartProvider); 35108 return Modal.create({ 35109 title: t("change_session"), 35110 content: withAccessParams( 35111 options.accessParams, 35112 b$1`<sonic-session-selector 35113 data-id=${options.lineItems[0].entity_id} 35114 .subscriptionTypeIds=${subscriptionFilter.subscriptionTypeIds} 35115 .subscriptionPriceIds=${subscriptionFilter.subscriptionPriceIds} 35116 @select=${(event) => options.onSelect(event.detail.id, event.detail.entity_type)} 35117 ></sonic-session-selector>` 35118 ), 35119 maxWidth: "60rem", 35120 removeOnHide: true 35121 }); 35122 } 35123 function menuIcon(name) { 35124 return b$1`<sonic-icon name=${name} library="custom" slot="prefix"></sonic-icon>`; 35125 } 35126 function menuLabel(label2) { 35127 return b$1`<span>${label2}</span>`; 35128 } 35129 function renderChangeEventSessionItems(options) { 35130 const { ctx, lineItems, query, api: api2, isMultiSession } = options; 35131 if (!canChangeEventSession(ctx.cartType, ctx.cartProvider)) return A$1; 35132 if (lineItems[0]?.entity_type !== EntityType.Event) return A$1; 35133 let modal; 35134 const onSelect = (entity_id, entity_type) => changeCartItemEvent({ api: api2, cartProvider: ctx.cartProvider, query, entity_id, entity_type, modal }); 35135 return b$1` 35136 <sonic-menu-item @click=${() => modal = openChangeEventModal({ accessParams: ctx.accessParams, cartProvider: ctx.cartProvider, lineItems, onSelect })}> 35137 ${menuIcon("calendars")} ${menuLabel(t("change_event"))} 35138 </sonic-menu-item> 35139 ${isMultiSession ? b$1`<sonic-menu-item 35140 @click=${() => modal = openChangeSessionModal({ accessParams: ctx.accessParams, cartProvider: ctx.cartProvider, lineItems, onSelect })} 35141 > 35142 ${menuIcon("calendar-day")} ${menuLabel(t("change_session"))} 35143 </sonic-menu-item>` : A$1}
35144 <sonic-divider></sonic-divider> 35145 `; 35146 } 35147 function renderEditPriceItem(ctx, lineItems) { 35148 return b$1` 35149 <sonic-menu-item 35150 noAutoFill 35151 @click=${() => editPriceModal({ 35152 lineItems, 35153 cartProvider: ctx.cartProvider, 35154 accessParams: ctx.accessParams 35155 })} 35156 > 35157 ${menuIcon("circle-euro")} ${menuLabel(t("edit_price"))} 35158 </sonic-menu-item> 35159 <sonic-divider></sonic-divider> 35160 `; 35161 } 35162 function renderSeatmapMenuItems(ctx, sessionId) { 35163 if (!sessionId) return A$1; 35164 const priceContext = { entityId: sessionId, entityType: EntityType.Event }; 35165 return b$1` 35166 <sonic-menu-item 35167 noAutoFill 35168 @click=${() => addSeatsModal({ 35169 cartProvider: ctx.cartProvider, 35170 navigationMode: "cart", 35171 priceContext, 35172 accessParams: ctx.accessParams 35173 })} 35174 > 35175 ${menuIcon("loveseat")} ${menuLabel(t("add_tickets_with_seating"))} 35176 </sonic-menu-item> 35177 <sonic-menu-item 35178 noAutoFill 35179 @click=${() => editSeatsModal({ 35180 cartProvider: ctx.cartProvider, 35181 priceContext, 35182 accessParams: ctx.accessParams 35183 })} 35184 > 35185 ${menuIcon("arrow-right-arrow-left")} ${menuLabel(t("edit_selected_seats"))} 35186 </sonic-menu-item> 35187 `; 35188 } 35189 function renderAddTicketsItem(ctx, sessionId) { 35190 return b$1` 35191 <sonic-menu-item 35192 @click=${() => addTicketsModal({ id: sessionId, cartProvider: ctx.cartProvider, accessParams: ctx.accessParams })} 35193 > 35194 ${menuIcon("ticket")} ${menuLabel(t("add_tickets"))} 35195 </sonic-menu-item> 35196 <sonic-divider></sonic-divider> 35197 `; 35198 } 35199 function renderEditOwnerItem(item, cartProvider, needSubscription) { 35200 const icon2 = needSubscription ? "id-card" : "face-smile"; 35201 return b$1` 35202 <sonic-menu-item noAutoFill @click=${() => attachOwnerModal({ items: [item], cartProvider })}> 35203 ${menuIcon(icon2)} ${menuLabel(t("edit_owner"))} 35204 </sonic-menu-item> 35205 `; 35206 } 35207 function canEditSubscriptionPrice(cartType) { 35208 return cartType !== "cart"; 35209 } 35210 function renderEditSubscriptionOwnerItem(ctx, item) { 35211 return b$1` 35212 <sonic-menu-item 35213 @click=${() => editSubscriptionOwnerModal({ 35214 lineItem: item, 35215 cartProvider: ctx.cartProvider 35216 })} 35217 > 35218 ${menuIcon("id-card")} ${menuLabel(t("edit_owner"))} 35219 </sonic-menu-item> 35220 `; 35221 } 35222 function renderEditSubscriptionPriceItem(ctx, item) { 35223 return b$1` 35224 <sonic-menu-item @click=${() => editSubscriptionPriceModal({ lineItem: item, cartProvider: ctx.cartProvider })}> 35225 ${menuIcon("circle-euro")} ${menuLabel(t("edit_price"))} 35226 </sonic-menu-item> 35227 `; 35228 } 35229 function renderEventsChoiceItem(ctx, subscriptionItemId) { 35230 return b$1` 35231 <sonic-menu-item 35232 @click=${() => quickSelectModal({ 35233 cartProvider: ctx.cartProvider, 35234 selectedSubscriptionId: subscriptionItemId, 35235 accessParams: ctx.accessParams 35236 })} 35237 > 35238 ${menuIcon("calendar-check")} ${menuLabel(t("events_choice"))} 35239 </sonic-menu-item> 35240 `; 35241 } 35242 function renderAddProofItem(ctx, item) { 35243 return b$1` 35244 <sonic-menu-item 35245 @click=${() => addProofModal({ lineItem: item, cartProvider: ctx.cartProvider })} 35246 > 35247 ${menuIcon("file-arrow-up")} ${menuLabel(t("LIB_add_proof"))} 35248 </sonic-menu-item> 35249 `; 35250 } 35251 function renderUnlinkItem(options) { 35252 return b$1` 35253 <sonic-divider></sonic-divider> 35254 <sonic-menu-item 35255 noAutoFill 35256 ?disabled=${!options.canDetach} 35257 @click=${() => Cart.patchItems({ 35258 apiConfiguration: options.api.getApiConfiguration(), 35259 cartProvider: options.cartProvider, 35260 query: { ids: [options.itemId] }, 35261 body: { parent_id: "" } 35262 })} 35263 > 35264 ${menuIcon("link-slash")} ${menuLabel(t("unlink"))} 35265 </sonic-menu-item> 35266 `; 35267 } 35268 function renderRemoveMenuItem(onRemove, withDivider = false) { 35269 return b$1` 35270 ${withDivider ? b$1`<sonic-divider></sonic-divider>` : A$1} 35271 <sonic-menu-item @click=${onRemove} noAutoFill type="danger"> 35272 ${menuIcon("trash")} ${menuLabel(t("LIB_remove"))} 35273 </sonic-menu-item> 35274 `; 35275 } 35276 function renderTrashButton(onRemove) { 35277 return b$1` 35278 <sonic-button 35279 class="mr-auto" 35280 variant="ghost" 35281 shape="circle" 35282 size="sm" 35283 icon 35284 @click=${onRemove} 35285 data-aria-label=${t("LIB_remove")} 35286 noAutoFill 35287 > 35288 <sonic-icon name="trash" library="custom"></sonic-icon> 35289 </sonic-button> 35290 `; 35291 } 35292 function renderActionMenuShell(options) { 35293 const { triggerIcon, triggerVariant, menuMinWidth, menuItems, trashButton } = options; 35294 return b$1` 35295 ${trashButton ?? A$1} 35296 <sonic-pop class=${trashButton ? "ml-auto" : A$1} placement="bottom"> 35297 <sonic-button shape="circle" variant=${triggerVariant ?? A$1} size="sm" icon noAutoFill> 35298 <sonic-icon 35299 name=${triggerIcon} 35300 library="custom" 35301 size=${triggerIcon === "ellipsis-vertical" ? "lg" : A$1} 35302 ></sonic-icon> 35303 </sonic-button> 35304 <sonic-menu slot="content" size="sm" minWidth=${menuMinWidth}>${menuItems}</sonic-menu> 35305 </sonic-pop> 35306 `; 35307 } 35308 var __defProp$2L = Object.defineProperty; 35309 var __getOwnPropDesc$2O = Object.getOwnPropertyDescriptor; 35310 var __decorateClass$2O = (decorators, target, key, kind) => { 35311 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2O(target, key) : target; 35312 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 35313 if (decorator = decorators[i2]) 35314 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 35315 if (kind && result) __defProp$2L(target, key, result); 35316 return result; 35317 }; 35318 const tagName$1H = "sonic-cart-item-header-actions"; 35319 let SonicCartItemHeaderActions = class extends Subscriber$1(i$6) { 35320 constructor() { 35321 super(...arguments); 35322 this.mode = "default"; 35323 this.entity = {}; 35324 this.hash = ""; 35325 this.items = null; 35326 this.cartProvider = "cart/current"; 35327 } 35328 get actionContext() { 35329 return { 35330 cartProvider: this.cartProvider, 35331 accessParams: this.accessParams, 35332 cartType: this.cartType 35333 }; 35334 } 35335 render() {
35336 const isCondensed = this.layout === "condensed"; 35337 if (this.mode == "readonly" || !this.items?.length) { 35338 return A$1; 35339 } 35340 if ((this.mode == "split" || this.mode == "splitResult") && this.items.length) { 35341 return b$1`<sonic-cart-move-items-button 35342 .lineItems=${this.items} 35343 .size=${isCondensed ? "sm" : "md"} 35344 ></sonic-cart-move-items-button>`; 35345 } 35346 return this.renderActionMenu(); 35347 } 35348 renderActionMenu() { 35349 if (!this.items?.length) return A$1; 35350 const eventMenu = this.entity?.entity_type === EntityType.Event ? this.renderEventMenu(this.entity, this.items) : A$1; 35351 return renderActionMenuShell({ 35352 triggerIcon: "ellipsis-vertical", 35353 triggerVariant: "ghost", 35354 menuMinWidth: "13rem", 35355 menuItems: b$1` 35356 ${eventMenu} 35357 ${renderRemoveMenuItem(() => this.removeEntityTickets())} 35358 ` 35359 }); 35360 } 35361 renderEventMenu(entity, items) { 35362 if (entity.entity_type !== EntityType.Event || !entity.id) { 35363 return A$1; 35364 } 35365 const ctx = this.actionContext; 35366 const sessionId = parseInt(entity.id.toString()); 35367 const showSeatmapActions = canShowSeatmapActions(ctx.accessParams, entity); 35368 return b$1` 35369 ${renderChangeEventSessionItems({ 35370 ctx, 35371 lineItems: items, 35372 query: buildEntityChangeQuery(items[0]), 35373 api: this, 35374 isMultiSession: isMultiSessionEntity(entity) 35375 })} 35376 ${showSeatmapActions ? renderSeatmapMenuItems(ctx, sessionId) : renderAddTicketsItem(ctx, sessionId)} 35377 `; 35378 } 35379 removeEntityTickets() { 35380 if (!this.cartProvider) return; 35381 const entity_id = parseInt(this.props?.entity.id?.toString() || ""); 35382 const entity_type = this.props?.entity.entity_type; 35383 removeCartItems(this, this.cartProvider, { entity_id, entity_type, parent_id: "null" }); 35384 } 35385 }; 35386 SonicCartItemHeaderActions.styles = [tailwind]; 35387 __decorateClass$2O([ 35388 c({ context: layoutContext, subscribe: true }), 35389 n$5({ type: String }) 35390 ], SonicCartItemHeaderActions.prototype, "layout", 2); 35391 __decorateClass$2O([ 35392 c({ context: modeContext, subscribe: true }), 35393 n$5({ type: String }) 35394 ], SonicCartItemHeaderActions.prototype, "mode", 2); 35395 __decorateClass$2O([ 35396 c({ context: appType, subscribe: true }), 35397 n$5({ type: String }) 35398 ], SonicCartItemHeaderActions.prototype, "appType", 2); 35399 __decorateClass$2O([ 35400 c({ context: cartTypeContext, subscribe: true }), 35401 n$5({ type: String }) 35402 ], SonicCartItemHeaderActions.prototype, "cartType", 2); 35403 __decorateClass$2O([ 35404 c({ context: accessParamsContext, subscribe: true }), 35405 n$5({ type: Object }) 35406 ], SonicCartItemHeaderActions.prototype, "accessParams", 2); 35407 __decorateClass$2O([ 35408 n$5({ type: Object }) 35409 ], SonicCartItemHeaderActions.prototype, "entity", 2); 35410 __decorateClass$2O([ 35411 n$5({ type: String }) 35412 ], SonicCartItemHeaderActions.prototype, "hash", 2); 35413 __decorateClass$2O([ 35414 n$5({ type: Array }) 35415 ], SonicCartItemHeaderActions.prototype, "items", 2); 35416 __decorateClass$2O([ 35417 ancestorAttribute("cartProvider") 35418 ], SonicCartItemHeaderActions.prototype, "cartProvider", 2); 35419 SonicCartItemHeaderActions = __decorateClass$2O([ 35420 t$3(tagName$1H) 35421 ], SonicCartItemHeaderActions); 35422 var __defProp$2K = Object.defineProperty; 35423 var __getOwnPropDesc$2N = Object.getOwnPropertyDescriptor; 35424 var __decorateClass$2N = (decorators, target, key, kind) => { 35425 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2N(target, key) : target; 35426 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 35427 if (decorator = decorators[i2]) 35428 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 35429 if (kind && result) __defProp$2K(target, key, result); 35430 return result; 35431 }; 35432 let SonicRequestRemainingPlaces = class extends Subscriber(i$6) { 35433 constructor() { 35434 super(...arguments); 35435 this.entityQuotas = []; 35436 } 35437 async willUpdate(changedProperties) { 35438 const currentEntity = this.entity; 35439 if (this.appType === "counter" && isRequest(this.cartType)) { 35440 if (changedProperties.has("entity") || changedProperties.has("appType") && currentEntity) { 35441 this.entityQuotas = await fetchEntityQuotasStock( 35442 this, 35443 currentEntity?.entity_type ?? EntityType.Event, 35444 Number(currentEntity?.id) 35445 ); 35446 } 35447 } 35448 super.willUpdate(changedProperties); 35449 } 35450 render() { 35451 let disiredQuotas = []; 35452 this.entityQuotas.forEach((quota) => { 35453 if (this.items?.some((item) => item.quota?.id === quota.id)) { 35454 disiredQuotas.push(quota); 35455 } 35456 }); 35457 if (this.entityQuotas.length > 0 && disiredQuotas.length === 0) 35458 return b$1`<sonic-badge size="xs" type="danger">Pas de place pour ce contingent</sonic-badge>`; 35459 if (disiredQuotas.length === 0) return A$1; 35460 return b$1` <div class="flex flex-col gap-[1px] items-start"> 35461 ${disiredQuotas.map((quota) => { 35462 const wishedPlaces = this.items?.filter((item) => item.quota?.id === quota.id).reduce((acc, item) => acc + (item.quantity || 0), 0) || 0; 35463 const canBeSatisfied = wishedPlaces <= (quota.remaining_places_nb || 0); 35464 const title = quota.title === "Hors contingentement" ? "H.C." : quota.title; 35465 return b$1`<sonic-badge size="xs" type="${canBeSatisfied ? "success" : "danger"}"> 35466 <div class="flex items-center gap-1 leading-none"> 35467 ${title} <sonic-icon name="ticket" library="custom" size="lg"></sonic-icon> <b>${wishedPlaces}</b> / 35468 ${quota.remaining_places_nb} 35469 </div> 35470 </sonic-badge>`; 35471 })} 35472 </div>`; 35473 } 35474 }; 35475 SonicRequestRemainingPlaces.styles = [tailwind]; 35476 __decorateClass$2N([ 35477 c({ context: cartTypeContext, subscribe: true }), 35478 n$5({ type: String }) 35479 ], SonicRequestRemainingPlaces.prototype, "cartType", 2); 35480 __decorateClass$2N([ 35481 n$5({ type: Object }) 35482 ], SonicRequestRemainingPlaces.prototype, "entity", 2); 35483 __decorateClass$2N([ 35484 n$5({ type: Object }) 35485 ], SonicRequestRemainingPlaces.prototype, "items", 2); 35486 __decorateClass$2N([ 35487 r$5() 35488 ], SonicRequestRemainingPlaces.prototype, "entityQuotas", 2); 35489 __decorateClass$2N([ 35490 c({ context: appType, subscribe: true }), 35491 n$5({ type: String }) 35492 ], SonicRequestRemainingPlaces.prototype, "appType", 2); 35493 SonicRequestRemainingPlaces = __decorateClass$2N([ 35494 t$3("sonic-request-remaining-places") 35495 ], SonicRequestRemainingPlaces); 35496 var __defProp$2J = Object.defineProperty;
35497 var __getOwnPropDesc$2M = Object.getOwnPropertyDescriptor; 35498 var __decorateClass$2M = (decorators, target, key, kind) => { 35499 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2M(target, key) : target; 35500 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 35501 if (decorator = decorators[i2]) 35502 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 35503 if (kind && result) __defProp$2J(target, key, result); 35504 return result; 35505 }; 35506 let SonicCartItemHeader = class extends Subscriber$1(i$6) { 35507 constructor() { 35508 super(...arguments); 35509 this.textOnly = false; 35510 this.layout = "default"; 35511 this.mode = "default"; 35512 this.showDetail = false; 35513 this.entity = {}; 35514 this.items = null; 35515 this._cartProvider = ""; 35516 this.outsideTextToCheck = ["hors les murs", "outside", "extérieur", "auÃer Haus", "op locatie"]; 35517 } 35518 connectedCallback() { 35519 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 35520 super.connectedCallback(); 35521 } 35522 async willUpdate(changedProperties) { 35523 if (changedProperties.has("layout")) { 35524 if (this.layout == "condensed") { 35525 this.textOnly = true; 35526 } 35527 } 35528 super.willUpdate(changedProperties); 35529 } 35530 shouldCheckRemainingPlaces() { 35531 const status = dp$1(this._cartProvider).data.status.get(); 35532 return isRequest(this.cartType) && this.layout !== "condensed" && ![ReservationStatus.Deleted, ReservationStatus.Expired, ReservationStatus.Processed].includes(status); 35533 } 35534 // SWITCH LAYOUTS 35535 render() { 35536 const enableLink = this.mode == "default" && this.entity.entity_type !== EntityType.Subscribe; 35537 const isCondensed = this.layout == "condensed"; 35538 const size = isCondensed ? "xs" : "sm"; 35539 let outsideLabel = void 0; 35540 const entity = this.entity; 35541 if ("labels" in entity && entity.labels instanceof Array) { 35542 outsideLabel = entity.labels.find( 35543 (label2) => this.outsideTextToCheck.some((text) => label2.title?.toLowerCase() === text) 35544 ); 35545 } 35546 const features = this.showDetail ? [ProductDisplay.LocationFull] : []; 35547 return b$1`<div class="flex gap-2 w-full px-1"> 35548 <sonic-product-summary 35549 size="${size}" 35550 class="block flew-grow w-full min-w-0 self-center leading-tight ${enableLink ? "hover:bg-neutral-50 rounded" : ""}" 35551 subDataProvider="entity" 35552 ?link=${enableLink} 35553 ?textOnly=${this.textOnly} 35554 .featureDisplay=${features} 35555 > 35556 ${outsideLabel ? b$1`<sonic-badge size="xs" class="mt-1" type="info" slot="subTitle">${outsideLabel.title}</sonic-badge>` : A$1} 35557 ${this.shouldCheckRemainingPlaces() ? b$1`<div slot="infos"> 35558 <sonic-request-remaining-places 35559 .entity=${this.entity} 35560 .items=${this.items} 35561 ></sonic-request-remaining-places> 35562 </div>` : A$1} 35563 </sonic-product-summary> 35564 ${this.entity ? b$1`<sonic-cart-item-header-actions class="ml-auto block shrink-0 "></sonic-cart-item-header-actions> ` : A$1} 35565 </div>`; 35566 } 35567 }; 35568 SonicCartItemHeader.styles = [tailwind]; 35569 __decorateClass$2M([ 35570 n$5({ type: Boolean }) 35571 ], SonicCartItemHeader.prototype, "textOnly", 2); 35572 __decorateClass$2M([ 35573 c({ context: layoutContext, subscribe: true }), 35574 n$5({ type: String }) 35575 ], SonicCartItemHeader.prototype, "layout", 2); 35576 __decorateClass$2M([ 35577 c({ context: modeContext, subscribe: true }), 35578 n$5({ type: String }) 35579 ], SonicCartItemHeader.prototype, "mode", 2); 35580 __decorateClass$2M([ 35581 c({ context: detailContext, subscribe: true }), 35582 n$5({ type: Boolean }) 35583 ], SonicCartItemHeader.prototype, "showDetail", 2); 35584 __decorateClass$2M([ 35585 n$5({ type: Object }) 35586 ], SonicCartItemHeader.prototype, "entity", 2); 35587 __decorateClass$2M([ 35588 n$5({ type: Array }) 35589 ], SonicCartItemHeader.prototype, "items", 2); 35590 __decorateClass$2M([ 35591 c({ context: appType, subscribe: true }), 35592 n$5({ type: String }) 35593 ], SonicCartItemHeader.prototype, "appType", 2); 35594 __decorateClass$2M([ 35595 c({ context: cartTypeContext, subscribe: true }), 35596 n$5({ type: String }) 35597 ], SonicCartItemHeader.prototype, "cartType", 2); 35598 __decorateClass$2M([ 35599 r$5()
35600 ], SonicCartItemHeader.prototype, "_cartProvider", 2); 35601 SonicCartItemHeader = __decorateClass$2M([ 35602 t$3("sonic-cart-item-header") 35603 ], SonicCartItemHeader); 35604 var __defProp$2I = Object.defineProperty; 35605 var __getOwnPropDesc$2L = Object.getOwnPropertyDescriptor; 35606 var __decorateClass$2L = (decorators, target, key, kind) => { 35607 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2L(target, key) : target; 35608 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 35609 if (decorator = decorators[i2]) 35610 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 35611 if (kind && result) __defProp$2I(target, key, result); 35612 return result; 35613 }; 35614 let CartInput = class extends Input { 35615 constructor() { 35616 super(...arguments); 35617 this.entity_id = 0; 35618 this.entity_type = null; 35619 this.parent_id = null; 35620 this.price = {}; 35621 this.quota = null; 35622 this.shake = false; 35623 this.plusMinus = false; 35624 this.cartItemQuantity = 0; 35625 this.items = null; 35626 this.mode = "default"; 35627 this._queryQuantityIncrement = ""; 35628 this.cartOperationId = 0; 35629 this.bntPlus = /*html*/ 35630 ` 35631 <sonic-button 35632 slot="suffix" 35633 radio 35634 name="queryQuantityIncrement" 35635 autoRepeat 35636 value="1" 35637 shape="circle" 35638 size="xs" 35639 icon 35640 variant="unstyled" 35641 > 35642 <sonic-icon library="iconoir" name="plus"></sonic-icon> 35643 </sonic-button> 35644 `; 35645 this.btnMinus = /*html */ 35646 ` 35647 <sonic-button 35648 class="btnMinus" 35649 slot="prefix" 35650 name="queryQuantityIncrement" 35651 autoRepeat 35652 radio 35653 value="-1" 35654 shape="circle" 35655 size="xs" 35656 icon 35657 variant="unstyled" 35658 > 35659 <sonic-icon library="iconoir" name="minus"></sonic-icon> 35660 </sonic-button> 35661 `; 35662 } 35663 async handleChange(e2) { 35664 let value = this.input.value.trim(); 35665 value = value.replace(/\D/g, ""); 35666 this.input.value = value; 35667 if (value == "") return; 35668 super.handleChange(e2); 35669 await this.cartOperation(); 35670 } 35671 setValueFromPublisher(value) { 35672 super.setValueFromPublisher(value); 35673 const btnMinus = this.querySelector(".btnMinus"); 35674 if (parseInt(this.value) > 1) { 35675 btnMinus?.removeAttribute("disabled"); 35676 } else { 35677 btnMinus?.setAttribute("disabled", ""); 35678 } 35679 } 35680 handleBlur(e2) { 35681 super.handleBlur(e2); 35682 if (this.input.value.trim() == "") { 35683 this.input.value = this.value; 35684 } 35685 } 35686 get queryQuantityIncrement() { 35687 return this._queryQuantityIncrement; 35688 } 35689 set queryQuantityIncrement(value) { 35690 if (value == this.queryQuantityIncrement) return; 35691 this._queryQuantityIncrement = value; 35692 const id = ++CartInput.queryIncrementId; 35693 (async () => { 35694 await Utils.delayPromise(1); 35695 if (id !== CartInput.queryIncrementId) return; 35696 window.queueMicrotask(() => this.publisher.queryQuantityIncrement = null); 35697 if (!value) return; 35698 const increment = parseInt(value); 35699 if (isNaN(increment)) return; 35700 const quantity = parseInt(this.value || "0") + increment; 35701 if (quantity < 1) return; 35702 this.input.value = quantity.toString(); 35703 this.input.dispatchEvent(new Event("input")); 35704 })(); 35705 } 35706 async cartOperation() { 35707 const id = ++this.cartOperationId; 35708 await Utils.delayPromise(400); 35709 if (id !== this.cartOperationId) return; 35710 const quantity = Number(this.value); 35711 if (isNaN(quantity)) return; 35712 if (this.mode === "splitResult") { 35713 this.handleSplit(Number(this.input.value)); 35714 return; 35715 } else { 35716 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 35717 const query = { 35718 entity_type: this.entity_type || void 0, 35719 entity_id: this.entity_id, 35720 parent_id: this.parent_id || "null" 35721 }; 35722 if (this.quota) { 35723 query.quota = { id: this.quota.id }; 35724 } 35725 if (this.price) { 35726 query.price = { id: this.price.id, amount: this.price.amount }; 35727 } 35728 const result = await Cart.set({ 35729 apiConfiguration: this.getApiConfiguration(), 35730 cartProvider, 35731 query, 35732 body: { 35733 quantity 35734 } 35735 }); 35736 if (result === "differentFromRequest") { 35737 this.shake = true; 35738 await Utils.delayPromise(820); 35739 this.shake = false;
35740 } else { 35741 this.highlight(); 35742 } 35743 return result; 35744 } 35745 } 35746 async handleSplit(wantedQuantity) { 35747 if (!wantedQuantity) return; 35748 const currentItemsCount = this.items?.length || 0; 35749 const itemsDelta = wantedQuantity - currentItemsCount; 35750 if (itemsDelta === 0) return; 35751 const [sourceDP, targetDP] = itemsDelta > 0 ? ["splitSource", "splitResult"] : ["splitResult", "splitSource"]; 35752 const remainingItems = dp(sourceDP).items.get(); 35753 const matchingItems = this.filterMatchingItems(remainingItems); 35754 const itemsToMove = matchingItems.slice(0, Math.abs(itemsDelta)); 35755 if (itemsToMove.length > 0) { 35756 moveCartItems(itemsToMove, { 35757 targetDataProvider: targetDP, 35758 sourceDataProvider: sourceDP 35759 }); 35760 } else if (itemsDelta > 0) { 35761 await this.shakeAndResetInput(currentItemsCount); 35762 } 35763 } 35764 // Helper method to filter matching items 35765 filterMatchingItems(items) { 35766 return items.filter( 35767 (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 35768 ); 35769 } 35770 // Helper method for shake animation and input reset 35771 async shakeAndResetInput(value) { 35772 this.shake = true; 35773 this.input.value = value.toString(); 35774 await Utils.delayPromise(820); 35775 this.shake = false; 35776 } 35777 connectedCallback() { 35778 this.setAttribute("pattern", "\\d+"); 35779 this.setAttribute("noAppearance", ""); 35780 this.setAttribute("name", "quantity"); 35781 this.setAttribute("inlineContent", ""); 35782 this.setAttribute("type", "number"); 35783 super.connectedCallback(); 35784 this.setAttribute("formDataProvider", this.dataProvider || ""); 35785 } 35786 willUpdate(changedProperties) { 35787 if (changedProperties.has("shake")) { 35788 if (this.shake) { 35789 this.status = "error"; 35790 setTimeout(() => { 35791 this.shake = false; 35792 this.status = "default"; 35793 }, 900); 35794 } 35795 } 35796 if (changedProperties.has("plusMinus")) { 35797 if (this.plusMinus && !this.readonly) { 35798 this.innerHTML = this.btnMinus + this.bntPlus; 35799 } else { 35800 this.innerHTML = ""; 35801 } 35802 } 35803 super.willUpdate(changedProperties); 35804 } 35805 highlight() { 35806 this.status = "success"; 35807 setTimeout(() => { 35808 this.status = "default"; 35809 }, 900); 35810 } 35811 }; 35812 CartInput.styles = [ 35813 ...Input.styles, 35814 i$9` 35815 :host { 35816 display: inline-block; 35817 text-align: center; 35818 width: max(2.5rem, 2ch); 35819 } 35820 :host([plusMinus]) { 35821 width: 5rem; 35822 } 35823 :host([plusMinus][size="2xs"]) { 35824 width: 5rem; 35825 } 35826 35827 :host([shake]) { 35828 animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; 35829 transform: translate3d(0, 0, 0); 35830 backface-visibility: hidden; 35831 perspective: 1000px; 35832 } 35833 35834 :host([readonly]) .form-element { 35835 --sc-input-border: var(--sc-base-50) !important; 35836 --sc-input-background: var(--sc-base-50) !important; 35837 } 35838 35839 @keyframes shake { 35840 10%, 35841 90% { 35842 transform: translate3d(-1px, 0, 0); 35843 } 35844 35845 20%, 35846 80% { 35847 transform: translate3d(2px, 0, 0); 35848 } 35849 35850 30%, 35851 50%, 35852 70% { 35853 transform: translate3d(-3px, 0, 0); 35854 } 35855 35856 40%, 35857 60% { 35858 transform: translate3d(3px, 0, 0); 35859 } 35860 } 35861 ` 35862 ]; 35863 CartInput.queryIncrementId = 0; 35864 __decorateClass$2L([ 35865 n$5({ type: Number }) 35866 ], CartInput.prototype, "entity_id", 2); 35867 __decorateClass$2L([ 35868 n$5({ type: String }) 35869 ], CartInput.prototype, "entity_type", 2); 35870 __decorateClass$2L([ 35871 n$5({ type: String }) 35872 ], CartInput.prototype, "parent_id", 2); 35873 __decorateClass$2L([ 35874 n$5({ type: Object }) 35875 ], CartInput.prototype, "price", 2); 35876 __decorateClass$2L([ 35877 n$5({ type: Object }) 35878 ], CartInput.prototype, "quota", 2); 35879 __decorateClass$2L([ 35880 n$5({ type: Boolean, reflect: true }) 35881 ], CartInput.prototype, "shake", 2); 35882 __decorateClass$2L([ 35883 n$5({ type: Boolean, reflect: true }) 35884 ], CartInput.prototype, "plusMinus", 2); 35885 __decorateClass$2L([ 35886 n$5({ type: Number }) 35887 ], CartInput.prototype, "cartItemQuantity", 2); 35888 __decorateClass$2L([ 35889 n$5({ type: Array }) 35890 ], CartInput.prototype, "items", 2); 35891 __decorateClass$2L([ 35892 c({ context: modeContext, subscribe: true }), 35893 n$5({ type: String }) 35894 ], CartInput.prototype, "mode", 2); 35895 __decorateClass$2L([ 35896 r$5() 35897 ], CartInput.prototype, "queryQuantityIncrement", 1); 35898 CartInput = __decorateClass$2L([ 35899 t$3("sonic-cart-input") 35900 ], CartInput); 35901 var __defProp$2H = Object.defineProperty; 35902 var __getOwnPropDesc$2K = Object.getOwnPropertyDescriptor; 35903 var __decorateClass$2K = (decorators, target, key, kind) => { 35904 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2K(target, key) : target; 35905 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 35906 if (decorator = decorators[i2]) 35907 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 35908 if (kind && result) __defProp$2H(target, key, result); 35909 return result; 35910 }; 35911 const tagName$1G = "sonic-cart-item-line-messages"; 35912 let CartItemLineMessages = class extends Subscriber$1(i$6) { 35913 constructor() { 35914 super(...arguments); 35915 this.messages = []; 35916 this.size = "sm"; 35917 } 35918 render() { 35919 return this.messages.map( 35920 (msg) => msg.type === "public" && ["warning", "error"].includes(msg.status || "") ? b$1`<sonic-alert status="${msg.status || "default"}" size="${this.size}"> 35921 ${o$6(msg.content)}</sonic-alert 35922 >` : A$1 35923 ); 35924 } 35925 }; 35926 __decorateClass$2K([ 35927 n$5({ type: Array }) 35928 ], CartItemLineMessages.prototype, "messages", 2); 35929 __decorateClass$2K([ 35930 n$5({ type: String }) 35931 ], CartItemLineMessages.prototype, "size", 2); 35932 CartItemLineMessages = __decorateClass$2K([ 35933 t$3(tagName$1G) 35934 ], CartItemLineMessages); 35935 async function fetchPriceEntity(api2, endpoint) { 35936 const result = await api2.get(endpoint); 35937 const data = result?.data; 35938 if (!data) return void 0; 35939 return { 35940 quotas: "quotas" in data ? data.quotas ?? [] : [], 35941 prices: data.prices ?? [], 35942 placesCategories: "places_categories" in data ? data.places_categories ?? [] : [], 35943 stock: data.stock 35944 }; 35945 } 35946 function prepareQuotas(quotas, isCustomerMode) { 35947 return isCustomerMode ? filterQuotasForCustomer(quotas) : quotas; 35948 } 35949 function resolveQuotaIdOnLoad(quotas, {
35950 currentQuotaId, 35951 preferredQuotaId, 35952 isEditMode, 35953 isCustomerMode 35954 }) { 35955 if (!isEditMode && preferredQuotaId) { 35956 const preferred = quotas.find((quota) => Number(quota.id) === Number(preferredQuotaId)); 35957 if (preferred && !isQuotaUnavailable(preferred, isCustomerMode)) { 35958 return preferredQuotaId; 35959 } 35960 } 35961 if (isCustomerMode) { 35962 const current2 = quotas.find((quota) => quota.id === currentQuotaId); 35963 if (!current2 || isQuotaUnavailable(current2, true)) { 35964 const firstAvailable = quotas.find((quota) => !isQuotaUnavailable(quota, true)); 35965 if (firstAvailable?.id != null) return Number(firstAvailable.id); 35966 } 35967 } 35968 return currentQuotaId; 35969 } 35970 function buildEditFormValues(edit) { 35971 const initialPrice = edit.initialPrice; 35972 return { 35973 price: { 35974 id: initialPrice?.id || 0, 35975 amount: initialPrice?.is_free_price ? Number(initialPrice.amount || 0) : void 0 35976 }, 35977 quota: { id: edit.initialQuotaId || 0 }, 35978 category: { id: Number(edit.lineItems?.[0]?.price?.placeCategory?.id) || 0 } 35979 }; 35980 } 35981 var __decorate$8 = function(decorators, target, key, desc) { 35982 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 35983 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 35984 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; 35985 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 35986 }; 35987 const tagName$1F = "sonic-radio"; 35988 let Radio = class Radio extends Checkbox { 35989 constructor() { 35990 super(); 35991 this.radio = true; 35992 } 35993 willUpdate(changedProperties) { 35994 const typeChanged = changedProperties.has("type"); 35995 super.willUpdate(changedProperties); 35996 if (typeChanged) { 35997 this.type = "radio"; 35998 } 35999 } 36000 connectedCallback() { 36001 super.connectedCallback(); 36002 this.type = "radio"; 36003 } 36004 }; 36005 Radio.styles = [ 36006 Checkbox.styles, 36007 i$9` 36008 :host input { 36009 border-radius: 50%; 36010 } 36011 :host sonic-icon { 36012 border-radius: 50%; 36013 overflow: hidden; 36014 background-color: var(--sc-primary-content, var(--sc-base, #fff)); 36015 line-height: 0; 36016 display: block; 36017 font-size: 1em; 36018 height: 0.6em; 36019 height: round(0.6em, 1px); 36020 width: 0.6em; 36021 width: round(0.6em, 1px); 36022 } 36023 ` 36024 ]; 36025 Radio = __decorate$8([ 36026 t$3(tagName$1F) 36027 ], Radio); 36028 var __defProp$2G = Object.defineProperty; 36029 var __getOwnPropDesc$2J = Object.getOwnPropertyDescriptor; 36030 var __decorateClass$2J = (decorators, target, key, kind) => { 36031 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2J(target, key) : target; 36032 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36033 if (decorator = decorators[i2]) 36034 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36035 if (kind && result) __defProp$2G(target, key, result); 36036 return result; 36037 }; 36038 const tagName$1E = "sonic-subscription-requirement-warning"; 36039 let SonicSubscriptionRequirementWarning = class extends Subscriber$1(i$6) { 36040 constructor() { 36041 super(...arguments); 36042 this.prices = []; 36043 } 36044 render() { 36045 const pricesMatchingQuota = this.selectedQuota ? this.prices.filter((p2) => this.selectedQuota?.prices?.some((q) => q.price_id == p2.id)) : this.prices; 36046 const subIsRequired = isSubscriptionRequired(this.subscriptionRequirement, this.appType); 36047 if (!subIsRequired) { 36048 return A$1; 36049 } 36050 const hasPrices = this.selectedQuota?.prices && this.selectedQuota?.prices.length > 0; 36051 if (!hasPrices) { 36052 return A$1; 36053 } 36054 const isWaitingListContext = this.accessParams?.isWaitingList; 36055 if (isWaitingListContext) { 36056 return A$1; 36057 } 36058 const allPricesNeedSubscription = pricesMatchingQuota.length > 0 && pricesMatchingQuota.every((p2) => p2.need_subscription); 36059 const hasPriceAvailable = this.selectedQuota ? this.selectedQuota.remaining_places_nb !== 0 : true; 36060 const displayWarning = subIsRequired && allPricesNeedSubscription && hasPrices && hasPriceAvailable; 36061 if (displayWarning) { 36062 return b$1`<sonic-alert 36063 status="info" 36064 background 36065 size="sm" 36066 class="my-8" 36067 label=${t("LIB_restriction_individuelle_warning_title")} 36068 > 36069 <sonic-icon library="custom" name="id-card" slot="icon"></sonic-icon> 36070 <div>${t("LIB_restriction_individuelle_warning_subtitle")}</div> 36071 <sonic-app-link 36072 to="subscription" 36073 variant="default" 36074 type="info" 36075 size="xs" 36076 class="mt-1 font-medium" 36077 autoactive="disabled" 36078 > 36079 <sonic-icon library="custom" name="arrow-right"></sonic-icon> 36080 ${t("onglet_home_abonnements")} 36081 </sonic-app-link> 36082 </sonic-alert>`; 36083 } else { 36084 return A$1; 36085 } 36086 } 36087 }; 36088 SonicSubscriptionRequirementWarning.styles = [tailwind]; 36089 __decorateClass$2J([ 36090 c({ context: appType, subscribe: true }), 36091 r$5() 36092 ], SonicSubscriptionRequirementWarning.prototype, "appType", 2); 36093 __decorateClass$2J([ 36094 c({ context: accessParamsContext, subscribe: true }), 36095 n$5({ type: Object }) 36096 ], SonicSubscriptionRequirementWarning.prototype, "accessParams", 2); 36097 __decorateClass$2J([ 36098 bind$1("settings.subscriptionRequirement"), 36099 r$5() 36100 ], SonicSubscriptionRequirementWarning.prototype, "subscriptionRequirement", 2); 36101 __decorateClass$2J([ 36102 n$5({ type: Array }) 36103 ], SonicSubscriptionRequirementWarning.prototype, "prices", 2); 36104 __decorateClass$2J([ 36105 n$5({ type: Object }) 36106 ], SonicSubscriptionRequirementWarning.prototype, "selectedQuota", 2); 36107 SonicSubscriptionRequirementWarning = __decorateClass$2J([ 36108 t$3(tagName$1E) 36109 ], SonicSubscriptionRequirementWarning); 36110 var __defProp$2F = Object.defineProperty; 36111 var __getOwnPropDesc$2I = Object.getOwnPropertyDescriptor; 36112 var __decorateClass$2I = (decorators, target, key, kind) => { 36113 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2I(target, key) : target; 36114 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36115 if (decorator = decorators[i2]) 36116 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36117 if (kind && result) __defProp$2F(target, key, result); 36118 return result; 36119 }; 36120 const tagName$1D = "sonic-price-selection-form"; 36121 let instanceCount$1 = 0; 36122 let PriceSelectionForm = class extends i$6 { 36123 constructor() { 36124 super(...arguments); 36125 this.cartProvider = "cart/current"; 36126 this.seatmapProvider = ""; 36127 this.fallbackAvailableQuota = true; 36128 this.showSubmitButton = true; 36129 this._isLoading = false;
36130 this._isSubmitting = false; 36131 this._stockQuotas = []; 36132 this._filterPriceByQuota = true; 36133 this.formDataProvider = `priceSelectionForm/${instanceCount$1++}`; 36134 this.quotaUpdatePolicyDataProvider = `priceSelectionPolicyForm/${instanceCount$1++}`; 36135 this.onQuotaChange = () => this.handleFormChange("quota"); 36136 this.onCategoryChange = () => this.handleFormChange("category"); 36137 this.onPriceChange = () => this.handleFormChange("price"); 36138 this.handleFormChange = (scope) => { 36139 const form2 = this.readForm(); 36140 const view = this.buildView(form2); 36141 syncFormSelection( 36142 { 36143 selection: view.selection, 36144 selectedCategoryId: form2.categoryId, 36145 selectedPriceId: form2.priceId, 36146 shouldShowQuantitySelect: view.shouldShowQuantitySelect, 36147 minQuantity: view.minQuantity, 36148 maxQuantity: view.maxQuantity, 36149 selectedQuantity: form2.quantity || view.minQuantity 36150 }, 36151 this.formMutators, 36152 scope 36153 ); 36154 if (scope !== "price") this.requestUpdate(); 36155 }; 36156 } 36157 get isEditMode() { 36158 return !!this.priceContext?.edit?.lineItems?.length; 36159 } 36160 get isCounterMode() { 36161 return this.appType === "counter"; 36162 } 36163 get isCustomerMode() { 36164 return this.appType === "customer"; 36165 } 36166 get editCategoryId() { 36167 const id = Number(this.priceContext?.edit?.lineItems?.[0]?.price?.placeCategory?.id); 36168 return this.isEditMode && id ? id : void 0; 36169 } 36170 readForm() { 36171 const form2 = dp(this.formDataProvider); 36172 const freeAmount = form2.price.amount.get(); 36173 return { 36174 quotaId: Number(form2.quota.id.get()) || 0, 36175 categoryId: Number(form2.category.id.get()) || 0, 36176 priceId: Number(form2.price.id.get()) || 0, 36177 quantity: Number(form2.quantity.get()) || 1, 36178 ...freeAmount !== void 0 && freeAmount !== "" && { freePriceAmount: Number(freeAmount) } 36179 }; 36180 } 36181 buildView(form2 = this.readForm()) { 36182 const selectedQuota = this._availableQuotas?.find((quota) => quota.id === form2.quotaId); 36183 return buildPriceFormView({ 36184 form: form2, 36185 allPrices: this._allPrices ?? [], 36186 placesCategories: this._placesCategories, 36187 stock: this._stock, 36188 quota: selectedQuota, 36189 filterByQuota: this._filterPriceByQuota, 36190 editCategoryId: this.editCategoryId, 36191 mode: this.isEditMode ? "edit" : "add", 36192 initialQuotaId: this.priceContext?.edit?.initialQuotaId, 36193 isCustomerMode: this.isCustomerMode, 36194 parentSubscriptionId: this.priceContext?.parentSubscription?.id 36195 }); 36196 } 36197 get formMutators() { 36198 const form2 = dp(this.formDataProvider); 36199 return { 36200 setCategoryId: (id) => form2.category.id.set(id), 36201 setPriceId: (id) => form2.price.id.set(id), 36202 setQuantity: (quantity) => form2.quantity.set(String(quantity)) 36203 }; 36204 } 36205 connectedCallback() { 36206 super.connectedCallback(); 36207 const form2 = dp(this.formDataProvider); 36208 form2.quota.id.onAssign(this.onQuotaChange); 36209 form2.category.id.onAssign(this.onCategoryChange); 36210 form2.price.id.onAssign(this.onPriceChange); 36211 } 36212 disconnectedCallback() { 36213 const form2 = dp(this.formDataProvider); 36214 form2.quota.id.offAssign(this.onQuotaChange); 36215 form2.category.id.offAssign(this.onCategoryChange); 36216 form2.price.id.offAssign(this.onPriceChange); 36217 super.disconnectedCallback(); 36218 } 36219 async fetchEntityData() { 36220 const { entityType, entityId } = this.priceContext || {}; 36221 if (!entityType || !entityId) return; 36222 this._isLoading = true; 36223 try { 36224 const api2 = new API(HTML.getApiConfiguration(this)); 36225 const endpoint = priceEndPoint( 36226 { entityType, entityId, parentSubscription: this.priceContext?.parentSubscription }, 36227 this.accessParams 36228 ); 36229 const data = await fetchPriceEntity(api2, endpoint); 36230 if (!data) return; 36231 this._availableQuotas = prepareQuotas(data.quotas, this.isCustomerMode); 36232 this._placesCategories = data.placesCategories; 36233 this._stock = data.stock; 36234 this._allPrices = data.prices; 36235 this._stockQuotas = shouldFetchQuotasStockDisplay(this.appType, this.accessParams) ? await fetchEntityQuotasStock(this, entityType, Number(entityId)) : []; 36236 const quotaId = resolveQuotaIdOnLoad(this._availableQuotas, { 36237 currentQuotaId: this.readForm().quotaId, 36238 preferredQuotaId: this.preferredQuotaId, 36239 isEditMode: this.isEditMode,
36240 isCustomerMode: this.isCustomerMode 36241 }); 36242 if (quotaId !== this.readForm().quotaId) { 36243 dp(this.formDataProvider).quota.id.set(quotaId); 36244 } 36245 this.handleFormChange("quota"); 36246 } finally { 36247 this._isLoading = false; 36248 } 36249 } 36250 async willUpdate(changedProperties) { 36251 if ((changedProperties.has("priceContext") || changedProperties.has("accessParams")) && this.priceContext?.entityType && this.priceContext?.entityId) { 36252 await this.fetchEntityData(); 36253 if (this.priceContext?.edit) { 36254 dp(this.formDataProvider).set(buildEditFormValues(this.priceContext.edit)); 36255 } 36256 } 36257 if (changedProperties.has("_filterPriceByQuota")) { 36258 this.handleFormChange("quota"); 36259 } 36260 if (changedProperties.has("appType") && this.isCounterMode) { 36261 this._filterPriceByQuota = false; 36262 } 36263 super.willUpdate(changedProperties); 36264 } 36265 async handleSubmit() { 36266 const form2 = this.readForm(); 36267 const view = this.buildView(form2); 36268 this._isSubmitting = true; 36269 try { 36270 const apiConfiguration = HTML.getApiConfiguration(this); 36271 const priceBody = { 36272 id: view.selectedPrice.id || 0, 36273 ...view.freePriceAmount && { is_free_price: true, amount: view.freePriceAmount } 36274 }; 36275 if (this.isEditMode) { 36276 const edit = this.priceContext.edit; 36277 const itemIds = edit.lineItems?.map((item) => item.id).filter((id) => id !== void 0) ?? []; 36278 const query = itemIds.length ? { ids: itemIds } : { 36279 entity_type: this.priceContext?.entityType, 36280 entity_id: Number(this.priceContext?.entityId), 36281 parent_id: this.priceContext?.parentSubscription?.id || "null", 36282 price: { id: edit.initialPrice?.id }, 36283 quota: { id: edit.initialQuotaId } 36284 }; 36285 const result = await Cart.patchItems({ 36286 apiConfiguration, 36287 cartProvider: this.cartProvider, 36288 query, 36289 body: { 36290 price: priceBody, 36291 quota: { id: form2.quotaId }, 36292 quota_update_strategy: dp(this.quotaUpdatePolicyDataProvider).quota_update_strategy.get() 36293 } 36294 }); 36295 if (result === "asRequested") { 36296 this.dispatchEvent( 36297 new CustomEvent("updated", { 36298 detail: { itemIds: itemIds.map(String) } 36299 }) 36300 ); 36301 } 36302 } else { 36303 const result = await Cart.addItems({ 36304 apiConfiguration, 36305 cartProvider: this.cartProvider, 36306 items: createItemsToAdd({ 36307 entity_id: Number(this.priceContext?.entityId), 36308 entity_type: this.priceContext?.entityType || EntityType.Event, 36309 parent_id: this.priceContext?.parentSubscription?.id || void 0, 36310 selectedQuotaId: form2.quotaId, 36311 selectedPriceId: Number(view.selectedPrice.id) || 0, 36312 freePriceAmount: view.freePriceAmount, 36313 quantity: view.submitQuantity 36314 }), 36315 auto_seating: true, 36316 fallback_available_quota: this.fallbackAvailableQuota, 36317 attachOwnersAfterRequest: true, 36318 accessParams: this.accessParams ?? void 0 36319 }); 36320 if (result === "asRequested") { 36321 if (this.seatmapProvider) updateSeatmapStatus(this.seatmapProvider); 36322 this.dispatchEvent(new CustomEvent("added")); 36323 } 36324 } 36325 } finally { 36326 this._isSubmitting = false; 36327 } 36328 } 36329 render() { 36330 const { entityType, entityId } = this.priceContext || {}; 36331 if (this._isLoading) { 36332 return b$1`<div class="mt-3"><sonic-loader mode="inline" align="left"></sonic-loader></div>`; 36333 } 36334 if (!entityType || !entityId) return A$1; 36335 const form2 = this.readForm(); 36336 const view = this.buildView(form2); 36337 const { selection, validation, prices, selectedQuota } = view; 36338 const showQuotaStrategy = this.isEditMode && this.priceContext?.edit?.lineItems.some((item) => !!item.seat?.id) && this.priceContext?.edit?.initialQuotaId !== form2.quotaId; 36339 return b$1` 36340 <div class="grid grid-cols-1 gap-5" formDataProvider="${this.formDataProvider}" dataProvider="cart/editForm"> 36341 ${this._availableQuotas?.length ? b$1` 36342 <sonic-select 36343 class="grow block ${this._availableQuotas.length === 1 ? "hidden" : ""}" 36344 .label="${this.isCounterMode ? "Contingentement" : ""}" 36345 name="quota.id" 36346 .options=${this.buildQuotaOptions(form2.quotaId)} 36347 ></sonic-select> 36348 ` : A$1} 36349 ${selection.showCategorySelect ? b$1` 36350 <sonic-select 36351 class="grow shrink-0 block" 36352 data-aria-label="${t("LIB_categories")}" 36353 name="category.id" 36354 label=${!selection.displayCategories.some((c2) => c2.title?.toLowerCase().includes("cat")) ? t("LIB_categories") : ""} 36355 .options=${categoriesToOptions(selection.displayCategories, form2.categoryId)} 36356 > 36357 ${this.getCategoryColor(form2.categoryId) ? b$1`<div 36358 slot="prefix" 36359 class="size-5 rounded-full shrink-0 border border-neutral-500" 36360 style="background-color: ${this.getCategoryColor(form2.categoryId)}" 36361 ></div>` : A$1} 36362 </sonic-select> 36363 ` : A$1} 36364 <div class="flex gap-2"> 36365 ${!validation.canSubmit ? b$1`<sonic-alert 36366 background 36367 status="error" 36368 label="${validation.errorMessage}" 36369 text="${validation.errorSubtitle}" 36370 class="w-full" 36371 > 36372 </sonic-alert>` : b$1`<div class="grow"> 36373 <sonic-select name="price.id" .options=${pricesToOptions(prices, { selectedPriceId: form2.priceId })}> 36374 <div slot="label"> 36375 ${prices.length > 1 ? t("prices") : t("price")} 36376 ${prices.length > 1 ? b$1`<sonic-badge type="info" size="xs" class="-top-[2px] relative" 36377 >${prices.length} ${t("disponibles")}<sonic-icon 36378 name="arrow-down" 36379 library="custom" 36380 size="xs" 36381 ></sonic-icon> 36382 </sonic-badge>` : A$1} 36383 </div> 36384 </sonic-select> 36385 </div>`} 36386 ${this.renderFreeAmountInput(view)} 36387 ${view.shouldShowQuantitySelect ? b$1` 36388 <sonic-select 36389 class="shrink-0 w-[5rem]" 36390 label="${t("quantity")}" 36391 name="quantity" 36392 .options=${quantityToOptions(view.maxQuantity, view.minQuantity, form2.quantity)} 36393 ></sonic-select> 36394 ` : A$1} 36395 </div> 36396 ${this.isCounterMode && this._availableQuotas?.length ? b$1` 36397 <div class="text-sm text-neutral-400 mb-3 -mt-2"> 36398 <sonic-button 36399 size="inherit" 36400 class="mt-1" 36401 variant="link" 36402 @click=${() => this._filterPriceByQuota = !this._filterPriceByQuota} 36403 noAutoFill 36404 > 36405 <sonic-icon 36406 name="${this._filterPriceByQuota ? "filter-slash" : "filter"}" 36407 library="custom" 36408 ></sonic-icon> 36409 ${this._filterPriceByQuota ? "Afficher tous les tarifs" : "Filtrer les tarifs selon le contingentement"} 36410 </sonic-button> 36411 </div> 36412 ` : A$1} 36413 ${showQuotaStrategy ? this.renderQuotaStrategyWarning() : A$1} 36414 ${this.showSubmitButton ? b$1` 36415 <sonic-button 36416 ?disabled=${!validation.canSubmit} 36417 ?loading=${this._isSubmitting} 36418 type="success" 36419 noAutoFill 36420 class="w-full" 36421 @click=${this.handleSubmit} 36422 > 36423 <sonic-icon name="check" library="custom"></sonic-icon> 36424 ${this.isEditMode ? PRICE_MESSAGES.save : PRICE_MESSAGES.add} 36425 </sonic-button> 36426 ` : A$1} 36427 </div> 36428 36429 ${!this.priceContext?.parentSubscription?.id ? b$1` 36430 <sonic-subscription-requirement-warning 36431 .prices=${selection.availablePrices} 36432 .selectedQuota=${selectedQuota} 36433 ></sonic-subscription-requirement-warning> 36434 ` : A$1} 36435 `; 36436 } 36437 renderQuotaStrategyWarning() { 36438 return b$1` 36439 ${this.isCounterMode ? b$1`<div>
36440 <sonic-divider align="left" class="text-neutral-400 mb-3 mt-0" size="sm" 36441 >Modification du contingentement</sonic-divider 36442 > 36443 <div class="flex gap-6" formDataProvider="${this.quotaUpdatePolicyDataProvider}"> 36444 <sonic-radio name="quota_update_strategy" value="update_seat_quota" checked> 36445 <div class="text-pretty">Modifier le contingentement de la place</div> 36446 </sonic-radio> 36447 <sonic-radio name="quota_update_strategy" value="change_seat"> 36448 <sonic-icon name="arrow-right-arrow-left" library="custom"></sonic-icon> 36449 Replacement auto 36450 </sonic-radio> 36451 </div> 36452 </div>` : A$1} 36453 ${this.isCustomerMode ? b$1`<sonic-alert background status="warning" label="${t("LIB_replacement_auto_warning")}"></sonic-alert>` : A$1} 36454 `; 36455 } 36456 buildQuotaOptions(selectedQuotaId) { 36457 if (!this._availableQuotas?.length) return []; 36458 return buildQuotaSelectOptions({ 36459 quotas: this._availableQuotas, 36460 stockQuotas: this._stockQuotas, 36461 selectedQuotaId, 36462 isCounterMode: this.isCounterMode, 36463 isCustomerMode: this.isCustomerMode 36464 }); 36465 } 36466 getCategoryColor(categoryId) { 36467 const color = this.seatMapData?.conf?.categorie?.find( 36468 (item) => Number(item.id) === Number(categoryId) 36469 )?.couleur; 36470 return color ? `#${color}` : void 0; 36471 } 36472 renderFreeAmountInput(view) { 36473 const price = view.selectedPrice; 36474 if (!price?.is_free_price) return A$1; 36475 const minAmount = price.free_price?.min || 0; 36476 const maxAmount = price.free_price?.max || void 0; 36477 const quantity = this.priceContext?.edit?.lineItems.length; 36478 return b$1` 36479 <div> 36480 <div class="font-bold w-[10rem] items-center flex gap-2"> 36481 <sonic-input 36482 type="number" 36483 name="price.amount" 36484 label="${t("Montant")}" 36485 min=${minAmount} 36486 max=${o$4(maxAmount)} 36487 suffix="â¬" 36488 inlineContent 36489 > 36490 <div slot="suffix">â¬</div> 36491 </sonic-input> 36492 ${quantity ? b$1`<div class="flex gap-1 mr-2 items-center pt-5 font-normal"> 36493 <sonic-icon name="xmark" size="xs" library="custom"></sonic-icon> 36494 ${quantity} <sonic-icon name="ticket" library="custom"></sonic-icon> 36495 </div>` : A$1} 36496 </div> 36497 <div class="font-normal text-neutral-400 mt-1 text-sm"> 36498 ${priceRange({ min: minAmount, max: maxAmount, is_free_price: true })} 36499 </div> 36500 </div> 36501 `; 36502 } 36503 }; 36504 PriceSelectionForm.styles = [tailwind]; 36505 __decorateClass$2I([ 36506 ancestorAttribute("cartProvider"), 36507 n$5({ type: String }) 36508 ], PriceSelectionForm.prototype, "cartProvider", 2); 36509 __decorateClass$2I([ 36510 ancestorAttribute("seatmapProvider"), 36511 n$5({ type: String }) 36512 ], PriceSelectionForm.prototype, "seatmapProvider", 2); 36513 __decorateClass$2I([ 36514 bind(seatmapKey), 36515 r$5() 36516 ], PriceSelectionForm.prototype, "seatMapData", 2); 36517 __decorateClass$2I([ 36518 n$5({ type: Object }) 36519 ], PriceSelectionForm.prototype, "priceContext", 2); 36520 __decorateClass$2I([ 36521 n$5({ type: Number }) 36522 ], PriceSelectionForm.prototype, "preferredQuotaId", 2); 36523 __decorateClass$2I([ 36524 n$5({ type: Boolean }) 36525 ], PriceSelectionForm.prototype, "fallbackAvailableQuota", 2); 36526 __decorateClass$2I([ 36527 n$5({ type: Boolean }) 36528 ], PriceSelectionForm.prototype, "showSubmitButton", 2); 36529 __decorateClass$2I([ 36530 c({ context: accessParamsContext, subscribe: true }), 36531 n$5({ type: Object }) 36532 ], PriceSelectionForm.prototype, "accessParams", 2); 36533 __decorateClass$2I([ 36534 c({ context: appType, subscribe: true }), 36535 n$5({ type: String }) 36536 ], PriceSelectionForm.prototype, "appType", 2); 36537 __decorateClass$2I([ 36538 r$5() 36539 ], PriceSelectionForm.prototype, "_isLoading", 2); 36540 __decorateClass$2I([ 36541 r$5() 36542 ], PriceSelectionForm.prototype, "_isSubmitting", 2); 36543 __decorateClass$2I([ 36544 r$5() 36545 ], PriceSelectionForm.prototype, "_availableQuotas", 2); 36546 __decorateClass$2I([ 36547 r$5() 36548 ], PriceSelectionForm.prototype, "_stockQuotas", 2); 36549 __decorateClass$2I([ 36550 r$5() 36551 ], PriceSelectionForm.prototype, "_allPrices", 2); 36552 __decorateClass$2I([ 36553 r$5() 36554 ], PriceSelectionForm.prototype, "_placesCategories", 2); 36555 __decorateClass$2I([ 36556 r$5() 36557 ], PriceSelectionForm.prototype, "_stock", 2); 36558 __decorateClass$2I([ 36559 r$5() 36560 ], PriceSelectionForm.prototype, "_filterPriceByQuota", 2); 36561 PriceSelectionForm = __decorateClass$2I([ 36562 t$3(tagName$1D) 36563 ], PriceSelectionForm); 36564 var __defProp$2E = Object.defineProperty; 36565 var __getOwnPropDesc$2H = Object.getOwnPropertyDescriptor; 36566 var __decorateClass$2H = (decorators, target, key, kind) => { 36567 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2H(target, key) : target; 36568 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36569 if (decorator = decorators[i2]) 36570 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36571 if (kind && result) __defProp$2E(target, key, result); 36572 return result; 36573 }; 36574 const tagName$1C = "sonic-cart-item-edit-price"; 36575 let CartItemEditPrice = class extends i$6 { 36576 constructor() { 36577 super(...arguments); 36578 this.cartProvider = "cart/current"; 36579 this.fallbackAvailableQuota = true; 36580 this.handleFormSuccess = () => {
36581 this.closeParentModal(); 36582 }; 36583 this.handleFormUpdated = (event) => { 36584 this.dispatchEvent( 36585 new CustomEvent("updated", { 36586 detail: event.detail 36587 }) 36588 ); 36589 this.closeParentModal(); 36590 }; 36591 } 36592 get isEditMode() { 36593 return !!this.priceContext?.edit?.lineItems?.length; 36594 } 36595 closeParentModal() { 36596 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 36597 parentModal?.hide(); 36598 } 36599 get hasSeat() { 36600 return this.priceContext?.edit?.lineItems.some((item) => !!item.seat?.id) || false; 36601 } 36602 renderHeader() { 36603 const { entityType, entityId } = this.priceContext || {}; 36604 if (!entityType || !entityId) return A$1; 36605 return b$1` 36606 ${this.isEditMode ? productPriceSummary({ 36607 lineItemCart: this.priceContext?.edit?.lineItems, 36608 className: "mb-6 block ", 36609 accessParams: this.accessParams 36610 }) : b$1` 36611 <sonic-fetch 36612 dataProvider=${entityEndPoint({ 36613 entityType, 36614 entityId: Number(entityId), 36615 view: entityView.essential, 36616 accessParams: this.accessParams 36617 })} 36618 > 36619 <sonic-product-summary size="md" subDataprovider="data" class="mb-6 block" noOverTitle> 36620 </sonic-product-summary> 36621 </sonic-fetch> 36622 `} 36623 `; 36624 } 36625 renderSeatSection() { 36626 const hasSeat = this.hasSeat; 36627 const hasOneItem = this.priceContext?.edit?.lineItems?.length === 1; 36628 const needSubscription = hasOneItem && this.priceContext?.edit?.lineItems?.[0]?.price?.need_subscription; 36629 const canChangeSeats = hasSeat; 36630 if (!canChangeSeats && !needSubscription) return A$1; 36631 return b$1` 36632 <sonic-divider class="mt-8 mb-3"></sonic-divider> 36633 <div class="flex gap-2 justify-center "> 36634 ${canChangeSeats ? b$1` <sonic-button 36635 variant="ghost" 36636 size="sm" 36637 minWidth="12rem" 36638 @click=${() => { 36639 this.closeParentModal(); 36640 editSeatsModal({ 36641 cartProvider: this.cartProvider, 36642 priceContext: this.priceContext, 36643 accessParams: this.accessParams 36644 }); 36645 }} 36646 > 36647 <sonic-icon name="loveseat" library="custom"></sonic-icon> 36648 ${t("change_seats")} 36649 </sonic-button>` : A$1} 36650 ${needSubscription && canChangeSeats ? b$1` <sonic-divider vertical></sonic-divider> ` : A$1} 36651 ${needSubscription ? b$1` <sonic-button 36652 variant="ghost" 36653 size="sm" 36654 minWidth="12rem" 36655 @click=${() => { 36656 this.closeParentModal(); 36657 attachOwnerModal({ 36658 cartProvider: this.cartProvider, 36659 items: this.priceContext?.edit?.lineItems || [] 36660 }); 36661 }} 36662 > 36663 <sonic-icon name="id-card" library="custom"></sonic-icon> 36664 ${t("edit_owner")} 36665 </sonic-button>` : A$1} 36666 </div> 36667 `; 36668 } 36669 render() { 36670 return b$1` 36671 ${this.renderHeader()} 36672 36673 <sonic-price-selection-form 36674 cartProvider=${this.cartProvider} 36675 .priceContext=${this.priceContext} 36676 .preferredQuotaId=${this.preferredQuotaId} 36677 .fallbackAvailableQuota=${this.fallbackAvailableQuota} 36678 @added=${this.handleFormSuccess} 36679 @updated=${this.handleFormUpdated} 36680 ></sonic-price-selection-form> 36681 36682 ${this.renderSeatSection()} 36683 `; 36684 } 36685 }; 36686 CartItemEditPrice.styles = [tailwind]; 36687 __decorateClass$2H([ 36688 ancestorAttribute("cartProvider"), 36689 n$5({ type: String }) 36690 ], CartItemEditPrice.prototype, "cartProvider", 2); 36691 __decorateClass$2H([ 36692 n$5({ type: Object }) 36693 ], CartItemEditPrice.prototype, "priceContext", 2); 36694 __decorateClass$2H([ 36695 n$5({ type: Number }) 36696 ], CartItemEditPrice.prototype, "preferredQuotaId", 2); 36697 __decorateClass$2H([ 36698 n$5({ type: Boolean }) 36699 ], CartItemEditPrice.prototype, "fallbackAvailableQuota", 2); 36700 __decorateClass$2H([ 36701 c({ context: accessParamsContext, subscribe: true }), 36702 n$5({ type: Object }) 36703 ], CartItemEditPrice.prototype, "accessParams", 2); 36704 CartItemEditPrice = __decorateClass$2H([ 36705 t$3(tagName$1C) 36706 ], CartItemEditPrice); 36707 var __defProp$2D = Object.defineProperty; 36708 var __getOwnPropDesc$2G = Object.getOwnPropertyDescriptor; 36709 var __decorateClass$2G = (decorators, target, key, kind) => { 36710 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2G(target, key) : target; 36711 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36712 if (decorator = decorators[i2]) 36713 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36714 if (kind && result) __defProp$2D(target, key, result); 36715 return result; 36716 }; 36717 let SonicUserSelectorItem = class extends Subscriber$1(i$6) { 36718 constructor() { 36719 super(...arguments); 36720 this.important = false;
36721 this.size = "sm"; 36722 this.noAutoFill = false; 36723 this.buttonType = "button"; 36724 } 36725 render() { 36726 const currentId = this.props?.uid; 36727 if (!currentId && !this.props?.firstName && !this.props?.lastName && !this.props?.email) return A$1; 36728 const isRadio = this.buttonType === "radio"; 36729 return b$1` 36730 <sonic-button 36731 ?noAutoFill="${this.noAutoFill}" 36732 ?radio=${isRadio} 36733 name=${o$4(this.buttonName)} 36734 value="${o$4(isRadio ? currentId : void 0)}" 36735 variant="unstyled" 36736 type="default" 36737 shape="block" 36738 align="left" 36739 class="h-full border cursor-pointer 36740 ${this.important ? "border-success text-success hover:bg-neutral-100 " : "border-neutral-200 hover:border-neutral-600 hover:bg-neutral-100"} 36741 transition 36742 [&[active]]:border-neutral-800 rounded-md py-2 px-2" 36743 > 36744 <sonic-user-info tabindex="-1" class="text-xs pointer-events-none py-1 min-w-0" .size=${this.size}> 36745 <slot></slot> 36746 </sonic-user-info> 36747 </sonic-button> 36748 `; 36749 } 36750 }; 36751 SonicUserSelectorItem.styles = [tailwind]; 36752 __decorateClass$2G([ 36753 n$5({ type: Boolean }) 36754 ], SonicUserSelectorItem.prototype, "important", 2); 36755 __decorateClass$2G([ 36756 n$5({ type: String }) 36757 ], SonicUserSelectorItem.prototype, "size", 2); 36758 __decorateClass$2G([ 36759 n$5({ type: Boolean }) 36760 ], SonicUserSelectorItem.prototype, "noAutoFill", 2); 36761 __decorateClass$2G([ 36762 n$5({ type: String }) 36763 ], SonicUserSelectorItem.prototype, "buttonType", 2); 36764 __decorateClass$2G([ 36765 n$5({ type: String }) 36766 ], SonicUserSelectorItem.prototype, "buttonName", 2); 36767 SonicUserSelectorItem = __decorateClass$2G([ 36768 t$3("sonic-user-selector-item") 36769 ], SonicUserSelectorItem); 36770 var __defProp$2C = Object.defineProperty; 36771 var __getOwnPropDesc$2F = Object.getOwnPropertyDescriptor; 36772 var __decorateClass$2F = (decorators, target, key, kind) => { 36773 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2F(target, key) : target; 36774 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36775 if (decorator = decorators[i2]) 36776 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36777 if (kind && result) __defProp$2C(target, key, result); 36778 return result; 36779 }; 36780 const tagName$1B = "sonic-user-suggest"; 36781 let SonicUserSuggest = class extends i$6 { 36782 constructor() { 36783 super(...arguments); 36784 this.lastName = ""; 36785 this.firstName = ""; 36786 this.email = ""; 36787 this.structure = ""; 36788 this.limit = 4; 36789 this.userList = []; 36790 this.userListFromEmail = []; 36791 this.userListFromNameOrFirstName = []; 36792 this.formDataProvider = "userSuggestions"; 36793 this.matchEmail = false; 36794 this.selectedId = 0; 36795 this.isFetching = false; 36796 this.fetchQueue = []; 36797 this.dispatch = (uid) => { 36798 if (!uid || uid == this.selectedId) return; 36799 const event = new CustomEvent("select", { 36800 detail: { uid } 36801 }); 36802 this.dispatchEvent(event); 36803 this.selectedId = uid; 36804 }; 36805 } 36806 connectedCallback() { 36807 PublisherManager.get(this.formDataProvider).uid.onAssign(this.dispatch); 36808 super.connectedCallback(); 36809 } 36810 disconnectedCallback() { 36811 PublisherManager.get(this.formDataProvider).uid.offAssign(this.dispatch); 36812 PublisherManager.get(this.formDataProvider).uid.set(null); 36813 super.disconnectedCallback(); 36814 } 36815 async getUser(options) { 36816 if (this.isFetching) { 36817 this.fetchQueue.push(options); 36818 return; 36819 } 36820 this.isFetching = true; 36821 try { 36822 const api2 = new API(HTML.getApiConfiguration(this)); 36823 if (options.email) { 36824 const resultEmail = await api2.get(`/user?search=${options.email}&limit=${this.limit}`); 36825 const data = resultEmail?.data ?? []; 36826 this.userListFromEmail = data.flat() || []; 36827 } else if (options.lastName || options.firstName || options.structure) { 36828 const resultName = await api2.get( 36829 `/user?search=${options.firstName}${options.lastName ? " " + options.lastName : ""}${options.structure ? " " + options.structure : ""}&limit=${this.limit}` 36830 ); 36831 const data = resultName?.data ?? []; 36832 this.userListFromNameOrFirstName = data.flat() || []; 36833 } 36834 } catch (error) { 36835 console.error("Fetch error:", error); 36836 } finally { 36837 this.isFetching = false;
36838 this.processQueue(); 36839 } 36840 } 36841 async processQueue() { 36842 if (this.fetchQueue.length > 0) { 36843 const nextRequest = this.fetchQueue.shift(); 36844 if (nextRequest) { 36845 await this.getUser(nextRequest); 36846 } 36847 } 36848 } 36849 willUpdate(_changedProperties) { 36850 if (_changedProperties.has("email")) { 36851 if (this.email?.length > 2) { 36852 this.getUser({ email: this.email }); 36853 } else { 36854 this.userListFromEmail = []; 36855 } 36856 } 36857 if (_changedProperties.has("lastName") || _changedProperties.has("firstName") || _changedProperties.has("structure")) { 36858 if (this.lastName.length + this.firstName.length + this.structure.length > 2) { 36859 this.getUser({ lastName: this.lastName, firstName: this.firstName, structure: this.structure }); 36860 } else { 36861 this.userListFromNameOrFirstName = []; 36862 } 36863 } 36864 if (_changedProperties.has("userListFromEmail") || _changedProperties.has("userListFromNameOrFirstName")) { 36865 this.sortAndFilterUserList(); 36866 } 36867 super.willUpdate(_changedProperties); 36868 } 36869 sortAndFilterUserList() { 36870 const pertinence = (user2) => { 36871 let score = 0; 36872 if (user2.email === this.email) score += 3; 36873 if (user2.firstName === this.firstName || user2.lastName === this.lastName) score += 1; 36874 return score; 36875 }; 36876 const userList = [...this.userListFromEmail, ...this.userListFromNameOrFirstName]; 36877 const removeSameID = userList.filter( 36878 (user2, index, self) => self.findIndex((t2) => t2.uid && t2.uid === user2.uid) === index 36879 ); 36880 const sortedList = removeSameID.sort((a2, b2) => pertinence(b2) - pertinence(a2)); 36881 if (sortedList.length > this.limit) { 36882 sortedList.length = this.limit; 36883 } 36884 this.userList = sortedList; 36885 const event = new CustomEvent("found", { 36886 detail: this.userList 36887 }); 36888 this.dispatchEvent(event); 36889 this.matchEmail = this.userListFromEmail.some((user2) => user2.email === this.email); 36890 } 36891 render() { 36892 if (!this.userList.length) { 36893 this.style.display = "none"; 36894 return A$1; 36895 } 36896 this.style.removeProperty("display"); 36897 return b$1`<div 36898 class="@container" 36899 formDataProvider="${this.formDataProvider}" 36900 ${F({ in: v, out: f, stabilizeOut: true })} 36901 > 36902 ${this.matchEmail ? b$1`<div align="left" class="mt-0 mb-4 text-success "> 36903 <sonic-icon library="custom" name="seal-exclamation" class="animate-heartbeat inline-block"></sonic-icon> Un 36904 compte correspond à votre sélection 36905 </div>` : b$1`<div align="left" class="mt-0 mb-4 text-neutral-400 "> 36906 <sonic-icon library="custom" name="face-smile-relaxed"></sonic-icon> Des comptes pourraient correspondre à 36907 votre sélection 36908 </div>`} 36909 <div class="grid grid-cols-1 @lg:grid-cols-2 @xl:grid-cols-3 gap-2 @3xl:grid-cols-4 "> 36910 ${c$1( 36911 this.userList, 36912 (user2) => user2.uid, 36913 (user2) => { 36914 const uid = user2.uid; 36915 if (!uid) return; 36916 const isCurrentEmail = user2?.email === this.email; 36917 return b$1`<sonic-user-selector-item 36918 noAutoFill 36919 dataProvider="userSuggestion/${uid}" 36920 size="xs" 36921 buttonType="button" 36922 ?important="${isCurrentEmail}" 36923 @click=${() => this.dispatch(uid)} 36924 .props=${user2} 36925 ></sonic-user-selector-item>`; 36926 } 36927 )} 36928 </div> 36929 </div>`; 36930 } 36931 }; 36932 SonicUserSuggest.styles = [tailwind]; 36933 __decorateClass$2F([ 36934 n$5({ type: String }) 36935 ], SonicUserSuggest.prototype, "lastName", 2); 36936 __decorateClass$2F([ 36937 n$5({ type: String }) 36938 ], SonicUserSuggest.prototype, "firstName", 2); 36939 __decorateClass$2F([ 36940 n$5({ type: String }) 36941 ], SonicUserSuggest.prototype, "email", 2); 36942 __decorateClass$2F([ 36943 n$5({ type: String }) 36944 ], SonicUserSuggest.prototype, "structure", 2); 36945 __decorateClass$2F([ 36946 n$5({ type: Number }) 36947 ], SonicUserSuggest.prototype, "limit", 2); 36948 __decorateClass$2F([ 36949 r$5() 36950 ], SonicUserSuggest.prototype, "userList", 2); 36951 __decorateClass$2F([ 36952 r$5() 36953 ], SonicUserSuggest.prototype, "userListFromEmail", 2); 36954 __decorateClass$2F([ 36955 r$5() 36956 ], SonicUserSuggest.prototype, "userListFromNameOrFirstName", 2); 36957 __decorateClass$2F([ 36958 n$5({ type: String }) 36959 ], SonicUserSuggest.prototype, "formDataProvider", 2); 36960 __decorateClass$2F([ 36961 r$5() 36962 ], SonicUserSuggest.prototype, "matchEmail", 2); 36963 SonicUserSuggest = __decorateClass$2F([ 36964 t$3(tagName$1B) 36965 ], SonicUserSuggest); 36966 var __defProp$2B = Object.defineProperty; 36967 var __getOwnPropDesc$2E = Object.getOwnPropertyDescriptor; 36968 var __decorateClass$2E = (decorators, target, key, kind) => { 36969 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2E(target, key) : target; 36970 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 36971 if (decorator = decorators[i2]) 36972 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 36973 if (kind && result) __defProp$2B(target, key, result); 36974 return result; 36975 }; 36976 const tagName$1A = "sonic-purchase-expiration-date"; 36977 let SonicPurchaseExpirationDate = class extends Subscriber$1(i$6) { 36978 constructor() { 36979 super(...arguments); 36980 this.expiration_date = null; 36981 this.expires_at = null; 36982 } 36983 render() { 36984 const date2 = this.expiration_date || this.expires_at; 36985 const now = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3); 36986 const isExpired = date2 && date2 < now; 36987 const text = isExpired ? t("expire_depuis_le") : t("valide_jusqu_au"); 36988 if (!date2) return A$1; 36989 return b$1`<sonic-badge 36990 variant="outline" 36991 type=${isExpired ? "danger" : "success"} 36992 size=${o$4(this.size)} 36993 variant="ghost" 36994 class="font-bold" 36995 > 36996 ${text} 36997 <sonic-date date=${date2} weekday="hidden" month="2-digit" hour="hidden" minute="hidden"></sonic-date> 36998 </sonic-badge>`; 36999 } 37000 }; 37001 SonicPurchaseExpirationDate.styles = [tailwind]; 37002 __decorateClass$2E([ 37003 n$5() 37004 ], SonicPurchaseExpirationDate.prototype, "size", 2); 37005 __decorateClass$2E([ 37006 n$5({ type: Number }) 37007 ], SonicPurchaseExpirationDate.prototype, "expiration_date", 2); 37008 __decorateClass$2E([ 37009 n$5({ type: Number }) 37010 ], SonicPurchaseExpirationDate.prototype, "expires_at", 2); 37011 SonicPurchaseExpirationDate = __decorateClass$2E([ 37012 t$3(tagName$1A) 37013 ], SonicPurchaseExpirationDate); 37014 var __getOwnPropDesc$2D = Object.getOwnPropertyDescriptor; 37015 var __decorateClass$2D = (decorators, target, key, kind) => { 37016 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2D(target, key) : target; 37017 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37018 if (decorator = decorators[i2]) 37019 result = decorator(result) || result; 37020 return result; 37021 }; 37022 let SubscriptionInfo = class extends Subscriber$1(i$6) { 37023 // output 37024 render() { 37025 if (!this.props) return A$1; 37026 const { number, price } = this.props; 37027 const renderLabel = price?.label && price?.label !== this.props.entity?.edito?.title; 37028 return b$1` 37029 <sonic-user-info subDataProvider="owner" mode="subscription" class="block" inert> 37030 <div class="mt-2"> 37031 <sonic-product-title subDataProvider="entity.edito" size="inherit"></sonic-product-title> 37032 <div>${renderLabel ? b$1`<div>${price?.label}</div>` : A$1}</div> 37033 <div class="flex gap-2 flex-wrap items-center"> 37034 ${number ? b$1` <div>N° ${number}</div>` : A$1} 37035 <sonic-purchase-expiration-date size="2xs"></sonic-purchase-expiration-date> 37036 </div> 37037 </div> 37038 </sonic-user-info> 37039 `; 37040 } 37041 }; 37042 SubscriptionInfo.styles = [tailwind]; 37043 SubscriptionInfo = __decorateClass$2D([ 37044 t$3("sonic-subscription-info") 37045 ], SubscriptionInfo); 37046 var __defProp$2A = Object.defineProperty; 37047 var __getOwnPropDesc$2C = Object.getOwnPropertyDescriptor; 37048 var __decorateClass$2C = (decorators, target, key, kind) => { 37049 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2C(target, key) : target; 37050 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37051 if (decorator = decorators[i2]) 37052 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 37053 if (kind && result) __defProp$2A(target, key, result); 37054 return result; 37055 }; 37056 let instanceCounter$b = 0; 37057 let SubscriptionSelector = class extends i$6 { 37058 constructor() { 37059 super(...arguments); 37060 this._searchFormDataProvider = `subscriptionSelectorFormFilters/${instanceCounter$b++}`; 37061 this._searchResultDataProvider = `subscriptionSelectorFormResults/${instanceCounter$b++}`; 37062 this.searchStatus = "valid"; 37063 this.canRenew = false;
37064 this.hideForm = false; 37065 this.hasSearchValue = false; 37066 this.handleSearchFormMutation = () => { 37067 const searchValue = dp(this._searchFormDataProvider).search.get(); 37068 const numberSearch = dp(this._searchFormDataProvider).number_search.get(); 37069 this.hasSearchValue = !!(searchValue || numberSearch); 37070 }; 37071 this._items = (item) => b$1` 37072 <sonic-button 37073 noAutoFill 37074 shape="block" 37075 align="left" 37076 size="xs" 37077 @click=${() => this.selectSubscription(item)} 37078 class="relative" 37079 variant="ghost" 37080 > 37081 <div 37082 class="bg-warning absolute top-0 left-0 w-full h-full pointer-events-none opacity-[.1] rounded-[--sc-btn-rounded]" 37083 ></div> 37084 <sonic-subscription-info class="block py-1 min-h-[7.5rem] min-w-0 relative" inert></sonic-subscription-info> 37085 </sonic-button> 37086 `; 37087 this.selectSubscription = (subscription) => { 37088 const customEvent = new CustomEvent("select", { detail: { subscription } }); 37089 this.dispatchEvent(customEvent); 37090 }; 37091 this._noItemsMarkup = () => { 37092 return b$1`<sonic-no-result size="lg"></sonic-no-result>`; 37093 }; 37094 } 37095 connectedCallback() { 37096 dp(this._searchFormDataProvider).onInternalMutation(this.handleSearchFormMutation); 37097 super.connectedCallback(); 37098 } 37099 disconnectedCallback() { 37100 super.disconnectedCallback(); 37101 dp(this._searchFormDataProvider).set({}); 37102 dp(this._searchFormDataProvider).offInternalMutation(this.handleSearchFormMutation); 37103 } 37104 render() { 37105 const searchParams = new URLSearchParams(); 37106 if (this.pricesTypeIds) { 37107 this.pricesTypeIds.forEach((price) => { 37108 searchParams.append(`prices_type_ids[]`, price.toString()); 37109 }); 37110 } 37111 if (this.subscriptionTypeId) { 37112 searchParams.set(`subscription_type_id`, this.subscriptionTypeId.toString()); 37113 } 37114 if (this.searchStatus) { 37115 searchParams.set(`status`, this.searchStatus); 37116 } 37117 if (this.canRenew) { 37118 searchParams.set(`can_renew`, "true"); 37119 } 37120 const searchParamsStrings = searchParams.toString(); 37121 return b$1`<div class="block @container"> 37122 <div 37123 formDataProvider="${this._searchFormDataProvider}" 37124 class=${this.hideForm ? "hidden" : " flex flex-col @xl:flex-row gap-2"} 37125 > 37126 ${this.hideForm ? b$1`<sonic-input 37127 type="hidden" 37128 name="search" 37129 id="inputSearch" 37130 value=${this.search || ""} 37131 dataProvider="susbcriptionsFilters" 37132 ></sonic-input> 37133 <sonic-input 37134 type="hidden" 37135 name="number_search" 37136 id="inputNumberSearch" 37137 value=${o$4(this.numberSearch)} 37138 dataProvider="susbcriptionsFilters" 37139 ></sonic-input> ` : b$1`<sonic-input 37140 inlineContent 37141 type="search" 37142 name="search" 37143 id="inputSearch" 37144 placeholder="${t("search_subscription")}" 37145 value="" 37146 dataProvider="susbcriptionsFilters" 37147 autocomplete="off" 37148 class="grow" 37149 > 37150 <sonic-icon name="magnifying-glass" library="custom" slot="prefix"></sonic-icon> 37151 </sonic-input> 37152 <sonic-input 37153 name="number_search" 37154 id="inputNumberSearch" 37155 value=${o$4(this.numberSearch)} 37156 dataProvider="susbcriptionsFilters" 37157 class="grow @xl:max-w-60" 37158 autocomplete="off" 37159 inlineContent 37160 placeholder="${t("numero_carte")}" 37161 > 37162 <sonic-icon name="input-numeric" library="custom" slot="prefix"></sonic-icon> 37163 </sonic-input> `} 37164 </div> 37165 37166 <sonic-queue 37167 limit="9" 37168 targetRequestDuration="1000" 37169 dataFilterProvider="${this._searchFormDataProvider}" 37170 dataProvider="${this._searchResultDataProvider}" 37171 dataProviderExpression="/subscriptions?limit=$limit&offset=$offset&features[]=owner&features[]=buyer&features[]=price&${searchParamsStrings}" 37172 key="data" 37173 class="custom-scroll mask-scroll 37174 pb-5 pr-2 pt-2
37175 grid grid-cols-1 @lg:grid-cols-2 @2xl:grid-cols-3 gap-2 max-h-80 37176 items-start 37177 ${this.hasSearchValue ? "" : "hidden"} 37178 " 37179 .items=${this._items} 37180 .noItems=${this._noItemsMarkup} 37181 > 37182 </sonic-queue> 37183 </div>`; 37184 } 37185 }; 37186 SubscriptionSelector.styles = [ 37187 tailwind, 37188 customScroll, 37189 i$9` 37190 .mask-scroll { 37191 mask-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 1)); 37192 } 37193 ` 37194 ]; 37195 __decorateClass$2C([ 37196 n$5({ type: String }) 37197 ], SubscriptionSelector.prototype, "searchStatus", 2); 37198 __decorateClass$2C([ 37199 n$5({ type: Boolean }) 37200 ], SubscriptionSelector.prototype, "canRenew", 2); 37201 __decorateClass$2C([ 37202 n$5({ type: Array }) 37203 ], SubscriptionSelector.prototype, "pricesTypeIds", 2); 37204 __decorateClass$2C([ 37205 n$5({ type: Number }) 37206 ], SubscriptionSelector.prototype, "subscriptionTypeId", 2); 37207 __decorateClass$2C([ 37208 n$5({ type: Boolean }) 37209 ], SubscriptionSelector.prototype, "hideForm", 2); 37210 __decorateClass$2C([ 37211 n$5({ type: String }) 37212 ], SubscriptionSelector.prototype, "search", 2); 37213 __decorateClass$2C([ 37214 n$5({ type: String }) 37215 ], SubscriptionSelector.prototype, "numberSearch", 2); 37216 __decorateClass$2C([ 37217 c({ context: appType, subscribe: true }) 37218 ], SubscriptionSelector.prototype, "appType", 2); 37219 __decorateClass$2C([ 37220 n$5({ type: String }) 37221 ], SubscriptionSelector.prototype, "cartProvider", 2); 37222 __decorateClass$2C([ 37223 r$5() 37224 ], SubscriptionSelector.prototype, "hasSearchValue", 2); 37225 SubscriptionSelector = __decorateClass$2C([ 37226 t$3("sonic-subscription-selector") 37227 ], SubscriptionSelector); 37228 var __defProp$2z = Object.defineProperty; 37229 var __getOwnPropDesc$2B = Object.getOwnPropertyDescriptor; 37230 var __decorateClass$2B = (decorators, target, key, kind) => { 37231 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2B(target, key) : target; 37232 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37233 if (decorator = decorators[i2]) 37234 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 37235 if (kind && result) __defProp$2z(target, key, result); 37236 return result; 37237 }; 37238 const tagName$1z = "sonic-quick-access-card"; 37239 let SonicComponent$g = class SonicComponent extends Subscriber$1(i$6) { 37240 constructor() { 37241 super(...arguments); 37242 this.href = ""; 37243 this.title = ""; 37244 this.icon = ""; 37245 this.target = "_self"; 37246 this.size = "md"; 37247 } 37248 render() { 37249 if (!this.href) return A$1; 37250 return b$1`<a 37251 href=${this.href} 37252 class="card h-full flex justify-between gap-[.5em] shadow-lg hover:shadow transition-[boxShadow_.2s] text-pretty" 37253 target=${this.target} 37254 > 37255 <div> 37256 <div 37257 class="flex items-center gap-[.5em] font-bold break-anywhere ${this.size === "sm" ? "text-[1em]" : "text-[1.15em] mb-[.3em]"}" 37258 > 37259 ${this.icon ? b$1` <sonic-icon 37260 library="custom" 37261 prefix="light" 37262 name=${o$4(this.icon)} 37263 class="${this.size === "sm" ? "text-[1.2em]" : "text-[1.6em]"} shrink-0" 37264 ></sonic-icon>` : A$1} 37265 <div class="text-pretty">${this.title}</div> 37266 </div> 37267 ${this.text && this.size === "md" ? b$1`<div class="text-[max(12px,.8em)] px-[.35em] mb-[.5em]">${this.text}</div>` : A$1} 37268 </div> 37269 <div class="-mr-[.5em] ${this.size === "md" ? "self-end -mb-[.5em]" : "self-center -my-[.5em]"} "> 37270 <sonic-button shape="circle" data-aria-label=${o$4(t("link_title_more_about"))} inert size=${this.size}> 37271 <sonic-icon library="custom" prefix="regular" name="arrow-right"></sonic-icon> 37272 </sonic-button> 37273 </div> 37274 </a>`; 37275 } 37276 }; 37277 SonicComponent$g.styles = [ 37278 tailwind, 37279 i$9` 37280 :host { 37281 --card-base: var(--sc-card-base, var(--sc-base-900)); 37282 --card-content: var(--sc-card-content, var(--sc-base-content)); 37283 } 37284 37285 :host([type="default"]) { 37286 --card-base: var(--sc-base-900); 37287 } 37288 37289 :host([type="primary"]) { 37290 --card-base: var(--sc-primary); 37291 } 37292 :host([type="warning"]) { 37293 --card-base: var(--sc-warning); 37294 } 37295 :host([type="danger"]) { 37296 --card-base: var(--sc-danger); 37297 } 37298 :host([type="info"]) { 37299 --card-base: var(--sc-info); 37300 } 37301 :host([type="success"]) { 37302 --card-base: var(--sc-success); 37303 } 37304 :host([type="neutral"]) { 37305 --card-base: var(--sc-base-600); 37306 } 37307 37308 .card { 37309 position: relative; 37310 padding: 1rem; 37311 border-radius: var(--sc-rounded-md); 37312 overflow: hidden; 37313 color: var(--card-content); 37314 } 37315 .card::before { 37316 content: ""; 37317 position: absolute; 37318 top: 0; 37319 left: 0; 37320 right: 0; 37321 bottom: 0; 37322 opacity: 0.1; 37323 background-color: var(--card-base); 37324 transition: opacity 0.2s; 37325 } 37326 .card:hover::before { 37327 opacity: 0.15; 37328 } 37329 37330 .break-anywhere {
37331 overflow-wrap: anywhere; /* word break flexbox*/ 37332 } 37333 ` 37334 ]; 37335 __decorateClass$2B([ 37336 n$5() 37337 ], SonicComponent$g.prototype, "href", 2); 37338 __decorateClass$2B([ 37339 n$5() 37340 ], SonicComponent$g.prototype, "title", 2); 37341 __decorateClass$2B([ 37342 n$5() 37343 ], SonicComponent$g.prototype, "text", 2); 37344 __decorateClass$2B([ 37345 n$5() 37346 ], SonicComponent$g.prototype, "icon", 2); 37347 __decorateClass$2B([ 37348 n$5() 37349 ], SonicComponent$g.prototype, "target", 2); 37350 __decorateClass$2B([ 37351 n$5({ type: String }) 37352 ], SonicComponent$g.prototype, "size", 2); 37353 SonicComponent$g = __decorateClass$2B([ 37354 t$3(tagName$1z) 37355 ], SonicComponent$g); 37356 var __defProp$2y = Object.defineProperty; 37357 var __getOwnPropDesc$2A = Object.getOwnPropertyDescriptor; 37358 var __decorateClass$2A = (decorators, target, key, kind) => { 37359 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2A(target, key) : target; 37360 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37361 if (decorator = decorators[i2]) 37362 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 37363 if (kind && result) __defProp$2y(target, key, result); 37364 return result; 37365 }; 37366 let instanceCounter$a = 0; 37367 let SubscriptionAttachForm = class extends i$6 { 37368 constructor() { 37369 super(...arguments); 37370 this.formDataProvider = `newSubscriptionAttachForm/${instanceCounter$a++}`; 37371 this._linkEndpoint = ""; 37372 this.needPartnerSubscription = false; 37373 this._currentSubscription = null; 37374 this._siblingsWithoutParent = []; 37375 this._compatibleSubscriptions = []; 37376 this._compatibleSubscriptionsRequestId = 0; 37377 this._presetFormDataProvider = "AttachToSiblingsPreset" + instanceCounter$a++; 37378 this.partnerOptions = []; 37379 this.refreshCompatibleSubscriptions = async () => { 37380 const requestId = ++this._compatibleSubscriptionsRequestId; 37381 const subscriptions = await this.updateCompatibleSubscriptions(); 37382 if (requestId !== this._compatibleSubscriptionsRequestId) { 37383 return; 37384 } 37385 this._compatibleSubscriptions = subscriptions; 37386 }; 37387 this.onCartAssign = () => { 37388 void this.refreshCompatibleSubscriptions(); 37389 }; 37390 this.updateCompatibleSubscriptions = async () => { 37391 const api2 = new API(HTML$1.getApiConfiguration(this)); 37392 const itemId = this.item?.id; 37393 const cartProvider = this.cartProvider; 37394 if (!cartProvider || !itemId) return []; 37395 const params = new URLSearchParams(); 37396 params.append("features[]", "owner"); 37397 params.append("features[]", "buyer"); 37398 params.append("features[]", "price"); 37399 const result = await api2.get( 37400 `${cartProvider}/items/${itemId}/compatible-subscriptions?${params.toString()}` 37401 ); 37402 if (result.success && result.data && Array.isArray(result.data)) { 37403 return result.data; 37404 } 37405 return []; 37406 }; 37407 this.unlinkSubscription = async () => { 37408 const itemId = this.item?.id; 37409 if (!itemId || !this.cartProvider) return; 37410 Cart.patchItems({ 37411 apiConfiguration: HTML$1.getApiConfiguration(this), 37412 cartProvider: this.cartProvider, 37413 query: { 37414 ids: [itemId] 37415 }, 37416 body: { parent_id: "0" } 37417 }).then((result) => { 37418 if (result === "asRequested") { 37419 this._currentSubscription = null; 37420 if (this.item?.parent_id) { 37421 this.item.parent_id = null; 37422 } 37423 } 37424 }); 37425 }; 37426 } 37427 connectedCallback() { 37428 if (this.cartProvider) { 37429 dp(this.cartProvider).data.onAssign(this.onCartAssign); 37430 this._linkEndpoint = `${this.cartProvider}/items/link`; 37431 } 37432 super.connectedCallback(); 37433 } 37434 disconnectedCallback() { 37435 super.disconnectedCallback(); 37436 if (this.cartProvider) { 37437 dp(this.cartProvider).data.offAssign(this.onCartAssign); 37438 } 37439 } 37440 async willUpdate(_changedProperties) { 37441 if (_changedProperties.has("item") || _changedProperties.has("cartProvider")) { 37442 if (this.item?.id) { 37443 dp(this.formDataProvider).ids.set([this.item?.id]); 37444 } 37445 if (this.item?.price?.id) { 37446 this._siblingsWithoutParent = dp(this.cartProvider || "").data?.items?.get()?.filter((item) => { 37447 const noParentId = !item.parent_id; 37448 const isSamePrice = item.price?.id === this.item?.price?.id; 37449 const isSameEntity = item.entity_type === this.item?.entity_type && item.entity_id === this.item?.entity_id; 37450 return isSamePrice && isSameEntity && noParentId; 37451 }); 37452 } 37453 if (this.cartProvider && this.item?.id) { 37454 void this.refreshCompatibleSubscriptions(); 37455 } else { 37456 this._compatibleSubscriptions = []; 37457 } 37458 } 37459 if (_changedProperties.has("needPartnerSubscription")) { 37460 this.getPartnerOptions().then((options) => { 37461 this.partnerOptions = options; 37462 }); 37463 } 37464 super.willUpdate(_changedProperties); 37465 } 37466 render() { 37467 const currentPriceTypeId = this.item?.price?.price_type_id; 37468 const { entity_type, entity_id } = this.item || {}; 37469 if (!currentPriceTypeId || !entity_type || !entity_id || !this.item) return A$1; 37470 return b$1` ${productPriceSummary({ lineItemCart: this.item, className: "mb-4" })} 37471 ${this.appType === "counter" && this._siblingsWithoutParent.length > 1 ? b$1` 37472 <div class="mt-6 mb-3" formDataProvider=${this._presetFormDataProvider}> 37473 <sonic-checkbox name="applyToSiblings" value=${true} unique size="lg">
37474 <span class="font-bold" 37475 >Associer les ${this._siblingsWithoutParent.length} places au même détenteur</span 37476 > 37477 </sonic-checkbox> 37478 </div> 37479 ` : A$1} 37480 <div class="block @container"> 37481 ${this.needPartnerSubscription ? this.subscriptionForm(this.needPartnerSubscription) : b$1` 37482 ${this.subscriptionSuggestions()} 37483 ${this.appType === "counter" ? b$1` 37484 <sonic-divider class="text-sm text-neutral-500 my-3 " align="left" 37485 >${t("owner_already_registered_this_season")} 37486 </sonic-divider> 37487 37488 <sonic-subscription-selector 37489 class="border-dashed border-neutral-200 block" 37490 size="md" 37491 @select=${(e2) => this.linkSubscriptionPurchase(e2.detail.subscription)} 37492 .pricesTypeIds=${[currentPriceTypeId]} 37493 ></sonic-subscription-selector> 37494 ` : A$1} 37495 ${this.appType === "customer" ? b$1`${this.newSubscription()} ${this.subscriptionForm()} ` : A$1} 37496 `} 37497 </div>`; 37498 } 37499 getIdsToAttach() { 37500 const attachToSiblings = !!dp(this._presetFormDataProvider).applyToSiblings.get(); 37501 const itemId = this.item?.id; 37502 if (!itemId || !this.item) return []; 37503 if (attachToSiblings) { 37504 const siblingsItems = this._siblingsWithoutParent; 37505 return [this.item, ...siblingsItems].map((item) => item?.id || ""); 37506 } 37507 return [this.item].map((item) => item?.id || ""); 37508 } 37509 async attachCartSubscription(subscriptionId) { 37510 const idsToAttach = this.getIdsToAttach(); 37511 if (!subscriptionId || !this.cartProvider || !idsToAttach.length) return; 37512 const isInCart = subscriptionId.startsWith("subscription-tmp"); 37513 let body = {}; 37514 if (isInCart) { 37515 body = { parent_id: String(subscriptionId) }; 37516 } 37517 Cart.patchItems({ 37518 apiConfiguration: HTML$1.getApiConfiguration(this), 37519 cartProvider: this.cartProvider, 37520 query: { 37521 ids: idsToAttach 37522 }, 37523 body 37524 }).then((result) => { 37525 if (result === "asRequested") { 37526 const event = new CustomEvent("attach", { 37527 detail: { itemIds: this.getIdsToAttach() } 37528 }); 37529 this.dispatchEvent(event); 37530 this.closeParentModal(); 37531 } 37532 }); 37533 } 37534 closeParentModal() { 37535 const parentModal = HTML$1.getClosestElement(this, "sonic-modal"); 37536 if (parentModal) { 37537 parentModal.hide(); 37538 } 37539 } 37540 handleSubmit(e2) { 37541 const result = e2.detail; 37542 if (result.success && this.cartProvider) { 37543 dp(this.cartProvider).set(result); 37544 this.closeParentModal(); 37545 } 37546 } 37547 async getPartnerOptions() { 37548 const api2 = new API(HTML$1.getApiConfiguration(this)); 37549 const result = await api2.get(`/partners`); 37550 if (result.success && result.data) { 37551 const data = result.data ?? []; 37552 const options = data.map((partner) => ({ 37553 wording: partner.title || "", 37554 value: Number(partner.id) 37555 })) || []; 37556 if (options.length > 1) { 37557 const defaultOption = { 37558 wording: t("LIB_choose_organisation"), 37559 value: "" 37560 }; 37561 options.unshift(defaultOption); 37562 } 37563 return options; 37564 } 37565 return []; 37566 } 37567 async linkSubscriptionPurchase(subscription) { 37568 const idsToAttach = this.getIdsToAttach(); 37569 if (!idsToAttach.length) return; 37570 const subscriptionNumber = "number" in subscription ? subscription.number : void 0; 37571 const email2 = subscription.owner?.email; 37572 if (!subscriptionNumber || !this.cartProvider || !email2) return; 37573 Loader.show(); 37574 const api2 = new API(HTML$1.getApiConfiguration(this)); 37575 const result = await api2.post(this._linkEndpoint, { 37576 ids: idsToAttach, 37577 subscription_id: subscription.id, 37578 number: subscriptionNumber, 37579 email: email2 37580 }); 37581 if (result?.success) { 37582 dp(this.cartProvider).set(result); 37583 const event = new CustomEvent("attach", { 37584 detail: { itemIds: this.getIdsToAttach() } 37585 }); 37586 this.dispatchEvent(event);
37587 this.closeParentModal(); 37588 } 37589 Loader.hide(); 37590 } 37591 // subscriptionForm :: NEW OWNER 37592 subscriptionForm(needPartnerSubscription) { 37593 const isCounter = this.appType === "counter"; 37594 const cartProvider = this.cartProvider; 37595 const currentItemId = this.item?.id; 37596 if (!cartProvider || !currentItemId) return A$1; 37597 const title = needPartnerSubscription ? t("LIB_associer_un_abonnement_partenaire") : t("owner_already_registered_this_season"); 37598 const notLoggedIn = !this.userId; 37599 const disallowEventsForSoldSubscription = this.appType === "customer" && this.disallowEventsForSoldSubscription?.active; 37600 if (disallowEventsForSoldSubscription) { 37601 return b$1`<sonic-alert status="info"> ${t("LIB_reserved_for_new_subscriptions")} </sonic-alert>`; 37602 } 37603 return b$1` 37604 <sonic-divider class="text-sm text-neutral-500 mb-3" align="left">${title}</sonic-divider> 37605 37606 <div formDataProvider=${this.formDataProvider} class="@container"> 37607 <div class="grid grid-cols-1 @2xl:flex items-end w-full gap-3"> 37608 <sonic-submit 37609 endPoint=${this._linkEndpoint} 37610 @submit=${this.handleSubmit} 37611 method="post" 37612 class="w-full" 37613 onEnterKey 37614 > 37615 <div class="grid grid-cols-1 @2xl:flex items-end w-full gap-3 grow "> 37616 ${needPartnerSubscription ? b$1` <sonic-select 37617 class="grow" 37618 label="${t("LIB_partner_organisation")}" 37619 name="partner_id" 37620 .options=${this.partnerOptions} 37621 ></sonic-select>` : A$1} 37622 <sonic-input class="grow" autocomplete="off" type="text" name="number" label="${t("numero_de_carte")}"> 37623 </sonic-input> 37624 <sonic-input 37625 class="grow" 37626 autocomplete="${isCounter ? "off" : "email"}" 37627 type="email" 37628 name="email" 37629 label="${t("email")}" 37630 ></sonic-input> 37631 </div> 37632 </sonic-submit> 37633 <sonic-submit 37634 @submit=${this.handleSubmit} 37635 endPoint=${this._linkEndpoint} 37636 method="post" 37637 class="shrink-0" 37638 onClick 37639 > 37640 <sonic-button type="primary" shape="block" class="block @2xl:hidden"> 37641 <sonic-icon name="check" library="custom"></sonic-icon> 37642 ${t("enregistrer")} 37643 </sonic-button> 37644 37645 <sonic-tooltip label="${t("enregistrer")}" class="hidden @2xl:block"> 37646 <sonic-button type="primary" shape="block" noAutoFill> 37647 <sonic-icon name="check" library="custom"></sonic-icon> 37648 </sonic-button> 37649 </sonic-tooltip> 37650 </sonic-submit> 37651 </div> 37652 ${!needPartnerSubscription && notLoggedIn ? b$1` 37653 <sonic-app-link 37654 to="account" 37655 size="xs" 37656 variant="link" 37657 type="info" 37658 class="inline-block mb-4 mt-4 @2xl:mt-2 " 37659 > 37660 <sonic-icon name="arrow-right-to-arc" library="custom" slot="prefix"></sonic-icon> 37661 ${t("LIB_se_connecter_pour_retrouver_mon_numero", true)} 37662 </sonic-app-link> 37663 ` : A$1} 37664 </div> 37665 `; 37666 } 37667 newSubscription() { 37668 const urlParams = new URLSearchParams(window.location.search); 37669 let subscriptionHref = appRoute("subscription").toString(); 37670 if (urlParams.get("sonic_subscription_legacy_href")) { 37671 subscriptionHref = urlParams.get("sonic_subscription_legacy_href") || ""; 37672 subscriptionHref = decodeURIComponent(subscriptionHref); 37673 } 37674 const isWaitingList2 = dp(this.cartProvider || "").data?.cartType?.get() === CartType.WaitingLists; 37675 if (isWaitingList2) { 37676 return A$1; 37677 } 37678 return b$1` 37679 ${this.subscriptionAccess && subscriptionHref ? b$1` <sonic-divider class="mb-3 text-sm text-neutral-500" align="left"> 37680 ${t("LIB_pas_encore_abonne_pour_cette_saison")}
37681 </sonic-divider> 37682 37683 <sonic-quick-access-card 37684 class="block flex-grow lg:max-w-[25rem] mb-10 " 37685 type="warning" 37686 title=${t("onglet_home_abonnements")} 37687 text=${o$4(t("module_subscription_summary"))} 37688 icon="address-card" 37689 href=${subscriptionHref} 37690 @click=${() => { 37691 this.closeParentModal(); 37692 }} 37693 > 37694 </sonic-quick-access-card>` : A$1} 37695 `; 37696 } 37697 subscriptionSuggestions() { 37698 if (!this._compatibleSubscriptions.length) return A$1; 37699 let text = t("LIB_subscription_suggestions_title"); 37700 if (this.appType === "counter") { 37701 text = t("LIB_subscription_suggestions_title_counter"); 37702 } 37703 return b$1`<sonic-divider class="text-sm text-neutral-500 my-3" align="left"> ${text} </sonic-divider> 37704 <div class="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] w-full gap-3 mb-10"> 37705 ${c$1( 37706 this._compatibleSubscriptions, 37707 (subscription) => subscription.id?.toString() ?? "", 37708 (subscription) => this.subscriptionSuggestionItem(subscription) 37709 )} 37710 </div>`; 37711 } 37712 removePrefix(id) { 37713 if (!id) return ""; 37714 return id.replace("subscription-tmp_", "")?.replace("subscription_", ""); 37715 } 37716 subscriptionSuggestionItem(subscription) { 37717 const subscriptionId = subscription.id?.toString(); 37718 const isInCart = subscriptionId && subscriptionId.startsWith("subscription-tmp"); 37719 const subIdWithoutPrefix = this.removePrefix(subscriptionId); 37720 const parentIdWithoutPrefix = this.removePrefix(this.item?.parent_id || void 0); 37721 const isActive = subIdWithoutPrefix === parentIdWithoutPrefix; 37722 const canDetach = !isSubscriptionRequired(this.subscriptionRequirement, this.appType); 37723 if (!isInCart) { 37724 const linkedSubs = dp(this.cartProvider || "").data?.linked_subscriptions?.get(); 37725 const targetPurchaseId = this.removePrefix(subscriptionId); 37726 const linkedSubscription = linkedSubs?.find( 37727 (ls) => targetPurchaseId && String(ls.id) === String(targetPurchaseId) 37728 ); 37729 if (linkedSubscription) { 37730 subscription = linkedSubscription; 37731 } 37732 } else { 37733 const entitiesInCart = dp(this.cartProvider || "").data?.entities?.get(); 37734 const entityId = "entity_id" in subscription ? subscription?.entity_id : void 0; 37735 const entity = "entity_id" in subscription ? entitiesInCart.filter((entity2) => entity2.entity_type === EntityType.Subscribe).find((entity2) => { 37736 const matchId = entity2.id?.toString() === entityId; 37737 return matchId; 37738 }) : void 0; 37739 subscription = { ...subscription, ...entity ? { entity } : {} }; 37740 } 37741 return b$1`<sonic-tooltip label="${isActive ? canDetach ? t("unlink") : "" : t("attach")}" class="w-full block"> 37742 ${isActive && canDetach ? b$1`<sonic-button 37743 type="danger" 37744 shape="circle" 37745 size="xs" 37746 noAutoFill 37747 icon 37748 class="absolute -top-2 right-2 z-10 pointer-events-none" 37749 > 37750 <sonic-icon name="link-slash" library="custom" prefix="solid"></sonic-icon 37751 ></sonic-button>` : A$1} 37752 <sonic-button 37753 ?active=${isActive} 37754 shape="block" 37755 align="left" 37756 size="xs" 37757 variant="${isActive ? "outline" : "ghost"}" 37758 @click=${() => { 37759 if (isActive) { 37760 if (canDetach) { 37761 this.unlinkSubscription(); 37762 } 37763 return; 37764 } 37765 if (isInCart) { 37766 this.attachCartSubscription(subscriptionId); 37767 } else { 37768 this.linkSubscriptionPurchase(subscription); 37769 } 37770 }} 37771 > 37772 ${!isActive ? b$1` 37773 <div 37774 class="bg-warning absolute top-0 left-0 w-full h-full pointer-events-none opacity-[.1] rounded-[--sc-btn-rounded]" 37775 ></div> 37776 ` : A$1} 37777 <sonic-subscription-info 37778 noAutoFill 37779 dataProvider="/subscriptionSuggestion/${subscription.id}" 37780 .props=${subscription} 37781 class="block py-1 self-start min-h-24 min-w-0 relative" 37782 ></sonic-subscription-info> </sonic-button 37783 ></sonic-tooltip>`; 37784 } 37785 }; 37786 SubscriptionAttachForm.styles = [tailwind, customScroll]; 37787 __decorateClass$2A([ 37788 n$5({ type: Boolean }) 37789 ], SubscriptionAttachForm.prototype, "needPartnerSubscription", 2); 37790 __decorateClass$2A([ 37791 n$5({ type: Object }) 37792 ], SubscriptionAttachForm.prototype, "item", 2); 37793 __decorateClass$2A([ 37794 n$5({ type: String }) 37795 ], SubscriptionAttachForm.prototype, "cartProvider", 2); 37796 __decorateClass$2A([ 37797 c({ context: appType, subscribe: true }) 37798 ], SubscriptionAttachForm.prototype, "appType", 2); 37799 __decorateClass$2A([ 37800 bind$1("user.id"), 37801 n$5({ type: String }) 37802 ], SubscriptionAttachForm.prototype, "userId", 2); 37803 __decorateClass$2A([ 37804 r$5()
37805 ], SubscriptionAttachForm.prototype, "_currentSubscription", 2); 37806 __decorateClass$2A([ 37807 r$5() 37808 ], SubscriptionAttachForm.prototype, "_siblingsWithoutParent", 2); 37809 __decorateClass$2A([ 37810 bind$1("settings.modules.subscription.access"), 37811 n$5({ type: Boolean }) 37812 ], SubscriptionAttachForm.prototype, "subscriptionAccess", 2); 37813 __decorateClass$2A([ 37814 bind$1("settings.subscriptionRequirement"), 37815 r$5() 37816 ], SubscriptionAttachForm.prototype, "subscriptionRequirement", 2); 37817 __decorateClass$2A([ 37818 r$5() 37819 ], SubscriptionAttachForm.prototype, "_compatibleSubscriptions", 2); 37820 __decorateClass$2A([ 37821 r$5() 37822 ], SubscriptionAttachForm.prototype, "partnerOptions", 2); 37823 __decorateClass$2A([ 37824 bind$1("settings.disallowEventsForSoldSubscription"), 37825 r$5() 37826 ], SubscriptionAttachForm.prototype, "disallowEventsForSoldSubscription", 2); 37827 SubscriptionAttachForm = __decorateClass$2A([ 37828 t$3("sonic-subscription-attach-form") 37829 ], SubscriptionAttachForm); 37830 var __defProp$2x = Object.defineProperty; 37831 var __getOwnPropDesc$2z = Object.getOwnPropertyDescriptor; 37832 var __decorateClass$2z = (decorators, target, key, kind) => { 37833 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2z(target, key) : target; 37834 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37835 if (decorator = decorators[i2]) 37836 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 37837 if (kind && result) __defProp$2x(target, key, result); 37838 return result; 37839 }; 37840 const tagName$1y = "sonic-cart-item-line-detail-actions"; 37841 let CartItemLineDetailActions = class extends i$6 { 37842 constructor() { 37843 super(...arguments); 37844 this.cartProvider = "cart/current"; 37845 this.mode = "default"; 37846 this.canEditPriceFlag = false; 37847 } 37848 willUpdate(changedProperties) { 37849 super.willUpdate(changedProperties); 37850 if (changedProperties.has("mode") || changedProperties.has("item")) { 37851 this.canEditPriceFlag = canEditPrice(this.mode, this.item?.entity_type); 37852 } 37853 } 37854 get actionContext() { 37855 return { 37856 cartProvider: this.cartProvider, 37857 accessParams: this.accessParams, 37858 cartType: this.cartType 37859 }; 37860 } 37861 getApiConfiguration() { 37862 return HTML.getApiConfiguration(this); 37863 } 37864 render() { 37865 const item = this.item; 37866 const itemId = item?.id; 37867 if (!itemId || !item) return A$1; 37868 const ctx = this.actionContext; 37869 const needSubscription = item.price?.need_subscription || item.price?.need_partner_subscription; 37870 const canDelete = item.canDelete; 37871 const hasSeat = !!item.seat?.id; 37872 const sessionId = item.entity_type === EntityType.Event ? item.entity_id : 0; 37873 const canDetach = !isSubscriptionRequired(this.subscriptionRequirement, this.appType); 37874 const removeQuery = buildDetailRemoveQuery(itemId); 37875 const onRemove = () => removeCartItems(this, this.cartProvider, removeQuery); 37876 return renderActionMenuShell({ 37877 triggerIcon: "pen", 37878 menuMinWidth: "16rem", 37879 trashButton: canDelete ? renderTrashButton(onRemove) : void 0, 37880 menuItems: b$1` 37881 ${renderChangeEventSessionItems({ 37882 ctx, 37883 lineItems: [item], 37884 query: removeQuery, 37885 api: this, 37886 isMultiSession: isMultiSessionLineItem(this.cartProvider, item) 37887 })} 37888 ${this.canEditPriceFlag ? renderEditPriceItem(ctx, [item]) : A$1} 37889 ${renderEditOwnerItem(item, this.cartProvider, !!needSubscription)} 37890 ${hasSeat && sessionId ? b$1`<sonic-divider></sonic-divider>${renderSeatmapMenuItems(ctx, Number(sessionId))}` : A$1} 37891 ${item.parent_id ? renderUnlinkItem({ api: this, cartProvider: this.cartProvider, itemId, canDetach }) : A$1} 37892 ${canDelete ? renderRemoveMenuItem(onRemove, true) : A$1} 37893 ` 37894 }); 37895 } 37896 }; 37897 CartItemLineDetailActions.styles = [ 37898 tailwind, 37899 i$9` 37900 :host { 37901 display: flex; 37902 } 37903 ` 37904 ]; 37905 __decorateClass$2z([ 37906 n$5({ type: Object }) 37907 ], CartItemLineDetailActions.prototype, "item", 2); 37908 __decorateClass$2z([ 37909 ancestorAttribute("cartProvider") 37910 ], CartItemLineDetailActions.prototype, "cartProvider", 2); 37911 __decorateClass$2z([ 37912 c({ context: modeContext, subscribe: true }), 37913 n$5({ type: String }) 37914 ], CartItemLineDetailActions.prototype, "mode", 2); 37915 __decorateClass$2z([ 37916 r$5() 37917 ], CartItemLineDetailActions.prototype, "canEditPriceFlag", 2); 37918 __decorateClass$2z([ 37919 c({ context: cartTypeContext, subscribe: true }), 37920 n$5({ type: String }) 37921 ], CartItemLineDetailActions.prototype, "cartType", 2); 37922 __decorateClass$2z([ 37923 c({ context: accessParamsContext, subscribe: true }), 37924 n$5({ type: Object }) 37925 ], CartItemLineDetailActions.prototype, "accessParams", 2); 37926 __decorateClass$2z([ 37927 bind$1("settings.subscriptionRequirement"), 37928 r$5() 37929 ], CartItemLineDetailActions.prototype, "subscriptionRequirement", 2); 37930 __decorateClass$2z([ 37931 c({ context: appType, subscribe: true }), 37932 n$5({ type: String }) 37933 ], CartItemLineDetailActions.prototype, "appType", 2); 37934 CartItemLineDetailActions = __decorateClass$2z([ 37935 t$3(tagName$1y) 37936 ], CartItemLineDetailActions); 37937 var __defProp$2w = Object.defineProperty; 37938 var __getOwnPropDesc$2y = Object.getOwnPropertyDescriptor; 37939 var __decorateClass$2y = (decorators, target, key, kind) => { 37940 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2y(target, key) : target; 37941 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 37942 if (decorator = decorators[i2]) 37943 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 37944 if (kind && result) __defProp$2w(target, key, result); 37945 return result; 37946 }; 37947 let SonicCartItemLine$2 = class SonicCartItemLine extends Subscriber$1(i$6) { 37948 constructor() { 37949 super(...arguments); 37950 this.mode = "default"; 37951 this.entity_type = null; 37952 this.price = {}; 37953 this.quota = null; 37954 this.owner = null; 37955 this.infos = null; 37956 this.placeCategory = null; 37957 this.seat = null; 37958 this.messages = []; 37959 this.canEditPrice = false;
37960 this._cartProvider = ""; 37961 } 37962 connectedCallback() { 37963 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 37964 super.connectedCallback(); 37965 } 37966 willUpdate(changedProperties) { 37967 if (changedProperties.has("mode") || changedProperties.has("cartType")) { 37968 this.canEditPrice = this.mode == "default" && this.entity_type !== EntityType.AdditionalProduct && this.entity_type !== EntityType.Subscribe; 37969 } 37970 super.willUpdate(changedProperties); 37971 } 37972 // 37973 // RENDER 37974 // LAYOUT GLOBAL 37975 render() { 37976 const quotaName = this.quota?.title || ""; 37977 const displayQuota = this.quota?.id && this.quota.id > 1 && quotaName ? true : false; 37978 const itemsToMove = this.props && Object.keys(this.props).length !== 0 ? [this.props] : []; 37979 const canEditLabel = this.canEditPrice ? t("edit_price") : ""; 37980 if (!this.props) return A$1; 37981 return b$1` 37982 <div 37983 class=" 37984 @container 37985 flex w-full items-start gap-2 37986 min-h-6 37987 rounded 37988 px-1 37989 py-2 37990 group 37991 hover:bg-[rgba(0,0,0,.02)] 37992 " 37993 > 37994 <div class=" self-center text-xs @lg:text-sm leading-tight grow items-start "> 37995 <div class="flex flex-wrap gap-x-[0.35em] w-full mb-[2px]"> 37996 <div 37997 @click=${() => { 37998 if (this.canEditPrice) { 37999 editPriceModal({ 38000 lineItems: this.props ? [this.props] : [], 38001 cartProvider: this._cartProvider, 38002 accessParams: this.accessParams 38003 }); 38004 } 38005 }} 38006 class="${this.canEditPrice ? "cursor-pointer hover:underline" : ""}" 38007 title=${o$4(canEditLabel)} 38008 > 38009 ${categoryMarkup(this.price)} ${this.price.label} 38010 </div> 38011 </div> 38012 <div class="text-xs"> 38013 ${displayQuota ? b$1`<sonic-badge size="inherit" class="mr-2">${quotaName}</sonic-badge>` : A$1} 38014 ${placementMarkup([this.props], "default")} 38015 ${this.price?.is_countermark ? b$1`<sonic-badge type="warning" size="xs" class="mr-2" variant="ghost"> 38016 <sonic-icon name="file-exclamation" library="custom" slot="prefix"></sonic-icon> 38017 <div class="text-balance">${t("contremarque_echanger_guichet")}</div> 38018 </sonic-badge>` : A$1} 38019 </div> 38020 38021 ${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} 38022 <div class="text-xs">${this.renderOwner()}</div> 38023 </div> 38024 <div class="inline-flex gap-1 justify-end items-center ml-auto min-h-[2.1em]"> 38025 <div class="text-sm text-right leading-none font-bold">
38025${formatAmount(this.price?.amount || 0)}</div> 38026 ${this.mode == "split" || this.mode == "splitResult" ? b$1`<sonic-cart-move-items-button size="xs" .lineItems=${itemsToMove}></sonic-cart-move-items-button>` : A$1} 38027 ${this.mode == "default" ? b$1` 38028 <sonic-cart-item-line-detail-actions 38029 .item=${this.props} 38030 class="w-[4.45rem] flex justify-end shrink-0" 38031 ></sonic-cart-item-line-detail-actions> 38032 ` : A$1} 38033 </div> 38034 </div> 38035 `; 38036 } 38037 renderOwner() { 38038 if (!this.props) return A$1; 38039 const owner = this.props.owner; 38040 const { firstName, lastName, email: email2 } = owner || {}; 38041 const fancyLastName = lastName ? b$1`<span class="uppercase">${lastName}</span>` : ""; 38042 const has_error_owner = this.props?.has_error_owner; 38043 const ownerIsEmpty = !owner || !firstName && !lastName && !email2; 38044 const hasOwnerData = !ownerIsEmpty; 38045 const needSubscription = this.props?.price?.need_subscription || this.props?.price?.need_partner_subscription; 38046 let icon2 = ownerIcon(owner); 38047 if (needSubscription) { 38048 icon2 = b$1`<sonic-icon name="id-card" prefix="regular" library="custom" class="shrink-0"></sonic-icon>`; 38049 } else if (ownerIsEmpty) { 38050 icon2 = b$1`<sonic-icon name="circle-plus" prefix="regular" library="custom" class="shrink-0"></sonic-icon>`; 38051 } else if (!has_error_owner && !needSubscription) { 38052 icon2 = ownerIcon(owner, "shrink-0"); 38053 } 38054 const disabled = !this.canEditPrice; 38055 if (hasOwnerData) { 38056 return b$1`<button 38057 size="inherit" 38058 class="mt-1 flex gap-1 text-left ${disabled ? "text-neutral-500" : "text-info"}" 38059 ?inert=${disabled} 38060 @click=${() => { 38061 attachOwnerModal({ items: this.props ? [this.props] : [], cartProvider: this._cartProvider }); 38062 }} 38063 > 38064 <span class="shrink-0 ">${icon2}</span> 38065 <span class="grow text-left">${fancyLastName} ${firstName} ${email2 ? `⢠${email2}` : ""}</span> 38066 </button>`; 38067 } 38068 if (!this.props?.owner_required || this.mode != "default") return A$1; 38069 let buttonText = t("edit_owner"); 38070 if (ownerIsEmpty && !this.props?.parent_id) { 38071 buttonText = t("add_owner"); 38072 } 38073 const isCondensed = this.layout == "condensed"; 38074 const isCounter = this.appType === "counter"; 38075 let buttonType = "danger"; 38076 if (isCounter && this.entity_type === EntityType.Event && !needSubscription) { 38077 buttonType = "info"; 38078 } else if (this.props?.parent_id && ownerIsEmpty) { 38079 buttonType = "warning"; 38080 } 38081 return b$1`<sonic-button 38082 @click=${() => { 38083 attachOwnerModal({ items: this.props ? [this.props] : [], cartProvider: this._cartProvider }); 38084 }} 38085 size="${isCondensed ? "2xs" : "xs"}" 38086 variant="outline" 38087 type="${buttonType}" 38088 class="mt-1 mb-2 " 38089 data-aria-label=${buttonText} 38090 > 38091 <div class="flex gap-1"> 38092 ${icon2} 38093 <div>${buttonText}</div> 38094 </div> 38095 </sonic-button>`; 38096 } 38097 }; 38098 SonicCartItemLine$2.styles = [ 38099 tailwind, 38100 i$9` 38101 :host { 38102 display: block; 38103 } 38104 ` 38105 ]; 38106 __decorateClass$2y([ 38107 c({ context: appType, subscribe: true }), 38108 n$5({ type: String }) 38109 ], SonicCartItemLine$2.prototype, "appType", 2); 38110 __decorateClass$2y([ 38111 c({ context: modeContext, subscribe: true }), 38112 n$5({ type: String }) 38113 ], SonicCartItemLine$2.prototype, "mode", 2); 38114 __decorateClass$2y([ 38115 c({ context: layoutContext, subscribe: true }), 38116 n$5({ type: String }) 38117 ], SonicCartItemLine$2.prototype, "layout", 2); 38118 __decorateClass$2y([ 38119 n$5({ type: String }) 38120 ], SonicCartItemLine$2.prototype, "entity_type", 2); 38121 __decorateClass$2y([ 38122 n$5({ type: Object }) 38123 ], SonicCartItemLine$2.prototype, "price", 2); 38124 __decorateClass$2y([ 38125 n$5({ type: Object }) 38126 ], SonicCartItemLine$2.prototype, "quota", 2); 38127 __decorateClass$2y([ 38128 n$5({ type: Object }) 38129 ], SonicCartItemLine$2.prototype, "owner", 2); 38130 __decorateClass$2y([ 38131 n$5({ type: Object }) 38132 ], SonicCartItemLine$2.prototype, "infos", 2); 38133 __decorateClass$2y([ 38134 n$5({ type: Object }) 38135 ], SonicCartItemLine$2.prototype, "placeCategory", 2); 38136 __decorateClass$2y([ 38137 n$5({ type: Object }) 38138 ], SonicCartItemLine$2.prototype, "seat", 2); 38139 __decorateClass$2y([ 38140 n$5({ type: Array }) 38141 ], SonicCartItemLine$2.prototype, "messages", 2); 38142 __decorateClass$2y([ 38143 r$5() 38144 ], SonicCartItemLine$2.prototype, "_modal", 2); 38145 __decorateClass$2y([ 38146 r$5() 38147 ], SonicCartItemLine$2.prototype, "canEditPrice", 2); 38148 __decorateClass$2y([ 38149 r$5()
38150 ], SonicCartItemLine$2.prototype, "_cartProvider", 2); 38151 __decorateClass$2y([ 38152 c({ context: cartTypeContext, subscribe: true }), 38153 n$5({ type: String }) 38154 ], SonicCartItemLine$2.prototype, "cartType", 2); 38155 __decorateClass$2y([ 38156 c({ context: accessParamsContext, subscribe: true }), 38157 n$5({ type: Object }) 38158 ], SonicCartItemLine$2.prototype, "accessParams", 2); 38159 SonicCartItemLine$2 = __decorateClass$2y([ 38160 t$3("sonic-cart-item-line-detail") 38161 ], SonicCartItemLine$2); 38162 var __defProp$2v = Object.defineProperty; 38163 var __getOwnPropDesc$2x = Object.getOwnPropertyDescriptor; 38164 var __decorateClass$2x = (decorators, target, key, kind) => { 38165 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2x(target, key) : target; 38166 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 38167 if (decorator = decorators[i2]) 38168 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 38169 if (kind && result) __defProp$2v(target, key, result); 38170 return result; 38171 }; 38172 const tagName$1x = "sonic-cart-item-line-actions"; 38173 let CartItemLineActions = class extends i$6 { 38174 constructor() { 38175 super(...arguments); 38176 this.cartProvider = "cart/current"; 38177 this.mode = "default"; 38178 this.canEditPriceFlag = false; 38179 } 38180 willUpdate(changedProperties) { 38181 if (changedProperties.has("items")) { 38182 this.query = buildLineGroupQuery(this.items || []); 38183 } 38184 if (changedProperties.has("mode") || changedProperties.has("items")) { 38185 this.canEditPriceFlag = canEditPrice(this.mode, this.items?.[0]?.entity_type); 38186 } 38187 super.willUpdate(changedProperties); 38188 } 38189 get actionContext() { 38190 return { 38191 cartProvider: this.cartProvider, 38192 accessParams: this.accessParams, 38193 cartType: this.cartType 38194 }; 38195 } 38196 getApiConfiguration() { 38197 return HTML.getApiConfiguration(this); 38198 } 38199 render() { 38200 const items = this.items; 38201 if (!items?.length || !this.query) return A$1; 38202 const ctx = this.actionContext; 38203 const firstItem = items[0]; 38204 const canDelete = items.every((item) => item.canDelete); 38205 const sessionId = firstItem.entity_type === EntityType.Event ? firstItem.entity_id : null; 38206 const hasSeat = items.some((item) => item.seat?.id); 38207 const isMultiSession = isMultiSessionLineItem(this.cartProvider, firstItem); 38208 const hasActions = canDelete || hasSeat && sessionId || this.canEditPriceFlag || isMultiSession; 38209 const onRemove = () => removeCartItems(this, this.cartProvider, this.query); 38210 if (!hasActions) return A$1; 38211 return renderActionMenuShell({ 38212 triggerIcon: "pen", 38213 menuMinWidth: "13rem", 38214 trashButton: canDelete ? renderTrashButton(onRemove) : void 0, 38215 menuItems: b$1` 38216 ${renderChangeEventSessionItems({ 38217 ctx, 38218 lineItems: items, 38219 query: this.query, 38220 api: this, 38221 isMultiSession 38222 })} 38223 ${this.canEditPriceFlag ? renderEditPriceItem(ctx, items) : A$1} 38224 ${hasSeat && sessionId ? renderSeatmapMenuItems(ctx, Number(sessionId)) : A$1} 38225 ${canDelete ? renderRemoveMenuItem(onRemove) : A$1} 38226 ` 38227 }); 38228 } 38229 }; 38230 CartItemLineActions.styles = [ 38231 tailwind, 38232 i$9` 38233 :host { 38234 display: flex; 38235 } 38236 ` 38237 ]; 38238 __decorateClass$2x([ 38239 n$5({ type: Array }) 38240 ], CartItemLineActions.prototype, "items", 2); 38241 __decorateClass$2x([ 38242 ancestorAttribute("cartProvider") 38243 ], CartItemLineActions.prototype, "cartProvider", 2); 38244 __decorateClass$2x([ 38245 c({ context: modeContext, subscribe: true }), 38246 n$5({ type: String }) 38247 ], CartItemLineActions.prototype, "mode", 2); 38248 __decorateClass$2x([ 38249 r$5() 38250 ], CartItemLineActions.prototype, "query", 2); 38251 __decorateClass$2x([ 38252 r$5() 38253 ], CartItemLineActions.prototype, "canEditPriceFlag", 2); 38254 __decorateClass$2x([ 38255 c({ context: appType, subscribe: true }), 38256 n$5({ type: String }) 38257 ], CartItemLineActions.prototype, "appType", 2); 38258 __decorateClass$2x([ 38259 c({ context: cartTypeContext, subscribe: true }), 38260 n$5({ type: String }) 38261 ], CartItemLineActions.prototype, "cartType", 2); 38262 __decorateClass$2x([ 38263 c({ context: accessParamsContext, subscribe: true }), 38264 n$5({ type: Object }) 38265 ], CartItemLineActions.prototype, "accessParams", 2); 38266 CartItemLineActions = __decorateClass$2x([ 38267 t$3(tagName$1x) 38268 ], CartItemLineActions); 38269 var __defProp$2u = Object.defineProperty; 38270 var __getOwnPropDesc$2w = Object.getOwnPropertyDescriptor; 38271 var __decorateClass$2w = (decorators, target, key, kind) => { 38272 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2w(target, key) : target; 38273 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 38274 if (decorator = decorators[i2]) 38275 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 38276 if (kind && result) __defProp$2u(target, key, result); 38277 return result; 38278 }; 38279 let SonicCartItemLine$1 = class SonicCartItemLine extends Subscriber$1(i$6) { 38280 constructor() { 38281 super(...arguments); 38282 this.mode = "default"; 38283 this.quantity = 0; 38284 this.price = {}; 38285 this.infos = null; 38286 this.canEditQuantity = false;
38287 this.owner_required = false; 38288 this.showDetail = false; 38289 this.entity_type = null; 38290 this.total = 0; 38291 this.messages = []; 38292 this.quota = null; 38293 this.items = null; 38294 this.wording_abonnement = ""; 38295 this.wording_LIB_abo_place = ""; 38296 this.canEditPrice = false; 38297 this._cartProvider = ""; 38298 } 38299 connectedCallback() { 38300 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 38301 super.connectedCallback(); 38302 } 38303 willUpdate(changedProperties) { 38304 if (this.price.amount !== void 0 && (changedProperties.has("quantity") || changedProperties.has("price"))) { 38305 this.publisher.total = this.quantity * this.price.amount; 38306 } 38307 if (changedProperties.has("items")) { 38308 const categories = this.items?.map((item) => item.price?.placeCategory?.title); 38309 if (categories && new Set(categories).size === 1) { 38310 this.categoryLabel = categories[0]; 38311 } 38312 } 38313 this.canEditPrice = this.mode == "default" && this.cartType !== "cart" && this.entity_type !== EntityType.AdditionalProduct && this.entity_type !== EntityType.Subscribe; 38314 super.willUpdate(changedProperties); 38315 } 38316 // 38317 // RENDER 38318 // LAYOUT GLOBAL 38319 render() { 38320 const quotaName = this.quota?.title || ""; 38321 const displayQuota = this.quota?.id && this.quota.id > 1 && quotaName ? true : false; 38322 const hasError = this.props?.items?.some((item) => item.has_error); 38323 const canEditLabel = this.canEditPrice ? t("edit_price") : ""; 38324 const itemsToMove = this.items; 38325 const anItemRequestOwner = this.items?.some((item) => { 38326 const needSubscription = item.price?.need_subscription || item.price?.need_partner_subscription; 38327 if (needSubscription) { 38328 return true; 38329 } else if (this.appType === "counter" && this.entity_type === EntityType.Event) { 38330 return false; 38331 } else { 38332 return item.owner_required; 38333 } 38334 }); 38335 const forceGlobalLine = this.mode !== "split" && this.mode !== "splitResult" && this.entity_type === EntityType.AdditionalProduct; 38336 const displayGlobalLine = (!this.showDetail || forceGlobalLine) && !anItemRequestOwner; 38337 const displayDetail = !displayGlobalLine; 38338 return b$1` 38339 ${displayGlobalLine ? b$1` <div 38340 class=" 38341 @container 38342 grid 38343 grid-cols-[minmax(35%,1fr)_auto_minmax(0,max-content)] items-center gap-3 38344 rounded py-[1px] 38345 px-1 38346 hover:bg-neutral-50 hover:shadow-[0_0_0_2px_var(--sc-base-50)] 38347 min-h-[1.7rem] @lg:min-h-[2rem] 38348 " 38349 > 38350 <div class="text-xs @lg:text-sm leading-tight py-1"> 38351 <slot name="text"> 38352 38353 <div> 38354 ${this.priceIcon()} 38355 <span 38356 @click=${() => { 38357 if (this.canEditPrice) { 38358 editPriceModal({ 38359 lineItems: this.props ? [this.props] : [], 38360 cartProvider: this._cartProvider, 38361 accessParams: this.accessParams 38362 }); 38363 } 38364 }} 38365 class="${hasError ? "text-danger font-bold" : ""} ${this.canEditPrice ? "cursor-pointer hover:underline" : ""}" 38366 title=${o$4(canEditLabel)} 38367 > 38368 ${categoryMarkup(this.price)} 38369 ${this.price.label} 38370 </span> 38371 ${this.infos?.code ? b$1`<sonic-badge size="xs" class="tracking-wider">${this.infos.code}</sonic-badge>` : A$1} 38372 </div> 38373 <div class="text-xs flex items-center flex-wrap"> 38374 ${displayQuota ? b$1`<sonic-badge size="inherit" class="mr-2" ellipsis>${quotaName}</sonic-badge>` : A$1} 38375 ${placementMarkup(this.items, "condensed")} 38376 ${this.price?.is_countermark ? b$1`<sonic-badge type="warning" size="xs" class="mr-2" variant="ghost"> 38377 <sonic-icon name="file-exclamation" library="custom" slot="prefix"></sonic-icon> 38378 <div class="text-balance">${t("contremarque_echanger_guichet")}</div> 38379 </sonic-badge>` : A$1} 38380 <sonic-cart-item-line-messages class="block my-1" size="inherit"></sonic-cart-item-line-messages> 38381 </div> 38382 </slot> 38383 </div> 38384 38385 <div class="inline-flex gap-1 items-center ml-auto text-xs text-neutral-400 "> 38386 <slot name="quantity">${this.defaultQuantityMarkup()}</slot> 38387 </div> 38388 38389 <div class="inline-flex gap-1 justify-end items-center"> 38390 <div 38391 class="text-sm @sm:text-base min-w-[3.2rem] whitespace-nowrap 38392 @lg:min-w-[6ch] 38393 text-right ml-auto leading-none font-bold" 38394 >
38395 ${formatAmount(this.total)} 38396 </div> 38397 38398 <!-- retirer bientot this.isExtra && this.props?.entity?.entity_type === EntityType.Giftcard) --> 38399 ${(this.mode == "split" || this.mode == "splitResult") && itemsToMove && itemsToMove?.length ? b$1`<sonic-cart-move-items-button 38400 size="sm" 38401 .lineItems=${itemsToMove} 38402 ></sonic-cart-move-items-button>` : A$1} 38403 ${this.mode == "default" ? b$1` 38404 <sonic-cart-item-line-actions 38405 .items=${this.items || []} 38406 class="w-[4.45rem] shrink-0 flex items-center justify-end" 38407 ></sonic-cart-item-line-actions> 38408 ` : A$1} 38409 </div> 38410 </div> </div>` : A$1} 38411 ${displayDetail ? b$1` <sonic-list 38412 subDataProvider="items" 38413 .items=${() => { 38414 return b$1`<sonic-cart-item-line-detail lazyRendering> </sonic-cart-item-line-detail> `; 38415 }} 38416 > 38417 </sonic-list>` : A$1} 38418 `; 38419 } 38420 priceIcon() { 38421 if (this.price.is_promo) return b$1`<sonic-icon library="custom" name="gift"></sonic-icon>`; 38422 if (this.price.is_triggering_promo) return b$1`<sonic-icon library="custom" name="star"></sonic-icon>`; 38423 else return A$1; 38424 } 38425 categoryMarkup() { 38426 return b$1`${this.categoryLabel ? b$1`<span class="inline-block italic">| ${o$6(this.categoryLabel)}</span>` : A$1}`; 38427 } 38428 // QUANTITÃ et ajout au panier 38429 defaultQuantityMarkup() { 38430 const hasError = this.props?.items?.some((item) => item.has_error); 38431 const isCondensed = this.layout == "condensed" ? true : false; 38432 const isRequestOrCampaign = getAccessType(this.accessParams) === AccessType.RESERVATION_REQUEST || getAccessType(this.accessParams) === AccessType.CAMPAIGN; 38433 const canEdit = isRequestOrCampaign ? true : this.canEditQuantity && this.mode !== "split"; 38434 return b$1` 38435 ${this.mode == "readonly" ? b$1` <div class="inline-block font-bold min-w-[2ch] text-right">${this.quantity}</div> ` : b$1` 38436 <sonic-cart-input 38437 name="quantity" 38438 status="${hasError ? "error" : "default"}" 38439 ?readonly=${!canEdit} 38440 ?plusMinus=${canEdit} 38441 formDataProvider="${this.dataProvider || ""}" 38442 size="${isCondensed ? "2xs" : "xs"}" 38443 min=${this.price.min || 0} 38444 max=${Math.min(this.price.max || 999)} 38445 .propertyMap=${{ type: "entity_type" }} 38446 > 38447 </sonic-cart-input> 38448 `} 38449 38450 <div class="hidden @lg:block min-w-[7ch] @lg:min-w-[8.5ch] @lg:ml-1"> 38451 Ã ${formatAmount(this.price.amount || 0)} 38452 </div> 38453 `; 38454 } 38455 }; 38456 SonicCartItemLine$1.styles = [tailwind]; 38457 __decorateClass$2w([ 38458 c({ context: appType, subscribe: true }), 38459 n$5({ type: String }) 38460 ], SonicCartItemLine$1.prototype, "appType", 2); 38461 __decorateClass$2w([ 38462 c({ context: modeContext, subscribe: true }), 38463 n$5({ type: String }) 38464 ], SonicCartItemLine$1.prototype, "mode", 2); 38465 __decorateClass$2w([ 38466 c({ context: layoutContext, subscribe: true }), 38467 n$5({ type: String }) 38468 ], SonicCartItemLine$1.prototype, "layout", 2); 38469 __decorateClass$2w([ 38470 n$5({ type: Number }) 38471 ], SonicCartItemLine$1.prototype, "quantity", 2); 38472 __decorateClass$2w([ 38473 n$5({ type: Object }) 38474 ], SonicCartItemLine$1.prototype, "price", 2); 38475 __decorateClass$2w([ 38476 n$5({ type: Object }) 38477 ], SonicCartItemLine$1.prototype, "infos", 2); 38478 __decorateClass$2w([ 38479 n$5({ type: Boolean }) 38480 ], SonicCartItemLine$1.prototype, "canEditQuantity", 2); 38481 __decorateClass$2w([ 38482 n$5({ type: Boolean }) 38483 ], SonicCartItemLine$1.prototype, "owner_required", 2); 38484 __decorateClass$2w([ 38485 c({ context: detailContext, subscribe: true }), 38486 n$5({ type: Boolean }) 38487 ], SonicCartItemLine$1.prototype, "showDetail", 2); 38488 __decorateClass$2w([ 38489 n$5({ type: String }) 38490 ], SonicCartItemLine$1.prototype, "entity_type", 2); 38491 __decorateClass$2w([ 38492 n$5({ type: Number }) 38493 ], SonicCartItemLine$1.prototype, "total", 2); 38494 __decorateClass$2w([ 38495 n$5({ type: Array }) 38496 ], SonicCartItemLine$1.prototype, "messages", 2); 38497 __decorateClass$2w([ 38498 n$5({ type: Object }) 38499 ], SonicCartItemLine$1.prototype, "quota", 2); 38500 __decorateClass$2w([ 38501 r$5() 38502 ], SonicCartItemLine$1.prototype, "_modal", 2); 38503 __decorateClass$2w([ 38504 n$5({ type: Array }) 38505 ], SonicCartItemLine$1.prototype, "items", 2); 38506 __decorateClass$2w([ 38507 n$5({ type: String }) 38508 ], SonicCartItemLine$1.prototype, "wording_abonnement", 2); 38509 __decorateClass$2w([ 38510 n$5({ type: String }) 38511 ], SonicCartItemLine$1.prototype, "wording_LIB_abo_place", 2); 38512 __decorateClass$2w([ 38513 n$5({ type: String }) 38514 ], SonicCartItemLine$1.prototype, "categoryLabel", 2); 38515 __decorateClass$2w([ 38516 r$5() 38517 ], SonicCartItemLine$1.prototype, "canEditPrice", 2); 38518 __decorateClass$2w([ 38519 c({ context: cartTypeContext, subscribe: true }), 38520 n$5({ type: String }) 38521 ], SonicCartItemLine$1.prototype, "cartType", 2); 38522 __decorateClass$2w([ 38523 c({ context: accessParamsContext, subscribe: true }), 38524 n$5({ type: Object }) 38525 ], SonicCartItemLine$1.prototype, "accessParams", 2); 38526 SonicCartItemLine$1 = __decorateClass$2w([ 38527 t$3("sonic-cart-item-line") 38528 ], SonicCartItemLine$1); 38529 var __defProp$2t = Object.defineProperty; 38530 var __getOwnPropDesc$2v = Object.getOwnPropertyDescriptor; 38531 var __decorateClass$2v = (decorators, target, key, kind) => { 38532 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2v(target, key) : target; 38533 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 38534 if (decorator = decorators[i2]) 38535 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 38536 if (kind && result) __defProp$2t(target, key, result); 38537 return result; 38538 }; 38539 const tagName$1w = "sonic-cart-item-line-subscribe"; 38540 let CartItemSubscribe = class extends Subscriber$1(i$6) { 38541 constructor() { 38542 super(...arguments); 38543 this.quantity = 0; 38544 this.total = 0; 38545 this.items = []; 38546 this.showDetail = false;
38547 this.mode = "default"; 38548 this.cartType = CartType.Cart; 38549 this.layout = "default"; 38550 this.fullWidth = false; 38551 this.noSubscriptionActions = false; 38552 this.cartProvider = "cart/current"; 38553 this.entityTitle = ""; 38554 } 38555 willUpdate(_changedProperties) { 38556 if (_changedProperties.has("props")) { 38557 this.entityTitle = this.props?.entity?.edito?.title || ""; 38558 } 38559 super.willUpdate(_changedProperties); 38560 } 38561 addEntitiesToItems(items) { 38562 if (!this.cartProvider) return items; 38563 try { 38564 const entities = dp(this.cartProvider).data.entities.get(); 38565 if (!entities) return items; 38566 return items.map((item) => ({ 38567 ...item, 38568 entity: entities.find( 38569 (entity) => entity.id === item.entity_id && entity.entity_type === item.entity_type 38570 ) 38571 })); 38572 } catch (error) { 38573 console.error("Error fetching entities:", error); 38574 return items; 38575 } 38576 } 38577 // Méthode helper pour déterminer le type d'entité 38578 // private getEntityType(entity: Session | GiftCard | SubscribeType | AdditionalProduct): string { 38579 // if ("start_date" in entity) { 38580 // return EntityType.Event; 38581 // } else if ("code" in entity) { 38582 // return EntityType.Giftcard; 38583 // } else if ("subscription_type" in entity) { 38584 // return EntityType.Subscribe; 38585 // } else if ("product_type" in entity) { 38586 // return EntityType.AdditionalProduct; 38587 // } 38588 // return ""; 38589 // } 38590 sortItemsByStartDates(items) { 38591 return [...items].sort((a2, b2) => { 38592 const aStartDate = a2.entity && "start_date" in a2.entity ? a2.entity.start_date ?? 0 : 0; 38593 const bStartDate = b2.entity && "start_date" in b2.entity ? b2.entity.start_date ?? 0 : 0; 38594 return aStartDate - bStartDate; 38595 }); 38596 } 38597 render() { 38598 const isCondensed = this.layout == "condensed"; 38599 const editMode = this.mode !== "readonly"; 38600 return b$1` 38601 ${c$1( 38602 this.items, 38603 (item) => item.id, 38604 (item, _index) => { 38605 let ticketQuantity = item.items?.filter((item2) => item2.entity_type === EntityType.Event).length || 0; 38606 const ticketQuantityLabel = ticketQuantity > 1 ? t("billets") : t("billet"); 38607 let total = 0; 38608 if ("total" in item) { 38609 total = item.total || 0; 38610 } 38611 const subscriptionEntityId = item.entity_id?.toString(); 38612 const subscriptionPriceId = item.price?.id?.toString(); 38613 const displayEmail = item.owner?.email && !item.owner?.email.endsWith(".pasdemail"); 38614 if (!subscriptionEntityId || !subscriptionPriceId) return A$1; 38615 return b$1` 38616 <div 38617 class=" 38618 @container 38619 ${this.fullWidth ? "w-full" : "px-1 py-2 mb-1 rounded"} 38620 ${editMode ? "hover:bg-[rgba(0,0,0,.02)] hover:shadow-[0_0_0_1px_rgba(0,0,0,.02)]" : ""}" 38621 > 38622 <div class="flex items-center gap-3 min-h-10 "> 38623 <div class="min-w-0"> 38624 <div class="font-bold text-lg">${this.entityTitle}</div> 38625 <div class="min-w-0 flex gap-1 text-xs @lg:text-sm"> 38626 <div class="min-w-0"> 38627 ${this.ownerName(item)} 38628 ${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} 38629 <div class="flex gap-x-3 text-neutral-500 flex-wrap min-w-0"> 38630 ${displayEmail ? b$1`<div class="truncate overflow-hidden">${item.owner?.email}</div>` : A$1} 38631 </div> 38632 </div> 38633 </div> 38634 </div> 38635 38636 <div class="flex ml-auto items-center gap-1 text-sm"> 38637 <div 38638 class="ml-auto font-bold text-right whitespace-nowrap ${isCondensed ? "text-sm min-w-[3.2rem]" : "text-base min-w-[6ch]"}" 38639 > 38640 ${formatAmount(total)} 38641 </div> 38642 38643 ${(this.mode == "split" || this.mode == "splitResult") && item ? b$1`<sonic-cart-move-items-button size="sm" .lineItems=${[item]}></sonic-cart-move-items-button>
38643` : A$1} 38644 ${this.mode === "default" ? b$1` ${this.subscriptionActions(item)} ` : A$1} 38645 </div> 38646 </div> 38647 38648 <div class="my-2"> 38649 ${ticketQuantity ? b$1` 38650 <sonic-badge type="primary" size="sm" aria-label="${ticketQuantity} ${ticketQuantityLabel}"> 38651 <div class="flex items-center"> 38652 <sonic-icon name="id-card" library="custom" prefix="regular"></sonic-icon> 38653 <sonic-icon name="plus" library="custom" size="xs"></sonic-icon> 38654 ${ticketQuantity} 38655 <sonic-icon name="ticket" library="custom" prefix="regular" class="ml-1"></sonic-icon> 38656 </div> 38657 </sonic-badge> 38658 ` : A$1} 38659 ${item.renew_from?.number ? b$1` 38660 <sonic-tooltip label="N°${item.renew_from.number}"> 38661 <sonic-badge type="primary" size="sm"> 38662 <sonic-icon name="arrows-rotate" library="custom" prefix="regular"></sonic-icon> 38663 <span>${t("LIB_Renouvellement")}</span> 38664 </sonic-badge> 38665 </sonic-tooltip> 38666 ` : A$1} 38667 </div> 38668 ${item.messages && item.messages.length > 0 ? b$1`<sonic-cart-item-line-messages 38669 class="block my-2 max-w-[64ch]" 38670 size="xs" 38671 dataProvider="subscriptionCartInfo/${item.entity_id}" 38672 .messages=${item.messages} 38673 ></sonic-cart-item-line-messages>` : A$1} 38674 ${this.quickActions(item)} ${this.renderDetail(item)} 38675 </div> 38676 `; 38677 } 38678 )} 38679 `; 38680 } 38681 quickActions(item) { 38682 const has_error = item.has_error_owner || item.has_error_linked_events || item.has_error_proof; 38683 if (this.mode !== "default" || !has_error) return A$1; 38684 return b$1` 38685 <div class="flex gap-[2px] flex-wrap text-2xs @lg:text-xs mb-4 @xl:mb-5"> 38686 ${item.has_error_owner ? b$1` 38687 <sonic-button 38688 variant="outline" 38689 size="inherit" 38690 type="danger" 38691 @click=${() => editSubscriptionOwnerModal({ 38692 lineItem: item, 38693 cartProvider: this.cartProvider, 38694 accessParams: this.accessParams 38695 })} 38696 > 38697 <sonic-icon name="id-card" library="custom" prefix="regular" slot="prefix"></sonic-icon> 38698 ${t("edit_owner")}</sonic-button 38699 > 38700 ` : A$1} 38701 ${item.has_error_proof ? b$1` 38702 <sonic-button 38703 variant="outline" 38704 size="inherit" 38705 type="danger" 38706 @click=${() => addProofModal({ lineItem: item, cartProvider: this.cartProvider, accessParams: this.accessParams })} 38707 > 38708 <sonic-icon name="file-arrow-up" library="custom" prefix="regular" slot="prefix"></sonic-icon> 38709 ${t("LIB_add_proof")}</sonic-button 38710 > 38711 ` : A$1} 38712 ${item.has_error_linked_events ? b$1` 38713 <sonic-button 38714 variant="outline" 38715 size="inherit" 38716 type="danger" 38717 @click=${() => quickSelectModal({ 38718 cartProvider: this.cartProvider, 38719 selectedSubscriptionId: item.id, 38720 accessParams: this.accessParams 38721 })} 38722 > 38723 <sonic-icon name="calendar-check" library="custom" prefix="regular" slot="prefix"></sonic-icon> 38724 ${t("events_choice")}</sonic-button 38725 > 38726 ` : A$1} 38727 </div> 38728 `; 38729 } 38730 renderDetail(item) { 38731 const hasEvents = item?.items?.some((item2) => item2.entity_type === EntityType.Event); 38732 const itemsWithEntities = this.addEntitiesToItems(item?.items || []); 38733 const subItems = this.sortItemsByStartDates(itemsWithEntities); 38734 if (!hasEvents) return A$1; 38735 const displayDetail = item?.items?.length && (this.showDetail || this.layout !== "condensed"); 38736 return b$1` ${displayDetail ? b$1`<div class="w-full @lg:pb-2 pl-2 @xl:pl-3 @2xl:pl-6"> 38737 ${c$1( 38738 subItems, 38739 (item2) => `${item2.entity_type}_${item2.id}`, 38740 (item2, _index) => { 38741 const entity = item2.entity; 38742 const displayPriceLabel = item2?.price?.label && item2?.price?.label !== this.entityTitle; 38743 const quotaTitle = item2.quota?.id !== 1 ? item2?.quota?.title : null; 38744 return b$1`<div class="flex w-full gap-1 my-4" style="interpolate-size: allow-keywords"> 38745 <sonic-product-summary 38746 dataProvider="subscriptionCartInfo_${item2.entity_type}_${item2.entity_id}" 38747 size="2xs" 38748 .props=${entity} 38749 class="w-full" 38750 ?textOnly=${this.layout == "condensed"} 38751 lazyRendering 38752 noAutoFill 38753 > 38754 <div 38755 slot="infos" 38756 class="align-middle w-full @lg:w-[12rem] @xl:w-[15rem] text-xs text-neutral-500 gap-1 items-center" 38757 > 38758 <div class="truncate"> 38759 ${categoryMarkup(item2?.price)} 38760 ${displayPriceLabel ? b$1`${o$6(item2?.price?.label)} ` : A$1} 38761 </div> 38762 ${quotaTitle ? b$1`<sonic-badge size="inherit" ellipsis>${o$6(quotaTitle)}</sonic-badge>` : A$1} 38763 ${placementMarkup([item2], "condensed")} 38764 ${c$1( 38765 item2.messages || [], 38766 (message) => message, 38767 (message) => { 38768 const isSubscription = item2.entity_type === EntityType.Subscribe; 38769 if (isSubscription) return A$1; 38770 return b$1`<sonic-alert 38771 status="${message.status ?? "error"}" 38772 size="xs" 38773 class="mt-px max-w-[50ch]" 38774 >${o$6(message.content)}</sonic-alert 38775 >`; 38776 } 38777 )} 38778 </div> 38779 </sonic-product-summary> 38780 38781 <div class="flex items-center self-start gap-1"> 38782 <div 38783 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 " 38784 >
38785 ${item2.price?.amount ? formatAmount(item2.price.amount) : A$1} 38786 </div> 38787 38788 ${this.mode === "default" ? b$1`<div class="w-[4.45rem] shrink-0 flex items-center justify-end"> 38789 ${item2.entity_type !== EntityType.Subscribe ? b$1`<sonic-cart-item-line-detail-actions 38790 class=" flex items-center justify-end" 38791 .item=${item2} 38792 ></sonic-cart-item-line-detail-actions>` : A$1} 38793 </div>` : A$1} 38794 ${this.mode === "split" ? b$1`<div class="w-[3rem] shrink-0 ml-auto"> 38795 ${this.mode == "split" || this.mode == "splitResult" ? b$1`<sonic-cart-move-items-button 38796 size="xs" 38797 .lineItems=${[item2]} 38798 ></sonic-cart-move-items-button>` : A$1} 38799 </div>` : A$1} 38800 </div> 38801 </div>`; 38802 } 38803 )} 38804 </div>` : A$1}`; 38805 } 38806 ownerName(item) { 38807 const owner = item.owner; 38808 const firstName = owner?.firstName; 38809 const lastName = owner?.lastName; 38810 if (!firstName || !lastName) return b$1`<span class="font-bold">${t("no_owner")}</span>`; 38811 return b$1`<span class="font-bold"> <span class="uppercase">${lastName}</span> ${firstName}</span>`; 38812 } 38813 subscriptionActions(item) { 38814 const itemId = item.id; 38815 if (!itemId) return A$1; 38816 const ctx = { 38817 cartProvider: this.cartProvider, 38818 accessParams: this.accessParams, 38819 cartType: this.cartType 38820 }; 38821 const onRemove = () => removeCartItems(this, this.cartProvider, buildDetailRemoveQuery(itemId)); 38822 return b$1` 38823 <div class="w-[4.45rem] shrink-0 flex items-center justify-end"> 38824 ${!this.noSubscriptionActions ? b$1` 38825 ${renderActionMenuShell({ 38826 triggerIcon: "ellipsis-vertical", 38827 triggerVariant: "ghost", 38828 menuMinWidth: "15rem", 38829 menuItems: b$1` 38830 ${renderEditSubscriptionOwnerItem(ctx, item)} 38831 ${canEditSubscriptionPrice(ctx.cartType) ? renderEditSubscriptionPriceItem(ctx, item) : A$1} 38832 ${item.can_attach_events ? renderEventsChoiceItem(ctx, itemId) : A$1} 38833 ${item.price?.need_proof_of_identity ? renderAddProofItem(ctx, item) : A$1} 38834 ${renderRemoveMenuItem(onRemove, true)} 38835 ` 38836 })} 38837 ` : A$1} 38838 </div> 38839 `; 38840 } 38841 }; 38842 CartItemSubscribe.styles = [tailwind]; 38843 __decorateClass$2v([ 38844 n$5({ type: Number }) 38845 ], CartItemSubscribe.prototype, "quantity", 2); 38846 __decorateClass$2v([ 38847 n$5({ type: Number }) 38848 ], CartItemSubscribe.prototype, "total", 2); 38849 __decorateClass$2v([ 38850 n$5({ type: Array }) 38851 ], CartItemSubscribe.prototype, "items", 2); 38852 __decorateClass$2v([ 38853 c({ context: detailContext, subscribe: true }), 38854 n$5({ type: Boolean }) 38855 ], CartItemSubscribe.prototype, "showDetail", 2); 38856 __decorateClass$2v([ 38857 c({ context: modeContext, subscribe: true }), 38858 n$5({ type: String }) 38859 ], CartItemSubscribe.prototype, "mode", 2); 38860 __decorateClass$2v([ 38861 c({ context: cartTypeContext, subscribe: true }), 38862 n$5({ type: String }) 38863 ], CartItemSubscribe.prototype, "cartType", 2); 38864 __decorateClass$2v([ 38865 c({ context: layoutContext, subscribe: true }), 38866 n$5({ type: String }) 38867 ], CartItemSubscribe.prototype, "layout", 2); 38868 __decorateClass$2v([ 38869 n$5({ type: Boolean }) 38870 ], CartItemSubscribe.prototype, "fullWidth", 2); 38871 __decorateClass$2v([ 38872 n$5({ type: Boolean }) 38873 ], CartItemSubscribe.prototype, "noSubscriptionActions", 2); 38874 __decorateClass$2v([ 38875 ancestorAttribute("cartProvider") 38876 ], CartItemSubscribe.prototype, "cartProvider", 2); 38877 __decorateClass$2v([ 38878 c({ context: accessParamsContext, subscribe: true }), 38879 n$5({ type: Object }) 38880 ], CartItemSubscribe.prototype, "accessParams", 2); 38881 __decorateClass$2v([ 38882 r$5() 38883 ], CartItemSubscribe.prototype, "entityTitle", 2); 38884 CartItemSubscribe = __decorateClass$2v([ 38885 t$3(tagName$1w) 38886 ], CartItemSubscribe); 38887 var __defProp$2s = Object.defineProperty; 38888 var __getOwnPropDesc$2u = Object.getOwnPropertyDescriptor; 38889 var __decorateClass$2u = (decorators, target, key, kind) => { 38890 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2u(target, key) : target; 38891 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 38892 if (decorator = decorators[i2]) 38893 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 38894 if (kind && result) __defProp$2s(target, key, result); 38895 return result; 38896 }; 38897 let SonicCartItem$1 = class SonicCartItem extends Subscriber$1(i$6) { 38898 constructor() { 38899 super(...arguments); 38900 this.hideHeader = false;
38901 this.textOnly = false; 38902 } 38903 render() { 38904 const noMargin = this.hideHeader || this.textOnly || this.layout == "condensed"; 38905 const entity = this.props?.entity; 38906 const isAdditionalProduct = entity?.entity_type === EntityType.AdditionalProduct; 38907 const isSubscription = entity?.entity_type === EntityType.Subscribe; 38908 const displayHeader = !(this.hideHeader || isAdditionalProduct || isSubscription); 38909 return b$1`${displayHeader ? b$1`<sonic-cart-item-header ?textOnly=${this.textOnly || this.layout == "condensed"}></sonic-cart-item-header>` : A$1} 38910 ${isSubscription ? b$1`<sonic-cart-item-line-subscribe 38911 class=" block ${noMargin ? "mt-0" : "mt-2"}" 38912 ></sonic-cart-item-line-subscribe>` : b$1` 38913 <sonic-list 38914 subDataProvider="items" 38915 class="w-full relative grid grid-cols-1 gap-1 ${noMargin ? "mt-0" : "mt-2"}" 38916 > 38917 <template><sonic-cart-item-line></sonic-cart-item-line> </template> 38918 </sonic-list> 38919 `}`; 38920 } 38921 }; 38922 SonicCartItem$1.styles = [tailwind]; 38923 __decorateClass$2u([ 38924 n$5({ type: Boolean }) 38925 ], SonicCartItem$1.prototype, "hideHeader", 2); 38926 __decorateClass$2u([ 38927 n$5({ type: Boolean }) 38928 ], SonicCartItem$1.prototype, "textOnly", 2); 38929 __decorateClass$2u([ 38930 c({ context: layoutContext, subscribe: true }), 38931 n$5({ type: String }) 38932 ], SonicCartItem$1.prototype, "layout", 2); 38933 SonicCartItem$1 = __decorateClass$2u([ 38934 t$3("sonic-cart-item") 38935 ], SonicCartItem$1); 38936 var __defProp$2r = Object.defineProperty; 38937 var __getOwnPropDesc$2t = Object.getOwnPropertyDescriptor; 38938 var __decorateClass$2t = (decorators, target, key, kind) => { 38939 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2t(target, key) : target; 38940 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 38941 if (decorator = decorators[i2]) 38942 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 38943 if (kind && result) __defProp$2r(target, key, result); 38944 return result; 38945 }; 38946 let SonicCartItemLine = class extends Subscriber$1(i$6) { 38947 constructor() { 38948 super(...arguments); 38949 this.mode = "default"; 38950 this.price = {}; 38951 this.infos = null; 38952 this.canDelete = false; 38953 } 38954 // protected willUpdate(_changedProperties: PropertyValues): void { 38955 // if (_changedProperties.has("props")) { 38956 // this.isExchange = this.props?.is_exchange ?? false; 38957 // } 38958 // } 38959 // 38960 // RENDER 38961 // LAYOUT GLOBAL 38962 render() { 38963 const isCondensed = this.layout == "condensed"; 38964 const noDeleteCell = this.mode === "readonly" && !this.canDelete; 38965 return b$1` 38966 <div 38967 class="flex items-center gap-1 justify-end 38968 rounded py-[1px] px-1 leading-tight ${isCondensed ? "text-sm" : "text-base"}" 38969 > 38970 <div class=" text-right"> 38971 ${this.extraIcon()} 38972 38973 <span>${this.price.label}</span> 38974 ${this.infos?.code ? b$1`<sonic-badge size="xs" class="tracking-wider">${this.infos.code}</sonic-badge>` : A$1} 38975 </div> 38976 <div class="inline-flex gap-1 justify-end items-center"> 38977 <div class="min-w-[5ch] text-right ml-auto leading-none font-bold "> 38978 ${this.price.amount ? formatAmount(this.price.amount) : A$1} 38979 </div> 38980 38981 ${this.mode != "splitResult" && this.mode != "split" && !noDeleteCell ? b$1` 38982 <div class="shrink-0 flex items-center justify-center w-[2rem]"> 38983 ${this.canDelete ? b$1`<sonic-button 38984 shape="circle" 38985 @click=${(e2) => { 38986 const exchangeId = this.props?.exchange_id; 38987 if (exchangeId) { 38988 e2.preventDefault(); 38989 e2.stopPropagation(); 38990 window.location.href = `/la_billetterie/billet/${exchangeId}?echanger=&annuler=`; 38991 } else { 38992 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 38993 Cart.removeItems({ 38994 apiConfiguration: HTML.getApiConfiguration(this), 38995 cartProvider: cartProvider || "cart/current", 38996 query: { 38997 ids: [this.id] 38998 } 38999 }); 39000 } 39001 }} 39002 variant="ghost" 39003 size="xs" 39004 icon 39005 > 39006 <sonic-icon name="trash" library="custom"></sonic-icon> 39007 </sonic-button>` : A$1} 39008 </div> 39009 ` : A$1} 39010 </div> 39011 </div> 39012 `; 39013 } 39014 extraIcon() { 39015 const exchange_id = this.props?.exchange_id; 39016 if (exchange_id) { 39017 return b$1` 39018 <sonic-icon name="ticket" library="custom"></sonic-icon> 39019 <b>Ãchange :</b> 39020 <sonic-app-link 39021 noAutoFill 39022 to="ticket" 39023 .id=${exchange_id.toString()} 39024 size="inherit" 39025 variant="link" 39026 class="inline-block align-baseline" 39027 > 39028 Billet n°${exchange_id} 39029 </sonic-app-link> 39030 ⢠39031 `; 39032 } 39033 if (this.props?.entity_type === EntityType.Credit) { 39034 return b$1`<sonic-icon name="wallet" library="custom"></sonic-icon>`; 39035 } 39036 if (this.props?.entity_type === EntityType.Giftcard) { 39037 return b$1`<sonic-icon name="gift-card" library="custom"></sonic-icon>`; 39038 } 39039 return A$1; 39040 } 39041 }; 39042 SonicCartItemLine.styles = [tailwind]; 39043 __decorateClass$2t([ 39044 c({ context: modeContext, subscribe: true }), 39045 n$5({ type: String }) 39046 ], SonicCartItemLine.prototype, "mode", 2); 39047 __decorateClass$2t([ 39048 c({ context: layoutContext, subscribe: true }), 39049 n$5({ type: String }) 39050 ], SonicCartItemLine.prototype, "layout", 2); 39051 __decorateClass$2t([ 39052 n$5({ type: Object }) 39053 ], SonicCartItemLine.prototype, "price", 2); 39054 __decorateClass$2t([ 39055 n$5({ type: Object }) 39056 ], SonicCartItemLine.prototype, "infos", 2); 39057 __decorateClass$2t([ 39058 n$5({ type: Boolean }) 39059 ], SonicCartItemLine.prototype, "canDelete", 2); 39060 SonicCartItemLine = __decorateClass$2t([ 39061 t$3("sonic-cart-item-line-extra") 39062 ], SonicCartItemLine); 39063 var __defProp$2q = Object.defineProperty; 39064 var __getOwnPropDesc$2s = Object.getOwnPropertyDescriptor; 39065 var __decorateClass$2s = (decorators, target, key, kind) => { 39066 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2s(target, key) : target; 39067 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39068 if (decorator = decorators[i2]) 39069 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39070 if (kind && result) __defProp$2q(target, key, result); 39071 return result; 39072 }; 39073 const tagName$1v = "sonic-cart-item-divider"; 39074 let SonicComponent$f = class SonicComponent extends i$6 { 39075 constructor() { 39076 super(...arguments); 39077 this.layout = "default"; 39078 this.showDetail = false;
39079 } 39080 render() { 39081 const isCondensed = this.layout == "condensed"; 39082 let dividerClass = isCondensed ? "my-[.5rem]" : "my-3"; 39083 if (this.showDetail && !isCondensed) { 39084 dividerClass = "my-5"; 39085 } 39086 return b$1`<sonic-divider class="${dividerClass}"></sonic-divider>`; 39087 } 39088 }; 39089 SonicComponent$f.styles = [tailwind]; 39090 __decorateClass$2s([ 39091 c({ context: layoutContext, subscribe: true }), 39092 n$5({ type: String }) 39093 ], SonicComponent$f.prototype, "layout", 2); 39094 __decorateClass$2s([ 39095 c({ context: detailContext, subscribe: true }), 39096 n$5({ type: Boolean }) 39097 ], SonicComponent$f.prototype, "showDetail", 2); 39098 SonicComponent$f = __decorateClass$2s([ 39099 t$3(tagName$1v) 39100 ], SonicComponent$f); 39101 var __defProp$2p = Object.defineProperty; 39102 var __getOwnPropDesc$2r = Object.getOwnPropertyDescriptor; 39103 var __decorateClass$2r = (decorators, target, key, kind) => { 39104 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2r(target, key) : target; 39105 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39106 if (decorator = decorators[i2]) 39107 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39108 if (kind && result) __defProp$2p(target, key, result); 39109 return result; 39110 }; 39111 let SonicCartEmpty = class extends i$6 { 39112 constructor() { 39113 super(...arguments); 39114 this.mode = "default"; 39115 this.textMain = t("message_panier_vide"); 39116 this.textSecondary = t("LIB_empty_cart_add_item"); 39117 } 39118 willUpdate(_changedProperties) { 39119 super.willUpdate(_changedProperties); 39120 if (_changedProperties.has("cartType") || _changedProperties.has("mode")) { 39121 let textMain = t("message_panier_vide"); 39122 let textSecondary = ""; 39123 if (this.mode === "splitResult") { 39124 textMain = "Aucun élément pour l'instant"; 39125 } else if (this.cartType === CartType.Cart && this.mode === "default") { 39126 textMain = t("message_panier_vide"); 39127 textSecondary = t("LIB_empty_cart_add_item"); 39128 } else { 39129 textMain = t("cart_default_no_items"); 39130 } 39131 this.textMain = textMain; 39132 this.textSecondary = textSecondary; 39133 } 39134 } 39135 render() { 39136 const status = this.status; 39137 const statusNoRender = [ReservationStatus.Deleted, ReservationStatus.Processed]; 39138 if (status && statusNoRender.includes(status)) { 39139 return A$1; 39140 } 39141 return b$1` 39142 <div class="flex gap-2 items-center"> 39143 <sonic-icon library="custom" name="face-thinking"></sonic-icon> 39144 <div>${this.textMain}</div> 39145 </div> 39146 ${this.textSecondary?.toString() !== "" ? b$1` <div class="text-[.75em]">${this.textSecondary}</div>` : A$1} 39147 `; 39148 } 39149 }; 39150 SonicCartEmpty.styles = [ 39151 tailwind, 39152 i$9` 39153 :host { 39154 display: block; 39155 } 39156 ` 39157 ]; 39158 __decorateClass$2r([ 39159 c({ context: cartTypeContext, subscribe: true }), 39160 n$5({ type: String }) 39161 ], SonicCartEmpty.prototype, "cartType", 2); 39162 __decorateClass$2r([ 39163 c({ context: modeContext, subscribe: true }), 39164 n$5({ type: String }) 39165 ], SonicCartEmpty.prototype, "mode", 2); 39166 __decorateClass$2r([ 39167 c({ context: layoutContext, subscribe: true }), 39168 n$5({ type: String }) 39169 ], SonicCartEmpty.prototype, "layout", 2); 39170 __decorateClass$2r([ 39171 n$5({ type: String }) 39172 ], SonicCartEmpty.prototype, "status", 2); 39173 __decorateClass$2r([ 39174 r$5() 39175 ], SonicCartEmpty.prototype, "textMain", 2); 39176 __decorateClass$2r([ 39177 r$5() 39178 ], SonicCartEmpty.prototype, "textSecondary", 2); 39179 SonicCartEmpty = __decorateClass$2r([ 39180 t$3("sonic-cart-empty") 39181 ], SonicCartEmpty); 39182 var __defProp$2o = Object.defineProperty; 39183 var __getOwnPropDesc$2q = Object.getOwnPropertyDescriptor; 39184 var __decorateClass$2q = (decorators, target, key, kind) => { 39185 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2q(target, key) : target; 39186 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39187 if (decorator = decorators[i2]) 39188 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39189 if (kind && result) __defProp$2o(target, key, result); 39190 return result; 39191 }; 39192 const tagName$1u = "sonic-cart-total"; 39193 let SonicCartTotal = class extends Subscriber$1(i$6) { 39194 constructor() { 39195 super(...arguments); 39196 this.total = 0; 39197 this.subTotal = 0; 39198 this.isSubtotal = false;
39199 this.computeId = 0; 39200 this.computeTotal = async () => { 39201 this.computeId++; 39202 const id = this.computeId; 39203 await Utils.delayPromise(1); 39204 if (id !== this.computeId) return; 39205 const items = this.publisher.items.get(); 39206 const itemsTotal = items ? items.reduce((acc, item) => { 39207 if (!item) return acc; 39208 const amount = item.price?.amount ? parseFloat(item.price?.amount.toString()) : 0; 39209 const total = item.quantity ? amount * item.quantity : 0; 39210 return acc + total; 39211 }, 0) : 0; 39212 const extras = this.publisher.extras.get(); 39213 const extrasTotal = extras ? extras.reduce((acc, item) => { 39214 if (!item) return acc; 39215 const amount = item.price?.amount ? parseFloat(item.price?.amount.toString()) : 0; 39216 const total = item.quantity ? amount * item.quantity : 0; 39217 return acc + total; 39218 }, 0) : 0; 39219 this.publisher.subTotal = itemsTotal; 39220 this.publisher.total = itemsTotal + extrasTotal; 39221 }; 39222 } 39223 connectedCallback() { 39224 super.connectedCallback(); 39225 this.publisher.items.onInternalMutation(this.computeTotal); 39226 } 39227 disconnectedCallback() { 39228 super.disconnectedCallback(); 39229 this.publisher.items.offInternalMutation(this.computeTotal); 39230 } 39231 render() { 39232 const defaultLabel = this.isSubtotal ? t("subTotal") : t("total"); 39233 const label2 = this.label || defaultLabel; 39234 const totalOutput = this.isSubtotal ? this.subTotal : this.total; 39235 return b$1`${label2} 39236 <span class="font-bold min-w-[5ch] inline-block text-right">
39236${formatAmount(totalOutput)}</span>`; 39237 } 39238 }; 39239 SonicCartTotal.styles = [tailwind]; 39240 __decorateClass$2q([ 39241 n$5({ type: Number }) 39242 ], SonicCartTotal.prototype, "total", 2); 39243 __decorateClass$2q([ 39244 n$5({ type: Number }) 39245 ], SonicCartTotal.prototype, "subTotal", 2); 39246 __decorateClass$2q([ 39247 n$5({ type: Boolean }) 39248 ], SonicCartTotal.prototype, "isSubtotal", 2); 39249 __decorateClass$2q([ 39250 n$5({ type: String }) 39251 ], SonicCartTotal.prototype, "label", 2); 39252 SonicCartTotal = __decorateClass$2q([ 39253 t$3(tagName$1u) 39254 ], SonicCartTotal); 39255 var __defProp$2n = Object.defineProperty; 39256 var __getOwnPropDesc$2p = Object.getOwnPropertyDescriptor; 39257 var __decorateClass$2p = (decorators, target, key, kind) => { 39258 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2p(target, key) : target; 39259 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39260 if (decorator = decorators[i2]) 39261 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39262 if (kind && result) __defProp$2n(target, key, result); 39263 return result; 39264 }; 39265 let CartAdditionalProductsItem = class extends Subscriber$1(i$6) { 39266 constructor() { 39267 super(...arguments); 39268 this.edito = null; 39269 this.prices = null; 39270 this.id = ""; 39271 this.loading = false; 39272 this.disabled = false; 39273 } 39274 async addToCart() { 39275 if (!this.prices) return; 39276 const priceId = this.prices[0].id; 39277 const cartItem = { 39278 entity_type: EntityType.AdditionalProduct, 39279 entity_id: parseInt(this.id), 39280 quantity: 1, 39281 price: { id: priceId || -1 } 39282 }; 39283 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 39284 this.loading = true; 39285 await Cart.addItems({ 39286 apiConfiguration: this.getApiConfiguration(), 39287 cartProvider, 39288 items: [cartItem], 39289 editFreePriceAfterRequest: true 39290 }); 39291 this.loading = false; 39292 } 39293 render() { 39294 if (!Array.isArray(this.prices) || this.prices.length == 0) { 39295 return A$1; 39296 } 39297 const firstPrice = this.prices[0]; 39298 const amount = firstPrice?.amount || 0; 39299 return b$1` 39300 <div 39301 class="flex gap-2 items-center justify-end text-left transition ${this.loading ? "pointer-events-none opacity-50" : ""} 39302 39303 " 39304 > 39305 <div 39306 class="flex flex-grow text-sm leading-tight gap-3 items-center justify-end ${this.disabled ? "opacity-50" : ""}" 39307 > 39308 <div class="flex-grow flex justify-end text-right">${this.edito?.title}</div> 39309 <div 39310 class="ml-auto font-medium min-w-[7ch] text-right flex items-center justify-end gap-x-2 whitespace-nowrap" 39311 > 39312 <div class="border-t border-dotted flex-grow border-neutral-300 min-w-[.5rem]"></div> 39313 <span class="shrink-0" 39314 >${firstPrice?.is_free_price ? priceRange({ 39315 min: firstPrice.free_price?.min || 0, 39316 max: firstPrice.free_price?.max, 39317 is_free_price: firstPrice.is_free_price 39318 }) : formatAmount(amount)} 39319 </span> 39320 </div> 39321 </div> 39322 <div class="flex items-center justify-center w-[1.6rem] shrink-0"> 39323 ${this.disabled ? b$1` <sonic-icon 39324 library="custom" 39325 name="ban" 39326 prefix="solid" 39327 aria-label="${t("not_available")}" 39328 class=" ${this.disabled ? "opacity-50 text-danger" : ""}" 39329 ></sonic-icon>` : b$1`<sonic-button type="success" shape="circle" size="2xs" @click=${this.addToCart}> 39330 <sonic-icon library="custom" name="plus" size="lg"></sonic-icon> 39331 </sonic-button>`} 39332 </div> 39333 </div> 39334 `; 39335 } 39336 }; 39337 CartAdditionalProductsItem.styles = [ 39338 tailwind, 39339 i$9` 39340 :host { 39341 direction: ltr; 39342 } 39343 ` 39344 ]; 39345 __decorateClass$2p([ 39346 n$5({ type: Object }) 39347 ], CartAdditionalProductsItem.prototype, "edito", 2); 39348 __decorateClass$2p([ 39349 n$5({ type: Array }) 39350 ], CartAdditionalProductsItem.prototype, "prices", 2); 39351 __decorateClass$2p([ 39352 n$5({ type: String }) 39353 ], CartAdditionalProductsItem.prototype, "id", 2); 39354 __decorateClass$2p([ 39355 n$5({ type: Boolean }) 39356 ], CartAdditionalProductsItem.prototype, "loading", 2); 39357 __decorateClass$2p([ 39358 n$5({ type: Boolean }) 39359 ], CartAdditionalProductsItem.prototype, "disabled", 2); 39360 CartAdditionalProductsItem = __decorateClass$2p([ 39361 t$3("sonic-cart-additional-products-item") 39362 ], CartAdditionalProductsItem); 39363 var __defProp$2m = Object.defineProperty; 39364 var __getOwnPropDesc$2o = Object.getOwnPropertyDescriptor; 39365 var __decorateClass$2o = (decorators, target, key, kind) => { 39366 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2o(target, key) : target; 39367 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39368 if (decorator = decorators[i2]) 39369 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39370 if (kind && result) __defProp$2m(target, key, result); 39371 return result; 39372 }; 39373 let CartAdditionalProducts = class extends Fetcher$1(Subscriber$1(i$6)) { 39374 constructor() { 39375 super(...arguments); 39376 this.dataProvider = "additional_products?features[]=prices&sort=title:asc";
39377 this.condensed = false; 39378 this.flatten = false; 39379 this.data = []; 39380 } 39381 renderList() { 39382 return b$1`<sonic-list 39383 class=" grid grid-cols-1 gap-y-2" 39384 subDataProvider="data" 39385 .items=${(item) => { 39386 const isAvailable = item.prices?.some((price) => price?.price_available); 39387 return b$1`<sonic-cart-additional-products-item 39388 ?disabled=${!isAvailable} 39389 ></sonic-cart-additional-products-item>`; 39390 }} 39391 > 39392 </sonic-list>`; 39393 } 39394 render() { 39395 const itemsCount = this.data?.length; 39396 if (!itemsCount) return A$1; 39397 if (itemsCount > 3 && !this.flatten) { 39398 return b$1`<sonic-pop noToggle data-on-select="keep"> 39399 <sonic-button size="${this.condensed ? "xs" : "sm"}" variant="outline"> 39400 <sonic-icon name="circle-plus" library="custom"></sonic-icon>${t("add_product")} 39401 </sonic-button> 39402 <div class="w-80 p-3 py-4 max-h-[45vh] custom-scroll" slot="content">${this.renderList()}</div> 39403 </sonic-pop>`; 39404 } else { 39405 return this.renderList(); 39406 } 39407 } 39408 }; 39409 CartAdditionalProducts.styles = [ 39410 tailwind, 39411 customScroll, 39412 i$9` 39413 :host { 39414 display: block; 39415 } 39416 39417 sonic-list { 39418 direction: rtl; 39419 } 39420 ` 39421 ]; 39422 __decorateClass$2o([ 39423 n$5() 39424 ], CartAdditionalProducts.prototype, "cartProvider", 2); 39425 __decorateClass$2o([ 39426 n$5({ type: Boolean }) 39427 ], CartAdditionalProducts.prototype, "condensed", 2); 39428 __decorateClass$2o([ 39429 n$5({ type: Boolean }) 39430 ], CartAdditionalProducts.prototype, "flatten", 2); 39431 __decorateClass$2o([ 39432 n$5({ type: Array }) 39433 ], CartAdditionalProducts.prototype, "data", 2); 39434 CartAdditionalProducts = __decorateClass$2o([ 39435 t$3("sonic-cart-additional-products") 39436 ], CartAdditionalProducts); 39437 var __defProp$2l = Object.defineProperty; 39438 var __getOwnPropDesc$2n = Object.getOwnPropertyDescriptor; 39439 var __decorateClass$2n = (decorators, target, key, kind) => { 39440 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2n(target, key) : target; 39441 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39442 if (decorator = decorators[i2]) 39443 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39444 if (kind && result) __defProp$2l(target, key, result); 39445 return result; 39446 }; 39447 let CounterStore = class extends Subscriber$1(i$6) { 39448 constructor() { 39449 super(...arguments); 39450 this.formType = "buttons"; 39451 this.hasToolbar = false; 39452 this.hasParentModal = false; 39453 this.enableSticky = false; 39454 this.localStoreFilters = false; 39455 this.formDataProvider = "counterEventFilters"; 39456 this.dataProviderExpression = "sessions?limit=$limit&offset=$offset&next=1"; 39457 this.observer = new IntersectionObserver( 39458 function(_ref) { 39459 const e2 = _ref[0]; 39460 return e2.target.classList.toggle("isSticky", e2.intersectionRatio < 1); 39461 }, 39462 { 39463 root: null, 39464 rootMargin: (this.hasToolbar ? "-61px" : "-1px") + " 0px 0px 0px", 39465 threshold: 1 39466 } 39467 ); 39468 } 39469 connectedCallback() { 39470 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 39471 if (!this.hasToolbar) { 39472 this.hasToolbar = !parentModal && document.getElementById("toolbar") !== null; 39473 } 39474 super.connectedCallback(); 39475 } 39476 updated(_changedProperties) { 39477 if (!this.formContainer) { 39478 this.observer.disconnect(); 39479 } else { 39480 this.observer.observe(this.formContainer); 39481 } 39482 super.updated(_changedProperties); 39483 } 39484 willUpdate(_changedProperties) { 39485 this.dataProviderExpression = entityEndPoint({ 39486 entityType: EntityType.Event, 39487 accessParams: this.accessParams, 39488 isQueue: true, 39489 next: true, 39490 view: entityView.essential 39491 }); 39492 super.willUpdate(_changedProperties); 39493 } 39494 disconnectedCallback() { 39495 this.observer.disconnect(); 39496 super.disconnectedCallback(); 39497 } 39498 render() { 39499 const searchDataProvider = this.formDataProvider + "searchResults"; 39500 return b$1` 39501 <div 39502 id="formContainer" 39503 class="flex gap-x-4 z-20 39504 mb-5 ${this.enableSticky ? "sticky shadow-[0_0_0_2px_var(--sc-base)]" : ""} ${this.hasToolbar ? "top-[--sticky-top-offset]" : "top-0"}" 39505 > 39506 <!--save form state in localstorage --> 39507 ${this.localStoreFilters ? b$1`<sonic-subscriber dataProvider="${this.formDataProvider}" localStorage="enabled"></sonic-subscriber>` : A$1} 39508 <sonic-event-selection-filters 39509 formDataProvider="${this.formDataProvider}"
39510 class=" block min-w-0 w-full " 39511 category 39512 activity 39513 range 39514 onlyFilter 39515 canFilterDays 39516 ></sonic-event-selection-filters> 39517 </div> 39518 <sonic-queue 39519 dataProviderExpression="${this.dataProviderExpression}" 39520 limit="8" 39521 targetRequestDuration="1000" 39522 key="data" 39523 dataProvider="${searchDataProvider}" 39524 dataFilterProvider="${this.formDataProvider}" 39525 > 39526 <template data-value="no-item"> 39527 <sonic-no-result size="xl"></sonic-no-result> 39528 </template> 39529 <template data-value="skeleton"> 39530 <sonic-event-store-item class="mb-4 block" skeleton></sonic-event-store-item> 39531 <sonic-event-store-item class="mb-4 block" skeleton></sonic-event-store-item> 39532 <sonic-event-store-item class="mb-4 block" skeleton></sonic-event-store-item> 39533 </template> 39534 <template> 39535 <sonic-event-store-item class="mb-4 block" showAllSessionsButton formType="buttons"></sonic-event-store-item> 39536 </template> 39537 </sonic-queue> 39538 `; 39539 } 39540 }; 39541 CounterStore.styles = [ 39542 tailwind, 39543 i$9` 39544 .isSticky { 39545 background-color: var(--sc-base); 39546 box-shadow: 0 1.5rem 1rem -1rem rgb(0 0 0 / 0.07); 39547 } 39548 ` 39549 ]; 39550 __decorateClass$2n([ 39551 n$5({ type: String }) 39552 ], CounterStore.prototype, "formType", 2); 39553 __decorateClass$2n([ 39554 n$5({ type: Boolean }) 39555 ], CounterStore.prototype, "hasToolbar", 2); 39556 __decorateClass$2n([ 39557 r$5() 39558 ], CounterStore.prototype, "hasParentModal", 2); 39559 __decorateClass$2n([ 39560 r$5() 39561 ], CounterStore.prototype, "enableSticky", 2); 39562 __decorateClass$2n([ 39563 n$5({ type: Boolean }) 39564 ], CounterStore.prototype, "localStoreFilters", 2); 39565 __decorateClass$2n([ 39566 n$5({ type: String }) 39567 ], CounterStore.prototype, "formDataProvider", 2); 39568 __decorateClass$2n([ 39569 e$7("#formContainer") 39570 ], CounterStore.prototype, "formContainer", 2); 39571 __decorateClass$2n([ 39572 r$5() 39573 ], CounterStore.prototype, "dataProviderExpression", 2); 39574 __decorateClass$2n([ 39575 c({ context: accessParamsContext, subscribe: true }), 39576 e$2({ context: accessParamsContext }), 39577 n$5({ type: Object }) 39578 ], CounterStore.prototype, "accessParams", 2); 39579 CounterStore = __decorateClass$2n([ 39580 t$3("sonic-counter-store") 39581 ], CounterStore); 39582 var __defProp$2k = Object.defineProperty; 39583 var __getOwnPropDesc$2m = Object.getOwnPropertyDescriptor; 39584 var __decorateClass$2m = (decorators, target, key, kind) => { 39585 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2m(target, key) : target; 39586 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39587 if (decorator = decorators[i2]) 39588 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39589 if (kind && result) __defProp$2k(target, key, result); 39590 return result; 39591 }; 39592 let ScheduledStatus = class extends Subscriber$1(i$6) { 39593 constructor() { 39594 super(...arguments); 39595 this.size = "md"; 39596 this.variant = "ghost"; 39597 } 39598 willUpdate(_changedProperties) { 39599 if (_changedProperties.has("props")) { 39600 const firstScheduleOnSale = this.props?.infos_status?.schedule?.find((schedule) => { 39601 const currentTime = (/* @__PURE__ */ new Date()).getTime() / 1e3; 39602 return schedule.publication === "on_sale" && schedule.date && schedule.date > currentTime; 39603 }); 39604 if (this.props?.settings?.sale_start_date) { 39605 this.sale_start_date = this.props?.settings?.sale_start_date; 39606 } else if (firstScheduleOnSale) { 39607 this.sale_start_date = firstScheduleOnSale.date; 39608 } 39609 } 39610 super.willUpdate(_changedProperties); 39611 } 39612 render() { 39613 const shouldRender = this.sale_start_date && this.appType === "customer" && !hasAccessParams(this.accessParams); 39614 if (!shouldRender) { 39615 return A$1; 39616 } 39617 return b$1` 39618 <sonic-badge type="info" size="${this.size}" variant="${this.variant}"> 39619 <sonic-icon library="custom" name="circle-exclamation" slot="prefix"></sonic-icon> 39620 <span> 39621 ${t("en_vente_a_partir_du")} 39622 <sonic-date 39623 date=${this.sale_start_date} 39624 noAutoFill 39625 weekday="hidden" 39626 day="2-digit" 39627 month="2-digit" 39628 ></sonic-date> 39629 </span> 39630 </sonic-badge> 39631 `; 39632 } 39633 }; 39634 ScheduledStatus.styles = [ 39635 tailwind, 39636 i$9` 39637 :host { 39638 display: contents !important; 39639 } 39640 ` 39641 ]; 39642 __decorateClass$2m([ 39643 n$5({ type: String }) 39644 ], ScheduledStatus.prototype, "size", 2); 39645 __decorateClass$2m([ 39646 n$5({ type: String }) 39647 ], ScheduledStatus.prototype, "variant", 2); 39648 __decorateClass$2m([ 39649 c({ context: appType, subscribe: true }), 39650 r$5() 39651 ], ScheduledStatus.prototype, "appType", 2); 39652 __decorateClass$2m([ 39653 c({ context: accessParamsContext, subscribe: true }), 39654 n$5({ type: Object }) 39655 ], ScheduledStatus.prototype, "accessParams", 2); 39656 __decorateClass$2m([ 39657 r$5() 39658 ], ScheduledStatus.prototype, "sale_start_date", 2); 39659 ScheduledStatus = __decorateClass$2m([ 39660 t$3("sonic-event-scheduled-status") 39661 ], ScheduledStatus); 39662 var __defProp$2j = Object.defineProperty; 39663 var __getOwnPropDesc$2l = Object.getOwnPropertyDescriptor; 39664 var __decorateClass$2l = (decorators, target, key, kind) => { 39665 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2l(target, key) : target; 39666 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39667 if (decorator = decorators[i2]) 39668 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39669 if (kind && result) __defProp$2j(target, key, result); 39670 return result; 39671 }; 39672 const tagName$1t = "sonic-pin"; 39673 let SonicPin = class extends Subscriber$1(i$6) { 39674 constructor() { 39675 super(...arguments); 39676 this.size = "md"; 39677 this.isPinned = false;
39678 } 39679 updatePin(pinned) { 39680 this.currentItemIsPined(pinned); 39681 } 39682 willUpdate(_changedProperties) { 39683 if (_changedProperties.has("props")) { 39684 this.currentItemIsPined(); 39685 } 39686 if (this.isPinned) { 39687 this.setAttribute("active", ""); 39688 } else { 39689 this.removeAttribute("active"); 39690 } 39691 super.willUpdate(_changedProperties); 39692 } 39693 currentItemIsPined(pinned) { 39694 const pinnedItem = pinned || getPinned(); 39695 if (pinnedItem) { 39696 const { id, entity_type } = pinnedItem; 39697 const ispinnedId = id === this.props?.id; 39698 const ispinnedType = entity_type === this.props?.entity_type; 39699 this.isPinned = ispinnedId && ispinnedType; 39700 } 39701 } 39702 // toggle pin 39703 togglePin() { 39704 if (this.isPinned) { 39705 this.isPinned = false; 39706 removePinned(true); 39707 } else { 39708 const id = this.props?.id; 39709 const entity_type = this.props?.entity_type; 39710 const archiving_date = this.props?.settings?.archiving_date || this.props?.archiving_date; 39711 const hasSeatmap = !!(this.props?.room && ["place", "mixte"].includes(this.props.room.placing_type_key || "")); 39712 const slug = this.props?.slug; 39713 setPinned({ id, entity_type, archiving_date, hasSeatmap, slug }); 39714 this.isPinned = true; 39715 } 39716 } 39717 render() { 39718 return b$1`<sonic-button 39719 variant="ghost" 39720 shape="block" 39721 align="left" 39722 ?active=${this.isPinned} 39723 size=${this.size} 39724 @click=${this.togglePin} 39725 > 39726 <sonic-icon name="thumbtack" library="custom" slot="prefix"> </sonic-icon> 39727 ${this.isPinned ? "Désépingler" : "Ãpingler"} 39728 </sonic-button>`; 39729 } 39730 }; 39731 __decorateClass$2l([ 39732 n$5({ type: String }) 39733 ], SonicPin.prototype, "size", 2); 39734 __decorateClass$2l([ 39735 n$5({ type: Boolean }) 39736 ], SonicPin.prototype, "isPinned", 2); 39737 __decorateClass$2l([ 39738 onAssign$1(DP_PINNED_ITEM) 39739 ], SonicPin.prototype, "updatePin", 1); 39740 SonicPin = __decorateClass$2l([ 39741 t$3(tagName$1t) 39742 ], SonicPin); 39743 const setPinned = (pinOptions, redirect) => { 39744 const { id, hasSeatmap, slug } = pinOptions; 39745 const pinnedItem = JSON.stringify({ ...pinOptions }); 39746 localStorage.setItem(DP_PINNED_ITEM, pinnedItem); 39747 PublisherManager.get(DP_PINNED_ITEM).set({ ...pinOptions }); 39748 { 39749 if (hasSeatmap && slug && id) { 39750 appRoute("seatmap").fill({ slug, id }).goTo(); 39751 } else { 39752 appRoute("pin").goTo(); 39753 } 39754 } 39755 }; 39756 const removePinned = (redirect) => { 39757 localStorage.removeItem(DP_PINNED_ITEM); 39758 PublisherManager.get(DP_PINNED_ITEM).set({}); 39759 const isPinPage = appRoute("pin").matchesCurrentPath(); 39760 if (isPinPage && redirect) { 39761 setTimeout(() => { 39762 appRoute("store").goTo(); 39763 }, 80); 39764 } 39765 }; 39766 const getPinned = () => { 39767 const pinnedItem = localStorage.getItem(DP_PINNED_ITEM); 39768 if (pinnedItem) { 39769 const { id, entity_type, archiving_date, hasSeatmap, slug } = JSON.parse(pinnedItem); 39770 return { id, entity_type, archiving_date, hasSeatmap, slug }; 39771 } 39772 return null; 39773 }; 39774 var __defProp$2i = Object.defineProperty; 39775 var __getOwnPropDesc$2k = Object.getOwnPropertyDescriptor; 39776 var __decorateClass$2k = (decorators, target, key, kind) => { 39777 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2k(target, key) : target; 39778 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39779 if (decorator = decorators[i2]) 39780 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39781 if (kind && result) __defProp$2i(target, key, result); 39782 return result; 39783 }; 39784 let RefundStatus = class extends Subscriber$1(i$6) { 39785 constructor() { 39786 super(...arguments); 39787 this.refund = {}; 39788 this.wording_LIB_remboursement_actif = ""; 39789 this.noText = false; 39790 this.noIcon = false; 39791 } 39792 render() { 39793 if (!this.refund.display_setting_status || !this.refund.enabled) return A$1; 39794 return b$1` 39795 <sonic-tooltip label=${this.wording_LIB_remboursement_actif} ?disabled=${!this.noText}> 39796 ${!this.noIcon ? b$1`<sonic-icon library="custom" name="arrow-rotate-left"></sonic-icon>` : A$1} 39797 ${!this.noText ? b$1` <span class="wording">${this.wording_LIB_remboursement_actif}</span>` : A$1} 39798 </sonic-tooltip> 39799 `; 39800 } 39801 }; 39802 RefundStatus.styles = styles$2; 39803 __decorateClass$2k([ 39804 n$5({ type: Object }) 39805 ], RefundStatus.prototype, "refund", 2); 39806 __decorateClass$2k([ 39807 n$5({ type: String }) 39808 ], RefundStatus.prototype, "wording_LIB_remboursement_actif", 2); 39809 __decorateClass$2k([ 39810 n$5({ type: Boolean }) 39811 ], RefundStatus.prototype, "noText", 2); 39812 __decorateClass$2k([ 39813 n$5({ type: Boolean }) 39814 ], RefundStatus.prototype, "noIcon", 2); 39815 RefundStatus = __decorateClass$2k([ 39816 t$3("sonic-event-refund-status") 39817 ], RefundStatus); 39818 var __defProp$2h = Object.defineProperty; 39819 var __getOwnPropDesc$2j = Object.getOwnPropertyDescriptor; 39820 var __decorateClass$2j = (decorators, target, key, kind) => { 39821 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2j(target, key) : target; 39822 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39823 if (decorator = decorators[i2]) 39824 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39825 if (kind && result) __defProp$2h(target, key, result); 39826 return result; 39827 }; 39828 let DistancingStatus = class extends Subscriber$1(i$6) { 39829 constructor() { 39830 super(...arguments); 39831 this.distancing = {}; 39832 this.wording_LIB_distanciation_actif = ""; 39833 this.noText = false;
39834 this.noIcon = false; 39835 } 39836 render() { 39837 if (!this.distancing.display_setting_status || !this.distancing.enabled) return A$1; 39838 return b$1` 39839 <sonic-tooltip label=${this.wording_LIB_distanciation_actif} ?disabled=${!this.noText}> 39840 ${!this.noIcon ? b$1`<sonic-icon library="custom" prefix="solid" name="people-arrows"></sonic-icon>` : A$1} 39841 ${!this.noText ? b$1`<span class="wording">${this.wording_LIB_distanciation_actif}</span>` : A$1} 39842 </sonic-tooltip> 39843 `; 39844 } 39845 }; 39846 DistancingStatus.styles = styles$2; 39847 __decorateClass$2j([ 39848 n$5({ type: Object }) 39849 ], DistancingStatus.prototype, "distancing", 2); 39850 __decorateClass$2j([ 39851 n$5({ type: String }) 39852 ], DistancingStatus.prototype, "wording_LIB_distanciation_actif", 2); 39853 __decorateClass$2j([ 39854 n$5({ type: Boolean }) 39855 ], DistancingStatus.prototype, "noText", 2); 39856 __decorateClass$2j([ 39857 n$5({ type: Boolean }) 39858 ], DistancingStatus.prototype, "noIcon", 2); 39859 DistancingStatus = __decorateClass$2j([ 39860 t$3("sonic-event-distancing-status") 39861 ], DistancingStatus); 39862 var __defProp$2g = Object.defineProperty; 39863 var __getOwnPropDesc$2i = Object.getOwnPropertyDescriptor; 39864 var __decorateClass$2i = (decorators, target, key, kind) => { 39865 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2i(target, key) : target; 39866 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 39867 if (decorator = decorators[i2]) 39868 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 39869 if (kind && result) __defProp$2g(target, key, result); 39870 return result; 39871 }; 39872 let SonicProductPublication = class extends Subscriber$1(i$6) { 39873 constructor() { 39874 super(...arguments); 39875 this.direction = "column"; 39876 this.displaySchedule = "single"; 39877 this.publication = null; 39878 this.schedule = null; 39879 } 39880 getStatusInfo(status) { 39881 switch (status) { 39882 case "unpublished": 39883 return { 39884 icon: "eye-slash", 39885 wording: t("non_publie") 39886 }; 39887 case "counter": 39888 return { 39889 icon: "store", 39890 wording: t("au_guichet_uniquement") 39891 }; 39892 case "only_visible": 39893 return { 39894 icon: "eye", 39895 wording: t("au_guichet_uniquement_et_visible_en_ligne") 39896 }; 39897 case "on_sale": 39898 return { 39899 icon: "basket-shopping", 39900 wording: t("au_guichet_uniquement_et_en_ligne") 39901 }; 39902 default: 39903 return { 39904 icon: "", 39905 wording: "" 39906 }; 39907 } 39908 } 39909 render() { 39910 const currentPublication = this.getStatusInfo(this.publication); 39911 const schedule = this.schedule ?? []; 39912 if (this.displaySchedule === "none" || schedule.length === 0) return this.renderStatus(currentPublication); 39913 const slicedSchedule = this.displaySchedule === "all" ? schedule : schedule.slice(0, 1); 39914 return b$1`<div class="grid grid-cols-1 gap-2"> 39915 ${c$1(slicedSchedule, (schedule2, index) => { 39916 const previousPublication = index === 0 ? currentPublication : this.getStatusInfo(this.schedule ? this.schedule[index - 1]?.publication : null); 39917 const nextPublication = schedule2?.date; 39918 const nextPublicationStatus = this.getStatusInfo(schedule2?.publication); 39919 return b$1` 39920 <div class="-mt-1"> 39921 <sonic-date 39922 class="font-medium text-2xs -mb-[2px] block" 39923 date="${nextPublication}" 39924 noAutoFill 39925 weekday="hidden" 39926 day="2-digit" 39927 month="2-digit" 39928 year="2-digit" 39929 ></sonic-date> 39930 <span class="flex items-center justify-center gap-1 "> 39931 ${this.renderStatus(previousPublication)} 39932 <sonic-icon size="xs" library="custom" name="arrow-right-long"></sonic-icon> 39933 ${this.renderStatus(nextPublicationStatus)} 39934 </span> 39935 </div> 39936 `; 39937 })} 39938 </div>`; 39939 } 39940 renderStatus(status) { 39941 return b$1` 39942 <sonic-tooltip label=${status.wording} placement=${o$4(this.tooltipPlacement)}> 39943 <sonic-icon library="custom" name=${status.icon}></sonic-icon> 39944 </sonic-tooltip> 39945 `; 39946 } 39947 }; 39948 SonicProductPublication.styles = [ 39949 tailwind, 39950 i$9` 39951 /* default | row */ 39952 :host { 39953 display: inline-flex; 39954 align-items: center; 39955 justify-content: center; 39956 text-align: center; 39957 } 39958 :host([direction="row"]) { 39959 flex-direction: row; 39960 gap: 0.25em; 39961 } 39962 39963 :host([direction="row"]) .closed { 39964 display: inline-flex; 39965 align-items: center; 39966 justify-content: center; 39967 } 39968 39969 /* column */ 39970 :host([direction="column"]) { 39971 flex-direction: column; 39972 } 39973 39974 :host([direction="column"]) .closed { 39975 display: inline-flex; 39976 flex-direction: column; 39977 align-items: center; 39978 justify-content: center; 39979 gap: 0.25em; 39980 } 39981 ` 39982 ]; 39983 __decorateClass$2i([ 39984 n$5({ type: String }) 39985 ], SonicProductPublication.prototype, "tooltipPlacement", 2); 39986 __decorateClass$2i([ 39987 n$5({ type: String, reflect: true }) 39988 ], SonicProductPublication.prototype, "direction", 2); 39989 __decorateClass$2i([ 39990 n$5({ type: String }) 39991 ], SonicProductPublication.prototype, "displaySchedule", 2); 39992 __decorateClass$2i([ 39993 n$5({ type: String }) 39994 ], SonicProductPublication.prototype, "publication", 2); 39995 __decorateClass$2i([ 39996 n$5({ type: Array }) 39997 ], SonicProductPublication.prototype, "schedule", 2); 39998 SonicProductPublication = __decorateClass$2i([ 39999 t$3("sonic-product-publication") 40000 ], SonicProductPublication); 40001 var __defProp$2f = Object.defineProperty; 40002 var __getOwnPropDesc$2h = Object.getOwnPropertyDescriptor; 40003 var __decorateClass$2h = (decorators, target, key, kind) => { 40004 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2h(target, key) : target; 40005 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40006 if (decorator = decorators[i2]) 40007 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40008 if (kind && result) __defProp$2f(target, key, result); 40009 return result; 40010 }; 40011 let Configuration = class extends Subscriber$1(i$6) { 40012 constructor() { 40013 super(...arguments); 40014 this.inline = false;
40015 this.settings = null; 40016 this.svgReelax = b$1`<svg 40017 xmlns="http://www.w3.org/2000/svg" 40018 xmlns:xlink="http://www.w3.org/1999/xlink" 40019 viewBox="0 0 37.08 39.46" 40020 width="1em" 40021 height="1em" 40022 fill="currentColor" 40023 style="vertical-align:middle;object-fit: contain;" 40024 > 40025 <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" /> 40026 <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" /> 40027 </svg>`; 40028 } 40029 render() { 40030 const settings = this.settings ?? this.props; 40031 const hasSyncho = !!settings?.synchro_site; 40032 const hasRefund = !!settings?.refund?.enabled; 40033 const hasReelax = !!settings?.reelax_info; 40034 const hasWaitingList = !!settings?.waiting_list?.enabled; 40035 const hasCarpooling = !!settings?.carpooling?.enabled; 40036 const hasOpenAgenda = !!settings?.openagenda; 40037 const passCultureIsSynchronized = settings?.pass_culture?.status === "synchronized"; 40038 return b$1`<sonic-product-publication 40039 direction=${this.inline ? "row" : "column"} 40040 noText 40041 class=${this.inline ? "" : "w-full"} 40042 displaySchedule=${o$4(this.displaySchedule)} 40043 ></sonic-product-publication> 40044 40045 ${settings?.closing_date ? b$1`<span class="font-bold text-[11px] leading-tight text-center gap-x-1 text-neutral-400 w-full"> 40046 <sonic-icon library="custom" name="lock" prefix="solid"></sonic-icon> 40047 <span>Clôturé le</span> 40048 <sonic-date 40049 date="${o$4(settings?.closing_date)}" 40050 weekday="hidden" 40051 day="2-digit" 40052 month="2-digit" 40053 year="2-digit" 40054 hour="hidden" 40055 minute="hidden" 40056 ></sonic-date> 40057 </span>` : A$1} 40058 ${hasRefund ? b$1`<sonic-tooltip label="Remboursement activé"> 40059 <sonic-icon class="text-sm text-neutral-400 " library="custom" name="arrow-rotate-left"></sonic-icon 40060 ></sonic-tooltip>` : A$1} 40061 ${hasOpenAgenda ? b$1`<sonic-tooltip label="OpenAgenda activé"> 40062 <sonic-icon class="text-sm text-neutral-400 " library="custom" name="location-check"></sonic-icon 40063 ></sonic-tooltip>` : A$1} 40064 ${hasSyncho ? b$1`<sonic-tooltip label="Synchronisé avec le site"> 40065 <sonic-icon class="text-sm text-neutral-400 " library="custom" name="link"></sonic-icon 40066 ></sonic-tooltip>` : A$1} 40067 ${hasCarpooling ? b$1`<sonic-tooltip label="Covoiturage activé" 40068 ><sonic-icon class="text-sm text-neutral-400 " library="custom" name="car-side"></sonic-icon 40069 ></sonic-tooltip>` : A$1} 40070 ${hasWaitingList ? b$1`<sonic-tooltip label="Liste d'attente si complet" 40071 ><sonic-icon class="text-sm text-neutral-400 " library="custom" name="list-ol"></sonic-icon 40072 ></sonic-tooltip>` : A$1} 40073 ${hasReelax ? b$1`<sonic-tooltip label="Bourse aux billets activée" 40074 ><span class="text-sm text-neutral-400">${this.svgReelax}</span></sonic-tooltip 40075 >` : A$1} 40076 ${passCultureIsSynchronized ? b$1`<sonic-tooltip label="pass Culture synchronisé"> 40077 ${svgPassCulture({ color: "currentColor", className: "size-6 text-neutral-500" })} 40078 </sonic-tooltip>` : A$1} `; 40079 } 40080 }; 40081 Configuration.styles = [ 40082 tailwind, 40083 i$9` 40084 :host { 40085 display: flex; 40086 align-items: center; 40087 justify-content: center; 40088 flex-wrap: wrap; 40089 gap: 0.3em 0.75em; 40090 } 40091 ` 40092 ]; 40093 __decorateClass$2h([ 40094 n$5({ type: String }) 40095 ], Configuration.prototype, "displaySchedule", 2); 40096 __decorateClass$2h([ 40097 n$5({ type: Boolean }) 40098 ], Configuration.prototype, "inline", 2); 40099 __decorateClass$2h([ 40100 n$5({ type: Object }) 40101 ], Configuration.prototype, "settings", 2); 40102 Configuration = __decorateClass$2h([ 40103 t$3("sonic-event-configuration") 40104 ], Configuration); 40105 var __defProp$2e = Object.defineProperty; 40106 var __getOwnPropDesc$2g = Object.getOwnPropertyDescriptor; 40107 var __decorateClass$2g = (decorators, target, key, kind) => { 40108 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2g(target, key) : target; 40109 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40110 if (decorator = decorators[i2]) 40111 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40112 if (kind && result) __defProp$2e(target, key, result); 40113 return result; 40114 }; 40115 const tagName$1s = "sonic-product-actions"; 40116 var ProductActionsEnum = /* @__PURE__ */ ((ProductActionsEnum2) => { 40117 ProductActionsEnum2["VIEW"] = "view"; 40118 ProductActionsEnum2["EDIT"] = "edit"; 40119 ProductActionsEnum2["STATS"] = "stats"; 40120 ProductActionsEnum2["CLONE"] = "clone";
40121 ProductActionsEnum2["PRICES"] = "prices"; 40122 ProductActionsEnum2["SALES"] = "sales"; 40123 ProductActionsEnum2["HISTORY"] = "history"; 40124 ProductActionsEnum2["MULTISESSIONS"] = "multisessions"; 40125 ProductActionsEnum2["MULTISESSIONS_EDIT"] = "multisessions.edit"; 40126 ProductActionsEnum2["MULTISESSIONS_STATS"] = "multisessions.stats"; 40127 ProductActionsEnum2["MULTISESSIONS_TICKETS"] = "multisessions.tickets"; 40128 ProductActionsEnum2["RESERVATIONS"] = "reservations.view"; 40129 ProductActionsEnum2["ALL_SESSIONS"] = "allSessions"; 40130 ProductActionsEnum2["DELETE"] = "delete"; 40131 ProductActionsEnum2["PIN"] = "pin"; 40132 ProductActionsEnum2["DIVIDER"] = "divider"; 40133 return ProductActionsEnum2; 40134 })(ProductActionsEnum || {}); 40135 let SonicProductActions = class extends Subscriber$1(i$6) { 40136 constructor() { 40137 super(...arguments); 40138 this.size = "md"; 40139 this.entity_type = EntityType.Event; 40140 this.displayConfiguration = false; 40141 } 40142 render() { 40143 if (!this.actions?.length) return A$1; 40144 return b$1`<sonic-pop> 40145 <sonic-button shape="circle" variant="ghost" icon size="${this.size}"> 40146 <sonic-icon library="custom" name="ellipsis-vertical" size="lg"></sonic-icon> 40147 </sonic-button> 40148 <sonic-menu slot="content" minWidth="11rem" size="sm"> 40149 ${this.menuActions()} 40150 ${this.displayConfiguration ? b$1`<sonic-divider>Configuration</sonic-divider> 40151 <sonic-event-configuration subDataProvider="settings" class="w-full text-lg"></sonic-event-configuration>` : A$1}</sonic-menu 40152 > 40153 </sonic-pop>`; 40154 } 40155 async deleteEvent() { 40156 const api2 = new API(this.getApiConfiguration()); 40157 await api2.delete(`sessions/${this.id}`, {}); 40158 this.dispatchEvent(new CustomEvent("deleteEvent")); 40159 const closestQueue = HTML.getClosestElement(this, "sonic-queue"); 40160 const formDataProvider = closestQueue?.getAttribute("dataFilterProvider"); 40161 if (this.dataProvider) { 40162 dp(this.dataProvider).invalidate(); 40163 } 40164 if (formDataProvider) { 40165 dp(formDataProvider).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 40166 } 40167 } 40168 confirmDeleteSession() { 40169 const entityTitle = this.props?.edito?.title; 40170 Modal.create({ 40171 title: `Confirmer la suppression`, 40172 subtitle: b$1`<i>"${entityTitle}"</i> sera supprimé définitivement.`, 40173 actions: b$1`<sonic-button @click=${() => this.deleteEvent()} type="danger" hideModal> 40174 <sonic-icon name="trash" library="custom" slot="prefix"> </sonic-icon> Supprimer</sonic-button 40175 > 40176 <sonic-button shape="block" hideModal> Annuler</sonic-button> ` 40177 }); 40178 } 40179 menuActions() { 40180 return this.actions?.map((action) => { 40181 const multisessionId = this.props?.multisession?.id; 40182 const isPast = !!(this.props?.settings?.archiving_date && this.props?.settings?.archiving_date < Math.floor(Date.now() / 1e3)); 40183 switch (action) { 40184 case "view": 40185 if (!this.props?.slug) return A$1; 40186 return b$1`<sonic-app-link 40187 size=${this.size} 40188 to="${this.viewRoute()}" 40189 slug=${this.props.slug} 40190 variant="ghost" 40191 shape="block" 40192 align="left" 40193 > 40194 <sonic-icon name="store" library="custom" slot="prefix"> </sonic-icon> Voir au guichet</sonic-app-link 40195 >`; 40196 case "edit": 40197 return b$1` <sonic-app-link 40198 size=${this.size} 40199 to=${this.editRoute()} 40200 id=${this.id} 40201 variant="ghost" 40202 shape="block" 40203 align="left" 40204 > 40205 <sonic-icon name="pen" library="custom" slot="prefix"> </sonic-icon> Modifier</sonic-app-link 40206 >`; 40207 case "stats": 40208 return b$1`<sonic-app-link 40209 size=${this.size} 40210 to="event.stats" 40211 id=${this.id} 40212 variant="ghost" 40213 shape="block" 40214 align="left" 40215 > 40216 <sonic-icon name="chart-pie-simple" library="custom" slot="prefix"> </sonic-icon> 40217 Statistiques</sonic-app-link 40218 >`; 40219 case "multisessions.stats": 40220 if (!multisessionId) return A$1; 40221 return b$1`<sonic-app-link 40222 size=${this.size} 40223 to="event.multisessions.stats" 40224 .id=${multisessionId} 40225 variant="ghost" 40226 shape="block" 40227 align="left" 40228 noAutoFill 40229 > 40230 <sonic-icon name="chart-pie-simple" library="custom" slot="prefix"> </sonic-icon> 40231 Statistiques</sonic-app-link 40232 >`; 40233 case "multisessions.tickets": 40234 if (!multisessionId) return A$1; 40235 return b$1`<sonic-app-link 40236 to=${this.salesRoute()} 40237 .query=${{ "reset-filtres": 1, multiseance: multisessionId, date_debut: "", saison: -2 }} 40238 variant="ghost" 40239 shape="block" 40240 size=${this.size} 40241 align="left" 40242 noAutoFill 40243 > 40244 <sonic-icon name="ticket" library="custom" slot="prefix"> </sonic-icon> Billets émis</sonic-app-link 40245 >`; 40246 case "multisessions": 40247 if (!multisessionId) return A$1; 40248 return b$1`<sonic-app-link 40249 to="event.multisessions" 40250 .id=${multisessionId} 40251 variant="ghost" 40252 shape="block" 40253 size=${this.size} 40254 align="left" 40255 noAutoFill 40256 > 40257 <sonic-icon name="calendar-day" library="custom" slot="prefix"> </sonic-icon> 40258 Multiséance</sonic-app-link 40259 >`; 40260 case "allSessions": 40261 if (!multisessionId) return A$1; 40262 return b$1`<sonic-app-link 40263 to="event" 40264 id=${this.id} 40265 slug=${o$4(this.props?.slug)} 40266 variant="ghost" 40267 shape="block" 40268 size=${this.size} 40269 align="left" 40270 > 40271 <sonic-icon name="calendar-day" library="custom" slot="prefix"> </sonic-icon> 40272 Toutes les séances</sonic-app-link 40273 >`; 40274 case "reservations.view": 40275 return b$1`<sonic-app-link 40276 to="reservations" 40277 .query=${{ "reset-filtres": 1, evenement: this.id }} 40278 variant="ghost" 40279 shape="block" 40280 align="left" 40281 size=${this.size} 40282 > 40283 <sonic-icon name="badge-check" library="custom" slot="prefix"> </sonic-icon> Réservations</sonic-app-link 40284 >`; 40285 case "prices": 40286 return b$1`<sonic-app-link 40287 to="prices" 40288 .query=${{ "reset-filtres": 1, evenement: this.id }} 40289 variant="ghost" 40290 shape="block" 40291 align="left" 40292 size=${this.size} 40293 > 40294 <sonic-icon name="euro-sign" library="custom" slot="prefix"> </sonic-icon> Tarifs</sonic-app-link 40295 >`; 40296 case "sales": 40297 if (this.entity_type == EntityType.Event && this.props?.settings?.can_be_deleted === true) return A$1; 40298 return b$1`<sonic-app-link 40299 to=${this.salesRoute()} 40300 .query=${{ 40301 "reset-filtres": 1, 40302 evenement: this.id, 40303 nid: this.id, 40304 type_abo: this.id, 40305 date_debut: "", 40306 saison: -2 40307 }} 40308 variant="ghost" 40309 shape="block" 40310 align="left" 40311 size=${this.size} 40312 > 40313 <sonic-icon name="ticket" library="custom" slot="prefix"> </sonic-icon> ${this.salesText()}</sonic-app-link 40314 >`; 40315 case "history": 40316 return b$1`<sonic-app-link 40317 size=${this.size} 40318 to="event.history" 40319 id=${this.id} 40320 variant="ghost" 40321 shape="block" 40322 align="left" 40323 > 40324 <sonic-icon name="clock-rotate-left" library="custom" slot="prefix"> </sonic-icon> 40325 Historique</sonic-app-link 40326 >`;
40327 case "clone": 40328 return b$1`<sonic-app-link 40329 size=${this.size} 40330 to="event.clone" 40331 id=${this.id} 40332 variant="ghost" 40333 shape="block" 40334 align="left" 40335 > 40336 <sonic-icon name="copy" library="custom" slot="prefix"> </sonic-icon> Dupliquer</sonic-app-link 40337 >`; 40338 case "pin": 40339 if (isPast) return A$1; 40340 return b$1`<sonic-pin size="sm"></sonic-pin>`; 40341 case "divider": 40342 return b$1`<sonic-divider></sonic-divider>`; 40343 case "delete": 40344 if (this.entity_type !== EntityType.Event || this.props?.settings?.can_be_deleted !== true || !this.permissions?.event?.delete) 40345 return A$1; 40346 return b$1` <sonic-button 40347 @click=${() => this.confirmDeleteSession()} 40348 variant="ghost" 40349 type="danger" 40350 noAutoFill 40351 shape="block" 40352 align="left" 40353 size=${this.size} 40354 > 40355 <sonic-icon name="trash" library="custom" slot="prefix"> </sonic-icon> Supprimer</sonic-button 40356 >`; 40357 default: 40358 return A$1; 40359 } 40360 }); 40361 } 40362 editRoute() { 40363 switch (this.entity_type) { 40364 case EntityType.Subscribe: 40365 return "subscriptionType.edit"; 40366 case EntityType.Giftcard: 40367 return "giftcard.edit"; 40368 case EntityType.Event: 40369 return "event.edit"; 40370 case EntityType.Merch: 40371 return "merch.edit"; 40372 default: 40373 return "event.edit"; 40374 } 40375 } 40376 salesRoute() { 40377 switch (this.entity_type) { 40378 case EntityType.Event: 40379 return "tickets"; 40380 case EntityType.Merch: 40381 return "merch.sales"; 40382 case EntityType.Subscribe: 40383 return "subscription.sales"; 40384 case EntityType.Giftcard: 40385 return "giftcard.sales"; 40386 default: 40387 return "tickets"; 40388 } 40389 } 40390 viewRoute() { 40391 switch (this.entity_type) { 40392 case EntityType.Event: 40393 return "event.session"; 40394 case EntityType.Merch: 40395 return "merch"; 40396 case EntityType.Subscribe: 40397 return "subscription"; 40398 case EntityType.Giftcard: 40399 return "giftcards"; 40400 default: 40401 return "event.session"; 40402 } 40403 } 40404 salesText() { 40405 switch (this.entity_type) { 40406 case EntityType.Event: 40407 return "Billets émis"; 40408 default: 40409 return "Produits vendus"; 40410 } 40411 } 40412 }; 40413 SonicProductActions.styles = [ 40414 tailwind, 40415 i$9` 40416 :host() { 40417 display: block; 40418 } 40419 40420 sonic-divider:last-child { 40421 display: none; 40422 } 40423 ` 40424 ]; 40425 __decorateClass$2g([ 40426 n$5() 40427 ], SonicProductActions.prototype, "size", 2); 40428 __decorateClass$2g([ 40429 n$5({ type: Array }) 40430 ], SonicProductActions.prototype, "actions", 2); 40431 __decorateClass$2g([ 40432 n$5({ type: String }) 40433 ], SonicProductActions.prototype, "entity_type", 2); 40434 __decorateClass$2g([ 40435 n$5({ type: Boolean }) 40436 ], SonicProductActions.prototype, "displayConfiguration", 2); 40437 __decorateClass$2g([ 40438 bind$1("admin/current.data.permissions"), 40439 r$5() 40440 ], SonicProductActions.prototype, "permissions", 2); 40441 SonicProductActions = __decorateClass$2g([ 40442 t$3(tagName$1s) 40443 ], SonicProductActions); 40444 var __defProp$2d = Object.defineProperty; 40445 var __getOwnPropDesc$2f = Object.getOwnPropertyDescriptor; 40446 var __decorateClass$2f = (decorators, target, key, kind) => { 40447 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2f(target, key) : target; 40448 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40449 if (decorator = decorators[i2]) 40450 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40451 if (kind && result) __defProp$2d(target, key, result); 40452 return result; 40453 }; 40454 let MerchCard = class extends Subscriber$1(i$6) { 40455 constructor() { 40456 super(...arguments); 40457 this.displayBackButton = false; 40458 } 40459 handleClickIllustration(src) { 40460 if (!src) return; 40461 Modal.create({ 40462 maxWidth: "60rem", 40463 content: b$1` <sonic-image src=${src} rounded="md" class="max-w-full max-h-full"></sonic-image> ` 40464 }); 40465 } 40466 render() { 40467 if (!this.props) return A$1; 40468 const bigPicture = this.props?.picture?.src ?? void 0; 40469 const body = this.props?.edito?.body ?? void 0; 40470 return b$1` 40471 <div class="@container "> 40472 <div 40473 class=" grid grid-cols-1 40474 @xl:grid-cols-[minmax(0,_12rem),_minmax(0,_1fr)] 40475 items-start 40476 rounded-lg gap-5 " 40477 > 40478 <div class="relative group"> 40479 ${this.displayBackButton ? b$1` 40480 <sonic-button 40481 icon 40482 goBack=${appRoute("home")} 40483 shape="circle" 40484 size="sm" 40485 noAutoFill 40486 type="neutral" 40487 class="absolute -left-1 -top-1 z-10" 40488 > 40489 <sonic-icon library="custom" name="arrow-left"></sonic-icon> 40490 </sonic-button> 40491 ` : A$1} 40492 <sonic-button variant="unstyled" @click=${() => this.handleClickIllustration(bigPicture)} class="w-full "> 40493 ${bigPicture ? b$1` 40494 <sonic-icon 40495 name="magnifying-glass-plus" 40496 library="custom" 40497 size="lg" 40498 class="absolute bottom-3 right-3 z-10 text-contrast-content group-hover:scale-[1.1] 40499 drop-shadow-md 40500 transition-all duration-200 " 40501 ></sonic-icon> 40502 ` : A$1} 40503 <sonic-product-illustration rounded="md"></sonic-product-illustration> 40504 </sonic-button> 40505 </div> 40506 40507 <div class="flex flex-col gap-2"> 40508 <sonic-product-title class="text-xl @xl:text-2xl font-bold flex-grow mb-3 mt-1"></sonic-product-title> 40509 <sonic-event-additional-status size="sm"></sonic-event-additional-status> 40510 <sonic-event-scheduled-status size="sm"></sonic-event-scheduled-status> 40511 <sonic-categorized-prices 40512 formType="select" 40513 type="merch" 40514 item_id=${this.id || ""} 40515 size="sm" 40516 class="flex-grow" 40517 ></sonic-categorized-prices> 40518
40519 ${body ? b$1` <sonic-divider class="my-4"></sonic-divider> 40520 <div class="prose prose-tight block text-sm @xl:text-base">${o$6(body)}</div>` : A$1} 40521 </div> 40522 </div> 40523 </div> 40524 `; 40525 } 40526 }; 40527 MerchCard.styles = [tailwind]; 40528 __decorateClass$2f([ 40529 n$5({ type: Boolean }) 40530 ], MerchCard.prototype, "displayBackButton", 2); 40531 MerchCard = __decorateClass$2f([ 40532 t$3("sonic-merch") 40533 ], MerchCard); 40534 var __defProp$2c = Object.defineProperty; 40535 var __getOwnPropDesc$2e = Object.getOwnPropertyDescriptor; 40536 var __decorateClass$2e = (decorators, target, key, kind) => { 40537 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2e(target, key) : target; 40538 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40539 if (decorator = decorators[i2]) 40540 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40541 if (kind && result) __defProp$2c(target, key, result); 40542 return result; 40543 }; 40544 const tagName$1r = "sonic-prose"; 40545 let SonicProse = class extends Subscriber$1(i$6) { 40546 constructor() { 40547 super(...arguments); 40548 this.size = "md"; 40549 } 40550 connectedCallback() { 40551 const templateEl = this.querySelector("template"); 40552 this.htmlContent = templateEl?.innerHTML.toString(); 40553 super.connectedCallback(); 40554 } 40555 render() { 40556 return b$1`<div class="prose ${this.size == "sm" ? " prose-sm prose-tight" : ""} max-w-[80ch]"> 40557 ${o$6(this.htmlContent)} 40558 <slot></slot> 40559 </div>`; 40560 } 40561 }; 40562 SonicProse.styles = [ 40563 tailwind, 40564 i$9` 40565 :host { 40566 display: block; 40567 } 40568 ` 40569 ]; 40570 __decorateClass$2e([ 40571 n$5() 40572 ], SonicProse.prototype, "size", 2); 40573 __decorateClass$2e([ 40574 n$5() 40575 ], SonicProse.prototype, "htmlContent", 2); 40576 SonicProse = __decorateClass$2e([ 40577 t$3(tagName$1r) 40578 ], SonicProse); 40579 const sonicProse = i$9` 40580 .sonic-prose { 40581 --sc-prose-mb: 1em; 40582 max-width: 72ch; 40583 } 40584 .sonic-prose-condensed { 40585 --sc-prose-mb: 0.6em; 40586 } 40587 .sonic-prose a { 40588 text-decoration: underline; 40589 } 40590 .sonic-prose p { 40591 margin-bottom: var(--_sc-prose-mb, 1em); 40592 } 40593 .sonic-prose ul, 40594 .sonic-prose ol { 40595 margin-bottom: var(--_sc-prose-mb, 1em); 40596 padding-left: 1.75em; 40597 } 40598 .sonic-prose li { 40599 margin-bottom: 0.1em; 40600 } 40601 .sonic-prose ul, 40602 .sonic-prose li { 40603 list-style-type: disc; 40604 } 40605`; 40606 var __defProp$2b = Object.defineProperty; 40607 var __getOwnPropDesc$2d = Object.getOwnPropertyDescriptor; 40608 var __decorateClass$2d = (decorators, target, key, kind) => { 40609 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2d(target, key) : target; 40610 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40611 if (decorator = decorators[i2]) 40612 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40613 if (kind && result) __defProp$2b(target, key, result); 40614 return result; 40615 }; 40616 const tagName$1q = "sonic-page-layout"; 40617 let PageLayout = class extends Subscriber$1(i$6) { 40618 constructor() { 40619 super(...arguments); 40620 this.displayTitle = false; 40621 this.displayText = false; 40622 this.smallTitle = false; 40623 } 40624 render() { 40625 const cleanTextMarkup = this.pageText ? this.removeEmptyParagraphs(this.pageText) : ""; 40626 const pageText = o$6(cleanTextMarkup || ""); 40627 return b$1`<div> 40628 ${(this.pageTitle || this.pageSubtitle) && this.displayTitle ? b$1`<div class="mb-4"> 40629 ${this.pageTitle && this.displayTitle ? b$1`<h1 40630 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]"} " 40631 > 40632 ${this.pageTitle} 40633 </h1>` : A$1} 40634 ${this.pageSubtitle && this.displayTitle ? b$1`<h1 40635 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]"} " 40636 > 40637 ${this.pageSubtitle} 40638 </h1>` : A$1} 40639 </div>` : A$1} 40640 40641 <slot name="intro"></slot> 40642 ${pageText && this.displayText ? b$1`<div class="mb-10 prose ">${pageText}</div>` : A$1} 40643 <slot></slot> 40644 </div>`; 40645 } 40646 removeEmptyParagraphs(markup) { 40647 return markup.replace(/<p><\/p>/g, "").replace(/<p> <\/p>/g, "").replace(/<p><br><\/p>/g, ""); 40648 } 40649 }; 40650 PageLayout.styles = [ 40651 tailwind, 40652 sonicProse, 40653 i$9` 40654 :host { 40655 display: block; 40656 } 40657 ` 40658 ]; 40659 __decorateClass$2d([ 40660 n$5({ type: String }) 40661 ], PageLayout.prototype, "pageTitle", 2); 40662 __decorateClass$2d([ 40663 n$5({ type: String }) 40664 ], PageLayout.prototype, "pageSubtitle", 2); 40665 __decorateClass$2d([ 40666 n$5({ type: String }) 40667 ], PageLayout.prototype, "pageText", 2); 40668 __decorateClass$2d([ 40669 n$5({ type: Boolean }) 40670 ], PageLayout.prototype, "displayTitle", 2); 40671 __decorateClass$2d([ 40672 n$5({ type: Boolean }) 40673 ], PageLayout.prototype, "displayText", 2); 40674 __decorateClass$2d([ 40675 n$5({ type: Boolean }) 40676 ], PageLayout.prototype, "smallTitle", 2); 40677 PageLayout = __decorateClass$2d([ 40678 t$3(tagName$1q) 40679 ], PageLayout); 40680 var __defProp$2a = Object.defineProperty; 40681 var __getOwnPropDesc$2c = Object.getOwnPropertyDescriptor; 40682 var __decorateClass$2c = (decorators, target, key, kind) => { 40683 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2c(target, key) : target; 40684 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40685 if (decorator = decorators[i2]) 40686 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40687 if (kind && result) __defProp$2a(target, key, result); 40688 return result; 40689 }; 40690 let SonicEventCard$2 = class SonicEventCard extends Subscriber$1(i$6) { 40691 constructor() { 40692 super(...arguments); 40693 this.categories = []; 40694 this.labels = []; 40695 this.slug = ""; 40696 this.skeleton = false;
40697 this.link = false; 40698 this.displayLocation = false; 40699 this.staticMode = false; 40700 } 40701 render() { 40702 if (this.skeleton) { 40703 return this.renderSkeleton(); 40704 } 40705 if (this.link) { 40706 let route2 = "event"; 40707 const entityType = this.props && "entity_type" in this.props ? this.props.entity_type : EntityType.Event; 40708 if (entityType === EntityType.Merch) { 40709 route2 = "merch"; 40710 } 40711 return b$1`<sonic-app-link to=${route2} .slug=${this.slug} class="group contents"> 40712 ${this.cardMarkup()} 40713 </sonic-app-link>`; 40714 } 40715 return this.cardMarkup(); 40716 } 40717 cardMarkup() { 40718 const id = this.props?.id; 40719 if (!id) return A$1; 40720 const isShowContext = this.props && "sessions" in this.props; 40721 const entityType = this.props && "entity_type" in this.props ? this.props.entity_type : EntityType.Event; 40722 const entityEndpoint = entityType === EntityType.Merch ? "merchs" : "sessions"; 40723 const statusEndpoint = isShowContext ? `shows/${id}/status` : `${entityEndpoint}/${id}?features[]=status`; 40724 const statusKey = isShowContext ? void 0 : "data"; 40725 const isMerch = entityType === EntityType.Merch; 40726 return b$1`<div class="@container"> 40727 <div 40728 class="leading-tight p-2 @sm:p-3 flex gap-3 rounded-md border border-solid border-neutral-100 40729 hover:border-neutral-200 focus:border-neutral-300 40730 transition duration-75 bg-neutral-0 " 40731 > 40732 <sonic-product-illustration 40733 rounded="md" 40734 class="w-1/3 max-w-[8rem] shrink-0 relative self-start" 40735 ></sonic-product-illustration> 40736 <div class="self-center flex-grow py-1 min-w-0"> 40737 <sonic-date 40738 weekday="short" 40739 day="2-digit" 40740 month="short" 40741 class="text-xs leading-tight block mb-2 uppercase" 40742 ></sonic-date> 40743 <div class="mb-3"> 40744 <sonic-product-title class="leading-tight"></sonic-product-title> 40745 </div> 40746 40747 <div class="flex gap-1 flex-wrap items-center gap-x-2 text-xs"> 40748 ${this.staticMode ? b$1`<sonic-event-additional-status 40749 size="inherit" 40750 variant="ghost" 40751 class="flex flex-wrap gap-x-3 gap-y-1" 40752 ></sonic-event-additional-status>` : b$1`<sonic-event-additional-status 40753 fetch 40754 dataProvider="${statusEndpoint}" 40755 key="${o$4(statusKey)}" 40756 size="inherit" 40757 variant="ghost" 40758 warnAndDangerAsPill 40759 class="flex flex-wrap gap-x-3 gap-y-1" 40760 ></sonic-event-additional-status>`} 40761 40762 <sonic-event-scheduled-status size="inherit"></sonic-event-scheduled-status> 40763 <sonic-event-taxonomy .taxonomy=${this.labels} size="inherit" key="label"></sonic-event-taxonomy> 40764 ${this.categories.length > 0 ? b$1` <sonic-event-taxonomy 40765 .icon=${{ name: "tag", library: "custom" }} 40766 .taxonomy=${this.categories} 40767 variant="ghost" 40768 key="category" 40769 size="xs" 40770 > 40771 </sonic-event-taxonomy>` : A$1} 40772 ${this.displayLocation ? b$1`<sonic-event-location-hall size="inherit" class=" grow w-full"></sonic-event-location-hall>` : A$1} 40773 </div> 40774 ${isMerch ? b$1`<sonic-price-range class="text-sm"></sonic-price-range>` : A$1} 40775 <slot name="bottom"></slot> 40776 </div> 40777 </div> 40778 </div>`; 40779 } 40780 renderSkeleton() { 40781 return b$1` 40782 <div class="leading-tight p-2 @sm:p-3 flex gap-3 rounded-md border border-solid border-neutral-100"> 40783 <div class="w-1/3 max-w-[8rem] shrink-0 relative aspect-square rounded-md bg-neutral-100 animate-pulse"></div> 40784 <div class="self-center flex-grow"> 40785 <div class=" leading-none block mb-2 bg-neutral-50 rounded-sm h-4 w-1/2 "></div> 40786 <div class=" leading-none block mb-1 bg-neutral-100 rounded-sm h-5 w-2/3 "></div> 40787 <div class="text-xs leading-tight block bg-neutral-100 rounded-sm h-3 w-1/3"></div> 40788 </div> 40789 </div> 40790 `; 40791 } 40792 }; 40793 SonicEventCard$2.styles = [tailwind]; 40794 __decorateClass$2c([ 40795 n$5({ type: Array }) 40796 ], SonicEventCard$2.prototype, "categories", 2); 40797 __decorateClass$2c([ 40798 n$5({ type: Array }) 40799 ], SonicEventCard$2.prototype, "labels", 2); 40800 __decorateClass$2c([ 40801 n$5({ type: String }) 40802 ], SonicEventCard$2.prototype, "slug", 2); 40803 __decorateClass$2c([ 40804 n$5({ type: Boolean }) 40805 ], SonicEventCard$2.prototype, "skeleton", 2); 40806 __decorateClass$2c([ 40807 n$5({ type: Boolean }) 40808 ], SonicEventCard$2.prototype, "link", 2); 40809 __decorateClass$2c([ 40810 n$5({ type: Boolean }) 40811 ], SonicEventCard$2.prototype, "displayLocation", 2); 40812 __decorateClass$2c([ 40813 c({ context: staticMode }), 40814 r$5() 40815 ], SonicEventCard$2.prototype, "staticMode", 2); 40816 SonicEventCard$2 = __decorateClass$2c([ 40817 t$3("sonic-event-card") 40818 ], SonicEventCard$2); 40819 var __defProp$29 = Object.defineProperty; 40820 var __getOwnPropDesc$2b = Object.getOwnPropertyDescriptor; 40821 var __decorateClass$2b = (decorators, target, key, kind) => { 40822 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2b(target, key) : target; 40823 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40824 if (decorator = decorators[i2]) 40825 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40826 if (kind && result) __defProp$29(target, key, result); 40827 return result; 40828 }; 40829 const tagName$1p = "sonic-shop"; 40830 let SonicShop = class extends Subscriber$1(i$6) { 40831 constructor() { 40832 super(...arguments); 40833 this.displayTitle = false;
40834 this.displayText = false; 40835 this.smallTitle = false; 40836 this.noRouting = false; 40837 this.storeMode = false; 40838 this.localStoreFilters = false; 40839 this.filterFormDataProvider = "defaultStoreFilters"; 40840 } 40841 handleClick(item) { 40842 if (!this.noRouting) return; 40843 Modal.create({ 40844 maxWidth: "72rem", 40845 content: b$1` 40846 <sonic-fetch 40847 key="data" 40848 dataProvider="merchs/${item.id}?features[]=prices&features[]=picture&features[]=status" 40849 cartProvider=${o$4(this.cartProvider)} 40850 > 40851 <sonic-merch .item=${item}></sonic-merch> 40852 </sonic-fetch> 40853 ` 40854 }); 40855 } 40856 render() { 40857 return b$1`<sonic-page-layout 40858 pageTitle=${t("module_shop_title")} 40859 pageText=${t("module_shop_text")} 40860 ?smallTitle=${this.smallTitle} 40861 ?displayTitle=${this.displayTitle} 40862 ?displayText=${this.displayText} 40863 > 40864 <div class="@container"> 40865 ${this.localStoreFilters ? b$1`<sonic-subscriber 40866 dataProvider="${this.filterFormDataProvider}" 40867 localStorage="enabled" 40868 ></sonic-subscriber>` : A$1} 40869 <sonic-form-event-filter 40870 .entityType=${EntityType.Merch} 40871 formDataProvider="${this.filterFormDataProvider}" 40872 class="block max-w-[40rem] w-full min-w-0 mb-6" 40873 ></sonic-form-event-filter> 40874 40875 <sonic-queue 40876 key="data" 40877 dataFilterProvider="${this.filterFormDataProvider}" 40878 dataProviderExpression="merchs?features[]=prices&features[]=picture&features[]=status&features[]=settings&limit=$limit&offset=$offset" 40879 class="grid grid-cols-1 ${this.storeMode ? "" : "@2xl:grid-cols-2 gap-4 @5xl:grid-cols-3"} " 40880 .items=${(item) => this.renderItems(item)} 40881 .noItems=${() => b$1` <sonic-no-result></sonic-no-result> `} 40882 .skeleton=${() => this.renderSkeleton()} 40883 > 40884 </sonic-queue> 40885 </div> 40886 </sonic-page-layout>`; 40887 } 40888 renderItems(item) { 40889 return b$1` 40890 ${this.storeMode ? b$1`<sonic-event-store-item formType=${this.appType === "counter" ? "buttons" : "select"} class="mb-4 block"> 40891 </sonic-event-store-item> ` : b$1` <sonic-event-card 40892 ?link=${!this.noRouting} 40893 @click=${() => this.handleClick(item)} 40894 class="cursor-pointer" 40895 > 40896 </sonic-event-card>`} 40897 `; 40898 } 40899 renderSkeleton() { 40900 return b$1` 40901 ${this.storeMode ? b$1` <sonic-event-store-item skeleton></sonic-event-store-item> ` : b$1` <sonic-event-card skeleton></sonic-event-card> `} 40902 `; 40903 } 40904 }; 40905 SonicShop.styles = [ 40906 tailwind, 40907 i$9` 40908 :host { 40909 display: block; 40910 } 40911 ` 40912 ]; 40913 __decorateClass$2b([ 40914 n$5({ type: Boolean }) 40915 ], SonicShop.prototype, "displayTitle", 2); 40916 __decorateClass$2b([ 40917 n$5({ type: Boolean }) 40918 ], SonicShop.prototype, "displayText", 2); 40919 __decorateClass$2b([ 40920 n$5({ type: Boolean }) 40921 ], SonicShop.prototype, "smallTitle", 2); 40922 __decorateClass$2b([ 40923 n$5({ type: Boolean }) 40924 ], SonicShop.prototype, "noRouting", 2); 40925 __decorateClass$2b([ 40926 n$5({ type: String }) 40927 ], SonicShop.prototype, "cartProvider", 2); 40928 __decorateClass$2b([ 40929 n$5({ type: Boolean }) 40930 ], SonicShop.prototype, "storeMode", 2); 40931 __decorateClass$2b([ 40932 n$5({ type: Boolean }) 40933 ], SonicShop.prototype, "localStoreFilters", 2); 40934 __decorateClass$2b([ 40935 n$5({ type: String }) 40936 ], SonicShop.prototype, "filterFormDataProvider", 2); 40937 __decorateClass$2b([ 40938 c({ context: appType, subscribe: true }) 40939 ], SonicShop.prototype, "appType", 2); 40940 SonicShop = __decorateClass$2b([ 40941 t$3(tagName$1p) 40942 ], SonicShop); 40943 var __defProp$28 = Object.defineProperty; 40944 var __getOwnPropDesc$2a = Object.getOwnPropertyDescriptor; 40945 var __decorateClass$2a = (decorators, target, key, kind) => { 40946 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2a(target, key) : target; 40947 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 40948 if (decorator = decorators[i2]) 40949 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 40950 if (kind && result) __defProp$28(target, key, result); 40951 return result; 40952 }; 40953 let instanceCounter$9 = 0; 40954 let SubscriptionType = class extends Subscriber$1(i$6) { 40955 constructor() { 40956 super(...arguments); 40957 this.infos_status = null; 40958 this._needProof = false;
40959 this.formDataProvider = `SubscriptionTypePriceForm/${instanceCounter$9++}`; 40960 this._selectedPriceId = 0; 40961 this.pricesOptions = []; 40962 this.loading = false; 40963 this.handleFormMutation = () => { 40964 const priceId = dp(this.formDataProvider).price.id.get(); 40965 const priceHasChanged = this._selectedPriceId !== Number(priceId); 40966 if (!priceId || !priceHasChanged) return; 40967 const currentPrice = this.props?.prices?.find((price) => price.id?.toString() === priceId.toString()); 40968 const quantity = Number(dp(this.formDataProvider).quantity.get()) || 1; 40969 this._needProof = !!currentPrice?.need_proof_of_identity; 40970 this._priceAmount = Number(currentPrice?.amount_display) * Number(quantity); 40971 this._selectedPriceId = Number(priceId); 40972 }; 40973 } 40974 connectedCallback() { 40975 super.connectedCallback(); 40976 dp(this.formDataProvider).onInternalMutation(this.handleFormMutation); 40977 dp(this.formDataProvider).set({ quantity: "1" }); 40978 } 40979 disconnectedCallback() { 40980 dp(this.formDataProvider).offInternalMutation(this.handleFormMutation); 40981 super.disconnectedCallback(); 40982 } 40983 willUpdate(_changedProperties) { 40984 if (_changedProperties.has("props")) { 40985 if (this.props?.prices) { 40986 this.pricesOptions = this.pricesToOptions(this.props.prices); 40987 } 40988 } 40989 if (_changedProperties.has("_selectedPriceId")) { 40990 const currentPrice = this.props?.prices?.find((price) => this._selectedPriceId === price.id); 40991 const isDuo = currentPrice?.is_duo ?? false; 40992 if (isDuo) { 40993 dp(this.formDataProvider).quantity.set("2"); 40994 } else { 40995 const maxQuantity = currentPrice?.price_max_places; 40996 const currentQuantity = Number(dp(this.formDataProvider).quantity.get()) || 1; 40997 if (maxQuantity && currentQuantity > maxQuantity) { 40998 dp(this.formDataProvider).quantity.set(maxQuantity.toString()); 40999 } 41000 } 41001 } 41002 } 41003 pricesToOptions(prices) { 41004 const pricesOptionsDefault = []; 41005 if (prices.length > 1) { 41006 const defaultSelectOption = { 41007 value: "0", 41008 wording: t("LIB_select_price_option") 41009 }; 41010 pricesOptionsDefault.push(defaultSelectOption); 41011 } 41012 const pricesOptions = prices.map((price) => ({ value: price.id?.toString() || "", wording: price.title || "" })); 41013 return [...pricesOptionsDefault, ...pricesOptions]; 41014 } 41015 quantityOptions(max = 10) { 41016 return Array.from({ length: max }, (_2, i2) => ({ 41017 value: (i2 + 1).toString(), 41018 wording: (i2 + 1).toString() 41019 })); 41020 } 41021 async addToCart() { 41022 if (!this.props?.id) return; 41023 this.loading = true; 41024 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 41025 const formValues = dp(this.formDataProvider); 41026 const cartItem = { 41027 entity_type: EntityType.Subscribe, 41028 entity_id: Number(this.props.id), 41029 quantity: Number(formValues.quantity.get()) || 1, 41030 price: { id: parseInt(formValues.price.id.get()) } 41031 }; 41032 await Cart.addItems({ 41033 apiConfiguration: this.getApiConfiguration(), 41034 cartProvider, 41035 items: [cartItem], 41036 attachOwnersAfterRequest: true 41037 }); 41038 this.loading = false; 41039 } 41040 render() { 41041 if (!this.props?.id) return A$1; 41042 const { prices } = this.props; 41043 const displayMoreInfo = !!this.props.edito?.body; 41044 const hasMultiplePrices = prices && prices.length > 1; 41045 const isFull = this.props.infos_status?.additionnals?.some((additional) => additional.key === "full"); 41046 return b$1` 41047 <div class="@container group max-w-[80rem] w-full"> 41048 <div 41049 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 " 41050 > 41051 <div class="hidden @2xl:block"> 41052 <sonic-product-illustration rounded="md"></sonic-product-illustration> 41053 </div> 41054 <div> 41055 <div class="flex items-center gap-2"> 41056 <sonic-product-title class="text-xl @xl:text-2xl font-bold mb-1"></sonic-product-title> 41057 ${this.appType == "counter" ? b$1`<div class="ml-auto pl-1 flex items-center"> 41058 <sonic-product-publication 41059 subDataProvider="infos_status" 41060 class="text-lg" 41061 ></sonic-product-publication> 41062 ${this.renderMenu()} 41063 </div>` : A$1} 41064 </div> 41065 ${this.props?.validity_text ? b$1`<div class="font-bold mb-3 -ml-1"> 41066 <sonic-icon name="calendar-lines" library="custom"></sonic-icon> ${o$6( 41067 this.props?.validity_text 41068 )} 41069 </div>` : A$1} 41070 <sonic-event-additional-status size="sm"></sonic-event-additional-status> 41071 <sonic-event-scheduled-status size="sm"></sonic-event-scheduled-status> 41072 41073 <div class="text-sm mb-6 mt-2"> 41074 ${this.props.edito?.summary ? b$1`<div class="prose prose-sm prose-tight block text-pretty"> 41075 ${o$6(this.props.edito?.summary)} 41076 </div>` : A$1} 41077 ${displayMoreInfo ? b$1`<sonic-button class="mt-1" size="inherit" @click=${() => this.showMoreInfo()} variant="link"> 41078 <sonic-icon name="circle-info" library="custom" slot="prefix"></sonic-icon> 41079 ${t("LIB_more_info")} 41080 </sonic-button>` : A$1} 41081 </div> 41082 41083 <!-- Price --> 41084 ${this._priceAmount ? b$1`<div class="text-lg @xl:text-xl mb-3 font-bold">
41084${formatAmount(this._priceAmount)}</div>` : A$1} 41085 ${this._needProof ? b$1`<sonic-alert 41086 ${F({ 41087 in: v, 41088 out: f, 41089 stabilizeOut: true, 41090 keyframeOptions: { 41091 duration: 250, 41092 easing: "linear" 41093 } 41094 })} 41095 status="warning" 41096 class="mb-3" 41097 size="sm" 41098 label="${t("LIB_need_proof")}" 41099 ></sonic-alert>` : A$1} 41100 ${prices && prices.length > 0 && !isFull ? b$1`<div 41101 formDataProvider=${this.formDataProvider} 41102 class="flex flex-col gap-3 @lg:flex-row @lg:items-end @lg:gap-2 w-full grow" 41103 > 41104 <sonic-select 41105 label="${t("price")}" 41106 name="price.id" 41107 class="${prices.length == 1 ? "hidden" : "min-w-[7.5rem] grow"} " 41108 .options=${this.pricesOptions} 41109 ></sonic-select> 41110 41111 <sonic-select 41112 name="quantity" 41113 label="${t("quantity")}" 41114 class="${this._selectedPriceId === 0 ? "opacity-0 pointer-events-none" : ""} inline-block min-w-[5rem] transition-opacity duration-300" 41115 value="1" 41116 .options=${this.quantityOptions()} 41117 ?disabled=${this._selectedPriceId === 0} 41118 ></sonic-select> 41119 41120 <sonic-button 41121 ?loading=${this.loading} 41122 data-aria-label=${t("LIB_add_to_cart")} 41123 @click=${this.addToCart} 41124 minWidth="10rem" 41125 type="primary" 41126 class="min-w-[10rem] transition-opacity duration-300 delay-200 ${this._selectedPriceId === 0 ? "opacity-0 pointer-events-none" : ""}" 41127 ?disabled=${this._selectedPriceId === 0 && hasMultiplePrices} 41128 > 41129 <sonic-icon name="basket-shopping" library="custom"></sonic-icon> 41130 <span class="font-bold">${t("LIB_add")}</span> 41131 </sonic-button> 41132 </div> ` : A$1} 41133 ${this.loginButton()} 41134 </div> 41135 </div> 41136 </div> 41137 `; 41138 } 41139 showMoreInfo() { 41140 const body = this.props?.edito?.body; 41141 const title = this.props?.edito?.title; 41142 const subtitle = this.props?.edito?.sub_title; 41143 if (this._modal) { 41144 this._modal.hide(); 41145 } 41146 if (!body) return; 41147 this._modal = Modal.create({ 41148 title: b$1`${title}`, 41149 subtitle: b$1`${subtitle}`, 41150 content: b$1`<div class="prose prose-sm prose-tight block">${o$6(this.props?.edito?.body)}</div>`, 41151 maxWidth: "45rem", 41152 removeOnHide: true 41153 }); 41154 } 41155 loginButton() { 41156 const isRestrictedToPro = this.props?.infos_status?.additionnals?.some( 41157 (additional) => additional.key === "pro_need_login" 41158 ); 41159 if (!isRestrictedToPro) return A$1; 41160 return b$1`<sonic-app-link to="account" variant="default" type="primary"> 41161 <sonic-icon library="custom" name="user-tie"></sonic-icon> 41162 ${t("se_connecter")} 41163 </sonic-app-link>`; 41164 } 41165 renderMenu() { 41166 const actions = [ 41167 ProductActionsEnum.EDIT, 41168 ProductActionsEnum.SALES, 41169 ProductActionsEnum.DIVIDER, 41170 ProductActionsEnum.PIN 41171 ]; 41172 return b$1` <sonic-product-actions size="sm" .actions=${actions}></sonic-product-actions>`; 41173 } 41174 }; 41175 SubscriptionType.styles = [ 41176 tailwind, 41177 i$9` 41178 :host { 41179 display: flex; 41180 width: 100%; 41181 min-height: 100%; 41182 } 41183 ` 41184 ]; 41185 __decorateClass$2a([ 41186 n$5({ type: Object }) 41187 ], SubscriptionType.prototype, "infos_status", 2); 41188 __decorateClass$2a([ 41189 r$5() 41190 ], SubscriptionType.prototype, "_modal", 2); 41191 __decorateClass$2a([ 41192 r$5() 41193 ], SubscriptionType.prototype, "_priceAmount", 2); 41194 __decorateClass$2a([ 41195 r$5() 41196 ], SubscriptionType.prototype, "_needProof", 2); 41197 __decorateClass$2a([ 41198 c({ context: appType, subscribe: true }), 41199 r$5() 41200 ], SubscriptionType.prototype, "appType", 2); 41201 __decorateClass$2a([ 41202 r$5() 41203 ], SubscriptionType.prototype, "_selectedPriceId", 2); 41204 __decorateClass$2a([ 41205 r$5() 41206 ], SubscriptionType.prototype, "pricesOptions", 2); 41207 __decorateClass$2a([ 41208 r$5() 41209 ], SubscriptionType.prototype, "loading", 2); 41210 SubscriptionType = __decorateClass$2a([ 41211 t$3("sonic-subscription-type") 41212 ], SubscriptionType); 41213 const autocompleteValue = (name, appType2) => { 41214 const isChromeBrowser = navigator.userAgent.includes("Chrome"); 41215 if (appType2 === "counter") { 41216 return isChromeBrowser ? "off-chrome" : "off"; 41217 } 41218 return name; 41219 }; 41220 const generateFakeEmail = (firstName, lastName) => { 41221 const sanitizeEmailPart = (value) => value?.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/\s+/g, "").replace(/[^a-z0-9]/g, "").slice(0, 30
41221); 41222 const prenom = sanitizeEmailPart(firstName); 41223 const nom = sanitizeEmailPart(lastName); 41224 const renderName = prenom || nom ? `${prenom}-${nom}` : "unknown"; 41225 return `${renderName}@${Date.now()}.pasdemail`; 41226 }; 41227 const normalizeCountry = (country) => { 41228 return country?.toUpperCase() || "FR"; 41229 }; 41230 function requiredMark(isRequired, slot = "label") { 41231 const shouldRender = isRequired || false; 41232 return shouldRender ? b$1`<span class="opacity-50 pl-1" slot=${o$4(slot)}>*</span>` : A$1; 41233 } 41234 const cleanFormData = (objectToClean, formConfiguration) => { 41235 if (!formConfiguration) return objectToClean; 41236 const keysToPreserve = [ 41237 ...Object.keys(formConfiguration).filter((key) => formConfiguration[key]?.enabled), 41238 "firstName", 41239 "lastName", 41240 "optins" 41241 ]; 41242 return Object.fromEntries(Object.entries(objectToClean).filter(([key]) => keysToPreserve.includes(key))); 41243 }; 41244 var __defProp$27 = Object.defineProperty; 41245 var __getOwnPropDesc$29 = Object.getOwnPropertyDescriptor; 41246 var __decorateClass$29 = (decorators, target, key, kind) => { 41247 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$29(target, key) : target; 41248 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 41249 if (decorator = decorators[i2]) 41250 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 41251 if (kind && result) __defProp$27(target, key, result); 41252 return result; 41253 }; 41254 const API_URLS = { 41255 zipcode: "https://data.geopf.fr/geocodage/completion?type=StreetAddress&maximumResponses=15", 41256 city: "https://data.geopf.fr/geocodage/completion?poiType=commune&type=PositionOfInterest&maximumResponses=15", 41257 address: "https://data.geopf.fr/geocodage/completion?poiType=housenumber&type=StreetAddress&maximumResponses=15" 41258 }; 41259 let instanceCounter$8 = 0; 41260 const tagName$1o = "sonic-geo-autocomplete"; 41261 let GeoAutocomplete = class extends Subscriber$1(i$6) { 41262 constructor() { 41263 super(...arguments); 41264 this._resizeController = new h$1(this, {}); 41265 this.required = false; 41266 this.type = "zipcode"; 41267 this.noSuggestion = false; 41268 this._isPopContentVisible = false; 41269 this.formDataProvider = ""; 41270 this.dataProviderExpression = ""; 41271 this.searchDataProvider = "searchGeoDP" + instanceCounter$8++; 41272 this.handleCurrentValueChange = (value) => { 41273 if (this.noSuggestion) { 41274 this._isPopContentVisible = false; 41275 dp(this.searchDataProvider).text.set(""); 41276 return; 41277 } 41278 if (value?.length && value.length > 2) { 41279 dp(this.searchDataProvider).text.set(value); 41280 this._isPopContentVisible = true; 41281 } else { 41282 dp(this.searchDataProvider).text.set(""); 41283 this._isPopContentVisible = false; 41284 } 41285 }; 41286 this.renderResults = (result) => { 41287 if (this.type === "zipcode" && result.kind !== "municipality") { 41288 return A$1; 41289 } 41290 if (this.type === "city" && result.kind !== "administratif") { 41291 return A$1; 41292 } 41293 return b$1`<sonic-menu-item @click=${() => this.handleSelect(result)} size="sm"> 41294 ${r(this.type, [ 41295 ["city", () => b$1`${result.names[0]} <span class="text-neutral-500 text-[.9em]">â ${result.zipcode}</span>`], 41296 ["zipcode", () => b$1`${result.zipcode} <span class="text-neutral-500 text-[.9em]">â ${result.city}</span>`], 41297 ["address", () => b$1`${result.fulltext}`] 41298 ])}</sonic-menu-item 41299 >`; 41300 }; 41301 } 41302 connectedCallback() { 41303 this.formDataProvider = HTML.getAncestorAttributeValue(this, "formdataprovider") || ""; 41304 this.dataProviderExpression = API_URLS[this.type]; 41305 if (!this.name) { 41306 this.name = this.defaultInputName(); 41307 } 41308 dp(this.formDataProvider)[this.name].onAssign(this.handleCurrentValueChange); 41309 super.connectedCallback(); 41310 } 41311 disconnectedCallback() { 41312 if (this.name) { 41313 dp(this.formDataProvider)[this.name].offAssign(this.handleCurrentValueChange); 41314 } 41315 super.disconnectedCallback(); 41316 } 41317 defaultInputName() {
41318 if (this.type === "zipcode") { 41319 return "postalCode"; 41320 } else if (this.type === "city") { 41321 return "city"; 41322 } else if (this.type === "address") { 41323 return "address"; 41324 } 41325 return ""; 41326 } 41327 handleSelect(result) { 41328 this.fillCurrentValue(result); 41329 const event = new CustomEvent("select", { detail: result }); 41330 this.dispatchEvent(event); 41331 } 41332 fillCurrentValue(result) { 41333 if (!result || !this.name) return; 41334 let newValue = ""; 41335 if (this.type === "zipcode") { 41336 newValue = result.zipcode; 41337 } else if (this.type === "city") { 41338 newValue = result.city || result.names?.[0]; 41339 } else if (this.type === "address") { 41340 newValue = result.fulltext ? result.fulltext.substring(0, result?.fulltext?.lastIndexOf(",")) : ""; 41341 } 41342 dp(this.formDataProvider)[this.name].set(newValue); 41343 } 41344 render() { 41345 const menuStyles = { 41346 display: this._isPopContentVisible ? "block" : "none", 41347 width: this.offsetWidth ? `${this.offsetWidth}px` : "auto" 41348 }; 41349 return b$1` 41350 <sonic-pop data-keyboard-nav="nav-autocomplete" class="w-full relative"> 41351 <sonic-input 41352 label="${this.label}" 41353 name="${this.name}" 41354 .size="${this.size}" 41355 ?required=${this.required} 41356 autocomplete="off-chrome" 41357 type="search" 41358 > 41359 ${requiredMark(this.required)} 41360 </sonic-input> 41361 <sonic-menu 41362 slot="content" 41363 style=${o$3(menuStyles)} 41364 class="max-h-[10rem] overflow-y-auto custom-scroll max-w-full" 41365 > 41366 <sonic-queue 41367 lazyload 41368 key="results" 41369 headersDataProvider="none" 41370 credentials="omit" 41371 dataProviderExpression="${this.dataProviderExpression}" 41372 dataFilterProvider="${this.searchDataProvider}" 41373 .items=${this.renderResults} 41374 .noItems=${() => b$1`<sonic-no-result size="sm"></sonic-no-result>`} 41375 > 41376 </sonic-queue> 41377 </sonic-menu> 41378 </sonic-pop> 41379 `; 41380 } 41381 // @todo / voir si c'est pas plus simple ainsi. 41382 // permettrait le filter en amont. 41383 // async fetchSuggestions(query: string): Promise<GeoResult[]> { 41384 // if (query.length < 3) { 41385 // return []; 41386 // } 41387 // const url = `${API_URLS[this.type]}&text=${encodeURIComponent(query)}`; 41388 // const res = await fetch(url); 41389 // const data = await res.json(); 41390 // return data.filter((item: GeoResult) => { 41391 // if (this.type === "zipcode" && item.kind !== "municipality") { 41392 // return false; 41393 // } 41394 // if (this.type === "city" && item.kind !== "administratif") { 41395 // return false; 41396 // } 41397 // return true; 41398 // }); 41399 // } 41400 }; 41401 GeoAutocomplete.styles = [ 41402 tailwind, 41403 customScroll, 41404 i$9` 41405 :host { 41406 width: 100%; 41407 } 41408 ` 41409 ]; 41410 __decorateClass$29([ 41411 n$5({ type: String }) 41412 ], GeoAutocomplete.prototype, "name", 2); 41413 __decorateClass$29([ 41414 n$5({ type: String }) 41415 ], GeoAutocomplete.prototype, "label", 2); 41416 __decorateClass$29([ 41417 n$5({ type: String }) 41418 ], GeoAutocomplete.prototype, "size", 2); 41419 __decorateClass$29([ 41420 n$5({ type: String }) 41421 ], GeoAutocomplete.prototype, "autoComplete", 2); 41422 __decorateClass$29([ 41423 n$5({ type: Boolean }) 41424 ], GeoAutocomplete.prototype, "required", 2); 41425 __decorateClass$29([ 41426 n$5({ type: String }) 41427 ], GeoAutocomplete.prototype, "type", 2); 41428 __decorateClass$29([ 41429 n$5({ type: Boolean }) 41430 ], GeoAutocomplete.prototype, "noSuggestion", 2); 41431 __decorateClass$29([ 41432 r$5() 41433 ], GeoAutocomplete.prototype, "_isPopContentVisible", 2); 41434 GeoAutocomplete = __decorateClass$29([ 41435 t$3(tagName$1o) 41436 ], GeoAutocomplete); 41437 var __defProp$26 = Object.defineProperty; 41438 var __getOwnPropDesc$28 = Object.getOwnPropertyDescriptor; 41439 var __decorateClass$28 = (decorators, target, key, kind) => { 41440 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$28(target, key) : target; 41441 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 41442 if (decorator = decorators[i2]) 41443 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 41444 if (kind && result) __defProp$26(target, key, result); 41445 return result; 41446 }; 41447 let AddressSuggestion = class extends Subscriber$1(i$6) { 41448 constructor() { 41449 super(...arguments); 41450 this.addresses = []; 41451 this.data = null; 41452 this.allowNewAddress = false;
41453 this.size = "sm"; 41454 this.defaultCountry = "FR"; 41455 this.formDataProvider = ""; 41456 this.handleAddressChange = () => { 41457 const formData = dp(this.formDataProvider).get(); 41458 const address = { 41459 address: formData?.address, 41460 address2: formData?.address2, 41461 postalCode: formData?.postalCode, 41462 city: formData?.city, 41463 country: formData?.country 41464 }; 41465 this.selectedId = this.generateAddressId(address); 41466 }; 41467 } 41468 connectedCallback() { 41469 this.dataProvider = this.getAncestorAttributeValue("cartProvider") || "cart/current"; 41470 this.formDataProvider = HTML.getAncestorAttributeValue(this, "formdataprovider") || ""; 41471 dp(this.formDataProvider)?.address.onAssign(this.handleAddressChange); 41472 dp(this.formDataProvider)?.address2.onAssign(this.handleAddressChange); 41473 dp(this.formDataProvider)?.postalCode.onAssign(this.handleAddressChange); 41474 dp(this.formDataProvider)?.city.onAssign(this.handleAddressChange); 41475 dp(this.formDataProvider)?.country.onAssign(this.handleAddressChange); 41476 super.connectedCallback(); 41477 } 41478 disconnectedCallback() { 41479 dp(this.formDataProvider)?.address.offAssign(this.handleAddressChange); 41480 dp(this.formDataProvider)?.address2.offAssign(this.handleAddressChange); 41481 dp(this.formDataProvider)?.postalCode.offAssign(this.handleAddressChange); 41482 dp(this.formDataProvider)?.city.offAssign(this.handleAddressChange); 41483 dp(this.formDataProvider)?.country.offAssign(this.handleAddressChange); 41484 super.disconnectedCallback(); 41485 } 41486 willUpdate(_changedProperties) { 41487 if (_changedProperties.has("data")) { 41488 this.addresses = this.getAddressSuggestion(this.data?.items || [], this.data?.linked_subscriptions || []); 41489 } 41490 if (_changedProperties.has("addresses")) { 41491 this.defaultCountry = this.addresses[0]?.country?.toUpperCase() || "FR"; 41492 } 41493 super.willUpdate(_changedProperties); 41494 } 41495 getAddressSuggestion(items, linked_subscriptions) { 41496 const subscriptions = getCartSubscriptions({ items, linked_subscriptions }); 41497 const addresses = []; 41498 subscriptions.forEach((subscription) => { 41499 if (subscription.owner?.address) { 41500 const owner = subscription.owner; 41501 const address = owner.address || ""; 41502 const address2 = owner.address2 || ""; 41503 const postalCode = owner.postalCode || ""; 41504 const city = owner.city || ""; 41505 const country = owner.country || "FR"; 41506 const id = this.generateAddressId({ address, address2, postalCode, city, country }); 41507 if (addresses.find((a2) => a2.id === id)) return; 41508 addresses.push({ 41509 id, 41510 address, 41511 address2, 41512 postalCode, 41513 city, 41514 country 41515 }); 41516 } 41517 }); 41518 return addresses; 41519 } 41520 generateAddressId(address) { 41521 let id = `${address.address}-${address.address2}-${address.postalCode}-${address.city}-${address.country}`; 41522 id = id.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(); 41523 return id; 41524 } 41525 selectAddress(address) { 41526 this.selectedId = address.id; 41527 const event = new CustomEvent("select", { detail: address }); 41528 this.dispatchEvent(event); 41529 } 41530 publicCountry(region) {
41531 const regionUpper = region?.toUpperCase(); 41532 if (!regionUpper) return ""; 41533 const locale = new Intl.DisplayNames("fr-FR", { type: "region", style: "short" }); 41534 const nomTraduit = locale.of(regionUpper); 41535 return nomTraduit; 41536 } 41537 render() { 41538 if (!this.addresses || this.addresses.length === 0) return A$1; 41539 return b$1`<div class="grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-2"> 41540 ${c$1( 41541 this.addresses, 41542 (address) => address.id, 41543 (address) => b$1`<sonic-button 41544 ?active=${this.selectedId === address.id} 41545 variant="outline" 41546 size=${this.size} 41547 @click=${() => this.selectAddress(address)} 41548 > 41549 <div class="text-left min-h-12 py-3 min-w-0"> 41550 <div class="truncate leading-tight">${address.address}</div> 41551 <div class="truncate leading-tight">${address.address2}</div> 41552 <div class="mt-2 truncate leading-tight"><b class="mr-1">${address.postalCode}</b> ${address.city}</div> 41553 <div class="truncate leading-tight"> 41554 ${address.country ? `â ${this.publicCountry(address.country)}` : ""} 41555 </div> 41556 </div> 41557 </sonic-button>` 41558 )} 41559 ${this.allowNewAddress ? b$1` 41560 <sonic-button 41561 variant="outline" 41562 size=${this.size} 41563 ?active=${this.selectedId === "new"} 41564 @click=${() => this.selectAddress({ 41565 id: "new", 41566 address: "", 41567 address2: "", 41568 postalCode: "", 41569 city: "", 41570 country: this.defaultCountry 41571 })} 41572 > 41573 <div class="font-bold"> 41574 <sonic-icon name="sparkles" library="custom" size="sm"></sonic-icon> 41575 Nouvelle adresse 41576 </div> 41577 </sonic-button> 41578 ` : A$1} 41579 </div>`; 41580 } 41581 }; 41582 AddressSuggestion.styles = [ 41583 tailwind, 41584 i$9` 41585 :host { 41586 display: block; 41587 } 41588 ` 41589 ]; 41590 __decorateClass$28([ 41591 r$5() 41592 ], AddressSuggestion.prototype, "addresses", 2); 41593 __decorateClass$28([ 41594 r$5() 41595 ], AddressSuggestion.prototype, "data", 2); 41596 __decorateClass$28([ 41597 n$5({ type: String }) 41598 ], AddressSuggestion.prototype, "selectedId", 2); 41599 __decorateClass$28([ 41600 n$5({ type: Boolean }) 41601 ], AddressSuggestion.prototype, "allowNewAddress", 2); 41602 __decorateClass$28([ 41603 n$5({ type: String }) 41604 ], AddressSuggestion.prototype, "size", 2); 41605 __decorateClass$28([ 41606 n$5() 41607 ], AddressSuggestion.prototype, "defaultCountry", 2); 41608 AddressSuggestion = __decorateClass$28([ 41609 t$3("sonic-address-suggestion") 41610 ], AddressSuggestion); 41611 var __decorate$7 = function(decorators, target, key, desc) { 41612 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 41613 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 41614 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; 41615 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 41616 }; 41617 const tagName$1n = "sonic-form-layout"; 41618 let FormLayout = class FormLayout extends Subscriber$1(i$6) { 41619 constructor() { 41620 super(...arguments); 41621 this._resizeController = new h$1(this, {}); 41622 this.oneFormElement = false; 41623 } 41624 onSlotChange() { 41625 let elements = this.slottedElements; 41626 const formElementColumns = ["sonic-input", "sonic-select", "sonic-input-autocomplete", ".form-item-container"]; 41627 elements = elements.filter((elt) => formElementColumns.includes(elt.nodeName.toLowerCase())); 41628 this.oneFormElement = elements.length == 1; 41629 } 41630 render() { 41631 const classes2 = { 41632 "cq--md": this.offsetWidth > 440, 41633 "one-form-element": this.oneFormElement 41634 }; 41635 return b$1`<div class=${e(classes2)}> 41636 <slot @slotchange=${this.onSlotChange}></slot> 41637 </div>`; 41638 } 41639 }; 41640 FormLayout.styles = [ 41641 i$9` 41642 :host { 41643 display: block; 41644 } 41645 41646 div { 41647 display: grid; 41648 grid-gap: 1.5rem; 41649 align-items: flex-start; 41650 } 41651 41652 .cq--md { 41653 grid-gap: 1.75rem; 41654 grid-template-columns: repeat(2, minmax(0, 1fr)); 41655 } 41656 .one-form-element { 41657 grid-template-columns: 1fr; 41658 } 41659 /*::slotted(sonic-radio), 41660 ::slotted(sonic-checkbox), 41661 ::slotted(sonic-form-actions),
41662 ::slotted(sonic-divider), 41663 ::slotted(sonic-textarea) { 41664 grid-column: 1 / -1; 41665 }*/ 41666 ::slotted(sonic-submit) { 41667 display: contents; 41668 } 41669 ::slotted(:not(sonic-input):not(sonic-select):not(sonic-input-autocomplete):not(.form-item-container)) { 41670 grid-column: 1 / -1; 41671 } 41672 41673 ::slotted(sonic-divider) { 41674 --sc-divider-my: 0; 41675 } 41676 ` 41677 ]; 41678 __decorate$7([ 41679 o$8({ flatten: true }) 41680 ], FormLayout.prototype, "slottedElements", void 0); 41681 __decorate$7([ 41682 n$5({ type: Boolean }) 41683 ], FormLayout.prototype, "oneFormElement", void 0); 41684 FormLayout = __decorate$7([ 41685 t$3(tagName$1n) 41686 ], FormLayout); 41687 var __defProp$25 = Object.defineProperty; 41688 var __getOwnPropDesc$27 = Object.getOwnPropertyDescriptor; 41689 var __decorateClass$27 = (decorators, target, key, kind) => { 41690 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$27(target, key) : target; 41691 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 41692 if (decorator = decorators[i2]) 41693 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 41694 if (kind && result) __defProp$25(target, key, result); 41695 return result; 41696 }; 41697 let SonicCountry = class extends Subscriber$1(i$6) { 41698 constructor() { 41699 super(...arguments); 41700 this.countries = []; 41701 this.required = false; 41702 this.formDataProvider = ""; 41703 this.handleSetCountry = (value) => { 41704 const country = this.countries.find((country2) => country2.id.toString() == value); 41705 if (!country) return; 41706 const event = new CustomEvent("selected", { 41707 detail: { 41708 country 41709 } 41710 }); 41711 this.dispatchEvent(event); 41712 }; 41713 } 41714 connectedCallback() { 41715 const lang = document.documentElement.lang.split("-")[0]; 41716 const safeLang = ["fr", "en", "nl", "de"].includes(lang) ? lang : "fr"; 41717 this.getCountries(safeLang); 41718 const FormDataProvider = this.getAncestorAttributeValue("formDataProvider"); 41719 this.formDataProvider = FormDataProvider; 41720 dp(this.formDataProvider).country.onAssign(this.handleSetCountry); 41721 super.connectedCallback(); 41722 } 41723 disconnectedCallback() { 41724 dp(this.formDataProvider).country.offAssign(this.handleSetCountry); 41725 super.disconnectedCallback(); 41726 } 41727 // retourne la liste des pays depuis le fichier json local dans la langue spécifiée 41728 // et la stocke dans la propriété countries 41729 getCountries(lang = "fr") { 41730 fetch("/sites/all/modules/la-billetterie/lib/Ssks/LaBilletterie/Core/Util/data/countries_" + lang + ".json").then((response) => response.json()).then((data) => { 41731 this.addLaReunion(data); 41732 this.countries = data; 41733 }).then(() => { 41734 this.setDefaultCountry(); 41735 }).catch((error) => { 41736 console.error("Error:", error); 41737 }); 41738 } 41739 addLaReunion(countries) { 41740 countries.push({ 41741 id: 999, 41742 alpha2: "RE", 41743 alpha3: "REU", 41744 name: "La Réunion", 41745 subregion: "La Réunion" 41746 }); 41747 } 41748 setDefaultCountry() { 41749 const initialCountry = dp(this.formDataProvider).country.get(); 41750 if (!initialCountry) { 41751 dp(this.formDataProvider).country.set("FR"); 41752 } 41753 } 41754 countriesToOptions(countries) { 41755 return countries.map((country) => ({ 41756 value: country.alpha2.toUpperCase(), 41757 wording: country.name 41758 })); 41759 } 41760 render() { 41761 if (!this.countries || this.countries.length === 0) return A$1; 41762 return b$1` 41763 <sonic-select label="${t("pays")}" name="country" .options=${this.countriesToOptions(this.countries)}> 41764 ${requiredMark(this.required)} 41765 </sonic-select> 41766 `; 41767 } 41768 }; 41769 SonicCountry.styles = [tailwind]; 41770 __decorateClass$27([ 41771 r$5() 41772 ], SonicCountry.prototype, "countries", 2); 41773 __decorateClass$27([ 41774 n$5({ type: Boolean }) 41775 ], SonicCountry.prototype, "required", 2); 41776 SonicCountry = __decorateClass$27([ 41777 t$3("sonic-country") 41778 ], SonicCountry); 41779 var __defProp$24 = Object.defineProperty; 41780 var __getOwnPropDesc$26 = Object.getOwnPropertyDescriptor; 41781 var __decorateClass$26 = (decorators, target, key, kind) => { 41782 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$26(target, key) : target; 41783 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 41784 if (decorator = decorators[i2]) 41785 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 41786 if (kind && result) __defProp$24(target, key, result); 41787 return result; 41788 }; 41789 let AddressFieldset = class extends i$6 { 41790 constructor() { 41791 super(...arguments); 41792 this.formDataProvider = ""; 41793 this.noSuggestion = false;
41794 this.handleCountryChange = () => { 41795 const formData = dp(this.formDataProvider).get(); 41796 this.noSuggestion = formData?.country && formData?.country !== "FR"; 41797 }; 41798 this.setCity = (e2) => { 41799 if (this.formConfiguration?.city?.enabled === false) return; 41800 const result = e2.detail; 41801 const city = result.city || result.names[0]; 41802 dp(this.formDataProvider).city.set(city); 41803 }; 41804 this.setPostalCode = (e2) => { 41805 if (this.formConfiguration?.postalCode?.enabled === false) return; 41806 const result = e2.detail; 41807 dp(this.formDataProvider).postalCode.set(result.zipcode); 41808 }; 41809 this.setCityAndPostalCode = (e2) => { 41810 this.setCity(e2); 41811 this.setPostalCode(e2); 41812 }; 41813 this.handleAddressSelect = (e2) => { 41814 const address = e2.detail; 41815 dp(this.formDataProvider).address.set(address.address || ""); 41816 dp(this.formDataProvider).address2.set(address.address2 || ""); 41817 dp(this.formDataProvider).postalCode.set(address.postalCode || ""); 41818 dp(this.formDataProvider).city.set(address.city || ""); 41819 dp(this.formDataProvider).country.set(address.country || "FR"); 41820 }; 41821 } 41822 connectedCallback() { 41823 this.formDataProvider = HTML.getAncestorAttributeValue(this, "formdataprovider") || ""; 41824 dp(this.formDataProvider)?.country.onAssign(this.handleCountryChange); 41825 super.connectedCallback(); 41826 } 41827 disconnectedCallback() { 41828 dp(this.formDataProvider)?.country.offAssign(this.handleCountryChange); 41829 super.disconnectedCallback(); 41830 } 41831 isRequired(field) { 41832 if (this.appType === "counter") { 41833 return false; 41834 } else if (this.appType === "customer") { 41835 return field?.required || false; 41836 } 41837 return false; 41838 } 41839 render() { 41840 const { country, address, address2, postalCode, city } = this.formConfiguration || {}; 41841 if (!address?.enabled && !address2?.enabled && !postalCode?.enabled && !city?.enabled && !country?.enabled) 41842 return A$1; 41843 return b$1` 41844 <sonic-fieldset iconLibrary="custom" iconName="location-dot" label="${t("coordonnes")}"> 41845 <sonic-address-suggestion 41846 allowNewAddress 41847 class="mb-6" 41848 @select=${this.handleAddressSelect} 41849 ></sonic-address-suggestion> 41850 41851 <sonic-form-layout> 41852 ${country?.enabled ? b$1`<sonic-country ?required=${this.isRequired(country)} size="sm"></sonic-country> 41853 <sonic-divider></sonic-divider>` : A$1} 41854 ${address?.enabled ? b$1` 41855 <div class="form-item-container"> 41856 <sonic-geo-autocomplete 41857 size="sm" 41858 autocomplete=${autocompleteValue("address-line1")} 41859 ?noSuggestion="${this.noSuggestion}" 41860 type="address" 41861 name="address" 41862 label=${t("adresse")} 41863 ?required=${this.isRequired(address)} 41864 @select=${(e2) => this.setCityAndPostalCode(e2)} 41865 ></sonic-geo-autocomplete> 41866 </div> 41867 ` : A$1} 41868 ${address2?.enabled ? b$1` 41869 <div class="form-item-container"> 41870 <sonic-input 41871 size="sm" 41872 name="address2" 41873 label=${t("adresse_2")} 41874 autocomplete=${autocompleteValue("address-line2", this.appType)} 41875 ></sonic-input> 41876 </div> 41877 ` : A$1} 41878 ${postalCode?.enabled ? b$1` 41879 <div class="form-item-container col-start-1"> 41880 <sonic-geo-autocomplete 41881 size="sm" 41882 autocomplete=${autocompleteValue("postal-code", this.appType)} 41883 ?noSuggestion="$this.noSuggestion}" 41884 type="zipcode" 41885 name="postalCode" 41886 label="${t("code_postal")}" 41887 ?required=${this.isRequired(postalCode)} 41888 @select=${(e2) => this.setCity(e2)} 41889 ></sonic-geo-autocomplete> 41890 </div> 41891 ` : A$1} 41892 ${city?.enabled ? b$1` 41893 <div class="form-item-container"> 41894 <sonic-geo-autocomplete 41895 size="sm" 41896 autocomplete=${autocompleteValue("city", this.appType)} 41897 ?noSuggestion="$this.noSuggestion}" 41898 type="city" 41899 name="city" 41900 label="${t("ville")}" 41901 ?required=${this.isRequired(city)} 41902 @select=${(e2) => this.setPostalCode(e2)} 41903 ></sonic-geo-autocomplete> 41904 </div> 41905 ` : A$1} 41906 </sonic-form-layout> 41907 </sonic-fieldset> 41908 `; 41909 } 41910 }; 41911 AddressFieldset.styles = [tailwind]; 41912 __decorateClass$26([ 41913 n$5({ type: Object }) 41914 ], AddressFieldset.prototype, "formConfiguration", 2); 41915 __decorateClass$26([ 41916 c({ context: appType, subscribe: true }), 41917 r$5() 41918 ], AddressFieldset.prototype, "appType", 2); 41919 __decorateClass$26([ 41920 n$5({ type: String }) 41921 ], AddressFieldset.prototype, "formDataProvider", 2); 41922 __decorateClass$26([ 41923 r$5() 41924 ], AddressFieldset.prototype, "noSuggestion", 2); 41925 AddressFieldset = __decorateClass$26([ 41926 t$3("sonic-address-fieldset") 41927 ], AddressFieldset); 41928 var __defProp$23 = Object.defineProperty; 41929 var __getOwnPropDesc$25 = Object.getOwnPropertyDescriptor; 41930 var __decorateClass$25 = (decorators, target, key, kind) => { 41931 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$25(target, key) : target; 41932 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 41933 if (decorator = decorators[i2]) 41934 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 41935 if (kind && result) __defProp$23(target, key, result); 41936 return result; 41937 }; 41938 let SonicDragAndDrop = class extends FormElement(Subscriber(i$6)) { 41939 constructor() { 41940 super(...arguments); 41941 this.multiple = false;
41942 this.withoutText = false; 41943 this.displayFileName = false; 41944 this.previewIndex = 0; 41945 this.size = "md"; 41946 this.dropState = "default"; 41947 this.files = []; 41948 this.filesWithPreview = []; 41949 this.handleDrop = async (e2) => { 41950 if (this.dropState === "error") return this.dropState = "default"; 41951 this.preventDefaults(e2); 41952 this.dropState = "default"; 41953 const droppedFiles = Array.from(e2.dataTransfer?.files || []); 41954 const validFiles = droppedFiles.filter(this.isValidFileType); 41955 if (validFiles.length > 0) { 41956 this.files = validFiles; 41957 } 41958 return; 41959 }; 41960 this.previewFiles = async (files) => { 41961 if (!files || files.length === 0) return Promise.resolve([]); 41962 const readFiles = files.filter(this.isValidFileType).map((file) => { 41963 return new Promise((resolve, reject) => { 41964 const reader = new FileReader(); 41965 reader.onloadend = () => { 41966 const previewType = this.getPreviewType(file); 41967 if (reader.error) { 41968 reject(reader.error); 41969 return; 41970 } 41971 if (!reader.result) { 41972 resolve({ 41973 file 41974 }); 41975 return; 41976 } 41977 resolve({ 41978 file, 41979 result: reader.result, 41980 previewType 41981 }); 41982 }; 41983 reader.onerror = () => { 41984 reject(`Failed to read file: ${file.name}`); 41985 }; 41986 reader.readAsDataURL(file); 41987 }); 41988 }); 41989 const filesWithPreview = await Promise.all(readFiles); 41990 this.dispatchEvent( 41991 new CustomEvent("files-change", { 41992 detail: { 41993 files: this.filesWithPreview 41994 }, 41995 bubbles: true, 41996 composed: true 41997 }) 41998 ); 41999 return filesWithPreview; 42000 }; 42001 this.versionHash = ""; 42002 this.isValidFileType = (file) => { 42003 if (!this.accept) return true; 42004 return this.accept.includes(file.type); 42005 }; 42006 this.getPreviewType = (file) => { 42007 if (file.type.startsWith("image/")) return "image"; 42008 if (file.type.startsWith("application/pdf")) return "pdf"; 42009 return "file"; 42010 }; 42011 this.handleDragOver = (e2) => { 42012 e2.preventDefault(); 42013 e2.stopPropagation(); 42014 const isValidFileType = Array.from(e2.dataTransfer?.items || []).every((item) => { 42015 if (!this.accept) return true; 42016 return this.accept.includes(item.type); 42017 }); 42018 this.dropState = isValidFileType ? "success" : "error"; 42019 }; 42020 this.handleDragLeave = (e2) => { 42021 e2.preventDefault(); 42022 e2.stopPropagation(); 42023 this.dropState = "default"; 42024 }; 42025 } 42026 getLocalizedButtonText() { 42027 const language = navigator.language || navigator.languages[0]; 42028 const translations = { 42029 fr: "Choisir un fichier", 42030 en: "Choose a file", 42031 es: "Elegir un archivo", 42032 de: "Datei auswählen", 42033 it: "Scegli un file", 42034 pt: "Escolher um arquivo", 42035 nl: "Kies een bestand", 42036 pl: "Wybierz plik", 42037 ru: "ÐÑбеÑиÑе Ñайл", 42038 zh: "éæ©æä»¶", 42039 ja: "ãã¡ã¤ã«ã鏿", 42040 ko: "íì¼ ì í", 42041 ar: "اختر Ù ÙÙÙØ§", 42042 default: "Choose a file" 42043 }; 42044 const mainLanguage = language.split("-")[0]; 42045 return translations[mainLanguage] || translations["default"]; 42046 } 42047 preventDefaults(e2) { 42048 e2.preventDefault(); 42049 e2.stopPropagation(); 42050 } 42051 async willUpdate(_changedProperties) { 42052 if (_changedProperties.has("files")) { 42053 if (this.fileInput) { 42054 this.fileInput.files = this.createFileList(this.files); 42055 } 42056 this.filesWithPreview = await this.previewFiles(this.files); 42057 this.updateDataValue(); 42058 } 42059 super.willUpdate(_changedProperties); 42060 } 42061 setFormPublisherValue(_value) { 42062 const filesWithPreview = this.filesWithPreview || []; 42063 const hash = this.fileHash(filesWithPreview.map((file) => file.file)); 42064 if (hash === this.versionHash) { 42065 return; 42066 } 42067 this.versionHash = hash; 42068 const valueToSet = filesWithPreview.map((file) => { 42069 return { 42070 name: file.file.name, 42071 type: file.file.type, 42072 size: file.file.size, 42073 data: file.result || "" 42074 }; 42075 }); 42076 traverseDotNotation(this.getFormPublisher(), this.name).set(valueToSet); 42077 } 42078 /** 42079 * Note: this is not a secure hash, it is used to compare the files with the files in the form publisher 42080 * Create a hash of the files 42081 * @param files tu use to compute the hash 42082 * @returns hash of the files 42083 */ 42084 fileHash(files) { 42085 return files.map((file) => { 42086 return file.name + file.type + file.size; 42087 }).join("\n"); 42088 } 42089 /** 42090 * Create a file list from the files 42091 * Its used tu update the file input with a compatible file list 42092 * @param files to create the file list from 42093 * @returns file list 42094 */ 42095 createFileList(files) { 42096 const dataTransfer = new DataTransfer();
42097 files.forEach((file) => dataTransfer.items.add(file)); 42098 return dataTransfer.files; 42099 } 42100 /** 42101 * Converts files from the publisher to the component propertiesÅ 42102 * @param value to set the files from 42103 */ 42104 setFormValueFromPublisher(value) { 42105 const files = value || []; 42106 const hash = this.fileHash(files); 42107 const hash2 = this.fileHash(this.files); 42108 if (hash === hash2) { 42109 return; 42110 } 42111 const result = files.map((file) => { 42112 return this.base64ToFile(file.data || "", file.name || "", file.type || ""); 42113 }); 42114 this.value = files[0]?.name ?? ""; 42115 this.files = result; 42116 } 42117 /** 42118 * Converts a base64 string to a file 42119 * @param base64 to convert to a file 42120 * @param filename to set the file name 42121 * @param mimeType to set the file type 42122 * @returns file 42123 */ 42124 base64ToFile(base64, filename, mimeType) { 42125 const byteString = atob(base64.split(",")[1]); 42126 const ab = new ArrayBuffer(byteString.length); 42127 const ia = new Uint8Array(ab); 42128 for (let i2 = 0; i2 < byteString.length; i2++) { 42129 ia[i2] = byteString.charCodeAt(i2); 42130 } 42131 return new File([ab], filename, { type: mimeType }); 42132 } 42133 removeItem(index) { 42134 this.files = this.files.filter((_2, i2) => i2 !== index); 42135 } 42136 handleFileInput(event) { 42137 const input = event?.target; 42138 if (this.multiple) { 42139 const newFiles = input.files ? Array.from(input.files) : []; 42140 this.files = [...this.files || [], ...newFiles]; 42141 } else { 42142 const newFile = input.files?.[0]; 42143 if (newFile) { 42144 this.files = [newFile]; 42145 } 42146 } 42147 } 42148 handleClick() { 42149 const fileInput = this.fileInput; 42150 fileInput?.click(); 42151 } 42152 showModal(item) { 42153 if (!item.result) return; 42154 this._modal = Modal.create({ 42155 title: `${item.file.name}`, 42156 content: b$1`<img 42157 src="${o$4(item.result)}" 42158 style="max-width: 100%; 42159 object-fit: contain; 42160 display: block; 42161 " 42162 />`, 42163 removeOnHide: true 42164 }); 42165 } 42166 switchSize() { 42167 switch (this.size) { 42168 case "sm": 42169 return "size-[6rem]"; 42170 case "md": 42171 return "size-[10rem]"; 42172 case "lg": 42173 return "size-[15rem]"; 42174 case "custom": 42175 return `${this.customSize}`; 42176 default: 42177 return "size-[10rem]"; 42178 } 42179 } 42180 render() { 42181 return b$1` 42182 ${this.label ? b$1`<label for="file-input" class="form-label">${this.label}</label>` : A$1} 42183 42184 <input 42185 type="file" 42186 id="file-input" 42187 ?multiple=${this.multiple} 42188 hidden 42189 @change=${this.handleFileInput} 42190 accept=${o$4(this.accept?.join(","))} 42191 /> 42192 42193 <div class="flex gap-x-5 gap-y-2 flex-wrap"> 42194 <div 42195 id="drop-area" 42196 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`} 42197 @click=${this.handleClick} 42198 @dragover=${this.handleDragOver} 42199 @dragleave=${this.handleDragLeave} 42200 @drop=${this.handleDrop} 42201 > 42202 <sonic-icon name="file-import" library="custom" size="3xl"></sonic-icon> 42203 42204 <div class="text-sm mt-2 leading-tight">${this.getLocalizedButtonText()}</div> 42205 </div> 42206 42207 ${this.filesWithPreview?.length > 0 ? o$1(this.filesWithPreview, (item, index) => { 42208 return b$1` 42209 <div 42210 class=${`relative ${this.switchSize()} aspect-square`} 42211 ${F({ 42212 keyframeOptions: { 42213 duration: 250, 42214 easing: "linear" 42215 }, 42216 in: [{ opacity: 0 }], 42217 stabilizeOut: true 42218 })} 42219 > 42220 ${item.previewType === "image" ? b$1` 42221 <sonic-button 42222 ${F({ 42223 keyframeOptions: { 42224 duration: 250, 42225 easing: `cubic-bezier(0.250, 0.250, 0.420, 1.225)` 42226 }, 42227 in: [{ transform: "scale(.9) translateY(5px)" }] 42228 })} 42229 @click=${() => this.showModal(item)} 42230 variant="unstyled" 42231 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 " 42232 > 42233 <img 42234 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 " 42235 src=${o$4(item.result)} 42236 alt="" 42237 /> 42238 </sonic-button> 42239 ` : A$1} 42240 ${item.previewType === "pdf" ? b$1` 42241 <embed 42242 src=${o$4(item.result)} 42243 type="application/pdf" 42244 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" 42245 /> 42246 ` : A$1} 42247 ${item.previewType === "file" ? b$1` 42248 <div 42249 class="size-full flex flex-col items-center justify-center border bg-content text-base rounded-md p-4" 42250 > 42251 <sonic-icon library="custom" name="file" variant="default" class="text-4xl mb-2"></sonic-icon> 42252 <div class="text-sm text-neutral-600 text-center break-words max-w-full"> 42253 ${item.file.name} 42254 </div> 42255 </div> 42256 ` : A$1} 42257 42258 <sonic-button 42259 @click=${() => this.removeItem(index)} 42260 shape="circle" 42261 size="2xs" 42262 class="absolute top-1 right-1" 42263 type="danger" 42264 ><sonic-icon library="custom" name="x" variant="default"></sonic-icon 42265 ></sonic-button> 42266 </div> 42267 `; 42268 }) : A$1} 42269 </div> 42270 ${this.description ? b$1`<div class="form-description max-w-[300px] mt-1 text-xs">${this.description}</div>` : A$1} 42271 ${this.alertMessage ? b$1`<sonic-alert class="mt-6" status="info" background dismissible>${this.alertMessage}</sonic-alert>` : A$1} 42272 `; 42273 } 42274 }; 42275 SonicDragAndDrop.styles = [ 42276 label, 42277 description, 42278 tailwind, 42279 i$9` 42280 :host([dropState="default"]) #drop-area { 42281 --_color: var(--sc-base-400); 42282 } 42283 42284 :host([dropState="success"]) #drop-area { 42285 --_color: var(--sc-success); 42286 } 42287 :host([dropState="error"]) #drop-area { 42288 --_color: var(--sc-danger); 42289 } 42290 #drop-area { 42291 color: var(--_color); 42292 } 42293 ` 42294 ]; 42295 __decorateClass$25([ 42296 n$5({ type: Boolean, reflect: true }) 42297 ], SonicDragAndDrop.prototype, "multiple", 2); 42298 __decorateClass$25([ 42299 n$5({ type: String }) 42300 ], SonicDragAndDrop.prototype, "label", 2); 42301 __decorateClass$25([ 42302 n$5({ type: String }) 42303 ], SonicDragAndDrop.prototype, "description", 2); 42304 __decorateClass$25([ 42305 n$5({ type: String }) 42306 ], SonicDragAndDrop.prototype, "customSize", 2); 42307 __decorateClass$25([ 42308 n$5({ type: Array }) 42309 ], SonicDragAndDrop.prototype, "accept", 2); 42310 __decorateClass$25([ 42311 n$5({ type: Boolean }) 42312 ], SonicDragAndDrop.prototype, "withoutText", 2); 42313 __decorateClass$25([ 42314 n$5({ type: Boolean }) 42315 ], SonicDragAndDrop.prototype, "displayFileName", 2); 42316 __decorateClass$25([ 42317 e$7("#file-input") 42318 ], SonicDragAndDrop.prototype, "fileInput", 2); 42319 __decorateClass$25([ 42320 e$7("#drop-area") 42321 ], SonicDragAndDrop.prototype, "dropArea", 2); 42322 __decorateClass$25([ 42323 e$7("#preview-container") 42324 ], SonicDragAndDrop.prototype, "previewContainer", 2); 42325 __decorateClass$25([ 42326 r$5() 42327 ], SonicDragAndDrop.prototype, "previewIndex", 2); 42328 __decorateClass$25([ 42329 r$5() 42330 ], SonicDragAndDrop.prototype, "alertMessage", 2); 42331 __decorateClass$25([ 42332 n$5({ type: String }) 42333 ], SonicDragAndDrop.prototype, "size", 2); 42334 __decorateClass$25([ 42335 n$5({ type: String, reflect: true }) 42336 ], SonicDragAndDrop.prototype, "dropState", 2); 42337 __decorateClass$25([ 42338 r$5() 42339 ], SonicDragAndDrop.prototype, "_modal", 2); 42340 __decorateClass$25([ 42341 n$5({ type: Array }) 42342 ], SonicDragAndDrop.prototype, "files", 2); 42343 __decorateClass$25([ 42344 r$5() 42345 ], SonicDragAndDrop.prototype, "filesWithPreview", 2); 42346 SonicDragAndDrop = __decorateClass$25([ 42347 t$3("sonic-file-upload") 42348 ], SonicDragAndDrop); 42349 var __defProp$22 = Object.defineProperty; 42350 var __getOwnPropDesc$24 = Object.getOwnPropertyDescriptor; 42351 var __decorateClass$24 = (decorators, target, key, kind) => { 42352 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$24(target, key) : target; 42353 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 42354 if (decorator = decorators[i2]) 42355 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 42356 if (kind && result) __defProp$22(target, key, result); 42357 return result; 42358 }; 42359 let instanceCounter$7 = 0; 42360 const tagName$1m = "sonic-subscription-renew-form"; 42361 let SubscriptionRenewFrom = class extends i$6 { 42362 constructor() { 42363 super(...arguments); 42364 this.formDataProvider = "subscriptionRenewFrom" + instanceCounter$7++; 42365 this.renewFromForm = false;
42366 this.handleSubscriptionSelect = (e2) => { 42367 const subscription = e2.detail.subscription; 42368 const renewFrom = { id: Number(subscription.id), number: subscription.number, email: subscription.owner?.email }; 42369 this.updateRenewFrom(renewFrom); 42370 }; 42371 } 42372 connectedCallback() { 42373 if (!this.cartProvider) { 42374 this.cartProvider = HTML$1.getAncestorAttributeValue(this, "cartProvider") || ""; 42375 } 42376 super.connectedCallback(); 42377 } 42378 willUpdate(_changedProperties) { 42379 if (_changedProperties.has("lineItem")) { 42380 this.renewFrom = this.lineItem?.renew_from || void 0; 42381 } 42382 super.willUpdate(_changedProperties); 42383 } 42384 render() { 42385 return b$1` 42386 <sonic-fieldset 42387 class="my-8" 42388 label="${t("LIB_Renouvellement")}" 42389 iconLibrary="custom" 42390 iconName="arrows-rotate" 42391 class="@container" 42392 > 42393 <div class="@container"> 42394 ${this.lineItem?.renew_from?.id ? b$1`<div class="flex items-start gap-4 rounded-md p-4 bg-neutral-50"> 42395 <sonic-fetch 42396 dataProvider="currentRenew" 42397 endPoint="/subscriptions/${this.lineItem.renew_from.id}?features[]=owner&features[]=buyer&features[]=price" 42398 > 42399 <sonic-subscription-info subDataProvider="data" class="grow min-w-0"></sonic-subscription-info 42400 ></sonic-fetch> 42401 <sonic-tooltip label=${t("unlink")} class="ml-auto"> 42402 <sonic-button 42403 @click=${() => this.updateRenewFrom({ id: 0, number: "", email: "" })} 42404 shape="circle" 42405 size="md" 42406 variant="outline" 42407 > 42408 <sonic-icon library="custom" name="link-slash"></sonic-icon> 42409 </sonic-button> 42410 </sonic-tooltip> 42411 </div> 42412 ${this.renewWarning()} ` : b$1`${this.renewFromSelection()}`} 42413 </div> 42414 </sonic-fieldset> 42415 `; 42416 } 42417 renewWarning() { 42418 if (!this.currentRenew) return A$1; 42419 const date2 = this.currentRenew.expires_at; 42420 const now = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3); 42421 const isExpired = date2 && date2 < now; 42422 if (isExpired) return A$1; 42423 return b$1`<sonic-alert 42424 status="warning" 42425 size="sm" 42426 class="mt-2 animate-pulse" 42427 background 42428 label=${t("LIB_subscription_actuellement_toujours_valide")} 42429 > 42430 </sonic-alert>`; 42431 } 42432 renewFromSelection() { 42433 const isCustomerLoggedIn = !!this.userId; 42434 const displayTabs = this.appType === "counter" || isCustomerLoggedIn; 42435 const displaySearchSelector = displayTabs && !this.renewFromForm; 42436 const displayClassicForm = this.renewFromForm || !displayTabs; 42437 return b$1` 42438 ${displayTabs ? b$1` 42439 <div class="flex gap-3 mb-3" direction="row"> 42440 <button 42441 size="sm" 42442 variant="ghost" 42443 class=" ${!displaySearchSelector ? "text-neutral-500" : ""} hover:text-current" 42444 ?active=${displaySearchSelector} 42445 @click=${() => this.renewFromForm = false} 42446 > 42447 ${t("Rechercher")} 42448 </button> 42449 <sonic-divider vertical></sonic-divider> 42450 <button 42451 size="sm" 42452 variant="ghost" 42453 class=" ${!displayClassicForm ? "text-neutral-500" : ""} hover:text-current" 42454 ?active=${displayClassicForm} 42455 @click=${() => this.renewFromForm = true} 42456 > 42457 ${t("i_have_a_number")} 42458 </button> 42459 </div> 42460 ` : A$1} 42461 ${displaySearchSelector ? b$1` 42462 <sonic-subscription-selector 42463 @select=${this.handleSubscriptionSelect} 42464 canRenew 42465 searchStatus="all" 42466 ></sonic-subscription-selector> 42467 ` : b$1` 42468 <div class="flex flex-col @xl:flex-row gap-2" formDataProvider=${this.formDataProvider}> 42469 <sonic-input 42470 class="grow" 42471 name="email" 42472 id="email" 42473 data-aria-label=${t("email")} 42474 inlineContent 42475 placeholder="${t("email")}" 42476 > 42477 <sonic-icon name="envelope" library="custom" slot="prefix"></sonic-icon> 42478 </sonic-input> 42479 <sonic-input 42480 name="number" 42481 id="inputNumber" 42482 inlineContent 42483 data-aria-label=${t("numero_carte")} 42484 placeholder="${t("numero_carte")}" 42485 > 42486 <sonic-icon name="input-numeric" library="custom" slot="prefix"></sonic-icon> 42487 </sonic-input> 42488 <sonic-button 42489 @click=${() => { 42490 const renewFrom = dp(this.formDataProvider).get(); 42491 if (!renewFrom) return; 42492 this.updateRenewFrom(renewFrom); 42493 }} 42494 size="sm" 42495 type="success" 42496 > 42497 ${t("LIB_abo_renouveler")} 42498 </sonic-button> 42499 </div> 42500 `} 42501 `; 42502 } 42503 clearRenewFrom() { 42504 if (this.lineItem) { 42505 this.lineItem.renew_from = void 0; 42506 } 42507 dp(this.formDataProvider).set({ 42508 email: "", 42509 number: "" 42510 }); 42511 } 42512 async updateRenewFrom(renew_from) { 42513 let id = this.lineItem?.id; 42514 const cartProvider = this.cartProvider; 42515 if (!id || !cartProvider) return; 42516 await Cart.patchItems({ 42517 apiConfiguration: HTML$1.getApiConfiguration(this), 42518 cartProvider, 42519 query: { 42520 ids: [id] 42521 }, 42522 body: { 42523 renew_from 42524 } 42525 }).then((e2) => { 42526 if (e2 === "asRequested") { 42527 const isCleared = renew_from.id === 0; 42528 if (isCleared) { 42529 this.clearRenewFrom(); 42530 } 42531 if (!renew_from.number) { 42532 const event2 = new CustomEvent("renewFromRemove"); 42533 this.dispatchEvent(event2); 42534 return; 42535 }
42536 const subscription = this.getSubscriptionFromLineItemCart(renew_from.number); 42537 if (subscription) { 42538 this.renewFrom = { 42539 id: Number(subscription.renew_from?.id || 0), 42540 number: subscription.renew_from?.number || "", 42541 email: subscription.renew_from?.email 42542 }; 42543 } 42544 const event = new CustomEvent("renewFromSelect", { detail: { ...subscription } }); 42545 this.dispatchEvent(event); 42546 } 42547 }); 42548 } 42549 getSubscriptionFromLineItemCart(number) { 42550 if (!this.cartProvider) return; 42551 const cartItems = dp(this.cartProvider).data.items.get(); 42552 const subscription = cartItems.find((item) => item?.renew_from?.number === number); 42553 return subscription; 42554 } 42555 }; 42556 SubscriptionRenewFrom.styles = [tailwind]; 42557 __decorateClass$24([ 42558 n$5({ type: Object }) 42559 ], SubscriptionRenewFrom.prototype, "lineItem", 2); 42560 __decorateClass$24([ 42561 r$5() 42562 ], SubscriptionRenewFrom.prototype, "renewFrom", 2); 42563 __decorateClass$24([ 42564 n$5() 42565 ], SubscriptionRenewFrom.prototype, "cartProvider", 2); 42566 __decorateClass$24([ 42567 n$5() 42568 ], SubscriptionRenewFrom.prototype, "formDataProvider", 2); 42569 __decorateClass$24([ 42570 c({ context: appType, subscribe: true }), 42571 r$5() 42572 ], SubscriptionRenewFrom.prototype, "appType", 2); 42573 __decorateClass$24([ 42574 bind$1("user.id"), 42575 n$5({ type: String }) 42576 ], SubscriptionRenewFrom.prototype, "userId", 2); 42577 __decorateClass$24([ 42578 r$5() 42579 ], SubscriptionRenewFrom.prototype, "renewFromForm", 2); 42580 __decorateClass$24([ 42581 bind$1("currentRenew.data"), 42582 r$5() 42583 ], SubscriptionRenewFrom.prototype, "currentRenew", 2); 42584 SubscriptionRenewFrom = __decorateClass$24([ 42585 t$3(tagName$1m) 42586 ], SubscriptionRenewFrom); 42587 var __defProp$21 = Object.defineProperty; 42588 var __getOwnPropDesc$23 = Object.getOwnPropertyDescriptor; 42589 var __decorateClass$23 = (decorators, target, key, kind) => { 42590 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$23(target, key) : target; 42591 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 42592 if (decorator = decorators[i2]) 42593 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 42594 if (kind && result) __defProp$21(target, key, result); 42595 return result; 42596 }; 42597 const tagName$1l = "sonic-optins-form"; 42598 var OptinType = /* @__PURE__ */ ((OptinType2) => { 42599 OptinType2["SUBSCRIPTION"] = "subscription"; 42600 OptinType2["ACCOUNT"] = "account"; 42601 OptinType2["QUICK_PURCHASE"] = "quick_purchase"; 42602 OptinType2["COUNTER"] = "counter"; 42603 return OptinType2; 42604 })(OptinType || {}); 42605 let OptinsForm = class extends i$6 { 42606 constructor() { 42607 super(...arguments); 42608 this.optinsListType = []; 42609 this.optins = []; 42610 this.loading = false; 42611 } 42612 willUpdate(_changedProperties) { 42613 if (_changedProperties.has("optinsListType")) { 42614 this.loadMailingLists(this.optinsListType); 42615 } 42616 } 42617 render() { 42618 if (this.loading) { 42619 return b$1`<sonic-loader class="my-4" mode="inline"></sonic-loader>`; 42620 } 42621 if (!this.loading && this.optins.length === 0) { 42622 return A$1; 42623 } 42624 return b$1` 42625 <sonic-fieldset> 42626 <div class="flex flex-col gap-3"> 42627 ${this.loading ? b$1`<sonic-loader></sonic-loader>` : b$1` 42628 ${this.optins.map((optin) => { 42629 const id = optin.id; 42630 if (!id) return; 42631 return b$1` <sonic-checkbox type="checkbox" name="optins" value=${id}> 42632 ${optin?.description} 42633 </sonic-checkbox>`; 42634 })} 42635 `} 42636 </div> 42637 </sonic-fieldset> 42638 `; 42639 } 42640 async loadMailingLists(types) { 42641 this.loading = true; 42642 try { 42643 const searchParams = new URLSearchParams(); 42644 if (types?.includes( 42645 "counter" 42646 /* COUNTER */ 42647 )) { 42648 searchParams.set("is_counter_enabled", "true"); 42649 } else if (types?.includes( 42650 "quick_purchase" 42651 /* QUICK_PURCHASE */ 42652 )) { 42653 searchParams.set("is_quick_purchase_enabled", "true"); 42654 } else if (types?.includes( 42655 "subscription" 42656 /* SUBSCRIPTION */ 42657 )) { 42658 searchParams.set("is_subscription_enabled", "true"); 42659 } else if (types?.includes( 42660 "account" 42661 /* ACCOUNT */ 42662 )) { 42663 searchParams.set("is_customer_account_enabled", "true"); 42664 } 42665 const api2 = new API(HTML.getApiConfiguration(this)); 42666 const response = await api2.get("/optins?" + searchParams.toString()); 42667 if (response?.success) { 42668 this.optins = response.data; 42669 } else { 42670 this.optins = []; 42671 } 42672 } catch (error) { 42673 console.error("Failed to load optins:", error); 42674 } finally { 42675 this.loading = false;
42676 } 42677 } 42678 }; 42679 OptinsForm.styles = [tailwind]; 42680 __decorateClass$23([ 42681 n$5({ type: Array }) 42682 ], OptinsForm.prototype, "optinsListType", 2); 42683 __decorateClass$23([ 42684 r$5() 42685 ], OptinsForm.prototype, "optins", 2); 42686 __decorateClass$23([ 42687 r$5() 42688 ], OptinsForm.prototype, "loading", 2); 42689 OptinsForm = __decorateClass$23([ 42690 t$3(tagName$1l) 42691 ], OptinsForm); 42692 var __decorate$6 = function(decorators, target, key, desc) { 42693 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 42694 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 42695 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; 42696 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 42697 }; 42698 const tagName$1k = "sonic-switch"; 42699 let Switch = class Switch extends Checkbox { 42700 constructor() { 42701 super(); 42702 this.unique = true; 42703 } 42704 }; 42705 Switch.styles = [ 42706 Checkbox.styles, 42707 i$9` 42708 sonic-icon { 42709 display: none; 42710 } 42711 42712 .icon-container { 42713 display: flex; 42714 align-items: center; 42715 justify-content: center; 42716 vertical-align: baseline; 42717 position: relative; 42718 font-size: var(--sc-_fs, 1rem); 42719 } 42720 :host([disabled]) .icon-container { 42721 cursor: not-allowed; 42722 } 42723 42724 :host input { 42725 -webkit-appearance: none; 42726 -moz-appearance: none; 42727 appearance: none; 42728 flex-shrink: 0; 42729 width: 100%; 42730 width: calc(var(--sc-_fs) * 2.5) !important; 42731 cursor: pointer; 42732 border-radius: 1.75em; 42733 background-color: var(--sc-checkbox-bg); 42734 } 42735 42736 :host input:checked { 42737 -webkit-appearance: none; 42738 -moz-appearance: none; 42739 appearance: none; 42740 flex-shrink: 0; 42741 width: 100%; 42742 width: calc(var(--sc-_fs) * 2.5) !important; 42743 cursor: pointer; 42744 border-radius: 1.75em; 42745 border-color: var(--sc-primary, var(--sc-base-content, #fff)); 42746 background-color: var(--sc-primary, var(--sc-base-content, #fff)); 42747 } 42748 42749 .icon-container::after { 42750 content: ""; 42751 position: absolute; 42752 height: round(calc(95% - var(--sc-checkbox-border-width)), 1px); 42753 aspect-ratio: 1/1; 42754 border-radius: 50%; 42755 left: var(--sc-checkbox-border-width); 42756 top: 50%; 42757 transform: translateY(-50%); 42758 display: block; 42759 background-color: var(--sc-input-color, var(--sc-base-content, #000)); 42760 transition: all 0.2s ease-in-out; 42761 } 42762 42763 .icon-container:has(input:checked)::after { 42764 left: calc(100% - var(--sc-checkbox-border-width)); 42765 background-color: var(--sc-primary-content, var(--sc-base, #fff)); 42766 transform: translateX(-100%) translateY(-50%); 42767 } 42768 42769 input + sonic-icon { 42770 display: none; 42771 } 42772 ` 42773 ]; 42774 Switch = __decorate$6([ 42775 t$3(tagName$1k) 42776 ], Switch); 42777 var __defProp$20 = Object.defineProperty; 42778 var __getOwnPropDesc$22 = Object.getOwnPropertyDescriptor; 42779 var __decorateClass$22 = (decorators, target, key, kind) => { 42780 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$22(target, key) : target; 42781 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 42782 if (decorator = decorators[i2]) 42783 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 42784 if (kind && result) __defProp$20(target, key, result); 42785 return result; 42786 }; 42787 const CUSTOM_FORMS_KEY = "customFormValues"; 42788 const tagName$1j = "sonic-custom-form"; 42789 let SonicCustomForm$1 = class SonicCustomForm extends i$6 { 42790 render() { 42791 return b$1` 42792 <sonic-fieldset 42793 .label=${this.customForm?.label} 42794 iconLibrary="custom" 42795 iconName="circle-info" 42796 variant=${o$4(this.variant)} 42797 > 42798 ${this.customForm?.body ? b$1`<div class="mb-6">${this.customForm?.body}</div>` : A$1} 42799 <div class="grid grid-cols-1 gap-6"> 42800 ${c$1( 42801 this.customForm?.inputs || [], 42802 (input) => input.id, 42803 (input) => this.renderMatchingInput(input) 42804 )} 42805 </div> 42806 </sonic-fieldset> 42807 `; 42808 } 42809 renderMatchingInput(input) { 42810 switch (input.type) { 42811 case InputType.Text: 42812 return this.renderInput(input); 42813 case InputType.Textarea: 42814 return this.renderTextarea(input); 42815 case InputType.Radio: 42816 return this.renderRadio(input); 42817 case InputType.Checkbox: 42818 return this.renderCheckbox(input); 42819 case InputType.Checkboxes: 42820 return this.renderCheckboxes(input); 42821 case InputType.Select: 42822 return this.renderSelect(input); 42823 case InputType.File: 42824 return this.renderFile(input); 42825 case InputType.Email: 42826 return this.renderEmail(input); 42827 case InputType.Number: 42828 return this.renderNumber(input); 42829 case InputType.Tel: 42830 return this.renderTel(input); 42831 case InputType.Date: 42832 return this.renderDate(input); 42833 case InputType.TextSection: 42834 return this.renderTextZone(input); 42835 default: 42836 return A$1; 42837 } 42838 } 42839 getInputName(input) { 42840 return `${this.namePrefix ? `${this.namePrefix}.` : ""}${input.name}`; 42841 } 42842 renderInput(input) { 42843 return b$1`<sonic-input 42844 type="text" 42845 name=${this.getInputName(input)} 42846 label=${input.label} 42847 ?required=${input.required} 42848 placeholder=${o$4(input.placeholder)} 42849 >${requiredMark(input.required)}</sonic-input 42850 >`; 42851 } 42852 renderNumber(input) { 42853 return b$1`<sonic-input 42854 type="number" 42855 name=${this.getInputName(input)} 42856 label=${input.label} 42857 ?required=${input.required} 42858 placeholder=${input.placeholder || "0"} 42859 >${requiredMark(input.required)}</sonic-input 42860 >`; 42861 } 42862 renderTextarea(input) { 42863 return b$1`<sonic-textarea 42864 type="textarea" 42865 name=${this.getInputName(input)} 42866 label=${input.label} 42867 ?required=${input.required} 42868 placeholder=${o$4(input.placeholder)} 42869 rows=${input.rows || 4} 42870 >${requiredMark(input.required)}</sonic-textarea 42871 >`; 42872 } 42873 renderEmail(input) { 42874 return b$1`<sonic-input 42875 type="email" 42876 name=${this.getInputName(input)} 42877 label=${input.label} 42878 ?required=${input.required} 42879 placeholder=${input.placeholder || "[email protected]"} 42880 >${requiredMark(input.required)}</sonic-input 42881 >`; 42882 } 42883 renderTel(input) { 42884 return b$1`<sonic-input 42885 type="tel" 42886 name=${this.getInputName(input)} 42887 label=${input.label} 42888 ?required=${input.required} 42889 placeholder=${o$4(input.placeholder)} 42890 >${requiredMark(input.required)}</sonic-input 42891 >`; 42892 } 42893 renderSelect(input) { 42894 const emptyOption = { value: "", wording: "- - - -" }; 42895 const options = [ 42896 emptyOption, 42897 ...input.options?.map((option) => ({ value: option.value, wording: option.label })) || [] 42898 ]; 42899 return b$1`<sonic-select 42900 name=${this.getInputName(input)} 42901 label=${input.label} 42902 ?required=${input.required} 42903 .options=${options} 42904 >${requiredMark(input.required)} 42905 </sonic-select>`; 42906 } 42907 renderRadio(input) { 42908 return b$1`<div> 42909 <label class="inline-block label mb-2">${input.label} ${requiredMark(input.required)}</label> 42910 <div class="flex gap-x-6 gap-y-2 flex-wrap"> 42911 ${input.options?.map( 42912 (option) => b$1` 42913 <sonic-radio name=${this.getInputName(input)} value=${option.value} ?required=${input.required} 42914 >${option.label}</sonic-radio 42915 > 42916 ` 42917 )} 42918 </div> 42919 </div>`; 42920 } 42921 renderCheckboxes(input) { 42922 return b$1`<div> 42923 <label class="inline-block label mb-2">${input.label}</label> 42924 <div class="flex gap-x-6 gap-y-2 flex-wrap"> 42925 ${input.options?.map( 42926 (option) => b$1` 42927 <sonic-checkbox name=${this.getInputName(input)} value=${option.value}>${option.label}</sonic-checkbox> 42928 ` 42929 )} 42930 </div> 42931 </div>`; 42932 } 42933 renderCheckbox(input) { 42934 return b$1`<sonic-checkbox name=${this.getInputName(input)} unique .value=${true} ?required=${input.required}> 42935 ${input.label} ${requiredMark(input.required, "")} 42936 </sonic-checkbox>`; 42937 } 42938 renderFile(input) { 42939 const extensions = input?.constraints?.extensions || []; 42940 return b$1`<sonic-file-upload 42941 name=${this.getInputName(input)} 42942 label=${input.label} 42943 ?required=${input.required} 42944 .accept=${input?.constraints?.fileTypes} 42945 .description=${extensions.join(", ")} 42946 ></sonic-file-upload>`; 42947 } 42948 renderDate(input) { 42949 return b$1`<sonic-input 42950 type="date" 42951 name=${this.getInputName(input)} 42952 label=${input.label} 42953 ?required=${input.required} 42954 >${requiredMark(input.required)}</sonic-input 42955 >`; 42956 } 42957 renderTextZone(input) { 42958 return b$1`<div class="max-w-prose">${o$6(input?.body)}</div>`; 42959 } 42960 }; 42961 SonicCustomForm$1.styles = [tailwind, label]; 42962 __decorateClass$22([ 42963 n$5({ type: Object }) 42964 ], SonicCustomForm$1.prototype, "customForm", 2); 42965 __decorateClass$22([ 42966 n$5({ type: String })
42967 ], SonicCustomForm$1.prototype, "namePrefix", 2); 42968 __decorateClass$22([ 42969 n$5({ type: String }) 42970 ], SonicCustomForm$1.prototype, "variant", 2); 42971 SonicCustomForm$1 = __decorateClass$22([ 42972 t$3(tagName$1j) 42973 ], SonicCustomForm$1); 42974 var __defProp$1$ = Object.defineProperty; 42975 var __getOwnPropDesc$21 = Object.getOwnPropertyDescriptor; 42976 var __decorateClass$21 = (decorators, target, key, kind) => { 42977 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$21(target, key) : target; 42978 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 42979 if (decorator = decorators[i2]) 42980 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 42981 if (kind && result) __defProp$1$(target, key, result); 42982 return result; 42983 }; 42984 let instanceCounter$6 = 0; 42985 const tagName$1i = "sonic-subscription-owner-form"; 42986 let SubscriptionOwnerForm = class extends i$6 { 42987 constructor() { 42988 super(...arguments); 42989 this.formDataProvider = "subscriptionOwnerForm" + instanceCounter$6++; 42990 this.structureTypesOptions = []; 42991 this.loading = false; 42992 this.no_email = "false"; 42993 this.selectFormSuggest = false; 42994 this.has_renew_from = false; 42995 this.handleFormMutation = () => { 42996 const formData = dp(this.formDataProvider).get(); 42997 const no_email = formData?.email?.endsWith(".pasdemail") ? "true" : "false"; 42998 this.no_email = no_email; 42999 }; 43000 this.handleNoEmailChange = (e2) => { 43001 const checkbox2 = e2.target; 43002 const firstName = dp(this.formDataProvider).firstName.get() || ""; 43003 const lastName = dp(this.formDataProvider).lastName.get() || ""; 43004 const email2 = generateFakeEmail(firstName, lastName); 43005 if (checkbox2.checked) { 43006 dp(this.formDataProvider).email.set(email2); 43007 } else { 43008 dp(this.formDataProvider).email.set(""); 43009 } 43010 }; 43011 this.udpateForUid = async (uid) => { 43012 const api2 = new API(HTML$1.getApiConfiguration(this)); 43013 const endpoint = `/user/${uid}`; 43014 const result = await api2.get(endpoint); 43015 const user2 = result; 43016 const id = this.item?.id; 43017 if (!id || !this.cartProvider) return; 43018 const customFormsData = dp(this.formDataProvider)?.[CUSTOM_FORMS_KEY]?.get(); 43019 await Cart.patchItems({ 43020 apiConfiguration: HTML$1.getApiConfiguration(this), 43021 cartProvider: this.cartProvider, 43022 query: { 43023 ids: [id] 43024 }, 43025 body: { 43026 owner: user2, 43027 [CUSTOM_FORMS_KEY]: customFormsData 43028 } 43029 }); 43030 this.setFormData(user2); 43031 this.selectFormSuggest = true; 43032 }; 43033 this.suggestFieldHasChanged = () => { 43034 this.selectFormSuggest = false; 43035 }; 43036 } 43037 connectedCallback() { 43038 this.setFormData(this.item?.owner, this.item?.[CUSTOM_FORMS_KEY] || {}); 43039 dp(this.formDataProvider).onInternalMutation(this.handleFormMutation); 43040 dp(this.formDataProvider).email.onAssign(this.suggestFieldHasChanged); 43041 dp(this.formDataProvider).lastName.onAssign(this.suggestFieldHasChanged); 43042 dp(this.formDataProvider).firstName.onAssign(this.suggestFieldHasChanged); 43043 super.connectedCallback(); 43044 } 43045 disconnectedCallback() { 43046 dp(this.formDataProvider).offInternalMutation(this.handleFormMutation); 43047 dp(this.formDataProvider).email.offAssign(this.suggestFieldHasChanged); 43048 dp(this.formDataProvider).lastName.offAssign(this.suggestFieldHasChanged); 43049 dp(this.formDataProvider).firstName.offAssign(this.suggestFieldHasChanged); 43050 super.disconnectedCallback(); 43051 } 43052 async willUpdate(_changedProperties) { 43053 if (_changedProperties.has("item")) { 43054 const subscriptionTypeId = this.item?.entity_id;
43055 this.getSubscriptionType(subscriptionTypeId).then((subscriptionType) => { 43056 this.subscriptionType = subscriptionType; 43057 }); 43058 this.has_renew_from = !!this.item?.renew_from?.id; 43059 } 43060 if (_changedProperties.has("subscriptionType")) { 43061 if (this.appType === "counter") { 43062 this.formConfiguration = this.subscriptionType?.owner_form?.counter; 43063 } else { 43064 this.formConfiguration = this.subscriptionType?.owner_form?.customer; 43065 } 43066 } 43067 if (_changedProperties.has("formConfiguration")) { 43068 const { structureType } = this.formConfiguration || {}; 43069 if (structureType?.enabled) { 43070 this.structureTypesOptions = await this.structureTypesToOptions() || []; 43071 } 43072 } 43073 } 43074 // RENDER FORM 43075 render() { 43076 if (!this.cartProvider) return A$1; 43077 const canRenew = this.appType === "counter" || this.subscriptionType?.settings?.can_renew; 43078 return b$1` 43079 ${productPriceSummary({ lineItemCart: this.item, className: "mb-6" })} 43080 ${canRenew ? b$1`<sonic-subscription-renew-form 43081 class="mb-8" 43082 @renewFromRemove=${() => { 43083 this.has_renew_from = false; 43084 if (this.item) { 43085 this.item = { 43086 ...this.item, 43087 renew_from: void 0 43088 }; 43089 } 43090 this.setFormData({}); 43091 }} 43092 @renewFromSelect=${(e2) => { 43093 const owner = e2.detail.owner; 43094 const customFormsData = dp(this.formDataProvider)?.[CUSTOM_FORMS_KEY]?.get(); 43095 this.setFormData(owner, customFormsData); 43096 this.has_renew_from = true; 43097 if (this.item) { 43098 this.item = { 43099 ...this.item, 43100 renew_from: e2.detail.renew_from 43101 }; 43102 } 43103 }} 43104 .lineItem=${this.item} 43105 cartProvider=${this.cartProvider} 43106 ></sonic-subscription-renew-form>` : A$1} 43107 ${this.loading ? b$1`<sonic-loader mode="inline" class="my-8"></sonic-loader>` : b$1` 43108 <form id="subscription-owner" formDataProvider=${this.formDataProvider}> 43109 ${this.renderInfos()} ${this.renderPhotography()} ${this.renderAddress()} ${this.renderCustomForms()} 43110 ${this.renderAllowInDirectory()} ${this.renderMailingLists()} 43111 <sonic-button @click=${this.submitForm} size="lg" type="success" shape="block" type="success"> 43112 <sonic-icon library="custom" name="check"></sonic-icon> 43113 ${t("Valider")} 43114 </sonic-button> 43115 43116 <div class="text-sm text-neutral-500 text-center pt-3">${t("LIB_required_fields")}</div> 43117 </form> 43118 `} 43119 `; 43120 } 43121 isRequired(isRequired) { 43122 if (this.appType === "counter") { 43123 return false; 43124 } else if (this.appType === "customer") { 43125 return isRequired || false; 43126 } 43127 return false; 43128 } 43129 requiredMark(isRequired) { 43130 const shouldRender = isRequired || false; 43131 return shouldRender ? b$1`<span class="opacity-50 pl-1" slot="label">*</span>` : A$1; 43132 } 43133 renderMailingLists() { 43134 return b$1`<sonic-optins-form .optinsListType=${[OptinType.SUBSCRIPTION]}></sonic-optins-form>`; 43135 } 43136 renderInfos() { 43137 if (!this.formConfiguration) return A$1; 43138 const { gender, birthdate, phoneNumber } = this.formConfiguration; 43139 const displaySuggestion = this.appType === "counter" && !this.has_renew_from && !this.selectFormSuggest; 43140 return b$1` 43141 <sonic-fieldset iconLibrary="custom" iconName="id-card" label="${t("type_abo_informations_personnelles")}"> 43142 <sonic-form-layout class="mb-6"> 43143 <sonic-input 43144 size="sm" 43145 autocomplete=${autocompleteValue("family-name", this.appType)} 43146 name="lastName" 43147 id="lastName" 43148 required 43149 label=${t("nom")} 43150 >${this.requiredMark(true)}</sonic-input 43151 > 43152 43153 <sonic-input 43154 size="sm" 43155 autocomplete=${autocompleteValue("given-name", this.appType)} 43156 name="firstName" 43157 id="firstName" 43158 required 43159 label=${t("prenom")} 43160 >${this.requiredMark(true)}</sonic-input 43161 > 43162
43163 <sonic-divider></sonic-divider> 43164 43165 <div class="form-item-container"> 43166 <sonic-input 43167 size="sm" 43168 id="email" 43169 name="email" 43170 type="email" 43171 label=${t("email")} 43172 ?disabled=${this.no_email === "true"} 43173 ?required=${this.appType !== "counter"} 43174 >${this.requiredMark(true)}</sonic-input 43175 > 43176 ${this.appType === "counter" ? b$1` 43177 <sonic-checkbox 43178 class="mt-3 block" 43179 name="no_email" 43180 size="sm" 43181 unique 43182 value="true" 43183 label="Le client n'a pas d'adresse email" 43184 @change=${this.handleNoEmailChange} 43185 ></sonic-checkbox> 43186 ` : A$1} 43187 </div> 43188 43189 ${phoneNumber?.enabled ? b$1` 43190 <sonic-input 43191 size="sm" 43192 id="phone" 43193 autocomplete=${autocompleteValue("tel", this.appType)} 43194 name="phoneNumber" 43195 type="tel" 43196 label=${t("telephone")} 43197 ?required=${this.isRequired(phoneNumber?.required)} 43198 >${this.requiredMark(phoneNumber?.required)}</sonic-input 43199 > 43200 ` : A$1} 43201 ${displaySuggestion ? b$1` 43202 <sonic-user-suggest 43203 class="p-5 block border-neutral-200 border-dashed rounded-md border-2" 43204 @select=${(e2) => { 43205 this.udpateForUid(e2.detail.uid); 43206 }} 43207 limit="3" 43208 .email=${sub(this.formDataProvider + ".email")} 43209 .lastName=${sub(this.formDataProvider + ".lastName")} 43210 ></sonic-user-suggest> 43211 ` : A$1} 43212 ${gender?.enabled ? b$1` 43213 <sonic-select 43214 size="sm" 43215 autocomplete=${autocompleteValue("gender", this.appType)} 43216 name="gender" 43217 id="gender" 43218 label=${t("sexe")} 43219 ?required=${this.isRequired(gender?.required)} 43220 .options=${[ 43221 { wording: "", value: "" }, 43222 { wording: t("select_vide"), value: "-" }, 43223 { wording: t("homme"), value: "Homme" }, 43224 { wording: t("femme"), value: "Femme" } 43225 ]} 43226 >${this.requiredMark(gender?.required)} 43227 </sonic-select> 43228 ` : A$1} 43229 ${birthdate?.enabled ? b$1` 43230 <sonic-input 43231 size="sm" 43232 id="birthdate" 43233 autocomplete=${autocompleteValue("birthdate", this.appType)} 43234 name="birthdate" 43235 type="date" 43236 label=${t("date_naissance")} 43237 ?required=${this.isRequired(birthdate?.required)} 43238 >${this.requiredMark(birthdate?.required)}</sonic-input 43239 > 43240 ` : A$1} 43241 ${this.renderStructure()} 43242 </sonic-form-layout> 43243 </sonic-fieldset> 43244 `; 43245 } 43246 renderStructure() { 43247 if (!this.formConfiguration) return A$1; 43248 const { structure, role, structureType } = this.formConfiguration; 43249 if (!structure?.enabled && !role?.enabled) return A$1; 43250 return b$1` 43251 <sonic-divider></sonic-divider> 43252 <sonic-form-layout> 43253 ${structure?.enabled ? b$1` 43254 <sonic-input 43255 size="sm" 43256 id="organization" 43257 autocomplete=${autocompleteValue("organization", this.appType)} 43258 name="structure" 43259 label="${t("LIB_organization")}" 43260 ?required=${this.isRequired(structure?.required)} 43261 >${this.requiredMark(structure?.required)}</sonic-input 43262 > 43263 ` : A$1} 43264 ${role?.enabled ? b$1` 43265 <sonic-input 43266 size="sm" 43267 id="organization-title" 43268 autocomplete=${autocompleteValue("organization-title", this.appType)} 43269 name="role" 43270 label=${t("Fonction")} 43271 ?required=${this.isRequired(role?.required)} 43272 >${this.requiredMark(role?.required)}</sonic-input 43273 > 43274 ` : A$1} 43275 ${structureType?.enabled && this.structureTypesOptions.length > 1 ? b$1` 43276 <sonic-select 43277 size="sm" 43278 id="structure-type" 43279 name="structureType.id" 43280 label=${t("Type de structure")} 43281 .options=${this.structureTypesOptions} 43282 ?required=${this.isRequired(structureType?.required)} 43283 >${this.requiredMark(structureType?.required)}</sonic-select 43284 > 43285 ` : A$1} 43286 </sonic-form-layout> 43287 `; 43288 } 43289 renderAllowInDirectory() { 43290 if (!this.formConfiguration) return A$1; 43291 const { allowInDirectory } = this.formConfiguration; 43292 if (!allowInDirectory?.enabled) return A$1; 43293 return b$1` 43294 <sonic-fieldset iconLibrary="custom" iconName="address-book" label="${t("accreditations_directory_title")}"> 43295 <sonic-switch 43296 label="${t("LIB_annuaire_autorisation_case")}" 43297 name="allowInDirectory" 43298 .value=${true} 43299 class="text-balance" 43300 ></sonic-switch> 43301 </sonic-fieldset> 43302 `; 43303 } 43304 renderPhotography() { 43305 const { photography } = this.formConfiguration || {}; 43306 if (!photography?.enabled) return A$1; 43307 return b$1` 43308 <sonic-fieldset> 43309 <sonic-file-upload 43310 id="photography" 43311 name="photography" 43312 type="file" 43313 label=${t("abonnement_photographie")} 43314 .accept=${["image/jpeg", "image/png", "image/jpg", "image/gif"]} 43315 description=".jpg, .jpeg, .png, .gif" 43316 ?required=${this.isRequired(photography?.required)} 43317 >${this.requiredMark(photography?.required)}</sonic-file-upload 43318 > 43319 </sonic-fieldset> 43320 `; 43321 } 43322 renderAddress() { 43323 if (!this.formConfiguration) return A$1; 43324 return b$1`<sonic-address-fieldset .formConfiguration=${this.formConfiguration}></sonic-address-fieldset>`; 43325 } 43326 setFormData(owner, customFormsData) { 43327 const ownerData = owner || {}; 43328 ownerData.country = normalizeCountry(ownerData.country); 43329 const no_email = ownerData.email?.endsWith(".pasdemail") ? "true" : "false"; 43330 this.no_email = no_email; 43331 dp(this.formDataProvider).set({ 43332 ...ownerData, 43333 no_email, 43334 [CUSTOM_FORMS_KEY]: customFormsData || {} 43335 }); 43336 } 43337 async submitForm(e2) { 43338 const button2 = e2.target; 43339 const id = this.item?.id; 43340 if (!id || !this.cartProvider) return; 43341 const formPublisher = dp(this.formDataProvider); 43342 formPublisher.isFormValid.set(true); 43343 formPublisher.invalidateForm(); 43344 if (!formPublisher.isFormValid.get()) return; 43345 const formData = formPublisher.get(); 43346 const ownerFormDataCleaned = cleanFormData(formData, this.formConfiguration); 43347 const customFormsData = formPublisher?.[CUSTOM_FORMS_KEY]?.get(); 43348 await Cart.patchItems({ 43349 apiConfiguration: HTML$1.getApiConfiguration(this), 43350 cartProvider: this.cartProvider, 43351 query: { 43352 ids: [id] 43353 }, 43354 body: { 43355 owner: ownerFormDataCleaned, 43356 [CUSTOM_FORMS_KEY]: customFormsData 43357 } 43358 }).then((e22) => { 43359 if (e22 === "asRequested") { 43360 const parentModal = HTML$1.getClosestElement(this, "sonic-modal"); 43361 if (parentModal) { 43362 parentModal.hide(); 43363 const event = new CustomEvent("attach", { 43364 detail: { 43365 itemIds: this.item?.id ? [this.item.id] : [] 43366 } 43367 }); 43368 this.dispatchEvent(event); 43369 } 43370 } 43371 }).finally(() => { 43372 button2.removeAttribute("loading"); 43373 }); 43374 } 43375 async getStructureTypes() { 43376 const api2 = new API(HTML$1.getApiConfiguration(this)); 43377 const endpoint = `/structures-types`; 43378 const result = await api2.get(endpoint); 43379 return result.data; 43380 } 43381 async structureTypesToOptions() {
43382 const structureTypes = await this.getStructureTypes(); 43383 const options = structureTypes?.map((structureType) => ({ 43384 value: structureType.id?.toString() || "", 43385 wording: structureType.title || "" 43386 })); 43387 options?.unshift({ wording: "...", value: "" }); 43388 return options; 43389 } 43390 async getSubscriptionType(subscriptionTypeId) { 43391 this.loading = true; 43392 if (!subscriptionTypeId) return void 0; 43393 const api2 = new API(HTML$1.getApiConfiguration(this)); 43394 const endpoint = entityEndPoint({ 43395 entityType: EntityType.Subscribe, 43396 entityId: subscriptionTypeId, 43397 features: [Feature.Prices, Feature.OwnerForm, Feature.Settings], 43398 subscriptionPriceIds: this.item?.price?.id ? [Number(this.item.price.id)] : void 0 43399 }); 43400 const result = await api2.get(endpoint); 43401 this.loading = false; 43402 return result.data; 43403 } 43404 renderCustomForms() { 43405 const customForms = this.subscriptionType?.customForms; 43406 if (!customForms) return A$1; 43407 return b$1` 43408 ${c$1( 43409 customForms || [], 43410 (customForm) => customForm.id, 43411 (customForm) => b$1`<sonic-custom-form .namePrefix=${CUSTOM_FORMS_KEY} .customForm=${customForm}></sonic-custom-form> ` 43412 )} 43413 `; 43414 } 43415 }; 43416 SubscriptionOwnerForm.styles = [tailwind]; 43417 __decorateClass$21([ 43418 n$5() 43419 ], SubscriptionOwnerForm.prototype, "formDataProvider", 2); 43420 __decorateClass$21([ 43421 n$5() 43422 ], SubscriptionOwnerForm.prototype, "cartProvider", 2); 43423 __decorateClass$21([ 43424 n$5({ type: Object }) 43425 ], SubscriptionOwnerForm.prototype, "item", 2); 43426 __decorateClass$21([ 43427 c({ context: appType, subscribe: true }), 43428 r$5() 43429 ], SubscriptionOwnerForm.prototype, "appType", 2); 43430 __decorateClass$21([ 43431 r$5() 43432 ], SubscriptionOwnerForm.prototype, "subscriptionType", 2); 43433 __decorateClass$21([ 43434 r$5() 43435 ], SubscriptionOwnerForm.prototype, "formConfiguration", 2); 43436 __decorateClass$21([ 43437 r$5() 43438 ], SubscriptionOwnerForm.prototype, "structureTypesOptions", 2); 43439 __decorateClass$21([ 43440 r$5() 43441 ], SubscriptionOwnerForm.prototype, "loading", 2); 43442 __decorateClass$21([ 43443 r$5() 43444 ], SubscriptionOwnerForm.prototype, "no_email", 2); 43445 __decorateClass$21([ 43446 r$5() 43447 ], SubscriptionOwnerForm.prototype, "selectFormSuggest", 2); 43448 __decorateClass$21([ 43449 r$5() 43450 ], SubscriptionOwnerForm.prototype, "has_renew_from", 2); 43451 SubscriptionOwnerForm = __decorateClass$21([ 43452 t$3(tagName$1i) 43453 ], SubscriptionOwnerForm); 43454 var __defProp$1_ = Object.defineProperty; 43455 var __getOwnPropDesc$20 = Object.getOwnPropertyDescriptor; 43456 var __decorateClass$20 = (decorators, target, key, kind) => { 43457 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$20(target, key) : target; 43458 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43459 if (decorator = decorators[i2]) 43460 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43461 if (kind && result) __defProp$1_(target, key, result); 43462 return result; 43463 }; 43464 const tagName$1h = "sonic-subscription-help"; 43465 let SubscriptionHelp = class extends Subscriber$1(i$6) { 43466 constructor() { 43467 super(...arguments); 43468 this.data = null; 43469 this.cartProvider = "cart/current"; 43470 this._hasEventsForSubscriptions = false; 43471 } 43472 connectedCallback() { 43473 this.cartProvider = this.getAncestorAttributeValue("cartProvider") || "cart/current"; 43474 this.dataProvider = this.cartProvider; 43475 super.connectedCallback(); 43476 } 43477 async willUpdate(_changedProperties) { 43478 if (_changedProperties.has("data")) { 43479 const subscriptions = getCartSubscriptions({ 43480 items: this.data?.items || [], 43481 linked_subscriptions: this.data?.linked_subscriptions || [], 43482 can_attach_events: true 43483 }); 43484 if (subscriptions.length > 0) { 43485 const apiConfiguration = HTML.getApiConfiguration(this); 43486 const events = await getEventsForSubscriptions({ 43487 apiConfiguration, 43488 subscriptions, 43489 accessParams: this.accessParams, 43490 limit: 1 43491 }); 43492 this._hasEventsForSubscriptions = events.length > 0; 43493 } else { 43494 this._hasEventsForSubscriptions = false;
43495 } 43496 } 43497 } 43498 render() { 43499 if (this._hasEventsForSubscriptions) { 43500 return b$1`<div class="@container"> 43501 <sonic-alert 43502 ${F({ 43503 in: v 43504 })} 43505 background 43506 status="success" 43507 data-action-area 43508 class="mb-6 @xl:text-lg" 43509 size="inherit" 43510 label="${t("LIB_subscription_help_cart")}" 43511 > 43512 <div class="mb-2">${t("LIB_subscription_help_cart_desc")}</div> 43513 <sonic-button 43514 @click=${() => quickSelectModal({ cartProvider: this.cartProvider, accessParams: this.accessParams })} 43515 type="success" 43516 size="inherit" 43517 class="animate-pulse lg:text-base" 43518 > 43519 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 43520 <span class="font-bold">${t("events_choice")}</span> 43521 </sonic-button> 43522 </sonic-alert> 43523 </div>`; 43524 } 43525 return A$1; 43526 } 43527 }; 43528 SubscriptionHelp.styles = [ 43529 tailwind, 43530 i$9` 43531 :host { 43532 width: 100%; 43533 display: block; 43534 } 43535 ` 43536 ]; 43537 __decorateClass$20([ 43538 n$5({ type: Object }) 43539 ], SubscriptionHelp.prototype, "data", 2); 43540 __decorateClass$20([ 43541 n$5({ type: String }) 43542 ], SubscriptionHelp.prototype, "cartProvider", 2); 43543 __decorateClass$20([ 43544 c({ context: accessParamsContext, subscribe: true }), 43545 n$5({ type: Object }) 43546 ], SubscriptionHelp.prototype, "accessParams", 2); 43547 __decorateClass$20([ 43548 r$5() 43549 ], SubscriptionHelp.prototype, "_hasEventsForSubscriptions", 2); 43550 SubscriptionHelp = __decorateClass$20([ 43551 t$3(tagName$1h) 43552 ], SubscriptionHelp); 43553 var __defProp$1Z = Object.defineProperty; 43554 var __getOwnPropDesc$1$ = Object.getOwnPropertyDescriptor; 43555 var __decorateClass$1$ = (decorators, target, key, kind) => { 43556 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1$(target, key) : target; 43557 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43558 if (decorator = decorators[i2]) 43559 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43560 if (kind && result) __defProp$1Z(target, key, result); 43561 return result; 43562 }; 43563 const tagName$1g = "sonic-subscription"; 43564 let SonicSubscription = class extends Subscriber$1(i$6) { 43565 constructor() { 43566 super(...arguments); 43567 this.urlBase = ""; 43568 this.displayTitle = false; 43569 this.displayText = false; 43570 this.noHelp = false; 43571 this.smallTitle = false; 43572 } 43573 connectedCallback() { 43574 const urlParams = new URLSearchParams(window.location.search); 43575 if (!this.hash) { 43576 this.hash = urlParams.get("subscription_hash") || ""; 43577 } 43578 if (!this.type) { 43579 this.type = urlParams.get("subscription_type") || ""; 43580 } 43581 super.connectedCallback(); 43582 } 43583 firstUpdated() { 43584 this.endpoint = this.subscriptionListEndPoint(); 43585 } 43586 subscriptionListEndPoint() { 43587 const queryParameters = new URLSearchParams(); 43588 if (this.type) { 43589 const types = this.type.split(","); 43590 types.forEach((type) => { 43591 queryParameters.append("id[]", type); 43592 }); 43593 } 43594 return entityEndPoint({ 43595 entityType: EntityType.Subscribe, 43596 next: true, 43597 features: [Feature.Prices, Feature.Status, Feature.Settings, Feature.Season, Feature.Picture], 43598 customSearchParams: queryParameters, 43599 accessParams: this.accessParams 43600 }); 43601 } 43602 render() { 43603 if (this.isWaiting || !this.endpoint) return A$1; 43604 return b$1`<sonic-page-layout 43605 ?smallTitle=${this.smallTitle} 43606 ?displayTitle=${this.displayTitle} 43607 ?displayText=${this.displayText} 43608 .pageTitle=${t("onglet_home_abonnements")} 43609 .pageText=${t("LIB_interface_vente_abonnement")} 43610 > 43611 <div class="@container"> 43612 ${!this.noHelp ? b$1`<sonic-subscription-help></sonic-subscription-help>` : A$1} 43613 <sonic-list 43614 loader="inline" 43615 fetch 43616 dataProvider=${this.endpoint} 43617 endPoint=${this.endpoint} 43618 key="data" 43619 class="grid grid-cols-1 @5xl:grid-cols-2 gap-4" 43620 .items=${() => b$1`<sonic-subscription-type></sonic-subscription-type>`} 43621 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 43622 > 43623 </sonic-list> 43624 </div> 43625 </sonic-page-layout>`; 43626 } 43627 }; 43628 SonicSubscription.styles = [tailwind]; 43629 __decorateClass$1$([ 43630 n$5({ type: String }) 43631 ], SonicSubscription.prototype, "urlBase", 2); 43632 __decorateClass$1$([ 43633 n$5({ type: String }) 43634 ], SonicSubscription.prototype, "hash", 2); 43635 __decorateClass$1$([ 43636 n$5({ type: String }) 43637 ], SonicSubscription.prototype, "type", 2); 43638 __decorateClass$1$([ 43639 n$5({ type: Boolean }) 43640 ], SonicSubscription.prototype, "displayTitle", 2); 43641 __decorateClass$1$([ 43642 n$5({ type: Boolean }) 43643 ], SonicSubscription.prototype, "displayText", 2); 43644 __decorateClass$1$([ 43645 n$5({ type: Boolean }) 43646 ], SonicSubscription.prototype, "noHelp", 2); 43647 __decorateClass$1$([ 43648 n$5({ type: Boolean }) 43649 ], SonicSubscription.prototype, "smallTitle", 2); 43650 __decorateClass$1$([ 43651 c({ context: accessParamsContext, subscribe: true }), 43652 n$5({ type: Object }) 43653 ], SonicSubscription.prototype, "accessParams", 2); 43654 __decorateClass$1$([ 43655 bind$1("sonicTicketApp.isWaiting"), 43656 r$5() 43657 ], SonicSubscription.prototype, "isWaiting", 2); 43658 __decorateClass$1$([ 43659 r$5() 43660 ], SonicSubscription.prototype, "endpoint", 2); 43661 SonicSubscription = __decorateClass$1$([ 43662 t$3(tagName$1g) 43663 ], SonicSubscription); 43664 var __defProp$1Y = Object.defineProperty; 43665 var __getOwnPropDesc$1_ = Object.getOwnPropertyDescriptor; 43666 var __decorateClass$1_ = (decorators, target, key, kind) => { 43667 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1_(target, key) : target; 43668 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43669 if (decorator = decorators[i2]) 43670 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43671 if (kind && result) __defProp$1Y(target, key, result); 43672 return result; 43673 }; 43674 let Giftcard = class extends Subscriber$1(i$6) { 43675 render() { 43676 if (!this.props) return A$1; 43677 const hasBody = !!this.props.edito?.body; 43678 const isCounter = this.appType == "counter"; 43679 return b$1` 43680 <div class="@container group max-w-[80rem] "> 43681 <div 43682 class=" bg-neutral-0 grid grid-cols-1 @md:grid-cols-[minmax(0,_12rem),_minmax(0,_3fr)] 43683 items-center 43684 border border-neutral-100 rounded-lg gap-5 p-5 relative" 43685 > 43686 <div> 43687 <sonic-product-illustration rounded="md"></sonic-product-illustration> 43688 </div> 43689 <div class="flex flex-col gap-2"> 43690 ${isCounter ? b$1` 43691 <div class="absolute top-1 right-1 @md:top-3 @md:right-3 flex items-center gap-2"> 43692 <sonic-product-publication 43693 subDataProvider="infos_status" 43694 class="text-lg" 43695 ></sonic-product-publication> 43696 ${this.renderMenu()} 43697 </div> 43698 ` : A$1} 43699 <div class="mb-3"> 43700 <sonic-product-title class="text-2xl font-bold flex-grow pr-8 "></sonic-product-title> 43701 ${hasBody ? b$1`<div class="prose prose-sm prose-tight block">${o$6(this.props.edito?.body)}</div>` : A$1} 43702 </div> 43703 <div class="flex flex-wrap items-center gap-x-3 gap-y-1"> 43704 <sonic-event-additional-status 43705 visibility="public" 43706 variant="ghost" 43707 size="lg" 43708 class="flex mt-4 flex-wrap gap-3" 43709 ></sonic-event-additional-status> 43710 <sonic-event-scheduled-status size="sm"></sonic-event-scheduled-status> 43711 </div> 43712 43713 <sonic-prices-form 43714 item_id=${this.id || ""} 43715 buttonType="primary" 43716 formType="buttons" 43717 type="giftcard" 43718 noPriceName 43719 size="sm" 43720 class="flex-grow" 43721 ></sonic-prices-form> 43722 </div> 43723 </div> 43724 </div> 43725 `; 43726 } 43727 renderMenu() { 43728 const actions = [ProductActionsEnum.EDIT]; 43729 return b$1`<sonic-product-actions size="sm" .actions=${actions}></sonic-product-actions>`; 43730 } 43731 }; 43732 Giftcard.styles = [tailwind]; 43733 __decorateClass$1_([ 43734 c({ context: appType, subscribe: true }), 43735 r$5() 43736 ], Giftcard.prototype, "appType", 2); 43737 Giftcard = __decorateClass$1_([ 43738 t$3("sonic-giftcard") 43739 ], Giftcard); 43740 var __defProp$1X = Object.defineProperty; 43741 var __getOwnPropDesc$1Z = Object.getOwnPropertyDescriptor; 43742 var __decorateClass$1Z = (decorators, target, key, kind) => { 43743 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1Z(target, key) : target; 43744 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43745 if (decorator = decorators[i2]) 43746 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43747 if (kind && result) __defProp$1X(target, key, result); 43748 return result; 43749 }; 43750 const tagName$1f = "sonic-giftcards"; 43751 let SonicGiftcards = class extends Subscriber$1(i$6) { 43752 constructor() { 43753 super(...arguments); 43754 this.displayTitle = false;
43755 this.displayText = false; 43756 this.smallTitle = false; 43757 } 43758 render() { 43759 const endPoint = entityEndPoint({ 43760 entityType: EntityType.Giftcard, 43761 accessParams: this.accessParams, 43762 next: true, 43763 view: entityView.full 43764 }); 43765 return b$1`<sonic-page-layout 43766 pageTitle=${t("module_giftcards_title")} 43767 pageText=${t("message_front_cartes_cadeaux")} 43768 ?smallTitle=${this.smallTitle} 43769 ?displayTitle=${this.displayTitle} 43770 ?displayText=${this.displayText} 43771 > 43772 <div class="@container"> 43773 <sonic-list 43774 loader="inline" 43775 key="data" 43776 fetch 43777 dataProvider=${endPoint} 43778 class="grid grid-cols-1 @[1500px]:grid-cols-2 gap-4" 43779 .items=${() => b$1`<sonic-giftcard></sonic-giftcard>`} 43780 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 43781 > 43782 </sonic-list> 43783 </div> 43784 </sonic-page-layout>`; 43785 } 43786 }; 43787 SonicGiftcards.styles = [ 43788 tailwind, 43789 i$9` 43790 :host { 43791 display: block; 43792 } 43793 ` 43794 ]; 43795 __decorateClass$1Z([ 43796 n$5({ type: Boolean }) 43797 ], SonicGiftcards.prototype, "displayTitle", 2); 43798 __decorateClass$1Z([ 43799 n$5({ type: Boolean }) 43800 ], SonicGiftcards.prototype, "displayText", 2); 43801 __decorateClass$1Z([ 43802 n$5({ type: Boolean }) 43803 ], SonicGiftcards.prototype, "smallTitle", 2); 43804 __decorateClass$1Z([ 43805 c({ context: accessParamsContext, subscribe: true }), 43806 n$5({ type: Object }) 43807 ], SonicGiftcards.prototype, "accessParams", 2); 43808 SonicGiftcards = __decorateClass$1Z([ 43809 t$3(tagName$1f) 43810 ], SonicGiftcards); 43811 var __defProp$1W = Object.defineProperty; 43812 var __getOwnPropDesc$1Y = Object.getOwnPropertyDescriptor; 43813 var __decorateClass$1Y = (decorators, target, key, kind) => { 43814 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1Y(target, key) : target; 43815 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43816 if (decorator = decorators[i2]) 43817 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43818 if (kind && result) __defProp$1W(target, key, result); 43819 return result; 43820 }; 43821 let SonicCartIcon = class extends i$6 { 43822 onSlotChange(e2) { 43823 const _isSlotEmpty = e2.target.assignedNodes().length === 0; 43824 if (!_isSlotEmpty) { 43825 e2.target.setAttribute("slot", "icon"); 43826 } else { 43827 e2.target.removeAttribute("slot"); 43828 } 43829 } 43830 render() { 43831 return b$1`<sonic-reservation-icon 43832 size="${o$4(this.size)}" 43833 dataProvider="cart/current" 43834 subDataProvider="data" 43835 > 43836 <slot name="icon" @slotchange=${this.onSlotChange}></slot> 43837 </sonic-reservation-icon>`; 43838 } 43839 }; 43840 SonicCartIcon.styles = [ 43841 i$9` 43842 :host { 43843 display: inline-flex; 43844 } 43845 ` 43846 ]; 43847 __decorateClass$1Y([ 43848 n$5({ type: String }) 43849 ], SonicCartIcon.prototype, "size", 2); 43850 SonicCartIcon = __decorateClass$1Y([ 43851 t$3("sonic-cart-icon"), 43852 awaitConnectedAncestors(APP_TAG_SELECTOR) 43853 ], SonicCartIcon); 43854 var __defProp$1V = Object.defineProperty; 43855 var __getOwnPropDesc$1X = Object.getOwnPropertyDescriptor; 43856 var __decorateClass$1X = (decorators, target, key, kind) => { 43857 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1X(target, key) : target; 43858 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 43859 if (decorator = decorators[i2]) 43860 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 43861 if (kind && result) __defProp$1V(target, key, result); 43862 return result; 43863 }; 43864 let SonicEventStoreContent = class extends Subscriber$1(i$6) { 43865 constructor() { 43866 super(...arguments); 43867 this.dataProviderExpression = "sessions?next=1&limit=$limit&offset=$offset"; 43868 this.formDataProvider = "eventFrontFilters"; 43869 this.displayCart = false; 43870 this.formType = "buttons"; 43871 this.cartProvider = "cart/current"; 43872 this.observer = new IntersectionObserver(([e2]) => e2.target.classList.toggle("isSticky", e2.intersectionRatio < 1), { 43873 threshold: [1] 43874 }); 43875 } 43876 updated(_changedProperties) { 43877 if (!this.formContainer) { 43878 this.observer.disconnect(); 43879 } else { 43880 this.observer.observe(this.formContainer); 43881 } 43882 super.updated(_changedProperties); 43883 } 43884 willUpdate(_changedProperties) { 43885 const searchParams = new URLSearchParams(); 43886 this.activity?.forEach((id) => { 43887 searchParams.append("ids_activity[]", id); 43888 }); 43889 this.category?.forEach((id) => { 43890 searchParams.append("ids_category[]", id); 43891 }); 43892 if (this.agendaId) { 43893 searchParams.append("ids_agenda", this.agendaId.toString()); 43894 } 43895 this.dataProviderExpression = entityEndPoint({ 43896 entityType: EntityType.Event, 43897 isQueue: true, 43898 next: true, 43899 accessParams: this.accessParams, 43900 customSearchParams: searchParams, 43901 view: entityView.essential 43902 }); 43903 super.willUpdate(_changedProperties); 43904 } 43905 disconnectedCallback() { 43906 this.observer.disconnect(); 43907 super.disconnectedCallback(); 43908 } 43909 openCart() { 43910 Modal.create({ 43911 content: b$1` 43912 <sonic-cart-full 43913 style="margin-top: 1rem !important;" 43914 cartProvider="${this.cartProvider}" 43915 dataProvider="${this.cartProvider}" 43916 subdataprovider="data" 43917 ></sonic-cart-full> 43918 ` 43919 }); 43920 } 43921 render() { 43922 const displayCartClassLayout = this.displayCart ? "grid grid-cols-1 @4xl:grid-cols-[minmax(0,2fr)_minmax(0,1.2fr)
43922] @5xl:grid-cols-[minmax(0,2fr)_minmax(0,1fr)] gap-8 relative z-[0]" : ""; 43923 return b$1` 43924 <div class="@container"> 43925 <div class="${displayCartClassLayout}"> 43926 <div> 43927 <slot name="intro"></slot> 43928 <div 43929 id="formContainer" 43930 class="flex gap-x-4 sticky top-[-1px] py-2 mb-5 shadow-[0_0_0_2px_var(--sc-base)] z-[1] pr-5" 43931 > 43932 ${this.appType === "counter" ? b$1`<sonic-event-selection-filters 43933 formDataProvider="${this.formDataProvider}" 43934 class=" block min-w-0 w-full " 43935 category 43936 activity 43937 range 43938 onlyFilter 43939 canFilterDays 43940 ></sonic-event-selection-filters>` : A$1} 43941 ${this.appType === "customer" ? b$1`<sonic-form-event-filter 43942 formDataProvider="${this.formDataProvider}" 43943 ?filterCategory=${!this.category?.length} 43944 class="block max-w-[40rem] w-full z-10 min-w-0" 43945 ></sonic-form-event-filter>` : A$1} 43946 43947 <slot name="formSuffix"></slot> 43948 43949 ${this.displayCart ? b$1` 43950 <sonic-button 43951 @click=${() => this.openCart()} 43952 class="@4xl:hidden ml-auto" 43953 variant="default" 43954 shape="circle" 43955 size="lg" 43956 icon 43957 > 43958 <sonic-reservation-icon 43959 dataProvider="${this.cartProvider}" 43960 subDataProvider="data" 43961 ></sonic-reservation-icon> 43962 </sonic-button> 43963 ` : A$1} 43964 </div> 43965 43966 <div> 43967 <sonic-queue 43968 dataProviderExpression="${this.dataProviderExpression}" 43969 key="data" 43970 limit="8" 43971 targetRequestDuration="1000" 43972 dataProvider="${this.formDataProvider + "searchResults"}" 43973 dataFilterProvider="${this.formDataProvider}" 43974 .items=${() => { 43975 return b$1`<sonic-event-store-item 43976 .queueFormDataProvider=${this.formDataProvider} 43977 showAllSessionsButton 43978 formType=${this.formType} 43979 class="mb-4 block" 43980 ></sonic-event-store-item>`; 43981 }} 43982 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 43983 > 43984 </sonic-queue> 43985 </div> 43986 </div> 43987 43988 ${this.displayCart ? b$1`<div class="hidden @4xl:block pt-3"> 43989 <sonic-cart-full 43990 cartProvider="${this.cartProvider}" 43991 dataProvider="${this.cartProvider}" 43992 subdataprovider="data" 43993 lazyrendering 43994 layout="condensed" 43995 class="sticky top-3" 43996 maxHeight 43997 ></sonic-cart-full> 43998 </div>` : A$1} 43999 </div> 44000 </div> 44001 `; 44002 } 44003 }; 44004 SonicEventStoreContent.styles = [ 44005 tailwind, 44006 i$9` 44007 .isSticky { 44008 background-color: var(--sc-base); 44009 box-shadow: 0 1.5rem 1rem -1rem rgb(0 0 0 / 0.07); 44010 } 44011 ` 44012 ]; 44013 __decorateClass$1X([ 44014 r$5() 44015 ], SonicEventStoreContent.prototype, "dataProviderExpression", 2); 44016 __decorateClass$1X([ 44017 e$7("#formContainer") 44018 ], SonicEventStoreContent.prototype, "formContainer", 2); 44019 __decorateClass$1X([ 44020 n$5({ type: Array }) 44021 ], SonicEventStoreContent.prototype, "activity", 2); 44022 __decorateClass$1X([ 44023 n$5({ type: Array }) 44024 ], SonicEventStoreContent.prototype, "category", 2); 44025 __decorateClass$1X([ 44026 n$5({ type: Number }) 44027 ], SonicEventStoreContent.prototype, "agendaId", 2); 44028 __decorateClass$1X([ 44029 n$5({ type: String }) 44030 ], SonicEventStoreContent.prototype, "formDataProvider", 2); 44031 __decorateClass$1X([ 44032 n$5({ type: Boolean }) 44033 ], SonicEventStoreContent.prototype, "displayCart", 2); 44034 __decorateClass$1X([ 44035 n$5({ type: String }) 44036 ], SonicEventStoreContent.prototype, "formType", 2); 44037 __decorateClass$1X([ 44038 c({ context: accessParamsContext, subscribe: true }), 44039 e$2({ context: accessParamsContext }), 44040 n$5({ type: Object }) 44041 ], SonicEventStoreContent.prototype, "accessParams", 2); 44042 __decorateClass$1X([ 44043 n$5({ type: String }) 44044 ], SonicEventStoreContent.prototype, "cartProvider", 2); 44045 __decorateClass$1X([ 44046 c({ context: appType }), 44047 n$5({ type: String }) 44048 ], SonicEventStoreContent.prototype, "appType", 2); 44049 SonicEventStoreContent = __decorateClass$1X([ 44050 t$3("sonic-event-store-content") 44051 ], SonicEventStoreContent); 44052 var __defProp$1U = Object.defineProperty; 44053 var __getOwnPropDesc$1W = Object.getOwnPropertyDescriptor; 44054 var __decorateClass$1W = (decorators, target, key, kind) => { 44055 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1W(target, key) : target; 44056 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44057 if (decorator = decorators[i2]) 44058 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44059 if (kind && result) __defProp$1U(target, key, result); 44060 return result; 44061 }; 44062 const ENTITY_INFO = { 44063 [EntityType.Subscribe]: { text: t("onglet_home_abonnements"), icon: "i
44063d-card" }, 44064 [EntityType.Giftcard]: { text: t("LIB_cartes_cadeaux"), icon: "gift-card" }, 44065 [EntityType.Merch]: { text: t("module_shop_title"), icon: "bags-shopping" }, 44066 [EntityType.Event]: { text: t("LIB_events"), icon: "calendar-day" } 44067 }; 44068 let SonicCartAddEntity = class extends i$6 { 44069 constructor() { 44070 super(...arguments); 44071 this.isEnabled = false; 44072 this._entityInfo = { 44073 text: t("LIB_add"), 44074 icon: "calendar-day" 44075 }; 44076 } 44077 connectedCallback() { 44078 if (!this.cartProvider) { 44079 this.cartProvider = HTML$1.getAncestorAttributeValue(this, "cartProvider") || "cart/current"; 44080 } 44081 super.connectedCallback(); 44082 } 44083 willUpdate(_changedProperties) { 44084 if (!this.cartProvider) { 44085 this.cartProvider = HTML$1.getAncestorAttributeValue(this, "cartProvider") || "cart/current"; 44086 } 44087 this.isEnabled = this.enableButton(this.entityType); 44088 if (_changedProperties.has("entityType") && this.entityType) { 44089 const info = ENTITY_INFO[this.entityType]; 44090 if (info) this._entityInfo = info; 44091 } 44092 super.willUpdate(_changedProperties); 44093 } 44094 render() { 44095 if (!this.isEnabled) return A$1; 44096 return b$1`<sonic-button 44097 .shape="${this.shape || "block"}" 44098 align="${this.align}" 44099 variant="${this.variant}" 44100 .size="${this.size}" 44101 type="${o$4(this.type)}" 44102 autoActive="disabled" 44103 @click=${() => this.addEntityModal(this.cartProvider || "cart/current")} 44104 > 44105 <slot name="icon"> 44106 <span class="relative"> 44107 <sonic-icon 44108 library="custom" 44109 name="circle-plus" 44110 prefix="solid" 44111 size="sm" 44112 class="absolute -bottom-1 -left-[.7em]" 44113 ></sonic-icon 44114 ><sonic-icon library="custom" name=${this._entityInfo.icon}></sonic-icon> 44115 </span> 44116 </slot> 44117 ${this._entityInfo.text} 44118 </sonic-button>`; 44119 } 44120 enableButton(entityType) { 44121 const mod = this.settings?.modules; 44122 const isCounter = this.appType === "counter"; 44123 const access = (module, counterBypass = false) => isCounter ? Boolean(counterBypass || module?.adminAccess) : Boolean(module?.access); 44124 switch (entityType) { 44125 case EntityType.Giftcard: 44126 return access(mod?.giftcards); 44127 case EntityType.Merch: 44128 return access(mod?.shop); 44129 case EntityType.Subscribe: 44130 return access(mod?.subscription); 44131 case EntityType.Event: 44132 return access(mod?.agenda, true); 44133 default: 44134 return false; 44135 } 44136 } 44137 addEntityModal(cartProvider) { 44138 if (this.entityType === EntityType.Subscribe) { 44139 this.addSubscriptionModal(cartProvider); 44140 } else if (this.entityType === EntityType.Giftcard) { 44141 this.addGiftcardModal(cartProvider); 44142 } else if (this.entityType === EntityType.Merch) { 44143 this.addMerchModal(cartProvider); 44144 } else { 44145 this.addEventModal(cartProvider); 44146 } 44147 } 44148 addEventModal(cartProvider) { 44149 Modal.create({ 44150 title: ENTITY_INFO[EntityType.Event]?.text, 44151 content: withAccessParams( 44152 this.accessParams, 44153 b$1`<sonic-event-store-content 44154 cartProvider=${cartProvider} 44155 class="block w-full" 44156 formDataProvider="cartAddEventsFilters" 44157 ></sonic-event-store-content>` 44158 ), 44159 width: "77rem", 44160 maxWidth: "90vw", 44161 maxHeight: "92svh", 44162 height: "92svh", 44163 removeOnHide: true 44164 }); 44165 } 44166 addSubscriptionModal(cartProvider) { 44167 Modal.create({ 44168 title: ENTITY_INFO[EntityType.Subscribe]?.text, 44169 content: withAccessParams( 44170 this.accessParams, 44171 b$1`<sonic-subscription cartProvider=${cartProvider} noHelp class="block w-full" v2></sonic-subscription>` 44172 ), 44173 maxWidth: "60rem", 44174 maxHeight: "92svh", 44175 removeOnHide: true 44176 }); 44177 } 44178 addGiftcardModal(cartProvider) { 44179 Modal.create({ 44180 title: ENTITY_INFO[EntityType.Giftcard]?.text, 44181 content: withAccessParams( 44182 this.accessParams, 44183 b$1`<sonic-giftcards cartProvider=${cartProvider} class="block w-full"></sonic-giftcards>` 44184 ), 44185 maxWidth: "60rem", 44186 maxHeight: "92svh", 44187 removeOnHide: true 44188 }); 44189 } 44190 addMerchModal(cartProvider) { 44191 Modal.create({ 44192 title: ENTITY_INFO[EntityType.Merch]?.text, 44193 content: withAccessParams( 44194 this.accessParams, 44195 b$1`<sonic-shop 44196 storeMode 44197 cartProvider=${cartProvider} 44198 .filterFormDataProvider=${"cartAddMerchFilters"} 44199 class="block w-full" 44200 noRouting 44201 ></sonic-shop>` 44202 ), 44203 maxWidth: "60rem", 44204 maxHeight: "92svh", 44205 height: "92svh", 44206 removeOnHide: true 44207 }); 44208 } 44209 }; 44210 SonicCartAddEntity.styles = [tailwind]; 44211 __decorateClass$1W([ 44212 n$5({ type: String }) 44213 ], SonicCartAddEntity.prototype, "cartProvider", 2); 44214 __decorateClass$1W([ 44215 n$5({ type: String }) 44216 ], SonicCartAddEntity.prototype, "entityType", 2); 44217 __decorateClass$1W([ 44218 n$5({ type: String }) 44219 ], SonicCartAddEntity.prototype, "size", 2); 44220 __decorateClass$1W([ 44221 n$5({ type: String }) 44222 ], SonicCartAddEntity.prototype, "type", 2); 44223 __decorateClass$1W([ 44224 n$5({ type: String }) 44225 ], SonicCartAddEntity.prototype, "shape", 2); 44226 __decorateClass$1W([ 44227 n$5({ type: String }) 44228 ], SonicCartAddEntity.prototype, "variant", 2); 44229 __decorateClass$1W([ 44230 n$5({ type: String }) 44231 ], SonicCartAddEntity.prototype, "customText", 2); 44232 __decorateClass$1W([ 44233 n$5({ type: String }) 44234 ], SonicCartAddEntity.prototype, "align", 2); 44235 __decorateClass$1W([ 44236 bind$1("settings"), 44237 n$5({ type: Object }) 44238 ], SonicCartAddEntity.prototype, "settings", 2); 44239 __decorateClass$1W([ 44240 c({ context: cartTypeContext, subscribe: true }), 44241 n$5({ type: String }) 44242 ], SonicCartAddEntity.prototype, "cartType", 2); 44243 __decorateClass$1W([ 44244 c({ context: accessParamsContext, subscribe: true }), 44245 n$5({ type: Object }) 44246 ], SonicCartAddEntity.prototype, "accessParams", 2); 44247 __decorateClass$1W([ 44248 c({ context: appType, subscribe: true }), 44249 n$5({ type: String }) 44250 ], SonicCartAddEntity.prototype, "appType", 2); 44251 __decorateClass$1W([ 44252 r$5() 44253 ], SonicCartAddEntity.prototype, "isEnabled", 2); 44254 __decorateClass$1W([ 44255 r$5()
44256 ], SonicCartAddEntity.prototype, "_entityInfo", 2); 44257 SonicCartAddEntity = __decorateClass$1W([ 44258 t$3("sonic-cart-add-entity") 44259 ], SonicCartAddEntity); 44260 var __defProp$1T = Object.defineProperty; 44261 var __getOwnPropDesc$1V = Object.getOwnPropertyDescriptor; 44262 var __decorateClass$1V = (decorators, target, key, kind) => { 44263 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1V(target, key) : target; 44264 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44265 if (decorator = decorators[i2]) 44266 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44267 if (kind && result) __defProp$1T(target, key, result); 44268 return result; 44269 }; 44270 const tagName$1e = "sonic-cart-payment-buttons"; 44271 let SonicComponent$e = class SonicComponent extends Subscriber$1(i$6) { 44272 constructor() { 44273 super(...arguments); 44274 this.payments_methods = []; 44275 this.resaAndCredit = []; 44276 this.paymentsWithoutResaAndCredit = []; 44277 this.canCheckout = false; 44278 this.quantity = 0; 44279 this.align = "center"; 44280 this.layout = "default"; 44281 this.displayShowAllPayments = false; 44282 this.showAllPayments = false; 44283 this.errorText = t("cart_payement_buttons_error"); 44284 this._resizeController = new h$1(this, {}); 44285 this.cartProvider = ""; 44286 } 44287 connectedCallback() { 44288 if (!this.cartProvider) { 44289 this.cartProvider = this.getAncestorAttributeValue("cartProvider"); 44290 } 44291 super.connectedCallback(); 44292 } 44293 willUpdate(_changedProperties) { 44294 switch (_changedProperties.has("props") && this.props?.cartType) { 44295 case "reservation": 44296 this.errorText = t("cart_payement_buttons_error_reservation"); 44297 break; 44298 case "cart": 44299 this.errorText = t("cart_payement_buttons_error"); 44300 break; 44301 } 44302 if (_changedProperties.has("payments_methods")) { 44303 this.resaAndCredit = this.payments_methods.filter((payment) => payment.code === "resa" || payment.code === "credit").sort((a2, b2) => { 44304 if (a2.code === "resa") return -1; 44305 if (b2.code === "resa") return 1; 44306 if (a2.code === "credit") return -1; 44307 if (b2.code === "credit") return 1; 44308 return 0; 44309 }); 44310 let paymentsWithoutResaAndCredit = this.payments_methods.filter( 44311 (payment) => payment.code !== "resa" && payment.code !== "credit" 44312 ); 44313 const maxToDisplay = 6; 44314 if (!this.showAllPayments && paymentsWithoutResaAndCredit.length > maxToDisplay) { 44315 paymentsWithoutResaAndCredit = paymentsWithoutResaAndCredit.slice(0, maxToDisplay); 44316 this.displayShowAllPayments = true; 44317 } else { 44318 this.displayShowAllPayments = false; 44319 } 44320 this.paymentsWithoutResaAndCredit = paymentsWithoutResaAndCredit; 44321 } 44322 super.willUpdate(_changedProperties); 44323 } 44324 // getCheckoutPath 44325 getCheckoutPath(payment) { 44326 const cart_id = this.props?.id; 44327 const params = {}; 44328 if (payment) { 44329 params.payment_id = payment.id; 44330 } 44331 if (cart_id) { 44332 params.cart_id = cart_id; 44333 } 44334 let route2 = appRoute("checkout").query(params); 44335 if (payment) { 44336 route2 = route2.fill(payment); 44337 } 44338 return route2; 44339 } 44340 render() { 44341 const isXsContainer = this.clientWidth < 200; 44342 const hasResaOrCredit = this.resaAndCredit.length; 44343 const messages2 = this.props?.messages || []; 44344 const messagesMarkup = b$1` 44345 ${messages2.map( 44346 (message) => b$1` 44347 <sonic-alert status="${message.status || "warning"}" ?background=${!isXsContainer} size="sm" class="mb-2"> 44348 ${o$6(message.content)} 44349 </sonic-alert> 44350 ` 44351 )} 44352 `; 44353 if (!this.canCheckout && !this.quantity) return A$1; 44354 if (!this.canCheckout && this.quantity) 44355 return b$1` 44356 ${messagesMarkup} 44357 <sonic-alert status="error" ?background=${!isXsContainer} size="sm"> ${this.errorText} </sonic-alert> 44358 ${this.resaAndCreditMarkup(true)} 44359 `; 44360 const paymentCount = this.paymentsWithoutResaAndCredit.length; 44361 const hasOnePaymentMethod = paymentCount === 1; 44362 if (!this.payments_methods.length) { 44363 return A$1; 44364 } 44365 if (this.appType === "customer") { 44366 return b$1` 44367 ${messagesMarkup} 44368 <sonic-button 44369 type="success" 44370 href=${this.getCheckoutPath().toString()} 44371 size="lg" 44372 align="center" 44373 shape="block" 44374 ?disabled=${!this.canCheckout} 44375 autoActive="disabled" 44376 class="mx-auto" 44377 ><sonic-icon name="arrow-right" library="custom"></sonic-icon>
44378 <span class="font-bold">${t("commander")} </span></sonic-button 44379 > 44380 `; 44381 } 44382 return b$1`<div class="@container"> 44383 ${messagesMarkup} 44384 ${this.paymentsWithoutResaAndCredit.length > 0 ? b$1` 44385 <div 44386 class="grid grid-cols-1 gap-1 ${paymentCount >= 2 ? " @sm:grid-cols-2" : ""} ${paymentCount >= 3 ? "@xl:grid-cols-3" : ""} " 44387 > 44388 ${this.paymentsWithoutResaAndCredit.map((payment, index) => { 44389 let type = "default"; 44390 if (index < 4) { 44391 type = "neutral"; 44392 } 44393 return b$1`<sonic-button 44394 type="${type}" 44395 href=${this.getCheckoutPath(payment).toString()} 44396 size="${o$4(this.size)}" 44397 shape="block" 44398 minWidth="8rem" 44399 autoActive="disabled" 44400 align="left" 44401 ?disabled=${!this.canCheckout} 44402 >${hasOnePaymentMethod ? b$1`<sonic-icon name="arrow-right" library="custom" slot="prefix"></sonic-icon> ${t("commander")}` : b$1`${renderPaymentIcon$1(payment.title)} 44403 <span class="${index < 3 ? "font-bold" : ""} ">${payment.title}</span>`}</sonic-button 44404 >`; 44405 })} 44406 ${this.displayShowAllPayments ? b$1` 44407 <sonic-button 44408 @click=${() => showAllPaymentsModal(this.cartProvider, this.appType)} 44409 shape="block" 44410 size="${o$4(this.size)}" 44411 align="left" 44412 class="col-span-full" 44413 > 44414 <sonic-icon size="lg" name="ellipsis" library="custom" slot="prefix"></sonic-icon> 44415 ${t("LIB_voir_tout")}</sonic-button 44416 > 44417 ` : A$1} 44418 </div> 44419 ` : A$1} 44420 ${hasResaOrCredit ? this.resaAndCreditMarkup() : A$1} 44421 </div>`; 44422 } 44423 resaAndCreditMarkup(resaOnly = false) { 44424 return b$1` <div 44425 class="pt-4 grid grid-cols-1 gap-1 ${this.resaAndCredit.length == 2 ? " @sm:grid-cols-2" : ""} " 44426 > 44427 ${this.resaAndCredit.map((payment) => { 44428 let type = "default"; 44429 let variant = "outline"; 44430 if (payment.code === "resa") { 44431 type = "warning"; 44432 variant = "default"; 44433 } else if (payment.code === "credit") { 44434 type = "info"; 44435 } 44436 const enableButton = this.canCheckout || payment.code === "resa"; 44437 if (resaOnly && payment.code !== "resa") return A$1; 44438 return b$1`<sonic-button 44439 type="${type}" 44440 href=${this.getCheckoutPath(payment).toString()} 44441 size="${o$4(this.size)}" 44442 shape="block" 44443 minWidth="8rem" 44444 autoActive="disabled" 44445 variant="${variant}" 44446 align="left" 44447 ?disabled=${!enableButton} 44448 >${renderPaymentIcon$1(payment.title)} 44449 <div>${payment.title}</div></sonic-button 44450 >`; 44451 })} 44452 </div>`; 44453 } 44454 }; 44455 SonicComponent$e.styles = [ 44456 tailwind, 44457 i$9` 44458 :host { 44459 width: 100%; 44460 display: block; 44461 } 44462 ` 44463 ]; 44464 __decorateClass$1V([ 44465 n$5({ type: Array }) 44466 ], SonicComponent$e.prototype, "payments_methods", 2); 44467 __decorateClass$1V([ 44468 r$5() 44469 ], SonicComponent$e.prototype, "resaAndCredit", 2); 44470 __decorateClass$1V([ 44471 r$5() 44472 ], SonicComponent$e.prototype, "paymentsWithoutResaAndCredit", 2); 44473 __decorateClass$1V([ 44474 n$5({ type: Boolean }) 44475 ], SonicComponent$e.prototype, "canCheckout", 2); 44476 __decorateClass$1V([ 44477 n$5({ type: Number }) 44478 ], SonicComponent$e.prototype, "quantity", 2); 44479 __decorateClass$1V([ 44480 n$5({ type: String }) 44481 ], SonicComponent$e.prototype, "size", 2); 44482 __decorateClass$1V([ 44483 n$5({ type: String }) 44484 ], SonicComponent$e.prototype, "align", 2); 44485 __decorateClass$1V([ 44486 n$5({ type: String }) 44487 ], SonicComponent$e.prototype, "layout", 2); 44488 __decorateClass$1V([ 44489 r$5() 44490 ], SonicComponent$e.prototype, "displayShowAllPayments", 2); 44491 __decorateClass$1V([ 44492 n$5({ type: Boolean }) 44493 ], SonicComponent$e.prototype, "showAllPayments", 2); 44494 __decorateClass$1V([ 44495 r$5() 44496 ], SonicComponent$e.prototype, "errorText", 2); 44497 __decorateClass$1V([ 44498 n$5() 44499 ], SonicComponent$e.prototype, "cartProvider", 2); 44500 __decorateClass$1V([ 44501 c({ context: appType, subscribe: true }), 44502 r$5() 44503 ], SonicComponent$e.prototype, "appType", 2); 44504 SonicComponent$e = __decorateClass$1V([ 44505 t$3(tagName$1e) 44506 ], SonicComponent$e); 44507 function renderPaymentIcon$1(text) { 44508 if (!text) return; 44509 const icons2 = { 44510 "cb/": "credit-card", 44511 cb: "credit-card", 44512 cheque: "money-check-dollar", 44513 espece: "money-bill-wave", 44514 exonere: "hand-peace", 44515 differe: "clock", 44516 passculture: "graduation-cap",
44517 compteclient: "wallet", 44518 virement: "arrow-right-arrow-left", 44519 reservation: "badge-check", 44520 sepa: "pen-nib", 44521 facture: "file-lines", 44522 paypal: "paypal", 44523 commander: "arrow-right", 44524 commande: "memo-circle-check", 44525 wonder: "sparkles", 44526 yep: "y", 44527 tourisme: "map-location", 44528 defaultIcon: "square-arrow-right" 44529 }; 44530 const cleanText = text.normalize("NFD").replaceAll(" ", "").replace(/[\u0300-\u036f]/g, "").toLowerCase(); 44531 const iconNamekey = Object.keys(icons2).find((key) => cleanText.includes(key)); 44532 const iconName = icons2[iconNamekey || "defaultIcon"]; 44533 return b$1`<sonic-icon slot="prefix" size="lg" name="${iconName}" library="custom"></sonic-icon>`; 44534 } 44535 var __defProp$1S = Object.defineProperty; 44536 var __getOwnPropDesc$1U = Object.getOwnPropertyDescriptor; 44537 var __decorateClass$1U = (decorators, target, key, kind) => { 44538 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1U(target, key) : target; 44539 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44540 if (decorator = decorators[i2]) 44541 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44542 if (kind && result) __defProp$1S(target, key, result); 44543 return result; 44544 }; 44545 let CartSummary = class extends Subscriber$1(i$6) { 44546 constructor() { 44547 super(...arguments); 44548 this.items = null; 44549 this.entities = null; 44550 this.quantity = 0; 44551 this.displayRemainingTime = false; 44552 this.displayTotal = false; 44553 this.noText = false; 44554 this.canEditSubscription = false; 44555 this.countEvents = 0; 44556 this.countTickets = 0; 44557 this.countGiftcards = 0; 44558 this.countSubscription = 0; 44559 this.countAdditionnalProduct = 0; 44560 this.countMerchs = 0; 44561 this.hasSeats = false; 44562 this._cartProvider = ""; 44563 this.mode = "default"; 44564 this._countUniqueEntityTypes = 0; 44565 } 44566 connectedCallback() { 44567 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 44568 super.connectedCallback(); 44569 } 44570 willUpdate(_changedProperties) { 44571 if (_changedProperties.has("items") || _changedProperties.has("entities")) { 44572 if (this.items && this.entities?.length) { 44573 let countUniqueEvents = 0; 44574 let countTickets = 0; 44575 let countGiftcards = 0; 44576 let countSubscription = 0; 44577 let countAdditionnalProduct = 0; 44578 let countMerchs = 0; 44579 countUniqueEvents = new Set( 44580 this.items.filter((item) => item.entity_type === EntityType.Event).map((item) => item.entity_id) 44581 ).size; 44582 this.items.forEach((item) => { 44583 switch (item.entity_type) { 44584 case EntityType.Event: 44585 countTickets += item.quantity || 1; 44586 break; 44587 case EntityType.Giftcard: 44588 countGiftcards++; 44589 break; 44590 case EntityType.Subscribe: 44591 countSubscription++; 44592 break; 44593 case EntityType.AdditionalProduct: 44594 countAdditionnalProduct++; 44595 break; 44596 case EntityType.Merch: 44597 countMerchs++; 44598 } 44599 }); 44600 this.countEvents = countUniqueEvents; 44601 this.countTickets = countTickets; 44602 this.countGiftcards = countGiftcards; 44603 this.countSubscription = countSubscription; 44604 this.countAdditionnalProduct = countAdditionnalProduct; 44605 this.countMerchs = countMerchs; 44606 this._countUniqueEntityTypes = new Set(this.items.map((item) => item.entity_type)).size; 44607 this.hasSeats = this.items?.some((item) => item.entity_type === EntityType.Event && item.seat?.id); 44608 } 44609 } 44610 super.willUpdate(_changedProperties); 44611 } 44612 render() { 44613 if (!this.items) { 44614 return A$1; 44615 } 44616 return b$1`<div class="@container"> 44617 <div class=" flex flex-wrap gap-x-3 @lg:gap-x-3 @xl:gap-x-4 gap-y-1 leading-none"> 44618 <slot name="prefix"></slot> 44619 44620 ${this.displayTotal ? b$1`<sonic-badge type="danger" size="sm" class="font-bold"> ${this.quantity}</sonic-badge>` : A$1} 44621 ${this.itemSummary({ 44622 title: t("LIB_event"),
44623 titlePlural: t("LIB_events"), 44624 icon: "calendar-day", 44625 count: this.countEvents 44626 })} 44627 ${this.itemSummary({ 44628 title: t("LIB_cartes_cadeaux"), 44629 titlePlural: t("LIB_cartes_cadeaux"), 44630 icon: "gift-card", 44631 count: this.countGiftcards 44632 })} 44633 ${this.itemSummary({ 44634 title: t("LIB_merch"), 44635 titlePlural: t("LIB_merchs"), 44636 icon: "bags-shopping", 44637 count: this.countMerchs 44638 })} 44639 ${this.itemSummary({ title: t("billet"), titlePlural: t("billets"), icon: "ticket", count: this.countTickets })} 44640 ${this.itemSummary({ 44641 title: t("LIB_produit_additionnel"), 44642 titlePlural: t("LIB_produits_additionnels"), 44643 icon: "circle-plus", 44644 count: this.countAdditionnalProduct 44645 })} 44646 ${this.itemSummary({ 44647 title: t("abonnement"), 44648 titlePlural: t("abonnement"), 44649 icon: "id-card", 44650 count: this.countSubscription 44651 })} 44652 ${this.renderSeatsSummary()} 44653 44654 <!-- TODO: add owners summary 44655 <sonic-cart-owners></sonic-cart-owners>--> 44656 44657 ${this.displayRemainingTime ? b$1`<sonic-cart-remaining-time class="font-bold text-center inline-flex "></sonic-cart-remaining-time>` : A$1} 44658 </div> 44659 </div>`; 44660 } 44661 itemSummary(options) { 44662 const { title, titlePlural, icon: icon2, count } = options; 44663 if (!count) { 44664 return A$1; 44665 } 44666 let textMarkup; 44667 if (this.noText) { 44668 textMarkup = A$1; 44669 } else { 44670 textMarkup = count > 1 ? b$1`${titlePlural}` : b$1`${title}`; 44671 } 44672 let classDisplayText = "@xs:inline-block"; 44673 if (this._countUniqueEntityTypes > 2) { 44674 classDisplayText = "@md:inline-block"; 44675 } else if (this._countUniqueEntityTypes > 3) { 44676 classDisplayText = "@lg:inline-block"; 44677 } else if (this._countUniqueEntityTypes > 4) { 44678 classDisplayText = "@xl:inline-block"; 44679 } 44680 return b$1` 44681 <div class="lowercase flex items-center gap-x-1 min-h-[1.1em]"> 44682 <sonic-icon library="custom" name="${icon2}" class="transform -translate-y-[.05em]"></sonic-icon> 44683 <span class="leading-none min-w-[1ch] " 44684 >${count} <span class="hidden ${classDisplayText}">${textMarkup}</span></span 44685 > 44686 </div> 44687 `; 44688 } 44689 renderSeatsSummary() { 44690 if (!this.hasSeats || this.mode !== "default") { 44691 return A$1; 44692 } 44693 return b$1`<sonic-tooltip label="${t("my_seats")}"> 44694 <sonic-button 44695 size="xs" 44696 variant="outline" 44697 class="text-sm" 44698 @click=${() => editSeatsModal({ cartProvider: this._cartProvider })} 44699 > 44700 <sonic-icon library="custom" name="loveseat"></sonic-icon> 44701 <span class="hidden @lg:inline-block">${t("my_seats")}</span> 44702 </sonic-button> 44703 </sonic-tooltip>`; 44704 } 44705 }; 44706 CartSummary.styles = [tailwind]; 44707 __decorateClass$1U([ 44708 n$5({ type: Array }) 44709 ], CartSummary.prototype, "items", 2); 44710 __decorateClass$1U([ 44711 n$5({ type: Array }) 44712 ], CartSummary.prototype, "entities", 2); 44713 __decorateClass$1U([ 44714 n$5({ type: Number }) 44715 ], CartSummary.prototype, "quantity", 2); 44716 __decorateClass$1U([ 44717 n$5({ type: Boolean }) 44718 ], CartSummary.prototype, "displayRemainingTime", 2); 44719 __decorateClass$1U([ 44720 n$5({ type: Boolean }) 44721 ], CartSummary.prototype, "displayTotal", 2); 44722 __decorateClass$1U([ 44723 n$5({ type: Boolean }) 44724 ], CartSummary.prototype, "noText", 2); 44725 __decorateClass$1U([ 44726 n$5({ type: Boolean }) 44727 ], CartSummary.prototype, "canEditSubscription", 2); 44728 __decorateClass$1U([ 44729 r$5() 44730 ], CartSummary.prototype, "countEvents", 2); 44731 __decorateClass$1U([ 44732 r$5() 44733 ], CartSummary.prototype, "countTickets", 2); 44734 __decorateClass$1U([ 44735 r$5() 44736 ], CartSummary.prototype, "countGiftcards", 2); 44737 __decorateClass$1U([ 44738 r$5() 44739 ], CartSummary.prototype, "countSubscription", 2); 44740 __decorateClass$1U([ 44741 r$5() 44742 ], CartSummary.prototype, "countAdditionnalProduct", 2); 44743 __decorateClass$1U([ 44744 r$5() 44745 ], CartSummary.prototype, "countMerchs", 2); 44746 __decorateClass$1U([ 44747 r$5() 44748 ], CartSummary.prototype, "hasSeats", 2); 44749 __decorateClass$1U([ 44750 r$5()
44751 ], CartSummary.prototype, "_cartProvider", 2); 44752 __decorateClass$1U([ 44753 c({ context: modeContext, subscribe: true }), 44754 n$5({ type: String }) 44755 ], CartSummary.prototype, "mode", 2); 44756 __decorateClass$1U([ 44757 r$5() 44758 ], CartSummary.prototype, "_countUniqueEntityTypes", 2); 44759 CartSummary = __decorateClass$1U([ 44760 t$3("sonic-cart-summary") 44761 ], CartSummary); 44762 var __defProp$1R = Object.defineProperty; 44763 var __getOwnPropDesc$1T = Object.getOwnPropertyDescriptor; 44764 var __decorateClass$1T = (decorators, target, key, kind) => { 44765 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1T(target, key) : target; 44766 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44767 if (decorator = decorators[i2]) 44768 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44769 if (kind && result) __defProp$1R(target, key, result); 44770 return result; 44771 }; 44772 let ClearCartButton = class extends Subscriber(i$6) { 44773 constructor() { 44774 super(...arguments); 44775 this.loading = false; 44776 this.quantity = null; 44777 } 44778 async clearCart() { 44779 this.loading = true; 44780 const cartProvider = this.getAncestorAttributeValue("cartProvider"); 44781 await Cart.removeItems({ 44782 apiConfiguration: this.getApiConfiguration(), 44783 cartProvider 44784 }); 44785 this.loading = false; 44786 } 44787 render() { 44788 if (this.quantity && this.quantity > 0) { 44789 return b$1` 44790 <sonic-tooltip label=${t("LIB_clear_cart")} placement="left"> 44791 <sonic-button 44792 icon 44793 size="lg" 44794 shape="circle" 44795 variant="ghost" 44796 @click="${this.clearCart}" 44797 ?loading=${this.loading} 44798 ?disabled=${this.loading} 44799 > 44800 <sonic-icon library="custom" name="trash"></sonic-icon> 44801 </sonic-button> 44802 </sonic-tooltip> 44803 `; 44804 } else { 44805 return A$1; 44806 } 44807 } 44808 }; 44809 ClearCartButton.styles = [tailwind]; 44810 __decorateClass$1T([ 44811 n$5({ type: Boolean }) 44812 ], ClearCartButton.prototype, "loading", 2); 44813 __decorateClass$1T([ 44814 n$5({ type: Number }) 44815 ], ClearCartButton.prototype, "quantity", 2); 44816 ClearCartButton = __decorateClass$1T([ 44817 t$3("sonic-clear-cart-btn") 44818 ], ClearCartButton); 44819 var __defProp$1Q = Object.defineProperty; 44820 var __getOwnPropDesc$1S = Object.getOwnPropertyDescriptor; 44821 var __decorateClass$1S = (decorators, target, key, kind) => { 44822 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1S(target, key) : target; 44823 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44824 if (decorator = decorators[i2]) 44825 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44826 if (kind && result) __defProp$1Q(target, key, result); 44827 return result; 44828 }; 44829 let WaitingCartsLink = class extends Subscriber(i$6) { 44830 constructor() { 44831 super(...arguments); 44832 this.size = "md"; 44833 this.variant = "ghost"; 44834 this.shape = "block"; 44835 } 44836 render() { 44837 if (!this.adminId || !this.waitingCarts) return A$1; 44838 const hasWaitingCarts = !!this.waitingCarts?.data?.length; 44839 const waitingCartText = this.waitingCarts?.total ? `${this.waitingCarts?.total} panier${this.waitingCarts?.total > 1 ? "s" : ""} en attente` : "Aucun panier en attente"; 44840 return b$1` 44841 ${hasWaitingCarts ? b$1` 44842 <sonic-app-link 44843 class="ml-auto relative" 44844 to="carts" 44845 size=${this.size} 44846 type="warning" 44847 .query=${{ "reset-filtres": "1", vendeur: this.adminId }} 44848 variant=${this.variant} 44849 shape="block" 44850 > 44851 <div class="relative inline-block"> 44852 <sonic-icon 44853 class="absolute -top-2 -left-2 text-[11px] animate-pulse rounded-full text-warning " 44854 library="custom" 44855 prefix="solid" 44856 name="clock" 44857 > 44858 </sonic-icon> 44859 <sonic-icon library="custom" name="basket-shopping"></sonic-icon> 44860 </div> 44861 ${waitingCartText} 44862 </sonic-app-link> 44863 ` : A$1} 44864 `; 44865 } 44866 }; 44867 WaitingCartsLink.styles = [tailwind]; 44868 __decorateClass$1S([ 44869 bind$1("admin/current.data.id"), 44870 n$5({ type: Number }) 44871 ], WaitingCartsLink.prototype, "adminId", 2); 44872 __decorateClass$1S([ 44873 bind$1("admin/waitingCarts"), 44874 r$5() 44875 ], WaitingCartsLink.prototype, "waitingCarts", 2); 44876 __decorateClass$1S([ 44877 n$5({ type: String }) 44878 ], WaitingCartsLink.prototype, "size", 2); 44879 __decorateClass$1S([ 44880 n$5({ type: String }) 44881 ], WaitingCartsLink.prototype, "variant", 2); 44882 __decorateClass$1S([ 44883 n$5({ type: String }) 44884 ], WaitingCartsLink.prototype, "shape", 2); 44885 WaitingCartsLink = __decorateClass$1S([ 44886 t$3("sonic-waiting-carts-link") 44887 ], WaitingCartsLink); 44888 var __defProp$1P = Object.defineProperty; 44889 var __getOwnPropDesc$1R = Object.getOwnPropertyDescriptor; 44890 var __decorateClass$1R = (decorators, target, key, kind) => { 44891 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1R(target, key) : target; 44892 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 44893 if (decorator = decorators[i2]) 44894 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 44895 if (kind && result) __defProp$1P(target, key, result); 44896 return result; 44897 }; 44898 let SonicCartItem = class extends Subscriber$1(i$6) { 44899 constructor() { 44900 super(...arguments); 44901 this.items = null; 44902 this.entities = null; 44903 this.linked_subscriptions = null; 44904 this.extras = null; 44905 this.canCheckout = false;
44906 this.canClearCart = false; 44907 this.total = 0; 44908 this.subTotal = 0; 44909 this.noAdditionalProducts = false; 44910 this.mode = "default"; 44911 this.showDetail = false; 44912 this.displaySummary = false; 44913 this.noDetailButton = false; 44914 this.layout = "default"; 44915 this.cartType = CartType.Cart; 44916 this.maxHeight = false; 44917 this._cartProvider = ""; 44918 this._hasEventsForSubscriptions = false; 44919 this._subscriptionsInCart = []; 44920 this.setMaxHeight = () => { 44921 if (!this.maxHeight) return; 44922 const top = this.getBoundingClientRect().top; 44923 let actionHeight = 0; 44924 if (this.actionElements) { 44925 this.actionElements.forEach((element) => { 44926 actionHeight += element.getBoundingClientRect().height; 44927 }); 44928 } 44929 const isNavigationV2 = document.documentElement.classList.contains("admin-navigation-v2"); 44930 const buttonDefaultHeight = isNavigationV2 ? 0 : 60; 44931 this.maxHeightValue = window.innerHeight - top - actionHeight - buttonDefaultHeight; 44932 }; 44933 this._resizeController = new h$1(this, { 44934 callback: this.setMaxHeight 44935 }); 44936 } 44937 connectedCallback() { 44938 if (this.maxHeight) { 44939 this.setMaxHeight(); 44940 window.addEventListener("resize", this.setMaxHeight); 44941 window.addEventListener("scroll", this.setMaxHeight); 44942 } 44943 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 44944 super.connectedCallback(); 44945 } 44946 disconnectedCallback() { 44947 super.disconnectedCallback(); 44948 if (this.maxHeight) { 44949 window.removeEventListener("resize", this.setMaxHeight); 44950 window.removeEventListener("scroll", this.setMaxHeight); 44951 } 44952 } 44953 async willUpdate(_changedProperties) { 44954 if (_changedProperties.has("items") && this.dataProvider) { 44955 if (this.items && this.entities?.length) { 44956 const groupedItems = groupItemsByEntity(this.items, this.entities); 44957 PublisherManager.get(this.dataProvider + "/clean").groupedItems.set(groupedItems); 44958 PublisherManager.get(this.dataProvider + "/clean").entities.set(this.entities); 44959 } 44960 } 44961 if (_changedProperties.has("items") || _changedProperties.has("linked_subscriptions")) { 44962 this._subscriptionsInCart = getCartSubscriptions({ 44963 items: this.items || [], 44964 linked_subscriptions: this.linked_subscriptions || [], 44965 can_attach_events: true 44966 }); 44967 } 44968 if (_changedProperties.has("_subscriptionsInCart")) { 44969 if (this._subscriptionsInCart.length > 0) { 44970 const apiConfiguration = HTML.getApiConfiguration(this); 44971 const events = await getEventsForSubscriptions({ 44972 apiConfiguration, 44973 subscriptions: this._subscriptionsInCart, 44974 accessParams: this.accessParams, 44975 limit: 1 44976 }); 44977 this._hasEventsForSubscriptions = events.length > 0; 44978 } else { 44979 this._hasEventsForSubscriptions = false; 44980 } 44981 } 44982 super.willUpdate(_changedProperties); 44983 } 44984 toggleDetail() { 44985 this.showDetail = !this.showDetail; 44986 this.dispatchEvent( 44987 new CustomEvent("detailChanged", { 44988 detail: { showDetail: this.showDetail }, 44989 bubbles: true, 44990 composed: true 44991 }) 44992 ); 44993 } 44994 render() { 44995 const isCurrentCart = this._cartProvider === "cart/current"; 44996 const isCondensed = this.layout == "condensed"; 44997 const showAdditionnal = !this.noAdditionalProducts && this.mode == "default"; 44998 if (!this.props) return A$1; 44999 const hasExtra = this.extras && this.extras?.length; 45000 const hasContent = !!this.items && this.items?.length > 0 || hasExtra; 45001 if (Object.keys(this.props).length === 0) return b$1`<sonic-loader mode="inline" class="mb-3"></sonic-loader>`; 45002 if (!hasContent) { 45003 const status = this.props && "status" in this.props ? this.props?.status : void 0; 45004 return b$1`<slot name="title"></slot> 45005 <sonic-cart-empty 45006 .status="${status}" 45007 .cartType="${this.cartType}" 45008 .mode="${this.mode}" 45009 class="${this.layout == "condensed" ? "lg:text-xl" : "text-lg lg:text-xl"} my-[2em] px-1 text-neutral-400" 45010 ></sonic-cart-empty>
45011 ${isCurrentCart ? b$1` <sonic-divider class="my-5"></sonic-divider 45012 ><sonic-waiting-carts-link 45013 shape="block" 45014 .size="${isCondensed ? "sm" : "md"}" 45015 variant="outline" 45016 ></sonic-waiting-carts-link>` : A$1} 45017 ${showAdditionnal ? this.renderAdditionnalProducts(isCondensed) : A$1} 45018 ${this.mode == "default" && !isCondensed && this.appType === "counter" ? this.renderActions() : A$1}`; 45019 } 45020 let styles2 = {}; 45021 if (this.maxHeightValue) { 45022 styles2 = { maxHeight: `clamp(200px, ${this.maxHeightValue}px, 2000px)` }; 45023 } 45024 const hasAction = this.mode !== "readonly"; 45025 const hideDetailText = isCondensed ? t("hide_detail_short") : t("hide_detail"); 45026 const showDetailText = isCondensed ? t("show_detail_short") : t("show_detail"); 45027 const displayEventChoiceButton = this.mode === "default" && this._hasEventsForSubscriptions && this.cartType !== CartType.WaitingLists; 45028 return b$1` 45029 <div class="@container"> 45030 <div class="flex w-full " data-action-area> 45031 <div class="min-w-0 grow"> 45032 <slot name="title"></slot> 45033 ${this.displaySummary ? b$1`<div class="flex items-center ${isCondensed ? "mb-2" : "mb-3"} gap-x-3 "> 45034 ${!this.noDetailButton ? b$1` 45035 <sonic-button 45036 @click=${this.toggleDetail} 45037 ?active=${this.showDetail} 45038 variant="unstyled" 45039 class="font-bold shrink-0 ${isCondensed ? "min-w-[4.5rem]" : "w-[12rem]"} " 45040 size="sm" 45041 > 45042 ${this.showDetail ? b$1`<sonic-icon library="custom" name="chevrons-up"></sonic-icon> 45043 <span class="underline underline-offset-2">${hideDetailText}</span>` : b$1`<sonic-icon library="custom" name="chevrons-down"></sonic-icon> 45044 <span class="underline underline-offset-2">${showDetailText}</span>`} 45045 </sonic-button> 45046 ` : A$1} 45047 <sonic-cart-summary 45048 ?displayRemainingTime=${isCurrentCart && !isCondensed} 45049 class="text-sm grow " 45050 ></sonic-cart-summary> 45051 </div>` : A$1} 45052 </div> 45053 <!-- Vider le panier --> 45054 ${this.canClearCart && hasAction ? b$1` <sonic-clear-cart-btn class="ml-auto"></sonic-clear-cart-btn> ` : A$1} 45055 </div> 45056 45057 <div 45058 style="${o$3(styles2)}" 45059 class="cart-content ${this.maxHeight ? "!overflow-y-auto overflow-x-hidden custom-scroll" : ""} ${isCondensed ? "pt-1" : "pt-3"}" 45060 > 45061 <sonic-list dataProvider="${this.dataProvider + "/clean"}" subDataProvider="groupedItems"> 45062 <template 45063 ><sonic-cart-item></sonic-cart-item> <sonic-cart-item-divider></sonic-cart-item-divider> 45064 </template> 45065 </sonic-list> 45066 45067 ${this.subTotal !== null && hasExtra ? b$1`<div 45068 class="text-right px-1 ${isCondensed ? "text-sm" : "text-base"} my-1 ${hasAction ? "mr-[2rem]" : ""} " 45069 > 45070 <sonic-cart-total isSubtotal></sonic-cart-total> 45071 </div>` : A$1} 45072 45073 <sonic-list subDataProvider="extras"> 45074 <template> 45075 <sonic-cart-item-line-extra></sonic-cart-item-line-extra> 45076 </template> 45077 </sonic-list> 45078 </div> 45079 45080 <div 45081 data-action-area 45082 class="px-1 ${hasAction ? "mr-[2rem]" : ""} ${isCondensed ? "text-lg @xl:text-xl" : "text-xl @xl:text-2xl "} py-[max(1.5%,.5rem)] text-right" 45083 > 45084 <sonic-cart-total></sonic-cart-total> 45085 </div> 45086 45087 <!-- Liste des produits additionels pouvant être ajoutés depuis le panier --> 45088 ${showAdditionnal ? this.renderAdditionnalProducts(isCondensed) : A$1} 45089 </div> 45090 45091 ${displayEventChoiceButton ? b$1`<div data-action-area class="py-4"> 45092 <sonic-button 45093 @click=${() => quickSelectModal({ cartProvider: this._cartProvider, accessParams: this.accessParams })} 45094 variant="outline" 45095 shape="block" 45096 > 45097 <sonic-icon name="calendar-check" library="custom"></sonic-icon>
45098 <span class="font-bold">${t("events_choice")}</span> 45099 </sonic-button> 45100 </div>` : A$1} 45101 ${this.mode == "default" && !isCondensed && this.appType === "counter" ? this.renderActions() : A$1} 45102 ${hasContent ? b$1`<slot name="actions"></slot>` : A$1} 45103 `; 45104 } 45105 renderActions() { 45106 if (isWaitingList(this.props?.cartType)) { 45107 return A$1; 45108 } 45109 const notReservationRequest = !isReservationRequest(this.props?.cartType); 45110 const enableSubscriptions = notReservationRequest && this.modules?.subscription?.enabled; 45111 const enableGiftcards = notReservationRequest && this.modules?.giftcards?.enabled; 45112 const enableMerch = notReservationRequest && this.modules?.shop?.enabled; 45113 return b$1` <div class="@container" data-action-area> 45114 <div class="flex flex-col @xl:flex-row gap-y-2 gap-x-1 pt-3 mb-4 "> 45115 <sonic-cart-add-entity .entityType=${EntityType.Event} class="block w-full"></sonic-cart-add-entity> 45116 ${enableSubscriptions ? b$1`<sonic-cart-add-entity 45117 .entityType=${EntityType.Subscribe} 45118 class="block w-full" 45119 ></sonic-cart-add-entity>` : A$1} 45120 ${enableGiftcards ? b$1`<sonic-cart-add-entity 45121 .entityType=${EntityType.Giftcard} 45122 class="block w-full" 45123 ></sonic-cart-add-entity>` : A$1} 45124 ${enableMerch ? b$1`<sonic-cart-add-entity .entityType=${EntityType.Merch} class="block w-full"></sonic-cart-add-entity> ` : A$1} 45125 </div> 45126 </div>`; 45127 } 45128 renderAdditionnalProducts(isCondensed) { 45129 const isCounter = this.appType === "counter"; 45130 if (isWaitingList(this.props?.cartType)) { 45131 return A$1; 45132 } 45133 return b$1`<div data-action-area class="text-right py-3 px-1"> 45134 <sonic-cart-additional-products 45135 ?condensed="${isCondensed}" 45136 ?flatten="${!isCounter}" 45137 ></sonic-cart-additional-products> 45138 </div>`; 45139 } 45140 }; 45141 SonicCartItem.styles = [ 45142 tailwind, 45143 customScroll, 45144 i$9` 45145 :host { 45146 text-align: left; 45147 display: block; 45148 } 45149 ` 45150 ]; 45151 __decorateClass$1R([ 45152 n$5({ type: Array }) 45153 ], SonicCartItem.prototype, "items", 2); 45154 __decorateClass$1R([ 45155 n$5({ type: Array }) 45156 ], SonicCartItem.prototype, "entities", 2); 45157 __decorateClass$1R([ 45158 n$5({ type: Array }) 45159 ], SonicCartItem.prototype, "linked_subscriptions", 2); 45160 __decorateClass$1R([ 45161 n$5({ type: Array }) 45162 ], SonicCartItem.prototype, "extras", 2); 45163 __decorateClass$1R([ 45164 n$5({ type: Boolean }) 45165 ], SonicCartItem.prototype, "canCheckout", 2); 45166 __decorateClass$1R([ 45167 n$5({ type: Boolean }) 45168 ], SonicCartItem.prototype, "canClearCart", 2); 45169 __decorateClass$1R([ 45170 n$5({ type: Number }) 45171 ], SonicCartItem.prototype, "total", 2); 45172 __decorateClass$1R([ 45173 n$5({ type: Number }) 45174 ], SonicCartItem.prototype, "subTotal", 2); 45175 __decorateClass$1R([ 45176 n$5({ type: Boolean }) 45177 ], SonicCartItem.prototype, "noAdditionalProducts", 2); 45178 __decorateClass$1R([ 45179 c({ context: modeContext, subscribe: true }), 45180 e$2({ context: modeContext }), 45181 n$5({ type: String }) 45182 ], SonicCartItem.prototype, "mode", 2); 45183 __decorateClass$1R([ 45184 e$2({ context: detailContext }), 45185 n$5({ type: Boolean }) 45186 ], SonicCartItem.prototype, "showDetail", 2); 45187 __decorateClass$1R([ 45188 n$5({ type: Boolean }) 45189 ], SonicCartItem.prototype, "displaySummary", 2); 45190 __decorateClass$1R([ 45191 n$5({ type: Boolean }) 45192 ], SonicCartItem.prototype, "noDetailButton", 2); 45193 __decorateClass$1R([ 45194 e$2({ context: layoutContext }), 45195 n$5({ type: String }) 45196 ], SonicCartItem.prototype, "layout", 2); 45197 __decorateClass$1R([ 45198 c({ context: cartTypeContext, subscribe: true }), 45199 e$2({ context: cartTypeContext }), 45200 n$5({ type: String }) 45201 ], SonicCartItem.prototype, "cartType", 2); 45202 __decorateClass$1R([ 45203 c({ context: accessParamsContext, subscribe: true }), 45204 n$5({ type: Object }) 45205 ], SonicCartItem.prototype, "accessParams", 2); 45206 __decorateClass$1R([ 45207 c({ context: appType, subscribe: true }) 45208 ], SonicCartItem.prototype, "appType", 2); 45209 __decorateClass$1R([ 45210 n$5({ type: Boolean }) 45211 ], SonicCartItem.prototype, "maxHeight", 2); 45212 __decorateClass$1R([ 45213 r$4("[data-action-area]") 45214 ], SonicCartItem.prototype, "actionElements", 2); 45215 __decorateClass$1R([ 45216 r$5() 45217 ], SonicCartItem.prototype, "maxHeightValue", 2); 45218 __decorateClass$1R([ 45219 bind$1("settings.modules"), 45220 n$5({ type: Object }) 45221 ], SonicCartItem.prototype, "modules", 2); 45222 __decorateClass$1R([ 45223 r$5() 45224 ], SonicCartItem.prototype, "_hasEventsForSubscriptions", 2); 45225 __decorateClass$1R([ 45226 r$5() 45227 ], SonicCartItem.prototype, "_subscriptionsInCart", 2); 45228 SonicCartItem = __decorateClass$1R([ 45229 t$3("sonic-cart-items") 45230 ], SonicCartItem); 45231 var __defProp$1O = Object.defineProperty; 45232 var __getOwnPropDesc$1Q = Object.getOwnPropertyDescriptor; 45233 var __decorateClass$1Q = (decorators, target, key, kind) => { 45234 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1Q(target, key) : target; 45235 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 45236 if (decorator = decorators[i2]) 45237 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 45238 if (kind && result) __defProp$1O(target, key, result); 45239 return result; 45240 }; 45241 let SonicPromo = class extends Subscriber$1(i$6) { 45242 constructor() { 45243 super(...arguments); 45244 this.giftcardEnabled = false;
45245 } 45246 invalidateCart(apiResult) { 45247 if (apiResult.success && this.cartProvider) { 45248 PublisherManager.get(this.cartProvider).invalidate(); 45249 this.giftCardCode = ""; 45250 } 45251 } 45252 connectedCallback() { 45253 if (!this.cartProvider) { 45254 this.cartProvider = this.getAncestorAttributeValue("cartProvider"); 45255 } 45256 super.connectedCallback(); 45257 } 45258 render() { 45259 if (this.giftcardEnabled) { 45260 const cartId = this.cartProvider?.split("/")?.pop() || "current"; 45261 return b$1` 45262 <div 45263 formdataprovider="giftcardForm" 45264 submitresultdataprovider="giftcardResult" 45265 dataProvider="giftcards" 45266 method="post" 45267 > 45268 <sonic-input type="hidden" name="cartId" value="${cartId}"></sonic-input> 45269 45270 <sonic-submit onEnterKey> 45271 <sonic-input 45272 size=${o$4(this.size)} 45273 name="code" 45274 placehoderAsLabel 45275 placeholder=${t("LIB_cartes_cadeaux")} 45276 inlineContent 45277 > 45278 <sonic-icon library="custom" name="gift-card" slot="prefix"></sonic-icon> 45279 45280 <sonic-submit onClick slot="suffix"> 45281 <sonic-tooltip label="${t("submit")}"> 45282 <sonic-button 45283 size=${o$4(this.size)} 45284 shape="square" 45285 icon 45286 variant="unstyled" 45287 data-aria-label=${t("submit")} 45288 > 45289 <sonic-icon 45290 library="iconoir" 45291 name="check" 45292 class="${this.giftCardCode ? "opacity-100 animate-[pulse.5s_ease-in-out_infinite_.5s] inline-block" : "opacity-30"}" 45293 ></sonic-icon> 45294 </sonic-button> 45295 </sonic-tooltip> 45296 </sonic-submit> 45297 </sonic-input> 45298 </sonic-submit> 45299 </div> 45300 `; 45301 } else { 45302 return A$1; 45303 } 45304 } 45305 }; 45306 SonicPromo.styles = [tailwind]; 45307 __decorateClass$1Q([ 45308 bind$1("settings.modules.giftcards.enabled"), 45309 n$5({ type: Boolean }) 45310 ], SonicPromo.prototype, "giftcardEnabled", 2); 45311 __decorateClass$1Q([ 45312 n$5({ type: String }) 45313 ], SonicPromo.prototype, "size", 2); 45314 __decorateClass$1Q([ 45315 bind$1("giftcardForm.code"), 45316 n$5({ type: String }) 45317 ], SonicPromo.prototype, "giftCardCode", 2); 45318 __decorateClass$1Q([ 45319 n$5({ type: String }) 45320 ], SonicPromo.prototype, "cartProvider", 2); 45321 __decorateClass$1Q([ 45322 onAssign$1("giftcardResult") 45323 ], SonicPromo.prototype, "invalidateCart", 1); 45324 SonicPromo = __decorateClass$1Q([ 45325 t$3("sonic-giftcard-form") 45326 ], SonicPromo); 45327 var __defProp$1N = Object.defineProperty; 45328 var __getOwnPropDesc$1P = Object.getOwnPropertyDescriptor; 45329 var __decorateClass$1P = (decorators, target, key, kind) => { 45330 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1P(target, key) : target; 45331 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 45332 if (decorator = decorators[i2]) 45333 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 45334 if (kind && result) __defProp$1N(target, key, result); 45335 return result; 45336 }; 45337 const tagName$1d = "sonic-use-my-giftcards"; 45338 let SonicGiftcardSelect = class extends Fetcher$1(Subscriber$1(i$6)) { 45339 constructor() { 45340 super(...arguments); 45341 this.data = null; 45342 this.cartProvider = ""; 45343 this.invalidateMyGiftCards = (_apiDataResult) => { 45344 if (this.dataProvider) { 45345 PublisherManager.get(this.dataProvider).invalidate(); 45346 } 45347 this._fetchData(); 45348 }; 45349 } 45350 connectedCallback() { 45351 this.isFetchEnabled = false; 45352 if (!this.cartProvider) { 45353 this.cartProvider = this.getAncestorAttributeValue("cartProvider") || "cart/current"; 45354 } 45355 this.dataProvider = this.cartProvider + "/cartMyGiftcards"; 45356 PublisherManager.get(this.cartProvider).data.onAssign(this.invalidateMyGiftCards); 45357 super.connectedCallback(); 45358 } 45359 disconnectedCallback() { 45360 PublisherManager.get(this.cartProvider).data.offAssign(this.invalidateMyGiftCards); 45361 super.disconnectedCallback(); 45362 } 45363 handleSubmit(e2) { 45364 if (e2.detail?.success == true) { 45365 PublisherManager.get(this.cartProvider).invalidate(); 45366 if (this.dataProvider) { 45367 PublisherManager.get(this.dataProvider).invalidate(); 45368 } 45369 } 45370 } 45371 willUpdate(changedProperties) { 45372 if (changedProperties.has("userId") && this.userId && !this.isFetchEnabled) { 45373 this.endPoint = `/user/${this.userId}/purchases/giftcard?owner=${this.userId}&available=true&inUse=false`; 45374 this.isFetchEnabled = true; 45375 this._fetchData(); 45376 } 45377 super.willUpdate(changedProperties); 45378 } 45379 render() { 45380 const hasData = this.data && this.data.length > 0; 45381 if (!hasData) { 45382 this.style.display = "none"; 45383 } else { 45384 this.style.display = "block"; 45385 } 45386 if (!this.data || this.data.length == 0 || !this.userId) return A$1; 45387 const cartId = this.cartProvider?.split("/")?.pop() || "current"; 45388 return b$1`<div>
45389 <sonic-divider class="uppercase text-xs mb-3 text-center text-neutral-500"> 45390 <sonic-icon name="gift-card" library="custom"></sonic-icon> ${t("giftcard_available")} 45391 </sonic-divider> 45392 45393 <div 45394 formdataprovider="cartMyGiftcardForm" 45395 submitresultdataprovider="cartMyGiftcardResult" 45396 dataProvider="giftcards" 45397 method="post" 45398 class="flex flex-wrap gap-2 justify-center" 45399 > 45400 <sonic-input type="hidden" name="cartId" value="${cartId}"></sonic-input> 45401 45402 ${c$1( 45403 this.data, 45404 (purchase) => purchase.giftcard?.code, 45405 (purchase) => { 45406 return b$1`${purchase.giftcard?.code ? b$1`<sonic-submit onClick clearedDataOnSuccess="cartMyGiftcardForm" @submit=${this.handleSubmit} 45407 ><sonic-button unique size="xs" name="code" value=${purchase.giftcard.code}> 45408 <div class="font-bold text-xs "> 45409 ${purchase.entity?.edito?.alt_title || purchase.entity?.edito?.title} 45410 </div> 45411 <span class="tracking-wide"> ${purchase.giftcard?.code} </span> 45412 ${purchase.giftcard?.remaining_amount ? b$1`/ ${formatAmount(purchase.giftcard?.remaining_amount || 0)}` : A$1} 45413 </sonic-button></sonic-submit 45414 >` : A$1}`; 45415 } 45416 )} 45417 </div> 45418 </div> `; 45419 } 45420 }; 45421 SonicGiftcardSelect.styles = [ 45422 tailwind, 45423 i$9` 45424 :host() { 45425 display: block; 45426 } 45427 ` 45428 ]; 45429 __decorateClass$1P([ 45430 bind$1("user.id"), 45431 n$5({ type: String }) 45432 ], SonicGiftcardSelect.prototype, "userId", 2); 45433 __decorateClass$1P([ 45434 n$5({ type: Array }) 45435 ], SonicGiftcardSelect.prototype, "data", 2); 45436 __decorateClass$1P([ 45437 n$5({ type: String }) 45438 ], SonicGiftcardSelect.prototype, "cartProvider", 2); 45439 SonicGiftcardSelect = __decorateClass$1P([ 45440 t$3(tagName$1d) 45441 ], SonicGiftcardSelect); 45442 const checkCanUseCredit = (proAccess, credit) => { 45443 if (!proAccess || !credit) return false; 45444 const isEnableForPros = credit?.enabledForPros ?? false; 45445 const isEnableForCustomers = credit?.enabledForCustomer ?? false; 45446 if (proAccess === "yes") { 45447 return isEnableForPros; 45448 } else { 45449 return isEnableForCustomers; 45450 } 45451 }; 45452 var __defProp$1M = Object.defineProperty; 45453 var __getOwnPropDesc$1O = Object.getOwnPropertyDescriptor; 45454 var __decorateClass$1O = (decorators, target, key, kind) => { 45455 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1O(target, key) : target; 45456 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 45457 if (decorator = decorators[i2]) 45458 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 45459 if (kind && result) __defProp$1M(target, key, result); 45460 return result; 45461 }; 45462 let SonicUseMyCredit = class extends i$6 { 45463 constructor() { 45464 super(...arguments); 45465 this.balance = 0; 45466 this.cartId = "current"; 45467 this.hasCreditInCurrentCart = false; 45468 this._canUseCredit = false; 45469 } 45470 willUpdate(_changedProperties) { 45471 if (_changedProperties.has("cart")) { 45472 this.hasCreditInCurrentCart = this.cart?.extras?.some((extra) => extra.entity_type === EntityType.Credit) ?? false; 45473 } 45474 if (_changedProperties.has("proAccess") || _changedProperties.has("credit") || _changedProperties.has("userId")) { 45475 this._canUseCredit = checkCanUseCredit(this.proAccess, this.credit); 45476 } 45477 super.willUpdate(_changedProperties); 45478 } 45479 async useMyCredit() { 45480 const api2 = new API(HTML.getApiConfiguration(this)); 45481 const cartId = Number(this.cart?.id) || 0; 45482 const response = await api2.post("/cart/discount", { 45483 type: "user_credit", 45484 userId: this.userId, 45485 cartId 45486 }); 45487 if (response.success && cartId) { 45488 Cart.updateCart(api2, `cart/${cartId}`); 45489 } 45490 } 45491 render() { 45492 if (this.balance <= 0 || !this._canUseCredit) return A$1; 45493 if (this.hasCreditInCurrentCart) return A$1; 45494 const hasBalanceButNoCartId = this.balance > 0 && !this.cart?.id; 45495 const cartTotal = this.cart?.total || 0; 45496 const remainingBalance = cartTotal < this.balance ? this.balance - cartTotal : 0; 45497 if (hasBalanceButNoCartId) 45498 return b$1` 45499 <sonic-alert status="info" size="sm" align="center" class="animate-pulse" noIcon> 45500 <strong>
45500${formatAmount(this.balance)} ${t("available_as_a_credit")}</strong><br /> 45501 ${t("LIB_use_your_credit_finalization")} 45502 </sonic-alert> 45503 `; 45504 return b$1`<sonic-divider> 45505 <sonic-button @click=${this.useMyCredit} type="info" variant="outline" size="sm"> 45506 <div> 45507 <sonic-icon name="wallet" library="custom" size="lg"></sonic-icon> 45508 <span class="font-bold"> ${t("LIB_use_your_credit")} : ${formatAmount(this.balance)}</span> 45509 </div> 45510 ${remainingBalance > 0 ? b$1` 45511 <div class="text-xs mt-1">${t("LIB_use_your_credit_remaining")} ${formatAmount(remainingBalance)}</div> 45512 ` : A$1} 45513 </sonic-button> 45514 </sonic-divider>`; 45515 } 45516 }; 45517 SonicUseMyCredit.styles = [tailwind]; 45518 __decorateClass$1O([ 45519 bind$1("user.balance"), 45520 n$5({ type: Number }) 45521 ], SonicUseMyCredit.prototype, "balance", 2); 45522 __decorateClass$1O([ 45523 bind$1("user.id"), 45524 n$5({ type: String }) 45525 ], SonicUseMyCredit.prototype, "userId", 2); 45526 __decorateClass$1O([ 45527 bind$1("user.proAccess"), 45528 n$5({ type: String }) 45529 ], SonicUseMyCredit.prototype, "proAccess", 2); 45530 __decorateClass$1O([ 45531 bind$1("settings.credit"), 45532 n$5({ type: Boolean }) 45533 ], SonicUseMyCredit.prototype, "credit", 2); 45534 __decorateClass$1O([ 45535 bind$1("cart/${cartId}.data"), 45536 n$5({ type: Object }) 45537 ], SonicUseMyCredit.prototype, "cart", 2); 45538 __decorateClass$1O([ 45539 n$5({ type: String }) 45540 ], SonicUseMyCredit.prototype, "cartId", 2); 45541 __decorateClass$1O([ 45542 r$5() 45543 ], SonicUseMyCredit.prototype, "hasCreditInCurrentCart", 2); 45544 __decorateClass$1O([ 45545 r$5() 45546 ], SonicUseMyCredit.prototype, "_canUseCredit", 2); 45547 SonicUseMyCredit = __decorateClass$1O([ 45548 t$3("sonic-use-my-credit") 45549 ], SonicUseMyCredit); 45550 var __defProp$1L = Object.defineProperty; 45551 var __getOwnPropDesc$1N = Object.getOwnPropertyDescriptor; 45552 var __decorateClass$1N = (decorators, target, key, kind) => { 45553 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1N(target, key) : target; 45554 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 45555 if (decorator = decorators[i2]) 45556 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 45557 if (kind && result) __defProp$1L(target, key, result); 45558 return result; 45559 }; 45560 const tagName$1c = "sonic-cart-actions"; 45561 let CartActions = class extends Subscriber$1(i$6) { 45562 constructor() { 45563 super(...arguments); 45564 this.messages = []; 45565 this.layout = "default"; 45566 this.cartType = CartType.Cart; 45567 this.quantity = 0; 45568 this.promoEnabled = false; 45569 this.giftcardEnabled = false; 45570 this.noSuffix = false; 45571 this.canSplitCart = false; 45572 this.extras = []; 45573 this._reservationRequestConfig = null; 45574 this.handleSaveCart = (e2, goToSplit = false) => { 45575 if (e2.detail?.success == true) { 45576 PublisherManager.get(this.cartProvider || "cart/current").invalidate(); 45577 const data = e2.detail?.data; 45578 const id = data?.id; 45579 if (id) { 45580 if (goToSplit) { 45581 appRoute("reservation").fill({ id }).query({ display_split: true }).goTo(); 45582 } else { 45583 appRoute("reservation").fill({ id }).goTo(); 45584 } 45585 } 45586 } 45587 }; 45588 } 45589 connectedCallback() { 45590 if (!this.cartProvider) { 45591 this.cartProvider = this.getAncestorAttributeValue("cartProvider"); 45592 } 45593 super.connectedCallback(); 45594 } 45595 async willUpdate(_changedProperties) { 45596 const isCounter = this.appType === "counter"; 45597 const hasExchange = this.extras && this.extras.some((item) => item.exchange_id); 45598 this.canSplitCart = this.cartProvider === "cart/current" && !this.noSuffix && this.quantity > 1 && !hasExchange && isCounter && this.cartType === CartType.Cart && this.props?.canCheckout === true; 45599 if (isReservationRequest(this.cartType)) { 45600 const reservationRequestConfigId = this.props?.reservationRequestConfigId; 45601 if (reservationRequestConfigId !== this._reservationRequestConfig?.id) { 45602 const apiConfiguration = this.getApiConfiguration(); 45603 const api2 = new API(apiConfiguration); 45604 const result = await api2.get(`reservation-request-config/${reservationRequestConfigId}`); 45605 if (result?.data && result.success) { 45606 this._reservationRequestConfig = result.data; 45607 } 45608 } 45609 } else { 45610 this._reservationRequestConfig = null; 45611 } 45612 super.willUpdate(_changedProperties); 45613 } 45614 render() {
45615 const isCondensed = this.layout == "condensed"; 45616 const isCurrentCart = this.cartProvider === "cart/current"; 45617 const displaySuffixDivider = !this.noSuffix && this.quantity && (this.promoEnabled || this.giftcardEnabled) && isCurrentCart; 45618 return b$1`<div class=" grid grid-cols-1 ${isCondensed ? "gap-3" : "gap-7"} "> 45619 ${this.quantity && isCurrentCart ? b$1`<sonic-use-my-giftcards></sonic-use-my-giftcards><sonic-use-my-credit></sonic-use-my-credit>` : A$1} 45620 ${this.reservationRequestActions()} 45621 <sonic-cart-payment-buttons size=${isCondensed ? "sm" : "md"}></sonic-cart-payment-buttons> 45622 45623 ${isCurrentCart && this.quantity && !this.noSuffix && this.appType === "counter" ? b$1` 45624 <div class="flex gap-2 justify-center w-full"> 45625 <sonic-submit 45626 endPoint="/cart/current/save" 45627 method="post" 45628 onEnterKey 45629 onClick 45630 @submit=${(event) => this.handleSaveCart(event, false)} 45631 > 45632 <sonic-tooltip label="Sauvegarde temporaire"> 45633 <sonic-button autoActive="disabled" size="sm" align="left" variant="outline" shape="circle" icon> 45634 <div class="relative inline-flex"> 45635 <sonic-icon 45636 name="floppy-disk" 45637 library="custom" 45638 class="translate-x-[1px] translate-y-[-1px]" 45639 ></sonic-icon> 45640 <sonic-icon 45641 name="clock" 45642 library="custom" 45643 prefix="solid" 45644 class="text-[11px] absolute bottom-[-2px] left-[-2px] bg-neutral-0 size-[13px] border-px border-neutral-0 rounded-full flex items-center" 45645 ></sonic-icon> 45646 </div> 45647 </sonic-button> 45648 </sonic-tooltip> 45649 </sonic-submit> 45650 45651 <sonic-submit 45652 endPoint="/cart/current/save" 45653 method="post" 45654 onEnterKey 45655 onClick 45656 class="grow" 45657 ?disabled=${!this.canSplitCart} 45658 @submit=${(event) => this.handleSaveCart(event, true)} 45659 > 45660 <sonic-button autoActive="disabled" size="sm" shape="block" align="left" variant="outline"> 45661 <sonic-icon slot="prefix" name="split" library="custom" size="lg"></sonic-icon> 45662 Diviser 45663 </sonic-button> 45664 </sonic-submit> 45665 </div> 45666 ` : A$1} 45667 ${this.quantity ? b$1` <slot name="customActions"></slot>` : A$1} 45668 ${displaySuffixDivider ? b$1`<sonic-divider noMargin></sonic-divider>` : A$1} 45669 ${!this.noSuffix && isCurrentCart ? b$1` <div class="flex flex-wrap gap-2 justify-center w-full"> 45670 <sonic-promo-form 45671 size=${isCondensed ? "xs" : "sm"} 45672 class=" flew-grow block text-left ${isCondensed ? " max-w-[10rem] " : "max-w-[13rem] "} " 45673 ></sonic-promo-form> 45674 45675 ${this.quantity ? b$1` <sonic-giftcard-form 45676 size=${isCondensed ? "xs" : "sm"} 45677 class=" flew-grow block text-left ${isCondensed ? " max-w-[10rem] " : "max-w-[13rem] "}" 45678 ></sonic-giftcard-form>` : A$1} 45679 </div>` : A$1} 45680 </div>`; 45681 } 45682 reservationRequestActions() { 45683 const items = this.props?.items || []; 45684 const extras = this.props?.extras || []; 45685 const hasItemsOrExtras = items?.length || extras?.length; 45686 if (!isReservationRequest(this.cartType) && !isWaitingList(this.cartType) || !hasItemsOrExtras) return A$1; 45687 if (this.props?.canCheckout && "status" in this.props && this.props?.status && this.props?.status === ReservationStatus.Incomplete && hasItemsOrExtras) { 45688 return b$1` 45689 <sonic-button 45690 slot="actions" 45691 type="success" 45692 @click=${() => this.lockReservationRequestModal(this.cartType, this.appType)} 45693 > 45694 <sonic-icon library="custom" name="check"></sonic-icon> 45695 ${t("confirm")} 45696 </sonic-button> 45697 `; 45698 } 45699 return A$1; 45700 } 45701 lockReservationRequestModal(cartType, appType2) { 45702 const cartProvider = this.cartProvider; 45703 const id = this.props && "id" in this.props && this.props.id ? this.props.id : ""; 45704 let formKey = `formInfos/requestLockForm/${cartType}/${id}`; 45705 let title = t("LIB_request_lock_title"); 45706 let subTitle = t("LIB_request_lock_subtitle"); 45707 let precisionLabel = t("LIB_precisions"); 45708 if (appType2 === "counter") { 45709 subTitle = t("LIB_request_lock_subtitle_counter"); 45710 precisionLabel = t("LIB_precisions_publiques"); 45711 } 45712 const description2 = isReservationRequest(cartType) ? t("LIB_indications_pmr_publiques_specifiques_financements") : void 0; 45713 const displayPublicNotes = this._reservationRequestConfig ? this._reservationRequestConfig?.display_public_notes : true; 45714 if (!cartProvider) return; 45715 Modal.create({ 45716 title, 45717 subtitle: subTitle, 45718 content: b$1` 45719 ${displayPublicNotes ? b$1` 45720 <div formDataProvider=${formKey}> 45721 <sonic-textarea 45722 label="${precisionLabel}" 45723 rows="4" 45724 name="publicNotes" 45725 value=${this.props?.publicNotes} 45726 .description=${description2} 45727 ></sonic-textarea> 45728 </div> 45729 ` : A$1} 45730 `, 45731 actions: b$1` <sonic-button 45732 shape="block" 45733 minWidth="10rem" 45734 hideModal 45735 type="success" 45736 @click=${async () => { 45737 const apiConfiguration = this.getApiConfiguration(); 45738 const api2 = new API(apiConfiguration); 45739 const publicNotes = dp$1(formKey).publicNotes.get(); 45740 const result = await api2.patch(cartProvider, { publicNotes }); 45741 if (result?.success) { 45742 await lockReservationRequest(apiConfiguration, cartProvider); 45743 } 45744 }} 45745 type="primary" 45746 > 45747 <sonic-icon library="custom" name="check"></sonic-icon> 45748 ${t("confirm")}</sonic-button 45749 > 45750 <sonic-button shape="block" minWidth="10rem" hideModal> ${t("cancel")}</sonic-button>`, 45751 maxWidth: "38rem", 45752 removeOnHide: true 45753 }); 45754 } 45755 }; 45756 CartActions.styles = [tailwind]; 45757 __decorateClass$1N([ 45758 n$5({ type: Array }) 45759 ], CartActions.prototype, "messages", 2); 45760 __decorateClass$1N([ 45761 c({ context: layoutContext, subscribe: true }), 45762 n$5({ type: String }) 45763 ], CartActions.prototype, "layout", 2); 45764 __decorateClass$1N([ 45765 c({ context: cartTypeContext, subscribe: true }), 45766 n$5({ type: String }) 45767 ], CartActions.prototype, "cartType", 2); 45768 __decorateClass$1N([ 45769 n$5({ type: Number }) 45770 ], CartActions.prototype, "quantity", 2); 45771 __decorateClass$1N([ 45772 c({ context: appType, subscribe: true }), 45773 r$5() 45774 ], CartActions.prototype, "appType", 2); 45775 __decorateClass$1N([ 45776 n$5({ type: String }) 45777 ], CartActions.prototype, "cartProvider", 2); 45778 __decorateClass$1N([ 45779 bind$1("settings.modules.giftcards.enabled"), 45780 n$5({ type: Boolean }) 45781 ], CartActions.prototype, "promoEnabled", 2); 45782 __decorateClass$1N([ 45783 bind$1("settings.promotion_code"), 45784 n$5({ type: Boolean }) 45785 ], CartActions.prototype, "giftcardEnabled", 2); 45786 __decorateClass$1N([ 45787 n$5({ type: Boolean }) 45788 ], CartActions.prototype, "noSuffix", 2); 45789 __decorateClass$1N([ 45790 r$5() 45791 ], CartActions.prototype, "canSplitCart", 2); 45792 __decorateClass$1N([ 45793 r$5() 45794 ], CartActions.prototype, "extras", 2); 45795 __decorateClass$1N([ 45796 r$5() 45797 ], CartActions.prototype, "_reservationRequestConfig", 2); 45798 CartActions = __decorateClass$1N([ 45799 t$3(tagName$1c) 45800 ], CartActions); 45801 const endpoints = { 45802 /** POST â Synchronize access control badge context. @hostProps badgeId: string | number */ 45803 accessControlBadgeSync: new Endpoint("access-control/badges/${badgeId}/sync"),
45804 /** POST â Create a ticket from access control. @hostProps sessionId: string | number */ 45805 accessControlSessionCreateTicket: new Endpoint("access-control/sessions/${sessionId}/tickets"), 45806 /** POST â Synchronize access control session. @hostProps sessionId: string | number */ 45807 accessControlSessionSync: new Endpoint("access-control/sessions/${sessionId}/sync"), 45808 /** GET â Products informations */ 45809 accessItems: new Endpoint("access-control/access-items"), 45810 /** POST â Connexion accréditation PRO autorisée au public */ 45811 accreditationLogin: new Endpoint("accreditations/login"), 45812 /** GET â Permet de se déconnecter de l'accréditation PRO */ 45813 accreditationsLogout: new Endpoint("accreditations/logout"), 45814 /** POST â Request a ticket refund */ 45815 askRefund: new Endpoint("refunds/ask"), 45816 /** PUT â Annuler la soumission d'une demande de réservation. @hostProps reservationRequestId: string | number */ 45817 cancelSubmissionReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/cancel-submission"), 45818 /** DELETE â Cancel a ticket online */ 45819 cancelTicket: new Endpoint("tickets"), 45820 /** POST â Cancel ticket for store credit */ 45821 cancelTicketForCredit: new Endpoint("tickets/cancel-for-credit"), 45822 /** GET â Check queue authorization */ 45823 checkQueueAuthorization: new Endpoint("queue/authorized"), 45824 /** POST â Check seat availability */ 45825 checkSeatAvailability: new Endpoint("seat-availability/check"), 45826 /** POST â Check subscription validity for partner event purchase */ 45827 checkSubscription: new Endpoint("partner/check_subscription"), 45828 /** PUT â Confirm a reservation. @hostProps reservationId: string | number */ 45829 confirmReservation: new Endpoint("reservations/${reservationId}/confirm"), 45830 /** PUT â Confirm a reservation request. @hostProps reservationRequestId: string | number */ 45831 confirmReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/confirm"), 45832 /** POST â Contact accréditation PRO */ 45833 contactAccreditation: new Endpoint("accreditations/contact"), 45834 /** POST â Créer un lien de connexion simplifié. @hostProps identifiant: string | number */ 45835 createAdminLoginLink: new Endpoint("admin/${identifiant}/login-link"), 45836 /** POST â Create a new reservation */ 45837 createReservation: new Endpoint("reservations"), 45838 /** POST â Create a new reservation request */ 45839 createReservationRequest: new Endpoint("reservation-request"), 45840 /** PUT â Décliner une demande de réservation. @hostProps reservationRequestId: string | number */ 45841 declineReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/decline"), 45842 /** DELETE â Delete an activity. @hostProps activityId: string | number */ 45843 deleteActivity: new Endpoint("activity/${activityId}"), 45844 /** DELETE â Delete a cart. @hostProps cartId: string | number */ 45845 deleteCart: new Endpoint("cart/${cartId}"), 45846 /** DELETE â Delete one item of a cart. @hostProps cartId: string | number; itemId: string | number */ 45847 deleteCartItem: new Endpoint("cart/${cartId}/items/${itemId}"), 45848 /** DELETE â Delete items of a cart. @hostProps cartId: string | number */ 45849 deleteCartItems: new Endpoint("cart/${cartId}/items"), 45850 /** DELETE â Delete a category. @hostProps categoryId: string | number */ 45851 deleteCategory: new Endpoint("categories/${categoryId}"), 45852 /** DELETE â Delete a label. @hostProps labelId: string | number */ 45853 deleteLabel: new Endpoint("label/${labelId}"), 45854 /** DELETE â Suppression d'un code promo actif */ 45855 deletePromotionCode: new Endpoint("promotion-code"), 45856 /** DELETE â Expire queue session */ 45857 deleteQueueSession: new Endpoint("queue/session"), 45858 /** DELETE â Delete a quota. @hostProps quotaId: string | number */ 45859 deleteQuota: new Endpoint("quota/${quotaId}"), 45860 /** DELETE â Delete a reservation. @hostProps reservationId: string | number */ 45861 deleteReservation: new Endpoint("reservations/${reservationId}"), 45862 /** PUT â Supprimer la réservation et restaurer la demande. @hostProps reservationId: string | number */ 45863 deleteReservationAndRestoreRequest: new Endpoint("reservations/${reservationId}/delete-and-restore-request"), 45864 /** DELETE â Delete an item from a reservation. @hostProps reservationId: string | number; itemId: string | number */ 45865 deleteReservationItem: new Endpoint("reservations/${reservationId}/items/${itemId}"), 45866 /** DELETE â Delete multiple items from a reservation (based on criteria). @hostProps reservationId: string | number */ 45867 deleteReservationItems: new Endpoint("reservations/${reservationId}/items"), 45868 /** DELETE â Delete a reservation request. @hostProps reservationRequestId: string | number */ 45869 deleteReservationRequest: new Endpoint("reservation-request/${reservationRequestId}"), 45870 /** DELETE â Delete multiple items from a reservation request (based on criteria). @hostProps reservationRequestId: string | number */ 45871 deleteReservationRequestItems: new Endpoint("reservation-request/${reservationRequestId}/items"), 45872 /** DELETE â Delete a session. @hostProps sessionId: string | number */ 45873 deleteSession: new Endpoint("sessions/${sessionId}"), 45874 /** DELETE â Delete user. @hostProps userId: string | number */ 45875 deleteUserById: new Endpoint("user/${userId}"), 45876 /** PUT â Refuser définitivement une demande de réservation. @hostProps reservationRequestId: string | number */ 45877 denyForeverReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/deny-forever"), 45878 /** POST â Désactive une demande de réservation. @hostProps reservationRequestId: string | number */ 45879 disableReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/disabled"), 45880 /** POST â Modifier une demande de réservation (duplication serveur). @hostProps reservationRequestId: string | number */ 45881 editReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/edit"), 45882 /** PATCH â Manage the waiting line */
45883 editWaitingLineAdmin: new Endpoint("waiting-line-admin"), 45884 /** GET â Get badge contexts */ 45885 getAccessControlBadgeContexts: new Endpoint("access-control/badges"), 45886 /** GET â List access controllers */ 45887 getAccessControllers: new Endpoint("access-controller"), 45888 /** GET â Get a session. @hostProps sessionId: string | number */ 45889 getAccessControlSession: new Endpoint("access-control/sessions/${sessionId}"), 45890 /** GET â Get sessions */ 45891 getAccessControlSessions: new Endpoint("access-control/sessions"), 45892 /** GET â Get an access control subscription. @hostProps subscriptionId: string | number */ 45893 getAccessControlSubscription: new Endpoint("access-control/subscriptions/${subscriptionId}"), 45894 /** GET â Get access control subscriptions */ 45895 getAccessControlSubscriptions: new Endpoint("access-control/subscriptions"), 45896 /** GET â Accréditation PRO autorisée au public. @hostProps identifiant: string | number */ 45897 getAccreditation: new Endpoint("accreditations/${identifiant}"), 45898 /** GET â Accréditations PRO autorisées au public */ 45899 getAccreditations: new Endpoint("accreditations"), 45900 /** GET â Liste des types de structures */ 45901 getAccreditationStructuresTypes: new Endpoint("accreditations/structures_types"), 45902 /** GET â Retrieve activities */ 45903 getActivities: new Endpoint("activity"), 45904 /** GET â Retrieve an activity. @hostProps activityId: string | number */ 45905 getActivity: new Endpoint("activity/${activityId}"), 45906 /** GET â Retrieve an additional product. @hostProps additionalProductId: string | number */ 45907 getAdditionalProduct: new Endpoint("additional_products/${additionalProductId}"), 45908 /** GET â Retrieve additional products */ 45909 getAdditionalProducts: new Endpoint("additional_products"), 45910 /** GET â Récupération d'un admin. @hostProps identifiant: string | number */ 45911 getAdmin: new Endpoint("admin/${identifiant}"), 45912 /** GET â Admin navigation */ 45913 getAdminNavigation: new Endpoint("admin-navigation"), 45914 /** GET â Agenda details. @hostProps agendaId: string | number */ 45915 getAgenda: new Endpoint("agendas/${agendaId}"), 45916 /** GET â List of agendas */ 45917 getAgendas: new Endpoint("agendas"), 45918 /** GET â Get all reservations requests */ 45919 getAllReservationRequests: new Endpoint("reservation-request"), 45920 /** GET â Get all reservations */ 45921 getAllReservations: new Endpoint("reservations"), 45922 /** GET â Demande de compte professionnel. @hostProps askAccountProId: string | number */ 45923 getAskAccountProById: new Endpoint("ask_account_pro/${askAccountProId}/"), 45924 /** GET â Get banking information. @hostProps userId: string | number */ 45925 getBankingInfo: new Endpoint("user/${userId}/banking-info"), 45926 /** GET â Get campaign by hash. @hostProps hash: string | number */ 45927 getCampaign: new Endpoint("campaign/${hash}"), 45928 /** GET â Return the cart. @hostProps cartId: string | number */ 45929 getCart: new Endpoint("cart/${cartId}"), 45930 /** GET â Returns one item of a cart. @hostProps cartId: string | number; itemId: string | number */ 45931 getCartItem: new Endpoint("cart/${cartId}/items/${itemId}"), 45932 /** GET â Get compatible subscriptions for a cart item. @hostProps cartId: string | number; itemId: string | number */ 45933 getCartItemCompatibleSubscriptions: new Endpoint("cart/${cartId}/items/${itemId}/compatible-subscriptions"), 45934 /** GET â Returns the items of a cart. @hostProps cartId: string | number */ 45935 getCartItems: new Endpoint("cart/${cartId}/items"), 45936 /** GET â Get categories */ 45937 getCategories: new Endpoint("category"), 45938 /** GET â Get a category. @hostProps categoryId: string | number */ 45939 getCategory: new Endpoint("category/${categoryId}"), 45940 /** GET â Recherche d'une ville et son code postal. @hostProps search: string | number */ 45941 getCitiesBySearch: new Endpoint("cities/${search}"), 45942 /** GET â Retrieve a closing statement. @hostProps closingId: string | number */ 45943 getClosingStatement: new Endpoint("statement/closing/${closingId}"), 45944 /** GET â Retrieve closing statements. @hostProps from: number; to: number */ 45945 getClosingStatements: new Endpoint("statement/closing?from=${from}&to=${to}"), 45946 /** GET â Get user contacts. @hostProps userId: string | number */ 45947 getContacts: new Endpoint("users/${userId}/contacts"), 45948 /** GET â Initialisation du cookie (route CMS/Site) */ 45949 getCookieSession: new Endpoint("cookie_session"), 45950 /** GET â Accréditation PRO autorisée au public de la session */ 45951 getCurrentAccreditation: new Endpoint("accreditations/current"), 45952 /** GET â 678aa662989d8b6ee13b3ee1960ef370 */ 45953 getCustomForms: new Endpoint("custom-forms"), 45954 /** GET â 77dacaab8bf5fdcf138a317be4a31a66. @hostProps formId: string | number; answerSetId: string | number */ 45955 getCustomFormsByFormIdAnswerSetsById: new Endpoint("custom-forms/${formId}/answer-sets/${answerSetId}"), 45956 /** GET â 28fb49d6c176693696b28223ab77d18d. @hostProps customFormId: string | number */ 45957 getCustomFormsById: new Endpoint("custom-forms/${customFormId}"), 45958 /** GET â 6e3d8c533968efcd54e567b0396d5ac1. @hostProps customFormId: string | number */ 45959 getCustomFormsByIdAnswerSets: new Endpoint("custom-forms/${customFormId}/answer-sets"), 45960 /** GET â Get custom list. @hostProps list: string | number */ 45961 getCustomList: new Endpoint("custom-list/${list}"), 45962 /** GET â Dernières connexions des comptes administrateurs */ 45963 getDashboardLastConnections: new Endpoint("dashboard/last_connections"), 45964 /** GET â Widgets du tableau de bord */ 45965 getDashboardWidgets: new Endpoint("dashboard/widgets"), 45966 /** GET â Récupération d'évènements */ 45967 getEvents: new Endpoint("events"), 45968 /** GET â Récupération d'un évènement. @hostProps eventId: string | number */ 45969 getEventsById: new Endpoint("events/${eventId}"), 45970 /** GET â Get event status. @hostProps eventId: string | number */ 45971 getEventStatus: new Endpoint("events/${eventId}/status"), 45972 /** GET â Récupération des cartes cadeaux. @hostProps ids: string */ 45973 getGiftcards: new Endpoint("giftcards?ids=${ids}"), 45974 /** GET â Get user giftcards. @hostProps userId: string | number */ 45975 getGiftcards2: new Endpoint("user/${userId}/giftcards"), 45976 /** GET â Récupération d'une carte cadeau. @hostProps giftcardId: string | number */ 45977 getGiftcardsById: new Endpoint("giftcards/${giftcardId}"), 45978 /** GET â Test d'une carte cadeau. @hostProps code: string */ 45979 getGiftcardsTest: new Endpoint("giftcards/test?code=${code}"), 45980 /** GET â Retrieve integrity reports data by class_name. @hostProps className: string | number */ 45981 getIntegrityReport: new Endpoint("integrity_report/${className}"), 45982 /** GET â Retrieve integrity reports data */ 45983 getIntegrityReports: new Endpoint("integrity_report"), 45984 /** GET â Get a label. @hostProps labelId: string | number */ 45985 getLabel: new Endpoint("label/${labelId}"), 45986 /** GET â Get labels */ 45987 getLabels: new Endpoint("label"), 45988 /** GET â Token de session legacy */ 45989 getLegacyToken: new Endpoint("legacy/token"), 45990 /** GET â Retrieve a location. @hostProps locationId: string | number */ 45991 getLocation: new Endpoint("locations/${locationId}"), 45992 /** GET â Retrieve available locations */ 45993 getLocations: new Endpoint("locations"), 45994 /** GET â Retrieve a merch. @hostProps merchId: string | number */ 45995 getMerch: new Endpoint("merchs/${merchId}"), 45996 /** GET â Retrieve merchs */ 45997 getMerchs: new Endpoint("merchs"), 45998 /** GET â Get optin by ID. @hostProps optinId: string | number */ 45999 getOptinById: new Endpoint("optins/${optinId}"), 46000 /** GET â Get optins */ 46001 getOptins: new Endpoint("optins"), 46002 /** GET â Retrieve a transaction. @hostProps orderId: string | number */ 46003 getOrder: new Endpoint("orders/${orderId}"), 46004 /** GET â Retrieve transactions */ 46005 getOrders: new Endpoint("orders"), 46006 /** GET â Retrieve a partner. @hostProps partnerId: string | number */ 46007 getPartner: new Endpoint("partner/${partnerId}"), 46008 /** GET â Retrieve the list of partners */ 46009 getPartners: new Endpoint("partner"), 46010 /** GET â Get payment links. @hostProps quoteId: string | number */ 46011 getPaymentLinks: new Endpoint("quote/${quoteId}/payment-link"), 46012 /** GET â Recherche d'une ville et son code postal. @hostProps search: string | number */ 46013 getPostcodesBySearch: new Endpoint("postcodes/${search}"), 46014 /** GET â Price details. @hostProps priceId: string | number */
46015 getPrice: new Endpoint("prices/${priceId}"), 46016 /** GET â Retrieve a producer. @hostProps producerId: string | number */ 46017 getProducer: new Endpoint("producer/${producerId}"), 46018 /** GET â List available producers */ 46019 getProducers: new Endpoint("producer"), 46020 /** GET â Récupération des codes promos */ 46021 getPromotionCode: new Endpoint("promotion-code"), 46022 /** GET â Get a purchase. @hostProps purchaseId: string | number */ 46023 getPurchase: new Endpoint("purchases/${purchaseId}"), 46024 /** GET â List purchases */ 46025 getPurchases: new Endpoint("purchases"), 46026 /** GET â Get queue front configuration */ 46027 getQueueFrontConfig: new Endpoint("queue/front/config"), 46028 /** GET â Get queue V2 configuration and status */ 46029 getQueueInfo: new Endpoint("queue/info"), 46030 /** GET â Get queue session */ 46031 getQueueSession: new Endpoint("queue/session"), 46032 /** GET â Get queue sessions for monitoring */ 46033 getQueueSessions: new Endpoint("queue/sessions"), 46034 /** GET â Retrieve a quota. @hostProps quotaId: string | number */ 46035 getQuota: new Endpoint("quota/${quotaId}"), 46036 /** GET â Retrieve available quotas */ 46037 getQuotas: new Endpoint("quota"), 46038 /** GET â Get a quote. @hostProps quoteId: string | number */ 46039 getQuote: new Endpoint("quotes/${quoteId}"), 46040 /** GET â Récupération des devis */ 46041 getQuotes: new Endpoint("quotes"), 46042 /** GET â Get a ticketing range. @hostProps rangeId: string | number */ 46043 getRange: new Endpoint("range/${rangeId}"), 46044 /** GET â Get available ticketing ranges */ 46045 getRanges: new Endpoint("range"), 46046 /** GET â Récupèrer les informations d'une réservation. @hostProps reservationId: string | number */ 46047 getReservation: new Endpoint("reservations/${reservationId}"), 46048 /** GET â Get a specific item from a reservation. @hostProps reservationId: string | number; itemId: string | number */ 46049 getReservationItem: new Endpoint("reservations/${reservationId}/items/${itemId}"), 46050 /** GET â Get compatible subscriptions for a reservation item. @hostProps reservationId: string | number; itemId: string | number */ 46051 getReservationItemCompatibleSubscriptions: new Endpoint("reservations/${reservationId}/items/${itemId}/compatible-subscriptions"), 46052 /** GET â Get all items from a reservation. @hostProps reservationId: string | number */ 46053 getReservationItems: new Endpoint("reservations/${reservationId}/items"), 46054 /** GET â Récupèrer les informations d'une demande de réservation. @hostProps reservationRequestId: string | number */ 46055 getReservationRequest: new Endpoint("reservation-request/${reservationRequestId}"), 46056 /** GET â Get pre-reservation configuration by ID. @hostProps reservationRequestConfigId: string | number */ 46057 getReservationRequestConfigById: new Endpoint("reservation-request-config/${reservationRequestConfigId}"), 46058 /** GET â List active pre-reservation configurations */ 46059 getReservationRequestConfigs: new Endpoint("reservation-request-config"), 46060 /** GET â Get a specific item from a reservation request. @hostProps reservationRequestId: string | number; itemId: string | number */ 46061 getReservationRequestItem: new Endpoint("reservation-request/${reservationRequestId}/items/${itemId}"), 46062 /** GET â Get compatible subscriptions for a reservation request item. @hostProps reservationRequestId: string | number; itemId: string | number */ 46063 getReservationRequestItemCompatibleSubscriptions: new Endpoint("reservation-request/${reservationRequestId}/items/${itemId}/compatible-subscriptions"), 46064 /** GET â Get all items from a reservation request. @hostProps reservationRequestId: string | number */ 46065 getReservationRequestItems: new Endpoint("reservation-request/${reservationRequestId}/items"), 46066 /** GET â Get reservation request treatment index for shows. @hostProps showId: string */ 46067 getReservationRequestTreatment: new Endpoint("reservation-request/treatment?show_id[]=${showId}"), 46068 /** GET â Get a room. @hostProps roomId: string | number */ 46069 getRoom: new Endpoint("room/${roomId}"), 46070 /** GET â Get rooms */ 46071 getRooms: new Endpoint("room"), 46072 /** GET â Récupération des saisons disponibles */ 46073 getSeason: new Endpoint("season"), 46074 /** GET â Récupération de la saison en cours. @hostProps filter: string | number | "past" | "current" | "next" */ 46075 getSeasonByFilter: new Endpoint("season/${filter}"),
46076 /** GET â Récupération d'une saison. @hostProps seasonId: string | number */ 46077 getSeasonById: new Endpoint("season/${seasonId}"), 46078 /** GET â Get a session. @hostProps sessionId: string | number */ 46079 getSession: new Endpoint("sessions/${sessionId}"), 46080 /** GET â Get sessions */ 46081 getSessions: new Endpoint("sessions"), 46082 /** GET â Settings de la billetterie */ 46083 getSettings: new Endpoint("settings"), 46084 /** GET â List shows */ 46085 getShows: new Endpoint("shows"), 46086 /** GET â Get a show. @hostProps showId: string | number */ 46087 getShowsById: new Endpoint("shows/${showId}"), 46088 /** GET â Retrieve shows related to the provided one. @hostProps showId: string | number */ 46089 getShowsRelated: new Endpoint("shows/${showId}/related"), 46090 /** GET â Get shows status. @hostProps showId: string | number */ 46091 getShowStatus: new Endpoint("shows/${showId}/status"), 46092 /** GET â getStatsPassControlMatrix. @hostProps seasonId: string | number */ 46093 getStatsPassControlMatrix: new Endpoint("stats/pass-control-matrix/${seasonId}"), 46094 /** GET â Retrieve structure types */ 46095 getStructureTypes: new Endpoint("structures-types"), 46096 /** GET â Retrieve a subscription. @hostProps subscriptionId: string | number */ 46097 getSubscription: new Endpoint("subscriptions/${subscriptionId}"), 46098 /** GET â Retrieve subscriptions */ 46099 getSubscriptions: new Endpoint("subscriptions"), 46100 /** GET â Retrieve a subscription type. @hostProps subscriptionTypeId: string | number */ 46101 getSubscriptionType: new Endpoint("subscription-types/${subscriptionTypeId}"), 46102 /** GET â Retrieve subscription types */ 46103 getSubscriptionTypes: new Endpoint("subscription-types"), 46104 /** GET â Récupération du thème */ 46105 getTheme: new Endpoint("theme"), 46106 /** GET â Retrieve a ticket. @hostProps ticketId: string | number */ 46107 getTicket: new Endpoint("tickets/${ticketId}"), 46108 /** GET â Retrieve tickets */ 46109 getTickets: new Endpoint("tickets"), 46110 /** GET â Génère un token d'accès à l'API */ 46111 getToken: new Endpoint("token"), 46112 /** GET â Récupération de libellés */ 46113 getTranslate: new Endpoint("translate"), 46114 /** GET â Get users */ 46115 getUser: new Endpoint("user"), 46116 /** GET â Get user. @hostProps userId: string | number */ 46117 getUser2: new Endpoint("user/${userId}"), 46118 /** GET â Get user orders. @hostProps userId: string | number */ 46119 getUserByIdOrders: new Endpoint("user/${userId}/orders"), 46120 /** GET â Get a user's purchases. @hostProps userId: string | number */ 46121 getUserByIdPurchases: new Endpoint("user/${userId}/purchases"), 46122 /** GET â Get a user's purchases by product type. @hostProps userId: string | number; type: string | number | "event" | "subscribe" | "merch" | "giftcard" | "additionalProduct" | "" */ 46123 getUserByIdPurchasesByType: new Endpoint("user/${userId}/purchases/${type}"), 46124 /** GET â Logout */ 46125 getUserLogout: new Endpoint("user/logout"), 46126 /** GET â Consume magic login link. @hostProps token: string */ 46127 getUserMagicLogin: new Endpoint("user/magic-login?token=${token}"), 46128 /** GET â Get position in waiting line */ 46129 getWaitingLine: new Endpoint("waiting-line"), 46130 /** GET â Retrieve information about the current config of the waiting line */ 46131 getWaitingLineConfig: new Endpoint("waiting-line-admin"), 46132 /** GET â Check if user has access to a password-protected pre-reservation configuration. @hostProps reservationRequestConfigId: string | number */ 46133 hasAccessReservationRequestConfig: new Endpoint("reservation-request-config/${reservationRequestConfigId}/has-access"), 46134 /** POST â Création ou mise à jour d'un contact pro avec le CRM. @hostProps type: string | number */ 46135 importCrmPro: new Endpoint("crm-import/${type}"), 46136 /** POST â Link items to a subscription. @hostProps cartId: string | number */ 46137 linkCartItems: new Endpoint("cart/${cartId}/link"), 46138 /** POST â Link ticket to user account */ 46139 linkTicketToAccount: new Endpoint("tickets/link-to-account"), 46140 /** POST â Verrouiller une réservation. @hostProps reservationId: string | number */ 46141 lockReservation: new Endpoint("reservations/${reservationId}/lock"), 46142 /** POST â Verrouiller une demande de réservation. @hostProps reservationRequestId: string | number */ 46143 lockReservationReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/lock"), 46144 /** POST â Login custom list */ 46145 loginCustomList: new Endpoint("custom-list/login"), 46146 /** PATCH â Update an activity. @hostProps activityId: string | number */ 46147 patchActivity: new Endpoint("activity/${activityId}"), 46148 /** PATCH â Modifier le quota préféré d'un admin. @hostProps identifiant: string | number */ 46149 patchAdmin: new Endpoint("admin/${identifiant}"), 46150 /** PATCH â Patch an item of a cart. @hostProps cartId: string | number; itemId: string | number */ 46151 patchCartItem: new Endpoint("cart/${cartId}/items/${itemId}"), 46152 /** PATCH â Patch items of a cart. @hostProps cartId: string | number */ 46153 patchCartItems: new Endpoint("cart/${cartId}/items"), 46154 /** PATCH â Update a category. @hostProps categoryId: string | number */ 46155 patchCategory: new Endpoint("category/${categoryId}"), 46156 /** PATCH â f5fb3f90f173ff88171038d515bbe7c5. @hostProps formId: string | number; answerSetId: string | number */ 46157 patchCustomFormsByFormIdAnswerSetsById: new Endpoint("custom-forms/${formId}/answer-sets/${answerSetId}"), 46158 /** PATCH â Update a label. @hostProps labelId: string | number */ 46159 patchLabel: new Endpoint("label/${labelId}"), 46160 /** PATCH â Update a producer. @hostProps producerId: string | number */ 46161 patchProducer: new Endpoint("producer/${producerId}"), 46162 /** PATCH â Modify a quota. @hostProps quotaId: string | number */ 46163 patchQuota: new Endpoint("quota/${quotaId}"), 46164 /** PATCH â Partially update a reservation. @hostProps reservationId: string | number */ 46165 patchReservation: new Endpoint("reservations/${reservationId}"), 46166 /** PATCH â Met à jour un item d'une réservation. @hostProps reservationId: string | number; itemId: string | number */ 46167 patchReservationItem: new Endpoint("reservations/${reservationId}/items/${itemId}"), 46168 /** PATCH â Met à jour des items d'une réservation (selon une recherche). @hostProps reservationId: string | number */ 46169 patchReservationItems: new Endpoint("reservations/${reservationId}/items"), 46170 /** PATCH â Partially update a reservation request. @hostProps reservationRequestId: string | number */ 46171 patchReservationRequest: new Endpoint("reservation-request/${reservationRequestId}"), 46172 /** PATCH â Met à jour un item d'une demande de réservation. @hostProps reservationRequestId: string | number; itemId: string | number */ 46173 patchReservationRequestItem: new Endpoint("reservation-request/${reservationRequestId}/items/${itemId}"), 46174 /** PATCH â Met à jour des items d'une demande réservation (selon une recherche). @hostProps reservationRequestId: string | number */ 46175 patchReservationRequestItems: new Endpoint("reservation-request/${reservationRequestId}/items"), 46176 /** PATCH â Update a subscription. @hostProps subscriptionId: string | number */ 46177 patchSubscription: new Endpoint("subscriptions/${subscriptionId}"), 46178 /** POST â Create an activity */ 46179 postActivity: new Endpoint("activity"), 46180 /** POST â Creates a new cart */ 46181 postCart: new Endpoint("cart"), 46182 /** POST â Apply discount to cart */ 46183 postCartDiscount: new Endpoint("cart/discount"), 46184 /** POST â Add items to a cart. @hostProps cartId: string | number */ 46185 postCartItems: new Endpoint("cart/${cartId}/items"), 46186 /** POST â Create a category */ 46187 postCategory: new Endpoint("category"), 46188 /** POST â Ajout d'une carte cadeau */ 46189 postGiftcards: new Endpoint("giftcards"), 46190 /** POST â Lien d'une carte cadeau */ 46191 postGiftcardsLink: new Endpoint("giftcards/link"), 46192 /** POST â Create a label */ 46193 postLabel: new Endpoint("label"), 46194 /** POST â Create a producer */ 46195 postProducer: new Endpoint("producer"), 46196 /** POST â Validation d'un code promo */ 46197 postPromotionCode: new Endpoint("promotion-code"), 46198 /** POST â Create a quota */ 46199 postQuota: new Endpoint("quota"),
46200 /** POST â Create a quote */ 46201 postQuote: new Endpoint("quotes"), 46202 /** POST â Add items to a reservation. @hostProps reservationId: string | number */ 46203 postReservationItems: new Endpoint("reservations/${reservationId}/items"), 46204 /** POST â Add items to a reservation request. @hostProps reservationRequestId: string | number */ 46205 postReservationRequestItems: new Endpoint("reservation-request/${reservationRequestId}/items"), 46206 /** POST â Create user */ 46207 postUser: new Endpoint("user"), 46208 /** POST â Send account validation link */ 46209 postUserLinkValidate: new Endpoint("user/link/validate"), 46210 /** POST â Login */ 46211 postUserLogin: new Endpoint("user/login"), 46212 /** POST â Process integrity report */ 46213 processIntegrityReport: new Endpoint("integrity_report/process"), 46214 /** POST â Process integrity report (one check). @hostProps className: string | number */ 46215 processIntegrityReportByClass: new Endpoint("integrity_report/process/${className}"), 46216 /** DELETE â Purge queue sessions */ 46217 purgeQueueSessions: new Endpoint("queue/sessions"), 46218 /** PUT â Replace items of a cart. @hostProps cartId: string | number */ 46219 putCartItems: new Endpoint("cart/${cartId}/items"), 46220 /** PUT â Update user. @hostProps userId: string | number */ 46221 putUserById: new Endpoint("user/${userId}"), 46222 /** PUT â Update user password. @hostProps userId: string | number */ 46223 putUserByIdPassword: new Endpoint("user/${userId}/password"), 46224 /** PUT â Validate account */ 46225 putUserValidate: new Endpoint("user/validate"), 46226 /** POST â Récupérer les commandes d'une personne */ 46227 recoverCart: new Endpoint("recover-orders"), 46228 /** POST â Refresh banned IPs from Data */ 46229 refreshBannedIpsFromData: new Endpoint("banned_ips/refresh_from_data"), 46230 /** POST â Request login link */ 46231 requestLoginLink: new Endpoint("user/login-link"), 46232 /** POST â Forgot password */ 46233 resetPassword: new Endpoint("user/reset-password"), 46234 /** PUT â Restaurer une demande de réservation initiale. @hostProps reservationRequestId: string | number */ 46235 restoreReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/restore"), 46236 /** POST â Save cart in the database */ 46237 saveCart: new Endpoint("cart/current/save"), 46238 /** POST â Envoi d'un mail */ 46239 sendEmail: new Endpoint("email"), 46240 /** POST â Submit logs */ 46241 sendLogs: new Endpoint("log"), 46242 /** POST â Send a quote. @hostProps quoteId: string | number */ 46243 sendQuote: new Endpoint("quote/${quoteId}/send/"), 46244 /** POST â Modifier la préférence d'interface admin. @hostProps identifiant: string | number */ 46245 setAdminInterface: new Endpoint("admin/${identifiant}/interface"), 46246 /** POST â Soumet une demande de réservation. @hostProps reservationRequestId: string | number */ 46247 submitReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/submit"), 46248 /** GET â Synchronisation d'un contact pro avec le CRM. @hostProps synchro: string */ 46249 synchroCrm: new Endpoint("crm?synchro=${synchro}"), 46250 /** GET â Synchronisation d'un contact pro avec le CRM. @hostProps method: string | number; crmProId: string | number */ 46251 synchroCrmPro: new Endpoint("crm-pro/${method}/${crmProId}"), 46252 /** PUT â Débloquer une réservation. @hostProps reservationId: string | number */ 46253 unlockReservation: new Endpoint("reservations/${reservationId}/unlock"), 46254 /** PUT â Débloquer une demande de réservation. @hostProps reservationRequestId: string | number */ 46255 unlockReservationRequest: new Endpoint("reservation-request/${reservationRequestId}/unlock"), 46256 /** POST â Unlock a password-protected pre-reservation configuration. @hostProps reservationRequestConfigId: string | number */ 46257 unlockReservationRequestConfig: new Endpoint("reservation-request-config/${reservationRequestConfigId}/login"), 46258 /** PUT â Update banking information. @hostProps userId: string | number */ 46259 updateBankingInfo: new Endpoint("user/${userId}/banking-info"), 46260 /** POST â Update queue configuration */ 46261 updateQueueConfig: new Endpoint("queue/config"), 46262 /** PATCH â Update queue session */ 46263 updateQueueSession: new Endpoint("queue/session") 46264 }; 46265 ({ 46266 contextual: { 46267 accessControlBadgeSync: endpoints.accessControlBadgeSync.getDataProviderKey(), 46268 accessControlSessionCreateTicket: endpoints.accessControlSessionCreateTicket.getDataProviderKey(), 46269 accessControlSessionSync: endpoints.accessControlSessionSync.getDataProviderKey(), 46270 accessItems: new DataProviderKey("access-control/access-items"), 46271 accreditationLogin: new DataProviderKey("accreditations/login"), 46272 accreditationsLogout: new DataProviderKey("accreditations/logout"), 46273 askRefund: new DataProviderKey("refunds/ask"), 46274 cancelSubmissionReservationRequest: endpoints.cancelSubmissionReservationRequest.getDataProviderKey(), 46275 cancelTicket: new DataProviderKey("tickets"), 46276 cancelTicketForCredit: new DataProviderKey("tickets/cancel-for-credit"), 46277 checkQueueAuthorization: new DataProviderKey("queue/authorized"), 46278 checkSeatAvailability: new DataProviderKey("seat-availability/check"), 46279 checkSubscription: new DataProviderKey("partner/check_subscription"), 46280 confirmReservation: endpoints.confirmReservation.getDataProviderKey(), 46281 confirmReservationRequest: endpoints.confirmReservationRequest.getDataProviderKey(), 46282 contactAccreditation: new DataProviderKey("accreditations/contact"), 46283 createAdminLoginLink: endpoints.createAdminLoginLink.getDataProviderKey(), 46284 createReservation: new DataProviderKey("reservations"), 46285 createReservationRequest: new DataProviderKey("reservation-request"), 46286 declineReservationRequest: endpoints.declineReservationRequest.getDataProviderKey(), 46287 deleteActivity: endpoints.deleteActivity.getDataProviderKey(),
46288 deleteCart: endpoints.deleteCart.getDataProviderKey(), 46289 deleteCartItem: endpoints.deleteCartItem.getDataProviderKey(), 46290 deleteCartItems: endpoints.deleteCartItems.getDataProviderKey(), 46291 deleteCategory: endpoints.deleteCategory.getDataProviderKey(), 46292 deleteLabel: endpoints.deleteLabel.getDataProviderKey(), 46293 deletePromotionCode: new DataProviderKey("promotion-code"), 46294 deleteQueueSession: new DataProviderKey("queue/session"), 46295 deleteQuota: endpoints.deleteQuota.getDataProviderKey(), 46296 deleteReservation: endpoints.deleteReservation.getDataProviderKey(), 46297 deleteReservationAndRestoreRequest: endpoints.deleteReservationAndRestoreRequest.getDataProviderKey(), 46298 deleteReservationItem: endpoints.deleteReservationItem.getDataProviderKey(), 46299 deleteReservationItems: endpoints.deleteReservationItems.getDataProviderKey(), 46300 deleteReservationRequest: endpoints.deleteReservationRequest.getDataProviderKey(), 46301 deleteReservationRequestItems: endpoints.deleteReservationRequestItems.getDataProviderKey(), 46302 deleteSession: endpoints.deleteSession.getDataProviderKey(), 46303 deleteUserById: endpoints.deleteUserById.getDataProviderKey(), 46304 denyForeverReservationRequest: endpoints.denyForeverReservationRequest.getDataProviderKey(), 46305 disableReservationRequest: endpoints.disableReservationRequest.getDataProviderKey(), 46306 editReservationRequest: endpoints.editReservationRequest.getDataProviderKey(), 46307 editWaitingLineAdmin: new DataProviderKey("waiting-line-admin"), 46308 getAccessControlBadgeContexts: new DataProviderKey("access-control/badges"), 46309 getAccessControllers: new DataProviderKey("access-controller"), 46310 getAccessControlSession: endpoints.getAccessControlSession.getDataProviderKey(), 46311 getAccessControlSessions: new DataProviderKey("access-control/sessions"), 46312 getAccessControlSubscription: endpoints.getAccessControlSubscription.getDataProviderKey(), 46313 getAccessControlSubscriptions: new DataProviderKey("access-control/subscriptions"), 46314 getAccreditation: endpoints.getAccreditation.getDataProviderKey(), 46315 getAccreditations: new DataProviderKey("accreditations"), 46316 getAccreditationStructuresTypes: new DataProviderKey("accreditations/structures_types"), 46317 getActivities: new DataProviderKey("activity"), 46318 getActivity: endpoints.getActivity.getDataProviderKey(), 46319 getAdditionalProduct: endpoints.getAdditionalProduct.getDataProviderKey(), 46320 getAdditionalProducts: new DataProviderKey("additional_products"), 46321 getAdmin: endpoints.getAdmin.getDataProviderKey(), 46322 getAdminNavigation: new DataProviderKey("admin-navigation"), 46323 getAgenda: endpoints.getAgenda.getDataProviderKey(), 46324 getAgendas: new DataProviderKey("agendas"), 46325 getAllReservationRequests: new DataProviderKey("reservation-request"), 46326 getAllReservations: new DataProviderKey("reservations"), 46327 getAskAccountProById: endpoints.getAskAccountProById.getDataProviderKey(), 46328 getBankingInfo: endpoints.getBankingInfo.getDataProviderKey(), 46329 getCampaign: endpoints.getCampaign.getDataProviderKey(), 46330 getCart: endpoints.getCart.getDataProviderKey(), 46331 getCartItem: endpoints.getCartItem.getDataProviderKey(), 46332 getCartItemCompatibleSubscriptions: endpoints.getCartItemCompatibleSubscriptions.getDataProviderKey(), 46333 getCartItems: endpoints.getCartItems.getDataProviderKey(), 46334 getCategories: new DataProviderKey("category"), 46335 getCategory: endpoints.getCategory.getDataProviderKey(), 46336 getCitiesBySearch: endpoints.getCitiesBySearch.getDataProviderKey(), 46337 getClosingStatement: endpoints.getClosingStatement.getDataProviderKey(), 46338 getClosingStatements: endpoints.getClosingStatements.getDataProviderKey(), 46339 getContacts: endpoints.getContacts.getDataProviderKey(), 46340 getCookieSession: new DataProviderKey("cookie_session"), 46341 getCurrentAccreditation: new DataProviderKey("accreditations/current"), 46342 getCustomForms: new DataProviderKey("custom-forms"), 46343 getCustomFormsByFormIdAnswerSetsById: endpoints.getCustomFormsByFormIdAnswerSetsById.getDataProviderKey(), 46344 getCustomFormsById: endpoints.getCustomFormsById.getDataProviderKey(), 46345 getCustomFormsByIdAnswerSets: endpoints.getCustomFormsByIdAnswerSets.getDataProviderKey(), 46346 getCustomList: endpoints.getCustomList.getDataProviderKey(), 46347 getDashboardLastConnections: new DataProviderKey("dashboard/last_connections"), 46348 getDashboardWidgets: new DataProviderKey("dashboard/widgets"), 46349 getEvents: new DataProviderKey("events"), 46350 getEventsById: endpoints.getEventsById.getDataProviderKey(), 46351 getEventStatus: endpoints.getEventStatus.getDataProviderKey(), 46352 getGiftcards: endpoints.getGiftcards.getDataProviderKey(), 46353 getGiftcards2: endpoints.getGiftcards2.getDataProviderKey(), 46354 getGiftcardsById: endpoints.getGiftcardsById.getDataProviderKey(), 46355 getGiftcardsTest: endpoints.getGiftcardsTest.getDataProviderKey(), 46356 getIntegrityReport: endpoints.getIntegrityReport.getDataProviderKey(), 46357 getIntegrityReports: new DataProviderKey("integrity_report"), 46358 getLabel: endpoints.getLabel.getDataProviderKey(), 46359 getLabels: new DataProviderKey("label"), 46360 getLegacyToken: new DataProviderKey("legacy/token"), 46361 getLocation: endpoints.getLocation.getDataProviderKey(), 46362 getLocations: new DataProviderKey("locations"), 46363 getMerch: endpoints.getMerch.getDataProviderKey(), 46364 getMerchs: new DataProviderKey("merchs"), 46365 getOptinById: endpoints.getOptinById.getDataProviderKey(), 46366 getOptins: new DataProviderKey("optins"), 46367 getOrder: endpoints.getOrder.getDataProviderKey(), 46368 getOrders: new DataProviderKey("orders"), 46369 getPartner: endpoints.getPartner.getDataProviderKey(), 46370 getPartners: new DataProviderKey("partner"), 46371 getPaymentLinks: endpoints.getPaymentLinks.getDataProviderKey(), 46372 getPostcodesBySearch: endpoints.getPostcodesBySearch.getDataProviderKey(),
46373 getPrice: endpoints.getPrice.getDataProviderKey(), 46374 getProducer: endpoints.getProducer.getDataProviderKey(), 46375 getProducers: new DataProviderKey("producer"), 46376 getPromotionCode: new DataProviderKey("promotion-code"), 46377 getPurchase: endpoints.getPurchase.getDataProviderKey(), 46378 getPurchases: new DataProviderKey("purchases"), 46379 getQueueFrontConfig: new DataProviderKey("queue/front/config"), 46380 getQueueInfo: new DataProviderKey("queue/info"), 46381 getQueueSession: new DataProviderKey("queue/session"), 46382 getQueueSessions: new DataProviderKey("queue/sessions"), 46383 getQuota: endpoints.getQuota.getDataProviderKey(), 46384 getQuotas: new DataProviderKey("quota"), 46385 getQuote: endpoints.getQuote.getDataProviderKey(), 46386 getQuotes: new DataProviderKey("quotes"), 46387 getRange: endpoints.getRange.getDataProviderKey(), 46388 getRanges: new DataProviderKey("range"), 46389 getReservation: endpoints.getReservation.getDataProviderKey(), 46390 getReservationItem: endpoints.getReservationItem.getDataProviderKey(), 46391 getReservationItemCompatibleSubscriptions: endpoints.getReservationItemCompatibleSubscriptions.getDataProviderKey(), 46392 getReservationItems: endpoints.getReservationItems.getDataProviderKey(), 46393 getReservationRequest: endpoints.getReservationRequest.getDataProviderKey(), 46394 getReservationRequestConfigById: endpoints.getReservationRequestConfigById.getDataProviderKey(), 46395 getReservationRequestConfigs: new DataProviderKey("reservation-request-config"), 46396 getReservationRequestItem: endpoints.getReservationRequestItem.getDataProviderKey(), 46397 getReservationRequestItemCompatibleSubscriptions: endpoints.getReservationRequestItemCompatibleSubscriptions.getDataProviderKey(), 46398 getReservationRequestItems: endpoints.getReservationRequestItems.getDataProviderKey(), 46399 getReservationRequestTreatment: endpoints.getReservationRequestTreatment.getDataProviderKey(), 46400 getRoom: endpoints.getRoom.getDataProviderKey(), 46401 getRooms: new DataProviderKey("room"), 46402 getSeason: new DataProviderKey("season"), 46403 getSeasonByFilter: endpoints.getSeasonByFilter.getDataProviderKey(), 46404 getSeasonById: endpoints.getSeasonById.getDataProviderKey(), 46405 getSession: endpoints.getSession.getDataProviderKey(), 46406 getSessions: new DataProviderKey("sessions"), 46407 getSettings: new DataProviderKey("settings"), 46408 getShows: new DataProviderKey("shows"), 46409 getShowsById: endpoints.getShowsById.getDataProviderKey(), 46410 getShowsRelated: endpoints.getShowsRelated.getDataProviderKey(), 46411 getShowStatus: endpoints.getShowStatus.getDataProviderKey(), 46412 getStatsPassControlMatrix: endpoints.getStatsPassControlMatrix.getDataProviderKey(), 46413 getStructureTypes: new DataProviderKey("structures-types"), 46414 getSubscription: endpoints.getSubscription.getDataProviderKey(), 46415 getSubscriptions: new DataProviderKey("subscriptions"), 46416 getSubscriptionType: endpoints.getSubscriptionType.getDataProviderKey(), 46417 getSubscriptionTypes: new DataProviderKey("subscription-types"), 46418 getTheme: new DataProviderKey("theme"), 46419 getTicket: endpoints.getTicket.getDataProviderKey(), 46420 getTickets: new DataProviderKey("tickets"), 46421 getToken: new DataProviderKey("token"), 46422 getTranslate: new DataProviderKey("translate"), 46423 getUser: new DataProviderKey("user"), 46424 getUser2: endpoints.getUser2.getDataProviderKey(), 46425 getUserByIdOrders: endpoints.getUserByIdOrders.getDataProviderKey(), 46426 getUserByIdPurchases: endpoints.getUserByIdPurchases.getDataProviderKey(), 46427 getUserByIdPurchasesByType: endpoints.getUserByIdPurchasesByType.getDataProviderKey(), 46428 getUserLogout: new DataProviderKey("user/logout"), 46429 getUserMagicLogin: endpoints.getUserMagicLogin.getDataProviderKey(), 46430 getWaitingLine: new DataProviderKey("waiting-line"), 46431 getWaitingLineConfig: new DataProviderKey("waiting-line-admin"), 46432 hasAccessReservationRequestConfig: endpoints.hasAccessReservationRequestConfig.getDataProviderKey(), 46433 importCrmPro: endpoints.importCrmPro.getDataProviderKey(), 46434 linkCartItems: endpoints.linkCartItems.getDataProviderKey(), 46435 linkTicketToAccount: new DataProviderKey("tickets/link-to-account"), 46436 lockReservation: endpoints.lockReservation.getDataProviderKey(), 46437 lockReservationReservationRequest: endpoints.lockReservationReservationRequest.getDataProviderKey(), 46438 loginCustomList: new DataProviderKey("custom-list/login"), 46439 patchActivity: endpoints.patchActivity.getDataProviderKey(), 46440 patchAdmin: endpoints.patchAdmin.getDataProviderKey(), 46441 patchCartItem: endpoints.patchCartItem.getDataProviderKey(), 46442 patchCartItems: endpoints.patchCartItems.getDataProviderKey(), 46443 patchCategory: endpoints.patchCategory.getDataProviderKey(), 46444 patchCustomFormsByFormIdAnswerSetsById: endpoints.patchCustomFormsByFormIdAnswerSetsById.getDataProviderKey(), 46445 patchLabel: endpoints.patchLabel.getDataProviderKey(), 46446 patchProducer: endpoints.patchProducer.getDataProviderKey(), 46447 patchQuota: endpoints.patchQuota.getDataProviderKey(), 46448 patchReservation: endpoints.patchReservation.getDataProviderKey(), 46449 patchReservationItem: endpoints.patchReservationItem.getDataProviderKey(), 46450 patchReservationItems: endpoints.patchReservationItems.getDataProviderKey(), 46451 patchReservationRequest: endpoints.patchReservationRequest.getDataProviderKey(), 46452 patchReservationRequestItem: endpoints.patchReservationRequestItem.getDataProviderKey(), 46453 patchReservationRequestItems: endpoints.patchReservationRequestItems.getDataProviderKey(), 46454 patchSubscription: endpoints.patchSubscription.getDataProviderKey(), 46455 postActivity: new DataProviderKey("activity"), 46456 postCart: new DataProviderKey("cart"), 46457 postCartDiscount: new DataProviderKey("cart/discount"), 46458 postCartItems: endpoints.postCartItems.getDataProviderKey(), 46459 postCategory: new DataProviderKey("category"), 46460 postGiftcards: new DataProviderKey("giftcards"), 46461 postGiftcardsLink: new DataProviderKey("giftcards/link"), 46462 postLabel: new DataProviderKey("label"), 46463 postProducer: new DataProviderKey("producer"), 46464 postPromotionCode: new DataProviderKey("promotion-code"), 46465 postQuota: new DataProviderKey("quota"),
46466 postQuote: new DataProviderKey("quotes"), 46467 postReservationItems: endpoints.postReservationItems.getDataProviderKey(), 46468 postReservationRequestItems: endpoints.postReservationRequestItems.getDataProviderKey(), 46469 postUser: new DataProviderKey("user"), 46470 postUserLinkValidate: new DataProviderKey("user/link/validate"), 46471 postUserLogin: new DataProviderKey("user/login"), 46472 processIntegrityReport: new DataProviderKey("integrity_report/process"), 46473 processIntegrityReportByClass: endpoints.processIntegrityReportByClass.getDataProviderKey(), 46474 purgeQueueSessions: new DataProviderKey("queue/sessions"), 46475 putCartItems: endpoints.putCartItems.getDataProviderKey(), 46476 putUserById: endpoints.putUserById.getDataProviderKey(), 46477 putUserByIdPassword: endpoints.putUserByIdPassword.getDataProviderKey(), 46478 putUserValidate: new DataProviderKey("user/validate"), 46479 recoverCart: new DataProviderKey("recover-orders"), 46480 refreshBannedIpsFromData: new DataProviderKey("banned_ips/refresh_from_data"), 46481 requestLoginLink: new DataProviderKey("user/login-link"), 46482 resetPassword: new DataProviderKey("user/reset-password"), 46483 restoreReservationRequest: endpoints.restoreReservationRequest.getDataProviderKey(), 46484 saveCart: new DataProviderKey("cart/current/save"), 46485 sendEmail: new DataProviderKey("email"), 46486 sendLogs: new DataProviderKey("log"), 46487 sendQuote: endpoints.sendQuote.getDataProviderKey(), 46488 setAdminInterface: endpoints.setAdminInterface.getDataProviderKey(), 46489 submitReservationRequest: endpoints.submitReservationRequest.getDataProviderKey(), 46490 synchroCrm: endpoints.synchroCrm.getDataProviderKey(), 46491 synchroCrmPro: endpoints.synchroCrmPro.getDataProviderKey(), 46492 unlockReservation: endpoints.unlockReservation.getDataProviderKey(), 46493 unlockReservationRequest: endpoints.unlockReservationRequest.getDataProviderKey(), 46494 unlockReservationRequestConfig: endpoints.unlockReservationRequestConfig.getDataProviderKey(), 46495 updateBankingInfo: endpoints.updateBankingInfo.getDataProviderKey(), 46496 updateQueueConfig: new DataProviderKey("queue/config"), 46497 updateQueueSession: new DataProviderKey("queue/session") 46498 }, 46499 generic: { 46500 accessControlBadgeSync: new DataProviderKey("access-control/badges/generic/sync"), 46501 accessControlSessionCreateTicket: new DataProviderKey("access-control/sessions/generic/tickets"), 46502 accessControlSessionSync: new DataProviderKey("access-control/sessions/generic/sync"), 46503 accessItems: new DataProviderKey("access-control/access-items"), 46504 accreditationLogin: new DataProviderKey("accreditations/login"), 46505 accreditationsLogout: new DataProviderKey("accreditations/logout"), 46506 askRefund: new DataProviderKey("refunds/ask"), 46507 cancelSubmissionReservationRequest: new DataProviderKey("reservation-request/generic/cancel-submission"), 46508 cancelTicket: new DataProviderKey("tickets"), 46509 cancelTicketForCredit: new DataProviderKey("tickets/cancel-for-credit"), 46510 checkQueueAuthorization: new DataProviderKey("queue/authorized"), 46511 checkSeatAvailability: new DataProviderKey("seat-availability/check"), 46512 checkSubscription: new DataProviderKey("partner/check_subscription"), 46513 confirmReservation: new DataProviderKey("reservations/generic/confirm"), 46514 confirmReservationRequest: new DataProviderKey("reservation-request/generic/confirm"), 46515 contactAccreditation: new DataProviderKey("accreditations/contact"), 46516 createAdminLoginLink: new DataProviderKey("admin/generic/login-link"), 46517 createReservation: new DataProviderKey("reservations"), 46518 createReservationRequest: new DataProviderKey("reservation-request"), 46519 declineReservationRequest: new DataProviderKey("reservation-request/generic/decline"), 46520 deleteActivity: new DataProviderKey("activity/generic"), 46521 deleteCart: new DataProviderKey("cart/generic"), 46522 deleteCartItem: new DataProviderKey("cart/generic/items/generic"), 46523 deleteCartItems: new DataProviderKey("cart/generic/items"),
46524 deleteCategory: new DataProviderKey("categories/generic"), 46525 deleteLabel: new DataProviderKey("label/generic"), 46526 deletePromotionCode: new DataProviderKey("promotion-code"), 46527 deleteQueueSession: new DataProviderKey("queue/session"), 46528 deleteQuota: new DataProviderKey("quota/generic"), 46529 deleteReservation: new DataProviderKey("reservations/generic"), 46530 deleteReservationAndRestoreRequest: new DataProviderKey("reservations/generic/delete-and-restore-request"), 46531 deleteReservationItem: new DataProviderKey("reservations/generic/items/generic"), 46532 deleteReservationItems: new DataProviderKey("reservations/generic/items"), 46533 deleteReservationRequest: new DataProviderKey("reservation-request/generic"), 46534 deleteReservationRequestItems: new DataProviderKey("reservation-request/generic/items"), 46535 deleteSession: new DataProviderKey("sessions/generic"), 46536 deleteUserById: new DataProviderKey("user/generic"), 46537 denyForeverReservationRequest: new DataProviderKey("reservation-request/generic/deny-forever"), 46538 disableReservationRequest: new DataProviderKey("reservation-request/generic/disabled"), 46539 editReservationRequest: new DataProviderKey("reservation-request/generic/edit"), 46540 editWaitingLineAdmin: new DataProviderKey("waiting-line-admin"), 46541 getAccessControlBadgeContexts: new DataProviderKey("access-control/badges"), 46542 getAccessControllers: new DataProviderKey("access-controller"), 46543 getAccessControlSession: new DataProviderKey("access-control/sessions/generic"), 46544 getAccessControlSessions: new DataProviderKey("access-control/sessions"), 46545 getAccessControlSubscription: new DataProviderKey("access-control/subscriptions/generic"), 46546 getAccessControlSubscriptions: new DataProviderKey("access-control/subscriptions"), 46547 getAccreditation: new DataProviderKey("accreditations/generic"), 46548 getAccreditations: new DataProviderKey("accreditations"), 46549 getAccreditationStructuresTypes: new DataProviderKey("accreditations/structures_types"), 46550 getActivities: new DataProviderKey("activity"), 46551 getActivity: new DataProviderKey("activity/generic"), 46552 getAdditionalProduct: new DataProviderKey("additional_products/generic"), 46553 getAdditionalProducts: new DataProviderKey("additional_products"), 46554 getAdmin: new DataProviderKey("admin/generic"), 46555 getAdminNavigation: new DataProviderKey("admin-navigation"), 46556 getAgenda: new DataProviderKey("agendas/generic"), 46557 getAgendas: new DataProviderKey("agendas"), 46558 getAllReservationRequests: new DataProviderKey("reservation-request"), 46559 getAllReservations: new DataProviderKey("reservations"), 46560 getAskAccountProById: new DataProviderKey("ask_account_pro/generic/"), 46561 getBankingInfo: new DataProviderKey("user/generic/banking-info"), 46562 getCampaign: new DataProviderKey("campaign/generic"), 46563 getCart: new DataProviderKey("cart/generic"), 46564 getCartItem: new DataProviderKey("cart/generic/items/generic"), 46565 getCartItemCompatibleSubscriptions: new DataProviderKey("cart/generic/items/generic/compatible-subscriptions"), 46566 getCartItems: new DataProviderKey("cart/generic/items"), 46567 getCategories: new DataProviderKey("category"), 46568 getCategory: new DataProviderKey("category/generic"), 46569 getCitiesBySearch: new DataProviderKey("cities/generic"), 46570 getClosingStatement: new DataProviderKey("statement/closing/generic"), 46571 getClosingStatements: new DataProviderKey("statement/closing?from=generic&to=generic"), 46572 getContacts: new DataProviderKey("users/generic/contacts"), 46573 getCookieSession: new DataProviderKey("cookie_session"), 46574 getCurrentAccreditation: new DataProviderKey("accreditations/current"), 46575 getCustomForms: new DataProviderKey("custom-forms"), 46576 getCustomFormsByFormIdAnswerSetsById: new DataProviderKey("custom-forms/generic/answer-sets/generic"), 46577 getCustomFormsById: new DataProviderKey("custom-forms/generic"), 46578 getCustomFormsByIdAnswerSets: new DataProviderKey("custom-forms/generic/answer-sets"), 46579 getCustomList: new DataProviderKey("custom-list/generic"), 46580 getDashboardLastConnections: new DataProviderKey("dashboard/last_connections"), 46581 getDashboardWidgets: new DataProviderKey("dashboard/widgets"), 46582 getEvents: new DataProviderKey("events"), 46583 getEventsById: new DataProviderKey("events/generic"), 46584 getEventStatus: new DataProviderKey("events/generic/status"), 46585 getGiftcards: new DataProviderKey("giftcards?ids=generic"), 46586 getGiftcards2: new DataProviderKey("user/generic/giftcards"), 46587 getGiftcardsById: new DataProviderKey("giftcards/generic"), 46588 getGiftcardsTest: new DataProviderKey("giftcards/test?code=generic"), 46589 getIntegrityReport: new DataProviderKey("integrity_report/generic"), 46590 getIntegrityReports: new DataProviderKey("integrity_report"), 46591 getLabel: new DataProviderKey("label/generic"), 46592 getLabels: new DataProviderKey("label"), 46593 getLegacyToken: new DataProviderKey("legacy/token"), 46594 getLocation: new DataProviderKey("locations/generic"), 46595 getLocations: new DataProviderKey("locations"), 46596 getMerch: new DataProviderKey("merchs/generic"), 46597 getMerchs: new DataProviderKey("merchs"), 46598 getOptinById: new DataProviderKey("optins/generic"), 46599 getOptins: new DataProviderKey("optins"), 46600 getOrder: new DataProviderKey("orders/generic"), 46601 getOrders: new DataProviderKey("orders"), 46602 getPartner: new DataProviderKey("partner/generic"), 46603 getPartners: new DataProviderKey("partner"), 46604 getPaymentLinks: new DataProviderKey("quote/generic/payment-link"), 46605 getPostcodesBySearch: new DataProviderKey("postcodes/generic"),
46606 getPrice: new DataProviderKey("prices/generic"), 46607 getProducer: new DataProviderKey("producer/generic"), 46608 getProducers: new DataProviderKey("producer"), 46609 getPromotionCode: new DataProviderKey("promotion-code"), 46610 getPurchase: new DataProviderKey("purchases/generic"), 46611 getPurchases: new DataProviderKey("purchases"), 46612 getQueueFrontConfig: new DataProviderKey("queue/front/config"), 46613 getQueueInfo: new DataProviderKey("queue/info"), 46614 getQueueSession: new DataProviderKey("queue/session"), 46615 getQueueSessions: new DataProviderKey("queue/sessions"), 46616 getQuota: new DataProviderKey("quota/generic"), 46617 getQuotas: new DataProviderKey("quota"), 46618 getQuote: new DataProviderKey("quotes/generic"), 46619 getQuotes: new DataProviderKey("quotes"), 46620 getRange: new DataProviderKey("range/generic"), 46621 getRanges: new DataProviderKey("range"), 46622 getReservation: new DataProviderKey("reservations/generic"), 46623 getReservationItem: new DataProviderKey("reservations/generic/items/generic"), 46624 getReservationItemCompatibleSubscriptions: new DataProviderKey("reservations/generic/items/generic/compatible-subscriptions"), 46625 getReservationItems: new DataProviderKey("reservations/generic/items"), 46626 getReservationRequest: new DataProviderKey("reservation-request/generic"), 46627 getReservationRequestConfigById: new DataProviderKey("reservation-request-config/generic"), 46628 getReservationRequestConfigs: new DataProviderKey("reservation-request-config"), 46629 getReservationRequestItem: new DataProviderKey("reservation-request/generic/items/generic"), 46630 getReservationRequestItemCompatibleSubscriptions: new DataProviderKey("reservation-request/generic/items/generic/compatible-subscriptions"), 46631 getReservationRequestItems: new DataProviderKey("reservation-request/generic/items"), 46632 getReservationRequestTreatment: new DataProviderKey("reservation-request/treatment?show_id[]=generic"), 46633 getRoom: new DataProviderKey("room/generic"), 46634 getRooms: new DataProviderKey("room"), 46635 getSeason: new DataProviderKey("season"), 46636 getSeasonByFilter: new DataProviderKey("season/generic"), 46637 getSeasonById: new DataProviderKey("season/generic"), 46638 getSession: new DataProviderKey("sessions/generic"), 46639 getSessions: new DataProviderKey("sessions"), 46640 getSettings: new DataProviderKey("settings"), 46641 getShows: new DataProviderKey("shows"), 46642 getShowsById: new DataProviderKey("shows/generic"), 46643 getShowsRelated: new DataProviderKey("shows/generic/related"), 46644 getShowStatus: new DataProviderKey("shows/generic/status"), 46645 getStatsPassControlMatrix: new DataProviderKey("stats/pass-control-matrix/generic"), 46646 getStructureTypes: new DataProviderKey("structures-types"), 46647 getSubscription: new DataProviderKey("subscriptions/generic"), 46648 getSubscriptions: new DataProviderKey("subscriptions"), 46649 getSubscriptionType: new DataProviderKey("subscription-types/generic"), 46650 getSubscriptionTypes: new DataProviderKey("subscription-types"), 46651 getTheme: new DataProviderKey("theme"), 46652 getTicket: new DataProviderKey("tickets/generic"), 46653 getTickets: new DataProviderKey("tickets"), 46654 getToken: new DataProviderKey("token"), 46655 getTranslate: new DataProviderKey("translate"), 46656 getUser: new DataProviderKey("user"), 46657 getUser2: new DataProviderKey("user/generic"), 46658 getUserByIdOrders: new DataProviderKey("user/generic/orders"), 46659 getUserByIdPurchases: new DataProviderKey("user/generic/purchases"), 46660 getUserByIdPurchasesByType: new DataProviderKey("user/generic/purchases/generic"), 46661 getUserLogout: new DataProviderKey("user/logout"), 46662 getUserMagicLogin: new DataProviderKey("user/magic-login?token=generic"), 46663 getWaitingLine: new DataProviderKey("waiting-line"), 46664 getWaitingLineConfig: new DataProviderKey("waiting-line-admin"), 46665 hasAccessReservationRequestConfig: new DataProviderKey("reservation-request-config/generic/has-access"), 46666 importCrmPro: new DataProviderKey("crm-import/generic"), 46667 linkCartItems: new DataProviderKey("cart/generic/link"), 46668 linkTicketToAccount: new DataProviderKey("tickets/link-to-account"), 46669 lockReservation: new DataProviderKey("reservations/generic/lock"), 46670 lockReservationReservationRequest: new DataProviderKey("reservation-request/generic/lock"), 46671 loginCustomList: new DataProviderKey("custom-list/login"), 46672 patchActivity: new DataProviderKey("activity/generic"), 46673 patchAdmin: new DataProviderKey("admin/generic"), 46674 patchCartItem: new DataProviderKey("cart/generic/items/generic"), 46675 patchCartItems: new DataProviderKey("cart/generic/items"), 46676 patchCategory: new DataProviderKey("category/generic"), 46677 patchCustomFormsByFormIdAnswerSetsById: new DataProviderKey("custom-forms/generic/answer-sets/generic"), 46678 patchLabel: new DataProviderKey("label/generic"), 46679 patchProducer: new DataProviderKey("producer/generic"), 46680 patchQuota: new DataProviderKey("quota/generic"), 46681 patchReservation: new DataProviderKey("reservations/generic"), 46682 patchReservationItem: new DataProviderKey("reservations/generic/items/generic"), 46683 patchReservationItems: new DataProviderKey("reservations/generic/items"), 46684 patchReservationRequest: new DataProviderKey("reservation-request/generic"), 46685 patchReservationRequestItem: new DataProviderKey("reservation-request/generic/items/generic"), 46686 patchReservationRequestItems: new DataProviderKey("reservation-request/generic/items"), 46687 patchSubscription: new DataProviderKey("subscriptions/generic"), 46688 postActivity: new DataProviderKey("activity"), 46689 postCart: new DataProviderKey("cart"), 46690 postCartDiscount: new DataProviderKey("cart/discount"), 46691 postCartItems: new DataProviderKey("cart/generic/items"), 46692 postCategory: new DataProviderKey("category"), 46693 postGiftcards: new DataProviderKey("giftcards"), 46694 postGiftcardsLink: new DataProviderKey("giftcards/link"), 46695 postLabel: new DataProviderKey("label"), 46696 postProducer: new DataProviderKey("producer"), 46697 postPromotionCode: new DataProviderKey("promotion-code"), 46698 postQuota: new DataProviderKey("quota"),
46699 postQuote: new DataProviderKey("quotes"), 46700 postReservationItems: new DataProviderKey("reservations/generic/items"), 46701 postReservationRequestItems: new DataProviderKey("reservation-request/generic/items"), 46702 postUser: new DataProviderKey("user"), 46703 postUserLinkValidate: new DataProviderKey("user/link/validate"), 46704 postUserLogin: new DataProviderKey("user/login"), 46705 processIntegrityReport: new DataProviderKey("integrity_report/process"), 46706 processIntegrityReportByClass: new DataProviderKey("integrity_report/process/generic"), 46707 purgeQueueSessions: new DataProviderKey("queue/sessions"), 46708 putCartItems: new DataProviderKey("cart/generic/items"), 46709 putUserById: new DataProviderKey("user/generic"), 46710 putUserByIdPassword: new DataProviderKey("user/generic/password"), 46711 putUserValidate: new DataProviderKey("user/validate"), 46712 recoverCart: new DataProviderKey("recover-orders"), 46713 refreshBannedIpsFromData: new DataProviderKey("banned_ips/refresh_from_data"), 46714 requestLoginLink: new DataProviderKey("user/login-link"), 46715 resetPassword: new DataProviderKey("user/reset-password"), 46716 restoreReservationRequest: new DataProviderKey("reservation-request/generic/restore"), 46717 saveCart: new DataProviderKey("cart/current/save"), 46718 sendEmail: new DataProviderKey("email"), 46719 sendLogs: new DataProviderKey("log"), 46720 sendQuote: new DataProviderKey("quote/generic/send/"), 46721 setAdminInterface: new DataProviderKey("admin/generic/interface"), 46722 submitReservationRequest: new DataProviderKey("reservation-request/generic/submit"), 46723 synchroCrm: new DataProviderKey("crm?synchro=generic"), 46724 synchroCrmPro: new DataProviderKey("crm-pro/generic/generic"), 46725 unlockReservation: new DataProviderKey("reservations/generic/unlock"), 46726 unlockReservationRequest: new DataProviderKey("reservation-request/generic/unlock"), 46727 unlockReservationRequestConfig: new DataProviderKey("reservation-request-config/generic/login"), 46728 updateBankingInfo: new DataProviderKey("user/generic/banking-info"), 46729 updateQueueConfig: new DataProviderKey("queue/config"), 46730 updateQueueSession: new DataProviderKey("queue/session") 46731 } 46732 }); 46733 const FALLBACK_LIST_PATH = { 46734 [CartType.WaitingLists]: "waiting-lists", 46735 [CartType.Cart]: "cart" 46736 }; 46737 function listPathForCartType(type) { 46738 switch (type) { 46739 case CartType.ReservationRequest: 46740 return endpoints.getAllReservationRequests.path; 46741 case CartType.Reservation: 46742 return endpoints.getAllReservations.path; 46743 default: 46744 return FALLBACK_LIST_PATH[type] ?? "cart"; 46745 } 46746 } 46747 const TREATMENT_CART_STATUSES = [ 46748 ReservationStatus.Pending, 46749 ReservationStatus.Draft, 46750 ReservationStatus.PartiallyProcessed, 46751 ReservationStatus.Confirmed, 46752 ReservationStatus.Declined, 46753 ReservationStatus.Submitted 46754 ]; 46755 function getCartEndpoint(options) { 46756 const { 46757 type, 46758 userId, 46759 statuses, 46760 limit, 46761 isQueue, 46762 sessionIds, 46763 multisessionId, 46764 updatedAfter, 46765 updatedBefore, 46766 ids, 46767 forTreatment, 46768 sort 46769 } = options; 46770 const params = new URLSearchParams(); 46771 params.set("type[]", type); 46772 if (forTreatment) { 46773 TREATMENT_CART_STATUSES.forEach((status) => { 46774 params.append("status[]", status); 46775 }); 46776 } else { 46777 statuses?.forEach((status) => { 46778 params.append("status[]", status); 46779 }); 46780 } 46781 sessionIds?.forEach((sessionId) => { 46782 params.append("session_id[]", sessionId.toString()); 46783 }); 46784 if (multisessionId) { 46785 params.set("multisession_id", multisessionId.toString()); 46786 } 46787 if (userId) { 46788 params.set("buyer[uid]", userId.toString()); 46789 } 46790 if (ids?.length) { 46791 params.set("ids", ids.join(",")); 46792 params.set("limit", String(ids.length)); 46793 } 46794 if (updatedAfter) { 46795 const updatedAfterToTimestamp = Math.floor(updatedAfter.getTime() / 1e3); 46796 params.set("updated_after", updatedAfterToTimestamp.toString()); 46797 } 46798 if (updatedBefore) { 46799 const updatedBeforeToTimestamp = Math.floor(updatedBefore.getTime() / 1e3); 46800 params.set("updated_before", updatedBeforeToTimestamp.toString()); 46801 } 46802 if (sort) { 46803 params.set("sort", sort); 46804 } 46805 const limitParam = limit ? `&limit=${limit}` : ""; 46806 const queueParams = isQueue ? `&limit=$limit&offset=$offset` : ""; 46807 return `${listPathForCartType(type)}?${params.toString()}${queueParams}${limitParam}`; 46808 } 46809 async function getUserCarts(element, options) { 46810 const { cartType, userId, statuses, limit, isQueue, sessionIds, multisessionId, updatedAfter, updatedBefore } = options; 46811 const endpoint = getCartEndpoint({ 46812 type: cartType, 46813 userId, 46814 statuses, 46815 limit, 46816 isQueue, 46817 sessionIds, 46818 multisessionId, 46819 updatedAfter, 46820 updatedBefore 46821 }); 46822 if (!userId || !endpoint) return []; 46823 const api2 = new API(HTML$1.getApiConfiguration(element)); 46824 const result = await api2.get(endpoint); 46825 if (result?.data && result.success) { 46826 return result.data; 46827 } 46828 return []; 46829 } 46830 var __defProp$1K = Object.defineProperty; 46831 var __getOwnPropDesc$1M = Object.getOwnPropertyDescriptor; 46832 var __decorateClass$1M = (decorators, target, key, kind) => { 46833 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1M(target, key) : target; 46834 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 46835 if (decorator = decorators[i2]) 46836 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 46837 if (kind && result) __defProp$1K(target, key, result); 46838 return result; 46839 }; 46840 let SonicCartFull$1 = class SonicCartFull extends Subscriber$1(i$6) { 46841 constructor() { 46842 super(...arguments); 46843 this.layout = "default"; 46844 this.mode = "default"; 46845 this.goBack = false;
46846 this.noCartActions = false; 46847 this.payment_link_hash = null; 46848 this.readOnly = false; 46849 this.maxHeight = false; 46850 this.displaySummary = false; 46851 this.noDetailButton = false; 46852 this.title = ""; 46853 this.summary = "icon"; 46854 this.cartType = CartType.Cart; 46855 this.subTitle = ""; 46856 this.text = ""; 46857 this.cartProvider = "cart/current"; 46858 this._waitingListModuleEnabled = false; 46859 this.cancelCart = () => { 46860 const api2 = new API(this.getApiConfiguration()); 46861 api2.delete("/cart/cancel", {}).then(() => dp("cart/current").invalidate()); 46862 }; 46863 this.isWaiting = false; 46864 this._hasWaitingList = false; 46865 } 46866 connectedCallback() { 46867 this.cartProvider = this.getAncestorAttributeValue("cartProvider") || "cart/current"; 46868 super.connectedCallback(); 46869 } 46870 willUpdate(_changedProperties) { 46871 super.willUpdate(_changedProperties); 46872 if (_changedProperties.has("readOnly")) { 46873 if (this.readOnly) { 46874 this.mode = "readonly"; 46875 } 46876 } 46877 if (_changedProperties.has("payment_link_hash")) { 46878 if (this.payment_link_hash) { 46879 this.mode = "readonly"; 46880 } 46881 } 46882 if (_changedProperties.has("userId") && _changedProperties.has("_waitingListModuleEnabled")) { 46883 if (this.userId && this._waitingListModuleEnabled) { 46884 this.updateWaitingList(); 46885 } 46886 } 46887 } 46888 async updateWaitingList() { 46889 const fourHoursAgo = new Date(Date.now() - 4 * 60 * 60 * 1e3); 46890 const userWaitingLists = await getUserCarts(this, { 46891 cartType: CartType.WaitingLists, 46892 userId: Number(this.userId), 46893 statuses: [ReservationStatus.Submitted], 46894 limit: 1, 46895 updatedAfter: fourHoursAgo 46896 }); 46897 this._hasWaitingList = userWaitingLists.length > 0; 46898 } 46899 async firstUpdated() { 46900 if (!this.props && this.cartProvider !== "cart/current") { 46901 const api2 = new API(HTML.getApiConfiguration(this)); 46902 await Cart.updateCart(api2, this.cartProvider); 46903 } 46904 } 46905 render() { 46906 if (this.isWaiting) return A$1; 46907 const urlCartRecover = appRoute("checkout"); 46908 const paymentHash = this.payment_link_hash; 46909 if (urlCartRecover.hasHash() && paymentHash) { 46910 urlCartRecover.query({ cart_id: paymentHash }); 46911 } else if (paymentHash) { 46912 urlCartRecover.appendPath(paymentHash); 46913 } 46914 if (this.cartType == "cart" && paymentHash) 46915 return b$1` 46916 ${this.renderTitle()} 46917 <div class="@container my-12"> 46918 <div class="mb-2 flex flex-col gap-2 "> 46919 <div class="flex gap-2"> 46920 <sonic-icon 46921 library="custom" 46922 prefix="solid" 46923 name="circle-exclamation" 46924 class="text-lg @xl:text-xl @2xl:text-2xl" 46925 ></sonic-icon> 46926 <div class=" flex-grow"> 46927 <div class="text-lg @xl:text-xl @2xl:text-2xl leading-none font-bold mb-6"> 46928 ${t("waiting_cart_message")} 46929 </div> 46930 <sonic-cart-summary></sonic-cart-summary> 46931 <div class="flex items-center gap-x-3 mt-2"> 46932 <sonic-cart-total class="text-lg font-bold"></sonic-cart-total> 46933 <sonic-pop> 46934 <sonic-button shape="circle" size="xs" icon> 46935 <sonic-icon library="custom" name="angle-down"></sonic-icon 46936 ></sonic-button> 46937 <div slot="content" class="content w-[80vw] max-w-[20rem] p-3"> 46938 <sonic-cart-items 46939 mode="readonly" 46940 layout="condensed" 46941 noCartActions 46942 maxHeight="40vh" 46943 ></sonic-cart-items> 46944 </div> 46945 </sonic-pop> 46946 </div> 46947 </div> 46948 </div> 46949 </div> 46950 <div class="flex gap-2 flex-col items-center justify-center mt-6"> 46951 <sonic-button href="${urlCartRecover}" type="success" class="w-full "> 46952 <sonic-icon library="custom" name="arrow-right"></sonic-icon>
46953 <span class="font-bold"> ${t("waiting_cart_continue")} </span> 46954 </sonic-button> 46955 <sonic-button variant="ghost" size="xs" @click="${this.cancelCart}"> 46956 <sonic-icon library="iconoir" name="trash"></sonic-icon> 46957 ${t("waiting_cart_cancel")} 46958 </sonic-button> 46959 </div> 46960 </div> 46961 `; 46962 return b$1` 46963 <!-- Contenu du panier et bouton de soumission --> 46964 <sonic-cart-items 46965 layout=${this.layout} 46966 displaySummary 46967 ?readOnly=${this.readOnly} 46968 ?maxHeight=${this.maxHeight} 46969 ?noAdditionalProducts=${this.readOnly} 46970 ?noDetailButton=${this.noDetailButton} 46971 > 46972 <div class="mb-2" slot="title"> 46973 ${this.renderTitle()} 46974 ${this.text || this.subTitle ? b$1` 46975 <sonic-alert status="info" class="text-left mt-6 mb-4" label="${this.subTitle}" size="sm" background> 46976 ${this.text ? b$1`${o$6(this.text)}` : A$1} 46977 </sonic-alert> 46978 ` : A$1} 46979 </div> 46980 46981 ${this.renderWaitingMessage()} 46982 </sonic-cart-items> 46983 46984 ${this.noCartActions ? A$1 : b$1`<sonic-cart-actions></sonic-cart-actions>`} 46985 `; 46986 } 46987 renderWaitingMessage() { 46988 if (this.cartType !== CartType.Cart || !this._hasWaitingList) return A$1; 46989 return b$1`<sonic-alert 46990 slot="actions" 46991 noIcon 46992 class="text-center my-2 text-info" 46993 size="sm" 46994 background 46995 label="${t("LIB_waiting_list_message_cart")}" 46996 > 46997 <sonic-button 46998 autoActive="strict" 46999 variant="outline" 47000 size="xs" 47001 type="info" 47002 href=${appRoute("account.waitingLists")} 47003 > 47004 <sonic-icon library="custom" name="list-ol"> </sonic-icon> ${t("LIB_mes_listes_d_attente")} 47005 </sonic-button> 47006 </sonic-alert> `; 47007 } 47008 renderTitle() { 47009 const isCondensed = this.layout == "condensed"; 47010 return b$1` 47011 <div 47012 class="${isCondensed ? "text-xl lg:text-2xl" : "text-2xl lg:text-2xl xl:text-3xl "} flex gap-2 items-center text-left " 47013 > 47014 ${this.goBack ? b$1` 47015 <sonic-button goBack=${appRoute("home")} icon shape="circle" class="mr-1"> 47016 <sonic-icon library="custom" name="arrow-left"></sonic-icon> 47017 </sonic-button> 47018 ` : A$1} 47019 <div class="flex items-center gap-2"> 47020 <sonic-reservation-icon class="relative z-20" noRemainingTime></sonic-reservation-icon> 47021 <div class="font-bold leading-none">${cartTitle(this.cartType)}</div> 47022 </div> 47023 </div> 47024 `; 47025 } 47026 }; 47027 SonicCartFull$1.styles = [ 47028 tailwind, 47029 i$9` 47030 :host { 47031 display: block; 47032 max-width: 90ch; 47033 } 47034 :host([fullWidth]) { 47035 max-width: none; 47036 } 47037 ` 47038 ]; 47039 __decorateClass$1M([ 47040 e$2({ context: layoutContext }), 47041 n$5({ type: String }) 47042 ], SonicCartFull$1.prototype, "layout", 2); 47043 __decorateClass$1M([ 47044 e$2({ context: modeContext }), 47045 n$5({ type: String }) 47046 ], SonicCartFull$1.prototype, "mode", 2); 47047 __decorateClass$1M([ 47048 n$5({ type: Boolean }) 47049 ], SonicCartFull$1.prototype, "goBack", 2); 47050 __decorateClass$1M([ 47051 n$5({ type: Boolean }) 47052 ], SonicCartFull$1.prototype, "noCartActions", 2); 47053 __decorateClass$1M([ 47054 n$5({ type: String }) 47055 ], SonicCartFull$1.prototype, "payment_link_hash", 2); 47056 __decorateClass$1M([ 47057 n$5({ type: Boolean }) 47058 ], SonicCartFull$1.prototype, "readOnly", 2); 47059 __decorateClass$1M([ 47060 n$5({ type: Boolean }) 47061 ], SonicCartFull$1.prototype, "maxHeight", 2); 47062 __decorateClass$1M([ 47063 n$5({ type: Boolean }) 47064 ], SonicCartFull$1.prototype, "displaySummary", 2); 47065 __decorateClass$1M([ 47066 n$5({ type: Boolean }) 47067 ], SonicCartFull$1.prototype, "noDetailButton", 2); 47068 __decorateClass$1M([ 47069 n$5({ type: String, attribute: "data-title" }) 47070 ], SonicCartFull$1.prototype, "title", 2); 47071 __decorateClass$1M([ 47072 n$5({ type: String }) 47073 ], SonicCartFull$1.prototype, "summary", 2); 47074 __decorateClass$1M([ 47075 e$2({ context: cartTypeContext }), 47076 n$5({ type: String }) 47077 ], SonicCartFull$1.prototype, "cartType", 2); 47078 __decorateClass$1M([ 47079 n$5({ type: String }) 47080 ], SonicCartFull$1.prototype, "subTitle", 2); 47081 __decorateClass$1M([ 47082 n$5({ type: String }) 47083 ], SonicCartFull$1.prototype, "text", 2); 47084 __decorateClass$1M([ 47085 n$5({ type: String }) 47086 ], SonicCartFull$1.prototype, "cartProvider", 2); 47087 __decorateClass$1M([ 47088 bind$1("settings.modules.waiting_list.enabled"), 47089 r$5() 47090 ], SonicCartFull$1.prototype, "_waitingListModuleEnabled", 2); 47091 __decorateClass$1M([ 47092 bind$1("sonicTicketApp.isWaiting"), 47093 r$5() 47094 ], SonicCartFull$1.prototype, "isWaiting", 2); 47095 __decorateClass$1M([ 47096 bind$1("user.id"), 47097 r$5() 47098 ], SonicCartFull$1.prototype, "userId", 2); 47099 __decorateClass$1M([ 47100 r$5() 47101 ], SonicCartFull$1.prototype, "_hasWaitingList", 2); 47102 SonicCartFull$1 = __decorateClass$1M([ 47103 t$3("sonic-cart-full") 47104 ], SonicCartFull$1); 47105 const algorithm = "AES-CBC"; 47106 const keyLength = 256; 47107 async function generateKey() { 47108 return crypto.subtle.generateKey( 47109 { 47110 name: algorithm, 47111 length: keyLength 47112 }, 47113 true, 47114 // extractable 47115 ["encrypt", "decrypt"] 47116 ); 47117 } 47118 function toBase64(buffer) { 47119 return btoa(String.fromCharCode(...new Uint8Array(buffer))); 47120 } 47121 async function encryptToBase64(data, key, iv) {
47122 const encodedData = new TextEncoder().encode(data); 47123 const encrypted = await crypto.subtle.encrypt({ 47124 name: algorithm, 47125 iv: iv.buffer 47126 }, key, encodedData); 47127 return toBase64(encrypted); 47128 } 47129 const altchaStyles = i$9` 47130 @keyframes altcha-spinner { 47131 to { 47132 transform: rotate(360deg); 47133 } 47134 } 47135 .altcha { 47136 background: var(--altcha-color-base, transparent); 47137 display: flex; 47138 flex-direction: column; 47139 position: relative; 47140 } 47141 47142 .altcha[data-floating] { 47143 background: var(--altcha-color-base, white); 47144 display: none; 47145 filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2)); 47146 left: -100%; 47147 position: fixed; 47148 top: -100%; 47149 width: var(--altcha-max-width, 260px); 47150 z-index: 999999; 47151 } 47152 .altcha[data-floating="top"] .altcha-anchor-arrow { 47153 border-bottom-color: transparent; 47154 border-top-color: var(--altcha-color-border, #a0a0a0); 47155 bottom: -12px; 47156 top: auto; 47157 } 47158 .altcha[data-floating="bottom"]:focus-within::after { 47159 border-bottom-color: var(--altcha-color-border-focus, currentColor); 47160 } 47161 .altcha[data-floating="top"]:focus-within::after { 47162 border-top-color: var(--altcha-color-border-focus, currentColor); 47163 } 47164 .altcha[data-floating]:not([data-state="unverified"]) { 47165 display: block; 47166 } 47167 .altcha-anchor-arrow { 47168 border: 6px solid transparent; 47169 border-bottom-color: var(--altcha-color-border, #a0a0a0); 47170 content: ""; 47171 height: 0; 47172 left: 12px; 47173 position: absolute; 47174 top: -12px; 47175 width: 0; 47176 } 47177 .altcha-main { 47178 align-items: center; 47179 display: flex; 47180 gap: 0.4rem; 47181 padding: 0.7rem; 47182 position: relative; 47183 } 47184 .altcha-code-challenge { 47185 background: var(--altcha-color-base, white); 47186 border: 1px solid var(--altcha-color-border-focus, currentColor); 47187 border-radius: var(--altcha-border-radius, 3px); 47188 filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2)); 47189 padding: 0.5rem; 47190 position: absolute; 47191 top: 2.5rem; 47192 z-index: 9999999; 47193 } 47194 .altcha-code-challenge > form { 47195 display: flex; 47196 flex-direction: column; 47197 gap: 0.5rem; 47198 } 47199 .altcha-code-challenge-input { 47200 border: 1px solid currentColor; 47201 border-radius: 3px; 47202 box-sizing: border-box; 47203 outline: 0; 47204 font-size: 16px; 47205 padding: 0.35rem; 47206 width: 220px; 47207 } 47208 .altcha-code-challenge-input:focus { 47209 outline: 2px solid 47210 color-mix(in srgb, var(--altcha-color-active, #1d1dc9) 20%, transparent); 47211 } 47212 .altcha-code-challenge-input:disabled { 47213 opacity: 0.7; 47214 } 47215 .altcha-code-challenge-image { 47216 background-color: #fff; 47217 border: 1px solid currentColor; 47218 border-radius: 3px; 47219 box-sizing: border-box; 47220 object-fit: contain; 47221 height: 50px; 47222 width: 220px; 47223 } 47224 .altcha-code-challenge-audio, 47225 .altcha-code-challenge-reload { 47226 background: color-mix( 47227 in srgb, 47228 var(--altcha-color-text, currentColor) 10%, 47229 transparent 47230 ); 47231 border: 0; 47232 border-radius: 3px; 47233 color: var(--altcha-color-text, currentColor); 47234 cursor: pointer; 47235 display: flex; 47236 align-items: center; 47237 justify-content: center; 47238 padding: 0.35rem; 47239 } 47240 .altcha-code-challenge-audio:disabled, 47241 .altcha-code-challenge-reload:disabled, 47242 .altcha-code-challenge-verify:disabled { 47243 opacity: 0.7; 47244 pointer-events: none; 47245 } 47246 .altcha-code-challenge-audio > *, 47247 .altcha-code-challenge-reload > * { 47248 height: 20px; 47249 width: 20px; 47250 } 47251 .altcha-code-challenge-buttons { 47252 display: flex; 47253 justify-content: space-between; 47254 } 47255 .altcha-code-challenge-buttons-left { 47256 display: flex; 47257 gap: 0.25rem; 47258 } 47259 .altcha-code-challenge-verify { 47260 align-items: center; 47261 background: var(--altcha-color-active, #1d1dc9); 47262 border: 0; 47263 border-radius: 3px; 47264 color: #fff; 47265 cursor: pointer; 47266 display: flex; 47267 gap: 0.5rem; 47268 font-size: 100%; 47269 padding: 0.35rem 1rem; 47270 } 47271 .altcha-code-challenge-arrow { 47272 border: 6px solid transparent; 47273 border-bottom-color: var(--altcha-color-border, currentColor); 47274 content: ""; 47275 height: 0; 47276 left: 0.15rem; 47277 position: absolute; 47278 top: -12px; 47279 width: 0; 47280 } 47281 .altcha[data-floating="top"] .altcha-code-challenge { 47282 top: -150px; 47283 } 47284 .altcha[data-floating="top"] .altcha-code-challenge-arrow { 47285 border-bottom-color: transparent; 47286 border-top-color: var(--altcha-color-border, currentColor); 47287 bottom: -12px; 47288 top: auto; 47289 } 47290 .altcha-label { 47291 cursor: pointer; 47292 flex-grow: 1; 47293 line-height: 1.15; 47294 } 47295 .altcha-logo { 47296 color: currentColor !important; 47297 opacity: 0.7; 47298 } 47299 .altcha-footer:hover, 47300 .altcha-logo:hover { 47301 opacity: 1; 47302 } 47303 .altcha-error { 47304 color: var(--altcha-color-error-text, #f23939); 47305 display: flex; 47306 font-size: 0.85rem; 47307 gap: 0.3rem; 47308 padding: 0 0.7rem 0.7rem; 47309 } 47310 .altcha-footer {
47311 align-items: center; 47312 background-color: var(--altcha-color-footer-bg, transparent); 47313 display: flex; 47314 font-size: 0.75rem; 47315 opacity: 0.7; 47316 justify-content: end; 47317 padding: 0.2rem 0.7rem; 47318 } 47319 .altcha-footer a { 47320 color: currentColor; 47321 } 47322 .altcha-checkbox { 47323 display: flex; 47324 align-items: center; 47325 justify-content: center; 47326 height: 24px; 47327 position: relative; 47328 width: 24px; 47329 margin: 0; 47330 } 47331 .altcha-checkbox .altcha-spinner { 47332 bottom: 0; 47333 left: 0; 47334 position: absolute; 47335 right: 0; 47336 top: 0; 47337 } 47338 .altcha-checkbox input { 47339 width: 18px; 47340 height: 18px; 47341 margin: 0; 47342 } 47343 .altcha-checkbox-verifying input { 47344 appearance: none; 47345 opacity: 0; 47346 pointer-events: none; 47347 } 47348 .altcha-spinner { 47349 animation: altcha-spinner 0.75s infinite linear; 47350 transform-origin: center; 47351 } 47352`; 47353 var __defProp$1J = Object.defineProperty; 47354 var __getOwnPropDesc$1L = Object.getOwnPropertyDescriptor; 47355 var __decorateClass$1L = (decorators, target, key, kind) => { 47356 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1L(target, key) : target; 47357 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 47358 if (decorator = decorators[i2]) 47359 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 47360 if (kind && result) __defProp$1J(target, key, result); 47361 return result; 47362 }; 47363 const MATH_FALLBACK_KEY = "math_fallback"; 47364 const ALTCHA_ENABLED_PATH = "settings.modules.altcha.enabled"; 47365 const CHALLENGE_URL = "https://altcha.supersoniks.org/get-challenge"; 47366 const MAX_NUMBER = 5e4; 47367 const PASS_PHRASE = "supersoniks_altcha"; 47368 const IV = "Si2\\]X8M4!n9DCLd"; 47369 const CHALLENGE_TIMEOUT_MS = 5e3; 47370 let scriptAdded = false; 47371 let LbCaptcha = class extends i$6 { 47372 constructor() { 47373 super(...arguments); 47374 this.key = ""; 47375 this.useMathFallback = false; 47376 this.mathAnswer = ""; 47377 this.captchaImgSrc = "/captcha?t=0"; 47378 this.challengeProbeDone = false; 47379 this.altchaBootstrapped = false; 47380 this.onCaptchaTokenChanged = (v2) => { 47381 if (v2 !== "request_token") return; 47382 this.formPublisher?.captchaToken.set(""); 47383 this.useMathFallback ? this.publishMath() : this.publishAltcha(); 47384 }; 47385 this.onAltchaEnabledAssign = (enabled) => this.applyAltchaAvailability(enabled); 47386 this.onLoginMessageAssign = (message) => { 47387 if (this.useMathFallback && message?.success === false) this.refreshMathChallenge(); 47388 }; 47389 this.onAltchaStateChange = (ev) => { 47390 const detail = ev.detail; 47391 if (detail?.state === "error") this.activateMathFallback(); 47392 else if (detail?.state === "verified") this.publishAltcha(); 47393 }; 47394 } 47395 connectedCallback() { 47396 if (!document.location.protocol.includes("https")) { 47397 super.connectedCallback(); 47398 return; 47399 } 47400 super.connectedCallback(); 47401 const providerPath = HTML.getAncestorAttributeValue(this, "headersDataProvider") ?? HTML.getAncestorAttributeValue(this, "formDataProvider") ?? this.getAttribute("formdataprovider"); 47402 this.formPublisher = providerPath ? dp$1(providerPath) : void 0; 47403 if (this.formPublisher && !this.formPublisher.captchaToken.get()) { 47404 this.formPublisher.needsCaptchaValidation.set(true); 47405 this.formPublisher.captchaToken.onAssign(this.onCaptchaTokenChanged); 47406 } 47407 dp$1(ALTCHA_ENABLED_PATH).onAssign(this.onAltchaEnabledAssign); 47408 dp$1("LoginMessage").onAssign(this.onLoginMessageAssign); 47409 this.applyAltchaAvailability(get$2(ALTCHA_ENABLED_PATH)); 47410 } 47411 disconnectedCallback() { 47412 dp$1(ALTCHA_ENABLED_PATH).offAssign(this.onAltchaEnabledAssign); 47413 dp$1("LoginMessage").offAssign(this.onLoginMessageAssign); 47414 if (this.formPublisher) { 47415 this.formPublisher.captchaToken.offAssign(this.onCaptchaTokenChanged); 47416 this.formPublisher.captchaToken.set(""); 47417 this.formPublisher.needsCaptchaValidation.set(false); 47418 } 47419 super.disconnectedCallback(); 47420 } 47421 applyAltchaAvailability(enabled) { 47422 if (enabled === false) { 47423 this.activateMathFallback(); 47424 return; 47425 } 47426 if (enabled !== true || this.altchaBootstrapped || this.useMathFallback) return; 47427 this.altchaBootstrapped = true; 47428 if (!scriptAdded) { 47429 const script = document.createElement("script"); 47430 script.type = "module"; 47431 script.src = "https://eu.altcha.org/js/latest/altcha.min.js"; 47432 scriptAdded = true; 47433 document.head.appendChild(script); 47434 } 47435 void generateKey().then((key) => encryptToBase64(PASS_PHRASE, key, new TextEncoder().encode(IV))).then((encrypted) => { 47436 if (!this.key) this.key = encrypted; 47437 }).catch(() => this.activateMathFallback()); 47438 } 47439 updated(changed) { 47440 if (changed.has("key") && this.key && !this.useMathFallback && !this.challengeProbeDone) { 47441 this.challengeProbeDone = true; 47442 const url = `${CHALLENGE_URL}?key=${encodeURIComponent(this.key)}&maxNumber=${MAX_NUMBER}`; 47443 const ctrl = new AbortController(); 47444 const timer = window.setTimeout(() => ctrl.abort(), CHALLENGE_TIMEOUT_MS); 47445 void fetch(url, { signal: ctrl.signal }).then((r2) => { 47446 if (!r2.ok) this.activateMathFallback(); 47447 }).catch(() => this.activateMathFallback()).finally(() => window.clearTimeout(timer)); 47448 } 47449 if (this.useMathFallback && (changed.has("mathAnswer") || changed.has("useMathFallback"))) { 47450 this.publishMath(); 47451 } 47452 } 47453 activateMathFallback() { 47454 if (this.useMathFallback) return; 47455 this.useMathFallback = true;
47456 this.refreshMathChallenge(); 47457 } 47458 refreshMathChallenge() { 47459 this.mathAnswer = ""; 47460 this.captchaImgSrc = `/captcha?t=${Date.now()}`; 47461 this.publishMath(); 47462 } 47463 publishAltcha() { 47464 if (!this.formPublisher || this.useMathFallback) return; 47465 const form2 = this.shadowRoot?.querySelector("form"); 47466 if (!form2) return; 47467 this.formPublisher.captchaKey.set(this.key); 47468 this.formPublisher.captchaToken.set(new FormData(form2).get("altcha")?.toString() || ""); 47469 } 47470 publishMath() { 47471 if (!this.formPublisher) return; 47472 this.formPublisher.captchaKey.set(MATH_FALLBACK_KEY); 47473 this.formPublisher.captchaToken.set(this.mathAnswer.trim()); 47474 } 47475 render() { 47476 if (this.useMathFallback) { 47477 const label2 = t("LIB_combien_font"); 47478 const hint = t("LIB_question_securite"); 47479 return b$1` 47480 <div class="grid gap-2 text-left max-w-[260px] mb-2"> 47481 <label> 47482 ${label2} 47483 <img class="align-middle ml-1.5" src=${this.captchaImgSrc} alt=${hint} width="100" height="40" /> 47484 </label> 47485 <input 47486 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)]" 47487 type="text" 47488 inputmode="numeric" 47489 autocomplete="off" 47490 required 47491 .value=${this.mathAnswer} 47492 @input=${(ev) => { 47493 this.mathAnswer = ev.target.value; 47494 }} 47495 /> 47496 <div class="text-sm opacity-80">${hint}</div> 47497 </div> 47498 <slot></slot> 47499 `; 47500 } 47501 if (!this.key) return b$1`<slot></slot>`; 47502 const isFR = Boolean(HTML.getLanguage().match("^fr\\b")); 47503 const labels = isFR ? { 47504 aria: "Visitez altcha.org", 47505 error: "La vérification a échoué, réessayez plus tard.", 47506 expired: "La vérification a expiré, réessayez.", 47507 footer: "Protégé par Altcha", 47508 label: "Je ne suis pas un robot.", 47509 verified: "Vérifié", 47510 verifying: "Vérification en cours...", 47511 wait: "Vérification en cours⦠Veuillez patienter." 47512 } : {}; 47513 return b$1` 47514 <form> 47515 <altcha-widget 47516 challengeurl="${CHALLENGE_URL}?key=${encodeURIComponent(this.key)}&maxNumber=${MAX_NUMBER}" 47517 maxnumber=${MAX_NUMBER} 47518 hidelogo 47519 hidefooter 47520 auto="onfocus" 47521 strings=${JSON.stringify(labels)} 47522 @statechange=${this.onAltchaStateChange} 47523 ></altcha-widget> 47524 </form> 47525 <slot></slot> 47526 `; 47527 } 47528 }; 47529 LbCaptcha.styles = [ 47530 altchaStyles, 47531 tailwind, 47532 i$9` 47533 :host { 47534 --altcha-border-width: var(--sc-border-width, 1px); 47535 --altcha-border-radius: var(--sc-rounded); 47536 --altcha-color-base: var(--sc-base); 47537 --altcha-color-border: var(--sc-input-border-color, var(--sc-base-content, #000)); 47538 --altcha-color-text: var(--sc-base-content, #000); 47539 --altcha-color-active: var(--sc-base-content, #000); 47540 --altcha-color-border-focus: currentColor; 47541 --altcha-color-error-text: var(--sc-danger, var(--sc-base-content, #000)); 47542 --altcha-color-footer-bg: var(--sc-base-100, #000); 47543 --altcha-max-width: 260px; 47544 display: block; 47545 } 47546 ` 47547 ]; 47548 __decorateClass$1L([ 47549 n$5() 47550 ], LbCaptcha.prototype, "key", 2); 47551 __decorateClass$1L([ 47552 r$5() 47553 ], LbCaptcha.prototype, "useMathFallback", 2); 47554 __decorateClass$1L([ 47555 r$5() 47556 ], LbCaptcha.prototype, "mathAnswer", 2); 47557 __decorateClass$1L([ 47558 r$5() 47559 ], LbCaptcha.prototype, "captchaImgSrc", 2); 47560 LbCaptcha = __decorateClass$1L([ 47561 t$3("lb-captcha") 47562 ], LbCaptcha); 47563 var __defProp$1I = Object.defineProperty; 47564 var __getOwnPropDesc$1K = Object.getOwnPropertyDescriptor; 47565 var __decorateClass$1K = (decorators, target, key, kind) => { 47566 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1K(target, key) : target; 47567 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 47568 if (decorator = decorators[i2]) 47569 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 47570 if (kind && result) __defProp$1I(target, key, result); 47571 return result; 47572 }; 47573 let UserFormLogin = class extends Subscriber$1(i$6) { 47574 constructor() { 47575 super(...arguments); 47576 this.createAccount = false;
47577 this.customerType = "all"; 47578 this.userId = false; 47579 this.checkout = false; 47580 this.online_payment_id = 0; 47581 this.canCheckout = false; 47582 this.quickBuyEnabled = false; 47583 this.accessAskProAccount = false; 47584 this.create_pro_account = false; 47585 this.create_client_account = true; 47586 this.cartItems = []; 47587 this.displayLoginLinkModal = false; 47588 this.loginLinkEmail = ""; 47589 this.canQuickPurchase = false; 47590 } 47591 handleLogin() { 47592 const message = PublisherManager.get("LoginMessage").get(); 47593 if (message?.success) { 47594 PublisherManager.get("user").invalidate(); 47595 const urlParams = new URLSearchParams(window.location.search); 47596 const destination = urlParams.get("sonic_login_destination"); 47597 if (destination) { 47598 const decodedDestination = decodeURIComponent(destination); 47599 if (decodedDestination.startsWith("#")) { 47600 window.location.hash = decodedDestination; 47601 } else { 47602 window.location.href = decodedDestination; 47603 } 47604 } 47605 } 47606 } 47607 handleLoginLinkResult() { 47608 const result = PublisherManager.get("user/login-link/result").get(); 47609 if (result?.success) { 47610 this.hideLoginLinkModal(); 47611 } 47612 } 47613 connectedCallback() { 47614 const urlParams = new URLSearchParams(window.location.search); 47615 if (!this.online_payment_id) { 47616 this.online_payment_id = urlParams.get("payment_id") || PublisherManager.get("settings").online_payment_id.get(); 47617 } 47618 PublisherManager.get("LoginMessage").onInternalMutation(this.handleLogin); 47619 PublisherManager.get("user/login-link/result").onInternalMutation(this.handleLoginLinkResult); 47620 super.connectedCallback(); 47621 } 47622 willUpdate(_changedProperties) { 47623 const hasCartItems = this.cartItems && this.cartItems.length > 0; 47624 this.canQuickPurchase = this.checkout && hasCartItems && this.canCheckout && this.quickBuyEnabled; 47625 super.willUpdate(_changedProperties); 47626 } 47627 render() { 47628 const defaultCreateUrl = appRoute("account.create").toString(); 47629 const defaultMissingUrl = appRoute("account.missingPassword").toString(); 47630 const checkoutQuery = { 47631 payment_id: this.online_payment_id 47632 }; 47633 const urlCreateAccount = this.checkout ? appRoute("checkout").query({ ...checkoutQuery, create_account: true }) : defaultCreateUrl; 47634 const loginDescription = t("LIB_connexion_description"); 47635 const canCreateOrAskAcount = this.create_client_account || this.accessAskProAccount || this.create_pro_account; 47636 return b$1` 47637 <sonic-login-saml></sonic-login-saml> 47638 <div class="contents"> 47639 <sonic-fieldset 47640 endpoint="user/login" 47641 dataProvider="user/login" 47642 method="post" 47643 class="mb-2 lg:mb-3" 47644 formDataProvider="userLogin" 47645 submitResultDataProvider="LoginMessage" 47646 > 47647 <sonic-legend 47648 iconLibrary="custom" 47649 iconName="face-smile-relaxed" 47650 label=${t("se_connecter")} 47651 .description=${loginDescription} 47652 > 47653 </sonic-legend> 47654 <sonic-submit usernameKey="email" onEnterKey> 47655 <div class="grid grid-cols-1 gap-4 mb-4"> 47656 <sonic-input 47657 required 47658 autocomplete="username" 47659 id="username" 47660 label="${t("email")}" 47661 type="email" 47662 name="email" 47663 ></sonic-input> 47664 <sonic-input 47665 required 47666 autocomplete="current-password" 47667 id="current-password" 47668 label="${t("mot_de_passe")}" 47669 name="password" 47670 type="password" 47671 ></sonic-input> 47672 </div> 47673 </sonic-submit> 47674 47675 <div class="text-center"> 47676 <lb-captcha formdataprovider="userLogin" class="text-left"> 47677 <sonic-submit onClick usernameKey="email" class="w-full text-center"> 47678 <sonic-button minWidth="12rem" type="success" class="w-full mb-1 lg:mb-2 mt-2"> 47679 <sonic-icon library="custom" name="arrow-right-to-arc" slot="prefix"></sonic-icon> 47680 ${t("connexion")}</sonic-button 47681 > 47682 </sonic-submit> 47683 </lb-captcha> 47684 <div class="grid grid-cols-1 gap-3 justify-center items-center mt-1"> 47685 <sonic-button size="sm" variant="link" @click=${this.showLoginLinkModal} autoActive="disabled"> 47686 ${t("LIB_magic_login_button")} 47687 </sonic-button> 47688 <sonic-button href="${defaultMissingUrl}" size="sm" variant="link" autoActive="disabled"> 47689 ${t("mot_de_passe_oublie")} 47690 </sonic-button> 47691 </div> 47692 </div> 47693 </sonic-fieldset> 47694 </div> 47695 47696 ${this.createAccount && (canCreateOrAskAcount || this.canQuickPurchase) ? b$1` 47697 <sonic-fieldset> 47698 ${canCreateOrAskAcount ? b$1` 47699 <sonic-legend 47700 description=${this.createSubTitle} 47701 label="${t("no_account_yet")}" 47702 iconName="face-thinking" 47703 iconLibrary="custom" 47704 class="mb-3" 47705 > 47706 </sonic-legend> 47707 ` : A$1} 47708 <div class="grid w-full grid-cols-1 gap-2"> 47709 ${this.customerIsAllowed() && urlCreateAccount && this.create_client_account ? b$1` 47710 <sonic-button href=${urlCreateAccount}
47710 minWidth="12rem" type="neutral" class="w-full" 47711 ><sonic-icon library="custom" name="user-plus" slot="prefix"></sonic-icon> ${t( 47712 "create_account" 47713 )}</sonic-button 47714 > 47715 ` : A$1} 47716 ${this.quickPurchaseButton()} 47717 ${this.proIsAllowed() && (this.accessAskProAccount || this.create_pro_account) ? b$1` 47718 ${this.customerType === "all" ? b$1` <sonic-divider class="my-3"></sonic-divider> ` : A$1} 47719 <div class="text-center "> 47720 <sonic-app-link 47721 to="askProAccount" 47722 type="info" 47723 minWidth="12rem" 47724 variant="default" 47725 class="w-full" 47726 > 47727 <sonic-icon library="custom" name="user-tie" slot="prefix"></sonic-icon> 47728 <span class="font-bold" 47729 >${this.accessAskProAccount ? t("LIB_compte_pro_demander") : t("LIB_compte_pro_creer")}</span 47730 > 47731 </sonic-app-link> 47732 </div> 47733 ` : A$1} 47734 </div> 47735 </sonic-fieldset> 47736 ` : A$1} 47737 ${this.renderLoginLinkModal()} 47738 `; 47739 } 47740 customerIsAllowed() { 47741 return this.customerType === "all" || this.customerType === "customer"; 47742 } 47743 proIsAllowed() { 47744 return this.customerType === "all" || this.customerType === "pros"; 47745 } 47746 renderLoginLinkModal() { 47747 return b$1` 47748 <sonic-modal @hidden=${this.hideLoginLinkModal} ?visible=${this.displayLoginLinkModal} width="30rem"> 47749 <sonic-modal-title>${t("LIB_magic_login_button")}</sonic-modal-title> 47750 <sonic-modal-subtitle class="text-pretty"> ${t("LIB_magic_login_subtitle")} </sonic-modal-subtitle> 47751 <sonic-modal-content> 47752 <div 47753 class="flex gap-3 flex-col" 47754 formdataprovider="loginLink" 47755 submitResultDataProvider="user/login-link/result" 47756 > 47757 <sonic-submit 47758 @submit=${this.handleLoginLinkSubmit} 47759 onEnterKey 47760 endPoint="user/login-link" 47761 method="post" 47762 formDataProvider="loginLink" 47763 > 47764 <sonic-input 47765 name="email" 47766 type="email" 47767 label="${t("email")}" 47768 placeholder="[email protected]" 47769 .value=${this.loginLinkEmail} 47770 ></sonic-input> 47771 </sonic-submit> 47772 47773 <sonic-submit 47774 @submit=${this.handleLoginLinkSubmit} 47775 onClick 47776 endPoint="user/login-link" 47777 method="post" 47778 formDataProvider="loginLink" 47779 class="block w-full" 47780 > 47781 <sonic-button type="primary" shape="block"> 47782 <sonic-icon name="paper-plane" library="custom"></sonic-icon> ${t("LIB_send")} 47783 </sonic-button> 47784 </sonic-submit> 47785 </div> 47786 </sonic-modal-content> 47787 </sonic-modal> 47788 `; 47789 } 47790 handleLoginLinkSubmit(e2) { 47791 if (e2.detail.success) { 47792 this.hideLoginLinkModal(); 47793 } 47794 } 47795 showLoginLinkModal() { 47796 const emailInput = this.renderRoot?.querySelector("#username"); 47797 this.loginLinkEmail = (emailInput?.value || emailInput?.getAttribute?.("value") || "").toString(); 47798 this.displayLoginLinkModal = true; 47799 } 47800 hideLoginLinkModal() { 47801 this.displayLoginLinkModal = false; 47802 } 47803 quickPurchaseButton() { 47804 const checkoutQuery = { 47805 payment_id: this.online_payment_id 47806 }; 47807 const urlQuickPurchase = appRoute("checkout").query({ 47808 ...checkoutQuery, 47809 quick_buy: true 47810 }); 47811 const hasSubscriptionInCart = this.cartItems?.some((item) => item.entity_type === EntityType.Subscribe); 47812 const displayQuickPurchaseButton = this.canQuickPurchase && urlQuickPurchase && !hasSubscriptionInCart; 47813 if (displayQuickPurchaseButton) { 47814 return b$1`<div class="text-center "> 47815 <sonic-button href=${urlQuickPurchase} variant="outline" minWidth="12rem" class="w-full" 47816 ><sonic-icon library="custom" name="cart-shopping-fast" slot="prefix"></sonic-icon> 47817 ${t("link_title_quick_purchase")} 47818 </sonic-button> 47819 </div>`; 47820 } 47821 return A$1; 47822 } 47823 }; 47824 UserFormLogin.styles = [ 47825 tailwind, 47826 i$9` 47827 :host { 47828 display: block; 47829 max-width: 25rem; 47830 } 47831 ` 47832 ]; 47833 __decorateClass$1K([ 47834 n$5({ type: Boolean }) 47835 ], UserFormLogin.prototype, "createAccount", 2); 47836 __decorateClass$1K([ 47837 n$5({ type: String }) 47838 ], UserFormLogin.prototype, "customerType", 2); 47839 __decorateClass$1K([ 47840 n$5({ type: Boolean }) 47841 ], UserFormLogin.prototype, "userId", 2); 47842 __decorateClass$1K([ 47843 n$5({ type: Boolean }) 47844 ], UserFormLogin.prototype, "checkout", 2); 47845 __decorateClass$1K([ 47846 n$5({ type: Number }) 47847 ], UserFormLogin.prototype, "online_payment_id", 2); 47848 __decorateClass$1K([ 47849 n$5({ type: String }) 47850 ], UserFormLogin.prototype, "createSubTitle", 2); 47851 __decorateClass$1K([ 47852 bind$1("cart/current.data.canCheckout"), 47853 r$5() 47854 ], UserFormLogin.prototype, "canCheckout", 2); 47855 __decorateClass$1K([ 47856 bind$1("settings.quick_purchase"), 47857 r$5() 47858 ], UserFormLogin.prototype, "quickBuyEnabled", 2); 47859 __decorateClass$1K([ 47860 bind$1("settings.modules.ask_pro_account.access"), 47861 r$5() 47862 ], UserFormLogin.prototype, "accessAskProAccount", 2); 47863 __decorateClass$1K([ 47864 bind$1("settings.modules.create_pro_account.access"), 47865 r$5() 47866 ], UserFormLogin.prototype, "create_pro_account", 2); 47867 __decorateClass$1K([ 47868 bind$1("settings.modules.create_client_account.access"), 47869 r$5() 47870 ], UserFormLogin.prototype, "create_client_account", 2); 47871 __decorateClass$1K([ 47872 bind$1("cart/current.data.items"), 47873 r$5() 47874 ], UserFormLogin.prototype, "cartItems", 2); 47875 __decorateClass$1K([ 47876 r$5() 47877 ], UserFormLogin.prototype, "displayLoginLinkModal", 2); 47878 __decorateClass$1K([ 47879 r$5() 47880 ], UserFormLogin.prototype, "loginLinkEmail", 2); 47881 __decorateClass$1K([ 47882 r$5() 47883 ], UserFormLogin.prototype, "canQuickPurchase", 2); 47884 UserFormLogin = __decorateClass$1K([ 47885 t$3("sonic-user-form-login") 47886 ], UserFormLogin); 47887 var __defProp$1H = Object.defineProperty; 47888 var __getOwnPropDesc$1J = Object.getOwnPropertyDescriptor; 47889 var __decorateClass$1J = (decorators, target, key, kind) => { 47890 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1J(target, key) : target; 47891 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 47892 if (decorator = decorators[i2]) 47893 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 47894 if (kind && result) __defProp$1H(target, key, result); 47895 return result; 47896 }; 47897 const tagName$1b = "sonic-clamped-content"; 47898 let SonicClampedContent = class extends i$6 { 47899 constructor() { 47900 super(...arguments); 47901 this.height = 12; 47902 this.buttonSize = "inherit"; 47903 this.buttonLabel = ""; 47904 this.expanded = false;
47905 this.overflows = false; 47906 } 47907 disconnectedCallback() { 47908 this.cancelMeasureOverflow(); 47909 super.disconnectedCallback(); 47910 } 47911 willUpdate(changedProperties) { 47912 if (changedProperties.has("height")) { 47913 this.expanded = false; 47914 this.overflows = false; 47915 } 47916 } 47917 updated() { 47918 this.scheduleMeasureOverflow(); 47919 } 47920 scheduleMeasureOverflow() { 47921 this.cancelMeasureOverflow(); 47922 this.measureOverflowFrame = requestAnimationFrame(() => { 47923 this.measureOverflowFrame = void 0; 47924 this.measureOverflow(); 47925 }); 47926 } 47927 cancelMeasureOverflow() { 47928 if (this.measureOverflowFrame === void 0) return; 47929 cancelAnimationFrame(this.measureOverflowFrame); 47930 this.measureOverflowFrame = void 0; 47931 } 47932 measureOverflow() { 47933 if (!this.isConnected) return; 47934 const el = this.contentElement; 47935 if (!el || this.expanded) { 47936 this.overflows = false; 47937 return; 47938 } 47939 this.overflows = el.scrollHeight > el.clientHeight + 1; 47940 } 47941 expand(event) { 47942 event.preventDefault(); 47943 event.stopPropagation(); 47944 this.expanded = true; 47945 } 47946 render() { 47947 const contentClasses = [ 47948 "content", 47949 this.expanded ? "content--expanded" : "", 47950 !this.expanded && this.overflows ? "content--clipped" : "" 47951 ].filter(Boolean).join(" "); 47952 const label2 = this.buttonLabel || t("LIB_voir_tout"); 47953 return b$1` 47954 <div class=${contentClasses} style=${`max-height: ${this.expanded ? "none" : `${this.height}rem`}`}> 47955 <slot @slotchange=${() => this.scheduleMeasureOverflow()}></slot> 47956 </div> 47957 ${this.overflows && !this.expanded ? b$1`<sonic-button class="mt-2" size=${this.buttonSize} type="neutral" @click=${this.expand}> 47958 <sonic-icon library="custom" name="arrow-down" slot="prefix"></sonic-icon> 47959 ${label2} 47960 </sonic-button>` : A$1} 47961 `; 47962 } 47963 }; 47964 SonicClampedContent.styles = [ 47965 tailwind, 47966 i$9` 47967 :host { 47968 display: block; 47969 } 47970 47971 .content { 47972 overflow: hidden; 47973 } 47974 47975 .content--expanded { 47976 max-height: none !important; 47977 overflow: visible; 47978 } 47979 47980 .content--clipped { 47981 mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 2.5rem), transparent 100%); 47982 -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 2.5rem), transparent 100%); 47983 } 47984 ` 47985 ]; 47986 __decorateClass$1J([ 47987 n$5({ type: Number }) 47988 ], SonicClampedContent.prototype, "height", 2); 47989 __decorateClass$1J([ 47990 n$5({ type: String }) 47991 ], SonicClampedContent.prototype, "buttonSize", 2); 47992 __decorateClass$1J([ 47993 n$5({ type: String }) 47994 ], SonicClampedContent.prototype, "buttonLabel", 2); 47995 __decorateClass$1J([ 47996 r$5() 47997 ], SonicClampedContent.prototype, "expanded", 2); 47998 __decorateClass$1J([ 47999 r$5() 48000 ], SonicClampedContent.prototype, "overflows", 2); 48001 __decorateClass$1J([ 48002 e$7(".content") 48003 ], SonicClampedContent.prototype, "contentElement", 2); 48004 SonicClampedContent = __decorateClass$1J([ 48005 t$3(tagName$1b) 48006 ], SonicClampedContent); 48007 var __defProp$1G = Object.defineProperty; 48008 var __getOwnPropDesc$1I = Object.getOwnPropertyDescriptor; 48009 var __decorateClass$1I = (decorators, target, key, kind) => { 48010 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1I(target, key) : target; 48011 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 48012 if (decorator = decorators[i2]) 48013 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 48014 if (kind && result) __defProp$1G(target, key, result); 48015 return result; 48016 }; 48017 const tagName$1a = "sonic-custom-form-preview"; 48018 let SonicCustomForm = class extends i$6 { 48019 constructor() { 48020 super(...arguments); 48021 this.clampHeight = 12; 48022 this.clampButtonSize = "inherit"; 48023 } 48024 render() { 48025 const fieldset2 = this.renderFieldset(); 48026 return fieldset2; 48027 } 48028 renderFieldset() { 48029 return b$1` 48030 <sonic-fieldset variant=${o$4(this.variant)} class="mb-2"> 48031 ${this.displayLegends && this.customForm?.label ? b$1`<sonic-legend iconLibrary="custom" iconName="circle-info"> 48032 ${this.customForm?.label} <slot name="actions" slot="suffix"></slot 48033 ></sonic-legend>` : A$1} 48034 ${this.collapsible ? b$1` 48035 <sonic-clamped-content 48036 .height=${this.clampHeight} 48037 buttonSize=${this.clampButtonSize} 48038 .buttonLabel=${this.customForm?.label || t("LIB_show_form_values")} 48039 > 48040 ${this.renderValues()} 48041 </sonic-clamped-content> 48042 ` : this.renderValues()} 48043 </sonic-fieldset> 48044 `; 48045 } 48046 renderValues() { 48047 const noValues = Object.keys(this.customFormValues || {}).length === 0 || Object.values(this.customFormValues || {}).every((value) => value === ""); 48048 if (noValues) { 48049 return b$1`<div class="${this.size === "sm" ? "text-xs" : "text-sm"} text-neutral-400"> 48050 ${t("LIB_custom_form_no_values")} 48051 </div>`; 48052 } 48053 return b$1`<div class="grid grid-cols-1 ${this.size === "sm" ? "gap-3" : "gap-4"}"> 48054 ${c$1( 48055 this.customForm?.inputs || [], 48056 (input) => input.id, 48057 (input) => { 48058 if (input.type === InputType.TextSection) { 48059 return A$1; 48060 } 48061 return b$1`<div> 48062 <div class="${this.size === "sm" ? "text-xs" : "text-sm"} mb-[2px] text-neutral-500 font-medium"> 48063 ${input.label} 48064 </div> 48065 <div>${this.renderMatchingPreview(input)}</div> 48066 </div>`; 48067 } 48068 )} 48069 </div>`; 48070 } 48071 renderMatchingPreview(input) { 48072 switch (input.type) { 48073 case InputType.File: 48074 return this.renderFilePreview(input); 48075 default: 48076 return this.renderDefaultPreview(input); 48077 } 48078 } 48079 renderDefaultPreview(input) { 48080 const value = this.getInputValue(input); 48081 const inputType = input.type; 48082 return b$1`<div class="max-w-[85ch] ${this.size === "sm" ? "text-sm" : "text-base"}"> 48083 ${value ? this.renderValue(inputType, value) : b$1`<div class="text-neutral-300">â</div>`} 48084 </div>`; 48085 } 48086 renderValue(inputType, value) { 48087 if (!inputType) { 48088 return value; 48089 } 48090 switch (inputType) { 48091 case InputType.Checkbox: 48092 return value ? t("oui") : t("non"); 48093 case InputType.Checkboxes: 48094 case InputType.Radio: 48095 case InputType.Select: 48096 if (Array.isArray(value)) { 48097 return value.filter((v2) => v2 !== "").map((v2) => v2).join(", "); 48098 } 48099 return value; 48100 case InputType.Date: 48101 return value ? new Date(value).toLocaleDateString("fr-FR") : "â"; 48102 default: 48103 return value; 48104 } 48105 } 48106 getInputValue(input) { 48107 return this.customFormValues?.[input.name] || ""; 48108 } 48109 renderFilePreview(input) { 48110 const value = this.getInputValue(input); 48111 const preview = Array.isArray(value) ? value.map((file) => { 48112 return b$1`<div class="relative"> 48113 <embed class="w-full h-full max-w-48 rounded-md" src=${file.data} type="${file.type}" /> 48114 <sonic-tooltip label="${t("telecharger")}" class="absolute bottom-2 right-2"> 48115 <sonic-button size="xs" shape="circle" href=${file.data} download type="warning"> 48116 <sonic-icon library="custom" name="arrow-down" variant="default"></sonic-icon> 48117 </sonic-button> 48118 </sonic-tooltip> 48119 </div>`; 48120 }) : typeof value === "string" && value !== "" ? b$1`<div class="text-neutral-500 text-sm italic">${value}</div>` : void 0; 48121 return b$1`<div class="flex flex-wrap gap-4"> 48122 <div>${preview ?? b$1`<div class="text-neutral-300">â</div>`}</div> 48123 </div> `; 48124 } 48125 }; 48126 SonicCustomForm.styles = [tailwind, label]; 48127 __decorateClass$1I([ 48128 n$5({ type: Object }) 48129 ], SonicCustomForm.prototype, "customForm", 2); 48130 __decorateClass$1I([ 48131 n$5({ type: Object }) 48132 ], SonicCustomForm.prototype, "customFormValues", 2); 48133 __decorateClass$1I([ 48134 n$5({ type: String }) 48135 ], SonicCustomForm.prototype, "variant", 2); 48136 __decorateClass$1I([ 48137 n$5({ type: Boolean }) 48138 ], SonicCustomForm.prototype, "displayLegends", 2); 48139 __decorateClass$1I([ 48140 n$5({ type: String }) 48141 ], SonicCustomForm.prototype, "size", 2); 48142 __decorateClass$1I([ 48143 n$5({ type: Boolean }) 48144 ], SonicCustomForm.prototype, "collapsible", 2); 48145 __decorateClass$1I([ 48146 n$5({ type: Number }) 48147 ], SonicCustomForm.prototype, "clampHeight", 2); 48148 __decorateClass$1I([ 48149 n$5({ type: String }) 48150 ], SonicCustomForm.prototype, "clampButtonSize", 2); 48151 SonicCustomForm = __decorateClass$1I([ 48152 t$3(tagName$1a) 48153 ], SonicCustomForm); 48154 const renderFormData = (options) => { 48155 const { 48156 reservationRequest, 48157 reservationRequestConfig, 48158 displayLegends, 48159 size = "md", 48160 displayPassCulture = true, 48161 collapsible = false, 48162 displayTitle = true 48163 } = options; 48164 if (!reservationRequest) return A$1; 48165 const { title, publicNotes, passCulture } = reservationRequest; 48166 const renderTitle = !reservationRequestConfig?.force_request_title && displayTitle; 48167 const renderPublicNotes = !!publicNotes; 48168 const renderRequestPassCulture = !!reservationRequestConfig?.display_pass_culture && displayPassCulture; 48169 const customForms = reservationRequestConfig?.customForms ?? []; 48170 const shouldRenderMainFieldset = renderTitle || renderPublicNotes || renderRequestPassCulture; 48171 if (!shouldRenderMainFieldset && customForms.length === 0) return A$1; 48172 return b$1` 48173 ${shouldRenderMainFieldset ? b$1`<sonic-fieldset class="mb-2"> 48174 ${displayLegends ? b$1` 48175 <sonic-legend iconLibrary="custom" iconName="circle-info"> ${t("LIB_informations")} </sonic-legend> 48176 ` : A$1} 48177 <div class="grid grid-cols-1 ${size === "sm" ? "gap-3" : "gap-4"}"> 48178 <div> 48179 ${renderTitle ? b$1` 48180 <div class="${size === "sm" ? "text-xs" : "text-sm"} text-neutral-600 mb-[2px]"> 48181 ${t("LIB_nom_du_projet_du_groupe")} 48182 </div> 48183 ` : A$1} 48184 <div class="${size === "sm" ? "text-sm" : "text-base"} font-bold">${title || "â"}</div> 48185 </div> 48186 48187 ${renderPublicNotes ? b$1` 48188 <div> 48189 <div class="${size === "sm" ? "text-xs" : "text-sm"} text-neutral-600 mb-[2px]"> 48190 ${t("LIB_precisions")} 48191 </div>
48192 <span 48193 class="${size === "sm" ? "text-sm" : "text-base"} 48194 max-w-[70ch] text-pretty whitespace-pre-line block" 48195 >${publicNotes} 48196 </span> 48197 </div> 48198 ` : A$1} 48199 ${renderRequestPassCulture ? b$1` 48200 <div class="flex items-center gap-x-3"> 48201 <div>${svgPassCulture({ color: "currentColor", width: 53, height: 53 })}</div> 48202 <div> 48203 <div class="${size === "sm" ? "text-xs" : "text-sm"} text-neutral-600 mb-[2px]"> 48204 ${t("LIB_prise_en_charge_pass_culture")} 48205 </div> 48206 <span 48207 class="${size === "sm" ? "text-sm" : "text-base"} font-bold ${!passCulture?.enabled ? "text-danger" : ""}" 48208 >${passCulture?.enabled ? t("oui") : t("non")}</span 48209 > 48210 </div> 48211 </div> 48212 ` : A$1} 48213 </div> 48214 </sonic-fieldset>` : A$1} 48215 ${c$1( 48216 customForms, 48217 (customForm) => customForm.id, 48218 (customForm) => b$1`<sonic-custom-form-preview 48219 .size=${size} 48220 ?displayLegends=${displayLegends} 48221 .customForm=${customForm} 48222 .customFormValues=${reservationRequest?.[CUSTOM_FORMS_KEY]} 48223 formDataProvider="formSubscription/${reservationRequest.id}/${customForm.id}" 48224 ?collapsible=${collapsible} 48225 > 48226 </sonic-custom-form-preview>` 48227 )} 48228 `; 48229 }; 48230 var RequestMode = /* @__PURE__ */ ((RequestMode2) => { 48231 RequestMode2["Uninitialized"] = "uninitialized"; 48232 RequestMode2["Create"] = "create"; 48233 RequestMode2["UpdateData"] = "updateData"; 48234 RequestMode2["Selection"] = "selection"; 48235 RequestMode2["Ending"] = "ending"; 48236 RequestMode2["Password"] = "password"; 48237 RequestMode2["Login"] = "login"; 48238 RequestMode2["NotAuthorized"] = "notAuthorized"; 48239 return RequestMode2; 48240 })(RequestMode || {}); 48241 async function findWaitingListCart(element, options) { 48242 const { userId, statuses, sessionIds, multisessionId } = options; 48243 if (sessionIds?.length) { 48244 const carts = await getUserCarts(element, { 48245 cartType: CartType.WaitingLists, 48246 userId, 48247 statuses, 48248 sessionIds, 48249 limit: 1 48250 }); 48251 if (carts[0]) { 48252 return carts[0]; 48253 } 48254 } 48255 if (multisessionId) { 48256 const carts = await getUserCarts(element, { 48257 cartType: CartType.WaitingLists, 48258 userId, 48259 statuses, 48260 multisessionId, 48261 limit: 1 48262 }); 48263 if (carts[0]) { 48264 return carts[0]; 48265 } 48266 } 48267 const incompleteCarts = await getUserCarts(element, { 48268 cartType: CartType.WaitingLists, 48269 userId, 48270 statuses: [ReservationStatus.Incomplete], 48271 limit: 50 48272 }); 48273 return incompleteCarts.find((list) => !list.items?.length) ?? null; 48274 } 48275 const getCartMatchingItems = async (options) => { 48276 const { element, userId, statuses, entityIds, multisessionId } = options; 48277 if (!userId) return null; 48278 const cart = await findWaitingListCart(element, { 48279 userId, 48280 statuses, 48281 sessionIds: entityIds, 48282 multisessionId 48283 }); 48284 return cart?.id ?? null; 48285 }; 48286 var __defProp$1F = Object.defineProperty; 48287 var __getOwnPropDesc$1H = Object.getOwnPropertyDescriptor; 48288 var __decorateClass$1H = (decorators, target, key, kind) => { 48289 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1H(target, key) : target; 48290 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 48291 if (decorator = decorators[i2]) 48292 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 48293 if (kind && result) __defProp$1F(target, key, result); 48294 return result; 48295 }; 48296 const tagName$19 = "sonic-waiting-list-form"; 48297 let SonicWaitingListForm = class extends Subscriber$1(i$6) { 48298 constructor() { 48299 super(...arguments); 48300 this._initGeneration = 0; 48301 this.accessParams = { isWaitingList: true }; 48302 this._cartProvider = ""; 48303 this._mode = RequestMode.Uninitialized; 48304 this.isLoading = false;
48305 this.handleSelect = async (e2) => { 48306 const isRemoved = this._selectedUserId && e2.detail.uid === 0; 48307 if (isRemoved && this._cartProvider) { 48308 const api2 = new API(getDefaultApiConfiguration()); 48309 await Cart.delete(api2, this._cartProvider); 48310 } 48311 this._selectedUserId = e2.detail.uid; 48312 }; 48313 this.handleDelete = async (e2) => { 48314 const target = e2.currentTarget; 48315 const parentModal = HTML.getClosestElement(target, "sonic-modal"); 48316 if (this._cartProvider) { 48317 const api2 = new API(getDefaultApiConfiguration()); 48318 await Cart.delete(api2, this._cartProvider); 48319 } 48320 parentModal?.hide(); 48321 }; 48322 } 48323 // guichet uniquement 48324 get buyerUserId() { 48325 return this.appType === "counter" ? this._selectedUserId : this.loggedUserId ?? void 0; 48326 } 48327 get cartStatus() { 48328 return this._cartData?.status; 48329 } 48330 get cartItems() { 48331 return this._cartData?.items; 48332 } 48333 get cartType() { 48334 return this._cartData?.cartType; 48335 } 48336 get hasItemsInCart() { 48337 return (this.cartItems?.length ?? 0) > 0; 48338 } 48339 get dataProviderExpression() { 48340 const hasSessionIds = this.sessionIds?.length; 48341 return entityEndPoint({ 48342 entityType: EntityType.Event, 48343 isQueue: true, 48344 next: true, 48345 accessParams: this.accessParams, 48346 view: entityView.essential, 48347 customSearchParams: new URLSearchParams({ 48348 ...hasSessionIds ? { ids: this.sessionIds?.join(",") ?? "" } : {} 48349 }) 48350 }); 48351 } 48352 async willUpdate(changed_properties) { 48353 const buyerChanged = changed_properties.has("loggedUserId") || changed_properties.has("_selectedUserId") || changed_properties.has("appType"); 48354 const needsCartInit = buyerChanged || !this._cartProvider && (this.buyerUserId !== void 0 || this.requestId !== void 0); 48355 if (needsCartInit) { 48356 const generation = ++this._initGeneration; 48357 await this.initData(this.requestId, generation); 48358 } 48359 if (changed_properties.has("_cartData") || changed_properties.has("_cartProvider")) { 48360 this.syncSessionIdsFromCart(); 48361 } 48362 if (buyerChanged || changed_properties.has("_cartData") || changed_properties.has("_cartProvider") || changed_properties.has("appType")) { 48363 this.setMode(); 48364 } 48365 super.willUpdate(changed_properties); 48366 } 48367 syncSessionIdsFromCart() { 48368 if (!this.cartItems?.length) return; 48369 const sessionIds = this.cartItems.filter((item) => item.entity_type === EntityType.Event).map((item) => Number(item.entity_id)); 48370 if (sessionIds.length) { 48371 const arrayIds = [...this.sessionIds ?? [], ...sessionIds]; 48372 this.sessionIds = [...new Set(arrayIds)]; 48373 } 48374 } 48375 /** Détermine le mode d'affichage (login, sélection, confirmation) selon l'utilisateur et le statut du panier. */ 48376 setMode() { 48377 const suggestLogin = !this.buyerUserId; 48378 const displaySelection = !suggestLogin && this._cartProvider; 48379 const displayEnding = [ 48380 ReservationStatus.Submitted, 48381 ReservationStatus.Confirmed, 48382 ReservationStatus.PartiallyProcessed, 48383 ReservationStatus.Processed 48384 ].includes(this.cartStatus ?? ReservationStatus.Draft); 48385 if (displayEnding && this.appType === "counter") { 48386 closeParentModal(this); 48387 return; 48388 } 48389 if (!this.appType || this.isLoading) { 48390 this._mode = RequestMode.Uninitialized; 48391 } else if (displayEnding) { 48392 this._mode = RequestMode.Ending; 48393 } else if (suggestLogin) { 48394 this._mode = RequestMode.Login; 48395 } else if (displaySelection) { 48396 this._mode = RequestMode.Selection; 48397 } else { 48398 this._mode = RequestMode.Uninitialized; 48399 } 48400 } 48401 /** Charge une liste d'attente existante ou en crée une, puis met à jour le cart provider. */ 48402 async initData(forcedCartId, generation) { 48403 this.isLoading = true; 48404 let listId = forcedCartId ?? void 0; 48405 if (!listId && this.appType === "customer") { 48406 listId = await getCartMatchingItems({ 48407 element: this, 48408 cartType: CartType.WaitingLists, 48409 userId: this.buyerUserId, 48410 entityType: EntityType.Event, 48411 entityIds: this.sessionIds, 48412 statuses: [ReservationStatus.Incomplete] 48413 }); 48414 } 48415 if (!listId) { 48416 listId = await this.newWaitingList(cartProviderKey(CartType.WaitingLists), this.buyerUserId); 48417 } 48418 if (generation !== void 0 && generation !== this._initGeneration) return; 48419 this._cartProvider = cartProviderKey(CartType.WaitingLists, Number(listId)); 48420 const api2 = new API(getDefaultApiConfiguration()); 48421 await Cart.updateCart(api2, this._cartProvider); 48422 this.isLoading = false;
48423 } 48424 /** Au guichet, pré-sélectionne l'utilisateur depuis le panier lié (buyer ou email d'abonnement). */ 48425 // TODO: réactiver quand l'acheteur sera éditable/visible au guichet. 48426 // async initUserFromLinkedCart() { 48427 // if (!this.linkedCartProvider) return; 48428 // 48429 // const api = new API(getDefaultApiConfiguration()); 48430 // const result = await api.get<APIResult>(this.linkedCartProvider); 48431 // if (!result?.success || !result.data) return; 48432 // 48433 // const cart = result.data as CartAPI; 48434 // const userId = await resolveCounterBuyerUid(toCounterCartBuyerSource(cart), getDefaultApiConfiguration()); 48435 // if (userId) { 48436 // this._selectedUserId = userId; 48437 // } 48438 // } 48439 /** Crée une nouvelle liste d'attente et retourne son identifiant. */ 48440 async newWaitingList(providerKey, buyerUserId) { 48441 const result = await Cart.newCart({ 48442 apiConfiguration: getDefaultApiConfiguration(), 48443 cartProvider: providerKey, 48444 ...buyerUserId ? { buyer: { uid: buyerUserId } } : {} 48445 }); 48446 return result?.data?.id ?? null; 48447 } 48448 render() { 48449 if (!this.sessionIds && !this._cartProvider) return A$1; 48450 const displayUserToggle = this.appType === "counter" && [RequestMode.Selection, RequestMode.Login].includes(this._mode); 48451 return b$1` 48452 <sonic-page-header .label=${t("waiting_list")}> 48453 ${this.renderCancelButton()} 48454 ${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} 48455 </sonic-page-header> 48456 <div class="min-w-0"> 48457 ${displayUserToggle ? b$1` 48458 <sonic-user-toggle 48459 .selectedId=${this._selectedUserId} 48460 @select=${this.handleSelect} 48461 class="block mb-6" 48462 canCreateAccount 48463 ></sonic-user-toggle> 48464 ` : A$1} 48465 ${r(this._mode, [ 48466 [RequestMode.Uninitialized, () => this.renderLoader()], 48467 [RequestMode.Login, () => this.renderLogin()], 48468 [RequestMode.Selection, () => this.renderSelection()], 48469 [RequestMode.Ending, () => renderEndingMessage(CartType.WaitingLists, this.appType)] 48470 ])} 48471 </div> 48472 `; 48473 } 48474 renderCancelButton() { 48475 if (this._mode === RequestMode.Ending) return A$1; 48476 if (this._mode === RequestMode.Selection && this.hasItemsInCart) { 48477 return b$1` 48478 <sonic-button @click=${(e2) => this.handleDelete(e2)} slot="actions" type="danger"> 48479 <sonic-icon name="trash" library="custom"></sonic-icon> ${t("supprimer")} 48480 </sonic-button> 48481 `; 48482 } 48483 return b$1`<sonic-button @click=${(e2) => this.handleDelete(e2)} slot="actions" shape="circle" icon size="lg"> 48484 <sonic-icon name="xmark" library="custom"></sonic-icon> 48485 </sonic-button>`; 48486 } 48487 renderHelp() { 48488 if (this.appType === "counter") { 48489 return A$1; 48490 } 48491 return b$1`<div class="text-lg mb-6 text-pretty prose -mt-3">${t("LIB_waiting_list_help", true)}</div>`; 48492 } 48493 renderLoader() { 48494 return b$1`<sonic-loader mode="inline" align="left"></sonic-loader>`; 48495 } 48496 renderSelection() { 48497 return i( 48498 this._cartProvider, 48499 this.hasItemsInCart ? b$1`<sonic-fieldset> 48500 <sonic-cart-full 48501 cartProvider="${this._cartProvider}" 48502 dataProvider="${this._cartProvider}" 48503 subdataprovider="data" 48504 class="block" 48505 ></sonic-cart-full 48506 ></sonic-fieldset>` : b$1`${this.renderHelp()} 48507 <div class="@container block" cartProvider="${this._cartProvider}">${this.renderEventCatalog()}</div>` 48508 ); 48509 } 48510 renderEventCatalog() { 48511 const hasOnlyOneSessionId = this.sessionIds && this.sessionIds.length === 1; 48512 return b$1` 48513 <sonic-queue 48514 dataProviderExpression="${this.dataProviderExpression}" 48515 key="data" 48516 class="block w-full" 48517 limit="8" 48518 targetRequestDuration="1000" 48519 .items=${() => b$1`<sonic-event-store-item 48520 showAllSessionsButton 48521 formType="select" 48522 class="mb-4 block" 48523 noActionMenu 48524 noAllSessionsButton 48525 ?alwaysExpanded=${hasOnlyOneSessionId} 48526 ></sonic-event-store-item>`} 48527 .skeleton=${() => b$1`<sonic-event-store-item skeleton></sonic-event-store-item>`} 48528 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 48529 ></sonic-queue> 48530 `; 48531 } 48532 renderLogin() { 48533 if (this.appType === "counter") { 48534 return A$1; 48535 } 48536 return b$1`${this.renderHelp()} <sonic-user-form-login createAccount></sonic-user-form-login> `; 48537 } 48538 }; 48539 SonicWaitingListForm.styles = [ 48540 tailwind, 48541 i$9` 48542 :host { 48543 display: block; 48544 min-height: 35rem; 48545 } 48546 ` 48547 ]; 48548 __decorateClass$1H([ 48549 bind$1("user.id"), 48550 n$5({ type: Number }) 48551 ], SonicWaitingListForm.prototype, "loggedUserId", 2); 48552 __decorateClass$1H([ 48553 r$5() 48554 ], SonicWaitingListForm.prototype, "_selectedUserId", 2); 48555 __decorateClass$1H([ 48556 n$5({ type: Number }) 48557 ], SonicWaitingListForm.prototype, "requestId", 2); 48558 __decorateClass$1H([ 48559 n$5({ type: Array }) 48560 ], SonicWaitingListForm.prototype, "sessionIds", 2); 48561 __decorateClass$1H([ 48562 e$2({ context: accessParamsContext }), 48563 n$5({ type: Object }) 48564 ], SonicWaitingListForm.prototype, "accessParams", 2); 48565 __decorateClass$1H([ 48566 c({ context: appType, subscribe: true }), 48567 r$5() 48568 ], SonicWaitingListForm.prototype, "appType", 2); 48569 __decorateClass$1H([ 48570 n$5({ type: String }) 48571 ], SonicWaitingListForm.prototype, "linkedCartProvider", 2); 48572 __decorateClass$1H([ 48573 r$5()
48574 ], SonicWaitingListForm.prototype, "_cartProvider", 2); 48575 __decorateClass$1H([ 48576 bind$1("${_cartProvider}.data"), 48577 r$5() 48578 ], SonicWaitingListForm.prototype, "_cartData", 2); 48579 __decorateClass$1H([ 48580 r$5() 48581 ], SonicWaitingListForm.prototype, "_mode", 2); 48582 __decorateClass$1H([ 48583 r$5() 48584 ], SonicWaitingListForm.prototype, "isLoading", 2); 48585 SonicWaitingListForm = __decorateClass$1H([ 48586 t$3(tagName$19) 48587 ], SonicWaitingListForm); 48588 var __defProp$1E = Object.defineProperty; 48589 var __getOwnPropDesc$1G = Object.getOwnPropertyDescriptor; 48590 var __decorateClass$1G = (decorators, target, key, kind) => { 48591 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1G(target, key) : target; 48592 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 48593 if (decorator = decorators[i2]) 48594 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 48595 if (kind && result) __defProp$1E(target, key, result); 48596 return result; 48597 }; 48598 const tagName$18 = "sonic-waiting-list-button"; 48599 let SonicWaitingListButton = class extends Subscriber$1(i$6) { 48600 constructor() { 48601 super(...arguments); 48602 this.id = ""; 48603 this.handleClick = () => { 48604 Modal.create({ 48605 forceAction: true, 48606 content: b$1`<sonic-waiting-list-form 48607 .sessionIds=${[Number(this.id)]} 48608 .linkedCartProvider=${this.cartProvider} 48609 ></sonic-waiting-list-form>`, 48610 maxWidth: "60rem" 48611 }); 48612 }; 48613 this._hasIncompleteWaitingList = false; 48614 } 48615 get isEnabled() { 48616 return !!this.props?.settings?.waiting_list?.enabled; 48617 } 48618 async willUpdate(_changedProperties) { 48619 if (_changedProperties.has("userId") || _changedProperties.has("props")) { 48620 if (this.isEnabled && this.userId) { 48621 const matchingCart = await getCartMatchingItems({ 48622 element: this, 48623 cartType: CartType.WaitingLists, 48624 userId: this.userId, 48625 entityType: EntityType.Event, 48626 entityIds: [Number(this.id)], 48627 statuses: [ReservationStatus.Incomplete] 48628 }); 48629 this._hasIncompleteWaitingList = !!matchingCart; 48630 } else { 48631 this._hasIncompleteWaitingList = false; 48632 } 48633 } 48634 } 48635 render() { 48636 if (!this.id || !this.isEnabled) return A$1; 48637 return b$1`<div class="inline-flex relative"> 48638 ${this._hasIncompleteWaitingList ? b$1`<sonic-badge 48639 type="danger" 48640 size="2xs" 48641 class="absolute -top-1 -left-1 z-[2] pointer-events-none animate-heartbeat" 48642 >!</sonic-badge 48643 >` : A$1} 48644 <sonic-button 48645 type="primary" 48646 variant=${o$4(this.variant)} 48647 size=${o$4(this.size)} 48648 to="waitingList" 48649 class="relative" 48650 @click=${this.handleClick} 48651 noAutofill 48652 > 48653 <sonic-icon library="custom" name="list-ol" slot="prefix"></sonic-icon> 48654 <span class="font-bold">${t("waiting_list")}</span> 48655 </sonic-button> 48656 </div>`; 48657 } 48658 }; 48659 SonicWaitingListButton.styles = [tailwind]; 48660 __decorateClass$1G([ 48661 bind$1("settings.modules.waiting_list.enabled"), 48662 n$5({ type: Boolean }) 48663 ], SonicWaitingListButton.prototype, "hasWaitingList", 2); 48664 __decorateClass$1G([ 48665 n$5({ type: Number }) 48666 ], SonicWaitingListButton.prototype, "id", 2); 48667 __decorateClass$1G([ 48668 n$5({ type: String }) 48669 ], SonicWaitingListButton.prototype, "size", 2); 48670 __decorateClass$1G([ 48671 n$5({ type: String }) 48672 ], SonicWaitingListButton.prototype, "variant", 2); 48673 __decorateClass$1G([ 48674 ancestorAttribute("cartProvider"), 48675 r$5() 48676 ], SonicWaitingListButton.prototype, "cartProvider", 2); 48677 __decorateClass$1G([ 48678 bind$1("user.id"), 48679 r$5() 48680 ], SonicWaitingListButton.prototype, "userId", 2); 48681 __decorateClass$1G([ 48682 r$5() 48683 ], SonicWaitingListButton.prototype, "_hasIncompleteWaitingList", 2); 48684 SonicWaitingListButton = __decorateClass$1G([ 48685 t$3(tagName$18) 48686 ], SonicWaitingListButton); 48687 var __defProp$1D = Object.defineProperty; 48688 var __getOwnPropDesc$1F = Object.getOwnPropertyDescriptor; 48689 var __decorateClass$1F = (decorators, target, key, kind) => { 48690 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1F(target, key) : target; 48691 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 48692 if (decorator = decorators[i2]) 48693 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 48694 if (kind && result) __defProp$1D(target, key, result); 48695 return result; 48696 };
48697 let CategorizedPrices = class extends EventContext(Subscriber$1(i$6)) { 48698 constructor() { 48699 super(...arguments); 48700 this.buyMode = BuyMode.DEFAULT; 48701 this.categoryId = 0; 48702 this.infos_status = {}; 48703 this.disabled = false; 48704 this.type = null; 48705 this.formType = "select"; 48706 this.size = "lg"; 48707 this.buttonType = ""; 48708 this.room = {}; 48709 this.stock = {}; 48710 this.loading = false; 48711 this.wording_LIB_add_to_cart = ""; 48712 this.someItemSelected = false; 48713 this.formItemsDataProvider = ""; 48714 this._pricesFilterSubscribedPath = null; 48715 this.onPricesFilterMutation = () => { 48716 this.requestUpdate(); 48717 }; 48718 this.updateSubmitBtnStatus = () => { 48719 const itemQuantities = Object.values(PublisherManager.get(this.formItemsDataProvider).get()); 48720 this.someItemSelected = itemQuantities.some((quantity) => quantity); 48721 }; 48722 this.places_categories = []; 48723 this._hasPricesDisplayed = false; 48724 } 48725 get props() { 48726 return super.props; 48727 } 48728 set props(value) { 48729 super.props = value; 48730 this.addDefaultPrices(); 48731 this.requestUpdate(); 48732 } 48733 /** Publisher du filtre tarifs pour le path couramment souscrit (évite de répéter `PublisherManager.get`). */ 48734 get subscribedPricesFilterPublisher() { 48735 const path = this._pricesFilterSubscribedPath; 48736 return path ? PublisherManager.get(path) : void 0; 48737 } 48738 syncPricesFilterSubscription() { 48739 const id = this.props?.id; 48740 if (!id) { 48741 this.subscribedPricesFilterPublisher?.offInternalMutation(this.onPricesFilterMutation); 48742 this._pricesFilterSubscribedPath = null; 48743 return; 48744 } 48745 const path = "product/" + id + "/PricesFilter"; 48746 if (this._pricesFilterSubscribedPath === path) return; 48747 this.subscribedPricesFilterPublisher?.offInternalMutation(this.onPricesFilterMutation); 48748 this._pricesFilterSubscribedPath = path; 48749 this.subscribedPricesFilterPublisher?.onInternalMutation(this.onPricesFilterMutation); 48750 } 48751 recomputeHasPricesDisplayed() { 48752 if (!this.props?.id) { 48753 this._hasPricesDisplayed = false; 48754 return; 48755 } 48756 const filter = PublisherManager.get("product/" + this.props.id + "/PricesFilter").get(); 48757 const placeCategories = this.categoryId ? this.places_categories.filter((c2) => c2.id == this.categoryId) : this.places_categories; 48758 this._hasPricesDisplayed = placeCategories.some((c2) => computeFilteredPrices(c2.items, filter).length > 0); 48759 } 48760 connectedCallback() { 48761 super.connectedCallback(); 48762 this._initialSelectedQuota = structuredClone(this.selectedQuota); 48763 this.formItemsDataProvider = this.dataProvider + "/price-form-items"; 48764 PublisherManager.get(this.formItemsDataProvider).onInternalMutation(this.updateSubmitBtnStatus); 48765 } 48766 disconnectedCallback() { 48767 super.disconnectedCallback(); 48768 PublisherManager.get(this.formItemsDataProvider).offInternalMutation(this.updateSubmitBtnStatus); 48769 this.subscribedPricesFilterPublisher?.offInternalMutation(this.onPricesFilterMutation); 48770 this._pricesFilterSubscribedPath = null; 48771 } 48772 willUpdate(properties) { 48773 if (properties.has("places_categories")) { 48774 this.addDefaultPrices(); 48775 } 48776 if (properties.has("selectedQuota")) { 48777 this.resetSelection(); 48778 } 48779 this.syncPricesFilterSubscription(); 48780 this.recomputeHasPricesDisplayed(); 48781 super.willUpdate(properties); 48782 } 48783 addDefaultPrices() { 48784 this.places_categories.forEach((category) => this.injectPrices(category)); 48785 if (this.places_categories.length == 0 && this.props && this.props.prices) 48786 this.places_categories.push({ items: this.props.prices || [] }); 48787 } 48788 injectPrices(category) { 48789 category.items = this.props?.prices?.filter( 48790 (price) => !price.place_category?.id || price.place_category.id == category.id 48791 ); 48792 } 48793 async addToCart() { 48794 this.loading = true; 48795 const entity_id = this.props?.id ? parseInt(this.props.id.toString()) : 0; 48796 const filter = PublisherManager.getInstance().get("product/" + entity_id + "/PricesFilter").get(); 48797 let currentQuota = filter.selectedQuota; 48798 if (!currentQuota && filter.quotas) { 48799 currentQuota = filter.quotas[0]; 48800 } 48801 const cartItems = []; 48802 let quota; 48803 if (currentQuota) { 48804 quota = { 48805 id: parseInt(currentQuota.id) 48806 }; 48807 } 48808 const itemSelects = Object.entries(PublisherManager.get(this.formItemsDataProvider).get()); 48809 for (const [price_id, price_quantity] of itemSelects) { 48810 if (price_quantity > 0) { 48811 const cartItem = { 48812 entity_type: this.type || void 0, 48813 entity_id, 48814 quantity: Number(price_quantity), 48815 price: { id: Number(price_id) }, 48816 quota 48817 }; 48818 cartItems.push(cartItem); 48819 } 48820 } 48821 const cartProvider = this.cartProvider; 48822 await Cart.addItems({ 48823 apiConfiguration: this.getApiConfiguration(), 48824 cartProvider, 48825 items: cartItems, 48826 attachOwnersAfterRequest: true, 48827 editFreePriceAfterRequest: true,
48828 auto_seating: isAutoseatingMode(this.buyMode), 48829 accessParams: this.accessParams ?? void 0 48830 }); 48831 this.resetSelection(); 48832 this.loading = false; 48833 } 48834 resetSelection() { 48835 const formPublisher = PublisherManager.get(this.formItemsDataProvider); 48836 const formData = PublisherManager.get(this.formItemsDataProvider).get(); 48837 Object.keys(formData).forEach((key) => { 48838 if (formData[key] > 0) { 48839 formPublisher[key].set(""); 48840 } 48841 }); 48842 } 48843 noPriceMessage(placeCategories) { 48844 const noItems = this.places_categories.length > 0 && this.places_categories.every((c2) => c2.items?.length == 0) || placeCategories.every((c2) => c2.items?.length == 0); 48845 if (!noItems) return A$1; 48846 if (!isSeatMode(this.buyMode)) return A$1; 48847 return b$1`<div class="text-neutral-500 text-center"> 48848 <sonic-icon name="circle-info" library="custom"></sonic-icon> ${t("no_price_available")} 48849 </div>`; 48850 } 48851 render() { 48852 if (!this.props) return A$1; 48853 const hasSeatmap = this.room && ["place", "mixte"].includes(this.room.placing_type_key || ""); 48854 const accessType = getAccessType(this.accessParams); 48855 const isWaitingListContext = accessType === AccessType.WAITING_LIST; 48856 const isCampaignContext = accessType === AccessType.CAMPAIGN; 48857 const isReservationRequestContext = accessType === AccessType.RESERVATION_REQUEST; 48858 if (!showsInlineRates(this.buyMode, !!hasSeatmap) && !isWaitingListContext) return A$1; 48859 const placeCategories = this.categoryId ? this.places_categories.filter((c2) => c2.id == this.categoryId) : this.places_categories; 48860 const hasAvailablePrices = placeCategories.some((c2) => c2.items?.some((p2) => p2.price_available)); 48861 const renderAsText = !this.isGuichet && !hasAvailablePrices; 48862 const item_id = this.props.id; 48863 const salesEnded = this.infos_status?.additionnals?.some((s2) => s2.key == "end_sale"); 48864 return b$1`<div> 48865 ${this.noPriceMessage(placeCategories)} 48866 ${c$1( 48867 placeCategories, 48868 (category) => category.id, 48869 (category) => { 48870 if (category.items?.length == 0) return A$1; 48871 if (renderAsText) return A$1; 48872 const initial = this.getInitial(category) || 0; 48873 const remaining = this.getRemainingPlacesNb(category); 48874 const specialContext = isCampaignContext || isReservationRequestContext || isWaitingListContext; 48875 const displaySoldOut = !this.isGuichet && remaining === 0 && !specialContext; 48876 const displayRemaining = this.isGuichet && !(isSeatMode(this.buyMode) && this._initialSelectedQuota?.id !== this.selectedQuota?.id); 48877 return b$1` 48878 <div class="sonic-categorized-prices-form"> 48879 ${category.title ? b$1` 48880 <div class="mt-4 mb-3 font-bold"> 48881 ${category.title ? category.title : A$1} 48882 ${displaySoldOut ? b$1`<sonic-badge type="danger" size="xs">${t("sold_out")}</sonic-badge>` : A$1} 48883 48884 <sonic-if .condition=${displayRemaining}> 48885 <sonic-badge type="${remaining == 0 ? "danger" : "default"}" size="sm" class="ml-2 inline-block" 48886 >Reste : ${remaining} / ${initial} 48887 </sonic-badge> 48888 </sonic-if> 48889 </div> 48890 ` : A$1} 48891 ${this.isGuichet || hasAvailablePrices ? b$1`<sonic-prices-form 48892 formDataProvider=${this.formItemsDataProvider} 48893 dataProvider=${`${this.dataProvider}/category-prices/${category.id ? category.id : "default"}`} 48894 .props=${{ 48895 quota: this.selectedQuota, 48896 prices: category.items, 48897 item_id, 48898 loading: this.loading 48899 }} 48900 formType="${this.formType}" 48901 buttonType="${this.buttonType}" 48902 size="${this.size}" 48903 type=${this.type} 48904 ></sonic-prices-form> 48905 <sonic-price-in-situ .category=${category} class="text-sm"></sonic-price-in-situ>` : A$1} 48906 </div> 48907 `; 48908 } 48909 )} 48910 48911 <!-- 48912 Ne rend en texte que si tous les tarifs sont complets 48913 --> 48914 ${!this.isGuichet && !hasAvailablePrices && isDefaultMode(this.buyMode) ? b$1`<sonic-price-list-info 48915 size="${this.size}" 48916 .prices=${this.props.prices || []} 48917 ?displaySoldOut=${!salesEnded} 48918 .selectedQuota=${this.selectedQuota} 48919 class="block mb-3" 48920 ></sonic-price-list-info>` : A$1} 48921 48922 <!--Achat--> 48923 ${this.getExtraFormItems()} 48924 48925 <sonic-subscription-requirement-warning 48926 .prices=${this.props.prices || []} 48927 .selectedQuota=${this.selectedQuota} 48928 ></sonic-subscription-requirement-warning> 48929 </div>`; 48930 } 48931 getExtraFormItems() { 48932 const isDisabled = this.loading || this.disabled || !this.someItemSelected; 48933 const noQuotaPlaces = this.selectedQuota && this.selectedQuota.remaining_places_nb === 0; 48934 let displaySubmitButton = false;
48935 if (this.isGuichet) { 48936 displaySubmitButton = this.formType === "select" && this._hasPricesDisplayed; 48937 } else { 48938 displaySubmitButton = this.formType === "select" && this._hasPricesDisplayed && !noQuotaPlaces; 48939 } 48940 const cartType = dp$1(this.cartProvider ?? "cart/current").data.cartType.get(); 48941 let text = t("LIB_add_to_cart"); 48942 if (cartType === CartType.WaitingLists || cartType === CartType.ReservationRequest || this.accessParams?.isWaitingList) { 48943 text = t("LIB_add_to_request"); 48944 } else if (cartType === CartType.Reservation) { 48945 text = t("LIB_add_to_reservation"); 48946 } 48947 return b$1`${displaySubmitButton ? b$1`<sonic-button 48948 data-aria-label=${text} 48949 @click=${this.addToCart} 48950 minWidth="16rem" 48951 type="primary" 48952 size=${this.size} 48953 ?disabled=${isDisabled} 48954 > 48955 <sonic-icon name="basket-shopping" library="custom" slot="prefix"></sonic-icon> 48956 <span class="font-bold uppercase">${text}</span> 48957 </sonic-button>` : A$1}`; 48958 } 48959 getRemainingPlacesNb(category) { 48960 const matchingStockDetail = this.getStockDetail(category); 48961 if (!matchingStockDetail) return 0; 48962 if (typeof matchingStockDetail.available === "number") { 48963 return matchingStockDetail.available; 48964 } 48965 return matchingStockDetail.has_available ? null : 0; 48966 } 48967 getInitial(category) { 48968 const matchingStockDetail = this.getStockDetail(category); 48969 return matchingStockDetail?.initial || 0; 48970 } 48971 getStockDetail(category) { 48972 return this.stock?.details?.find((d2) => { 48973 const matchingQuotaAndCategory = d2.places_category_id === category.id && d2.quota_id === this.selectedQuota?.id; 48974 if (matchingQuotaAndCategory) { 48975 return true; 48976 } 48977 const matchingGlobalQuota = d2.quota_id === this.selectedQuota?.id && !d2?.places_category_id; 48978 if (matchingGlobalQuota) { 48979 return true; 48980 } 48981 return false; 48982 }); 48983 } 48984 }; 48985 CategorizedPrices.styles = [tailwind, styles$1]; 48986 __decorateClass$1F([ 48987 n$5() 48988 ], CategorizedPrices.prototype, "props", 1); 48989 __decorateClass$1F([ 48990 c({ context: buyModeContext, subscribe: true }), 48991 n$5({ type: String }) 48992 ], CategorizedPrices.prototype, "buyMode", 2); 48993 __decorateClass$1F([ 48994 n$5({ type: Number }) 48995 ], CategorizedPrices.prototype, "categoryId", 2); 48996 __decorateClass$1F([ 48997 n$5({ type: Object }) 48998 ], CategorizedPrices.prototype, "infos_status", 2); 48999 __decorateClass$1F([ 49000 n$5({ type: Boolean }) 49001 ], CategorizedPrices.prototype, "disabled", 2); 49002 __decorateClass$1F([ 49003 bind$1("user.is_pro"), 49004 n$5({ type: Boolean }) 49005 ], CategorizedPrices.prototype, "userIsPro", 2); 49006 __decorateClass$1F([ 49007 n$5() 49008 ], CategorizedPrices.prototype, "type", 2); 49009 __decorateClass$1F([ 49010 n$5() 49011 ], CategorizedPrices.prototype, "formType", 2); 49012 __decorateClass$1F([ 49013 n$5({ type: String }) 49014 ], CategorizedPrices.prototype, "size", 2); 49015 __decorateClass$1F([ 49016 n$5() 49017 ], CategorizedPrices.prototype, "buttonType", 2); 49018 __decorateClass$1F([ 49019 n$5() 49020 ], CategorizedPrices.prototype, "room", 2); 49021 __decorateClass$1F([ 49022 n$5() 49023 ], CategorizedPrices.prototype, "stock", 2); 49024 __decorateClass$1F([ 49025 n$5() 49026 ], CategorizedPrices.prototype, "selectedQuota", 2); 49027 __decorateClass$1F([ 49028 n$5() 49029 ], CategorizedPrices.prototype, "loading", 2); 49030 __decorateClass$1F([ 49031 n$5({ type: String }) 49032 ], CategorizedPrices.prototype, "eventSlug", 2); 49033 __decorateClass$1F([ 49034 n$5({ type: String }) 49035 ], CategorizedPrices.prototype, "wording_LIB_add_to_cart", 2); 49036 __decorateClass$1F([ 49037 n$5({ type: Boolean }) 49038 ], CategorizedPrices.prototype, "someItemSelected", 2); 49039 __decorateClass$1F([ 49040 c({ context: accessParamsContext, subscribe: true }), 49041 n$5({ type: Object }) 49042 ], CategorizedPrices.prototype, "accessParams", 2); 49043 __decorateClass$1F([ 49044 ancestorAttribute("cartProvider"), 49045 n$5({ type: String }) 49046 ], CategorizedPrices.prototype, "cartProvider", 2); 49047 __decorateClass$1F([ 49048 n$5({ type: Array }) 49049 ], CategorizedPrices.prototype, "places_categories", 2); 49050 CategorizedPrices = __decorateClass$1F([ 49051 t$3("sonic-categorized-prices") 49052 ], CategorizedPrices); 49053 var __defProp$1C = Object.defineProperty; 49054 var __getOwnPropDesc$1E = Object.getOwnPropertyDescriptor; 49055 var __decorateClass$1E = (decorators, target, key, kind) => { 49056 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1E(target, key) : target; 49057 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49058 if (decorator = decorators[i2]) 49059 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49060 if (kind && result) __defProp$1C(target, key, result); 49061 return result; 49062 }; 49063 const tagName$17 = "sonic-store-status"; 49064 let SonicClosedStoreMessage = class extends Subscriber$1(i$6) { 49065 constructor() { 49066 super(...arguments); 49067 this.templateClosed = null; 49068 this.templateOpen = null; 49069 this.is_online = null; 49070 this.maintenance = false;
49071 this.status = "error"; 49072 this.isGuichet = false; 49073 } 49074 connectedCallback() { 49075 if (!this.dataProvider) { 49076 this.dataProvider = "settings"; 49077 } 49078 this.accessParams = getAccessParamsFromUrl(); 49079 this.isGuichet = this.hasAncestorAttribute("is_guichet"); 49080 this.templateClosed = this.querySelector("template[data-value='closed']"); 49081 this.templateOpen = this.querySelector("template[data-value='open']"); 49082 super.connectedCallback(); 49083 } 49084 render() { 49085 const message = this.maintenance ? t("LIB_maintenance_message", true) : t("message_billetterie_en_ligne_fermee", true); 49086 const isClosed = this.is_online === false; 49087 if (isClosed && !hasAccessParams(this.accessParams) || this.maintenance) { 49088 if (this.templateClosed) { 49089 return b$1`<div>${o$2(this.templateClosed)}</div>`; 49090 } else if (!this.isGuichet) { 49091 return b$1`<sonic-alert status=${this.status} size=${o$4(this.size)} class="py-[2em]" 49092 ><div class="sonic-prose sonic-prose-condensed">${message}</div> 49093 </sonic-alert>`; 49094 } 49095 } 49096 if (this.is_online === true && this.templateOpen) { 49097 return b$1`<div>${o$2(this.templateOpen)}</div>`; 49098 } 49099 return A$1; 49100 } 49101 }; 49102 SonicClosedStoreMessage.styles = [tailwind, sonicProse]; 49103 __decorateClass$1E([ 49104 n$5() 49105 ], SonicClosedStoreMessage.prototype, "templateClosed", 2); 49106 __decorateClass$1E([ 49107 n$5() 49108 ], SonicClosedStoreMessage.prototype, "templateOpen", 2); 49109 __decorateClass$1E([ 49110 n$5({ type: Boolean }) 49111 ], SonicClosedStoreMessage.prototype, "is_online", 2); 49112 __decorateClass$1E([ 49113 n$5({ type: Boolean }) 49114 ], SonicClosedStoreMessage.prototype, "maintenance", 2); 49115 __decorateClass$1E([ 49116 n$5({ type: String }) 49117 ], SonicClosedStoreMessage.prototype, "status", 2); 49118 __decorateClass$1E([ 49119 n$5({ type: String }) 49120 ], SonicClosedStoreMessage.prototype, "size", 2); 49121 __decorateClass$1E([ 49122 n$5({ type: Boolean }) 49123 ], SonicClosedStoreMessage.prototype, "isGuichet", 2); 49124 __decorateClass$1E([ 49125 e$2({ context: accessParamsContext }), 49126 n$5({ type: Object }) 49127 ], SonicClosedStoreMessage.prototype, "accessParams", 2); 49128 SonicClosedStoreMessage = __decorateClass$1E([ 49129 t$3(tagName$17) 49130 ], SonicClosedStoreMessage); 49131 function shouldDisplayWaitingList(options) { 49132 const { 49133 session, 49134 quotas, 49135 availablePrices, 49136 accessParams, 49137 appType: appType2, 49138 waitingListModuleEnabled = true, 49139 hasSeatmap = false, 49140 isPlacementRateSelection = false, 49141 selectedQuota 49142 } = options; 49143 const waitingListSettings = session?.settings?.waiting_list; 49144 const isEnabledForCurrentSession = waitingListSettings?.enabled; 49145 const isHidden = waitingListSettings?.forceHidden === true; 49146 if (!waitingListModuleEnabled || !isEnabledForCurrentSession || isHidden) { 49147 return false; 49148 } 49149 const accessType = getAccessType(accessParams); 49150 if (accessType === AccessType.RESERVATION_REQUEST || accessType === AccessType.CAMPAIGN || accessType === AccessType.WAITING_LIST) { 49151 return false; 49152 } 49153 const isCustomer = appType2 === "customer"; 49154 const isOnlyVisibleForCustomer = isCustomer && session?.infos_status?.publication === "only_visible"; 49155 if (isOnlyVisibleForCustomer) { 49156 return false; 49157 } 49158 const forceDisplayWaitingList = waitingListSettings?.forceDisplay; 49159 const isGuichet = appType2 === "counter"; 49160 if (forceDisplayWaitingList || isGuichet) { 49161 return true; 49162 } 49163 const sessionPrices = session?.prices ?? []; 49164 const hasPrices = sessionPrices.length > 0 || (availablePrices?.length ?? 0) > 0 || (quotas?.some((quota) => (quota.prices?.length ?? 0) > 0) ?? false); 49165 const isPlacedSummary = hasSeatmap && !isPlacementRateSelection; 49166 if (isPlacedSummary) { 49167 const someQuotaIsFull = quotas?.some((quota) => quota.remaining_places_nb === 0); 49168 return !!someQuotaIsFull && hasPrices; 49169 } 49170 if (selectedQuota) { 49171 const remainingPlaces = selectedQuota.remaining_places_nb; 49172 const quotaHasPrices = (selectedQuota.prices?.length ?? 0) > 0; 49173 return remainingPlaces === 0 && quotaHasPrices; 49174 } 49175 return false;
49176 } 49177 var __defProp$1B = Object.defineProperty; 49178 var __getOwnPropDesc$1D = Object.getOwnPropertyDescriptor; 49179 var __decorateClass$1D = (decorators, target, key, kind) => { 49180 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1D(target, key) : target; 49181 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49182 if (decorator = decorators[i2]) 49183 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49184 if (kind && result) __defProp$1B(target, key, result); 49185 return result; 49186 }; 49187 let instanceCount = 0; 49188 const tagName$16 = "sonic-buy-event-block"; 49189 let BuyEventBlock$1 = class BuyEventBlock extends EventContext(Subscriber$1(i$6)) { 49190 constructor() { 49191 super(...arguments); 49192 this.buyMode = BuyMode.DEFAULT; 49193 this.lockSeatContingentSelection = false; 49194 this.disabled = false; 49195 this.noSuffix = false; 49196 this.billetteriePurchaseLink = false; 49197 this.quotas = null; 49198 this.display = "select"; 49199 this.size = "md"; 49200 this.slug = ""; 49201 this.room = {}; 49202 this.categoryId = 0; 49203 this.start_date = 0; 49204 this.end_date = 0; 49205 this.isFetchEnabled = false; 49206 this.isPin = false; 49207 this.disableButtonMultiSelect = false; 49208 this.formDataProvider = "buyEventBlock" + instanceCount++; 49209 this.refetch = (api2) => { 49210 return async () => { 49211 const rect = this.getBoundingClientRect(); 49212 const isInViewPort = rect.width > 0 && rect.height > 0 && rect.top >= 0 && rect.left >= 0 && rect.bottom <= window.innerHeight && rect.right <= window.innerWidth; 49213 if (!isInViewPort) return; 49214 const endpoint = entityEndPoint({ 49215 entityType: EntityType.Event, 49216 entityId: Number(this.id), 49217 accessParams: this.accessParams, 49218 view: entityView.full 49219 }); 49220 const result = await api2.get(endpoint); 49221 if (result?.data) { 49222 this.publisher.set(result.data); 49223 } 49224 }; 49225 }; 49226 this.refetchIntervalId = 0; 49227 } 49228 connectedCallback() { 49229 this.isFetchEnabled = this.hasAttribute("fetch"); 49230 if (this.isFetchEnabled && this.id) { 49231 this.dataProvider = entityEndPoint({ 49232 entityType: EntityType.Event, 49233 entityId: Number(this.id), 49234 accessParams: this.accessParams, 49235 view: entityView.prices, 49236 features: [Feature.Location] 49237 }); 49238 } 49239 super.connectedCallback(); 49240 } 49241 disconnectedCallback() { 49242 super.disconnectedCallback(); 49243 clearInterval(this.refetchIntervalId); 49244 } 49245 onSelectQuota(e2) { 49246 this.selectedQuota = e2.detail; 49247 } 49248 handleRefetch() { 49249 if (this.refetchIntervalId) { 49250 clearInterval(this.refetchIntervalId); 49251 } 49252 if (!this.start_date) return; 49253 const now = Date.now() / 1e3; 49254 const startDateExtended = this.start_date - 24 * 60 * 60; 49255 const endDateExtended = (this.end_date || this.start_date) + 24 * 60 * 60; 49256 if (endDateExtended - startDateExtended > 96 * 60 * 60) return; 49257 if (now > startDateExtended && now < endDateExtended) { 49258 const api2 = new API(this.getApiConfiguration()); 49259 this.refetchIntervalId = setInterval(this.refetch(api2), 1e4); 49260 } 49261 } 49262 willUpdate(_changedProperties) { 49263 if (_changedProperties.has("quotas") && this.quotas) { 49264 if (!this.selectedQuota) { 49265 this.selectedQuota = this.quotas[0]; 49266 } else { 49267 const matchingQuota = this.quotas.find((quota) => quota.id == this.selectedQuota?.id); 49268 this.selectedQuota = matchingQuota || this.quotas[0]; 49269 } 49270 dp("product/" + this.id + "/PricesFilter").selectedQuota.set(this.selectedQuota); 49271 } 49272 if (_changedProperties.has("start_date") && this.start_date) { 49273 this.handleRefetch(); 49274 } 49275 if (_changedProperties.has("accessParams")) { 49276 const accessType = getAccessType(this.accessParams); 49277 if (accessType === AccessType.RESERVATION_REQUEST || accessType === AccessType.CAMPAIGN || accessType === AccessType.WAITING_LIST) { 49278 this.noSuffix = true; 49279 } 49280 } 49281 super.willUpdate(_changedProperties); 49282 } 49283 displayWaitingList() { 49284 return shouldDisplayWaitingList({ 49285 session: this.props, 49286 quotas: this.quotas, 49287 accessParams: this.accessParams, 49288 appType: this.appType, 49289 hasSeatmap: !!this.props?.settings?.has_seatmap, 49290 isPlacementRateSelection: isSeatMode(this.buyMode), 49291 selectedQuota: this.selectedQuota 49292 }); 49293 } 49294 isOnlyVisibleForCustomer() { 49295 const isCustomer = this.appType === "customer"; 49296 const isOnlyVisibleForCustomer = isCustomer && this.props?.infos_status?.publication === "only_visible"; 49297 return isOnlyVisibleForCustomer; 49298 } 49299 shouldDisplayQuotaSelector() { 49300 return this.quotas && this.quotas.length > 1 && !this.lockSeatContingentSelection && !this.isOnlyVisibleForCustomer() && !isAutoseatingMode(this.buyMode) && !isSeatmapviewMode(this.buyMode); 49301 } 49302 render() { 49303 if (this.isWaiting) { 49304 return A$1; 49305 } 49306 return b$1` 49307 ${this.isFetchEnabled ? b$1`<sonic-fetch dataProvider=${this.dataProvider || ""} key="data"></sonic-fetch>` : A$1} 49308 <sonic-store-status></sonic-store-status> 49309 49310 ${this.renderMainContent()} ${this.renderWaitingList()} ${this.renderSuffix()} 49311 `; 49312 } 49313 renderWaitingList() { 49314 if (!this.displayWaitingList()) return A$1; 49315 return b$1`<div class="block mt-3"> 49316 <sonic-waiting-list-button variant="outline"></sonic-waiting-list-button> 49317 </div> `; 49318 } 49319 renderSuffix() { 49320 if (this.noSuffix) return A$1; 49321 return b$1` 49322 <div> 49323 <sonic-buy-event-block-suffix class="block mt-6"></sonic-buy-event-block-suffix> 49324 </div> 49325 `; 49326 } 49327 renderMainContent() { 49328 const showsMapLink = showsEventMapLink(this.buyMode, !!this.props?.settings?.has_seatmap); 49329 const justifyClass = flexJustify(this.align); 49330 const isWaitingListContext = this.accessParams?.isWaitingList; 49331 const displayCategorizedPrices = isAutoseatingMode(this.buyMode) ? false : true; 49332 const hasPrices = this.props?.prices && this.props?.prices?.length > 0; 49333 if (!showsMapLink && !hasPrices) return A$1; 49334 return b$1` 49335 ${this.shouldDisplayQuotaSelector() ? b$1`<sonic-event-quota-selector 49336 formDataProvider=${this.formDataProvider} 49337 ?lockSeatContingentSelection=${this.lockSeatContingentSelection} 49338 .selectedQuota=${this.selectedQuota} 49339 @selectQuota="${this.onSelectQuota}" 49340 display="${this.isGuichet ? "select" : "tabs"}" 49341 class="block mb-5" 49342 ></sonic-event-quota-selector>` : A$1} 49343 ${isAutoseatingMode(this.buyMode) ? b$1` 49344 <sonic-fieldset class=" hover:shadow-lg"> 49345 <div class="text-lg mb-5 font-bold"> 49346 <sonic-icon name="ticket" library="custom"></sonic-icon> ${t("LIB_select_price")} 49347 </div> 49348 <sonic-price-selection-form 49349 .priceContext=${{ 49350 entityType: EntityType.Event,
49351 entityId: Number(this.id) 49352 }} 49353 .fallbackAvailableQuota=${false} 49354 ></sonic-price-selection-form> 49355 </sonic-fieldset> 49356 ` : A$1} 49357 ${displayCategorizedPrices ? b$1`<sonic-categorized-prices 49358 type="${this.props?.entity_type ?? null}" 49359 categoryId="${this.categoryId}" 49360 formType="${this.formType || this.display || "select"}" 49361 ?disabled=${this.disabled} 49362 size="${this.size}" 49363 .selectedQuota=${this.selectedQuota} 49364 ></sonic-categorized-prices>` : A$1} 49365 ${showsMapLink && !this.isPin && !isWaitingListContext ? b$1`<div class="flex gap-x-3 gap-y-2 items-center flex-wrap ${justifyClass}"> 49366 <sonic-event-map-link></sonic-event-map-link> 49367 </div> 49368 <sonic-seat-suggest .sessionId="${Number(this.id)}" class="my-2 block"></sonic-seat-suggest>` : A$1} 49369 `; 49370 } 49371 }; 49372 BuyEventBlock$1.styles = [ 49373 i$9` 49374 :host([align="center"]) { 49375 text-align: center; 49376 } 49377 `, 49378 tailwind 49379 ]; 49380 __decorateClass$1D([ 49381 e$2({ context: buyModeContext }), 49382 n$5({ type: String }) 49383 ], BuyEventBlock$1.prototype, "buyMode", 2); 49384 __decorateClass$1D([ 49385 n$5({ type: Boolean }) 49386 ], BuyEventBlock$1.prototype, "lockSeatContingentSelection", 2); 49387 __decorateClass$1D([ 49388 n$5({ type: Boolean }) 49389 ], BuyEventBlock$1.prototype, "disabled", 2); 49390 __decorateClass$1D([ 49391 n$5({ type: Boolean }) 49392 ], BuyEventBlock$1.prototype, "noSuffix", 2); 49393 __decorateClass$1D([ 49394 n$5({ type: Boolean }) 49395 ], BuyEventBlock$1.prototype, "billetteriePurchaseLink", 2); 49396 __decorateClass$1D([ 49397 n$5({ type: Array }) 49398 ], BuyEventBlock$1.prototype, "quotas", 2); 49399 __decorateClass$1D([ 49400 n$5({ type: String }) 49401 ], BuyEventBlock$1.prototype, "formType", 2); 49402 __decorateClass$1D([ 49403 n$5({ type: String }) 49404 ], BuyEventBlock$1.prototype, "display", 2); 49405 __decorateClass$1D([ 49406 n$5({ type: String }) 49407 ], BuyEventBlock$1.prototype, "size", 2); 49408 __decorateClass$1D([ 49409 n$5({ type: String }) 49410 ], BuyEventBlock$1.prototype, "slug", 2); 49411 __decorateClass$1D([ 49412 n$5({ type: Object }) 49413 ], BuyEventBlock$1.prototype, "room", 2); 49414 __decorateClass$1D([ 49415 n$5({ type: Number }) 49416 ], BuyEventBlock$1.prototype, "categoryId", 2); 49417 __decorateClass$1D([ 49418 n$5({ type: Number }) 49419 ], BuyEventBlock$1.prototype, "start_date", 2); 49420 __decorateClass$1D([ 49421 n$5({ type: Number }) 49422 ], BuyEventBlock$1.prototype, "end_date", 2); 49423 __decorateClass$1D([ 49424 c({ context: alignContext, subscribe: true }), 49425 e$2({ context: alignContext }), 49426 n$5({ type: String, reflect: true }) 49427 ], BuyEventBlock$1.prototype, "align", 2); 49428 __decorateClass$1D([ 49429 c({ context: accessParamsContext, subscribe: true }), 49430 n$5({ type: Object }) 49431 ], BuyEventBlock$1.prototype, "accessParams", 2); 49432 __decorateClass$1D([ 49433 bind$1("sonicTicketApp.isWaiting"), 49434 r$5() 49435 ], BuyEventBlock$1.prototype, "isWaiting", 2); 49436 __decorateClass$1D([ 49437 c({ context: appType, subscribe: true }), 49438 r$5() 49439 ], BuyEventBlock$1.prototype, "appType", 2); 49440 __decorateClass$1D([ 49441 c({ context: pinContext, subscribe: true }), 49442 n$5({ type: Boolean }) 49443 ], BuyEventBlock$1.prototype, "isPin", 2); 49444 __decorateClass$1D([ 49445 e$2({ context: disableButtonMultiSelectContext }), 49446 n$5({ type: Boolean }) 49447 ], BuyEventBlock$1.prototype, "disableButtonMultiSelect", 2); 49448 __decorateClass$1D([ 49449 r$5() 49450 ], BuyEventBlock$1.prototype, "selectedQuota", 2); 49451 __decorateClass$1D([ 49452 bind$1("settings.subscriptionRequirement"), 49453 r$5() 49454 ], BuyEventBlock$1.prototype, "subscriptionRequirement", 2); 49455 BuyEventBlock$1 = __decorateClass$1D([ 49456 t$3(tagName$16) 49457 ], BuyEventBlock$1); 49458 var __defProp$1A = Object.defineProperty; 49459 var __getOwnPropDesc$1C = Object.getOwnPropertyDescriptor; 49460 var __decorateClass$1C = (decorators, target, key, kind) => { 49461 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1C(target, key) : target; 49462 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49463 if (decorator = decorators[i2]) 49464 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49465 if (kind && result) __defProp$1A(target, key, result); 49466 return result; 49467 }; 49468 let EventTaxonomies = class extends Subscriber$1(i$6) { 49469 constructor() { 49470 super(...arguments); 49471 this.categories = []; 49472 this.labels = []; 49473 this.range = null; 49474 this.size = "md"; 49475 this.displayAll = false;
49476 this.forceRangeDisplay = false; 49477 this.displayTaxonomies = ["range", "label", "category"]; 49478 } 49479 render() { 49480 const hasRange = this.range && (this.range.display || this.forceRangeDisplay || this.appType === "counter"); 49481 const hasLabel = this.labels && this.labels.length > 0; 49482 const hasCategory = this.categories && this.categories.length > 0; 49483 if (!hasRange && !hasLabel && !hasCategory) { 49484 this.style.display = "none"; 49485 return A$1; 49486 } 49487 this.style.removeProperty("display"); 49488 return b$1` 49489 ${this.displayTaxonomies.includes("range") && this.range ? b$1`<sonic-event-taxonomy 49490 size=${this.size} 49491 .taxonomy=${[this.range]} 49492 key="range" 49493 variant="outline" 49494 ?displayAll=${this.forceRangeDisplay} 49495 ></sonic-event-taxonomy>` : A$1} 49496 ${this.displayTaxonomies.includes("label") && this.labels.length > 0 ? b$1`<sonic-event-taxonomy size=${this.size} .taxonomy=${this.labels} key="label" variant="default"> 49497 </sonic-event-taxonomy>` : A$1} 49498 ${this.displayTaxonomies.includes("category") && this.categories.length > 0 ? b$1`<sonic-event-taxonomy 49499 size=${this.size} 49500 .icon=${{ library: "custom", prefix: "regular", name: "tag" }} 49501 .taxonomy=${this.categories} 49502 ?displayAll=${this.displayAll} 49503 variant="ghost" 49504 key="category" 49505 ></sonic-event-taxonomy>` : A$1} 49506 `; 49507 } 49508 }; 49509 EventTaxonomies.styles = i$9` 49510 :host { 49511 display: flex; 49512 gap: 0.25em 0.35em; 49513 flex-wrap: wrap; 49514 align-items: center; 49515 } 49516 `; 49517 __decorateClass$1C([ 49518 n$5({ type: Array }) 49519 ], EventTaxonomies.prototype, "categories", 2); 49520 __decorateClass$1C([ 49521 n$5({ type: Array }) 49522 ], EventTaxonomies.prototype, "labels", 2); 49523 __decorateClass$1C([ 49524 n$5({ type: Object }) 49525 ], EventTaxonomies.prototype, "range", 2); 49526 __decorateClass$1C([ 49527 n$5({ type: String }) 49528 ], EventTaxonomies.prototype, "size", 2); 49529 __decorateClass$1C([ 49530 n$5({ type: Boolean }) 49531 ], EventTaxonomies.prototype, "displayAll", 2); 49532 __decorateClass$1C([ 49533 n$5({ type: Boolean }) 49534 ], EventTaxonomies.prototype, "forceRangeDisplay", 2); 49535 __decorateClass$1C([ 49536 n$5({ type: Array }) 49537 ], EventTaxonomies.prototype, "displayTaxonomies", 2); 49538 __decorateClass$1C([ 49539 c({ context: appType, subscribe: true }), 49540 r$5() 49541 ], EventTaxonomies.prototype, "appType", 2); 49542 EventTaxonomies = __decorateClass$1C([ 49543 t$3("sonic-event-taxonomies") 49544 ], EventTaxonomies); 49545 var __defProp$1z = Object.defineProperty; 49546 var __getOwnPropDesc$1B = Object.getOwnPropertyDescriptor; 49547 var __decorateClass$1B = (decorators, target, key, kind) => { 49548 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1B(target, key) : target; 49549 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49550 if (decorator = decorators[i2]) 49551 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49552 if (kind && result) __defProp$1z(target, key, result); 49553 return result; 49554 }; 49555 const tagName$15 = "sonic-event-duration"; 49556 let SonicEventDuration = class extends Subscriber$1(i$6) { 49557 constructor() { 49558 super(...arguments); 49559 this.duration = 0; 49560 this.settings = {}; 49561 this.durationOutput = ""; 49562 } 49563 willUpdate(changedProperties) { 49564 if (changedProperties.has("settings") || changedProperties.has("duration")) { 49565 const duration = this.settings?.duration || this.duration || 0; 49566 this.durationOutput = this.cleanDurationOutput(duration); 49567 } 49568 super.willUpdate(changedProperties); 49569 } 49570 cleanDurationOutput(duration) { 49571 if (!duration) return ""; 49572 let durationOuput = ""; 49573 const lang = document.documentElement.lang; 49574 const isFrench = lang.split("-")[0] === "fr"; 49575 const hourSeparator = isFrench ? "h" : ":"; 49576 if (duration >= 60) { 49577 const hours = Math.floor(duration / 60); 49578 const minutes = duration % 60; 49579 const formatedMinutes = minutes < 10 ? `0${minutes}` : minutes; 49580 durationOuput = `${hours}${hourSeparator}${formatedMinutes}`; 49581 } else if (isFrench) { 49582 durationOuput = `${duration < 10 ? `0${duration}` : duration}min`; 49583 } else { 49584 durationOuput = `0${hourSeparator}${duration < 10 ? `0${duration}` : duration}`; 49585 } 49586 return durationOuput; 49587 } 49588 render() { 49589 if (!this.durationOutput) return A$1; 49590 return b$1`<div class="flex gap-[.35em] items-center"> 49591 <sonic-icon name="clock" library="custom" class=" text-center"></sonic-icon>
49592 <span> ${t("duree")} : ${this.durationOutput} </span> 49593 </div>`; 49594 } 49595 }; 49596 SonicEventDuration.styles = [tailwind]; 49597 __decorateClass$1B([ 49598 n$5({ type: Number }) 49599 ], SonicEventDuration.prototype, "duration", 2); 49600 __decorateClass$1B([ 49601 n$5({ type: Object }) 49602 ], SonicEventDuration.prototype, "settings", 2); 49603 __decorateClass$1B([ 49604 r$5() 49605 ], SonicEventDuration.prototype, "durationOutput", 2); 49606 SonicEventDuration = __decorateClass$1B([ 49607 t$3(tagName$15) 49608 ], SonicEventDuration); 49609 var __defProp$1y = Object.defineProperty; 49610 var __getOwnPropDesc$1A = Object.getOwnPropertyDescriptor; 49611 var __decorateClass$1A = (decorators, target, key, kind) => { 49612 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1A(target, key) : target; 49613 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49614 if (decorator = decorators[i2]) 49615 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49616 if (kind && result) __defProp$1y(target, key, result); 49617 return result; 49618 }; 49619 let SonicEventNotes = class extends Subscriber$1(i$6) { 49620 constructor() { 49621 super(...arguments); 49622 this.notes = ""; 49623 this.lineClamp = false; 49624 } 49625 render() { 49626 if (!this.notes) return A$1; 49627 return b$1` 49628 <div class=" text-info flex gap-[.35em] "> 49629 <sonic-icon library="custom" name="comment-exclamation"></sonic-icon> 49630 <div class=" text-pretty ${this.lineClamp ? "line-clamp-3" : ""} [&_a]:underline"> 49631 ${o$6(this.notes)} 49632 </div> 49633 </div> 49634 `; 49635 } 49636 }; 49637 SonicEventNotes.styles = [tailwind]; 49638 __decorateClass$1A([ 49639 n$5({ type: String }) 49640 ], SonicEventNotes.prototype, "notes", 2); 49641 __decorateClass$1A([ 49642 n$5({ type: Boolean }) 49643 ], SonicEventNotes.prototype, "lineClamp", 2); 49644 SonicEventNotes = __decorateClass$1A([ 49645 t$3("sonic-event-notes") 49646 ], SonicEventNotes); 49647 var __defProp$1x = Object.defineProperty; 49648 var __getOwnPropDesc$1z = Object.getOwnPropertyDescriptor; 49649 var __decorateClass$1z = (decorators, target, key, kind) => { 49650 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1z(target, key) : target; 49651 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49652 if (decorator = decorators[i2]) 49653 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49654 if (kind && result) __defProp$1x(target, key, result); 49655 return result; 49656 }; 49657 let SonicEventStore = class extends Subscriber$1(i$6) { 49658 constructor() { 49659 super(...arguments); 49660 this.formType = "select"; 49661 this.noBorder = false; 49662 this.noActionMenu = false;
49663 this.skeleton = false; 49664 this.expanded = false; 49665 this.alwaysExpanded = false; 49666 this.showAllSessionsButton = false; 49667 this.noAllSessionsButton = false; 49668 } 49669 toggleExpanded() { 49670 if (this.alwaysExpanded) return; 49671 this.expanded = !this.expanded; 49672 } 49673 updated() { 49674 if (!this.resizeObserver) { 49675 this.publicationElement = this.renderRoot.querySelector("sonic-product-publication") ?? void 0; 49676 if (this.publicationElement) { 49677 this.resizeObserver = new ResizeObserver((entries) => { 49678 for (const entry of entries) { 49679 const width = entry.contentRect.width; 49680 this.style.setProperty("--publication-size", `${width}px`); 49681 } 49682 }); 49683 this.resizeObserver.observe(this.publicationElement); 49684 } 49685 } 49686 } 49687 willUpdate(_changedProperties) { 49688 if (_changedProperties.has("accessParams") && this.accessParams?.customListSlug) { 49689 this.alwaysExpanded = true; 49690 this.expanded = true; 49691 } 49692 if (_changedProperties.has("alwaysExpanded")) { 49693 if (this.alwaysExpanded) { 49694 this.expanded = true; 49695 } 49696 } 49697 const isEvent = this.props?.entity_type === EntityType.Event; 49698 if (isEvent && this.appType === "counter") { 49699 this.actions = [ 49700 ProductActionsEnum.EDIT, 49701 ProductActionsEnum.MULTISESSIONS, 49702 ProductActionsEnum.STATS, 49703 ProductActionsEnum.SALES, 49704 ProductActionsEnum.RESERVATIONS, 49705 ProductActionsEnum.DIVIDER, 49706 ProductActionsEnum.PIN 49707 ]; 49708 } 49709 const isMerch = this.props?.entity_type === EntityType.Merch; 49710 if (isMerch && this.appType === "counter") { 49711 this.actions = [ 49712 ProductActionsEnum.EDIT, 49713 ProductActionsEnum.SALES, 49714 ProductActionsEnum.DIVIDER, 49715 ProductActionsEnum.PIN 49716 ]; 49717 } 49718 super.willUpdate(_changedProperties); 49719 } 49720 render() { 49721 if (this.skeleton) { 49722 return this.renderSkeleton(); 49723 } 49724 const entityType = this.props?.entity_type; 49725 if (!entityType) return A$1; 49726 const statusEndPoint = entityStatusEndPoint({ 49727 entityType, 49728 entityId: Number(this.id), 49729 accessParams: this.accessParams 49730 }); 49731 const props = this.props || {}; 49732 const { edito, settings } = props; 49733 const start_date = "start_date" in props ? props.start_date : void 0; 49734 const { site_link } = settings || {}; 49735 const hasDate = !!start_date; 49736 const gridColsClass = hasDate ? " @md:grid-cols-[6rem,1fr,2.5rem] @xl:gr
49736id-cols-[4rem,7.5rem,1fr,2.5rem]" : "@md:grid-cols-[1fr,2.5rem] @xl:grid-cols-[7.5rem,1fr,2.5rem]"; 49737 const displayActions = this.actions?.length && !this.noActionMenu; 49738 return b$1` 49739 <div class="@container"> 49740 <div 49741 @click=${this.toggleExpanded} 49742 class="bg-neutral-0 grid grid-cols-[8rem,1fr] ${gridColsClass} gap-y-2 gap-x-3 49743 @xl:gap-4 items-start @xl:items-center 49744 @sm:rounded-lg relative 49745 ${!this.noBorder ? `pb-6 @sm:p-3 @xl:p-4 49746 border-b @sm:border border-neutral-100 49747 @sm:hover:border-neutral-300 @sm:focus:border-neutral-300 49748 transition-border duration-100` : ""} 49749 49750 ${!this.alwaysExpanded ? "[&:not([alwaysExpanded])]:hover:cursor-pointer tap-highlight-none" : ""} 49751 " 49752 > 49753 ${hasDate ? b$1`<sonic-vertical-date class="hidden @xl:block self-center text-sm"></sonic-vertical-date>` : A$1} 49754 49755 <sonic-product-illustration rounded="md" class="row-span-2 @md:row-span-1 "></sonic-product-illustration> 49756 49757 <div class="flex flex-col pt-1 @md:py-2"> 49758 <div class="mb-2"> 49759 ${hasDate ? b$1`<sonic-date 49760 class="block @xl:hidden text-[.8em] mb-[.2em] uppercase mr-3" 49761 month="2-digit" 49762 ></sonic-date>` : A$1} 49763 49764 <sonic-product-title class="text-lg leading-tight pr-[var(--publication-size)]"></sonic-product-title> 49765 </div> 49766 49767 <div class="flex flex-wrap items-center gap-x-3 gap-y-1"> 49768 ${this.id ? b$1`<sonic-event-additional-status 49769 fetch 49770 dataProvider=${statusEndPoint} 49771 key="data" 49772 size="xs" 49773 class="flex flex-wrap gap-x-3" 49774 ></sonic-event-additional-status>` : A$1} 49775 <sonic-event-scheduled-status size="xs"></sonic-event-scheduled-status> 49776 <sonic-event-taxonomies size="xs" class="contents"></sonic-event-taxonomies> 49777 </div> 49778 49779 <div class="flex flex-wrap items-center gap-x-4 gap-y-1 min-h-[1.8rem] mt-2 text-xs "> 49780 ${this.props?.entity_type === EntityType.Merch ? b$1`<sonic-price-range class="text-sm"></sonic-price-range>` : A$1} 49781 49782 <sonic-event-location-hall class="w-full @md:w-auto"></sonic-event-location-hall> 49783 ${edito?.body || site_link ? b$1` <sonic-pop class="inline-block leading-tight" @click=${(e2) => e2.stopPropagation()}> 49784 <sonic-button variant="unstyled" class="text-xs hover:underline"> 49785 <div class="text-xs hover:text-neutral-800 hover:underline flex items-center gap-[0.35em]"> 49786 <sonic-icon library="custom" name="circle-info"></sonic-icon> 49787 ${t("link_title_infos")} 49788 </div> 49789 </sonic-button> 49790 <div 49791 slot="content" 49792 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" 49793 > 49794 ${edito?.body ? b$1`<div class="prose-sm prose-tight leading-tight max-h-[40vh] overflow-auto"> 49795 ${o$6(edito?.body)} 49796 </div> ` : A$1} 49797 <sonic-divider size="sm"></sonic-divider> 49798 <sonic-event-duration class="text-sm"></sonic-event-duration> 49799 <sonic-event-location-hall class="text-sm" addressDisplay="text"></sonic-event-location-hall> 49800 ${site_link ? b$1`<sonic-link href=${site_link} class="text-info text-sm" target="_blank"> 49801 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 49802 <span class="hover:underline">${t("link_title_more_about")}</span> 49803 </sonic-link>` : A$1} 49804 </div> 49805 </sonic-pop>` : A$1} 49806 ${this.renderAllSessionsButton()} 49807 </div> 49808 <sonic-event-notes subDataProvider="settings" lineClamp class="text-xs mt-1"></sonic-event-notes> 49809 </div> 49810 49811 ${displayActions ? b$1`<div class="absolute top-1 right-1 @md:top-3 @md:right-3 flex items-center gap-2"> 49812 <sonic-product-publication 49813 subDataProvider="${entityType === EntityType.Merch ? "infos_status" : "settings"}" 49814 class="text-lg" 49815 ></sonic-product-publication> 49816 <sonic-product-actions 49817 .actions=${this.actions} 49818 @click=${(e2) => e2.stopPropagation()} 49819 size="sm" 49820 > 49821 </sonic-product-actions> 49822 </div>` : A$1} 49823 ${!this.alwaysExpanded && !displayActions ? b$1`<div class="hidden @md:block"> 49824 <sonic-button ?active=${this.expanded} icon variant="ghost" shape="circle"> 49825 <sonic-icon name="chevron-up" swap="on" library="custom"></sonic-icon> 49826 <sonic-icon name="chevron-down" swap="off" library="custom"></sonic-icon> 49827 </sonic-button> 49828 </div>` : A$1} 49829 ${!this.alwaysExpanded && !displayActions ? b$1` <div class="col-span-full @md:hidden px-3"> 49830 <sonic-button 49831 data-aria-label=${t("link_title_show_prices")} 49832 shape="block" 49833 size="xs" 49834 noAutoFill 49835 class="w-full text-center text-neutral-200 ${this.expanded ? "mb-3" : ""}" 49836 > 49837 ${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")}`} 49838 </sonic-button> 49839 </div>` : A$1} 49840 49841 <div 49842 class="${this.expanded && this.id ? "block" : "hidden"} col-[1/-1] @xl:col-[2/-1] px-3 @md:px-0" 49843 @click=${(e2) => e2.stopPropagation()} 49844 > 49845 ${h(this.expanded ? b$1` ${this.renderBuyBlock()} ` : A$1)} 49846 </div> 49847 </div> 49848 </div> 49849 `; 49850 } 49851 renderSkeleton() { 49852 return b$1`<div class="@container"> 49853 <div 49854 class="grid grid-cols-[8rem,1fr] @md:grid-cols-[6rem,1fr,2.5rem] 49855 @xl:grid-cols-[4rem,7.5rem,1fr,2.5rem] gap-y-2 gap-x-3 49856 @xl:gap-4 items-start @xl:items-center
49857 @sm:rounded-lg 49858 pb-6 @sm:p-3 @xl:p-4 49859 border-b @sm:border border-neutral-100 49860 " 49861 > 49862 <div class="hidden @xl:flex self-center items-center justify-center flex-col"> 49863 <div class="rounded-sm h-3 w-8 bg-neutral-100 "></div> 49864 <div class="rounded-sm size-10 bg-neutral-100 my-2"></div> 49865 <div class="rounded-sm h-3 w-8 bg-neutral-100 "></div> 49866 </div> 49867 <div class=" animate-pulse row-span-2 @md:row-span-1 rounded-md bg-neutral-50 aspect-square"></div> 49868 <div class="flex flex-col pt-1"> 49869 <div class="mb-2"> 49870 <div class="animate-pulse leading-none block bg-neutral-100 rounded-sm h-6 w-1/2 @md:w-1/3 mb-2"></div> 49871 <div class="animate-pulse leading-none block bg-neutral-100 rounded-sm h-5 w-1/3 @md:w-1/4 mb-3"></div> 49872 <div class="animate-pulse leading-none block mb-2 bg-neutral-50 rounded-sm h-4 w-1/2 @md:w-1/3"></div> 49873 </div> 49874 </div> 49875 </div> 49876 </div>`; 49877 } 49878 renderBuyBlock() { 49879 const entityType = this.props?.entity_type; 49880 if (!entityType) return A$1; 49881 const pricesEndPoint = entityEndPoint({ 49882 entityType, 49883 entityId: Number(this.id), 49884 accessParams: this.accessParams, 49885 next: true, 49886 view: entityView.full 49887 }); 49888 if (this.props?.entity_type === EntityType.Merch) { 49889 return b$1`<sonic-buy-event-block display=${this.formType} size="sm"></sonic-buy-event-block> `; 49890 } 49891 if (!pricesEndPoint) return A$1; 49892 return b$1`<sonic-fetch 49893 loader="inline" 49894 dataProvider="sessions/${this.id}/prices" 49895 endpoint=${pricesEndPoint} 49896 key="data" 49897 lazyload 49898 ><sonic-buy-event-block display=${this.formType} size="sm"></sonic-buy-event-block> 49899 </sonic-fetch>`; 49900 } 49901 renderAllSessionsButton() { 49902 if (this.noAllSessionsButton) return A$1; 49903 const props = this.props || {}; 49904 const { slug } = props; 49905 const multisession = "multisession" in props && props.multisession ? props.multisession : void 0; 49906 const multisessionId = multisession ? multisession.id : void 0; 49907 if (!(multisessionId && this.showAllSessionsButton && slug)) return A$1; 49908 const hasCustomAccess = hasAccessParams(this.accessParams); 49909 const buttonContent = b$1` 49910 <div class="text-xs group flex items-center gap-[0.35em]"> 49911 <sonic-icon name="calendar-day" library="custom"></sonic-icon> 49912 <span class="group-hover:underline"> ${t("link_title_sessions_all")} </span> 49913 </div> 49914 `; 49915 if (hasCustomAccess) { 49916 return b$1`<sonic-button 49917 variant="unstyled" 49918 @click=${(e2) => { 49919 const title = this.props?.edito?.title; 49920 if (this.queueFormDataProvider && title) { 49921 dp(this.queueFormDataProvider).set({ search: title.trim() }); 49922 } 49923 e2.stopPropagation(); 49924 e2.preventDefault(); 49925 }} 49926 >${buttonContent}</sonic-button 49927 > `; 49928 } else { 49929 return b$1`<sonic-app-link to="event" slug=${slug} toShow variant="unstyled"> 49930 ${buttonContent} 49931 </sonic-app-link>`; 49932 } 49933 } 49934 }; 49935 SonicEventStore.styles = [ 49936 tailwind, 49937 i$9` 49938 .tap-highlight-none { 49939 -webkit-tap-highlight-color: transparent; 49940 } 49941 ` 49942 ]; 49943 __decorateClass$1z([ 49944 n$5() 49945 ], SonicEventStore.prototype, "formType", 2); 49946 __decorateClass$1z([ 49947 n$5({ type: Boolean }) 49948 ], SonicEventStore.prototype, "noBorder", 2); 49949 __decorateClass$1z([ 49950 n$5({ type: Boolean }) 49951 ], SonicEventStore.prototype, "noActionMenu", 2); 49952 __decorateClass$1z([ 49953 n$5({ type: Boolean }) 49954 ], SonicEventStore.prototype, "skeleton", 2); 49955 __decorateClass$1z([ 49956 n$5({ type: Boolean }) 49957 ], SonicEventStore.prototype, "expanded", 2); 49958 __decorateClass$1z([ 49959 n$5({ type: Boolean }) 49960 ], SonicEventStore.prototype, "alwaysExpanded", 2); 49961 __decorateClass$1z([ 49962 n$5({ type: Boolean }) 49963 ], SonicEventStore.prototype, "showAllSessionsButton", 2); 49964 __decorateClass$1z([ 49965 n$5({ type: Boolean }) 49966 ], SonicEventStore.prototype, "noAllSessionsButton", 2); 49967 __decorateClass$1z([ 49968 c({ context: accessParamsContext, subscribe: true }), 49969 e$2({ context: accessParamsContext }), 49970 n$5({ type: Object }) 49971 ], SonicEventStore.prototype, "accessParams", 2); 49972 __decorateClass$1z([ 49973 c({ context: appType, subscribe: true }) 49974 ], SonicEventStore.prototype, "appType", 2); 49975 __decorateClass$1z([ 49976 n$5({ type: Array }) 49977 ], SonicEventStore.prototype, "actions", 2); 49978 __decorateClass$1z([ 49979 n$5({ type: String }) 49980 ], SonicEventStore.prototype, "queueFormDataProvider", 2); 49981 SonicEventStore = __decorateClass$1z([ 49982 t$3("sonic-event-store-item") 49983 ], SonicEventStore); 49984 var __defProp$1w = Object.defineProperty; 49985 var __getOwnPropDesc$1y = Object.getOwnPropertyDescriptor; 49986 var __decorateClass$1y = (decorators, target, key, kind) => { 49987 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1y(target, key) : target; 49988 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 49989 if (decorator = decorators[i2]) 49990 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 49991 if (kind && result) __defProp$1w(target, key, result); 49992 return result; 49993 }; 49994 let SonicUserSelector = class extends i$6 { 49995 constructor() { 49996 super(...arguments); 49997 this.formDataProvider = "userSelection"; 49998 this.searchFormDataProvider = ""; 49999 this.searchResultDataProvider = ""; 50000 this.selectedId = 0; 50001 this.dispatch = (uid) => { 50002 if (!uid || uid == this.selectedId) return; 50003 const event = new CustomEvent("select", { 50004 detail: { uid } 50005 }); 50006 this.dispatchEvent(event); 50007 this.selectedId = uid; 50008 }; 50009 } 50010 connectedCallback() { 50011 PublisherManager.get(this.formDataProvider).uid.onAssign(this.dispatch); 50012 this.searchFormDataProvider = this.formDataProvider + "Filters"; 50013 this.searchResultDataProvider = this.formDataProvider + "FiltersResult"; 50014 super.connectedCallback(); 50015 } 50016 disconnectedCallback() { 50017 PublisherManager.get(this.formDataProvider).uid.offAssign(this.dispatch); 50018 PublisherManager.get(this.searchFormDataProvider).search.set(""); 50019 PublisherManager.get(this.formDataProvider).uid.set(null); 50020 super.disconnectedCallback(); 50021 } 50022 render() { 50023 return b$1` 50024 <div class="@container "> 50025 <div formDataProvider="${this.searchFormDataProvider}"> 50026 <sonic-input 50027 inlineContent 50028 type="search" 50029 name="search" 50030 size="lg" 50031 id="inputSearch" 50032 placeholder="Rechercher un compte client" 50033 value="" 50034 dataProvider="userSelectionFilters" 50035 autocomplete="off" 50036 > 50037 <sonic-icon name="magnifying-glass" library="custom" slot="prefix"></sonic-icon> 50038 </sonic-input> 50039 </div> 50040 50041 <sonic-if .condition=${sub(this.searchFormDataProvider + ".search")}> 50042 <sonic-queue 50043 limit="9" 50044 targetRequestDuration="1000" 50045 dataFilterProvider="${this.searchFormDataProvider}" 50046 dataProvider="${this.searchResultDataProvider}" 50047 dataProviderExpression="/user?limit=$limit&offset=$offset" 50048 formDataProvider="${this.formDataProvider}" 50049 key="data" 50050 tabindex="0" 50051 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" 50052 > 50053 <template> 50054 <sonic-user-selector-item buttonType="radio" buttonName="uid" class="h-full"></sonic-user-selector-item> 50055 </template> 50056 <template data-value="no-item"> 50057 <sonic-no-result size="md"></sonic-no-result> 50058 </template> 50059 </sonic-queue> 50060 </sonic-if> 50061 </div> 50062 `; 50063 } 50064 }; 50065 SonicUserSelector.styles = [ 50066 tailwind, 50067 customScroll, 50068 i$9` 50069 .mask-scroll { 50070 mask-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 1)); 50071 } 50072 ` 50073 ]; 50074 __decorateClass$1y([ 50075 n$5({ type: String }) 50076 ], SonicUserSelector.prototype, "formDataProvider", 2); 50077 __decorateClass$1y([ 50078 r$5() 50079 ], SonicUserSelector.prototype, "selectedId", 2); 50080 SonicUserSelector = __decorateClass$1y([ 50081 t$3("sonic-user-selector") 50082 ], SonicUserSelector); 50083 var __defProp$1v = Object.defineProperty; 50084 var __getOwnPropDesc$1x = Object.getOwnPropertyDescriptor; 50085 var __decorateClass$1x = (decorators, target, key, kind) => { 50086 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1x(target, key) : target; 50087 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 50088 if (decorator = decorators[i2]) 50089 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 50090 if (kind && result) __defProp$1v(target, key, result); 50091 return result; 50092 }; 50093 let instanceCounter$5 = 0; 50094 let UserAttachForm = class extends i$6 { 50095 constructor() { 50096 super(...arguments); 50097 this.formDataProvider = `newOwnerForm/${instanceCounter$5++}`; 50098 this.owners = []; 50099 this.contactContext = "owner"; 50100 this.updateOwners = (cart) => { 50101 this.owners = getCartOwners(cart.items); 50102 }; 50103 this.handleSubmit = (e2) => { 50104 if (e2?.detail.success) { 50105 const event = new CustomEvent("attach", { detail: { itemIds: [this.item?.id || ""] } }); 50106 this.dispatchEvent(event); 50107 } 50108 }; 50109 } 50110 connectedCallback() { 50111 this.initFormDataProvider(); 50112 if (this.cartProvider) { 50113 dp(this.cartProvider).data.onAssign(this.updateOwners); 50114 } 50115 super.connectedCallback(); 50116 } 50117 initFormDataProvider() { 50118 dp(this.formDataProvider).set({ 50119 owner: this.item?.owner 50120 }); 50121 } 50122 disconnectedCallback() { 50123 super.disconnectedCallback(); 50124 if (this.cartProvider) { 50125 dp(this.cartProvider).data.offAssign(this.updateOwners); 50126 } 50127 } 50128 render() { 50129 const { entity_type, entity_id } = this.item || {}; 50130 if (!entity_type || !entity_id || !this.item) return A$1; 50131 return b$1`${productPriceSummary({ lineItemCart: this.item, className: "mb-4", accessParams: this.accessParams })} 50132 <div class="block @container"> 50133 ${this.ownerSuggestion()} ${this.ownerForm()} 50134 ${this.appType === "counter" ? b$1` <sonic-user-selector 50135 class="pt-8 mt-8 border-t border-dashed border-neutral-200 block" 50136 formDataProvider="Owner/userSelection" 50137 size="md" 50138 @select=${(e2) => this.patchOwner(e2.detail)} 50139 ></sonic-user-selector>` : A$1} 50140 </div>`; 50141 } 50142 // OwnerForm :: NEW OWNER 50143 ownerForm() { 50144 const endpoint = `${this.cartProvider}/items/${this.item?.id}`; 50145 if (!this.cartProvider) return A$1; 50146 const isCounter = this.appType === "counter"; 50147 return b$1`<div formDataProvider=${this.formDataProvider} class="@container">
50148 <sonic-input class="grow" type="hidden" value="0" name="owner.uid"></sonic-input> 50149 <div class="grid grid-cols-1 @2xl:flex items-end w-full gap-3"> 50150 <sonic-submit 50151 class="w-full" 50152 endPoint=${endpoint} 50153 submitResultDataprovider="${this.cartProvider}" 50154 method="patch" 50155 @submit=${this.handleSubmit} 50156 onEnterKey 50157 > 50158 <div class="grid grid-cols-1 @2xl:flex items-end w-full gap-3 grow"> 50159 <sonic-input type="hidden" name="owner.uid" value="0"></sonic-input> 50160 <sonic-input 50161 class="grow" 50162 type="text" 50163 id="lastName" 50164 autocomplete=${autocompleteValue("family-name", this.appType)} 50165 name="owner.lastName" 50166 label="${t("nom")}" 50167 ?required=${!isCounter} 50168 > 50169 ${this.requiredMark(!isCounter)} 50170 </sonic-input> 50171 <sonic-input 50172 class="grow" 50173 id="firstName" 50174 autocomplete=${autocompleteValue("given-name", this.appType)} 50175 type="text" 50176 name="owner.firstName" 50177 label="${t("prenom")}" 50178 ?required=${!isCounter} 50179 > 50180 ${this.requiredMark(!isCounter)} 50181 </sonic-input> 50182 <sonic-input 50183 class="grow min-w-[10rem]" 50184 id="email" 50185 autocomplete=${autocompleteValue("email", this.appType)} 50186 type="email" 50187 name="owner.email" 50188 label="${t("email")}" 50189 ></sonic-input> 50190 </div> 50191 </sonic-submit> 50192 <sonic-submit 50193 @submit=${this.handleSubmit} 50194 endPoint=${endpoint} 50195 submitResultDataprovider="${this.cartProvider}" 50196 method="patch" 50197 onClick 50198 > 50199 <sonic-button type="primary" shape="block" noAutoFill> 50200 <sonic-icon name="check" library="custom" slot="prefix"></sonic-icon> 50201 ${t("enregistrer")}</sonic-button 50202 > 50203 </sonic-submit> 50204 50205 <sonic-tooltip label="${t("reset_informations")}" placement="bottom-end"> 50206 <sonic-button shape="circle" @click=${this.resetOwnerForm}> 50207 <sonic-icon library="custom" name="arrow-rotate-left"></sonic-icon 50208 ></sonic-button> 50209 </sonic-tooltip> 50210 </div> 50211 </div>`; 50212 } 50213 // @todo : refacto this in a shared component 50214 requiredMark(isRequired) { 50215 const shouldRender = isRequired || false; 50216 return shouldRender ? b$1`<span class="opacity-50 pl-1" slot="label">*</span>` : A$1; 50217 } 50218 resetOwnerForm() { 50219 dp(this.formDataProvider).set({ 50220 owner: { 50221 uid: 0, 50222 lastName: "", 50223 firstName: "", 50224 email: "" 50225 } 50226 }); 50227 } 50228 ownerSuggestion() { 50229 if (!this.owners.length) return A$1; 50230 const hasNonEmptyOwner = this.owners.some((owner) => owner.uid || owner.firstName || owner.lastName || owner.email); 50231 if (!hasNonEmptyOwner) return A$1; 50232 return b$1`<sonic-divider class="text-sm text-neutral-500 " align="left">${t("choose_owner")}</sonic-divider> 50233 <div class="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] w-full gap-3 mb-8"> 50234 ${c$1( 50235 this.owners, 50236 (owner) => owner, 50237 (owner) => this.ownerSuggestionItem(owner) 50238 )} 50239 </div>`; 50240 } 50241 ownerSuggestionItem(owner) { 50242 const { uid, firstName, lastName, email: email2 } = owner; 50243 if (!uid && !firstName && !lastName && !email2) return; 50244 const uniqueId = `${firstName}-${lastName}-${email2}-${uid}`; 50245 return b$1` 50246 <sonic-user-selector-item 50247 noAutoFill 50248 dataProvider="ownerSelection/${uniqueId}" 50249 size="xs" 50250 buttonType="button" 50251 @click=${() => this.patchOwner(owner)} 50252 .props=${owner} 50253 ></sonic-user-selector-item> 50254 `; 50255 } 50256 async patchOwner(owner) { 50257 const id = this.item?.id; 50258 if (!id || !this.cartProvider) return; 50259 Cart.patchItems({ 50260 apiConfiguration: HTML$1.getApiConfiguration(this), 50261 cartProvider: this.cartProvider, 50262 query: { 50263 ids: [id] 50264 }, 50265 body: { 50266 owner 50267 } 50268 }).then((e2) => { 50269 if (e2 === "asRequested") { 50270 const event = new CustomEvent("attach", { detail: { itemIds: [id] } }); 50271 this.dispatchEvent(event); 50272 } 50273 }); 50274 } 50275 }; 50276 UserAttachForm.styles = [tailwind, customScroll]; 50277 __decorateClass$1x([ 50278 n$5({ type: Object }) 50279 ], UserAttachForm.prototype, "item", 2); 50280 __decorateClass$1x([ 50281 n$5({ type: String }) 50282 ], UserAttachForm.prototype, "formDataProvider", 2); 50283 __decorateClass$1x([ 50284 c({ context: appType, subscribe: true }) 50285 ], UserAttachForm.prototype, "appType", 2); 50286 __decorateClass$1x([ 50287 n$5({ type: String }) 50288 ], UserAttachForm.prototype, "cartProvider", 2); 50289 __decorateClass$1x([ 50290 c({ context: accessParamsContext }), 50291 n$5({ type: Object }) 50292 ], UserAttachForm.prototype, "accessParams", 2); 50293 __decorateClass$1x([ 50294 r$5() 50295 ], UserAttachForm.prototype, "owners", 2); 50296 __decorateClass$1x([ 50297 e$2({ context: contactContext }), 50298 n$5({ type: String }) 50299 ], UserAttachForm.prototype, "contactContext", 2); 50300 UserAttachForm = __decorateClass$1x([ 50301 t$3("sonic-owner-attach-form") 50302 ], UserAttachForm); 50303 var __decorate$5 = function(decorators, target, key, desc) { 50304 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 50305 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 50306 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; 50307 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 50308 }; 50309 const tagName$14 = "sonic-form-actions"; 50310 let FormActions = class FormActions extends i$6 { 50311 constructor() { 50312 super(...arguments); 50313 this.direction = "row"; 50314 this.justify = "flex-start"; 50315 } 50316 render() { 50317 const styles2 = { 50318 flexDirection: this.direction, 50319 justifyContent: this.justify 50320 }; 50321 return b$1`<slot style=${o$3(styles2)}></slot>`; 50322 } 50323 }; 50324 FormActions.styles = [ 50325 i$9` 50326 :host { 50327 display: block; 50328 } 50329 slot { 50330 display: flex; 50331 flex-wrap: wrap; 50332 gap: 0.3rem; 50333 } 50334 ` 50335 ]; 50336 __decorate$5([ 50337 n$5({ type: String }) 50338 ], FormActions.prototype, "direction", void 0); 50339 __decorate$5([ 50340 n$5({ type: String }) 50341 ], FormActions.prototype, "justify", void 0); 50342 FormActions = __decorate$5([ 50343 t$3(tagName$14) 50344 ], FormActions); 50345 var __defProp$1u = Object.defineProperty; 50346 var __getOwnPropDesc$1w = Object.getOwnPropertyDescriptor; 50347 var __decorateClass$1w = (decorators, target, key, kind) => { 50348 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1w(target, key) : target; 50349 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 50350 if (decorator = decorators[i2]) 50351 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 50352 if (kind && result) __defProp$1u(target, key, result); 50353 return result; 50354 }; 50355 let instanceCounter$4 = 0; 50356 const tagName$13 = "sonic-add-proof"; 50357 let AddProof = class extends i$6 { 50358 constructor() { 50359 super(...arguments); 50360 this.formDataProvider = "subscriptionAddProof" + instanceCounter$4++; 50361 this.canSubmit = false;
50362 this.handleFormMutation = () => { 50363 const proof = dp(this.formDataProvider).proof_of_identity?.get(); 50364 const proofIsEmpty = Array.isArray(proof) ? proof.length === 0 : !proof; 50365 this.canSubmit = !proofIsEmpty; 50366 }; 50367 } 50368 connectedCallback() { 50369 dp(this.formDataProvider).proof_of_identity.set(this.item?.proof_of_identity); 50370 dp(this.formDataProvider).onInternalMutation(this.handleFormMutation); 50371 super.connectedCallback(); 50372 } 50373 render() { 50374 return b$1`${productPriceSummary({ lineItemCart: this.item, className: "mb-6" })} 50375 <form formDataProvider=${this.formDataProvider}> 50376 <sonic-fieldset> 50377 <sonic-file-upload 50378 required 50379 type="file" 50380 name="proof_of_identity" 50381 label="${t("LIB_proof_private")}" 50382 .accept=${["image/jpeg", "image/png", "image/jpg", "application/pdf", "image/gif"]} 50383 ></sonic-file-upload> 50384 </sonic-fieldset> 50385 <sonic-form-actions> 50386 <sonic-button @click=${this.submitForm} type="success" shape="block" ?disabled=${!this.canSubmit}> 50387 <sonic-icon name="file-arrow-up" library="custom"></sonic-icon> 50388 ${t("LIB_send")}</sonic-button 50389 > 50390 </sonic-form-actions> 50391 </form>`; 50392 } 50393 async submitForm(e2) { 50394 const button2 = e2.target; 50395 const id = this.item?.id; 50396 if (!id || !this.cartProvider) return; 50397 const formPublisher = dp(this.formDataProvider); 50398 formPublisher.isFormValid.set(true); 50399 formPublisher.invalidateForm(); 50400 if (!formPublisher.isFormValid.get()) return; 50401 button2.setAttribute("loading", ""); 50402 await Cart.patchItems({ 50403 apiConfiguration: HTML.getApiConfiguration(this), 50404 cartProvider: this.cartProvider, 50405 query: { 50406 ids: [id] 50407 }, 50408 body: { 50409 proof_of_identity: formPublisher.proof_of_identity?.get() 50410 } 50411 }).then((e22) => { 50412 if (e22 === "asRequested") { 50413 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 50414 if (parentModal) { 50415 parentModal.hide(); 50416 this.dispatchEvent(new CustomEvent("attach")); 50417 } 50418 } 50419 }).finally(() => { 50420 button2.removeAttribute("loading"); 50421 }); 50422 } 50423 }; 50424 AddProof.styles = [tailwind]; 50425 __decorateClass$1w([ 50426 n$5({ type: Object }) 50427 ], AddProof.prototype, "item", 2); 50428 __decorateClass$1w([ 50429 n$5({ type: String }) 50430 ], AddProof.prototype, "cartProvider", 2); 50431 __decorateClass$1w([ 50432 r$5() 50433 ], AddProof.prototype, "canSubmit", 2); 50434 AddProof = __decorateClass$1w([ 50435 t$3(tagName$13) 50436 ], AddProof); 50437 const subscriptionsContext = n("subscriptions"); 50438 const quickSelectSliderCSS = i$9` 50439 [data-quick-select-slider] { 50440 overflow: hidden; 50441 width: 100%; 50442 display: block; 50443 } 50444 50445 [data-quick-select-slider-wrapper] { 50446 display: flex; 50447 transform: translateX(var(--quick-select-slider-offset, 0px)); 50448 transition: transform 0.2s ease-in-out; 50449 height: 100%; 50450 will-change: transform; 50451 } 50452 50453 [data-quick-select-slider-item] { 50454 scroll-snap-align: start; 50455 width: var(--quick-select-column-width); 50456 padding: 0.5rem 0.5rem; 50457 flex-shrink: 0; 50458 position: relative; 50459 height: 100%; 50460 } 50461`; 50462 const normalizeEmail = (email2) => email2?.trim().toLowerCase() ?? ""; 50463 const buildUserEmailSearchUrl = (emails, limit) => { 50464 const params = new URLSearchParams(); 50465 params.set("limit", String(limit)); 50466 emails.forEach((email2) => params.append("email[]", email2)); 50467 return `/user?${params.toString()}`; 50468 }; 50469 const groupAccountsByEmail = (accounts, emails) => { 50470 const accountsByEmail = /* @__PURE__ */ new Map(); 50471 emails.forEach((email2) => { 50472 accountsByEmail.set(normalizeEmail(email2), []); 50473 }); 50474 accounts.forEach((account) => { 50475 const bucket = accountsByEmail.get(normalizeEmail(account.email)); 50476 if (bucket) { 50477 bucket.push(account); 50478 } 50479 }); 50480 return accountsByEmail; 50481 }; 50482 const computeAccountSearchLimit = (emailCount, accountSearchLimit) => Math.min(500, Math.max(accountSearchLimit, emailCount * accountSearchLimit)); 50483 const fetchAccountsByEmails = async (api2, emails, accountSearchLimit) => { 50484 const uniqueEmails = [...new Set(emails.map((email2) =>
50484 email2.trim()).filter(Boolean))]; 50485 if (!uniqueEmails.length) { 50486 return /* @__PURE__ */ new Map(); 50487 } 50488 const limit = computeAccountSearchLimit(uniqueEmails.length, accountSearchLimit); 50489 try { 50490 const result = await api2.get(buildUserEmailSearchUrl(uniqueEmails, limit)); 50491 const accounts = result?.data ?? []; 50492 return groupAccountsByEmail(accounts, uniqueEmails); 50493 } catch (error) { 50494 console.error("Owner suggestion account search failed:", error); 50495 return new Map(uniqueEmails.map((email2) => [normalizeEmail(email2), []])); 50496 } 50497 }; 50498 function getOwnerEmailsFromCart(cart) { 50499 const owners = getCartOwnerSuggestions({ 50500 items: cart.items ?? [], 50501 linked_subscriptions: cart.linked_subscriptions 50502 }); 50503 const emails = []; 50504 for (const owner of owners) { 50505 const email2 = owner.email?.trim(); 50506 if (!email2 || email2.endsWith(".pasdemail")) { 50507 continue; 50508 } 50509 if (!emails.some((existing) => normalizeEmail(existing) === normalizeEmail(email2))) { 50510 emails.push(email2); 50511 } 50512 } 50513 return emails; 50514 } 50515 async function findUserAccountsByOwnerEmails(api2, emails) { 50516 if (!emails.length) { 50517 return []; 50518 } 50519 const accountsByEmail = await fetchAccountsByEmails(api2, emails, 5); 50520 const seenUids = /* @__PURE__ */ new Set(); 50521 const accounts = []; 50522 for (const email2 of emails) { 50523 for (const account of accountsByEmail.get(normalizeEmail(email2)) ?? []) { 50524 const uid = account.uid; 50525 if (!uid || seenUids.has(uid)) { 50526 continue; 50527 } 50528 seenUids.add(uid); 50529 accounts.push(account); 50530 } 50531 } 50532 return accounts; 50533 } 50534 async function findCounterBuyerAccounts(cart, apiConfiguration) { 50535 const emails = getOwnerEmailsFromCart(cart); 50536 if (!emails.length) { 50537 return []; 50538 } 50539 return findUserAccountsByOwnerEmails(new API(apiConfiguration), emails); 50540 } 50541 let pendingBuyerSelection = null; 50542 function promptCounterBuyerSelection(accounts) { 50543 if (!accounts.length) { 50544 return Promise.resolve(void 0); 50545 } 50546 if (pendingBuyerSelection) { 50547 return pendingBuyerSelection; 50548 } 50549 pendingBuyerSelection = new Promise((resolve) => { 50550 let settled = false; 50551 let selectedUid; 50552 const finish = (uid) => { 50553 if (settled) { 50554 return; 50555 } 50556 settled = true; 50557 resolve(uid); 50558 }; 50559 const modal = Modal.create({ 50560 title: t("choose_customer_account"), 50561 maxWidth: "42rem", 50562 removeOnHide: true, 50563 styleSheet: [tailwind], 50564 content: b$1` 50565 <sonic-alert class="mb-5">Comptes clients candidats parmi les détenteurs du panier</sonic-alert> 50566 <div class="grid grid-cols-1 gap-2"> 50567 ${accounts.map( 50568 (account) => b$1` 50569 <sonic-button 50570 variant="outline" 50571 align="left" 50572 shape="block" 50573 class="mb-3" 50574 @click=${() => { 50575 selectedUid = account.uid ?? void 0; 50576 modal.hide(); 50577 }} 50578 > 50579 <sonic-user-info 50580 inert 50581 tabindex="-1" 50582 class=" pointer-events-none py-2 block" 50583 size="sm" 50584 noAutoFill 50585 dataProvider="user/${account.uid}" 50586 .props=${account} 50587 ></sonic-user-info> 50588 </sonic-button> 50589 ` 50590 )} 50591 </div> 50592 ` 50593 }); 50594 modal.addEventListener( 50595 "hide", 50596 () => { 50597 finish(selectedUid); 50598 }, 50599 { once: true } 50600 ); 50601 }).finally(() => { 50602 pendingBuyerSelection = null; 50603 }); 50604 return pendingBuyerSelection; 50605 } 50606 function toCounterCartBuyerSource(cart, items) { 50607 return { 50608 buyer: cart?.buyer, 50609 items: items ?? cart?.items ?? [], 50610 linked_subscriptions: cart?.linked_subscriptions 50611 }; 50612 } 50613 async function resolveCounterBuyerUidForSubscription(cart, apiConfiguration, ownerEmail) { 50614 const email2 = ownerEmail?.trim(); 50615 if (email2 && !email2.endsWith(".pasdemail")) { 50616 const accounts2 = await findUserAccountsByOwnerEmails(new API(apiConfiguration), [email2]); 50617 if (accounts2.length === 1) { 50618 return { uid: accounts2[0].uid ?? void 0, hasCandidateAccounts: true }; 50619 } 50620 if (accounts2.length > 1) { 50621 const uid2 = await promptCounterBuyerSelection(accounts2); 50622 return { uid: uid2, hasCandidateAccounts: true }; 50623 } 50624 } 50625 const accounts = await findCounterBuyerAccounts(cart, apiConfiguration); 50626 if (!accounts.length) { 50627 return { hasCandidateAccounts: false }; 50628 } 50629 if (accounts.length === 1) { 50630 return { uid: accounts[0].uid ?? void 0, hasCandidateAccounts: true }; 50631 } 50632 const uid = await promptCounterBuyerSelection(accounts); 50633 return { uid, hasCandidateAccounts: true }; 50634 } 50635 const ACTIVE_WAITING_LIST_STATUSES = [ 50636 ReservationStatus.Incomplete, 50637 ReservationStatus.Draft, 50638 ReservationStatus.Submitted, 50639 ReservationStatus.Pending 50640 ]; 50641 const WAITING_LIST_TUNNEL_DP = "cart/quickSelect/waitingListTunnel"; 50642 const WAITING_LIST_TUNNEL_BIND_PATH = "cart/quickSelect/waitingListTunnel.data"; 50643 let refreshWaitingListRequestId = 0; 50644 function asWaitingListTunnelEntries(entries) { 50645 return Array.isArray(entries) ? entries : []; 50646 } 50647 function hasNoParentSubscription(parentId) { 50648 return parentId == null || parentId === ""; 50649 } 50650 function matchesParentSubscription(lineItemParentId, parentSubscriptionId) { 50651 if (!parentSubscriptionId) { 50652 return hasNoParentSubscription(lineItemParentId); 50653 } 50654 return String(lineItemParentId ?? "") === String(parentSubscriptionId); 50655 } 50656 function filterWaitingListTunnelEntries(entries, sessionId, parentSubscriptionId) { 50657 return asWaitingListTunnelEntries(entries).filter(({ lineItem }) => { 50658 if (lineItem.entity_type !== EntityType.Event || Number(lineItem.entity_id) !== sessionId) { 50659 return false;
50660 } 50661 return matchesParentSubscription(lineItem.parent_id, parentSubscriptionId); 50662 }); 50663 } 50664 function filterWaitingListTunnelEntriesForSubscriber(entries, parentSubscriptionId) { 50665 return asWaitingListTunnelEntries(entries).filter( 50666 ({ lineItem }) => matchesParentSubscription(lineItem.parent_id, parentSubscriptionId) 50667 ); 50668 } 50669 function isWaitingListTunnelEntryDirectlyEditable(status) { 50670 if (!status) { 50671 return true; 50672 } 50673 return status === ReservationStatus.Incomplete || status === ReservationStatus.Draft; 50674 } 50675 function isWaitingListTunnelEntryLockedForever(status) { 50676 if (!status) { 50677 return false; 50678 } 50679 return isLockedForever(status); 50680 } 50681 async function ensureWaitingListTunnelEntryEditable(entry, apiConfiguration) { 50682 if (isWaitingListTunnelEntryDirectlyEditable(entry.status)) { 50683 return true; 50684 } 50685 if (isWaitingListTunnelEntryLockedForever(entry.status)) { 50686 return false; 50687 } 50688 const api2 = new API(apiConfiguration); 50689 const result = await api2.put(`${entry.cartProvider}/cancel-submission`, {}); 50690 return !!result?.success; 50691 } 50692 async function restoreWaitingListTunnelEntrySubmission(entry, apiConfiguration) { 50693 if (await waitingListCartHasErrors(apiConfiguration, entry.cartProvider)) { 50694 return true; 50695 } 50696 return lockReservationRequest(apiConfiguration, entry.cartProvider); 50697 } 50698 function waitingListCartHasItemErrors(items = []) { 50699 return items.some((item) => item.has_error || item.messages?.some((message) => message?.status === "error")); 50700 } 50701 async function waitingListCartHasErrors(apiConfiguration, cartProvider) { 50702 const api2 = new API(apiConfiguration); 50703 const result = await api2.get(cartProvider); 50704 if (!result?.success || !result.data) { 50705 return true; 50706 } 50707 return waitingListCartHasItemErrors(result.data.items ?? []); 50708 } 50709 async function loadWaitingListTunnelEntries(element, buyerUid, options) { 50710 if (!buyerUid) { 50711 return []; 50712 } 50713 const sessionIds = void 0; 50714 const carts = await getUserCarts(element, { 50715 cartType: CartType.WaitingLists, 50716 userId: buyerUid, 50717 statuses: ACTIVE_WAITING_LIST_STATUSES, 50718 limit: 50, 50719 sessionIds, 50720 multisessionId: options?.multisessionId 50721 }); 50722 const entries = []; 50723 for (const cart of carts) { 50724 if (!cart.id) { 50725 continue; 50726 } 50727 const cartProvider = cartProviderKey(CartType.WaitingLists, cart.id); 50728 for (const item of cart.items ?? []) { 50729 if (item.entity_type !== EntityType.Event) { 50730 continue; 50731 } 50732 entries.push({ 50733 lineItem: item, 50734 cartProvider, 50735 cartId: cart.id, 50736 status: cart.status 50737 }); 50738 } 50739 } 50740 return entries; 50741 } 50742 async function loadWaitingListTunnelEntriesForBuyers(element, buyerUids, options) { 50743 const uniqueUids = [...new Set(buyerUids.filter((uid) => uid > 0))]; 50744 if (!uniqueUids.length) { 50745 return []; 50746 } 50747 const results = await Promise.all( 50748 uniqueUids.map((buyerUid) => loadWaitingListTunnelEntries(element, buyerUid, options)) 50749 ); 50750 return results.flat(); 50751 } 50752 async function resolveWaitingListBuyerUids(element, options) { 50753 if (options.appType === "counter") { 50754 const cartData = dp(options.cartProvider).data.get?.() ?? dp(options.cartProvider).data.get(); 50755 const accounts = await findCounterBuyerAccounts( 50756 toCounterCartBuyerSource(cartData, cartData?.items), 50757 options.apiConfiguration ?? HTML$1.getApiConfiguration(element) 50758 ); 50759 return accounts.map((account) => account.uid).filter((uid) => !!uid); 50760 } 50761 return options.loggedUserId ? [options.loggedUserId] : []; 50762 } 50763 async function refreshWaitingListTunnelEntries(element, options) { 50764 const requestId = ++refreshWaitingListRequestId; 50765 const buyerUids = await resolveWaitingListBuyerUids(element, options); 50766 if (requestId !== refreshWaitingListRequestId) { 50767 return asWaitingListTunnelEntries(dp(WAITING_LIST_TUNNEL_DP).data.get()); 50768 } 50769 if (!buyerUids.length) { 50770 dp(WAITING_LIST_TUNNEL_DP).data.set([]); 50771 return []; 50772 } 50773 const entries = await loadWaitingListTunnelEntriesForBuyers(element, buyerUids); 50774 if (requestId !== refreshWaitingListRequestId) { 50775 return asWaitingListTunnelEntries(dp(WAITING_LIST_TUNNEL_DP).data.get()); 50776 } 50777 dp(WAITING_LIST_TUNNEL_DP).data.set(entries); 50778 return entries; 50779 } 50780 async function resolveBuyerUid(_element, _linkedCartProvider, buyerUid) { 50781 if (buyerUid) { 50782 return buyerUid; 50783 } 50784 return void 0; 50785 } 50786 async function unlockWaitingListCartIfNeeded(cartProvider, status, apiConfiguration) { 50787 if (!status || isWaitingListTunnelEntryDirectlyEditable(status)) { 50788 return true; 50789 } 50790 if (isWaitingListTunnelEntryLockedForever(status)) { 50791 return false;
50792 } 50793 const api2 = new API(apiConfiguration); 50794 const result = await api2.put(`${cartProvider}/cancel-submission`, {}); 50795 return !!result?.success; 50796 } 50797 async function ensureWaitingListCartProvider(element, options) { 50798 const buyerId = await resolveBuyerUid(element, options.linkedCartProvider, options.buyerUid); 50799 if (!buyerId) { 50800 return null; 50801 } 50802 const apiConfiguration = options.apiConfiguration ?? HTML$1.getApiConfiguration(element); 50803 const matchingCart = await findWaitingListCart(element, { 50804 userId: buyerId, 50805 statuses: ACTIVE_WAITING_LIST_STATUSES, 50806 sessionIds: options.sessionId ? [options.sessionId] : void 0, 50807 multisessionId: options.multisessionId 50808 }); 50809 let listId = matchingCart?.id ?? null; 50810 if (!listId) { 50811 const providerKey = cartProviderKey(CartType.WaitingLists); 50812 const result = await Cart.newCart({ 50813 apiConfiguration, 50814 cartProvider: providerKey, 50815 buyer: { uid: buyerId } 50816 }); 50817 listId = result?.data?.id ?? null; 50818 } 50819 if (!listId) { 50820 return null; 50821 } 50822 const cartProvider = cartProviderKey(CartType.WaitingLists, listId); 50823 const unlocked = await unlockWaitingListCartIfNeeded(cartProvider, matchingCart?.status, apiConfiguration); 50824 return unlocked ? cartProvider : null; 50825 } 50826 async function addSessionToWaitingList(element, options) { 50827 const waitingListProvider = await ensureWaitingListCartProvider(element, { 50828 linkedCartProvider: options.linkedCartProvider, 50829 buyerUid: options.buyerUid, 50830 sessionId: options.sessionId, 50831 multisessionId: options.multisessionId, 50832 apiConfiguration: options.apiConfiguration 50833 }); 50834 if (!waitingListProvider) { 50835 return false; 50836 } 50837 const item = { 50838 entity_type: EntityType.Event, 50839 entity_id: options.sessionId, 50840 quantity: options.quantity ?? 1, 50841 ...options.parentSubscriptionId ? { parent_id: options.parentSubscriptionId } : {}, 50842 ...options.quotaId ? { quota: { id: options.quotaId } } : {} 50843 }; 50844 const apiConfiguration = options.apiConfiguration ?? HTML$1.getApiConfiguration(element); 50845 const result = await Cart.addItems({ 50846 apiConfiguration, 50847 cartProvider: waitingListProvider, 50848 items: [item] 50849 }); 50850 if (result === "error") { 50851 return false; 50852 } 50853 if (result !== "asRequested") { 50854 return true; 50855 } 50856 return lockReservationRequest(apiConfiguration, waitingListProvider); 50857 } 50858 async function removeWaitingListTunnelEntry(element, entry, apiConfiguration) { 50859 if (!entry.lineItem.id) { 50860 return; 50861 } 50862 await Cart.removeItems({ 50863 apiConfiguration: apiConfiguration ?? HTML$1.getApiConfiguration(element), 50864 cartProvider: entry.cartProvider, 50865 query: { ids: [entry.lineItem.id] } 50866 }); 50867 } 50868 function renderQuotaBadge(quota) { 50869 if (!quota?.id || isOutOfContingentQuotaId(quota.id)) return A$1; 50870 return b$1`<sonic-badge size="2xs" class="mt-2">${quota.title}</sonic-badge>`; 50871 } 50872 function getAmountLabel(price) { 50873 return price?.amount_display ? formatAmount(price.amount_display) : t("free"); 50874 } 50875 function renderWaitingListHeader(messages2) { 50876 const hasError = messages2?.some((message) => message?.status === "error"); 50877 return b$1` 50878 <sonic-badge 50879 size="2xs" 50880 type="${hasError ? "danger" : "info"}" 50881 class="font-bold italic mb-[3px] flex items-center justify-center gap-1" 50882 > 50883 <sonic-icon name="list-ol" library="custom"></sonic-icon> 50884 ${t("waiting_list")} 50885 </sonic-badge> 50886 `; 50887 } 50888 function renderPriceHeader(price) { 50889 const promoIcon = price.is_triggering_promo ? b$1`<sonic-icon 50890 name="stars" 50891 library="custom" 50892 prefix="solid" 50893 class="animate-heartbeat inline-block" 50894 ></sonic-icon>` : price.is_promo ? b$1`<sonic-icon 50895 name="gift" 50896 library="custom" 50897 prefix="solid" 50898 class="animate-heartbeat inline-block" 50899 ></sonic-icon>` : A$1; 50900 const categoryLabel = price.placeCategory?.title ? b$1`<div class="font-bold italic mb-[3px]">${price.placeCategory.title}</div>` : A$1; 50901 const priceTitle = b$1`<div class="mb-[2px]">${promoIcon} ${price.label}</div>`; 50902 return b$1`<div class="text-pretty mb-2">${categoryLabel} ${priceTitle}</div>`; 50903 }
50904 function renderSeatLabel(seat) { 50905 if (!seat?.short_name) return A$1; 50906 return b$1` 50907 <span class="flex items-center gap-x-1"> 50908 <sonic-icon name="loveseat" library="custom"></sonic-icon> 50909 <span>${seat.short_name}</span> 50910 </span> 50911 `; 50912 } 50913 function renderQuickSelectLineItemMarkup(lineItem, isWaitingList2) { 50914 const { price, quota, messages: messages2, seat } = lineItem; 50915 const amountLabel = getAmountLabel(price); 50916 const editRow = b$1`<div class="flex items-center gap-x-1"> 50917 <span>${amountLabel}</span> 50918 <span>|</span> 50919 <sonic-icon name="pen" library="custom"></sonic-icon> 50920 </div>`; 50921 const quotaBadge = renderQuotaBadge(quota); 50922 if (isWaitingList2) { 50923 const priceLabel = price?.label ?? t("waiting_list"); 50924 return b$1` 50925 <div class="text-pretty mb-2 flex flex-col items-center justify-center gap-1"> 50926 ${renderWaitingListHeader(messages2)} 50927 <div class="mb-[2px]">${priceLabel}</div> 50928 ${editRow} 50929 </div> 50930 ${quotaBadge} 50931 `; 50932 } 50933 if (!price) return "..."; 50934 return b$1` 50935 ${renderPriceHeader(price)} 50936 <div class="flex gap-x-3 flex-nowrap justify-center">${renderSeatLabel(seat)} ${editRow}</div> 50937 ${quotaBadge} 50938 `; 50939 } 50940 var __defProp$1t = Object.defineProperty; 50941 var __getOwnPropDesc$1v = Object.getOwnPropertyDescriptor; 50942 var __decorateClass$1v = (decorators, target, key, kind) => { 50943 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1v(target, key) : target; 50944 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 50945 if (decorator = decorators[i2]) 50946 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 50947 if (kind && result) __defProp$1t(target, key, result); 50948 return result; 50949 }; 50950 let SonicCartQuickSelectLineItem = class extends Subscriber$1(i$6) { 50951 constructor() { 50952 super(...arguments); 50953 this.cartProvider = ""; 50954 } 50955 render() { 50956 const entry = this.entry; 50957 if (!entry) return A$1; 50958 const { lineItem, waitingListEntry } = entry; 50959 const { id, has_error, messages: messages2 } = lineItem; 50960 if (!id) return A$1; 50961 const isWaitingList2 = !!waitingListEntry; 50962 const isLockedForever2 = isWaitingList2 && isWaitingListTunnelEntryLockedForever(waitingListEntry.status); 50963 const displayMessages = isWaitingList2 ? messages2?.filter((message) => message?.status === "error") : messages2; 50964 const hasWarning = !!displayMessages?.some((message) => message?.status === "warning"); 50965 const messageMarkup = this.renderLineItemMessages(displayMessages, hasWarning); 50966 const buttonType = this.getLineItemButtonType(lineItem, { 50967 isWaitingList: isWaitingList2, 50968 hasError: !!has_error, 50969 hasWarning 50970 }); 50971 const buttonVariant = has_error || isWaitingList2 ? "outline" : "default"; 50972 const itemMarkup = renderQuickSelectLineItemMarkup(lineItem, isWaitingList2); 50973 const fadeAnimation = F({ in: v, out: f, stabilizeOut: true }); 50974 const openEditModal = async () => { 50975 if (isWaitingList2 && waitingListEntry) { 50976 const wasSubmitted = waitingListEntry.status === ReservationStatus.Submitted; 50977 const editable = await ensureWaitingListTunnelEntryEditable(waitingListEntry, this.getApiConfiguration()); 50978 if (!editable) return; 50979 editPriceModal({ 50980 lineItems: [lineItem], 50981 cartProvider: waitingListEntry.cartProvider, 50982 linkedCartProvider: this.cartProvider, 50983 accessParams: { ...this.accessParams, isWaitingList: true }, 50984 onUpdated: async () => { 50985 if (wasSubmitted) { 50986 await restoreWaitingListTunnelEntrySubmission(waitingListEntry, this.getApiConfiguration()); 50987 } 50988 this.dispatchWaitingListUpdated(); 50989 } 50990 }); 50991 return; 50992 } 50993 editPriceModal({ 50994 lineItems: [lineItem], 50995 cartProvider: this.cartProvider, 50996 accessParams: this.accessParams 50997 }); 50998 }; 50999 const removeItem = async () => { 51000 if (isWaitingList2 && waitingListEntry) { 51001 const editable = await ensureWaitingListTunnelEntryEditable(waitingListEntry, this.getApiConfiguration()); 51002 if (!editable) return; 51003 await removeWaitingListTunnelEntry(this, waitingListEntry, this.getApiConfiguration()); 51004 this.dispatchWaitingListUpdated(); 51005 return; 51006 } 51007 await Cart.removeItems({ 51008 apiConfiguration: this.getApiConfiguration(), 51009 cartProvider: this.cartProvider, 51010 query: { ids: [id] } 51011 }); 51012 }; 51013 const mainButton = b$1` 51014 <sonic-button 51015 type="${buttonType}" 51016 variant="${buttonVariant}" 51017 size="xs" 51018 shape="block" 51019 ${fadeAnimation} 51020 class="w-full relative ${isLockedForever2 ? "pointer-events-none" : "hover:opacity-85 transition-opacity duration-100"}" 51021 @click="${isLockedForever2 ? void 0 : () => void openEditModal()}" 51022 > 51023 ${itemMarkup} ${messageMarkup} 51024 </sonic-button> 51025 `; 51026 const removeButton = !isLockedForever2 ? b$1` 51027 <sonic-button 51028 size="2xs" 51029 icon 51030 shape="circle" 51031 type="danger" 51032 ${fadeAnimation} 51033 class="absolute -right-2 -top-2 rounded-full hover:scale-110 transition-all duration-100" 51034 data-aria-label=${t("LIB_remove")} 51035 @click="${() => void removeItem()}" 51036 > 51037 <sonic-icon name="trash" library="custom"></sonic-icon> 51038 </sonic-button> 51039 ` : A$1; 51040 return b$1` <div class="relative my-1 z-[2]">${mainButton} ${removeButton}</div> `; 51041 } 51042 dispatchWaitingListUpdated() { 51043 this.dispatchEvent(new CustomEvent("waiting-list-updated", { bubbles: true, composed: true })); 51044 } 51045 getLineItemButtonType(lineItem, { isWaitingList: isWaitingList2, hasError, hasWarning }) { 51046 if (hasError) return "danger"; 51047 if (hasWarning) return "warning"; 51048 if (lineItem.price?.is_triggering_promo) return "success"; 51049 if (isWaitingList2) return "info"; 51050 return "neutral"; 51051 } 51052 renderLineItemMessages(messages2, hasWarning) { 51053 if (!messages2?.length) return A$1; 51054 return b$1` 51055 <div class="mt-2 ${hasWarning ? "animate-pulse" : ""}"> 51056 ${o( 51057 o$1(messages2, (message) => message?.content ? o$6(message.content) : A$1), 51058 b$1`<br />` 51059 )} 51060 </div> 51061 `; 51062 } 51063 }; 51064 SonicCartQuickSelectLineItem.styles = [tailwind]; 51065 __decorateClass$1v([ 51066 n$5({ type: Object }) 51067 ], SonicCartQuickSelectLineItem.prototype, "entry", 2); 51068 __decorateClass$1v([ 51069 n$5({ type: String }) 51070 ], SonicCartQuickSelectLineItem.prototype, "cartProvider", 2); 51071 __decorateClass$1v([ 51072 n$5({ type: Object }) 51073 ], SonicCartQuickSelectLineItem.prototype, "accessParams", 2); 51074 SonicCartQuickSelectLineItem = __decorateClass$1v([ 51075 t$3("sonic-cart-quick-select-line-item") 51076 ], SonicCartQuickSelectLineItem); 51077 var __defProp$1s = Object.defineProperty; 51078 var __getOwnPropDesc$1u = Object.getOwnPropertyDescriptor; 51079 var __decorateClass$1u = (decorators, target, key, kind) => { 51080 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1u(target, key) : target; 51081 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 51082 if (decorator = decorators[i2]) 51083 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 51084 if (kind && result) __defProp$1s(target, key, result); 51085 return result; 51086 }; 51087 dp("cart/quickSelect/isAdding").set(false); 51088 let SonicCartQuickSelectSessionPrices = class extends Subscriber$1(i$6) { 51089 constructor() { 51090 super(...arguments); 51091 this.items = []; 51092 this.hasSeatmap = false;
51093 this._waitingListShowEntries = []; 51094 this._availablePrices = null; 51095 this._isLoading = false; 51096 this._waitingListEnabled = false; 51097 this._availablePricesRequestId = 0; 51098 this._isAdding = false; 51099 this._waitingListModuleEnabled = false; 51100 this._cartProvider = ""; 51101 this._availableQuotas = []; 51102 } 51103 connectedCallback() { 51104 this._cartProvider = this.getAncestorAttributeValue("cartProvider"); 51105 super.connectedCallback(); 51106 } 51107 get _waitingListEntries() { 51108 if (!this.priceContext?.entityId) return []; 51109 return filterWaitingListTunnelEntries( 51110 this._waitingListShowEntries ?? [], 51111 Number(this.priceContext.entityId), 51112 this.priceContext.parentSubscription?.id 51113 ); 51114 } 51115 get _waitingListEntriesForSubscriber() { 51116 return filterWaitingListTunnelEntriesForSubscriber( 51117 this._waitingListShowEntries ?? [], 51118 this.priceContext?.parentSubscription?.id 51119 ); 51120 } 51121 dispatchWaitingListUpdated() { 51122 this.dispatchEvent(new CustomEvent("waiting-list-updated", { bubbles: true, composed: true })); 51123 } 51124 willUpdate(_changedProperties) { 51125 if (_changedProperties.has("items") || _changedProperties.has("priceContext") && this.priceContext) { 51126 const subscriptionEntityId = this.priceContext?.parentSubscription?.entity_id; 51127 this.updateGeneralCondition(subscriptionEntityId); 51128 } 51129 if (_changedProperties.has("priceContext") && this.priceContext?.entityId && this.isConnected) { 51130 const previousPriceContext = _changedProperties.get("priceContext"); 51131 if (previousPriceContext?.entityId !== this.priceContext?.entityId || previousPriceContext?.parentSubscription?.id !== this.priceContext?.parentSubscription?.id) { 51132 this._availablePrices = null; 51133 this._availableQuotas = []; 51134 void this.setAvailablePrices(); 51135 } 51136 } 51137 if (_changedProperties.has("items") && this._pricesLoaded) { 51138 this._isLoading = false; 51139 } 51140 if (_changedProperties.has("loggedUserId") && this.loggedUserId && this._customerAccountModal) { 51141 this._customerAccountModal.hide(); 51142 this._customerAccountModal = void 0; 51143 } 51144 super.willUpdate(_changedProperties); 51145 } 51146 get canUseWaitingList() { 51147 const isCanceled = this.infosStatus?.additionnals?.some((additionnal) => additionnal.key === "canceled"); 51148 const notVisibleForCurrentCustomerType = this.infosStatus?.publication !== Publication.OnSale && "customer" === this.appType; 51149 if (isCanceled || notVisibleForCurrentCustomerType) return false; 51150 return this._waitingListModuleEnabled && this._waitingListEnabled; 51151 } 51152 get _pricesLoaded() { 51153 return this._availablePrices !== null; 51154 } 51155 get canAddToCart() { 51156 return (this._availablePrices?.length ?? 0) > 0; 51157 } 51158 /** Hors contingent ou contingent préféré guichet sans places restantes. */ 51159 get hasRelevantQuotaWithoutRemaining() { 51160 const outOfContingentQuota = this._availableQuotas.find((quota) => isOutOfContingentQuotaId(quota.id)); 51161 if (outOfContingentQuota?.has_remaining === false) return true; 51162 if (this.preferredQuotaId) { 51163 const preferredQuota = this._availableQuotas.find((quota) => Number(quota.id) === Number(this.preferredQuotaId)); 51164 if (preferredQuota?.has_remaining === false) return true; 51165 } 51166 return false; 51167 } 51168 /** 51169 * Indique si l'utilisateur peut ajouter la session à la liste d'attente ("waiting list"). 51170 * 51171 * â true si : 51172 * - les prix sont chargés, 51173 * - la waiting list est possible sur cette session, 51174 * - l'utilisateur peut ajouter plus de places à la session, 51175 * - (règles différentes selon le mode guichet ou non) 51176 * 51177 * Pour le mode "counter" (guichet) : 51178 * - true si : il y a un quota pertinent sans places restantes OU on ne peut pas ajouter au panier. 51179 * Pour les autres : true si on ne peut pas ajouter au panier. 51180 */ 51181 get canAddWaitingList() { 51182 if (!this._pricesLoaded || !this.canUseWaitingList || !this.canAddMoreToSession) return false;
51183 if (this.appType === "counter") { 51184 return this.hasRelevantQuotaWithoutRemaining || !this.canAddToCart; 51185 } 51186 return !this.canAddToCart; 51187 } 51188 get matchingLineItems() { 51189 return this.items.filter( 51190 (item) => this.belongsToSubscriber(item) && Number(item.entity_id) === Number(this.priceContext?.entityId) && item.entity_type === EntityType.Event 51191 ); 51192 } 51193 get selectedQuantity() { 51194 return this.matchingLineItems.length + this._waitingListEntries.length; 51195 } 51196 get minTicketsPerSession() { 51197 return this._generalCondition?.ticketsPerSession?.min ?? 1; 51198 } 51199 get maxTicketsPerSession() { 51200 return this._generalCondition?.ticketsPerSession?.max ?? 999; 51201 } 51202 get maxSessionsPerShow() { 51203 return this._generalCondition?.sessionsPerShow?.max ?? null; 51204 } 51205 belongsToSubscriber(item) { 51206 const parentId = this.priceContext?.parentSubscription?.id; 51207 return parentId ? item.parent_id === parentId : !item.parent_id; 51208 } 51209 get sessionIdsWithItemsForShow() { 51210 const showId = Number(this.multisessionId); 51211 if (!showId) return /* @__PURE__ */ new Set(); 51212 const lineItems = [ 51213 ...this.items.filter((item) => this.belongsToSubscriber(item)), 51214 ...this._waitingListEntriesForSubscriber.map((entry) => entry.lineItem) 51215 ]; 51216 return new Set( 51217 lineItems.filter((item) => item.entity_type === EntityType.Event && item.multisession_id === showId && item.entity_id).map((item) => Number(item.entity_id)) 51218 ); 51219 } 51220 get canAddMoreToSession() { 51221 const currentSessionId = Number(this.priceContext?.entityId); 51222 if (!currentSessionId) return false; 51223 if (this.maxTicketsPerSession && this.selectedQuantity >= this.maxTicketsPerSession) return false; 51224 const sessionsPerShowMax = this.maxSessionsPerShow; 51225 if (sessionsPerShowMax == null) return true; 51226 if (this.isShowLimitReached) return false; 51227 return !(sessionsPerShowMax === 1 && this.selectedQuantity >= 1); 51228 } 51229 get isShowLimitReached() { 51230 const sessionsPerShowMax = this.maxSessionsPerShow; 51231 const currentSessionId = Number(this.priceContext?.entityId); 51232 if (sessionsPerShowMax == null || !currentSessionId) return false; 51233 const sessionsWithItems = this.sessionIdsWithItemsForShow; 51234 return !sessionsWithItems.has(currentSessionId) && sessionsWithItems.size >= sessionsPerShowMax; 51235 } 51236 get displayLineItems() { 51237 return [ 51238 ...this.matchingLineItems.map((lineItem) => ({ lineItem })), 51239 ...this._waitingListEntries.map((entry) => ({ lineItem: entry.lineItem, waitingListEntry: entry })) 51240 ]; 51241 } 51242 getCounterCartBuyerSource() { 51243 const cartData = dp(this._cartProvider).data.get?.() ?? dp(this._cartProvider).data.get(); 51244 return toCounterCartBuyerSource(cartData, this.items); 51245 } 51246 /** 51247 * Au guichet : résout le compte client du détenteur de la colonne abonné. 51248 */ 51249 async resolveCounterBuyer() { 51250 return resolveCounterBuyerUidForSubscription( 51251 this.getCounterCartBuyerSource(), 51252 this.getApiConfiguration(), 51253 this.priceContext?.parentSubscription?.owner?.email 51254 ); 51255 } 51256 openCustomerAccountModal() { 51257 this._customerAccountModal = Modal.create({ 51258 title: t("LIB_account_required"), 51259 content: b$1`<sonic-user-form-login createAccount></sonic-user-form-login>`, 51260 removeOnHide: true 51261 }); 51262 } 51263 openCounterCreateAccountModal() { 51264 Modal.create({ 51265 title: t("LIB_account_required"), 51266 content: b$1`<sonic-alert 51267 background 51268 status="info" 51269 label="Aucun compte client ne correspond à l'email d'un abonnement du panier." 51270 > 51271 Veuillez créer un compte client correspondant à l'email d'un abonnement du panier. 51272 </sonic-alert> `, 51273 removeOnHide: true 51274 }); 51275 } 51276 /** 51277 * Met à jour la condition générale de l'abonnement (règles ticketsPerSession, sessionsPerShow, etc.) 51278 * @param subscriptionEntityId - ID de l'entité abonnement 51279 */ 51280 updateGeneralCondition(subscriptionEntityId) { 51281 this._generalCondition = subscriptionEntityId ? getSubscriptionRules(subscriptionEntityId, this._cartProvider)?.[0]?.conditions?.[0] : void 0; 51282 } 51283 /**
51284 * Récupère les prix disponibles pour l'entité 51285 * Et les contingent disponibles 51286 */ 51287 async setAvailablePrices() { 51288 if (!this.priceContext) return; 51289 const requestId = ++this._availablePricesRequestId; 51290 const api2 = getDefaultApi(); 51291 const endpoint = priceEndPoint(this.priceContext, this.accessParams); 51292 this._isLoading = true; 51293 try { 51294 const result = await api2.get(endpoint); 51295 if (requestId !== this._availablePricesRequestId) return; 51296 const data = result?.data; 51297 this._availablePrices = data?.prices?.filter((price) => price?.price_available) ?? []; 51298 this._availableQuotas = data?.quotas ?? []; 51299 this._waitingListEnabled = !!data?.settings?.waiting_list?.enabled; 51300 } finally { 51301 if (requestId === this._availablePricesRequestId) { 51302 this._isLoading = false; 51303 } 51304 } 51305 } 51306 getLastQuotaId() { 51307 if (this.items.length === 0) return; 51308 const subscriptionItems = this.items.filter((item) => item.parent_id === this.priceContext?.parentSubscription?.id); 51309 if (subscriptionItems.length === 0) return; 51310 const sortedItems = this.sortItemsByUpdatedAt(subscriptionItems); 51311 const lastItem = sortedItems[0]; 51312 if (!lastItem.quota) return 0; 51313 return Number(lastItem.quota?.id); 51314 } 51315 getPreferredQuotaId() { 51316 const lastQuotaId = this.getLastQuotaId(); 51317 const lastQuotaIsOutOfContingentOrUnset = !lastQuotaId || isOutOfContingentQuotaId(lastQuotaId); 51318 if (lastQuotaIsOutOfContingentOrUnset && this.preferredQuotaId) { 51319 return Number(this.preferredQuotaId); 51320 } 51321 if (lastQuotaId) { 51322 return Number(lastQuotaId); 51323 } 51324 if (this.preferredQuotaId) { 51325 return Number(this.preferredQuotaId); 51326 } 51327 return void 0; 51328 } 51329 sortItemsByUpdatedAt(items) { 51330 return [...items].sort((a2, b2) => { 51331 if (a2.updatedAt && b2.updatedAt) { 51332 return b2.updatedAt - a2.updatedAt; 51333 } 51334 return 0; 51335 }); 51336 } 51337 async addToCart() { 51338 if (!this.canAddMoreToSession) return; 51339 if (this.needsPriceSelection()) { 51340 this.openPriceSelectionModal(); 51341 return; 51342 } 51343 if (this.maxTicketsPerSession && this.selectedQuantity >= this.maxTicketsPerSession) return; 51344 await this.submitCartAddition(this.computeQuantityToAdd()); 51345 } 51346 needsPriceSelection() { 51347 const lastQuotaId = this.getLastQuotaId(); 51348 return this.hasAmbiguousFreePrice() || this.hasMultiplePricesWithoutQuotaHistory(lastQuotaId) || this.hasMultipleQuotasWithoutPreference(lastQuotaId); 51349 } 51350 /** Plusieurs prix dont au moins un gratuit et au moins un payant â choix ambigu. */ 51351 hasAmbiguousFreePrice() { 51352 const prices = this._availablePrices; 51353 if (!prices || prices.length <= 1) return false; 51354 const hasFreePrice = prices.some((price) => price.amount === 0); 51355 const allPricesAreFree = prices.every((price) => price.amount === 0); 51356 return hasFreePrice && !allPricesAreFree; 51357 } 51358 /** Plusieurs prix mais aucun historique de quota dans le panier â on laisse l'utilisateur choisir. */ 51359 hasMultiplePricesWithoutQuotaHistory(lastQuotaId) { 51360 const prices = this._availablePrices; 51361 if (!prices || prices.length <= 1) return false; 51362 return !lastQuotaId; 51363 } 51364 /** Plusieurs quotas visibles sans préférence guichet ni historique â on laisse l'utilisateur choisir. */ 51365 hasMultipleQuotasWithoutPreference(lastQuotaId) { 51366 if (!this._availableQuotas?.length) return false; 51367 const visibleQuotaCount = this._availableQuotas.filter( 51368 (quota) => quota?.prices?.some((price) => price.visible === true) 51369 ).length; 51370 if (visibleQuotaCount <= 1) return false; 51371 return !this.preferredQuotaId && !lastQuotaId; 51372 } 51373 openPriceSelectionModal() { 51374 if (!this.priceContext) return; 51375 addPriceModal({ 51376 cartProvider: this._cartProvider, 51377 priceContext: this.priceContext, 51378 preferredQuotaId: this.preferredQuotaId || this.getLastQuotaId() 51379 }); 51380 } 51381 openPriceModalAfterApiMismatch() { 51382 if (!this.priceContext) return; 51383 addPriceModal({ 51384 cartProvider: this._cartProvider, 51385 priceContext: this.priceContext, 51386 accessParams: this.accessParams 51387 }); 51388 } 51389 computeQuantityToAdd() { 51390 let quantity = 1; 51391 if (this.selectedQuantity + quantity > this.maxTicketsPerSession) { 51392 quantity = this.maxTicketsPerSession - this.selectedQuantity; 51393 } 51394 if (this.selectedQuantity === 0) { 51395 quantity = this.minTicketsPerSession; 51396 } 51397 return quantity; 51398 } 51399 buildLineItemToAdd(quantity) { 51400 const quotaId = this.getPreferredQuotaId(); 51401 return { 51402 entity_type: EntityType.Event, 51403 entity_id: Number(this.priceContext?.entityId), 51404 parent_id: this.priceContext?.parentSubscription?.id, 51405 quantity, 51406 ...quotaId ? { quota: { id: quotaId } } : {} 51407 }; 51408 } 51409 async submitCartAddition(quantity) { 51410 dp("cart/quickSelect/isAdding").set(true);
51411 try { 51412 const result = await Cart.addItems({ 51413 apiConfiguration: this.getApiConfiguration(), 51414 cartProvider: this._cartProvider, 51415 items: [this.buildLineItemToAdd(quantity)], 51416 auto_seating: true, 51417 attachOwnersAfterRequest: true, 51418 accessParams: this.accessParams 51419 }); 51420 if (result === "differentFromRequest") { 51421 this.openPriceModalAfterApiMismatch(); 51422 } 51423 } finally { 51424 dp("cart/quickSelect/isAdding").set(false); 51425 } 51426 } 51427 async addToWaitingList() { 51428 if (!this.priceContext?.entityId) return; 51429 if (!this.canAddMoreToSession) return; 51430 let buyerUid; 51431 if (this.appType === "counter") { 51432 const { uid, hasCandidateAccounts } = await this.resolveCounterBuyer(); 51433 if (!uid) { 51434 if (!hasCandidateAccounts) { 51435 this.openCounterCreateAccountModal(); 51436 } 51437 return; 51438 } 51439 buyerUid = uid; 51440 } else { 51441 buyerUid = this.loggedUserId ?? void 0; 51442 if (!buyerUid) { 51443 this.openCustomerAccountModal(); 51444 return; 51445 } 51446 } 51447 dp("cart/quickSelect/isAdding").set(true); 51448 const success = await addSessionToWaitingList(this, { 51449 linkedCartProvider: this._cartProvider, 51450 sessionId: Number(this.priceContext.entityId), 51451 multisessionId: this.multisessionId, 51452 parentSubscriptionId: this.priceContext.parentSubscription?.id, 51453 quotaId: this.getPreferredQuotaId(), 51454 quantity: 1, 51455 apiConfiguration: this.getApiConfiguration(), 51456 buyerUid 51457 }); 51458 dp("cart/quickSelect/isAdding").set(false); 51459 if (success) { 51460 await refreshWaitingListTunnelEntries(this, { 51461 cartProvider: this._cartProvider, 51462 appType: this.appType, 51463 loggedUserId: this.loggedUserId, 51464 apiConfiguration: this.getApiConfiguration() 51465 }); 51466 this.dispatchWaitingListUpdated(); 51467 } 51468 } 51469 render() { 51470 if (this._isLoading || !this._pricesLoaded && this.priceContext?.entityId) { 51471 return b$1`<sonic-loader mode="inline" class="opacity-20"></sonic-loader>`; 51472 } 51473 const displayItems = this.displayLineItems; 51474 const hasDisplayItems = displayItems.length > 0; 51475 const unavailableMessage = this.getUnavailableMessage(); 51476 if (unavailableMessage && !hasDisplayItems && !this.canAddWaitingList) { 51477 return b$1`${this.renderUnavailableMessage(unavailableMessage)}`; 51478 } 51479 const noQuantity = this.selectedQuantity === 0; 51480 const manualPlacement = this.placementType === PlacementType.MANUAL && this.hasSeatmap; 51481 return b$1` 51482 <div class="text-center"> 51483 ${unavailableMessage ? this.renderUnavailableMessage(unavailableMessage) : A$1} ${this._renderItems()} 51484 ${this.canAddToCart && this.canAddMoreToSession ? b$1` <div class="${noQuantity ? "" : "mt-1"} justify-center flex items-center"> 51485 <div class="inline-flex relative items-center"> 51486 <sonic-button 51487 size="${noQuantity && !hasDisplayItems ? "md" : "xs"}" 51488 shape="circle" 51489 variant="ghost" 51490 ?disabled=${this._isAdding} 51491 @click="${() => { 51492 if (!this.canAddMoreToSession) return; 51493 if (manualPlacement && this.priceContext) { 51494 addSeatsModal({ 51495 cartProvider: this._cartProvider, 51496 navigationMode: "event", 51497 priceContext: this.priceContext, 51498 accessParams: this.accessParams 51499 }); 51500 } else { 51501 this.addToCart(); 51502 } 51503 }}" 51504 icon 51505 class="relative hover:scale-110 transition-all duration-100 inline-block will-change-transform" 51506 > 51507 <sonic-icon name="plus" library="custom" size="lg"></sonic-icon> 51508 </sonic-button> 51509 </div> 51510 </div>` : A$1} 51511 ${this.canAddWaitingList ? b$1`<div class="${hasDisplayItems ? "mt-3" : "mt-1"} justify-center flex items-center"> 51512 <sonic-button 51513 size="xs" 51514 variant="default" 51515 ?disabled=${this._isAdding} 51516 @click=${() => this.addToWaitingList()} 51517 class="mx-auto" 51518 > 51519 <sonic-icon name="plus" library="custom" slot="prefix" size="lg"></sonic-icon>
51520 <span>${t("waiting_list")}</span> 51521 </sonic-button> 51522 </div>` : A$1} 51523 </div> 51524 `; 51525 } 51526 _renderItems() { 51527 return b$1` 51528 ${c$1( 51529 this.displayLineItems, 51530 (entry) => entry.waitingListEntry?.lineItem.id ?? entry.lineItem.id ?? "", 51531 (entry) => b$1` 51532 <sonic-cart-quick-select-line-item 51533 .entry=${entry} 51534 .cartProvider=${this._cartProvider} 51535 .accessParams=${this.accessParams} 51536 ></sonic-cart-quick-select-line-item> 51537 ` 51538 )} 51539 `; 51540 } 51541 getUnavailableMessage() { 51542 if (!this._pricesLoaded) return void 0; 51543 if (!this.canAddToCart && this.matchingLineItems.length === 0) { 51544 const hasSubscription = !!this.priceContext?.parentSubscription?.id; 51545 return hasSubscription ? t("no_price_available_for_this_offer") : t("no_price_available"); 51546 } 51547 if (this.isShowLimitReached) { 51548 return t("LIB_max_reached_for_this_event"); 51549 } 51550 return void 0; 51551 } 51552 renderUnavailableMessage(text) { 51553 return b$1`<div class="text-center text-neutral-500 my-1 lg:my-2"> 51554 <sonic-icon name="ban" library="custom"></sonic-icon> 51555 <div class="text-xs mt-1 text-balance mx-2">${text}</div> 51556 </div>`; 51557 } 51558 }; 51559 SonicCartQuickSelectSessionPrices.styles = [tailwind]; 51560 __decorateClass$1u([ 51561 n$5({ type: Array }) 51562 ], SonicCartQuickSelectSessionPrices.prototype, "items", 2); 51563 __decorateClass$1u([ 51564 n$5({ type: Boolean }) 51565 ], SonicCartQuickSelectSessionPrices.prototype, "hasSeatmap", 2); 51566 __decorateClass$1u([ 51567 n$5({ type: Object }) 51568 ], SonicCartQuickSelectSessionPrices.prototype, "priceContext", 2); 51569 __decorateClass$1u([ 51570 n$5({ type: Number }) 51571 ], SonicCartQuickSelectSessionPrices.prototype, "multisessionId", 2); 51572 __decorateClass$1u([ 51573 bind$1(WAITING_LIST_TUNNEL_BIND_PATH), 51574 r$5() 51575 ], SonicCartQuickSelectSessionPrices.prototype, "_waitingListShowEntries", 2); 51576 __decorateClass$1u([ 51577 r$5() 51578 ], SonicCartQuickSelectSessionPrices.prototype, "_availablePrices", 2); 51579 __decorateClass$1u([ 51580 r$5() 51581 ], SonicCartQuickSelectSessionPrices.prototype, "_isLoading", 2); 51582 __decorateClass$1u([ 51583 r$5() 51584 ], SonicCartQuickSelectSessionPrices.prototype, "_waitingListEnabled", 2); 51585 __decorateClass$1u([ 51586 r$5() 51587 ], SonicCartQuickSelectSessionPrices.prototype, "_generalCondition", 2); 51588 __decorateClass$1u([ 51589 bind$1("cart/quickSelect/isAdding"), 51590 r$5() 51591 ], SonicCartQuickSelectSessionPrices.prototype, "_isAdding", 2); 51592 __decorateClass$1u([ 51593 bind$1("settings.modules.waiting_list.enabled"), 51594 r$5() 51595 ], SonicCartQuickSelectSessionPrices.prototype, "_waitingListModuleEnabled", 2); 51596 __decorateClass$1u([ 51597 bind$1("user.id"), 51598 n$5({ type: Number }) 51599 ], SonicCartQuickSelectSessionPrices.prototype, "loggedUserId", 2); 51600 __decorateClass$1u([ 51601 c({ context: preferredQuotaIdContext, subscribe: true }), 51602 r$5() 51603 ], SonicCartQuickSelectSessionPrices.prototype, "preferredQuotaId", 2); 51604 __decorateClass$1u([ 51605 c({ context: appType, subscribe: true }), 51606 n$5({ type: String }) 51607 ], SonicCartQuickSelectSessionPrices.prototype, "appType", 2); 51608 __decorateClass$1u([ 51609 r$5() 51610 ], SonicCartQuickSelectSessionPrices.prototype, "_availableQuotas", 2); 51611 __decorateClass$1u([ 51612 bind$1(QUICK_SELECT_PLACEMENT_TYPE), 51613 r$5() 51614 ], SonicCartQuickSelectSessionPrices.prototype, "placementType", 2); 51615 __decorateClass$1u([ 51616 c({ context: accessParamsContext, subscribe: true }), 51617 n$5({ type: Object }) 51618 ], SonicCartQuickSelectSessionPrices.prototype, "accessParams", 2); 51619 __decorateClass$1u([ 51620 n$5({ type: Object }) 51621 ], SonicCartQuickSelectSessionPrices.prototype, "infosStatus", 2); 51622 SonicCartQuickSelectSessionPrices = __decorateClass$1u([ 51623 t$3("sonic-cart-quick-select-session-prices") 51624 ], SonicCartQuickSelectSessionPrices); 51625 var __defProp$1r = Object.defineProperty; 51626 var __getOwnPropDesc$1t = Object.getOwnPropertyDescriptor; 51627 var __decorateClass$1t = (decorators, target, key, kind) => { 51628 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1t(target, key) : target; 51629 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 51630 if (decorator = decorators[i2]) 51631 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 51632 if (kind && result) __defProp$1r(target, key, result); 51633 return result; 51634 }; 51635 let SonicCartQuickSelectSessionRow = class extends Subscriber$1(i$6) { 51636 constructor() { 51637 super(...arguments); 51638 this.id = ""; 51639 this._subscriptions = []; 51640 this._metadata_ = {}; 51641 this.isFirstRow = false;
51642 this.isOdd = false; 51643 this.isLarge = false; 51644 this.isCondensed = false; 51645 this._cartProvider = ""; 51646 this._currentStatusEndpoint = ""; 51647 this._showOtherOwners = false; 51648 this.updateStatus = () => { 51649 this._infosStatus = dp(this.dataProviderStatusKey).get()?.infos_status || null; 51650 }; 51651 } 51652 connectedCallback() { 51653 this._cartProvider = this.getAncestorAttributeValue("cartProvider") || "cart/current"; 51654 super.connectedCallback(); 51655 } 51656 get dataProviderStatusKey() { 51657 return `quickSelect/status/${this.id}`; 51658 } 51659 willUpdate(_changedProperties) { 51660 if (_changedProperties.has("_metadata_")) { 51661 this.isFirstRow = !!this._metadata_.firstChild; 51662 this.isOdd = !!this._metadata_.odd; 51663 } 51664 if (_changedProperties.has("id") && this.id) { 51665 const previousId = _changedProperties.get("id"); 51666 if (previousId) { 51667 dp(`quickSelect/status/${previousId}`).offInternalMutation(this.updateStatus); 51668 } 51669 this._currentStatusEndpoint = this.statusEndPoint(this.id); 51670 dp(this.dataProviderStatusKey).onInternalMutation(this.updateStatus); 51671 } 51672 super.willUpdate(_changedProperties); 51673 } 51674 disconnectedCallback() { 51675 if (this.id) { 51676 dp(this.dataProviderStatusKey).offInternalMutation(this.updateStatus); 51677 } 51678 this._currentStatusEndpoint = ""; 51679 super.disconnectedCallback(); 51680 } 51681 statusEndPoint(id) { 51682 return entityEndPoint({ 51683 entityType: EntityType.Event, 51684 entityId: Number(id), 51685 accessParams: this.accessParams, 51686 view: entityView.status, 51687 subscriptionTypeIds: this._subscriptions?.map((subscription) => subscription.entity_id?.toString() || ""), 51688 subscriptionPriceIds: this._subscriptions?.map((subscription) => Number(subscription.price?.id) || 0) 51689 }); 51690 } 51691 render() { 51692 const isCondensed = this.isCondensed; 51693 return b$1` 51694 <div class="flex"> 51695 <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 "> 51696 <div class="flex flex-row w-full gap-2 min-w-0 items-start "> 51697 <div class="flex items-center gap-2"> 51698 <sonic-date 51699 class="font-bold lg:min-w-[11rem] block leading-none mb-1 uppercase ${!this.isLarge ? "max-w-[15ch]" : ""}" 51700 month="2-digit" 51701 designMode 51702 noshadowdom 51703 > 51704 <template data-value="literal"> 51705 <span class="text-[.9em] font-normal"></span> 51706 </template> 51707 <template data-value="hour"> 51708 <span class="text-[.9em] font-normal"></span> 51709 </template> 51710 <template data-value="minute"> 51711 <span class="text-[.9em] font-normal"></span> 51712 </template> 51713 </sonic-date> 51714 51715 ${isCondensed ? b$1`<sonic-pop class="-mt-1" 51716 ><sonic-button variant="ghost" shape="circle" size="xs" icon> 51717 <sonic-icon name="circle-info" library="custom" class="text-neutral-500"></sonic-icon> 51718 </sonic-button> 51719 <div slot="content" class="p-3 max-w-[18rem]"> 51720 <sonic-event-taxonomies size="xs"></sonic-event-taxonomies> 51721 <sonic-event-location-hall 51722 ?noPlacement=${!this.isLarge} 51723 size="xs" 51724 class="text-xs mt-1 block " 51725 ></sonic-event-location-hall> 51726 </div> 51727 </sonic-pop>` : A$1} 51728 </div> 51729 </div> 51730 51731 <div class="text-2xs lg:text-xs pointer-events-none"> 51732 <div class=${this.appType === "counter" ? "block w-full min-h-[1.25rem]" : "contents"}> 51733 <sonic-event-additional-status 51734 variant="ghost" 51735 fetch 51736 size="inherit" 51737 warnAndDangerAsPill 51738 key="data" 51739 endpoint=${this._currentStatusEndpoint} 51740 dataProvider="${this.dataProviderStatusKey}" 51741 lazyload 51742 ></sonic-event-additional-status> 51743 </div> 51744 51745 <sonic-event-taxonomies 51746 size="inherit" 51747 class="pointer-events-none mt-1 ${isCondensed ? "hidden" : ""} " 51748 ></sonic-event-taxonomies> 51749 <sonic-event-location-hall
51750 size="inherit" 51751 noPlacement 51752 class="pointer-events-none block mt-1 ${isCondensed ? "hidden" : ""} " 51753 ></sonic-event-location-hall> 51754 </div> 51755 </div> 51756 <div data-quick-select-slider> 51757 <div data-quick-select-slider-wrapper> 51758 ${c$1( 51759 this._subscriptions, 51760 (subscription) => subscription.id, 51761 (subscription, index) => { 51762 const isLastSubscription = index === this._subscriptions.length - 1; 51763 const isLastFromRow = isLastSubscription && !this._showOtherOwners; 51764 return this.renderSubscriptionPriceItem(subscription, isLastFromRow); 51765 } 51766 )} 51767 ${this._showOtherOwners ? this.renderSubscriptionPriceItem(null, true) : A$1} 51768 </div> 51769 </div> 51770 </div> 51771 `; 51772 } 51773 renderSubscriptionPriceItem(subscription, isLastFromRow) { 51774 const sessionId = this.id; 51775 if (!sessionId) return A$1; 51776 const isSelected = subscription === null ? isOtherOwnersTabId(this.selectedSubscriptionId) : this.selectedSubscriptionId === subscription?.id; 51777 const hiddenOnMobile = !this.isLarge && !isSelected; 51778 if (hiddenOnMobile) return A$1; 51779 return b$1`<div 51780 data-quick-select-slider-item 51781 class="px-2 lg:px-3 py-4 flex border-l items-start border-r 51782 border-dashed border-neutral-200 shrink-0 justify-center 51783 ${this.isFirstRow ? "border-t" : ""} 51784 ${this.isLarge && !isLastFromRow ? "border-r-0" : ""} 51785 ${isLastFromRow ? "border-r" : ""} " 51786 > 51787 <sonic-cart-quick-select-session-prices 51788 class="block w-full text-center max-w-60" 51789 dataProvider=${this._cartProvider} 51790 subDataProvider="data" 51791 ?hasSeatmap=${!!this.props?.settings?.has_seatmap} 51792 .multisessionId=${Number(this.props?.multisession?.id) || void 0} 51793 .priceContext=${{ 51794 entityType: EntityType.Event, 51795 entityId: Number(sessionId), 51796 parentSubscription: subscription, 51797 accessParams: this.accessParams 51798 }} 51799 .infosStatus=${this._infosStatus} 51800 ></sonic-cart-quick-select-session-prices> 51801 </div> `; 51802 } 51803 }; 51804 SonicCartQuickSelectSessionRow.styles = [ 51805 tailwind, 51806 quickSelectSliderCSS, 51807 i$9` 51808 :host { 51809 display: block; 51810 } 51811 :host([isOdd]) { 51812 background: var(--sc-base-50); 51813 } 51814 ` 51815 ]; 51816 __decorateClass$1t([ 51817 n$5({ type: String, attribute: "data-id" }) 51818 ], SonicCartQuickSelectSessionRow.prototype, "id", 2); 51819 __decorateClass$1t([ 51820 c({ context: subscriptionsContext, subscribe: true }), 51821 r$5() 51822 ], SonicCartQuickSelectSessionRow.prototype, "_subscriptions", 2); 51823 __decorateClass$1t([ 51824 n$5({ type: Object }) 51825 ], SonicCartQuickSelectSessionRow.prototype, "_metadata_", 2); 51826 __decorateClass$1t([ 51827 n$5({ type: Boolean }) 51828 ], SonicCartQuickSelectSessionRow.prototype, "isFirstRow", 2); 51829 __decorateClass$1t([ 51830 n$5({ type: Boolean, reflect: true }) 51831 ], SonicCartQuickSelectSessionRow.prototype, "isOdd", 2); 51832 __decorateClass$1t([ 51833 c({ context: isLargeContext, subscribe: true }), 51834 r$5() 51835 ], SonicCartQuickSelectSessionRow.prototype, "isLarge", 2); 51836 __decorateClass$1t([ 51837 c({ context: selectedSubscriptionIdContext, subscribe: true }), 51838 r$5() 51839 ], SonicCartQuickSelectSessionRow.prototype, "selectedSubscriptionId", 2); 51840 __decorateClass$1t([ 51841 bind$1(QUICK_SELECT_DISPLAY_IS_CONDENSED), 51842 r$5() 51843 ], SonicCartQuickSelectSessionRow.prototype, "isCondensed", 2); 51844 __decorateClass$1t([ 51845 c({ context: accessParamsContext, subscribe: true }), 51846 n$5({ type: Object }) 51847 ], SonicCartQuickSelectSessionRow.prototype, "accessParams", 2); 51848 __decorateClass$1t([ 51849 r$5() 51850 ], SonicCartQuickSelectSessionRow.prototype, "_infosStatus", 2); 51851 __decorateClass$1t([ 51852 r$5() 51853 ], SonicCartQuickSelectSessionRow.prototype, "_currentStatusEndpoint", 2); 51854 __decorateClass$1t([ 51855 c({ context: appType, subscribe: true }), 51856 r$5() 51857 ], SonicCartQuickSelectSessionRow.prototype, "appType", 2); 51858 __decorateClass$1t([ 51859 c({ context: showOtherOwnersContext, subscribe: true }), 51860 r$5() 51861 ], SonicCartQuickSelectSessionRow.prototype, "_showOtherOwners", 2); 51862 SonicCartQuickSelectSessionRow = __decorateClass$1t([ 51863 t$3("sonic-cart-quick-select-session-row") 51864 ], SonicCartQuickSelectSessionRow); 51865 var __defProp$1q = Object.defineProperty; 51866 var __getOwnPropDesc$1s = Object.getOwnPropertyDescriptor; 51867 var __decorateClass$1s = (decorators, target, key, kind) => { 51868 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1s(target, key) : target; 51869 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 51870 if (decorator = decorators[i2]) 51871 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 51872 if (kind && result) __defProp$1q(target, key, result); 51873 return result; 51874 }; 51875 const tagName$12 = "sonic-cart-quick-select-show"; 51876 let SonicCartQuickSelectShow = class extends Subscriber$1(i$6) { 51877 constructor() { 51878 super(...arguments); 51879 this.isLarge = false;
51880 this.isCondensed = false; 51881 this.collapsed = false; 51882 } 51883 willUpdate(_changedProperties) { 51884 if (_changedProperties.has("isCondensed") || _changedProperties.has("isLarge")) { 51885 this.collapsed = this.isLarge === false; 51886 } 51887 super.willUpdate(_changedProperties); 51888 } 51889 render() { 51890 return b$1` 51891 <div 51892 class="@container 51893 bg-neutral-0 md:rounded-md 51894 border-b md:border border-neutral-200 hover:border-neutral-400 transition-border duration-300 overflow-hidden" 51895 > 51896 <sonic-product-summary 51897 fixedActions 51898 size="${this.isLarge ? "md" : "sm"}" 51899 class=" px-3 pb-3 md:mb-2 md:px-2 lg:px-3 md:pt-2 md:pb-0 block group" 51900 @click=${() => { 51901 if (this.isLarge && !this.isCondensed) return; 51902 this.collapsed = !this.collapsed; 51903 }} 51904 > 51905 ${!this.isLarge ? b$1`<sonic-button shape="circle" variant="ghost" icon slot="actions" class="group" 51906 ><sonic-icon 51907 class="text-neutral-300 group-hover:text-neutral-500" 51908 name="${this.collapsed ? "chevron-down" : "chevron-up"}" 51909 library="custom" 51910 ></sonic-icon 51911 ></sonic-button>` : A$1} 51912 </sonic-product-summary> 51913 <sonic-list 51914 subDataProvider="sessions" 51915 class="${this.collapsed ? "hidden" : ""}" 51916 .items=${() => b$1`<sonic-cart-quick-select-session-row></sonic-cart-quick-select-session-row>`} 51917 > 51918 </sonic-list> 51919 </div> 51920 `; 51921 } 51922 }; 51923 SonicCartQuickSelectShow.styles = [ 51924 tailwind, 51925 i$9` 51926 :host { 51927 display: block; 51928 } 51929 ` 51930 ]; 51931 __decorateClass$1s([ 51932 c({ context: isLargeContext, subscribe: true }), 51933 r$5() 51934 ], SonicCartQuickSelectShow.prototype, "isLarge", 2); 51935 __decorateClass$1s([ 51936 bind$1(QUICK_SELECT_DISPLAY_IS_CONDENSED), 51937 r$5() 51938 ], SonicCartQuickSelectShow.prototype, "isCondensed", 2); 51939 __decorateClass$1s([ 51940 r$5() 51941 ], SonicCartQuickSelectShow.prototype, "collapsed", 2); 51942 SonicCartQuickSelectShow = __decorateClass$1s([ 51943 t$3(tagName$12) 51944 ], SonicCartQuickSelectShow); 51945 var __defProp$1p = Object.defineProperty; 51946 var __getOwnPropDesc$1r = Object.getOwnPropertyDescriptor; 51947 var __decorateClass$1r = (decorators, target, key, kind) => { 51948 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1r(target, key) : target; 51949 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 51950 if (decorator = decorators[i2]) 51951 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 51952 if (kind && result) __defProp$1p(target, key, result); 51953 return result; 51954 }; 51955 const tagName$11 = "sonic-preferred-quota-selector"; 51956 let PreferredQuotaSelector = class extends i$6 { 51957 constructor() { 51958 super(...arguments); 51959 this._quotas = []; 51960 this._quotaOptions = []; 51961 this.displayLabel = false; 51962 this.canDisplayAll = false; 51963 this.hasFetchOnce = false; 51964 } 51965 async fetchQuotas() { 51966 const api2 = new API(HTML.getApiConfiguration(this)); 51967 const result = await api2.get("quota"); 51968 if (result?.data) { 51969 this._quotas = result.data; 51970 this._quotaOptions = this.quotaToOptions(this._quotas); 51971 if (this.canDisplayAll) { 51972 const allOption = { wording: "Tous les contingentements", value: "all" }; 51973 this._quotaOptions.unshift(allOption); 51974 } 51975 } 51976 this.hasFetchOnce = true; 51977 } 51978 quotaToOptions(quotas) { 51979 const options = quotas.map((quota) => ({ 51980 wording: quota.title ?? "", 51981 value: quota.id?.toString() ?? "" 51982 // selected: quota.id === this.preferred_quota_id, 51983 })); 51984 return options; 51985 } 51986 willUpdate(_changedProperties) { 51987 if (!this.hasFetchOnce) { 51988 this.fetchQuotas(); 51989 } 51990 super.willUpdate(_changedProperties); 51991 } 51992 render() { 51993 if (this._quotaOptions.length === 0) { 51994 return A$1; 51995 } 51996 return b$1` 51997 <sonic-select 51998 @change=${this.handleQuotaChange} 51999 name="preferred_quota_id" 52000 size=${o$4(this.size)} 52001 .options=${this._quotaOptions} 52002 label=${this.displayLabel ? "Contingentement de préférence" : ""} 52003 > 52004 <sonic-icon slot="prefix" library="custom" name="users-v
52004iewfinder"></sonic-icon> 52005 </sonic-select> 52006 `; 52007 } 52008 async handleQuotaChange(event) { 52009 const select2 = event.target; 52010 const quotaId = Number(select2.value); 52011 this.dispatchEvent( 52012 new CustomEvent("quotaChange", { 52013 detail: { 52014 quotaId 52015 } 52016 }) 52017 ); 52018 } 52019 }; 52020 PreferredQuotaSelector.styles = [tailwind]; 52021 __decorateClass$1r([ 52022 r$5() 52023 ], PreferredQuotaSelector.prototype, "_quotas", 2); 52024 __decorateClass$1r([ 52025 r$5() 52026 ], PreferredQuotaSelector.prototype, "_quotaOptions", 2); 52027 __decorateClass$1r([ 52028 n$5({ type: Boolean }) 52029 ], PreferredQuotaSelector.prototype, "displayLabel", 2); 52030 __decorateClass$1r([ 52031 n$5({ type: String }) 52032 ], PreferredQuotaSelector.prototype, "size", 2); 52033 __decorateClass$1r([ 52034 n$5({ type: Boolean }) 52035 ], PreferredQuotaSelector.prototype, "canDisplayAll", 2); 52036 PreferredQuotaSelector = __decorateClass$1r([ 52037 t$3(tagName$11) 52038 ], PreferredQuotaSelector); 52039 var __defProp$1o = Object.defineProperty; 52040 var __getOwnPropDesc$1q = Object.getOwnPropertyDescriptor; 52041 var __decorateClass$1q = (decorators, target, key, kind) => { 52042 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1q(target, key) : target; 52043 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 52044 if (decorator = decorators[i2]) 52045 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 52046 if (kind && result) __defProp$1o(target, key, result); 52047 return result; 52048 }; 52049 const tagName$10 = "sonic-placement-choice"; 52050 let SonicPlacementChoice = class extends Subscriber$1(i$6) { 52051 constructor() { 52052 super(...arguments); 52053 this.formDataProvider = QUICK_SELECT_PLACEMENT_DP; 52054 this.displayMode = "default"; 52055 this.displayDescription = false; 52056 this._placementType = PlacementType.AUTO; 52057 this._hasSeatingModule = false; 52058 this._isApplyingSync = false; 52059 this.handlePreferencesMutation = () => { 52060 if (this._isApplyingSync) { 52061 return; 52062 } 52063 const current2 = dp(this.formDataProvider).get() ?? {}; 52064 if (this.displayMode === "switch") { 52065 const placement_type = normalizeSwitchPlacementType(current2.placement_type); 52066 if (current2.placement_type !== placement_type) { 52067 this.setPlacementType(placement_type, current2); 52068 return; 52069 } 52070 } 52071 this._placementType = current2.placement_type ?? PlacementType.AUTO; 52072 this.saveToStorage(); 52073 }; 52074 } 52075 get _resolvedAppType() { 52076 return resolveAppType$1(this.appType); 52077 } 52078 readPlacementConfigFromDp(appType2) { 52079 const resolvedAppType = resolveAppType$1(appType2); 52080 return resolvedAppType === "counter" ? dp("settings.store_ui.event.placement").get() : dp("settings.customer_ui.event.placement").get(); 52081 } 52082 readSeatingModuleFromDp() { 52083 return dp("settings.modules.seating.enabled").get() === true; 52084 } 52085 /** Lit la config admin depuis le bind ou le dp (fallback si le bind a raté la valeur initiale). */ 52086 get _placementConfig() { 52087 const fromBind = this._resolvedAppType === "counter" ? this._storePlacementConfig : this._customerPlacementConfig; 52088 if (fromBind !== void 0) { 52089 return fromBind; 52090 } 52091 return this.readPlacementConfigFromDp(this.appType); 52092 } 52093 get _seatingModuleEnabled() { 52094 return this._hasSeatingModule || this.readSeatingModuleFromDp(); 52095 } 52096 get _isVisible() { 52097 if (!this.formDataProvider || !this._seatingModuleEnabled) { 52098 return false; 52099 } 52100 if (getVisiblePlacementTypes(this._placementConfig).length === 0) { 52101 return false; 52102 } 52103 if (this.displayMode === "switch") { 52104 return this._resolvedAppType === "counter"; 52105 } 52106 return this._resolvedAppType !== "counter"; 52107 } 52108 get _isPlacementConfigLoaded() { 52109 return this.readPlacementConfigFromDp(this.appType) !== void 0; 52110 } 52111 connectedCallback() { 52112 super.connectedCallback(); 52113 if (!this.formDataProvider) { 52114 return; 52115 } 52116 dp(this.formDataProvider).onInternalMutation(this.handlePreferencesMutation); 52117 this.syncIfReady(); 52118 } 52119 disconnectedCallback() { 52120 if (this.formDataProvider) { 52121 dp(this.formDataProvider).offInternalMutation(this.handlePreferencesMutation); 52122 } 52123 super.disconnectedCallback(); 52124 } 52125 willUpdate(changedProperties) { 52126 if (changedProperties.has("_customerPlacementConfig") || changedProperties.has("_storePlacementConfig") || changedProperties.has("_hasSeatingModule") || changedProperties.has("appType")) { 52127 this.syncIfReady(this._isPlacementConfigLoaded); 52128 } 52129 super.willUpdate(changedProperties); 52130 } 52131 onPlacementSettingsChanged() { 52132 this.syncIfReady(this._isPlacementConfigLoaded); 52133 } 52134 setPlacementType(placement_type, current2 = {}) { 52135 this._isApplyingSync = true;
52136 try { 52137 dp(this.formDataProvider).set({ ...current2, placement_type }); 52138 } finally { 52139 this._isApplyingSync = false; 52140 } 52141 } 52142 syncIfReady(persist = false) { 52143 this.syncFromConfig(persist); 52144 } 52145 syncFromConfig(persist = false) { 52146 let { placement_type } = resolvePlacementPreferences(this._placementConfig, this.readFromStorage()); 52147 if (this.displayMode === "switch") { 52148 placement_type = normalizeSwitchPlacementType(placement_type); 52149 } 52150 const current2 = dp(this.formDataProvider).get() ?? {}; 52151 if (placement_type !== current2.placement_type) { 52152 this.setPlacementType(placement_type, current2); 52153 } 52154 this._placementType = placement_type; 52155 if (persist) { 52156 this.saveToStorage(); 52157 } 52158 } 52159 readFromStorage() { 52160 try { 52161 return JSON.parse(localStorage.getItem(this.formDataProvider) ?? "{}"); 52162 } catch { 52163 return {}; 52164 } 52165 } 52166 saveToStorage() { 52167 const preferences = dp(this.formDataProvider).get(); 52168 if (!preferences) { 52169 return; 52170 } 52171 localStorage.setItem(this.formDataProvider, JSON.stringify(preferences)); 52172 } 52173 render() { 52174 if (!this._isVisible) { 52175 return A$1; 52176 } 52177 if (this.displayMode === "switch") { 52178 return this.renderSwitch(); 52179 } 52180 const visiblePlacementTypes = getVisiblePlacementTypes(this._placementConfig); 52181 return b$1` 52182 <div class="@container"> 52183 <div class="flex flex-col @sm:flex-row gap-1 "> 52184 ${visiblePlacementTypes.map((placementType) => this.renderPlacementTypeChoiceButton(placementType))} 52185 </div> 52186 </div> 52187 `; 52188 } 52189 renderSwitch() { 52190 if (this._customerPlacementConfig === void 0 || this._storePlacementConfig === void 0) { 52191 const customerConfig = this.readPlacementConfigFromDp("customer"); 52192 const storeConfig = this.readPlacementConfigFromDp("counter"); 52193 if (customerConfig === void 0 || storeConfig === void 0) { 52194 return A$1; 52195 } 52196 } 52197 const isAuto = this._placementType === PlacementType.AUTO; 52198 return b$1` 52199 <sonic-switch 52200 formDataProvider="${this.formDataProvider}" 52201 dataProvider="${this.formDataProvider}" 52202 value="${PlacementType.AUTO}" 52203 class="font-bold" 52204 name="placement_type" 52205 > 52206 <span class=${isAuto ? "text-content" : "text-neutral-400"}> 52207 <sonic-icon name="sparkles" library="custom"></sonic-icon> ${t("LIB_placement_auto_short")} 52208 </span> 52209 </sonic-switch> 52210 `; 52211 } 52212 renderPlacementTypeChoiceButton(placementType) { 52213 const isAuto = placementType === PlacementType.AUTO; 52214 const iconName = isAuto ? "sparkles" : "loveseat"; 52215 const label2 = isAuto ? t("LIB_placement_auto") : t("LIB_placement_manuel"); 52216 const description2 = isAuto ? t("LIB_placement_auto_customer_help_text") : t("LIB_placement_manuel_customer_help_text"); 52217 return b$1` 52218 <sonic-button 52219 radio 52220 formDataProvider="${this.formDataProvider}" 52221 dataProvider="${this.formDataProvider}" 52222 value="${placementType}" 52223 shape="block" 52224 class="text-sm @xl:text-base font-bold @xl:max-w-[30rem] grow min-w-0" 52225 name="placement_type" 52226 align="left" 52227 size="inherit" 52228 > 52229 <sonic-icon 52230 class="self-start mt-2" 52231 swap="off" 52232 name="circle" 52233 library="custom" 52234 slot="prefix" 52235 size="lg" 52236 ></sonic-icon> 52237 <sonic-icon 52238 class="self-start mt-2" 52239 swap="on" 52240 name="circle-check" 52241 library="custom" 52242 slot="prefix" 52243 size="lg" 52244 ></sonic-icon> 52245 <div class="flex items-center gap-2 min-h-[2.1em] grow min-w-0"> 52246 <sonic-icon name="${iconName}" library="custom" slot="prefix" size="lg"></sonic-icon> 52247 <span class="block font-bold">${label2}</span> 52248 </div> 52249 ${this.displayDescription ? b$1` <span class="text-xs @xl:text-sm mt-2 border-t text-pretty py-3 hidden @xl:block" 52250 >${description2}</span 52251 >` : A$1} 52252 </sonic-button> 52253 `; 52254 } 52255 }; 52256 SonicPlacementChoice.styles = [ 52257 tailwind, 52258 i$9` 52259 :host { 52260 display: block; 52261 } 52262 ` 52263 ]; 52264 __decorateClass$1q([ 52265 n$5({ type: String }) 52266 ], SonicPlacementChoice.prototype, "formDataProvider", 2); 52267 __decorateClass$1q([ 52268 n$5({ type: String }) 52269 ], SonicPlacementChoice.prototype, "displayMode", 2); 52270 __decorateClass$1q([ 52271 n$5({ type: Boolean }) 52272 ], SonicPlacementChoice.prototype, "displayDescription", 2); 52273 __decorateClass$1q([ 52274 r$5() 52275 ], SonicPlacementChoice.prototype, "_placementType", 2); 52276 __decorateClass$1q([ 52277 c({ context: appType, subscribe: true }), 52278 r$5() 52279 ], SonicPlacementChoice.prototype, "appType", 2); 52280 __decorateClass$1q([ 52281 bind$1("settings.modules.seating.enabled"), 52282 r$5() 52283 ], SonicPlacementChoice.prototype, "_hasSeatingModule", 2); 52284 __decorateClass$1q([ 52285 bind$1("settings.customer_ui.event.placement"), 52286 r$5()
52287 ], SonicPlacementChoice.prototype, "_customerPlacementConfig", 2); 52288 __decorateClass$1q([ 52289 bind$1("settings.store_ui.event.placement"), 52290 r$5() 52291 ], SonicPlacementChoice.prototype, "_storePlacementConfig", 2); 52292 __decorateClass$1q([ 52293 onAssign$1( 52294 "settings.modules.seating.enabled", 52295 "settings.customer_ui.event.placement", 52296 "settings.store_ui.event.placement" 52297 ) 52298 ], SonicPlacementChoice.prototype, "onPlacementSettingsChanged", 1); 52299 SonicPlacementChoice = __decorateClass$1q([ 52300 t$3(tagName$10) 52301 ], SonicPlacementChoice); 52302 var __defProp$1n = Object.defineProperty; 52303 var __getOwnPropDesc$1p = Object.getOwnPropertyDescriptor; 52304 var __decorateClass$1p = (decorators, target, key, kind) => { 52305 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1p(target, key) : target; 52306 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 52307 if (decorator = decorators[i2]) 52308 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 52309 if (kind && result) __defProp$1n(target, key, result); 52310 return result; 52311 }; 52312 const tagName$$ = "sonic-quick-select-display-toggle"; 52313 let SonicQuickSelectDisplayToggle = class extends Subscriber$1(i$6) { 52314 constructor() { 52315 super(...arguments); 52316 this.formDataProvider = QUICK_SELECT_DISPLAY_DP; 52317 this._isCondensed = false; 52318 } 52319 connectedCallback() { 52320 super.connectedCallback(); 52321 if (!this.formDataProvider) { 52322 return; 52323 } 52324 this.loadFromStorage(); 52325 } 52326 onIsCondensedChanged(isCondensed) { 52327 if (!this.formDataProvider) { 52328 return; 52329 } 52330 localStorage.setItem(this.formDataProvider, JSON.stringify({ isCondensed: isCondensed ?? false })); 52331 } 52332 loadFromStorage() { 52333 const stored = this.readFromStorage(); 52334 dp(this.formDataProvider).set({ 52335 isCondensed: stored.isCondensed ?? false 52336 }); 52337 } 52338 readFromStorage() { 52339 try { 52340 return JSON.parse(localStorage.getItem(this.formDataProvider) ?? "{}"); 52341 } catch { 52342 return {}; 52343 } 52344 } 52345 render() { 52346 if (this.appType !== "counter") { 52347 return A$1; 52348 } 52349 return b$1` 52350 <sonic-switch 52351 formDataProvider="${this.formDataProvider}" 52352 dataProvider="${this.formDataProvider}" 52353 value="true" 52354 class="font-bold" 52355 name="isCondensed" 52356 > 52357 <span class=${this._isCondensed ? "text-content" : "text-neutral-400"}> 52358 <sonic-icon name="bars" library="custom"></sonic-icon> Condensé 52359 </span> 52360 </sonic-switch> 52361 `; 52362 } 52363 }; 52364 SonicQuickSelectDisplayToggle.styles = [ 52365 tailwind, 52366 i$9` 52367 :host { 52368 display: block; 52369 } 52370 ` 52371 ]; 52372 __decorateClass$1p([ 52373 n$5({ type: String }) 52374 ], SonicQuickSelectDisplayToggle.prototype, "formDataProvider", 2); 52375 __decorateClass$1p([ 52376 c({ context: appType, subscribe: true }) 52377 ], SonicQuickSelectDisplayToggle.prototype, "appType", 2); 52378 __decorateClass$1p([ 52379 bind(quickSelectDisplayFormKey.isCondensed), 52380 r$5() 52381 ], SonicQuickSelectDisplayToggle.prototype, "_isCondensed", 2); 52382 __decorateClass$1p([ 52383 handle(quickSelectDisplayFormKey.isCondensed) 52384 ], SonicQuickSelectDisplayToggle.prototype, "onIsCondensedChanged", 1); 52385 SonicQuickSelectDisplayToggle = __decorateClass$1p([ 52386 t$3(tagName$$) 52387 ], SonicQuickSelectDisplayToggle); 52388 var __defProp$1m = Object.defineProperty; 52389 var __getOwnPropDesc$1o = Object.getOwnPropertyDescriptor; 52390 var __decorateClass$1o = (decorators, target, key, kind) => { 52391 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1o(target, key) : target; 52392 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 52393 if (decorator = decorators[i2]) 52394 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 52395 if (kind && result) __defProp$1m(target, key, result); 52396 return result; 52397 }; 52398 let SonicCartQuickSelectSubscriptionSummary = class extends Subscriber$1(i$6) { 52399 constructor() { 52400 super(...arguments); 52401 this.cartProvider = "cart/current"; 52402 this._groupedItem = []; 52403 } 52404 willUpdate(_changedProperties) { 52405 super.willUpdate(_changedProperties); 52406 if (_changedProperties.has("subscription") || _changedProperties.has("props")) { 52407 if (this.subscription) { 52408 const clonedItems = structuredClone(this.props?.items || []); 52409 const items = clonedItems.filter((item) => item.id === this.subscription?.id || item.parent_id === this.subscription?.id) || []; 52410 const entities = this.props?.entities || []; 52411 this._groupedItem = groupItemsByEntity(items, entities); 52412 } 52413 } 52414 } 52415 render() { 52416 return b$1`<sonic-cart-item-line-subscribe 52417 cartProvider=${o$4(this.cartProvider || void 0)} 52418 dataProvider="${this.cartProvider}/subSummary/${this.subscription?.id}" 52419 showDetail 52420 fullWidth 52421 noSubscriptionActions 52422 .props=${this._groupedItem[0]} 52423 ></sonic-cart-item-line-subscribe>`; 52424 } 52425 }; 52426 __decorateClass$1o([ 52427 ancestorAttribute("cartProvider") 52428 ], SonicCartQuickSelectSubscriptionSummary.prototype, "cartProvider", 2); 52429 __decorateClass$1o([ 52430 n$5({ type: Object }) 52431 ], SonicCartQuickSelectSubscriptionSummary.prototype, "subscription", 2); 52432 __decorateClass$1o([ 52433 r$5() 52434 ], SonicCartQuickSelectSubscriptionSummary.prototype, "_groupedItem", 2); 52435 SonicCartQuickSelectSubscriptionSummary = __decorateClass$1o([ 52436 t$3("sonic-cart-quick-select-subscription-summary") 52437 ], SonicCartQuickSelectSubscriptionSummary); 52438 var __defProp$1l = Object.defineProperty; 52439 var __getOwnPropDesc$1n = Object.getOwnPropertyDescriptor; 52440 var __decorateClass$1n = (decorators, target, key, kind) => { 52441 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1n(target, key) : target; 52442 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 52443 if (decorator = decorators[i2]) 52444 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 52445 if (kind && result) __defProp$1l(target, key, result); 52446 return result; 52447 }; 52448 let instanceCounter$3 = 0; 52449 const tagName$_ = "sonic-cart-quick-select"; 52450 let SonicCartQuickSelect = class extends Subscriber$1(i$6) { 52451 constructor() { 52452 super(...arguments); 52453 this._dpSessionFilters = "subTypeSessionsFilters" + instanceCounter$3++; 52454 this.items = []; 52455 this.linked_subscriptions = []; 52456 this.cartType = CartType.Cart; 52457 this.entities = []; 52458 this._modal = null; 52459 this._subscriptions = []; 52460 this.tabs = []; 52461 this._resizeController = new h$1(this, { 52462 callback: () => { 52463 this.isLarge = this.clientWidth > 768; 52464 if (this.isLarge) { 52465 this.updateSliderOffset(); 52466 } 52467 } 52468 }); 52469 this.isLarge = false;
52470 this.allSubscriptionsAreValid = false; 52471 this._sliderInitialized = false; 52472 this._showOtherOwners = false; 52473 this.handleWaitingListRefresh = () => { 52474 void this.refreshWaitingListEntries(); 52475 }; 52476 this.handleWaitingListUpdated = () => { 52477 void this.refreshWaitingListEntries(); 52478 }; 52479 this.sliderIndex = 0; 52480 } 52481 setTabs(showOtherOwners) { 52482 const subscriptionTabs = this._subscriptions.filter((sub2) => sub2.id).map((sub2) => ({ 52483 id: sub2.id, 52484 type: "subscription", 52485 subscriptionItem: sub2 52486 })); 52487 this.tabs = showOtherOwners ? [ 52488 ...subscriptionTabs, 52489 { 52490 id: OTHER_OWNERS_TAB_ID, 52491 type: OTHER_OWNERS_TAB_ID 52492 } 52493 ] : subscriptionTabs; 52494 } 52495 getStickyTopValue() { 52496 const parentModal = this.closest("#modal"); 52497 if (!parentModal) return 0; 52498 const modalPaddingTop = getComputedStyle(parentModal).paddingTop; 52499 const paddingTopValue = parseInt(modalPaddingTop); 52500 const negativePaddingTop = paddingTopValue ? `-${paddingTopValue}px` : "0px"; 52501 return negativePaddingTop; 52502 } 52503 async willUpdate(changedProperties) { 52504 if (changedProperties.has("items") || changedProperties.has("linked_subscriptions") || changedProperties.has("subscriptionRequirement") || changedProperties.has("appType")) { 52505 this._subscriptions = getCartSubscriptions({ items: this.items, linked_subscriptions: this.linked_subscriptions }); 52506 this.allSubscriptionsAreValid = this._subscriptions && this._subscriptions.length > 0 && this._subscriptions.every((sub2) => !sub2.has_error_linked_events); 52507 const { subscriptionRequirement, disallowEventsForSoldSubscription } = this.settings || {}; 52508 const onlyNewSubscriptionAllowed = isSubscriptionRequired(subscriptionRequirement, this.appType) && disallowEventsForSoldSubscription?.active; 52509 const hasItemsNeedingOtherOwners = !onlyNewSubscriptionAllowed || this.items.some( 52510 (item) => item.entity_type === EntityType.Event && item.price?.need_subscription && !item.parent_id 52511 ); 52512 this._showOtherOwners = hasItemsNeedingOtherOwners; 52513 this.setTabs(this._showOtherOwners); 52514 void this.refreshWaitingListEntries(); 52515 } 52516 if (changedProperties.has("loggedUserId") || changedProperties.has("appType")) { 52517 void this.refreshWaitingListEntries(); 52518 } 52519 if (changedProperties.has("_subscriptions")) { 52520 const newQueueExpression = this.queueExpression(); 52521 if (newQueueExpression !== this._queueDpExpression) { 52522 this._queueDpExpression = newQueueExpression; 52523 } 52524 const isOtherOwnersSelected = isOtherOwnersTabId(this.selectedSubscriptionId); 52525 const selectedSubscriptionNotFound = !isOtherOwnersSelected && this._subscriptions.findIndex((sub2) => sub2.id === this.selectedSubscriptionId) === -1; 52526 if ((selectedSubscriptionNotFound || !this.selectedSubscriptionId) && this._subscriptions.length > 0) { 52527 this.selectedSubscriptionId = this._subscriptions[0].id; 52528 } 52529 } 52530 if (changedProperties.has("selectedSubscriptionId")) { 52531 this.initSliderIndex(); 52532 } 52533 super.willUpdate(changedProperties); 52534 } 52535 updated(changedProperties) { 52536 if (!this._sliderInitialized) { 52537 this.updateSliderOffset(); 52538 } 52539 super.updated(changedProperties); 52540 } 52541 connectedCallback() { 52542 dp("toastSettings").muteCartSuccessMessages.set(true); 52543 super.connectedCallback(); 52544 this.addEventListener("waiting-list-updated", this.handleWaitingListUpdated); 52545 const cartProvider = this.cartProvider || "cart/current"; 52546 dp(cartProvider).data.onInternalMutation(this.handleWaitingListRefresh); 52547 void this.refreshWaitingListEntries(); 52548 } 52549 disconnectedCallback() { 52550 dp("toastSettings").muteCartSuccessMessages.set(false); 52551 this.removeEventListener("waiting-list-updated", this.handleWaitingListUpdated); 52552 const cartProvider = this.cartProvider || "cart/current"; 52553 dp(cartProvider).data.offInternalMutation(this.handleWaitingListRefresh); 52554 super.disconnectedCallback(); 52555 } 52556 refreshWaitingListEntries() { 52557 void refreshWaitingListTunnelEntries(this, { 52558 cartProvider: this.cartProvider || "cart/current", 52559 appType: this.appType, 52560 loggedUserId: this.loggedUserId, 52561 apiConfiguration: this.getApiConfiguration() 52562 }); 52563 } 52564 firstUpdated(_changedProperties) { 52565 if (this.isLarge && this.appType !== "counter") { 52566 dp(QUICK_SELECT_DISPLAY_DP).isCondensed.set(false); 52567 } 52568 } 52569 renderAddSubscriptionButton(size = "md", variant = "outline") {
52570 return b$1`<sonic-divider> 52571 <sonic-cart-add-entity 52572 align="left" 52573 .entityType=${EntityType.Subscribe} 52574 class="block w-full" 52575 variant=${variant} 52576 type="success" 52577 size=${size} 52578 > 52579 <sonic-icon name="circle-plus" library="custom" slot="icon"></sonic-icon> </sonic-cart-add-entity 52580 ></sonic-divider>`; 52581 } 52582 render() { 52583 const isCounter = this.appType === "counter"; 52584 const displayQuotaSelector = isCounter; 52585 const noSubscriptionOrOtherOwner = !this.tabs.length; 52586 if (noSubscriptionOrOtherOwner) { 52587 return this.renderAddSubscriptionButton("lg"); 52588 } 52589 return b$1` 52590 ${!isCounter ? b$1`<sonic-placement-choice 52591 formDataProvider="${QUICK_SELECT_PLACEMENT_DP}" 52592 displayDescription 52593 class="mb-5" 52594 ></sonic-placement-choice>` : A$1} 52595 <div> 52596 <div id="SubSessionFormContainer" class="mb-5 flex gap-4 flex-wrap items-center relative z-[3]"> 52597 <sonic-form-event-filter 52598 dataProvider="${this._dpSessionFilters}" 52599 formDataProvider="${this._dpSessionFilters}" 52600 class="block w-full z-[2] min-w-0 ${displayQuotaSelector ? "max-w-[64rem]" : "max-w-[35rem]"}" 52601 filterCategory 52602 > 52603 ${displayQuotaSelector ? b$1` 52604 <div class="flex items-center" slot="formSuffix"> 52605 <sonic-divider vertical class="mx-4 hidden lg:block"></sonic-divider> 52606 <sonic-subscriber 52607 localStorage="enabled" 52608 dataProvider="admin_form_preferred_quota" 52609 ></sonic-subscriber> 52610 <sonic-preferred-quota-selector 52611 dataProvider="admin_form_preferred_quota" 52612 formDataProvider="admin_form_preferred_quota" 52613 ></sonic-preferred-quota-selector> 52614 </div> 52615 ` : A$1} 52616 </sonic-form-event-filter> 52617 </div> 52618 52619 ${this.renderHeader()} ${this.renderAddSubscriptionButton("sm", "ghost")} 52620 52621 <sonic-queue 52622 dataProviderExpression="${o$4(this._queueDpExpression)}" 52623 key="data" 52624 limit="4" 52625 targetRequestDuration="1000" 52626 dataFilterProvider="${this._dpSessionFilters}" 52627 class="mb-10 min-h-[40vh] relative z-[1] -mx-[--sc-modal-px] lg:-mx-0" 52628 .items=${() => b$1`<sonic-cart-quick-select-show 52629 class="${this.isLarge ? "mb-5" : "mb-3"} " 52630 ></sonic-cart-quick-select-show>`} 52631 .noItems=${() => b$1`<sonic-no-result class="py-12 px-6 block"></sonic-no-result>`} 52632 > 52633 </sonic-queue> 52634 52635 ${this.renderFooter()} 52636 </div> 52637 `; 52638 } 52639 renderHeader() { 52640 return b$1` 52641 <div 52642 class="sticky z-[2] flex mb-5 52643 ${this.isLarge ? "rounded-md border-neutral-200 border" : " border-t border-b border-neutral-200"} 52644 bg-neutral-0 shadow-lg -mx-[--sc-modal-px] lg:-mx-0 " 52645 style="top: ${this.getStickyTopValue()}" 52646 > 52647 ${this.isLarge ? this.renderDesktopHeader() : this.renderMobileHeader()} 52648 </div> 52649 `; 52650 } 52651 renderFooter() { 52652 const isValid = this.allSubscriptionsAreValid; 52653 const oneItemHasSeat = this.items?.some((item) => item.seat?.id); 52654 const hasEventTickets = this.items?.some((item) => item.entity_type === EntityType.Event); 52655 if (!hasEventTickets || !isValid) return A$1; 52656 return b$1` 52657 <div class="sticky z-[2] bottom-0 w-full"> 52658 <div 52659 class=" 52660 flex gap-2 items-center justify-center 52661 bg-neutral-0 py-3 shadow-[0_-1rem_1rem_-1rem_rgba(0,0,0,0.1)] 52662 -mx-[--sc-modal-px] px-3 lg:px-[--sc-modal-px] 52663 text-pretty 52664 " 52665 > 52666 ${isValid && oneItemHasSeat ? b$1` 52667 <sonic-button 52668 shape="block" 52669 type="info" 52670 variant="outline" 52671 @click=${async () => { 52672 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 52673 await parentModal?.hide(); 52674 if (this.cartProvider) { 52675 editSeatsModal({ cartProvider: this.cartProvider, accessParams: this.accessParams }); 52676 } 52677 }} 52678 > 52679 ${this.isLarge ? b$1`<sonic-icon library="custom" name="loveseat" size="lg"></sonic-icon>` : A$1}
52680 <span class="font-bold"> ${t("LIB_validate_and_check_seats")} </span> 52681 </sonic-button> 52682 ` : A$1} 52683 ${isValid && hasEventTickets ? b$1` 52684 <sonic-button 52685 shape="block" 52686 type="success" 52687 @click=${async () => { 52688 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 52689 await parentModal?.hide(); 52690 if (this.cartType === CartType.Cart && !appRoute("cart").matchesCurrentPath()) { 52691 appRoute("cart").goTo(); 52692 } else if (this.cartType === CartType.Reservation && this.cartProvider && !appRoute("reservation").fill({ id: dp(this.cartProvider).data.id.get() }).matchesCurrentPath()) { 52693 appRoute("reservation").fill({ id: dp(this.cartProvider).data.id.get() }).goTo(); 52694 } 52695 }} 52696 > 52697 ${this.isLarge ? b$1`<sonic-icon library="custom" name="check" size="lg"></sonic-icon>` : A$1} 52698 <span class="font-bold"> 52699 ${this.cartType === CartType.Reservation ? t("LIB_validate_and_go_to_reservation") : t("LIB_validate_and_go_to_cart")} 52700 </span> 52701 </sonic-button> 52702 ` : A$1} 52703 </div> 52704 </div> 52705 `; 52706 } 52707 initSliderIndex() { 52708 const currentIndex = this.tabs.findIndex((tab) => tab.id === this.selectedSubscriptionId); 52709 this.sliderIndex = Math.max(currentIndex, 0); 52710 } 52711 previous() { 52712 this.sliderIndex = Math.max(this.sliderIndex - 1, 0); 52713 this.updateSliderOffset(); 52714 } 52715 next() { 52716 const maxIndex = this.tabs.length - 1; 52717 this.sliderIndex = Math.min(this.sliderIndex + 1, maxIndex); 52718 this.updateSliderOffset(); 52719 } 52720 updateSliderOffset() { 52721 const sliderWrapper = this.shadowRoot?.querySelector("[data-quick-select-slider-wrapper]"); 52722 const sliderItems = this.shadowRoot?.querySelectorAll("[data-quick-select-slider-item]"); 52723 if (!sliderWrapper || !sliderItems.length) return; 52724 const targetItem = sliderItems[this.sliderIndex]; 52725 if (!targetItem) return; 52726 const wrapperRect = sliderWrapper.getBoundingClientRect(); 52727 const itemRect = targetItem.getBoundingClientRect(); 52728 const offset = wrapperRect.left - itemRect.left; 52729 this.style.setProperty("--quick-select-slider-offset", `${offset}px`); 52730 this._sliderInitialized = true; 52731 } 52732 renderDesktopHeader() { 52733 const displaySliderButtons = this.tabs.length > 1; 52734 const isCounter = this.appType === "counter"; 52735 return b$1`<div class="w-[--_event-width] px-2 lg:px-3 py-4 shrink-0 flex gap-2 items-center justify-center "> 52736 ${isCounter ? b$1` 52737 <div class="mr-auto flex flex-col gap-1"> 52738 <sonic-placement-choice 52739 displayMode="switch" 52740 formDataProvider="${QUICK_SELECT_PLACEMENT_DP}" 52741 ></sonic-placement-choice> 52742 <sonic-quick-select-display-toggle></sonic-quick-select-display-toggle> 52743 </div> 52744 ` : A$1} 52745 <div class="flex items-center gap-2 ${isCounter ? "ml-auto" : ""} ${displaySliderButtons ? "" : "hidden"}"> 52746 <sonic-button 52747 noAutoFill 52748 shape="circle" 52749 icon 52750 size="sm" 52751 @click=${() => this.previous()} 52752 ?disabled=${this.sliderIndex === 0} 52753 > 52754 <sonic-icon name="chevron-left" library="custom"></sonic-icon> 52755 </sonic-button> 52756 <sonic-divider vertical noMargin></sonic-divider> 52757 <sonic-button 52758 noAutoFill 52759 shape="circle" 52760 icon 52761 size="sm" 52762 @click=${() => this.next()} 52763 ?disabled=${this.sliderIndex === this.tabs.length - 1} 52764 > 52765 <sonic-icon name="chevron-right" library="custom"></sonic-icon> 52766 </sonic-button> 52767 </div> 52768 </div> 52769 <div data-quick-select-slider class="rounded-tr-md rounded-br-md"> 52770 <div data-quick-select-slider-wrapper> 52771 ${c$1( 52772 this.tabs, 52773 (tab) => tab.id, 52774 (tab, index) => { 52775 const isLast = index === this.tabs.length - 1; 52776 if (tab.type === OTHER_OWNERS_TAB_ID) { 52777 return b$1` 52778 <div 52779 data-quick-select-slider-item 52780 class="text-sm bg-neutral-0 font-medium border-l 52781 border-neutral-200 border-dashed text-center 52782 ${isLast ? "border-r" : ""}" 52783 > 52784 <div class="block font-bold">${t("LIB_other_owners")}</div> 52785 </div> 52786 `; 52787 } 52788 return b$1` 52789 <div 52790 data-quick-select-slider-item 52791 class=" 52792 bg-neutral-0 font-medium border-l 52793 border-neutral-200 border-dashed text-center 52794 ${isLast ? "border-r" : ""} 52795 " 52796 > 52797 ${tab.subscriptionItem ? this.renderHeaderItem(tab.subscriptionItem, "center") : A$1} 52798 </div> 52799 `; 52800 } 52801 )} 52802 </div> 52803 </div>`; 52804 } 52805 renderMobileHeader() { 52806 const selectedTab = this.tabs.find((tab) => tab.id === this.selectedSubscriptionId); 52807 if (!selectedTab) return b$1`<div class="p-3 w-full"></div>`; 52808 if (selectedTab.type === OTHER_OWNERS_TAB_ID) { 52809 return b$1` 52810 <div class="p-3 w-full"> 52811 <div class="">
52812 <span class="block font-bold mb-2">${t("LIB_other_owners")}</span> 52813 </div> 52814 <div class="flex items-center gap-1 ">${this.renderTabsPop()}</div> 52815 </div> 52816 `; 52817 } 52818 const selectedSubscription = selectedTab.subscriptionItem; 52819 return b$1` 52820 <div class="p-3 w-full">${selectedSubscription ? this.renderHeaderItem(selectedSubscription, "left") : ""}</div> 52821 `; 52822 } 52823 selectSubscription(subscriptionItem) { 52824 this.selectedSubscriptionId = subscriptionItem.id; 52825 } 52826 renderTabsPop() { 52827 if (this.tabs.length <= 1 || this.isLarge) return A$1; 52828 return b$1` 52829 <sonic-pop class="grow max-w-40"> 52830 <sonic-button size="xs" shape="block" type="info"> 52831 ${t("owners")} <sonic-icon name="chevron-down" library="custom" slot="suffix"></sonic-icon> 52832 </sonic-button> 52833 <sonic-menu 52834 slot="content" 52835 minWidth="14rem" 52836 class="max-h-[40vh] overflow-y-auto custom-scroll" 52837 direction="column" 52838 > 52839 ${c$1( 52840 this.tabs, 52841 (tab) => tab.id, 52842 (tab, index) => { 52843 const isLast = index === this.tabs.length - 1; 52844 if (tab.type === OTHER_OWNERS_TAB_ID) { 52845 const isCurrent2 = isOtherOwnersTabId(this.selectedSubscriptionId); 52846 return b$1`<sonic-menu-item 52847 size="sm" 52848 ?active=${isCurrent2} 52849 @click=${() => { 52850 this.selectedSubscriptionId = OTHER_OWNERS_TAB_ID; 52851 }} 52852 > 52853 <sonic-icon 52854 name="${isCurrent2 ? "circle-check" : "circle"}" 52855 slot="prefix" 52856 library="custom" 52857 size="lg" 52858 ></sonic-icon> 52859 <div class="font-bold text-sm whitespace-nowrap">${t("LIB_other_owners")}</div> 52860 </sonic-menu-item> 52861 ${!isLast && this.tabs.length > 1 ? b$1`<sonic-divider class="my-0"></sonic-divider>` : A$1}`; 52862 } 52863 const subscriptionItem = tab.subscriptionItem; 52864 if (!subscriptionItem) return A$1; 52865 const { id, owner } = subscriptionItem || {}; 52866 const { firstName, lastName } = owner || {}; 52867 const isCurrent = id === this.selectedSubscriptionId; 52868 const hasError = subscriptionItem.has_error_linked_events; 52869 const isAnonymous = !firstName && !lastName; 52870 return b$1`<sonic-menu-item 52871 size="sm" 52872 ?active=${isCurrent} 52873 @click=${() => this.selectSubscription(subscriptionItem)} 52874 > 52875 <sonic-icon 52876 name="${isCurrent ? "circle-check" : "circle"}" 52877 slot="prefix" 52878 library="custom" 52879 class="self-start mt-1" 52880 size="lg" 52881 ></sonic-icon> 52882 52883 <div class="font-bold text-sm whitespace-nowrap mt-1"> 52884 ${isAnonymous ? t("Anonyme") : b$1`${firstName} <span class="uppercase">${lastName}</span>`} 52885 </div> 52886 <div class="text-xs mt-1 mb-2">${this.getSubscriptionName(subscriptionItem)}</div> 52887 52888 ${hasError ? b$1`<sonic-icon 52889 name="triangle-exclamation" 52890 library="custom" 52891 slot="suffix" 52892 prefix="solid" 52893 class="text-danger ml-left" 52894 size="lg" 52895 ></sonic-icon>` : A$1} 52896 </sonic-menu-item> `; 52897 } 52898 )} 52899 </sonic-menu> 52900 </sonic-pop> 52901 `; 52902 } 52903 renderHeaderItem(subscriptionItem, align = "center") { 52904 const { has_error_linked_events, has_error_owner, has_error_proof } = subscriptionItem; 52905 const firstName = subscriptionItem?.owner?.firstName; 52906 const lastName = subscriptionItem?.owner?.lastName; 52907 const isAnonymous = !firstName && !lastName; 52908 const isPrePurchased = isPrePurchaseSubscription(subscriptionItem); 52909 const displayOwnerButton = !isPrePurchased; 52910 const displayProofButton = !isPrePurchased && subscriptionItem.price?.
52910need_proof_of_identity; 52911 const title = isAnonymous ? t("Anonyme") : b$1`${firstName} ${lastName}`; 52912 return b$1` 52913 <div class="${align === "left" ? "text-left" : "text-center"}"> 52914 <button 52915 class="group block w-full ${align === "left" ? "text-left" : "text-center"}" 52916 @click=${() => { 52917 if (isPrePurchased) { 52918 return; 52919 } 52920 editSubscriptionOwnerModal({ 52921 lineItem: subscriptionItem, 52922 cartProvider: this.cartProvider, 52923 accessParams: this.accessParams 52924 }); 52925 }} 52926 > 52927 <div 52928 class="text-base md:text-sm ${isPrePurchased ? "" : "group-hover:underline underline-offset-2"} truncate font-bold min-h-[1.15em]" 52929 > 52930 ${title} 52931 </div> 52932 </button> 52933 52934 <div class="truncate mt-1 mb-1 min-h-[1.15em] text-xs">${this.getSubscriptionName(subscriptionItem)}</div> 52935 <div class="flex items-center gap-1 ${this.isLarge ? "justify-center" : ""}"> 52936 ${displayOwnerButton ? b$1` 52937 <sonic-tooltip label=${t("owner")} ?disabled=${!this.isLarge}> 52938 <sonic-button 52939 size="xs" 52940 shape="square" 52941 variant="${has_error_owner ? "outline" : "default"}" 52942 type="${has_error_owner ? "danger" : "neutral"}" 52943 @click=${() => editSubscriptionOwnerModal({ 52944 lineItem: subscriptionItem, 52945 cartProvider: this.cartProvider, 52946 accessParams: this.accessParams 52947 })} 52948 > 52949 <sonic-icon name="id-card" library="custom"></sonic-icon> 52950 </sonic-button> 52951 </sonic-tooltip> 52952 ` : A$1} 52953 ${displayProofButton ? b$1` 52954 <sonic-tooltip label=${t("LIB_add_proof")} ?disabled=${!this.isLarge}> 52955 <sonic-button 52956 size="xs" 52957 shape="square" 52958 variant="${has_error_proof ? "outline" : "default"}" 52959 type="${has_error_proof ? "danger" : "neutral"}" 52960 @click=${() => addProofModal({ 52961 lineItem: subscriptionItem, 52962 cartProvider: this.cartProvider, 52963 accessParams: this.accessParams 52964 })} 52965 > 52966 <sonic-icon name="file-arrow-up" library="custom"></sonic-icon> 52967 </sonic-button> 52968 </sonic-tooltip> 52969 ` : A$1} 52970 <sonic-tooltip label=${t("LIB_summary")} ?disabled=${!this.isLarge}> 52971 <sonic-button 52972 size="xs" 52973 variant="default" 52974 type="${has_error_linked_events ? "danger" : "success"}" 52975 class="mt-auto" 52976 @click=${() => this.displaySummary(subscriptionItem)} 52977 > 52978 <sonic-icon name="ticket" library="custom"></sonic-icon> 52979 <span class="min-w-[2ch] inline-block"> ${this.countSubscriptionSessions(subscriptionItem.id)} </span> 52980 <sonic-icon 52981 ${F({ in: v })} 52982 name="${has_error_linked_events ? "triangle-exclamation" : "thumbs-up"}" 52983 class="${has_error_linked_events ? "animate-pulse" : ""}" 52984 prefix="solid" 52985 library="custom" 52986 ></sonic-icon> 52987 </sonic-button> 52988 </sonic-tooltip> 52989 52990 <sonic-tooltip label=${t("LIB_remove")} class="ml-2"> 52991 <sonic-button 52992 shape="circle" 52993 icon 52994 size="xs" 52995 @click=${() => { 52996 this.confirmDeleteSubscription(subscriptionItem); 52997 }} 52998 > 52999 <sonic-icon name="trash" library="custom" class=""></sonic-icon> 53000 </sonic-button> 53001 </sonic-tooltip> 53002 53003 ${!this.isLarge ? b$1`<sonic-divider vertical></sonic-divider>` : A$1} ${this.renderTabsPop()} 53004 </div> 53005 </div> 53006 `; 53007 } 53008 /** 53009 * Construit l'expression de requête pour récupérer les spectacles associés aux abonnements 53010 */ 53011 queueExpression() { 53012 const subscriptionTypeIds = [...new Set(this._subscriptions.map((subscription) => subscription.entity_id))]; 53013 const subscription_price_ids = [...new Set(this._subscriptions.map((subscription) => subscription.price?.id))]; 53014 const endPoint = entityEndPoint({ 53015 entityType: "show", 53016 subscriptionTypeIds: subscriptionTypeIds.map((id) => id?.toString() || ""), 53017 subscriptionPriceIds: subscription_price_ids.map((id) => Number(id) || 0), 53018 view: entityView.essential, 53019 next: true, 53020 isQueue: true, 53021 accessParams: this.accessParams 53022 }); 53023 return endPoint; 53024 } 53025 /** 53026 * Compte le nombre de séances associées à un abonnement donné 53027 */ 53028 countSubscriptionSessions(subscriptionId) { 53029 if (!subscriptionId) return 0; 53030 const sessionIds = this.items.filter((lineCartItem) => lineCartItem.parent_id === subscriptionId); 53031 return sessionIds?.length || 0; 53032 } 53033 /** 53034 * Récupère le nom/titre d'un type d'abonnement 53035 */ 53036 getSubscriptionName(subscriptionItem, displayPrice = true) { 53037 const subscriptionEntityId = subscriptionItem?.entity_id; 53038 if (!subscriptionEntityId) return ""; 53039 const subscriptionEntity = this.entities.find( 53040 (entity) => entity.id === subscriptionEntityId && entity.entity_type === EntityType.Subscribe 53041 ); 53042 const linkedSubscription = this.linked_subscriptions.find( 53043 (subscription) => subscription.entity?.id === subscriptionEntityId 53044 ); 53045 const entityTitle = linkedSubscription?.entity?.edito?.title || subscriptionEntity?.edito?.title || ""; 53046 const priceLabel = subscriptionItem?.price?.label; 53047 return b$1`${entityTitle} 53048 ${priceLabel && priceLabel !== entityTitle && displayPrice ? b$1`⢠${priceLabel}` : A$1}`; 53049 } 53050 /** 53051 * Affiche le récapitulatif d'un abonnement donné 53052 */ 53053 displaySummary(subscriptionItem) { 53054 const hasItems = !!this.items?.find( 53055 (item) => item.parent_id === subscriptionItem.id || item.id === subscriptionItem.id 53056 ); 53057 if (!hasItems || !this.cartProvider) return; 53058 this._modal = Modal.create({ 53059 title: t("LIB_summary"), 53060 removeOnHide: true, 53061 content: b$1` 53062 <sonic-cart-quick-select-subscription-summary 53063 .subscription=${subscriptionItem} 53064 cartProvider=${this.cartProvider} 53065 dataProvider=${this.cartProvider} 53066 subDataProvider="data" 53067 > 53068 </sonic-cart-quick-select-subscription-summary> 53069 ${this.goToCartButton()} 53070 `, 53071 maxWidth: "45rem" 53072 }); 53073 } 53074 goToCartButton() { 53075 const cartProvider = this.cartProvider; 53076 if (!cartProvider) return; 53077 const canCheckout = !!dp(cartProvider).data.canCheckout.get(); 53078 if (!canCheckout) return; 53079 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 53080 let backLabel = t("back_to_cart"); 53081 const cartType = dp(cartProvider).data.cartType.get(); 53082 if (cartType === "reservation") { 53083 backLabel = t("back_to_reservation"); 53084 } 53085 return b$1`<sonic-button 53086 shape="block" 53087 type="success" 53088 style="margin-top:1rem" 53089 @click=${() => { 53090 this._modal?.hide(); 53091 parentModal?.hide(); 53092 }} 53093 > 53094 <sonic-icon name="arrow-right" library="custom"></sonic-icon>
53095 <span class="font-bold">${backLabel}</span> 53096 </sonic-button>`; 53097 } 53098 confirmDeleteSubscription(subscriptionItem) { 53099 if (!subscriptionItem.id) return; 53100 const subscriptionName = this.getSubscriptionName(subscriptionItem, false); 53101 const linkedSessions = this.countSubscriptionSessions(subscriptionItem.id); 53102 const firstName = subscriptionItem?.owner?.firstName; 53103 const lastName = subscriptionItem?.owner?.lastName; 53104 const isAnonymous = !firstName && !lastName; 53105 Modal.create({ 53106 title: `Confirmer la suppression`, 53107 content: b$1`<div style="display: flex; align-items: flex-start; margin-bottom: .25rem;"> 53108 <sonic-icon name="id-card" library="custom" style="margin-right:3px;"> </sonic-icon> 53109 <div> 53110 ${subscriptionName} 53111 <br /> 53112 â ${isAnonymous ? t("Anonyme") : b$1`${firstName} <span class="uppercase">${lastName}</span>`} 53113 </div> 53114 </div> 53115 ${linkedSessions > 0 ? b$1`<div style="display: flex; align-items: center;"> 53116 <sonic-icon name="ticket" library="custom" style="margin-right:3px;"> </sonic-icon> ${linkedSessions} 53117 billet(s) associé(s) 53118 </div>` : A$1}`, 53119 actions: b$1`<sonic-button 53120 @click=${() => { 53121 if (!subscriptionItem.id) return; 53122 Cart.removeItems({ 53123 apiConfiguration: this.getApiConfiguration(), 53124 cartProvider: this.cartProvider, 53125 query: { 53126 ids: [subscriptionItem.id] 53127 } 53128 }).then(() => { 53129 const firstTab = this.tabs[0]; 53130 if (firstTab) { 53131 this.selectedSubscriptionId = firstTab.id; 53132 } 53133 }); 53134 }} 53135 type="danger" 53136 hideModal 53137 > 53138 <sonic-icon name="trash" library="custom" slot="prefix"> </sonic-icon> Supprimer</sonic-button 53139 > 53140 <sonic-button shape="block" hideModal> Annuler</sonic-button> ` 53141 }); 53142 } 53143 }; 53144 SonicCartQuickSelect.styles = [ 53145 tailwind, 53146 customScroll, 53147 quickSelectSliderCSS, 53148 i$9` 53149 :host { 53150 width: 100%; 53151 position: relative; 53152 display: block; 53153 --_event-width: clamp(13rem, 50%, 25rem); 53154 --quick-select-column-width: 100%; 53155 } 53156 53157 :host([islarge]) { 53158 --_event-width: clamp(14rem, 50%, 25rem); 53159 --quick-select-column-width: 15rem; 53160 } 53161 ` 53162 ]; 53163 __decorateClass$1n([ 53164 n$5({ type: Array }) 53165 ], SonicCartQuickSelect.prototype, "items", 2); 53166 __decorateClass$1n([ 53167 n$5({ type: Array }) 53168 ], SonicCartQuickSelect.prototype, "linked_subscriptions", 2); 53169 __decorateClass$1n([ 53170 n$5({ type: String }) 53171 ], SonicCartQuickSelect.prototype, "cartType", 2); 53172 __decorateClass$1n([ 53173 n$5({ type: String }) 53174 ], SonicCartQuickSelect.prototype, "cartProvider", 2); 53175 __decorateClass$1n([ 53176 n$5({ type: Array }) 53177 ], SonicCartQuickSelect.prototype, "entities", 2); 53178 __decorateClass$1n([ 53179 e$2({ context: selectedSubscriptionIdContext }), 53180 n$5({ type: String }) 53181 ], SonicCartQuickSelect.prototype, "selectedSubscriptionId", 2); 53182 __decorateClass$1n([ 53183 e$2({ context: subscriptionsContext }), 53184 r$5() 53185 ], SonicCartQuickSelect.prototype, "_subscriptions", 2); 53186 __decorateClass$1n([ 53187 c({ context: accessParamsContext, subscribe: true }), 53188 e$2({ context: accessParamsContext }), 53189 n$5({ type: Object }) 53190 ], SonicCartQuickSelect.prototype, "accessParams", 2); 53191 __decorateClass$1n([ 53192 r$5() 53193 ], SonicCartQuickSelect.prototype, "tabs", 2); 53194 __decorateClass$1n([ 53195 bind$1("settings"), 53196 r$5() 53197 ], SonicCartQuickSelect.prototype, "settings", 2); 53198 __decorateClass$1n([ 53199 c({ context: appType, subscribe: true }) 53200 ], SonicCartQuickSelect.prototype, "appType", 2); 53201 __decorateClass$1n([ 53202 e$2({ context: preferredQuotaIdContext }), 53203 bind$1("admin_form_preferred_quota.preferred_quota_id"), 53204 r$5() 53205 ], SonicCartQuickSelect.prototype, "preferredQuotaId", 2); 53206 __decorateClass$1n([ 53207 r$5() 53208 ], SonicCartQuickSelect.prototype, "_queueDpExpression", 2); 53209 __decorateClass$1n([ 53210 e$2({ context: isLargeContext }), 53211 n$5({ type: Boolean, reflect: true }) 53212 ], SonicCartQuickSelect.prototype, "isLarge", 2); 53213 __decorateClass$1n([ 53214 r$5() 53215 ], SonicCartQuickSelect.prototype, "allSubscriptionsAreValid", 2); 53216 __decorateClass$1n([ 53217 bind$1("user.id"), 53218 r$5() 53219 ], SonicCartQuickSelect.prototype, "loggedUserId", 2); 53220 __decorateClass$1n([ 53221 e$2({ context: showOtherOwnersContext }), 53222 r$5() 53223 ], SonicCartQuickSelect.prototype, "_showOtherOwners", 2); 53224 __decorateClass$1n([ 53225 r$5() 53226 ], SonicCartQuickSelect.prototype, "sliderIndex", 2); 53227 SonicCartQuickSelect = __decorateClass$1n([ 53228 t$3(tagName$_) 53229 ], SonicCartQuickSelect); 53230 var __defProp$1k = Object.defineProperty; 53231 var __getOwnPropDesc$1m = Object.getOwnPropertyDescriptor; 53232 var __decorateClass$1m = (decorators, target, key, kind) => { 53233 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1m(target, key) : target; 53234 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 53235 if (decorator = decorators[i2]) 53236 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 53237 if (kind && result) __defProp$1k(target, key, result); 53238 return result; 53239 }; 53240 let instanceCounter$2 = 0; 53241 let SubscriptionPriceForm = class extends i$6 { 53242 constructor() { 53243 super(...arguments); 53244 this.prices = []; 53245 this.isLoading = false;
53246 this.formDataProvider = `subscription-price-form-${instanceCounter$2++}`; 53247 } 53248 async willUpdate(_changedProperties) { 53249 if (_changedProperties.has("lineItem")) { 53250 this.setPrices(this.lineItem?.entity_id?.toString()); 53251 } 53252 } 53253 async setPrices(id) { 53254 this.isLoading = true; 53255 const api2 = new API(HTML.getApiConfiguration(this)); 53256 const endpoint = `/subscription-types/${id}?features[]=prices`; 53257 const result = await api2.get(endpoint); 53258 if (result.success && result.data) { 53259 const data = result.data; 53260 this.prices = data?.prices ?? []; 53261 } else { 53262 this.prices = []; 53263 } 53264 this.isLoading = false; 53265 } 53266 pricesToOptions(prices) { 53267 let displayAmount = true; 53268 const everyAmountAreNull = prices.length > 0 && prices.every((price) => !price.amount); 53269 if (everyAmountAreNull) { 53270 displayAmount = false; 53271 } 53272 return prices.map((price) => { 53273 const isSelected = price.id?.toString() === this.lineItem?.price?.id?.toString(); 53274 const amount = formatAmount(price.amount || 0); 53275 return { 53276 value: price.id?.toString() || "", 53277 wording: `${price.title} ${displayAmount ? `â ${amount}` : ""}`, 53278 selected: isSelected 53279 }; 53280 }); 53281 } 53282 render() { 53283 if (this.isLoading) { 53284 return b$1`<sonic-loader mode="inline"></sonic-loader>`; 53285 } 53286 return b$1`<div class="flex flex-col gap-2" formDataProvider=${this.formDataProvider}> 53287 <sonic-select 53288 label=${t("price")} 53289 name="subscriptionPriceId" 53290 .options=${this.pricesToOptions(this.prices)} 53291 ?readonly=${this.prices.length === 1} 53292 ></sonic-select> 53293 <sonic-button 53294 size="lg" 53295 type="success" 53296 shape="block" 53297 @click=${this.handleSubmit} 53298 ?disabled=${this.prices.length === 1} 53299 > 53300 <sonic-icon library="custom" name="check"></sonic-icon> 53301 ${t("Valider")} 53302 </sonic-button> 53303 </div>`; 53304 } 53305 handleSubmit(e2) { 53306 e2.preventDefault(); 53307 const priceId = dp(this.formDataProvider).subscriptionPriceId.get(); 53308 const itemId = this.lineItem?.id; 53309 if (!itemId || !this.cartProvider || !priceId) return; 53310 const button2 = e2.target; 53311 button2.setAttribute("disabled", ""); 53312 button2.setAttribute("loading", ""); 53313 Cart.patchItems({ 53314 apiConfiguration: HTML.getApiConfiguration(this), 53315 cartProvider: this.cartProvider, 53316 query: { 53317 ids: [itemId] 53318 }, 53319 body: { 53320 price: { 53321 id: priceId 53322 } 53323 } 53324 }).then((e22) => { 53325 if (e22 === "asRequested") { 53326 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 53327 parentModal?.hide(); 53328 } 53329 }); 53330 button2.removeAttribute("disabled"); 53331 button2.removeAttribute("loading"); 53332 } 53333 }; 53334 SubscriptionPriceForm.styles = [tailwind]; 53335 __decorateClass$1m([ 53336 n$5({ type: Object }) 53337 ], SubscriptionPriceForm.prototype, "lineItem", 2); 53338 __decorateClass$1m([ 53339 n$5({ type: String }) 53340 ], SubscriptionPriceForm.prototype, "cartProvider", 2); 53341 __decorateClass$1m([ 53342 n$5({ type: Array }) 53343 ], SubscriptionPriceForm.prototype, "prices", 2); 53344 __decorateClass$1m([ 53345 r$5() 53346 ], SubscriptionPriceForm.prototype, "isLoading", 2); 53347 SubscriptionPriceForm = __decorateClass$1m([ 53348 t$3("sonic-subscription-price-form") 53349 ], SubscriptionPriceForm); 53350 function resolveAppType(appType2) { 53351 if (appType2) { 53352 return appType2; 53353 } 53354 if (document.querySelector("sonic-counter-app, sonic-counter-app-legacy")) { 53355 return "counter"; 53356 } 53357 return "customer"; 53358 } 53359 function getEventPlacementConfig(appType2) { 53360 const resolvedAppType = resolveAppType(appType2); 53361 return resolvedAppType === "counter" ? dp("settings.store_ui.event.placement").get() : dp("settings.customer_ui.event.placement").get(); 53362 } 53363 function shouldOpenAddPriceModalInsteadOfSeatmap(appType2) { 53364 return isAutoOnlyPlacement(getEventPlacementConfig(appType2)); 53365 } 53366 function openAddPriceModalForAutoPlacement({ 53367 cartProvider, 53368 priceContext, 53369 accessParams, 53370 preferredQuotaId 53371 }) { 53372 addPriceModal({ 53373 cartProvider, 53374 priceContext, 53375 accessParams, 53376 preferredQuotaId 53377 }); 53378 } 53379 const categoryMarkup = (price) => { 53380 if (!price) return A$1; 53381 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}`; 53382 }; 53383 const typeOfSeatIsChair = (type_of_seat) => { 53384 const normalSeatsLabels = ["chair", "siège", "fauteuil", "sitz", "stoel"]; 53385 const lowerCaseTypeOfSeat = type_of_seat?.toLowerCase().trim(); 53386 return normalSeatsLabels.includes(lowerCaseTypeOfSeat); 53387 }; 53388 function getSeatPlacementLabel(seat, mode2 = "default") { 53389 const { type_of_seat, common_name, short_name } = seat || {}; 53390 const typeSeatLabel = type_of_seat && !typeOfSeatIsChair(type_of_seat) ? " " + type_of_seat : ""; 53391 if (mode2 === "condensed" && short_name) { 53392 return `${short_name}${typeSeatLabel}`; 53393 } 53394 if (seat?.common_name) { 53395 return `${common_name}${typeSeatLabel}`; 53396 } 53397 return void 0; 53398 } 53399 const placementMarkup = (lineItems, mode2 = "default") => { 53400 if (!lineItems) return A$1; 53401 const labels = lineItems.map((item) => getSeatPlacementLabel(item.seat, mode2)).filter((label2) => !!label2); 53402 if (!labels.length) return A$1; 53403 return b$1`<div class="inline-flex gap-1 items-center align-middle">
53404 <sonic-icon library="custom" name="loveseat" class="self-start"></sonic-icon> 53405 ${o( 53406 o$1(labels, (label2) => b$1`${o$6(label2)}`), 53407 b$1`, ` 53408 )} 53409 </div>`; 53410 }; 53411 const priceLineMarkup = (lineItems) => { 53412 if (!lineItems?.length) return A$1; 53413 const firstPrice = lineItems[0].price; 53414 const allSamePrice = lineItems.every( 53415 (item) => item.price?.id === firstPrice?.id && item.price?.amount === firstPrice?.amount 53416 ); 53417 const isMultiple = lineItems.length > 1; 53418 const isSubscription = lineItems[0]?.entity_type === EntityType.Subscribe; 53419 let displayAmount = true; 53420 if (isSubscription && !firstPrice?.amount) { 53421 displayAmount = false; 53422 } 53423 return b$1` 53424 ${allSamePrice ? b$1`<span class="mr-3"> 53425 ${categoryMarkup(firstPrice)} ${firstPrice?.label} 53426 ${!isMultiple && lineItems[0]?.seat?.id ? b$1` â ${placementMarkup(lineItems, "default")} ` : A$1} 53427 ${displayAmount ? b$1`⢠${formatAmount(firstPrice?.amount || 0)}` : A$1} 53428 </span> 53429 ${isMultiple ? b$1`<span> 53430 <sonic-icon name="ticket" library="custom"></sonic-icon> 53431 à 53432 <span class="font-medium">${lineItems.length} </span> 53433 </span>` : A$1} ` : A$1} 53434 `; 53435 }; 53436 const editPriceModal = (options) => { 53437 const { lineItems, cartProvider, linkedCartProvider, accessParams, onUpdated } = options; 53438 const firstItem = lineItems?.[0]; 53439 if (!cartProvider || !firstItem) return; 53440 const { entity_type, entity_id } = firstItem; 53441 const parentSubscription = getParentItem(firstItem, cartProvider) || (linkedCartProvider ? getParentItem(firstItem, linkedCartProvider) : void 0); 53442 const priceContext = { 53443 entityType: entity_type, 53444 entityId: Number(entity_id), 53445 parentSubscription, 53446 edit: { 53447 lineItems, 53448 initialPrice: { 53449 id: Number(firstItem.price?.id), 53450 amount: Number(firstItem.price?.amount) || void 0, 53451 is_free_price: firstItem.price?.is_free_price || false 53452 }, 53453 initialQuotaId: Number(firstItem.quota?.id) || void 0 53454 } 53455 }; 53456 Modal.create({ 53457 title: lineItems.length > 0 ? t("edit_price") : t("LIB_select_price"), 53458 content: withAccessParams( 53459 accessParams, 53460 b$1`<sonic-cart-item-edit-price 53461 cartProvider=${cartProvider} 53462 .priceContext=${priceContext} 53463 @updated=${() => onUpdated?.()} 53464 ></sonic-cart-item-edit-price>` 53465 ), 53466 maxWidth: "40rem", 53467 removeOnHide: true 53468 }); 53469 }; 53470 const addPriceModal = (options) => { 53471 const { priceContext, cartProvider, preferredQuotaId, accessParams } = options; 53472 if (!cartProvider || !priceContext) return; 53473 Modal.create({ 53474 title: t("LIB_select_price"), 53475 content: withAccessParams( 53476 accessParams, 53477 b$1`<sonic-cart-item-edit-price 53478 cartProvider=${cartProvider} 53479 .priceContext=${priceContext} 53480 .preferredQuotaId=${preferredQuotaId} 53481 ></sonic-cart-item-edit-price>` 53482 ), 53483 maxWidth: "40rem", 53484 removeOnHide: true 53485 }); 53486 }; 53487 const quickSelectModal = async (options) => { 53488 const { cartProvider, selectedSubscriptionId, accessParams } = options; 53489 if (!cartProvider) return; 53490 if (Modal?.modals) { 53491 await Promise.all([...Modal.modals].map((modal) => modal.dispose())); 53492 } 53493 Modal.create({ 53494 title: b$1`<div style="display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start;"> 53495 <sonic-button 53496 to="subscription" 53497 noAutoFill 53498 autoActive="disabled" 53499 size="sm" 53500 variant="unstyled" 53501 @click=${(e2) => { 53502 const parentModal = HTML.getClosestElement(e2.target, "sonic-modal"); 53503 parentModal?.hide(); 53504 }} 53505 > 53506 <sonic-icon name="arrow-left" library="custom" size="lg"></sonic-icon> 53507 <span style="text-transform:uppercase;font-weight:bold">${t("back")}</span> 53508 </sonic-button> 53509 ${t("events_choice")} 53510 </div>`, 53511 subtitle: b$1``, 53512 content: withAccessParams( 53513 accessParams, 53514 b$1` 53515 <sonic-cart-quick-select 53516 dataProvider="${cartProvider}" 53517 cartProvider="${cartProvider}" 53518 subDataProvider="data" 53519 .selectedSubscriptionId=${selectedSubscriptionId} 53520 ></sonic-cart-quick-select> 53521 ` 53522 ), 53523 removeOnHide: true, 53524 fullScreen: true, 53525 closeButtonType: "danger" 53526 }); 53527 }; 53528 const addProofModal = ({ 53529 lineItem, 53530 cartProvider 53531 }) => { 53532 if (!lineItem?.id || !cartProvider) return; 53533 Modal.create({ 53534 title: t("LIB_add_proof"), 53535 content: b$1`<sonic-add-proof .item=${lineItem} cartProvider=${cartProvider}></sonic-add-proof>`, 53536 removeOnHide: true 53537 }); 53538 }; 53539 const editSubscriptionOwnerModal = ({ 53540 lineItem, 53541 cartProvider 53542 }) => { 53543 if (!lineItem?.id || !cartProvider) return; 53544 Modal.create({ 53545 title: t("owner"), 53546 content: b$1`<sonic-subscription-owner-form 53547 cartProvider=${cartProvider} 53548 .item=${lineItem} 53549 ></sonic-subscription-owner-form>`, 53550 removeOnHide: true, 53551 maxWidth: "50rem" 53552 }); 53553 }; 53554 const editSubscriptionPriceModal = ({ 53555 lineItem, 53556 cartProvider 53557 }) => { 53558 if (!lineItem || !cartProvider) return; 53559 Modal.create({ 53560 title: t("edit_price"), 53561 content: b$1`<sonic-subscription-price-form 53562 .lineItem=${lineItem} 53563 cartProvider=${cartProvider} 53564 ></sonic-subscription-price-form>`, 53565 maxWidth: "32rem", 53566 removeOnHide: true 53567 }); 53568 }; 53569 const editSeatsModal = ({ 53570 cartProvider, 53571 priceContext, 53572 sessionId, 53573 accessParams, 53574 editMode = SeatmapMode.CART_EDIT, 53575 onHide 53576 }) => { 53577 if (!cartProvider) return; 53578 const sessions = getSessionsWithSeatmap(cartProvider); 53579 const entityId = priceContext?.entityId ?? sessionId ?? Number(sessions[0]?.id) ?? 0; 53580 if (!entityId) return; 53581 const currentPriceContext = priceContext ?? { 53582 entityId, 53583 entityType: EntityType.Event 53584 }; 53585 const seatmapPublisher2 = getSeatmapModalPublisher(currentPriceContext); 53586 const modal = Modal.create({ 53587 // title: t("edit_selected_seats"), 53588 content: withAccessParams( 53589 accessParams, 53590 b$1`<sonic-event-seat-selector 53591 cartProvider=${cartProvider} 53592 seatmapProvider=${seatmapPublisher2} 53593 displaySummary 53594 .sessionsList=${sessions} 53595 edit-mode=${editMode} 53596 .priceContext=${currentPriceContext} 53597 ></sonic-event-seat-selector>` 53598 ), 53599 maxWidth: "68rem", 53600 height: "95svh", 53601 maxHeight: "95svh", 53602 removeOnHide: true 53603 }); 53604 modal.addEventListener("hidden", () => { 53605 dp(seatmapPublisher2).set({}); 53606 }); 53607 if (onHide) { 53608 modal.addEventListener("hide", onHide, { once: true }); 53609 } 53610 return modal; 53611 }; 53612 function getSeatmapModalPublisher(priceContext) { 53613 return `seatmapModal/${priceContext?.entityId ?? 0}`; 53614 } 53615 const addSeatsModal = (options) => { 53616 const { cartProvider, navigationMode, priceContext, accessParams, appType: appType2, preferredQuotaId } = options; 53617 if (!cartProvider) return; 53618 if (shouldOpenAddPriceModalInsteadOfSeatmap(appType2)) { 53619 openAddPriceModalForAutoPlacement({ 53620 cartProvider, 53621 priceContext, 53622 accessParams, 53623 preferredQuotaId 53624 }); 53625 return; 53626 } 53627 const sessions = navigationMode === "cart" ? getSessionsWithSeatmap(cartProvider) : []; 53628 const seatmapPublisher2 = getSeatmapModalPublisher(priceContext); 53629 const modal = Modal.create({ 53630 // title: t("add_tickets_with_seating"), 53631 content: withAccessParams( 53632 accessParams, 53633 b$1`<sonic-event-seat-selector 53634 cartProvider=${cartProvider} 53635 seatmapProvider=${seatmapPublisher2} 53636 displaySummary 53637 .sessionsList=${sessions} 53638 edit-mode=${SeatmapMode.CART_ADD} 53639 .priceContext=${priceContext} 53640 ></sonic-event-seat-selector>` 53641 ), 53642 maxWidth: "68rem", 53643 height: "95svh", 53644 maxHeight: "95svh", 53645 removeOnHide: true 53646 }); 53647 modal.addEventListener("hidden", () => { 53648 dp(seatmapPublisher2).set({}); 53649 }); 53650 return modal; 53651 }; 53652 const productPriceSummary = ({ 53653 lineItemCart, 53654 accessParams, 53655 className 53656 }) => { 53657 if (!lineItemCart) return A$1; 53658 const firstLineItem = Array.isArray(lineItemCart) ? lineItemCart[0] : lineItemCart; 53659 const isArray = Array.isArray(lineItemCart); 53660 const { entity_type, entity_id } = firstLineItem || {}; 53661 if (!entity_type || !entity_id) return A$1; 53662 return b$1`<sonic-fetch 53663 dataProvider="${entity_type}/${entity_id}/summary" 53664 endpoint=${entityEndPoint({ 53665 entityType: entity_type, 53666 entityId: Number(entity_id), 53667 view: entityView.full, 53668 accessParams 53669 })} 53670 key="data" 53671 > 53672 <sonic-product-summary size="md" class="${o$4(className)}" noOverTitle> 53673 <div class="text-sm mt-2" slot="subTitle">${priceLineMarkup(isArray ? lineItemCart : [firstLineItem])}</div> 53674 </sonic-product-summary> 53675 </sonic-fetch> `; 53676 }; 53677 const getSessionsWithSeatmap = (cartProvider) => { 53678 const cartEntities = dp(cartProvider).data.entities.get(); 53679 if (!cartEntities?.length) return []; 53680 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)); 53681 }; 53682 const showAllPaymentsModal = (cartProvider, appType2) => { 53683 const title = appType2 === "counter" ? t("LIB_moyen_de_paiement_principal") : t("LIB_moyen_de_paiement"); 53684 Modal.create({ 53685 title, 53686 content: b$1`<sonic-cart-payment-buttons 53687 showAllPayments 53688 dataProvider="${cartProvider}" 53689 cartProvider="${cartProvider}" 53690 subDataProvider="data" 53691 ></sonic-cart-payment-buttons>`, 53692 removeOnHide: true 53693 }); 53694 }; 53695 const addTicketsModal = ({ 53696 id, 53697 cartProvider, 53698 accessParams 53699 }) => { 53700 const endPoint = entityEndPoint({ 53701 entityType: EntityType.Event, 53702 entityId: id, 53703 view: entityView.full, 53704 accessParams 53705 }); 53706 Modal.create({ 53707 title: t("add_tickets"), 53708 content: withAccessParams( 53709 accessParams, 53710 b$1`<sonic-fetch dataProvider=${endPoint} cartProvider=${o$4(cartProvider)} key="data"> 53711 <sonic-event-store-item noActionMenu alwaysExpanded formType="buttons"></sonic-event-store-item> 53712 </sonic-fetch>` 53713 ), 53714 maxWidth: "60rem", 53715 removeOnHide: true 53716 }); 53717 }; 53718 const getSubscriptionName = (subscriptionEntityId, cartProvider) => { 53719 if (!subscriptionEntityId || !cartProvider) return ""; 53720 const entities = dp(cartProvider).data.entities.get(); 53721 const subscription = entities.find( 53722 (entity) => entity.id === subscriptionEntityId && entity.entity_type === EntityType.Subscribe 53723 ); 53724 if (!subscription) return ""; 53725 return subscription.edito?.title || ""; 53726 }; 53727 let currentModal = null; 53728 const calculateCounters = (tasks, currentTask, totalTasksByType) => { 53729 const currentTaskType = currentTask.type; 53730 const tasksOfSameType = tasks.filter((task) => task.type === currentTaskType); 53731 const totalOfType = totalTasksByType?.[currentTaskType] || tasksOfSameType.length;
53732 let currentIndex; 53733 if (totalTasksByType?.[currentTaskType]) { 53734 currentIndex = totalTasksByType[currentTaskType] - tasksOfSameType.length + 1; 53735 } else { 53736 currentIndex = tasksOfSameType.findIndex((task) => task === currentTask) + 1; 53737 } 53738 return { 53739 currentIndex, 53740 totalOfType, 53741 isSubscription: currentTaskType === "owner-subscription" || currentTaskType === "owner" && currentTask.items[0]?.entity_type === EntityType.Subscribe 53742 }; 53743 }; 53744 async function hideAndProcessNextTask(modal, config) { 53745 await modal?.hide(); 53746 const { tasks, cartProvider, processedItems, totalTasksByType } = config; 53747 if (tasks.length && cartProvider) { 53748 const refreshedTasks = refreshTasksWithFreshItems(tasks, cartProvider); 53749 unifiedModal({ tasks: refreshedTasks, processedItems, cartProvider, totalTasksByType }); 53750 } else if (cartProvider) { 53751 const hadSubscriptionTasks = (totalTasksByType?.[ 53752 "owner-subscription" 53753 /* OWNER_SUBSCRIPTION */ 53754 ] ?? 0) > 0; 53755 if (hadSubscriptionTasks) { 53756 checkAndOpenQuickSelectModal(processedItems, cartProvider); 53757 } 53758 } 53759 } 53760 async function hideAndAttachNextOwners(modal, config) { 53761 await modal?.hide(); 53762 const { items, cartProvider, processedItems } = config; 53763 if (items.length && cartProvider) { 53764 attachOwnerModal({ items, processedItems, cartProvider }); 53765 } 53766 } 53767 const checkAndOpenQuickSelectModal = (processedItems, cartProvider) => { 53768 if (!processedItems?.length) return; 53769 try { 53770 const freshCartData = dp(cartProvider).data.get(); 53771 const freshItems = freshCartData?.items || []; 53772 const subscriptionsCanAttachEvents = processedItems.filter((item) => item.entity_type === EntityType.Subscribe).map((item) => freshItems.find((freshItem) => freshItem.id === item.id)).filter((item) => { 53773 return !!item && !!item.can_attach_events; 53774 }); 53775 const subscriptionsNeedingQuickSelection = subscriptionsCanAttachEvents?.filter((item) => { 53776 return item?.has_error_linked_events || item?.force_quick_selection; 53777 }); 53778 if (subscriptionsNeedingQuickSelection.length > 0) { 53779 quickSelectModal({ 53780 cartProvider, 53781 selectedSubscriptionId: subscriptionsNeedingQuickSelection[0].id 53782 }); 53783 } 53784 } catch (error) { 53785 console.warn("Erreur lors de la vérification des abonnements nécessitant des événements:", error); 53786 } 53787 }; 53788 const unifiedModal = (config) => { 53789 const { tasks, cartProvider, processedItems, totalTasksByType } = config; 53790 const currentTask = tasks[0]; 53791 if (!currentTask || !cartProvider) return; 53792 const currentItem = currentTask.items[0]; 53793 const id = currentItem?.id; 53794 if (!id) return; 53795 const { currentIndex, totalOfType } = calculateCounters(tasks, currentTask, totalTasksByType); 53796 let progressText = A$1; 53797 if (totalOfType > 1) { 53798 progressText = b$1`<span style="font-size: 0.7em;font-weight: 400; margin-left: 0.5rem;"> 53799 n°${currentIndex}/${totalOfType}</span 53800 >`; 53801 } 53802 const modalContent = b$1`${r(currentTask.type, [ 53803 [ 53804 "owner", 53805 () => renderOwnerModalContent(currentTask, cartProvider, tasks, processedItems, totalTasksByType) 53806 ], 53807 [ 53808 "owner-subscription", 53809 () => renderOwnerModalContent(currentTask, cartProvider, tasks, processedItems, totalTasksByType) 53810 ], 53811 [ 53812 "owner-other", 53813 () => renderOwnerModalContent(currentTask, cartProvider, tasks, processedItems, totalTasksByType) 53814 ], 53815 [ 53816 "free-price", 53817 () => renderFreePriceModalContent(currentTask, cartProvider, tasks, processedItems, totalTasksByType) 53818 ] 53819 ])}`; 53820 let width = "40rem"; 53821 if (currentTask.type === "owner-subscription" || currentTask.type === "owner" && currentItem.entity_type === EntityType.Subscribe) { 53822 width = "48rem"; 53823 } else if (currentTask.type === "owner" || currentTask.type === "owner-other") { 53824 width = "64rem"; 53825 } 53826 const modal = Modal.create({ 53827 title: b$1`${currentTask.title} ${progressText}`, 53828 content: modalContent, 53829 maxWidth: "95vw", 53830 width, 53831 removeOnHide: true 53832 }); 53833 currentModal = modal; 53834 }; 53835 const renderOwnerModalContent = (currentTask, cartProvider, tasks, processedItems, totalTasksByType) => { 53836 const currentItem = currentTask.items[0]; 53837 let mode2 = "default"; 53838 if (currentTask.type === "owner-subscription" || currentItem.entity_type === EntityType.Subscribe) { 53839 mode2 = "subscription"; 53840 }
53840 else if (currentItem.price?.need_subscription || currentItem.price?.need_partner_subscription) { 53841 mode2 = "attach-subscription"; 53842 } 53843 return r(mode2, [ 53844 [ 53845 "subscription", 53846 () => b$1`<sonic-subscription-owner-form 53847 cartProvider=${cartProvider} 53848 .item=${currentItem} 53849 @attach=${(e2) => { 53850 hideAndProcessNextTask(currentModal, { 53851 tasks: getNextTasks(tasks, e2.detail.itemIds), 53852 processedItems: getProcessedItems(processedItems, currentTask.items, e2.detail.itemIds), 53853 cartProvider, 53854 totalTasksByType 53855 }); 53856 }} 53857 ></sonic-subscription-owner-form>` 53858 ], 53859 [ 53860 "default", 53861 () => b$1`<sonic-owner-attach-form 53862 cartProvider=${cartProvider} 53863 .item=${currentItem} 53864 @attach=${(e2) => { 53865 hideAndProcessNextTask(currentModal, { 53866 tasks: getNextTasks(tasks, e2.detail.itemIds), 53867 processedItems: getProcessedItems(processedItems, currentTask.items, e2.detail.itemIds), 53868 cartProvider, 53869 totalTasksByType 53870 }); 53871 }} 53872 ></sonic-owner-attach-form>` 53873 ], 53874 [ 53875 "attach-subscription", 53876 () => b$1`<sonic-subscription-attach-form 53877 ?needPartnerSubscription=${currentItem.price?.need_partner_subscription} 53878 cartProvider=${cartProvider} 53879 .item=${currentItem} 53880 @attach=${(e2) => { 53881 hideAndProcessNextTask(currentModal, { 53882 tasks: getNextTasks(tasks, e2.detail.itemIds), 53883 processedItems: getProcessedItems(processedItems, currentTask.items, e2.detail.itemIds), 53884 cartProvider, 53885 totalTasksByType 53886 }); 53887 }} 53888 ></sonic-subscription-attach-form>` 53889 ] 53890 ]); 53891 }; 53892 const renderFreePriceModalContent = (currentTask, cartProvider, tasks, processedItems, totalTasksByType) => { 53893 const currentItem = currentTask.items[0]; 53894 const parentItem = getParentItem(currentItem, cartProvider); 53895 const priceContext = { 53896 entityType: currentItem.entity_type || EntityType.Event, 53897 entityId: Number(currentItem.entity_id), 53898 parentSubscription: parentItem, 53899 edit: { 53900 lineItems: currentTask.items, 53901 initialPrice: { 53902 id: Number(currentItem?.price?.id), 53903 amount: Number(currentItem?.price?.amount) || void 0, 53904 is_free_price: currentItem?.price?.is_free_price || false 53905 }, 53906 initialQuotaId: Number(currentItem?.quota?.id) || void 0 53907 } 53908 }; 53909 return b$1`<sonic-cart-item-edit-price 53910 .priceContext=${priceContext} 53911 cartProvider=${cartProvider} 53912 @updated=${() => { 53913 hideAndProcessNextTask(currentModal, { 53914 tasks: tasks.slice(1), 53915 processedItems: [...processedItems || [], ...currentTask.items], 53916 cartProvider, 53917 totalTasksByType 53918 }); 53919 }} 53920 ></sonic-cart-item-edit-price>`; 53921 }; 53922 const getNextTasks = (tasks, processedItemIds) => { 53923 const remainingItems = tasks[0].items.slice(1).filter((item) => !processedItemIds.includes(item.id || "")); 53924 if (remainingItems.length > 0) { 53925 return [{ ...tasks[0], items: remainingItems }, ...tasks.slice(1)]; 53926 } else { 53927 return tasks.slice(1); 53928 } 53929 }; 53930 const attachOwnerModal = (config) => { 53931 const { items, cartProvider, processedItems } = config; 53932 const currentItem = items[0]; 53933 const id = currentItem?.id; 53934 if (!id || !cartProvider) return; 53935 const currentIndex = items.findIndex((item) => item.id === currentItem.id) + 1; 53936 const totalOfType = items.length; 53937 let progressText = A$1; 53938 if (totalOfType > 1) { 53939 progressText = b$1`<span style="font-size: 0.7em;font-weight: 400; margin-left: 0.5rem;"> 53940 n°${currentIndex}/${totalOfType}</span 53941 >`; 53942 } 53943 let mode2 = "default"; 53944 if (currentItem.entity_type === EntityType.Subscribe) { 53945 mode2 = "subscription"; 53946 } else if (currentItem.price?.need_subscription || currentItem.price?.need_partner_subscription) { 53947 mode2 = "attach-subscription"; 53948 } 53949 const modal = Modal.create({ 53950 title: b$1`${t("owner")} ${progressText}`, 53951 content: b$1`${r(mode2, [ 53952 [ 53953 "subscription", 53954 () => b$1`<sonic-subscription-owner-form 53955 cartProvider=${cartProvider} 53956 .item=${currentItem} 53957 @attach=${(e2) => { 53958 hideAndAttachNextOwners(modal, { 53959 items: getNextItems(items, e2.detail.itemIds), 53960 processedItems: getProcessedItems(processedItems, items, e2.detail.itemIds), 53961 cartProvider 53962 }); 53963 }} 53964 ></sonic-subscription-owner-form>` 53965 ], 53966 [ 53967 "default", 53968 () => b$1`<sonic-owner-attach-form 53969 cartProvider=${cartProvider} 53970 .item=${currentItem} 53971 @attach=${(e2) => { 53972 hideAndAttachNextOwners(modal, { 53973 items: getNextItems(items, e2.detail.itemIds), 53974 processedItems: getProcessedItems(processedItems, items, e2.detail.itemIds), 53975 cartProvider 53976 }); 53977 }} 53978 ></sonic-owner-attach-form>` 53979 ], 53980 [ 53981 "attach-subscription", 53982 () => b$1`<sonic-subscription-attach-form
53983 ?needPartnerSubscription=${currentItem.price?.need_partner_subscription} 53984 cartProvider=${cartProvider} 53985 .item=${currentItem} 53986 @attach=${(e2) => { 53987 hideAndAttachNextOwners(modal, { 53988 items: getNextItems(items, e2.detail.itemIds), 53989 processedItems: getProcessedItems(processedItems, items, e2.detail.itemIds), 53990 cartProvider 53991 }); 53992 }} 53993 ></sonic-subscription-attach-form>` 53994 ] 53995 ])}`, 53996 maxWidth: "95vw", 53997 width: mode2 === "subscription" ? "48rem" : "64rem", 53998 removeOnHide: true 53999 }); 54000 }; 54001 const createModalTasks = (items, editFreePriceAfterRequest) => { 54002 const tasks = []; 54003 const itemsNeedingOwner = items.filter((item) => item.has_error_owner); 54004 const itemsNeedingFreePrice = editFreePriceAfterRequest ? items.filter((item) => { 54005 return item.price?.is_free_price; 54006 }).sort((a2, b2) => { 54007 return (b2.updatedAt || 0) - (a2.updatedAt || 0); 54008 }) : []; 54009 if (itemsNeedingFreePrice.length > 0) { 54010 const groupedFreePriceItems = groupFreePriceItems(itemsNeedingFreePrice); 54011 groupedFreePriceItems.forEach((group) => { 54012 tasks.push({ 54013 type: "free-price", 54014 items: group, 54015 title: t("edit_price") 54016 }); 54017 }); 54018 } 54019 if (itemsNeedingOwner.length > 0) { 54020 itemsNeedingOwner.forEach((item) => { 54021 let taskType; 54022 if (item.entity_type === EntityType.Subscribe) { 54023 taskType = "owner-subscription"; 54024 } else { 54025 taskType = "owner-other"; 54026 } 54027 tasks.push({ 54028 type: taskType, 54029 items: [item], 54030 // Un seul item par tâche 54031 title: t("owner") 54032 }); 54033 }); 54034 } 54035 return tasks; 54036 }; 54037 const groupFreePriceItems = (items) => { 54038 const groups = /* @__PURE__ */ new Map(); 54039 items.forEach((item) => { 54040 const key = `${item.entity_id}-${item.entity_type}-${item.price?.id}-${item.price?.amount}`; 54041 if (!groups.has(key)) { 54042 groups.set(key, []); 54043 } 54044 groups.get(key).push(item); 54045 }); 54046 return Array.from(groups.values()); 54047 }; 54048 const itemsMatchingRequest = (items, requestItems) => { 54049 return items.filter((lineItem) => { 54050 return requestItems?.some((requestItem) => { 54051 const matchEntity = requestItem.entity_id === lineItem.entity_id && requestItem.entity_type === lineItem.entity_type; 54052 const matchingPriceId = requestItem.price?.id ? requestItem.price?.id === lineItem.price?.id : true; 54053 const matchingParentId = (requestItem.parent_id ?? null) === (lineItem.parent_id ?? null); 54054 return matchEntity && matchingPriceId && matchingParentId; 54055 }); 54056 }); 54057 }; 54058 const handlePostRequestModals = (request, resultItems, editFreePriceAfterRequest) => { 54059 const { cartProvider, items: requestItems } = request; 54060 if (!cartProvider) return; 54061 let matchingItems = itemsMatchingRequest(resultItems, requestItems || []); 54062 const hasSubscriptionInRequest = requestItems?.some((item) => item.entity_type === EntityType.Subscribe); 54063 if (hasSubscriptionInRequest) { 54064 const itemsNeedingSubscription = resultItems.filter( 54065 (item) => item.entity_type === EntityType.Event && (item.price?.need_subscription || item.price?.need_partner_subscription) && item.has_error_owner 54066 ); 54067 const existingIds = new Set(matchingItems.map((item) => item.id)); 54068 const newItems = itemsNeedingSubscription.filter((item) => !existingIds.has(item.id)); 54069 matchingItems = [...matchingItems, ...newItems]; 54070 } 54071 const tasks = createModalTasks(matchingItems, editFreePriceAfterRequest); 54072 if (tasks.length > 0) { 54073 const totalTasksByType = tasks.reduce( 54074 (acc, task) => { 54075 acc[task.type] = (acc[task.type] || 0) + 1; 54076 return acc; 54077 }, 54078 {} 54079 ); 54080 unifiedModal({ 54081 tasks, 54082 cartProvider, 54083 totalTasksByType 54084 }); 54085 } 54086 }; 54087 const getNextItems = (items, attachedItemsIds) => { 54088 return items.slice(1).filter((item) => !attachedItemsIds.includes(item.id || "")); 54089 }; 54090 const getProcessedItems = (processedItems, items, attachedItems) => { 54091 const itemsToAdd = items?.filter((item) => attachedItems?.includes(item?.id || "")); 54092 return [...processedItems || [], ...itemsToAdd || []]; 54093 }; 54094 const refreshTasksWithFreshItems = (tasks, cartProvider) => { 54095 try { 54096 const freshCartData = dp(cartProvider).data.get(); 54097 const freshItems = freshCartData?.items || []; 54098 return tasks.map((task) => ({ 54099 ...task, 54100 items: task.items.map((oldItem) => { 54101 const freshItem = freshItems.find((item) => item.id === oldItem.id); 54102 return freshItem || oldItem; 54103 }).filter((item) => { 54104 if (task.type === "owner" || task.type === "owner-subscription" || task.type === "owner-other") { 54105 return item.has_error_owner; 54106 } else if (task.type === "free-price") { 54107 return item.price?.is_free_price; 54108 } 54109 return true; 54110 }) 54111 })).filter((task) => task.items.length > 0); 54112 } catch (error) { 54113 console.warn("Erreur lors du rafraîchissement des items des tâches:", error); 54114 return tasks; 54115 } 54116 }; 54117 const _Cart = class _Cart { 54118 /**
54119 * Crée un nouveau panier 54120 * @param request - La requête de création d'un nouveau panier 54121 * @returns le panier créé 54122 */ 54123 static async newCart(request) { 54124 const api2 = new API(request.apiConfiguration); 54125 const { cartProvider, buyer, items, cart_origin } = request; 54126 if (!cartProvider) return; 54127 Loader.show(); 54128 const result = await api2.post(cartProvider, { 54129 items, 54130 cart_origin, 54131 ...buyer 54132 }); 54133 Loader.hide(); 54134 await this.handleResult({ request, api: api2, result }); 54135 return result; 54136 } 54137 static async patchCart(request) { 54138 const api2 = new API(request.apiConfiguration); 54139 const { cartProvider, buyer, items } = request; 54140 if (!cartProvider) return; 54141 Loader.show(); 54142 const result = await api2.patch(cartProvider, { 54143 items, 54144 ...buyer 54145 }); 54146 Loader.hide(); 54147 await this.handleResult({ request, api: api2, result }); 54148 return result; 54149 } 54150 /** 54151 * Ajoute des éléments au panier 54152 * @param request - La requête d'ajout d'éléments 54153 * @returns le panier mis à jour 54154 */ 54155 static async addItems(request) { 54156 const api2 = new API(request.apiConfiguration); 54157 const { 54158 cartProvider, 54159 items, 54160 auto_seating, 54161 fallback_available_quota, 54162 attachOwnersAfterRequest, 54163 editFreePriceAfterRequest, 54164 accessParams 54165 } = request; 54166 if (!cartProvider) return; 54167 const endPoint = itemsEndpoint(cartProvider); 54168 Loader.show(); 54169 const { campaignHash, campaignId, reservationRequestConfigId, customListSlug } = accessParams ?? {}; 54170 const result = await api2.post(endPoint, { 54171 items, 54172 auto_seating, 54173 fallback_available_quota, 54174 campaign_hash: campaignHash, 54175 campaign_id: campaignId, 54176 reservation_request_config_id: reservationRequestConfigId, 54177 custom_list_slug: customListSlug 54178 }); 54179 Loader.hide(); 54180 return await this.handleResult({ 54181 request, 54182 api: api2, 54183 result, 54184 attachOwnersAfterRequest, 54185 editFreePriceAfterRequest 54186 }); 54187 } 54188 /** 54189 * Modifie un ou plusieurs articles du panier 54190 * @param request - La requête de modification d'un article 54191 */ 54192 static async patchItems(request) { 54193 const api2 = new API(request.apiConfiguration); 54194 const { cartProvider } = request; 54195 if (!cartProvider) return; 54196 let endpoint = itemsEndpoint(cartProvider); 54197 endpoint = addQueryToEndpoint(endpoint, request.query); 54198 const result = await api2.patch(endpoint, request.body); 54199 return await this.handleResult({ request, api: api2, result }); 54200 } 54201 static async set(request) { 54202 const api2 = new API(request.apiConfiguration); 54203 const { cartProvider } = request; 54204 if (!cartProvider) return "error"; 54205 const requestsKey = request.apiConfiguration.serviceURL + cartProvider; 54206 let requests = this.setRequests.get(requestsKey); 54207 if (!requests) { 54208 this.setRequests.set(requestsKey, requests = {}); 54209 } 54210 if (requests.current) { 54211 requests.next = request; 54212 return "pending"; 54213 } 54214 requests.current = request; 54215 Loader.show({ noDelay: true }); 54216 let endPoint = itemsEndpoint(cartProvider); 54217 endPoint = addQueryToEndpoint(endPoint, request.query); 54218 const body = request.body || {}; 54219 const result = await api2.patch(endPoint, body); 54220 delete requests.current; 54221 Loader.hide(); 54222 if (requests.next) { 54223 const next = requests.next; 54224 delete requests.next; 54225 return await this.set(next); 54226 } else { 54227 return await this.handleResult({ request, api: api2, result }); 54228 } 54229 } 54230 /** 54231 * Supprime un ou plusieurs articles du panier 54232 * @param request - La requête de suppression d'un article 54233 * sans Requête, elle supprime tous les articles du panier 54234 */ 54235 static async removeItems(request) { 54236 const api2 = new API(request.apiConfiguration); 54237 const cartProvider = request.cartProvider; 54238 if (!cartProvider) return; 54239 let endpoint = itemsEndpoint(cartProvider); 54240 endpoint = addQueryToEndpoint(endpoint, request.query); 54241 Loader.show(); 54242 const result = await api2.delete(endpoint, {}); 54243 Loader.hide(); 54244 await this.handleResult({ request, api: api2, result }); 54245 } 54246 /** 54247 * Gère le résultat d'une requête de panier 54248 * @param options - Les options de la requête 54249 * @returns le résultat de la requête 54250 */ 54251 static async handleResult(options) { 54252 const { request, api: api2, result, attachOwnersAfterRequest, editFreePriceAfterRequest } = options; 54253 const { cartProvider } = request; 54254 if (!cartProvider) return "error"; 54255 if (!result) { 54256 const alertMessage = { messages: [{ content: "Network Error", status: "error" }] }; 54257 dp(cartProvider).set(alertMessage); 54258 return "error"; 54259 } 54260 if (result.data && "items" in result.data) { 54261 dp(cartProvider).set(result); 54262 if (window.self !== window.top) { 54263 window.top?.postMessage({ invalidate: [cartProvider] }, "*"); 54264 } 54265 const hasErrors = result.messages?.some((m2) => m2.status === "error"); 54266 if (hasErrors) { 54267 await this.updateCart(api2, cartProvider); 54268 return "differentFromRequest";
54269 } else { 54270 if ("items" in request && (editFreePriceAfterRequest || attachOwnersAfterRequest)) { 54271 const items = result.data?.items ?? []; 54272 handlePostRequestModals(request, items, editFreePriceAfterRequest); 54273 } 54274 if ("items" in request) { 54275 this.handleTracking(request.items, result.data); 54276 } 54277 return "asRequested"; 54278 } 54279 } else { 54280 await this.updateCart(api2, cartProvider); 54281 return "differentFromRequest"; 54282 } 54283 } 54284 static handleTracking(items, cart) { 54285 if (cart?.cartType !== CartType.Cart) { 54286 return; 54287 } 54288 items.forEach((item) => { 54289 const cartItem = cart.items?.find((i2) => i2.entity_id === item.entity_id && i2.price?.id === item.price?.id); 54290 const entity = cart.entities?.find((e2) => e2.id === item.entity_id); 54291 if (!cartItem || !entity) { 54292 return; 54293 } 54294 const title = entity.edito?.title ?? "Produit"; 54295 const trackingCartItem = { 54296 item: { ...cartItem, quantity: item.quantity }, 54297 title, 54298 total: String(cart.total) 54299 }; 54300 TrackingManager.getTrackingManager((trackingManager) => { 54301 trackingManager.trackingOnCart(trackingCartItem); 54302 }); 54303 }); 54304 } 54305 static async updateCart(api2, dataProvider) { 54306 let result = await api2.get(dataProvider); 54307 if (!result) { 54308 result = { 54309 messages: [ 54310 { 54311 content: "Network Error", 54312 status: "error" 54313 } 54314 ] 54315 }; 54316 dp(dataProvider).set(result); 54317 return; 54318 } 54319 const isWaitingList2 = dataProvider.includes("waiting-list"); 54320 if (isWaitingList2) { 54321 const linkedCartProvider = "cart/current"; 54322 const cartCurrentResult = await api2.get(linkedCartProvider); 54323 if (cartCurrentResult) { 54324 dp(linkedCartProvider).set(cartCurrentResult); 54325 } 54326 } 54327 dp(dataProvider).set(result); 54328 } 54329 static async delete(api2, dataProvider) { 54330 const result = await api2.delete(dataProvider, {}); 54331 if (result?.success) { 54332 await this.updateCart(api2, dataProvider); 54333 } 54334 return result; 54335 } 54336 }; 54337 _Cart.setRequests = /* @__PURE__ */ new Map(); 54338 let Cart = _Cart; 54339 const flattenObject = (obj, prefix = "") => { 54340 let result = {}; 54341 for (const key in obj) { 54342 if (Object.prototype.hasOwnProperty.call(obj, key)) { 54343 const value = obj[key]; 54344 const newKey = prefix ? `${prefix}[${key}]` : key; 54345 if (typeof value === "object" && !Array.isArray(value)) { 54346 Object.assign(result, flattenObject(value, newKey)); 54347 } else if (Array.isArray(value)) { 54348 value.forEach((val, index) => { 54349 result[`${newKey}[${index}]`] = val; 54350 }); 54351 } else { 54352 result[newKey] = value; 54353 } 54354 } 54355 } 54356 return result; 54357 }; 54358 const itemsEndpoint = (cartProvider) => { 54359 return cartProvider + "/items"; 54360 }; 54361 const addQueryToEndpoint = (endpoint, query) => { 54362 if (!query) return endpoint; 54363 const queryParams = new URLSearchParams(flattenObject(query)); 54364 return `${endpoint}?${queryParams.toString()}`; 54365 }; 54366 const getItemsWithParentId = (items) => { 54367 return items.filter((item) => item.parent_id); 54368 }; 54369 const getItemsWithoutMatchingParent = (items) => { 54370 const itemsWithoutParent = items.filter((item) => { 54371 if (!item.parent_id) return true; 54372 return !items.some((i2) => i2.id === item.parent_id); 54373 }); 54374 return itemsWithoutParent; 54375 }; 54376 const getTotal = (item) => { 54377 let quantity = item.quantity || 0; 54378 let total = item.price?.amount ? parseFloat((item.price.amount * quantity).toString()) : 0; 54379 if (!item.items) return total; 54380 item.items?.forEach((subItem) => { 54381 if (subItem.price?.amount) { 54382 const subitemQuantity = subItem.quantity || 0; 54383 const subitemTotal = parseFloat((subItem.price.amount * subitemQuantity).toString()); 54384 total += subitemTotal || 0; 54385 } 54386 }); 54387 return total; 54388 }; 54389 const groupItemsByEntity = (items, entities) => { 54390 const clonedItems = structuredClone(items); 54391 const itemsWithoutParent = getItemsWithoutMatchingParent(clonedItems); 54392 const itemsWithParentId = getItemsWithParentId(clonedItems); 54393 const groupedItems = [];
54394 entities.forEach((entity) => { 54395 const matchingItems = itemsWithoutParent.filter( 54396 (item) => item.entity_id === entity.id && item.entity_type === entity.entity_type 54397 ); 54398 if (matchingItems.length === 0) { 54399 return; 54400 } 54401 const entityGroup = { 54402 entity, 54403 items: [] 54404 }; 54405 matchingItems.forEach((item) => { 54406 const childItems = itemsWithParentId.filter((childItem) => childItem.parent_id === item.id); 54407 const total = getTotal(item) + childItems.reduce((sum, childItem) => sum + getTotal(childItem), 0); 54408 const itemWithTotal = { ...item, total, items: [item, ...childItems] }; 54409 if (item.entity_type === EntityType.Subscribe) { 54410 const hash = item.infos?.hash; 54411 entityGroup.hash = hash; 54412 entityGroup.items.push(itemWithTotal); 54413 } else { 54414 const existingPrice = entityGroup.items.find( 54415 (i2) => i2.price?.id === item.price?.id && i2.quota?.id === item.quota?.id && i2.price?.amount === item.price?.amount
54416 ); 54417 if (existingPrice) { 54418 existingPrice.items.push(...itemWithTotal.items); 54419 existingPrice.total += total; 54420 existingPrice.quantity = (existingPrice.quantity || 0) + (item.quantity || 0); 54421 existingPrice.owner_required = item.owner_required; 54422 } else { 54423 entityGroup.items.push({ 54424 ...itemWithTotal, 54425 quantity: item.quantity || 0, 54426 messages: item.messages || [], 54427 canEditQuantity: !!item.canEditQuantity, 54428 canDelete: !!item.canDelete 54429 }); 54430 } 54431 } 54432 }); 54433 entityGroup.items.sort((a2, b2) => (Number(a2.price?.id) || 0) - (Number(b2.price?.id) || 0)); 54434 groupedItems.push(entityGroup); 54435 }); 54436 return groupedItems.filter((item) => item.items.length > 0); 54437 }; 54438 const getTicketsQuantity = (items) => { 54439 return items.reduce((acc, item) => { 54440 if (item.entity_type === EntityType.Event) { 54441 acc += item.quantity || 0; 54442 } 54443 return acc; 54444 }, 0); 54445 }; 54446 const moveCartItems = (items, options) => { 54447 if (!items) return; 54448 let itemsToMove = []; 54449 if (items.some((item) => item.items?.length)) { 54450 items.forEach((item) => { 54451 itemsToMove.push(...item.items || []); 54452 }); 54453 } else { 54454 itemsToMove = structuredClone(items || []); 54455 } 54456 const sourcePublisher = dp(options.sourceDataProvider); 54457 const targetPublisher = dp(options.targetDataProvider); 54458 const targetPublisherCurrentItems = targetPublisher.items.get() || []; 54459 const seenIds = new Set(targetPublisherCurrentItems.map((item) => String(item.id))); 54460 const uniqueClonedItems = itemsToMove.filter((item) => !seenIds.has(item.id)); 54461 const targetPublisherUpdatedItems = [...targetPublisherCurrentItems, ...uniqueClonedItems]; 54462 targetPublisher.items.set(targetPublisherUpdatedItems); 54463 targetPublisher.quantity.set(getTicketsQuantity(targetPublisherUpdatedItems)); 54464 const sourceItems = sourcePublisher.items?.get(); 54465 const sourceItemsAfterUpdate = sourceItems?.filter((item) => !itemsToMove.some((i2) => i2.id === item.id)) || []; 54466 sourcePublisher.items.set(sourceItemsAfterUpdate); 54467 sourcePublisher.quantity.set(getTicketsQuantity(sourceItemsAfterUpdate)); 54468 }; 54469 const matchOwners = (owner1, owner2) => { 54470 if (owner1.email && owner2.email && owner1.email !== owner2.email) { 54471 return false; 54472 } 54473 return owner1.firstName === owner2.firstName && owner1.lastName === owner2.lastName && owner1.email === owner2.email; 54474 }; 54475 const isNonEmptyOwner = (owner) => { 54476 if (!owner) { 54477 return false; 54478 } 54479 return Boolean( 54480 owner.uid || owner.firstName?.trim() || owner.lastName?.trim() || owner.email?.trim() || owner.structure?.trim() || owner.address?.trim() || owner.postalCode?.trim() || owner.phoneNumber?.trim() 54481 ); 54482 }; 54483 const sortCartOwners = (uniqueOwners) => uniqueOwners.sort((a2, b2) => { 54484 const isAAnonymous = !a2.firstName && !a2.lastName && !a2.email; 54485 const isBAnonymous = !b2.firstName && !b2.lastName && !b2.email; 54486 if (isAAnonymous !== isBAnonymous) { 54487 return isAAnonymous ? 1 : -1; 54488 } 54489 if (!a2.lastName && b2.lastName) return 1; 54490 if (a2.lastName && !b2.lastName) return -1; 54491 if (a2.lastName && b2.lastName) { 54492 return a2.lastName.localeCompare(b2.lastName); 54493 } 54494 if (a2.email && b2.email) { 54495 return a2.email.localeCompare(b2.email); 54496 } 54497 if (!a2.email && b2.email) return 1; 54498 if (a2.email && !b2.email) return -1; 54499 return 0; 54500 }); 54501 const getCartOwners = (items) => { 54502 if (!items || !items.length) return []; 54503 const owners = items.filter((item) => item.owner).map((item) => item.owner); 54504 const uniqueOwners = owners?.reduce((acc, current2) => { 54505 if (!current2) return acc; 54506 const isDuplicate = acc.some((owner) => matchOwners(owner, current2)); 54507 if (!isDuplicate) { 54508 acc.push(current2); 54509 } 54510 return acc; 54511 }, []); 54512 return sortCartOwners(uniqueOwners); 54513 }; 54514 const getCartSubscriptions = ({ 54515 items, 54516 linked_subscriptions, 54517 can_attach_events 54518 }) => {
54519 let cartSubscriptions = items.filter((item) => item.entity_type === EntityType.Subscribe); 54520 let linkedSubscriptions = linked_subscriptions?.map((sub2) => prePurchaseSubscriptionToLineItemCart(sub2)).filter((sub2) => !!sub2) || []; 54521 let mergedSubscriptions = [...cartSubscriptions, ...linkedSubscriptions]; 54522 if (can_attach_events) { 54523 mergedSubscriptions = mergedSubscriptions.filter((sub2) => sub2.can_attach_events); 54524 } 54525 return mergedSubscriptions; 54526 }; 54527 const getCartOwnerSuggestions = ({ items, linked_subscriptions }) => { 54528 const cartItems = items || []; 54529 const subscriptionOwners = []; 54530 const otherOwners = []; 54531 const pushUniqueOwner = (acc, owner, exclude = []) => { 54532 if (!isNonEmptyOwner(owner)) { 54533 return; 54534 } 54535 if ([...acc, ...exclude].some((existing) => matchOwners(existing, owner))) { 54536 return; 54537 } 54538 acc.push(owner); 54539 }; 54540 for (const item of cartItems) { 54541 if (item.entity_type === EntityType.Subscribe) { 54542 pushUniqueOwner(subscriptionOwners, item.owner); 54543 } 54544 } 54545 for (const purchase of linked_subscriptions || []) { 54546 pushUniqueOwner(subscriptionOwners, purchase.owner); 54547 } 54548 for (const item of cartItems) { 54549 if (item.entity_type === EntityType.Subscribe) { 54550 continue; 54551 } 54552 pushUniqueOwner(otherOwners, item.owner, subscriptionOwners); 54553 } 54554 return [...subscriptionOwners, ...otherOwners]; 54555 }; 54556 const prePurchaseSubscriptionToLineItemCart = (purchase) => { 54557 if (purchase?.entity_type !== EntityType.Subscribe) return void 0; 54558 const priceId = purchase.price?.id; 54559 const price = priceId ? { 54560 id: priceId, 54561 amount: purchase.price?.amount, 54562 label: purchase.price?.label 54563 } : void 0; 54564 return { 54565 id: "subscription_" + purchase.id, 54566 entity_type: EntityType.Subscribe, 54567 entity_id: Number(purchase.entity?.id), 54568 owner: purchase.owner || {}, 54569 price, 54570 can_attach_events: !!purchase.can_attach_events 54571 }; 54572 }; 54573 const isPrePurchaseSubscription = (purchase) => { 54574 return purchase.entity_type === EntityType.Subscribe && purchase.id?.toString().startsWith("subscription_"); 54575 }; 54576 const getParentItem = (item, cartProvider) => { 54577 const cartContent = dp(cartProvider).data.get(); 54578 const parentItem = cartContent?.items?.find((i2) => i2.id === item.parent_id); 54579 if (parentItem) return parentItem; 54580 const parentLinkedSubscription = cartContent?.linked_subscriptions?.find( 54581 (i2) => Number(i2.id) === Number(item.parent_id?.replace("subscription_", "")) 54582 ); 54583 if (!parentLinkedSubscription) return void 0; 54584 return prePurchaseSubscriptionToLineItemCart(parentLinkedSubscription); 54585 }; 54586 const getSubscriptionRules = (entityId, cartProvider) => { 54587 const entities = dp(cartProvider).data.entities.get(); 54588 const subscriptionEntity = entities.find( 54589 (item) => Number(item.id) === Number(entityId) && item.entity_type === EntityType.Subscribe 54590 ); 54591 if (!subscriptionEntity) return; 54592 return subscriptionEntity.rules; 54593 }; 54594 const getSeatOwnerFromCart = (seatId, cartProvider) => { 54595 const cartItems = dp(cartProvider).data.items.get(); 54596 const matchingItem = cartItems?.find((item) => item.seat?.id === seatId); 54597 if (!matchingItem) return; 54598 const ownerFromParent = matchingItem.parent_id ? getParentItem(matchingItem, cartProvider)?.owner : void 0; 54599 return ownerFromParent || matchingItem.owner; 54600 }; 54601 const getLineItemCartForSeat = (seatId, cartProvider) => { 54602 const cartItems = dp(cartProvider).data.items.get(); 54603 const matchingItem = cartItems?.find((item) => item.seat?.id === seatId); 54604 return matchingItem; 54605 }; 54606 const cartTitle = (cartType) => { 54607 switch (cartType) { 54608 case CartType.Cart: 54609 return t("cart_title_panier"); 54610 case CartType.Reservation: 54611 return t("cart_title_reservation"); 54612 case CartType.Order: 54613 return t("cart_title_commande"); 54614 case CartType.ReservationRequest: 54615 return t("cart_title_demande_de_reservation"); 54616 case CartType.Split: 54617 return t("cart_title_retrait_partiel"); 54618 case CartType.WaitingLists: 54619 return t("cart_title_liste_attente"); 54620 default: 54621 return t("cart_title_panier"); 54622 } 54623 }; 54624 const lockReservationRequest = async (apiConfiguration, cartProvider) => { 54625 const api2 = new API(apiConfiguration); 54626 const result = await api2.post(cartProvider + "/submit", {}); 54627 const isSuccess = result.success ?? false; 54628 if (isSuccess) { 54629 await Cart.updateCart(api2, cartProvider); 54630 } 54631 return isSuccess; 54632 }; 54633 const getSessionItems = (items, entityId, parentId) => { 54634 return items.filter((item) => { 54635 const matchParent = parentId ? item.parent_id === parentId : !item.parent_id; 54636 return matchParent && item.entity_id === entityId && item.entity_type === EntityType.Event; 54637 }); 54638 }; 54639 const cartProviderKey = (cartType, id) => { 54640 switch (cartType) { 54641 case CartType.ReservationRequest: 54642 return `reservation-request${id ? `/${id}` : ""}`; 54643 case CartType.WaitingLists: 54644 return `waiting-lists${id ? `/${id}` : ""}`; 54645 case CartType.Reservation: 54646 return `reservations${id ? `/${id}` : ""}`; 54647 case CartType.Order: 54648 return `orders${id ? `/${id}` : ""}`; 54649 default: 54650 case CartType.Cart: 54651 return `cart${id ? `/${id}` : "/current"}`; 54652 } 54653 }; 54654 var __defProp$1j = Object.defineProperty; 54655 var __getOwnPropDesc$1l = Object.getOwnPropertyDescriptor; 54656 var __decorateClass$1l = (decorators, target, key, kind) => { 54657 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1l(target, key) : target; 54658 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 54659 if (decorator = decorators[i2]) 54660 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 54661 if (kind && result) __defProp$1j(target, key, result); 54662 return result; 54663 }; 54664 let SonicReservationIcon = class extends Subscriber$1(i$6) { 54665 constructor() { 54666 super(...arguments); 54667 this.noRemainingTime = false;
54668 } 54669 render() { 54670 const { quantity, cartType } = this.props ?? {}; 54671 return b$1`<span class="sr-only">${cartTitle(cartType)} ${quantity ? b$1`${quantity} items` : A$1}</span> 54672 54673 <div class="inline-flex relative items-center justify-center align-center"> 54674 <slot name="icon"> 54675 <sonic-icon library="custom" name="basket-shopping" size="${o$4(this.size)}"></sonic-icon> 54676 </slot> 54677 <sonic-cart-item-count class="item-count"></sonic-cart-item-count> 54678 ${!this.noRemainingTime ? b$1`<sonic-cart-remaining-time 54679 class="remaining-time" 54680 badge 54681 style="font-size: clamp(9px, 0.45em, 0.75rem);" 54682 ></sonic-cart-remaining-time>` : A$1} 54683 </div>`; 54684 } 54685 }; 54686 SonicReservationIcon.styles = [ 54687 tailwind, 54688 i$9` 54689 /*:host { 54690 vertical-align: text-bottom; 54691 display: inline-flex; 54692 }*/ 54693 54694 :host { 54695 display: inline-flex; 54696 } 54697 54698 .item-count { 54699 position: absolute; 54700 left: 50%; 54701 top: 50%; 54702 transform: translate(-50%, -50%) translate(-1.35em, -1.35em); 54703 } 54704 54705 .remaining-time { 54706 position: absolute; 54707 left: 50%; 54708 top: 100%; 54709 transform: translate(-50%, 10%); 54710 } 54711 ` 54712 ]; 54713 __decorateClass$1l([ 54714 n$5({ type: String }) 54715 ], SonicReservationIcon.prototype, "size", 2); 54716 __decorateClass$1l([ 54717 n$5({ type: Boolean }) 54718 ], SonicReservationIcon.prototype, "noRemainingTime", 2); 54719 SonicReservationIcon = __decorateClass$1l([ 54720 t$3("sonic-reservation-icon") 54721 ], SonicReservationIcon); 54722 var __defProp$1i = Object.defineProperty; 54723 var __getOwnPropDesc$1k = Object.getOwnPropertyDescriptor; 54724 var __decorateClass$1k = (decorators, target, key, kind) => { 54725 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1k(target, key) : target; 54726 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 54727 if (decorator = decorators[i2]) 54728 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 54729 if (kind && result) __defProp$1i(target, key, result); 54730 return result; 54731 }; 54732 let SonicUserIcon = class extends i$6 { 54733 render() { 54734 if (this.userId) { 54735 return b$1`<sonic-icon 54736 library="custom" 54737 prefix="solid" 54738 name="user-check" 54739 size="${o$4(this.size)}" 54740 class="translate-x-[.1em] inline-block" 54741 ></sonic-icon>`; 54742 } 54743 return b$1`<sonic-icon library="custom" name="user" size="${o$4(this.size)}"></sonic-icon>`; 54744 } 54745 }; 54746 SonicUserIcon.styles = [ 54747 tailwind, 54748 i$9` 54749 :host { 54750 display: inline-flex; 54751 } 54752 ` 54753 ]; 54754 __decorateClass$1k([ 54755 n$5({ type: String }) 54756 ], SonicUserIcon.prototype, "size", 2); 54757 __decorateClass$1k([ 54758 bind$1("user.id"), 54759 n$5({ type: String }) 54760 ], SonicUserIcon.prototype, "userId", 2); 54761 SonicUserIcon = __decorateClass$1k([ 54762 t$3("sonic-user-icon") 54763 ], SonicUserIcon); 54764 var __defProp$1h = Object.defineProperty; 54765 var __getOwnPropDesc$1j = Object.getOwnPropertyDescriptor; 54766 var __decorateClass$1j = (decorators, target, key, kind) => { 54767 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1j(target, key) : target; 54768 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 54769 if (decorator = decorators[i2]) 54770 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 54771 if (kind && result) __defProp$1h(target, key, result); 54772 return result; 54773 }; 54774 const tagName$Z = "sonic-header"; 54775 let SonicHeader = class extends Subscriber$1(i$6) { 54776 constructor() { 54777 super(...arguments); 54778 this.showOffCanvas = false; 54779 this.closeOffCanvas = false; 54780 this.enableOffCanvas = false; 54781 this.showBaseline = false; 54782 this.noPaddingX = false; 54783 this._isAccesibilityMode = false; 54784 this.handleSonicA11y = (e2) => { 54785 const customEvent = e2; 54786 this._isAccesibilityMode = customEvent.detail.a11y; 54787 }; 54788 } 54789 connectedCallback() { 54790 this.enableOffCanvas = this.hasAncestorAttribute("enableOffCanvas"); 54791 this.showBaseline = this.hasAncestorAttribute("defaultFrontend"); 54792 if (document.documentElement.hasAttribute("data-sonic-a11y")) { 54793 this._isAccesibilityMode = true; 54794 } 54795 window.addEventListener("sonicA11y", this.handleSonicA11y); 54796 super.connectedCallback(); 54797 } 54798 disconnectedCallback() { 54799 window.removeEventListener("sonicA11y", this.handleSonicA11y); 54800 super.disconnectedCallback(); 54801 } 54802 getBaseline() { 54803 const lang = document.documentElement.lang.split("-")[0]; 54804 const wording2 = { 54805 fr: "Billetterie", 54806 en: "Ticketing", 54807 nl: "Tickets", 54808 de: "Eintrittskarten" 54809 }; 54810 return wording2[lang] || wording2.fr;
54811 } 54812 getMarquee() { 54813 return b$1`<marquee> 54814 ${this.testMode ? b$1`Mode test` : A$1} ${this.testMode && this.isAuthorizedIP ? " ⢠" : A$1} 54815 ${this.isAuthorizedIP ? b$1`Fermée â IP autorisée` : A$1} 54816 </marquee>`; 54817 } 54818 render() { 54819 return b$1`<div 54820 class="h-[--sc-header-height] -mt-cgy ${this.noPaddingX ? "" : "-mx-cgx px-cgx"} py-[--sc-header-gy] flex" 54821 > 54822 <div class="flex items-center gap-4 grow"> 54823 ${this.enableOffCanvas && (this.showOffCanvas || this.closeOffCanvas) && this.isStoreOnline !== false ? b$1` 54824 <!-- Toggle menu --> 54825 <div class="flex items-center gap-4"> 54826 <sonic-button 54827 data-aria-label="Menu" 54828 formDataProvider="offCanvas" 54829 name="displayOffCanvas" 54830 value="true" 54831 size="lg" 54832 shape="circle" 54833 unique 54834 icon 54835 >${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>`} 54836 </sonic-button> 54837 </div> 54838 ` : A$1} 54839 <!-- Logo --> 54840 <div class="h-full max-w-[12rem] relative mr-2 lg:mr-3 flex items-center"> 54841 <div class="h-full flex w-full items-center ${this._isAccesibilityMode ? "logo-a11y-wrapper" : ""} "> 54842 <sonic-theme-logo class="${this._isAccesibilityMode ? "logo-a11y-mode" : ""} h-full"></sonic-theme-logo> 54843 </div> 54844 ${this.renderBaseline()} 54845 </div> 54846 54847 <!-- Outils --> 54848 <div class="flex items-center pl-3 lg:pl-4 gap-1 border-l border-neutral-200"> 54849 <sonic-tooltip label=${o$4(t("mon_compte"))} placement="bottom"> 54850 <sonic-app-link 54851 to="account" 54852 shape="circle" 54853 variant="ghost" 54854 data-aria-label="${o$4(t("mon_compte"))}" 54855 size="lg" 54856 type=${this.userId ? "primary" : "default"} 54857 icon 54858 > 54859 <sonic-user-icon></sonic-user-icon> 54860 </sonic-app-link> 54861 </sonic-tooltip> 54862 ${this.isStoreOnline !== false ? b$1` <sonic-tooltip label=${o$4(t("panier"))} placement="bottom"> 54863 <sonic-app-link to="cart" shape="circle" variant="ghost" size="lg" icon data-aria-label=${t("panier")}> 54864 <sonic-reservation-icon 54865 dataProvider="cart/current" 54866 subDataProvider="data" 54867 ></sonic-reservation-icon> </sonic-app-link 54868 ></sonic-tooltip>` : A$1} 54869 54870 <!--Attention - n'est rendu que si le composant est défini, par le site par exemple --> 54871 <sonic-a11y 54872 class="text-xl ml-2" 54873 aria-label="${t("toggle_accessibility_mode")}" 54874 title="${t("toggle_accessibility_mode")}" 54875 > 54876 <sonic-a11y-icon></sonic-a11y-icon 54877 ></sonic-a11y> 54878 </div> 54879 </div> 54880 </div>`; 54881 } 54882 renderBaseline() { 54883 const headerBaseline = this.getBaseline(); 54884 if (this.testMode || this.isAuthorizedIP) { 54885 return b$1`<div 54886 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" 54887 > 54888 ${this.getMarquee()} 54889 </div>`; 54890 } else if (this.showBaseline) { 54891 return b$1`<sonic-badge type="neutral" size="xs" class="absolute top-[100%] left-0 mt-[.35rem]" 54892 ><span class="font-bold text-nowrap">â ${headerBaseline}</span></sonic-badge 54893 > `; 54894 } 54895 return A$1; 54896 } 54897 }; 54898 SonicHeader.styles = [ 54899 tailwind, 54900 i$9` 54901 .logo-a11y-mode { 54902 filter: hue-rotate(180deg) brightness(100%) contrast(30%) brightness(50%) saturate(100%); 54903 } 54904 54905 @media (prefers-color-scheme: dark) { 54906 .logo-a11y-mode { 54907 filter: invert(1) hue-rotate(180deg) brightness(100%) contrast(30%) brightness(100%) saturate(100%); 54908 } 54909 } 54910 ` 54911 ]; 54912 __decorateClass$1j([ 54913 n$5({ type: Boolean }) 54914 ], SonicHeader.prototype, "showOffCanvas", 2); 54915 __decorateClass$1j([ 54916 n$5({ type: Boolean }) 54917 ], SonicHeader.prototype, "closeOffCanvas", 2); 54918 __decorateClass$1j([ 54919 n$5({ type: Boolean }) 54920 ], SonicHeader.prototype, "enableOffCanvas", 2); 54921 __decorateClass$1j([ 54922 n$5({ type: Boolean }) 54923 ], SonicHeader.prototype, "showBaseline", 2); 54924 __decorateClass$1j([ 54925 n$5({ type: Boolean }) 54926 ], SonicHeader.prototype, "noPaddingX", 2); 54927 __decorateClass$1j([ 54928 bind$1("user.id"), 54929 n$5({ type: String }) 54930 ], SonicHeader.prototype, "userId", 2); 54931 __decorateClass$1j([ 54932 r$5() 54933 ], SonicHeader.prototype, "_isAccesibilityMode", 2); 54934 __decorateClass$1j([ 54935 bind$1("settings.is_online"), 54936 n$5({ type: Boolean }) 54937 ], SonicHeader.prototype, "isStoreOnline", 2); 54938 __decorateClass$1j([ 54939 bind$1("settings.test_mode"), 54940 n$5({ type: Boolean }) 54941 ], SonicHeader.prototype, "testMode", 2); 54942 __decorateClass$1j([ 54943 bind$1("settings.is_authorized_ip"), 54944 n$5({ type: Boolean }) 54945 ], SonicHeader.prototype, "isAuthorizedIP", 2); 54946 SonicHeader = __decorateClass$1j([ 54947 t$3(tagName$Z), 54948 awaitConnectedAncestors(APP_TAG_SELECTOR) 54949 ], SonicHeader); 54950 var __defProp$1g = Object.defineProperty; 54951 var __getOwnPropDesc$1i = Object.getOwnPropertyDescriptor; 54952 var __decorateClass$1i = (decorators, target, key, kind) => { 54953 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1i(target, key) : target; 54954 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 54955 if (decorator = decorators[i2]) 54956 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 54957 if (kind && result) __defProp$1g(target, key, result); 54958 return result; 54959 }; 54960 const tagName$Y = "sonic-language-menu"; 54961 let SonicComponent$d = class SonicComponent extends Subscriber$1(i$6) { 54962 constructor() { 54963 super(...arguments); 54964 this.langs = []; 54965 this.wording_page_available_in_multiple_languages = ""; 54966 } 54967 willUpdate(changedProperties) { 54968 if (changedProperties.has("langs") || changedProperties.has("wording_page_available_in_multiple_languages")) { 54969 if (this.langs.length < 2) return; 54970 const htmlLang = document.documentElement.lang.split("-")[0]; 54971 const navigatorLang = window.navigator.language.split("-")[0]; 54972 if (navigatorLang != htmlLang && isWordingReady("page_available_in_multiple_languages") && !localStorage.getItem("SonicSelectedLanguage")) { 54973 const toast = { 54974 text: ( 54975 /*html*/ 54976 `${this.wording_page_available_in_multiple_languages} <br /> 54977 <div style="margin-top:.25em"> 54978 ${this.langs.map( 54979 (lang) => `<sonic-button 54980 href="?language=${lang}" 54981 autoActive="disabled" 54982 shape="circle" 54983 variant="outline" 54984 size="xs" 54985 onClick="localStorage.setItem('SonicSelectedLanguage', '${lang}')" 54986 ><span style="text-transform:uppercase">${lang}</span></sonic-button 54987 >` 54988 ).join(" ")} 54989 </div>` 54990 ), 54991 id: "language-menu-toast", 54992 status: "info", 54993 preserve: true,
54994 dismissForever: true 54995 }; 54996 SonicToast.add(toast); 54997 } 54998 } 54999 super.willUpdate(changedProperties); 55000 } 55001 render() { 55002 if (this.langs.length > 1) { 55003 return b$1`<div class="flex flex-wrap gap-1 items-center"> 55004 <!-- <sonic-icon name="translate" library="custom"></sonic-icon> --> 55005 ${this.langs.map((lang) => { 55006 return b$1`<sonic-button 55007 href="?language=${lang}" 55008 autoActive="disabled" 55009 ?active=${lang.split("-")[0] == HTML$1.getLanguage()?.split("-")[0]} 55010 shape="circle" 55011 size="xs" 55012 @click=${() => localStorage.setItem("SonicSelectedLanguage", lang)} 55013 ><span class="uppercase">${lang}</span></sonic-button 55014 > `; 55015 })} 55016 </div>`; 55017 } else { 55018 return A$1; 55019 } 55020 } 55021 }; 55022 SonicComponent$d.styles = [tailwind]; 55023 __decorateClass$1i([ 55024 n$5({ type: Array }) 55025 ], SonicComponent$d.prototype, "langs", 2); 55026 __decorateClass$1i([ 55027 n$5({ type: String }) 55028 ], SonicComponent$d.prototype, "wording_page_available_in_multiple_languages", 2); 55029 SonicComponent$d = __decorateClass$1i([ 55030 t$3(tagName$Y) 55031 ], SonicComponent$d); 55032 async function getAgenda(id, htmlContext) { 55033 const api2 = new API(HTML$1.getApiConfiguration(htmlContext)); 55034 const result = await api2.get(`/agendas/${id}`); 55035 if (result.success && result.data) { 55036 return result.data; 55037 } 55038 return null; 55039 } 55040 async function getAgendas(htmlContext, excludeMainAgenda = false) { 55041 const api2 = new API(HTML$1.getApiConfiguration(htmlContext)); 55042 const result = await api2.get(`/agendas${excludeMainAgenda ? "?exclude_main=true" : ""}`); 55043 if (result.success && result.data) { 55044 return result.data; 55045 } 55046 return []; 55047 } 55048 const getBrandLogo = (brand, options) => { 55049 const color = options?.color ?? "currentColor"; 55050 const className = options?.className; 55051 if (brand?.id === "soticket") { 55052 return b$1` 55053 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 133 42.1" fill=${color} class=${className}> 55054 <path 55055 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" 55056 class="cls-1" 55057 /> 55058 <path 55059 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
550591.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" 55060 /> 55061 </svg> 55062 `; 55063 } else { 55064 return b$1` 55065 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 242.8 62.9" fill=${color} class=${className}> 55066 <g> 55067 <path 55068 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" 55069 /> 55070 <g> 55071 <path 55072 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
55072-.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" 55073 /> 55074 </g> 55075 </g> 55076 <g> 55077 <path 55078 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" 55079 /> 55080 <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" /> 55081 <path 55082 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" 55083 /> 55084 <path 55085 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" 55086 style="fill:#d35162" 55087 /> 55088 </g> 55089 </svg> 55090 `; 55091 } 55092 }; 55093 var __defProp$1f = Object.defineProperty; 55094 var __getOwnPropDesc$1h = Object.getOwnPropertyDescriptor; 55095 var __decorateClass$1h = (decorators, target, key, kind) => { 55096 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1h(target, key) : target; 55097 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55098 if (decorator = decorators[i2]) 55099 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55100 if (kind && result) __defProp$1f(target, key, result); 55101 return result; 55102 }; 55103 const tagName$X = "sonic-brand-logo"; 55104 let SonicComponent$c = class SonicComponent extends Subscriber$1(i$6) { 55105 constructor() { 55106 super(...arguments); 55107 this.brand = {}; 55108 } 55109 render() { 55110 if (!this.brand.url || !this.brand.id) return A$1; 55111 return b$1`<sonic-link href=${this.brand.url} data-aria-label=${o$4(this.brand.url)} target="_blank" 55112 >${getBrandLogo(this.brand, { className: "w-full h-full" })} 55113 </sonic-link>`; 55114 } 55115 }; 55116 SonicComponent$c.styles = [ 55117 i$9` 55118 :host { 55119 display: block; 55120 } 55121 svg { 55122 display: block; 55123 width: 100%; 55124 } 55125 ` 55126 ]; 55127 __decorateClass$1h([ 55128 n$5({ type: Object }) 55129 ], SonicComponent$c.prototype, "brand", 2); 55130 SonicComponent$c = __decorateClass$1h([ 55131 t$3(tagName$X) 55132 ], SonicComponent$c); 55133 var __defProp$1e = Object.defineProperty; 55134 var __getOwnPropDesc$1g = Object.getOwnPropertyDescriptor; 55135 var __decorateClass$1g = (decorators, target, key, kind) => { 55136 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1g(target, key) : target; 55137 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55138 if (decorator = decorators[i2]) 55139 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55140 if (kind && result) __defProp$1e(target, key, result); 55141 return result; 55142 }; 55143 const tagName$W = "sonic-footer"; 55144 let SonicFooter = class extends Subscriber$1(i$6) { 55145 constructor() { 55146 super(...arguments); 55147 this.hideBottomMobile = false; 55148 this.modules = {}; 55149 this.infos = {}; 55150 this.is_online = false; 55151 this._displayCookiesButton = false; 55152 } 55153 connectedCallback() { 55154 if (!this.dataProvider) { 55155 this.dataProvider = "settings"; 55156 } 55157 this.setDisplayCookiesButton(); 55158 super.connectedCallback(); 55159 } 55160 setDisplayCookiesButton() { 55161 TrackingManager.getTrackingManager((trackingManager) => { 55162 this._displayCookiesButton = trackingManager.trackings.length > 0; 55163 }); 55164 } 55165 render() { 55166 const storeUrl = this.getAncestorAttributeValue("storeUrl") || ""; 55167 const phoneNumber = this.infos.address?.phone_number; 55168 let hrefPhoneNumber; 55169 if (phoneNumber) { 55170 hrefPhoneNumber = phoneNumber.replace(/[^+\d]+/g, ""); 55171 } 55172 return b$1`<div class="text-content"> 55173 <!-- Menu prefooter --> 55174 ${this.is_online !== false ? this.render_prefooter() : A$1} 55175 55176 <!-- Footer adresse --> 55177 <div 55178 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"}" 55179 >
55180 <span class="flex flex-wrap gap-x-3"> 55181 ${this.infos ? b$1`<span>${this.render_address()}</span>` : A$1} 55182 ${hrefPhoneNumber ? b$1`<span>â</span> 55183 <sonic-link 55184 href="tel:${hrefPhoneNumber}" 55185 class="hover:text-primary [&[active]]:underline underline-offset-2" 55186 > 55187 ${phoneNumber} 55188 </sonic-link>` : A$1} 55189 ${this.infos.website ? b$1`<span>â</span> 55190 <sonic-link 55191 href=${this.infos.website} 55192 target="_blank" 55193 class="hover:text-primary [&[active]]:underline underline-offset-2" 55194 > 55195 ${new URL(this.infos.website).host.replace("www.", "")} 55196 </sonic-link>` : A$1} 55197 </span> 55198 <span class="h-[var(--sc-border-width)] grow bg-current"></span> 55199 55200 <sonic-brand-logo class="w-[10rem] transition hover:scale-[.95]"></sonic-brand-logo> 55201 </div> 55202 55203 <!-- Menu Footer --> 55204 <div 55205 class=" flex-wrap gap-y-3 gap-x-6 lg:gap-x-14 text-[.8rem] ${this.hideBottomMobile ? " hidden lg:flex" : "flex"}" 55206 > 55207 ${this._displayCookiesButton ? b$1` 55208 <sonic-link href="#tarteaucitron" class="hover:text-primary [&[active]]:underline underline-offset-2"> 55209 ${t("LIB_gestion_des_cookies")} 55210 </sonic-link> 55211 ` : A$1} 55212 ${this.infos.legal_terms?.url ? b$1`<sonic-link 55213 href=${this.infos.legal_terms.url} 55214 target="_blank" 55215 class="hover:text-primary [&[active]]:underline underline-offset-2" 55216 > 55217 ${t("mentions_legales")} 55218 </sonic-link>` : A$1} 55219 ${this.infos.cgv_link ? b$1`<sonic-link 55220 href="${this.infos.cgv_link}" 55221 target="_blank" 55222 class="hover:text-primary [&[active]]:underline underline-offset-2" 55223 > 55224 ${t("cgv_de_la_billetterie")} 55225 </sonic-link>` : A$1} 55226 <sonic-link href="${storeUrl + "/user"}" class="hover:text-primary [&[active]]:underline underline-offset-2"> 55227 ${t("administration")} 55228 </sonic-link> 55229 </div> 55230 </div>`; 55231 } 55232 render_prefooter() { 55233 return b$1` <div 55234 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] " 55235 > 55236 <sonic-app-link to="store" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55237 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55238 <sonic-icon library="custom" prefix="regular" name="cart-shopping-fast" size="lg"></sonic-icon> 55239 <span class="pt-[.1em] inline-block text-pretty">${t("module_store_title")}</span> 55240 </div> 55241 </sonic-app-link> 55242 <sonic-app-link to="infosPrices" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55243 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55244 <sonic-icon library="custom" prefix="regular" name="circle-info" size="lg"></sonic-icon> 55245 <span class="pt-[.1em] inline-block text-pretty">${t("module_infos_title")}</span> 55246 </div> 55247 </sonic-app-link> 55248 ${this.modules.reelax?.access && this.modules.reelax?.url ? b$1`<sonic-button 55249 href=${this.modules.reelax?.url} 55250 variant="unstyled" 55251 class="[&[active]]:underline [&[active]]:text-primary underline-offset-2" 55252 > 55253 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55254 <sonic-icon library="custom" prefix="regular" name="ssks-reelax" size="lg"></sonic-icon> 55255 <span class="pt-[.1em] inline-block text-pretty">${t("module_reelax_title")}</span> 55256 </div> 55257 </sonic-button>` : A$1} 55258 ${this.modules.cashless?.access && this.modules.cashless?.url ? b$1`<sonic-button 55259 href=${this.modules.cashless?.url} 55260 variant="unstyled" 55261 class="[&[active]]:underline [&[active]]:text-primary underline-offset-2" 55262 > 55263 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55264 <sonic-icon library="custom" prefix="regular" name="mobile-signal-out" size="lg"></sonic-icon>
55265 <span class="pt-[.1em] inline-block text-pretty">${t("module_cashless_title")}</span> 55266 </div> 55267 </sonic-button>` : A$1} 55268 55269 <sonic-app-link to="orderRecover" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55270 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55271 <sonic-icon library="custom" prefix="regular" name="circle-question" size="lg"></sonic-icon> 55272 <span class="pt-[.1em] inline-block text-pretty">${t("module_order_recover_title")}</span> 55273 </div> 55274 </sonic-app-link> 55275 ${this.modules.promo?.enabled ? b$1` 55276 <sonic-app-link to="promo" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55277 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55278 <sonic-icon library="custom" prefix="regular" name="gift" size="lg"></sonic-icon> 55279 <span class="pt-[.1em] inline-block text-pretty">${t("module_promo_code_title")}</span> 55280 </div> 55281 </sonic-app-link> 55282 ` : A$1} 55283 ${this.modules.freeup_tickets?.enabled ? b$1` 55284 <sonic-app-link to="freeup" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55285 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55286 <sonic-icon library="custom" prefix="regular" name="hand-wave" size="lg"></sonic-icon> 55287 <span class="pt-[.1em] inline-block text-pretty">${t("free_up")}</span> 55288 </div> 55289 </sonic-app-link> 55290 ` : A$1} 55291 55292 <sonic-app-link to="reservationRequest" class="[&[active]]:underline [&[active]]:text-primary underline-offset-2"> 55293 <div class="flex gap-3 uppercase font-bold hover:text-primary text-[.8rem] lg:text-[1rem] "> 55294 <sonic-icon library="custom" prefix="regular" name="file-heart" size="lg"></sonic-icon> 55295 <span class="pt-[.1em] inline-block text-pretty">${t("LIB_reservation_request_title")}</span> 55296 </div> 55297 </sonic-app-link> 55298 </div>`; 55299 } 55300 render_address() { 55301 return b$1`${this.infos.editor_name ? b$1` <span>${this.infos.editor_name}</span>` : A$1} 55302 ${this.infos.address?.street ? b$1`<span class="[&:first-child]:hidden"> - </span><span>${this.infos.address.street}</span>` : A$1} 55303 ${this.infos.address?.street_2 ? b$1`<span class="[&:first-child]:hidden"> - </span><span>${this.infos.address.street_2}</span>` : A$1} 55304 ${this.infos.address?.zip_code || this.infos.address?.city || this.infos.address?.country ? b$1`<span class="[&:first-child]:hidden"> - </span 55305 ><span>${this.infos.address?.zip_code} ${this.infos.address?.city} ${this.infos.address?.country}</span>` : A$1} `; 55306 } 55307 }; 55308 SonicFooter.styles = [ 55309 tailwind, 55310 i$9` 55311 :host { 55312 display: block; 55313 padding-top: 3.5rem; 55314 padding-bottom: 3.5rem; 55315 } 55316 ` 55317 ]; 55318 __decorateClass$1g([ 55319 n$5({ type: Boolean }) 55320 ], SonicFooter.prototype, "hideBottomMobile", 2); 55321 __decorateClass$1g([ 55322 n$5({ type: Object }) 55323 ], SonicFooter.prototype, "modules", 2); 55324 __decorateClass$1g([ 55325 n$5({ type: Object }) 55326 ], SonicFooter.prototype, "infos", 2); 55327 __decorateClass$1g([ 55328 n$5({ type: Boolean }) 55329 ], SonicFooter.prototype, "is_online", 2); 55330 __decorateClass$1g([ 55331 r$5() 55332 ], SonicFooter.prototype, "_displayCookiesButton", 2); 55333 SonicFooter = __decorateClass$1g([ 55334 t$3(tagName$W), 55335 awaitConnectedAncestors(APP_TAG_SELECTOR) 55336 ], SonicFooter); 55337 var __defProp$1d = Object.defineProperty; 55338 var __getOwnPropDesc$1f = Object.getOwnPropertyDescriptor; 55339 var __decorateClass$1f = (decorators, target, key, kind) => { 55340 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1f(target, key) : target; 55341 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55342 if (decorator = decorators[i2]) 55343 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55344 if (kind && result) __defProp$1d(target, key, result); 55345 return result; 55346 }; 55347 const tagName$V = "sonic-off-canvas"; 55348 let SonicOffCanvas = class extends Subscriber$1(i$6) { 55349 constructor() { 55350 super(...arguments); 55351 this.displayOffCanvas = false;
55352 this.logoSrc = ""; 55353 this.customAgendas = []; 55354 } 55355 async willUpdate(_changedProperties) { 55356 if (_changedProperties.has("settings")) { 55357 const hasCustomAgendas = this.settings?.modules?.custom_agendas?.access; 55358 this.customAgendas = hasCustomAgendas ? (await getAgendas(this, true)).filter((agenda) => agenda.isLinkEnabled === true) : []; 55359 } 55360 } 55361 handleRoutes() { 55362 if (!this.href_agenda) { 55363 this.href_agenda = appRoute("agenda").toString(); 55364 } 55365 if (!this.href_subscription) { 55366 this.href_subscription = appRoute("subscription").toString(); 55367 } 55368 if (!this.href_giftcards) { 55369 this.href_giftcards = appRoute("giftcards").toString(); 55370 } 55371 if (!this.href_shop) { 55372 this.href_shop = appRoute("shop").toString(); 55373 } 55374 if (!this.href_carpooling) { 55375 this.href_carpooling = appRoute("carpooling").toString(); 55376 } 55377 if (!this.href_accreditationsDirectory) { 55378 this.href_accreditationsDirectory = appRoute("accreditationsDirectory").toString(); 55379 } 55380 } 55381 updated(_changedProperties) { 55382 const wasHiddenBefore = _changedProperties.get("displayOffCanvas") !== true; 55383 if (this.displayOffCanvas && wasHiddenBefore) { 55384 if (this.firstMenuItem) { 55385 this.firstMenuItem?.focus({ preventScroll: true }); 55386 } 55387 } 55388 super.updated(_changedProperties); 55389 } 55390 connectedCallback() { 55391 super.connectedCallback(); 55392 this.addEventListener("keydown", this.handleKeyDown); 55393 } 55394 disconnectedCallback() { 55395 this.removeEventListener("keydown", this.handleKeyDown); 55396 super.disconnectedCallback(); 55397 } 55398 handleKeyDown(event) { 55399 if (event.key === "Escape") { 55400 dp("offCanvas").displayOffCanvas.set(false); 55401 } 55402 } 55403 render() { 55404 this.handleRoutes(); 55405 const { agenda, subscription, giftcards, carpooling, shop, accreditations_directory } = this.settings?.modules || {}; 55406 return b$1`<div 55407 class="${this.displayOffCanvas ? "" : "hidden"} fixed flex flex-col inset-0 px-cgx py-cgy bg-neutral-0 overflow-auto z-[980]" 55408 > 55409 <sonic-header closeOffCanvas></sonic-header> 55410 55411 <div class="grow flex flex-col items-start gap-4 lg:gap-5 mt-7 lg:mt-8 mb-[2rem]" id="off-canvas-menu"> 55412 ${this.href_agenda && agenda?.access ? this.renderMenuItem(this.href_agenda, "calendar-day", t("module_agenda_title")) : A$1} 55413 ${this.customAgendas?.length > 0 ? c$1( 55414 this.customAgendas, 55415 (agenda2) => agenda2.id, 55416 (agenda2) => this.renderMenuItem( 55417 appRoute("customAgenda").fill({ slug: agenda2.slug }).toString(), 55418 "calendar-star", 55419 agenda2.title || "" 55420 ) 55421 ) : A$1} 55422 ${this.href_subscription && subscription?.access ? this.renderMenuItem(this.href_subscription, "address-card", t("onglet_home_abonnements")) : A$1} 55423 ${this.href_giftcards && giftcards?.access ? this.renderMenuItem(this.href_giftcards, "gift-card", t("module_giftcards_title")) : A$1} 55424 ${this.href_shop && shop?.access ? this.renderMenuItem(this.href_shop, "bags-shopping", t("module_shop_title")) : A$1} 55425 ${this.href_accreditationsDirectory && accreditations_directory?.access ? this.renderMenuItem(this.href_accreditationsDirectory, "address-book", t("accreditations_directory_title")) : A$1} 55426 ${this.href_carpooling && carpooling?.access ? this.renderMenuItem(this.href_carpooling, "car-side", t("module_carpooling_title")) : A$1} 55427 </div> 55428 55429 <sonic-language-menu dataProvider="settings" class="mb-6"></sonic-language-menu> 55430 <sonic-footer class="p-0" hideBottomMobile dataProvider="settings"></sonic-footer> 55431 </div>`; 55432 } 55433 renderMenuItem(href, iconName, label2) { 55434 return b$1`<sonic-button variant="unstyled" class="main-menu-item" href=${href} data-aria-label=${label2} 55435 ><div class="items-start group inline-flex gap-x-[.3em]"> 55436 <sonic-icon 55437 library="custom" 55438 prefix="light" 55439 class=" group-hover:opacity-0 transition-scale duration-200 group-hover:scale-[1.1]" 55440 name=${iconName} 55441 ></sonic-icon> 55442 <sonic-icon 55443 library="custom" 55444 prefix="thin" 55445 class="group-hover:opacity-100 absolute opacity-0 transition-transform duration-100 55446 ease-[cubic-bezier(0.16,0.69,0.54,1.15)] group-hover:scale-[1.15]" 55447 name=${iconName} 55448 ></sonic-icon 55449 ><span class="font-headings font-weight-headings font-style-headings">${label2}</span> 55450 </div></sonic-button 55451 >`; 55452 } 55453 }; 55454 SonicOffCanvas.styles = [ 55455 tailwind, 55456 i$9` 55457 .main-menu-item { 55458 display: flex; 55459 align-items: center; 55460 gap: 0.6em; 55461 font-weight: bold; 55462 font-size: 1.8rem; 55463 } 55464 @media (min-width: 992px) { 55465 .main-menu-item { 55466 font-size: 2rem; 55467 } 55468 } 55469 @media (min-width: 1200px) { 55470 .main-menu-item { 55471 font-size: 2.5rem; 55472 } 55473 } 55474 .main-menu-item:hover { 55475 color: var(--sc-primary); 55476 } 55477 .main-menu-item[active] { 55478 color: var(--sc-primary); 55479 text-underline-offset: 0.2em; 55480 text-decoration: underline; 55481 } 55482 ` 55483 ]; 55484 __decorateClass$1f([ 55485 n$5({ type: Boolean }) 55486 ], SonicOffCanvas.prototype, "displayOffCanvas", 2); 55487 __decorateClass$1f([ 55488 n$5({ type: String }) 55489 ], SonicOffCanvas.prototype, "logoSrc", 2); 55490 __decorateClass$1f([ 55491 bind$1("settings"), 55492 n$5({ type: Object }) 55493 ], SonicOffCanvas.prototype, "settings", 2); 55494 __decorateClass$1f([ 55495 r$5() 55496 ], SonicOffCanvas.prototype, "customAgendas", 2); 55497 __decorateClass$1f([ 55498 e$7(".main-menu-item") 55499 ], SonicOffCanvas.prototype, "firstMenuItem", 2); 55500 SonicOffCanvas = __decorateClass$1f([ 55501 t$3(tagName$V), 55502 awaitConnectedAncestors(APP_TAG_SELECTOR) 55503 ], SonicOffCanvas);
55504 var __defProp$1c = Object.defineProperty; 55505 var __getOwnPropDesc$1e = Object.getOwnPropertyDescriptor; 55506 var __decorateClass$1e = (decorators, target, key, kind) => { 55507 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1e(target, key) : target; 55508 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55509 if (decorator = decorators[i2]) 55510 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55511 if (kind && result) __defProp$1c(target, key, result); 55512 return result; 55513 }; 55514 let SonicPriceListText = class extends Fetcher$1(Subscriber$1(i$6)) { 55515 constructor() { 55516 super(...arguments); 55517 this.customIconLibraryPath = "https://cdn.supersoniks.com/concorde/icons/fontawesome/v6/$prefix/$name.svg"; 55518 this.customIconDefaultPrefix = "regular"; 55519 } 55520 connectedCallback() { 55521 if (this.storeUrl) { 55522 const urlWithoutLastSlash = this.storeUrl.replace(/\/$/, ""); 55523 this.setAttribute("serviceUrl", urlWithoutLastSlash + "/api/v2"); 55524 this.setAttribute("wordingProvider", "translate"); 55525 this.setAttribute("customIconLibraryPath", this.customIconLibraryPath); 55526 this.setAttribute("customIconDefaultPrefix", this.customIconDefaultPrefix); 55527 } 55528 if (!this.fetch) { 55529 this.isFetchEnabled = false; 55530 } 55531 if (this.id) { 55532 this.dataProvider = `sessions/${this.id}?features[]=prices&features[]=quotas&features[]=places_categories`; 55533 this.key = "data"; 55534 } 55535 super.connectedCallback(); 55536 } 55537 willUpdate(changedProperties) { 55538 if (changedProperties.has("props") || changedProperties.has("filterByPriceLabels")) { 55539 if (this.filterByPriceLabels && this.filterByPriceLabels.length > 0) { 55540 this._pricesToRender = this.props?.prices?.filter((price) => { 55541 const normalizedTitle = this.normalizeString(price.title ?? "") ?? ""; 55542 const normalizedFilterByPriceLabels = this.filterByPriceLabels?.map( 55543 (label2) => this.normalizeString(label2 ?? "") 55544 ); 55545 return normalizedFilterByPriceLabels?.includes(normalizedTitle ?? ""); 55546 }) || []; 55547 } else { 55548 this._pricesToRender = this.props?.prices || []; 55549 } 55550 } 55551 super.willUpdate(changedProperties); 55552 } 55553 normalizeString(string) { 55554 return string.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/\s+/g, "").replace(/[^a-z0-9]/g, ""); 55555 } 55556 onSelectQuota(e2) { 55557 this.selectedQuota = e2.detail; 55558 } 55559 render() { 55560 const isExternalLink = this.storeUrl?.startsWith("http"); 55561 const slug = this.props?.slug || this.props?.id || this.id; 55562 const eventLink2 = `${this.storeUrl}?sonic_to=event(slug:${slug})&session=${this.id}`; 55563 const quotas = this.props?.quotas || []; 55564 return b$1` 55565 <sonic-event-quota-selector 55566 @selectQuota="${this.onSelectQuota}" 55567 display="tabs" 55568 .quotas=${quotas || []} 55569 ></sonic-event-quota-selector> 55570 55571 <sonic-price-list-info 55572 class=" my-5 block" 55573 .prices=${this._pricesToRender || []} 55574 .selectedQuota=${this.selectedQuota} 55575 class="block mb-3" 55576 > 55577 </sonic-price-list-info> 55578 ${eventLink2 ? b$1` 55579 <sonic-button 55580 href=${eventLink2} 55581 type="primary" 55582 target=${isExternalLink ? "_blank" : "_self"} 55583 noAutoFill 55584 variant="default" 55585 minWidth="18rem" 55586 > 55587 <sonic-icon library="custom" name="basket-shopping"></sonic-icon> 55588 Acheter en ligne 55589 </sonic-button> 55590 ` : A$1} 55591 `; 55592 } 55593 }; 55594 SonicPriceListText.styles = [tailwind]; 55595 __decorateClass$1e([ 55596 n$5({ type: String }) 55597 ], SonicPriceListText.prototype, "storeUrl", 2); 55598 __decorateClass$1e([ 55599 n$5({ type: String }) 55600 ], SonicPriceListText.prototype, "token", 2); 55601 __decorateClass$1e([ 55602 n$5({ type: String }) 55603 ], SonicPriceListText.prototype, "customIconLibraryPath", 2); 55604 __decorateClass$1e([ 55605 n$5({ type: String }) 55606 ], SonicPriceListText.prototype, "customIconDefaultPrefix", 2); 55607 __decorateClass$1e([ 55608 n$5({ type: Boolean }) 55609 ], SonicPriceListText.prototype, "fetch", 2); 55610 __decorateClass$1e([ 55611 r$5() 55612 ], SonicPriceListText.prototype, "selectedQuota", 2); 55613 __decorateClass$1e([ 55614 n$5({ type: Array }) 55615 ], SonicPriceListText.prototype, "filterByPriceLabels", 2); 55616 __decorateClass$1e([ 55617 r$5() 55618 ], SonicPriceListText.prototype, "_pricesToRender", 2); 55619 SonicPriceListText = __decorateClass$1e([ 55620 t$3("sonic-link-event-block") 55621 ], SonicPriceListText); 55622 var __defProp$1b = Object.defineProperty; 55623 var __getOwnPropDesc$1d = Object.getOwnPropertyDescriptor; 55624 var __decorateClass$1d = (decorators, target, key, kind) => { 55625 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1d(target, key) : target; 55626 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55627 if (decorator = decorators[i2]) 55628 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55629 if (kind && result) __defProp$1b(target, key, result); 55630 return result; 55631 }; 55632 const tagName$U = "sonic-jumbotron"; 55633 let SonicJumbotron = class extends i$6 { 55634 constructor() { 55635 super(...arguments); 55636 this.title = ""; 55637 this.home = false;
55638 } 55639 render() { 55640 let title; 55641 let text; 55642 if (this.home) { 55643 title = this.title || t("home_jumbotron_title"); 55644 text = t("home_jumbotron_text", true); 55645 } else { 55646 title = this.title; 55647 text = this.text || o$6(this.text); 55648 } 55649 if (!title && !this.text) { 55650 return A$1; 55651 } 55652 return b$1` <div class="shadow-[0_40px_50px_-70px_rgb(0_0_0_/_0.35)] pb-8 text-left max-w-[55rem] "> 55653 ${title ? b$1` <div 55654 class="font-headings font-weight-headings font-style-headings text-3xl lg:text-5xl text-balance leading-tighter mb-4" 55655 > 55656 ${title} 55657 </div>` : A$1} 55658 ${text ? b$1` <div class="text-lg lg:text-xl sonic-prose sonic-prose-condensed "> 55659 ${this.text ? o$6(this.text) : t("home_jumbotron_text", true)} 55660 </div>` : A$1} 55661 </div>`; 55662 } 55663 }; 55664 SonicJumbotron.styles = [ 55665 tailwind, 55666 sonicProse, 55667 i$9` 55668 :host { 55669 display: block; 55670 margin-left: calc(-1 * var(--sc-container-gutter-x)); 55671 margin-right: calc(-1 * var(--sc-container-gutter-x)); 55672 padding: 1rem var(--sc-container-gutter-x); 55673 } 55674 ` 55675 ]; 55676 __decorateClass$1d([ 55677 n$5({ type: String }) 55678 ], SonicJumbotron.prototype, "title", 2); 55679 __decorateClass$1d([ 55680 n$5({ type: String }) 55681 ], SonicJumbotron.prototype, "text", 2); 55682 __decorateClass$1d([ 55683 n$5({ type: Boolean }) 55684 ], SonicJumbotron.prototype, "home", 2); 55685 SonicJumbotron = __decorateClass$1d([ 55686 t$3(tagName$U) 55687 ], SonicJumbotron); 55688 var __defProp$1a = Object.defineProperty; 55689 var __getOwnPropDesc$1c = Object.getOwnPropertyDescriptor; 55690 var __decorateClass$1c = (decorators, target, key, kind) => { 55691 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1c(target, key) : target; 55692 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55693 if (decorator = decorators[i2]) 55694 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55695 if (kind && result) __defProp$1a(target, key, result); 55696 return result; 55697 }; 55698 let SonicEventCard$1 = class SonicEventCard extends Subscriber$1(i$6) { 55699 constructor() { 55700 super(...arguments); 55701 this.categories = []; 55702 this.labels = []; 55703 this.event_id = ""; 55704 this.slug = ""; 55705 this.multisession = null; 55706 this.skeleton = false; 55707 this.staticMode = false; 55708 } 55709 render() { 55710 if (this.skeleton) { 55711 return this.renderSkeleton(); 55712 } 55713 const id = this.props?.id; 55714 if (!id) return A$1; 55715 const isShowContext = this.props && "sessions" in this.props; 55716 const statusEndpoint = isShowContext ? `shows/${id}/status` : `sessions/${id}?features[]=status`; 55717 const statusKey = isShowContext ? void 0 : "data"; 55718 return b$1` 55719 <sonic-app-link to="event" .slug=${this.slug} class="group contents"> 55720 <div class="@container w-full h-full relative"> 55721 <div 55722 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 " 55723 > 55724 <sonic-product-illustration class="relative rounded-md overflow-hidden"></sonic-product-illustration> 55725 <div class="min-h-[6rem]"> 55726 <sonic-date 55727 weekday="short" 55728 day="2-digit" 55729 month="short" 55730 class="text-xs leading-tight block mb-2 uppercase" 55731 ></sonic-date> 55732 <div class="mb-3"> 55733 <sonic-product-title 55734 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" 55735 ></sonic-product-title> 55736 </div> 55737 55738 <div class="flex gap-1 flex-wrap items-center gap-x-2"> 55739 ${this.staticMode ? b$1`<sonic-event-additional-status 55740 size="xs" 55741 variant="ghost" 55742 warnAndDangerAsPill 55743 class="flex flex-wrap gap-x-3 gap-y-1" 55744 ></sonic-event-additional-status>` : b$1`<sonic-event-additional-status 55745 fetch 55746 dataProvider="${statusEndpoint}" 55747 key="${o$4(statusKey)}" 55748 size="xs" 55749 warnAndDangerAsPill 55750 variant="ghost" 55751 class="flex flex-wrap gap-x-3 gap-y-1" 55752 ></sonic-event-additional-status>`} 55753 55754 <sonic-event-scheduled-status size="xs"></sonic-event-scheduled-status> 55755 55756 <sonic-event-taxonomy .taxonomy=${this.labels} size="xs" key="label"></sonic-event-taxonomy> 55757 ${this.categories.length > 0 ? b$1` <sonic-event-taxonomy 55758 .icon=${{ name: "tag", library: "custom" }} 55759 .taxonomy=${this.categories} 55760 variant="ghost" 55761 key="category" 55762 size="xs" 55763 > 55764 </sonic-event-taxonomy>` : A$1} 55765 </div> 55766 </div> 55767 </div> 55768 </div> 55769 </sonic-app-link> 55770 `; 55771 } 55772 renderSkeleton() { 55773 return b$1` 55774 <div class="@container w-full h-full "> 55775 <div 55776 class="leading-tight p-3 @sm:p-4 grid grid-cols-1 gap-3 rounded-md @sm:rounded-lg border border-transparent" 55777 > 55778 <div class=" relative aspect-square rounded-lg bg-neutral-100 animate-pulse "></div> 55779 <div class="min-h-[6rem]"> 55780 <div class=" leading-none block mb-2 bg-neutral-50 rounded-sm h-4 w-1/2 "></div> 55781 <div class=" leading-none block mb-1 bg-neutral-100 rounded-sm h-5 w-2/3 "></div> 55782 <div class="text-xs leading-tight block bg-neutral-100 rounded-sm h-3 w-1/3"></div> 55783 </div> 55784 </div> 55785 </div> 55786 `; 55787 } 55788 }; 55789 SonicEventCard$1.styles = [ 55790 tailwind, 55791 i$9` 55792 :host { 55793 width: 100%; 55794 position: relative; 55795 display: block; 55796 } 55797 ` 55798 ]; 55799 __decorateClass$1c([ 55800 n$5({ type: Array }) 55801 ], SonicEventCard$1.prototype, "categories", 2); 55802 __decorateClass$1c([ 55803 n$5({ type: Array }) 55804 ], SonicEventCard$1.prototype, "labels", 2); 55805 __decorateClass$1c([ 55806 n$5({ type: String }) 55807 ], SonicEventCard$1.prototype, "event_id", 2); 55808 __decorateClass$1c([ 55809 n$5({ type: String }) 55810 ], SonicEventCard$1.prototype, "slug", 2); 55811 __decorateClass$1c([ 55812 n$5({ type: Object }) 55813 ], SonicEventCard$1.prototype, "multisession", 2); 55814 __decorateClass$1c([ 55815 n$5({ type: Boolean }) 55816 ], SonicEventCard$1.prototype, "skeleton", 2); 55817 __decorateClass$1c([ 55818 c({ context: staticMode }), 55819 r$5() 55820 ], SonicEventCard$1.prototype, "staticMode", 2); 55821 SonicEventCard$1 = __decorateClass$1c([ 55822 t$3("sonic-event-card-vertical") 55823 ], SonicEventCard$1); 55824 var __defProp$19 = Object.defineProperty; 55825 var __getOwnPropDesc$1b = Object.getOwnPropertyDescriptor; 55826 var __decorateClass$1b = (decorators, target, key, kind) => { 55827 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1b(target, key) : target; 55828 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55829 if (decorator = decorators[i2]) 55830 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55831 if (kind && result) __defProp$19(target, key, result); 55832 return result; 55833 }; 55834 let SonicEventCard = class extends Subscriber$1(i$6) { 55835 constructor() { 55836 super(...arguments); 55837 this.staticMode = false;
55838 this.id = ""; 55839 this.slug = ""; 55840 this.start_date = ""; 55841 this.illustration = ""; 55842 this.categories = []; 55843 this.labels = []; 55844 this.event_id = ""; 55845 this.multisession = null; 55846 this.skeleton = false; 55847 } 55848 render() { 55849 if (this.skeleton) { 55850 return this.renderSkeleton(); 55851 } 55852 if (!this.props?.id) return A$1; 55853 return b$1` 55854 <sonic-app-link to="event" .slug=${this.slug} variant="unstyled" class="contents "> 55855 <div 55856 class="sonic-event-card no-underline relative rounded-lg overflow-hidden @container group hover:scale-[103%] transition hover:shadow-xl" 55857 > 55858 <sonic-vertical-date 55859 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" 55860 ></sonic-vertical-date> 55861 <sonic-product-illustration transition="fade-scale-out"></sonic-product-illustration> 55862 <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"> 55863 <sonic-product-title 55864 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" 55865 ></sonic-product-title> 55866 55867 <div class="text-xs @md:text-sm flex flex-wrap gap-1 gap-x-2 items-center"> 55868 ${this.id ? b$1`<sonic-event-additional-status 55869 ?fetch=${!this.staticMode} 55870 dataProvider=${!this.staticMode ? `shows/${this.id}/status` : A$1} 55871 size="inherit" 55872 variant="default" 55873 class="flex flex-wrap gap-x-3 gap-y-1" 55874 ></sonic-event-additional-status>` : A$1} 55875 <sonic-event-scheduled-status variant="default" size="inherit"></sonic-event-scheduled-status> 55876 <sonic-event-taxonomy 55877 .taxonomy=${this.labels} 55878 key="label" 55879 size="inherit" 55880 class="block" 55881 ></sonic-event-taxonomy> 55882 55883 <sonic-event-taxonomy 55884 .icon=${{ 55885 library: "custom", 55886 prefix: "regular", 55887 name: "tag" 55888 }} 55889 .taxonomy=${this.categories} 55890 variant="ghost" 55891 contrast 55892 key="category" 55893 size="inherit" 55894 class="block" 55895 > 55896 </sonic-event-taxonomy> 55897 </div> 55898 </div> 55899 55900 <div class="absolute inset-0 z-10 bg-gradient-to-br from-[rgba(0,0,0,.25)] to-[rgba(0,0,0,0)]"></div> 55901 <div class="absolute inset-0 z-10 bg-gradient-to-t from-[rgba(0,0,0,.25)] to-[rgba(0,0,0,0)]"></div> 55902 </div> 55903 </sonic-app-link> 55904 `; 55905 } 55906 renderSkeleton() { 55907 return b$1`<div class="aspect-square bg-neutral-50 rounded-lg relative @container "> 55908 <div 55909 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" 55910 ></div> 55911 <div class="absolute z-20 bottom-0 text-contrast-content p-4 @xs:p-5 @sm:p-6 w-full "> 55912 <div class="animate-pulse leading-none block bg-neutral-100 rounded-sm h-10 w-2/3 mb-2"></div> 55913 <div class="animate-pulse text-xs leading-tight block bg-neutral-100 rounded-sm h-7 w-1/3 mb-4"></div> 55914 <div class="animate-pulse leading-none block mb-2 bg-neutral-100 rounded-sm h-5 w-1/2 "></div> 55915 </div> 55916 </div> `; 55917 } 55918 }; 55919 SonicEventCard.styles = [tailwind]; 55920 __decorateClass$1b([ 55921 c({ context: staticMode }), 55922 r$5() 55923 ], SonicEventCard.prototype, "staticMode", 2); 55924 __decorateClass$1b([ 55925 n$5({ type: String }) 55926 ], SonicEventCard.prototype, "id", 2); 55927 __decorateClass$1b([ 55928 n$5({ type: String }) 55929 ], SonicEventCard.prototype, "slug", 2); 55930 __decorateClass$1b([ 55931 n$5({ type: String }) 55932 ], SonicEventCard.prototype, "start_date", 2); 55933 __decorateClass$1b([ 55934 n$5({ type: String }) 55935 ], SonicEventCard.prototype, "illustration", 2); 55936 __decorateClass$1b([ 55937 n$5({ type: Array }) 55938 ], SonicEventCard.prototype, "categories", 2); 55939 __decorateClass$1b([ 55940 n$5({ type: Array }) 55941 ], SonicEventCard.prototype, "labels", 2); 55942 __decorateClass$1b([ 55943 n$5({ type: String }) 55944 ], SonicEventCard.prototype, "event_id", 2); 55945 __decorateClass$1b([ 55946 n$5({ type: Object }) 55947 ], SonicEventCard.prototype, "multisession", 2); 55948 __decorateClass$1b([ 55949 n$5({ type: Boolean }) 55950 ], SonicEventCard.prototype, "skeleton", 2); 55951 SonicEventCard = __decorateClass$1b([ 55952 t$3("sonic-event-card-cover") 55953 ], SonicEventCard); 55954 var __defProp$18 = Object.defineProperty; 55955 var __getOwnPropDesc$1a = Object.getOwnPropertyDescriptor; 55956 var __decorateClass$1a = (decorators, target, key, kind) => { 55957 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1a(target, key) : target; 55958 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 55959 if (decorator = decorators[i2]) 55960 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 55961 if (kind && result) __defProp$18(target, key, result); 55962 return result; 55963 }; 55964 const tagName$T = "sonic-related"; 55965 let SonicComponent$b = class SonicComponent extends Subscriber$1(i$6) { 55966 constructor() { 55967 super(...arguments); 55968 this.staticMode = false;
55969 } 55970 render() { 55971 if (!this.id || !this.relatedEnabled) return A$1; 55972 return b$1`<div class="@container"> 55973 ${t("related") ? b$1` <h2 class="flex items-center text-2xl lg:text-4xl font-bold mb-5 gap-3"> 55974 <span>${t("related")}</span> 55975 <span class="h-[var(--sc-border-width)] grow bg-content "></span> 55976 </h2>` : A$1} 55977 55978 <sonic-list 55979 fetch 55980 lazyload 55981 lazyBoundsRatio="0.2" 55982 dataprovider="shows/${this.id}/related?next=1&limit=4&view=essential" 55983 key="data" 55984 class="grid grid-cols-1 @xl:grid-cols-2 @6xl:grid-cols-4 gap-4" 55985 > 55986 <template data-value="skeleton"> 55987 <sonic-event-card-cover skeleton></sonic-event-card-cover> 55988 <sonic-event-card-cover skeleton></sonic-event-card-cover> 55989 <sonic-event-card-cover skeleton></sonic-event-card-cover> 55990 <sonic-event-card-cover skeleton></sonic-event-card-cover> 55991 </template> 55992 <template> 55993 <sonic-event-card-cover lazyrendering></sonic-event-card-cover> 55994 </template> 55995 </sonic-list> 55996 </div> `; 55997 } 55998 }; 55999 SonicComponent$b.styles = [ 56000 tailwind, 56001 i$9` 56002 :host { 56003 display: block; 56004 } 56005 ` 56006 ]; 56007 __decorateClass$1a([ 56008 bind$1("settings.modules.related_events.access"), 56009 r$5() 56010 ], SonicComponent$b.prototype, "relatedEnabled", 2); 56011 __decorateClass$1a([ 56012 e$2({ context: staticMode }) 56013 ], SonicComponent$b.prototype, "staticMode", 2); 56014 SonicComponent$b = __decorateClass$1a([ 56015 t$3(tagName$T) 56016 ], SonicComponent$b); 56017 const formTypeContext = n("formType"); 56018 var __defProp$17 = Object.defineProperty; 56019 var __getOwnPropDesc$19 = Object.getOwnPropertyDescriptor; 56020 var __decorateClass$19 = (decorators, target, key, kind) => { 56021 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$19(target, key) : target; 56022 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 56023 if (decorator = decorators[i2]) 56024 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 56025 if (kind && result) __defProp$17(target, key, result); 56026 return result; 56027 }; 56028 let SessionCard = class extends EventContext(Subscriber$1(i$6)) { 56029 constructor() { 56030 super(...arguments); 56031 this.expanded = false; 56032 this.alwaysExpanded = false; 56033 this.onlyHours = false; 56034 this.id = ""; 56035 this._metadata_ = {}; 56036 this.formType = "select"; 56037 this.formSize = "sm"; 56038 this.start_date = ""; 56039 this.edito = {}; 56040 this.site_link = ""; 56041 this.entity_type = EntityType.Event; 56042 this.initialized = false; 56043 } 56044 connectedCallback() { 56045 if (this.alwaysExpanded) this.expanded = true; 56046 super.connectedCallback(); 56047 } 56048 willUpdate(changedProperties) { 56049 if (this.entity_type === EntityType.Event && this.appType === "counter") { 56050 this.actions = [ 56051 ProductActionsEnum.EDIT, 56052 ProductActionsEnum.STATS, 56053 ProductActionsEnum.SALES, 56054 ProductActionsEnum.DIVIDER, 56055 ProductActionsEnum.PIN 56056 ]; 56057 } 56058 if (changedProperties.has("id") && !this.expanded && !this.initialized) { 56059 const urlParams = new URLSearchParams(window.location.search); 56060 const sessionIds = urlParams.get("session"); 56061 if (sessionIds) { 56062 const sessionIdsArray = sessionIds.split(","); 56063 const sessionId = this.id.toString(); 56064 if (sessionIdsArray.includes(sessionId)) { 56065 this.expanded = true; 56066 } 56067 } 56068 this.initialized = true; 56069 } 56070 if (changedProperties.has("_metadata_") && !this.alwaysExpanded) this.alwaysExpanded = !!this._metadata_?.onlyChild; 56071 super.willUpdate(changedProperties); 56072 } 56073 toggleExpanded() { 56074 if (this.alwaysExpanded) return; 56075 this.expanded = !this.expanded; 56076 } 56077 render() { 56078 let startDateHours; 56079 if (this.start_date) { 56080 const startDate = new Date(parseInt(this.start_date) * 1e3); 56081 const minutes = startDate.getMinutes(); 56082 startDateHours = startDate.getHours() + ":" + (minutes < 10 ? "0" : "") + minutes; 56083 } 56084 const displayActions = this.actions?.length; 56085 return b$1` 56086 <div class="@container"> 56087 <div 56088 @click="${this.toggleExpanded}" 56089 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" : ""}" 56090 > 56091 <slot name="prefix"></slot> 56092 <div class="flex justify-between items-center gap-2 "> 56093 <div class=" grid grid-cols-1 flex-grow gap-y-1 text-left"> 56094 ${this.onlyHours && startDateHours ? b$1`<span class="text-lg leading-tighter lg:text-xl font-bold">${startDateHours}</span>` : b$1`
56095 <sonic-date noshadowdom designMode class="font-bold capitalize text-lg leading-tighter lg:text-xl "> 56096 <template data-value="to"> 56097 <sonic-icon name="chevron-right" class="mx-2" library="custom"></sonic-icon> 56098 </template> 56099 <template data-value="hour"> 56100 <span class="font-normal text-[.8em]"></span> 56101 </template> 56102 <template data-value="minute"> 56103 <span class="font-normal text-[.8em]"></span> 56104 </template> 56105 <template data-value="literal"> 56106 <span class="font-normal text-[.8em]"></span> 56107 </template> 56108 </sonic-date> 56109 `} 56110 <div class="flex flex-wrap items-center gap-x-3 gap-y-[0.125em] leading-none text-xs"> 56111 <sonic-event-location-hall></sonic-event-location-hall> 56112 56113 ${this.staticMode ? b$1`<sonic-event-additional-status 56114 size="inherit" 56115 class="flex flex-wrap gap-x-3" 56116 ></sonic-event-additional-status>` : b$1`<sonic-event-additional-status 56117 fetch 56118 dataProvider=${`sessions/${this.id}?features[]=status`} 56119 size="inherit" 56120 class="flex flex-wrap gap-x-3" 56121 key="data" 56122 ></sonic-event-additional-status>`} 56123 56124 <sonic-event-scheduled-status size="xs"></sonic-event-scheduled-status> 56125 <sonic-event-taxonomies size="xs" class="contents"></sonic-event-taxonomies> 56126 <sonic-event-duration class="text-xs text-neutral-500"></sonic-event-duration> 56127 </div> 56128 <sonic-event-notes subDataProvider="settings" lineClamp class="text-xs "></sonic-event-notes> 56129 </div> 56130 56131 ${displayActions ? b$1`<div class=" -mr-2 flex items-center gap-2"> 56132 <sonic-product-publication subDataProvider="settings" class="text-lg"></sonic-product-publication> 56133 <sonic-product-actions 56134 .actions=${this.actions} 56135 @click=${(e2) => e2.stopPropagation()} 56136 size="sm" 56137 > 56138 </sonic-product-actions> 56139 </div>` : A$1} 56140 ${!this.alwaysExpanded && !displayActions ? b$1` 56141 <sonic-button 56142 ?active=${this.expanded} 56143 ?data-aria-expanded=${this.expanded} 56144 data-aria-controls="card-session-${this.id}" 56145 data-aria-label=${this.expanded ? "Fermer" : "Ouvrir"} 56146 icon 56147 shape="circle" 56148 variant="ghost" 56149 class="hidden @md:block -my-1 -mr-2" 56150 noAutoFill 56151 > 56152 <sonic-icon name="chevron-up" swap="on" library="custom"></sonic-icon> 56153 <sonic-icon name="chevron-down" swap="off" library="custom"></sonic-icon> 56154 </sonic-button> 56155 ` : A$1} 56156 </div> 56157 <div 56158 class="grid grid-cols-1 transition-all duration-[400ms] ${this.expanded || this.alwaysExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"}" 56159 id="card-session-${this.id}" 56160 ?inert=${!this.expanded && !this.alwaysExpanded} 56161 > 56162 <div class="${!this.alwaysExpanded ? "overflow-hidden" : ""}"> 56163 <div class="py-3"> 56164 ${this.edito?.body ? b$1`<div class="prose-sm mb-5 prose-tight">${o$6(this.edito?.body)}</div>` : A$1} 56165 ${this.site_link ? b$1` <sonic-event-site-link 56166 class="block text-sm mb-5 ${this.edito?.body ? "-mt-2" : ""}" 56167 tooltipPlacement="bottom-start" 56168 ></sonic-event-site-link>` : A$1} 56169 <!-- 56170 Actuellement en mode static on ne peut pas suppr le fetch 56171 la notion de placement disparait avec le clean_session_data 56172 ce qui change le rendu malgré la présence des autres données 56173 --> 56174 <sonic-fetch 56175 lazyload 56176 loader="inline" 56177 dataProvider="${entityEndPoint({ 56178 entityType: EntityType.Event,
56179 entityId: Number(this.id), 56180 accessParams: this.accessParams, 56181 view: entityView.full 56182 })}" 56183 key="data" 56184 @click=${(e2) => e2.stopPropagation()} 56185 > 56186 <sonic-buy-event-block 56187 size=${this.formSize} 56188 display=${this.formType} 56189 class="cursor-default" 56190 ></sonic-buy-event-block> 56191 </sonic-fetch> 56192 </div> 56193 </div> 56194 </div> 56195 </div> 56196 </div> 56197 `; 56198 } 56199 }; 56200 SessionCard.styles = [tailwind]; 56201 __decorateClass$19([ 56202 n$5({ type: Boolean }) 56203 ], SessionCard.prototype, "expanded", 2); 56204 __decorateClass$19([ 56205 n$5({ type: Boolean }) 56206 ], SessionCard.prototype, "alwaysExpanded", 2); 56207 __decorateClass$19([ 56208 n$5({ type: Boolean }) 56209 ], SessionCard.prototype, "onlyHours", 2); 56210 __decorateClass$19([ 56211 n$5({ type: String }) 56212 ], SessionCard.prototype, "id", 2); 56213 __decorateClass$19([ 56214 n$5({ type: Object }) 56215 ], SessionCard.prototype, "_metadata_", 2); 56216 __decorateClass$19([ 56217 c({ context: formTypeContext, subscribe: true }), 56218 n$5({ type: String }) 56219 ], SessionCard.prototype, "formType", 2); 56220 __decorateClass$19([ 56221 n$5({ type: String }) 56222 ], SessionCard.prototype, "formSize", 2); 56223 __decorateClass$19([ 56224 n$5({ type: String }) 56225 ], SessionCard.prototype, "start_date", 2); 56226 __decorateClass$19([ 56227 n$5({ type: Object }) 56228 ], SessionCard.prototype, "edito", 2); 56229 __decorateClass$19([ 56230 n$5({ type: String }) 56231 ], SessionCard.prototype, "site_link", 2); 56232 __decorateClass$19([ 56233 c({ context: appType, subscribe: true }) 56234 ], SessionCard.prototype, "appType", 2); 56235 __decorateClass$19([ 56236 n$5({ type: String }) 56237 ], SessionCard.prototype, "entity_type", 2); 56238 __decorateClass$19([ 56239 n$5({ type: Array }) 56240 ], SessionCard.prototype, "actions", 2); 56241 __decorateClass$19([ 56242 c({ context: staticMode }), 56243 r$5() 56244 ], SessionCard.prototype, "staticMode", 2); 56245 __decorateClass$19([ 56246 c({ context: accessParamsContext, subscribe: true }), 56247 r$5() 56248 ], SessionCard.prototype, "accessParams", 2); 56249 SessionCard = __decorateClass$19([ 56250 t$3("sonic-event-session-card") 56251 ], SessionCard); 56252 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) => { 56253 for (var a2 in t2 || (t2 = {})) __hasOwnProp.call(t2, a2) && __defNormalProp(e2, a2, t2[a2]); 56254 if (__getOwnPropSymbols) for (var a2 of __getOwnPropSymbols(t2)) __propIsEnum.call(t2, a2) && __defNormalProp(e2, a2, t2[a2]); 56255 return e2; 56256 }, __publicField = (e2, t2, a2) => (__defNormalProp(e2, "symbol" != typeof t2 ? t2 + "" : t2, a2), a2); 56257 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>`; 56258 class DefaultOptionsCalendar { 56259 constructor() { 56260 var e2; 56261 __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
56261: 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"); 56262 } 56263 } 56264 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) => { 56265 const s2 = getDate(a2), l2 = getDate(n2), r2 = new Date(s2.getTime()); 56266 for (; r2 <= l2; r2.setDate(r2.getDate() + 1)) e3.push(getDateString(r2)); 56267 return t3; 56268 })), 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) => { 56269 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; 56270 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; 56271 }, initRange = (e2) => { 56272 var t2, a2, n2; 56273 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; 56274 const s2 = e2.settings.range.disablePast && !e2.settings.range.disableAllDays && getDate(e2.settings.range.min) < e2.date.today; 56275 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]); 56276 }, initSelectedDates = (e2) => { 56277 var t2, a2; 56278 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) : []; 56279 }, initDateMinMax = (e2) => {
56280 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); 56281 }, initTime = (e2) => { 56282 const t2 = true === e2.settings.selection.time || 12 === e2.settings.selection.time; 56283 if (t2 || 24 === e2.settings.selection.time) { 56284 let a2 = false; 56285 if ("string" == typeof e2.settings.selected.time) { 56286 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; 56287 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"), ""))); 56288 } 56289 !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}` : ""}`; 56290 } else if (e2.settings.selection.time) throw new Error(messages.incorrectTime); 56291 }, initCorrectMonths = (e2) => { 56292 e2.correctMonths = "multiple" === e2.type ? 1 === e2.months ? 2 : e2.months > 12 ? 12 : e2.months : 1; 56293 }, setVariables = (e2) => { 56294 e2.currentType = e2.type, initSelectedMonthYear(e2), initRange(e2), initSelectedDates(e2), initDateMinMax(e2), initTime(e2), initCorrectMonths(e2); 56295 }, setVisibilityArrows = ({ arrowPrev: e2, arrowNext: t2, isPrevHidden: a2, isNextHidden: n2 }) => { 56296 e2.style.visibility = a2 ? "hidden" : "", t2.style.visibility = n2 ? "hidden" : ""; 56297 }, visibilityArrows = (e2) => { 56298 var t2, a2; 56299 if ("month" === e2.currentType) return; 56300 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}`); 56301 if (!n2 || !s2) return; 56302 ({ default: () => { 56303 const t3 = getDate(getDateString(new Date(e2.selectedYear, e2.selectedMonth, 1))), a3 = new Date(t3.getTime()), l2 = new Date(t3.getTime()); 56304 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())); 56305 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(); 56306 setVisibilityArrows({ arrowPrev: n2, arrowNext: s2, isPrevHidden: r2, isNextHidden: i2 }); 56307 }, year: () => { 56308 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() }); 56309 } })["multiple" === e2.currentType ? "default" : e2.currentType](); 56310 }, getWeekNumber = (e2, t2) => { 56311 if (!e2) return null; 56312 const a2 = getDate(e2), n2 = t2 ? a2.getDay() || 7 : a2.getDay(); 56313 a2.setDate(a2.getDate() + 4 - n2); 56314 const s2 = new Date(a2.getFullYear(), 0, 1), l2 = Math.ceil(((+a2 - +s2) / 864e5 + 1) / 7); 56315 return { year: a2.getFullYear(), week: l2 }; 56316 }, handleDay = (e2, t2, a2, n2) => { 56317 const s2 = a2.querySelector(`[data-calendar-day="${e2}"]`); 56318 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>`)); 56319 }, createPopup = (e2, t2) => { 56320 var a2; 56321 e2.popups && (null == (a2 = Object.entries(e2.popups)) || a2.forEach((([a3, n2]) =>
56321 handleDay(a3, n2, t2, e2.CSSClasses.dayPopup)))); 56322 }, createWeekNumber = (e2, t2, a2, n2, s2) => { 56323 const l2 = t2[a2].querySelector(`.${e2.CSSClasses.dayBtn}`), r2 = getWeekNumber(null == l2 ? void 0 : l2.dataset.calendarDay, e2.settings.iso8601); 56324 if (!r2) return; 56325 const i2 = n2.cloneNode(true); 56326 i2.innerText = String(r2.week), i2.dataset.calendarYearWeek = String(r2.year), s2.append(i2); 56327 }, createWeekNumbers = (e2, t2, a2, n2, s2) => { 56328 if (!e2.settings.visibility.weekNumbers) return; 56329 n2.innerHTML = ""; 56330 const l2 = document.createElement("b"); 56331 l2.className = e2.CSSClasses.weekNumbersTitle, l2.innerText = "#", n2.append(l2); 56332 const r2 = document.createElement("div"); 56333 r2.className = e2.CSSClasses.weekNumbersContent, n2.append(r2); 56334 const i2 = document.createElement("button"); 56335 i2.type = "button", i2.className = e2.CSSClasses.weekNumber; 56336 const d2 = s2.querySelectorAll(`.${e2.CSSClasses.day}`), c2 = Math.ceil((t2 + a2) / 7); 56337 for (let t3 = 0; t3 < c2; t3++) createWeekNumber(e2, d2, 0 === t3 ? 6 : 7 * t3, i2, r2); 56338 }, setDisabledDays = (e2, t2, a2) => { 56339 var n2, s2, l2, r2, i2; 56340 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]); 56341 !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)))); 56342 }, setDayModifier = (e2, t2, a2, n2, s2, l2, r2) => { 56343 var i2, d2, c2; 56344 (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))); 56345 }, createDay = (e2, t2, a2, n2, s2, l2, r2, i2) => { 56346 const d2 = document.createElement("div"); 56347 d2.className = e2.CSSClasses.day; 56348 const c2 = document.createElement("button"); 56349 c2.className = `${e2.CSSClasses.dayBtn}${i2 ? ` ${i2}` : ""}`, c2.type = "button", c2.innerText = String(n2), c2.dataset.calendarDay = l2; 56350 e2.settings.visibility.weekNumbers && (() => { 56351 const t3 = getWeekNumber(l2, e2.settings.iso8601); 56352 t3 && (c2.dataset.calendarWeekNumber = String(t3.week)); 56353 })(), 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); 56354 }, prevMonth = (e2, t2, a2, n2, s2) => { 56355 let l2 = new Date(a2, n2, 0).getDate() - (s2 - 1); 56356 const r2 = 0 === n2 ? a2 - 1 : a2, i2 = 0 === n2 ? 12 : n2 < 10 ? `0${n2}` : n2; 56357 for (let n3 = s2; n3 > 0; n3--, l2++) { 56358 const n4 = `${r2}-${i2}-${l2}`, s3 = getDate(n4).getDay(); 56359 createDay(e2, a2, t2, l2, s3, n4, true, e2.CSSClasses.dayBtnPrev); 56360 } 56361 }, currentMonth = (e2, t2, a2, n2, s2) => { 56362 for (let l2 = 1; l2 <= a2; l2++) { 56363 const a3 = new Date(n2, s2, l2), r2 = getDateString(a3), i2 = a3.getDay(); 56364 createDay(e2, n2, t2, l2, i2, r2, false, null); 56365 } 56366 }, nextMonth = (e2, t2, a2, n2, s2, l2) => { 56367 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; 56368 for (let a3 = 1; a3 <= i2; a3++) { 56369 const s3 = `${d2}-${c2}-${a3 < 10 ? `0${a3}` : String(a3)}`, l3 = getDate(s3).getDay();
56370 createDay(e2, n2, t2, a3, l3, s3, true, e2.CSSClasses.dayBtnNext); 56371 } 56372 }, createDays = (e2) => { 56373 const t2 = e2.HTMLElement.querySelectorAll(`.${e2.CSSClasses.days}`), a2 = e2.HTMLElement.querySelectorAll(`.${e2.CSSClasses.weekNumbers}`), n2 = new Date(e2.selectedYear, e2.selectedMonth, 1); 56374 t2.forEach(((t3, s2) => { 56375 const l2 = new Date(n2); 56376 l2.setMonth(l2.getMonth() + s2); 56377 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(); 56378 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); 56379 })); 56380 }, visibilityMonth = (e2, t2, a2, n2) => { 56381 const s2 = new Date(n2.setMonth(e2.selectedMonth + a2)).getMonth(), l2 = false === e2.settings.selection.month || "only-arrows" === e2.settings.selection.month; 56382 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]; 56383 }, visibilityYear = (e2, t2, a2, n2) => { 56384 const s2 = new Date(n2.setFullYear(e2.selectedYear, e2.selectedMonth + a2)).getFullYear(), l2 = false === e2.settings.selection.year || "only-arrows" === e2.settings.selection.year; 56385 t2.tabIndex = l2 ? -1 : 0, t2.classList.toggle(e2.CSSClasses.yearDisabled, l2), t2.setAttribute("data-calendar-selected-year", String(s2)), t2.innerText = String(s2); 56386 }, visibilityTitle = (e2) => { 56387 var t2, a2; 56388 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]"); 56389 if (!(null == n2 ? void 0 : n2[0]) && (null == s2 ? void 0 : s2[0])) return; 56390 const l2 = new Date(e2.selectedYear, e2.selectedMonth, 1); 56391 null == n2 || n2.forEach(((t3, a3) => visibilityMonth(e2, t3, a3, l2))), null == s2 || s2.forEach(((t3, a3) => visibilityYear(e2, t3, a3, l2))); 56392 }, changeMonth = (e2, t2) => { 56393 const a2 = getDate(getDateString(new Date(e2.selectedYear, e2.selectedMonth, 1))); 56394 ({ 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); 56395 }, 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) => { 56396 const n2 = (s2 = a2.replace(/[/\s\n\t]/g, ""), components[s2]); 56397 var s2; 56398 return n2 ? n2(e2) : ""; 56399 })).replace(/[\n\t]/g, ""), MultipleParser = (e2, t2) => t2.replace(/<#Multiple>(.*?)<#\/Multiple>/g, ((t3, a2) => { 56400 let n2 = ""; 56401 for (let t4 = 0; t4 < e2.correctMonths; t4++) n2 += a2; 56402 return n2; 56403 })).replace(/[\n\t]/g, ""), createDOM = (e2, t2) => {
56404 const { HTMLElement: a2, CSSClasses: n2, DOMTemplates: s2, type: l2, currentType: r2, correctMonths: i2 } = e2, d2 = (s3, l3) => { 56405 if (!t2) return; 56406 const r3 = a2.querySelector(`.${n2.controls}`); 56407 r3 && a2.removeChild(r3); 56408 a2.querySelector(`.${n2.grid}`).classList.add(n2.gridDisabled); 56409 const i3 = t2.closest(`.${n2.column}`); 56410 i3.classList.add(s3), i3.innerHTML = DOMParser(e2, l3); 56411 }, c2 = { default: () => { 56412 a2.classList.add(n2.calendarDefault), a2.classList.remove(n2.calendarMonth, n2.calendarYear), a2.innerHTML = DOMParser(e2, s2.default); 56413 }, multiple: () => { 56414 i2 && (a2.classList.add(n2.calendarMultiple), a2.classList.remove(n2.calendarMonth, n2.calendarYear), a2.innerHTML = MultipleParser(e2, DOMParser(e2, s2.multiple))); 56415 }, month: () => { 56416 "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); 56417 }, year: () => { 56418 "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); 56419 } }; 56420 a2.classList.add(n2.calendar), c2[r2](); 56421 }, createYearEl = (e2, t2, a2, n2, s2) => { 56422 const l2 = t2.cloneNode(false); 56423 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; 56424 }, createYears = (e2, t2) => { 56425 const a2 = (null == t2 ? void 0 : t2.dataset.calendarSelectedYear) ? Number(null == t2 ? void 0 : t2.dataset.calendarSelectedYear) : e2.selectedYear; 56426 e2.currentType = "year", createDOM(e2, t2), visibilityTitle(e2), visibilityArrows(e2); 56427 const n2 = e2.HTMLElement.querySelector(`.${e2.CSSClasses.years}`); 56428 if (!e2.settings.selection.year || !n2) return; 56429 n2.classList.add(e2.CSSClasses.yearsSelecting); 56430 const s2 = "multiple" !== e2.type || e2.selectedYear === a2 ? 0 : 1, l2 = document.createElement("button"); 56431 l2.type = "button"; 56432 for (let t3 = e2.viewYear - 7; t3 < e2.viewYear + 8; t3++) { 56433 const r2 = t3 < e2.dateMin.getFullYear() + s2 || t3 > e2.dateMax.getFullYear(), i2 = createYearEl(e2, l2, a2, r2, t3); 56434 n2.append(i2), e2.actions.getYears && e2.actions.getYears(t3, i2, e2); 56435 } 56436 }, handleClickArrow = (e2, t2) => { 56437 const a2 = t2.target.closest(`.${e2.CSSClasses.arrow}`); 56438 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)); 56439 }, handleClickWeekNumber = (e2, t2) => { 56440 var a2; 56441 if (!e2.settings.visibility.weekNumbers || !e2.actions.clickWeekNumber) return; 56442 const n2 = t2.target.closest(`.${e2.CSSClasses.weekNumber}`), s2 = null == (a2 = e2.HTMLElement) ? void 0 : a2.querySelectorAll("[data-calendar-week-number]"); 56443 if (!n2 || !s2) return; 56444 const l2 = Number(n2.innerText), r2 = Number(n2.dataset.calendarYearWeek), i2 = [...s2].filter(((e3) => Number(e3.dataset.calendarWeekNumber) === l2)); 56445 e2.actions.clickWeekNumber(t2, l2, i2, r2, e2); 56446 }, capitalizeFirstLetter = (e2) => `${e2.charAt(0).toUpperCase()}${e2.substring(1, e2.length)}`.replace(/\./, ""), getLocaleWeekday = (e2, t2) => { 56447 const a2 = (/* @__PURE__ */ new Date(`1978-01-0${t2 + 1}T00:00:00.000Z`)).toLocaleString(e2.settings.lang, { weekday: "short", timeZone: "UTC" }); 56448 e2.locale.weekday.push(capitalizeFirstLetter(a2)); 56449 }, getLocaleMonth = (e2, t2) => { 56450 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" }); 56451 e2.locale.months.push(capitalizeFirstLetter(a2)); 56452 }, getLocale = (e2) => { 56453 if ("define" !== e2.settings.lang || !e2.locale.weekday[6] || !e2.locale.months[11]) { 56454 if ("define" === e2.settings.lang) throw new Error(messages.notLocale); 56455 e2.locale.weekday = [], e2.locale.months = []; 56456 for (let t2 = 0; t2 < 7; t2++) getLocaleWeekday(e2, t2); 56457 for (let t2 = 0; t2 < 12; t2++) getLocaleMonth(e2, t2); 56458 } 56459 }, relationshipID = (e2) => { 56460 if ("multiple" !== e2.type) return 0; 56461 const t2 = [...e2.HTMLElement.querySelectorAll(`.${e2.CSSClasse
56461s.column}`)].findIndex(((t3) => t3.classList.contains(`${e2.CSSClasses.columnMonth}`))); 56462 return t2 > 0 ? t2 : 0; 56463 }, createMonthEl = (e2, t2, a2, n2, s2, l2) => { 56464 const r2 = t2.cloneNode(false); 56465 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; 56466 }, createMonths = (e2, t2) => { 56467 var a2, n2; 56468 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; 56469 e2.currentType = "month", createDOM(e2, t2), visibilityTitle(e2); 56470 const i2 = null == (n2 = e2.HTMLElement) ? void 0 : n2.querySelector(`.${e2.CSSClasses.months}`); 56471 if (!e2.settings.selection.month || !i2) return; 56472 i2.classList.add(e2.CSSClasses.monthsSelecting); 56473 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"); 56474 c2.type = "button"; 56475 for (let t3 = 0; t3 < 12; t3++) { 56476 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); 56477 i2.append(l3), e2.actions.getMonths && e2.actions.getMonths(t3, l3, e2); 56478 } 56479 }, 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) => { 56480 e2.addEventListener("mouseover", (() => t2.classList.add(a2))), e2.addEventListener("mouseout", (() => t2.classList.remove(a2))); 56481 }, setTime = (e2, t2, a2, n2) => { 56482 ({ hours: () => { 56483 e2.selectedHours = a2; 56484 }, minutes: () => { 56485 e2.selectedMinutes = a2; 56486 } })[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); 56487 }, changeRange = (e2, t2, a2, n2, s2, l2) => { 56488 t2.addEventListener("input", ((t3) => { 56489 const r2 = t3.target, i2 = Number(r2.value), d2 = i2 < 10 ? `0${i2}` : `${i2}`; 56490 if ("hours" !== s2 || 12 !== l2) return a2.value = d2, void setTime(e2, t3, d2, s2); 56491 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)); 56492 })); 56493 }, changeInput = (e2, t2, a2, n2, s2, l2) => { 56494 a2.addEventListener("change", ((a3) => { 56495 const r2 = a3.target, i2 = Number(r2.value), d2 = i2 < 10 ? `0${i2}` : `${i2}`; 56496 "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); 56497 })); 56498 }, clickBtnKeepingTime = (e2, t2, a2) => { 56499 t2.addEventListener("click", ((n2) => { 56500 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"); 56501 })); 56502 }, changeTime = (e2, t2, a2) => { 56503 const n2 = 24 === a2 ? 23 : a2 || 12, s2 = getInputElement(t2, e2.CSSClasse
56503s.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}`); 56504 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); 56505 }, 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) => { 56506 const t2 = e2.HTMLElement.querySelector(`.${e2.CSSClasses.time}`); 56507 if (!t2) return; 56508 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]; 56509 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); 56510 }, createWeekDays = (e2, t2, a2) => { 56511 const n2 = document.createElement("b"); 56512 t2.innerHTML = ""; 56513 for (let s2 = 0; s2 < a2.length; s2++) { 56514 const l2 = a2[s2], r2 = n2.cloneNode(true); 56515 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); 56516 } 56517 }, createWeek = (e2) => { 56518 const t2 = [...e2.locale.weekday]; 56519 if (!t2[0]) return; 56520 e2.settings.iso8601 && t2.push(t2.shift()); 56521 e2.HTMLElement.querySelectorAll(`.${e2.CSSClasses.week}`).forEach(((a2) => createWeekDays(e2, a2, t2))); 56522 }, themes = ["light", "dark", "system"], haveListener = { value: false, set: () => { 56523 haveListener.value = true; 56524 }, check: () => haveListener.value }, getTheme = (e2, t2) => themes.find(((a2) => { 56525 var n2; 56526 return "system" !== a2 && (null == (n2 = e2.getAttribute(t2)) ? void 0 : n2.includes(a2)); 56527 })), setTheme = (e2, t2) => { 56528 e2.dataset.calendarTheme = t2; 56529 }, trackChangesThemeInSystemSettings = (e2, t2) => { 56530 var a2; 56531 if (a2 = t2, setTheme(e2.HTMLElement, a2.matches ? "dark" : "light"), "system" !== e2.settings.visibility.theme || haveListener.check()) return; 56532 const n2 = (t3) => { 56533 const a3 = document.querySelectorAll(`.${e2.CSSClasses.calendar}`); 56534 null == a3 || a3.forEach(((e3) => setTheme(e3, t3.matches ? "dark" : "light"))); 56535 }; 56536 t2.addEventListener ? t2.addEventListener("change", n2) : t2.addListener(n2), haveListener.set(); 56537 }, trackChangesThemeInHTMLElement = (e2, t2, a2) => { 56538 new MutationObserver(((n2) => { 56539 for (let s2 = 0; s2 < n2.length; s2++) { 56540 if (n2[s2].attributeName === a2) { 56541 const n3 = getTheme(t2, a2); 56542 n3 && setTheme(e2.HTMLElement, n3); 56543 break; 56544 } 56545 } 56546 })).observe(t2, { attributes: true }); 56547 }, detectTheme = (e2, t2) => { 56548 const a2 = e2.settings.visibility.themeDetect ? document.querySelector(e2.settings.visibility.themeDetect) : null; 56549 if (!a2) return void trackChangesThemeInSystemSettings(e2, t2); 56550 const n2 = e2.settings.visibility.themeDetect.replace(/^.*\[(.+)\]/g, ((e3, t3) => t3)), s2 = getTheme(a2, n2); 56551 s2 ? (setTheme(e2.HTMLElement, s2), trackChangesThemeInHTMLElement(e2, a2, n2)) : trackChangesThemeInSystemSettings(e2, t2); 56552 }, changeTheme = (e2) => { 56553 if (!themes.includes(e2.settings.visibility.theme)) throw new Error(messages.incorrectTheme); 56554 if ("not all" === window.matchMedia("(prefers-color-scheme)").media) return void setTheme(e2.HTMLElement, "light"); 56555 ({ light: () => setTheme(e2.HTMLElement, "light"), dark: () => setTheme(e2.HTMLElement, "dark"), system: () => detectTheme(e2, window.matchMedia("(prefers-color-scheme: dark)")) })[e2.settings.visibility.theme](); 56556 }, create = (e2) => { 56557 const t2 = { default: () => { 56558 createWeek(e2), createDays(e2); 56559 }, multiple: () => { 56560 createWeek(e2), createDays(e2); 56561 }, month: () => createMonths(e2), year: () => createYears(e2) }; 56562 changeTheme(e2), getLocale(e2), createDOM(e2), visibilityTitle(e2), visibilityArrows(e2), createTime(e2), t2[e2.currentType](); 56563 }, current = { self: null, rangeMin: void 0, rangeMax: void 0 }, removeHoverEffect = () => { 56564 var e2; 56565 if (!(null == (e2 = current.self) ? void 0 : e2.HTMLElement)) return;
56566 const { CSSClasses: t2 } = current.self; 56567 current.self.HTMLElement.querySelectorAll(`.${current.self.CSSClasses.dayBtnHover}`).forEach(((e3) => { 56568 var a2; 56569 e3.classList.remove(current.self.CSSClasses.dayBtnHover), null == (a2 = e3.parentElement) || a2.classList.remove(t2.dayHoverIntermediate, t2.dayHoverFirst, t2.dayHoverLast); 56570 })); 56571 }, addHoverEffect = (e2, t2, a2) => { 56572 var n2, s2, l2; 56573 if (!(null == (n2 = current.self) ? void 0 : n2.selectedDates)) return; 56574 const r2 = getDateString(e2), { CSSClasses: i2 } = current.self; 56575 if (null == (s2 = current.self.rangeDisabled) ? void 0 : s2.includes(r2)) return; 56576 const d2 = null == (l2 = current.self.HTMLElement) ? void 0 : l2.querySelectorAll(`[data-calendar-day="${r2}"]`); 56577 null == d2 || d2.forEach(((e3) => { 56578 var t3; 56579 e3.classList.add(i2.dayBtnHover), null == (t3 = e3.parentElement) || t3.classList.add(i2.dayHoverIntermediate); 56580 })), null == t2 || t2.forEach(((e3) => { 56581 var t3; 56582 return null == (t3 = e3.parentElement) ? void 0 : t3.classList.add(i2.dayHoverFirst); 56583 })), null == a2 || a2.forEach(((e3) => { 56584 var t3; 56585 return null == (t3 = e3.parentElement) ? void 0 : t3.classList.add(i2.dayHoverLast); 56586 })); 56587 }, handleHoverDaysEvent = (e2) => { 56588 var t2; 56589 if (!e2.target || !(null == (t2 = current.self) ? void 0 : t2.selectedDates)) return; 56590 if (!e2.target.closest(`.${current.self.CSSClasses.days}`)) return void removeHoverEffect(); 56591 const a2 = e2.target.closest("[data-calendar-day]"); 56592 if (!a2) return; 56593 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]; 56594 removeHoverEffect(); 56595 for (let e3 = new Date(o2); e3 <= u2; e3.setDate(e3.getDate() + 1)) addHoverEffect(e3, d2, c2); 56596 }, handleCancelSelectionDays = (e2) => { 56597 current.self && "Escape" === e2.key && (current.self.selectedDates = [], current.self.HTMLElement.removeEventListener("mousemove", handleHoverDaysEvent), document.removeEventListener("keydown", handleCancelSelectionDays), create(current.self)); 56598 }, updateDisabledDates = () => { 56599 var e2, t2, a2; 56600 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; 56601 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]); 56602 s2 && (current.self.rangeMin = getDateString(new Date(s2.setDate(s2.getDate() + 1)))), l2 && (current.self.rangeMax = getDateString(new Date(l2.setDate(l2.getDate() - 1)))); 56603 }, handleDayRangedSelection = (e2, t2) => { 56604 var a2; 56605 if (t2) { 56606 const n2 = 1 === e2.selectedDates.length && e2.selectedDates[0].includes(t2); 56607 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))); 56608 } 56609 e2.settings.range.disableGaps && (current.rangeMin = current.rangeMin ? current.rangeMin : e2.rangeMin, current.rangeMax = current.rangeMax ? current.rangeMax : e2.rangeMax), current.self = e2; 56610 ({ set: () => { 56611 e2.HTMLElement.addEventListener("mousemove", handleHoverDaysEvent), document.addEventListener("keydown", handleCancelSelectionDays), e2.settings.range.disableGaps && updateDisabledDates(); 56612 }, reset: () => { 56613 const [t3, a3] = [e2.selectedDates[0], e2.selectedDates[e2.selectedDates.length - 1]]; 56614 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); 56615 } })[1 === e2.selectedDates.length ? "set" : "reset"](); 56616 }, handleDaySelection = (e2, t2, a2) => { 56617 if (!t2.dataset.calendarDay) return; 56618 const n2 = t2.dataset.calendarDay, s2 = t2.classList.contains(e2.CSSClasse
56618s.dayBtnSelected); 56619 s2 && !e2.settings.selection.cancelableDay || (e2.selectedDates = s2 ? e2.selectedDates.filter(((e3) => e3 !== n2)) : a2 ? [...e2.selectedDates, n2] : [n2]); 56620 }, handleClickDay = (e2, t2) => { 56621 var a2; 56622 const n2 = t2.target, s2 = (e3) => n2.closest(`.${e3}`), l2 = s2(e2.CSSClasses.dayBtn); 56623 if (!e2.settings.selection.day || !["single", "multiple", "multiple-ranged"].includes(e2.settings.selection.day) || !l2) return; 56624 ({ 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); 56625 e2.input && e2.HTMLInputElement && e2.HTMLElement && e2.actions.changeToInput && e2.actions.changeToInput(t2, e2); 56626 const r2 = s2(e2.CSSClasses.dayBtnPrev), i2 = s2(e2.CSSClasses.dayBtnNext); 56627 ({ prev: () => changeMonth(e2, "prev"), next: () => changeMonth(e2, "next"), default: () => createDays(e2) })[r2 ? "prev" : i2 ? "next" : "default"](); 56628 }, getColumnID = (e2, t2, a2, n2, s2) => { 56629 const l2 = e2.HTMLElement.querySelectorAll(`.${e2.CSSClasses.column}`), r2 = [...l2].findIndex(((e3) => e3.classList.contains(t2))), i2 = Number(l2[r2].querySelector(`.${a2}`).getAttribute(s2)); 56630 return "month" === e2.currentType && r2 >= 0 ? n2 - r2 : "year" === e2.currentType && e2.selectedYear !== i2 ? n2 - 1 : n2; 56631 }, handleItemClick = (e2, t2, a2, n2, s2) => { 56632 const l2 = { year: () => { 56633 var a3, n3; 56634 return null == (n3 = (a3 = e2.actions).clickYear) ? void 0 : n3.call(a3, t2, e2); 56635 }, month: () => { 56636 var a3, n3; 56637 return null == (n3 = (a3 = e2.actions).clickMonth) ? void 0 : n3.call(a3, t2, e2); 56638 } }; 56639 ({ year: () => { 56640 if ("multiple" === e2.type) { 56641 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(); 56642 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; 56643 } else e2.selectedYear = Number(s2.dataset.calendarYear); 56644 }, month: () => { 56645 if ("multiple" === e2.type) { 56646 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}`); 56647 e2.selectedYear = Number(a3.dataset.calendarSelectedYear); 56648 const l3 = t3 < e2.dateMin.getMonth() && e2.selectedYear <= e2.dateMin.getFullYear(), r2 = t3 > e2.dateMax.getMonth() && e2.selectedYear >= e2.dateMax.getFullYear(); 56649 e2.selectedMonth = l3 ? e2.dateMin.getMonth() : r2 ? e2.dateMax.getMonth() : t3; 56650 } else e2.selectedMonth = Number(s2.dataset.calendarMonth); 56651 } })[a2](), l2[a2](), e2.currentType = e2.type, create(e2); 56652 }, handleClickMonthOrYear = (e2, t2, a2, n2) => { 56653 if (!e2.settings.selection[a2]) return; 56654 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); 56655 if (e2.currentType !== a2 && r2) { 56656 ({ year: () => createYears(e2, s2), month: () => createMonths(e2, s2) })[a2](); 56657 } 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)); 56658 }, handleClick = (e2) => { 56659 const t2 = (t3) => { 56660 handleClickArrow(e2, t3), handleClickWeekNumber(e2, t3), handleClickDay(e2, t3), handleClickMonthOrYear(e2, t3, "month", { header: e2.CSSClasse
56660s.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 }); 56661 }; 56662 return e2.HTMLElement.addEventListener("click", t2), () => e2.HTMLElement.removeEventListener("click", t2); 56663 }, reset = (e2, { year: t2, month: a2, dates: n2, holidays: s2, time: l2 } = {}) => { 56664 var r2; 56665 const i2 = __spreadValues({}, e2.settings.selected); 56666 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); 56667 }, setPositionCalendar = (e2, t2, a2, n2) => { 56668 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; 56669 t2.classList.add("bottom" === l2 ? n2.calendarToInputBottom : n2.calendarToInputTop); 56670 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]; 56671 Object.assign(t2.style, { left: `${u2}px`, top: `${o2}px` }); 56672 }, handleInput = (e2) => { 56673 let t2 = true; 56674 const a2 = []; 56675 e2.HTMLInputElement = e2.HTMLElement; 56676 const n2 = () => setPositionCalendar(e2.HTMLInputElement, e2.HTMLElement, e2.settings.visibility.positionToInput, e2.CSSClasses), s2 = (t3) => { 56677 var a3; 56678 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 })); 56679 }; 56680 return e2.HTMLInputElement.addEventListener("click", (() => { 56681 t2 ? a2.push((() => { 56682 const a3 = document.createElement("div"); 56683 return a3.className = `${e2.CSSClasses.calendar} ${e2.CSSClasses.calendarToInput} ${e2.CSSClasses.calendarHidden}`, e2.HTMLElement = a3, document.body.append(e2.HTMLElement), t2 = false, setTimeout((() => { 56684 setPositionCalendar(e2.HTMLInputElement, a3, e2.settings.visibility.positionToInput, e2.CSSClasses), e2.show(); 56685 }), 0), reset(e2, { year: true, month: true, dates: true, holidays: true, time: true }), e2.actions.initCalendar && e2.actions.initCalendar(e2), handleClick(e2); 56686 })()) : (setPositionCalendar(e2.HTMLInputElement, e2.HTMLElement, e2.settings.visibility.positionToInput, e2.CSSClasses), e2.show()), window.addEventListener("resize", n2), document.addEventListener("click", s2, { capture: true }); 56687 })), () => { 56688 a2.forEach(((e3) => e3())); 56689 }; 56690 }, update = (e2, { year: t2, month: a2, dates: n2, holidays: s2, time: l2 }
56690 = {}) => { 56691 if (!e2.isInit) throw new Error(messages.notInit); 56692 reset(e2, { year: t2, month: a2, dates: n2, holidays: s2, time: l2 }), e2.actions.updateCalendar && e2.actions.updateCalendar(e2); 56693 }, destroy = (e2) => { 56694 var t2, a2, n2, s2; 56695 if (!e2.isInit) throw new Error(messages.notInit); 56696 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); 56697 }; 56698 class VanillaCalendar extends DefaultOptionsCalendar { 56699 constructor(e2, t2) { 56700 if (super(), __publicField(this, "init", (() => { 56701 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)); 56702 var e3; 56703 })), __publicField(this, "update", ((e3) => update(this, e3))), __publicField(this, "destroy", (() => destroy(this))), __publicField(this, "show", (() => { 56704 var e3; 56705 (e3 = this).currentType ? (e3.HTMLElement.classList.remove(e3.CSSClasses.calendarHidden), e3.actions.showCalendar && e3.actions.showCalendar(e3)) : e3.HTMLElement.click(); 56706 })), __publicField(this, "hide", (() => { 56707 var e3; 56708 (e3 = this).currentType && (e3.HTMLElement.classList.add(e3.CSSClasses.calendarHidden), e3.actions.hideCalendar && e3.actions.hideCalendar(e3)); 56709 })), this.HTMLElement = "string" == typeof e2 ? document.querySelector(e2) : e2, !this.HTMLElement) throw new Error(messages.notFoundSelector(e2)); 56710 if (!t2) return; 56711 const a2 = (e3, t3) => { 56712 Object.keys(t3).forEach(((n2) => { 56713 "object" != typeof e3[n2] || "object" != typeof t3[n2] || t3[n2] instanceof Date ? e3[n2] = t3[n2] : a2(e3[n2], t3[n2]); 56714 })); 56715 }; 56716 a2(this, t2); 56717 } 56718 } 56719 const vanillaCalendarCSS = i$9` 56720 .vanilla-calendar { 56721 position: relative; 56722 box-sizing: border-box; 56723 display: flex; 56724 height: -webkit-max-content; 56725 height: max-content; 56726 width: -webkit-max-content; 56727 width: max-content; 56728 min-width: 272px; 56729 max-width: 100%; 56730 flex-direction: column; 56731 border-radius: var(--sc-rounded-md); 56732 opacity: 1; 56733 transition-property: opacity; 56734 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 56735 transition-duration: 0.15s; 56736 } 56737 .vanilla-calendar_multiple { 56738 width: 550px; 56739 } 56740 .vanilla-calendar button:focus-visible { 56741 border-radius: var(-sc-rounded); 56742 outline-style: solid; 56743 outline-width: 1px; 56744 } 56745 .vanilla-calendar.vanilla-calendar_multiple .vanilla-calendar-days { 56746 flex-grow: 0; 56747 } 56748 .vanilla-calendar_hidden { 56749 pointer-events: none; 56750 opacity: 0; 56751 } 56752 .vanilla-calendar_to-input { 56753 position: absolute; 56754 left: 0; 56755 bottom: 0; 56756 margin-top: 0.25em; 56757 } 56758 .vanilla-calendar-controls { 56759 pointer-events: none; 56760 position: absolute; 56761 left: 0; 56762 right: 0; 56763 top: 0; 56764 z-index: 20; 56765 box-sizing: content-box; 56766 display: flex; 56767 align-items: center; 56768 justify-content: space-between; 56769 padding-left: 1em; 56770 padding-right: 1em; 56771 padding-top: 1.25em; 56772 } 56773 .vanilla-calendar-arrow { 56774 pointer-events: auto; 56775 position: relative; 56776 display: block; 56777 height: 1.5em; 56778 width: 1.5em; 56779 cursor: pointer; 56780 border-width: 0px; 56781 background-color: transparent; 56782 } 56783 .vanilla-calendar-arrow:before { 56784 position: absolute; 56785 inset: 0; 56786 background-color: currentColor; 56787 --tw-content: ""; 56788 -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>"); 56789 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>"); 56790 -webkit-mask-position: center center; 56791 mask-position: center center; 56792 content: var(--tw-content); 56793 -webkit-mask-repeat: no-repeat; 56794 mask-repeat: no-repeat; 56795 } 56796 .vanilla-calendar-arrow.vanilla-calendar-arrow_prev:before { 56797 transform: rotate(90deg); 56798 } 56799 .vanilla-calendar-arrow.vanilla-calendar-arrow_next:before { 56800 transform: rotate(-90deg); 56801 } 56802 .vanilla-calendar-grid { 56803 display: grid; 56804 flex-grow: 1; 56805 grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 56806 gap: 1.75em; 56807 } 56808 .vanilla-calendar-grid.vanilla-calendar-grid_disabled .vanilla-calendar-column { 56809 pointer-events: none; 56810 opacity: 0.3; 56811 } 56812 .vanilla-calendar-grid.vanilla-calendar-grid_disabled .vanilla-calendar-column.vanilla-calendar-column_month, 56813 .vanilla-calendar-grid.vanilla-calendar-grid_disabled .vanilla-calendar-column.vanilla-calendar-column_year {
56814 pointer-events: auto; 56815 opacity: 1; 56816 } 56817 .vanilla-calendar-column { 56818 display: flex; 56819 min-width: -webkit-min-content; 56820 min-width: min-content; 56821 flex-direction: column; 56822 } 56823 .vanilla-calendar-header { 56824 position: relative; 56825 margin-bottom: 0.75em; 56826 display: flex; 56827 align-items: center; 56828 } 56829 .vanilla-calendar-header__content { 56830 display: grid; 56831 flex-grow: 1; 56832 grid-auto-columns: -webkit-max-content; 56833 grid-auto-columns: max-content; 56834 grid-auto-flow: column; 56835 align-items: center; 56836 justify-content: center; 56837 white-space: pre-wrap; 56838 padding-left: 1em; 56839 padding-right: 1em; 56840 } 56841 .vanilla-calendar-month, 56842 .vanilla-calendar-year { 56843 cursor: pointer; 56844 border-radius: var(--sc-rounded-sm); 56845 border-width: 0px; 56846 background-color: transparent; 56847 padding: 0.25em; 56848 font-size: 1em; 56849 line-height: 1.5em; 56850 font-weight: 700; 56851 } 56852 .vanilla-calendar-month.vanilla-calendar-month_disabled, 56853 .vanilla-calendar-year.vanilla-calendar-year_disabled { 56854 pointer-events: none; 56855 } 56856 .vanilla-calendar-months { 56857 display: grid; 56858 flex-grow: 1; 56859 grid-template-columns: repeat(4, minmax(0, 1fr)); 56860 align-items: center; 56861 row-gap: 1em; 56862 column-gap: 0.5em; 56863 } 56864 .vanilla-calendar-years { 56865 display: grid; 56866 flex-grow: 1; 56867 grid-template-columns: repeat(5, minmax(0, 1fr)); 56868 align-items: center; 56869 row-gap: 1em; 56870 column-gap: 0.5em; 56871 } 56872 .vanilla-calendar-months_selecting .vanilla-calendar-months__month, 56873 .vanilla-calendar-years_selecting .vanilla-calendar-years__year { 56874 cursor: pointer; 56875 } 56876 .vanilla-calendar-months_selecting .vanilla-calendar-months__month .vanilla-calendar-months__month_disabled, 56877 .vanilla-calendar-years_selecting .vanilla-calendar-years__year .vanilla-calendar-years__year_disabled { 56878 cursor: default; 56879 } 56880 .vanilla-calendar-months__month, 56881 .vanilla-calendar-years__year { 56882 display: flex; 56883 height: 2.5em; 56884 align-items: center; 56885 justify-content: center; 56886 word-break: break-all; 56887 border-radius: var(-sc-rounded); 56888 border-width: 0px; 56889 padding: 0.25em; 56890 text-align: center; 56891 font-size: 0.75em; 56892 line-height: 1em; 56893 font-weight: 600; 56894 } 56895 .vanilla-calendar-months__month.vanilla-calendar-months__month_disabled, 56896 .vanilla-calendar-years__year.vanilla-calendar-years__year_disabled { 56897 pointer-events: none; 56898 } 56899 .vanilla-calendar-week-numbers { 56900 display: flex; 56901 flex-direction: column; 56902 } 56903 .vanilla-calendar-week-numbers__title { 56904 margin-bottom: 0.5em; 56905 display: flex; 56906 align-items: center; 56907 justify-content: center; 56908 font-size: 0.75em; 56909 line-height: 1em; 56910 font-weight: 700; 56911 } 56912 .vanilla-calendar-week-numbers__content { 56913 display: grid; 56914 grid-auto-flow: row; 56915 align-items: center; 56916 justify-items: center; 56917 row-gap: 0.25em; 56918 } 56919 .vanilla-calendar-week-number { 56920 margin: 0; 56921 display: flex; 56922 height: 100%; 56923 min-height: 1.875em; 56924 width: 100%; 56925 min-width: 1.875em; 56926 cursor: pointer;
56927 align-items: center; 56928 justify-content: center; 56929 border-style: none; 56930 background-color: transparent; 56931 padding: 0; 56932 font-size: 0.75em; 56933 line-height: 1em; 56934 font-weight: 600; 56935 } 56936 .vanilla-calendar-wrapper { 56937 display: flex; 56938 flex-grow: 1; 56939 } 56940 .vanilla-calendar-content { 56941 display: flex; 56942 flex-grow: 1; 56943 flex-direction: column; 56944 } 56945 .vanilla-calendar-week { 56946 margin-bottom: 0.5em; 56947 display: grid; 56948 grid-template-columns: repeat(7, 1fr); 56949 justify-items: center; 56950 } 56951 .vanilla-calendar-week__day { 56952 display: flex; 56953 height: 100%; 56954 width: 100%; 56955 min-width: 1.875em; 56956 align-items: center; 56957 justify-content: center; 56958 font-size: 0.75em; 56959 line-height: 1em; 56960 font-weight: 700; 56961 } 56962 .vanilla-calendar-days { 56963 display: grid; 56964 flex-grow: 1; 56965 grid-template-columns: repeat(7, 1fr); 56966 align-items: center; 56967 justify-items: center; 56968 gap: 0.25em; 56969 } 56970 .vanilla-calendar-days_selecting .vanilla-calendar-day__btn { 56971 cursor: pointer; 56972 } 56973 .vanilla-calendar-days_selecting .vanilla-calendar-day__btn_disabled { 56974 cursor: default; 56975 } 56976 .vanilla-calendar-day { 56977 position: relative; 56978 display: flex; 56979 height: 100%; 56980 width: 100%; 56981 align-items: center; 56982 justify-content: center; 56983 } 56984 .vanilla-calendar-day:focus-visible .vanilla-calendar-day__popup, 56985 .vanilla-calendar-day:hover .vanilla-calendar-day__popup { 56986 pointer-events: auto; 56987 opacity: 1; 56988 } 56989 .vanilla-calendar-day_selected-first .vanilla-calendar-day__btn_selected { 56990 border-top-right-radius: 0; 56991 border-bottom-right-radius: 0; 56992 border-top-left-radius: 0.5em; 56993 border-bottom-left-radius: 0.5em; 56994 } 56995 .vanilla-calendar-day_selected-last .vanilla-calendar-day__btn_selected { 56996 border-top-left-radius: 0; 56997 border-bottom-left-radius: 0; 56998 border-top-right-radius: 0.5em; 56999 border-bottom-right-radius: 0.5em; 57000 } 57001 .vanilla-calendar-day_selected-intermediate .vanilla-calendar-day__btn_selected_intermediate { 57002 border-radius: 0; 57003 } 57004 .vanilla-calendar-day__btn { 57005 display: flex; 57006 height: 100%; 57007 min-height: 1.875em; 57008 width: 100%; 57009 min-width: 1.875em; 57010 cursor: default; 57011 align-items: center; 57012 justify-content: center; 57013 border-radius: var(-sc-rounded); 57014 border-width: 0px; 57015 font-size: 0.75em; 57016 line-height: 1em; 57017 font-weight: 400; 57018 } 57019 .vanilla-calendar-day__btn_today { 57020 font-weight: 700; 57021 } 57022 .vanilla-calendar-day__btn_disabled { 57023 pointer-events: none; 57024 } 57025 .vanilla-calendar-day__popup { 57026 transform: translate(-50%); 57027 pointer-events: none; 57028 position: absolute; 57029 left: 50%; 57030 top: 100%; 57031 z-index: 20; 57032 width: 8em; 57033 padding: 1em 0.75em 0.5em; 57034 font-size: 0.75em; 57035 line-height: 1em; 57036 font-weight: 400; 57037 opacity: 0; 57038 } 57039 .vanilla-calendar-day__popup:before { 57040 content: var(--tw-content); 57041 position: absolute; 57042 } 57043 .vanilla-calendar-day__popup:after { 57044 content: var(--tw-content); 57045 position: absolute; 57046 } 57047 .vanilla-calendar-day__popup:hover { 57048 pointer-events: auto; 57049 opacity: 1; 57050 } 57051 .vanilla-calendar-day__popup:before { 57052 content: ""; 57053 left: 0; 57054 bottom: 0; 57055 z-index: -10; 57056 display: block; 57057 height: calc(100% - 8px); 57058 width: 100%; 57059 border-radius: var(-sc-rounded); 57060 } 57061 .vanilla-calendar-day__popup:after { 57062 content: ""; 57063 transform: translate(-50%); 57064 left: 50%; 57065 top: 1px; 57066 z-index: -10; 57067 display: block; 57068 height: 0px; 57069 width: 0px; 57070 border-left-width: 8px; 57071 border-right-width: 8px; 57072 border-top-width: 0px; 57073 border-bottom-width: 8px; 57074 border-style: solid; 57075 border-left-color: transparent; 57076 border-right-color: transparent; 57077 border-top-color: transparent; 57078 } 57079 .vanilla-calendar-time { 57080 margin-top: 0.75em; 57081 display: grid; 57082 grid-template-columns: auto 1fr; 57083 gap: 0.75em; 57084 border-top-width: 1px; 57085 border-bottom-width: 0px; 57086 border-left-width: 0px; 57087 border-right-width: 0px; 57088 border-style: solid; 57089 padding-top: 0.75em; 57090 } 57091 .vanilla-calendar-time__content { 57092 display: grid; 57093 grid-auto-flow: column; 57094 align-items: center; 57095 } 57096 .vanilla-calendar-time__hours { 57097 position: relative; 57098 margin-right: 0.35em; 57099 width: 1.75em; 57100 } 57101 .vanilla-calendar-time__hours:after { 57102 position: absolute; 57103 right: -5px; 57104 top: 50%; 57105 margin-top: calc(-50% + 1px); 57106 display: block; 57107 --tw-content: ":"; 57108 content: var(--tw-content); 57109 } 57110 .vanilla-calendar-time__minutes { 57111 width: 1.75em; 57112 } 57113 .vanilla-calendar-time__hours input, 57114 .vanilla-calendar-time__minutes input { 57115 position: relative; 57116 margin: 0; 57117 box-sizing: border-box; 57118 display: block; 57119 width: 100%; 57120 border-radius: var(--sc-rounded-sm); 57121 border-width: 0px; 57122 padding: 0.125em; 57123 text-align: center; 57124 font-size: 1.125em; 57125 font-weight: 600; 57126 line-height: 1.125em; 57127 } 57128 .vanilla-calendar-time__hours input:focus-visible, 57129 .vanilla-calendar-time__minutes input:focus-visible { 57130 outline-style: solid; 57131 outline-width: 1px; 57132 } 57133 .vanilla-calendar-time__hours input:disabled, 57134 .vanilla-calendar-time__minutes input:disabled { 57135 cursor: default; 57136 } 57137 .vanilla-calendar-time__hours input:hover:disabled, 57138 .vanilla-calendar-time__minutes input:hover:disabled { 57139 background-color: transparent; 57140 } 57141 .vanilla-calendar-time__keeping { 57142 margin-left: 1px; 57143 margin-top: 0.25em; 57144 width: 22px; 57145 cursor: pointer; 57146 border-radius: var(--sc-rounded-sm); 57147 border-width: 0px; 57148 background-color: transparent; 57149 padding: 0; 57150 font-size: 11px; 57151 } 57152 .vanilla-calendar-time__keeping:focus-visible { 57153 outline-style: solid; 57154 outline-width: 1px; 57155 } 57156 .vanilla-calendar-time__keeping:disabled { 57157 cursor: default; 57158 } 57159 .vanilla-calendar-time__keeping:hover:disabled { 57160 background-color: transparent; 57161 } 57162 .vanilla-calendar-time__ranges { 57163 display: grid; 57164 grid-auto-flow: row; 57165 } 57166 .vanilla-calendar-time__range { 57167 position: relative; 57168 z-index: 10; 57169 font-size: 0; 57170 } 57171 .vanilla-calendar-time__range:before { 57172 content: var(--tw-content); 57173 left: 0; 57174 } 57175 .vanilla-calendar-time__range:after { 57176 content: var(--tw-content); 57177 right: 0; 57178 } 57179 .vanilla-calendar-time__range:before, 57180 .vanilla-calendar-time__range:after { 57181 content: ""; 57182 transform: translateY(-50%); 57183 pointer-events: none; 57184 position: absolute; 57185 top: 50%; 57186 z-index: 10; 57187 height: 0.5em; 57188 width: 1px; 57189 } 57190 .vanilla-calendar-time__range input { 57191 position: relative; 57192 margin: 0; 57193 height: 1.25em; 57194 width: 100%; 57195 cursor: pointer; 57196 -webkit-appearance: none; 57197 appearance: none; 57198 outline-width: 0px; 57199 } 57200 .vanilla-calendar-time__range input::-webkit-slider-thumb { 57201 position: relative; 57202 z-index: 20; 57203 margin-top: -0.5em; 57204 box-sizing: border-box; 57205 height: 1em; 57206 width: 0.75em; 57207 cursor: pointer; 57208 -webkit-appearance: none; 57209 appearance: none; 57210 border-radius: var(--sc-rounded-sm); 57211 border-width: 1px; 57212 border-style: solid; 57213 --tw-shadow: 0 0 #0000; 57214 --tw-shadow-colored: 0 0 #0000; 57215 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-sha
57215dow); 57216 } 57217 .vanilla-calendar-time__range input::-moz-range-thumb { 57218 position: relative; 57219 z-index: 20; 57220 box-sizing: border-box; 57221 height: 1em; 57222 width: 0.75em; 57223 cursor: pointer; 57224 border-radius: var(--sc-rounded-sm); 57225 border-width: 1px; 57226 border-style: solid; 57227 --tw-shadow: 0 0 #0000; 57228 --tw-shadow-colored: 0 0 #0000; 57229 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 57230 } 57231 .vanilla-calendar-time__range input::-webkit-slider-runnable-track { 57232 margin-top: 1px; 57233 box-sizing: border-box; 57234 height: 1px; 57235 width: 100%; 57236 cursor: pointer; 57237 --tw-shadow: 0 0 #0000; 57238 --tw-shadow-colored: 0 0 #0000; 57239 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); 57240 } 57241 .vanilla-calendar-time__range input::-moz-range-track { 57242 margin-top: 1px; 57243 box-sizing: border-box; 57244 height: 1px; 57245 width: 100%; 57246 cursor: pointer; 57247 --tw-shadow: 0 0 #0000; 57248 --tw-shadow-colored: 0 0 #0000; 57249 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-sha
57249dow); 57250 } 57251 57252 .vanilla-calendar-day { 57253 width: 2em; 57254 height: 2em; 57255 color: var(--sc-base-content); 57256 } 57257 57258 .vanilla-calendar-day__btn { 57259 border-radius: 50% !important; 57260 font-weight: 600; 57261 box-shadow: 0 0 0 0 var(--sc-base-100); 57262 } 57263 57264 .vanilla-calendar-week__day_weekend, 57265 .vanilla-calendar-day__btn_weekend, 57266 .vanilla-calendar-day__btn_weekend.vanilla-calendar-day__btn_disabled { 57267 color: var(--sc-base-700); 57268 } 57269 57270 .vanilla-calendar-day__btn_disabled { 57271 border-color: transparent; 57272 opacity: 0.7; 57273 color: var(--sc-base-content); 57274 background-color: transparent; 57275 font-weight: 400; 57276 } 57277 57278 .vanilla-calendar-day__btn_today { 57279 font-weight: 600 !important; 57280 } 57281 .vanilla-calendar-day__btn:not(.vanilla-calendar-day__btn_disabled) { 57282 border-radius: 50% !important; 57283 font-weight: 600; 57284 color: var(--sc-base-content); 57285 background: var(--sc-base-100); 57286 box-shadow: 0 0 0 0 var(--sc-base-100); 57287 } 57288 57289 /* !! SUPERSONIKS !! */ 57290 .vanilla-calendar-day__btn:focus, 57291 .vanilla-calendar-day__btn:hover { 57292 box-shadow: 0 0 0 2px var(--sc-base-content); 57293 } 57294 57295 .vanilla-calendar-day__btn:focus, 57296 .vanilla-calendar-day__btn:hover, 57297 .vanilla-calendar-day__btn_selected { 57298 transition: 0.1s; 57299 background-color: var(--sc-base-content) !important; 57300 color: var(--sc-base) !important; 57301 } 57302 /* YEAR */ 57303 .vanilla-calendar-months__month, 57304 .vanilla-calendar-years__year { 57305 border-radius: var(--sc-rounded); 57306 } 57307 57308 .vanilla-calendar-months__month:hover, 57309 .vanilla-calendar-months__month:focus, 57310 .vanilla-calendar-years__year:focus, 57311 .vanilla-calendar-years__year:hover { 57312 background: var(--sc-base-100); 57313 } 57314 .vanilla-calendar-months__month_disabled, 57315 .vanilla-calendar-years__year_disabled { 57316 color: var(--sc-base-400); 57317 } 57318`; 57319 var __defProp$15 = Object.defineProperty; 57320 var __getOwnPropDesc$18 = Object.getOwnPropertyDescriptor; 57321 var __decorateClass$18 = (decorators, target, key, kind) => { 57322 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$18(target, key) : target; 57323 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 57324 if (decorator = decorators[i2]) 57325 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 57326 if (kind && result) __defProp$15(target, key, result); 57327 return result; 57328 }; 57329 const WarningKeys = ["almost_full_here", "almost_full_places", "almost_full", "remaining_places_warning", "deferred"]; 57330 const UnavailableKeys = ["full", "full_here", "full_in_no_quota", "canceled", "forced_to_full"]; 57331 const tagName$S = "sonic-buy-calendar"; 57332 let SonicBuyCalendar = class extends Subscriber$1(i$6) { 57333 constructor() { 57334 super(...arguments); 57335 this.initialized = false; 57336 this.sessions = []; 57337 this.dates = []; 57338 this.displayInfos = false; 57339 this.sessionStatuses = []; 57340 this._filteredSessions = []; 57341 this.formatDateForCalendar = (date2) => { 57342 return date2.toLocaleDateString("en-GB", { 57343 year: "numeric", 57344 month: "2-digit", 57345 day: "2-digit" 57346 }).split("/").reverse().join("-"); 57347 }; 57348 } 57349 // INITIALISATION DU CALENDRIER 57350 initCalendar(enabledDates = [], container) { 57351 const htmlLang = HTML$1.getLanguage(); 57352 const options = { 57353 actions: { 57354 clickDay: (_2, _self) => { 57355 if (_self) { 57356 this.selectedDay = _self.selectedDates[0]; 57357 } 57358 } 57359 }, 57360 settings: { 57361 lang: htmlLang, 57362 range: { 57363 disableAllDays: true 57364 } 57365 } 57366 }; 57367 if (options?.settings?.range) { 57368 options.settings.range.enabled = enabledDates; 57369 } 57370 const today = /* @__PURE__ */ new Date(); 57371 today.setHours(0, 0, 0, 0); 57372 const firstUpcomingDate = enabledDates.find((date2) => { 57373 const [year, month, day] = date2.split("-").map(Number); 57374 const dateObj = new Date(year, month - 1, day); 57375 return dateObj >= today; 57376 }) || enabledDates[0]; 57377 if (firstUpcomingDate) { 57378 const [year, month] = firstUpcomingDate.split("-").map(Number); 57379 if (options?.settings) { 57380 options.settings.selected = { 57381 month: month - 1, 57382 year 57383 }; 57384 } 57385 } 57386 this.calendar = new VanillaCalendar(container, options);
57387 this.calendar.init(); 57388 } 57389 async updated(changedProperties) { 57390 if (changedProperties.has("sessions")) { 57391 if (this.sessions.length && this.calendarContainer) { 57392 const enabledDates = this.sessions.map((session) => { 57393 if (session.start_date) { 57394 const date2 = new Date(session.start_date * 1e3); 57395 return date2.toLocaleDateString("en-GB", { 57396 year: "numeric", 57397 month: "2-digit", 57398 day: "2-digit" 57399 }).split("/").reverse().join("-"); 57400 } else { 57401 return ""; 57402 } 57403 }); 57404 if (!this.calendar) { 57405 this.initCalendar(enabledDates, this.calendarContainer); 57406 } else { 57407 this.calendar.settings.range.enabled = enabledDates; 57408 this.calendar.update(); 57409 } 57410 if (this.sessions.length && this.calendar) { 57411 this.sessionStatuses = await this.getSatusInfo(this.sessions); 57412 const popupSettings = await this.getPopupSettings(); 57413 this.calendar.popups = popupSettings; 57414 this.displayInfos = Object.keys(popupSettings).length > 0; 57415 this.calendar.update(); 57416 } 57417 } 57418 if (!this.initialized) { 57419 const urlParams = new URLSearchParams(window.location.search); 57420 const sessionId = urlParams.get("session"); 57421 if (sessionId) { 57422 const session = this.sessions.find((s2) => s2.id === parseInt(sessionId)); 57423 if (session?.start_date) { 57424 const date2 = new Date(session.start_date * 1e3); 57425 this.selectedDay = this.formatDateForCalendar(date2); 57426 } 57427 } 57428 this.initialized = true; 57429 } 57430 } 57431 if (changedProperties.has("selectedDay")) { 57432 this._filteredSessions = this.sessions?.filter((session) => { 57433 if (!session.start_date) { 57434 return false; 57435 } 57436 const date2 = new Date(session.start_date * 1e3); 57437 return this.formatDateForCalendar(date2) === this.selectedDay; 57438 }); 57439 } 57440 super.willUpdate(changedProperties); 57441 } 57442 async getSatusInfo(sessions) { 57443 const api2 = new API(this.getApiConfiguration()); 57444 const ids = sessions.map((session) => session.id).join(","); 57445 const eventsData = await api2.get(`/sessions?ids=${ids}&features[]=status`); 57446 return eventsData.data; 57447 } 57448 // 57449 async getPopupSettings() { 57450 const events = this.sessionStatuses; 57451 const eventsStatusByDay = {}; 57452 events.forEach((event) => { 57453 if (!event.start_date) { 57454 return; 57455 } 57456 const date2 = new Date(event.start_date * 1e3); 57457 const day = this.formatDateForCalendar(date2); 57458 if (!eventsStatusByDay[day]) { 57459 eventsStatusByDay[day] = []; 57460 } 57461 const isAvailable = event.infos_status?.additionnals?.some((additionnal) => { 57462 if (!additionnal.key) return true; 57463 return !UnavailableKeys.includes(additionnal.key); 57464 }); 57465 const isWarning = event.infos_status?.additionnals?.some((additionnal) => { 57466 if (!additionnal.key) return false; 57467 return WarningKeys.includes(additionnal.key); 57468 }); 57469 eventsStatusByDay[day].push({ 57470 isAvailable: isAvailable || false, 57471 isWarning: isWarning || false 57472 }); 57473 }); 57474 const popupSettings = {}; 57475 Object.keys(eventsStatusByDay).forEach((day) => { 57476 const modifierClass = this.getModifierClass(eventsStatusByDay[day]); 57477 if (modifierClass) { 57478 popupSettings[day] = { 57479 modifier: modifierClass 57480 }; 57481 } 57482 }); 57483 return popupSettings; 57484 } 57485 getModifierClass(eventsDayStatus) { 57486 const isUnavailable = eventsDayStatus.length > 0 && eventsDayStatus.every((status) => status.isAvailable === false); 57487 if (isUnavailable) { 57488 return "calendar-danger-dot"; 57489 } 57490 const isWarning = eventsDayStatus.every((status) => status.isWarning === true || status.isAvailable === false); 57491 if (isWarning) { 57492 return "calendar-warning-dot"; 57493 } else { 57494 return false;
57495 } 57496 } 57497 // unset selected day 57498 unsetSelectedDay() { 57499 this.calendar?.update({ 57500 dates: true 57501 }); 57502 this.selectedDay = null; 57503 } 57504 render() { 57505 let startOfDay; 57506 if (this.selectedDay) { 57507 const date2 = new Date(this.selectedDay); 57508 startOfDay = date2.getTime() / 1e3; 57509 } 57510 const justifyClass = flexJustify(this.align); 57511 return b$1` 57512 <div class="${this.selectedDay ? "hidden" : " @container"}"> 57513 <div 57514 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}" 57515 > 57516 <sonic-icon library="custom" name="calendar-day"></sonic-icon> ${t("select_a_day")} 57517 </div> 57518 <sonic-fieldset class="@container mb-0"> 57519 <div class="@md:flex gap-4 ${justifyClass}"> 57520 <div id="calendarContainer" class=" @xl:text-lg @2xl:text-xl"></div> 57521 57522 <div 57523 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"}" 57524 > 57525 <div class="text-warning text-xs flex items-center font-bold gap-x-2"> 57526 <span class="bg-warning size-3 warning-triangle"></span><span> ${t("sold_out_soon")}</span> 57527 </div> 57528 <div class="text-danger text-xs flex items-center font-bold gap-x-2"> 57529 <span class="bg-danger rounded-full size-3"></span> <span> ${t("sold_out_or_canceled")}</span> 57530 </div> 57531 </div> 57532 </div> 57533 </sonic-fieldset> 57534 </div> 57535 57536 ${this.selectedDay && this._filteredSessions.length > 0 && this.id ? b$1`<sonic-tooltip label="${t("back_to_calendar")}"> 57537 <sonic-button type="primary" size="lg" @click=${this.unsetSelectedDay} class="mb-3 cursor-pointer"> 57538 <span class="font-bold flex gap-3"> 57539 <sonic-date date=${o$4(startOfDay)} noAutoFill hour="hidden" minute="hidden"></sonic-date> 57540 <span class="border-l-[1px] border-current block self-stretch "></span> 57541 <sonic-icon library="custom" name="xmark" class="self-center"></sonic-icon> 57542 </span> 57543 </sonic-button> 57544 </sonic-tooltip> 57545 <!-- 57546 Liste des séances du 57547 show filtrées par date 57548 --> 57549 <sonic-list 57550 class="grid gap-3 grid-cols-1" 57551 dataProvider="_filteredSessions/${this.id}" 57552 .props=${this._filteredSessions} 57553 > 57554 <template> 57555 <sonic-event-session-card onlyHours></sonic-event-session-card> 57556 </template> 57557 </sonic-list>` : A$1} 57558 `; 57559 } 57560 }; 57561 SonicBuyCalendar.styles = [ 57562 vanillaCalendarCSS, 57563 tailwind, 57564 i$9` 57565 .calendar-danger-dot::before, 57566 .calendar-danger-dot::after, 57567 .calendar-warning-dot::before, 57568 .calendar-warning-dot::after { 57569 width: 13px; 57570 height: 13px; 57571 display: inline-flex; 57572 vertical-align: middle; 57573 border-radius: 50%; 57574 content: ""; 57575 position: absolute; 57576 top: -3px; 57577 left: -2px; 57578 z-index: 3; 57579 } 57580 57581 /*OMBRE*/ 57582 .calendar-danger-dot::after, 57583 .calendar-warning-dot::after { 57584 transform: scale(1.3); 57585 z-index: 2; 57586 background-color: var(--sc-base); 57587 } 57588 57589 .calendar-warning-dot::after, 57590 .calendar-warning-dot::before { 57591 border-radius: 0; 57592 clip-path: polygon(50% 0, 0 100%, 100% 100%); 57593 } 57594 57595 .warning-triangle { 57596 clip-path: polygon(50% 0, 0 100%, 100% 100%); 57597 } 57598 57599 .calendar-warning-dot::before { 57600 background-color: var(--sc-warning); 57601 } 57602 .calendar-danger-dot::before { 57603 background-color: var(--sc-danger); 57604 } 57605 .calendar-warning-dot { 57606 --sc-base-content: var(--sc-warning); 57607 } 57608 .calendar-warning-dot:focus, 57609 .calendar-warning-dot:hover { 57610 color: var(--sc-warning-content) !important; 57611 } 57612 57613 .calendar-danger-dot { 57614 --sc-base-content: var(--sc-danger); 57615 } 57616 57617 .calendar-danger-dot:focus, 57618 .calendar-danger-dot:hover { 57619 color: var(--sc-danger-content) !important; 57620 } 57621 ` 57622 ]; 57623 __decorateClass$18([ 57624 e$7("#calendarContainer") 57625 ], SonicBuyCalendar.prototype, "calendarContainer", 2); 57626 __decorateClass$18([ 57627 c({ context: formTypeContext }), 57628 n$5({ type: String }) 57629 ], SonicBuyCalendar.prototype, "formType", 2); 57630 __decorateClass$18([ 57631 n$5({ type: Array }) 57632 ], SonicBuyCalendar.prototype, "sessions", 2); 57633 __decorateClass$18([ 57634 n$5({ type: Array }) 57635 ], SonicBuyCalendar.prototype, "dates", 2); 57636 __decorateClass$18([ 57637 r$5() 57638 ], SonicBuyCalendar.prototype, "selectedDay", 2); 57639 __decorateClass$18([ 57640 r$5() 57641 ], SonicBuyCalendar.prototype, "displayInfos", 2); 57642 __decorateClass$18([ 57643 c({ context: alignContext, subscribe: true }), 57644 n$5({ type: String, reflect: true }) 57645 ], SonicBuyCalendar.prototype, "align", 2); 57646 __decorateClass$18([ 57647 r$5() 57648 ], SonicBuyCalendar.prototype, "sessionStatuses", 2); 57649 __decorateClass$18([ 57650 r$5() 57651 ], SonicBuyCalendar.prototype, "_filteredSessions", 2); 57652 SonicBuyCalendar = __decorateClass$18([ 57653 t$3(tagName$S) 57654 ], SonicBuyCalendar); 57655 var __defProp$14 = Object.defineProperty; 57656 var __getOwnPropDesc$17 = Object.getOwnPropertyDescriptor; 57657 var __decorateClass$17 = (decorators, target, key, kind) => { 57658 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$17(target, key) : target; 57659 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 57660 if (decorator = decorators[i2]) 57661 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 57662 if (kind && result) __defProp$14(target, key, result); 57663 return result; 57664 }; 57665 const tagName$R = "sonic-buy-list"; 57666 let SonicBuyList = class extends Subscriber$1(i$6) { 57667 constructor() { 57668 super(...arguments); 57669 this.sessions = []; 57670 this.selectedSession = ""; 57671 this.formType = "select"; 57672 this.isInitialized = false;
57673 } 57674 // unset selected day 57675 unsetSelectedSession() { 57676 this.selectedSession = ""; 57677 } 57678 setSession(id) { 57679 this.selectedSession = id || ""; 57680 } 57681 willUpdate(changedProperties) { 57682 if (changedProperties.has("sessions") && !this.isInitialized) { 57683 const urlParams = new URLSearchParams(window.location.search); 57684 const sessionId = urlParams.get("session"); 57685 if (sessionId) this.setSession(sessionId); 57686 this.isInitialized = true; 57687 } 57688 } 57689 updated(changedProperties) { 57690 if (changedProperties.has("selectedSession") && this.selectedSession) { 57691 this.scrollIntoView({ behavior: "smooth", block: "start" }); 57692 } 57693 } 57694 render() { 57695 return b$1` 57696 <div class="${this.selectedSession ? "hidden" : " @container"}"> 57697 <div class="@container"> 57698 <div class="grid gap-3 grid-cols-1 @3xl:grid-cols-2"> 57699 ${o$1( 57700 this.sessions, 57701 (session) => b$1`<sonic-event-card 57702 tabindex="0" 57703 class="cursor-pointer" 57704 @keypress=${(e2) => { 57705 if (e2.key === "Enter") this.setSession(session.id); 57706 }} 57707 @click=${() => this.setSession(session.id)} 57708 dataProvider="eventListGroup/${session.id}" 57709 noAutoFill 57710 displayLocation 57711 .props=${session} 57712 ></sonic-event-card>` 57713 )} 57714 </div> 57715 </div> 57716 </div> 57717 ${this.selectedSession ? b$1`<sonic-fetch 57718 dataProvider="sessions/${this.selectedSession}?features[]=location&features[]=taxonomies&features[]=range&features[]=settings" 57719 key="data" 57720 > 57721 <sonic-event-session-card alwaysExpanded expanded .id=${this.selectedSession.toString()}> 57722 <div slot="prefix" class="flex"> 57723 <sonic-product-title class="text-3xl mb-4 text-left align-middle"></sonic-product-title> 57724 <sonic-tooltip label="${t("back_to_sessions")}" class="flex ml-auto self-start"> 57725 <sonic-button 57726 shape="circle" 57727 size="xl" 57728 type="neutral" 57729 @click=${this.unsetSelectedSession} 57730 class="translate-x-1 -translate-y-1 " 57731 > 57732 <sonic-icon library="custom" name="xmark" class="self-center"></sonic-icon> 57733 </sonic-button> 57734 </sonic-tooltip> 57735 </div> 57736 </sonic-event-session-card> 57737 </sonic-fetch>` : A$1} 57738 `; 57739 } 57740 }; 57741 SonicBuyList.styles = [tailwind]; 57742 __decorateClass$17([ 57743 n$5({ type: Array }) 57744 ], SonicBuyList.prototype, "sessions", 2); 57745 __decorateClass$17([ 57746 r$5() 57747 ], SonicBuyList.prototype, "selectedSession", 2); 57748 __decorateClass$17([ 57749 e$2({ context: formTypeContext }), 57750 n$5({ type: String }) 57751 ], SonicBuyList.prototype, "formType", 2); 57752 SonicBuyList = __decorateClass$17([ 57753 t$3(tagName$R) 57754 ], SonicBuyList); 57755 var __defProp$13 = Object.defineProperty; 57756 var __getOwnPropDesc$16 = Object.getOwnPropertyDescriptor; 57757 var __decorateClass$16 = (decorators, target, key, kind) => { 57758 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$16(target, key) : target; 57759 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 57760 if (decorator = decorators[i2]) 57761 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 57762 if (kind && result) __defProp$13(target, key, result); 57763 return result; 57764 }; 57765 const tagName$Q = "sonic-buy"; 57766 let BuyEventBlock = class extends EventContext(Fetcher$1(Subscriber$1(i$6))) { 57767 constructor() { 57768 super(...arguments); 57769 this.sessions = []; 57770 this.cleanData = false; 57771 this.formType = "select"; 57772 this.formSize = "sm"; 57773 this.displayPast = false; 57774 this.display = "default"; 57775 } 57776 connectedCallback() { 57777 this.isFetchEnabled = this.hasAttribute("fetch"); 57778 const cleanDataParameter = this.cleanData ? "&clean_sessions_data=true" : ""; 57779 const nextParameter = !this.displayPast ? "&next=true" : ""; 57780 if (this.isFetchEnabled && this.id) { 57781 this.dataProvider = `shows/${this.id}?view=essential${cleanDataParameter + nextParameter}`; 57782 this.key = "data"; 57783 } 57784 super.connectedCallback(); 57785 } 57786 render() { 57787 if (!this.props) return A$1; 57788 if (this.display == "list") { 57789 return b$1`<sonic-buy-list></sonic-buy-list>`; 57790 } else if (this.display == "calendar") { 57791 return b$1`<sonic-buy-calendar></sonic-buy-calendar>`; 57792 } else { 57793 return b$1`<sonic-list subDataProvider="sessions" class="grid gap-3 grid-cols-1"> 57794 <template> 57795 <sonic-event-session-card></sonic-event-session-card> 57796 </template> 57797 </sonic-list>`; 57798 } 57799 } 57800 }; 57801 BuyEventBlock.styles = [ 57802 tailwind, 57803 i$9` 57804 :host { 57805 display: block; 57806 } 57807 ` 57808 ]; 57809 __decorateClass$16([ 57810 n$5({ type: Array }) 57811 ], BuyEventBlock.prototype, "sessions", 2); 57812 __decorateClass$16([ 57813 n$5({ type: Boolean }) 57814 ], BuyEventBlock.prototype, "cleanData", 2); 57815 __decorateClass$16([ 57816 e$2({ context: formTypeContext }), 57817 n$5({ type: String }) 57818 ], BuyEventBlock.prototype, "formType", 2); 57819 __decorateClass$16([ 57820 n$5({ type: String }) 57821 ], BuyEventBlock.prototype, "formSize", 2); 57822 __decorateClass$16([ 57823 n$5({ type: Boolean }) 57824 ], BuyEventBlock.prototype, "displayPast", 2); 57825 __decorateClass$16([ 57826 n$5({ type: String }) 57827 ], BuyEventBlock.prototype, "display", 2); 57828 __decorateClass$16([ 57829 e$2({ context: alignContext }), 57830 n$5({ type: String }) 57831 ], BuyEventBlock.prototype, "align", 2); 57832 BuyEventBlock = __decorateClass$16([ 57833 t$3(tagName$Q), 57834 awaitConnectedAncestors(APP_TAG_SELECTOR) 57835 ], BuyEventBlock); 57836 var __defProp$12 = Object.defineProperty; 57837 var __getOwnPropDesc$15 = Object.getOwnPropertyDescriptor; 57838 var __decorateClass$15 = (decorators, target, key, kind) => { 57839 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$15(target, key) : target; 57840 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 57841 if (decorator = decorators[i2]) 57842 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 57843 if (kind && result) __defProp$12(target, key, result); 57844 return result; 57845 }; 57846 const tagName$P = "sonic-event-page"; 57847 let EventPage = class extends Fetcher$1(Subscriber$1(i$6)) { 57848 constructor() { 57849 super(...arguments); 57850 this.edito = {}; 57851 this.sessions = []; 57852 this.site_link = ""; 57853 this.noRelated = false;
57854 this.noNavigation = false; 57855 this.staticMode = false; 57856 } 57857 handleIsWaiting(value) { 57858 if (!this.staticMode && !this.fetchedData && value === false) { 57859 this.isFetchEnabled = true; 57860 this.key = "data"; 57861 this._fetchData(); 57862 } 57863 } 57864 connectedCallback() { 57865 this.staticMode = !this.hasAttribute("fetch"); 57866 this.isFetchEnabled = false; 57867 if (this.id) { 57868 this.dataProvider = `shows/${this.id}?clean_sessions_data=true&view=essential&next=true`; 57869 } 57870 super.connectedCallback(); 57871 } 57872 render() { 57873 if (this.isWaiting) return A$1; 57874 const isOnError = this.props === null || this.props?.edito === null && this.props?.sessions === null; 57875 if (isOnError) { 57876 return b$1`<sonic-alert size="lg" status="error" label="${t("error_title")}" 57877 >${t("LIB_event_404")}</sonic-alert 57878 >`; 57879 } 57880 if (!this.props) return A$1; 57881 return b$1` 57882 <div class="@container"> 57883 <div class="grid grid-cols-1 @4xl:grid-cols-2 gap-5 @4xl:gap-12"> 57884 <!-- ILLUSTRATION MOBILE --> 57885 <div class="overflow-hidden rounded-lg @4xl:hidden relative "> 57886 ${!this.noNavigation ? b$1`<div class="absolute top-5 left-4 z-10"> 57887 <sonic-button 57888 data-aria-label=${o$4(t("back"))} 57889 goBack=${appRoute("home")} 57890 shape="circle" 57891 noAutoFill 57892 variant="unstyled" 57893 class="text-2xl text-contrast-content drop-shadow-md" 57894 > 57895 <sonic-icon library="custom" name="arrow-left"></sonic-icon> 57896 </sonic-button> 57897 </div>` : A$1} 57898 57899 <sonic-product-illustration 57900 class="illustrationMobile" 57901 noFallback 57902 objectPosition="center top" 57903 ></sonic-product-illustration> 57904 </div> 57905 57906 <!-- MAIN --> 57907 <div> 57908 ${!this.noNavigation ? b$1`<div class="mb-3 relative hidden @4xl:block "> 57909 <sonic-button 57910 data-aria-label=${o$4(t("back"))} 57911 icon 57912 goBack=${appRoute("home")} 57913 shape="circle" 57914 size="sm" 57915 noAutoFill 57916 > 57917 <sonic-icon library="custom" name="arrow-left"></sonic-icon> 57918 </sonic-button> 57919 </div>` : A$1} 57920 57921 <div class="mb-3"> 57922 <sonic-product-title 57923 class="text-3xl md:text-5xl md:leading-[1.1] font-headings font-weight-headings font-style-headings block" 57924 ></sonic-product-title> 57925 </div> 57926 <div class="text-sm lg:text-base grid grid-cols-1 gap-1 mb-7"> 57927 <div class="flex flex-wrap items-center gap-x-3 gap-y-2 mb-3 lg:mb-5"> 57928 <sonic-event-scheduled-status size="inherit" variant="default"></sonic-event-scheduled-status> 57929 <sonic-event-taxonomies size="inherit" class="contents"></sonic-event-taxonomies> 57930 </div> 57931 <sonic-event-location-hall class="w-full @md:w-auto " addressDisplay="text"></sonic-event-location-hall> 57932 <sonic-event-duration class="w-full @md:w-auto "></sonic-event-duration> 57933 </div> 57934 57935 ${this.edito?.body ? b$1`<div class="block mb-8 prose">${o$6(this.edito?.body)}</div> ` : A$1} 57936 ${this.site_link ? b$1` <sonic-event-site-link 57937 class="block text-sm mb-8 ${this.edito?.body ? "-mt-5" : "-mt-1"} " 57938 ></sonic-event-site-link>` : A$1} 57939 57940 <sonic-buy></sonic-buy> 57941 </div> 57942 57943 <!-- ASIDE --> 57944 <div class="hidden @4xl:block"> 57945 <sonic-product-illustration 57946 transition="fade-scale-out" 57947 rounded="lg" 57948 class="sticky top-4 aspect-square" 57949 noFallback 57950 ></sonic-product-illustration> 57951 </div> 57952 </div> 57953 ${!this.noRelated ? b$1` <sonic-related id="${this.id}" class="mt-12 lg:mt-16"></sonic-related> ` : A$1} 57954 </div> 57955 `; 57956 } 57957 }; 57958 EventPage.styles = [tailwind]; 57959 __decorateClass$15([ 57960 n$5({ type: Object }) 57961 ], EventPage.prototype, "edito", 2); 57962 __decorateClass$15([ 57963 n$5({ type: Array }) 57964 ], EventPage.prototype, "sessions", 2); 57965 __decorateClass$15([ 57966 n$5({ type: String }) 57967 ], EventPage.prototype, "site_link", 2); 57968 __decorateClass$15([ 57969 n$5({ type: Boolean }) 57970 ], EventPage.prototype, "noRelated", 2); 57971 __decorateClass$15([ 57972 n$5({ type: Boolean }) 57973 ], EventPage.prototype, "noNavigation", 2); 57974 __decorateClass$15([ 57975 bind$1("sonicTicketApp.isWaiting"), 57976 r$5() 57977 ], EventPage.prototype, "isWaiting", 2); 57978 __decorateClass$15([ 57979 e$2({ context: staticMode }), 57980 n$5({ type: Boolean }) 57981 ], EventPage.prototype, "staticMode", 2); 57982 __decorateClass$15([ 57983 onAssign$1("sonicTicketApp.isWaiting") 57984 ], EventPage.prototype, "handleIsWaiting", 1); 57985 EventPage = __decorateClass$15([ 57986 t$3(tagName$P) 57987 ], EventPage); 57988 var __defProp$11 = Object.defineProperty; 57989 var __getOwnPropDesc$14 = Object.getOwnPropertyDescriptor; 57990 var __decorateClass$14 = (decorators, target, key, kind) => { 57991 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$14(target, key) : target; 57992 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 57993 if (decorator = decorators[i2]) 57994 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 57995 if (kind && result) __defProp$11(target, key, result); 57996 return result; 57997 }; 57998 const tagName$O = "sonic-agenda-section-featured"; 57999 let SectionFeatured = class extends Fetcher$1(Subscriber$1(i$6)) { 58000 constructor() { 58001 super(...arguments); 58002 this.staticMode = false;
58003 this.displayMode = "card_cover"; 58004 } 58005 handleIsWaiting(value) { 58006 if (!this.staticMode && !this.fetchedData && value === false) { 58007 this.isFetchEnabled = true; 58008 this.key = "data"; 58009 this._fetchData(); 58010 } 58011 } 58012 connectedCallback() { 58013 this.staticMode = !this.hasAttribute("fetch"); 58014 this.isFetchEnabled = false; 58015 this.dataProvider = "/shows?featured=1&next=1&limit=3&clean_sessions_data=true&view=essential"; 58016 super.connectedCallback(); 58017 } 58018 render() { 58019 if (this.isWaiting) return A$1; 58020 if (this.props && Object.keys(this.props).length === 0) return A$1; 58021 return b$1` <div class="@container"> 58022 <sonic-list 58023 loader="inline" 58024 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"}" 58025 > 58026 ${this.displayMode === "page" ? b$1` <template> 58027 <sonic-event-page noNavigation noRelated></sonic-event-page> 58028 </template> 58029 <template data-value="separator"> <sonic-divider></sonic-divider></template>` : A$1} 58030 ${this.displayMode === "card_cover" ? b$1`<template data-value="skeleton"> 58031 <sonic-event-card-cover skeleton></sonic-event-card-cover> 58032 <sonic-event-card-cover skeleton></sonic-event-card-cover> 58033 <sonic-event-card-cover skeleton></sonic-event-card-cover> 58034 </template> 58035 <template> 58036 <sonic-event-card-cover></sonic-event-card-cover> 58037 </template>` : A$1} 58038 </sonic-list> 58039 </div>`; 58040 } 58041 }; 58042 SectionFeatured.styles = [ 58043 tailwind, 58044 i$9` 58045 :host { 58046 display: block; 58047 } 58048 ` 58049 ]; 58050 __decorateClass$14([ 58051 e$2({ context: staticMode }), 58052 n$5({ type: Boolean }) 58053 ], SectionFeatured.prototype, "staticMode", 2); 58054 __decorateClass$14([ 58055 bind$1("sonicTicketApp.isWaiting"), 58056 r$5() 58057 ], SectionFeatured.prototype, "isWaiting", 2); 58058 __decorateClass$14([ 58059 bind$1("settings.customer_ui.home.featured"), 58060 r$5() 58061 ], SectionFeatured.prototype, "displayMode", 2); 58062 __decorateClass$14([ 58063 onAssign$1("sonicTicketApp.isWaiting") 58064 ], SectionFeatured.prototype, "handleIsWaiting", 1); 58065 SectionFeatured = __decorateClass$14([ 58066 t$3(tagName$O) 58067 ], SectionFeatured); 58068 var __defProp$10 = Object.defineProperty; 58069 var __getOwnPropDesc$13 = Object.getOwnPropertyDescriptor; 58070 var __decorateClass$13 = (decorators, target, key, kind) => { 58071 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$13(target, key) : target; 58072 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58073 if (decorator = decorators[i2]) 58074 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58075 if (kind && result) __defProp$10(target, key, result); 58076 return result; 58077 }; 58078 const tagName$N = "sonic-quick-access-cards"; 58079 let SonicComponent$a = class SonicComponent extends i$6 { 58080 constructor() { 58081 super(...arguments); 58082 this.customAgendas = []; 58083 this.allowedModules = [ 58084 "agenda", 58085 "subscription", 58086 "carpooling", 58087 "giftcards", 58088 "accreditations_directory", 58089 "shop", 58090 "custom_agendas" 58091 ]; 58092 this.size = "md"; 58093 this.align = "center"; 58094 } 58095 async willUpdate(_changedProperties) { 58096 if (_changedProperties.has("settings")) { 58097 const hasCustomAgendas = this.settings?.modules?.custom_agendas?.access; 58098 this.customAgendas = hasCustomAgendas ? (await getAgendas(this, true)).filter((agenda) => agenda.isLinkEnabled === true) : []; 58099 } 58100 } 58101 render() { 58102 const { agenda, subscription, carpooling, giftcards, accreditations_directory, shop } = this.settings?.modules || {}; 58103 const agendaAccess = agenda?.access && this.allowedModules.includes("agenda"); 58104 const subscriptionAccess = subscription?.access && this.allowedModules.includes("subscription"); 58105 const carpoolingAccess = carpooling?.access && this.allowedModules.includes("carpooling"); 58106 const giftcardsAccess = giftcards?.access && this.allowedModules.includes("giftcards"); 58107 const shopAccess = shop?.access && this.allowedModules.includes("shop"); 58108 const accreditationDirectoryAccess = accreditations_directory?.access && this.allowedModules.includes("accreditations_directory"); 58109 const customAgendasAccess = this.customAgendas && this.customAgendas?.length > 0 && this.allowedModules.includes("custom_agendas"); 58110 if (!(subscriptionAccess || carpoolingAccess || giftcardsAccess || shopAccess || accreditationDirectoryAccess || agendaAccess || customAgendasAccess)) 58111 return A$1; 58112 const justify = this.align === "left" ? "justify-start" : "justify-center"; 58113 return b$1`<div class="flex gap-4 flex-wrap ${justify}"> 58114 ${agendaAccess ? this.renderCard({ 58115 href: appRoute("agenda").toString(), 58116 title: t("module_agenda_title"), 58117 text: o$4(t("module_agenda_summary")), 58118 icon: "calendar-day" 58119 }) : A$1} 58120 ${customAgendasAccess ? c$1( 58121 this.customAgendas || [], 58122 (agenda2) => agenda2.id, 58123 (agenda2) => this.renderCard({ 58124 href: appRoute("customAgenda").fill({ slug: agenda2.slug }).toString(), 58125 title: agenda2.title || "", 58126 text: agenda2.summary || "", 58127 icon: "calendar-star", 58128 type: "info" 58129 }) 58130 ) : A$1} 58131 ${subscriptionAccess ? this.renderCard({ 58132 href: appRoute("subscription").toString(), 58133 title: t("onglet_home_abonnements"), 58134 text: o$4(t("module_subscription_summary")), 58135 icon: "address-card", 58136 type: "warning" 58137 }) : A$1} 58138 ${shopAccess ? this.renderCard({ 58139 href: appRoute("shop").toString(), 58140 title: t("module_shop_title"), 58141 text: o$4(t("module_shop_summary")), 58142 icon: "bags-shopping", 58143 type: "info" 58144 }) : A$1} 58145 ${giftcardsAccess ? this.renderCard({ 58146 href: appRoute("giftcards").toString(), 58147 title: t("module_giftcards_title"), 58148 text: o$4(t("module_giftcards_summary")), 58149 icon: "gift-card", 58150 type: "danger" 58151 }) : A$1} 58152 ${accreditationDirectoryAccess ? this.renderCard({ 58153 href: appRoute("accreditationsDirectory").toString(), 58154 title: t("accreditations_directory_title"), 58155 text: o$4(t("accreditations_directory_summary")), 58156 icon: "address-book", 58157 type: "default" 58158 }) : A$1} 58159 ${carpoolingAccess ? this.renderCard({ 58160 href: appRoute("carpooling").toString(), 58161 title: t("module_carpooling_title"), 58162 text: o$4(t("module_carpooling_summary")), 58163 icon: "car-side", 58164 type: "success" 58165 }) : A$1} 58166 </div>`; 58167 } 58168 renderCard(options) { 58169 const { type = "default", href, title, text, icon: icon2 } = options; 58170 return b$1`<sonic-quick-access-card 58171 class="flex-grow max-w-[19rem] shrink-0" 58172 type=${type} 58173 href=${href} 58174 title=${title} 58175 text=${text} 58176 icon=${icon2} 58177 .size=${this.size} 58178 ></sonic-quick-access-card>`; 58179 } 58180 }; 58181 SonicComponent$a.styles = [ 58182 tailwind, 58183 i$9` 58184 :host { 58185 display: block; 58186 } 58187 ` 58188 ]; 58189 __decorateClass$13([ 58190 bind$1("settings"), 58191 n$5({ type: Object }) 58192 ], SonicComponent$a.prototype, "settings", 2); 58193 __decorateClass$13([ 58194 r$5() 58195 ], SonicComponent$a.prototype, "customAgendas", 2); 58196 __decorateClass$13([ 58197 n$5({ type: Array }) 58198 ], SonicComponent$a.prototype, "allowedModules", 2); 58199 __decorateClass$13([ 58200 n$5({ type: String }) 58201 ], SonicComponent$a.prototype, "size", 2); 58202 __decorateClass$13([ 58203 n$5({ type: String }) 58204 ], SonicComponent$a.prototype, "align", 2); 58205 SonicComponent$a = __decorateClass$13([ 58206 t$3(tagName$N) 58207 ], SonicComponent$a); 58208 var __defProp$$ = Object.defineProperty; 58209 var __getOwnPropDesc$12 = Object.getOwnPropertyDescriptor; 58210 var __decorateClass$12 = (decorators, target, key, kind) => { 58211 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$12(target, key) : target; 58212 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58213 if (decorator = decorators[i2]) 58214 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58215 if (kind && result) __defProp$$(target, key, result); 58216 return result; 58217 }; 58218 const tagName$M = "sonic-agenda-section-next"; 58219 let SonicComponent$9 = class SonicComponent extends Fetcher$1(Subscriber$1(i$6)) { 58220 constructor() { 58221 super(...arguments); 58222 this.wording_link_title_events_all = ""; 58223 this.wording_module_store_title = ""; 58224 this.wording_strate_title_events_next = ""; 58225 this.staticMode = false;
58226 } 58227 handleIsWaiting(value) { 58228 if (!this.staticMode && !this.fetchedData && value === false) { 58229 this.isFetchEnabled = true; 58230 this.key = "data"; 58231 this._fetchData(); 58232 } 58233 } 58234 connectedCallback() { 58235 this.staticMode = !this.hasAttribute("fetch"); 58236 this.isFetchEnabled = false; 58237 this.dataProvider = "/shows?next=1&limit=6&view=essential"; 58238 super.connectedCallback(); 58239 } 58240 render() { 58241 if (this.props && Object.keys(this.props).length === 0) return A$1; 58242 if (this.isWaiting) return A$1; 58243 return b$1`<h2 class="font-headings font-weight-headings font-style-headings mb-4 text-2xl lg:text-3xl "> 58244 <sonic-icon library="custom" prefix="regular" name="forward" class="mr-[.35em]"></sonic-icon> 58245 ${this.wording_strate_title_events_next} 58246 </h2> 58247 <div class="@container"> 58248 <sonic-list .props=${this.props} class="grid grid-cols-1 @3xl:grid-cols-2 @7xl:grid-cols-3 gap-4 "> 58249 <template data-value="skeleton"> 58250 <sonic-event-card skeleton></sonic-event-card> 58251 <sonic-event-card skeleton></sonic-event-card> 58252 <sonic-event-card skeleton class="@7xl:block hidden"></sonic-event-card> 58253 </template> 58254 <template> 58255 <sonic-event-card link></sonic-event-card> 58256 </template> 58257 </sonic-list> 58258 </div> 58259 58260 <div class="flex gap-x-2 gap-y-1 mt-4 flex-wrap"> 58261 <sonic-app-link type="primary" to="agenda" variant="default"> 58262 <sonic-icon slot="prefix" library="custom" prefix="regular" name="calendar-day"></sonic-icon> 58263 ${this.wording_link_title_events_all} 58264 </sonic-app-link> 58265 <sonic-app-link to="store" variant="ghost"> 58266 <sonic-icon slot="prefix" library="custom" prefix="regular" name="cart-shopping-fast"></sonic-icon> 58267 ${this.wording_module_store_title} 58268 </sonic-app-link> 58269 </div>`; 58270 } 58271 }; 58272 SonicComponent$9.styles = [tailwind]; 58273 __decorateClass$12([ 58274 n$5({ type: String }) 58275 ], SonicComponent$9.prototype, "wording_link_title_events_all", 2); 58276 __decorateClass$12([ 58277 n$5({ type: String }) 58278 ], SonicComponent$9.prototype, "wording_module_store_title", 2); 58279 __decorateClass$12([ 58280 n$5({ type: String }) 58281 ], SonicComponent$9.prototype, "wording_strate_title_events_next", 2); 58282 __decorateClass$12([ 58283 bind$1("sonicTicketApp.isWaiting"), 58284 r$5() 58285 ], SonicComponent$9.prototype, "isWaiting", 2); 58286 __decorateClass$12([ 58287 e$2({ context: staticMode }), 58288 n$5({ type: Boolean }) 58289 ], SonicComponent$9.prototype, "staticMode", 2); 58290 __decorateClass$12([ 58291 onAssign$1("sonicTicketApp.isWaiting") 58292 ], SonicComponent$9.prototype, "handleIsWaiting", 1); 58293 SonicComponent$9 = __decorateClass$12([ 58294 t$3(tagName$M) 58295 ], SonicComponent$9); 58296 var __defProp$_ = Object.defineProperty; 58297 var __getOwnPropDesc$11 = Object.getOwnPropertyDescriptor; 58298 var __decorateClass$11 = (decorators, target, key, kind) => { 58299 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$11(target, key) : target; 58300 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58301 if (decorator = decorators[i2]) 58302 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58303 if (kind && result) __defProp$_(target, key, result); 58304 return result; 58305 }; 58306 let EventStore = class extends Subscriber$1(i$6) { 58307 constructor() { 58308 super(...arguments); 58309 this.formType = "buttons"; 58310 this.displayTitle = false; 58311 this.smallTitle = false; 58312 this.displayText = false; 58313 this.cartProvider = "cart/current"; 58314 } 58315 render() { 58316 if (this.isWaiting) return A$1; 58317 const allowedModules = ["subscription", "giftcards", "shop"]; 58318 return b$1` 58319 <sonic-page-layout 58320 pageTitle=${t("module_store_title")} 58321 ?smallTitle=${this.smallTitle} 58322 ?displayTitle=${this.displayTitle} 58323 ?displayText=${this.displayText} 58324 class="@container block" 58325 > 58326 <sonic-quick-access-cards 58327 class="mb-8" 58328 .allowedModules=${allowedModules} 58329 size="sm" 58330 align="left" 58331 ></sonic-quick-access-cards> 58332 <sonic-event-store-content displayCart cartProvider="${this.cartProvider}"></sonic-event-store-content> 58333 </sonic-page-layout> 58334 `; 58335 } 58336 }; 58337 EventStore.styles = [tailwind]; 58338 __decorateClass$11([ 58339 n$5({ type: String }) 58340 ], EventStore.prototype, "formType", 2); 58341 __decorateClass$11([ 58342 n$5({ type: Boolean }) 58343 ], EventStore.prototype, "displayTitle", 2); 58344 __decorateClass$11([ 58345 n$5({ type: Boolean }) 58346 ], EventStore.prototype, "smallTitle", 2); 58347 __decorateClass$11([ 58348 n$5({ type: Boolean }) 58349 ], EventStore.prototype, "displayText", 2); 58350 __decorateClass$11([ 58351 n$5({ type: Array }) 58352 ], EventStore.prototype, "activity", 2); 58353 __decorateClass$11([ 58354 n$5({ type: Array }) 58355 ], EventStore.prototype, "category", 2); 58356 __decorateClass$11([ 58357 n$5({ type: Number }) 58358 ], EventStore.prototype, "agendaId", 2); 58359 __decorateClass$11([ 58360 n$5({ type: String }) 58361 ], EventStore.prototype, "cartProvider", 2); 58362 __decorateClass$11([ 58363 bind$1("sonicTicketApp.isWaiting"), 58364 r$5() 58365 ], EventStore.prototype, "isWaiting", 2); 58366 EventStore = __decorateClass$11([ 58367 t$3("sonic-event-store") 58368 ], EventStore); 58369 var __defProp$Z = Object.defineProperty; 58370 var __getOwnPropDesc$10 = Object.getOwnPropertyDescriptor; 58371 var __decorateClass$10 = (decorators, target, key, kind) => { 58372 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$10(target, key) : target; 58373 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58374 if (decorator = decorators[i2]) 58375 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58376 if (kind && result) __defProp$Z(target, key, result); 58377 return result; 58378 }; 58379 const tagName$L = "sonic-shop-section-featured"; 58380 let SonicComponent$8 = class SonicComponent extends Fetcher$1(Subscriber$1(i$6)) { 58381 constructor() { 58382 super(...arguments); 58383 this.staticMode = false;
58384 } 58385 handleIsWaiting(value) { 58386 if (!this.staticMode && !this.fetchedData && value === false) { 58387 this.isFetchEnabled = true; 58388 this.key = "data"; 58389 this._fetchData(); 58390 } 58391 } 58392 connectedCallback() { 58393 this.staticMode = !this.hasAttribute("fetch"); 58394 this.isFetchEnabled = false; 58395 this.dataProvider = entityEndPoint({ 58396 entityType: EntityType.Merch, 58397 features: [Feature.Prices, Feature.Picture], 58398 limit: 3, 58399 featured: true 58400 }); 58401 super.connectedCallback(); 58402 } 58403 render() { 58404 if (this.props && Object.keys(this.props).length === 0) return A$1; 58405 if (this.isWaiting) return A$1; 58406 return b$1` <h2 class="font-headings font-weight-headings font-style-headings mb-4 text-2xl lg:text-3xl "> 58407 <sonic-icon library="custom" prefix="regular" name="bags-shopping" class="mr-[.35em]"></sonic-icon> 58408 ${t("module_shop_title")} 58409 </h2> 58410 <div class="@container"> 58411 <sonic-list 58412 .props=${this.props} 58413 class="grid grid-cols-1 @3xl:grid-cols-2 @7xl:grid-cols-3 gap-4 " 58414 .skeleton=${() => b$1`<sonic-event-card skeleton></sonic-event-card>`} 58415 .items=${() => b$1`<sonic-event-card link> </sonic-event-card>`} 58416 > 58417 </sonic-list> 58418 </div> 58419 58420 <div class="flex gap-x-2 gap-y-1 mt-4 flex-wrap"> 58421 <sonic-app-link type="primary" to="shop" variant="default"> 58422 <sonic-icon slot="prefix" library="custom" prefix="regular" name="arrow-right"></sonic-icon> 58423 ${t("link_title_shop_all")} 58424 </sonic-app-link> 58425 </div>`; 58426 } 58427 }; 58428 SonicComponent$8.styles = [tailwind]; 58429 __decorateClass$10([ 58430 bind$1("sonicTicketApp.isWaiting"), 58431 r$5() 58432 ], SonicComponent$8.prototype, "isWaiting", 2); 58433 __decorateClass$10([ 58434 e$2({ context: staticMode }), 58435 n$5({ type: Boolean }) 58436 ], SonicComponent$8.prototype, "staticMode", 2); 58437 __decorateClass$10([ 58438 onAssign$1("sonicTicketApp.isWaiting") 58439 ], SonicComponent$8.prototype, "handleIsWaiting", 1); 58440 SonicComponent$8 = __decorateClass$10([ 58441 t$3(tagName$L) 58442 ], SonicComponent$8); 58443 var __defProp$Y = Object.defineProperty; 58444 var __getOwnPropDesc$$ = Object.getOwnPropertyDescriptor; 58445 var __decorateClass$$ = (decorators, target, key, kind) => { 58446 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$$(target, key) : target; 58447 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58448 if (decorator = decorators[i2]) 58449 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58450 if (kind && result) __defProp$Y(target, key, result); 58451 return result; 58452 }; 58453 let SonicHome = class extends i$6 { 58454 render() { 58455 if (!this.settings) { 58456 return A$1; 58457 } 58458 if (this.settings?.is_online === false) { 58459 return b$1` <sonic-store-status size="2xl"></sonic-store-status> `; 58460 } 58461 const { jumbotron, featured, quick_access, events } = this.settings.customer_ui?.home || {}; 58462 return b$1` 58463 ${jumbotron ? b$1` <sonic-jumbotron home></sonic-jumbotron> ` : A$1} 58464 ${featured ? b$1` <sonic-agenda-section-featured fetch></sonic-agenda-section-featured> ` : A$1} 58465 ${quick_access ? b$1` <sonic-quick-access-cards></sonic-quick-access-cards> ` : A$1} 58466 ${events === "next" ? b$1` <sonic-agenda-section-next fetch></sonic-agenda-section-next> ` : A$1} 58467 ${this.renderProducts()} 58468 ${events === "store" ? b$1` <sonic-event-store displayText displayTitle></sonic-event-store> ` : A$1} 58469 `; 58470 } 58471 renderProducts() { 58472 const { shop, giftcards } = this.settings?.customer_ui?.home || {}; 58473 if (!shop && !giftcards) { 58474 return A$1; 58475 } 58476 return b$1` 58477 <div class="section-products"> 58478 ${shop ? b$1`<sonic-shop-section-featured fetch></sonic-shop-section-featured>` : A$1} 58479 ${giftcards ? b$1`<sonic-giftcards></sonic-giftcards> ` : A$1} 58480 </div> 58481 `; 58482 } 58483 }; 58484 SonicHome.styles = [ 58485 tailwind, 58486 i$9` 58487 :host { 58488 display: block; 58489 --_cgx: var(--sc-container-gutter-x); 58490 --_section-margin: var(--sc-section-margin); 58491 } 58492 sonic-quick-access-cards { 58493 margin: var(--_section-margin) clamp(1rem, 7vw, 3rem); 58494 display: block; 58495 } 58496 58497 sonic-jumbotron, 58498 sonic-event-store, 58499 sonic-agenda-section-next, 58500 sonic-agenda-section-featured, 58501 sonic-shop-section-featured { 58502 display: block; 58503 margin-top: var(--_section-margin); 58504 } 58505 58506 .section-products { 58507 margin-top: var(--_section-margin); 58508 margin-left: calc(var(--_cgx) * -1); 58509 margin-right: calc(var(--_cgx) * -1); 58510 background: var(--sc-base-50); 58511 padding: 4rem var(--_cgx) calc(4rem + var(--_section-margin)); 58512 border-radius: var(--sc-rounded-lg, 2.5rem) var(--sc-rounded-lg, 2.5rem) 0 0; 58513 } 58514 58515 .section-products > * + * { 58516 margin-top: var(--_section-margin); 58517 } 58518 58519 .section-shop + .section-giftcards { 58520 margin-top: calc(var(--_section-margin) * -1 -2px); 58521 border-radius: 0 0; 58522 padding-top: 5px !important; 58523 } 58524 ` 58525 ]; 58526 __decorateClass$$([ 58527 bind$1("settings"), 58528 n$5({ type: Object }) 58529 ], SonicHome.prototype, "settings", 2); 58530 SonicHome = __decorateClass$$([ 58531 t$3("sonic-home"), 58532 awaitConnectedAncestors(APP_TAG_SELECTOR) 58533 ], SonicHome); 58534 var __decorate$4 = function(decorators, target, key, desc) { 58535 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 58536 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 58537 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; 58538 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 58539 }; 58540 const tagName$K = "sonic-router"; 58541 let SonicRouter = class SonicRouter extends TemplatesContainer$1(i$6) { 58542 constructor() { 58543 super(...arguments); 58544 this.templateValueAttribute = "data-route"; 58545 this._location = document.location.href.replace(document.location.origin, ""); 58546 } 58547 createRenderRoot() { 58548 return this; 58549 } 58550 connectedCallback() { 58551 LocationHandler$1.onChange(this); 58552 super.connectedCallback(); 58553 } 58554 disconnectedCallback() { 58555 LocationHandler$1.offChange(this); 58556 super.disconnectedCallback(); 58557 } 58558 set location(value) { 58559 this._location = value; 58560 this.requestUpdate(); 58561 } 58562 get location() { 58563 return this._location; 58564 } 58565 get cleanLocation() { 58566 const url = new URL(this.location, document.location.origin); 58567 return url.pathname + url.hash; 58568 } 58569 get patternBasePath() { 58570 if (this.basePath !== void 0) { 58571 return this.basePath; 58572 } 58573 return "(/)*"; 58574 } 58575 get regExpBasePath() { 58576 if (this.basePath !== void 0) { 58577 return "^" + this.basePath; 58578 } 58579 return ""; 58580 } 58581 handleroutes() { 58582 if (!this.routes) 58583 return []; 58584 const templates = []; 58585 for (let [path, renderFn] of Object.entries(this.routes)) { 58586 if (path === "fallback" || !renderFn) 58587 continue; 58588 const regexp = new RegExp(this.regExpBasePath + path); 58589 if (regexp.test(this.cleanLocation)) { 58590 const params = regexp.exec(this.cleanLocation) || [path]; 58591 params.shift(); 58592 templates.push(renderFn([...params])); 58593 } else { 58594 try { 58595 const pattern = new UrlPattern(this.patternBasePath + path); 58596 const match = pattern.match(this.cleanLocation); 58597 if (match) { 58598 const params = match || {}; 58599 templates.push(renderFn(params)); 58600 } 58601 } catch (e2) { 58602 if (this.cleanLocation.indexOf((this.basePath || "") + path.replace(document.location.origin, "")) != -1) { 58603 templates.push(renderFn({})); 58604 } 58605 } 58606 } 58607 } 58608 if (templates.length == 0) { 58609 if (this.routes?.fallback && this.isConnected) { 58610 templates.push(this.routes.fallback()); 58611 } 58612 } 58613 return templates; 58614 } 58615 render() { 58616 const programmaticTemplates = this.handleroutes(); 58617 if (programmaticTemplates.length > 0) { 58618 return b$1`${programmaticTemplates}`; 58619 } 58620 const templates = []; 58621 for (const t2 of this.templatePartsList) { 58622 const path = t2.getAttribute(this.templateValueAttribute) || ""; 58623 const regexp = new RegExp(this.regExpBasePath + path); 58624 if (regexp.test(this.cleanLocation)) { 58625 templates.push(t2); 58626 } else { 58627 try { 58628 if (new UrlPattern(this.patternBasePath + path + "(/*)").match(this.cleanLocation)) { 58629 t2.setAttribute("mode", "patternMatching"); 58630 templates.push(t2); 58631 } 58632 } catch (e2) { 58633 if (this.cleanLocation.indexOf((this.basePath || "") + path.replace(document.location.origin, "")) != -1) { 58634 templates.push(t2); 58635 } 58636 } 58637 } 58638 } 58639 if (templates.length == 0) { 58640 if (this.fallBackRoute && this.isConnected) { 58641 document.location.href = this.fallBackRoute; 58642 } 58643 const fallback = this.templateList.find((t2) => t2.hasAttribute("data-fallback")); 58644 if (fallback) { 58645 templates.push(fallback); 58646 } 58647 } 58648 return b$1`${c$1(templates, (template, index) => { 58649 return index + (/* @__PURE__ */ new Date()).getTime(); 58650 }, (template) => { 58651 if (template.title) 58652 document.title = template.title; 58653 if (template.hasAttribute("dataProviderExpression")) { 58654 let dataProvider = ""; 58655 const dataProviderExpression = template.getAttribute("dataProviderExpression") || ""; 58656 if (template.getAttribute("mode") == "patternMatching") { 58657 const matcher = new UrlPattern("(/)*" + (template.getAttribute(this.templateValueAttribute) || "") + "*"); 58658 const filler = new UrlPattern(dataProviderExpression); 58659 dataProvider = filler.stringify(matcher.match(this.cleanLocation)); 58660 } else { 58661 const regexp = new RegExp(template.getAttribute(this.templateValueAttribute) || ""); 58662 const match = (this.cleanLocation + "").match(regexp); 58663 if (match) { 58664 dataProvider = match.shift()?.replace(regexp, dataProviderExpression) || ""; 58665 } 58666 } 58667 return b$1`<div 58668 style="display:contents" 58669 dataProvider="${dataProvider}" 58670 > 58671 ${o$2(template)} 58672 </div>`; 58673 } 58674 return o$2(template); 58675 })}`; 58676 } 58677 }; 58678 __decorate$4([ 58679 n$5({ type: String }) 58680 ], SonicRouter.prototype, "fallBackRoute", void 0); 58681 __decorate$4([ 58682 n$5({ type: Object, attribute: false }) 58683 ], SonicRouter.prototype, "routes", void 0); 58684 __decorate$4([ 58685 n$5({ type: String }) 58686 ], SonicRouter.prototype, "basePath", void 0); 58687 __decorate$4([ 58688 n$5() 58689 ], SonicRouter.prototype, "location", null); 58690 SonicRouter = __decorate$4([ 58691 t$3(tagName$K) 58692 ], SonicRouter); 58693 var __defProp$X = Object.defineProperty; 58694 var __getOwnPropDesc$_ = Object.getOwnPropertyDescriptor; 58695 var __decorateClass$_ = (decorators, target, key, kind) => { 58696 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$_(target, key) : target; 58697 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58698 if (decorator = decorators[i2]) 58699 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58700 if (kind && result) __defProp$X(target, key, result); 58701 return result; 58702 }; 58703 const tagName$J = "sonic-giftcard-code"; 58704 let SonicComponent$7 = class SonicComponent extends Subscriber$1(i$6) { 58705 constructor() { 58706 super(...arguments); 58707 this.code = null; 58708 this.type = "success"; 58709 } 58710 copyCode(code) { 58711 if (!code) return; 58712 navigator.clipboard?.writeText(code).then(function() { 58713 const toast = { 58714 text: ( 58715 /*html*/ 58716 `<span class="tracking-wide font-bold">${code}</span> a été copié` 58717 ), 58718 status: "success" 58719 }; 58720 SonicToast.add(toast); 58721 }); 58722 if (!navigator.clipboard) { 58723 const toast = { 58724 text: ( 58725 /*html*/ 58726 `Votre navigateur ne supporte pas la copie automatique, veuillez copier manuellement le code : <span class="tracking-wide font-bold">${code}</span>` 58727 ), 58728 status: "error" 58729 }; 58730 SonicToast.add(toast); 58731 } 58732 } 58733 render() { 58734 return b$1`${this.code ? b$1` 58735 <sonic-tooltip label="${t("copy")}"> 58736 <sonic-badge 58737 tabindex="0" 58738 class="cursor-pointer" 58739 @click="${() => this.copyCode(this.code)}" 58740 type="${o$4(this.type)}" 58741 size="${o$4(this.size)}" 58742 class="font-monospace tracking-widest" 58743 >${this.code}</sonic-badge 58744 > 58745 </sonic-tooltip> 58746 ` : A$1}`; 58747 } 58748 }; 58749 SonicComponent$7.styles = [tailwind]; 58750 __decorateClass$_([ 58751 n$5({ type: String }) 58752 ], SonicComponent$7.prototype, "code", 2); 58753 __decorateClass$_([ 58754 n$5({ type: Boolean }) 58755 ], SonicComponent$7.prototype, "copy", 2); 58756 __decorateClass$_([ 58757 n$5({ type: String }) 58758 ], SonicComponent$7.prototype, "size", 2); 58759 __decorateClass$_([ 58760 n$5({ type: String }) 58761 ], SonicComponent$7.prototype, "type", 2); 58762 SonicComponent$7 = __decorateClass$_([ 58763 t$3(tagName$J) 58764 ], SonicComponent$7); 58765 var __defProp$W = Object.defineProperty; 58766 var __getOwnPropDesc$Z = Object.getOwnPropertyDescriptor; 58767 var __decorateClass$Z = (decorators, target, key, kind) => { 58768 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$Z(target, key) : target; 58769 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58770 if (decorator = decorators[i2]) 58771 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58772 if (kind && result) __defProp$W(target, key, result); 58773 return result; 58774 }; 58775 let SonicPurchaseStatus = class extends Subscriber(i$6) { 58776 constructor() { 58777 super(...arguments); 58778 this.status = ""; 58779 this.size = "md"; 58780 this.displayDetail = false;
58781 this.checked = null; 58782 this.checked_at = null; 58783 this.flexDirection = "column"; 58784 this.align = "center"; 58785 this.badgeType = "default"; 58786 this.statusIcon = ""; 58787 this.shouldRender = false; 58788 this.hiddenIfValid = false; 58789 this.checkedLabel = ""; 58790 this.checkedIcon = ""; 58791 this.refund = {}; 58792 this.disabled_at = null; 58793 } 58794 willUpdate(_changedProperties) { 58795 if (_changedProperties.has("status") || _changedProperties.has("checked") || _changedProperties.has("checked_at") || _changedProperties.has("hiddenIfValid") || _changedProperties.has("checkedLabel") || _changedProperties.has("checkedIcon")) { 58796 this.shouldRender = !!this.checked || !!this.checked_at || !!this.status; 58797 if (!this.checked && !this.checked_at) { 58798 switch (this.status) { 58799 case PurchaseStatus.Valid: 58800 case "valide": 58801 this.badgeType = "default"; 58802 this.statusIcon = "check"; 58803 this.label = t("status_valid"); 58804 if (this.hiddenIfValid) { 58805 this.shouldRender = false;
58806 } else { 58807 this.shouldRender = true; 58808 } 58809 break; 58810 case PurchaseStatus.Deleted: 58811 case "supprime": 58812 this.badgeType = "danger"; 58813 this.statusIcon = "xmark"; 58814 this.label = t("status_deleted"); 58815 break; 58816 case "annule": 58817 this.badgeType = "danger"; 58818 this.statusIcon = "xmark"; 58819 this.label = t("status_canceled"); 58820 break; 58821 case PurchaseStatus.Refunded: 58822 case "rembourse": 58823 this.badgeType = "success"; 58824 this.statusIcon = "arrow-rotate-left"; 58825 this.label = t("status_refunded"); 58826 break; 58827 case PurchaseStatus.RefundRequested: 58828 case "demande_remb": 58829 this.badgeType = "warning"; 58830 this.statusIcon = "comment-exclamation"; 58831 this.label = t("status_refund_requested"); 58832 break; 58833 case PurchaseStatus.Exchanged: 58834 case "echange": 58835 this.badgeType = "warning"; 58836 this.statusIcon = "arrows-left-right"; 58837 this.label = t("status_exchanged"); 58838 break; 58839 case PurchaseStatus.Disabled: 58840 case "disabled": 58841 this.badgeType = "danger"; 58842 this.statusIcon = "xmark"; 58843 this.label = t("status_disabled"); 58844 break; 58845 case PurchaseStatus.Expired: 58846 this.badgeType = "danger"; 58847 this.statusIcon = "xmark"; 58848 this.label = t("status_expired"); 58849 break; 58850 case "remboursement_partiel": 58851 case PurchaseStatus.RefundedPartially: 58852 this.badgeType = "warning"; 58853 this.statusIcon = "scale-unbalanced-flip"; 58854 this.label = t("status_refunded_partially"); 58855 break; 58856 case PurchaseStatus.AutoRefundPending: 58857 case "remb_auto_attente": 58858 this.badgeType = "info"; 58859 this.statusIcon = "hourglass-start"; 58860 this.label = t("status_auto_refund_pending"); 58861 break; 58862 } 58863 } else { 58864 this.badgeType = "success"; 58865 this.statusIcon = this.checkedIcon || "barcode-scan"; 58866 this.label = this.checkedLabel ? t(this.checkedLabel) : t("status_checked"); 58867 } 58868 } 58869 super.willUpdate(_changedProperties); 58870 } 58871 render() { 58872 if (!this.shouldRender) return A$1; 58873 let dateDetail; 58874 switch (this.status) { 58875 case "supprime": 58876 case "annule": 58877 dateDetail = this.disabled_at; 58878 break; 58879 case "rembourse": 58880 dateDetail = this.refund.date; 58881 break; 58882 case "demande_remb": 58883 dateDetail = this.refund.askDate; 58884 break; 58885 } 58886 if (this.checked || this.checked_at) { 58887 dateDetail = this.checked; 58888 } 58889 const flexDirectionClass = this.flexDirection === "row" ? "flex-row gap-x-2 flex-wrap" : "flex-col gap-y-[.15em]"; 58890 const alignClass = this.align === "start" ? "items-start" : "items-center"; 58891 const badgeAlignClass = this.align === "start" ? "justify-start" : "justify-center"; 58892 const badgeAlign = this.align === "start" ? "start" : "center"; 58893 const hasDate = dateDetail && this.displayDetail; 58894 return b$1` 58895 <div class="flex ${flexDirectionClass} ${alignClass}"> 58896 <sonic-badge 58897 type=${this.badgeType} 58898 size=${this.size} 58899 noAutoFill 58900 class="${hasDate ? "min-w-[14.5ch]" : ""} ${badgeAlignClass}" 58901 align=${badgeAlign} 58902 > 58903 ${this.statusIcon ? b$1`<sonic-icon name=${this.statusIcon} alignItem="center" library="custom"></sonic-icon>` : A$1} 58904 <span class="font-medium"> ${this.label} </span> 58905 </sonic-badge> 58906 ${dateDetail && this.displayDetail ? b$1`<div> 58907 <sonic-badge variant="ghost" size=${this.size} noAutoFill> 58908 <sonic-date date="${dateDetail}" day="2-digit" month="2-digit" weekday="hidden"></sonic-date> 58909 </sonic-badge> 58910 </div>` : A$1} 58911 </div> 58912 `; 58913 } 58914 }; 58915 SonicPurchaseStatus.styles = [tailwind]; 58916 __decorateClass$Z([ 58917 n$5({ type: String }) 58918 ], SonicPurchaseStatus.prototype, "status", 2); 58919 __decorateClass$Z([ 58920 n$5({ type: String }) 58921 ], SonicPurchaseStatus.prototype, "size", 2); 58922 __decorateClass$Z([ 58923 n$5({ type: Boolean }) 58924 ], SonicPurchaseStatus.prototype, "displayDetail", 2); 58925 __decorateClass$Z([ 58926 n$5({ type: Number }) 58927 ], SonicPurchaseStatus.prototype, "checked", 2); 58928 __decorateClass$Z([ 58929 n$5({ type: Number }) 58930 ], SonicPurchaseStatus.prototype, "checked_at", 2); 58931 __decorateClass$Z([ 58932 n$5({ type: String }) 58933 ], SonicPurchaseStatus.prototype, "flexDirection", 2); 58934 __decorateClass$Z([ 58935 n$5({ type: String }) 58936 ], SonicPurchaseStatus.prototype, "align", 2); 58937 __decorateClass$Z([ 58938 r$5() 58939 ], SonicPurchaseStatus.prototype, "badgeType", 2); 58940 __decorateClass$Z([ 58941 r$5() 58942 ], SonicPurchaseStatus.prototype, "statusIcon", 2); 58943 __decorateClass$Z([ 58944 r$5() 58945 ], SonicPurchaseStatus.prototype, "label", 2); 58946 __decorateClass$Z([ 58947 r$5() 58948 ], SonicPurchaseStatus.prototype, "shouldRender", 2); 58949 __decorateClass$Z([ 58950 n$5({ type: Boolean }) 58951 ], SonicPurchaseStatus.prototype, "hiddenIfValid", 2); 58952 __decorateClass$Z([ 58953 n$5({ type: String }) 58954 ], SonicPurchaseStatus.prototype, "checkedLabel", 2); 58955 __decorateClass$Z([ 58956 n$5({ type: String }) 58957 ], SonicPurchaseStatus.prototype, "checkedIcon", 2); 58958 __decorateClass$Z([ 58959 n$5({ type: Object }) 58960 ], SonicPurchaseStatus.prototype, "refund", 2); 58961 __decorateClass$Z([ 58962 n$5({ type: Number }) 58963 ], SonicPurchaseStatus.prototype, "disabled_at", 2); 58964 SonicPurchaseStatus = __decorateClass$Z([ 58965 t$3("sonic-purchase-status") 58966 ], SonicPurchaseStatus); 58967 var __defProp$V = Object.defineProperty; 58968 var __getOwnPropDesc$Y = Object.getOwnPropertyDescriptor; 58969 var __decorateClass$Y = (decorators, target, key, kind) => { 58970 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$Y(target, key) : target; 58971 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 58972 if (decorator = decorators[i2]) 58973 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 58974 if (kind && result) __defProp$V(target, key, result); 58975 return result; 58976 }; 58977 const tagName$I = "sonic-purchase-summary-main-info"; 58978 let PurchaseSummaryMainInfo = class extends Subscriber$1(i$6) { 58979 constructor() { 58980 super(...arguments); 58981 this.subscribe = {}; 58982 this.giftcard = {}; 58983 this.entity = {}; 58984 this.owner = {}; 58985 this.session_status = null; 58986 } 58987 render() { 58988 switch (this.props?.entity_type) { 58989 case "event": 58990 return b$1` ${this.render_event()} `; 58991 default: 58992 return b$1` ${this.render_default()} `; 58993 } 58994 } 58995 render_event() { 58996 if (!this.entity) return A$1; 58997 return b$1` 58998 <sonic-date subDataProvider="entity" month="2-digit" class="text-xs mb-1 pt-1 block"></sonic-date> 58999 <sonic-product-title subDataProvider="entity.edito"></sonic-product-title> 59000 59001 ${this.session_status === "canceled" ? b$1`<sonic-badge type="danger" class="mt-1" size="xs">${t("LIB_event_status_canceled")}</sonic-badge>` : A$1} 59002 ${this.session_status === "deferred" ? b$1`<sonic-badge type="warning" class="mt-1" size="xs">${t("LIB_event_status_deferred")}</sonic-badge>` : A$1} 59003 59004 <sonic-event-location-hall
59005 subDataProvider="entity" 59006 isEvent="true" 59007 class="block mt-2 text-xs" 59008 noPlacement 59009 addressDisplay="hoverLink" 59010 ></sonic-event-location-hall> 59011 `; 59012 } 59013 render_default() { 59014 return b$1` 59015 <div class="font-bold mb-1 pt-1"><sonic-product-title subDataProvider="entity.edito"></sonic-product-title></div> 59016 <div class="text-xs"> 59017 ${this.subscribe?.name ? b$1`<div class="font-bold">${this.subscribe?.name}</div>` : A$1} 59018 ${this.subscribe?.email ? b$1`<div>${this.subscribe?.email}</div>` : A$1} 59019 59020 <div class="flex gap-x-1 gap-y-1 flex-wrap items-center mt-1"> 59021 ${this.subscribe?.number ? b$1` <sonic-badge type="info" size="xs">${"N°" + this.subscribe.number}</sonic-badge> ` : A$1} 59022 ${this.giftcard?.code ? b$1` <sonic-giftcard-code copy code="${this.giftcard.code}" size="xs"></sonic-giftcard-code>` : A$1} 59023 ${this.giftcard?.remaining_amount && this.giftcard?.remaining_amount !== null ? b$1`<sonic-badge type="info" size="xs" 59024 >${t("giftcard_remaining_amount")} : ${formatAmount(this.giftcard?.remaining_amount || 0)}</sonic-badge 59025 >` : A$1} 59026 <sonic-purchase-expiration-date size="xs" class="block"></sonic-purchase-expiration-date> 59027 </div> 59028 </div> 59029 `; 59030 } 59031 }; 59032 PurchaseSummaryMainInfo.styles = [tailwind]; 59033 __decorateClass$Y([ 59034 n$5({ type: Object }) 59035 ], PurchaseSummaryMainInfo.prototype, "subscribe", 2); 59036 __decorateClass$Y([ 59037 n$5({ type: Object }) 59038 ], PurchaseSummaryMainInfo.prototype, "giftcard", 2); 59039 __decorateClass$Y([ 59040 n$5({ type: Object }) 59041 ], PurchaseSummaryMainInfo.prototype, "entity", 2); 59042 __decorateClass$Y([ 59043 n$5({ type: Object }) 59044 ], PurchaseSummaryMainInfo.prototype, "owner", 2); 59045 __decorateClass$Y([ 59046 n$5({ type: String }) 59047 ], PurchaseSummaryMainInfo.prototype, "session_status", 2); 59048 PurchaseSummaryMainInfo = __decorateClass$Y([ 59049 t$3(tagName$I) 59050 ], PurchaseSummaryMainInfo); 59051 var __defProp$U = Object.defineProperty; 59052 var __getOwnPropDesc$X = Object.getOwnPropertyDescriptor; 59053 var __decorateClass$X = (decorators, target, key, kind) => { 59054 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$X(target, key) : target; 59055 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 59056 if (decorator = decorators[i2]) 59057 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 59058 if (kind && result) __defProp$U(target, key, result); 59059 return result; 59060 }; 59061 function isValidStatus(status) { 59062 return status === "valide"; 59063 } 59064 let SonicTransactionPurchaseStatus = class extends Subscriber$1(i$6) { 59065 constructor() { 59066 super(...arguments); 59067 this.size = "xs"; 59068 this.hideValid = false; 59069 } 59070 render() { 59071 const purchase = this.props; 59072 if (!purchase?.entity_type) { 59073 return A$1; 59074 } 59075 switch (purchase.entity_type) { 59076 case EntityType.Event: 59077 return this.renderEventStatus(purchase); 59078 case EntityType.Subscribe: 59079 return this.renderSubscribeStatus(purchase); 59080 case EntityType.Giftcard: 59081 return this.renderGiftcardStatus(purchase); 59082 case EntityType.Merch: 59083 case EntityType.AdditionalProduct: 59084 return this.renderCatalogProductStatus(purchase); 59085 default: 59086 return A$1; 59087 } 59088 } 59089 /** Billets d'événement : statut billet + contrôle. */ 59090 renderEventStatus(purchase) { 59091 return b$1` 59092 <sonic-purchase-status 59093 size=${this.size} 59094 align="start" 59095 flexDirection="column" 59096 displayDetail 59097 ?hiddenIfValid=${this.hideValid} 59098 .status=${purchase.status ?? ""} 59099 .refund=${purchase.refund ?? {}} 59100 .disabled_at=${purchase.disabled_at ?? null} 59101 .checked=${purchase.checked ?? 0} 59102 ></sonic-purchase-status> 59103 `; 59104 } 59105 /** Abonnements : état de validité (pas « billet valide »). */ 59106 renderSubscribeStatus(purchase) { 59107 return b$1` 59108 <sonic-purchase-status 59109 size=${this.size} 59110 align="start" 59111 flexDirection="column" 59112 displayDetail 59113 ?hiddenIfValid=${this.hideValid} 59114 .status=${purchase.status ?? ""} 59115 .refund=${purchase.refund ?? {}} 59116 .disabled_at=${purchase.disabled_at ?? null} 59117 .checked=${0} 59118 ></sonic-purchase-status> 59119 `; 59120 } 59121 /** 59122 * Cartes cadeaux : états métier (expirée, épuisée) ou statut compta si anormal. 59123 * Pas de « billet valide » pour une carte active. 59124 */ 59125 renderGiftcardStatus(purchase) { 59126 if (!isValidStatus(purchase.status)) { 59127 return this.renderRefundStatus(purchase, false); 59128 } 59129 const now = Math.floor(Date.now() / 1e3); 59130 if (purchase.expiration_date && purchase.expiration_date < now) { 59131 return b$1` 59132 <sonic-badge type="danger" size=${this.size} align="start"> 59133 <sonic-icon name="xmark" library="custom"></sonic-icon>
59134 <span class="font-medium">${t("status_expired")}</span> 59135 </sonic-badge> 59136 `; 59137 } 59138 const remaining = purchase.giftcard?.remaining_amount; 59139 if (remaining != null && remaining <= 0) { 59140 return b$1` 59141 <sonic-badge type="warning" size=${this.size} align="start"> 59142 <sonic-icon name="ban" library="custom"></sonic-icon> 59143 <span class="font-medium">${t("This_gift_card_is_empty")}</span> 59144 </sonic-badge> 59145 `; 59146 } 59147 return A$1; 59148 } 59149 /** 59150 * Articles boutique / produits additionnels : masquer le « valide » neutre, 59151 * afficher uniquement les anomalies (remboursement, suppressionâ¦). 59152 */ 59153 renderCatalogProductStatus(purchase) { 59154 if (isValidStatus(purchase.status)) { 59155 if (!purchase.checked) { 59156 return A$1; 59157 } 59158 return b$1` 59159 <sonic-purchase-status 59160 size=${this.size} 59161 align="start" 59162 flexDirection="column" 59163 displayDetail 59164 checkedLabel="request_status_processed" 59165 checkedIcon="check" 59166 .checked=${purchase.checked} 59167 .status=${""} 59168 ></sonic-purchase-status> 59169 `; 59170 } 59171 return this.renderRefundStatus(purchase, false); 59172 } 59173 renderRefundStatus(purchase, displayDetail) { 59174 return b$1` 59175 <sonic-purchase-status 59176 size=${this.size} 59177 align="start" 59178 flexDirection="column" 59179 ?displayDetail=${displayDetail} 59180 hiddenIfValid 59181 .status=${purchase.status ?? ""} 59182 .refund=${purchase.refund ?? {}} 59183 .disabled_at=${purchase.disabled_at ?? null} 59184 .checked=${0} 59185 ></sonic-purchase-status> 59186 `; 59187 } 59188 }; 59189 SonicTransactionPurchaseStatus.styles = [tailwind]; 59190 __decorateClass$X([ 59191 n$5({ type: String }) 59192 ], SonicTransactionPurchaseStatus.prototype, "size", 2); 59193 __decorateClass$X([ 59194 n$5({ type: Boolean }) 59195 ], SonicTransactionPurchaseStatus.prototype, "hideValid", 2); 59196 SonicTransactionPurchaseStatus = __decorateClass$X([ 59197 t$3("sonic-transaction-purchase-status") 59198 ], SonicTransactionPurchaseStatus); 59199 var __defProp$T = Object.defineProperty; 59200 var __getOwnPropDesc$W = Object.getOwnPropertyDescriptor; 59201 var __decorateClass$W = (decorators, target, key, kind) => { 59202 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$W(target, key) : target; 59203 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 59204 if (decorator = decorators[i2]) 59205 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 59206 if (kind && result) __defProp$T(target, key, result); 59207 return result; 59208 }; 59209 const tagName$H = "sonic-purchase-summary-complementary-info"; 59210 let PurchaseSummaryComplementaryInfo = class extends Subscriber$1(i$6) { 59211 constructor() { 59212 super(...arguments); 59213 this.created = 0; 59214 this.price = {}; 59215 this.owner = {}; 59216 this.cancelable = false; 59217 this.changeAllowInDirectory = async () => { 59218 const ownerDp = this.publisher.owner; 59219 const allowInDirectory = ownerDp.allowInDirectory.get(); 59220 const api2 = new API(this.getApiConfiguration()); 59221 const body = { 59222 owner: { 59223 allowInDirectory: !!allowInDirectory 59224 } 59225 }; 59226 const response = await api2.patch(`subscriptions/${this.id}`, body); 59227 if (response.success) { 59228 const data = response.data; 59229 ownerDp.set(data?.owner); 59230 } 59231 }; 59232 } 59233 render() { 59234 const isSubscribe = this.props?.entity_type === "subscribe"; 59235 const barcode = this.props?.barcode; 59236 const eventId = this.props?.entity?.id; 59237 const isInDirectory = this.owner?.allowInDirectory; 59238 return b$1` 59239 <div class="@container"> 59240 <div class="grid @sm:grid-cols-2 grid-cols-1 gap-y-1"> 59241 ${this.price?.label || this.price?.amount ? b$1`<div> 59242 <span class="mr-1 text-2xs">${t("price")}</span><br /> 59243 <strong class="inline-block">${this.price?.label} ${formatAmount(this.price?.amount ?? 0)}</strong> 59244 </div>` : A$1} 59245 59246 <div>
59247 <span class="mr-1 text-2xs"> ${t("purchase_date")}</span><br /> 59248 <strong><sonic-date date=${this.created} weekday="hidden" month="2-digit"></sonic-date></strong> 59249 </div> 59250 ${!isSubscribe && (this.owner?.firstName || this.owner?.lastName) ? b$1`<div> 59251 <span class="mr-1 text-2xs">${t("owner")} </span><br /><strong class="inline-block" 59252 >${this.owner?.firstName} ${this.owner?.lastName}</strong 59253 > 59254 </div>` : A$1} 59255 59256 <!-- Contremarque --> 59257 ${this.price?.isCountermark && !this.props?.checked ? b$1` 59258 <sonic-badge type="danger" class="mt-1 mr-1" size="xs"> 59259 <sonic-icon name="file-exclamation" library="custom" slot="prefix"></sonic-icon> 59260 <div class="text-balance">${t("contremarque_echanger_guichet")}</div> 59261 </sonic-badge> 59262 ` : A$1} 59263 <sonic-transaction-purchase-status 59264 size="xs" 59265 hideValid 59266 class="block justify-self-start mt-1" 59267 ></sonic-transaction-purchase-status> 59268 59269 ${this.cancelable ? b$1`<div class="mt-1"> 59270 <sonic-button 59271 size="xs" 59272 variant="outline" 59273 type="info" 59274 noAutofill 59275 @click="${() => cancelTicket(Number(this.id))}" 59276 > 59277 <sonic-icon library="custom" name="hand-wave"></sonic-icon> 59278 <span class="font-semibold">${t("free_up")}</span> 59279 </sonic-button> 59280 </div>` : A$1} 59281 ${this.props?.cancelable_for_credit ? b$1` <div class="mt-1"> 59282 <sonic-button 59283 size="xs" 59284 variant="outline" 59285 type="info" 59286 noAutofill 59287 @click="${() => cancelTicket(Number(this.id), "credit")}" 59288 > 59289 <sonic-icon library="custom" name="hand-wave"></sonic-icon> 59290 <span class="font-semibold">${t("annuler_contre_avoir")}</span> 59291 </sonic-button> 59292 </div>` : A$1} 59293 ${this.props?.refund?.askEnabled && eventId && barcode ? b$1` 59294 <div class="mt-1"> 59295 <sonic-button 59296 size="xs" 59297 variant="outline" 59298 type="info" 59299 class="whitespace-nowrap" 59300 href="${appRoute("refund").query({ event_id: eventId, barcode })?.toString()}" 59301 > 59302 <sonic-icon name="arrow-rotate-left" library="custom"></sonic-icon> 59303 <b>${t("LIB_refund")}</b> 59304 </sonic-button> 59305 </div> 59306 ` : A$1} 59307 ${this.props?.can_allow_in_directory ? b$1`<div class="mt-1"> 59308 <sonic-checkbox 59309 formDataProvider=${this.dataProvider} 59310 dataProvider="_NONE_" 59311 unique 59312 name="owner.allowInDirectory" 59313 .value=${true} 59314 @change=${this.changeAllowInDirectory} 59315 size="xs" 59316 style="--sc-input-bg: var(--sc-base-300);" 59317 class=" ${!isInDirectory ? "text-neutral-600" : ""}" 59318 > 59319 <div class="flex items-center gap-1"> 59320 <sonic-icon library="custom" name="address-book" size="lg"></sonic-icon> 59321 ${t("LIB_in_directory")} 59322 </div> 59323 </sonic-checkbox> 59324 </div>` : A$1} 59325 </div> 59326 </div> 59327 `; 59328 } 59329 }; 59330 PurchaseSummaryComplementaryInfo.styles = [tailwind]; 59331 __decorateClass$W([ 59332 n$5({ type: Number }) 59333 ], PurchaseSummaryComplementaryInfo.prototype, "created", 2); 59334 __decorateClass$W([ 59335 n$5({ type: Object }) 59336 ], PurchaseSummaryComplementaryInfo.prototype, "price", 2); 59337 __decorateClass$W([ 59338 n$5({ type: Object }) 59339 ], PurchaseSummaryComplementaryInfo.prototype, "owner", 2); 59340 __decorateClass$W([ 59341 n$5({ type: Boolean }) 59342 ], PurchaseSummaryComplementaryInfo.prototype, "cancelable", 2); 59343 PurchaseSummaryComplementaryInfo = __decorateClass$W([ 59344 t$3(tagName$H) 59345 ], PurchaseSummaryComplementaryInfo); 59346 function isPurchasePrintable(purchase) { 59347 const status = purchase.status; 59348 if (!status) { 59349 return !!(purchase.print_url || purchase.pdf_mobile_url); 59350 } 59351 return status === "valide"; 59352 } 59353 ({ 59354 [EntityType.Event]: "/la_billetterie/billet/${id}/transactions", 59355 [EntityType.Giftcard]: "/la_billetterie/carte_cadeau/${id}", 59356 [EntityType.AdditionalProduct]: "/la_billetterie/produits_additionnels/${id}", 59357 [EntityType.Merch]: "/la_billetterie/merchs/${id}" 59358 }); 59359 const TRANSACTION_ROW_ACTIONS_SLOTS_CLASS = "grid grid-cols-[2.25rem_2.25rem] gap-1 justify-end w-full ml-auto"; 59360 var __defProp$S = Object.defineProperty; 59361 var __getOwnPropDesc$V = Object.getOwnPropertyDescriptor; 59362 var __decorateClass$V = (decorators, target, key, kind) => { 59363 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$V(target, key) : target; 59364 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 59365 if (decorator = decorators[i2]) 59366 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 59367 if (kind && result) __defProp$S(target, key, result); 59368 return result; 59369 }; 59370 const tagName$G = "sonic-ticket-info"; 59371 let TicketInfo = class extends Subscriber$1(i$6) { 59372 constructor() { 59373 super(...arguments); 59374 this.label = ""; 59375 this.content = ""; 59376 } 59377 render() { 59378 return b$1`<div> 59379 <div class="text-xs">${this.label}</div> 59380 <div class="font-bold">${o$6(this.content)}<slot></slot></div> 59381 </div>`; 59382 } 59383 }; 59384 TicketInfo.styles = [tailwind]; 59385 __decorateClass$V([ 59386 n$5({ type: String }) 59387 ], TicketInfo.prototype, "label", 2); 59388 __decorateClass$V([ 59389 n$5({ type: String }) 59390 ], TicketInfo.prototype, "content", 2); 59391 TicketInfo = __decorateClass$V([ 59392 t$3(tagName$G) 59393 ], TicketInfo); 59394 var barcodes = {}; 59395 var CODE39 = {}; 59396 var Barcode$1 = {}; 59397 var hasRequiredBarcode; 59398 function requireBarcode() { 59399 if (hasRequiredBarcode) return Barcode$1; 59400 hasRequiredBarcode = 1;
59401 Object.defineProperty(Barcode$1, "__esModule", { 59402 value: true 59403 }); 59404 function _classCallCheck(instance, Constructor) { 59405 if (!(instance instanceof Constructor)) { 59406 throw new TypeError("Cannot call a class as a function"); 59407 } 59408 } 59409 var Barcode2 = function Barcode3(data, options) { 59410 _classCallCheck(this, Barcode3); 59411 this.data = data; 59412 this.text = options.text || data; 59413 this.options = options; 59414 }; 59415 Barcode$1.default = Barcode2; 59416 return Barcode$1; 59417 } 59418 var hasRequiredCODE39; 59419 function requireCODE39() { 59420 if (hasRequiredCODE39) return CODE39; 59421 hasRequiredCODE39 = 1; 59422 Object.defineProperty(CODE39, "__esModule", { 59423 value: true 59424 }); 59425 CODE39.CODE39 = void 0; 59426 var _createClass = /* @__PURE__ */ (function() { 59427 function defineProperties(target, props) { 59428 for (var i2 = 0; i2 < props.length; i2++) { 59429 var descriptor = props[i2]; 59430 descriptor.enumerable = descriptor.enumerable || false; 59431 descriptor.configurable = true; 59432 if ("value" in descriptor) descriptor.writable = true; 59433 Object.defineProperty(target, descriptor.key, descriptor); 59434 } 59435 } 59436 return function(Constructor, protoProps, staticProps) { 59437 if (protoProps) defineProperties(Constructor.prototype, protoProps); 59438 if (staticProps) defineProperties(Constructor, staticProps); 59439 return Constructor; 59440 }; 59441 })(); 59442 var _Barcode2 = requireBarcode(); 59443 var _Barcode3 = _interopRequireDefault(_Barcode2); 59444 function _interopRequireDefault(obj) { 59445 return obj && obj.__esModule ? obj : { default: obj }; 59446 } 59447 function _classCallCheck(instance, Constructor) { 59448 if (!(instance instanceof Constructor)) { 59449 throw new TypeError("Cannot call a class as a function"); 59450 } 59451 } 59452 function _possibleConstructorReturn(self, call) { 59453 if (!self) { 59454 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59455 } 59456 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59457 } 59458 function _inherits(subClass, superClass) { 59459 if (typeof superClass !== "function" && superClass !== null) { 59460 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59461 } 59462 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 59463 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 59464 } 59465 var CODE39$1 = (function(_Barcode) { 59466 _inherits(CODE392, _Barcode); 59467 function CODE392(data, options) { 59468 _classCallCheck(this, CODE392); 59469 data = data.toUpperCase(); 59470 if (options.mod43) { 59471 data += getCharacter(mod43checksum(data)); 59472 } 59473 return _possibleConstructorReturn(this, (CODE392.__proto__ || Object.getPrototypeOf(CODE392)).call(this, data, options)); 59474 } 59475 _createClass(CODE392, [{ 59476 key: "encode", 59477 value: function encode() { 59478 var result = getEncoding("*"); 59479 for (var i2 = 0; i2 < this.data.length; i2++) { 59480 result += getEncoding(this.data[i2]) + "0"; 59481 } 59482 result += getEncoding("*"); 59483 return { 59484 data: result, 59485 text: this.text 59486 }; 59487 } 59488 }, { 59489 key: "valid", 59490 value: function valid() { 59491 return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/) !== -1; 59492 } 59493 }]); 59494 return CODE392; 59495 })(_Barcode3.default); 59496 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", "-", ".", " ", "$", "/", "+", "%", "*"]; 59497 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]; 59498 function getEncoding(character) { 59499 return getBinary(characterValue(character)); 59500 } 59501 function getBinary(characterValue2) { 59502 return encodings[characterValue2].toString(2); 59503 } 59504 function getCharacter(characterValue2) { 59505 return characters[characterValue2]; 59506 } 59507 function characterValue(character) { 59508 return characters.indexOf(character); 59509 } 59510 function mod43checksum(data) { 59511 var checksum = 0; 59512 for (var i2 = 0; i2 < data.length; i2++) { 59513 checksum += characterValue(data[i2]); 59514 } 59515 checksum = checksum % 43; 59516 return checksum; 59517 } 59518 CODE39.CODE39 = CODE39$1; 59519 return CODE39; 59520 } 59521 var CODE128$1 = {}; 59522 var CODE128_AUTO = {}; 59523 var CODE128 = {}; 59524 var constants$3 = {}; 59525 var hasRequiredConstants$3; 59526 function requireConstants$3() { 59527 if (hasRequiredConstants$3) return constants$3; 59528 hasRequiredConstants$3 = 1;
59529 Object.defineProperty(constants$3, "__esModule", { 59530 value: true 59531 }); 59532 var _SET_BY_CODE; 59533 function _defineProperty(obj, key, value) { 59534 if (key in obj) { 59535 Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); 59536 } else { 59537 obj[key] = value; 59538 } 59539 return obj; 59540 } 59541 var SET_A = constants$3.SET_A = 0; 59542 var SET_B = constants$3.SET_B = 1; 59543 var SET_C = constants$3.SET_C = 2; 59544 constants$3.SHIFT = 98; 59545 var START_A = constants$3.START_A = 103; 59546 var START_B = constants$3.START_B = 104; 59547 var START_C = constants$3.START_C = 105; 59548 constants$3.MODULO = 103; 59549 constants$3.STOP = 106; 59550 constants$3.FNC1 = 207; 59551 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); 59552 constants$3.SWAP = { 59553 101: SET_A, 59554 100: SET_B, 59555 99: SET_C 59556 }; 59557 constants$3.A_START_CHAR = String.fromCharCode(208); 59558 constants$3.B_START_CHAR = String.fromCharCode(209); 59559 constants$3.C_START_CHAR = String.fromCharCode(210); 59560 constants$3.A_CHARS = "[\0-_Ã-Ã]"; 59561 constants$3.B_CHARS = "[ -�Ã-Ã]"; 59562 constants$3.C_CHARS = "(Ã*[0-9]{2}Ã*)"; 59563 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]; 59564 return constants$3; 59565 } 59566 var hasRequiredCODE128$1; 59567 function requireCODE128$1() { 59568 if (hasRequiredCODE128$1) return CODE128; 59569 hasRequiredCODE128$1 = 1; 59570 Object.defineProperty(CODE128, "__esModule", { 59571 value: true 59572 }); 59573 var _createClass = /* @__PURE__ */ (function() { 59574 function defineProperties(target, props) { 59575 for (var i2 = 0; i2 < props.length; i2++) { 59576 var descriptor = props[i2]; 59577 descriptor.enumerable = descriptor.enumerable || false; 59578 descriptor.configurable = true; 59579 if ("value" in descriptor) descriptor.writable = true; 59580 Object.defineProperty(target, descriptor.key, descriptor); 59581 } 59582 } 59583 return function(Constructor, protoProps, staticProps) { 59584 if (protoProps) defineProperties(Constructor.prototype, protoProps); 59585 if (staticProps) defineProperties(Constructor, staticProps); 59586 return Constructor; 59587 }; 59588 })(); 59589 var _Barcode2 = requireBarcode(); 59590 var _Barcode3 = _interopRequireDefault(_Barcode2); 59591 var _constants = requireConstants$3(); 59592 function _interopRequireDefault(obj) { 59593 return obj && obj.__esModule ? obj : { default: obj }; 59594 } 59595 function _classCallCheck(instance, Constructor) { 59596 if (!(instance instanceof Constructor)) { 59597 throw new TypeError("Cannot call a class as a function"); 59598 } 59599 } 59600 function _possibleConstructorReturn(self, call) { 59601 if (!self) { 59602 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59603 } 59604 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59605 } 59606 function _inherits(subClass, superClass) { 59607 if (typeof superClass !== "function" && superClass !== null) { 59608 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59609 } 59610 subClass.prototype = Object.create(superClass && superClass.prototype, { c
59610onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 59611 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 59612 } 59613 var CODE128$12 = (function(_Barcode) { 59614 _inherits(CODE1282, _Barcode); 59615 function CODE1282(data, options) { 59616 _classCallCheck(this, CODE1282); 59617 var _this = _possibleConstructorReturn(this, (CODE1282.__proto__ || Object.getPrototypeOf(CODE1282)).call(this, data.substring(1), options)); 59618 _this.bytes = data.split("").map(function(char) { 59619 return char.charCodeAt(0); 59620 }); 59621 return _this; 59622 } 59623 _createClass(CODE1282, [{ 59624 key: "valid", 59625 value: function valid() { 59626 return /^[\x00-\x7F\xC8-\xD3]+$/.test(this.data); 59627 } 59628 // The public encoding function 59629 }, { 59630 key: "encode", 59631 value: function encode() { 59632 var bytes = this.bytes; 59633 var startIndex = bytes.shift() - 105; 59634 var startSet = _constants.SET_BY_CODE[startIndex]; 59635 if (startSet === void 0) { 59636 throw new RangeError("The encoding does not start with a start character."); 59637 } 59638 if (this.shouldEncodeAsEan128() === true) { 59639 bytes.unshift(_constants.FNC1); 59640 } 59641 var encodingResult = CODE1282.next(bytes, 1, startSet); 59642 return { 59643 text: this.text === this.data ? this.text.replace(/[^\x20-\x7E]/g, "") : this.text, 59644 data: ( 59645 // Add the start bits 59646 CODE1282.getBar(startIndex) + // Add the encoded bits 59647 encodingResult.result + // Add the checksum 59648 CODE1282.getBar((encodingResult.checksum + startIndex) % _constants.MODULO) + // Add the end bits 59649 CODE1282.getBar(_constants.STOP) 59650 ) 59651 }; 59652 } 59653 // GS1-128/EAN-128 59654 }, { 59655 key: "shouldEncodeAsEan128", 59656 value: function shouldEncodeAsEan128() { 59657 var isEAN128 = this.options.ean128 || false; 59658 if (typeof isEAN128 === "string") { 59659 isEAN128 = isEAN128.toLowerCase() === "true"; 59660 } 59661 return isEAN128; 59662 } 59663 // Get a bar symbol by index 59664 }], [{ 59665 key: "getBar", 59666 value: function getBar(index) { 59667 return _constants.BARS[index] ? _constants.BARS[index].toString() : ""; 59668 } 59669 // Correct an index by a set and shift it from the bytes array 59670 }, { 59671 key: "correctIndex", 59672 value: function correctIndex(bytes, set2) { 59673 if (set2 === _constants.SET_A) { 59674 var charCode = bytes.shift(); 59675 return charCode < 32 ? charCode + 64 : charCode - 32; 59676 } else if (set2 === _constants.SET_B) { 59677 return bytes.shift() - 32; 59678 } else { 59679 return (bytes.shift() - 48) * 10 + bytes.shift() - 48; 59680 } 59681 } 59682 }, { 59683 key: "next", 59684 value: function next(bytes, pos, set2) { 59685 if (!bytes.length) { 59686 return { result: "", checksum: 0 }; 59687 } 59688 var nextCode = void 0, index = void 0; 59689 if (bytes[0] >= 200) { 59690 index = bytes.shift() - 105; 59691 var nextSet = _constants.SWAP[index]; 59692 if (nextSet !== void 0) { 59693 nextCode = CODE1282.next(bytes, pos + 1, nextSet); 59694 } else { 59695 if ((set2 === _constants.SET_A || set2 === _constants.SET_B) && index === _constants.SHIFT) { 59696 bytes[0] = set2 === _constants.SET_A ? bytes[0] > 95 ? bytes[0] - 96 : bytes[0] : bytes[0] < 32 ? bytes[0] + 96 : bytes[0]; 59697 } 59698 nextCode = CODE1282.next(bytes, pos + 1, set2); 59699 } 59700 } else { 59701 index = CODE1282.correctIndex(bytes, set2); 59702 nextCode = CODE1282.next(bytes, pos + 1, set2); 59703 } 59704 var enc = CODE1282.getBar(index); 59705 var weight = index * pos; 59706 return { 59707 result: enc + nextCode.result, 59708 checksum: weight + nextCode.checksum 59709 }; 59710 } 59711 }]); 59712 return CODE1282; 59713 })(_Barcode3.default); 59714 CODE128.default = CODE128$12; 59715 return CODE128; 59716 } 59717 var auto = {}; 59718 var hasRequiredAuto; 59719 function requireAuto() { 59720 if (hasRequiredAuto) return auto; 59721 hasRequiredAuto = 1;
59722 Object.defineProperty(auto, "__esModule", { 59723 value: true 59724 }); 59725 var _constants = requireConstants$3(); 59726 var matchSetALength = function matchSetALength2(string) { 59727 return string.match(new RegExp("^" + _constants.A_CHARS + "*"))[0].length; 59728 }; 59729 var matchSetBLength = function matchSetBLength2(string) { 59730 return string.match(new RegExp("^" + _constants.B_CHARS + "*"))[0].length; 59731 }; 59732 var matchSetC = function matchSetC2(string) { 59733 return string.match(new RegExp("^" + _constants.C_CHARS + "*"))[0]; 59734 }; 59735 function autoSelectFromAB(string, isA) { 59736 var ranges = isA ? _constants.A_CHARS : _constants.B_CHARS; 59737 var untilC = string.match(new RegExp("^(" + ranges + "+?)(([0-9]{2}){2,})([^0-9]|$)")); 59738 if (untilC) { 59739 return untilC[1] + String.fromCharCode(204) + autoSelectFromC(string.substring(untilC[1].length)); 59740 } 59741 var chars = string.match(new RegExp("^" + ranges + "+"))[0]; 59742 if (chars.length === string.length) { 59743 return string; 59744 } 59745 return chars + String.fromCharCode(isA ? 205 : 206) + autoSelectFromAB(string.substring(chars.length), !isA); 59746 } 59747 function autoSelectFromC(string) { 59748 var cMatch = matchSetC(string); 59749 var length = cMatch.length; 59750 if (length === string.length) { 59751 return string; 59752 } 59753 string = string.substring(length); 59754 var isA = matchSetALength(string) >= matchSetBLength(string); 59755 return cMatch + String.fromCharCode(isA ? 206 : 205) + autoSelectFromAB(string, isA); 59756 } 59757 auto.default = function(string) { 59758 var newString = void 0; 59759 var cLength = matchSetC(string).length; 59760 if (cLength >= 2) { 59761 newString = _constants.C_START_CHAR + autoSelectFromC(string); 59762 } else { 59763 var isA = matchSetALength(string) > matchSetBLength(string); 59764 newString = (isA ? _constants.A_START_CHAR : _constants.B_START_CHAR) + autoSelectFromAB(string, isA); 59765 } 59766 return newString.replace( 59767 /[\xCD\xCE]([^])[\xCD\xCE]/, 59768 // Any sequence between 205 and 206 characters 59769 function(match, char) { 59770 return String.fromCharCode(203) + char; 59771 } 59772 ); 59773 }; 59774 return auto; 59775 } 59776 var hasRequiredCODE128_AUTO; 59777 function requireCODE128_AUTO() { 59778 if (hasRequiredCODE128_AUTO) return CODE128_AUTO; 59779 hasRequiredCODE128_AUTO = 1; 59780 Object.defineProperty(CODE128_AUTO, "__esModule", { 59781 value: true 59782 }); 59783 var _CODE2 = requireCODE128$1(); 59784 var _CODE3 = _interopRequireDefault(_CODE2); 59785 var _auto = requireAuto(); 59786 var _auto2 = _interopRequireDefault(_auto); 59787 function _interopRequireDefault(obj) { 59788 return obj && obj.__esModule ? obj : { default: obj }; 59789 } 59790 function _classCallCheck(instance, Constructor) { 59791 if (!(instance instanceof Constructor)) { 59792 throw new TypeError("Cannot call a class as a function"); 59793 } 59794 } 59795 function _possibleConstructorReturn(self, call) { 59796 if (!self) { 59797 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59798 } 59799 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59800 } 59801 function _inherits(subClass, superClass) { 59802 if (typeof superClass !== "function" && superClass !== null) { 59803 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59804 } 59805 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 59806 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 59807 } 59808 var CODE128AUTO = (function(_CODE) { 59809 _inherits(CODE128AUTO2, _CODE); 59810 function CODE128AUTO2(data, options) { 59811 _classCallCheck(this, CODE128AUTO2); 59812 if (/^[\x00-\x7F\xC8-\xD3]+$/.test(data)) { 59813 var _this = _possibleConstructorReturn(this, (CODE128AUTO2.__proto__ || Object.getPrototypeOf(CODE128AUTO2)).call(this, (0, _auto2.default)(data), options)); 59814 } else { 59815 var _this = _possibleConstructorReturn(this, (CODE128AUTO2.__proto__ || Object.getPrototypeOf(CODE128AUTO2)).call(this, data, options)); 59816 } 59817 return _possibleConstructorReturn(_this); 59818 } 59819 return CODE128AUTO2; 59820 })(_CODE3.default); 59821 CODE128_AUTO.default = CODE128AUTO; 59822 return CODE128_AUTO; 59823 } 59824 var CODE128A = {}; 59825 var hasRequiredCODE128A; 59826 function requireCODE128A() { 59827 if (hasRequiredCODE128A) return CODE128A; 59828 hasRequiredCODE128A = 1;
59829 Object.defineProperty(CODE128A, "__esModule", { 59830 value: true 59831 }); 59832 var _createClass = /* @__PURE__ */ (function() { 59833 function defineProperties(target, props) { 59834 for (var i2 = 0; i2 < props.length; i2++) { 59835 var descriptor = props[i2]; 59836 descriptor.enumerable = descriptor.enumerable || false; 59837 descriptor.configurable = true; 59838 if ("value" in descriptor) descriptor.writable = true; 59839 Object.defineProperty(target, descriptor.key, descriptor); 59840 } 59841 } 59842 return function(Constructor, protoProps, staticProps) { 59843 if (protoProps) defineProperties(Constructor.prototype, protoProps); 59844 if (staticProps) defineProperties(Constructor, staticProps); 59845 return Constructor; 59846 }; 59847 })(); 59848 var _CODE2 = requireCODE128$1(); 59849 var _CODE3 = _interopRequireDefault(_CODE2); 59850 var _constants = requireConstants$3(); 59851 function _interopRequireDefault(obj) { 59852 return obj && obj.__esModule ? obj : { default: obj }; 59853 } 59854 function _classCallCheck(instance, Constructor) { 59855 if (!(instance instanceof Constructor)) { 59856 throw new TypeError("Cannot call a class as a function"); 59857 } 59858 } 59859 function _possibleConstructorReturn(self, call) { 59860 if (!self) { 59861 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59862 } 59863 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59864 } 59865 function _inherits(subClass, superClass) { 59866 if (typeof superClass !== "function" && superClass !== null) { 59867 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59868 } 59869 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 59870 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 59871 } 59872 var CODE128A$1 = (function(_CODE) { 59873 _inherits(CODE128A2, _CODE); 59874 function CODE128A2(string, options) { 59875 _classCallCheck(this, CODE128A2); 59876 return _possibleConstructorReturn(this, (CODE128A2.__proto__ || Object.getPrototypeOf(CODE128A2)).call(this, _constants.A_START_CHAR + string, options)); 59877 } 59878 _createClass(CODE128A2, [{ 59879 key: "valid", 59880 value: function valid() { 59881 return new RegExp("^" + _constants.A_CHARS + "+$").test(this.data); 59882 } 59883 }]); 59884 return CODE128A2; 59885 })(_CODE3.default); 59886 CODE128A.default = CODE128A$1; 59887 return CODE128A; 59888 } 59889 var CODE128B = {}; 59890 var hasRequiredCODE128B; 59891 function requireCODE128B() { 59892 if (hasRequiredCODE128B) return CODE128B; 59893 hasRequiredCODE128B = 1; 59894 Object.defineProperty(CODE128B, "__esModule", { 59895 value: true 59896 }); 59897 var _createClass = /* @__PURE__ */ (function() { 59898 function defineProperties(target, props) { 59899 for (var i2 = 0; i2 < props.length; i2++) { 59900 var descriptor = props[i2]; 59901 descriptor.enumerable = descriptor.enumerable || false; 59902 descriptor.configurable = true; 59903 if ("value" in descriptor) descriptor.writable = true; 59904 Object.defineProperty(target, descriptor.key, descriptor); 59905 } 59906 } 59907 return function(Constructor, protoProps, staticProps) { 59908 if (protoProps) defineProperties(Constructor.prototype, protoProps); 59909 if (staticProps) defineProperties(Constructor, staticProps); 59910 return Constructor; 59911 }; 59912 })(); 59913 var _CODE2 = requireCODE128$1(); 59914 var _CODE3 = _interopRequireDefault(_CODE2); 59915 var _constants = requireConstants$3(); 59916 function _interopRequireDefault(obj) { 59917 return obj && obj.__esModule ? obj : { default: obj }; 59918 } 59919 function _classCallCheck(instance, Constructor) { 59920 if (!(instance instanceof Constructor)) { 59921 throw new TypeError("Cannot call a class as a function"); 59922 } 59923 } 59924 function _possibleConstructorReturn(self, call) { 59925 if (!self) { 59926 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59927 } 59928 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59929 } 59930 function _inherits(subClass, superClass) { 59931 if (typeof superClass !== "function" && superClass !== null) { 59932 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59933 } 59934 subClass.prototype = Object.create(superClass && superClass.prototype, { c
59934onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 59935 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 59936 } 59937 var CODE128B$1 = (function(_CODE) { 59938 _inherits(CODE128B2, _CODE); 59939 function CODE128B2(string, options) { 59940 _classCallCheck(this, CODE128B2); 59941 return _possibleConstructorReturn(this, (CODE128B2.__proto__ || Object.getPrototypeOf(CODE128B2)).call(this, _constants.B_START_CHAR + string, options)); 59942 } 59943 _createClass(CODE128B2, [{ 59944 key: "valid", 59945 value: function valid() { 59946 return new RegExp("^" + _constants.B_CHARS + "+$").test(this.data); 59947 } 59948 }]); 59949 return CODE128B2; 59950 })(_CODE3.default); 59951 CODE128B.default = CODE128B$1; 59952 return CODE128B; 59953 } 59954 var CODE128C = {}; 59955 var hasRequiredCODE128C; 59956 function requireCODE128C() { 59957 if (hasRequiredCODE128C) return CODE128C; 59958 hasRequiredCODE128C = 1; 59959 Object.defineProperty(CODE128C, "__esModule", { 59960 value: true 59961 }); 59962 var _createClass = /* @__PURE__ */ (function() { 59963 function defineProperties(target, props) { 59964 for (var i2 = 0; i2 < props.length; i2++) { 59965 var descriptor = props[i2]; 59966 descriptor.enumerable = descriptor.enumerable || false; 59967 descriptor.configurable = true; 59968 if ("value" in descriptor) descriptor.writable = true; 59969 Object.defineProperty(target, descriptor.key, descriptor); 59970 } 59971 } 59972 return function(Constructor, protoProps, staticProps) { 59973 if (protoProps) defineProperties(Constructor.prototype, protoProps); 59974 if (staticProps) defineProperties(Constructor, staticProps); 59975 return Constructor; 59976 }; 59977 })(); 59978 var _CODE2 = requireCODE128$1(); 59979 var _CODE3 = _interopRequireDefault(_CODE2); 59980 var _constants = requireConstants$3(); 59981 function _interopRequireDefault(obj) { 59982 return obj && obj.__esModule ? obj : { default: obj }; 59983 } 59984 function _classCallCheck(instance, Constructor) { 59985 if (!(instance instanceof Constructor)) { 59986 throw new TypeError("Cannot call a class as a function"); 59987 } 59988 } 59989 function _possibleConstructorReturn(self, call) { 59990 if (!self) { 59991 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 59992 } 59993 return call && (typeof call === "object" || typeof call === "function") ? call : self; 59994 } 59995 function _inherits(subClass, superClass) { 59996 if (typeof superClass !== "function" && superClass !== null) { 59997 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 59998 } 59999 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60000 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60001 } 60002 var CODE128C$1 = (function(_CODE) { 60003 _inherits(CODE128C2, _CODE); 60004 function CODE128C2(string, options) { 60005 _classCallCheck(this, CODE128C2); 60006 return _possibleConstructorReturn(this, (CODE128C2.__proto__ || Object.getPrototypeOf(CODE128C2)).call(this, _constants.C_START_CHAR + string, options)); 60007 } 60008 _createClass(CODE128C2, [{ 60009 key: "valid", 60010 value: function valid() { 60011 return new RegExp("^" + _constants.C_CHARS + "+$").test(this.data); 60012 } 60013 }]); 60014 return CODE128C2; 60015 })(_CODE3.default); 60016 CODE128C.default = CODE128C$1; 60017 return CODE128C; 60018 } 60019 var hasRequiredCODE128; 60020 function requireCODE128() { 60021 if (hasRequiredCODE128) return CODE128$1; 60022 hasRequiredCODE128 = 1; 60023 Object.defineProperty(CODE128$1, "__esModule", { 60024 value: true 60025 }); 60026 CODE128$1.CODE128C = CODE128$1.CODE128B = CODE128$1.CODE128A = CODE128$1.CODE128 = void 0; 60027 var _CODE128_AUTO = requireCODE128_AUTO(); 60028 var _CODE128_AUTO2 = _interopRequireDefault(_CODE128_AUTO); 60029 var _CODE128A = requireCODE128A(); 60030 var _CODE128A2 = _interopRequireDefault(_CODE128A); 60031 var _CODE128B = requireCODE128B(); 60032 var _CODE128B2 = _interopRequireDefault(_CODE128B); 60033 var _CODE128C = requireCODE128C(); 60034 var _CODE128C2 = _interopRequireDefault(_CODE128C); 60035 function _interopRequireDefault(obj) { 60036 return obj && obj.__esModule ? obj : { default: obj }; 60037 } 60038 CODE128$1.CODE128 = _CODE128_AUTO2.default; 60039 CODE128$1.CODE128A = _CODE128A2.default; 60040 CODE128$1.CODE128B = _CODE128B2.default; 60041 CODE128$1.CODE128C = _CODE128C2.default; 60042 return CODE128$1; 60043 } 60044 var EAN_UPC = {}; 60045 var EAN13 = {}; 60046 var constants$2 = {}; 60047 var hasRequiredConstants$2; 60048 function requireConstants$2() { 60049 if (hasRequiredConstants$2) return constants$2; 60050 hasRequiredConstants$2 = 1;
60051 Object.defineProperty(constants$2, "__esModule", { 60052 value: true 60053 }); 60054 constants$2.SIDE_BIN = "101"; 60055 constants$2.MIDDLE_BIN = "01010"; 60056 constants$2.BINARIES = { 60057 "L": [ 60058 // The L (left) type of encoding 60059 "0001101", 60060 "0011001", 60061 "0010011", 60062 "0111101", 60063 "0100011", 60064 "0110001", 60065 "0101111", 60066 "0111011", 60067 "0110111", 60068 "0001011" 60069 ], 60070 "G": [ 60071 // The G type of encoding 60072 "0100111", 60073 "0110011", 60074 "0011011", 60075 "0100001", 60076 "0011101", 60077 "0111001", 60078 "0000101", 60079 "0010001", 60080 "0001001", 60081 "0010111" 60082 ], 60083 "R": [ 60084 // The R (right) type of encoding 60085 "1110010", 60086 "1100110", 60087 "1101100", 60088 "1000010", 60089 "1011100", 60090 "1001110", 60091 "1010000", 60092 "1000100", 60093 "1001000", 60094 "1110100" 60095 ], 60096 "O": [ 60097 // The O (odd) encoding for UPC-E 60098 "0001101", 60099 "0011001", 60100 "0010011", 60101 "0111101", 60102 "0100011", 60103 "0110001", 60104 "0101111", 60105 "0111011", 60106 "0110111", 60107 "0001011" 60108 ], 60109 "E": [ 60110 // The E (even) encoding for UPC-E 60111 "0100111", 60112 "0110011", 60113 "0011011", 60114 "0100001", 60115 "0011101", 60116 "0111001", 60117 "0000101", 60118 "0010001", 60119 "0001001", 60120 "0010111" 60121 ] 60122 }; 60123 constants$2.EAN2_STRUCTURE = ["LL", "LG", "GL", "GG"]; 60124 constants$2.EAN5_STRUCTURE = ["GGLLL", "GLGLL", "GLLGL", "GLLLG", "LGGLL", "LLGGL", "LLLGG", "LGLGL", "LGLLG", "LLGLG"]; 60125 constants$2.EAN13_STRUCTURE = ["LLLLLL", "LLGLGG", "LLGGLG", "LLGGGL", "LGLLGG", "LGGLLG", "LGGGLL", "LGLGLG", "LGLGGL", "LGGLGL"]; 60126 return constants$2; 60127 } 60128 var EAN = {}; 60129 var encoder = {}; 60130 var hasRequiredEncoder; 60131 function requireEncoder() { 60132 if (hasRequiredEncoder) return encoder; 60133 hasRequiredEncoder = 1; 60134 Object.defineProperty(encoder, "__esModule", { 60135 value: true 60136 }); 60137 var _constants = requireConstants$2(); 60138 var encode = function encode2(data, structure, separator) { 60139 var encoded = data.split("").map(function(val, idx) { 60140 return _constants.BINARIES[structure[idx]]; 60141 }).map(function(val, idx) { 60142 return val ? val[data[idx]] : ""; 60143 }); 60144 if (separator) { 60145 var last = data.length - 1; 60146 encoded = encoded.map(function(val, idx) { 60147 return idx < last ? val + separator : val; 60148 }); 60149 } 60150 return encoded.join(""); 60151 }; 60152 encoder.default = encode; 60153 return encoder; 60154 } 60155 var hasRequiredEAN; 60156 function requireEAN() { 60157 if (hasRequiredEAN) return EAN; 60158 hasRequiredEAN = 1; 60159 Object.defineProperty(EAN, "__esModule", { 60160 value: true 60161 }); 60162 var _createClass = /* @__PURE__ */ (function() { 60163 function defineProperties(target, props) { 60164 for (var i2 = 0; i2 < props.length; i2++) { 60165 var descriptor = props[i2]; 60166 descriptor.enumerable = descriptor.enumerable || false; 60167 descriptor.configurable = true; 60168 if ("value" in descriptor) descriptor.writable = true; 60169 Object.defineProperty(target, descriptor.key, descriptor); 60170 } 60171 } 60172 return function(Constructor, protoProps, staticProps) { 60173 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60174 if (staticProps) defineProperties(Constructor, staticProps); 60175 return Constructor; 60176 }; 60177 })(); 60178 var _constants = requireConstants$2(); 60179 var _encoder = requireEncoder(); 60180 var _encoder2 = _interopRequireDefault(_encoder); 60181 var _Barcode2 = requireBarcode(); 60182 var _Barcode3 = _interopRequireDefault(_Barcode2); 60183 function _interopRequireDefault(obj) { 60184 return obj && obj.__esModule ? obj : { default: obj }; 60185 } 60186 function _classCallCheck(instance, Constructor) { 60187 if (!(instance instanceof Constructor)) { 60188 throw new TypeError("Cannot call a class as a function"); 60189 } 60190 } 60191 function _possibleConstructorReturn(self, call) { 60192 if (!self) { 60193 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60194 } 60195 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60196 } 60197 function _inherits(subClass, superClass) { 60198 if (typeof superClass !== "function" && superClass !== null) { 60199 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60200 } 60201 subClass.prototype = Object.create(superClass && superClass.prototype, { c
60201onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60202 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60203 } 60204 var EAN$1 = (function(_Barcode) { 60205 _inherits(EAN3, _Barcode); 60206 function EAN3(data, options) { 60207 _classCallCheck(this, EAN3); 60208 var _this = _possibleConstructorReturn(this, (EAN3.__proto__ || Object.getPrototypeOf(EAN3)).call(this, data, options)); 60209 _this.fontSize = !options.flat && options.fontSize > options.width * 10 ? options.width * 10 : options.fontSize; 60210 _this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin; 60211 return _this; 60212 } 60213 _createClass(EAN3, [{ 60214 key: "encode", 60215 value: function encode() { 60216 return this.options.flat ? this.encodeFlat() : this.encodeGuarded(); 60217 } 60218 }, { 60219 key: "leftText", 60220 value: function leftText(from, to) { 60221 return this.text.substr(from, to); 60222 } 60223 }, { 60224 key: "leftEncode", 60225 value: function leftEncode(data, structure) { 60226 return (0, _encoder2.default)(data, structure); 60227 } 60228 }, { 60229 key: "rightText", 60230 value: function rightText(from, to) { 60231 return this.text.substr(from, to); 60232 } 60233 }, { 60234 key: "rightEncode", 60235 value: function rightEncode(data, structure) { 60236 return (0, _encoder2.default)(data, structure); 60237 } 60238 }, { 60239 key: "encodeGuarded", 60240 value: function encodeGuarded() { 60241 var textOptions = { fontSize: this.fontSize }; 60242 var guardOptions = { height: this.guardHeight }; 60243 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 }]; 60244 } 60245 }, { 60246 key: "encodeFlat", 60247 value: function encodeFlat() { 60248 var data = [_constants.SIDE_BIN, this.leftEncode(), _constants.MIDDLE_BIN, this.rightEncode(), _constants.SIDE_BIN]; 60249 return { 60250 data: data.join(""), 60251 text: this.text 60252 }; 60253 } 60254 }]); 60255 return EAN3; 60256 })(_Barcode3.default); 60257 EAN.default = EAN$1; 60258 return EAN; 60259 } 60260 var hasRequiredEAN13; 60261 function requireEAN13() { 60262 if (hasRequiredEAN13) return EAN13; 60263 hasRequiredEAN13 = 1; 60264 Object.defineProperty(EAN13, "__esModule", { 60265 value: true 60266 }); 60267 var _createClass = /* @__PURE__ */ (function() { 60268 function defineProperties(target, props) { 60269 for (var i2 = 0; i2 < props.length; i2++) { 60270 var descriptor = props[i2]; 60271 descriptor.enumerable = descriptor.enumerable || false; 60272 descriptor.configurable = true; 60273 if ("value" in descriptor) descriptor.writable = true; 60274 Object.defineProperty(target, descriptor.key, descriptor); 60275 } 60276 } 60277 return function(Constructor, protoProps, staticProps) { 60278 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60279 if (staticProps) defineProperties(Constructor, staticProps); 60280 return Constructor; 60281 }; 60282 })(); 60283 var _get = function get2(object2, property2, receiver) { 60284 if (object2 === null) object2 = Function.prototype; 60285 var desc = Object.getOwnPropertyDescriptor(object2, property2); 60286 if (desc === void 0) { 60287 var parent = Object.getPrototypeOf(object2); 60288 if (parent === null) { 60289 return void 0; 60290 } else { 60291 return get2(parent, property2, receiver); 60292 } 60293 } else if ("value" in desc) { 60294 return desc.value; 60295 } else { 60296 var getter = desc.get; 60297 if (getter === void 0) { 60298 return void 0; 60299 } 60300 return getter.call(receiver); 60301 } 60302 }; 60303 var _constants = requireConstants$2(); 60304 var _EAN2 = requireEAN(); 60305 var _EAN3 = _interopRequireDefault(_EAN2); 60306 function _interopRequireDefault(obj) { 60307 return obj && obj.__esModule ? obj : { default: obj }; 60308 } 60309 function _classCallCheck(instance, Constructor) { 60310 if (!(instance instanceof Constructor)) { 60311 throw new TypeError("Cannot call a class as a function"); 60312 } 60313 } 60314 function _possibleConstructorReturn(self, call) { 60315 if (!self) { 60316 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60317 } 60318 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60319 } 60320 function _inherits(subClass, superClass) { 60321 if (typeof superClass !== "function" && superClass !== null) { 60322 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60323 } 60324 subClass.prototype = Object.create(superClass && superClass.prototype, { c
60324onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60325 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60326 } 60327 var checksum = function checksum2(number) { 60328 var res = number.substr(0, 12).split("").map(function(n2) { 60329 return +n2; 60330 }).reduce(function(sum, a2, idx) { 60331 return idx % 2 ? sum + a2 * 3 : sum + a2; 60332 }, 0); 60333 return (10 - res % 10) % 10; 60334 }; 60335 var EAN13$1 = (function(_EAN) { 60336 _inherits(EAN132, _EAN); 60337 function EAN132(data, options) { 60338 _classCallCheck(this, EAN132); 60339 if (data.search(/^[0-9]{12}$/) !== -1) { 60340 data += checksum(data); 60341 } 60342 var _this = _possibleConstructorReturn(this, (EAN132.__proto__ || Object.getPrototypeOf(EAN132)).call(this, data, options)); 60343 _this.lastChar = options.lastChar; 60344 return _this; 60345 } 60346 _createClass(EAN132, [{ 60347 key: "valid", 60348 value: function valid() { 60349 return this.data.search(/^[0-9]{13}$/) !== -1 && +this.data[12] === checksum(this.data); 60350 } 60351 }, { 60352 key: "leftText", 60353 value: function leftText() { 60354 return _get(EAN132.prototype.__proto__ || Object.getPrototypeOf(EAN132.prototype), "leftText", this).call(this, 1, 6); 60355 } 60356 }, { 60357 key: "leftEncode", 60358 value: function leftEncode() { 60359 var data = this.data.substr(1, 6); 60360 var structure = _constants.EAN13_STRUCTURE[this.data[0]]; 60361 return _get(EAN132.prototype.__proto__ || Object.getPrototypeOf(EAN132.prototype), "leftEncode", this).call(this, data, structure); 60362 } 60363 }, { 60364 key: "rightText", 60365 value: function rightText() { 60366 return _get(EAN132.prototype.__proto__ || Object.getPrototypeOf(EAN132.prototype), "rightText", this).call(this, 7, 6); 60367 } 60368 }, { 60369 key: "rightEncode", 60370 value: function rightEncode() { 60371 var data = this.data.substr(7, 6); 60372 return _get(EAN132.prototype.__proto__ || Object.getPrototypeOf(EAN132.prototype), "rightEncode", this).call(this, data, "RRRRRR"); 60373 } 60374 // The "standard" way of printing EAN13 barcodes with guard bars 60375 }, { 60376 key: "encodeGuarded", 60377 value: function encodeGuarded() { 60378 var data = _get(EAN132.prototype.__proto__ || Object.getPrototypeOf(EAN132.prototype), "encodeGuarded", this).call(this); 60379 if (this.options.displayValue) { 60380 data.unshift({ 60381 data: "000000000000", 60382 text: this.text.substr(0, 1), 60383 options: { textAlign: "left", fontSize: this.fontSize } 60384 }); 60385 if (this.options.lastChar) { 60386 data.push({ 60387 data: "00" 60388 }); 60389 data.push({ 60390 data: "00000", 60391 text: this.options.lastChar, 60392 options: { fontSize: this.fontSize } 60393 }); 60394 } 60395 } 60396 return data; 60397 } 60398 }]); 60399 return EAN132; 60400 })(_EAN3.default); 60401 EAN13.default = EAN13$1; 60402 return EAN13; 60403 } 60404 var EAN8 = {}; 60405 var hasRequiredEAN8; 60406 function requireEAN8() { 60407 if (hasRequiredEAN8) return EAN8; 60408 hasRequiredEAN8 = 1; 60409 Object.defineProperty(EAN8, "__esModule", { 60410 value: true 60411 }); 60412 var _createClass = /* @__PURE__ */ (function() { 60413 function defineProperties(target, props) { 60414 for (var i2 = 0; i2 < props.length; i2++) { 60415 var descriptor = props[i2]; 60416 descriptor.enumerable = descriptor.enumerable || false; 60417 descriptor.configurable = true; 60418 if ("value" in descriptor) descriptor.writable = true; 60419 Object.defineProperty(target, descriptor.key, descriptor); 60420 } 60421 } 60422 return function(Constructor, protoProps, staticProps) { 60423 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60424 if (staticProps) defineProperties(Constructor, staticProps); 60425 return Constructor; 60426 }; 60427 })(); 60428 var _get = function get2(object2, property2, receiver) { 60429 if (object2 === null) object2 = Function.prototype; 60430 var desc = Object.getOwnPropertyDescriptor(object2, property2); 60431 if (desc === void 0) { 60432 var parent = Object.getPrototypeOf(object2); 60433 if (parent === null) { 60434 return void 0; 60435 } else { 60436 return get2(parent, property2, receiver); 60437 } 60438 } else if ("value" in desc) { 60439 return desc.value; 60440 } else { 60441 var getter = desc.get; 60442 if (getter === void 0) { 60443 return void 0; 60444 } 60445 return getter.call(receiver); 60446 } 60447 }; 60448 var _EAN2 = requireEAN(); 60449 var _EAN3 = _interopRequireDefault(_EAN2); 60450 function _interopRequireDefault(obj) { 60451 return obj && obj.__esModule ? obj : { default: obj }; 60452 } 60453 function _classCallCheck(instance, Constructor) { 60454 if (!(instance instanceof Constructor)) { 60455 throw new TypeError("Cannot call a class as a function"); 60456 } 60457 } 60458 function _possibleConstructorReturn(self, call) { 60459 if (!self) { 60460 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60461 } 60462 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60463 } 60464 function _inherits(subClass, superClass) { 60465 if (typeof superClass !== "function" && superClass !== null) { 60466 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60467 } 60468 subClass.prototype = Object.create(superClass && superClass.prototype, { c
60468onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60469 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60470 } 60471 var checksum = function checksum2(number) { 60472 var res = number.substr(0, 7).split("").map(function(n2) { 60473 return +n2; 60474 }).reduce(function(sum, a2, idx) { 60475 return idx % 2 ? sum + a2 : sum + a2 * 3; 60476 }, 0); 60477 return (10 - res % 10) % 10; 60478 }; 60479 var EAN8$1 = (function(_EAN) { 60480 _inherits(EAN82, _EAN); 60481 function EAN82(data, options) { 60482 _classCallCheck(this, EAN82); 60483 if (data.search(/^[0-9]{7}$/) !== -1) { 60484 data += checksum(data); 60485 } 60486 return _possibleConstructorReturn(this, (EAN82.__proto__ || Object.getPrototypeOf(EAN82)).call(this, data, options)); 60487 } 60488 _createClass(EAN82, [{ 60489 key: "valid", 60490 value: function valid() { 60491 return this.data.search(/^[0-9]{8}$/) !== -1 && +this.data[7] === checksum(this.data); 60492 } 60493 }, { 60494 key: "leftText", 60495 value: function leftText() { 60496 return _get(EAN82.prototype.__proto__ || Object.getPrototypeOf(EAN82.prototype), "leftText", this).call(this, 0, 4); 60497 } 60498 }, { 60499 key: "leftEncode", 60500 value: function leftEncode() { 60501 var data = this.data.substr(0, 4); 60502 return _get(EAN82.prototype.__proto__ || Object.getPrototypeOf(EAN82.prototype), "leftEncode", this).call(this, data, "LLLL"); 60503 } 60504 }, { 60505 key: "rightText", 60506 value: function rightText() { 60507 return _get(EAN82.prototype.__proto__ || Object.getPrototypeOf(EAN82.prototype), "rightText", this).call(this, 4, 4); 60508 } 60509 }, { 60510 key: "rightEncode", 60511 value: function rightEncode() { 60512 var data = this.data.substr(4, 4); 60513 return _get(EAN82.prototype.__proto__ || Object.getPrototypeOf(EAN82.prototype), "rightEncode", this).call(this, data, "RRRR"); 60514 } 60515 }]); 60516 return EAN82; 60517 })(_EAN3.default); 60518 EAN8.default = EAN8$1; 60519 return EAN8; 60520 } 60521 var EAN5 = {}; 60522 var hasRequiredEAN5; 60523 function requireEAN5() { 60524 if (hasRequiredEAN5) return EAN5; 60525 hasRequiredEAN5 = 1; 60526 Object.defineProperty(EAN5, "__esModule", { 60527 value: true 60528 }); 60529 var _createClass = /* @__PURE__ */ (function() { 60530 function defineProperties(target, props) { 60531 for (var i2 = 0; i2 < props.length; i2++) { 60532 var descriptor = props[i2]; 60533 descriptor.enumerable = descriptor.enumerable || false; 60534 descriptor.configurable = true; 60535 if ("value" in descriptor) descriptor.writable = true; 60536 Object.defineProperty(target, descriptor.key, descriptor); 60537 } 60538 } 60539 return function(Constructor, protoProps, staticProps) { 60540 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60541 if (staticProps) defineProperties(Constructor, staticProps); 60542 return Constructor; 60543 }; 60544 })(); 60545 var _constants = requireConstants$2(); 60546 var _encoder = requireEncoder(); 60547 var _encoder2 = _interopRequireDefault(_encoder); 60548 var _Barcode2 = requireBarcode(); 60549 var _Barcode3 = _interopRequireDefault(_Barcode2); 60550 function _interopRequireDefault(obj) { 60551 return obj && obj.__esModule ? obj : { default: obj }; 60552 } 60553 function _classCallCheck(instance, Constructor) { 60554 if (!(instance instanceof Constructor)) { 60555 throw new TypeError("Cannot call a class as a function"); 60556 } 60557 } 60558 function _possibleConstructorReturn(self, call) { 60559 if (!self) { 60560 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60561 } 60562 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60563 } 60564 function _inherits(subClass, superClass) { 60565 if (typeof superClass !== "function" && superClass !== null) { 60566 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60567 } 60568 subClass.prototype = Object.create(superClass && superClass.prototype, { c
60568onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60569 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60570 } 60571 var checksum = function checksum2(data) { 60572 var result = data.split("").map(function(n2) { 60573 return +n2; 60574 }).reduce(function(sum, a2, idx) { 60575 return idx % 2 ? sum + a2 * 9 : sum + a2 * 3; 60576 }, 0); 60577 return result % 10; 60578 }; 60579 var EAN5$1 = (function(_Barcode) { 60580 _inherits(EAN52, _Barcode); 60581 function EAN52(data, options) { 60582 _classCallCheck(this, EAN52); 60583 return _possibleConstructorReturn(this, (EAN52.__proto__ || Object.getPrototypeOf(EAN52)).call(this, data, options)); 60584 } 60585 _createClass(EAN52, [{ 60586 key: "valid", 60587 value: function valid() { 60588 return this.data.search(/^[0-9]{5}$/) !== -1; 60589 } 60590 }, { 60591 key: "encode", 60592 value: function encode() { 60593 var structure = _constants.EAN5_STRUCTURE[checksum(this.data)]; 60594 return { 60595 data: "1011" + (0, _encoder2.default)(this.data, structure, "01"), 60596 text: this.text 60597 }; 60598 } 60599 }]); 60600 return EAN52; 60601 })(_Barcode3.default); 60602 EAN5.default = EAN5$1; 60603 return EAN5; 60604 } 60605 var EAN2 = {}; 60606 var hasRequiredEAN2; 60607 function requireEAN2() { 60608 if (hasRequiredEAN2) return EAN2; 60609 hasRequiredEAN2 = 1; 60610 Object.defineProperty(EAN2, "__esModule", { 60611 value: true 60612 }); 60613 var _createClass = /* @__PURE__ */ (function() { 60614 function defineProperties(target, props) { 60615 for (var i2 = 0; i2 < props.length; i2++) { 60616 var descriptor = props[i2]; 60617 descriptor.enumerable = descriptor.enumerable || false; 60618 descriptor.configurable = true; 60619 if ("value" in descriptor) descriptor.writable = true; 60620 Object.defineProperty(target, descriptor.key, descriptor); 60621 } 60622 } 60623 return function(Constructor, protoProps, staticProps) { 60624 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60625 if (staticProps) defineProperties(Constructor, staticProps); 60626 return Constructor; 60627 }; 60628 })(); 60629 var _constants = requireConstants$2(); 60630 var _encoder = requireEncoder(); 60631 var _encoder2 = _interopRequireDefault(_encoder); 60632 var _Barcode2 = requireBarcode(); 60633 var _Barcode3 = _interopRequireDefault(_Barcode2); 60634 function _interopRequireDefault(obj) { 60635 return obj && obj.__esModule ? obj : { default: obj }; 60636 } 60637 function _classCallCheck(instance, Constructor) { 60638 if (!(instance instanceof Constructor)) { 60639 throw new TypeError("Cannot call a class as a function"); 60640 } 60641 } 60642 function _possibleConstructorReturn(self, call) { 60643 if (!self) { 60644 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60645 } 60646 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60647 } 60648 function _inherits(subClass, superClass) { 60649 if (typeof superClass !== "function" && superClass !== null) { 60650 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60651 } 60652 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60653 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60654 } 60655 var EAN2$1 = (function(_Barcode) { 60656 _inherits(EAN22, _Barcode); 60657 function EAN22(data, options) { 60658 _classCallCheck(this, EAN22); 60659 return _possibleConstructorReturn(this, (EAN22.__proto__ || Object.getPrototypeOf(EAN22)).call(this, data, options)); 60660 } 60661 _createClass(EAN22, [{ 60662 key: "valid", 60663 value: function valid() { 60664 return this.data.search(/^[0-9]{2}$/) !== -1; 60665 } 60666 }, { 60667 key: "encode", 60668 value: function encode() { 60669 var structure = _constants.EAN2_STRUCTURE[parseInt(this.data) % 4]; 60670 return { 60671 // Start bits + Encode the two digits with 01 in between 60672 data: "1011" + (0, _encoder2.default)(this.data, structure, "01"), 60673 text: this.text 60674 }; 60675 } 60676 }]); 60677 return EAN22; 60678 })(_Barcode3.default); 60679 EAN2.default = EAN2$1; 60680 return EAN2; 60681 } 60682 var UPC = {}; 60683 var hasRequiredUPC; 60684 function requireUPC() { 60685 if (hasRequiredUPC) return UPC; 60686 hasRequiredUPC = 1;
vendor: 12,325 bytes, lines 60687-61011
60687 Object.defineProperty(UPC, "__esModule", { 60688 value: true 60689 }); 60690 var _createClass = /* @__PURE__ */ (function() { 60691 function defineProperties(target, props) { 60692 for (var i2 = 0; i2 < props.length; i2++) { 60693 var descriptor = props[i2]; 60694 descriptor.enumerable = descriptor.enumerable || false; 60695 descriptor.configurable = true; 60696 if ("value" in descriptor) descriptor.writable = true; 60697 Object.defineProperty(target, descriptor.key, descriptor); 60698 } 60699 } 60700 return function(Constructor, protoProps, staticProps) { 60701 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60702 if (staticProps) defineProperties(Constructor, staticProps); 60703 return Constructor; 60704 }; 60705 })(); 60706 UPC.checksum = checksum; 60707 var _encoder = requireEncoder(); 60708 var _encoder2 = _interopRequireDefault(_encoder); 60709 var _Barcode2 = requireBarcode(); 60710 var _Barcode3 = _interopRequireDefault(_Barcode2); 60711 function _interopRequireDefault(obj) { 60712 return obj && obj.__esModule ? obj : { default: obj }; 60713 } 60714 function _classCallCheck(instance, Constructor) { 60715 if (!(instance instanceof Constructor)) { 60716 throw new TypeError("Cannot call a class as a function"); 60717 } 60718 } 60719 function _possibleConstructorReturn(self, call) { 60720 if (!self) { 60721 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60722 } 60723 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60724 } 60725 function _inherits(subClass, superClass) { 60726 if (typeof superClass !== "function" && superClass !== null) { 60727 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60728 } 60729 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60730 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60731 } 60732 var UPC$1 = (function(_Barcode) { 60733 _inherits(UPC2, _Barcode); 60734 function UPC2(data, options) { 60735 _classCallCheck(this, UPC2); 60736 if (data.search(/^[0-9]{11}$/) !== -1) { 60737 data += checksum(data); 60738 } 60739 var _this = _possibleConstructorReturn(this, (UPC2.__proto__ || Object.getPrototypeOf(UPC2)).call(this, data, options)); 60740 _this.displayValue = options.displayValue; 60741 if (options.fontSize > options.width * 10) { 60742 _this.fontSize = options.width * 10; 60743 } else { 60744 _this.fontSize = options.fontSize; 60745 } 60746 _this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin; 60747 return _this; 60748 } 60749 _createClass(UPC2, [{ 60750 key: "valid", 60751 value: function valid() { 60752 return this.data.search(/^[0-9]{12}$/) !== -1 && this.data[11] == checksum(this.data); 60753 } 60754 }, { 60755 key: "encode", 60756 value: function encode() { 60757 if (this.options.flat) { 60758 return this.flatEncoding(); 60759 } else { 60760 return this.guardedEncoding(); 60761 } 60762 } 60763 }, { 60764 key: "flatEncoding", 60765 value: function flatEncoding() { 60766 var result = ""; 60767 result += "101"; 60768 result += (0, _encoder2.default)(this.data.substr(0, 6), "LLLLLL"); 60769 result += "01010"; 60770 result += (0, _encoder2.default)(this.data.substr(6, 6), "RRRRRR"); 60771 result += "101"; 60772 return { 60773 data: result, 60774 text: this.text 60775 }; 60776 } 60777 }, { 60778 key: "guardedEncoding", 60779 value: function guardedEncoding() { 60780 var result = []; 60781 if (this.displayValue) { 60782 result.push({ 60783 data: "00000000", 60784 text: this.text.substr(0, 1), 60785 options: { textAlign: "left", fontSize: this.fontSize } 60786 }); 60787 } 60788 result.push({ 60789 data: "101" + (0, _encoder2.default)(this.data[0], "L"), 60790 options: { height: this.guardHeight } 60791 }); 60792 result.push({ 60793 data: (0, _encoder2.default)(this.data.substr(1, 5), "LLLLL"), 60794 text: this.text.substr(1, 5), 60795 options: { fontSize: this.fontSize } 60796 }); 60797 result.push({ 60798 data: "01010", 60799 options: { height: this.guardHeight } 60800 }); 60801 result.push({ 60802 data: (0, _encoder2.default)(this.data.substr(6, 5), "RRRRR"), 60803 text: this.text.substr(6, 5), 60804 options: { fontSize: this.fontSize } 60805 }); 60806 result.push({ 60807 data: (0, _encoder2.default)(this.data[11], "R") + "101", 60808 options: { height: this.guardHeight } 60809 }); 60810 if (this.displayValue) { 60811 result.push({ 60812 data: "00000000", 60813 text: this.text.substr(11, 1), 60814 options: { textAlign: "right", fontSize: this.fontSize } 60815 }); 60816 } 60817 return result; 60818 } 60819 }]); 60820 return UPC2; 60821 })(_Barcode3.default); 60822 function checksum(number) { 60823 var result = 0; 60824 var i2; 60825 for (i2 = 1; i2 < 11; i2 += 2) { 60826 result += parseInt(number[i2]); 60827 } 60828 for (i2 = 0; i2 < 11; i2 += 2) { 60829 result += parseInt(number[i2]) * 3; 60830 } 60831 return (10 - result % 10) % 10; 60832 } 60833 UPC.default = UPC$1; 60834 return UPC; 60835 } 60836 var UPCE = {}; 60837 var hasRequiredUPCE; 60838 function requireUPCE() { 60839 if (hasRequiredUPCE) return UPCE; 60840 hasRequiredUPCE = 1; 60841 Object.defineProperty(UPCE, "__esModule", { 60842 value: true 60843 }); 60844 var _createClass = /* @__PURE__ */ (function() { 60845 function defineProperties(target, props) { 60846 for (var i2 = 0; i2 < props.length; i2++) { 60847 var descriptor = props[i2]; 60848 descriptor.enumerable = descriptor.enumerable || false; 60849 descriptor.configurable = true; 60850 if ("value" in descriptor) descriptor.writable = true; 60851 Object.defineProperty(target, descriptor.key, descriptor); 60852 } 60853 } 60854 return function(Constructor, protoProps, staticProps) { 60855 if (protoProps) defineProperties(Constructor.prototype, protoProps); 60856 if (staticProps) defineProperties(Constructor, staticProps); 60857 return Constructor; 60858 }; 60859 })(); 60860 var _encoder = requireEncoder(); 60861 var _encoder2 = _interopRequireDefault(_encoder); 60862 var _Barcode2 = requireBarcode(); 60863 var _Barcode3 = _interopRequireDefault(_Barcode2); 60864 var _UPC = requireUPC(); 60865 function _interopRequireDefault(obj) { 60866 return obj && obj.__esModule ? obj : { default: obj }; 60867 } 60868 function _classCallCheck(instance, Constructor) { 60869 if (!(instance instanceof Constructor)) { 60870 throw new TypeError("Cannot call a class as a function"); 60871 } 60872 } 60873 function _possibleConstructorReturn(self, call) { 60874 if (!self) { 60875 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 60876 } 60877 return call && (typeof call === "object" || typeof call === "function") ? call : self; 60878 } 60879 function _inherits(subClass, superClass) { 60880 if (typeof superClass !== "function" && superClass !== null) { 60881 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 60882 } 60883 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 60884 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 60885 } 60886 var EXPANSIONS = ["XX00000XXX", "XX10000XXX", "XX20000XXX", "XXX00000XX", "XXXX00000X", "XXXXX00005", "XXXXX00006", "XXXXX00007", "XXXXX00008", "XXXXX00009"]; 60887 var PARITIES = [["EEEOOO", "OOOEEE"], ["EEOEOO", "OOEOEE"], ["EEOOEO", "OOEEOE"], ["EEOOOE", "OOEEEO"], ["EOEEOO", "OEOOEE"], ["EOOEEO", "OEEOOE"], ["EOOOEE", "OEEEOO"], ["EOEOEO", "OEOEOE"], ["EOEOOE", "OEOEEO"], ["EOOEOE", "OEEOEO"]]; 60888 var UPCE$1 = (function(_Barcode) { 60889 _inherits(UPCE2, _Barcode); 60890 function UPCE2(data, options) { 60891 _classCallCheck(this, UPCE2); 60892 var _this = _possibleConstructorReturn(this, (UPCE2.__proto__ || Object.getPrototypeOf(UPCE2)).call(this, data, options)); 60893 _this.isValid = false; 60894 if (data.search(/^[0-9]{6}$/) !== -1) { 60895 _this.middleDigits = data; 60896 _this.upcA = expandToUPCA(data, "0"); 60897 _this.text = options.text || "" + _this.upcA[0] + data + _this.upcA[_this.upcA.length - 1]; 60898 _this.isValid = true; 60899 } else if (data.search(/^[01][0-9]{7}$/) !== -1) { 60900 _this.middleDigits = data.substring(1, data.length - 1); 60901 _this.upcA = expandToUPCA(_this.middleDigits, data[0]); 60902 if (_this.upcA[_this.upcA.length - 1] === data[data.length - 1]) { 60903 _this.isValid = true; 60904 } else { 60905 return _possibleConstructorReturn(_this); 60906 } 60907 } else { 60908 return _possibleConstructorReturn(_this); 60909 } 60910 _this.displayValue = options.displayValue; 60911 if (options.fontSize > options.width * 10) { 60912 _this.fontSize = options.width * 10; 60913 } else { 60914 _this.fontSize = options.fontSize; 60915 } 60916 _this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin; 60917 return _this; 60918 } 60919 _createClass(UPCE2, [{ 60920 key: "valid", 60921 value: function valid() { 60922 return this.isValid; 60923 } 60924 }, { 60925 key: "encode", 60926 value: function encode() { 60927 if (this.options.flat) { 60928 return this.flatEncoding(); 60929 } else { 60930 return this.guardedEncoding(); 60931 } 60932 } 60933 }, { 60934 key: "flatEncoding", 60935 value: function flatEncoding() { 60936 var result = ""; 60937 result += "101"; 60938 result += this.encodeMiddleDigits(); 60939 result += "010101"; 60940 return { 60941 data: result, 60942 text: this.text 60943 }; 60944 } 60945 }, { 60946 key: "guardedEncoding", 60947 value: function guardedEncoding() { 60948 var result = []; 60949 if (this.displayValue) { 60950 result.push({ 60951 data: "00000000", 60952 text: this.text[0], 60953 options: { textAlign: "left", fontSize: this.fontSize } 60954 }); 60955 } 60956 result.push({ 60957 data: "101", 60958 options: { height: this.guardHeight } 60959 }); 60960 result.push({ 60961 data: this.encodeMiddleDigits(), 60962 text: this.text.substring(1, 7), 60963 options: { fontSize: this.fontSize } 60964 }); 60965 result.push({ 60966 data: "010101", 60967 options: { height: this.guardHeight } 60968 }); 60969 if (this.displayValue) { 60970 result.push({ 60971 data: "00000000", 60972 text: this.text[7], 60973 options: { textAlign: "right", fontSize: this.fontSize } 60974 }); 60975 } 60976 return result; 60977 } 60978 }, { 60979 key: "encodeMiddleDigits", 60980 value: function encodeMiddleDigits() { 60981 var numberSystem = this.upcA[0]; 60982 var checkDigit = this.upcA[this.upcA.length - 1]; 60983 var parity = PARITIES[parseInt(checkDigit)][parseInt(numberSystem)]; 60984 return (0, _encoder2.default)(this.middleDigits, parity); 60985 } 60986 }]); 60987 return UPCE2; 60988 })(_Barcode3.default); 60989 function expandToUPCA(middleDigits, numberSystem) { 60990 var lastUpcE = parseInt(middleDigits[middleDigits.length - 1]); 60991 var expansion = EXPANSIONS[lastUpcE]; 60992 var result = ""; 60993 var digitIndex = 0; 60994 for (var i2 = 0; i2 < expansion.length; i2++) { 60995 var c2 = expansion[i2]; 60996 if (c2 === "X") { 60997 result += middleDigits[digitIndex++]; 60998 } else { 60999 result += c2; 61000 } 61001 } 61002 result = "" + numberSystem + result; 61003 return "" + result + (0, _UPC.checksum)(result); 61004 } 61005 UPCE.default = UPCE$1; 61006 return UPCE; 61007 } 61008 var hasRequiredEAN_UPC; 61009 function requireEAN_UPC() { 61010 if (hasRequiredEAN_UPC) return EAN_UPC; 61011 hasRequiredEAN_UPC = 1;
61012 Object.defineProperty(EAN_UPC, "__esModule", { 61013 value: true 61014 }); 61015 EAN_UPC.UPCE = EAN_UPC.UPC = EAN_UPC.EAN2 = EAN_UPC.EAN5 = EAN_UPC.EAN8 = EAN_UPC.EAN13 = void 0; 61016 var _EAN = requireEAN13(); 61017 var _EAN2 = _interopRequireDefault(_EAN); 61018 var _EAN3 = requireEAN8(); 61019 var _EAN4 = _interopRequireDefault(_EAN3); 61020 var _EAN5 = requireEAN5(); 61021 var _EAN6 = _interopRequireDefault(_EAN5); 61022 var _EAN7 = requireEAN2(); 61023 var _EAN8 = _interopRequireDefault(_EAN7); 61024 var _UPC = requireUPC(); 61025 var _UPC2 = _interopRequireDefault(_UPC); 61026 var _UPCE = requireUPCE(); 61027 var _UPCE2 = _interopRequireDefault(_UPCE); 61028 function _interopRequireDefault(obj) { 61029 return obj && obj.__esModule ? obj : { default: obj }; 61030 } 61031 EAN_UPC.EAN13 = _EAN2.default; 61032 EAN_UPC.EAN8 = _EAN4.default; 61033 EAN_UPC.EAN5 = _EAN6.default; 61034 EAN_UPC.EAN2 = _EAN8.default; 61035 EAN_UPC.UPC = _UPC2.default; 61036 EAN_UPC.UPCE = _UPCE2.default; 61037 return EAN_UPC; 61038 } 61039 var ITF$1 = {}; 61040 var ITF = {}; 61041 var constants$1 = {}; 61042 var hasRequiredConstants$1; 61043 function requireConstants$1() { 61044 if (hasRequiredConstants$1) return constants$1; 61045 hasRequiredConstants$1 = 1; 61046 Object.defineProperty(constants$1, "__esModule", { 61047 value: true 61048 }); 61049 constants$1.START_BIN = "1010"; 61050 constants$1.END_BIN = "11101"; 61051 constants$1.BINARIES = ["00110", "10001", "01001", "11000", "00101", "10100", "01100", "00011", "10010", "01010"]; 61052 return constants$1; 61053 } 61054 var hasRequiredITF$1; 61055 function requireITF$1() { 61056 if (hasRequiredITF$1) return ITF; 61057 hasRequiredITF$1 = 1; 61058 Object.defineProperty(ITF, "__esModule", { 61059 value: true 61060 }); 61061 var _createClass = /* @__PURE__ */ (function() { 61062 function defineProperties(target, props) { 61063 for (var i2 = 0; i2 < props.length; i2++) { 61064 var descriptor = props[i2]; 61065 descriptor.enumerable = descriptor.enumerable || false; 61066 descriptor.configurable = true; 61067 if ("value" in descriptor) descriptor.writable = true; 61068 Object.defineProperty(target, descriptor.key, descriptor); 61069 } 61070 } 61071 return function(Constructor, protoProps, staticProps) { 61072 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61073 if (staticProps) defineProperties(Constructor, staticProps); 61074 return Constructor; 61075 }; 61076 })(); 61077 var _constants = requireConstants$1(); 61078 var _Barcode2 = requireBarcode(); 61079 var _Barcode3 = _interopRequireDefault(_Barcode2); 61080 function _interopRequireDefault(obj) { 61081 return obj && obj.__esModule ? obj : { default: obj }; 61082 } 61083 function _classCallCheck(instance, Constructor) { 61084 if (!(instance instanceof Constructor)) { 61085 throw new TypeError("Cannot call a class as a function"); 61086 } 61087 } 61088 function _possibleConstructorReturn(self, call) { 61089 if (!self) { 61090 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61091 } 61092 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61093 } 61094 function _inherits(subClass, superClass) { 61095 if (typeof superClass !== "function" && superClass !== null) { 61096 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61097 } 61098 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61099 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61100 } 61101 var ITF$12 = (function(_Barcode) { 61102 _inherits(ITF2, _Barcode); 61103 function ITF2() { 61104 _classCallCheck(this, ITF2); 61105 return _possibleConstructorReturn(this, (ITF2.__proto__ || Object.getPrototypeOf(ITF2)).apply(this, arguments)); 61106 } 61107 _createClass(ITF2, [{ 61108 key: "valid", 61109 value: function valid() { 61110 return this.data.search(/^([0-9]{2})+$/) !== -1; 61111 } 61112 }, { 61113 key: "encode", 61114 value: function encode() { 61115 var _this2 = this; 61116 var encoded = this.data.match(/.{2}/g).map(function(pair) { 61117 return _this2.encodePair(pair); 61118 }).join(""); 61119 return { 61120 data: _constants.START_BIN + encoded + _constants.END_BIN, 61121 text: this.text 61122 }; 61123 } 61124 // Calculate the data of a number pair 61125 }, { 61126 key: "encodePair", 61127 value: function encodePair(pair) { 61128 var second = _constants.BINARIES[pair[1]]; 61129 return _constants.BINARIES[pair[0]].split("").map(function(first, idx) { 61130 return (first === "1" ? "111" : "1") + (second[idx] === "1" ? "000" : "0"); 61131 }).join(""); 61132 } 61133 }]); 61134 return ITF2; 61135 })(_Barcode3.default); 61136 ITF.default = ITF$12; 61137 return ITF; 61138 } 61139 var ITF14 = {}; 61140 var hasRequiredITF14; 61141 function requireITF14() { 61142 if (hasRequiredITF14) return ITF14; 61143 hasRequiredITF14 = 1;
61144 Object.defineProperty(ITF14, "__esModule", { 61145 value: true 61146 }); 61147 var _createClass = /* @__PURE__ */ (function() { 61148 function defineProperties(target, props) { 61149 for (var i2 = 0; i2 < props.length; i2++) { 61150 var descriptor = props[i2]; 61151 descriptor.enumerable = descriptor.enumerable || false; 61152 descriptor.configurable = true; 61153 if ("value" in descriptor) descriptor.writable = true; 61154 Object.defineProperty(target, descriptor.key, descriptor); 61155 } 61156 } 61157 return function(Constructor, protoProps, staticProps) { 61158 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61159 if (staticProps) defineProperties(Constructor, staticProps); 61160 return Constructor; 61161 }; 61162 })(); 61163 var _ITF2 = requireITF$1(); 61164 var _ITF3 = _interopRequireDefault(_ITF2); 61165 function _interopRequireDefault(obj) { 61166 return obj && obj.__esModule ? obj : { default: obj }; 61167 } 61168 function _classCallCheck(instance, Constructor) { 61169 if (!(instance instanceof Constructor)) { 61170 throw new TypeError("Cannot call a class as a function"); 61171 } 61172 } 61173 function _possibleConstructorReturn(self, call) { 61174 if (!self) { 61175 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61176 } 61177 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61178 } 61179 function _inherits(subClass, superClass) { 61180 if (typeof superClass !== "function" && superClass !== null) { 61181 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61182 } 61183 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61184 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61185 } 61186 var checksum = function checksum2(data) { 61187 var res = data.substr(0, 13).split("").map(function(num) { 61188 return parseInt(num, 10); 61189 }).reduce(function(sum, n2, idx) { 61190 return sum + n2 * (3 - idx % 2 * 2); 61191 }, 0); 61192 return Math.ceil(res / 10) * 10 - res; 61193 }; 61194 var ITF14$1 = (function(_ITF) { 61195 _inherits(ITF142, _ITF); 61196 function ITF142(data, options) { 61197 _classCallCheck(this, ITF142); 61198 if (data.search(/^[0-9]{13}$/) !== -1) { 61199 data += checksum(data); 61200 } 61201 return _possibleConstructorReturn(this, (ITF142.__proto__ || Object.getPrototypeOf(ITF142)).call(this, data, options)); 61202 } 61203 _createClass(ITF142, [{ 61204 key: "valid", 61205 value: function valid() { 61206 return this.data.search(/^[0-9]{14}$/) !== -1 && +this.data[13] === checksum(this.data); 61207 } 61208 }]); 61209 return ITF142; 61210 })(_ITF3.default); 61211 ITF14.default = ITF14$1; 61212 return ITF14; 61213 } 61214 var hasRequiredITF; 61215 function requireITF() { 61216 if (hasRequiredITF) return ITF$1; 61217 hasRequiredITF = 1; 61218 Object.defineProperty(ITF$1, "__esModule", { 61219 value: true 61220 }); 61221 ITF$1.ITF14 = ITF$1.ITF = void 0; 61222 var _ITF = requireITF$1(); 61223 var _ITF2 = _interopRequireDefault(_ITF); 61224 var _ITF3 = requireITF14(); 61225 var _ITF4 = _interopRequireDefault(_ITF3); 61226 function _interopRequireDefault(obj) { 61227 return obj && obj.__esModule ? obj : { default: obj }; 61228 } 61229 ITF$1.ITF = _ITF2.default; 61230 ITF$1.ITF14 = _ITF4.default; 61231 return ITF$1; 61232 } 61233 var MSI$1 = {}; 61234 var MSI = {}; 61235 var hasRequiredMSI$1; 61236 function requireMSI$1() { 61237 if (hasRequiredMSI$1) return MSI; 61238 hasRequiredMSI$1 = 1; 61239 Object.defineProperty(MSI, "__esModule", { 61240 value: true 61241 }); 61242 var _createClass = /* @__PURE__ */ (function() { 61243 function defineProperties(target, props) { 61244 for (var i2 = 0; i2 < props.length; i2++) { 61245 var descriptor = props[i2]; 61246 descriptor.enumerable = descriptor.enumerable || false; 61247 descriptor.configurable = true; 61248 if ("value" in descriptor) descriptor.writable = true; 61249 Object.defineProperty(target, descriptor.key, descriptor); 61250 } 61251 } 61252 return function(Constructor, protoProps, staticProps) { 61253 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61254 if (staticProps) defineProperties(Constructor, staticProps); 61255 return Constructor; 61256 }; 61257 })(); 61258 var _Barcode2 = requireBarcode(); 61259 var _Barcode3 = _interopRequireDefault(_Barcode2); 61260 function _interopRequireDefault(obj) { 61261 return obj && obj.__esModule ? obj : { default: obj }; 61262 } 61263 function _classCallCheck(instance, Constructor) { 61264 if (!(instance instanceof Constructor)) { 61265 throw new TypeError("Cannot call a class as a function"); 61266 } 61267 } 61268 function _possibleConstructorReturn(self, call) { 61269 if (!self) { 61270 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61271 } 61272 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61273 } 61274 function _inherits(subClass, superClass) { 61275 if (typeof superClass !== "function" && superClass !== null) { 61276 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61277 } 61278 subClass.prototype = Object.create(superClass && superClass.prototype, { c
61278onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61279 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61280 } 61281 var MSI$12 = (function(_Barcode) { 61282 _inherits(MSI2, _Barcode); 61283 function MSI2(data, options) { 61284 _classCallCheck(this, MSI2); 61285 return _possibleConstructorReturn(this, (MSI2.__proto__ || Object.getPrototypeOf(MSI2)).call(this, data, options)); 61286 } 61287 _createClass(MSI2, [{ 61288 key: "encode", 61289 value: function encode() { 61290 var ret = "110"; 61291 for (var i2 = 0; i2 < this.data.length; i2++) { 61292 var digit = parseInt(this.data[i2]); 61293 var bin = digit.toString(2); 61294 bin = addZeroes(bin, 4 - bin.length); 61295 for (var b2 = 0; b2 < bin.length; b2++) { 61296 ret += bin[b2] == "0" ? "100" : "110"; 61297 } 61298 } 61299 ret += "1001"; 61300 return { 61301 data: ret, 61302 text: this.text 61303 }; 61304 } 61305 }, { 61306 key: "valid", 61307 value: function valid() { 61308 return this.data.search(/^[0-9]+$/) !== -1; 61309 } 61310 }]); 61311 return MSI2; 61312 })(_Barcode3.default); 61313 function addZeroes(number, n2) { 61314 for (var i2 = 0; i2 < n2; i2++) { 61315 number = "0" + number; 61316 } 61317 return number; 61318 } 61319 MSI.default = MSI$12; 61320 return MSI; 61321 } 61322 var MSI10 = {}; 61323 var checksums = {}; 61324 var hasRequiredChecksums; 61325 function requireChecksums() { 61326 if (hasRequiredChecksums) return checksums; 61327 hasRequiredChecksums = 1; 61328 Object.defineProperty(checksums, "__esModule", { 61329 value: true 61330 }); 61331 checksums.mod10 = mod10; 61332 checksums.mod11 = mod11; 61333 function mod10(number) { 61334 var sum = 0; 61335 for (var i2 = 0; i2 < number.length; i2++) { 61336 var n2 = parseInt(number[i2]); 61337 if ((i2 + number.length) % 2 === 0) { 61338 sum += n2; 61339 } else { 61340 sum += n2 * 2 % 10 + Math.floor(n2 * 2 / 10); 61341 } 61342 } 61343 return (10 - sum % 10) % 10; 61344 } 61345 function mod11(number) { 61346 var sum = 0; 61347 var weights = [2, 3, 4, 5, 6, 7]; 61348 for (var i2 = 0; i2 < number.length; i2++) { 61349 var n2 = parseInt(number[number.length - 1 - i2]); 61350 sum += weights[i2 % weights.length] * n2; 61351 } 61352 return (11 - sum % 11) % 11; 61353 } 61354 return checksums; 61355 } 61356 var hasRequiredMSI10; 61357 function requireMSI10() { 61358 if (hasRequiredMSI10) return MSI10; 61359 hasRequiredMSI10 = 1; 61360 Object.defineProperty(MSI10, "__esModule", { 61361 value: true 61362 }); 61363 var _MSI2 = requireMSI$1(); 61364 var _MSI3 = _interopRequireDefault(_MSI2); 61365 var _checksums = requireChecksums(); 61366 function _interopRequireDefault(obj) { 61367 return obj && obj.__esModule ? obj : { default: obj }; 61368 } 61369 function _classCallCheck(instance, Constructor) { 61370 if (!(instance instanceof Constructor)) { 61371 throw new TypeError("Cannot call a class as a function"); 61372 } 61373 } 61374 function _possibleConstructorReturn(self, call) { 61375 if (!self) { 61376 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61377 } 61378 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61379 } 61380 function _inherits(subClass, superClass) { 61381 if (typeof superClass !== "function" && superClass !== null) { 61382 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61383 } 61384 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61385 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61386 } 61387 var MSI10$1 = (function(_MSI) { 61388 _inherits(MSI102, _MSI); 61389 function MSI102(data, options) { 61390 _classCallCheck(this, MSI102); 61391 return _possibleConstructorReturn(this, (MSI102.__proto__ || Object.getPrototypeOf(MSI102)).call(this, data + (0, _checksums.mod10)(data), options)); 61392 } 61393 return MSI102; 61394 })(_MSI3.default); 61395 MSI10.default = MSI10$1; 61396 return MSI10; 61397 } 61398 var MSI11 = {}; 61399 var hasRequiredMSI11; 61400 function requireMSI11() { 61401 if (hasRequiredMSI11) return MSI11; 61402 hasRequiredMSI11 = 1;
61403 Object.defineProperty(MSI11, "__esModule", { 61404 value: true 61405 }); 61406 var _MSI2 = requireMSI$1(); 61407 var _MSI3 = _interopRequireDefault(_MSI2); 61408 var _checksums = requireChecksums(); 61409 function _interopRequireDefault(obj) { 61410 return obj && obj.__esModule ? obj : { default: obj }; 61411 } 61412 function _classCallCheck(instance, Constructor) { 61413 if (!(instance instanceof Constructor)) { 61414 throw new TypeError("Cannot call a class as a function"); 61415 } 61416 } 61417 function _possibleConstructorReturn(self, call) { 61418 if (!self) { 61419 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61420 } 61421 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61422 } 61423 function _inherits(subClass, superClass) { 61424 if (typeof superClass !== "function" && superClass !== null) { 61425 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61426 } 61427 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61428 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61429 } 61430 var MSI11$1 = (function(_MSI) { 61431 _inherits(MSI112, _MSI); 61432 function MSI112(data, options) { 61433 _classCallCheck(this, MSI112); 61434 return _possibleConstructorReturn(this, (MSI112.__proto__ || Object.getPrototypeOf(MSI112)).call(this, data + (0, _checksums.mod11)(data), options)); 61435 } 61436 return MSI112; 61437 })(_MSI3.default); 61438 MSI11.default = MSI11$1; 61439 return MSI11; 61440 } 61441 var MSI1010 = {}; 61442 var hasRequiredMSI1010; 61443 function requireMSI1010() { 61444 if (hasRequiredMSI1010) return MSI1010; 61445 hasRequiredMSI1010 = 1; 61446 Object.defineProperty(MSI1010, "__esModule", { 61447 value: true 61448 }); 61449 var _MSI2 = requireMSI$1(); 61450 var _MSI3 = _interopRequireDefault(_MSI2); 61451 var _checksums = requireChecksums(); 61452 function _interopRequireDefault(obj) { 61453 return obj && obj.__esModule ? obj : { default: obj }; 61454 } 61455 function _classCallCheck(instance, Constructor) { 61456 if (!(instance instanceof Constructor)) { 61457 throw new TypeError("Cannot call a class as a function"); 61458 } 61459 } 61460 function _possibleConstructorReturn(self, call) { 61461 if (!self) { 61462 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61463 } 61464 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61465 } 61466 function _inherits(subClass, superClass) { 61467 if (typeof superClass !== "function" && superClass !== null) { 61468 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61469 } 61470 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61471 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61472 } 61473 var MSI1010$1 = (function(_MSI) { 61474 _inherits(MSI10102, _MSI); 61475 function MSI10102(data, options) { 61476 _classCallCheck(this, MSI10102); 61477 data += (0, _checksums.mod10)(data); 61478 data += (0, _checksums.mod10)(data); 61479 return _possibleConstructorReturn(this, (MSI10102.__proto__ || Object.getPrototypeOf(MSI10102)).call(this, data, options)); 61480 } 61481 return MSI10102; 61482 })(_MSI3.default); 61483 MSI1010.default = MSI1010$1; 61484 return MSI1010; 61485 } 61486 var MSI1110 = {}; 61487 var hasRequiredMSI1110; 61488 function requireMSI1110() { 61489 if (hasRequiredMSI1110) return MSI1110; 61490 hasRequiredMSI1110 = 1; 61491 Object.defineProperty(MSI1110, "__esModule", { 61492 value: true 61493 }); 61494 var _MSI2 = requireMSI$1(); 61495 var _MSI3 = _interopRequireDefault(_MSI2); 61496 var _checksums = requireChecksums(); 61497 function _interopRequireDefault(obj) { 61498 return obj && obj.__esModule ? obj : { default: obj }; 61499 } 61500 function _classCallCheck(instance, Constructor) { 61501 if (!(instance instanceof Constructor)) { 61502 throw new TypeError("Cannot call a class as a function"); 61503 } 61504 } 61505 function _possibleConstructorReturn(self, call) { 61506 if (!self) { 61507 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61508 } 61509 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61510 } 61511 function _inherits(subClass, superClass) { 61512 if (typeof superClass !== "function" && superClass !== null) { 61513 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61514 } 61515 subClass.prototype = Object.create(superClass && superClass.prototype, { c
61515onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61516 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61517 } 61518 var MSI1110$1 = (function(_MSI) { 61519 _inherits(MSI11102, _MSI); 61520 function MSI11102(data, options) { 61521 _classCallCheck(this, MSI11102); 61522 data += (0, _checksums.mod11)(data); 61523 data += (0, _checksums.mod10)(data); 61524 return _possibleConstructorReturn(this, (MSI11102.__proto__ || Object.getPrototypeOf(MSI11102)).call(this, data, options)); 61525 } 61526 return MSI11102; 61527 })(_MSI3.default); 61528 MSI1110.default = MSI1110$1; 61529 return MSI1110; 61530 } 61531 var hasRequiredMSI; 61532 function requireMSI() { 61533 if (hasRequiredMSI) return MSI$1; 61534 hasRequiredMSI = 1; 61535 Object.defineProperty(MSI$1, "__esModule", { 61536 value: true 61537 }); 61538 MSI$1.MSI1110 = MSI$1.MSI1010 = MSI$1.MSI11 = MSI$1.MSI10 = MSI$1.MSI = void 0; 61539 var _MSI = requireMSI$1(); 61540 var _MSI2 = _interopRequireDefault(_MSI); 61541 var _MSI3 = requireMSI10(); 61542 var _MSI4 = _interopRequireDefault(_MSI3); 61543 var _MSI5 = requireMSI11(); 61544 var _MSI6 = _interopRequireDefault(_MSI5); 61545 var _MSI7 = requireMSI1010(); 61546 var _MSI8 = _interopRequireDefault(_MSI7); 61547 var _MSI9 = requireMSI1110(); 61548 var _MSI10 = _interopRequireDefault(_MSI9); 61549 function _interopRequireDefault(obj) { 61550 return obj && obj.__esModule ? obj : { default: obj }; 61551 } 61552 MSI$1.MSI = _MSI2.default; 61553 MSI$1.MSI10 = _MSI4.default; 61554 MSI$1.MSI11 = _MSI6.default; 61555 MSI$1.MSI1010 = _MSI8.default; 61556 MSI$1.MSI1110 = _MSI10.default; 61557 return MSI$1; 61558 } 61559 var pharmacode = {}; 61560 var hasRequiredPharmacode; 61561 function requirePharmacode() { 61562 if (hasRequiredPharmacode) return pharmacode; 61563 hasRequiredPharmacode = 1; 61564 Object.defineProperty(pharmacode, "__esModule", { 61565 value: true 61566 }); 61567 pharmacode.pharmacode = void 0; 61568 var _createClass = /* @__PURE__ */ (function() { 61569 function defineProperties(target, props) { 61570 for (var i2 = 0; i2 < props.length; i2++) { 61571 var descriptor = props[i2]; 61572 descriptor.enumerable = descriptor.enumerable || false; 61573 descriptor.configurable = true; 61574 if ("value" in descriptor) descriptor.writable = true; 61575 Object.defineProperty(target, descriptor.key, descriptor); 61576 } 61577 } 61578 return function(Constructor, protoProps, staticProps) { 61579 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61580 if (staticProps) defineProperties(Constructor, staticProps); 61581 return Constructor; 61582 }; 61583 })(); 61584 var _Barcode2 = requireBarcode(); 61585 var _Barcode3 = _interopRequireDefault(_Barcode2); 61586 function _interopRequireDefault(obj) { 61587 return obj && obj.__esModule ? obj : { default: obj }; 61588 } 61589 function _classCallCheck(instance, Constructor) { 61590 if (!(instance instanceof Constructor)) { 61591 throw new TypeError("Cannot call a class as a function"); 61592 } 61593 } 61594 function _possibleConstructorReturn(self, call) { 61595 if (!self) { 61596 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61597 } 61598 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61599 } 61600 function _inherits(subClass, superClass) { 61601 if (typeof superClass !== "function" && superClass !== null) { 61602 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61603 } 61604 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61605 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61606 } 61607 var pharmacode$1 = (function(_Barcode) { 61608 _inherits(pharmacode2, _Barcode); 61609 function pharmacode2(data, options) { 61610 _classCallCheck(this, pharmacode2); 61611 var _this = _possibleConstructorReturn(this, (pharmacode2.__proto__ || Object.getPrototypeOf(pharmacode2)).call(this, data, options)); 61612 _this.number = parseInt(data, 10); 61613 return _this; 61614 } 61615 _createClass(pharmacode2, [{ 61616 key: "encode", 61617 value: function encode() { 61618 var z2 = this.number; 61619 var result = ""; 61620 while (!isNaN(z2) && z2 != 0) { 61621 if (z2 % 2 === 0) { 61622 result = "11100" + result; 61623 z2 = (z2 - 2) / 2; 61624 } else { 61625 result = "100" + result; 61626 z2 = (z2 - 1) / 2; 61627 } 61628 } 61629 result = result.slice(0, -2); 61630 return { 61631 data: result, 61632 text: this.text 61633 }; 61634 } 61635 }, { 61636 key: "valid", 61637 value: function valid() { 61638 return this.number >= 3 && this.number <= 131070; 61639 } 61640 }]); 61641 return pharmacode2; 61642 })(_Barcode3.default); 61643 pharmacode.pharmacode = pharmacode$1; 61644 return pharmacode; 61645 } 61646 var codabar = {}; 61647 var hasRequiredCodabar; 61648 function requireCodabar() { 61649 if (hasRequiredCodabar) return codabar; 61650 hasRequiredCodabar = 1;
61651 Object.defineProperty(codabar, "__esModule", { 61652 value: true 61653 }); 61654 codabar.codabar = void 0; 61655 var _createClass = /* @__PURE__ */ (function() { 61656 function defineProperties(target, props) { 61657 for (var i2 = 0; i2 < props.length; i2++) { 61658 var descriptor = props[i2]; 61659 descriptor.enumerable = descriptor.enumerable || false; 61660 descriptor.configurable = true; 61661 if ("value" in descriptor) descriptor.writable = true; 61662 Object.defineProperty(target, descriptor.key, descriptor); 61663 } 61664 } 61665 return function(Constructor, protoProps, staticProps) { 61666 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61667 if (staticProps) defineProperties(Constructor, staticProps); 61668 return Constructor; 61669 }; 61670 })(); 61671 var _Barcode2 = requireBarcode(); 61672 var _Barcode3 = _interopRequireDefault(_Barcode2); 61673 function _interopRequireDefault(obj) { 61674 return obj && obj.__esModule ? obj : { default: obj }; 61675 } 61676 function _classCallCheck(instance, Constructor) { 61677 if (!(instance instanceof Constructor)) { 61678 throw new TypeError("Cannot call a class as a function"); 61679 } 61680 } 61681 function _possibleConstructorReturn(self, call) { 61682 if (!self) { 61683 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61684 } 61685 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61686 } 61687 function _inherits(subClass, superClass) { 61688 if (typeof superClass !== "function" && superClass !== null) { 61689 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61690 } 61691 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61692 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61693 } 61694 var codabar$1 = (function(_Barcode) { 61695 _inherits(codabar2, _Barcode); 61696 function codabar2(data, options) { 61697 _classCallCheck(this, codabar2); 61698 if (data.search(/^[0-9\-\$\:\.\+\/]+$/) === 0) { 61699 data = "A" + data + "A"; 61700 } 61701 var _this = _possibleConstructorReturn(this, (codabar2.__proto__ || Object.getPrototypeOf(codabar2)).call(this, data.toUpperCase(), options)); 61702 _this.text = _this.options.text || _this.text.replace(/[A-D]/g, ""); 61703 return _this; 61704 } 61705 _createClass(codabar2, [{ 61706 key: "valid", 61707 value: function valid() { 61708 return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/) !== -1; 61709 } 61710 }, { 61711 key: "encode", 61712 value: function encode() { 61713 var result = []; 61714 var encodings = this.getEncodings(); 61715 for (var i2 = 0; i2 < this.data.length; i2++) { 61716 result.push(encodings[this.data.charAt(i2)]); 61717 if (i2 !== this.data.length - 1) { 61718 result.push("0"); 61719 } 61720 } 61721 return { 61722 text: this.text, 61723 data: result.join("") 61724 }; 61725 } 61726 }, { 61727 key: "getEncodings", 61728 value: function getEncodings() { 61729 return { 61730 "0": "101010011", 61731 "1": "101011001", 61732 "2": "101001011", 61733 "3": "110010101", 61734 "4": "101101001", 61735 "5": "110101001", 61736 "6": "100101011", 61737 "7": "100101101", 61738 "8": "100110101", 61739 "9": "110100101", 61740 "-": "101001101", 61741 "$": "101100101", 61742 ":": "1101011011", 61743 "/": "1101101011", 61744 ".": "1101101101", 61745 "+": "1011011011", 61746 "A": "1011001001", 61747 "B": "1001001011", 61748 "C": "1010010011", 61749 "D": "1010011001" 61750 }; 61751 } 61752 }]); 61753 return codabar2; 61754 })(_Barcode3.default); 61755 codabar.codabar = codabar$1; 61756 return codabar; 61757 } 61758 var CODE93$1 = {}; 61759 var CODE93 = {}; 61760 var constants = {}; 61761 var hasRequiredConstants; 61762 function requireConstants() { 61763 if (hasRequiredConstants) return constants; 61764 hasRequiredConstants = 1;
61765 Object.defineProperty(constants, "__esModule", { 61766 value: true 61767 }); 61768 constants.SYMBOLS = [ 61769 "0", 61770 "1", 61771 "2", 61772 "3", 61773 "4", 61774 "5", 61775 "6", 61776 "7", 61777 "8", 61778 "9", 61779 "A", 61780 "B", 61781 "C", 61782 "D", 61783 "E", 61784 "F", 61785 "G", 61786 "H", 61787 "I", 61788 "J", 61789 "K", 61790 "L", 61791 "M", 61792 "N", 61793 "O", 61794 "P", 61795 "Q", 61796 "R", 61797 "S", 61798 "T", 61799 "U", 61800 "V", 61801 "W", 61802 "X", 61803 "Y", 61804 "Z", 61805 "-", 61806 ".", 61807 " ", 61808 "$", 61809 "/", 61810 "+", 61811 "%", 61812 // Only used for csum and multi-symbols character encodings 61813 "($)", 61814 "(%)", 61815 "(/)", 61816 "(+)", 61817 // Start/Stop 61818 "ÿ" 61819 ]; 61820 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"]; 61821 constants.MULTI_SYMBOLS = { 61822 "\0": ["(%)", "U"], 61823 "�": ["($)", "A"], 61824 "�": ["($)", "B"], 61825 "�": ["($)", "C"], 61826 "�": ["($)", "D"], 61827 "�": ["($)", "E"], 61828 "�": ["($)", "F"], 61829 "\x07": ["($)", "G"], 61830 "\b": ["($)", "H"], 61831 " ": ["($)", "I"], 61832 "\n": ["($)", "J"], 61833 "\v": ["($)", "K"], 61834 "\f": ["($)", "L"], 61835 "\r": ["($)", "M"], 61836 "�": ["($)", "N"], 61837 "�": ["($)", "O"], 61838 "�": ["($)", "P"], 61839 "�": ["($)", "Q"], 61840 "�": ["($)", "R"], 61841 "�": ["($)", "S"], 61842 "�": ["($)", "T"], 61843 "�": ["($)", "U"], 61844 "�": ["($)", "V"], 61845 "�": ["($)", "W"], 61846 "�": ["($)", "X"], 61847 "�": ["($)", "Y"], 61848 "�": ["($)", "Z"], 61849 "\x1B": ["(%)", "A"], 61850 "�": ["(%)", "B"], 61851 "�": ["(%)", "C"], 61852 "�": ["(%)", "D"], 61853 "�": ["(%)", "E"], 61854 "!": ["(/)", "A"], 61855 '"': ["(/)", "B"], 61856 "#": ["(/)", "C"], 61857 "&": ["(/)", "F"], 61858 "'": ["(/)", "G"], 61859 "(": ["(/)", "H"], 61860 ")": ["(/)", "I"], 61861 "*": ["(/)", "J"], 61862 ",": ["(/)", "L"], 61863 ":": ["(/)", "Z"], 61864 ";": ["(%)", "F"], 61865 "<": ["(%)", "G"], 61866 "=": ["(%)", "H"], 61867 ">": ["(%)", "I"], 61868 "?": ["(%)", "J"], 61869 "@": ["(%)", "V"], 61870 "[": ["(%)", "K"], 61871 "\\": ["(%)", "L"], 61872 "]": ["(%)", "M"], 61873 "^": ["(%)", "N"], 61874 "_": ["(%)", "O"], 61875 "`": ["(%)", "W"], 61876 "a": ["(+)", "A"], 61877 "b": ["(+)", "B"], 61878 "c": ["(+)", "C"], 61879 "d": ["(+)", "D"], 61880 "e": ["(+)", "E"], 61881 "f": ["(+)", "F"], 61882 "g": ["(+)", "G"], 61883 "h": ["(+)", "H"], 61884 "i": ["(+)", "I"], 61885 "j": ["(+)", "J"], 61886 "k": ["(+)", "K"], 61887 "l": ["(+)", "L"], 61888 "m": ["(+)", "M"], 61889 "n": ["(+)", "N"], 61890 "o": ["(+)", "O"], 61891 "p": ["(+)", "P"], 61892 "q": ["(+)", "Q"], 61893 "r": ["(+)", "R"], 61894 "s": ["(+)", "S"], 61895 "t": ["(+)", "T"], 61896 "u": ["(+)", "U"], 61897 "v": ["(+)", "V"], 61898 "w": ["(+)", "W"], 61899 "x": ["(+)", "X"], 61900 "y": ["(+)", "Y"], 61901 "z": ["(+)", "Z"], 61902 "{": ["(%)", "P"], 61903 "|": ["(%)", "Q"], 61904 "}": ["(%)", "R"], 61905 "~": ["(%)", "S"], 61906 "�": ["(%)", "T"] 61907 }; 61908 return constants; 61909 } 61910 var hasRequiredCODE93$1; 61911 function requireCODE93$1() { 61912 if (hasRequiredCODE93$1) return CODE93; 61913 hasRequiredCODE93$1 = 1; 61914 Object.defineProperty(CODE93, "__esModule", { 61915 value: true 61916 }); 61917 var _createClass = /* @__PURE__ */ (function() { 61918 function defineProperties(target, props) { 61919 for (var i2 = 0; i2 < props.length; i2++) { 61920 var descriptor = props[i2]; 61921 descriptor.enumerable = descriptor.enumerable || false; 61922 descriptor.configurable = true; 61923 if ("value" in descriptor) descriptor.writable = true; 61924 Object.defineProperty(target, descriptor.key, descriptor); 61925 } 61926 } 61927 return function(Constructor, protoProps, staticProps) { 61928 if (protoProps) defineProperties(Constructor.prototype, protoProps); 61929 if (staticProps) defineProperties(Constructor, staticProps); 61930 return Constructor; 61931 }; 61932 })(); 61933 var _constants = requireConstants(); 61934 var _Barcode2 = requireBarcode(); 61935 var _Barcode3 = _interopRequireDefault(_Barcode2); 61936 function _interopRequireDefault(obj) { 61937 return obj && obj.__esModule ? obj : { default: obj }; 61938 } 61939 function _classCallCheck(instance, Constructor) { 61940 if (!(instance instanceof Constructor)) { 61941 throw new TypeError("Cannot call a class as a function"); 61942 } 61943 } 61944 function _possibleConstructorReturn(self, call) { 61945 if (!self) { 61946 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 61947 } 61948 return call && (typeof call === "object" || typeof call === "function") ? call : self; 61949 } 61950 function _inherits(subClass, superClass) { 61951 if (typeof superClass !== "function" && superClass !== null) { 61952 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 61953 } 61954 subClass.prototype = Object.create(superClass && superClass.prototype, { c
61954onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 61955 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 61956 } 61957 var CODE93$12 = (function(_Barcode) { 61958 _inherits(CODE932, _Barcode); 61959 function CODE932(data, options) { 61960 _classCallCheck(this, CODE932); 61961 return _possibleConstructorReturn(this, (CODE932.__proto__ || Object.getPrototypeOf(CODE932)).call(this, data, options)); 61962 } 61963 _createClass(CODE932, [{ 61964 key: "valid", 61965 value: function valid() { 61966 return /^[0-9A-Z\-. $/+%]+$/.test(this.data); 61967 } 61968 }, { 61969 key: "encode", 61970 value: function encode() { 61971 var symbols = this.data.split("").flatMap(function(c2) { 61972 return _constants.MULTI_SYMBOLS[c2] || c2; 61973 }); 61974 var encoded = symbols.map(function(s2) { 61975 return CODE932.getEncoding(s2); 61976 }).join(""); 61977 var csumC = CODE932.checksum(symbols, 20); 61978 var csumK = CODE932.checksum(symbols.concat(csumC), 15); 61979 return { 61980 text: this.text, 61981 data: ( 61982 // Add the start bits 61983 CODE932.getEncoding("ÿ") + // Add the encoded bits 61984 encoded + // Add the checksum 61985 CODE932.getEncoding(csumC) + CODE932.getEncoding(csumK) + // Add the stop bits 61986 CODE932.getEncoding("ÿ") + // Add the termination bit 61987 "1" 61988 ) 61989 }; 61990 } 61991 // Get the binary encoding of a symbol 61992 }], [{ 61993 key: "getEncoding", 61994 value: function getEncoding(symbol) { 61995 return _constants.BINARIES[CODE932.symbolValue(symbol)]; 61996 } 61997 // Get the symbol for a symbol value 61998 }, { 61999 key: "getSymbol", 62000 value: function getSymbol(symbolValue) { 62001 return _constants.SYMBOLS[symbolValue]; 62002 } 62003 // Get the symbol value of a symbol 62004 }, { 62005 key: "symbolValue", 62006 value: function symbolValue(symbol) { 62007 return _constants.SYMBOLS.indexOf(symbol); 62008 } 62009 // Calculate a checksum symbol 62010 }, { 62011 key: "checksum", 62012 value: function checksum(symbols, maxWeight) { 62013 var csum = symbols.slice().reverse().reduce(function(sum, symbol, idx) { 62014 var weight = idx % maxWeight + 1; 62015 return sum + CODE932.symbolValue(symbol) * weight; 62016 }, 0); 62017 return CODE932.getSymbol(csum % 47); 62018 } 62019 }]); 62020 return CODE932; 62021 })(_Barcode3.default); 62022 CODE93.default = CODE93$12; 62023 return CODE93; 62024 } 62025 var CODE93FullASCII = {}; 62026 var hasRequiredCODE93FullASCII; 62027 function requireCODE93FullASCII() { 62028 if (hasRequiredCODE93FullASCII) return CODE93FullASCII; 62029 hasRequiredCODE93FullASCII = 1; 62030 Object.defineProperty(CODE93FullASCII, "__esModule", { 62031 value: true 62032 }); 62033 var _createClass = /* @__PURE__ */ (function() { 62034 function defineProperties(target, props) { 62035 for (var i2 = 0; i2 < props.length; i2++) { 62036 var descriptor = props[i2]; 62037 descriptor.enumerable = descriptor.enumerable || false; 62038 descriptor.configurable = true; 62039 if ("value" in descriptor) descriptor.writable = true; 62040 Object.defineProperty(target, descriptor.key, descriptor); 62041 } 62042 } 62043 return function(Constructor, protoProps, staticProps) { 62044 if (protoProps) defineProperties(Constructor.prototype, protoProps); 62045 if (staticProps) defineProperties(Constructor, staticProps); 62046 return Constructor; 62047 }; 62048 })(); 62049 var _CODE2 = requireCODE93$1(); 62050 var _CODE3 = _interopRequireDefault(_CODE2); 62051 function _interopRequireDefault(obj) { 62052 return obj && obj.__esModule ? obj : { default: obj }; 62053 } 62054 function _classCallCheck(instance, Constructor) { 62055 if (!(instance instanceof Constructor)) { 62056 throw new TypeError("Cannot call a class as a function"); 62057 } 62058 } 62059 function _possibleConstructorReturn(self, call) { 62060 if (!self) { 62061 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 62062 } 62063 return call && (typeof call === "object" || typeof call === "function") ? call : self; 62064 } 62065 function _inherits(subClass, superClass) { 62066 if (typeof superClass !== "function" && superClass !== null) { 62067 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 62068 } 62069 subClass.prototype = Object.create(superClass && superClass.prototype, { c
62069onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 62070 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 62071 } 62072 var CODE93FullASCII$1 = (function(_CODE) { 62073 _inherits(CODE93FullASCII2, _CODE); 62074 function CODE93FullASCII2(data, options) { 62075 _classCallCheck(this, CODE93FullASCII2); 62076 return _possibleConstructorReturn(this, (CODE93FullASCII2.__proto__ || Object.getPrototypeOf(CODE93FullASCII2)).call(this, data, options)); 62077 } 62078 _createClass(CODE93FullASCII2, [{ 62079 key: "valid", 62080 value: function valid() { 62081 return /^[\x00-\x7f]+$/.test(this.data); 62082 } 62083 }]); 62084 return CODE93FullASCII2; 62085 })(_CODE3.default); 62086 CODE93FullASCII.default = CODE93FullASCII$1; 62087 return CODE93FullASCII; 62088 } 62089 var hasRequiredCODE93; 62090 function requireCODE93() { 62091 if (hasRequiredCODE93) return CODE93$1; 62092 hasRequiredCODE93 = 1; 62093 Object.defineProperty(CODE93$1, "__esModule", { 62094 value: true 62095 }); 62096 CODE93$1.CODE93FullASCII = CODE93$1.CODE93 = void 0; 62097 var _CODE = requireCODE93$1(); 62098 var _CODE2 = _interopRequireDefault(_CODE); 62099 var _CODE93FullASCII = requireCODE93FullASCII(); 62100 var _CODE93FullASCII2 = _interopRequireDefault(_CODE93FullASCII); 62101 function _interopRequireDefault(obj) { 62102 return obj && obj.__esModule ? obj : { default: obj }; 62103 } 62104 CODE93$1.CODE93 = _CODE2.default; 62105 CODE93$1.CODE93FullASCII = _CODE93FullASCII2.default; 62106 return CODE93$1; 62107 } 62108 var GenericBarcode = {}; 62109 var hasRequiredGenericBarcode; 62110 function requireGenericBarcode() { 62111 if (hasRequiredGenericBarcode) return GenericBarcode; 62112 hasRequiredGenericBarcode = 1; 62113 Object.defineProperty(GenericBarcode, "__esModule", { 62114 value: true 62115 }); 62116 GenericBarcode.GenericBarcode = void 0; 62117 var _createClass = /* @__PURE__ */ (function() { 62118 function defineProperties(target, props) { 62119 for (var i2 = 0; i2 < props.length; i2++) { 62120 var descriptor = props[i2]; 62121 descriptor.enumerable = descriptor.enumerable || false; 62122 descriptor.configurable = true; 62123 if ("value" in descriptor) descriptor.writable = true; 62124 Object.defineProperty(target, descriptor.key, descriptor); 62125 } 62126 } 62127 return function(Constructor, protoProps, staticProps) { 62128 if (protoProps) defineProperties(Constructor.prototype, protoProps); 62129 if (staticProps) defineProperties(Constructor, staticProps); 62130 return Constructor; 62131 }; 62132 })(); 62133 var _Barcode2 = requireBarcode(); 62134 var _Barcode3 = _interopRequireDefault(_Barcode2); 62135 function _interopRequireDefault(obj) { 62136 return obj && obj.__esModule ? obj : { default: obj }; 62137 } 62138 function _classCallCheck(instance, Constructor) { 62139 if (!(instance instanceof Constructor)) { 62140 throw new TypeError("Cannot call a class as a function"); 62141 } 62142 } 62143 function _possibleConstructorReturn(self, call) { 62144 if (!self) { 62145 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 62146 } 62147 return call && (typeof call === "object" || typeof call === "function") ? call : self; 62148 } 62149 function _inherits(subClass, superClass) { 62150 if (typeof superClass !== "function" && superClass !== null) { 62151 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 62152 } 62153 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 62154 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 62155 } 62156 var GenericBarcode$1 = (function(_Barcode) { 62157 _inherits(GenericBarcode2, _Barcode); 62158 function GenericBarcode2(data, options) { 62159 _classCallCheck(this, GenericBarcode2); 62160 return _possibleConstructorReturn(this, (GenericBarcode2.__proto__ || Object.getPrototypeOf(GenericBarcode2)).call(this, data, options)); 62161 } 62162 _createClass(GenericBarcode2, [{ 62163 key: "encode", 62164 value: function encode() { 62165 return { 62166 data: "10101010101010101010101010101010101010101", 62167 text: this.text 62168 }; 62169 } 62170 // Resturn true/false if the string provided is valid for this encoder 62171 }, { 62172 key: "valid", 62173 value: function valid() { 62174 return true; 62175 } 62176 }]); 62177 return GenericBarcode2; 62178 })(_Barcode3.default); 62179 GenericBarcode.GenericBarcode = GenericBarcode$1; 62180 return GenericBarcode; 62181 } 62182 var hasRequiredBarcodes; 62183 function requireBarcodes() { 62184 if (hasRequiredBarcodes) return barcodes; 62185 hasRequiredBarcodes = 1;
62186 Object.defineProperty(barcodes, "__esModule", { 62187 value: true 62188 }); 62189 var _CODE = requireCODE39(); 62190 var _CODE2 = requireCODE128(); 62191 var _EAN_UPC = requireEAN_UPC(); 62192 var _ITF = requireITF(); 62193 var _MSI = requireMSI(); 62194 var _pharmacode = requirePharmacode(); 62195 var _codabar = requireCodabar(); 62196 var _CODE3 = requireCODE93(); 62197 var _GenericBarcode = requireGenericBarcode(); 62198 barcodes.default = { 62199 CODE39: _CODE.CODE39, 62200 CODE128: _CODE2.CODE128, 62201 CODE128A: _CODE2.CODE128A, 62202 CODE128B: _CODE2.CODE128B, 62203 CODE128C: _CODE2.CODE128C, 62204 EAN13: _EAN_UPC.EAN13, 62205 EAN8: _EAN_UPC.EAN8, 62206 EAN5: _EAN_UPC.EAN5, 62207 EAN2: _EAN_UPC.EAN2, 62208 UPC: _EAN_UPC.UPC, 62209 UPCE: _EAN_UPC.UPCE, 62210 ITF14: _ITF.ITF14, 62211 ITF: _ITF.ITF, 62212 MSI: _MSI.MSI, 62213 MSI10: _MSI.MSI10, 62214 MSI11: _MSI.MSI11, 62215 MSI1010: _MSI.MSI1010, 62216 MSI1110: _MSI.MSI1110, 62217 pharmacode: _pharmacode.pharmacode, 62218 codabar: _codabar.codabar, 62219 CODE93: _CODE3.CODE93, 62220 CODE93FullASCII: _CODE3.CODE93FullASCII, 62221 GenericBarcode: _GenericBarcode.GenericBarcode 62222 }; 62223 return barcodes; 62224 } 62225 var merge = {}; 62226 var hasRequiredMerge; 62227 function requireMerge() { 62228 if (hasRequiredMerge) return merge; 62229 hasRequiredMerge = 1; 62230 Object.defineProperty(merge, "__esModule", { 62231 value: true 62232 }); 62233 var _extends = Object.assign || function(target) { 62234 for (var i2 = 1; i2 < arguments.length; i2++) { 62235 var source = arguments[i2]; 62236 for (var key in source) { 62237 if (Object.prototype.hasOwnProperty.call(source, key)) { 62238 target[key] = source[key]; 62239 } 62240 } 62241 } 62242 return target; 62243 }; 62244 merge.default = function(old, replaceObj) { 62245 return _extends({}, old, replaceObj); 62246 }; 62247 return merge; 62248 } 62249 var linearizeEncodings = {}; 62250 var hasRequiredLinearizeEncodings; 62251 function requireLinearizeEncodings() { 62252 if (hasRequiredLinearizeEncodings) return linearizeEncodings; 62253 hasRequiredLinearizeEncodings = 1; 62254 Object.defineProperty(linearizeEncodings, "__esModule", { 62255 value: true 62256 }); 62257 linearizeEncodings.default = linearizeEncodings$1; 62258 function linearizeEncodings$1(encodings) { 62259 var linearEncodings = []; 62260 function nextLevel(encoded) { 62261 if (Array.isArray(encoded)) { 62262 for (var i2 = 0; i2 < encoded.length; i2++) { 62263 nextLevel(encoded[i2]); 62264 } 62265 } else { 62266 encoded.text = encoded.text || ""; 62267 encoded.data = encoded.data || ""; 62268 linearEncodings.push(encoded); 62269 } 62270 } 62271 nextLevel(encodings); 62272 return linearEncodings; 62273 } 62274 return linearizeEncodings; 62275 } 62276 var fixOptions = {}; 62277 var hasRequiredFixOptions; 62278 function requireFixOptions() { 62279 if (hasRequiredFixOptions) return fixOptions; 62280 hasRequiredFixOptions = 1; 62281 Object.defineProperty(fixOptions, "__esModule", { 62282 value: true 62283 }); 62284 fixOptions.default = fixOptions$1; 62285 function fixOptions$1(options) { 62286 options.marginTop = options.marginTop || options.margin; 62287 options.marginBottom = options.marginBottom || options.margin; 62288 options.marginRight = options.marginRight || options.margin; 62289 options.marginLeft = options.marginLeft || options.margin; 62290 return options; 62291 } 62292 return fixOptions; 62293 } 62294 var getRenderProperties = {}; 62295 var getOptionsFromElement = {}; 62296 var optionsFromStrings = {}; 62297 var hasRequiredOptionsFromStrings; 62298 function requireOptionsFromStrings() { 62299 if (hasRequiredOptionsFromStrings) return optionsFromStrings; 62300 hasRequiredOptionsFromStrings = 1; 62301 Object.defineProperty(optionsFromStrings, "__esModule", { 62302 value: true 62303 }); 62304 optionsFromStrings.default = optionsFromStrings$1; 62305 function optionsFromStrings$1(options) { 62306 var intOptions = ["width", "height", "textMargin", "fontSize", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight"]; 62307 for (var intOption in intOptions) { 62308 if (intOptions.hasOwnProperty(intOption)) { 62309 intOption = intOptions[intOption]; 62310 if (typeof options[intOption] === "string") { 62311 options[intOption] = parseInt(options[intOption], 10); 62312 } 62313 } 62314 } 62315 if (typeof options["displayValue"] === "string") { 62316 options["displayValue"] = options["displayValue"] != "false"; 62317 } 62318 return options; 62319 } 62320 return optionsFromStrings; 62321 } 62322 var defaults = {}; 62323 var hasRequiredDefaults; 62324 function requireDefaults() { 62325 if (hasRequiredDefaults) return defaults; 62326 hasRequiredDefaults = 1;
62327 Object.defineProperty(defaults, "__esModule", { 62328 value: true 62329 }); 62330 var defaults$1 = { 62331 width: 2, 62332 height: 100, 62333 format: "auto", 62334 displayValue: true, 62335 fontOptions: "", 62336 font: "monospace", 62337 text: void 0, 62338 textAlign: "center", 62339 textPosition: "bottom", 62340 textMargin: 2, 62341 fontSize: 20, 62342 background: "#ffffff", 62343 lineColor: "#000000", 62344 margin: 10, 62345 marginTop: void 0, 62346 marginBottom: void 0, 62347 marginLeft: void 0, 62348 marginRight: void 0, 62349 valid: function valid() { 62350 } 62351 }; 62352 defaults.default = defaults$1; 62353 return defaults; 62354 } 62355 var hasRequiredGetOptionsFromElement; 62356 function requireGetOptionsFromElement() { 62357 if (hasRequiredGetOptionsFromElement) return getOptionsFromElement; 62358 hasRequiredGetOptionsFromElement = 1; 62359 Object.defineProperty(getOptionsFromElement, "__esModule", { 62360 value: true 62361 }); 62362 var _optionsFromStrings = requireOptionsFromStrings(); 62363 var _optionsFromStrings2 = _interopRequireDefault(_optionsFromStrings); 62364 var _defaults = requireDefaults(); 62365 var _defaults2 = _interopRequireDefault(_defaults); 62366 function _interopRequireDefault(obj) { 62367 return obj && obj.__esModule ? obj : { default: obj }; 62368 } 62369 function getOptionsFromElement$1(element) { 62370 var options = {}; 62371 for (var property2 in _defaults2.default) { 62372 if (_defaults2.default.hasOwnProperty(property2)) { 62373 if (element.hasAttribute("jsbarcode-" + property2.toLowerCase())) { 62374 options[property2] = element.getAttribute("jsbarcode-" + property2.toLowerCase()); 62375 } 62376 if (element.hasAttribute("data-" + property2.toLowerCase())) { 62377 options[property2] = element.getAttribute("data-" + property2.toLowerCase()); 62378 } 62379 } 62380 } 62381 options["value"] = element.getAttribute("jsbarcode-value") || element.getAttribute("data-value"); 62382 options = (0, _optionsFromStrings2.default)(options); 62383 return options; 62384 } 62385 getOptionsFromElement.default = getOptionsFromElement$1; 62386 return getOptionsFromElement; 62387 } 62388 var renderers = {}; 62389 var canvas$1 = {}; 62390 var shared = {}; 62391 var hasRequiredShared; 62392 function requireShared() { 62393 if (hasRequiredShared) return shared; 62394 hasRequiredShared = 1; 62395 Object.defineProperty(shared, "__esModule", { 62396 value: true 62397 }); 62398 shared.getTotalWidthOfEncodings = shared.calculateEncodingAttributes = shared.getBarcodePadding = shared.getEncodingHeight = shared.getMaximumHeightOfEncodings = void 0; 62399 var _merge = requireMerge(); 62400 var _merge2 = _interopRequireDefault(_merge); 62401 function _interopRequireDefault(obj) { 62402 return obj && obj.__esModule ? obj : { default: obj }; 62403 } 62404 function getEncodingHeight(encoding, options) { 62405 return options.height + (options.displayValue && encoding.text.length > 0 ? options.fontSize + options.textMargin : 0) + options.marginTop + options.marginBottom; 62406 } 62407 function getBarcodePadding(textWidth, barcodeWidth, options) { 62408 if (options.displayValue && barcodeWidth < textWidth) { 62409 if (options.textAlign == "center") { 62410 return Math.floor((textWidth - barcodeWidth) / 2); 62411 } else if (options.textAlign == "left") { 62412 return 0; 62413 } else if (options.textAlign == "right") { 62414 return Math.floor(textWidth - barcodeWidth); 62415 } 62416 } 62417 return 0; 62418 } 62419 function calculateEncodingAttributes(encodings, barcodeOptions, context) { 62420 for (var i2 = 0; i2 < encodings.length; i2++) { 62421 var encoding = encodings[i2]; 62422 var options = (0, _merge2.default)(barcodeOptions, encoding.options); 62423 var textWidth; 62424 if (options.displayValue) { 62425 textWidth = messureText(encoding.text, options, context); 62426 } else { 62427 textWidth = 0; 62428 } 62429 var barcodeWidth = encoding.data.length * options.width; 62430 encoding.width = Math.ceil(Math.max(textWidth, barcodeWidth)); 62431 encoding.height = getEncodingHeight(encoding, options); 62432 encoding.barcodePadding = getBarcodePadding(textWidth, barcodeWidth, options); 62433 } 62434 } 62435 function getTotalWidthOfEncodings(encodings) { 62436 var totalWidth = 0; 62437 for (var i2 = 0; i2 < encodings.length; i2++) { 62438 totalWidth += encodings[i2].width; 62439 } 62440 return totalWidth; 62441 } 62442 function getMaximumHeightOfEncodings(encodings) { 62443 var maxHeight = 0; 62444 for (var i2 = 0; i2 < encodings.length; i2++) { 62445 if (encodings[i2].height > maxHeight) { 62446 maxHeight = encodings[i2].height; 62447 } 62448 } 62449 return maxHeight; 62450 } 62451 function messureText(string, options, context) { 62452 var ctx; 62453 if (context) { 62454 ctx = context; 62455 } else if (typeof document !== "undefined") { 62456 ctx = document.createElement("canvas").getContext("2d"); 62457 } else { 62458 return 0; 62459 } 62460 ctx.font = options.fontOptions + " " + options.fontSize + "px " + options.font; 62461 var measureTextResult = ctx.measureText(string); 62462 if (!measureTextResult) { 62463 return 0; 62464 } 62465 var size = measureTextResult.width; 62466 return size; 62467 } 62468 shared.getMaximumHeightOfEncodings = getMaximumHeightOfEncodings; 62469 shared.getEncodingHeight = getEncodingHeight; 62470 shared.getBarcodePadding = getBarcodePadding; 62471 shared.calculateEncodingAttributes = calculateEncodingAttributes; 62472 shared.getTotalWidthOfEncodings = getTotalWidthOfEncodings; 62473 return shared; 62474 } 62475 var hasRequiredCanvas$1; 62476 function requireCanvas$1() { 62477 if (hasRequiredCanvas$1) return canvas$1; 62478 hasRequiredCanvas$1 = 1;
vendor: 12,543 bytes, lines 62479-62793
62479 Object.defineProperty(canvas$1, "__esModule", { 62480 value: true 62481 }); 62482 var _createClass = /* @__PURE__ */ (function() { 62483 function defineProperties(target, props) { 62484 for (var i2 = 0; i2 < props.length; i2++) { 62485 var descriptor = props[i2]; 62486 descriptor.enumerable = descriptor.enumerable || false; 62487 descriptor.configurable = true; 62488 if ("value" in descriptor) descriptor.writable = true; 62489 Object.defineProperty(target, descriptor.key, descriptor); 62490 } 62491 } 62492 return function(Constructor, protoProps, staticProps) { 62493 if (protoProps) defineProperties(Constructor.prototype, protoProps); 62494 if (staticProps) defineProperties(Constructor, staticProps); 62495 return Constructor; 62496 }; 62497 })(); 62498 var _merge = requireMerge(); 62499 var _merge2 = _interopRequireDefault(_merge); 62500 var _shared = requireShared(); 62501 function _interopRequireDefault(obj) { 62502 return obj && obj.__esModule ? obj : { default: obj }; 62503 } 62504 function _classCallCheck(instance, Constructor) { 62505 if (!(instance instanceof Constructor)) { 62506 throw new TypeError("Cannot call a class as a function"); 62507 } 62508 } 62509 var CanvasRenderer = (function() { 62510 function CanvasRenderer2(canvas2, encodings, options) { 62511 _classCallCheck(this, CanvasRenderer2); 62512 this.canvas = canvas2; 62513 this.encodings = encodings; 62514 this.options = options; 62515 } 62516 _createClass(CanvasRenderer2, [{ 62517 key: "render", 62518 value: function render() { 62519 if (!this.canvas.getContext) { 62520 throw new Error("The browser does not support canvas."); 62521 } 62522 this.prepareCanvas(); 62523 for (var i2 = 0; i2 < this.encodings.length; i2++) { 62524 var encodingOptions = (0, _merge2.default)(this.options, this.encodings[i2].options); 62525 this.drawCanvasBarcode(encodingOptions, this.encodings[i2]); 62526 this.drawCanvasText(encodingOptions, this.encodings[i2]); 62527 this.moveCanvasDrawing(this.encodings[i2]); 62528 } 62529 this.restoreCanvas(); 62530 } 62531 }, { 62532 key: "prepareCanvas", 62533 value: function prepareCanvas() { 62534 var ctx = this.canvas.getContext("2d"); 62535 ctx.save(); 62536 (0, _shared.calculateEncodingAttributes)(this.encodings, this.options, ctx); 62537 var totalWidth = (0, _shared.getTotalWidthOfEncodings)(this.encodings); 62538 var maxHeight = (0, _shared.getMaximumHeightOfEncodings)(this.encodings); 62539 this.canvas.width = totalWidth + this.options.marginLeft + this.options.marginRight; 62540 this.canvas.height = maxHeight; 62541 ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); 62542 if (this.options.background) { 62543 ctx.fillStyle = this.options.background; 62544 ctx.fillRect(0, 0, this.canvas.width, this.canvas.height); 62545 } 62546 ctx.translate(this.options.marginLeft, 0); 62547 } 62548 }, { 62549 key: "drawCanvasBarcode", 62550 value: function drawCanvasBarcode(options, encoding) { 62551 var ctx = this.canvas.getContext("2d"); 62552 var binary = encoding.data; 62553 var yFrom; 62554 if (options.textPosition == "top") { 62555 yFrom = options.marginTop + options.fontSize + options.textMargin; 62556 } else { 62557 yFrom = options.marginTop; 62558 } 62559 ctx.fillStyle = options.lineColor; 62560 for (var b2 = 0; b2 < binary.length; b2++) { 62561 var x2 = b2 * options.width + encoding.barcodePadding; 62562 if (binary[b2] === "1") { 62563 ctx.fillRect(x2, yFrom, options.width, options.height); 62564 } else if (binary[b2]) { 62565 ctx.fillRect(x2, yFrom, options.width, options.height * binary[b2]); 62566 } 62567 } 62568 } 62569 }, { 62570 key: "drawCanvasText", 62571 value: function drawCanvasText(options, encoding) { 62572 var ctx = this.canvas.getContext("2d"); 62573 var font = options.fontOptions + " " + options.fontSize + "px " + options.font; 62574 if (options.displayValue) { 62575 var x2, y2; 62576 if (options.textPosition == "top") { 62577 y2 = options.marginTop + options.fontSize - options.textMargin; 62578 } else { 62579 y2 = options.height + options.textMargin + options.marginTop + options.fontSize; 62580 } 62581 ctx.font = font; 62582 if (options.textAlign == "left" || encoding.barcodePadding > 0) { 62583 x2 = 0; 62584 ctx.textAlign = "left"; 62585 } else if (options.textAlign == "right") { 62586 x2 = encoding.width - 1; 62587 ctx.textAlign = "right"; 62588 } else { 62589 x2 = encoding.width / 2; 62590 ctx.textAlign = "center"; 62591 } 62592 ctx.fillText(encoding.text, x2, y2); 62593 } 62594 } 62595 }, { 62596 key: "moveCanvasDrawing", 62597 value: function moveCanvasDrawing(encoding) { 62598 var ctx = this.canvas.getContext("2d"); 62599 ctx.translate(encoding.width, 0); 62600 } 62601 }, { 62602 key: "restoreCanvas", 62603 value: function restoreCanvas() { 62604 var ctx = this.canvas.getContext("2d"); 62605 ctx.restore(); 62606 } 62607 }]); 62608 return CanvasRenderer2; 62609 })(); 62610 canvas$1.default = CanvasRenderer; 62611 return canvas$1; 62612 } 62613 var svg = {}; 62614 var hasRequiredSvg; 62615 function requireSvg() { 62616 if (hasRequiredSvg) return svg; 62617 hasRequiredSvg = 1; 62618 Object.defineProperty(svg, "__esModule", { 62619 value: true 62620 }); 62621 var _createClass = /* @__PURE__ */ (function() { 62622 function defineProperties(target, props) { 62623 for (var i2 = 0; i2 < props.length; i2++) { 62624 var descriptor = props[i2]; 62625 descriptor.enumerable = descriptor.enumerable || false; 62626 descriptor.configurable = true; 62627 if ("value" in descriptor) descriptor.writable = true; 62628 Object.defineProperty(target, descriptor.key, descriptor); 62629 } 62630 } 62631 return function(Constructor, protoProps, staticProps) { 62632 if (protoProps) defineProperties(Constructor.prototype, protoProps); 62633 if (staticProps) defineProperties(Constructor, staticProps); 62634 return Constructor; 62635 }; 62636 })(); 62637 var _merge = requireMerge(); 62638 var _merge2 = _interopRequireDefault(_merge); 62639 var _shared = requireShared(); 62640 function _interopRequireDefault(obj) { 62641 return obj && obj.__esModule ? obj : { default: obj }; 62642 } 62643 function _classCallCheck(instance, Constructor) { 62644 if (!(instance instanceof Constructor)) { 62645 throw new TypeError("Cannot call a class as a function"); 62646 } 62647 } 62648 var svgns = "http://www.w3.org/2000/svg"; 62649 var SVGRenderer = (function() { 62650 function SVGRenderer2(svg2, encodings, options) { 62651 _classCallCheck(this, SVGRenderer2); 62652 this.svg = svg2; 62653 this.encodings = encodings; 62654 this.options = options; 62655 this.document = options.xmlDocument || document; 62656 } 62657 _createClass(SVGRenderer2, [{ 62658 key: "render", 62659 value: function render() { 62660 var currentX = this.options.marginLeft; 62661 this.prepareSVG(); 62662 for (var i2 = 0; i2 < this.encodings.length; i2++) { 62663 var encoding = this.encodings[i2]; 62664 var encodingOptions = (0, _merge2.default)(this.options, encoding.options); 62665 var group = this.createGroup(currentX, encodingOptions.marginTop, this.svg); 62666 this.setGroupOptions(group, encodingOptions); 62667 this.drawSvgBarcode(group, encodingOptions, encoding); 62668 this.drawSVGText(group, encodingOptions, encoding); 62669 currentX += encoding.width; 62670 } 62671 } 62672 }, { 62673 key: "prepareSVG", 62674 value: function prepareSVG() { 62675 while (this.svg.firstChild) { 62676 this.svg.removeChild(this.svg.firstChild); 62677 } 62678 (0, _shared.calculateEncodingAttributes)(this.encodings, this.options); 62679 var totalWidth = (0, _shared.getTotalWidthOfEncodings)(this.encodings); 62680 var maxHeight = (0, _shared.getMaximumHeightOfEncodings)(this.encodings); 62681 var width = totalWidth + this.options.marginLeft + this.options.marginRight; 62682 this.setSvgAttributes(width, maxHeight); 62683 if (this.options.background) { 62684 this.drawRect(0, 0, width, maxHeight, this.svg).setAttribute("fill", this.options.background); 62685 } 62686 } 62687 }, { 62688 key: "drawSvgBarcode", 62689 value: function drawSvgBarcode(parent, options, encoding) { 62690 var binary = encoding.data; 62691 var yFrom; 62692 if (options.textPosition == "top") { 62693 yFrom = options.fontSize + options.textMargin; 62694 } else { 62695 yFrom = 0; 62696 } 62697 var barWidth = 0; 62698 var x2 = 0; 62699 for (var b2 = 0; b2 < binary.length; b2++) { 62700 x2 = b2 * options.width + encoding.barcodePadding; 62701 if (binary[b2] === "1") { 62702 barWidth++; 62703 } else if (barWidth > 0) { 62704 this.drawRect(x2 - options.width * barWidth, yFrom, options.width * barWidth, options.height, parent); 62705 barWidth = 0; 62706 } 62707 } 62708 if (barWidth > 0) { 62709 this.drawRect(x2 - options.width * (barWidth - 1), yFrom, options.width * barWidth, options.height, parent); 62710 } 62711 } 62712 }, { 62713 key: "drawSVGText", 62714 value: function drawSVGText(parent, options, encoding) { 62715 var textElem = this.document.createElementNS(svgns, "text"); 62716 if (options.displayValue) { 62717 var x2, y2; 62718 textElem.setAttribute("font-family", options.font); 62719 textElem.setAttribute("font-size", options.fontSize); 62720 if (options.fontOptions.includes("bold")) { 62721 textElem.setAttribute("font-weight", "bold"); 62722 } 62723 if (options.fontOptions.includes("italic")) { 62724 textElem.setAttribute("font-style", "italic"); 62725 } 62726 if (options.textPosition == "top") { 62727 y2 = options.fontSize - options.textMargin; 62728 } else { 62729 y2 = options.height + options.textMargin + options.fontSize; 62730 } 62731 if (options.textAlign == "left" || encoding.barcodePadding > 0) { 62732 x2 = 0; 62733 textElem.setAttribute("text-anchor", "start"); 62734 } else if (options.textAlign == "right") { 62735 x2 = encoding.width - 1; 62736 textElem.setAttribute("text-anchor", "end"); 62737 } else { 62738 x2 = encoding.width / 2; 62739 textElem.setAttribute("text-anchor", "middle"); 62740 } 62741 textElem.setAttribute("x", x2); 62742 textElem.setAttribute("y", y2); 62743 textElem.appendChild(this.document.createTextNode(encoding.text)); 62744 parent.appendChild(textElem); 62745 } 62746 } 62747 }, { 62748 key: "setSvgAttributes", 62749 value: function setSvgAttributes(width, height) { 62750 var svg2 = this.svg; 62751 svg2.setAttribute("width", width + "px"); 62752 svg2.setAttribute("height", height + "px"); 62753 svg2.setAttribute("x", "0px"); 62754 svg2.setAttribute("y", "0px"); 62755 svg2.setAttribute("viewBox", "0 0 " + width + " " + height); 62756 svg2.setAttribute("xmlns", svgns); 62757 svg2.setAttribute("version", "1.1"); 62758 } 62759 }, { 62760 key: "createGroup", 62761 value: function createGroup(x2, y2, parent) { 62762 var group = this.document.createElementNS(svgns, "g"); 62763 group.setAttribute("transform", "translate(" + x2 + ", " + y2 + ")"); 62764 parent.appendChild(group); 62765 return group; 62766 } 62767 }, { 62768 key: "setGroupOptions", 62769 value: function setGroupOptions(group, options) { 62770 group.setAttribute("fill", options.lineColor); 62771 } 62772 }, { 62773 key: "drawRect", 62774 value: function drawRect(x2, y2, width, height, parent) { 62775 var rect = this.document.createElementNS(svgns, "rect"); 62776 rect.setAttribute("x", x2); 62777 rect.setAttribute("y", y2); 62778 rect.setAttribute("width", width); 62779 rect.setAttribute("height", height); 62780 parent.appendChild(rect); 62781 return rect; 62782 } 62783 }]); 62784 return SVGRenderer2; 62785 })(); 62786 svg.default = SVGRenderer; 62787 return svg; 62788 } 62789 var object = {}; 62790 var hasRequiredObject; 62791 function requireObject() { 62792 if (hasRequiredObject) return object; 62793 hasRequiredObject = 1;
62794 Object.defineProperty(object, "__esModule", { 62795 value: true 62796 }); 62797 var _createClass = /* @__PURE__ */ (function() { 62798 function defineProperties(target, props) { 62799 for (var i2 = 0; i2 < props.length; i2++) { 62800 var descriptor = props[i2]; 62801 descriptor.enumerable = descriptor.enumerable || false; 62802 descriptor.configurable = true; 62803 if ("value" in descriptor) descriptor.writable = true; 62804 Object.defineProperty(target, descriptor.key, descriptor); 62805 } 62806 } 62807 return function(Constructor, protoProps, staticProps) { 62808 if (protoProps) defineProperties(Constructor.prototype, protoProps); 62809 if (staticProps) defineProperties(Constructor, staticProps); 62810 return Constructor; 62811 }; 62812 })(); 62813 function _classCallCheck(instance, Constructor) { 62814 if (!(instance instanceof Constructor)) { 62815 throw new TypeError("Cannot call a class as a function"); 62816 } 62817 } 62818 var ObjectRenderer = (function() { 62819 function ObjectRenderer2(object2, encodings, options) { 62820 _classCallCheck(this, ObjectRenderer2); 62821 this.object = object2; 62822 this.encodings = encodings; 62823 this.options = options; 62824 } 62825 _createClass(ObjectRenderer2, [{ 62826 key: "render", 62827 value: function render() { 62828 this.object.encodings = this.encodings; 62829 } 62830 }]); 62831 return ObjectRenderer2; 62832 })(); 62833 object.default = ObjectRenderer; 62834 return object; 62835 } 62836 var hasRequiredRenderers; 62837 function requireRenderers() { 62838 if (hasRequiredRenderers) return renderers; 62839 hasRequiredRenderers = 1; 62840 Object.defineProperty(renderers, "__esModule", { 62841 value: true 62842 }); 62843 var _canvas = requireCanvas$1(); 62844 var _canvas2 = _interopRequireDefault(_canvas); 62845 var _svg = requireSvg(); 62846 var _svg2 = _interopRequireDefault(_svg); 62847 var _object = requireObject(); 62848 var _object2 = _interopRequireDefault(_object); 62849 function _interopRequireDefault(obj) { 62850 return obj && obj.__esModule ? obj : { default: obj }; 62851 } 62852 renderers.default = { CanvasRenderer: _canvas2.default, SVGRenderer: _svg2.default, ObjectRenderer: _object2.default }; 62853 return renderers; 62854 } 62855 var exceptions = {}; 62856 var hasRequiredExceptions; 62857 function requireExceptions() { 62858 if (hasRequiredExceptions) return exceptions; 62859 hasRequiredExceptions = 1; 62860 Object.defineProperty(exceptions, "__esModule", { 62861 value: true 62862 }); 62863 function _classCallCheck(instance, Constructor) { 62864 if (!(instance instanceof Constructor)) { 62865 throw new TypeError("Cannot call a class as a function"); 62866 } 62867 } 62868 function _possibleConstructorReturn(self, call) { 62869 if (!self) { 62870 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 62871 } 62872 return call && (typeof call === "object" || typeof call === "function") ? call : self; 62873 } 62874 function _inherits(subClass, superClass) { 62875 if (typeof superClass !== "function" && superClass !== null) { 62876 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 62877 } 62878 subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); 62879 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 62880 } 62881 var InvalidInputException = (function(_Error) { 62882 _inherits(InvalidInputException2, _Error); 62883 function InvalidInputException2(symbology, input) { 62884 _classCallCheck(this, InvalidInputException2); 62885 var _this = _possibleConstructorReturn(this, (InvalidInputException2.__proto__ || Object.getPrototypeOf(InvalidInputException2)).call(this)); 62886 _this.name = "InvalidInputException"; 62887 _this.symbology = symbology; 62888 _this.input = input; 62889 _this.message = '"' + _this.input + '" is not a valid input for ' + _this.symbology; 62890 return _this; 62891 } 62892 return InvalidInputException2; 62893 })(Error); 62894 var InvalidElementException = (function(_Error2) { 62895 _inherits(InvalidElementException2, _Error2); 62896 function InvalidElementException2() { 62897 _classCallCheck(this, InvalidElementException2); 62898 var _this2 = _possibleConstructorReturn(this, (InvalidElementException2.__proto__ || Object.getPrototypeOf(Invali
62898dElementException2)).call(this)); 62899 _this2.name = "InvalidElementException"; 62900 _this2.message = "Not supported type to render on"; 62901 return _this2; 62902 } 62903 return InvalidElementException2; 62904 })(Error); 62905 var NoElementException = (function(_Error3) { 62906 _inherits(NoElementException2, _Error3); 62907 function NoElementException2() { 62908 _classCallCheck(this, NoElementException2); 62909 var _this3 = _possibleConstructorReturn(this, (NoElementException2.__proto__ || Object.getPrototypeOf(NoElementException2)).call(this)); 62910 _this3.name = "NoElementException"; 62911 _this3.message = "No element to render on."; 62912 return _this3; 62913 } 62914 return NoElementException2; 62915 })(Error); 62916 exceptions.InvalidInputException = InvalidInputException; 62917 exceptions.InvalidElementException = InvalidElementException; 62918 exceptions.NoElementException = NoElementException; 62919 return exceptions; 62920 } 62921 var hasRequiredGetRenderProperties; 62922 function requireGetRenderProperties() { 62923 if (hasRequiredGetRenderProperties) return getRenderProperties; 62924 hasRequiredGetRenderProperties = 1; 62925 Object.defineProperty(getRenderProperties, "__esModule", { 62926 value: true 62927 }); 62928 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { 62929 return typeof obj; 62930 } : function(obj) { 62931 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 62932 }; 62933 var _getOptionsFromElement = requireGetOptionsFromElement(); 62934 var _getOptionsFromElement2 = _interopRequireDefault(_getOptionsFromElement); 62935 var _renderers = requireRenderers(); 62936 var _renderers2 = _interopRequireDefault(_renderers); 62937 var _exceptions = requireExceptions(); 62938 function _interopRequireDefault(obj) { 62939 return obj && obj.__esModule ? obj : { default: obj }; 62940 } 62941 function getRenderProperties$1(element) { 62942 if (typeof element === "string") { 62943 return querySelectedRenderProperties(element); 62944 } else if (Array.isArray(element)) { 62945 var returnArray = []; 62946 for (var i2 = 0; i2 < element.length; i2++) { 62947 returnArray.push(getRenderProperties$1(element[i2])); 62948 } 62949 return returnArray; 62950 } else if (typeof HTMLCanvasElement !== "undefined" && element instanceof HTMLImageElement) { 62951 return newCanvasRenderProperties(element); 62952 } else if (element && element.nodeName && element.nodeName.toLowerCase() === "svg" || typeof SVGElement !== "undefined" && element instanceof SVGElement) { 62953 return { 62954 element, 62955 options: (0, _getOptionsFromElement2.default)(element), 62956 renderer: _renderers2.default.SVGRenderer 62957 }; 62958 } else if (typeof HTMLCanvasElement !== "undefined" && element instanceof HTMLCanvasElement) { 62959 return { 62960 element, 62961 options: (0, _getOptionsFromElement2.default)(element), 62962 renderer: _renderers2.default.CanvasRenderer 62963 }; 62964 } else if (element && element.getContext) { 62965 return { 62966 element, 62967 renderer: _renderers2.default.CanvasRenderer 62968 }; 62969 } else if (element && (typeof element === "undefined" ? "undefined" : _typeof(element)) === "object" && !element.nodeName) { 62970 return { 62971 element, 62972 renderer: _renderers2.default.ObjectRenderer 62973 }; 62974 } else { 62975 throw new _exceptions.InvalidElementException(); 62976 } 62977 } 62978 function querySelectedRenderProperties(string) { 62979 var selector = document.querySelectorAll(string); 62980 if (selector.length === 0) { 62981 return void 0; 62982 } else { 62983 var returnArray = []; 62984 for (var i2 = 0; i2 < selector.length; i2++) { 62985 returnArray.push(getRenderProperties$1(selector[i2])); 62986 } 62987 return returnArray; 62988 } 62989 } 62990 function newCanvasRenderProperties(imgElement) { 62991 var canvas2 = document.createElement("canvas"); 62992 return { 62993 element: canvas2, 62994 options: (0, _getOptionsFromElement2.default)(imgElement), 62995 renderer: _renderers2.default.CanvasRenderer,
62996 afterRender: function afterRender() { 62997 imgElement.setAttribute("src", canvas2.toDataURL()); 62998 } 62999 }; 63000 } 63001 getRenderProperties.default = getRenderProperties$1; 63002 return getRenderProperties; 63003 } 63004 var ErrorHandler = {}; 63005 var hasRequiredErrorHandler; 63006 function requireErrorHandler() { 63007 if (hasRequiredErrorHandler) return ErrorHandler; 63008 hasRequiredErrorHandler = 1; 63009 Object.defineProperty(ErrorHandler, "__esModule", { 63010 value: true 63011 }); 63012 var _createClass = /* @__PURE__ */ (function() { 63013 function defineProperties(target, props) { 63014 for (var i2 = 0; i2 < props.length; i2++) { 63015 var descriptor = props[i2]; 63016 descriptor.enumerable = descriptor.enumerable || false; 63017 descriptor.configurable = true; 63018 if ("value" in descriptor) descriptor.writable = true; 63019 Object.defineProperty(target, descriptor.key, descriptor); 63020 } 63021 } 63022 return function(Constructor, protoProps, staticProps) { 63023 if (protoProps) defineProperties(Constructor.prototype, protoProps); 63024 if (staticProps) defineProperties(Constructor, staticProps); 63025 return Constructor; 63026 }; 63027 })(); 63028 function _classCallCheck(instance, Constructor) { 63029 if (!(instance instanceof Constructor)) { 63030 throw new TypeError("Cannot call a class as a function"); 63031 } 63032 } 63033 var ErrorHandler$1 = (function() { 63034 function ErrorHandler2(api2) { 63035 _classCallCheck(this, ErrorHandler2); 63036 this.api = api2; 63037 } 63038 _createClass(ErrorHandler2, [{ 63039 key: "handleCatch", 63040 value: function handleCatch(e2) { 63041 if (e2.name === "InvalidInputException") { 63042 if (this.api._options.valid !== this.api._defaults.valid) { 63043 this.api._options.valid(false); 63044 } else { 63045 throw e2.message; 63046 } 63047 } else { 63048 throw e2; 63049 } 63050 this.api.render = function() { 63051 }; 63052 } 63053 }, { 63054 key: "wrapBarcodeCall", 63055 value: function wrapBarcodeCall(func) { 63056 try { 63057 var result = func.apply(void 0, arguments); 63058 this.api._options.valid(true); 63059 return result; 63060 } catch (e2) { 63061 this.handleCatch(e2); 63062 return this.api; 63063 } 63064 } 63065 }]); 63066 return ErrorHandler2; 63067 })(); 63068 ErrorHandler.default = ErrorHandler$1; 63069 return ErrorHandler; 63070 } 63071 var JsBarcode_1; 63072 var hasRequiredJsBarcode; 63073 function requireJsBarcode() { 63074 if (hasRequiredJsBarcode) return JsBarcode_1; 63075 hasRequiredJsBarcode = 1; 63076 var _barcodes = requireBarcodes(); 63077 var _barcodes2 = _interopRequireDefault(_barcodes); 63078 var _merge = requireMerge(); 63079 var _merge2 = _interopRequireDefault(_merge); 63080 var _linearizeEncodings = requireLinearizeEncodings(); 63081 var _linearizeEncodings2 = _interopRequireDefault(_linearizeEncodings); 63082 var _fixOptions = requireFixOptions(); 63083 var _fixOptions2 = _interopRequireDefault(_fixOptions); 63084 var _getRenderProperties = requireGetRenderProperties(); 63085 var _getRenderProperties2 = _interopRequireDefault(_getRenderProperties); 63086 var _optionsFromStrings = requireOptionsFromStrings(); 63087 var _optionsFromStrings2 = _interopRequireDefault(_optionsFromStrings); 63088 var _ErrorHandler = requireErrorHandler(); 63089 var _ErrorHandler2 = _interopRequireDefault(_ErrorHandler); 63090 var _exceptions = requireExceptions(); 63091 var _defaults = requireDefaults(); 63092 var _defaults2 = _interopRequireDefault(_defaults); 63093 function _interopRequireDefault(obj) { 63094 return obj && obj.__esModule ? obj : { default: obj }; 63095 } 63096 var API2 = function API3() { 63097 }; 63098 var JsBarcode2 = function JsBarcode3(element, text, options) { 63099 var api2 = new API2(); 63100 if (typeof element === "undefined") { 63101 throw Error("No element to render on was provided."); 63102 } 63103 api2._renderProperties = (0, _getRenderProperties2.default)(element); 63104 api2._encodings = []; 63105 api2._options = _defaults2.default; 63106 api2._errorHandler = new _ErrorHandler2.default(api2); 63107 if (typeof text !== "undefined") { 63108 options = options || {}; 63109 if (!options.format) { 63110 options.format = autoSelectBarcode(); 63111 } 63112 api2.options(options)[options.format](text, options).render(); 63113 } 63114 return api2; 63115 }; 63116 JsBarcode2.getModule = function(name2) { 63117 return _barcodes2.default[name2]; 63118 }; 63119 for (var name in _barcodes2.default) { 63120 if (_barcodes2.default.hasOwnProperty(name)) { 63121 registerBarcode(_barcodes2.default, name); 63122 } 63123 } 63124 function registerBarcode(barcodes2, name2) { 63125 API2.prototype[name2] = API2.prototype[name2.toUpperCase()] = API2.prototype[name2.toLowerCase()] = function(text, options) { 63126 var api2 = this; 63127 return api2._errorHandler.wrapBarcodeCall(function() { 63128 options.text = typeof options.text === "undefined" ? void 0 : "" + options.text; 63129 var newOptions = (0, _merge2.default)(api2._options, options); 63130 newOptions = (0, _optionsFromStrings2.default)(newOptions); 63131 var Encoder = barcodes2[name2]; 63132 var encoded = encode(text, Encoder, newOptions); 63133 api2._encodings.push(encoded); 63134 return api2; 63135 }); 63136 }; 63137 } 63138 function encode(text, Encoder, options) { 63139 text = "" + text; 63140 var encoder2 = new Encoder(text, options); 63141 if (!encoder2.valid()) { 63142 throw new _exceptions.InvalidInputException(encoder2.constructor.name, text); 63143 } 63144 var encoded = encoder2.encode(); 63145 encoded = (0, _linearizeEncodings2.default)(encoded); 63146 for (var i2 = 0; i2 < encoded.length; i2++) { 63147 encoded[i2].options = (0, _merge2.default)(options, encoded[i2].options); 63148 } 63149 return encoded; 63150 } 63151 function autoSelectBarcode() { 63152 if (_barcodes2.default["CODE128"]) { 63153 return "CODE128"; 63154 } 63155 return Object.keys(_barcodes2.default)[0]; 63156 } 63157 API2.prototype.options = function(options) { 63158 this._options = (0, _merge2.default)(this._options, options); 63159 return this; 63160 }; 63161 API2.prototype.blank = function(size) { 63162 var zeroes = new Array(size + 1).join("0");
63163 this._encodings.push({ data: zeroes }); 63164 return this; 63165 }; 63166 API2.prototype.init = function() { 63167 if (!this._renderProperties) { 63168 return; 63169 } 63170 if (!Array.isArray(this._renderProperties)) { 63171 this._renderProperties = [this._renderProperties]; 63172 } 63173 var renderProperty; 63174 for (var i2 in this._renderProperties) { 63175 renderProperty = this._renderProperties[i2]; 63176 var options = (0, _merge2.default)(this._options, renderProperty.options); 63177 if (options.format == "auto") { 63178 options.format = autoSelectBarcode(); 63179 } 63180 this._errorHandler.wrapBarcodeCall(function() { 63181 var text = options.value; 63182 var Encoder = _barcodes2.default[options.format.toUpperCase()]; 63183 var encoded = encode(text, Encoder, options); 63184 render(renderProperty, encoded, options); 63185 }); 63186 } 63187 }; 63188 API2.prototype.render = function() { 63189 if (!this._renderProperties) { 63190 throw new _exceptions.NoElementException(); 63191 } 63192 if (Array.isArray(this._renderProperties)) { 63193 for (var i2 = 0; i2 < this._renderProperties.length; i2++) { 63194 render(this._renderProperties[i2], this._encodings, this._options); 63195 } 63196 } else { 63197 render(this._renderProperties, this._encodings, this._options); 63198 } 63199 return this; 63200 }; 63201 API2.prototype._defaults = _defaults2.default; 63202 function render(renderProperties, encodings, options) { 63203 encodings = (0, _linearizeEncodings2.default)(encodings); 63204 for (var i2 = 0; i2 < encodings.length; i2++) { 63205 encodings[i2].options = (0, _merge2.default)(options, encodings[i2].options); 63206 (0, _fixOptions2.default)(encodings[i2].options); 63207 } 63208 (0, _fixOptions2.default)(options); 63209 var Renderer = renderProperties.renderer; 63210 var renderer = new Renderer(renderProperties.element, encodings, options); 63211 renderer.render(); 63212 if (renderProperties.afterRender) { 63213 renderProperties.afterRender(); 63214 } 63215 } 63216 if (typeof window !== "undefined") { 63217 window.JsBarcode = JsBarcode2; 63218 } 63219 if (typeof jQuery !== "undefined") { 63220 jQuery.fn.JsBarcode = function(content, options) { 63221 var elementArray = []; 63222 jQuery(this).each(function() { 63223 elementArray.push(this); 63224 }); 63225 return JsBarcode2(elementArray, content, options); 63226 }; 63227 } 63228 JsBarcode_1 = JsBarcode2; 63229 return JsBarcode_1; 63230 } 63231 var JsBarcodeExports = requireJsBarcode(); 63232 const JsBarcode = /* @__PURE__ */ getDefaultExportFromCjs(JsBarcodeExports); 63233 var __defProp$R = Object.defineProperty; 63234 var __getOwnPropDesc$U = Object.getOwnPropertyDescriptor; 63235 var __decorateClass$U = (decorators, target, key, kind) => { 63236 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$U(target, key) : target; 63237 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 63238 if (decorator = decorators[i2]) 63239 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 63240 if (kind && result) __defProp$R(target, key, result); 63241 return result; 63242 }; 63243 let Barcode = class extends Subscriber$1(i$6) { 63244 constructor() { 63245 super(...arguments); 63246 this.barcode = ""; 63247 this.barWidth = 2; 63248 this.barHeight = 100; 63249 this.hideValue = false; 63250 this.margin = "13 15 13 15"; 63251 } 63252 // @property() hideValue = "true"; 63253 firstUpdated() { 63254 const isSafariIos = navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/AppleWebKit/); 63255 const version2 = navigator.userAgent.match(/Version\/(\d+)/); 63256 if (isSafariIos && version2 && parseInt(version2[1]) <= 15) { 63257 this.setAttribute("blackandwhite", ""); 63258 } else { 63259 const computedStyle = getComputedStyle(this); 63260 let bg = computedStyle.getPropertyValue("background-color"); 63261 let color = computedStyle.getPropertyValue("color"); 63262 if (bg.includes("rgba")) { 63263 bg = this.rgbaToRgb(bg); 63264 } 63265 if (color.includes("rgba")) { 63266 color = this.rgbaToRgb(color); 63267 } 63268 const bgLuminance = this.getLuminance(bg); 63269 const colorLuminance = this.getLuminance(color); 63270 if (colorLuminance > bgLuminance) { 63271 this.setAttribute("invert", ""); 63272 } 63273 } 63274 } 63275 rgbaToRgb(color) { 63276 const rgb = color.match(/\d+/g)?.map(Number); 63277 if (!rgb || rgb.length !== 3) { 63278 throw new Error("Invalid color format"); 63279 } 63280 return `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`; 63281 } 63282 getLuminance(color) { 63283 const rgb = color.match(/\d+/g)?.map(Number); 63284 if (!rgb || rgb.length !== 3) { 63285 throw new Error("Invalid color format"); 63286 } 63287 const [r2, g2, b2] = rgb.map((c2) => { 63288 const sRGB = c2 / 255; 63289 return sRGB <= 0.03928 ? sRGB / 12.92 : Math.pow((sRGB + 0.055) / 1.055, 2.4); 63290 }); 63291 return 0.2126 * r2 + 0.7152 * g2 + 0.0722 * b2; 63292 } 63293 render() { 63294 return b$1`<svg id="barcode"></svg>`; 63295 } 63296 generateBarcode() { 63297 const margins = this.margin.split(" "); 63298 JsBarcode(this.$barcode, this.barcode, { 63299 format: "ean13", 63300 background: "transparent", 63301 lineColor: "currentColor", 63302 font: "var(--sc-barcode-ff)", 63303 displayValue: this.hideValue ? false : true, 63304 width: this.barWidth, 63305 height: this.barHeight, 63306 marginTop: parseInt(margins[0]), 63307 marginRight: parseInt(margins[1]), 63308 marginBottom: parseInt(margins[2]), 63309 marginLeft: parseInt(margins[3]), 63310 valid: (valid) => { 63311 if (valid) { 63312 this.$barcode.style.display = "block"; 63313 } else { 63314 this.$barcode.style.display = "none"; 63315 } 63316 } 63317 }); 63318 } 63319 updated() { 63320 this.generateBarcode(); 63321 } 63322 }; 63323 Barcode.styles = [ 63324 i$9` 63325 :host { 63326 --sc-barcode-bg: var(--sc-base); 63327 --sc-barcode-color: var(--sc-base-900); 63328 --sc-barcode-ff: var(--sc-font-family-base); 63329 background-color: var(--sc-barcode-bg); 63330 color: var(--sc-barcode-color); 63331 border-radius: var(--sc-rounded-md); 63332 display: inline-block; 63333 vertical-align: middle; 63334 } 63335 63336 :host([invert]) { 63337 --sc-barcode-bg: var(--sc-base-900); 63338 --sc-barcode-color: var(--sc-base); 63339 } 63340 :host([blackandwhite]) { 63341 --sc-barcode-bg: #ffffff; 63342 --sc-barcode-color: #000000; 63343 } 63344 63345 svg { 63346 width: 100%; 63347 height: auto; 63348 } 63349 ` 63350 ]; 63351 __decorateClass$U([ 63352 e$7("#barcode") 63353 ], Barcode.prototype, "$barcode", 2); 63354 __decorateClass$U([ 63355 n$5() 63356 ], Barcode.prototype, "barcode", 2); 63357 __decorateClass$U([ 63358 n$5({ type: Number }) 63359 ], Barcode.prototype, "barWidth", 2); 63360 __decorateClass$U([ 63361 n$5({ type: Number }) 63362 ], Barcode.prototype, "barHeight", 2); 63363 __decorateClass$U([ 63364 n$5({ type: Boolean }) 63365 ], Barcode.prototype, "hideValue", 2); 63366 __decorateClass$U([ 63367 n$5({ type: String }) 63368 ], Barcode.prototype, "margin", 2); 63369 Barcode = __decorateClass$U([ 63370 t$3("sonic-barcode") 63371 ], Barcode); 63372 var browser = {}; 63373 var canPromise; 63374 var hasRequiredCanPromise; 63375 function requireCanPromise() { 63376 if (hasRequiredCanPromise) return canPromise; 63377 hasRequiredCanPromise = 1; 63378 canPromise = function() { 63379 return typeof Promise === "function" && Promise.prototype && Promise.prototype.then; 63380 }; 63381 return canPromise; 63382 } 63383 var qrcode = {}; 63384 var utils$1 = {}; 63385 var hasRequiredUtils$1; 63386 function requireUtils$1() { 63387 if (hasRequiredUtils$1) return utils$1; 63388 hasRequiredUtils$1 = 1; 63389 let toSJISFunction; 63390 const CODEWORDS_COUNT = [ 63391 0, 63392 // Not used 63393 26, 63394 44, 63395 70, 63396 100, 63397 134, 63398 172, 63399 196, 63400 242, 63401 292, 63402 346, 63403 404, 63404 466, 63405 532, 63406 581, 63407 655, 63408 733, 63409 815, 63410 901, 63411 991, 63412 1085, 63413 1156, 63414 1258, 63415 1364, 63416 1474, 63417 1588, 63418 1706, 63419 1828, 63420 1921, 63421 2051, 63422 2185, 63423 2323, 63424 2465, 63425 2611,
vendor: 9,972 bytes, lines 63426-63727
63426 2761, 63427 2876, 63428 3034, 63429 3196, 63430 3362, 63431 3532, 63432 3706 63433 ]; 63434 utils$1.getSymbolSize = function getSymbolSize(version2) { 63435 if (!version2) throw new Error('"version" cannot be null or undefined'); 63436 if (version2 < 1 || version2 > 40) throw new Error('"version" should be in range from 1 to 40'); 63437 return version2 * 4 + 17; 63438 }; 63439 utils$1.getSymbolTotalCodewords = function getSymbolTotalCodewords(version2) { 63440 return CODEWORDS_COUNT[version2]; 63441 }; 63442 utils$1.getBCHDigit = function(data) { 63443 let digit = 0; 63444 while (data !== 0) { 63445 digit++; 63446 data >>>= 1; 63447 } 63448 return digit; 63449 }; 63450 utils$1.setToSJISFunction = function setToSJISFunction(f2) { 63451 if (typeof f2 !== "function") { 63452 throw new Error('"toSJISFunc" is not a valid function.'); 63453 } 63454 toSJISFunction = f2; 63455 }; 63456 utils$1.isKanjiModeEnabled = function() { 63457 return typeof toSJISFunction !== "undefined"; 63458 }; 63459 utils$1.toSJIS = function toSJIS(kanji) { 63460 return toSJISFunction(kanji); 63461 }; 63462 return utils$1; 63463 } 63464 var errorCorrectionLevel = {}; 63465 var hasRequiredErrorCorrectionLevel; 63466 function requireErrorCorrectionLevel() { 63467 if (hasRequiredErrorCorrectionLevel) return errorCorrectionLevel; 63468 hasRequiredErrorCorrectionLevel = 1; 63469 (function(exports) { 63470 exports.L = { bit: 1 }; 63471 exports.M = { bit: 0 }; 63472 exports.Q = { bit: 3 }; 63473 exports.H = { bit: 2 }; 63474 function fromString(string) { 63475 if (typeof string !== "string") { 63476 throw new Error("Param is not a string"); 63477 } 63478 const lcStr = string.toLowerCase(); 63479 switch (lcStr) { 63480 case "l": 63481 case "low": 63482 return exports.L; 63483 case "m": 63484 case "medium": 63485 return exports.M; 63486 case "q": 63487 case "quartile": 63488 return exports.Q; 63489 case "h": 63490 case "high": 63491 return exports.H; 63492 default: 63493 throw new Error("Unknown EC Level: " + string); 63494 } 63495 } 63496 exports.isValid = function isValid(level) { 63497 return level && typeof level.bit !== "undefined" && level.bit >= 0 && level.bit < 4; 63498 }; 63499 exports.from = function from(value, defaultValue2) { 63500 if (exports.isValid(value)) { 63501 return value; 63502 } 63503 try { 63504 return fromString(value); 63505 } catch (e2) { 63506 return defaultValue2; 63507 } 63508 }; 63509 })(errorCorrectionLevel); 63510 return errorCorrectionLevel; 63511 } 63512 var bitBuffer; 63513 var hasRequiredBitBuffer; 63514 function requireBitBuffer() { 63515 if (hasRequiredBitBuffer) return bitBuffer; 63516 hasRequiredBitBuffer = 1; 63517 function BitBuffer() { 63518 this.buffer = []; 63519 this.length = 0; 63520 } 63521 BitBuffer.prototype = { 63522 get: function(index) { 63523 const bufIndex = Math.floor(index / 8); 63524 return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) === 1; 63525 }, 63526 put: function(num, length) { 63527 for (let i2 = 0; i2 < length; i2++) { 63528 this.putBit((num >>> length - i2 - 1 & 1) === 1); 63529 } 63530 }, 63531 getLengthInBits: function() { 63532 return this.length; 63533 }, 63534 putBit: function(bit) { 63535 const bufIndex = Math.floor(this.length / 8); 63536 if (this.buffer.length <= bufIndex) { 63537 this.buffer.push(0); 63538 } 63539 if (bit) { 63540 this.buffer[bufIndex] |= 128 >>> this.length % 8; 63541 } 63542 this.length++; 63543 } 63544 }; 63545 bitBuffer = BitBuffer; 63546 return bitBuffer; 63547 } 63548 var bitMatrix; 63549 var hasRequiredBitMatrix; 63550 function requireBitMatrix() { 63551 if (hasRequiredBitMatrix) return bitMatrix; 63552 hasRequiredBitMatrix = 1; 63553 function BitMatrix(size) { 63554 if (!size || size < 1) { 63555 throw new Error("BitMatrix size must be defined and greater than 0"); 63556 } 63557 this.size = size; 63558 this.data = new Uint8Array(size * size); 63559 this.reservedBit = new Uint8Array(size * size); 63560 } 63561 BitMatrix.prototype.set = function(row, col, value, reserved) { 63562 const index = row * this.size + col; 63563 this.data[index] = value; 63564 if (reserved) this.reservedBit[index] = true; 63565 }; 63566 BitMatrix.prototype.get = function(row, col) { 63567 return this.data[row * this.size + col]; 63568 }; 63569 BitMatrix.prototype.xor = function(row, col, value) { 63570 this.data[row * this.size + col] ^= value; 63571 }; 63572 BitMatrix.prototype.isReserved = function(row, col) { 63573 return this.reservedBit[row * this.size + col]; 63574 }; 63575 bitMatrix = BitMatrix; 63576 return bitMatrix; 63577 } 63578 var alignmentPattern = {}; 63579 var hasRequiredAlignmentPattern; 63580 function requireAlignmentPattern() { 63581 if (hasRequiredAlignmentPattern) return alignmentPattern; 63582 hasRequiredAlignmentPattern = 1; 63583 (function(exports) { 63584 const getSymbolSize = requireUtils$1().getSymbolSize; 63585 exports.getRowColCoords = function getRowColCoords(version2) { 63586 if (version2 === 1) return []; 63587 const posCount = Math.floor(version2 / 7) + 2; 63588 const size = getSymbolSize(version2); 63589 const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2; 63590 const positions = [size - 7]; 63591 for (let i2 = 1; i2 < posCount - 1; i2++) { 63592 positions[i2] = positions[i2 - 1] - intervals; 63593 } 63594 positions.push(6); 63595 return positions.reverse(); 63596 }; 63597 exports.getPositions = function getPositions(version2) { 63598 const coords = []; 63599 const pos = exports.getRowColCoords(version2); 63600 const posLength = pos.length; 63601 for (let i2 = 0; i2 < posLength; i2++) { 63602 for (let j2 = 0; j2 < posLength; j2++) { 63603 if (i2 === 0 && j2 === 0 || // top-left 63604 i2 === 0 && j2 === posLength - 1 || // bottom-left 63605 i2 === posLength - 1 && j2 === 0) { 63606 continue; 63607 } 63608 coords.push([pos[i2], pos[j2]]); 63609 } 63610 } 63611 return coords; 63612 }; 63613 })(alignmentPattern); 63614 return alignmentPattern; 63615 } 63616 var finderPattern = {}; 63617 var hasRequiredFinderPattern; 63618 function requireFinderPattern() { 63619 if (hasRequiredFinderPattern) return finderPattern; 63620 hasRequiredFinderPattern = 1; 63621 const getSymbolSize = requireUtils$1().getSymbolSize; 63622 const FINDER_PATTERN_SIZE = 7; 63623 finderPattern.getPositions = function getPositions(version2) { 63624 const size = getSymbolSize(version2); 63625 return [ 63626 // top-left 63627 [0, 0], 63628 // top-right 63629 [size - FINDER_PATTERN_SIZE, 0], 63630 // bottom-left 63631 [0, size - FINDER_PATTERN_SIZE] 63632 ]; 63633 }; 63634 return finderPattern; 63635 } 63636 var maskPattern = {}; 63637 var hasRequiredMaskPattern; 63638 function requireMaskPattern() { 63639 if (hasRequiredMaskPattern) return maskPattern; 63640 hasRequiredMaskPattern = 1; 63641 (function(exports) { 63642 exports.Patterns = { 63643 PATTERN000: 0, 63644 PATTERN001: 1, 63645 PATTERN010: 2, 63646 PATTERN011: 3, 63647 PATTERN100: 4, 63648 PATTERN101: 5, 63649 PATTERN110: 6, 63650 PATTERN111: 7 63651 }; 63652 const PenaltyScores = { 63653 N1: 3, 63654 N2: 3, 63655 N3: 40, 63656 N4: 10 63657 }; 63658 exports.isValid = function isValid(mask) { 63659 return mask != null && mask !== "" && !isNaN(mask) && mask >= 0 && mask <= 7; 63660 }; 63661 exports.from = function from(value) { 63662 return exports.isValid(value) ? parseInt(value, 10) : void 0; 63663 }; 63664 exports.getPenaltyN1 = function getPenaltyN1(data) { 63665 const size = data.size; 63666 let points = 0; 63667 let sameCountCol = 0; 63668 let sameCountRow = 0; 63669 let lastCol = null; 63670 let lastRow = null; 63671 for (let row = 0; row < size; row++) { 63672 sameCountCol = sameCountRow = 0; 63673 lastCol = lastRow = null; 63674 for (let col = 0; col < size; col++) { 63675 let module = data.get(row, col); 63676 if (module === lastCol) { 63677 sameCountCol++; 63678 } else { 63679 if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5); 63680 lastCol = module; 63681 sameCountCol = 1; 63682 } 63683 module = data.get(col, row); 63684 if (module === lastRow) { 63685 sameCountRow++; 63686 } else { 63687 if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5); 63688 lastRow = module; 63689 sameCountRow = 1; 63690 } 63691 } 63692 if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5); 63693 if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5); 63694 } 63695 return points; 63696 }; 63697 exports.getPenaltyN2 = function getPenaltyN2(data) { 63698 const size = data.size; 63699 let points = 0; 63700 for (let row = 0; row < size - 1; row++) { 63701 for (let col = 0; col < size - 1; col++) { 63702 const last = data.get(row, col) + data.get(row, col + 1) + data.get(row + 1, col) + data.get(row + 1, col + 1); 63703 if (last === 4 || last === 0) points++; 63704 } 63705 } 63706 return points * PenaltyScores.N2; 63707 }; 63708 exports.getPenaltyN3 = function getPenaltyN3(data) { 63709 const size = data.size; 63710 let points = 0; 63711 let bitsCol = 0; 63712 let bitsRow = 0; 63713 for (let row = 0; row < size; row++) { 63714 bitsCol = bitsRow = 0; 63715 for (let col = 0; col < size; col++) { 63716 bitsCol = bitsCol << 1 & 2047 | data.get(row, col); 63717 if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) points++; 63718 bitsRow = bitsRow << 1 & 2047 | data.get(col, row); 63719 if (col >= 10 && (bitsRow === 1488 || bitsRow === 93)) points++; 63720 } 63721 } 63722 return points * PenaltyScores.N3; 63723 }; 63724 exports.getPenaltyN4 = function getPenaltyN4(data) { 63725 let darkCount = 0; 63726 const modulesCount = data.data.length; 63727 for (let i2 = 0; i2 < modulesCount; i2++) darkCount += data.data[i2];
63728 const k2 = Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10); 63729 return k2 * PenaltyScores.N4; 63730 }; 63731 function getMaskAt(maskPattern2, i2, j2) { 63732 switch (maskPattern2) { 63733 case exports.Patterns.PATTERN000: 63734 return (i2 + j2) % 2 === 0; 63735 case exports.Patterns.PATTERN001: 63736 return i2 % 2 === 0; 63737 case exports.Patterns.PATTERN010: 63738 return j2 % 3 === 0; 63739 case exports.Patterns.PATTERN011: 63740 return (i2 + j2) % 3 === 0; 63741 case exports.Patterns.PATTERN100: 63742 return (Math.floor(i2 / 2) + Math.floor(j2 / 3)) % 2 === 0; 63743 case exports.Patterns.PATTERN101: 63744 return i2 * j2 % 2 + i2 * j2 % 3 === 0; 63745 case exports.Patterns.PATTERN110: 63746 return (i2 * j2 % 2 + i2 * j2 % 3) % 2 === 0; 63747 case exports.Patterns.PATTERN111: 63748 return (i2 * j2 % 3 + (i2 + j2) % 2) % 2 === 0; 63749 default: 63750 throw new Error("bad maskPattern:" + maskPattern2); 63751 } 63752 } 63753 exports.applyMask = function applyMask(pattern, data) { 63754 const size = data.size; 63755 for (let col = 0; col < size; col++) { 63756 for (let row = 0; row < size; row++) { 63757 if (data.isReserved(row, col)) continue; 63758 data.xor(row, col, getMaskAt(pattern, row, col)); 63759 } 63760 } 63761 }; 63762 exports.getBestMask = function getBestMask(data, setupFormatFunc) { 63763 const numPatterns = Object.keys(exports.Patterns).length; 63764 let bestPattern = 0; 63765 let lowerPenalty = Infinity; 63766 for (let p2 = 0; p2 < numPatterns; p2++) { 63767 setupFormatFunc(p2); 63768 exports.applyMask(p2, data); 63769 const penalty = exports.getPenaltyN1(data) + exports.getPenaltyN2(data) + exports.getPenaltyN3(data) + exports.getPenaltyN4(data); 63770 exports.applyMask(p2, data); 63771 if (penalty < lowerPenalty) { 63772 lowerPenalty = penalty; 63773 bestPattern = p2; 63774 } 63775 } 63776 return bestPattern; 63777 }; 63778 })(maskPattern); 63779 return maskPattern; 63780 } 63781 var errorCorrectionCode = {}; 63782 var hasRequiredErrorCorrectionCode; 63783 function requireErrorCorrectionCode() { 63784 if (hasRequiredErrorCorrectionCode) return errorCorrectionCode; 63785 hasRequiredErrorCorrectionCode = 1; 63786 const ECLevel = requireErrorCorrectionLevel(); 63787 const EC_BLOCKS_TABLE = [ 63788 // L M Q H 63789 1, 63790 1, 63791 1, 63792 1, 63793 1, 63794 1, 63795 1, 63796 1, 63797 1, 63798 1, 63799 2, 63800 2, 63801 1, 63802 2, 63803 2, 63804 4, 63805 1, 63806 2, 63807 4, 63808 4, 63809 2, 63810 4, 63811 4, 63812 4, 63813 2, 63814 4, 63815 6, 63816 5, 63817 2, 63818 4, 63819 6, 63820 6, 63821 2, 63822 5, 63823 8, 63824 8, 63825 4, 63826 5, 63827 8, 63828 8, 63829 4, 63830 5, 63831 8, 63832 11, 63833 4, 63834 8, 63835 10, 63836 11, 63837 4, 63838 9, 63839 12, 63840 16, 63841 4, 63842 9, 63843 16, 63844 16, 63845 6, 63846 10, 63847 12, 63848 18, 63849 6, 63850 10, 63851 17, 63852 16, 63853 6, 63854 11, 63855 16, 63856 19, 63857 6, 63858 13, 63859 18, 63860 21, 63861 7, 63862 14, 63863 21, 63864 25, 63865 8, 63866 16, 63867 20, 63868 25, 63869 8, 63870 17, 63871 23, 63872 25, 63873 9, 63874 17, 63875 23, 63876 34, 63877 9, 63878 18, 63879 25, 63880 30, 63881 10, 63882 20, 63883 27, 63884 32, 63885 12, 63886 21, 63887 29, 63888 35, 63889 12, 63890 23, 63891 34, 63892 37, 63893 12, 63894 25, 63895 34, 63896 40, 63897 13, 63898 26, 63899 35, 63900 42, 63901 14, 63902 28, 63903 38, 63904 45, 63905 15, 63906 29, 63907 40, 63908 48, 63909 16, 63910 31, 63911 43, 63912 51, 63913 17, 63914 33, 63915 45, 63916 54, 63917 18, 63918 35, 63919 48, 63920 57, 63921 19, 63922 37, 63923 51, 63924 60, 63925 19, 63926 38, 63927 53, 63928 63, 63929 20, 63930 40, 63931 56, 63932 66, 63933 21, 63934 43, 63935 59, 63936 70, 63937 22, 63938 45, 63939 62, 63940 74, 63941 24, 63942 47, 63943 65, 63944 77, 63945 25, 63946 49, 63947 68, 63948 81 63949 ]; 63950 const EC_CODEWORDS_TABLE = [ 63951 // L M Q H 63952 7, 63953 10, 63954 13, 63955 17, 63956 10, 63957 16, 63958 22, 63959 28, 63960 15, 63961 26, 63962 36, 63963 44, 63964 20, 63965 36, 63966 52, 63967 64, 63968 26, 63969 48, 63970 72, 63971 88, 63972 36, 63973 64, 63974 96, 63975 112, 63976 40, 63977 72, 63978 108, 63979 130, 63980 48, 63981 88, 63982 132, 63983 156, 63984 60, 63985 110, 63986 160, 63987 192, 63988 72, 63989 130, 63990 192, 63991 224, 63992 80, 63993 150, 63994 224, 63995 264, 63996 96, 63997 176, 63998 260, 63999 308, 64000 104, 64001 198, 64002 288, 64003 352, 64004 120, 64005 216, 64006 320, 64007 384, 64008 132, 64009 240, 64010 360, 64011 432, 64012 144, 64013 280, 64014 408, 64015 480, 64016 168, 64017 308, 64018 448, 64019 532, 64020 180, 64021 338, 64022 504, 64023 588, 64024 196, 64025 364, 64026 546, 64027 650, 64028 224, 64029 416, 64030 600, 64031 700, 64032 224, 64033 442, 64034 644, 64035 750, 64036 252, 64037 476, 64038 690, 64039 816, 64040 270, 64041 504, 64042 750, 64043 900, 64044 300, 64045 560, 64046 810, 64047 960, 64048 312, 64049 588, 64050 870, 64051 1050, 64052 336, 64053 644, 64054 952, 64055 1110, 64056 360, 64057 700, 64058 1020, 64059 1200, 64060 390, 64061 728, 64062 1050, 64063 1260, 64064 420, 64065 784, 64066 1140, 64067 1350, 64068 450, 64069 812, 64070 1200, 64071 1440, 64072 480, 64073 868, 64074 1290, 64075 1530, 64076 510, 64077 924, 64078 1350, 64079 1620, 64080 540, 64081 980, 64082 1440, 64083 1710, 64084 570, 64085 1036, 64086 1530, 64087 1800, 64088 570, 64089 1064, 64090 1590, 64091 1890, 64092 600, 64093 1120, 64094 1680, 64095 1980, 64096 630, 64097 1204, 64098 1770, 64099 2100, 64100 660, 64101 1260, 64102 1860, 64103 2220, 64104 720, 64105 1316, 64106 1950, 64107 2310, 64108 750, 64109 1372, 64110 2040, 64111 2430 64112 ]; 64113 errorCorrectionCode.getBlocksCount = function getBlocksCount(version2, errorCorrectionLevel2) { 64114 switch (errorCorrectionLevel2) { 64115 case ECLevel.L: 64116 return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 0]; 64117 case ECLevel.M: 64118 return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 1]; 64119 case ECLevel.Q: 64120 return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 2]; 64121 case ECLevel.H: 64122 return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 3]; 64123 default: 64124 return void 0; 64125 } 64126 }; 64127 errorCorrectionCode.getTotalCodewordsCount = function getTotalCodewordsCount(version2, errorCorrectionLevel2) { 64128 switch (errorCorrectionLevel2) { 64129 case ECLevel.L: 64130 return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 0]; 64131 case ECLevel.M: 64132 return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 1]; 64133 case ECLevel.Q: 64134 return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 2]; 64135 case ECLevel.H: 64136 return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 3]; 64137 default: 64138 return void 0; 64139 } 64140 }; 64141 return errorCorrectionCode; 64142 } 64143 var polynomial = {}; 64144 var galoisField = {}; 64145 var hasRequiredGaloisField; 64146 function requireGaloisField() { 64147 if (hasRequiredGaloisField) return galoisField; 64148 hasRequiredGaloisField = 1; 64149 const EXP_TABLE = new Uint8Array(512); 64150 const LOG_TABLE = new Uint8Array(256); 64151 (function initTables() { 64152 let x2 = 1; 64153 for (let i2 = 0; i2 < 255; i2++) { 64154 EXP_TABLE[i2] = x2; 64155 LOG_TABLE[x2] = i2; 64156 x2 <<= 1; 64157 if (x2 & 256) { 64158 x2 ^= 285; 64159 } 64160 } 64161 for (let i2 = 255; i2 < 512; i2++) { 64162 EXP_TABLE[i2] = EXP_TABLE[i2 - 255]; 64163 } 64164 })(); 64165 galoisField.log = function log2(n2) { 64166 if (n2 < 1) throw new Error("log(" + n2 + ")"); 64167 return LOG_TABLE[n2]; 64168 }; 64169 galoisField.exp = function exp(n2) { 64170 return EXP_TABLE[n2]; 64171 }; 64172 galoisField.mul = function mul(x2, y2) { 64173 if (x2 === 0 || y2 === 0) return 0; 64174 return EXP_TABLE[LOG_TABLE[x2] + LOG_TABLE[y2]]; 64175 }; 64176 return galoisField; 64177 } 64178 var hasRequiredPolynomial; 64179 function requirePolynomial() { 64180 if (hasRequiredPolynomial) return polynomial; 64181 hasRequiredPolynomial = 1; 64182 (function(exports) { 64183 const GF = requireGaloisField(); 64184 exports.mul = function mul(p1, p2) { 64185 const coeff = new Uint8Array(p1.length + p2.length - 1); 64186 for (let i2 = 0; i2 < p1.length; i2++) { 64187 for (let j2 = 0; j2 < p2.length; j2++) { 64188 coeff[i2 + j2] ^= GF.mul(p1[i2], p2[j2]); 64189 } 64190 } 64191 return coeff; 64192 }; 64193 exports.mod = function mod(divident, divisor) { 64194 let result = new Uint8Array(divident); 64195 while (result.length - divisor.length >= 0) { 64196 const coeff = result[0]; 64197 for (let i2 = 0; i2 < divisor.length; i2++) { 64198 result[i2] ^= GF.mul(divisor[i2], coeff); 64199 } 64200 let offset = 0; 64201 while (offset < result.length && result[offset] === 0) offset++; 64202 result = result.slice(offset); 64203 } 64204 return result; 64205 }; 64206 exports.generateECPolynomial = function generateECPolynomial(degree) { 64207 let poly = new Uint8Array([1]); 64208 for (let i2 = 0; i2 < degree; i2++) { 64209 poly = exports.mul(poly, new Uint8Array([1, GF.exp(i2)])); 64210 } 64211 return poly; 64212 }; 64213 })(polynomial); 64214 return polynomial; 64215 } 64216 var reedSolomonEncoder; 64217 var hasRequiredReedSolomonEncoder; 64218 function requireReedSolomonEncoder() { 64219 if (hasRequiredReedSolomonEncoder) return reedSolomonEncoder; 64220 hasRequiredReedSolomonEncoder = 1; 64221 const Polynomial = requirePolynomial(); 64222 function ReedSolomonEncoder(degree) { 64223 this.genPoly = void 0; 64224 this.degree = degree; 64225 if (this.degree) this.initialize(this.degree); 64226 } 64227 ReedSolomonEncoder.prototype.initialize = function initialize(degree) { 64228 this.degree = degree; 64229 this.genPoly = Polynomial.generateECPolynomial(this.degree); 64230 };
64231 ReedSolomonEncoder.prototype.encode = function encode(data) { 64232 if (!this.genPoly) { 64233 throw new Error("Encoder not initialized"); 64234 } 64235 const paddedData = new Uint8Array(data.length + this.degree); 64236 paddedData.set(data); 64237 const remainder = Polynomial.mod(paddedData, this.genPoly); 64238 const start = this.degree - remainder.length; 64239 if (start > 0) { 64240 const buff = new Uint8Array(this.degree); 64241 buff.set(remainder, start); 64242 return buff; 64243 } 64244 return remainder; 64245 }; 64246 reedSolomonEncoder = ReedSolomonEncoder; 64247 return reedSolomonEncoder; 64248 } 64249 var version = {}; 64250 var mode = {}; 64251 var versionCheck = {}; 64252 var hasRequiredVersionCheck; 64253 function requireVersionCheck() { 64254 if (hasRequiredVersionCheck) return versionCheck; 64255 hasRequiredVersionCheck = 1; 64256 versionCheck.isValid = function isValid(version2) { 64257 return !isNaN(version2) && version2 >= 1 && version2 <= 40; 64258 }; 64259 return versionCheck; 64260 } 64261 var regex = {}; 64262 var hasRequiredRegex; 64263 function requireRegex() { 64264 if (hasRequiredRegex) return regex; 64265 hasRequiredRegex = 1; 64266 const numeric = "[0-9]+"; 64267 const alphanumeric = "[A-Z $%*+\\-./:]+"; 64268 let kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+"; 64269 kanji = kanji.replace(/u/g, "\\u"); 64270 const byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+"; 64271 regex.KANJI = new RegExp(kanji, "g"); 64272 regex.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"); 64273 regex.BYTE = new RegExp(byte, "g"); 64274 regex.NUMERIC = new RegExp(numeric, "g"); 64275 regex.ALPHANUMERIC = new RegExp(alphanumeric, "g"); 64276 const TEST_KANJI = new RegExp("^" + kanji + "$"); 64277 const TEST_NUMERIC = new RegExp("^" + numeric + "$"); 64278 const TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$"); 64279 regex.testKanji = function testKanji(str) { 64280 return TEST_KANJI.test(str); 64281 }; 64282 regex.testNumeric = function testNumeric(str) { 64283 return TEST_NUMERIC.test(str); 64284 }; 64285 regex.testAlphanumeric = function testAlphanumeric(str) { 64286 return TEST_ALPHANUMERIC.test(str); 64287 }; 64288 return regex; 64289 } 64290 var hasRequiredMode; 64291 function requireMode() { 64292 if (hasRequiredMode) return mode; 64293 hasRequiredMode = 1; 64294 (function(exports) { 64295 const VersionCheck = requireVersionCheck(); 64296 const Regex = requireRegex(); 64297 exports.NUMERIC = { 64298 id: "Numeric", 64299 bit: 1 << 0, 64300 ccBits: [10, 12, 14] 64301 }; 64302 exports.ALPHANUMERIC = { 64303 id: "Alphanumeric", 64304 bit: 1 << 1, 64305 ccBits: [9, 11, 13] 64306 }; 64307 exports.BYTE = { 64308 id: "Byte", 64309 bit: 1 << 2, 64310 ccBits: [8, 16, 16] 64311 }; 64312 exports.KANJI = { 64313 id: "Kanji", 64314 bit: 1 << 3, 64315 ccBits: [8, 10, 12] 64316 }; 64317 exports.MIXED = { 64318 bit: -1 64319 }; 64320 exports.getCharCountIndicator = function getCharCountIndicator(mode2, version2) { 64321 if (!mode2.ccBits) throw new Error("Invalid mode: " + mode2); 64322 if (!VersionCheck.isValid(version2)) { 64323 throw new Error("Invalid version: " + version2); 64324 } 64325 if (version2 >= 1 && version2 < 10) return mode2.ccBits[0]; 64326 else if (version2 < 27) return mode2.ccBits[1]; 64327 return mode2.ccBits[2]; 64328 }; 64329 exports.getBestModeForData = function getBestModeForData(dataStr) { 64330 if (Regex.testNumeric(dataStr)) return exports.NUMERIC; 64331 else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC; 64332 else if (Regex.testKanji(dataStr)) return exports.KANJI; 64333 else return exports.BYTE; 64334 }; 64335 exports.toString = function toString(mode2) { 64336 if (mode2 && mode2.id) return mode2.id; 64337 throw new Error("Invalid mode"); 64338 }; 64339 exports.isValid = function isValid(mode2) { 64340 return mode2 && mode2.bit && mode2.ccBits; 64341 }; 64342 function fromString(string) { 64343 if (typeof string !== "string") { 64344 throw new Error("Param is not a string"); 64345 } 64346 const lcStr = string.toLowerCase(); 64347 switch (lcStr) { 64348 case "numeric": 64349 return exports.NUMERIC; 64350 case "alphanumeric": 64351 return exports.ALPHANUMERIC; 64352 case "kanji": 64353 return exports.KANJI; 64354 case "byte": 64355 return exports.BYTE; 64356 default: 64357 throw new Error("Unknown mode: " + string); 64358 } 64359 } 64360 exports.from = function from(value, defaultValue2) { 64361 if (exports.isValid(value)) { 64362 return value; 64363 } 64364 try { 64365 return fromString(value); 64366 } catch (e2) { 64367 return defaultValue2; 64368 } 64369 }; 64370 })(mode); 64371 return mode; 64372 } 64373 var hasRequiredVersion; 64374 function requireVersion() { 64375 if (hasRequiredVersion) return version; 64376 hasRequiredVersion = 1; 64377 (function(exports) { 64378 const Utils2 = requireUtils$1(); 64379 const ECCode = requireErrorCorrectionCode(); 64380 const ECLevel = requireErrorCorrectionLevel(); 64381 const Mode = requireMode(); 64382 const VersionCheck = requireVersionCheck(); 64383 const G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0;
vendor: 4,097 bytes, lines 64384-64482
64384 const G18_BCH = Utils2.getBCHDigit(G18); 64385 function getBestVersionForDataLength(mode2, length, errorCorrectionLevel2) { 64386 for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { 64387 if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, mode2)) { 64388 return currentVersion; 64389 } 64390 } 64391 return void 0; 64392 } 64393 function getReservedBitsCount(mode2, version2) { 64394 return Mode.getCharCountIndicator(mode2, version2) + 4; 64395 } 64396 function getTotalBitsFromDataArray(segments2, version2) { 64397 let totalBits = 0; 64398 segments2.forEach(function(data) { 64399 const reservedBits = getReservedBitsCount(data.mode, version2); 64400 totalBits += reservedBits + data.getBitsLength(); 64401 }); 64402 return totalBits; 64403 } 64404 function getBestVersionForMixedData(segments2, errorCorrectionLevel2) { 64405 for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { 64406 const length = getTotalBitsFromDataArray(segments2, currentVersion); 64407 if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, Mode.MIXED)) { 64408 return currentVersion; 64409 } 64410 } 64411 return void 0; 64412 } 64413 exports.from = function from(value, defaultValue2) { 64414 if (VersionCheck.isValid(value)) { 64415 return parseInt(value, 10); 64416 } 64417 return defaultValue2; 64418 }; 64419 exports.getCapacity = function getCapacity(version2, errorCorrectionLevel2, mode2) { 64420 if (!VersionCheck.isValid(version2)) { 64421 throw new Error("Invalid QR Code version"); 64422 } 64423 if (typeof mode2 === "undefined") mode2 = Mode.BYTE; 64424 const totalCodewords = Utils2.getSymbolTotalCodewords(version2); 64425 const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); 64426 const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8; 64427 if (mode2 === Mode.MIXED) return dataTotalCodewordsBits; 64428 const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode2, version2); 64429 switch (mode2) { 64430 case Mode.NUMERIC: 64431 return Math.floor(usableBits / 10 * 3); 64432 case Mode.ALPHANUMERIC: 64433 return Math.floor(usableBits / 11 * 2); 64434 case Mode.KANJI: 64435 return Math.floor(usableBits / 13); 64436 case Mode.BYTE: 64437 default: 64438 return Math.floor(usableBits / 8); 64439 } 64440 }; 64441 exports.getBestVersionForData = function getBestVersionForData(data, errorCorrectionLevel2) { 64442 let seg; 64443 const ecl = ECLevel.from(errorCorrectionLevel2, ECLevel.M); 64444 if (Array.isArray(data)) { 64445 if (data.length > 1) { 64446 return getBestVersionForMixedData(data, ecl); 64447 } 64448 if (data.length === 0) { 64449 return 1; 64450 } 64451 seg = data[0]; 64452 } else { 64453 seg = data; 64454 } 64455 return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl); 64456 }; 64457 exports.getEncodedBits = function getEncodedBits(version2) { 64458 if (!VersionCheck.isValid(version2) || version2 < 7) { 64459 throw new Error("Invalid QR Code version"); 64460 } 64461 let d2 = version2 << 12; 64462 while (Utils2.getBCHDigit(d2) - G18_BCH >= 0) { 64463 d2 ^= G18 << Utils2.getBCHDigit(d2) - G18_BCH; 64464 } 64465 return version2 << 12 | d2; 64466 }; 64467 })(version); 64468 return version; 64469 } 64470 var formatInfo = {}; 64471 var hasRequiredFormatInfo; 64472 function requireFormatInfo() { 64473 if (hasRequiredFormatInfo) return formatInfo; 64474 hasRequiredFormatInfo = 1; 64475 const Utils2 = requireUtils$1(); 64476 const G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0; 64477 const G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1; 64478 const G15_BCH = Utils2.getBCHDigit(G15); 64479 formatInfo.getEncodedBits = function getEncodedBits(errorCorrectionLevel2, mask) { 64480 const data = errorCorrectionLevel2.bit << 3 | mask; 64481 let d2 = data << 10; 64482 while (Utils2.getBCHDigit(d2) - G15_BCH >= 0) {
64483 d2 ^= G15 << Utils2.getBCHDigit(d2) - G15_BCH; 64484 } 64485 return (data << 10 | d2) ^ G15_MASK; 64486 }; 64487 return formatInfo; 64488 } 64489 var segments = {}; 64490 var numericData; 64491 var hasRequiredNumericData; 64492 function requireNumericData() { 64493 if (hasRequiredNumericData) return numericData; 64494 hasRequiredNumericData = 1; 64495 const Mode = requireMode(); 64496 function NumericData(data) { 64497 this.mode = Mode.NUMERIC; 64498 this.data = data.toString(); 64499 } 64500 NumericData.getBitsLength = function getBitsLength(length) { 64501 return 10 * Math.floor(length / 3) + (length % 3 ? length % 3 * 3 + 1 : 0); 64502 }; 64503 NumericData.prototype.getLength = function getLength() { 64504 return this.data.length; 64505 }; 64506 NumericData.prototype.getBitsLength = function getBitsLength() { 64507 return NumericData.getBitsLength(this.data.length); 64508 }; 64509 NumericData.prototype.write = function write2(bitBuffer2) { 64510 let i2, group, value; 64511 for (i2 = 0; i2 + 3 <= this.data.length; i2 += 3) { 64512 group = this.data.substr(i2, 3); 64513 value = parseInt(group, 10); 64514 bitBuffer2.put(value, 10); 64515 } 64516 const remainingNum = this.data.length - i2; 64517 if (remainingNum > 0) { 64518 group = this.data.substr(i2); 64519 value = parseInt(group, 10); 64520 bitBuffer2.put(value, remainingNum * 3 + 1); 64521 } 64522 }; 64523 numericData = NumericData; 64524 return numericData; 64525 } 64526 var alphanumericData; 64527 var hasRequiredAlphanumericData; 64528 function requireAlphanumericData() { 64529 if (hasRequiredAlphanumericData) return alphanumericData; 64530 hasRequiredAlphanumericData = 1; 64531 const Mode = requireMode(); 64532 const ALPHA_NUM_CHARS = [ 64533 "0", 64534 "1", 64535 "2", 64536 "3", 64537 "4", 64538 "5", 64539 "6", 64540 "7", 64541 "8", 64542 "9", 64543 "A", 64544 "B", 64545 "C", 64546 "D", 64547 "E", 64548 "F", 64549 "G", 64550 "H", 64551 "I", 64552 "J", 64553 "K", 64554 "L", 64555 "M", 64556 "N", 64557 "O", 64558 "P", 64559 "Q", 64560 "R", 64561 "S", 64562 "T", 64563 "U", 64564 "V", 64565 "W", 64566 "X", 64567 "Y", 64568 "Z", 64569 " ", 64570 "$", 64571 "%", 64572 "*", 64573 "+", 64574 "-", 64575 ".", 64576 "/", 64577 ":" 64578 ]; 64579 function AlphanumericData(data) { 64580 this.mode = Mode.ALPHANUMERIC; 64581 this.data = data; 64582 } 64583 AlphanumericData.getBitsLength = function getBitsLength(length) { 64584 return 11 * Math.floor(length / 2) + 6 * (length % 2); 64585 }; 64586 AlphanumericData.prototype.getLength = function getLength() { 64587 return this.data.length; 64588 }; 64589 AlphanumericData.prototype.getBitsLength = function getBitsLength() { 64590 return AlphanumericData.getBitsLength(this.data.length); 64591 }; 64592 AlphanumericData.prototype.write = function write2(bitBuffer2) { 64593 let i2; 64594 for (i2 = 0; i2 + 2 <= this.data.length; i2 += 2) { 64595 let value = ALPHA_NUM_CHARS.indexOf(this.data[i2]) * 45; 64596 value += ALPHA_NUM_CHARS.indexOf(this.data[i2 + 1]); 64597 bitBuffer2.put(value, 11); 64598 } 64599 if (this.data.length % 2) { 64600 bitBuffer2.put(ALPHA_NUM_CHARS.indexOf(this.data[i2]), 6); 64601 } 64602 }; 64603 alphanumericData = AlphanumericData; 64604 return alphanumericData; 64605 } 64606 var byteData; 64607 var hasRequiredByteData; 64608 function requireByteData() { 64609 if (hasRequiredByteData) return byteData; 64610 hasRequiredByteData = 1; 64611 const Mode = requireMode(); 64612 function ByteData(data) { 64613 this.mode = Mode.BYTE; 64614 if (typeof data === "string") { 64615 this.data = new TextEncoder().encode(data); 64616 } else { 64617 this.data = new Uint8Array(data); 64618 } 64619 } 64620 ByteData.getBitsLength = function getBitsLength(length) { 64621 return length * 8; 64622 }; 64623 ByteData.prototype.getLength = function getLength() { 64624 return this.data.length; 64625 }; 64626 ByteData.prototype.getBitsLength = function getBitsLength() { 64627 return ByteData.getBitsLength(this.data.length); 64628 }; 64629 ByteData.prototype.write = function(bitBuffer2) { 64630 for (let i2 = 0, l2 = this.data.length; i2 < l2; i2++) { 64631 bitBuffer2.put(this.data[i2], 8); 64632 } 64633 }; 64634 byteData = ByteData; 64635 return byteData; 64636 } 64637 var kanjiData; 64638 var hasRequiredKanjiData; 64639 function requireKanjiData() { 64640 if (hasRequiredKanjiData) return kanjiData; 64641 hasRequiredKanjiData = 1; 64642 const Mode = requireMode(); 64643 const Utils2 = requireUtils$1(); 64644 function KanjiData(data) { 64645 this.mode = Mode.KANJI; 64646 this.data = data; 64647 } 64648 KanjiData.getBitsLength = function getBitsLength(length) { 64649 return length * 13; 64650 }; 64651 KanjiData.prototype.getLength = function getLength() { 64652 return this.data.length; 64653 }; 64654 KanjiData.prototype.getBitsLength = function getBitsLength() { 64655 return KanjiData.getBitsLength(this.data.length); 64656 }; 64657 KanjiData.prototype.write = function(bitBuffer2) { 64658 let i2; 64659 for (i2 = 0; i2 < this.data.length; i2++) { 64660 let value = Utils2.toSJIS(this.data[i2]); 64661 if (value >= 33088 && value <= 40956) { 64662 value -= 33088; 64663 } else if (value >= 57408 && value <= 60351) { 64664 value -= 49472; 64665 } else { 64666 throw new Error( 64667 "Invalid SJIS character: " + this.data[i2] + "\nMake sure your charset is UTF-8" 64668 ); 64669 } 64670 value = (value >>> 8 & 255) * 192 + (value & 255); 64671 bitBuffer2.put(value, 13); 64672 } 64673 }; 64674 kanjiData = KanjiData; 64675 return kanjiData; 64676 } 64677 var dijkstra = { exports: {} }; 64678 var hasRequiredDijkstra; 64679 function requireDijkstra() { 64680 if (hasRequiredDijkstra) return dijkstra.exports; 64681 hasRequiredDijkstra = 1; 64682 (function(module) { 64683 var dijkstra2 = { 64684 single_source_shortest_paths: function(graph, s2, d2) { 64685 var predecessors = {}; 64686 var costs = {}; 64687 costs[s2] = 0; 64688 var open = dijkstra2.PriorityQueue.make(); 64689 open.push(s2, 0); 64690 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; 64691 while (!open.empty()) { 64692 closest = open.pop(); 64693 u2 = closest.value; 64694 cost_of_s_to_u = closest.cost; 64695 adjacent_nodes = graph[u2] || {}; 64696 for (v2 in adjacent_nodes) { 64697 if (adjacent_nodes.hasOwnProperty(v2)) { 64698 cost_of_e = adjacent_nodes[v2]; 64699 cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e; 64700 cost_of_s_to_v = costs[v2]; 64701 first_visit = typeof costs[v2] === "undefined"; 64702 if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) { 64703 costs[v2] = cost_of_s_to_u_plus_cost_of_e; 64704 open.push(v2, cost_of_s_to_u_plus_cost_of_e); 64705 predecessors[v2] = u2; 64706 } 64707 } 64708 } 64709 } 64710 if (typeof d2 !== "undefined" && typeof costs[d2] === "undefined") { 64711 var msg = ["Could not find a path from ", s2, " to ", d2, "."].join(""); 64712 throw new Error(msg); 64713 } 64714 return predecessors; 64715 }, 64716 extract_shortest_path_from_predecessor_list: function(predecessors, d2) { 64717 var nodes = []; 64718 var u2 = d2; 64719 while (u2) { 64720 nodes.push(u2); 64721 predecessors[u2]; 64722 u2 = predecessors[u2]; 64723 } 64724 nodes.reverse(); 64725 return nodes; 64726 }, 64727 find_path: function(graph, s2, d2) { 64728 var predecessors = dijkstra2.single_source_shortest_paths(graph, s2, d2); 64729 return dijkstra2.extract_shortest_path_from_predecessor_list( 64730 predecessors, 64731 d2 64732 ); 64733 }, 64734 /** 64735 * A very naive priority queue implementation. 64736 */ 64737 PriorityQueue: { 64738 make: function(opts) { 64739 var T = dijkstra2.PriorityQueue, t2 = {}, key; 64740 opts = opts || {}; 64741 for (key in T) { 64742 if (T.hasOwnProperty(key)) { 64743 t2[key] = T[key]; 64744 } 64745 } 64746 t2.queue = []; 64747 t2.sorter = opts.sorter || T.default_sorter; 64748 return t2; 64749 }, 64750 default_sorter: function(a2, b2) { 64751 return a2.cost - b2.cost; 64752 }, 64753 /** 64754 * Add a new item to the queue and ensure the highest priority element 64755 * is at the front of the queue. 64756 */ 64757 push: function(value, cost) { 64758 var item = { value, cost }; 64759 this.queue.push(item); 64760 this.queue.sort(this.sorter); 64761 }, 64762 /** 64763 * Return the highest priority element in the queue. 64764 */ 64765 pop: function() { 64766 return this.queue.shift(); 64767 }, 64768 empty: function() { 64769 return this.queue.length === 0; 64770 } 64771 } 64772 }; 64773 { 64774 module.exports = dijkstra2; 64775 } 64776 })(dijkstra); 64777 return dijkstra.exports; 64778 } 64779 var hasRequiredSegments; 64780 function requireSegments() { 64781 if (hasRequiredSegments) return segments; 64782 hasRequiredSegments = 1; 64783 (function(exports) { 64784 const Mode = requireMode(); 64785 const NumericData = requireNumericData();
vendor: 26,944 bytes, lines 64786-65491
64786 const AlphanumericData = requireAlphanumericData(); 64787 const ByteData = requireByteData(); 64788 const KanjiData = requireKanjiData(); 64789 const Regex = requireRegex(); 64790 const Utils2 = requireUtils$1(); 64791 const dijkstra2 = requireDijkstra(); 64792 function getStringByteLength(str) { 64793 return unescape(encodeURIComponent(str)).length; 64794 } 64795 function getSegments(regex2, mode2, str) { 64796 const segments2 = []; 64797 let result; 64798 while ((result = regex2.exec(str)) !== null) { 64799 segments2.push({ 64800 data: result[0], 64801 index: result.index, 64802 mode: mode2, 64803 length: result[0].length 64804 }); 64805 } 64806 return segments2; 64807 } 64808 function getSegmentsFromString(dataStr) { 64809 const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr); 64810 const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr); 64811 let byteSegs; 64812 let kanjiSegs; 64813 if (Utils2.isKanjiModeEnabled()) { 64814 byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr); 64815 kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr); 64816 } else { 64817 byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr); 64818 kanjiSegs = []; 64819 } 64820 const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs); 64821 return segs.sort(function(s1, s2) { 64822 return s1.index - s2.index; 64823 }).map(function(obj) { 64824 return { 64825 data: obj.data, 64826 mode: obj.mode, 64827 length: obj.length 64828 }; 64829 }); 64830 } 64831 function getSegmentBitsLength(length, mode2) { 64832 switch (mode2) { 64833 case Mode.NUMERIC: 64834 return NumericData.getBitsLength(length); 64835 case Mode.ALPHANUMERIC: 64836 return AlphanumericData.getBitsLength(length); 64837 case Mode.KANJI: 64838 return KanjiData.getBitsLength(length); 64839 case Mode.BYTE: 64840 return ByteData.getBitsLength(length); 64841 } 64842 } 64843 function mergeSegments(segs) { 64844 return segs.reduce(function(acc, curr) { 64845 const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null; 64846 if (prevSeg && prevSeg.mode === curr.mode) { 64847 acc[acc.length - 1].data += curr.data; 64848 return acc; 64849 } 64850 acc.push(curr); 64851 return acc; 64852 }, []); 64853 } 64854 function buildNodes(segs) { 64855 const nodes = []; 64856 for (let i2 = 0; i2 < segs.length; i2++) { 64857 const seg = segs[i2]; 64858 switch (seg.mode) { 64859 case Mode.NUMERIC: 64860 nodes.push([ 64861 seg, 64862 { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length }, 64863 { data: seg.data, mode: Mode.BYTE, length: seg.length } 64864 ]); 64865 break; 64866 case Mode.ALPHANUMERIC: 64867 nodes.push([ 64868 seg, 64869 { data: seg.data, mode: Mode.BYTE, length: seg.length } 64870 ]); 64871 break; 64872 case Mode.KANJI: 64873 nodes.push([ 64874 seg, 64875 { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) } 64876 ]); 64877 break; 64878 case Mode.BYTE: 64879 nodes.push([ 64880 { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) } 64881 ]); 64882 } 64883 } 64884 return nodes; 64885 } 64886 function buildGraph(nodes, version2) { 64887 const table = {}; 64888 const graph = { start: {} }; 64889 let prevNodeIds = ["start"]; 64890 for (let i2 = 0; i2 < nodes.length; i2++) { 64891 const nodeGroup = nodes[i2]; 64892 const currentNodeIds = []; 64893 for (let j2 = 0; j2 < nodeGroup.length; j2++) { 64894 const node = nodeGroup[j2]; 64895 const key = "" + i2 + j2; 64896 currentNodeIds.push(key); 64897 table[key] = { node, lastCount: 0 }; 64898 graph[key] = {}; 64899 for (let n2 = 0; n2 < prevNodeIds.length; n2++) { 64900 const prevNodeId = prevNodeIds[n2]; 64901 if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) { 64902 graph[prevNodeId][key] = getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node.mode); 64903 table[prevNodeId].lastCount += node.length; 64904 } else { 64905 if (table[prevNodeId]) table[prevNodeId].lastCount = node.length; 64906 graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) + 4 + Mode.getCharCountIndicator(node.mode, version2); 64907 } 64908 } 64909 } 64910 prevNodeIds = currentNodeIds; 64911 } 64912 for (let n2 = 0; n2 < prevNodeIds.length; n2++) { 64913 graph[prevNodeIds[n2]].end = 0; 64914 } 64915 return { map: graph, table }; 64916 } 64917 function buildSingleSegment(data, modesHint) { 64918 let mode2; 64919 const bestMode = Mode.getBestModeForData(data); 64920 mode2 = Mode.from(modesHint, bestMode); 64921 if (mode2 !== Mode.BYTE && mode2.bit < bestMode.bit) { 64922 throw new Error('"' + data + '" cannot be encoded with mode ' + Mode.toString(mode2) + ".\n Suggested mode is: " + Mode.toString(bestMode)); 64923 } 64924 if (mode2 === Mode.KANJI && !Utils2.isKanjiModeEnabled()) { 64925 mode2 = Mode.BYTE; 64926 } 64927 switch (mode2) { 64928 case Mode.NUMERIC: 64929 return new NumericData(data); 64930 case Mode.ALPHANUMERIC: 64931 return new AlphanumericData(data); 64932 case Mode.KANJI: 64933 return new KanjiData(data); 64934 case Mode.BYTE: 64935 return new ByteData(data); 64936 } 64937 } 64938 exports.fromArray = function fromArray(array) { 64939 return array.reduce(function(acc, seg) { 64940 if (typeof seg === "string") { 64941 acc.push(buildSingleSegment(seg, null)); 64942 } else if (seg.data) { 64943 acc.push(buildSingleSegment(seg.data, seg.mode)); 64944 } 64945 return acc; 64946 }, []); 64947 }; 64948 exports.fromString = function fromString(data, version2) { 64949 const segs = getSegmentsFromString(data, Utils2.isKanjiModeEnabled()); 64950 const nodes = buildNodes(segs); 64951 const graph = buildGraph(nodes, version2); 64952 const path = dijkstra2.find_path(graph.map, "start", "end"); 64953 const optimizedSegs = []; 64954 for (let i2 = 1; i2 < path.length - 1; i2++) { 64955 optimizedSegs.push(graph.table[path[i2]].node); 64956 } 64957 return exports.fromArray(mergeSegments(optimizedSegs)); 64958 }; 64959 exports.rawSplit = function rawSplit(data) { 64960 return exports.fromArray( 64961 getSegmentsFromString(data, Utils2.isKanjiModeEnabled()) 64962 ); 64963 }; 64964 })(segments); 64965 return segments; 64966 } 64967 var hasRequiredQrcode; 64968 function requireQrcode() { 64969 if (hasRequiredQrcode) return qrcode; 64970 hasRequiredQrcode = 1; 64971 const Utils2 = requireUtils$1(); 64972 const ECLevel = requireErrorCorrectionLevel(); 64973 const BitBuffer = requireBitBuffer(); 64974 const BitMatrix = requireBitMatrix(); 64975 const AlignmentPattern = requireAlignmentPattern(); 64976 const FinderPattern = requireFinderPattern(); 64977 const MaskPattern = requireMaskPattern(); 64978 const ECCode = requireErrorCorrectionCode(); 64979 const ReedSolomonEncoder = requireReedSolomonEncoder(); 64980 const Version = requireVersion(); 64981 const FormatInfo = requireFormatInfo(); 64982 const Mode = requireMode(); 64983 const Segments = requireSegments(); 64984 function setupFinderPattern(matrix, version2) { 64985 const size = matrix.size; 64986 const pos = FinderPattern.getPositions(version2); 64987 for (let i2 = 0; i2 < pos.length; i2++) { 64988 const row = pos[i2][0]; 64989 const col = pos[i2][1]; 64990 for (let r2 = -1; r2 <= 7; r2++) { 64991 if (row + r2 <= -1 || size <= row + r2) continue; 64992 for (let c2 = -1; c2 <= 7; c2++) { 64993 if (col + c2 <= -1 || size <= col + c2) continue; 64994 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) { 64995 matrix.set(row + r2, col + c2, true, true); 64996 } else { 64997 matrix.set(row + r2, col + c2, false, true); 64998 } 64999 } 65000 } 65001 } 65002 } 65003 function setupTimingPattern(matrix) { 65004 const size = matrix.size; 65005 for (let r2 = 8; r2 < size - 8; r2++) { 65006 const value = r2 % 2 === 0; 65007 matrix.set(r2, 6, value, true); 65008 matrix.set(6, r2, value, true); 65009 } 65010 } 65011 function setupAlignmentPattern(matrix, version2) { 65012 const pos = AlignmentPattern.getPositions(version2); 65013 for (let i2 = 0; i2 < pos.length; i2++) { 65014 const row = pos[i2][0]; 65015 const col = pos[i2][1]; 65016 for (let r2 = -2; r2 <= 2; r2++) { 65017 for (let c2 = -2; c2 <= 2; c2++) { 65018 if (r2 === -2 || r2 === 2 || c2 === -2 || c2 === 2 || r2 === 0 && c2 === 0) { 65019 matrix.set(row + r2, col + c2, true, true); 65020 } else { 65021 matrix.set(row + r2, col + c2, false, true); 65022 } 65023 } 65024 } 65025 } 65026 } 65027 function setupVersionInfo(matrix, version2) { 65028 const size = matrix.size; 65029 const bits = Version.getEncodedBits(version2); 65030 let row, col, mod; 65031 for (let i2 = 0; i2 < 18; i2++) { 65032 row = Math.floor(i2 / 3); 65033 col = i2 % 3 + size - 8 - 3; 65034 mod = (bits >> i2 & 1) === 1; 65035 matrix.set(row, col, mod, true); 65036 matrix.set(col, row, mod, true); 65037 } 65038 } 65039 function setupFormatInfo(matrix, errorCorrectionLevel2, maskPattern2) { 65040 const size = matrix.size; 65041 const bits = FormatInfo.getEncodedBits(errorCorrectionLevel2, maskPattern2); 65042 let i2, mod; 65043 for (i2 = 0; i2 < 15; i2++) { 65044 mod = (bits >> i2 & 1) === 1; 65045 if (i2 < 6) { 65046 matrix.set(i2, 8, mod, true); 65047 } else if (i2 < 8) { 65048 matrix.set(i2 + 1, 8, mod, true); 65049 } else { 65050 matrix.set(size - 15 + i2, 8, mod, true); 65051 } 65052 if (i2 < 8) { 65053 matrix.set(8, size - i2 - 1, mod, true); 65054 } else if (i2 < 9) { 65055 matrix.set(8, 15 - i2 - 1 + 1, mod, true); 65056 } else { 65057 matrix.set(8, 15 - i2 - 1, mod, true); 65058 } 65059 } 65060 matrix.set(size - 8, 8, 1, true); 65061 } 65062 function setupData(matrix, data) { 65063 const size = matrix.size; 65064 let inc = -1; 65065 let row = size - 1; 65066 let bitIndex = 7; 65067 let byteIndex = 0; 65068 for (let col = size - 1; col > 0; col -= 2) { 65069 if (col === 6) col--; 65070 while (true) { 65071 for (let c2 = 0; c2 < 2; c2++) { 65072 if (!matrix.isReserved(row, col - c2)) { 65073 let dark2 = false; 65074 if (byteIndex < data.length) { 65075 dark2 = (data[byteIndex] >>> bitIndex & 1) === 1; 65076 } 65077 matrix.set(row, col - c2, dark2); 65078 bitIndex--; 65079 if (bitIndex === -1) { 65080 byteIndex++; 65081 bitIndex = 7; 65082 } 65083 } 65084 } 65085 row += inc; 65086 if (row < 0 || size <= row) { 65087 row -= inc; 65088 inc = -inc; 65089 break; 65090 } 65091 } 65092 } 65093 } 65094 function createData(version2, errorCorrectionLevel2, segments2) { 65095 const buffer = new BitBuffer(); 65096 segments2.forEach(function(data) { 65097 buffer.put(data.mode.bit, 4); 65098 buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version2)); 65099 data.write(buffer); 65100 }); 65101 const totalCodewords = Utils2.getSymbolTotalCodewords(version2); 65102 const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); 65103 const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8; 65104 if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) { 65105 buffer.put(0, 4); 65106 } 65107 while (buffer.getLengthInBits() % 8 !== 0) { 65108 buffer.putBit(0); 65109 } 65110 const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8; 65111 for (let i2 = 0; i2 < remainingByte; i2++) { 65112 buffer.put(i2 % 2 ? 17 : 236, 8); 65113 } 65114 return createCodewords(buffer, version2, errorCorrectionLevel2); 65115 } 65116 function createCodewords(bitBuffer2, version2, errorCorrectionLevel2) { 65117 const totalCodewords = Utils2.getSymbolTotalCodewords(version2); 65118 const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); 65119 const dataTotalCodewords = totalCodewords - ecTotalCodewords; 65120 const ecTotalBlocks = ECCode.getBlocksCount(version2, errorCorrectionLevel2); 65121 const blocksInGroup2 = totalCodewords % ecTotalBlocks; 65122 const blocksInGroup1 = ecTotalBlocks - blocksInGroup2; 65123 const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks); 65124 const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks); 65125 const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1; 65126 const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1; 65127 const rs = new ReedSolomonEncoder(ecCount); 65128 let offset = 0; 65129 const dcData = new Array(ecTotalBlocks); 65130 const ecData = new Array(ecTotalBlocks); 65131 let maxDataSize = 0; 65132 const buffer = new Uint8Array(bitBuffer2.buffer); 65133 for (let b2 = 0; b2 < ecTotalBlocks; b2++) { 65134 const dataSize = b2 < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2; 65135 dcData[b2] = buffer.slice(offset, offset + dataSize); 65136 ecData[b2] = rs.encode(dcData[b2]); 65137 offset += dataSize; 65138 maxDataSize = Math.max(maxDataSize, dataSize); 65139 } 65140 const data = new Uint8Array(totalCodewords); 65141 let index = 0; 65142 let i2, r2; 65143 for (i2 = 0; i2 < maxDataSize; i2++) { 65144 for (r2 = 0; r2 < ecTotalBlocks; r2++) { 65145 if (i2 < dcData[r2].length) { 65146 data[index++] = dcData[r2][i2]; 65147 } 65148 } 65149 } 65150 for (i2 = 0; i2 < ecCount; i2++) { 65151 for (r2 = 0; r2 < ecTotalBlocks; r2++) { 65152 data[index++] = ecData[r2][i2]; 65153 } 65154 } 65155 return data; 65156 } 65157 function createSymbol(data, version2, errorCorrectionLevel2, maskPattern2) { 65158 let segments2; 65159 if (Array.isArray(data)) { 65160 segments2 = Segments.fromArray(data); 65161 } else if (typeof data === "string") { 65162 let estimatedVersion = version2; 65163 if (!estimatedVersion) { 65164 const rawSegments = Segments.rawSplit(data); 65165 estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel2); 65166 } 65167 segments2 = Segments.fromString(data, estimatedVersion || 40); 65168 } else { 65169 throw new Error("Invalid data"); 65170 } 65171 const bestVersion = Version.getBestVersionForData(segments2, errorCorrectionLevel2); 65172 if (!bestVersion) { 65173 throw new Error("The amount of data is too big to be stored in a QR Code"); 65174 } 65175 if (!version2) { 65176 version2 = bestVersion; 65177 } else if (version2 < bestVersion) { 65178 throw new Error( 65179 "\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + bestVersion + ".\n" 65180 ); 65181 } 65182 const dataBits = createData(version2, errorCorrectionLevel2, segments2); 65183 const moduleCount = Utils2.getSymbolSize(version2); 65184 const modules2 = new BitMatrix(moduleCount); 65185 setupFinderPattern(modules2, version2); 65186 setupTimingPattern(modules2); 65187 setupAlignmentPattern(modules2, version2); 65188 setupFormatInfo(modules2, errorCorrectionLevel2, 0); 65189 if (version2 >= 7) { 65190 setupVersionInfo(modules2, version2); 65191 } 65192 setupData(modules2, dataBits); 65193 if (isNaN(maskPattern2)) { 65194 maskPattern2 = MaskPattern.getBestMask( 65195 modules2, 65196 setupFormatInfo.bind(null, modules2, errorCorrectionLevel2) 65197 ); 65198 } 65199 MaskPattern.applyMask(maskPattern2, modules2); 65200 setupFormatInfo(modules2, errorCorrectionLevel2, maskPattern2); 65201 return { 65202 modules: modules2, 65203 version: version2, 65204 errorCorrectionLevel: errorCorrectionLevel2, 65205 maskPattern: maskPattern2, 65206 segments: segments2 65207 }; 65208 } 65209 qrcode.create = function create2(data, options) { 65210 if (typeof data === "undefined" || data === "") { 65211 throw new Error("No input text"); 65212 } 65213 let errorCorrectionLevel2 = ECLevel.M; 65214 let version2; 65215 let mask; 65216 if (typeof options !== "undefined") { 65217 errorCorrectionLevel2 = ECLevel.from(options.errorCorrectionLevel, ECLevel.M); 65218 version2 = Version.from(options.version); 65219 mask = MaskPattern.from(options.maskPattern); 65220 if (options.toSJISFunc) { 65221 Utils2.setToSJISFunction(options.toSJISFunc); 65222 } 65223 } 65224 return createSymbol(data, version2, errorCorrectionLevel2, mask); 65225 }; 65226 return qrcode; 65227 } 65228 var canvas = {}; 65229 var utils = {}; 65230 var hasRequiredUtils; 65231 function requireUtils() { 65232 if (hasRequiredUtils) return utils; 65233 hasRequiredUtils = 1; 65234 (function(exports) { 65235 function hex2rgba(hex) { 65236 if (typeof hex === "number") { 65237 hex = hex.toString(); 65238 } 65239 if (typeof hex !== "string") { 65240 throw new Error("Color should be defined as hex string"); 65241 } 65242 let hexCode = hex.slice().replace("#", "").split(""); 65243 if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) { 65244 throw new Error("Invalid hex color: " + hex); 65245 } 65246 if (hexCode.length === 3 || hexCode.length === 4) { 65247 hexCode = Array.prototype.concat.apply([], hexCode.map(function(c2) { 65248 return [c2, c2]; 65249 })); 65250 } 65251 if (hexCode.length === 6) hexCode.push("F", "F"); 65252 const hexValue = parseInt(hexCode.join(""), 16); 65253 return { 65254 r: hexValue >> 24 & 255, 65255 g: hexValue >> 16 & 255, 65256 b: hexValue >> 8 & 255, 65257 a: hexValue & 255, 65258 hex: "#" + hexCode.slice(0, 6).join("") 65259 }; 65260 } 65261 exports.getOptions = function getOptions(options) { 65262 if (!options) options = {}; 65263 if (!options.color) options.color = {}; 65264 const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin; 65265 const width = options.width && options.width >= 21 ? options.width : void 0; 65266 const scale = options.scale || 4; 65267 return { 65268 width, 65269 scale: width ? 4 : scale, 65270 margin, 65271 color: { 65272 dark: hex2rgba(options.color.dark || "#000000ff"), 65273 light: hex2rgba(options.color.light || "#ffffffff") 65274 }, 65275 type: options.type, 65276 rendererOpts: options.rendererOpts || {} 65277 }; 65278 }; 65279 exports.getScale = function getScale(qrSize, opts) { 65280 return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale; 65281 }; 65282 exports.getImageWidth = function getImageWidth(qrSize, opts) { 65283 const scale = exports.getScale(qrSize, opts); 65284 return Math.floor((qrSize + opts.margin * 2) * scale); 65285 }; 65286 exports.qrToImageData = function qrToImageData(imgData, qr, opts) { 65287 const size = qr.modules.size; 65288 const data = qr.modules.data; 65289 const scale = exports.getScale(size, opts); 65290 const symbolSize = Math.floor((size + opts.margin * 2) * scale); 65291 const scaledMargin = opts.margin * scale; 65292 const palette = [opts.color.light, opts.color.dark]; 65293 for (let i2 = 0; i2 < symbolSize; i2++) { 65294 for (let j2 = 0; j2 < symbolSize; j2++) { 65295 let posDst = (i2 * symbolSize + j2) * 4; 65296 let pxColor = opts.color.light; 65297 if (i2 >= scaledMargin && j2 >= scaledMargin && i2 < symbolSize - scaledMargin && j2 < symbolSize - scaledMargin) { 65298 const iSrc = Math.floor((i2 - scaledMargin) / scale); 65299 const jSrc = Math.floor((j2 - scaledMargin) / scale); 65300 pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0]; 65301 } 65302 imgData[posDst++] = pxColor.r; 65303 imgData[posDst++] = pxColor.g; 65304 imgData[posDst++] = pxColor.b; 65305 imgData[posDst] = pxColor.a; 65306 } 65307 } 65308 }; 65309 })(utils); 65310 return utils; 65311 } 65312 var hasRequiredCanvas; 65313 function requireCanvas() { 65314 if (hasRequiredCanvas) return canvas; 65315 hasRequiredCanvas = 1; 65316 (function(exports) { 65317 const Utils2 = requireUtils(); 65318 function clearCanvas(ctx, canvas2, size) { 65319 ctx.clearRect(0, 0, canvas2.width, canvas2.height); 65320 if (!canvas2.style) canvas2.style = {}; 65321 canvas2.height = size; 65322 canvas2.width = size; 65323 canvas2.style.height = size + "px"; 65324 canvas2.style.width = size + "px"; 65325 } 65326 function getCanvasElement() { 65327 try { 65328 return document.createElement("canvas"); 65329 } catch (e2) { 65330 throw new Error("You need to specify a canvas element"); 65331 } 65332 } 65333 exports.render = function render(qrData, canvas2, options) { 65334 let opts = options; 65335 let canvasEl = canvas2; 65336 if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { 65337 opts = canvas2; 65338 canvas2 = void 0; 65339 } 65340 if (!canvas2) { 65341 canvasEl = getCanvasElement(); 65342 } 65343 opts = Utils2.getOptions(opts); 65344 const size = Utils2.getImageWidth(qrData.modules.size, opts); 65345 const ctx = canvasEl.getContext("2d"); 65346 const image = ctx.createImageData(size, size); 65347 Utils2.qrToImageData(image.data, qrData, opts); 65348 clearCanvas(ctx, canvasEl, size); 65349 ctx.putImageData(image, 0, 0); 65350 return canvasEl; 65351 }; 65352 exports.renderToDataURL = function renderToDataURL(qrData, canvas2, options) { 65353 let opts = options; 65354 if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { 65355 opts = canvas2; 65356 canvas2 = void 0; 65357 } 65358 if (!opts) opts = {}; 65359 const canvasEl = exports.render(qrData, canvas2, opts); 65360 const type = opts.type || "image/png"; 65361 const rendererOpts = opts.rendererOpts || {}; 65362 return canvasEl.toDataURL(type, rendererOpts.quality); 65363 }; 65364 })(canvas); 65365 return canvas; 65366 } 65367 var svgTag = {}; 65368 var hasRequiredSvgTag; 65369 function requireSvgTag() { 65370 if (hasRequiredSvgTag) return svgTag; 65371 hasRequiredSvgTag = 1; 65372 const Utils2 = requireUtils(); 65373 function getColorAttrib(color, attrib) { 65374 const alpha = color.a / 255; 65375 const str = attrib + '="' + color.hex + '"'; 65376 return alpha < 1 ? str + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str; 65377 } 65378 function svgCmd(cmd, x2, y2) { 65379 let str = cmd + x2; 65380 if (typeof y2 !== "undefined") str += " " + y2; 65381 return str; 65382 } 65383 function qrToPath(data, size, margin) { 65384 let path = ""; 65385 let moveBy = 0; 65386 let newRow = false; 65387 let lineLength = 0; 65388 for (let i2 = 0; i2 < data.length; i2++) { 65389 const col = Math.floor(i2 % size); 65390 const row = Math.floor(i2 / size); 65391 if (!col && !newRow) newRow = true; 65392 if (data[i2]) { 65393 lineLength++; 65394 if (!(i2 > 0 && col > 0 && data[i2 - 1])) { 65395 path += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0); 65396 moveBy = 0; 65397 newRow = false; 65398 } 65399 if (!(col + 1 < size && data[i2 + 1])) { 65400 path += svgCmd("h", lineLength); 65401 lineLength = 0; 65402 } 65403 } else { 65404 moveBy++; 65405 } 65406 } 65407 return path; 65408 } 65409 svgTag.render = function render(qrData, options, cb) { 65410 const opts = Utils2.getOptions(options); 65411 const size = qrData.modules.size; 65412 const data = qrData.modules.data; 65413 const qrcodesize = size + opts.margin * 2; 65414 const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + ' d="M0 0h' + qrcodesize + "v" + qrcodesize + 'H0z"/>'; 65415 const path = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size, opts.margin) + '"/>'; 65416 const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"'; 65417 const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" '; 65418 const svgTag2 = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path + "</svg>\n"; 65419 if (typeof cb === "function") { 65420 cb(null, svgTag2); 65421 } 65422 return svgTag2; 65423 }; 65424 return svgTag; 65425 } 65426 var hasRequiredBrowser; 65427 function requireBrowser() { 65428 if (hasRequiredBrowser) return browser; 65429 hasRequiredBrowser = 1; 65430 const canPromise2 = requireCanPromise(); 65431 const QRCode2 = requireQrcode(); 65432 const CanvasRenderer = requireCanvas(); 65433 const SvgRenderer = requireSvgTag(); 65434 function renderCanvas(renderFunc, canvas2, text, opts, cb) { 65435 const args = [].slice.call(arguments, 1); 65436 const argsNum = args.length; 65437 const isLastArgCb = typeof args[argsNum - 1] === "function"; 65438 if (!isLastArgCb && !canPromise2()) { 65439 throw new Error("Callback required as last argument"); 65440 } 65441 if (isLastArgCb) { 65442 if (argsNum < 2) { 65443 throw new Error("Too few arguments provided"); 65444 } 65445 if (argsNum === 2) { 65446 cb = text; 65447 text = canvas2; 65448 canvas2 = opts = void 0; 65449 } else if (argsNum === 3) { 65450 if (canvas2.getContext && typeof cb === "undefined") { 65451 cb = opts; 65452 opts = void 0; 65453 } else { 65454 cb = opts; 65455 opts = text; 65456 text = canvas2; 65457 canvas2 = void 0; 65458 } 65459 } 65460 } else { 65461 if (argsNum < 1) { 65462 throw new Error("Too few arguments provided"); 65463 } 65464 if (argsNum === 1) { 65465 text = canvas2; 65466 canvas2 = opts = void 0; 65467 } else if (argsNum === 2 && !canvas2.getContext) { 65468 opts = text; 65469 text = canvas2; 65470 canvas2 = void 0; 65471 } 65472 return new Promise(function(resolve, reject) { 65473 try { 65474 const data = QRCode2.create(text, opts); 65475 resolve(renderFunc(data, canvas2, opts)); 65476 } catch (e2) { 65477 reject(e2); 65478 } 65479 }); 65480 } 65481 try { 65482 const data = QRCode2.create(text, opts); 65483 cb(null, renderFunc(data, canvas2, opts)); 65484 } catch (e2) { 65485 cb(e2); 65486 } 65487 } 65488 browser.create = QRCode2.create; 65489 browser.toCanvas = renderCanvas.bind(null, CanvasRenderer.render); 65490 browser.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL); 65491 browser.toString = renderCanvas.bind(null, function(data, _2, opts) {
65492 return SvgRenderer.render(data, opts); 65493 }); 65494 return browser; 65495 } 65496 var browserExports = requireBrowser(); 65497 const QRCode = /* @__PURE__ */ getDefaultExportFromCjs(browserExports); 65498 function getLuminance(color) { 65499 const rgbArr = colorToRgbArray(color); 65500 const [r2, g2, b2] = rgbArr.map((c2) => { 65501 const sRGB = c2 / 255; 65502 return sRGB <= 0.03928 ? sRGB / 12.92 : Math.pow((sRGB + 0.055) / 1.055, 2.4); 65503 }); 65504 return 0.2126 * r2 + 0.7152 * g2 + 0.0722 * b2; 65505 } 65506 function colorToRgbArray(color) { 65507 const rgb = colorToRgb(color); 65508 const rgbArr = rgb.match(/\d+/g)?.map(Number); 65509 if (!rgbArr || rgbArr.length !== 3) { 65510 throw new Error("Invalid color format"); 65511 } 65512 return rgbArr; 65513 } 65514 function rgbaToRgb(color) { 65515 const rgb = color.match(/\d+/g)?.map(Number); 65516 if (!rgb || rgb.length !== 3) { 65517 throw new Error("Invalid color format"); 65518 } 65519 return `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`; 65520 } 65521 function hexToRgb(color) { 65522 color = color.replace(/^#/, ""); 65523 if (color.length === 3) { 65524 color = color.split("").map((c2) => c2 + c2).join(""); 65525 } 65526 const rgb = color.match(/\w\w/g)?.map((c2) => parseInt(c2, 16)); 65527 if (!rgb || rgb.length !== 3) { 65528 throw new Error("Invalid color format"); 65529 } 65530 return `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`; 65531 } 65532 function colorToRgb(color) { 65533 if (color.includes("rgba")) { 65534 return rgbaToRgb(color); 65535 } else if (color.includes("#")) { 65536 return hexToRgb(color); 65537 } else { 65538 return color; 65539 } 65540 } 65541 function rgbToHex(color) { 65542 const rgb = color.match(/\d+/g)?.map(Number); 65543 if (!rgb || rgb.length !== 3) { 65544 throw new Error("Invalid color format"); 65545 } 65546 return `#${rgb.map((c2) => c2.toString(16).padStart(2, "0")).join("")}`; 65547 } 65548 function colorToHex(color) { 65549 if (color.includes("rgba")) { 65550 return rgbToHex(rgbaToRgb(color)); 65551 } else if (color.includes("rgb")) { 65552 return rgbToHex(color); 65553 } else { 65554 return color; 65555 } 65556 } 65557 function getContrastRatio(color1, color2) { 65558 const luminance1 = getLuminance(color1); 65559 const luminance2 = getLuminance(color2); 65560 return (Math.max(luminance1, luminance2) + 0.05) / (Math.min(luminance1, luminance2) + 0.05); 65561 } 65562 function darkenColor(color, weight) { 65563 const rgbArr = colorToRgbArray(color); 65564 const darkened = rgbArr.map((c2) => Math.round(c2 * (1 - weight))); 65565 return `rgb(${darkened[0]}, ${darkened[1]}, ${darkened[2]})`; 65566 } 65567 function lightenColor(color, weight) { 65568 const rgbArr = colorToRgbArray(color); 65569 const lightened = rgbArr.map((c2) => Math.round(c2 + (255 - c2) * weight)); 65570 return `rgb(${lightened[0]}, ${lightened[1]}, ${lightened[2]})`; 65571 } 65572 var __defProp$Q = Object.defineProperty; 65573 var __getOwnPropDesc$T = Object.getOwnPropertyDescriptor; 65574 var __decorateClass$T = (decorators, target, key, kind) => { 65575 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$T(target, key) : target; 65576 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 65577 if (decorator = decorators[i2]) 65578 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 65579 if (kind && result) __defProp$Q(target, key, result); 65580 return result; 65581 }; 65582 const tagName$F = "sonic-qrcode"; 65583 let SonicQRcode = class extends Subscriber$1(i$6) { 65584 constructor() { 65585 super(...arguments); 65586 this._resizeController = new h$1(this, {}); 65587 this.barcode = ""; 65588 this.margin = 1; 65589 this.makeContrastReachThreshold = (light2, dark2, threshold = 7) => { 65590 const contrast = getContrastRatio(light2, dark2); 65591 if (contrast < threshold) { 65592 light2 = lightenColor(light2, getLuminance(light2)); 65593 dark2 = darkenColor(dark2, getLuminance(dark2)); 65594 return this.makeContrastReachThreshold(light2, dark2, threshold); 65595 } 65596 return { light: light2, dark: dark2 }; 65597 }; 65598 } 65599 updated(_changedProperties) { 65600 const computedStyle = getComputedStyle(this); 65601 let light2 = computedStyle.getPropertyValue("background-color"); 65602 let dark2 = computedStyle.getPropertyValue("color"); 65603 if (getLuminance(light2) < getLuminance(dark2)) { 65604 [light2, dark2] = [dark2, light2]; 65605 } 65606 const contrastThreshold = 7;
65607 ({ light: light2, dark: dark2 } = this.makeContrastReachThreshold(light2, dark2, contrastThreshold)); 65608 const generateQR = async (text2) => { 65609 try { 65610 await QRCode.toCanvas(this.qrcodeEl, text2, { 65611 margin: this.margin, 65612 width: this.qrcodecontainerEl.clientWidth, 65613 color: { 65614 dark: colorToHex(dark2), 65615 light: colorToHex(light2) 65616 } 65617 }); 65618 } catch (err) { 65619 console.error(err); 65620 } 65621 }; 65622 const text = this.qrCodeContent || this.barcode; 65623 if (text) { 65624 generateQR(text); 65625 } 65626 super.updated(_changedProperties); 65627 } 65628 render() { 65629 return b$1` 65630 <div id="qrcodecontainer" class="canvas-container"> 65631 <canvas id="qrcode"></canvas> 65632 </div> 65633 `; 65634 } 65635 }; 65636 SonicQRcode.styles = [ 65637 // language=CSS 65638 i$9` 65639 :host { 65640 display: block; 65641 width: 100%; 65642 background-color: var(--sc-base, #fff); 65643 color: var(--sc-base-content, #000); 65644 } 65645 65646 .canvas-container { 65647 aspect-ratio: 1 / 1; 65648 } 65649 65650 canvas { 65651 display: block; 65652 width: 100% !important; 65653 height: auto !important; 65654 } 65655 ` 65656 ]; 65657 __decorateClass$T([ 65658 n$5({ type: String }) 65659 ], SonicQRcode.prototype, "barcode", 2); 65660 __decorateClass$T([ 65661 n$5({ type: Number }) 65662 ], SonicQRcode.prototype, "margin", 2); 65663 __decorateClass$T([ 65664 n$5({ type: String }) 65665 ], SonicQRcode.prototype, "qrCodeContent", 2); 65666 __decorateClass$T([ 65667 e$7("#qrcode") 65668 ], SonicQRcode.prototype, "qrcodeEl", 2); 65669 __decorateClass$T([ 65670 e$7("#qrcodecontainer") 65671 ], SonicQRcode.prototype, "qrcodecontainerEl", 2); 65672 SonicQRcode = __decorateClass$T([ 65673 t$3(tagName$F) 65674 ], SonicQRcode); 65675 var __defProp$P = Object.defineProperty; 65676 var __getOwnPropDesc$S = Object.getOwnPropertyDescriptor; 65677 var __decorateClass$S = (decorators, target, key, kind) => { 65678 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$S(target, key) : target; 65679 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 65680 if (decorator = decorators[i2]) 65681 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 65682 if (kind && result) __defProp$P(target, key, result); 65683 return result; 65684 }; 65685 const tagName$E = "sonic-ticket"; 65686 let SonicTicket = class extends Subscriber$1(i$6) { 65687 constructor() { 65688 super(...arguments); 65689 this.entity = {}; 65690 this.created = 0; 65691 this.event = {}; 65692 this.price = {}; 65693 this.owner = {}; 65694 this.barcode = ""; 65695 this.subscribe = {}; 65696 this.giftcard = {}; 65697 this.refund = {}; 65698 this.cancelable = false; 65699 this.barcodeMode = "qrcode"; 65700 this.skeleton = false; 65701 } 65702 renderPlacement() { 65703 if (!this.event?.placement) return A$1; 65704 const content = placementToString(this.event?.placement); 65705 if (!content) return A$1; 65706 return b$1`<sonic-ticket-info 65707 class="text-sm" 65708 label=${t("ticket_placement")} 65709 content="${content}" 65710 ></sonic-ticket-info> `; 65711 } 65712 render() { 65713 if (this.skeleton) return b$1`${this.render_skeleton()}`; 65714 const entityType = this.props?.entity_type; 65715 const displayBarcode = this.refund.status != "pending" && this.refund.status != "accepted" && !this.price.isCountermark; 65716 return b$1` <div> 65717 <div class=" mb-6 pt-3 px-3 lg:px-6"> 65718 <div class="mb-4"> 65719 ${entityType == EntityType.Event ? b$1` 65720 <sonic-date subDataProvider="entity" class="uppercase block mb-1"></sonic-date> 65721 <sonic-product-title 65722 machineName 65723 subDataProvider="entity.edito" 65724 class="text-2xl mb-2" 65725 ></sonic-product-title> 65726 65727 ${this.props?.session_status === "canceled" ? b$1`<sonic-badge type="danger" class="my-1" size="sm" 65728 >${t("LIB_event_status_canceled")}</sonic-badge 65729 >` : A$1} 65730 ${this.props?.session_status === "deferred" ? b$1`<sonic-badge type="warning" class="my-1" size="sm" 65731 >${t("LIB_event_status_deferred")}</sonic-badge 65732 >` : A$1} 65733 <sonic-event-location-hall
65734 subDataProvider="entity" 65735 isEvent="true" 65736 class="block mt-1 text-sm" 65737 addressDisplay="text" 65738 ></sonic-event-location-hall> 65739 ` : b$1`<sonic-product-title subDataProvider="entity.edito" class="text-2xl mb-2"></sonic-product-title> `} 65740 65741 <div class="flex gap-2 items-center flex-wrap "> 65742 ${entityType == "subscribe" && this.subscribe?.number ? b$1` <sonic-badge type="info" size="sm">N° ${this.subscribe?.number}</sonic-badge>` : A$1} 65743 ${this.giftcard?.code ? b$1` <sonic-giftcard-code copy code="${this.giftcard?.code}" size="sm"></sonic-giftcard-code>` : A$1} 65744 65745 <sonic-purchase-expiration-date size="sm" class="block"></sonic-purchase-expiration-date> 65746 </div> 65747 <!-- Contremarque --> 65748 ${this.price?.isCountermark && !this.props?.checked ? b$1` 65749 <sonic-badge type="danger" size="sm" class="mt-1"> 65750 <sonic-icon name="file-exclamation" library="custom"></sonic-icon> ${t( 65751 "contremarque_echanger_guichet" 65752 )}</sonic-badge 65753 > 65754 ` : A$1} 65755 <sonic-purchase-status 65756 size="sm" 65757 class="block mt-1 " 65758 displayDetail 65759 flexDirection="row" 65760 hiddenIfValid 65761 ></sonic-purchase-status> 65762 </div> 65763 65764 <div class="grid grid-cols-[repeat(auto-fit,minmax(min(100%,10rem),1fr))] gap-3"> 65765 ${this.giftcard?.remaining_amount || this.giftcard?.remaining_amount === 0 ? b$1` 65766 <sonic-ticket-info class="text-sm" label=${t("remaining")}> 65767 ${formatAmount(this.giftcard?.remaining_amount || 0)} 65768 </sonic-ticket-info> 65769 ` : A$1} 65770 65771 <!-- Détenteur --> 65772 ${this.owner?.firstName || this.owner?.lastName ? b$1` 65773 <sonic-ticket-info 65774 class="text-sm" 65775 label=${t("LIB_detenteur")} 65776 content="${this.owner?.firstName} ${this.owner?.lastName}" 65777 ></sonic-ticket-info> 65778 ` : A$1} 65779 65780 <!-- Date --> 65781 ${this.created ? b$1` 65782 <sonic-ticket-info class="text-sm" label=${t("purchase_date")}> 65783 <sonic-date date=${this.created} weekday="hidden" month="2-digit"></sonic-date> 65784 </sonic-ticket-info> 65785 ` : A$1} 65786 65787 <!-- Placement --> 65788 ${this.renderPlacement()} 65789 <!-- Catégories --> 65790 65791 <!-- Prix --> 65792 ${this.price?.amount ? b$1` 65793 <sonic-ticket-info 65794 class="text-sm" 65795 label="${t("price")}" 65796 content="${this.price?.label} ${formatAmount(this.price?.amount)}" 65797 ></sonic-ticket-info> 65798 ` : A$1} 65799 </div> 65800 65801 ${this.ticketActions()} 65802 </div> 65803 65804 ${this.barcode && !this.price.isCountermark ? b$1` 65805 <sonic-divider class="mt-6 mb-4"></sonic-divider> 65806 <div class="px-3 lg:px-6 pb-5 flex flex-col items-center lowercase "> 65807 <div class="text-sm tracking-wider leading-none">n° ${this.barcode}</div> 65808 ${displayBarcode ? b$1` 65809 ${this.barcodeMode == "qrcode" ? b$1`<sonic-qrcode class="size-[8rem]" margin="2"></sonic-qrcode>` : b$1`<sonic-barcode 65810 hideValue 65811 barWidth="3" 65812 barHeight="60" 65813 class="w-[max(60%,20rem)] max-w-[90%] " 65814 ></sonic-barcode>`} 65815 65816 <div class="flex gap-1 mt-1"> 65817 <sonic-button 65818 variant="ghost" 65819 size="2xs" 65820 class="font-semibold " 65821 minWidth="6rem" 65822 @click=${() => this.barcodeMode = "qrcode"} 65823 ?active=${this.barcodeMode == "qrcode"} 65824 ><span class="lowercase">${t("qr code")}</span></sonic-button 65825 > 65826 <sonic-button 65827 variant="ghost" 65828 size="2xs" 65829 class="font-semibold " 65830 minWidth="6rem" 65831 @click=${() => this.barcodeMode = "barcode"} 65832 ?active=${this.barcodeMode == "barcode"} 65833 ><span class="lowercase">${t("codebarre")}</span></sonic-button 65834 > 65835 </div> 65836 ` : A$1} 65837 </div> 65838 ` : A$1} 65839 ${entityType == EntityType.Event || entityType == EntityType.Merch ? b$1` 65840 <div class="aspect-[3/2] lg:aspect-[16/9] overflow-hidden "> 65841 <sonic-product-illustration 65842 noAnimation 65843 subdataProvider="entity" 65844 class="w-full block" 65845 ></sonic-product-illustration> 65846 </div> 65847 ` : A$1} 65848 </div>`; 65849 } 65850 ticketActions() { 65851 const displayActions = this.cancelable || this.refund?.askEnabled || this.props?.cancelable_for_credit; 65852 if (!displayActions) return A$1; 65853 const eventId = this.entity?.id; 65854 return b$1` 65855 <div class="col-span-full mt-5"> 65856 ${this.refund?.askEnabled ? b$1` 65857 <sonic-button 65858 class="grow" 65859 size="sm" 65860 shape="block" 65861 variant="outline" 65862 type="info" 65863 @click=${() => { 65864 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 65865 if (parentModal) { 65866 parentModal.hide(); 65867 } 65868 }} 65869 href="${appRoute("refund").query({ event_id: eventId, barcode: this.barcode })}" 65870 > 65871 <sonic-icon name="arrow-rotate-left" library="custom"></sonic-icon> 65872 <b>${t("ask_for_refund")}</b> 65873 </sonic-button> 65874 ` : A$1} 65875 ${this.cancelable ? b$1` 65876 <sonic-button 65877 class="grow" 65878 shape="block" 65879 variant="outline" 65880 size="sm" 65881 type="info" 65882 @click=${() => { 65883 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 65884 if (parentModal) { 65885 parentModal.hide(); 65886 }
65887 cancelTicket(Number(this.id)); 65888 }} 65889 > 65890 <sonic-icon name="hand-wave" library="custom"></sonic-icon> 65891 <b>${t("free_up")}</b> 65892 </sonic-button> 65893 ` : A$1} 65894 ${this.props?.cancelable_for_credit ? b$1` 65895 <sonic-button 65896 class="grow" 65897 shape="block" 65898 variant="outline" 65899 size="sm" 65900 type="info" 65901 @click=${() => cancelTicket(Number(this.id), "credit")} 65902 > 65903 <sonic-icon name="hand-wave" library="custom"></sonic-icon> 65904 <b>${t("annuler_contre_avoir")}</b> 65905 </sonic-button> 65906 ` : A$1} 65907 </div> 65908 `; 65909 } 65910 printCategories(categories) { 65911 const titles = categories.reduce((acc, category) => { 65912 if (category.title) acc.push(category.title); 65913 return acc; 65914 }, []); 65915 return b$1` ${titles.join(", ")} `; 65916 } 65917 render_skeleton() { 65918 return b$1` <div> 65919 <div class=" pt-5 px-3 lg:px-6"> 65920 <div class="mb-4"> 65921 <div class="rounded-sm animate-pulse bg-neutral-300 h-4 max-w-[20ch] mb-1"></div> 65922 <div class="rounded-sm animate-pulse bg-neutral-300 h-7 max-w-[34ch] mb-1"></div> 65923 <div class="rounded-sm animate-pulse bg-neutral-300 h-2 max-w-[15ch] mb-3"></div> 65924 </div> 65925 65926 <div class="grid grid-cols-[repeat(auto-fit,minmax(min(100%,15rem),1fr))] gap-3"> 65927 <div> 65928 <div class="rounded-sm animate-pulse bg-neutral-300 h-2 max-w-[10ch] mb-1"></div> 65929 <div class="rounded-sm animate-pulse bg-neutral-300 h-3 max-w-[23ch] "></div> 65930 </div> 65931 <div> 65932 <div class="rounded-sm animate-pulse bg-neutral-300 h-2 max-w-[12ch] mb-1"></div> 65933 <div class="rounded-sm animate-pulse bg-neutral-300 h-3 max-w-[18ch] "></div> 65934 </div> 65935 </div> 65936 </div> 65937 <sonic-divider class="mt-6 mb-5"></sonic-divider> 65938 <div class="px-3 lg:px-6 pb-6 flex flex-col gap-[3px] items-center"> 65939 <sonic-barcode 65940 barcode="123456789012" 65941 hideValue 65942 barWidth="3" 65943 barHeight="60" 65944 class="w-[max(60%,25rem)] max-w-[90%] animate-pulse text-neutral-300" 65945 ></sonic-barcode> 65946 </div> 65947 <div class="animate-pulse aspect-[3/2] lg:aspect-[16/9] overflow-hidden bg-neutral-200"></div> 65948 </div>`; 65949 } 65950 }; 65951 SonicTicket.styles = [tailwind]; 65952 __decorateClass$S([ 65953 n$5({ type: Object }) 65954 ], SonicTicket.prototype, "entity", 2); 65955 __decorateClass$S([ 65956 n$5({ type: Number }) 65957 ], SonicTicket.prototype, "created", 2); 65958 __decorateClass$S([ 65959 n$5({ type: Object }) 65960 ], SonicTicket.prototype, "event", 2); 65961 __decorateClass$S([ 65962 n$5({ type: Object }) 65963 ], SonicTicket.prototype, "price", 2); 65964 __decorateClass$S([ 65965 n$5({ type: Object }) 65966 ], SonicTicket.prototype, "owner", 2); 65967 __decorateClass$S([ 65968 n$5({ type: String }) 65969 ], SonicTicket.prototype, "barcode", 2); 65970 __decorateClass$S([ 65971 n$5({ type: Object }) 65972 ], SonicTicket.prototype, "subscribe", 2); 65973 __decorateClass$S([ 65974 n$5({ type: Object }) 65975 ], SonicTicket.prototype, "giftcard", 2); 65976 __decorateClass$S([ 65977 n$5({ type: Object }) 65978 ], SonicTicket.prototype, "refund", 2); 65979 __decorateClass$S([ 65980 n$5({ type: Boolean }) 65981 ], SonicTicket.prototype, "cancelable", 2); 65982 __decorateClass$S([ 65983 r$5() 65984 ], SonicTicket.prototype, "barcodeMode", 2); 65985 __decorateClass$S([ 65986 n$5({ type: Boolean }) 65987 ], SonicTicket.prototype, "skeleton", 2); 65988 SonicTicket = __decorateClass$S([ 65989 t$3(tagName$E) 65990 ], SonicTicket); 65991 var __defProp$O = Object.defineProperty; 65992 var __getOwnPropDesc$R = Object.getOwnPropertyDescriptor; 65993 var __decorateClass$R = (decorators, target, key, kind) => { 65994 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$R(target, key) : target; 65995 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 65996 if (decorator = decorators[i2]) 65997 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 65998 if (kind && result) __defProp$O(target, key, result); 65999 return result; 66000 }; 66001 let SonicPurchaseSummaryActions = class extends Subscriber$1(i$6) { 66002 constructor() { 66003 super(...arguments); 66004 this.print_url = ""; 66005 this.barcode = ""; 66006 this.pdf_mobile_url = ""; 66007 this.cancelable = false;
66008 this.refund = {}; 66009 this.detailHref = ""; 66010 this.store_url = ""; 66011 } 66012 willUpdate(changedProperties) { 66013 const entity = this.props?.entity; 66014 if (changedProperties.has("props") && entity?.entity_type === EntityType.Event) { 66015 this._icsUrl = icsCalendarUrl([entity], this.store_url); 66016 this._calendarUrl = googleCalendarUrl(entity); 66017 } 66018 super.willUpdate(changedProperties); 66019 } 66020 get resolvedDetailHref() { 66021 if (!this.detailHref) { 66022 return ""; 66023 } 66024 return this.detailHref.replace(/\$\{id\}/g, String(this.id ?? "")); 66025 } 66026 showDetailAction() { 66027 return !!(this.resolvedDetailHref || this.id); 66028 } 66029 hasDefaultMenuActions() { 66030 const purchase = this.props ?? {}; 66031 if (!isPurchasePrintable(purchase)) { 66032 return false; 66033 } 66034 const refundEnabled = this.refund?.askEnabled; 66035 return !!(this.pdf_mobile_url || this.print_url || this.cancelable || refundEnabled || this._calendarUrl); 66036 } 66037 hasConfiguredMenuActions() { 66038 const purchase = this.props ?? {}; 66039 if (!isPurchasePrintable(purchase)) { 66040 return false; 66041 } 66042 if (this.menuActions) { 66043 const showPdfMobile = purchase.entity_type === EntityType.Event && !!purchase.pdf_mobile_url; 66044 return showPdfMobile || !!purchase.print_url; 66045 } 66046 return !!(purchase.pdf_mobile_url || purchase.print_url || purchase.cancelable || purchase.refund?.askEnabled); 66047 } 66048 get hasMenu() { 66049 return this.menuActions ? this.hasConfiguredMenuActions() : this.hasDefaultMenuActions(); 66050 } 66051 render() { 66052 const menuContent = this.menuActions ? this.menuActions(this.props ?? {}) : this.renderDefaultMenuActions(); 66053 return b$1` 66054 <div class="${TRANSACTION_ROW_ACTIONS_SLOTS_CLASS}"> 66055 <div class="flex items-center justify-center h-9 w-full"> 66056 ${this.hasMenu ? b$1`<sonic-pop placement="bottom"> 66057 <sonic-button noAutofill icon shape="circle" type="default" variant="ghost"> 66058 <sonic-icon library="custom" size="lg" name="ellipsis-vertical"></sonic-icon> 66059 </sonic-button> 66060 <sonic-menu slot="content" minWidth="15rem">${menuContent}</sonic-menu> 66061 </sonic-pop>` : A$1} 66062 </div> 66063 <div class="flex items-center justify-center h-9 w-full"> 66064 ${this.showDetailAction() ? this.renderDetailAction() : A$1} 66065 </div> 66066 </div> 66067 `; 66068 } 66069 renderDetailAction() { 66070 const href = this.resolvedDetailHref; 66071 if (href) { 66072 return b$1` 66073 <sonic-button noAutofill shape="circle" type="neutral" href=${href}> 66074 <sonic-icon name="chevron-right" library="custom"></sonic-icon> 66075 </sonic-button> 66076 `; 66077 } 66078 return b$1` 66079 <sonic-button noAutofill shape="circle" type="neutral" @click=${this.openTicketModal}> 66080 <sonic-icon name="chevron-right" library="custom"></sonic-icon> 66081 </sonic-button> 66082 `; 66083 } 66084 renderDefaultMenuActions() { 66085 const purchase = this.props ?? {}; 66086 if (!isPurchasePrintable(purchase)) { 66087 return A$1; 66088 } 66089 const refundEnabled = this.refund?.askEnabled; 66090 return b$1` 66091 ${this.pdf_mobile_url ? b$1`<sonic-menu-item noAutofill href="${this.pdf_mobile_url}" target="_blank"> 66092 <sonic-icon library="custom" slot="prefix" name="file-pdf"></sonic-icon> 66093 ${t("pdf_mobile")} 66094 </sonic-menu-item>` : A$1} 66095 ${this.print_url ? b$1`<sonic-menu-item noAutofill href="${this.print_url}" target="_blank"> 66096 <sonic-icon library="custom" slot="prefix" name="print"></sonic-icon> 66097 ${t("print")} 66098 </sonic-menu-item>` : A$1} 66099 ${this.print_url && (this.cancelable || refundEnabled) ? b$1`<sonic-divider></sonic-divider>` : A$1} 66100 ${this.cancelLink()} ${refundEnabled ? this.refundLink() : A$1} 66101 ${this.renderAddToCalendar()} 66102 `; 66103 } 66104 renderAddToCalendar() { 66105 if (!this._calendarUrl || !this._icsUrl) { 66106 return A$1; 66107 } 66108 return b$1`<sonic-divider></sonic-divider> 66109 <sonic-menu-item noAutofill href="${this._calendarUrl}" target="_blank"> 66110 <sonic-icon slot="prefix" library="custom" prefix="brands" name="google"></sonic-icon> 66111 ${t("add_to_google_calendar")} 66112 </sonic-menu-item> 66113 <sonic-menu-item noAutofill href="${this._icsUrl}" target="_blank"> 66114 <sonic-icon library="custom" slot="prefix" name="calendar-plus"></sonic-icon> 66115 <div>${t("download_calendar")}</div> 66116 </sonic-menu-item>`; 66117 } 66118 refundLink() { 66119 const entityId = this.props?.entity?.id; 66120 const refundRoute = appRoute("refund").query({ event_id: entityId, barcode: this.barcode })?.toString(); 66121 return b$1`<sonic-menu-item noAutofill href="${refundRoute}" class="whitespace-nowrap"> 66122 <sonic-icon library="custom" slot="prefix" name="arrow-rotate-left"></sonic-icon> 66123 ${t("ask_for_refund")} 66124 </sonic-menu-item>`; 66125 } 66126 cancelLink() { 66127 if (this.cancelable) {
66128 return b$1` <sonic-divider></sonic-divider> 66129 <sonic-menu-item noAutofill @click="${() => cancelTicket(Number(this.id))}"> 66130 <sonic-icon library="custom" slot="prefix" name="hand-wave"></sonic-icon> 66131 ${t("free_up")} 66132 </sonic-menu-item>`; 66133 } else if (this.props?.cancelable_for_credit) { 66134 return b$1` <sonic-divider></sonic-divider> 66135 <sonic-menu-item noAutofill @click="${() => cancelTicket(Number(this.id), "credit")}"> 66136 <sonic-icon library="custom" slot="prefix" name="hand-wave"></sonic-icon> 66137 ${t("annuler_contre_avoir")} 66138 </sonic-menu-item>`; 66139 } 66140 return A$1; 66141 } 66142 openTicketModal() { 66143 Modal.create({ 66144 content: ( 66145 /*html*/ 66146 '<sonic-ticket class="pt-3" dataProvider="' + this.dataProvider + '"></sonic-ticket>' 66147 ), 66148 paddingX: "0", 66149 paddingY: "0", 66150 width: "30rem", 66151 removeOnHide: true 66152 }); 66153 } 66154 }; 66155 SonicPurchaseSummaryActions.styles = [ 66156 tailwind, 66157 i$9` 66158 :host { 66159 display: block; 66160 flex-shrink: 0; 66161 } 66162 ` 66163 ]; 66164 __decorateClass$R([ 66165 n$5({ type: String }) 66166 ], SonicPurchaseSummaryActions.prototype, "print_url", 2); 66167 __decorateClass$R([ 66168 n$5({ type: String }) 66169 ], SonicPurchaseSummaryActions.prototype, "barcode", 2); 66170 __decorateClass$R([ 66171 n$5({ type: String }) 66172 ], SonicPurchaseSummaryActions.prototype, "pdf_mobile_url", 2); 66173 __decorateClass$R([ 66174 n$5({ type: Boolean }) 66175 ], SonicPurchaseSummaryActions.prototype, "cancelable", 2); 66176 __decorateClass$R([ 66177 n$5({ type: Object }) 66178 ], SonicPurchaseSummaryActions.prototype, "refund", 2); 66179 __decorateClass$R([ 66180 n$5({ type: String, attribute: "detail-href" }) 66181 ], SonicPurchaseSummaryActions.prototype, "detailHref", 2); 66182 __decorateClass$R([ 66183 n$5({ type: Function, attribute: false }) 66184 ], SonicPurchaseSummaryActions.prototype, "menuActions", 2); 66185 __decorateClass$R([ 66186 bind$1("settings.store_url"), 66187 n$5({ type: String }) 66188 ], SonicPurchaseSummaryActions.prototype, "store_url", 2); 66189 __decorateClass$R([ 66190 r$5() 66191 ], SonicPurchaseSummaryActions.prototype, "_icsUrl", 2); 66192 __decorateClass$R([ 66193 r$5() 66194 ], SonicPurchaseSummaryActions.prototype, "_calendarUrl", 2); 66195 SonicPurchaseSummaryActions = __decorateClass$R([ 66196 t$3("sonic-purchase-summary-actions") 66197 ], SonicPurchaseSummaryActions); 66198 var __defProp$N = Object.defineProperty; 66199 var __getOwnPropDesc$Q = Object.getOwnPropertyDescriptor; 66200 var __decorateClass$Q = (decorators, target, key, kind) => { 66201 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$Q(target, key) : target; 66202 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66203 if (decorator = decorators[i2]) 66204 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66205 if (kind && result) __defProp$N(target, key, result); 66206 return result; 66207 }; 66208 const tagName$D = "sonic-purchase-summary"; 66209 let PurchaseSummary = class extends Subscriber$1(i$6) { 66210 constructor() { 66211 super(...arguments); 66212 this.print_url = ""; 66213 this.barcode = ""; 66214 this.pdf_mobile_url = ""; 66215 this.direction = "row"; 66216 this.skeleton = false; 66217 this.entity = null; 66218 this.cancelable = false; 66219 this.refund = {}; 66220 this.detailHref = ""; 66221 this._resizeController = new h$1(this, {}); 66222 } 66223 render() { 66224 if (this.skeleton) { 66225 return this.render_skeleton(); 66226 } 66227 return b$1` 66228 <div class="@container"> 66229 <div 66230 class=" 66231 grid gap-4 p-3 @xl:p-4 66232 grid-cols-[max(6rem,_13%)_1fr] 66233 @xl:grid-cols-[max(6rem,_13%)_minmax(0,1fr)_minmax(0,1fr)] 66234 @xl:pr-2 66235 items-center bg-neutral-100 rounded-md" 66236 > 66237 <div class="rounded-md overflow-hidden"> 66238 <div class="aspect-square flex w-full"> 66239 <sonic-product-illustration 66240 noAnimation 66241 subDataProvider="entity" 66242 class="block w-full" 66243 ></sonic-product-illustration> 66244 </div> 66245 </div> 66246 66247 <div> 66248 <sonic-purchase-summary-main-info></sonic-purchase-summary-main-info> 66249 </div> 66250 66251 <div 66252 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" 66253 > 66254 <div class="col-start-2 @xl:col-auto flex-grow cell-aside self-center text-xs"> 66255 <sonic-purchase-summary-complementary-info></sonic-purchase-summary-complementary-info> 66256 </div> 66257 66258 <sonic-purchase-summary-actions 66259 class="ml-auto" 66260 detail-href=${this.detailHref} 66261 .menuActions=${this.menuActions} 66262 ></sonic-purchase-summary-actions> 66263 </div> 66264 </div> 66265 </div> 66266 `; 66267 } 66268 render_skeleton() { 66269 return b$1`<div class="@container"> 66270 <div 66271 class="grid gap-4 p-3 @xl:p-4 66272 grid-cols-[max(6rem,_13%)_1fr] 66273 @xl:grid-cols-[max(6rem,_13%)_minmax(0,1fr)_minmax(0,1fr)] items-center 66274 bg-neutral-100 rounded-md" 66275 > 66276 <div class="rounded-md overflow-hidden self-start"> 66277 <div class="aspect-square bg-neutral-300 animate-pulse"></div> 66278 </div>
66279 <div class="self-center"> 66280 <div class="rounded-sm animate-pulse bg-neutral-300 h-4 max-w-[15ch] mb-1"></div> 66281 <div class="rounded-sm animate-pulse bg-neutral-300 h-4 max-w-[28ch] mb-3"></div> 66282 <div class="rounded-sm animate-pulse bg-neutral-300 h-4 max-w-[18ch]"></div> 66283 </div> 66284 </div> 66285 </div>`; 66286 } 66287 }; 66288 PurchaseSummary.styles = [tailwind]; 66289 __decorateClass$Q([ 66290 n$5({ type: String }) 66291 ], PurchaseSummary.prototype, "print_url", 2); 66292 __decorateClass$Q([ 66293 n$5({ type: String }) 66294 ], PurchaseSummary.prototype, "barcode", 2); 66295 __decorateClass$Q([ 66296 n$5({ type: String }) 66297 ], PurchaseSummary.prototype, "pdf_mobile_url", 2); 66298 __decorateClass$Q([ 66299 n$5({ type: String }) 66300 ], PurchaseSummary.prototype, "direction", 2); 66301 __decorateClass$Q([ 66302 n$5({ type: Boolean }) 66303 ], PurchaseSummary.prototype, "skeleton", 2); 66304 __decorateClass$Q([ 66305 n$5({ type: Object }) 66306 ], PurchaseSummary.prototype, "entity", 2); 66307 __decorateClass$Q([ 66308 n$5({ type: Boolean }) 66309 ], PurchaseSummary.prototype, "cancelable", 2); 66310 __decorateClass$Q([ 66311 n$5({ type: Object }) 66312 ], PurchaseSummary.prototype, "refund", 2); 66313 __decorateClass$Q([ 66314 n$5({ type: String, attribute: "detail-href" }) 66315 ], PurchaseSummary.prototype, "detailHref", 2); 66316 __decorateClass$Q([ 66317 n$5({ type: Function, attribute: false }) 66318 ], PurchaseSummary.prototype, "menuActions", 2); 66319 PurchaseSummary = __decorateClass$Q([ 66320 t$3(tagName$D) 66321 ], PurchaseSummary); 66322 var __defProp$M = Object.defineProperty; 66323 var __getOwnPropDesc$P = Object.getOwnPropertyDescriptor; 66324 var __decorateClass$P = (decorators, target, key, kind) => { 66325 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$P(target, key) : target; 66326 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66327 if (decorator = decorators[i2]) 66328 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66329 if (kind && result) __defProp$M(target, key, result); 66330 return result; 66331 }; 66332 let OrdersTableLine = class extends Subscriber$1(i$6) { 66333 constructor() { 66334 super(...arguments); 66335 this.id = ""; 66336 this.date = ""; 66337 this.invoice_name = ""; 66338 this.amount = ""; 66339 this.invoice_url = ""; 66340 this.mandate_pdf_url = ""; 66341 } 66342 render() { 66343 return b$1` 66344 <sonic-tr> 66345 <sonic-td> 66346 <sonic-date month="numeric" year="numeric" weekday="hidden"></sonic-date> 66347 </sonic-td> 66348 <sonic-td>${this.invoice_name}</sonic-td> 66349 <sonic-td class="hidden lg:contents">${this.id}</sonic-td> 66350 <sonic-td>${this.amount}â¬</sonic-td> 66351 <sonic-td align="center"> 66352 <sonic-button 66353 href="${this.invoice_url}" 66354 variant="ghost" 66355 icon 66356 shape="circle" 66357 target="_blank" 66358 size="sm" 66359 aria-label="print invoice" 66360 > 66361 <sonic-icon library="custom" name="file-pdf"></sonic-icon> 66362 </sonic-button> 66363 ${this.mandate_pdf_url ? b$1`<sonic-button 66364 href="${this.mandate_pdf_url}" 66365 variant="outline" 66366 type="primary" 66367 icon 66368 target="_blank" 66369 size="xs" 66370 aria-label="download SEPA mandate" 66371 > 66372 SEPA 66373 </sonic-button>` : A$1} 66374 </sonic-td> 66375 </sonic-tr> 66376 `; 66377 } 66378 }; 66379 OrdersTableLine.styles = [ 66380 tailwind, 66381 i$9` 66382 :host { 66383 display: contents; 66384 } 66385 ` 66386 ]; 66387 __decorateClass$P([ 66388 n$5() 66389 ], OrdersTableLine.prototype, "id", 2); 66390 __decorateClass$P([ 66391 n$5() 66392 ], OrdersTableLine.prototype, "date", 2); 66393 __decorateClass$P([ 66394 n$5() 66395 ], OrdersTableLine.prototype, "invoice_name", 2); 66396 __decorateClass$P([ 66397 n$5() 66398 ], OrdersTableLine.prototype, "amount", 2); 66399 __decorateClass$P([ 66400 n$5() 66401 ], OrdersTableLine.prototype, "invoice_url", 2); 66402 __decorateClass$P([ 66403 n$5() 66404 ], OrdersTableLine.prototype, "mandate_pdf_url", 2); 66405 OrdersTableLine = __decorateClass$P([ 66406 t$3("sonic-orders-table-line") 66407 ], OrdersTableLine); 66408 var __defProp$L = Object.defineProperty; 66409 var __getOwnPropDesc$O = Object.getOwnPropertyDescriptor; 66410 var __decorateClass$O = (decorators, target, key, kind) => { 66411 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$O(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$L(target, key, result); 66416 return result; 66417 }; 66418 let OrdersTable = class extends Subscriber$1(i$6) { 66419 constructor() { 66420 super(...arguments); 66421 this.userId = ""; 66422 } 66423 render() { 66424 if (!this.userId) return A$1; 66425 return b$1` 66426 <sonic-table bordered maxHeight="50vh" size="sm"> 66427 <sonic-thead> 66428 <sonic-tr class="text-neutral-400 text-normal lowercase "> 66429 <sonic-th>${t("date_buy")}</sonic-th> 66430 <sonic-th>${t("invoice_number")}</sonic-th> 66431 <sonic-th class="hidden lg:contents">${t("transaction_number")}</sonic-th> 66432 <sonic-th>${t("amount")}</sonic-th> 66433 <sonic-th></sonic-th> 66434 </sonic-tr> 66435 </sonic-thead> 66436 <sonic-tbody dataProvider="userInvoicesResults"> 66437 <sonic-queue 66438 displayContents 66439 dataProviderExpression="/user/${this.userId}/orders?limit=$limit&offset=$offset" 66440 targetRequestDuration="1000" 66441 limit="10" 66442 key="data" 66443 > 66444 <template data-value="no-item"> 66445 <sonic-tr> 66446 <sonic-td colspan="5"> 66447 <sonic-no-result></sonic-no-result> 66448 </sonic-td> 66449 </sonic-tr> 66450 </template> 66451 <template> 66452 <sonic-orders-table-line></sonic-orders-table-line> 66453 </template> 66454 </sonic-queue> 66455 </sonic-tbody> 66456 </sonic-table> 66457 `; 66458 } 66459 }; 66460 OrdersTable.styles = [tailwind]; 66461 __decorateClass$O([ 66462 n$5({ type: String }) 66463 ], OrdersTable.prototype, "userId", 2); 66464 OrdersTable = __decorateClass$O([ 66465 t$3("sonic-orders-table") 66466 ], OrdersTable); 66467 function mapSeasonSelectOptions(seasons, { formatValue, isSelected }) { 66468 return [...seasons].reverse().map((season) => ({ 66469 value: formatValue(season), 66470 wording: season.title ?? "", 66471 selected: isSelected(season) 66472 })); 66473 } 66474 var __defProp$K = Object.defineProperty; 66475 var __getOwnPropDesc$N = Object.getOwnPropertyDescriptor; 66476 var __decorateClass$N = (decorators, target, key, kind) => { 66477 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$N(target, key) : target; 66478 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66479 if (decorator = decorators[i2]) 66480 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66481 if (kind && result) __defProp$K(target, key, result); 66482 return result; 66483 }; 66484 const tagName$C = "sonic-season-select"; 66485 let SeasonSelect = class extends Subscriber$1(i$6) { 66486 constructor() { 66487 super(...arguments); 66488 this.name = "season"; 66489 this.onlyId = false;
66490 this.enableAll = false; 66491 this.enableNext = false; 66492 this.selectCurrent = false; 66493 this.selectNext = false; 66494 this.size = "md"; 66495 } 66496 formatValue(season) { 66497 if (this.onlyId && season.id) return season.id.toString(); 66498 return season.id + "|" + season.start_date + "|" + season.end_date + (season.current ? "|current" : "|"); 66499 } 66500 render() { 66501 if (!this.props || Object.entries(this.props).length == 0) return A$1; 66502 let options = mapSeasonSelectOptions(this.props, { 66503 formatValue: (season) => this.formatValue(season), 66504 isSelected: (season) => this.selectCurrent ? Boolean(season.current) : false 66505 }); 66506 if (this.enableAll) { 66507 options = [ 66508 { 66509 value: "", 66510 wording: "Toutes les saisons", 66511 selected: this.selectCurrent ? false : true 66512 }, 66513 ...options 66514 ]; 66515 } 66516 if (this.enableNext) { 66517 options = [ 66518 { 66519 value: "next", 66520 wording: "A venir", 66521 selected: this.selectNext ? false : true 66522 }, 66523 ...options 66524 ]; 66525 } 66526 return b$1`<sonic-select size=${this.size} name="${this.name}" .options=${options}></sonic-select>`; 66527 } 66528 }; 66529 SeasonSelect.styles = [tailwind]; 66530 __decorateClass$N([ 66531 n$5({ type: String }) 66532 ], SeasonSelect.prototype, "name", 2); 66533 __decorateClass$N([ 66534 n$5({ type: Boolean }) 66535 ], SeasonSelect.prototype, "onlyId", 2); 66536 __decorateClass$N([ 66537 n$5({ type: Boolean }) 66538 ], SeasonSelect.prototype, "enableAll", 2); 66539 __decorateClass$N([ 66540 n$5({ type: Boolean }) 66541 ], SeasonSelect.prototype, "enableNext", 2); 66542 __decorateClass$N([ 66543 n$5({ type: Boolean }) 66544 ], SeasonSelect.prototype, "selectCurrent", 2); 66545 __decorateClass$N([ 66546 n$5({ type: Boolean }) 66547 ], SeasonSelect.prototype, "selectNext", 2); 66548 __decorateClass$N([ 66549 n$5({ type: String }) 66550 ], SeasonSelect.prototype, "size", 2); 66551 SeasonSelect = __decorateClass$N([ 66552 t$3(tagName$C) 66553 ], SeasonSelect); 66554 var __defProp$J = Object.defineProperty; 66555 var __getOwnPropDesc$M = Object.getOwnPropertyDescriptor; 66556 var __decorateClass$M = (decorators, target, key, kind) => { 66557 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$M(target, key) : target; 66558 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66559 if (decorator = decorators[i2]) 66560 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66561 if (kind && result) __defProp$J(target, key, result); 66562 return result; 66563 }; 66564 const DP_ACCOUNT_PURCHASES_FILTERS = "accountPurchasesFilters"; 66565 const tagName$B = "sonic-user-account-purchases"; 66566 let UserAccount$4 = class UserAccount extends i$6 { 66567 constructor() { 66568 super(...arguments); 66569 this.activeTab = "history"; 66570 } 66571 toggleTab(tab) { 66572 this.activeTab = tab; 66573 } 66574 render() { 66575 if (!this.userId) return A$1; 66576 return b$1` 66577 <sonic-page-header label="${t("mes_achats")}"></sonic-page-header> 66578 66579 <!-- Search --> 66580 <div class="flex gap-2 -mt-6 mb-8"> 66581 <sonic-button ?active=${this.activeTab == "history"} @click=${() => this.toggleTab("history")} size="md"> 66582 <sonic-icon library="custom" name="clock-rotate-left" class="mr-1"> </sonic-icon> 66583 ${t("history")} 66584 </sonic-button> 66585 <sonic-button ?active=${this.activeTab == "invoice"} @click=${() => this.toggleTab("invoice")} size="md"> 66586 <sonic-icon library="custom" name="file" class="mr-1"> </sonic-icon> 66587 ${t("invoices")} 66588 </sonic-button> 66589 </div> 66590 66591 <!-- HISTORY --> 66592 66593 ${this.activeTab === "history" ? b$1` 66594 <div 66595 formDataProvider="${DP_ACCOUNT_PURCHASES_FILTERS}" 66596 dataProvider="${DP_ACCOUNT_PURCHASES_FILTERS}" 66597 class="mb-8 flex flex-wrap gap-x-3 gap-y-2 items-center " 66598 > 66599 <sonic-input 66600 type="search" 66601 name="search" 66602 inlineContent 66603 placeholder="Rechercher..." 66604 filteredFields="title" 66605 class="grow max-w-[20rem]" 66606 autocomplete="off" 66607 value="" 66608 > 66609 <sonic-icon library="iconoir" slot="prefix" name="search"></sonic-icon> 66610 </sonic-input> 66611 <sonic-select 66612 name="entity_type" 66613 class="min-w-[13rem] " 66614 .options=${[ 66615 { value: "", wording: t("all_purchases") }, 66616 { value: "event", wording: t("tickets") }, 66617 ...this.hasSubscription ? [{ value: "subscribe", wording: t("abonnements") }] : [], 66618 ...this.hasGiftcards ? [{ value: "giftcard", wording: t("LIB_cartes_cadeaux") }] : [], 66619 ...this.hasAdditionalProducts ? [{ value: "additionalProduct", wording: t("LIB_produits_additionnels") }] : [], 66620 ...this.hasShop ? [{ value: "merch", wording: t("LIB_merchs") }] : [] 66621 ]} 66622 > 66623 </sonic-select> 66624 <sonic-fetch dataProvider="SeasonList" endPoint="/season" key="data"> 66625 <sonic-season-select name="ids_season[]" enableAll onlyId class="min-w-[13rem]"></sonic-season-select> 66626 </sonic-fetch> 66627 </div> 66628 <div dataProvider="accountPurchasesFilters"> 66629 <sonic-queue 66630 dataProviderExpression="/user/${this.userId}/purchases?next=1&limit=$limit&offset=$offset&buyer=${this.userId}" 66631 limit="8" 66632 lazyBoundsRatio="4" 66633 targetRequestDuration="1000" 66634 dataFilterProvider="${DP_ACCOUNT_PURCHASES_FILTERS}" 66635 key="data" 66636 > 66637 <template data-value="no-item"> 66638 <sonic-no-result></sonic-no-result> 66639 </template> 66640 <template data-value="skeleton"> 66641 <sonic-purchase-summary class="block mb-3" skeleton></sonic-purchase-summary> 66642 </template> 66643 <template> 66644 <sonic-purchase-summary class="block mb-3"></sonic-purchase-summary> 66645 </template> 66646 </sonic-queue> 66647 </div> 66648 ` : A$1} 66649 66650 <!-- INVOICES --> 66651 ${this.activeTab === "invoice" ? b$1`<sonic-orders-table userId=${this.userId}></sonic-orders-table>` : A$1} 66652 `; 66653 } 66654 }; 66655 UserAccount$4.styles = [tailwind]; 66656 __decorateClass$M([ 66657 bind$1("user.id"), 66658 n$5({ type: Number }) 66659 ], UserAccount$4.prototype, "userId", 2); 66660 __decorateClass$M([ 66661 bind$1("settings.modules.subscription.enabled"), 66662 n$5({ type: Boolean }) 66663 ], UserAccount$4.prototype, "hasSubscription", 2); 66664 __decorateClass$M([ 66665 bind$1("settings.modules.giftcards.enabled"), 66666 n$5({ type: Boolean }) 66667 ], UserAccount$4.prototype, "hasGiftcards", 2); 66668 __decorateClass$M([ 66669 bind$1("settings.modules.additional_products.enabled"), 66670 n$5({ type: Boolean }) 66671 ], UserAccount$4.prototype, "hasAdditionalProducts", 2); 66672 __decorateClass$M([ 66673 bind$1("settings.modules.shop.enabled"), 66674 n$5({ type: Boolean }) 66675 ], UserAccount$4.prototype, "hasShop", 2); 66676 __decorateClass$M([ 66677 r$5() 66678 ], UserAccount$4.prototype, "activeTab", 2); 66679 UserAccount$4 = __decorateClass$M([ 66680 t$3(tagName$B) 66681 ], UserAccount$4); 66682 var __defProp$I = Object.defineProperty; 66683 var __getOwnPropDesc$L = Object.getOwnPropertyDescriptor; 66684 var __decorateClass$L = (decorators, target, key, kind) => { 66685 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$L(target, key) : target; 66686 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66687 if (decorator = decorators[i2]) 66688 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66689 if (kind && result) __defProp$I(target, key, result); 66690 return result; 66691 }; 66692 const tagName$A = "sonic-link-ticket"; 66693 let SonicLinkTicket = class extends i$6 { 66694 constructor() { 66695 super(...arguments); 66696 this.displayTitle = false;
66697 this.displayText = false; 66698 this.smallTitle = false; 66699 this.userId = ""; 66700 } 66701 render() { 66702 if (!this.userId) return A$1; 66703 return b$1` 66704 <sonic-page-layout 66705 pageTitle=${t("LIB_compte_lier_transaction")} 66706 pageText=${t("LIB_compte_lier_transaction_aide")} 66707 ?smallTitle=${this.smallTitle} 66708 ?displayTitle=${this.displayTitle} 66709 ?displayText=${this.displayText} 66710 > 66711 <form method="post" dataProvider="tickets/link-to-account" formDataProvider="LinkTicketForm"> 66712 <sonic-fieldset> 66713 <sonic-input type="hidden" name="user_id" value=${this.userId}></sonic-input> 66714 <sonic-submit onEnterKey @submit=${this.handleSubmit}> 66715 <sonic-input 66716 type="text" 66717 label=${t("barcode_or_ticket_number")} 66718 name="barcode" 66719 required 66720 placeholder="- - - - - - - - - - - -" 66721 ></sonic-input> 66722 </sonic-submit> 66723 </sonic-fieldset> 66724 <sonic-submit onClick @submit=${this.handleSubmit}> 66725 <sonic-button radio noAutoFill type="success"> 66726 <sonic-icon slot="prefix" name="check"></sonic-icon> ${t("confirm")} 66727 </sonic-button> 66728 </sonic-submit> 66729 </form> 66730 </sonic-page-layout> 66731 `; 66732 } 66733 handleSubmit(event) { 66734 if (event.detail.success) { 66735 dp(DP_ACCOUNT_PURCHASES_FILTERS).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 66736 dp(DP_ACCOUNT_TICKETS_FILTERS).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 66737 const parentModal = HTML.getClosestElement(this, "sonic-modal"); 66738 parentModal?.hide(); 66739 } 66740 } 66741 }; 66742 SonicLinkTicket.styles = [tailwind]; 66743 __decorateClass$L([ 66744 n$5({ type: Boolean }) 66745 ], SonicLinkTicket.prototype, "displayTitle", 2); 66746 __decorateClass$L([ 66747 n$5({ type: Boolean }) 66748 ], SonicLinkTicket.prototype, "displayText", 2); 66749 __decorateClass$L([ 66750 n$5({ type: Boolean }) 66751 ], SonicLinkTicket.prototype, "smallTitle", 2); 66752 __decorateClass$L([ 66753 bind$1("user.id"), 66754 r$5() 66755 ], SonicLinkTicket.prototype, "userId", 2); 66756 SonicLinkTicket = __decorateClass$L([ 66757 t$3(tagName$A) 66758 ], SonicLinkTicket); 66759 var __defProp$H = Object.defineProperty; 66760 var __getOwnPropDesc$K = Object.getOwnPropertyDescriptor; 66761 var __decorateClass$K = (decorators, target, key, kind) => { 66762 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$K(target, key) : target; 66763 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66764 if (decorator = decorators[i2]) 66765 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66766 if (kind && result) __defProp$H(target, key, result); 66767 return result; 66768 }; 66769 const DP_ACCOUNT_TICKETS_FILTERS = "accountTicketsFilters"; 66770 const tagName$z = "sonic-user-account-tickets"; 66771 let UserAccount$3 = class UserAccount extends i$6 { 66772 constructor() { 66773 super(...arguments); 66774 this.eventSelection = "past"; 66775 } 66776 linkTicketModal() { 66777 Modal.create({ 66778 content: ( 66779 /*html*/ 66780 `<sonic-link-ticket displayTitle displayText smallTitle></sonic-link-ticket>` 66781 ), 66782 width: "40rem", 66783 removeOnHide: true 66784 }); 66785 } 66786 render() { 66787 if (!this.userId) return A$1; 66788 const todayMinus6hours = /* @__PURE__ */ new Date(); 66789 todayMinus6hours.setHours(todayMinus6hours.getHours() - 6); 66790 const fromDate = Math.floor(todayMinus6hours.getTime() / 1e3); 66791 const dateParam = this.eventSelection == "next" ? `&event_from=${fromDate}&sort=start_date:asc` : `&event_to=${fromDate}&sort=start_date:desc`; 66792 return b$1` 66793 <!-- Search --> 66794 <sonic-page-header label="${t("mes_billets")}"> 66795 <sonic-menu-item @click=${this.linkTicketModal} slot="more"> 66796 <sonic-icon slot="prefix" library="custom" name="link"></sonic-icon> 66797 ${t("LIB_compte_lier_transaction")}</sonic-menu-item 66798 > 66799 </sonic-page-header> 66800 <div 66801 formDataProvider="${DP_ACCOUNT_TICKETS_FILTERS}" 66802 dataProvider="${DP_ACCOUNT_TICKETS_FILTERS}" 66803 class="mb-8 flex flex-wrap gap-x-3 gap-y-2 items-center " 66804 > 66805 <sonic-input 66806 type="search" 66807 name="search" 66808 inlineContent 66809 placeholder="Rechercher..." 66810 filteredFields="title" 66811 class="grow max-w-[20rem]" 66812 autocomplete="off" 66813 value="" 66814 class="grow lg:grow-0" 66815 > 66816 <sonic-icon library="iconoir" slot="prefix" name="search"></sonic-icon> 66817 </sonic-input> 66818 <sonic-select 66819 name="eventSelection" 66820 class="min-w-[13rem]" 66821 .options=${[ 66822 { value: "next", wording: t("next_events") }, 66823 { value: "past", wording: t("past_events") } 66824 ]} 66825 > 66826 </sonic-select> 66827 </div> 66828 <div> 66829 <sonic-queue 66830 dataProviderExpression="/user/${this.userId}/purchases/event?limit=$limit&offset=$offset${dateParam}&owner=${this.userId}&buyer=${this.userId}" 66831 limit="8" 66832 lazyBoundsRatio="4" 66833 targetRequestDuration="1000" 66834 dataFilterProvider="${DP_ACCOUNT_TICKETS_FILTERS}" 66835 key="data" 66836 > 66837 <template data-value="no-item"> 66838 <sonic-no-result></sonic-no-result> 66839 </template> 66840 <template data-value="skeleton"> 66841 <sonic-purchase-summary class="block mb-3" skeleton></sonic-purchase-summary> 66842 </template> 66843 <template> 66844 <sonic-purchase-summary class="block mb-3"></sonic-purchase-summary> 66845 </template> 66846 </sonic-queue> 66847 </div> 66848 66849 <!--AIDE RELIER BILLET AU COMPTE CLIENT--> 66850 <sonic-alert status="info" background class="my-8" dismissible dism
66850issForever id="helpLinkTickets"> 66851 <div class="font-bold mb-1">${t("help_link_tickets")}</div> 66852 <sonic-button @click=${this.linkTicketModal} size="xs" type="info" variant="outline"> 66853 <sonic-icon slot="prefix" library="custom" name="link"></sonic-icon> 66854 ${t("LIB_compte_lier_transaction")}</sonic-button 66855 > 66856 </sonic-alert> 66857 `; 66858 } 66859 }; 66860 UserAccount$3.styles = [tailwind]; 66861 __decorateClass$K([ 66862 bind$1("user.id"), 66863 n$5({ type: Number }) 66864 ], UserAccount$3.prototype, "userId", 2); 66865 __decorateClass$K([ 66866 bind$1(`${DP_ACCOUNT_TICKETS_FILTERS}.eventSelection`), 66867 r$5() 66868 ], UserAccount$3.prototype, "eventSelection", 2); 66869 UserAccount$3 = __decorateClass$K([ 66870 t$3(tagName$z) 66871 ], UserAccount$3); 66872 const cancelTicket = (purchaseId, mode2 = "freeup") => { 66873 if (!purchaseId) return; 66874 dp("cancelTicketConfirmForm").set({}); 66875 const handleSubmit = (event) => { 66876 if (event.detail?.success) { 66877 const target = event.target; 66878 if (target instanceof HTMLElement) { 66879 const parentModal = HTML.getClosestElement(target, "sonic-modal"); 66880 if (parentModal) { 66881 parentModal.hide(); 66882 } 66883 } 66884 dp("user").invalidate(); 66885 dp(DP_ACCOUNT_PURCHASES_FILTERS).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 66886 dp(DP_ACCOUNT_TICKETS_FILTERS).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 66887 dp("accountHomeTickets")?.invalidate(); 66888 } 66889 }; 66890 const title = mode2 === "freeup" ? t("free_up_confirm") : t("annuler_contre_avoir_confirm"); 66891 const content = mode2 === "freeup" ? t("free_up_short_text") : t("annuler_contre_avoir_short_text"); 66892 const endpoint = mode2 === "freeup" ? "tickets" : "tickets/cancel-for-credit"; 66893 const method = mode2 === "freeup" ? "delete" : "post"; 66894 Modal.create({ 66895 title, 66896 content, 66897 actions: b$1` 66898 <sonic-submit 66899 endpoint=${endpoint} 66900 method=${method} 66901 @submit=${handleSubmit} 66902 formDataProvider="cancelTicketConfirmForm" 66903 onClick 66904 > 66905 <sonic-input type="hidden" name="id" value="${purchaseId}"></sonic-input> 66906 <sonic-button minWidth="13rem" hideModal noAutoFill type="success"> 66907 <sonic-icon name="check" slot="prefix" library="custom"></sonic-icon> ${t("confirm")} 66908 </sonic-button> 66909 </sonic-submit> 66910 <sonic-button noAutoFill hideModal type="default">${t("cancel")} </sonic-button> 66911 ` 66912 }); 66913 }; 66914 const googleCalendarUrl = (session) => { 66915 const entity = session; 66916 const { edito, start_date, end_date, location: location2, settings } = entity; 66917 if (!start_date) return ""; 66918 const toGoogleDate = (timestamp) => new Date(timestamp * 1e3).toISOString().replace(/[-:]/g, "").replace(/\.\d+/, ""); 66919 const googleStartDate = toGoogleDate(start_date); 66920 const computedDuration = (settings?.duration || 0) * 60; 66921 const endDate = end_date ? toGoogleDate(end_date) : toGoogleDate(start_date + computedDuration); 66922 const title = edito?.alt_title || edito?.title; 66923 const subtitle = edito?.sub_title || ""; 66924 const body = edito?.body?.replaceAll("</p>", "\n").replace(/<[^>]*>?/g, "").trim() || ""; 66925 const truncadedBody = body.length > 259 ? body.slice(0, 259) + "..." : body; 66926 const googleCalendarUrl2 = new URLSearchParams({ 66927 action: "TEMPLATE", 66928 text: title + " " + subtitle || "", 66929 dates: `${googleStartDate}/${endDate}`, 66930 details: truncadedBody, 66931 location: [location2?.title, location2?.address, location2?.city, location2?.postal_code].filter(Boolean).join(" ") 66932 }); 66933 return `https://www.google.com/calendar/render?${googleCalendarUrl2}`; 66934 }; 66935 const icsCalendarUrl = (sessions, store_url) => { 66936 const urlWithoutLastSlash = store_url.replace(/\/$/, ""); 66937 return `${urlWithoutLastSlash}/calendar?${sessions.map((session) => `event_id[]=${session.id}`).join("&")}.ics`; 66938 }; 66939 var __defProp$G = Object.defineProperty; 66940 var __getOwnPropDesc$J = Object.getOwnPropertyDescriptor; 66941 var __decorateClass$J = (decorators, target, key, kind) => { 66942 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$J(target, key) : target; 66943 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 66944 if (decorator = decorators[i2]) 66945 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 66946 if (kind && result) __defProp$G(target, key, result); 66947 return result; 66948 }; 66949 const tagName$y = "sonic-add-to-calendar-list"; 66950 let AddToCalendarList = class extends Subscriber$1(i$6) { 66951 constructor() { 66952 super(...arguments); 66953 this.session = null; 66954 this.sessions = []; 66955 this.store_url = ""; 66956 this.uniqueSessions = []; 66957 } 66958 willUpdate(changedProperties) { 66959 if (changedProperties.has("sessions")) { 66960 this.sessions.forEach((session) => { 66961 if (session.id && !this.uniqueSessions.some((s2) => s2.id === session.id)) { 66962 this.uniqueSessions.push(session); 66963 } 66964 }); 66965 } 66966 if (changedProperties.has("store_url") || changedProperties.has("uniqueSessions")) { 66967 this.icsUrl = icsCalendarUrl(this.uniqueSessions, this.store_url); 66968 } 66969 } 66970 render() { 66971 return b$1`
66972 <sonic-button noAutofill variant="outline" class="grow" href="${this.icsUrl}" shape="block"> 66973 <sonic-icon library="custom" name="download"></sonic-icon> 66974 ${t("download_all_calendar_ics")} 66975 </sonic-button> 66976 <sonic-divider class="mt-6 mb-3"> 66977 <sonic-icon library="custom" prefix="brands" name="google"></sonic-icon> Google Agenda</sonic-divider 66978 > 66979 ${c$1( 66980 this.uniqueSessions, 66981 (session) => session.id, 66982 (session, _index) => { 66983 const googleUrl = googleCalendarUrl(session); 66984 return b$1` 66985 <sonic-product-summary 66986 class="mb-1 p-1 hover:bg-neutral-50 rounded" 66987 size="xs" 66988 .props=${session} 66989 noAutofill 66990 dataProvider="PurchaseSession/${session.id}" 66991 > 66992 <sonic-button 66993 target="_blank" 66994 href="${googleUrl}" 66995 slot="actions" 66996 noAutofill 66997 variant="outline" 66998 class="grow" 66999 shape="circle" 67000 > 67001 <sonic-icon library="custom" name="calendar-plus"></sonic-icon> 67002 </sonic-button> 67003 </sonic-product-summary> 67004 `; 67005 } 67006 )} 67007 `; 67008 } 67009 }; 67010 AddToCalendarList.styles = [tailwind]; 67011 __decorateClass$J([ 67012 n$5({ type: Object }) 67013 ], AddToCalendarList.prototype, "session", 2); 67014 __decorateClass$J([ 67015 n$5({ type: Array }) 67016 ], AddToCalendarList.prototype, "sessions", 2); 67017 __decorateClass$J([ 67018 bind$1("settings.store_url"), 67019 n$5({ type: String }) 67020 ], AddToCalendarList.prototype, "store_url", 2); 67021 __decorateClass$J([ 67022 r$5() 67023 ], AddToCalendarList.prototype, "uniqueSessions", 2); 67024 __decorateClass$J([ 67025 r$5() 67026 ], AddToCalendarList.prototype, "icsUrl", 2); 67027 AddToCalendarList = __decorateClass$J([ 67028 t$3(tagName$y) 67029 ], AddToCalendarList); 67030 var __defProp$F = Object.defineProperty; 67031 var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor; 67032 var __decorateClass$I = (decorators, target, key, kind) => { 67033 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$I(target, key) : target; 67034 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67035 if (decorator = decorators[i2]) 67036 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67037 if (kind && result) __defProp$F(target, key, result); 67038 return result; 67039 }; 67040 let PurchaseCompletion = class extends Fetcher$1(Subscriber$1(i$6)) { 67041 constructor() { 67042 super(...arguments); 67043 this.purchase_id = 0; 67044 this.forceError = false; 67045 this.wecount_link = false; 67046 this.hasAlreadyPurchased = false; 67047 this.hasLoadedOnce = false; 67048 this.data = null; 67049 this.eventIds = []; 67050 this.pixelAdded = false; 67051 } 67052 connectedCallback() { 67053 this.isFetchEnabled = false; 67054 if (!this.purchase_id) { 67055 const urlParams = new URLSearchParams(window.location.search); 67056 this.purchase_id = parseInt(urlParams.get("sonic_purchase_id") || "0"); 67057 } 67058 if (this.purchase_id) { 67059 this.setAttribute("fetch", ""); 67060 this.isFetchEnabled = true; 67061 if (this.isFetchEnabled && this.purchase_id) { 67062 this.dataProvider = `orders/${this.purchase_id}?features[]=purchases`; 67063 } 67064 const lastPurchaseId = localStorage.getItem("lastPurchaseId"); 67065 if (lastPurchaseId && lastPurchaseId === this.purchase_id.toString()) { 67066 this.hasAlreadyPurchased = true; 67067 } 67068 } else { 67069 this.forceError = true; 67070 } 67071 super.connectedCallback(); 67072 } 67073 willUpdate(changedProperties) { 67074 if (changedProperties.has("data")) { 67075 if (this.data?.status === "success") { 67076 localStorage.setItem("lastPurchaseId", this.purchase_id.toString()); 67077 this.addTracking(); 67078 } 67079 if (this.data?.status === "pending") { 67080 this.fetchEvery4s(); 67081 } 67082 if (this.data?.purchases) { 67083 this.eventIds = this.data.purchases.filter((purchase) => purchase.entity_type === EntityType.Event && purchase.entity?.id).map((purchase) => purchase.entity?.id?.toString() || ""); 67084 } 67085 } 67086 if (!this.hasLoadedOnce && this.data?.status) { 67087 this.hasLoadedOnce = true; 67088 } 67089 super.willUpdate(changedProperties); 67090 } 67091 fetchEvery4s() { 67092 setTimeout(() => { 67093 this._fetchData(); 67094 }, 7e3); 67095 } 67096 addTracking() { 67097 if (this.pixelAdded) return; 67098 this.pixelAdded = true; 67099 const orderId = this.purchase_id.toString(); 67100 const revenue = String(this.data?.amount ?? 0); 67101 TrackingManager.getTrackingManager((trackingManager) => { 67102 trackingManager.trackingOnPurchase(orderId, revenue); 67103 }); 67104 } 67105 render() { 67106 if (this.isLoading && !this.hasLoadedOnce) { 67107 return b$1`<sonic-loader align="left" mode="inline"></sonic-loader>`; 67108 } 67109 let status = this.data?.status || "need_login"; 67110 let title; 67111 let subtitle; 67112 switch (status) { 67113 case "waiting": 67114 goTo("cart"); 67115 return A$1; 67116 case "success": 67117 if (this.hasAlreadyPurchased) { 67118 title = t("purchase_completion_title_already_purchased"); 67119 } else { 67120 title = this.data?.amount ? t("purchase_completion_title") : t("purchase_completion_title_free"); 67121 } 67122 if (this.userId) { 67123 subtitle = t("purchase_completion_message_loggedIn"); 67124 } else { 67125 subtitle = t("purchase_completion_message_notLoggedIn"); 67126 } 67127 break; 67128 case "rejected": 67129 title = t("paiement_en_erreur"); 67130 subtitle = t("retry_order"); 67131 break; 67132 case "error": 67133 title = t("error_occurred"); 67134 subtitle = t("paiement_erreur"); 67135 break; 67136 case "expired": 67137 title = t("LIB_panier_expire"); 67138 subtitle = t("retry_order"); 67139 break; 67140 case "pending": 67141 title = t("payment_processing"); 67142 subtitle = t("payment_wait_reload_request"); 67143 break; 67144 case "need_login": 67145 title = t("error_occurred"); 67146 subtitle = t("purchase_completion_title_need_login"); 67147 break; 67148 default: 67149 title = t("error_occurred"); 67150 break; 67151 } 67152 return b$1` 67153 <div class="max-w-prose container"> 67154 <sonic-page-header .label="${title}" .subtitle="${subtitle}"> </sonic-page-header> 67155 67156 <!-- SI erreur --> 67157 ${status == "error" ? b$1` 67158 ${this.settingsInfos?.email_contact ? b$1`<sonic-button href="mailto:${this.settingsInfos?.email_contact}"> 67159 <sonic-icon slot="prefix" name="envelope" library="custom"></sonic-icon> 67160 ${this.settingsInfos?.email_contact}</sonic-button 67161 > ` : A$1} 67162 ` : A$1} 67163 67164 <!-- SI EN COURS -->
67165 ${status == "pending" ? b$1`<sonic-loader align="left" mode="inline"></sonic-loader> ` : A$1} 67166 ${status == "need_login" ? b$1` 67167 <sonic-app-link to="account" variant="default" type="primary"> 67168 <sonic-icon library="custom" name="user"></sonic-icon> 67169 ${t("se_connecter")} 67170 </sonic-app-link> 67171 ` : A$1} 67172 <!-- SI success --> 67173 67174 ${status == "success" ? b$1` 67175 <div class="flex flex-wrap gap-2"> 67176 ${this.data?.pdf_url ? b$1` <sonic-button target="_blank" type="primary" href="${this.data.pdf_url}" 67177 ><sonic-icon library="custom" name="file-pdf" slot="prefix"></sonic-icon>${t( 67178 "purchase_completion_download" 67179 )}</sonic-button 67180 >` : A$1} 67181 ${this.data?.mandate_pdf_url ? b$1`<sonic-button target="_blank" href="${this.data.mandate_pdf_url}" 67182 ><sonic-icon library="custom" name="file-pdf" slot="prefix"></sonic-icon>${t( 67183 "mandat_imprimer" 67184 )}</sonic-button 67185 >` : A$1} 67186 ${this.renderAddToCalendar()} 67187 </div> 67188 <!-- SI loggé + pas d'email envoyé --> 67189 ${this.userId && this.send_order_mail === false ? b$1` 67190 <sonic-alert 67191 status="success" 67192 class="mt-12" 67193 background 67194 label="${t("purchase_completion_alert_label_loggedIn")}" 67195 text="${t("purchase_completion_alert_text_loggedIn")}" 67196 > 67197 <sonic-icon slot="icon" name="envelope" library="custom" size="lg"></sonic-icon> 67198 </sonic-alert> 67199 ` : A$1} 67200 67201 <!-- SI on envoie les email ou utilisateur achat sans compte --> 67202 ${!this.userId || this.send_order_mail === true ? b$1` 67203 <sonic-alert 67204 status="info" 67205 class="mt-12" 67206 background 67207 label="${t("purchase_completion_alert_label_notLoggedIn")}" 67208 text="${t("purchase_completion_alert_text_notLoggedIn")}" 67209 > 67210 <sonic-icon slot="icon" name="envelope" library="custom" size="lg"></sonic-icon> 67211 </sonic-alert> 67212 ` : A$1} 67213 ${this.wecount_link && this.settingsInfos?.store_url ? b$1` <a 67214 href="https://mep.wecount.io/campaigns/8ed50c2b-3295-445c-b5d4-56ee12b1b0c1/form" 67215 target="_blank" 67216 class="block mt-2 hover:shadow-[0px_0px_0_3px_#ffb71d] transition rounded-md overflow-hidden" 67217 ><sonic-image 67218 src="${this.settingsInfos?.store_url}/sites/all/themes/superstrap/img/wecount.png" 67219 ></sonic-image 67220 ></a>` : A$1} 67221 ` : A$1} 67222 </div> 67223 `; 67224 } 67225 renderAddToCalendar() { 67226 const eventPurchases = this.data?.purchases?.filter( 67227 (purchase) => purchase.entity_type === EntityType.Event && purchase.entity?.id 67228 ); 67229 const sessions = eventPurchases?.map((purchase) => purchase.entity); 67230 if (!sessions || sessions.length === 0) return A$1; 67231 return b$1`<sonic-button @click=${() => this.renderAddToCalendarModal(sessions)}> 67232 <sonic-icon library="custom" slot="prefix" name="calendar-plus"></sonic-icon> 67233 ${t("add_to_calendar")} 67234 </sonic-button>`; 67235 } 67236 renderAddToCalendarModal(sessions) { 67237 Modal.create({ 67238 title: t("add_to_calendar"), 67239 content: b$1`<sonic-add-to-calendar-list .sessions=${sessions}></sonic-add-to-calendar-list>`, 67240 maxWidth: "40rem", 67241 removeOnHide: true 67242 }); 67243 } 67244 }; 67245 PurchaseCompletion.styles = [tailwind]; 67246 __decorateClass$I([ 67247 bind$1("user.id"), 67248 n$5({ type: String }) 67249 ], PurchaseCompletion.prototype, "userId", 2); 67250 __decorateClass$I([ 67251 bind$1("settings.send_order_mail"), 67252 n$5({ type: Boolean }) 67253 ], PurchaseCompletion.prototype, "send_order_mail", 2); 67254 __decorateClass$I([ 67255 bind$1("settings.infos"), 67256 n$5({ type: Object }) 67257 ], PurchaseCompletion.prototype, "settingsInfos", 2); 67258 __decorateClass$I([ 67259 n$5({ type: Number }) 67260 ], PurchaseCompletion.prototype, "purchase_id", 2); 67261 __decorateClass$I([ 67262 n$5({ type: Boolean }) 67263 ], PurchaseCompletion.prototype, "forceError", 2); 67264 __decorateClass$I([ 67265 bind$1("settings.wecount_link"), 67266 n$5({ type: Boolean }) 67267 ], PurchaseCompletion.prototype, "wecount_link", 2); 67268 __decorateClass$I([ 67269 n$5({ type: Boolean }) 67270 ], PurchaseCompletion.prototype, "hasAlreadyPurchased", 2); 67271 __decorateClass$I([ 67272 n$5({ type: Boolean }) 67273 ], PurchaseCompletion.prototype, "hasLoadedOnce", 2); 67274 __decorateClass$I([ 67275 n$5({ type: Object }) 67276 ], PurchaseCompletion.prototype, "data", 2); 67277 __decorateClass$I([ 67278 r$5() 67279 ], PurchaseCompletion.prototype, "eventIds", 2); 67280 __decorateClass$I([ 67281 r$5() 67282 ], PurchaseCompletion.prototype, "pixelAdded", 2); 67283 PurchaseCompletion = __decorateClass$I([ 67284 t$3("sonic-checkout-process-end") 67285 ], PurchaseCompletion); 67286 var __defProp$E = Object.defineProperty; 67287 var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor; 67288 var __decorateClass$H = (decorators, target, key, kind) => { 67289 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$H(target, key) : target; 67290 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67291 if (decorator = decorators[i2]) 67292 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67293 if (kind && result) __defProp$E(target, key, result); 67294 return result; 67295 }; 67296 let instanceCounter$1 = 0; 67297 let SonicRefundForm = class extends Subscriber$1(i$6) { 67298 constructor() { 67299 super(...arguments); 67300 this.id = ""; 67301 this.barcode = ""; 67302 this.entity_type = "event";
67303 this.success = false; 67304 this._editBankingInfo = false; 67305 this._hasBankingInfo = false; 67306 this.formDataProvider = "refundForm" + instanceCounter$1++; 67307 this.ribInfoFormDataProvider = "ribInfoForm" + instanceCounter$1++; 67308 } 67309 handleSubmit(event) { 67310 this.success = !!event.detail.success; 67311 } 67312 handleSubmitBankingInfo(event) { 67313 if (event.detail.success) { 67314 this._editBankingInfo = false; 67315 dp("user").invalidate(); 67316 } 67317 } 67318 willUpdate(changedProperties) { 67319 if (changedProperties.has("user")) { 67320 const { iban, bic, rib_uploaded_at } = this.user ?? {}; 67321 if (!iban && !bic && !rib_uploaded_at) { 67322 this._hasBankingInfo = false; 67323 } else { 67324 this._hasBankingInfo = true; 67325 } 67326 } 67327 } 67328 render() { 67329 const userId = this.user?.id; 67330 const { enable_iban_bic_txt, enable_iban_bic_pdf } = this.settings?.refund_form ?? {}; 67331 const bothFormatAreEnabled = enable_iban_bic_txt && enable_iban_bic_pdf; 67332 const { iban, bic, rib_uploaded_at } = this.user ?? {}; 67333 if (!this.id || !userId) return A$1; 67334 if (this.success) { 67335 return b$1`<sonic-alert 67336 status="success" 67337 label=${t("LIB_remboursement_confirme")} 67338 class="my-6" 67339 background 67340 ></sonic-alert> 67341 <sonic-app-link noAutoFill to="account.purchases" variant="default" type="primary" autoActive="disabled"> 67342 <sonic-icon name="clock-rotate-left" slot="prefix" library="custom"></sonic-icon> 67343 ${t("mes_achats")}</sonic-app-link 67344 > 67345 <sonic-button 67346 noAutoFill 67347 variant="ghost" 67348 @click=${() => { 67349 this.success = false; 67350 dp(this.formDataProvider).barcode.set(""); 67351 this.barcode = ""; 67352 }} 67353 > 67354 <sonic-icon name="plus" slot="prefix" library="custom"></sonic-icon> 67355 ${t("LIB_nouvelle_demande")}</sonic-button 67356 > `; 67357 } 67358 if (this._editBankingInfo) { 67359 return b$1` 67360 <form formDataProvider=${this.ribInfoFormDataProvider}> 67361 <sonic-fieldset label=${t("LIB_remboursement_infos_bancaires")} iconName="file-invoice" iconLibrary="custom"> 67362 <sonic-form-layout> 67363 ${enable_iban_bic_txt ? b$1` 67364 <sonic-input 67365 ?required=${enable_iban_bic_txt} 67366 type="text" 67367 label=${t("IBAN")} 67368 name="iban" 67369 placeholder="FR00 0000 0000 0000 0000 0000 0000 000" 67370 value=${iban} 67371 ></sonic-input> 67372 <sonic-input 67373 ?required=${enable_iban_bic_txt} 67374 type="text" 67375 label=${t("BIC")} 67376 name="bic" 67377 placeholder="- - - - - - -" 67378 value=${bic} 67379 ></sonic-input> 67380 ` : A$1} 67381 ${bothFormatAreEnabled ? b$1` <sonic-divider></sonic-divider> ` : A$1} 67382 ${enable_iban_bic_pdf ? b$1` 67383 <sonic-file-upload 67384 label=${t("RIB")} 67385 name="rib" 67386 .accept=${["image/jpeg", "image/png", "image/jpg", "application/pdf", "image/gif"]} 67387 ?required=${enable_iban_bic_pdf} 67388 ></sonic-file-upload> 67389 ` : A$1} 67390 </sonic-form-layout> 67391 </sonic-fieldset> 67392 <div class="flex gap-2"> 67393 <sonic-submit 67394 onClick 67395 endpoint="user/${userId}/banking-info" 67396 @submit=${this.handleSubmitBankingInfo} 67397 method="post" 67398 > 67399 <sonic-button noAutoFill type="success" 67400 ><sonic-icon slot="prefix" name="check" library="custom"></sonic-icon> ${t("mettre_a_jour")} 67401 </sonic-button> 67402 </sonic-submit> 67403 67404 ${this._hasBankingInfo ? b$1` 67405 <sonic-button 67406 @click=${() => { 67407 this._editBankingInfo = false;
67408 dp("user").invalidate(); 67409 }} 67410 > 67411 <sonic-icon name="arrow-rotate-left" slot="prefix" library="custom"></sonic-icon> 67412 ${t("annuler")} 67413 </sonic-button> 67414 ` : A$1} 67415 </div> 67416 </form> 67417 `; 67418 } 67419 const ribIsMissing = this.user && !rib_uploaded_at && enable_iban_bic_pdf; 67420 const ibanOrBicIsMissing = this.user && (!iban || !bic) && enable_iban_bic_txt; 67421 return b$1`<sonic-fieldset 67422 label=${t("LIB_remboursement_infos_bancaires")} 67423 iconName="file-invoice" 67424 iconLibrary="custom" 67425 > 67426 ${iban ? b$1`<div><b>${t("IBAN")}</b> : ${iban}</div>` : A$1} 67427 ${bic ? b$1`<div><b>${t("BIC")}</b> : ${bic}</div>` : A$1} 67428 ${rib_uploaded_at ? b$1`<div> 67429 <b>${t("RIB")}</b> : ${t("LIB_updated_at")} <sonic-date date=${rib_uploaded_at}></sonic-date> 67430 </div>` : A$1} 67431 ${ribIsMissing || ibanOrBicIsMissing ? b$1`<sonic-alert 67432 status="error" 67433 label=${t("LIB_remboursement_infos_bancaires_incompletes")} 67434 class="mt-2 animate-pulse" 67435 ></sonic-alert>` : A$1} 67436 <sonic-button 67437 size="sm" 67438 class="mt-2" 67439 variant="outline" 67440 @click=${() => { 67441 this._editBankingInfo = true; 67442 }} 67443 type="${ribIsMissing || ibanOrBicIsMissing ? "danger" : "default"}" 67444 > 67445 <sonic-icon name="pencil" slot="prefix" library="custom"></sonic-icon> 67446 ${t("Modifier")} 67447 </sonic-button> 67448 </sonic-fieldset> 67449 <form formDataProvider=${this.formDataProvider}> 67450 <sonic-input type="hidden" name="event_id" value=${this.id}></sonic-input> 67451 ${userId ? b$1`<sonic-input type="hidden" name="user_id" value=${userId}></sonic-input>` : A$1} 67452 <sonic-input type="hidden" name="entity_type" value=${this.entity_type}></sonic-input> 67453 67454 <sonic-fieldset> 67455 <sonic-form-layout> 67456 <sonic-input 67457 type="text" 67458 label=${t("barcode_or_ticket_number")} 67459 name="barcode" 67460 placeholder="- - - - - - - - - - - -" 67461 required 67462 value=${this.barcode} 67463 > 67464 <sonic-app-link slot="description" noAutoFill to="account.purchases" variant="link" autoActive="disabled"> 67465 <sonic-icon name="arrow-right" slot="prefix" library="custom"></sonic-icon> 67466 ${t("LIB_rechercher_mon_billet")} 67467 </sonic-app-link> 67468 </sonic-input> 67469 </sonic-form-layout> 67470 </sonic-fieldset> 67471 <sonic-submit 67472 onClick 67473 endpoint="refunds/ask" 67474 @submit=${this.handleSubmit} 67475 method="post" 67476 ?disabled=${ribIsMissing || ibanOrBicIsMissing} 67477 > 67478 <sonic-button noAutoFill type="success" ?disabled=${ribIsMissing || ibanOrBicIsMissing} 67479 ><sonic-icon slot="prefix" name="check" library="custom"></sonic-icon> ${t("confirm")} 67480 </sonic-button> 67481 </sonic-submit> 67482 </form> `; 67483 } 67484 }; 67485 SonicRefundForm.styles = [tailwind]; 67486 __decorateClass$H([ 67487 n$5({ type: String, attribute: "data-id" }) 67488 ], SonicRefundForm.prototype, "id", 2); 67489 __decorateClass$H([ 67490 n$5({ type: String }) 67491 ], SonicRefundForm.prototype, "barcode", 2); 67492 __decorateClass$H([ 67493 n$5({ type: String }) 67494 ], SonicRefundForm.prototype, "entity_type", 2); 67495 __decorateClass$H([ 67496 bind$1("user"), 67497 n$5({ type: Object }) 67498 ], SonicRefundForm.prototype, "user", 2); 67499 __decorateClass$H([ 67500 bind$1("settings"), 67501 n$5({ type: Object }) 67502 ], SonicRefundForm.prototype, "settings", 2); 67503 __decorateClass$H([ 67504 r$5() 67505 ], SonicRefundForm.prototype, "success", 2); 67506 __decorateClass$H([ 67507 r$5() 67508 ], SonicRefundForm.prototype, "_editBankingInfo", 2); 67509 __decorateClass$H([ 67510 r$5() 67511 ], SonicRefundForm.prototype, "_hasBankingInfo", 2); 67512 SonicRefundForm = __decorateClass$H([ 67513 t$3("sonic-refund-form") 67514 ], SonicRefundForm); 67515 var __defProp$D = Object.defineProperty; 67516 var __getOwnPropDesc$G = Object.getOwnPropertyDescriptor; 67517 var __decorateClass$G = (decorators, target, key, kind) => { 67518 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$G(target, key) : target; 67519 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67520 if (decorator = decorators[i2]) 67521 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67522 if (kind && result) __defProp$D(target, key, result); 67523 return result; 67524 }; 67525 const tagName$x = "sonic-refund"; 67526 let SonicRefund = class extends i$6 { 67527 constructor() { 67528 super(...arguments); 67529 this.event_id = ""; 67530 this.barcode = ""; 67531 this.displayTitle = false;
67532 this.displayText = false; 67533 this.smallTitle = false; 67534 } 67535 connectedCallback() { 67536 const urlParams = new URLSearchParams(window.location.search); 67537 if (!this.event_id) { 67538 this.event_id = urlParams.get("event_id") || ""; 67539 } 67540 if (!this.barcode) { 67541 this.barcode = urlParams.get("barcode") || ""; 67542 } 67543 super.connectedCallback(); 67544 } 67545 async willUpdate(changedProperties) { 67546 if (changedProperties.has("event_id") && this.event_id) { 67547 this.sessionResult = await this.fetchEvent(); 67548 } 67549 } 67550 async fetchEvent() { 67551 const api2 = new API(HTML$1.getApiConfiguration(this)); 67552 const endpoint = entityEndPoint({ 67553 entityType: EntityType.Event, 67554 entityId: Number(this.event_id), 67555 view: entityView.essential, 67556 features: [Feature.Status] 67557 }); 67558 const result = await api2.get(endpoint); 67559 return result; 67560 } 67561 render() { 67562 return b$1`<sonic-page-layout 67563 ?smallTitle=${this.smallTitle} 67564 ?displayTitle=${this.displayTitle} 67565 ?displayText=${this.displayText} 67566 pageTitle=${t("remboursement")} 67567 pageText=${t("LIB_remboursement_texte_aide")} 67568 > 67569 <div class="max-w-[60rem]"> 67570 <!-- intro selon évènement --> 67571 ${this.renderForm()} 67572 67573 <!-- Si connecté pas d'évènement passé, la liste est affichée --> 67574 ${this.renderList()} 67575 </div> 67576 </sonic-page-layout>`; 67577 } 67578 renderForm() { 67579 const isLogged = !!this.userId; 67580 const sessionData = this.sessionResult?.data; 67581 const displayEvent = isLogged && this.event_id; 67582 const displayForm = displayEvent && sessionData?.settings?.refund?.enabled === true; 67583 const displayRefundIsNotEnabled = displayEvent && sessionData?.settings?.refund?.enabled === false; 67584 const display404 = displayEvent && this.sessionResult?.success === false; 67585 return b$1` 67586 ${sessionData ? b$1` 67587 <sonic-product-summary 67588 dataProvider="sessionRefundData/${this.event_id}" 67589 noAutoFill 67590 .props=${sessionData} 67591 class="mb-5 block" 67592 .featureDisplay=${[ProductDisplay.Status, ProductDisplay.Location]} 67593 ></sonic-product-summary> 67594 ` : A$1} 67595 67596 <!-- Si Pas connecté --> 67597 ${!isLogged ? b$1`<sonic-user-form-login 67598 class="mt-8 w-full" 67599 createSubTitle="${t("LIB_remboursement_pas_de_compte_2")}" 67600 createAccount 67601 ></sonic-user-form-login>` : A$1} 67602 67603 <!-- Si connecté et eventId en contexte du composant --> 67604 ${displayForm ? b$1`<sonic-refund-form .id="${this.event_id}" barcode="${this.barcode}"></sonic-refund-form> ` : A$1} 67605 ${display404 ? b$1`<sonic-alert status="error" background label=${t("LIB_event_404")} class="my-5"></sonic-alert>` : A$1} 67606 ${displayRefundIsNotEnabled ? b$1`<sonic-alert 67607 status="error" 67608 background 67609 label=${t("LIB_event_refund_not_enabled")} 67610 class="my-5" 67611 ></sonic-alert>` : A$1} 67612 `; 67613 } 67614 renderList() { 67615 const isLogged = !!this.userId; 67616 if (!isLogged || this.event_id) return A$1; 67617 return b$1` <sonic-queue 67618 dataProviderExpression="sessions?limit=$limit&offset=$offset&refund=1&features[]=picture&features[]=location" 67619 key="data" 67620 limit="5" 67621 targetRequestDuration="1000" 67622 class="mt-8" 67623 .noItems=${() => b$1`<sonic-no-result .text=${t("LIB_remboursement_aucun_evenement")}></sonic-no-result>`} 67624 .items=${(_item) => b$1`<sonic-button 67625 variant="unstyled" 67626 class="w-full" 67627 @click=${() => this.event_id = _item.id?.toString() || ""} 67628 ><sonic-product-summary .featureDisplay=${[ProductDisplay.Status, ProductDisplay.Location]} class="w-full"> 67629 <sonic-button slot="actions" icon shape="circle"> 67630 <sonic-icon name="chevron-right" library="custom"></sonic-icon> 67631 </sonic-button> </sonic-product-summary 67632 ></sonic-button> 67633 <sonic-divider class="my-4"></sonic-divider>`} 67634 > 67635 </sonic-queue>`; 67636 } 67637 }; 67638 SonicRefund.styles = [tailwind]; 67639 __decorateClass$G([ 67640 n$5({ type: String }) 67641 ], SonicRefund.prototype, "event_id", 2); 67642 __decorateClass$G([ 67643 n$5({ type: String }) 67644 ], SonicRefund.prototype, "barcode", 2); 67645 __decorateClass$G([ 67646 n$5({ type: Boolean }) 67647 ], SonicRefund.prototype, "displayTitle", 2); 67648 __decorateClass$G([ 67649 n$5({ type: Boolean }) 67650 ], SonicRefund.prototype, "displayText", 2); 67651 __decorateClass$G([ 67652 n$5({ type: Boolean }) 67653 ], SonicRefund.prototype, "smallTitle", 2); 67654 __decorateClass$G([ 67655 bind$1("user.id"), 67656 n$5({ type: String }) 67657 ], SonicRefund.prototype, "userId", 2); 67658 __decorateClass$G([ 67659 r$5() 67660 ], SonicRefund.prototype, "sessionResult", 2); 67661 SonicRefund = __decorateClass$G([ 67662 t$3(tagName$x) 67663 ], SonicRefund); 67664 var __defProp$C = Object.defineProperty; 67665 var __getOwnPropDesc$F = Object.getOwnPropertyDescriptor; 67666 var __decorateClass$F = (decorators, target, key, kind) => { 67667 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$F(target, key) : target; 67668 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67669 if (decorator = decorators[i2]) 67670 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67671 if (kind && result) __defProp$C(target, key, result); 67672 return result; 67673 }; 67674 let SonicComponent$6 = class SonicComponent extends Subscriber$1(i$6) { 67675 constructor() { 67676 super(...arguments); 67677 this.logoFallback = false;
67678 } 67679 render() { 67680 const theme = this.props; 67681 if (!theme) return A$1; 67682 const bannerDesktop = theme.banners?.banner_desktop?.ratio_auto_1920 || theme.banners?.banner_desktop?.src; 67683 const bannerMobile = theme.banners?.banner_mobile?.ratio_auto_1000 || theme.banners?.banner_mobile?.src; 67684 const logo = theme.banners?.banner_mobile?.ratio_auto_640 || theme.logos?.logo_billetterie?.src; 67685 let LogoVisiblityClass = "flex"; 67686 if (bannerDesktop && !bannerMobile) { 67687 LogoVisiblityClass = "flex lg:hidden"; 67688 } 67689 if (!bannerDesktop && bannerMobile) { 67690 LogoVisiblityClass = "hidden lg:flex"; 67691 } 67692 return b$1` 67693 ${bannerDesktop ? b$1` 67694 <a href="/" class="lb_banner-desktop overflow-hidden rounded-lg w-full mb-10 [display:none] lg:block "> 67695 <img loading="eager" src="${bannerDesktop}" class="block w-full" alt="" /> 67696 </a> 67697 ` : ""} 67698 ${bannerMobile ? b$1` 67699 <a href="/" class="lb_banner-mobile overflow-hidden rounded-md w-full mb-7 block lg:hidden"> 67700 <img loading="eager" src="${bannerMobile}" class="block w-full" alt="" /> 67701 </a> 67702 ` : ""} 67703 ${this.logoFallback && logo && !(bannerDesktop && bannerMobile) ? b$1` 67704 <div class=" justify-center items-center my-4 lg:mt-8 lg:mb-12 ${LogoVisiblityClass}"> 67705 <a href="/" class="contents"> 67706 <img 67707 loading="eager" 67708 src="${logo}" 67709 alt="" 67710 class="block max-w-[16rem] lg:max-w-[32rem] max-h-[10rem] object-contain w-10/12" 67711 /> 67712 </a> 67713 </div> 67714 ` : ""} 67715 `; 67716 } 67717 }; 67718 SonicComponent$6.styles = [tailwind]; 67719 __decorateClass$F([ 67720 n$5({ type: Boolean }) 67721 ], SonicComponent$6.prototype, "logoFallback", 2); 67722 SonicComponent$6 = __decorateClass$F([ 67723 t$3("sonic-banner") 67724 ], SonicComponent$6); 67725 var __defProp$B = Object.defineProperty; 67726 var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor; 67727 var __decorateClass$E = (decorators, target, key, kind) => { 67728 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$E(target, key) : target; 67729 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67730 if (decorator = decorators[i2]) 67731 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67732 if (kind && result) __defProp$B(target, key, result); 67733 return result; 67734 }; 67735 const tagName$w = "sonic-fullscreen-layout"; 67736 let SonicComponent$5 = class SonicComponent extends Subscriber$1(i$6) { 67737 constructor() { 67738 super(...arguments); 67739 this.largeAside = false;
67740 this.forceZindex = false; 67741 this.displayBanner = false; 67742 this.noAside = false; 67743 this.noHeader = false; 67744 this.alwaysTwoColumns = false; 67745 this.isWaiting = false; 67746 } 67747 connectedCallback() { 67748 super.connectedCallback(); 67749 document.documentElement.scrollTop; 67750 document.body.style.overflow = "hidden"; 67751 if (this.forceZindex) { 67752 const yolos = document.querySelectorAll("*"); 67753 yolos.forEach((el) => { 67754 const zIndex = window.getComputedStyle(el, null).getPropertyValue("z-index"); 67755 if (el instanceof HTMLElement && zIndex && el != this) { 67756 el.classList.add("sc-disable-zindex"); 67757 } 67758 document.head.insertAdjacentHTML( 67759 "beforeend", 67760 `<style>body{height:0 !important;overflow:hidden !important;}.sc-disable-zindex{z-index: auto !important; position: initial !important;}</style>` 67761 ); 67762 }); 67763 } 67764 } 67765 disconnectedCallback() { 67766 if (this.forceZindex) { 67767 document.querySelectorAll(".sc-disable-zindex").forEach((el) => { 67768 if (el instanceof HTMLElement && el != this) { 67769 el.classList.remove("sc-disable-zindex"); 67770 } 67771 }); 67772 } 67773 document.body.style.removeProperty("overflow"); 67774 super.disconnectedCallback(); 67775 } 67776 ensureScrollGuard() { 67777 const el = this.renderRoot.querySelector(".custom-scroll"); 67778 if (!el) return; 67779 watchScrollRoot(el); 67780 restoreScrollRoot(el); 67781 requestAnimationFrame(() => { 67782 restoreScrollRoot(el); 67783 requestAnimationFrame(() => restoreScrollRoot(el)); 67784 }); 67785 } 67786 updated(_changedProperties) { 67787 this.ensureScrollGuard(); 67788 super.updated(_changedProperties); 67789 } 67790 render() { 67791 if (this.isWaiting) return A$1; 67792 const defaultImageSrc = this.defaultImage?.is_animated ? this.defaultImage?.src : this.defaultImage?.ratio_1x1_1000; 67793 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)]"; 67794 const asideHeightClass = this.alwaysTwoColumns ? "h-full" : this.noHeader ? "lg:h-full" : "lg:h-[c
67794alc(100vh-4rem)]"; 67795 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"; 67796 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 "> 67797 <div class="flex flex-col min-w-0 relative z-[2]"> 67798 ${this.noHeader ? A$1 : b$1`<sonic-header showOffCanvas noPaddingX class="mb-10"></sonic-header>`} 67799 <slot></slot> 67800 </div> 67801 67802 <!-- affiche la banniere (exemple campagne) --> 67803 ${this.displayBanner ? b$1`<div class=""> 67804 ${this.bannerDesktopSrc ? b$1`<div 67805 class="hidden lg:block overflow-clip rounded-bl-lg -mt-cgy -ml-[calc(var(--sc-container-gutter-x)/2)] -mr-cgx mb-8" 67806 > 67807 <img src="${this.bannerDesktopSrc}" class="max-h-[11rem] w-full h-full object-cover" alt="" /> 67808 </div>` : A$1} 67809 <slot name="aside"></slot> 67810 </div> ` : A$1} 67811 67812 <!-- pas de banniere --> 67813 ${!this.displayBanner ? b$1` <div 67814 class="aside 67815 sticky 67816 top-0 67817 ${asideHeightClass} 67818 lg:-mr-[calc(var(--sc-container-gutter-x)_-_var(--sc-container-gutter-y))] 67819 " 67820 > 67821 <slot name="aside"> 67822 <div class="${defaultAsideClass}"> 67823 ${defaultImageSrc ? b$1`<sonic-image cover src="${defaultImageSrc}" />` : b$1` 67824 <sonic-fetch dataProvider="shows?featured=1&next=1&limit=1" key="data.0"> 67825 <sonic-product-illustration cover></sonic-product-illustration> 67826 </sonic-fetch> 67827 `} 67828 </div> 67829 </slot> 67830 </div>` : A$1} 67831 </div>`; 67832 } 67833 }; 67834 SonicComponent$5.styles = [ 67835 tailwind, 67836 customScroll, 67837 i$9` 67838 :host { 67839 position: fixed !important; 67840 top: 0 !important; 67841 left: 0 !important; 67842 right: 0 !important; 67843 bottom: 0 !important; 67844 background-color: var(--sc-base); 67845 color: var(--sc-base-content); 67846 z-index: 900 !important; 67847 } 67848 ` 67849 ]; 67850 __decorateClass$E([ 67851 bind$1("theme.banners.banner_desktop.ratio_auto_1920"), 67852 n$5({ type: String }) 67853 ], SonicComponent$5.prototype, "bannerDesktopSrc", 2); 67854 __decorateClass$E([ 67855 bind$1("theme.banners.default_image"), 67856 n$5({ type: String }) 67857 ], SonicComponent$5.prototype, "defaultImage", 2); 67858 __decorateClass$E([ 67859 n$5({ type: Boolean }) 67860 ], SonicComponent$5.prototype, "largeAside", 2); 67861 __decorateClass$E([ 67862 n$5({ type: Boolean }) 67863 ], SonicComponent$5.prototype, "forceZindex", 2); 67864 __decorateClass$E([ 67865 n$5({ type: Boolean }) 67866 ], SonicComponent$5.prototype, "displayBanner", 2); 67867 __decorateClass$E([ 67868 n$5({ type: Boolean }) 67869 ], SonicComponent$5.prototype, "noAside", 2); 67870 __decorateClass$E([ 67871 n$5({ type: Boolean }) 67872 ], SonicComponent$5.prototype, "noHeader", 2); 67873 __decorateClass$E([ 67874 n$5({ type: Boolean }) 67875 ], SonicComponent$5.prototype, "alwaysTwoColumns", 2); 67876 __decorateClass$E([ 67877 bind$1("sonicTicketApp.isWaiting"), 67878 r$5() 67879 ], SonicComponent$5.prototype, "isWaiting", 2); 67880 SonicComponent$5 = __decorateClass$E([ 67881 t$3(tagName$w) 67882 ], SonicComponent$5); 67883 var __defProp$A = Object.defineProperty; 67884 var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor; 67885 var __decorateClass$D = (decorators, target, key, kind) => { 67886 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target; 67887 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67888 if (decorator = decorators[i2]) 67889 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67890 if (kind && result) __defProp$A(target, key, result); 67891 return result; 67892 }; 67893 let UserFormCreate = class extends Subscriber$1(i$6) { 67894 constructor() { 67895 super(...arguments); 67896 this.paymentId = 0; 67897 } 67898 connectedCallback() { 67899 const urlParams = new URLSearchParams(window.location.search);
67900 this.mailHash = urlParams.get("sonic_mail_hash") || void 0; 67901 super.connectedCallback(); 67902 } 67903 render() { 67904 let iframeSrc = "/inscription?no_title=true"; 67905 if (this.paymentId) { 67906 iframeSrc += `&payment_id=${this.paymentId}`; 67907 } 67908 if (this.mailHash) { 67909 iframeSrc = `/inscription/rel:${this.mailHash}?no_title=true`; 67910 } 67911 return b$1` <div class="prose prose-sm mb-8">${t("info_form_inscription_acces_direct", true)}</div> 67912 <sonic-iframe src="${iframeSrc}"></sonic-iframe>`; 67913 } 67914 }; 67915 UserFormCreate.styles = [tailwind]; 67916 __decorateClass$D([ 67917 n$5({ type: Number }) 67918 ], UserFormCreate.prototype, "paymentId", 2); 67919 __decorateClass$D([ 67920 n$5({ type: String }) 67921 ], UserFormCreate.prototype, "mailHash", 2); 67922 UserFormCreate = __decorateClass$D([ 67923 t$3("sonic-user-form-create") 67924 ], UserFormCreate); 67925 var __defProp$z = Object.defineProperty; 67926 var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor; 67927 var __decorateClass$C = (decorators, target, key, kind) => { 67928 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target; 67929 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 67930 if (decorator = decorators[i2]) 67931 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 67932 if (kind && result) __defProp$z(target, key, result); 67933 return result; 67934 }; 67935 const tagName$v = "sonic-sepa-schedule"; 67936 function renderPaymentIcon(entityType) { 67937 let iconName = "credit-card"; 67938 switch (entityType) { 67939 case EntityType.Credit: 67940 iconName = "wallet"; 67941 break; 67942 case EntityType.Giftcard: 67943 iconName = "gift-card"; 67944 break; 67945 case "sepa": 67946 iconName = "pen-nib"; 67947 break; 67948 } 67949 return b$1`<sonic-icon size="xs" name="${iconName}" library="custom"></sonic-icon>`; 67950 } 67951 let SonicSepaSchedule = class extends Subscriber$1(i$6) { 67952 constructor() { 67953 super(...arguments); 67954 this.cartId = "current"; 67955 this.total = 0; 67956 this.schedules = "[]"; 67957 this.pspTitle = t("LIB_carte_bancaire"); 67958 this.sepaTitle = t("LIB_mandat_sepa"); 67959 } 67960 render() { 67961 let scheduleDates = [];
67962 try { 67963 scheduleDates = JSON.parse(this.schedules); 67964 } catch { 67965 scheduleDates = []; 67966 } 67967 if (!Array.isArray(scheduleDates) || scheduleDates.length < 2) { 67968 return A$1; 67969 } 67970 const cart = this._cartData; 67971 const initialTotal = Number(this.total || 0); 67972 let grossTotal = Number(cart?.total ?? 0); 67973 if (grossTotal <= 0 && initialTotal > 0) { 67974 grossTotal = initialTotal; 67975 } 67976 const extrasList = []; 67977 let extrasTotal = 0; 67978 cart?.extras?.forEach((extra) => { 67979 const amt = Math.abs(Number(extra.price?.amount)); 67980 if (amt <= 0) { 67981 return; 67982 } 67983 extrasTotal += amt; 67984 extrasList.push(extra); 67985 }); 67986 if (grossTotal <= 0 && Number(cart?.subTotal ?? 0) > 0) { 67987 grossTotal = Number(cart?.subTotal ?? 0) + extrasTotal; 67988 } 67989 const netAmount = Math.max(0, grossTotal - extrasTotal); 67990 const count = scheduleDates.length; 67991 const baseAmount = Math.round(netAmount / count * 100) / 100; 67992 const lastAmount = Math.round((netAmount - baseAmount * (count - 1)) * 100) / 100; 67993 return b$1` 67994 <sonic-table size="sm"> 67995 <sonic-thead> 67996 <sonic-tr> 67997 <sonic-th>${t("LIB_sepa_moyen_de_paiement")}</sonic-th> 67998 <sonic-th>${t("LIB_sepa_date_de_prelevement")}</sonic-th> 67999 <sonic-th align="right">${t("LIB_sepa_montant")}</sonic-th> 68000 </sonic-tr> 68001 </sonic-thead> 68002 68003 <sonic-tbody> 68004 <!-- 1st installment: due today --> 68005 <sonic-tr> 68006 <sonic-td class="text-info"> 68007 ${renderPaymentIcon(null)} 68008 <span class="font-bold text-info">${this.pspTitle}</span> 68009 </sonic-td> 68010 <sonic-td class="font-bold text-info"> ${t("LIB_sepa_aujourdhui")} </sonic-td> 68011 <sonic-td align="right"> <span class="font-bold text-info">
68011${formatAmount(baseAmount)}</span> </sonic-td> 68012 </sonic-tr> 68013 68014 <!-- Extras (Credits, Vouchers, etc.): light gray --> 68015 ${extrasList.map( 68016 (item) => b$1` 68017 <sonic-tr> 68018 <sonic-td> 68019 ${renderPaymentIcon(item.entity_type)} 68020 <span>${item.price?.label}</span> 68021 </sonic-td> 68022 <sonic-td>${t("LIB_sepa_aujourdhui")}</sonic-td> 68023 <sonic-td align="right"> ${formatAmount(Math.abs(item.price?.amount ?? 0))} </sonic-td> 68024 </sonic-tr> 68025 ` 68026 )} 68027 68028 <!-- Future SEPA schedules: bold --> 68029 ${scheduleDates.slice(1).map( 68030 (date2, index) => b$1` 68031 <sonic-tr> 68032 <sonic-td> 68033 ${renderPaymentIcon("sepa")} 68034 <span>${this.sepaTitle}</span> 68035 </sonic-td> 68036 <sonic-td> <sonic-date date=${date2}></sonic-date> </sonic-td> 68037 <sonic-td align="right"> ${formatAmount(index === count - 2 ? lastAmount : baseAmount)} </sonic-td> 68038 </sonic-tr> 68039 ` 68040 )} 68041 </sonic-tbody> 68042 </sonic-table> 68043 `; 68044 } 68045 }; 68046 SonicSepaSchedule.styles = [tailwind]; 68047 __decorateClass$C([ 68048 n$5({ type: String }) 68049 ], SonicSepaSchedule.prototype, "cartId", 2); 68050 __decorateClass$C([ 68051 n$5({ type: Number }) 68052 ], SonicSepaSchedule.prototype, "total", 2); 68053 __decorateClass$C([ 68054 n$5({ type: String }) 68055 ], SonicSepaSchedule.prototype, "schedules", 2); 68056 __decorateClass$C([ 68057 n$5({ type: String }) 68058 ], SonicSepaSchedule.prototype, "pspTitle", 2); 68059 __decorateClass$C([ 68060 n$5({ type: String }) 68061 ], SonicSepaSchedule.prototype, "sepaTitle", 2); 68062 __decorateClass$C([ 68063 bind$1("cart/${cartId}.data"), 68064 r$5() 68065 ], SonicSepaSchedule.prototype, "_cartData", 2); 68066 SonicSepaSchedule = __decorateClass$C([ 68067 t$3(tagName$v) 68068 ], SonicSepaSchedule); 68069 var __defProp$y = Object.defineProperty; 68070 var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor; 68071 var __decorateClass$B = (decorators, target, key, kind) => { 68072 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target; 68073 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68074 if (decorator = decorators[i2]) 68075 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68076 if (kind && result) __defProp$y(target, key, result); 68077 return result; 68078 }; 68079 const tagName$u = "sonic-checkout"; 68080 let SonicComponent$4 = class SonicComponent extends Subscriber$1(i$6) { 68081 constructor() { 68082 super(...arguments); 68083 this.online_payment_id = 0; 68084 this.cart_id = ""; 68085 this.quickBuy = false; 68086 this.create_account = false; 68087 this.wording_create_account = ""; 68088 } 68089 connectedCallback() { 68090 const urlParams = new URLSearchParams(window.location.search); 68091 if (!this.online_payment_id) { 68092 this.online_payment_id = Number(urlParams.get("payment_id") || get("settings.online_payment_id") || 0); 68093 } 68094 if (!this.cart_id) { 68095 this.cart_id = urlParams.get("cart_id") || urlParams.get("sonic_cart_id") || ""; 68096 } 68097 if (!this.create_account) { 68098 this.create_account = !!urlParams.get("create_account") || false; 68099 } 68100 if (!this.quickBuy) { 68101 this.quickBuy = !!urlParams.get("quick_buy"); 68102 } 68103 super.connectedCallback(); 68104 } 68105 render() { 68106 const checkoutRoute = appRoute("checkout"); 68107 const cartRoute = appRoute("cart"); 68108 const displayLoginForm = !this.userId && !this.quickBuy && !this.cart_id; 68109 if (this.create_account && !this.quickBuy && !this.cart_id) 68110 return b$1`<sonic-page-header goBack label="${this.wording_create_account}"></sonic-page-header> 68111 <sonic-user-form-create paymentId=${this.online_payment_id}></sonic-user-form-create>`; 68112 if (displayLoginForm) 68113 return b$1`<sonic-user-form-login 68114 createAccount 68115 checkout 68116 online_payment_id=${this.online_payment_id} 68117 class="mt-2 lg:mt-8 mx-auto block w-full" 68118 ></sonic-user-form-login>`; 68119 if (this.cart_id) return b$1`<sonic-iframe src="/paiement/${this.cart_id}"></sonic-iframe>`; 68120 if (this.quickBuy) 68121 return b$1`<sonic-page-header
68122 goBackHref="${this.hash && cartRoute ? cartRoute : checkoutRoute}" 68123 label="${t("link_title_quick_purchase")}" 68124 ></sonic-page-header 68125 ><sonic-iframe src="/validation/${this.online_payment_id}?no_title=true&quick_buy=true"></sonic-iframe>`; 68126 if (!this.cart_id && !this.quickBuy) 68127 return b$1` <sonic-iframe src="/validation/${this.online_payment_id}"></sonic-iframe>`; 68128 return A$1; 68129 } 68130 }; 68131 SonicComponent$4.styles = [tailwind]; 68132 __decorateClass$B([ 68133 n$5({ type: Number }) 68134 ], SonicComponent$4.prototype, "online_payment_id", 2); 68135 __decorateClass$B([ 68136 n$5({ type: String }) 68137 ], SonicComponent$4.prototype, "cart_id", 2); 68138 __decorateClass$B([ 68139 n$5({ type: Boolean }) 68140 ], SonicComponent$4.prototype, "quickBuy", 2); 68141 __decorateClass$B([ 68142 n$5({ type: Boolean }) 68143 ], SonicComponent$4.prototype, "create_account", 2); 68144 __decorateClass$B([ 68145 n$5({ type: String }) 68146 ], SonicComponent$4.prototype, "wording_create_account", 2); 68147 __decorateClass$B([ 68148 bind$1("user.id"), 68149 n$5({ type: String }) 68150 ], SonicComponent$4.prototype, "userId", 2); 68151 __decorateClass$B([ 68152 bind$1("cart/current.data.payment_link_hash"), 68153 n$5({ type: String }) 68154 ], SonicComponent$4.prototype, "hash", 2); 68155 SonicComponent$4 = __decorateClass$B([ 68156 t$3(tagName$u) 68157 ], SonicComponent$4); 68158 var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor; 68159 var __decorateClass$A = (decorators, target, key, kind) => { 68160 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target; 68161 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68162 if (decorator = decorators[i2]) 68163 result = decorator(result) || result; 68164 return result; 68165 }; 68166 let SonicCartFull = class extends i$6 { 68167 connectedCallback() { 68168 this.setAttribute("dataProvider", "cart/current"); 68169 super.connectedCallback(); 68170 } 68171 willUpdate(_changedProperties) { 68172 this.urlCheckout = appRoute("checkout"); 68173 this.urlCart = appRoute("cart"); 68174 } 68175 render() { 68176 const urlCheckoutIsUrlCart = this.urlCart?.hasSameBaseAs(this.urlCheckout); 68177 return b$1` 68178 <sonic-fullscreen-layout> 68179 ${urlCheckoutIsUrlCart && this.urlCheckout?.hasHash() ? b$1` 68180 <sonic-router class="contents"> 68181 <template data-fallback data-route="${this.urlCart}$"> 68182 <sonic-cart-full subDataProvider="data" goBack></sonic-cart-full> 68183 </template> 68184 <template data-route="${this.urlCheckout.getHash()}"> 68185 <sonic-checkout subDataProvider="data"></sonic-checkout> 68186 </template> 68187 </sonic-router> 68188 ` : b$1`<sonic-cart-full subDataProvider="data" goBack></sonic-cart-full>`} 68189 </sonic-fullscreen-layout> 68190 `; 68191 } 68192 }; 68193 SonicCartFull.styles = [tailwind]; 68194 SonicCartFull = __decorateClass$A([ 68195 t$3("sonic-cart") 68196 ], SonicCartFull); 68197 var __defProp$x = Object.defineProperty; 68198 var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor; 68199 var __decorateClass$z = (decorators, target, key, kind) => { 68200 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target; 68201 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68202 if (decorator = decorators[i2]) 68203 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68204 if (kind && result) __defProp$x(target, key, result); 68205 return result; 68206 }; 68207 const tagName$t = "sonic-agenda"; 68208 let SonicComponent$3 = class SonicComponent extends i$6 { 68209 constructor() { 68210 super(...arguments); 68211 this.displayTitle = false; 68212 this.smallTitle = false; 68213 this.displayText = false; 68214 this._dataProviderExpression = "shows?offset=$offset&limit=$limit&next=1&ids_agenda=0"; 68215 this._formDataProvider = `eventFrontFilters/${this.agendaId ?? 0}`; 68216 this.isWaiting = false; 68217 this._resizeController = new h$1(this, {}); 68218 this.agenda = null; 68219 } 68220 connectedCallback() { 68221 this._formDataProvider = `eventFrontFilters/${this.agendaId ?? 0}`; 68222 super.connectedCallback(); 68223 } 68224 async willUpdate(_changedProperties) { 68225 if (_changedProperties.has("agendaId")) { 68226 if (this.agendaId) { 68227 this.agenda = await getAgenda(this.agendaId, this); 68228 dp(this._formDataProvider).set({ 68229 ids_agenda: this.agendaId 68230 }); 68231 } else { 68232 this.agenda = null; 68233 dp(this._formDataProvider).set({ 68234 ids_agenda: 0 68235 }); 68236 } 68237 } 68238 } 68239 render() { 68240 if (this.isWaiting) return A$1; 68241 if (this.agendaId && !this.agenda) { 68242 return A$1; 68243 } 68244 const title = this.agenda ? this.agenda.title : t("module_agenda_title"); 68245 const text = this.agenda ? this.agenda.description : t("info_message_interface_billets_front"); 68246 return b$1`<sonic-page-layout 68247 pageTitle=${title} 68248 pageText=${text} 68249 ?smallTitle=${this.smallTitle} 68250 ?displayTitle=${this.displayTitle} 68251 ?displayText=${this.displayText} 68252 > 68253 <div class="mb-8"> 68254 <sonic-form-event-filter 68255 formDataProvider="${this._formDataProvider}" 68256 ?filterCategory=${!this.agendaId} 68257 .agendaId=${this.agendaId} 68258 class="block max-w-[36rem] w-full z-10" 68259 ></sonic-form-event-filter> 68260 </div> 68261 68262 ${this.clientWidth < 768 ? b$1` 68263 <sonic-queue 68264 limit="10" 68265 lazyBoundsRatio="4" 68266 targetRequestDuration="2000" 68267 dataProvider="searchResults" 68268 dataFilterProvider="${this._formDataProvider}" 68269 dataProviderExpression="${this._dataProviderExpression}" 68270 key="data" 68271 > 68272 <template data-value="skeleton"> 68273 <sonic-event-card class="block mb-4" skeleton></sonic-event-card> 68274 <sonic-event-card class="block mb-4" skeleton></sonic-event-card> 68275 </template> 68276 <template data-value="no-item"> 68277 <sonic-no-result></sonic-no-result> 68278 </template> 68279 <template> 68280 <sonic-event-card class="block mb-4" link></sonic-event-card> 68281 </template> 68282 </sonic-queue> 68283 ` : b$1`<sonic-queue 68284 limit="10" 68285 lazyBoundsRatio="4" 68286 targetRequestDuration="2000" 68287 dataProvider="searchResults" 68288 dataFilterProvider="${this._formDataProvider}" 68289 dataProviderExpression="${this._dataProviderExpression}" 68290 key="data" 68291 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" 68292 > 68293 <template data-value="skeleton"> 68294 <sonic-event-card-vertical skeleton></sonic-event-card-vertical> 68295 <sonic-event-card-vertical skeleton></sonic-event-card-vertical> 68296 <sonic-event-card-vertical skeleton></sonic-event-card-vertical> 68297 <sonic-event-card-vertical skeleton></sonic-event-card-vertical> 68298 </template> 68299 <template data-value="no-item"> 68300 <sonic-no-result></sonic-no-result> 68301 </template> 68302 <template> 68303 <sonic-event-card-vertical></sonic-event-card-vertical> 68304 </template> 68305 </sonic-queue>`} 68306 </sonic-page-layout>`; 68307 } 68308 }; 68309 SonicComponent$3.styles = [ 68310 tailwind, 68311 i$9` 68312 :host { 68313 display: block; 68314 } 68315 ` 68316 ]; 68317 __decorateClass$z([ 68318 n$5({ type: Boolean }) 68319 ], SonicComponent$3.prototype, "displayTitle", 2); 68320 __decorateClass$z([ 68321 n$5({ type: Boolean }) 68322 ], SonicComponent$3.prototype, "smallTitle", 2); 68323 __decorateClass$z([ 68324 n$5({ type: Boolean }) 68325 ], SonicComponent$3.prototype, "displayText", 2); 68326 __decorateClass$z([ 68327 n$5({ type: Number }) 68328 ], SonicComponent$3.prototype, "agendaId", 2); 68329 __decorateClass$z([ 68330 bind$1("sonicTicketApp.isWaiting"), 68331 r$5() 68332 ], SonicComponent$3.prototype, "isWaiting", 2); 68333 __decorateClass$z([ 68334 r$5() 68335 ], SonicComponent$3.prototype, "agenda", 2); 68336 SonicComponent$3 = __decorateClass$z([ 68337 t$3(tagName$t) 68338 ], SonicComponent$3); 68339 var __defProp$w = Object.defineProperty; 68340 var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor; 68341 var __decorateClass$y = (decorators, target, key, kind) => { 68342 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target; 68343 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68344 if (decorator = decorators[i2]) 68345 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68346 if (kind && result) __defProp$w(target, key, result); 68347 return result; 68348 }; 68349 const tagName$s = "sonic-multisession-nav"; 68350 let MultisessionNav = class extends i$6 { 68351 constructor() { 68352 super(...arguments); 68353 this.mode = "default"; 68354 this._sessionsList = []; 68355 } 68356 async willUpdate(changed) { 68357 if (!changed.has("currentSession") && !changed.has("accessParams")) return; 68358 const multisessionId = Number(this.currentSession?.multisession?.id); 68359 if (!Number.isFinite(multisessionId)) { 68360 this._sessionsList = []; 68361 this._loadedMultisessionId = void 0; 68362 return; 68363 } 68364 const needFetch = multisessionId !== this._loadedMultisessionId || changed.has("accessParams"); 68365 if (!needFetch) return; 68366 const sessions = await this.fetchSessions(multisessionId); 68367 if (multisessionId !== Number(this.currentSession?.multisession?.id)) return; 68368 this._loadedMultisessionId = multisessionId; 68369 this._sessionsList = Array.isArray(sessions) ? sessions : []; 68370 } 68371 async fetchSessions(multisessionId) { 68372 const api2 = new API(HTML.getApiConfiguration(this)); 68373 const endpoint = entityEndPoint({ 68374 entityType: EntityType.Event, 68375 accessParams: this.accessParams, 68376 view: entityView.mini, 68377 multisessionId, 68378 next: true 68379 }); 68380 const result = await api2.get(endpoint); 68381 return result.data; 68382 } 68383 cleanDate(date2, displayHours = false) { 68384 if (!date2) return ""; 68385 const lang = document.documentElement.lang || "fr-FR"; 68386 return new Date(date2 * 1e3).toLocaleDateString(lang, { 68387 weekday: "short", 68388 year: "numeric", 68389 month: "short", 68390 day: "numeric", 68391 hour: displayHours ? "2-digit" : void 0, 68392 minute: displayHours ? "2-digit" : void 0 68393 }); 68394 } 68395 getSessionHref(session) { 68396 if (this.mode === "seatmap") { 68397 return appRoute("seatmap").fill({ slug: session.slug, id: session.id?.toString() }).toString(); 68398 } 68399 return appRoute("event").fill({ slug: session.slug, id: session.id?.toString() }).query({ session: session.id?.toString() }).toString(); 68400 } 68401 renderAllSessionsButton() { 68402 return b$1` 68403 <sonic-app-link to="event" .slug=${this.currentSession?.slug} size="sm" variant="ghost"> 68404 ${t("link_title_sessions_all")} 68405 </sonic-app-link> 68406 `; 68407 } 68408 render() { 68409 const currentId = Number(this.currentSession?.id); 68410 if (!currentId) return A$1; 68411 const hasMultipleSessions = this._sessionsList.length >= 2; 68412 if (!hasMultipleSessions) { 68413 return this.renderAllSessionsButton(); 68414 } 68415 const currentIndex = this._sessionsList.findIndex((session) => Number(session.id) === currentId); 68416 const previousSession = currentIndex > 0 ? this._sessionsList[currentIndex - 1] : null; 68417 const nextSession = currentIndex >= 0 && currentIndex < this._sessionsList.length - 1 ? this._sessionsList[currentIndex + 1] : null; 68418 const previousDate = this.cleanDate(previousSession?.start_date, true); 68419 const nextDate = this.cleanDate(nextSession?.start_date, true);
68420 const previousHref = previousSession ? this.getSessionHref(previousSession) : null; 68421 const nextHref = nextSession ? this.getSessionHref(nextSession) : null; 68422 return b$1` 68423 <div class="flex items-center"> 68424 ${this.renderAllSessionsButton()} 68425 68426 <div class="inline-flex items-center"> 68427 <sonic-pop> 68428 <sonic-tooltip label="${this._sessionsList.length} ${t("LIB_seances")}"> 68429 <sonic-button size="sm" variant="ghost" shape="circle" icon> 68430 <sonic-icon name="chevron-down" library="custom"></sonic-icon> 68431 </sonic-button> 68432 </sonic-tooltip> 68433 <sonic-menu slot="content" class="w-[18rem] lg:w-[25rem]"> 68434 ${c$1( 68435 this._sessionsList, 68436 (session) => session.id, 68437 (session, index) => { 68438 if (!session.slug || !session.id) return A$1; 68439 const href = this.getSessionHref(session); 68440 const isActive = Number(session.id) === currentId; 68441 const isLast = index === this._sessionsList.length - 1; 68442 return b$1`<sonic-menu-item href=${href} autoActive="disabled" ?active=${isActive}> 68443 <div class="font-bold capitalize">${this.cleanDate(session.start_date, true)}</div> 68444 <sonic-event-additional-status 68445 variant="ghost" 68446 fetch 68447 size="xs" 68448 key="data" 68449 dataProvider=${entityEndPoint({ 68450 entityType: EntityType.Event, 68451 entityId: Number(session.id), 68452 accessParams: this.accessParams, 68453 view: entityView.status 68454 })} 68455 class="flex gap-x-3 " 68456 ></sonic-event-additional-status> 68457 </sonic-menu-item> 68458 68459 ${!isLast ? b$1`<sonic-divider></sonic-divider>` : A$1} `; 68460 } 68461 )} 68462 </sonic-menu> 68463 </sonic-pop> 68464 <sonic-divider vertical></sonic-divider> 68465 <sonic-tooltip label=${previousDate}> 68466 <sonic-button 68467 variant="ghost" 68468 ?disabled=${!previousSession} 68469 href=${o$4(previousHref?.toString())} 68470 size="sm" 68471 shape="circle" 68472 icon 68473 noAutoFill 68474 > 68475 <sonic-icon name="chevron-left" library="custom"></sonic-icon> 68476 </sonic-button> 68477 </sonic-tooltip> 68478 <sonic-tooltip label=${nextDate}> 68479 <sonic-button 68480 ?disabled=${!nextSession} 68481 href=${o$4(nextHref)} 68482 size="sm" 68483 variant="ghost" 68484 shape="circle" 68485 icon 68486 noAutoFill 68487 > 68488 <sonic-icon name="chevron-right" library="custom"></sonic-icon> 68489 </sonic-button> 68490 </sonic-tooltip> 68491 </div> 68492 </div> 68493 `; 68494 } 68495 }; 68496 MultisessionNav.styles = [tailwind]; 68497 __decorateClass$y([ 68498 n$5({ type: Object }) 68499 ], MultisessionNav.prototype, "currentSession", 2); 68500 __decorateClass$y([ 68501 c({ context: accessParamsContext, subscribe: true }), 68502 n$5({ type: Object }) 68503 ], MultisessionNav.prototype, "accessParams", 2); 68504 __decorateClass$y([ 68505 n$5({ type: String }) 68506 ], MultisessionNav.prototype, "mode", 2); 68507 __decorateClass$y([ 68508 r$5() 68509 ], MultisessionNav.prototype, "_sessionsList", 2); 68510 MultisessionNav = __decorateClass$y([ 68511 t$3(tagName$s) 68512 ], MultisessionNav); 68513 var __defProp$v = Object.defineProperty; 68514 var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor; 68515 var __decorateClass$x = (decorators, target, key, kind) => { 68516 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target; 68517 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68518 if (decorator = decorators[i2]) 68519 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68520 if (kind && result) __defProp$v(target, key, result); 68521 return result; 68522 }; 68523 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"; 68524 const tagName$r = "sonic-seatmap"; 68525 let Seatmap = class extends Fetcher$1(Subscriber$1(i$6)) { 68526 constructor() { 68527 super(...arguments); 68528 this.slug = ""; 68529 this.places_categories = []; 68530 this.hidePromoForm = false;
68531 this.multisession = null; 68532 this.quotas = []; 68533 this.success = null; 68534 this.cartProvider = "cart/current"; 68535 this.seatmapProvider = "seatmap"; 68536 this.isMobile = false; 68537 this._resizeController = new h$1(this, { 68538 callback: () => { 68539 this.isMobile = this.clientWidth < 768; 68540 if (this.isMobile) { 68541 this.changeSeatmapView({ 68542 type: "category" 68543 }); 68544 } 68545 } 68546 }); 68547 this.changeSeatmapView = (view) => { 68548 let colorMode = null; 68549 let currentSeatFilter = { 68550 field: null, 68551 value: null, 68552 subField: null 68553 }; 68554 if (view.type === "category") { 68555 colorMode = SeatColorMode.CATEGORY; 68556 this._selectedCategoryId = view.id ?? null; 68557 if (view.id) { 68558 currentSeatFilter = { 68559 field: "range", 68560 value: view.id, 68561 subField: null 68562 }; 68563 } 68564 } else if (view.type === "quota") { 68565 colorMode = SeatColorMode.QUOTAS; 68566 if (view.id) { 68567 currentSeatFilter = { 68568 field: "contingentementInterne", 68569 value: view.id, 68570 subField: null 68571 }; 68572 } 68573 } 68574 seatmapPublisher(this.seatmapProvider).viewerState.seatFilter?.set(currentSeatFilter); 68575 seatmapPublisher(this.seatmapProvider).conf.seatsColorsMode?.set(colorMode ?? ""); 68576 }; 68577 } 68578 handleSeatmapSeatFilterChange(seatfilter) { 68579 this._activeFilter = seatfilter; 68580 } 68581 handleSeatmapSeatColorModeChange(colorMode) { 68582 this._activeColorMode = colorMode; 68583 } 68584 connectedCallback() { 68585 this.isFetchEnabled = this.hasAttribute("fetch"); 68586 if (!this.accessParams) { 68587 this.accessParams = getAccessParamsFromUrl(); 68588 } 68589 if (this.isFetchEnabled) { 68590 this.dataProvider = entityEndPoint({ 68591 entityType: EntityType.Event, 68592 entityId: Number(this.id), 68593 accessParams: this.accessParams, 68594 view: entityView.full 68595 }); 68596 this.key = "data"; 68597 } 68598 window.requestAnimationFrame(() => { 68599 super.connectedCallback(); 68600 }); 68601 } 68602 updated(changedProperties) { 68603 if (changedProperties.has("placementType") && this.placementType === PlacementType.AUTO) { 68604 this.changeSeatmapView({ type: "category" }); 68605 } 68606 super.updated(changedProperties); 68607 } 68608 render() { 68609 const isError = this.success === false; 68610 if (isError) { 68611 return b$1`<sonic-fullscreen-layout> 68612 <div> 68613 <sonic-alert status="error" class="py-3" size="lg" label=${t("error_title")} background> 68614 <div>${t("error_seatmap_description")}</div> 68615 <sonic-button 68616 goBack=${appRoute("agenda").toString()} 68617 icon 68618 size="xs" 68619 class="mt-2" 68620 variant="outline" 68621 type="danger" 68622 > 68623 <sonic-icon library="custom" name="arrow-left"></sonic-icon> ${t("back")} 68624 </sonic-button> 68625 </sonic-alert> 68626 </div> 68627 </sonic-fullscreen-layout>`; 68628 } 68629 const isMobile = this.clientWidth < 768; 68630 const isAutoSeating = this.placementType === PlacementType.AUTO; 68631 return b$1`<sonic-fullscreen-layout largeAside> 68632 <div> 68633 <div class="flex items-center gap-x-1 mb-3"> 68634 <sonic-button 68635 data-aria-label=${o$4(t("back"))} 68636 goBack=${appRoute("agenda")} 68637 icon 68638 size="sm" 68639 shape="circle" 68640 > 68641 <sonic-icon library="custom" name="arrow-left"></sonic-icon> 68642 </sonic-button> 68643 68644 ${this.multisession && !hasAccessParams(this.accessParams) ? b$1`<sonic-multisession-nav mode="seatmap" .currentSession=${this.props}></sonic-multisession-nav> ` : A$1} 68645 ${this.accessParams?.customListSlug ? b$1`<sonic-app-link 68646 dataProvider="customLinkAllEventsLink" 68647 noAutoFill 68648 to="customList" 68649 slug="${this.accessParams?.customListSlug}" 68650 class="hover:underline text-sm ml-2" 68651 >${t("tous_les_evenements")}</sonic-app-link 68652 >` : A$1} 68653 </div> 68654 68655 <sonic-product-title 68656 class="text-3xl md:text-4xl md:leading-[1.1] font-headings font-weight-headings font-style-headings block mb-3" 68657 ></sonic-product-title> 68658 <div class="flex flex-wrap items-center gap-x-2 gap-y-1"> 68659 <sonic-event-additional-status class="flex flex-wrap gap-x-3"></sonic-event-additional-status> 68660 <sonic-event-taxonomies class="contents"></sonic-event-taxonomies> 68661 </div> 68662 68663 <div class="mt-[1.5rem] mb-4 grid gap-y-1"> 68664 <sonic-date 68665 class="text-[1.5rem] font-bold [&_.hour]:font-normal [&_.minute]:font-normal [&_.literal]:font-normal" 68666 noshadowdom 68667 ></sonic-date> 68668 <sonic-event-location-hall isEvent="true" class="block w-full mt-1 text-sm"></sonic-event-location-hall> 68669 <sonic-price-range displayIcon class="text-sm"></sonic-price-range> 68670 </div> 68671 68672 ${this.props?.prices && this.props?.prices?.length > 0 ? b$1` 68673 <sonic-placement-choice 68674 formDataProvider=${SEATMAP_PLACEMENT_PREFERENCES_DP} 68675 class="my-4" 68676 ></sonic-placement-choice> 68677 ` : A$1} 68678 ${this.placementType === PlacementType.MANUAL ? b$1` ${this.renderCategories(this.places_categories)}` : A$1} 68679 68680 <sonic-buy-event-block 68681 seatmapProvider=${this.seatmapProvider} 68682 .categoryId=${this._selectedCategoryId} 68683 size="sm"
68684 .buyMode="${this.placementType === PlacementType.MANUAL ? BuyMode.SEATMAPVIEW : BuyMode.AUTOSEATING}" 68685 > 68686 </sonic-buy-event-block> 68687 </div> 68688 68689 <div 68690 slot="aside" 68691 class=" 68692 ${isMobile && isAutoSeating ? "hidden" : ""} 68693 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" 68694 > 68695 ${this.id ? b$1`<sonic-seatmap-view 68696 cover 68697 class="absolute h-full w-full" 68698 eventId=${this.id} 68699 seatmapProvider=${this.seatmapProvider} 68700 ></sonic-seatmap-view>` : A$1} 68701 </div> 68702 </sonic-fullscreen-layout>`; 68703 } 68704 renderCategories(categories) { 68705 if (!categories.length) return A$1; 68706 const totalTotal = categories.reduce((acc, category) => acc + Number(category.total_places_nb), 0); 68707 const totalSold = categories.reduce( 68708 (acc, category) => acc + (Number(category.total_places_nb) - Number(category.remaining_places_nb)), 68709 0 68710 ); 68711 const displayAll = categories.length > 1; 68712 const pricesInHC = this.props?.quotas?.find((quota) => quota.id === 1)?.prices?.filter((price) => price.visible); 68713 const idsOfPricesInHC = pricesInHC?.map((price) => price.price_id); 68714 const isCounter = this.appType === "counter"; 68715 return b$1` <div class="@container mt-5 hidden lg:block"> 68716 <div class="flex items-center gap-x-2"> 68717 <sonic-divider align="left" class="w-full">${t("LIB_categories")}</sonic-divider> 68718 <sonic-seatmap-help-button 68719 eventId=${this.id} 68720 mode="inlineButton" 68721 size="xs" 68722 variant="ghost" 68723 class="shrink-0" 68724 ></sonic-seatmap-help-button> 68725 </div> 68726 <div 68727 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 " 68728 > 68729 ${displayAll ? b$1`<sonic-button 68730 noAutoFill 68731 size="sm" 68732 shape="block" 68733 variant="unstyled" 68734 class=${buttonViewClass} 68735 @click=${() => this.changeSeatmapView({ 68736 type: "category" 68737 })} 68738 align="left" 68739 ?active=${this._activeColorMode === SeatColorMode.CATEGORY && this._activeFilter?.value === null} 68740 > 68741 ${this.buttonContent({ 68742 label: t("LIB_all"), 68743 value: totalSold, 68744 max: totalTotal, 68745 prices: this.props?.prices?.filter((price) => idsOfPricesInHC?.includes(Number(price.id))) || [] 68746 })} 68747 </sonic-button>` : A$1} 68748 ${c$1( 68749 categories, 68750 (category) => category.id, 68751 (category) => { 68752 const { remaining_places_nb, total_places_nb } = category; 68753 const sold = Number(total_places_nb) - Number(remaining_places_nb); 68754 const pricesMatchesCategory = this.props?.prices?.filter((price) => { 68755 const priceId = Number(price.id); 68756 return price.place_category?.id === category.id && idsOfPricesInHC?.includes(priceId); 68757 }); 68758 const categoryFromSeatmap = this.seatMapData?.conf?.categorie?.find( 68759 (item) => Number(item.id) === Number(category.id) 68760 ); 68761 const color = "#" + categoryFromSeatmap?.couleur?.toString(); 68762 return b$1` 68763 <sonic-button 68764 noAutoFill 68765 size="sm" 68766 shape="block" 68767 variant="unstyled" 68768 class=${buttonViewClass} 68769 @click=${() => this.changeSeatmapView({ 68770 type: "category", 68771 id: Number(category.id) 68772 })} 68773 align="left" 68774 ?active=${this._activeFilter?.field === "range" && this._activeFilter?.value === category.id} 68775 > 68776 ${this.buttonContent({ 68777 label: category.title || "", 68778 value: sold, 68779 max: total_places_nb || 0, 68780 color: color || "", 68781 prices: pricesMatchesCategory || [] 68782 })} 68783 </sonic-button> 68784 `; 68785 } 68786 )} 68787 </div> 68788 </div>`; 68789 } 68790 buttonContent({ 68791 label: label2, 68792 value, 68793 max, 68794 color, 68795 prices 68796 }) { 68797 const displayRemaining = this.appType === "counter" ? true : false;
68798 const isFull = value >= max; 68799 return b$1` 68800 <div class="relative px-3 py-2 "> 68801 <div class="flex items-center gap-x-1"> 68802 ${color ? b$1`<div class="size-3 rounded-full shrink-0 " style="background-color: ${color}"></div>` : A$1} 68803 <div class="truncate">${label2}</div> 68804 </div> 68805 68806 ${displayRemaining ? b$1` 68807 <sonic-progress 68808 value=${value} 68809 max=${max} 68810 class="mt-1" 68811 size="xs" 68812 style="${color ? `--sc-progress-color: ${color}` : ""}" 68813 > 68814 <span slot="remaining">Reste : ${Math.max(0, max - value)} / ${max}</span> 68815 </sonic-progress> 68816 68817 ${prices?.length && !isFull ? b$1` 68818 <sonic-badge size="2xs"> 68819 <sonic-price-range 68820 class="white-space-nowrap lowercase" 68821 .prices=${prices || []} 68822 dataProvider=${`pricesRange/${prices?.map((price) => price.id).join(",")}`} 68823 ></sonic-price-range> 68824 </sonic-badge> 68825 ` : A$1} 68826 ` : A$1} 68827 </div> 68828 `; 68829 } 68830 }; 68831 Seatmap.styles = [ 68832 tailwind, 68833 i$9` 68834 :host { 68835 display: block; 68836 } 68837 ` 68838 ]; 68839 __decorateClass$x([ 68840 n$5({ type: String }) 68841 ], Seatmap.prototype, "slug", 2); 68842 __decorateClass$x([ 68843 n$5({ type: Array }) 68844 ], Seatmap.prototype, "places_categories", 2); 68845 __decorateClass$x([ 68846 n$5({ type: Boolean }) 68847 ], Seatmap.prototype, "hidePromoForm", 2); 68848 __decorateClass$x([ 68849 n$5({ type: Object }) 68850 ], Seatmap.prototype, "multisession", 2); 68851 __decorateClass$x([ 68852 n$5({ type: Array }) 68853 ], Seatmap.prototype, "quotas", 2); 68854 __decorateClass$x([ 68855 n$5({ type: Boolean }) 68856 ], Seatmap.prototype, "success", 2); 68857 __decorateClass$x([ 68858 c({ context: accessParamsContext, subscribe: true }), 68859 e$2({ context: accessParamsContext }), 68860 n$5({ type: Object }) 68861 ], Seatmap.prototype, "accessParams", 2); 68862 __decorateClass$x([ 68863 ancestorAttribute("cartProvider"), 68864 n$5({ type: String }) 68865 ], Seatmap.prototype, "cartProvider", 2); 68866 __decorateClass$x([ 68867 c({ context: appType, subscribe: true }), 68868 r$5() 68869 ], Seatmap.prototype, "appType", 2); 68870 __decorateClass$x([ 68871 bind(seatmapKey), 68872 r$5() 68873 ], Seatmap.prototype, "seatMapData", 2); 68874 __decorateClass$x([ 68875 r$5() 68876 ], Seatmap.prototype, "_activeFilter", 2); 68877 __decorateClass$x([ 68878 r$5() 68879 ], Seatmap.prototype, "_activeColorMode", 2); 68880 __decorateClass$x([ 68881 r$5() 68882 ], Seatmap.prototype, "isMobile", 2); 68883 __decorateClass$x([ 68884 r$5() 68885 ], Seatmap.prototype, "_selectedCategoryId", 2); 68886 __decorateClass$x([ 68887 onAssign(seatmapKey.viewerState.seatFilter.path) 68888 ], Seatmap.prototype, "handleSeatmapSeatFilterChange", 1); 68889 __decorateClass$x([ 68890 onAssign(seatmapKey.conf.seatsColorsMode.path) 68891 ], Seatmap.prototype, "handleSeatmapSeatColorModeChange", 1); 68892 __decorateClass$x([ 68893 bind(SEATMAP_PLACEMENT_PREFERENCES_DP + ".placement_type"), 68894 r$5() 68895 ], Seatmap.prototype, "placementType", 2); 68896 Seatmap = __decorateClass$x([ 68897 t$3(tagName$r) 68898 ], Seatmap); 68899 var __defProp$u = Object.defineProperty; 68900 var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor; 68901 var __decorateClass$w = (decorators, target, key, kind) => { 68902 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target; 68903 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68904 if (decorator = decorators[i2]) 68905 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68906 if (kind && result) __defProp$u(target, key, result); 68907 return result; 68908 }; 68909 const tagName$q = "sonic-infos-prices"; 68910 let SonicComponent$2 = class SonicComponent extends Subscriber$1(i$6) { 68911 constructor() { 68912 super(...arguments); 68913 this.displayTitle = false; 68914 this.displayText = false; 68915 this.wording_module_infos_title = ""; 68916 this.wording_texte_infos_et_tarifs = ""; 68917 this.smallTitle = false; 68918 } 68919 render() { 68920 return b$1`<sonic-page-layout 68921 pageTitle=${this.wording_module_infos_title} 68922 pageText=${this.wording_texte_infos_et_tarifs} 68923 ?smallTitle=${this.smallTitle} 68924 ?displayTitle=${this.displayTitle} 68925 ?displayText=${this.displayText} 68926 > 68927 </sonic-page-layout>`; 68928 } 68929 }; 68930 SonicComponent$2.styles = [tailwind]; 68931 __decorateClass$w([ 68932 n$5({ type: Boolean }) 68933 ], SonicComponent$2.prototype, "displayTitle", 2); 68934 __decorateClass$w([ 68935 n$5({ type: Boolean }) 68936 ], SonicComponent$2.prototype, "displayText", 2); 68937 __decorateClass$w([ 68938 n$5({ type: String }) 68939 ], SonicComponent$2.prototype, "wording_module_infos_title", 2); 68940 __decorateClass$w([ 68941 n$5({ type: String }) 68942 ], SonicComponent$2.prototype, "wording_texte_infos_et_tarifs", 2); 68943 __decorateClass$w([ 68944 n$5({ type: Boolean }) 68945 ], SonicComponent$2.prototype, "smallTitle", 2); 68946 SonicComponent$2 = __decorateClass$w([ 68947 t$3(tagName$q) 68948 ], SonicComponent$2); 68949 var __defProp$t = Object.defineProperty; 68950 var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor; 68951 var __decorateClass$v = (decorators, target, key, kind) => { 68952 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target; 68953 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 68954 if (decorator = decorators[i2]) 68955 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 68956 if (kind && result) __defProp$t(target, key, result); 68957 return result; 68958 }; 68959 let OrderRecover = class extends Subscriber$1(i$6) { 68960 constructor() { 68961 super(...arguments); 68962 this.endPoint = "recover-orders"; 68963 this.wording_LIB_recup_commande_front = ""; 68964 this.wording_LIB_recup_commande_title = ""; 68965 this.wording_LIB_recup_commande_aide_new = ""; 68966 this.wording_abonnements = ""; 68967 this.wording_billets = ""; 68968 this.wording_Valider = ""; 68969 this.displayTitle = false;
68970 this.displayText = true; 68971 this.smallTitle = false; 68972 } 68973 removeHtmlTags(text) { 68974 if (!text) return ""; 68975 return text.replace(/(<([^>]+)>)/gi, ""); 68976 } 68977 render() { 68978 const componentTitle = this.removeHtmlTags(this.wording_LIB_recup_commande_front); 68979 const cleanTitleMarkup = this.removeHtmlTags(this.wording_LIB_recup_commande_title); 68980 const cleanTextMarkup = this.removeHtmlTags(this.wording_LIB_recup_commande_aide_new); 68981 const text = `<p>${cleanTitleMarkup ? `<b class="text-[1.2em] leading-tight">${cleanTitleMarkup}</b><br>` : ""} 68982 ${cleanTextMarkup}</p> `; 68983 return b$1` 68984 <sonic-page-layout 68985 pageTitle=${componentTitle} 68986 pageText=${text} 68987 ?smallTitle=${this.smallTitle} 68988 ?displayTitle=${this.displayTitle} 68989 ?displayText=${this.displayText} 68990 formDataProvider="order/recover/form" 68991 > 68992 <div class="flex gap-3 flex-col" dataProvider="recoverOrder" submitResultDataProvider="order/recover/result"> 68993 <sonic-select 68994 name="send_type" 68995 class="min-w-[13rem]" 68996 value="all" 68997 .options=${[ 68998 { value: "all", wording: this.wording_abonnements + " + " + this.wording_billets }, 68999 { value: "abonnements", wording: this.wording_abonnements }, 69000 { value: "billets", wording: this.wording_billets } 69001 ]} 69002 > 69003 </sonic-select> 69004 <sonic-submit onEnterKey endPoint=${this.endPoint}> 69005 <sonic-input name="email" placeholder="[email protected]" value=""></sonic-input> 69006 </sonic-submit> 69007 <sonic-submit onClick endPoint=${this.endPoint}> 69008 <sonic-button shape="block" type="primary"> 69009 <sonic-icon name="paper-plane" library="custom"></sonic-icon> 69010 ${this.wording_Valider} 69011 </sonic-button> 69012 </sonic-submit> 69013 </div> 69014 </sonic-page-layout> 69015 `; 69016 } 69017 }; 69018 OrderRecover.styles = [ 69019 tailwind, 69020 i$9` 69021 :host { 69022 display: block; 69023 max-width: 90ch; 69024 } 69025 ` 69026 ]; 69027 __decorateClass$v([ 69028 n$5() 69029 ], OrderRecover.prototype, "endPoint", 2); 69030 __decorateClass$v([ 69031 n$5({ type: String }) 69032 ], OrderRecover.prototype, "wording_LIB_recup_commande_front", 2); 69033 __decorateClass$v([ 69034 n$5({ type: String }) 69035 ], OrderRecover.prototype, "wording_LIB_recup_commande_title", 2); 69036 __decorateClass$v([ 69037 n$5({ type: String }) 69038 ], OrderRecover.prototype, "wording_LIB_recup_commande_aide_new", 2); 69039 __decorateClass$v([ 69040 n$5({ type: String }) 69041 ], OrderRecover.prototype, "wording_abonnements", 2); 69042 __decorateClass$v([ 69043 n$5({ type: String }) 69044 ], OrderRecover.prototype, "wording_billets", 2); 69045 __decorateClass$v([ 69046 n$5({ type: String }) 69047 ], OrderRecover.prototype, "wording_Valider", 2); 69048 __decorateClass$v([ 69049 n$5({ type: Boolean }) 69050 ], OrderRecover.prototype, "displayTitle", 2); 69051 __decorateClass$v([ 69052 n$5({ type: Boolean }) 69053 ], OrderRecover.prototype, "displayText", 2); 69054 __decorateClass$v([ 69055 n$5({ type: Boolean }) 69056 ], OrderRecover.prototype, "smallTitle", 2); 69057 OrderRecover = __decorateClass$v([ 69058 t$3("sonic-order-recover") 69059 ], OrderRecover); 69060 var __defProp$s = Object.defineProperty; 69061 var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor; 69062 var __decorateClass$u = (decorators, target, key, kind) => { 69063 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target; 69064 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69065 if (decorator = decorators[i2]) 69066 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69067 if (kind && result) __defProp$s(target, key, result); 69068 return result; 69069 }; 69070 const tagName$p = "sonic-promo"; 69071 let SonicPagePromo$1 = class SonicPagePromo extends Subscriber$1(i$6) { 69072 constructor() { 69073 super(...arguments); 69074 this.wording_LIB_code_promo = ""; 69075 this.displayTitle = false; 69076 this.displayText = false; 69077 this.smallTitle = false; 69078 } 69079 render() { 69080 return b$1`<sonic-page-layout 69081 pageTitle=${this.wording_LIB_code_promo} 69082 ?smallTitle=${this.smallTitle} 69083 ?displayTitle=${this.displayTitle} 69084 ?displayText=${this.displayText} 69085 > 69086 <div class="my-8 max-w-[30rem]"> 69087 <sonic-promo-form></sonic-promo-form> 69088 </div> 69089 </sonic-page-layout>`; 69090 } 69091 }; 69092 SonicPagePromo$1.styles = [tailwind]; 69093 __decorateClass$u([ 69094 n$5() 69095 ], SonicPagePromo$1.prototype, "wording_LIB_code_promo", 2); 69096 __decorateClass$u([ 69097 n$5({ type: Boolean }) 69098 ], SonicPagePromo$1.prototype, "displayTitle", 2); 69099 __decorateClass$u([ 69100 n$5({ type: Boolean }) 69101 ], SonicPagePromo$1.prototype, "displayText", 2); 69102 __decorateClass$u([ 69103 n$5({ type: Boolean }) 69104 ], SonicPagePromo$1.prototype, "smallTitle", 2); 69105 SonicPagePromo$1 = __decorateClass$u([ 69106 t$3(tagName$p) 69107 ], SonicPagePromo$1); 69108 var __decorate$3 = function(decorators, target, key, desc) { 69109 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 69110 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 69111 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; 69112 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 69113 }; 69114 const tagName$o = "sonic-alert-messages"; 69115 let AlertMessages = class AlertMessages extends Subscriber$1(i$6) { 69116 constructor() { 69117 super(...arguments); 69118 this.size = "md"; 69119 this.background = false;
69120 this.noIcon = false; 69121 this.messages = []; 69122 } 69123 render() { 69124 if (!this.messages?.length) 69125 return A$1; 69126 return b$1`<div class="container"> 69127 ${o$1(this.messages, (message) => { 69128 if (message.type == "public") { 69129 return b$1`<sonic-alert 69130 status=${message.status || "default"} 69131 text=${o$4(message.content)} 69132 size=${this.size} 69133 ?noIcon=${this.noIcon} 69134 ?background=${this.background} 69135 ></sonic-alert>`; 69136 } else 69137 return A$1; 69138 })} 69139 </div>`; 69140 } 69141 }; 69142 AlertMessages.styles = [ 69143 i$9` 69144 .container { 69145 display: grid; 69146 gap: 0.5em; 69147 grid-template-columns: minmax(0, 1fr); 69148 width: 100%; 69149 } 69150 ` 69151 ]; 69152 __decorate$3([ 69153 n$5({ type: String }) 69154 ], AlertMessages.prototype, "size", void 0); 69155 __decorate$3([ 69156 n$5({ type: Boolean }) 69157 ], AlertMessages.prototype, "background", void 0); 69158 __decorate$3([ 69159 n$5({ type: Boolean }) 69160 ], AlertMessages.prototype, "noIcon", void 0); 69161 __decorate$3([ 69162 n$5({ type: Array }) 69163 ], AlertMessages.prototype, "messages", void 0); 69164 AlertMessages = __decorate$3([ 69165 t$3(tagName$o) 69166 ], AlertMessages); 69167 var __defProp$r = Object.defineProperty; 69168 var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor; 69169 var __decorateClass$t = (decorators, target, key, kind) => { 69170 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target; 69171 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69172 if (decorator = decorators[i2]) 69173 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69174 if (kind && result) __defProp$r(target, key, result); 69175 return result; 69176 }; 69177 const tagName$n = "sonic-ticket-freeup"; 69178 let SonicFreeUp = class extends Subscriber$1(i$6) { 69179 constructor() { 69180 super(...arguments); 69181 this.displayTitle = false; 69182 this.smallTitle = false; 69183 this.displayText = false; 69184 this.formDataProvider = "FreeupTicketFormNotLoggedIn"; 69185 this.messages = []; 69186 } 69187 handleSubmit(event) { 69188 if (event.detail.success === false) { 69189 this.messages = event.detail.messages; 69190 } else { 69191 dp(this.formDataProvider).barcode.set(""); 69192 this.messages = []; 69193 } 69194 } 69195 render() { 69196 const isLoggedIn = !!this.user?.id; 69197 const userEmail = this.user?.email; 69198 return b$1`<sonic-page-layout 69199 pageTitle=${t("free_up")} 69200 pageSubtitle=${t("free_up_short_text")} 69201 ?smallTitle=${this.smallTitle} 69202 ?displayTitle=${this.displayTitle} 69203 ?displayText=${this.displayText} 69204 > 69205 ${isLoggedIn ? b$1`<sonic-quick-access-card 69206 class="block mb-8" 69207 type="warning" 69208 href=${appRoute("account.tickets")} 69209 title=${t("LIB_retrouvez_vos_billets_depuis_votre_compte")} 69210 text=${t("LIB_et_liberez_rapidement_et_simplement_vos_billets")} 69211 icon="ticket" 69212 ></sonic-quick-access-card> 69213 </sonic-app-link>` : b$1`<sonic-quick-access-card 69214 class="block mb-8" 69215 type="success" 69216 href=${appRoute("account")} 69217 title=${t("LIB_connectez_vous_a_votre_compte")} 69218 text=${t("LIB_et_retrouvez_rapidement_et_simplement_vos_billets_a_liberer")} 69219 icon="user" 69220 ></sonic-quick-access-card> `} 69221 69222 <div formDataProvider=${this.formDataProvider}> 69223 <form> 69224 <sonic-divider align="left" class="mb-5 text-neutral-500">${t("LIB_billets_sans_compte")}</sonic-divider> 69225 <sonic-submit onEnterKey endpoint="tickets" method="delete" @submit=${this.handleSubmit}> 69226 <sonic-form-layout> 69227 <sonic-input 69228 type="email" 69229 label=${t("email")} 69230 name="email" 69231 placeholder="[email protected]" 69232 value=${userEmail} 69233 required 69234 ></sonic-input> 69235 <sonic-input 69236 type="text" 69237 label=${t("barcode_or_ticket_number")} 69238 name="barcode" 69239 placeholder="- - - - - - - - - - - -" 69240 ></sonic-input> 69241 </sonic-form-layout> 69242 </sonic-submit> 69243 69244 ${this.messages.length > 0 ? b$1`<sonic-alert-messages 69245 size="inherit" 69246 class="block my-4 text-pretty" 69247 background 69248 .messages=${this.messages}
69249 dismissible 69250 dataProvider="FreeupTicketFormMessages" 69251 ></sonic-alert-messages>` : A$1} 69252 <sonic-submit onClick endpoint="tickets" method="delete" @submit=${this.handleSubmit} class="mt-4 block"> 69253 <sonic-button radio noAutoFill type="success" 69254 ><sonic-icon slot="prefix" name="check"></sonic-icon> ${t("confirm")} 69255 </sonic-button> 69256 </sonic-submit> 69257 </form> 69258 </div> 69259 </sonic-page-layout>`; 69260 } 69261 }; 69262 SonicFreeUp.styles = [tailwind]; 69263 __decorateClass$t([ 69264 n$5({ type: Boolean }) 69265 ], SonicFreeUp.prototype, "displayTitle", 2); 69266 __decorateClass$t([ 69267 n$5({ type: Boolean }) 69268 ], SonicFreeUp.prototype, "smallTitle", 2); 69269 __decorateClass$t([ 69270 n$5({ type: Boolean }) 69271 ], SonicFreeUp.prototype, "displayText", 2); 69272 __decorateClass$t([ 69273 bind$1("user"), 69274 r$5() 69275 ], SonicFreeUp.prototype, "user", 2); 69276 __decorateClass$t([ 69277 n$5({ type: Array }) 69278 ], SonicFreeUp.prototype, "messages", 2); 69279 SonicFreeUp = __decorateClass$t([ 69280 t$3(tagName$n) 69281 ], SonicFreeUp); 69282 var __defProp$q = Object.defineProperty; 69283 var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor; 69284 var __decorateClass$s = (decorators, target, key, kind) => { 69285 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target; 69286 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69287 if (decorator = decorators[i2]) 69288 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69289 if (kind && result) __defProp$q(target, key, result); 69290 return result; 69291 }; 69292 const tagName$m = "sonic-campaign-content"; 69293 let SonicCampaignContent = class extends Subscriber$1(i$6) { 69294 constructor() { 69295 super(...arguments); 69296 this.edito = {}; 69297 } 69298 render() { 69299 const endPoint = entityEndPoint({ 69300 entityType: EntityType.Event, 69301 isQueue: true, 69302 next: true, 69303 accessParams: this.accessParams, 69304 view: entityView.essential 69305 }); 69306 return b$1`<sonic-page-layout 69307 pageTitle=${o$4(this.edito?.title)} 69308 pageText=${o$4(this.edito?.body)} 69309 pageSubtitle=${o$4(this.edito?.sub_title)} 69310 displayTitle 69311 displayText 69312 > 69313 <sonic-form-event-filter 69314 formDataProvider="campaignFormFilter" 69315 filterCategory 69316 class="block max-w-[40rem] w-full z-10 min-w-0 mb-6" 69317 ></sonic-form-event-filter> 69318 <div> 69319 <sonic-queue 69320 dataProviderExpression="${endPoint}" 69321 key="data" 69322 limit="5" 69323 targetRequestDuration="1000" 69324 dataProvider="campainResults" 69325 dataFilterProvider="campaignFormFilter" 69326 .items=${(_item, _metadata) => { 69327 const onlyOneResult = _metadata.firstChild && _metadata.lastChild; 69328 return b$1`<sonic-event-store-item 69329 showAllSessionsButton 69330 formType="select" 69331 ?alwaysExpanded=${onlyOneResult} 69332 class="mb-4 block" 69333 ></sonic-event-store-item>`; 69334 }} 69335 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 69336 > 69337 </sonic-queue></div 69338 ></sonic-page-layout>`; 69339 } 69340 }; 69341 SonicCampaignContent.styles = [tailwind]; 69342 __decorateClass$s([ 69343 n$5({ type: Object }) 69344 ], SonicCampaignContent.prototype, "edito", 2); 69345 __decorateClass$s([ 69346 c({ context: accessParamsContext, subscribe: true }), 69347 n$5({ type: Object }) 69348 ], SonicCampaignContent.prototype, "accessParams", 2); 69349 SonicCampaignContent = __decorateClass$s([ 69350 t$3(tagName$m) 69351 ], SonicCampaignContent); 69352 var __defProp$p = Object.defineProperty; 69353 var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor; 69354 var __decorateClass$r = (decorators, target, key, kind) => { 69355 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target; 69356 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69357 if (decorator = decorators[i2]) 69358 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69359 if (kind && result) __defProp$p(target, key, result); 69360 return result; 69361 }; 69362 const tagName$l = "sonic-campaign"; 69363 let SonicCampaign = class extends Fetcher$1(Subscriber$1(i$6)) { 69364 constructor() { 69365 super(...arguments); 69366 this.success = false;
69367 } 69368 connectedCallback() { 69369 if (!this.accessParams) { 69370 this.accessParams = getAccessParamsFromUrl(); 69371 } 69372 this.initDataProvider(); 69373 super.connectedCallback(); 69374 } 69375 willUpdate(changedProperties) { 69376 if (changedProperties.has("success")) { 69377 dp$1("user").invalidate(); 69378 } 69379 } 69380 initDataProvider() { 69381 const urlParams = new URLSearchParams(); 69382 appendAccessParams(urlParams, this.accessParams); 69383 const { campaignId, campaignHash } = this.accessParams || {}; 69384 const fragment = campaignHash || campaignId; 69385 if (fragment) { 69386 this.setAttribute("dataProvider", `campaign/${fragment}?${urlParams.toString()}`); 69387 } 69388 } 69389 render() { 69390 return b$1`${this.success ? b$1`<sonic-fullscreen-layout displayBanner> 69391 <sonic-campaign-content subDataProvider="data" ></sonic-campaign-content> 69392 </sonic-page-layout> 69393 <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> 69394 </sonic-fullscreen-layout 69395 >` : A$1}`; 69396 } 69397 }; 69398 SonicCampaign.styles = [tailwind]; 69399 __decorateClass$r([ 69400 e$2({ context: accessParamsContext }), 69401 n$5({ type: Object }) 69402 ], SonicCampaign.prototype, "accessParams", 2); 69403 __decorateClass$r([ 69404 n$5({ type: Boolean }) 69405 ], SonicCampaign.prototype, "success", 2); 69406 SonicCampaign = __decorateClass$r([ 69407 t$3(tagName$l) 69408 ], SonicCampaign); 69409 var __defProp$o = Object.defineProperty; 69410 var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor; 69411 var __decorateClass$q = (decorators, target, key, kind) => { 69412 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target; 69413 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69414 if (decorator = decorators[i2]) 69415 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69416 if (kind && result) __defProp$o(target, key, result); 69417 return result; 69418 }; 69419 const tagName$k = "sonic-ask-pro-account"; 69420 let SonicComponent$1 = class SonicComponent extends Subscriber$1(i$6) { 69421 constructor() { 69422 super(...arguments); 69423 this.displayTitle = false; 69424 this.displayText = false; 69425 this.smallTitle = false; 69426 this.updateAccount = false; 69427 this.accessAskProAccount = false; 69428 this.create_pro_account = false; 69429 } 69430 render() { 69431 return b$1`<sonic-page-layout 69432 ?smallTitle=${this.smallTitle} 69433 ?displayTitle=${this.displayTitle} 69434 ?displayText=${this.displayText} 69435 pageTitle=${this.create_pro_account ? t("create_account") : this.updateAccount ? t("LIB_formulaire_pro_actualiser") : t("LIB_compte_pro_formulaire_demande")} 69436 pageText=${this.accessAskProAccount ? t("LIB_compte_pro_formulaire_body") : ""} 69437 ><sonic-iframe src="/ask_pro_account?no_title=true"></sonic-iframe 69438 ></sonic-page-layout>`; 69439 } 69440 }; 69441 __decorateClass$q([ 69442 n$5({ type: Boolean }) 69443 ], SonicComponent$1.prototype, "displayTitle", 2); 69444 __decorateClass$q([ 69445 n$5({ type: Boolean }) 69446 ], SonicComponent$1.prototype, "displayText", 2); 69447 __decorateClass$q([ 69448 n$5({ type: Boolean }) 69449 ], SonicComponent$1.prototype, "smallTitle", 2); 69450 __decorateClass$q([ 69451 n$5({ type: Boolean }) 69452 ], SonicComponent$1.prototype, "updateAccount", 2); 69453 __decorateClass$q([ 69454 bind$1("settings.modules.ask_pro_account.access"), 69455 r$5() 69456 ], SonicComponent$1.prototype, "accessAskProAccount", 2); 69457 __decorateClass$q([ 69458 bind$1("settings.modules.create_pro_account.access"), 69459 r$5() 69460 ], SonicComponent$1.prototype, "create_pro_account", 2); 69461 SonicComponent$1 = __decorateClass$q([ 69462 t$3(tagName$k) 69463 ], SonicComponent$1); 69464 var __defProp$n = Object.defineProperty; 69465 var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor; 69466 var __decorateClass$p = (decorators, target, key, kind) => { 69467 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target; 69468 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69469 if (decorator = decorators[i2]) 69470 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69471 if (kind && result) __defProp$n(target, key, result); 69472 return result; 69473 }; 69474 const tagName$j = "sonic-custom-list-content"; 69475 let SonicCustomList$1 = class SonicCustomList extends Subscriber$1(i$6) { 69476 constructor() { 69477 super(...arguments); 69478 this.edito = {}; 69479 this.sessions = []; 69480 } 69481 render() { 69482 if (!this.props) return A$1; 69483 return b$1` 69484 <sonic-page-header .label=${this.edito.title}></sonic-page-header> 69485 69486 ${this.edito.body ? b$1`<div class="prose mb-10">${o$6(this.edito.body)}</div>` : A$1} 69487 ${this.props?.scheduledAt ? b$1`<sonic-alert status="warning" class="mb-3"> 69488 ${t("en_ligne_a_partir_du")} 69489 <sonic-date date=${this.props?.scheduledAt}></sonic-date> 69490 </sonic-alert>` : A$1} 69491 ${this.props?.quickAccess?.subscriptions ? b$1`<sonic-subscription-help class="block "></sonic-subscription-help>` : A$1} 69492 ${this.renderQuickAccess()} 69493 <sonic-list 69494 subDataProvider="sessions" 69495 class="grid gap-3 grid-cols-1" 69496 .items=${() => b$1`<sonic-event-store-item formType="buttons" formSize="sm"></sonic-event-store-item>`} 69497 > 69498 </sonic-list> 69499 `; 69500 } 69501 renderQuickAccess() { 69502 const quickAccess = this.props?.quickAccess; 69503 if (!quickAccess?.subscriptions && !quickAccess?.giftcards) return A$1; 69504 return b$1` 69505 <div class="flex gap-2 mb-3"> 69506 ${quickAccess?.subscriptions ? b$1`<sonic-cart-add-entity .entityType=${EntityType.Subscribe} class="block grow"></sonic-cart-add-entity>` : A$1} 69507 ${quickAccess?.giftcards ? b$1`<sonic-cart-add-entity .entityType=${EntityType.Giftcard} class="block grow"></sonic-cart-add-entity>` : A$1} 69508 </div> 69509 `; 69510 } 69511 }; 69512 SonicCustomList$1.styles = [tailwind]; 69513 __decorateClass$p([ 69514 n$5({ type: Object }) 69515 ], SonicCustomList$1.prototype, "edito", 2); 69516 __decorateClass$p([ 69517 n$5({ type: Array }) 69518 ], SonicCustomList$1.prototype, "sessions", 2); 69519 SonicCustomList$1 = __decorateClass$p([ 69520 t$3(tagName$j) 69521 ], SonicCustomList$1); 69522 var __defProp$m = Object.defineProperty; 69523 var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor; 69524 var __decorateClass$o = (decorators, target, key, kind) => { 69525 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target; 69526 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 69527 if (decorator = decorators[i2]) 69528 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 69529 if (kind && result) __defProp$m(target, key, result); 69530 return result; 69531 }; 69532 const tagName$i = "sonic-custom-list"; 69533 let SonicCustomList = class extends Fetcher(Subscriber$1(i$6)) { 69534 constructor() { 69535 super(...arguments); 69536 this.success = null; 69537 } 69538 connectedCallback() { 69539 if (!this.accessParams) { 69540 this.accessParams = getAccessParamsFromUrl(); 69541 } 69542 if (!this.accessParams?.customListSlug) { 69543 const slug = decodeURI(window.location.href.split("/").pop() || ""); 69544 this.accessParams.customListSlug = appRoute("customList").extract()?.slug || slug;
69545 } 69546 this.noErrorsRecordings = true; 69547 super.connectedCallback(); 69548 } 69549 render() { 69550 const hasPictureSrc = !!this.publisher.get().data?.picture?.src; 69551 return b$1` <sonic-fullscreen-layout> 69552 ${this.success === false ? b$1` 69553 <form 69554 formDataProvider="customListLogin" 69555 submitResultDataProvider="${this.dataProvider || ""}" 69556 dataProvider="customListLogin" 69557 > 69558 <sonic-fieldset class="max-w-[25rem]"> 69559 <sonic-legend iconLibrary="custom" iconName="lock" label=${t("password")}></sonic-legend> 69560 <sonic-form-layout> 69561 <sonic-submit onEnterKey endpoint="custom-list/login" method="post"> 69562 <sonic-form-layout> 69563 <sonic-input type="hidden" name="list" value=${this.accessParams?.customListSlug}></sonic-input> 69564 <sonic-input type="password" data-aria-label=${t("password")} name="password"></sonic-input> 69565 </sonic-form-layout> 69566 </sonic-submit> 69567 <sonic-form-actions> 69568 <sonic-submit onClick endpoint="custom-list/login" method="post"> 69569 <sonic-button radio noAutoFill type="success"> 69570 <sonic-icon slot="prefix" name="check"></sonic-icon> 69571 ${t("confirm")} 69572 </sonic-button> 69573 </sonic-submit> 69574 </sonic-form-actions> 69575 </sonic-form-layout> 69576 </sonic-fieldset> 69577 </form> 69578 ` : A$1} 69579 ${this.success ? b$1`<sonic-custom-list-content subDataProvider="data"></sonic-custom-list-content> ${hasPictureSrc ? b$1`<div 69580 slot="aside" 69581 class="relative h-full bg-neutral-100 rounded-lg overflow-hidden hidden lg:block" 69582 > 69583 <sonic-product-illustration subDataProvider="data" cover></sonic-product-illustration> 69584 </div> ` : A$1}` : A$1} 69585 </sonic-fullscreen-layout>`; 69586 } 69587 }; 69588 SonicCustomList.styles = [tailwind]; 69589 __decorateClass$o([ 69590 r$5() 69591 ], SonicCustomList.prototype, "success", 2); 69592 __decorateClass$o([ 69593 e$2({ context: accessParamsContext }), 69594 n$5({ type: Object }) 69595 ], SonicCustomList.prototype, "accessParams", 2); 69596 SonicCustomList = __decorateClass$o([ 69597 t$3(tagName$i) 69598 ], SonicCustomList); 69599 var __decorate$2 = function(decorators, target, key, desc) { 69600 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 69601 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 69602 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; 69603 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 69604 }; 69605 const tagName$h = "sonic-redirect"; 69606 let SonicRedirect = class SonicRedirect extends Subscriber$1(i$6) { 69607 connectedCallback() { 69608 this.noShadowDom = ""; 69609 this.style.display = "none"; 69610 super.connectedCallback(); 69611 this.udpateCallBack = () => this.update(); 69612 if (this.publisher) 69613 this.publisher.onInternalMutation(this.udpateCallBack); 69614 } 69615 disconnectedCallback() { 69616 if (this.publisher) 69617 this.publisher.offInternalMutation(this.udpateCallBack); 69618 super.disconnectedCallback(); 69619 } 69620 update() { 69621 if (this.hasAttribute("onAdded")) { 69622 LocationHandler$1.changeFromComponent(this); 69623 return; 69624 } 69625 if (!this.props) 69626 return; 69627 const onDataPath = this.getAttribute("onData").split("."); 69628 const searchedData = Objects$1.traverse(this.props, onDataPath); 69629 if (searchedData && !(Objects$1.isObject(searchedData) && searchedData)) { 69630 LocationHandler$1.changeFromComponent(this); 69631 } 69632 } 69633 }; 69634 SonicRedirect = __decorate$2([ 69635 t$3(tagName$h) 69636 ], SonicRedirect); 69637 const checkbox = { "tagName": "sonic-checkbox" }; 69638 const date = { "tagName": "sonic-input", "attributes": { "type": "date" } }; 69639 const fieldset = { "tagName": "sonic-fieldset", "nodes": [{ "libraryKey": "formLayout" }], "contentElementSelector": "sonic-form-layout" }; 69640 const managed_file = { "tagName": "sonic-input", "attributes": { "variant": "ghost", "type": "file" } }; 69641 const password = { "tagName": "sonic-input", "attributes": { "type": "password" } }; 69642 const radio = { "tagName": "sonic-radio" }; 69643 const select = { "tagName": "sonic-select" }; 69644 const textarea = { "tagName": "sonic-textarea" }; 69645 const textfield = { "tagName": "sonic-input", "attributes": { "type": "text" } }; 69646 const hidden = { "tagName": "sonic-input", "attributes": { "type": "hidden" } }; 69647 const button = { "tagName": "sonic-button" }; 69648 const form = { "tagName": "sonic-submit", "attributes": { "onEnterKey": true } }; 69649 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" } }] }] }; 69650 const email = { "tagName": "sonic-input", "attributes": { "type": "email" } }; 69651 const formItemContainer = { "tagName": "div", "attributes": { "class": "form-item-container" } }; 69652 const formLayout = { "tagName": "sonic-form-layout" }; 69653 const formActions = { "tagName": "sonic-form-actions" }; 69654 const passwordHelper = { "tagName": "sonic-password-helper" }; 69655 const sameValueHelper = { "tagName": "sonic-same-value-helper" };
vendor: 6,415 bytes, lines 69656-69829
69656 const divider = { "tagName": "sonic-divider" }; 69657 const default_library = { 69658 checkbox, 69659 date, 69660 fieldset, 69661 managed_file, 69662 password, 69663 radio, 69664 select, 69665 textarea, 69666 textfield, 69667 hidden, 69668 button, 69669 form, 69670 submit, 69671 email, 69672 formItemContainer, 69673 formLayout, 69674 formActions, 69675 passwordHelper, 69676 sameValueHelper, 69677 divider 69678 }; 69679 class SDUIDescriptorTransformer { 69680 /** 69681 * Tranform un SDUIDescriptor via une SDUITransformDescription 69682 * Attention fonction non pure : la sduiDescriptor est modifiée en place. 69683 * * La librarie de la sduiDescriptor est mise à jour avec celle présente dans SDUITransformDescription<br> 69684 * Si des clefs de librairie correspondent, celles de SDUITransformDescription ecrasent celles existantes 69685 * * Ensuite des actions de transformations sont menées sur les nodes du SDUIDescriptor 69686 * 69687 */ 69688 async transform(sduiDescriptor, transformDescriptor) { 69689 this.sduiDescriptor = sduiDescriptor; 69690 if (this.sduiDescriptor.library) { 69691 for (const key in transformDescriptor.library) { 69692 this.sduiDescriptor.library[key] = transformDescriptor.library[key]; 69693 } 69694 } 69695 for (const item of transformDescriptor.transforms) { 69696 this.transformAction(item); 69697 } 69698 } 69699 /** 69700 * Effectue une actions de transformation sur les noeuds (nodes) de la sduiDescriptor (SDUIDescriptor) 69701 * La des noeuds impacté est sélectionnée via pattern matching (voir SDUITransformAction.pattern et getNodesMatchingPatterns); 69702 * Voir le détail des actions de transformations dns les fonctions appellées dans le switch. 69703 */ 69704 transformAction(transformAction) { 69705 const uis = this.getNodesMatchingPatterns(transformAction.patterns, this.sduiDescriptor); 69706 this[transformAction.action](transformAction, uis); 69707 } 69708 /** 69709 * Retourne les noeuds du SDUIDescriptor qui matche la liste de patterns fournis, dans l'ordre des patterns fournis 69710 */ 69711 getNodesMatchingPatterns(patterns, node) { 69712 if (!patterns) 69713 return []; 69714 if (!node) 69715 return []; 69716 const nodes = node.nodes; 69717 if (!nodes) 69718 return []; 69719 let result = []; 69720 let index = 0; 69721 for (const pattern of patterns) { 69722 for (const child of nodes) { 69723 if (this.nodeMatchesPattern(pattern, child)) { 69724 result.push({ parent: node, child, index }); 69725 } 69726 result = result.concat(this.getNodesMatchingPatterns([pattern], child)); 69727 index++; 69728 } 69729 } 69730 return result; 69731 } 69732 /** 69733 * Utilisé pour voir si un élément du pattern match le même élement du noeud en cours de traitement 69734 */ 69735 stringMatchesExpression(stringToTest, regExpString) { 69736 return !regExpString || stringToTest && stringToTest.match(regExpString); 69737 } 69738 /** 69739 * Return true si le pattern match avec le noeud, false sinon. 69740 */ 69741 nodeMatchesPattern(pattern, node) { 69742 const patternDynamic = pattern; 69743 const nodeDynamic = node; 69744 const keys2 = ["libraryKey", "innerHTML", "prefix", "suffix", "markup"]; 69745 for (const key of keys2) { 69746 if (!this.stringMatchesExpression(nodeDynamic[key], patternDynamic[key])) { 69747 return false; 69748 } 69749 } 69750 const patternAttributes = pattern.attributes; 69751 const nodeAttributes = node.attributes; 69752 if (patternAttributes && !nodeAttributes) 69753 return false; 69754 if (patternAttributes) { 69755 for (const name in patternAttributes) { 69756 if (!nodeAttributes || !this.stringMatchesExpression(nodeAttributes[name], patternAttributes[name])) { 69757 return false; 69758 } 69759 } 69760 } 69761 return true; 69762 } 69763 /** 69764 * Pour chaque élément de la liste, remplace l'élément par ses enfants 69765 */ 69766 unwrap(transformAction, list) { 69767 for (const item of list) { 69768 item.parent.nodes?.splice(item.parent.nodes.indexOf(item.child), 1); 69769 if (item.child.nodes) { 69770 item.parent.nodes?.splice(item.parent.nodes.indexOf(item.child), 0, ...item.child.nodes); 69771 } 69772 } 69773 } 69774 /** 69775 * Regroupe tous les éléments de la liste dans l'élément fourni via la prop `ui` de transformAction 69776 * L'élément créé est inséré en lieu et place du premier élément de la liste 69777 */ 69778 wrap(transformAction, list) { 69779 const wrapper = { ...transformAction.ui }; 69780 if (!wrapper.nodes) 69781 wrapper.nodes = []; 69782 let i2 = 0; 69783 for (const item of list) { 69784 wrapper.nodes?.push(item.child); 69785 if (i2 > 0) { 69786 item.parent.nodes?.splice(item.parent.nodes.indexOf(item.child), 1); 69787 } 69788 i2++; 69789 } 69790 const idx = list[0]?.parent.nodes?.indexOf(list[0].child); 69791 if (idx) { 69792 list[0].parent.nodes?.splice(idx, 1); 69793 list[0].parent.nodes?.splice(idx, 0, wrapper); 69794 } 69795 } 69796 /** 69797 * 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` 69798 */ 69799 move(transformAction, list) { 69800 for (const item of list) { 69801 item.parent.nodes?.splice(item.parent.nodes.indexOf(item.child), 1); 69802 let list2 = []; 69803 if (transformAction.after) 69804 list2 = this.getNodesMatchingPatterns([transformAction.after], this.sduiDescriptor); 69805 if (transformAction.before) 69806 list2 = this.getNodesMatchingPatterns([transformAction.before], this.sduiDescriptor); 69807 const element = list2[0]; 69808 if (element) { 69809 element.parent.nodes?.splice(element.parent.nodes.indexOf(element.child) + (transformAction.after ? 1 : 0), 0, item.child); 69810 } 69811 } 69812 } 69813 /** 69814 * Transform ous les éléments fourni dans la liste en un élément créé a partir du model fourni dans ui. 69815 * Les props attributs et autre props de chaque élément sont conservés si non remapés 69816 */ 69817 remap(transformAction, list) { 69818 for (const item of list) { 69819 const newUI = { ...transformAction.ui }; 69820 if (!newUI.attributes) { 69821 newUI.attributes = {}; 69822 } 69823 const childAttributes = item.child.attributes; 69824 if (childAttributes) { 69825 for (const key in childAttributes) { 69826 if (!Object.prototype.hasOwnProperty.call(newUI.attributes, "key")) 69827 newUI.attributes[key] = childAttributes[key]; 69828 } 69829 }
69830 const keys2 = ["libraryKey", "innerHTML", "prefix", "suffix", "markup"]; 69831 const childDynamic = item.child; 69832 const newUIDynamic = newUI; 69833 for (const key of keys2) { 69834 if (!Object.prototype.hasOwnProperty.call(newUI, key) && childDynamic[key]) 69835 newUIDynamic[key] = childDynamic[key]; 69836 } 69837 if (!newUI.nodes) { 69838 newUI.nodes = []; 69839 } 69840 const childNodes = item.child.nodes; 69841 if (childNodes) { 69842 for (const node of childNodes) { 69843 newUI.nodes.push(node); 69844 } 69845 } 69846 const idx = item.parent.nodes?.indexOf(item.child) || -1; 69847 if (idx != -1) { 69848 item.parent.nodes?.splice(idx, 1); 69849 item.parent.nodes?.splice(idx, 0, newUI); 69850 } 69851 } 69852 } 69853 /** 69854 * Supprime tous les éléments de la liste. 69855 */ 69856 delete(transformAction, list) { 69857 for (const item of list) { 69858 item.parent.nodes?.splice(item.parent.nodes.indexOf(item.child), 1); 69859 } 69860 } 69861 /** 69862 * 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 69863 * 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 69864 */ 69865 insert(transformAction, list) { 69866 const positionType = transformAction.after ? "after" : transformAction.before ? "before" : "in"; 69867 list = []; 69868 if (transformAction.after) { 69869 list = this.getNodesMatchingPatterns([transformAction.after], this.sduiDescriptor); 69870 } else if (transformAction.before) { 69871 list = this.getNodesMatchingPatterns([transformAction.before], this.sduiDescriptor); 69872 } else if (transformAction.in) { 69873 list = this.getNodesMatchingPatterns([transformAction.in], this.sduiDescriptor); 69874 } 69875 const node = list[0]; 69876 if (node) { 69877 if (positionType == "in") { 69878 if (!node.child.nodes) 69879 node.child.nodes = []; 69880 node.child.nodes.push({ ...transformAction.ui }); 69881 } else { 69882 node.parent.nodes?.splice(node.parent.nodes.indexOf(node.child) + (positionType == "after" ? 1 : 0), 0, { 69883 ...transformAction.ui 69884 }); 69885 } 69886 } 69887 } 69888 } 69889 var __decorate$1 = function(decorators, target, key, desc) { 69890 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 69891 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 69892 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; 69893 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 69894 }; 69895 const tagName$g = "sonic-sdui"; 69896 let SonicSDUI = class SonicSDUI extends Fetcher(Subscriber(i$6)) { 69897 constructor() { 69898 super(...arguments); 69899 this.sduiDescriptor = {}; 69900 } 69901 connectedCallback() { 69902 this.noShadowDom = ""; 69903 this.displayContents = true; 69904 this.isFetchEnabled = this.hasAttribute("fetch"); 69905 super.connectedCallback(); 69906 } 69907 /** 69908 * On peut passer la description sous form de props, sinon il faut utiliser l'attribut fetch 69909 */ 69910 willUpdate(changedProperties) { 69911 if (this.props == null) { 69912 this.sduiDescriptor = {}; 69913 } 69914 { 69915 const newSduiDescriptor = this.sduiKey ? this.props[this.sduiKey] : this.props; 69916 if (this.sduiDescriptor == newSduiDescriptor) 69917 return; 69918 this.sduiDescriptor = newSduiDescriptor; 69919 this.updateContents(); 69920 } 69921 super.willUpdate(changedProperties); 69922 } 69923 /** 69924 * updateContents est déclenché quand les sduiDescriptor sont renseignées 69925 * Le contenu du composant est regénéré en fonction du descripteur fourni 69926 */ 69927 async updateContents() { 69928 if (!this.sduiDescriptor) 69929 return; 69930 const library = {}; 69931 Object.assign(library, default_library, this.sduiDescriptor.library); 69932 this.sduiDescriptor.library = library; 69933 this.loadAssets(); 69934 await this.loadLibrary(); 69935 await this.transformSDUIDescriptor(); 69936 this.parseRootNodes(); 69937 } 69938 /** 69939 * Suppressiond du contenu du composant avant le génération de la nouvelle ui 69940 */ 69941 removeChildren() { 69942 while ([...this.children].filter((elt) => elt.nodeName != "SLOT").length > 0) { 69943 this.removeChild(this.children[0]); 69944 } 69945 } 69946 /**
vendor: 4,135 bytes, lines 69947-70055
69947 * Chargement de fichiers js et css associés si besoin 69948 **/ 69949 loadAssets() { 69950 if (!this.sduiDescriptor) 69951 return; 69952 if (this.sduiDescriptor.js) { 69953 for (const src of this.sduiDescriptor.js) 69954 HTML.loadJS(src); 69955 } 69956 if (this.sduiDescriptor.css) { 69957 for (const src of this.sduiDescriptor.css) 69958 HTML.loadCSS(src); 69959 } 69960 } 69961 /** 69962 * Transformation de la data fournie via sduiDescriptor si il y a un attribut transformation 69963 * */ 69964 async transformSDUIDescriptor() { 69965 if (!this.hasAttribute("transformation")) 69966 return; 69967 const result = await fetch(this.getAttribute("transformation")); 69968 const json = await result.json(); 69969 const transformer = new SDUIDescriptorTransformer(); 69970 await transformer.transform(this.sduiDescriptor, json); 69971 } 69972 /** 69973 * Charge la library à utiliser 69974 * */ 69975 async loadLibrary() { 69976 if (!this.hasAttribute("library")) 69977 return; 69978 const result = await fetch(this.getAttribute("library")); 69979 const json = await result.json(); 69980 this.sduiDescriptor.library = json; 69981 } 69982 /** 69983 * Point d'entrée : transformation des noeuds fournis en éléments graphiques 69984 **/ 69985 parseRootNodes() { 69986 this.removeChildren(); 69987 if (!this.sduiDescriptor) 69988 return; 69989 let nodes = this.sduiDescriptor.nodes; 69990 if (!nodes) 69991 nodes = []; 69992 const messageProvider = { 69993 tagName: "sonic-toast-message-subscriber", 69994 attributes: {} 69995 }; 69996 if (this.messagesKey) { 69997 messageProvider.attributes = { subDataProvider: this.messagesKey }; 69998 } 69999 nodes.push(messageProvider); 70000 nodes.forEach((node) => this.appendChild(this.parseChild(node))); 70001 } 70002 /** 70003 * On parse un noeud ce qui crée un éléments graphique et ses enfants par recursivité via `handleChildNodes` 70004 */ 70005 parseChild(node) { 70006 const tagName2 = node.tagName || "div"; 70007 let { element, contentElement } = this.handleLibrary(node, tagName2); 70008 this.handleAttributes(node, element); 70009 element = this.handleMarkup(node, element); 70010 if (!contentElement) 70011 contentElement = element; 70012 this.handleChildNodes(node, contentElement, element); 70013 this.handleInnerHTML(node, contentElement); 70014 if (node.prefix || node.suffix) { 70015 const container = this.handlePrefixSuffix(node, element); 70016 return container; 70017 } 70018 return element; 70019 } 70020 /** 70021 * Si le noeud courant a des propriétés prefix et ou suffix il est entouré des markups fournis dans ces sduiDescriptor. 70022 * Le tout est inclu dans une div en display contents 70023 */ 70024 handlePrefixSuffix(node, element) { 70025 const container = document.createElement("div"); 70026 container.innerHTML = (node.prefix || "") + element.outerHTML + (node.suffix || ""); 70027 container.style.display = "contents"; 70028 return container; 70029 } 70030 /** 70031 * Création des enfants du noeud courant 70032 * 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. 70033 */ 70034 handleChildNodes(node, contentElement, element) { 70035 if (node.nodes) { 70036 const children = node.nodes; 70037 for (const child of children) { 70038 const childElement = this.parseChild(child); 70039 let nodeToAppendOn = contentElement; 70040 if (child.parentElementSelector) { 70041 nodeToAppendOn = element.querySelector(child.parentElementSelector) || contentElement; 70042 } 70043 if (nodeToAppendOn.shadowRoot) 70044 nodeToAppendOn.shadowRoot.appendChild(childElement); 70045 else if (nodeToAppendOn.tagName.toLocaleLowerCase() == "template") { 70046 const template = nodeToAppendOn; 70047 template.content.appendChild(childElement); 70048 } else 70049 nodeToAppendOn.appendChild(childElement); 70050 } 70051 } 70052 } 70053 /** 70054 * Gestion de librarie : 70055 * * 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.
70056 * * Sa propriété contentElement retournée vaut element par défaut. 70057 * * Si contentElementSelector est definit, alors contentElement correspond à l'élément obtenu par selection css d'après la valeurs de contentElementSelector 70058 * * Les éléments enfants seront ensuite ajoutés dans contentElement 70059 */ 70060 handleLibrary(node, tagName2) { 70061 let element; 70062 let contentElement; 70063 if (node.libraryKey && this.sduiDescriptor.library) { 70064 element = this.parseChild(this.sduiDescriptor.library[node.libraryKey] || { tagName: "div" }); 70065 const selector = (this.sduiDescriptor.library[node.libraryKey] || {}).contentElementSelector; 70066 if (selector) 70067 contentElement = element.querySelector(selector); 70068 } else 70069 element = document.createElement(tagName2); 70070 return { element, contentElement }; 70071 } 70072 /** 70073 * Remplissage des attributs html avec les attributs fournis dans le noeud 70074 */ 70075 handleAttributes(node, element) { 70076 const attributes = node.attributes; 70077 for (const k2 in attributes) { 70078 const attrData = attributes[k2]; 70079 const attr = Objects.isObject(attrData) ? JSON.stringify(attrData) : attrData; 70080 element.setAttribute(k2, attr); 70081 } 70082 } 70083 /** 70084 * Si une propriété markup est fournie, l'élément est créé à partir de la chaine html fournie avant d'être configuré 70085 */ 70086 handleMarkup(node, element) { 70087 if (node.markup) { 70088 element = document.createElement("div"); 70089 element.style.display = "contents"; 70090 element.innerHTML = node.markup; 70091 } 70092 return element; 70093 } 70094 /** 70095 * si le noeud à une propriété innerHTML, on l'ajout ay innerHTML de l'élément html en cours de création 70096 */ 70097 handleInnerHTML(node, contentElement) { 70098 if (!node.innerHTML) 70099 return; 70100 if (node.innerHTML.indexOf("wording_") != -1) { 70101 const wordingProvider = this.getAncestorAttributeValue("wordingProvider"); 70102 this.api?.post(wordingProvider, { labels: [node.innerHTML.substring(8)] }).then((value) => { 70103 if (contentElement) 70104 contentElement.innerHTML += value; 70105 }); 70106 } else if (contentElement) { 70107 contentElement.innerHTML += node.innerHTML; 70108 } 70109 } 70110 }; 70111 __decorate$1([ 70112 n$5() 70113 ], SonicSDUI.prototype, "sduiKey", void 0); 70114 __decorate$1([ 70115 n$5() 70116 ], SonicSDUI.prototype, "messagesKey", void 0); 70117 SonicSDUI = __decorate$1([ 70118 t$3(tagName$g) 70119 ], SonicSDUI); 70120 var __defProp$l = Object.defineProperty; 70121 var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor; 70122 var __decorateClass$n = (decorators, target, key, kind) => { 70123 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target; 70124 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70125 if (decorator = decorators[i2]) 70126 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70127 if (kind && result) __defProp$l(target, key, result); 70128 return result; 70129 }; 70130 const tagName$f = "sonic-carpooling"; 70131 let SonicPageCarpooling = class extends CovoitLoad(i$6) { 70132 constructor() { 70133 super(...arguments); 70134 this.displayTitle = false; 70135 this.smallTitle = false; 70136 this.displayText = false; 70137 } 70138 render() { 70139 const covoitURL = this.carpoolingSettings?.url; 70140 const token = this.carpoolingSettings?.token || ""; 70141 if (!covoitURL) return A$1; 70142 return b$1`<sonic-page-layout 70143 pageTitle=${t("module_carpooling_title")} 70144 pageText=${t("module_carpooling_text")} 70145 ?smallTitle=${this.smallTitle} 70146 ?displayTitle=${this.displayTitle} 70147 ?displayText=${this.displayText} 70148 > 70149 <covoit-app 70150 covoitURL="${covoitURL}" 70151 baseURL=${appRoute("carpooling")} 70152 token="${o$4(token)}" 70153 encryptedUid=${o$4(this.encryptedUid)} 70154 customRoutes=${JSON.stringify(this.customRoutes)} 70155 ></covoit-app> 70156 </sonic-page-layout>`; 70157 } 70158 }; 70159 __decorateClass$n([ 70160 n$5({ type: Boolean }) 70161 ], SonicPageCarpooling.prototype, "displayTitle", 2); 70162 __decorateClass$n([ 70163 n$5({ type: Boolean }) 70164 ], SonicPageCarpooling.prototype, "smallTitle", 2); 70165 __decorateClass$n([ 70166 n$5({ type: Boolean }) 70167 ], SonicPageCarpooling.prototype, "displayText", 2); 70168 SonicPageCarpooling = __decorateClass$n([ 70169 t$3(tagName$f) 70170 ], SonicPageCarpooling); 70171 var __defProp$k = Object.defineProperty; 70172 var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor; 70173 var __decorateClass$m = (decorators, target, key, kind) => { 70174 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target; 70175 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70176 if (decorator = decorators[i2]) 70177 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70178 if (kind && result) __defProp$k(target, key, result); 70179 return result; 70180 }; 70181 const tagName$e = "sonic-reservation-request-config-status"; 70182 let SonicReservationRequestStatus = class extends Subscriber$1(i$6) { 70183 willUpdate(changedProperties) {
70184 const isPro = this.props?.access_restriction === "pros"; 70185 const isSpecificPro = this.props?.access_restriction === "pros_types"; 70186 const customerHasProAccess = this.userProAccess === "yes"; 70187 this.type = "warning"; 70188 let textToDisplay = void 0; 70189 if (!customerHasProAccess && (isPro || isSpecificPro)) { 70190 textToDisplay = t("LIB_abo_pro_warning"); 70191 } else { 70192 if (isSpecificPro) { 70193 const structureTypeId = this.userStructureTypeId ?? 0; 70194 const structureIsAllowed = this.props?.structure_types?.includes(structureTypeId); 70195 textToDisplay = !structureIsAllowed ? t("LIB_unauthorized_warning") : void 0; 70196 this.type = !structureIsAllowed ? "danger" : "warning"; 70197 } 70198 } 70199 this.text = textToDisplay; 70200 super.willUpdate(changedProperties); 70201 } 70202 render() { 70203 if (!this.text) { 70204 return A$1; 70205 } 70206 return b$1`<sonic-badge type="warning" class="inline-block"> ${this.text}</sonic-badge>`; 70207 } 70208 }; 70209 SonicReservationRequestStatus.styles = [tailwind]; 70210 __decorateClass$m([ 70211 bind$1("user.proAccess"), 70212 n$5({ type: Number }) 70213 ], SonicReservationRequestStatus.prototype, "userProAccess", 2); 70214 __decorateClass$m([ 70215 bind$1("user.structureType.id"), 70216 n$5({ type: Number }) 70217 ], SonicReservationRequestStatus.prototype, "userStructureTypeId", 2); 70218 __decorateClass$m([ 70219 r$5() 70220 ], SonicReservationRequestStatus.prototype, "text", 2); 70221 __decorateClass$m([ 70222 r$5() 70223 ], SonicReservationRequestStatus.prototype, "type", 2); 70224 SonicReservationRequestStatus = __decorateClass$m([ 70225 t$3(tagName$e) 70226 ], SonicReservationRequestStatus); 70227 var __defProp$j = Object.defineProperty; 70228 var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor; 70229 var __decorateClass$l = (decorators, target, key, kind) => { 70230 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target; 70231 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70232 if (decorator = decorators[i2]) 70233 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70234 if (kind && result) __defProp$j(target, key, result); 70235 return result; 70236 }; 70237 const tagName$d = "sonic-request-link-item"; 70238 let SonicRequestLinkItem = class extends Subscriber$1(i$6) { 70239 constructor() { 70240 super(...arguments); 70241 this.active = false; 70242 } 70243 render() { 70244 const { title, sub_title } = this.props?.edito || {}; 70245 return b$1` 70246 <button 70247 id=${this.id} 70248 ?disabled=${this.active} 70249 class="mb-4 w-full flex text-left gap-4 border-2 rounded-lg p-5 70250 ${this.active ? "border-neutral-900 hover:bg-transparent" : "border-neutral-100 hover:bg-neutral-50 focus:border-2 focus:border-neutral-900"}" 70251 > 70252 <div class="grow flex flex-col gap-1 pointer-events-auto"> 70253 <div class="text-2xl font-bold max-w-[60rem] ">${title}</div> 70254 ${sub_title ? b$1`<div class="text-xl max-w-[60rem] prose text-neutral-800 ">${sub_title}</div>` : A$1} 70255 ${this.renderBody()} 70256 70257 <sonic-reservation-request-config-status></sonic-reservation-request-config-status> 70258 </div> 70259 70260 <slot name="actions"> 70261 <sonic-button class="shrink-0 self-center" shape="circle" size="xl"> 70262 <sonic-icon library="custom" name="arrow-right" color="currentColor"></sonic-icon> </sonic-button 70263 ></slot> 70264 </button> 70265 `; 70266 } 70267 renderBody() { 70268 const { body } = this.props?.edito || {}; 70269 if (!body || !this.active) return A$1; 70270 return b$1` 70271 <sonic-clamped-content 70272 class="mt-5 pointer-events-auto" 70273 .height=${12} 70274 buttonSize="inherit" 70275 .buttonLabel=${t("LIB_voir_la_description_complete")} 70276 > 70277 <div class="text-base max-w-[60rem] prose text-neutral-800">${o$6(body)}</div> 70278 </sonic-clamped-content> 70279 `; 70280 } 70281 }; 70282 SonicRequestLinkItem.styles = [ 70283 tailwind, 70284 i$9` 70285 :host { 70286 display: block; 70287 } 70288 ` 70289 ]; 70290 __decorateClass$l([ 70291 n$5({ type: Boolean }) 70292 ], SonicRequestLinkItem.prototype, "active", 2); 70293 SonicRequestLinkItem = __decorateClass$l([ 70294 t$3(tagName$d) 70295 ], SonicRequestLinkItem); 70296 var __defProp$i = Object.defineProperty; 70297 var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor; 70298 var __decorateClass$k = (decorators, target, key, kind) => { 70299 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target; 70300 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70301 if (decorator = decorators[i2]) 70302 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70303 if (kind && result) __defProp$i(target, key, result); 70304 return result; 70305 }; 70306 const tagName$c = "sonic-request-event-form"; 70307 let instanceCounter = 0; 70308 let SonicRequestEventForm = class extends i$6 { 70309 constructor() { 70310 super(...arguments); 70311 this.formKey = "formInfos/reservation-request" + instanceCounter++; 70312 this.cartProvider = ""; 70313 this.testMode = false;
70314 this._mode = RequestMode.Uninitialized; 70315 } 70316 async deleteWithConfim(api2, dataProvider) { 70317 if (!this._cartData?.id) { 70318 this.dispatchEvent(new CustomEvent("deleted")); 70319 return; 70320 } 70321 Modal.create({ 70322 title: t("LIB_confirmer_la_suppression"), 70323 subtitle: t("LIB_attention_toutes_les_donnees_seront_perdues"), 70324 actions: b$1`<sonic-button 70325 minWidth="10rem" 70326 shape="block" 70327 type="danger" 70328 @click=${(e2) => { 70329 const target = e2.currentTarget; 70330 const parentModal = HTML$1.getClosestElement(target, "sonic-modal"); 70331 Cart.delete(api2, dataProvider).then(() => { 70332 parentModal?.hide(); 70333 this.dispatchEvent(new CustomEvent("deleted")); 70334 }); 70335 }} 70336 > 70337 <sonic-icon library="custom" name="trash"></sonic-icon> 70338 ${t("supprimer")}</sonic-button 70339 ><sonic-button shape="block" minWidtremh="10" hideModal> 70340 <sonic-icon library="custom" name="arrow-rotate-left"></sonic-icon>${t("annuler")}</sonic-button 70341 >`, 70342 removeOnHide: true 70343 }); 70344 } 70345 async willUpdate(changedProperties) { 70346 if (changedProperties.has("userId") || changedProperties.has("testMode")) { 70347 if (this.userId) { 70348 this.initFromUserId(this.userId); 70349 } else if (this.testMode) { 70350 this._mode = RequestMode.Create; 70351 } else { 70352 this._mode = RequestMode.Login; 70353 } 70354 } 70355 const previousStatus = changedProperties.get("_cartData")?.status; 70356 const currentStatus = this._cartData?.status; 70357 const incompleteToSubmitted = previousStatus === ReservationStatus.Incomplete && currentStatus === ReservationStatus.Submitted; 70358 if (incompleteToSubmitted) { 70359 this._mode = RequestMode.Ending; 70360 } 70361 super.willUpdate(changedProperties); 70362 } 70363 async initFromUserId(userId) { 70364 const userRequests = await getUserCarts(this, { 70365 cartType: CartType.ReservationRequest, 70366 userId, 70367 statuses: [ReservationStatus.Incomplete] 70368 }); 70369 const userRequestsForConfig = userRequests.filter( 70370 (reservation) => reservation.reservationRequestConfigId === Number(this.config?.id) 70371 ); 70372 if (userRequestsForConfig.length > 0) { 70373 const urlParams = new URLSearchParams(window.location.search); 70374 const requestId = urlParams.get("sonic_request_id"); 70375 const configId = urlParams.get("sonic_reservation_request_config_id"); 70376 if (requestId && configId) { 70377 this._cartData = userRequestsForConfig.find( 70378 (reservation) => reservation.id === Number(requestId) && reservation.reservationRequestConfigId === Number(configId) 70379 ) ?? void 0; 70380 } else { 70381 this._cartData = userRequestsForConfig[0]; 70382 } 70383 this.cartProvider = this.getCartProviderKey(); 70384 await this.initFormData(this.cartProvider); 70385 this._mode = RequestMode.Selection; 70386 } else if (this.config?.has_password_restriction) { 70387 const hasAccess = await this.hasAccess(); 70388 this._mode = hasAccess ? RequestMode.Create : RequestMode.Password; 70389 } else if (this.config?.access_restriction === "pros" || this.config?.access_restriction === "pros_types") { 70390 const hasAccess = await this.hasAccess(); 70391 this._mode = hasAccess ? RequestMode.Create : RequestMode.NotAuthorized; 70392 } else { 70393 this._mode = RequestMode.Create; 70394 } 70395 } 70396 async hasAccess() { 70397 const api2 = new API(HTML$1.getApiConfiguration(this)); 70398 const result = await api2.get(`reservation-request-config/${this.config?.id}/has-access`); 70399 return result?.data?.has_access || false; 70400 } 70401 getCartProviderKey(id) { 70402 const _id = id || this._cartData?.id; 70403 if (!_id) return ""; 70404 return `reservation-request/${_id}`; 70405 } 70406 async initFormData(cartProvider) { 70407 const api2 = new API(HTML$1.getApiConfiguration(this)); 70408 const result = await api2.get(cartProvider); 70409 const cartData = result?.data; 70410 if (cartData && result.success) { 70411 dp(cartProvider).set(structuredClone(result)); 70412 dp(this.formKey).set(structuredClone(cartData)); 70413 } 70414 } 70415 render() { 70416 if (!this._mode) return b$1`<sonic-loader mode="inline"></sonic-loader>`; 70417 return b$1`${r(this._mode, [
70418 [RequestMode.Login, () => b$1`${this.renderLogin()}`], 70419 [RequestMode.Uninitialized, () => b$1`<sonic-loader mode="inline"></sonic-loader>`], 70420 [RequestMode.Create, () => b$1`${this.renderIntro()} ${this.renderForm()}`], 70421 [RequestMode.UpdateData, () => b$1`${this.renderIntro()} ${this.renderForm()}`], 70422 [RequestMode.Ending, () => b$1`${this.renderEndingMessage()}`], 70423 [RequestMode.Password, () => b$1`${this.renderPassword()}`], 70424 [RequestMode.Selection, () => b$1`${this.renderIntro()} ${this.renderSelection()}`], 70425 [RequestMode.NotAuthorized, () => b$1`${this.renderNotAuthorized()}`] 70426 ])} `; 70427 } 70428 updated(changedProperties) { 70429 if (changedProperties.has("_mode")) { 70430 const previousMode = changedProperties.get("_mode"); 70431 const hasPreviousMode = previousMode !== void 0 && previousMode !== RequestMode.Uninitialized; 70432 if (hasPreviousMode && previousMode !== this._mode && this._mode === RequestMode.Selection) { 70433 this.storeSelectionElement?.scrollIntoView({ behavior: "smooth" }); 70434 } 70435 } 70436 super.updated(changedProperties); 70437 } 70438 async updateOrCreateReservationRequest(mode2 = "update") { 70439 const api2 = new API(HTML$1.getApiConfiguration(this)); 70440 const formPublisher = dp(this.formKey); 70441 formPublisher.isFormValid.set(true); 70442 formPublisher.invalidateForm(); 70443 if (!formPublisher.isFormValid.get()) return; 70444 const formData = formPublisher.get(); 70445 const { title, publicNotes, passCulture } = formData || {}; 70446 const formDataToUpdate = { 70447 title, 70448 publicNotes, 70449 passCulture 70450 }; 70451 const customFormsData = formPublisher?.[CUSTOM_FORMS_KEY]?.get(); 70452 if (!formDataToUpdate && !customFormsData) return; 70453 if (mode2 === "create") { 70454 const result = await api2.post("reservation-request", { 70455 buyer: { 70456 uid: this.userId 70457 }, 70458 reservationRequestConfigId: Number(this.config?.id), 70459 ...formDataToUpdate, 70460 ...customFormsData ? { [CUSTOM_FORMS_KEY]: customFormsData } : {} 70461 }); 70462 if (result?.data && result.success) { 70463 const cartId = result.data.id; 70464 if (cartId) { 70465 this.cartProvider = this.getCartProviderKey(cartId); 70466 dp(this.cartProvider).set(structuredClone(result)); 70467 dp(this.formKey).set(structuredClone(result.data)); 70468 } 70469 this._mode = RequestMode.Selection; 70470 } 70471 } else { 70472 const result = await api2.patch(this.cartProvider, { 70473 ...formDataToUpdate, 70474 ...customFormsData ? { [CUSTOM_FORMS_KEY]: customFormsData } : {} 70475 }); 70476 if (result?.data && result.success) { 70477 Cart.updateCart(api2, this.cartProvider); 70478 this._mode = RequestMode.Selection; 70479 } 70480 } 70481 } 70482 renderNotAuthorized() { 70483 return b$1` <sonic-alert status="warning" label=${t("LIB_access_denied")} size="lg" background> 70484 <div>${t("LIB_access_denied_description_request")}</div> 70485 <sonic-button 70486 class="mt-1" 70487 size="sm" 70488 type="warning" 70489 variant="outline" 70490 @click=${() => this.deleteWithConfim(new API(HTML$1.getApiConfiguration(this)), this.cartProvider)} 70491 > 70492 <sonic-icon name="arrow-left" library="custom"></sonic-icon> 70493 ${t("back")}</sonic-button 70494 > 70495 </sonic-alert>`; 70496 } 70497 renderEndingMessage() { 70498 return b$1` <sonic-alert status="success" label=${t("LIB_request_created_message")} size="lg" background> 70499 <sonic-app-link to="home" type="success" variant="default" autoActive="disabled" class="mt-2"> 70500 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 70501 ${t("LIB_retour_accueil")} 70502 </sonic-app-link> 70503 <sonic-app-link 70504 to="account.reservationRequests" 70505 variant="outline" 70506 type="success" 70507 autoActive="disabled" 70508 class="mt-2" 70509 > 70510 <sonic-icon name="arrow-right" library="custom"></sonic-icon> 70511 ${t("LIB_mes_demandes")} 70512 </sonic-app-link> 70513 </sonic-alert>`; 70514 } 70515 renderPassword() { 70516 const endpoint = `reservation-request-config/${this.config?.id}/login`; 70517 const formDataProvider = `reservationRequestLogin/${this.config?.id}`; 70518 return b$1` <form formDataProvider=${formDataProvider} dataProvider=${formDataProvider}> 70519 <sonic-fieldset class="max-w-[25rem]"> 70520 <sonic-legend iconLibrary="custom" iconName="lock" label=${t("password")}></sonic-legend> 70521 <sonic-form-layout> 70522 <sonic-submit onEnterKey @submit=${this.handleSubmitPassWord} endpoint=${endpoint} method="post"> 70523 <sonic-form-layout> 70524 <sonic-input type="password" data-aria-label=${t("password")} name="password"></sonic-input> 70525 </sonic-form-layout> 70526 </sonic-submit> 70527 <sonic-form-actions> 70528 <sonic-submit onClick @submit=${this.handleSubmitPassWord} endpoint=${endpoint} method="post"> 70529 <sonic-button radio noAutoFill type="success"> 70530 <sonic-icon slot="prefix" name="check"></sonic-icon> 70531 ${t("confirm")} 70532 </sonic-button> 70533 </sonic-submit> 70534 </sonic-form-actions> 70535 </sonic-form-layout> 70536 </sonic-fieldset> 70537 </form>`; 70538 } 70539 handleSubmitPassWord(e2) { 70540 if (e2.detail.success) { 70541 if (this.userId) { 70542 this.initFromUserId(this.userId); 70543 } else { 70544 this._mode = RequestMode.Login; 70545 } 70546 } 70547 } 70548 renderIntro() { 70549 return b$1`<sonic-request-link-item 70550 class="mb-8" 70551 dataProvider="reservationRequestConfigs/${this.config?.id}" 70552 noAutoFill 70553 .props=${this.config} 70554 ?active=${true} 70555 > 70556 <sonic-button 70557 slot="actions" 70558 class="shrink-0 self-start" 70559 shape="circle" 70560 size="xl" 70561 type="danger" 70562 @click=${() => this.deleteWithConfim(new API(HTML$1.getApiConfiguration(this)), this.cartProvider)} 70563 > 70564 <sonic-icon library="custom" name="trash" color="currentColor"></sonic-icon> 70565 </sonic-button> 70566 </sonic-request-link-item>`; 70567 } 70568 renderLogin() { 70569 const isForPros = this.config?.access_restriction === "pros" || this.config?.access_restriction === "pros_types"; 70570 return b$1`<sonic-user-form-login 70571 class="mt-8 w-full" 70572 createSubTitle="${t("LIB_reservation_request_pas_de_compte_2")}" 70573 createAccount 70574 customerType=${isForPros ? "pros" : "all"} 70575 ></sonic-user-form-login>`; 70576 } 70577 renderCustomForms() { 70578 const customForms = this.config?.customForms; 70579 if (!customForms) return A$1; 70580 return b$1` 70581 ${c$1( 70582 customForms || [], 70583 (customForm) => customForm.id, 70584 (customForm) => b$1`<sonic-custom-form 70585 class="-mx-5" 70586 variant="ghost" 70587 .namePrefix=${CUSTOM_FORMS_KEY} 70588 .customForm=${customForm} 70589 ></sonic-custom-form> ` 70590 )} 70591 `; 70592 } 70593 renderForm() { 70594 const hasFileInCustomForms = this.config?.customForms?.some( 70595 (customForm) => customForm.inputs?.some((input) => input.type === InputType.File) 70596 ); 70597 return b$1` 70598 <sonic-fieldset class="shadow-lg" formDataProvider=${this.formKey} dataProvider=${this.formKey}> 70599 <div class="flex flex-col gap-6 mb-6"> 70600 ${this.config?.force_request_title ? b$1` 70601 <sonic-input type="hidden" name="title" value=${this.config?.default_request_title}> </sonic-input> 70602 ` : b$1` 70603 <sonic-input label="${this.config?.request_title_label}" type="text" name="title" required> 70604 ${requiredMark(true)} 70605 </sonic-input> 70606 `} 70607 ${this.config?.display_public_notes ? b$1` 70608 <sonic-textarea 70609 label="${t("LIB_precisions")}" 70610 rows="4" 70611 name="publicNotes" 70612 description="${t("LIB_indications_pmr_publiques_specifiques_financements")}" 70613 ></sonic-textarea> 70614 ` : A$1} 70615 ${this.config?.display_pass_culture ? b$1` 70616 <div class="flex items-center gap-x-3"> 70617 ${svgPassCulture({ color: "currentColor", width: 53, height: 53 })} 70618 <div class="border-l border-neutral-200 pl-3"> 70619 <div class="flex items-center gap-x-5 py-3 font-bold"> 70620 <sonic-checkbox unique value="true" name="passCulture.enabled" 70621 >${t("LIB_prise_en_charge_pass_culture")} 70622 </sonic-checkbox> 70623 </div> 70624 </div> 70625 </div> 70626 ` : A$1} 70627 ${this.renderCustomForms()} 70628 </div> 70629 ${hasFileInCustomForms ? b$1`<sonic-alert status="info" size="sm" class="mb-6 ">${t("LIB_rgpd_file_upload_warning")}</sonic-alert>` : A$1} 70630 <div class="flex gap-2 flex-col md:flex-row items-center"> 70631 ${this._mode === RequestMode.Create ? b$1`<sonic-button 70632 type="success" 70633 @click=${() => this.updateOrCreateReservationRequest("create")} 70634 minWidth="13rem" 70635 class="w-full md:w-auto" 70636 > 70637 <sonic-icon name="check" library="custom"></sonic-icon> ${t("LIB_commencer")} 70638 </sonic-button>` : b$1`<sonic-button 70639 type="success" 70640 @click=${() => this.updateOrCreateReservationRequest("update")} 70641 minWidth="13rem" 70642 class="w-full md:w-auto" 70643 > 70644 <sonic-icon name="check" library="custom"></sonic-icon> ${t("LIB_mettre_a_jour")} 70645 </sonic-button> 70646 <sonic-button variant="ghost" size="sm" @click=${() => this._mode = RequestMode.Selection}> 70647 ${t("cancel")} 70648 </sonic-button>`} 70649 </div> 70650 </sonic-fieldset> 70651 `; 70652 } 70653 renderSelection() { 70654 return b$1`<div class="relative"> 70655 ${renderFormData({ 70656 reservationRequest: this._cartData, 70657 reservationRequestConfig: this.config, 70658 displayLegends: true, 70659 displayTitle: true, 70660 collapsible: true 70661 })} 70662 <sonic-button 70663 icon 70664 shape="circle" 70665 @click=${() => this._mode = RequestMode.UpdateData} 70666 class="absolute top-4 right-4" 70667 > 70668 <sonic-icon name="pencil" library="custom"></sonic-icon 70669 ></sonic-button> 70670 </div> 70671 70672 <div class="text-xl lg:text-2xl font-bold mt-8 mb-4"> 70673 <sonic-icon name="square-check" library="custom"></sonic-icon> ${t( 70674 "LIB_selectionner_puis_confirmer_votre_demande" 70675 )} 70676 </div> 70677 <sonic-event-store-content 70678 id="storeSelection" 70679 displayCart 70680 formType="select" 70681 cartProvider=${this.cartProvider} 70682 class=" block" 70683 > 70684 </sonic-event-store-content>`; 70685 } 70686 }; 70687 SonicRequestEventForm.styles = [ 70688 tailwind, 70689 i$9` 70690 :host { 70691 display: block; 70692 } 70693 ` 70694 ]; 70695 __decorateClass$k([ 70696 bind$1("user.id"), 70697 n$5({ type: Number }) 70698 ], SonicRequestEventForm.prototype, "userId", 2); 70699 __decorateClass$k([ 70700 n$5({ type: Object }) 70701 ], SonicRequestEventForm.prototype, "config", 2); 70702 __decorateClass$k([ 70703 n$5({ type: String }) 70704 ], SonicRequestEventForm.prototype, "cartProvider", 2); 70705 __decorateClass$k([ 70706 bind$1("${cartProvider}.data"), 70707 r$5()
70708 ], SonicRequestEventForm.prototype, "_cartData", 2); 70709 __decorateClass$k([ 70710 n$5({ attribute: false }) 70711 ], SonicRequestEventForm.prototype, "testMode", 2); 70712 __decorateClass$k([ 70713 r$5() 70714 ], SonicRequestEventForm.prototype, "_mode", 2); 70715 __decorateClass$k([ 70716 e$7("#storeSelection") 70717 ], SonicRequestEventForm.prototype, "storeSelectionElement", 2); 70718 SonicRequestEventForm = __decorateClass$k([ 70719 t$3(tagName$c) 70720 ], SonicRequestEventForm); 70721 var __defProp$h = Object.defineProperty; 70722 var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor; 70723 var __decorateClass$j = (decorators, target, key, kind) => { 70724 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target; 70725 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70726 if (decorator = decorators[i2]) 70727 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70728 if (kind && result) __defProp$h(target, key, result); 70729 return result; 70730 }; 70731 const tagName$b = "sonic-reservation-request"; 70732 const RESERVATION_REQUEST_CONFIGS_DP_KEY = "reservationRequestConfigs"; 70733 let SonicReservationRequest = class extends i$6 { 70734 constructor() { 70735 super(...arguments); 70736 this.displayTitle = false; 70737 this.displayText = false; 70738 this.smallTitle = false; 70739 this._selectedConfig = null; 70740 this._testMode = false; 70741 } 70742 firstUpdated() { 70743 this.initFromUrl(); 70744 } 70745 async initFromUrl() { 70746 const accessParams = getAccessParamsFromUrl(); 70747 const configIdFromRoute = appRoute("reservationRequest").extract()?.id; 70748 const { reservationRequestConfigId, reservationRequestConfigHash } = accessParams; 70749 const hasHash = !!reservationRequestConfigHash; 70750 let hashOrParam = reservationRequestConfigHash || configIdFromRoute || reservationRequestConfigId; 70751 this._testMode = !!reservationRequestConfigHash?.startsWith("test_"); 70752 if (hashOrParam) { 70753 const api2 = new API(HTML.getApiConfiguration(this)); 70754 const config = await api2.get(`reservation-request-config/${hashOrParam}`); 70755 if (config?.data && config.success) { 70756 dp("user").invalidate(); 70757 this._selectedConfig = config.data; 70758 this.accessParams = { 70759 ...this.accessParams, 70760 reservationRequestConfigHash: reservationRequestConfigHash || void 0, 70761 reservationRequestConfigId: Number(configIdFromRoute || reservationRequestConfigId) || void 0 70762 }; 70763 if (hasHash) { 70764 this._selectedConfig = config.data; 70765 } 70766 } 70767 } 70768 } 70769 async willUpdate(changedProperties) { 70770 if (changedProperties.has("userId")) { 70771 dp(RESERVATION_REQUEST_CONFIGS_DP_KEY).invalidate(); 70772 } 70773 super.willUpdate(changedProperties); 70774 } 70775 selectReservationRequestConfig(requestConfig) { 70776 this._selectedConfig = requestConfig; 70777 this.accessParams = { 70778 ...this.accessParams, 70779 reservationRequestConfigId: Number(requestConfig.id) 70780 }; 70781 } 70782 resetSelectedConfig() { 70783 this._selectedConfig = null; 70784 this.accessParams = void 0; 70785 } 70786 render() { 70787 return b$1`<sonic-page-layout 70788 pageTitle="${t("LIB_reservation_request_title")}" 70789 pageText="${t("LIB_reservation_request_text")}" 70790 ?smallTitle=${this.smallTitle} 70791 ?displayTitle=${this.displayTitle} 70792 ?displayText=${this.displayText} 70793 > 70794 ${this.renderPageContent()} 70795 </sonic-page-layout>`; 70796 } 70797 renderPageContent() { 70798 if (this._selectedConfig) { 70799 return this.renderForm(); 70800 } else { 70801 return this.renderMenu(); 70802 } 70803 } 70804 renderForm() { 70805 return b$1`<sonic-request-event-form 70806 @deleted=${() => this.resetSelectedConfig()} 70807 .config=${this._selectedConfig} 70808 .testMode=${this._testMode} 70809 ></sonic-request-event-form>`; 70810 } 70811 renderMenu() { 70812 return b$1` 70813 <sonic-list 70814 class=" block" 70815 fetch 70816 dataProvider=${RESERVATION_REQUEST_CONFIGS_DP_KEY} 70817 endPoint="reservation-request-config" 70818 key="data" 70819 .items=${(item) => b$1`<sonic-request-link-item 70820 @click=${() => this.selectReservationRequestConfig(item)} 70821 ></sonic-request-link-item>`} 70822 .noItems=${() => b$1`<sonic-no-result></sonic-no-result>`} 70823 > 70824 </sonic-list> 70825 `; 70826 } 70827 }; 70828 SonicReservationRequest.styles = [ 70829 tailwind, 70830 i$9` 70831 :host { 70832 display: block; 70833 --page-max-width: 65rem; 70834 } 70835 ` 70836 ]; 70837 __decorateClass$j([ 70838 n$5({ type: Boolean }) 70839 ], SonicReservationRequest.prototype, "displayTitle", 2); 70840 __decorateClass$j([ 70841 n$5({ type: Boolean }) 70842 ], SonicReservationRequest.prototype, "displayText", 2); 70843 __decorateClass$j([ 70844 n$5({ type: Boolean }) 70845 ], SonicReservationRequest.prototype, "smallTitle", 2); 70846 __decorateClass$j([ 70847 r$5() 70848 ], SonicReservationRequest.prototype, "_selectedConfig", 2); 70849 __decorateClass$j([ 70850 r$5() 70851 ], SonicReservationRequest.prototype, "_testMode", 2); 70852 __decorateClass$j([ 70853 e$2({ context: accessParamsContext }), 70854 n$5({ type: Object }) 70855 ], SonicReservationRequest.prototype, "accessParams", 2); 70856 SonicReservationRequest = __decorateClass$j([ 70857 t$3(tagName$b) 70858 ], SonicReservationRequest); 70859 var __defProp$g = Object.defineProperty; 70860 var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor; 70861 var __decorateClass$i = (decorators, target, key, kind) => { 70862 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target; 70863 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 70864 if (decorator = decorators[i2]) 70865 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 70866 if (kind && result) __defProp$g(target, key, result); 70867 return result; 70868 }; 70869 let UserAccount$2 = class UserAccount extends i$6 { 70870 constructor() { 70871 super(...arguments); 70872 this.modules = {}; 70873 this._hasAccountRequest = false;
70874 this._hasReservation = false; 70875 this._hasWaitingList = false; 70876 } 70877 async willUpdate(_changedProperties) { 70878 if (_changedProperties.has("userId")) { 70879 const userRequests = await getUserCarts(this, { 70880 cartType: CartType.ReservationRequest, 70881 userId: Number(this.userId), 70882 limit: 1 70883 }); 70884 this._hasAccountRequest = userRequests.length > 0; 70885 const userWaitingLists = await getUserCarts(this, { 70886 cartType: CartType.WaitingLists, 70887 userId: Number(this.userId), 70888 limit: 1 70889 }); 70890 this._hasWaitingList = userWaitingLists.length > 0; 70891 const reservations = await getUserCarts(this, { 70892 cartType: CartType.Reservation, 70893 userId: Number(this.userId), 70894 limit: 1, 70895 statuses: [ 70896 ReservationStatus.Pending, 70897 ReservationStatus.Confirmed, 70898 ReservationStatus.Processing, 70899 ReservationStatus.PartiallyProcessed 70900 ] 70901 }); 70902 this._hasReservation = reservations.length > 0; 70903 } 70904 super.willUpdate(_changedProperties); 70905 } 70906 render() { 70907 const currentHash = window.location.hash; 70908 if (currentHash === "") { 70909 window.location.hash = appRoute("account.home").toString(); 70910 } 70911 return b$1` 70912 <sonic-menu scrollable direction="row" gap=".5rem"> 70913 <sonic-menu-item size="xl" variant="default" type="default" shape="circle" href=${appRoute("account.home")}> 70914 <sonic-icon library="custom" name="house"> </sonic-icon> 70915 </sonic-menu-item> 70916 <sonic-menu-item 70917 icon 70918 autoActive="strict" 70919 size="xl" 70920 variant="default" 70921 type="default" 70922 shape="circle" 70923 href=${appRoute("account.tickets")} 70924 > 70925 <sonic-icon library="custom" name="ticket"> </sonic-icon> 70926 </sonic-menu-item> 70927 <sonic-menu-item 70928 icon 70929 autoActive="strict" 70930 size="xl" 70931 variant="default" 70932 type="default" 70933 shape="circle" 70934 href=${appRoute("account.purchases")} 70935 > 70936 <sonic-icon library="custom" name="clock-rotate-left"> </sonic-icon> 70937 </sonic-menu-item> 70938 70939 ${this._hasWaitingList ? b$1` 70940 <sonic-menu-item 70941 icon 70942 autoActive="strict" 70943 size="xl" 70944 variant="default" 70945 type="default" 70946 shape="circle" 70947 href=${appRoute("account.waitingLists")} 70948 > 70949 <sonic-icon library="custom" name="list-ol"> </sonic-icon> 70950 </sonic-menu-item> 70951 ` : A$1} 70952 ${this._hasReservation ? b$1` 70953 <sonic-menu-item 70954 icon 70955 class="relative" 70956 autoActive="strict" 70957 size="xl" 70958 variant="default" 70959 type="default" 70960 shape="circle" 70961 href=${appRoute("account.reservations")} 70962 > 70963 <sonic-badge 70964 class="absolute -top-[3px] -left-[3px] animate-heartbeat" 70965 type="danger" 70966 size="2xs" 70967 ></sonic-badge> 70968 <sonic-icon library="custom" name="badge-check"> </sonic-icon> 70969 </sonic-menu-item> 70970 ` : A$1} 70971 ${this.modules?.reservationRequest?.access && this._hasAccountRequest ? b$1` 70972 <sonic-menu-item 70973 icon 70974 autoActive="strict" 70975 size="xl" 70976 variant="default" 70977 type="default" 70978 shape="circle" 70979 href=${appRoute("account.reservationRequests")} 70980 > 70981 <sonic-icon library="custom" name="file-heart"> </sonic-icon> 70982 </sonic-menu-item> 70983 ` : A$1} 70984 ${this.modules?.carpooling?.access ? b$1` 70985 <sonic-menu-item 70986 icon 70987 autoActive="strict" 70988 size="xl" 70989 variant="default" 70990 type="default" 70991 shape="circle" 70992 href=${appRoute("account.trips")} 70993 > 70994 <sonic-icon library="custom" name="car-side"> </sonic-icon> 70995 </sonic-menu-item> 70996 ` : A$1} 70997 <sonic-menu-item 70998 icon 70999 autoActive="strict" 71000 size="xl" 71001 variant="default" 71002 type="default" 71003 shape="circle" 71004 href=${appRoute("account.edit")} 71005 > 71006 <sonic-icon library="custom" name="pen"> </sonic-icon> 71007 </sonic-menu-item> 71008 <sonic-menu-item 71009 icon 71010 autoActive="strict" 71011 size="xl" 71012 variant="default" 71013 type="default" 71014 shape="circle" 71015 href=${appRoute("account.editPassword")} 71016 > 71017 <sonic-icon library="custom" name="lock"> </sonic-icon> 71018 </sonic-menu-item>
71019 <sonic-divider vertical class="hidden md:block"></sonic-divider> 71020 <sonic-menu-item 71021 icon 71022 autoActive="strict" 71023 size="xl" 71024 variant="default" 71025 type="default" 71026 @click=${() => logout(this)} 71027 shape="circle" 71028 > 71029 <sonic-icon library="custom" name="power-off"> </sonic-icon> 71030 </sonic-menu-item> 71031 </sonic-menu> 71032 `; 71033 } 71034 }; 71035 UserAccount$2.styles = [tailwind]; 71036 __decorateClass$i([ 71037 bind$1("settings.modules"), 71038 n$5({ type: Object }) 71039 ], UserAccount$2.prototype, "modules", 2); 71040 __decorateClass$i([ 71041 bind$1("user.id"), 71042 n$5({ type: String }) 71043 ], UserAccount$2.prototype, "userId", 2); 71044 __decorateClass$i([ 71045 r$5() 71046 ], UserAccount$2.prototype, "_hasAccountRequest", 2); 71047 __decorateClass$i([ 71048 r$5() 71049 ], UserAccount$2.prototype, "_hasReservation", 2); 71050 __decorateClass$i([ 71051 r$5() 71052 ], UserAccount$2.prototype, "_hasWaitingList", 2); 71053 UserAccount$2 = __decorateClass$i([ 71054 t$3("sonic-user-account-menu") 71055 ], UserAccount$2); 71056 var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor; 71057 var __decorateClass$h = (decorators, target, key, kind) => { 71058 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target; 71059 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71060 if (decorator = decorators[i2]) 71061 result = decorator(result) || result; 71062 return result; 71063 }; 71064 let GiftcardAd = class extends i$6 { 71065 render() { 71066 return b$1` 71067 <sonic-alert 71068 noIcon 71069 status="success" 71070 class="mb-3 relative overflow-hidden min-h-[5rem]" 71071 dismissible 71072 dismissForever 71073 id="ad-alert" 71074 > 71075 <div class="grid grid-cols-1 gap-1 mb-3 max-w-[50ch] "> 71076 <div class="text-xl font-bold leading-tight">${t("module_giftcards_title")}</div> 71077 <div>${o$4(t("module_giftcards_summary"))}</div> 71078 </div> 71079 <sonic-app-link to="giftcards" variant="outline" type="success" size="sm"> 71080 <sonic-icon library="custom" name="arrow-right" slot="prefix"></sonic-icon> 71081 ${t("link_title_more_about")} 71082 </sonic-app-link> 71083 <div class="absolute -bottom-2 -right-2 opacity-30 "> 71084 <svg xmlns="http://www.w3.org/2000/svg" class="h-20 w-auto" viewB
71084ox="0 0 640 512"> 71085 <!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --> 71086 <path 71087 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" 71088 fill="currentColor" 71089 /> 71090 </svg> 71091 </div> 71092 </sonic-alert> 71093 `; 71094 } 71095 }; 71096 GiftcardAd.styles = [tailwind]; 71097 GiftcardAd = __decorateClass$h([ 71098 t$3("sonic-giftcard-ad") 71099 ], GiftcardAd); 71100 var __defProp$f = Object.defineProperty; 71101 var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor; 71102 var __decorateClass$g = (decorators, target, key, kind) => { 71103 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target; 71104 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71105 if (decorator = decorators[i2]) 71106 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71107 if (kind && result) __defProp$f(target, key, result); 71108 return result; 71109 }; 71110 const tagName$a = "sonic-giftcard-link"; 71111 let SonicComponent = class extends Subscriber$1(i$6) { 71112 constructor() { 71113 super(...arguments); 71114 this.tight = false; 71115 } 71116 handleSubmit(e2) { 71117 if (e2.detail.success) { 71118 this.dispatchEvent(new CustomEvent("linked")); 71119 } 71120 } 71121 render() { 71122 if (!this.hasGiftcards) return A$1; 71123 return b$1` <sonic-fieldset 71124 formDataProvider="giftcard" 71125 submitResultDataProvider="defaultMessages" 71126 endPoint="/giftcards/link" 71127 dataProvider="giftcards/link" 71128 formDataProvider="giftcardsLink" 71129 ?tight=${this.tight} 71130 > 71131 <sonic-legend iconlibrary="custom" iconname="gift-card" label="${t("I_have_a_gift_card")}"></sonic-legend> 71132 <div class="mb-3 flex items-end gap-3"> 71133 <sonic-submit @submit=${this.handleSubmit} method="POST" onEnterkey> 71134 <sonic-input name="code" label="${t("Enter_your_gift_card_code")}" placeholder="- - - - - -"></sonic-input> 71135 </sonic-submit> 71136 <sonic-submit @submit=${this.handleSubmit} method="POST" onClick> 71137 <sonic-button type="primary" class="whitespace-nowrap"> 71138 <sonic-icon library="custom" name="link" slot="prefix"></sonic-icon> 71139 <span class="hidden lg:block"> ${t("LIB_giftcard_relier")} </span> 71140 <span class="block lg:hidden"> ${t("LIB_giftcard_relier_mobile")} </span> 71141 </sonic-button> 71142 </sonic-submit> 71143 </div> 71144 </sonic-fieldset>`; 71145 } 71146 }; 71147 SonicComponent.styles = [tailwind]; 71148 __decorateClass$g([ 71149 n$5({ type: Boolean }) 71150 ], SonicComponent.prototype, "tight", 2); 71151 __decorateClass$g([ 71152 bind$1("settings.modules.giftcards.enabled"), 71153 n$5({ type: Boolean }) 71154 ], SonicComponent.prototype, "hasGiftcards", 2); 71155 SonicComponent = __decorateClass$g([ 71156 t$3(tagName$a) 71157 ], SonicComponent); 71158 var __decorate = function(decorators, target, key, desc) { 71159 var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; 71160 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); 71161 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; 71162 return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; 71163 }; 71164 const tagName$9 = "sonic-t"; 71165 let SonicT = class SonicT extends i$6 { 71166 render() { 71167 if (!this.key) 71168 return A$1; 71169 return b$1`${t(this.key, this.unsafeHTML)}`; 71170 } 71171 }; 71172 __decorate([ 71173 n$5({ type: String }) 71174 ], SonicT.prototype, "key", void 0); 71175 __decorate([ 71176 n$5({ type: Boolean }) 71177 ], SonicT.prototype, "unsafeHTML", void 0); 71178 SonicT = __decorate([ 71179 t$3(tagName$9) 71180 ], SonicT); 71181 var __defProp$e = Object.defineProperty; 71182 var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor; 71183 var __decorateClass$f = (decorators, target, key, kind) => { 71184 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target; 71185 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71186 if (decorator = decorators[i2]) 71187 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71188 if (kind && result) __defProp$e(target, key, result); 71189 return result; 71190 }; 71191 const tagName$8 = "sonic-account-my-giftcards"; 71192 let SonicAccountMyGiftcards = class extends Fetcher$1(Subscriber$1(i$6)) { 71193 constructor() { 71194 super(...arguments); 71195 this.tight = false;
71196 this.data = null; 71197 this.dataProvider = "my-giftcards"; 71198 } 71199 connectedCallback() { 71200 this.isFetchEnabled = false; 71201 super.connectedCallback(); 71202 } 71203 getEndPoint() { 71204 if (!this.userId) return ""; 71205 return `/user/${this.userId}/purchases/giftcard?owner=${this.userId}&available=true`; 71206 } 71207 willUpdate(changedProperties) { 71208 if (changedProperties.has("userId") && this.userId) { 71209 this.endPoint = this.getEndPoint(); 71210 this.isFetchEnabled = true; 71211 this._fetchData(); 71212 } 71213 super.willUpdate(changedProperties); 71214 } 71215 render() { 71216 if (!this.data || this.data.length == 0) return A$1; 71217 return b$1`<sonic-fieldset ?tight=${this.tight}> 71218 <sonic-legend iconlibrary="custom" iconName="gift-card" label="${t("LIB_cartes_cadeaux")}"></sonic-legend> 71219 <sonic-list subDataProvider="data" class="grid grid-cols-1 gap-y-3"> 71220 <template> 71221 <sonic-purchase-summary></sonic-purchase-summary> 71222 </template> 71223 </sonic-list> 71224 </sonic-fieldset>`; 71225 } 71226 }; 71227 SonicAccountMyGiftcards.styles = [tailwind]; 71228 __decorateClass$f([ 71229 n$5({ type: Boolean }) 71230 ], SonicAccountMyGiftcards.prototype, "tight", 2); 71231 __decorateClass$f([ 71232 bind$1("user.id"), 71233 n$5({ type: Number }) 71234 ], SonicAccountMyGiftcards.prototype, "userId", 2); 71235 __decorateClass$f([ 71236 n$5({ type: Array }) 71237 ], SonicAccountMyGiftcards.prototype, "data", 2); 71238 SonicAccountMyGiftcards = __decorateClass$f([ 71239 t$3(tagName$8) 71240 ], SonicAccountMyGiftcards); 71241 var __defProp$d = Object.defineProperty; 71242 var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor; 71243 var __decorateClass$e = (decorators, target, key, kind) => { 71244 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target; 71245 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71246 if (decorator = decorators[i2]) 71247 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71248 if (kind && result) __defProp$d(target, key, result); 71249 return result; 71250 }; 71251 let UserFormEdit = class extends Subscriber$1(i$6) { 71252 constructor() { 71253 super(...arguments); 71254 this.accessAskProAccount = false; 71255 } 71256 render() { 71257 return b$1` 71258 <sonic-page-header label="${t("mes_informations")}"> 71259 ${this.isPro === true && this.accessAskProAccount ? b$1` <sonic-menu-item @click=${updateProAccountModal} slot="more"> 71260 <sonic-icon slot="prefix" library="custom" name="link"></sonic-icon> 71261 ${t("LIB_formulaire_pro_actualiser")}</sonic-menu-item 71262 >` : A$1} 71263 </sonic-page-header> 71264 <sonic-iframe src="/mon-compte/mes-informations?no_title=true&no_navigation=true"></sonic-iframe> 71265 `; 71266 } 71267 }; 71268 __decorateClass$e([ 71269 bind$1("user.is_pro"), 71270 n$5({ type: Boolean }) 71271 ], UserFormEdit.prototype, "isPro", 2); 71272 __decorateClass$e([ 71273 bind$1("settings.modules.ask_pro_account.access"), 71274 r$5() 71275 ], UserFormEdit.prototype, "accessAskProAccount", 2); 71276 UserFormEdit = __decorateClass$e([ 71277 t$3("sonic-user-form-edit") 71278 ], UserFormEdit); 71279 const updateProAccountModal = () => { 71280 Modal.create({ 71281 content: ( 71282 /*html*/ 71283 `<sonic-ask-pro-account updateAccount smallTitle displayTitle displayText ></sonic-ask-pro-account>` 71284 ), 71285 width: "45rem", 71286 removeOnHide: true 71287 }); 71288 }; 71289 var __defProp$c = Object.defineProperty; 71290 var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor; 71291 var __decorateClass$d = (decorators, target, key, kind) => { 71292 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target; 71293 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71294 if (decorator = decorators[i2]) 71295 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71296 if (kind && result) __defProp$c(target, key, result); 71297 return result; 71298 }; 71299 const tagName$7 = "sonic-user-account-home"; 71300 let UserAccount$1 = class UserAccount extends i$6 { 71301 constructor() { 71302 super(...arguments); 71303 this.balance = 0; 71304 this._resizeController = new h$1(this, {}); 71305 this._canUseCredit = false;
71306 } 71307 willUpdate(changedProperties) { 71308 if (changedProperties.has("currentUser") || changedProperties.has("creditAccess")) { 71309 this._canUseCredit = checkCanUseCredit(this.currentUser?.proAccess, this.creditAccess); 71310 } 71311 super.willUpdate(changedProperties); 71312 } 71313 render() { 71314 const todayMinus6hours = /* @__PURE__ */ new Date(); 71315 todayMinus6hours.setHours(todayMinus6hours.getHours() - 6); 71316 const fromDate = Math.floor(todayMinus6hours.getTime() / 1e3); 71317 const isSmall = this.clientWidth < 500; 71318 const userId = this.currentUser?.id; 71319 const subscriptionIsEnabled = this.settings?.modules?.subscription?.enabled; 71320 const accessGiftcard = this.settings?.modules?.giftcards?.access; 71321 const accessAskProAccount = this.settings?.modules?.ask_pro_account?.access; 71322 const displayRenewSubscriptionMessage = accessAskProAccount && this.currentUser?.can_renew && this.currentUser?.is_pro; 71323 const oneYearAgo = /* @__PURE__ */ new Date(); 71324 oneYearAgo.setFullYear(oneYearAgo.getFullYear() - 1); 71325 const oneYearAgoTimestamp = Math.floor(oneYearAgo.getTime() / 1e3); 71326 const userBalance = this.currentUser?.balance ?? 0; 71327 let messageType; 71328 if (displayRenewSubscriptionMessage && this.currentUser?.proAccess == "disabled") { 71329 messageType = "renew"; 71330 } else if (displayRenewSubscriptionMessage && this.currentUser?.proAccess == "pending") { 71331 messageType = "pending"; 71332 } 71333 if (!userId) return A$1; 71334 return b$1` 71335 <div class="mb-6"> 71336 <div class="text-4xl font-bold">${t("bonjour")} ${this.currentUser?.firstName}</div> 71337 ${this.renderSubTitle()} 71338 </div> 71339 71340 <!--Message de renouvellement d'abonnement--> 71341 ${messageType == "renew" ? b$1` <sonic-alert background status="error" label=${t("LIB_pro_access_disabled")}> 71342 <sonic-button 71343 align="left" 71344 type="danger" 71345 @click=${updateProAccountModal} 71346 size="sm" 71347 class="mt-1" 71348 variant="outline" 71349 > 71350 <sonic-icon slot="prefix" library="custom" name="arrow-right"></sonic-icon>${t( 71351 "LIB_formulaire_pro_actualiser" 71352 )}</sonic-button 71353 ></sonic-alert 71354 >` : A$1} 71355 ${messageType == "pending" ? b$1` <sonic-alert background status="success" label=${t("LIB_pro_access_pending")}> 71356 <p>${t("LIB_pro_access_pending_text")}</p> 71357 <sonic-button 71358 align="left" 71359 type="success" 71360 @click=${updateProAccountModal} 71361 size="sm" 71362 class="mt-3" 71363 variant="outline" 71364 > 71365 <sonic-icon slot="prefix" library="custom" name="arrow-right"></sonic-icon>${t( 71366 "LIB_pro_access_new_request" 71367 )}</sonic-button 71368 ></sonic-alert 71369 >` : A$1} 71370 ${accessGiftcard ? b$1` <sonic-giftcard-ad class="block mb-3"></sonic-giftcard-ad> ` : A$1} 71371 ${userBalance > 0 ? b$1` 71372 <sonic-alert status="info" class="mb-3" background> 71373 <strong>
71373${formatAmount(this.balance)} ${t("available_as_a_credit")}</strong><br /> 71374 ${this._canUseCredit ? b$1`${t("balance_use_info_text_enabled_online")}` : b$1`${t("balance_use_info_text_new")}`} 71375 </sonic-alert> 71376 ` : A$1} 71377 71378 <sonic-fetch 71379 dataProvider="accountHomeTickets" 71380 key="data" 71381 endpoint="/user/${userId}/purchases/event?limit=4&next=1&sort=start_date:asc&event_from=${fromDate}&owner=${userId}" 71382 ></sonic-fetch> 71383 ${this.accountHomeTickets?.length ? b$1` 71384 <sonic-fieldset ?tight=${isSmall}> 71385 ${this.accountHomeTickets?.length ? b$1`<sonic-legend 71386 iconlibrary="custom" 71387 iconName="forward" 71388 label="${t("coming_soon")}" 71389 ></sonic-legend>` : A$1} 71390 <sonic-list dataProvider="accountHomeTickets" class="grid grid-cols-1 gap-3"> 71391 <template> 71392 <sonic-purchase-summary></sonic-purchase-summary> 71393 </template> 71394 <template data-value="skeleton"> 71395 <sonic-purchase-summary skeleton></sonic-purchase-summary> 71396 </template> 71397 </sonic-list> 71398 <sonic-app-link to="account.tickets" size="sm" variant="default" class="mt-3 w-full"> 71399 <sonic-icon library="custom" name="arrow-right"></sonic-icon> 71400 <sonic-t key="tous_mes_billets"></sonic-t> 71401 </sonic-app-link> 71402 </sonic-fieldset> 71403 ` : this.agendaCard()} 71404 71405 <sonic-fetch 71406 endpoint="/user/${userId}/purchases/subscribe?owner=${userId}&valid_from=${oneYearAgoTimestamp}" 71407 dataProvider="accountHomeSubscriptions" 71408 key="data" 71409 ></sonic-fetch> 71410 ${subscriptionIsEnabled && this.accountHomeSubscriptions?.length ? b$1` 71411 <sonic-fieldset ?tight=${isSmall}> 71412 <sonic-legend iconlibrary="custom" iconName="id-card" label="${t("abonnements")}"></sonic-legend> 71413 <sonic-list dataProvider="accountHomeSubscriptions" class="grid grid-cols-1 gap-3"> 71414 <template> 71415 <sonic-purchase-summary></sonic-purchase-summary> 71416 </template> 71417 <template data-value="skeleton"> 71418 <sonic-purchase-summary skeleton></sonic-purchase-summary> 71419 </template> 71420 </sonic-list> 71421 <sonic-app-link 71422 to="subscription" 71423 size="${this.accountHomeSubscriptions?.length ? "sm" : "2xl"}" 71424 variant="default" 71425 class="w-full ${this.accountHomeSubscriptions?.length ? "mt-3" : ""}" 71426 > 71427 <sonic-icon library="custom" name="arrow-right"></sonic-icon> 71428 <sonic-t key="onglet_home_abonnements"></sonic-t> 71429 </sonic-app-link> 71430 </sonic-fieldset> 71431 ` : A$1} 71432 ${!this.accountHomeSubscriptions?.length ? this.subscriptionCard() : A$1} 71433 71434 <sonic-account-my-giftcards id=${userId} ?tight=${isSmall}></sonic-account-my-giftcards> 71435 <sonic-giftcard-link ?tight=${isSmall} @linked=${() => dp("my-giftcards").invalidate()}></sonic-giftcard-link> 71436 `; 71437 } 71438 agendaCard() { 71439 const agendaAccess = this.settings?.modules?.agenda?.access; 71440 return agendaAccess ? b$1`<div class="block mb-6"> 71441 <sonic-quick-access-card 71442 type="default" 71443 href=${appRoute("agenda")} 71444 title=${t("module_agenda_title")} 71445 text=${o$4(t("module_agenda_summary"))} 71446 icon="calendar-day" 71447 ></sonic-quick-access-card> 71448 </div>` : A$1; 71449 } 71450 subscriptionCard() { 71451 const subscriptionAccess = this.settings?.modules?.subscription?.access; 71452 return subscriptionAccess ? b$1`<div class="block mb-6"> 71453 <sonic-quick-access-card 71454 type="warning" 71455 href=${appRoute("subscription")} 71456 title=${t("onglet_home_abonnements")} 71457 text=${o$4(t("module_subscription_summary"))} 71458 icon="address-card" 71459 ></sonic-quick-access-card> 71460 </div>` : A$1; 71461 } 71462 renderSubTitle() { 71463 const is_pro = this.currentUser?.is_pro; 71464 const createdAt = Number(this.currentUser?.created_at); 71465 const createdDate = new Date(createdAt * 1e3 || 0); 71466 const createdDateWasToday = createdDate.toDateString() === (/* @__PURE__ */ new Date()).toDateString(); 71467 if (is_pro) return A$1; 71468 return b$1`<div class="text-xl mt-1"> 71469 ${createdDateWasToday ? b$1`${t("LIB_account_welcome_message")} ð ` : b$1`${t("ravi_de_vous_revoir")} âï¸`} 71470 </div>`; 71471 } 71472 }; 71473 UserAccount$1.styles = [tailwind]; 71474 __decorateClass$d([ 71475 bind$1("user"), 71476 n$5({ type: Object }) 71477 ], UserAccount$1.prototype, "currentUser", 2); 71478 __decorateClass$d([ 71479 bind$1("user.balance"), 71480 n$5({ type: Number }) 71481 ], UserAccount$1.prototype, "balance", 2); 71482 __decorateClass$d([ 71483 bind$1("accountHomeTickets"), 71484 r$5() 71485 ], UserAccount$1.prototype, "accountHomeTickets", 2); 71486 __decorateClass$d([ 71487 bind$1("accountHomeSubscriptions"), 71488 r$5() 71489 ], UserAccount$1.prototype, "accountHomeSubscriptions", 2); 71490 __decorateClass$d([ 71491 bind$1("settings"), 71492 n$5({ type: Object }) 71493 ], UserAccount$1.prototype, "settings", 2); 71494 __decorateClass$d([ 71495 bind$1("settings.credit"), 71496 n$5({ type: Object }) 71497 ], UserAccount$1.prototype, "creditAccess", 2); 71498 __decorateClass$d([ 71499 r$5()
71500 ], UserAccount$1.prototype, "_canUseCredit", 2); 71501 UserAccount$1 = __decorateClass$d([ 71502 t$3(tagName$7) 71503 ], UserAccount$1); 71504 var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor; 71505 var __decorateClass$c = (decorators, target, key, kind) => { 71506 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target; 71507 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71508 if (decorator = decorators[i2]) 71509 result = decorator(result) || result; 71510 return result; 71511 }; 71512 const tagName$6 = "sonic-account-carpooling"; 71513 let SonicPagePromo = class extends CovoitLoad(i$6) { 71514 render() { 71515 const covoitURL = this.carpoolingSettings?.url; 71516 const token = this.carpoolingSettings?.token || ""; 71517 if (!covoitURL) return A$1; 71518 return b$1` 71519 <sonic-page-header label="${t("my_trips")}"></sonic-page-header> 71520 71521 <covoit-app 71522 covoitURL=${covoitURL} 71523 baseURL=${appRoute("carpooling")} 71524 token=${o$4(token)} 71525 encryptedUid=${o$4(this.encryptedUid)} 71526 customRoutes=${JSON.stringify(this.customRoutes)} 71527 view="myTrips" 71528 ></covoit-app> 71529 `; 71530 } 71531 }; 71532 SonicPagePromo.styles = [tailwind]; 71533 SonicPagePromo = __decorateClass$c([ 71534 t$3(tagName$6) 71535 ], SonicPagePromo); 71536 var __defProp$b = Object.defineProperty; 71537 var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor; 71538 var __decorateClass$b = (decorators, target, key, kind) => { 71539 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target; 71540 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71541 if (decorator = decorators[i2]) 71542 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71543 if (kind && result) __defProp$b(target, key, result); 71544 return result; 71545 }; 71546 let SonicCartItemsCondensed = class extends Subscriber$1(i$6) { 71547 constructor() { 71548 super(...arguments); 71549 this.items = null; 71550 this.entities = null; 71551 this.groupedItems = null; 71552 this.total = 0; 71553 this.productsWithQuantity = []; 71554 this.mode = "default"; 71555 } 71556 willUpdate(changedProperties) { 71557 super.willUpdate(changedProperties); 71558 if (changedProperties.has("items") || changedProperties.has("entities")) { 71559 if (this.items && this.entities) { 71560 this.total = this.items.reduce((acc, item) => acc + (item.price?.amount || 0), 0); 71561 const productMap = /* @__PURE__ */ new Map(); 71562 this.entities.forEach((entity) => { 71563 const key = entity.id; 71564 const items = this.items?.filter((item) => item.entity_id === entity.id) || []; 71565 const messages2 = items.flatMap((item) => item.messages || []); 71566 const uniqueMessagesMap = /* @__PURE__ */ new Map(); 71567 for (const message of messages2) { 71568 uniqueMessagesMap.set(message.content, message); 71569 } 71570 const uniqueMessagesByContent = Array.from(uniqueMessagesMap.values()); 71571 if (items.length > 0) { 71572 productMap.set(key, { 71573 entity, 71574 quantity: items.reduce((acc, item) => acc + (item.quantity || 0), 0), 71575 total: items.reduce((acc, item) => acc + (item.price?.amount || 0), 0), 71576 messages: uniqueMessagesByContent 71577 }); 71578 } 71579 }); 71580 this.productsWithQuantity = Array.from(productMap.values()); 71581 } 71582 } 71583 } 71584 render() { 71585 if (!this.productsWithQuantity?.length) { 71586 const status = this.props && "status" in this.props ? this.props?.status : void 0; 71587 return b$1`<sonic-cart-empty 71588 .status="${status}" 71589 .cartType="${this.props?.cartType}" 71590 .mode="${this.mode}" 71591 class="text-neutral-400 text-base " 71592 ></sonic-cart-empty>`; 71593 } 71594 return b$1`<div class="flex items-center mb-2"> 71595 <sonic-cart-summary class="font-medium text-sm block grow"></sonic-cart-summary> 71596 <div class="font-bold text-base ml-auto text-nowrap leading-none"> 71597 Total : ${this.total ? formatAmount(this.total) : "gratuit"} 71598 </div> 71599 </div> 71600 <div class="mb-[2px] w-full border-t border-t-neutral-200"></div> 71601 ${o$1(this.productsWithQuantity, (product, index) => { 71602 let icon2 = iconFromEntityType(product.entity?.entity_type); 71603 const isLast = index === this.productsWithQuantity.length - 1;
71604 return b$1`<div class="flex gap-2 items-center rounded p-[2px] py-[3px] min-h-6"> 71605 <sonic-subscriber 71606 dataProvider="groupedCartItem/${this.id}/${product.entity?.id}" 71607 .props="${product.entity}" 71608 > 71609 <div class="w-12 @xl:w-14 rounded overflow-hidden shrink-0 hidden @lg:block"> 71610 <sonic-product-illustration noAnimation></sonic-product-illustration> 71611 </div> 71612 <div> 71613 <sonic-date class="text-xs"></sonic-date> 71614 <sonic-product-title machineName noOverTitle class="text-xs"></sonic-product-title> 71615 ${c$1( 71616 product.messages, 71617 (message) => message, 71618 (message) => { 71619 if (isRequest(this.props?.cartType)) return A$1; 71620 if (isReservation(this.props?.cartType) && this.appType === "customer") return A$1; 71621 return b$1`<sonic-alert status="error" size="xs" class="mt-px" 71622 >${o$6(message.content)}</sonic-alert 71623 >`; 71624 } 71625 )} 71626 </div> 71627 </sonic-subscriber> 71628 <div class="flex ml-auto items-center"> 71629 <div class="text-neutral-500 text-sm text-nowrap"> 71630 <sonic-icon name="${icon2}" library="custom"></sonic-icon> 71631 <span class="@lg:min-w-[3ch] inline-block text-center">${product.quantity}</span> 71632 </div> 71633 <div class="font-medium text-sm min-w-[5.8ch] @lg:min-w-20 ml-5 text-right"> 71634 ${product.total ? formatAmount(product.total) : "gratuit"} 71635 </div> 71636 </div> 71637 </div> 71638 ${isLast ? A$1 : b$1`<div class="my-[2px] w-full border-t border-t-neutral-200"></div>`} `; 71639 })}`; 71640 } 71641 }; 71642 SonicCartItemsCondensed.styles = [tailwind]; 71643 __decorateClass$b([ 71644 n$5({ type: Array }) 71645 ], SonicCartItemsCondensed.prototype, "items", 2); 71646 __decorateClass$b([ 71647 n$5({ type: Array }) 71648 ], SonicCartItemsCondensed.prototype, "entities", 2); 71649 __decorateClass$b([ 71650 r$5() 71651 ], SonicCartItemsCondensed.prototype, "groupedItems", 2); 71652 __decorateClass$b([ 71653 r$5() 71654 ], SonicCartItemsCondensed.prototype, "total", 2); 71655 __decorateClass$b([ 71656 r$5() 71657 ], SonicCartItemsCondensed.prototype, "productsWithQuantity", 2); 71658 __decorateClass$b([ 71659 e$2({ context: modeContext }), 71660 n$5({ type: String }) 71661 ], SonicCartItemsCondensed.prototype, "mode", 2); 71662 __decorateClass$b([ 71663 c({ context: appType, subscribe: true }) 71664 ], SonicCartItemsCondensed.prototype, "appType", 2); 71665 SonicCartItemsCondensed = __decorateClass$b([ 71666 t$3("sonic-cart-items-condensed") 71667 ], SonicCartItemsCondensed); 71668 var __defProp$a = Object.defineProperty; 71669 var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor; 71670 var __decorateClass$a = (decorators, target, key, kind) => { 71671 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(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$a(target, key, result); 71676 return result; 71677 }; 71678 let SonicReservationStatus = class extends Subscriber(i$6) { 71679 constructor() { 71680 super(...arguments); 71681 this.status = ReservationStatus.Draft; 71682 this.size = "md"; 71683 this.ellipsis = false; 71684 this.badgeType = "default"; 71685 this.statusIcon = ""; 71686 this.label = ""; 71687 } 71688 willUpdate(_changedProperties) { 71689 if (_changedProperties.has("status") || _changedProperties.has("appType")) { 71690 const prefix = isRequest(this.props?.cartType) ? "request_" : "cart_"; 71691 switch (this.status) { 71692 case ReservationStatus.Draft: 71693 this.badgeType = "default"; 71694 this.statusIcon = "pencil"; 71695 this.label = t(`cart_status_draft`); 71696 break; 71697 case ReservationStatus.Pending: 71698 this.badgeType = "info"; 71699 this.statusIcon = "clock"; 71700 this.label = t(`cart_status_pending`); 71701 break; 71702 case ReservationStatus.PartiallyProcessed:
71703 this.badgeType = "warning"; 71704 this.statusIcon = "clock"; 71705 this.label = t(`${prefix}status_partially_processed`); 71706 if (["xs", "sm", "2xs"].includes(this.size)) { 71707 this.label = t(`${prefix}status_partially_processed_short`); 71708 } 71709 break; 71710 case ReservationStatus.Processed: 71711 this.badgeType = "success"; 71712 this.statusIcon = "check"; 71713 this.label = t(`${prefix}status_processed`); 71714 break; 71715 case ReservationStatus.Confirmed: 71716 this.badgeType = "success"; 71717 this.statusIcon = "check"; 71718 this.label = t(`${prefix}status_confirmed`); 71719 break; 71720 case ReservationStatus.Expired: 71721 this.badgeType = "danger"; 71722 this.statusIcon = "xmark"; 71723 this.label = t("cart_status_expired"); 71724 break; 71725 case ReservationStatus.Deleted: 71726 this.badgeType = "danger"; 71727 this.statusIcon = "xmark"; 71728 this.label = t("cart_status_deleted"); 71729 break; 71730 case ReservationStatus.Declined: 71731 this.badgeType = "danger"; 71732 this.statusIcon = "xmark"; 71733 this.label = t("cart_status_temporary_declined"); 71734 break; 71735 case ReservationStatus.DeclinedForever: 71736 this.badgeType = "danger"; 71737 this.statusIcon = "ban"; 71738 this.label = t("cart_status_declined"); 71739 break; 71740 case ReservationStatus.Incomplete: 71741 this.badgeType = "danger"; 71742 this.statusIcon = "triangle-exclamation"; 71743 this.label = t("cart_status_incomplete"); 71744 break; 71745 case ReservationStatus.Processing: 71746 this.badgeType = "warning"; 71747 this.statusIcon = "credit-card"; 71748 this.label = "En cours de règlement"; 71749 if (["xs", "sm", "2xs"].includes(this.size)) { 71750 this.label = t("cart_status_processing"); 71751 } 71752 break; 71753 case ReservationStatus.Error: 71754 this.badgeType = "danger"; 71755 this.statusIcon = "circle-exclamation"; 71756 this.label = t("cart_status_error"); 71757 break; 71758 case ReservationStatus.Disabled: 71759 this.badgeType = "danger"; 71760 this.statusIcon = "ban"; 71761 this.label = t("cart_status_disabled"); 71762 break; 71763 case ReservationStatus.Submitted: 71764 this.badgeType = "info"; 71765 this.statusIcon = "clock"; 71766 this.label = t("LIB_awaiting_processing"); 71767 break; 71768 default: 71769 this.badgeType = "default"; 71770 break; 71771 } 71772 const processingStatuses = [ 71773 ReservationStatus.Draft, 71774 ReservationStatus.PartiallyProcessed, 71775 ReservationStatus.Confirmed, 71776 ReservationStatus.Pending, 71777 ReservationStatus.Declined 71778 ]; 71779 const requestForCustomer = isRequest(this.props?.cartType) && this.appType === "customer"; 71780 if (requestForCustomer && processingStatuses.includes(this.status)) { 71781 this.badgeType = "warning"; 71782 this.statusIcon = "lock"; 71783 this.label = t("LIB_en_cours_de_traitement"); 71784 } 71785 } 71786 super.willUpdate(_changedProperties); 71787 } 71788 render() { 71789 if (!this.status) return A$1; 71790 return b$1`<sonic-badge type=${this.badgeType} size=${this.size} ?ellipsis=${this.ellipsis} 71791 >${this.statusIcon ? b$1`<sonic-icon name=${this.statusIcon} library="custom"></sonic-icon>` : A$1} 71792 ${this.label}</sonic-badge 71793 >`; 71794 } 71795 }; 71796 SonicReservationStatus.styles = [tailwind]; 71797 __decorateClass$a([ 71798 n$5({ type: String }) 71799 ], SonicReservationStatus.prototype, "status", 2); 71800 __decorateClass$a([ 71801 n$5({ type: String }) 71802 ], SonicReservationStatus.prototype, "size", 2); 71803 __decorateClass$a([ 71804 n$5({ type: Boolean }) 71805 ], SonicReservationStatus.prototype, "ellipsis", 2); 71806 __decorateClass$a([ 71807 r$5() 71808 ], SonicReservationStatus.prototype, "badgeType", 2); 71809 __decorateClass$a([ 71810 r$5() 71811 ], SonicReservationStatus.prototype, "statusIcon", 2); 71812 __decorateClass$a([ 71813 r$5() 71814 ], SonicReservationStatus.prototype, "label", 2); 71815 __decorateClass$a([ 71816 c({ context: appType, subscribe: true }), 71817 r$5() 71818 ], SonicReservationStatus.prototype, "appType", 2); 71819 SonicReservationStatus = __decorateClass$a([ 71820 t$3("sonic-reservation-status") 71821 ], SonicReservationStatus); 71822 var __defProp$9 = Object.defineProperty; 71823 var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor; 71824 var __decorateClass$9 = (decorators, target, key, kind) => { 71825 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target; 71826 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71827 if (decorator = decorators[i2]) 71828 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71829 if (kind && result) __defProp$9(target, key, result); 71830 return result; 71831 }; 71832 const tagName$5 = "sonic-user-account-request-detail"; 71833 let UserAccountRequestDetail = class extends Subscriber(i$6) { 71834 constructor() { 71835 super(...arguments); 71836 this.initialized = false;
71837 } 71838 async willUpdate() { 71839 if (this.props?.id && !this.initialized) { 71840 const apiConfiguration = HTML.getApiConfiguration(this); 71841 const api2 = new API(apiConfiguration); 71842 const result = await api2.get(`reservation-request-config/${this.props?.reservationRequestConfigId}`); 71843 if (result?.data && result.success) { 71844 this.config = result.data; 71845 this.initialized = true; 71846 } 71847 } 71848 } 71849 render() { 71850 if (!this.props) return A$1; 71851 return b$1` ${renderFormData({ 71852 reservationRequest: this.props, 71853 reservationRequestConfig: this.config, 71854 displayLegends: false, 71855 displayTitle: false, 71856 size: "sm" 71857 })} 71858 <sonic-cart-items displaySummary noDetailButton mode="readonly" class="mt-3"></sonic-cart-items>`; 71859 } 71860 }; 71861 UserAccountRequestDetail.styles = [tailwind]; 71862 __decorateClass$9([ 71863 n$5({ type: Object }) 71864 ], UserAccountRequestDetail.prototype, "config", 2); 71865 UserAccountRequestDetail = __decorateClass$9([ 71866 t$3(tagName$5) 71867 ], UserAccountRequestDetail); 71868 var __defProp$8 = Object.defineProperty; 71869 var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor; 71870 var __decorateClass$8 = (decorators, target, key, kind) => { 71871 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target; 71872 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 71873 if (decorator = decorators[i2]) 71874 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 71875 if (kind && result) __defProp$8(target, key, result); 71876 return result; 71877 }; 71878 let SonicRequestItem = class extends Subscriber(i$6) { 71879 constructor() { 71880 super(...arguments); 71881 this._display = "current"; 71882 this._reservationTargetData = null; 71883 } 71884 async willUpdate(changedProperties) { 71885 if (changedProperties.has("props")) { 71886 const hasInitialRequest = this.props?.cart_origin?.type === CartType.ReservationRequest || this.props?.cart_origin?.type === CartType.WaitingLists; 71887 this._display = hasInitialRequest ? "initial" : "current"; 71888 if (this.props?.cart_target && this.props.cart_target.type === CartType.Reservation) { 71889 const api2 = new API(HTML$1.getApiConfiguration(this)); 71890 const result = await api2.get(`reservations/${this.props.cart_target.id}`); 71891 if (result?.data && result.success) { 71892 this._reservationTargetData = result.data; 71893 } 71894 } 71895 } 71896 } 71897 deleteRequest(dataProvider) { 71898 const api2 = new API(HTML$1.getApiConfiguration(this)); 71899 Modal.create({ 71900 title: t("LIB_confirmer_la_suppression"), 71901 subtitle: t("LIB_attention_toutes_les_donnees_seront_perdues"), 71902 actions: b$1`<sonic-button 71903 minWidth="10rem" 71904 shape="block" 71905 type="danger" 71906 @click=${(e2) => { 71907 const target = e2.currentTarget; 71908 const parentModal = HTML$1.getClosestElement(target, "sonic-modal"); 71909 Cart.delete(api2, dataProvider).then(() => { 71910 parentModal?.hide(); 71911 if (this.filterDataProvider) { 71912 dp(this.filterDataProvider).refreshDate.set((/* @__PURE__ */ new Date()).getTime()); 71913 } 71914 }); 71915 }} 71916 > 71917 <sonic-icon library="custom" name="trash"></sonic-icon> 71918 ${t("supprimer")}</sonic-button 71919 ><sonic-button shape="block" minWidth="10rem" hideModal> 71920 <sonic-icon library="custom"></sonic-icon>${t("annuler")}</sonic-button 71921 >`, 71922 removeOnHide: true 71923 }); 71924 } 71925 editRequest(cart) { 71926 const api2 = new API(HTML$1.getApiConfiguration(this)); 71927 const cancelEndpoint = `${cartProviderKey(cart.cartType, Number(cart.id))}/cancel-submission`; 71928 Modal.create({ 71929 title: t("LIB_modifier_la_demande"), 71930 subtitle: t("LIB_attention_vous_devrez_la_confirmer_de_nouveau"), 71931 actions: b$1`<sonic-button 71932 minWidth="10rem" 71933 shape="block" 71934 type="success" 71935 @click=${async () => { 71936 const response = await api2.put(cancelEndpoint, {}); 71937 if (response?.success) { 71938 Modal.modals[Modal.modals.length - 1].hide(); 71939 if (cart.cartType === CartType.ReservationRequest) { 71940 appRoute("reservationRequest").fill({ 71941 id: cart.reservationRequestConfigId 71942 }).query({ 71943 sonic_request_id: cart.id, 71944 sonic_reservation_request_config_id: cart.reservationRequestConfigId 71945 }).goTo(); 71946 } else { 71947 appRoute("waitingList").fill({ 71948 id: cart.id 71949 }).goTo(); 71950 } 71951 } 71952 }} 71953 > 71954 <sonic-icon library="custom" name="pen"></sonic-icon> 71955 ${t("modifier")}</sonic-button 71956 ><sonic-button shape="block" minWidth="10rem" hideModal> 71957 <sonic-icon library="custom"></sonic-icon>${t("annuler")}</sonic-button 71958 >`, 71959 removeOnHide: true 71960 }); 71961 } 71962 render() { 71963 const cart = this.props; 71964 if (!cart) return A$1; 71965 const currentQuote = cart.quotes?.current; 71966 const lastUpdate = currentQuote?.created_at || cart?.updated_at; 71967 const pdfURL = currentQuote?.pdf_url; 71968 const canEdit = cart.status === ReservationStatus.Incomplete || cart.status === ReservationStatus.Submitted; 71969 const cartOriginId = Number(cart.cart_origin?.id); 71970 const displayDetailButton = this._display === "current" ? !!cart?.items?.length : true; 71971 const displayPdfDownload = cart?.cartType !== CartType.WaitingLists; 71972 return b$1`<div class="mb-3 rounded-md p-3 border border-neutral-100 @container"> 71973 <div class="flex items-center gap-2 mb-3"> 71974 <div class="mr-auto"> 71975 <div class="font-bold pr-2">${cart?.title || cartTitle(cart.cartType)}</div> 71976 <div class="text-xs mt-1"> 71977 n°${getCartNumber(cart)} â ${t("mis_a_jour_le")} <sonic-date date=${lastUpdate}></sonic-date> 71978 </div> 71979 71980 <sonic-reservation-status 71981 size="xs" 71982 class="block @md:hidden mt-1 ${cart.status === ReservationStatus.Incomplete ? "animate-pulse" : ""}" 71983 ></sonic-reservation-status> 71984 71985 ${this.renderMessage(cart.status, this._reservationTargetData)} 71986 </div> 71987
71988 <div class="self-start flex items-center gap-1"> 71989 <sonic-reservation-status 71990 size="xs" 71991 class="hidden @md:block ${cart.status === ReservationStatus.Incomplete ? "animate-pulse" : ""}" 71992 ></sonic-reservation-status> 71993 <sonic-pop> 71994 <sonic-button shape="circle" size="xs" icon ?disabled=${!canEdit}> 71995 <sonic-icon library="custom" name="ellipsis-vertical"></sonic-icon> 71996 </sonic-button> 71997 <sonic-menu slot="content" size="sm"> 71998 <sonic-menu-item target="_blank" ?disabled=${!canEdit} @click=${() => this.editRequest(cart)}> 71999 <sonic-icon library="custom" name="pen" slot="prefix"></sonic-icon> 72000 ${t("modifier")} 72001 </sonic-menu-item> 72002 72003 ${displayPdfDownload ? b$1` 72004 <sonic-menu-item href=${pdfURL} target="_blank" ?disabled=${!pdfURL}> 72005 <sonic-icon library="custom" name="file-pdf" slot="prefix"></sonic-icon> 72006 ${t("telecharger")} 72007 </sonic-menu-item> 72008 ` : A$1} 72009 <sonic-divider></sonic-divider> 72010 <sonic-menu-item type="danger" @click=${() => this.deleteRequest("reservation-request/" + cart.id)}> 72011 <sonic-icon library="custom" name="trash" slot="prefix"></sonic-icon> 72012 ${t("supprimer")} 72013 </sonic-menu-item> 72014 </sonic-menu> 72015 </sonic-pop> 72016 </div> 72017 </div> 72018 72019 ${this._display === "initial" ? b$1` 72020 <sonic-fetch dataProvider="reservation-request/${cartOriginId}" key="data"> 72021 <sonic-cart-items-condensed></sonic-cart-items-condensed> 72022 </sonic-fetch> 72023 ` : b$1`<sonic-cart-items-condensed></sonic-cart-items-condensed>`} 72024 72025 <div class="flex items-center gap-2 mt-3 flex-wrap"> 72026 ${displayDetailButton ? b$1` 72027 <sonic-button @click=${() => this.showDetail()} variant="link" size="xs"> 72028 <sonic-icon library="custom" slot="prefix" name="eye"></sonic-icon> 72029 ${t("LIB_voir_le_detail")} 72030 </sonic-button> 72031 ` : A$1} 72032 ${cartOriginId && this._display === "current" ? b$1`<sonic-button variant="link" size="xs" @click=${() => this.showOriginalRequest(cartOriginId)}> 72033 <sonic-icon library="custom" slot="prefix" name="clock-rotate-left"></sonic-icon> 72034 ${t("LIB_voir_la_demande_initiale")}</sonic-button 72035 >` : A$1} 72036 </div> 72037 </div>`; 72038 } 72039 showOriginalRequest(cartOriginId) { 72040 const subtitle = this.props?.title || cartTitle(this.props?.cartType); 72041 Modal.create({ 72042 title: subtitle, 72043 content: b$1`<div style="display: grid; grid-template-columns: 1fr 1fr;grid-gap:2rem;"> 72044 <div> 72045 <sonic-fetch dataProvider="reservation-request/${cartOriginId}" key="data"> 72046 <sonic-cart-items displaySummary noDetailButton mode="readonly"> 72047 <div slot="title" style="font-weight: bold; font-size: 1.25rem; margin-bottom:.3rem;"> 72048 Demande initiale 72049 </div> 72050 </sonic-cart-items> 72051 </sonic-fetch> 72052 </div> 72053 <sonic-cart-items dataProvider="${this.dataProvider}" displaySummary noDetailButton mode="readonly"> 72054 <div slot="title" style="font-weight: bold; font-size: 1.25rem; margin-bottom:.3rem;">Demande actuelle</div> 72055 </sonic-cart-items> 72056 </div>`, 72057 maxWidth: "85vw", 72058 removeOnHide: true 72059 }); 72060 } 72061 async showDetail() { 72062 const cartOriginId = Number(this.props?.cart_origin?.id); 72063 const dataProvider = this._display === "initial" ? `reservation-request/${cartOriginId}` : this.dataProvider; 72064 Modal.create({ 72065 title: this.props?.title || cartTitle(this.props?.cartType), 72066 content: b$1`<sonic-user-account-request-detail 72067 dataProvider="${dataProvider}" 72068 cartProvider="${this.dataProvider}" 72069 ></sonic-user-account-request-detail>`, 72070 removeOnHide: true 72071 }); 72072 } 72073 renderMessage(status, reservationTargetData) { 72074 if (!status) return A$1; 72075 const isProcessed = status === ReservationStatus.Processed; 72076 const isDeclinedForever = status === ReservationStatus.DeclinedForever; 72077 const isAvailableInAccount = reservationTargetData?.displayOnline === true; 72078 const reservationIsProcessed = reservationTargetData?.status === ReservationStatus.Processed || reservationTargetData?.status === ReservationStatus.Deleted || !reservationTargetData; 72079 const requestHasBeenModified = this.props?.cart_origin?.type === CartType.ReservationRequest; 72080 if (isProcessed) { 72081 if (reservationIsProcessed) { 72082 return A$1; 72083 } else if (isAvailableInAccount) { 72084 return b$1`<sonic-alert class="my-2" size="sm" status="success" 72085 >${t("LIB_reservation_available_in_account")} 72086 </sonic-alert> 72087 ${requestHasBeenModified ? b$1`<sonic-alert class="my-2 font-bold" size="sm" status="warning" 72088 >${t("LIB_demande_modifiee_warning")}</sonic-alert 72089 >` : A$1}`; 72090 } else { 72091 return b$1`<sonic-alert class="my-2" size="sm" status="success"> 72092 ${t("LIB_account_request_processed_message")} 72093 </sonic-alert>`; 72094 } 72095 } else if (isDeclinedForever) { 72096 return b$1`<sonic-alert class="my-2" size="sm" status="error" 72097 >${t("LIB_account_request_declined_forever_message")}</sonic-alert 72098 >`; 72099 } 72100 return A$1; 72101 } 72102 }; 72103 SonicRequestItem.styles = [tailwind]; 72104 __decorateClass$8([ 72105 n$5({ type: String }) 72106 ], SonicRequestItem.prototype, "filterDataProvider", 2); 72107 __decorateClass$8([ 72108 r$5() 72109 ], SonicRequestItem.prototype, "_display", 2); 72110 __decorateClass$8([ 72111 r$5() 72112 ], SonicRequestItem.prototype, "_reservationTargetData", 2); 72113 SonicRequestItem = __decorateClass$8([ 72114 t$3("sonic-user-account-request-item") 72115 ], SonicRequestItem); 72116 var __defProp$7 = Object.defineProperty; 72117 var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor; 72118 var __decorateClass$7 = (decorators, target, key, kind) => { 72119 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target; 72120 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72121 if (decorator = decorators[i2]) 72122 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72123 if (kind && result) __defProp$7(target, key, result); 72124 return result; 72125 }; 72126 const tagName$4 = "sonic-user-account-requests"; 72127 const DATA_FILTER_REQUESTS_PROVIDER = "accountRequestsFilters"; 72128 let UserAccountReservationRequests = class extends i$6 { 72129 constructor() { 72130 super(...arguments); 72131 this.dataProvider = "account/my-requests"; 72132 this.cartType = CartType.ReservationRequest; 72133 } 72134 async willUpdate(changedProperties) { 72135 if (changedProperties.has("userId") && this.userId && this.cartType) { 72136 this._dataEndpoint = getCartEndpoint({ 72137 type: this.cartType, 72138 userId: this.userId, 72139 statuses: [ 72140 ReservationStatus.Incomplete, 72141 ReservationStatus.Pending, 72142 ReservationStatus.Submitted, 72143 ReservationStatus.Draft, 72144 ReservationStatus.Confirmed, 72145 ReservationStatus.Processed, 72146 ReservationStatus.Declined, 72147 ReservationStatus.DeclinedForever 72148 ], 72149 isQueue: true 72150 }); 72151 } 72152 } 72153 renderHeader(cartType) { 72154 if (cartType === CartType.ReservationRequest) { 72155 return b$1` 72156 <sonic-page-header label=${t("LIB_mes_demandes_de_reservation")}></sonic-page-header> 72157 <div class=" prose mb-8 ">${t("LIB_reservation_request_account_help_message", true)}</div> 72158 `; 72159 } else if (cartType === CartType.WaitingLists) { 72160 return b$1` 72161 <sonic-page-header label=${t("LIB_mes_listes_d_attente")}></sonic-page-header> 72162 <div class=" prose mb-8 ">${t("LIB_waiting_list_account_help_message", true)}</div> 72163 `; 72164 } 72165 return A$1; 72166 } 72167 render() { 72168 if (!this._dataEndpoint) return A$1; 72169 const isReservationRequest2 = this.cartType === CartType.ReservationRequest; 72170 return b$1` 72171 ${this.renderHeader(this.cartType)} 72172 <sonic-queue 72173 dataFilterProvider="${DATA_FILTER_REQUESTS_PROVIDER}" 72174 key="data" 72175 limit="5" 72176 dataProviderExpression=${this._dataEndpoint} 72177 .items=${() => b$1`<sonic-user-account-request-item 72178 .filterDataProvider=${DATA_FILTER_REQUESTS_PROVIDER} 72179 ></sonic-user-account-request-item>`} 72180 .noItems=${() => b$1`<sonic-no-result> 72181 ${isReservationRequest2 ? b$1` 72182 <sonic-app-link to="reservationRequest" size="xs" variant="default" class="mt-2" 72183 ><sonic-icon library="custom" name="arrow-right"></sonic-icon> ${t( 72184 "LIB_nouvelle_demande" 72185 )}</sonic-app-link 72186 > 72187 ` : A$1} 72188 </sonic-no-result>`} 72189 > 72190 </sonic-queue> 72191 `; 72192 } 72193 }; 72194 UserAccountReservationRequests.styles = [tailwind, sonicProse]; 72195 __decorateClass$7([ 72196 bind$1("user.id"), 72197 n$5({ type: Number }) 72198 ], UserAccountReservationRequests.prototype, "userId", 2); 72199 __decorateClass$7([ 72200 r$5() 72201 ], UserAccountReservationRequests.prototype, "_dataEndpoint", 2); 72202 __decorateClass$7([ 72203 n$5() 72204 ], UserAccountReservationRequests.prototype, "cartType", 2); 72205 UserAccountReservationRequests = __decorateClass$7([ 72206 t$3(tagName$4) 72207 ], UserAccountReservationRequests); 72208 var __defProp$6 = Object.defineProperty; 72209 var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor; 72210 var __decorateClass$6 = (decorators, target, key, kind) => { 72211 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target; 72212 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72213 if (decorator = decorators[i2]) 72214 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72215 if (kind && result) __defProp$6(target, key, result); 72216 return result; 72217 }; 72218 const tagName$3 = "sonic-user-account-reservations"; 72219 const DATA_FILTER_RESERVATIONS_PROVIDER = "accountReservationsFilters"; 72220 let UserAccountReservations = class extends i$6 { 72221 constructor() { 72222 super(...arguments); 72223 this.dataProvider = "account/my-reservations"; 72224 } 72225 async willUpdate(changedProperties) { 72226 if (changedProperties.has("userId") && this.userId) { 72227 this._dataEndpoint = getCartEndpoint({ 72228 type: CartType.Reservation, 72229 userId: this.userId, 72230 statuses: [ 72231 ReservationStatus.Pending, 72232 ReservationStatus.Confirmed, 72233 ReservationStatus.Processing, 72234 ReservationStatus.PartiallyProcessed 72235 ], 72236 isQueue: true 72237 }); 72238 } 72239 } 72240 render() { 72241 if (!this._dataEndpoint) return A$1; 72242 return b$1` 72243 <sonic-page-header label=${t("LIB_mes_reservations")}></sonic-page-header> 72244 <sonic-queue 72245 dataFilterProvider="${DATA_FILTER_RESERVATIONS_PROVIDER}" 72246 key="data" 72247 limit="5" 72248 dataProviderExpression=${this._dataEndpoint} 72249 .items=${(reservation) => this.renderItem(reservation)} 72250 } 72251 .noItems=${() => b$1`<sonic-no-result size="md"> </sonic-no-result>`} 72252 > 72253 </sonic-queue> 72254 `; 72255 } 72256 renderItem(reservation) { 72257 const paymentLinkHref = reservation?.quotes?.current?.payment_link?.url ?? ""; 72258 const quoteTitle = reservation?.quotes?.current?.title ?? ""; 72259 const quoteUrl = reservation?.quotes?.current?.pdf_url ?? ""; 72260 const reservationNumber = reservation?.id; 72261 const hasItems = reservation?.items && reservation?.items.length > 0 || reservation?.extras && reservation?.extras.length > 0; 72262 const cartId = reservation?.quotes?.current?.payment_link?.cart_id?.toString() ?? ""; 72263 const total = reservation?.quotes?.current?.total ?? 0; 72264 const btnText = total > 0 ? t("LIB_payer_maintenant") : t("LIB_get_my_tickets"); 72265 return b$1`<div class="p-4 border border-neutral-100 rounded-md mb-3"> 72266 <div class="mb-3"> 72267 <div class="font-bold mb-1 text-lg">${reservation.title ?? "Réservation n°" + reservationNumber}</div> 72268 <div class="text-sm my-1">Devis ${quoteTitle}</div> 72269 </div> 72270 72271 ${reservation.status === ReservationStatus.PartiallyProcessed ? b$1`<sonic-cart-items-condensed></sonic-cart-items-condensed>` : b$1`<sonic-cart-items-condensed 72272 subDataProvider="quotes.current" 72273 .props=${reservation.quotes?.current} 72274 ></sonic-cart-items-condensed> `} 72275 ${paymentLinkHref && hasItems ? b$1`<sonic-button href=${paymentLinkHref} size="xs" type="success" class="mt-2"> 72276 <sonic-icon library="custom" name="credit-card"></sonic-icon> ${btnText} 72277 </sonic-button>` : A$1} 72278 ${reservation.status === ReservationStatus.Processing ? b$1` 72279 <sonic-alert 72280 background 72281 class="my-3" 72282 size="sm" 72283 status="warning" 72284 label="${t("LIB_alert_reservation_en_cours_de_paiement")}" 72285 > 72286 <div class="flex items-center gap-2">
72287 <span>${t("LIB_remaining_time")} : </span> 72288 <sonic-fetch dataProvider="orders/${cartId}" key="data"> 72289 <sonic-cart-remaining-time></sonic-cart-remaining-time> 72290 </sonic-fetch></div 72291 ></sonic-alert> 72292 ` : A$1} 72293 ${quoteUrl ? b$1`<sonic-button href=${quoteUrl} size="xs" class="mt-2" target="_blank"> 72294 <sonic-icon library="custom" name="file-pdf"></sonic-icon> ${t("LIB_telecharger_le_devis")} 72295 </sonic-button>` : A$1} 72296 </div>`; 72297 } 72298 }; 72299 UserAccountReservations.styles = [tailwind, sonicProse]; 72300 __decorateClass$6([ 72301 bind$1("user.id"), 72302 n$5({ type: Number }) 72303 ], UserAccountReservations.prototype, "userId", 2); 72304 __decorateClass$6([ 72305 r$5() 72306 ], UserAccountReservations.prototype, "_dataEndpoint", 2); 72307 UserAccountReservations = __decorateClass$6([ 72308 t$3(tagName$3) 72309 ], UserAccountReservations); 72310 var __defProp$5 = Object.defineProperty; 72311 var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor; 72312 var __decorateClass$5 = (decorators, target, key, kind) => { 72313 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target; 72314 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72315 if (decorator = decorators[i2]) 72316 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72317 if (kind && result) __defProp$5(target, key, result); 72318 return result; 72319 }; 72320 const matchAnyQuery = (route2) => { 72321 return appRoute(route2).toString().split("#").join(".*?#"); 72322 }; 72323 const tagName$2 = "sonic-account"; 72324 const user = new DataProviderKey("user"); 72325 let UserAccount = class extends i$6 { 72326 constructor() { 72327 super(...arguments); 72328 this._userId = null; 72329 this._shouldRender = false;
72330 } 72331 userIdChanged(user2) { 72332 if (!user2) { 72333 this._userId = null; 72334 this._shouldRender = false; 72335 return; 72336 } 72337 const userId = user2 && "id" in user2 ? user2.id : null; 72338 this._userId = userId; 72339 const hasFetch = "success" in user2; 72340 this._shouldRender = !!(userId || hasFetch); 72341 } 72342 getLoggedInRoutes() { 72343 return { 72344 [`${matchAnyQuery("account.tickets")}$`]: () => b$1`<sonic-user-account-tickets></sonic-user-account-tickets>`, 72345 [`${matchAnyQuery("account.purchases")}$`]: () => b$1`<sonic-user-account-purchases></sonic-user-account-purchases>`, 72346 [`${matchAnyQuery("account.edit")}$`]: () => b$1`<sonic-user-form-edit></sonic-user-form-edit>`, 72347 [`${matchAnyQuery("account.editPassword")}$`]: () => b$1` 72348 <div dataProvider="sonic-wording"> 72349 <sonic-page-header label="${t("my_password")}"></sonic-page-header> 72350 </div> 72351 <sonic-sdui 72352 fetch 72353 sduiKey="data" 72354 dataProvider="sdui-provider" 72355 endPoint="/user/form/change-password/" 72356 headersDataProvider="ticketsAppHeadersProvider" 72357 ></sonic-sdui> 72358 `, 72359 [`${matchAnyQuery("account.trips")}$`]: () => b$1`<sonic-account-carpooling></sonic-account-carpooling>`, 72360 [`${matchAnyQuery("account.waitingLists")}$`]: () => b$1`<sonic-user-account-requests .cartType=${CartType.WaitingLists}></sonic-user-account-requests>`, 72361 [`${matchAnyQuery("account.reservationRequests")}$`]: () => b$1`<sonic-user-account-requests></sonic-user-account-requests>`, 72362 [`${matchAnyQuery("account.reservations")}$`]: () => b$1`<sonic-user-account-reservations></sonic-user-account-reservations>`, 72363 fallback: () => b$1`<sonic-user-account-home></sonic-user-account-home>` 72364 }; 72365 } 72366 getNotLoggedInRoutes() { 72367 return { 72368 [matchAnyQuery("account.create")]: () => b$1` 72369 <div dataProvider="sonic-wording"> 72370 <sonic-page-header goBack label="${t("create_account")}"></sonic-page-header> 72371 </div> 72372 <sonic-user-form-create></sonic-user-form-create> 72373 `, 72374 [`${matchAnyQuery("account.missingPassword")}$`]: () => b$1` 72375 <div class="mt-2 lg:mt-8 mx-auto max-w-[32rem] block w-full"> 72376 <div dataProvider="sonic-wording"> 72377 <sonic-page-header goBack label="${t("mot_de_passe_oublie")}"></sonic-page-header> 72378 </div> 72379 <sonic-sdui 72380 fetch 72381 sduiKey="data" 72382 dataProvider="sdui-provider" 72383 endPoint="/user/form/change-password/" 72384 headersDataProvider="ticketsAppHeadersProvider" 72385 ></sonic-sdui> 72386 </div> 72387 `, 72388 fallback: () => b$1` 72389 <sonic-user-form-login createAccount class="mt-2 lg:mt-8 mx-auto block w-full"></sonic-user-form-login> 72390 ` 72391 }; 72392 } 72393 render() { 72394 if (!this._shouldRender) return A$1; 72395 return b$1` 72396 <sonic-fullscreen-layout> 72397 ${this._userId ? b$1` 72398 <sonic-user-account-menu class="mb-8 block"></sonic-user-account-menu> 72399 <sonic-router class="contents" .routes=${this.getLoggedInRoutes()}></sonic-router> 72400 ` : b$1`<sonic-router class="contents" .routes=${this.getNotLoggedInRoutes()}></sonic-router>`} 72401 </sonic-fullscreen-layout> 72402 `; 72403 } 72404 }; 72405 UserAccount.styles = [tailwind]; 72406 __decorateClass$5([ 72407 handle(user) 72408 ], UserAccount.prototype, "userIdChanged", 1); 72409 __decorateClass$5([ 72410 r$5() 72411 ], UserAccount.prototype, "_userId", 2); 72412 __decorateClass$5([ 72413 r$5() 72414 ], UserAccount.prototype, "_shouldRender", 2); 72415 UserAccount = __decorateClass$5([ 72416 t$3(tagName$2) 72417 ], UserAccount); 72418 var __defProp$4 = Object.defineProperty; 72419 var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor; 72420 var __decorateClass$4 = (decorators, target, key, kind) => { 72421 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target; 72422 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72423 if (decorator = decorators[i2]) 72424 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72425 if (kind && result) __defProp$4(target, key, result); 72426 return result; 72427 }; 72428 let accreditationCard = class extends Subscriber(i$6) { 72429 constructor() { 72430 super(...arguments); 72431 this.noContactButton = false;
72432 this.skeleton = false; 72433 } 72434 render() { 72435 if (this.props === null) return A$1; 72436 if (this.skeleton) { 72437 return b$1` 72438 <div 72439 class=" p-4 border-2 border-solid border-neutral-100 rounded-lg animate-pulse grid grid-cols-[auto,_minmax(0,1fr),_auto] gap-3" 72440 > 72441 <div class="w-20 aspect-square bg-neutral-100 rounded flex items-center justify-center"></div> 72442 <div class="mt-2"> 72443 <div class="w-28 h-3 bg-neutral-100 rounded mb-2"></div> 72444 <div class="w-28 h-3 bg-neutral-100 rounded mb-2"></div> 72445 <div class="w-28 h-3 bg-neutral-100 rounded"></div> 72446 </div> 72447 <div class="w-8 h-8 bg-neutral-100 rounded-full"></div> 72448 </div> 72449 `; 72450 } 72451 this.accreditation = this.props; 72452 return b$1` 72453 <div class="@container"> 72454 <div class="p-3 @md:p-4 border border-solid border-neutral-200 rounded-lg"> 72455 <div class="grid grid-cols-[auto,_minmax(0,1fr),_auto] gap-3 @md:gap-4 mb-3 "> 72456 <div class="photo"> 72457 ${this.accreditation.picture ? b$1`<sonic-image 72458 src=${this.accreditation.picture} 72459 ratio="1/1" 72460 class="w-16 @md:w-20 rounded overflow-hidden" 72461 ></sonic-image>` : b$1`<div class="w-16 @md:w-20 aspect-square bg-neutral-200 rounded flex items-center justify-center"> 72462 <sonic-icon library="custom" name="user" size="xl" class="text-neutral-0"></sonic-icon> 72463 </div>`} 72464 </div> 72465 <div class="mt-2 text-[.85rem] @md:text-[1.05rem]"> 72466 ${this.accreditation.structureName ? b$1` 72467 <sonic-button 72468 variant="unstyled" 72469 radio 72470 name="search" 72471 value="${this.accreditation.structureName}" 72472 class="font-bold text-[.75em] mb-2" 72473 > 72474 ${this.accreditation.structureName} 72475 </sonic-button> 72476 ` : A$1} 72477 <div>${this.accreditation.firstName} ${this.accreditation.lastName}</div> 72478 ${this.accreditation.function ? b$1` 72479 <sonic-button 72480 radio 72481 variant="unstyled" 72482 name="search" 72483 value="${this.accreditation.function}" 72484 class="text-[.75em] text-neutral-400" 72485 > 72486 ${this.accreditation.function} 72487 </sonic-button> 72488 ` : A$1} 72489 </div> 72490 ${!this.noContactButton && this.accreditation.contact ? b$1` <sonic-button shape="circle" @click="${this.setAccreditationContactModal}"> 72491 <sonic-icon library="heroicons" name="envelope"></sonic-icon> 72492 </sonic-button>` : A$1} 72493 </div> 72494 <div class="flex flex-wrap gap-4 text-[.78rem] @md:text-[.9rem] "> 72495 <div class="flex"> 72496 <sonic-icon library="custom" name="location-dot"></sonic-icon> 72497 <!-- POSTALCODE--> 72498 ${this.accreditation.postalCode ? b$1` 72499 <sonic-button 72500 class="mr-1 text-[1em]" 72501 variant="unstyled" 72502 radio 72503 name="search" 72504 value="${this.accreditation.postalCode}" 72505 > 72506 ${this.accreditation.postalCode} 72507 </sonic-button> 72508 ` : A$1} 72509 <!-- CITY--> 72510 ${this.accreditation.city ? b$1` <sonic-button 72511 radio 72512 variant="unstyled" 72513 name="search" 72514 class="text-[1em]" 72515 value="${this.accreditation.city}" 72516 > 72517 <!-- Capitalize word --> 72518 ${this.accreditation.city.split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ")} 72519 </sonic-button>` : A$1} 72520 , ${this.accreditation.country} 72521 </div> 72522 ${this.accreditation.structureTypeId ? b$1` 72523 <sonic-button 72524 radio 72525 class="text-[1em]" 72526 variant="unstyled" 72527 name="structureTypeID" 72528 value="${this.accreditation.structureTypeId}" 72529 > 72530 <sonic-icon library="custom" name="tags"></sonic-icon> 72531 ${this.accreditation.structureType} 72532 </sonic-button> 72533 ` : A$1} 72534 </div> 72535 </div> 72536 </div> 72537 `; 72538 } 72539 setAccreditationContactModal() { 72540 PublisherManager.get(`accreditationContact`).set(this.accreditation); 72541 } 72542 }; 72543 accreditationCard.styles = [tailwind]; 72544 __decorateClass$4([ 72545 n$5({ type: Boolean }) 72546 ], accreditationCard.prototype, "noContactButton", 2); 72547 __decorateClass$4([ 72548 n$5({ type: Boolean }) 72549 ], accreditationCard.prototype, "skeleton", 2); 72550 accreditationCard = __decorateClass$4([ 72551 t$3("accreditation-card") 72552 ], accreditationCard); 72553 var __defProp$3 = Object.defineProperty; 72554 var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor; 72555 var __decorateClass$3 = (decorators, target, key, kind) => { 72556 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target; 72557 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72558 if (decorator = decorators[i2]) 72559 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72560 if (kind && result) __defProp$3(target, key, result); 72561 return result; 72562 }; 72563 const tagName$1 = "sonic-accreditations-directory"; 72564 let SonicAccreditationsDirectory = class extends Subscriber$1(i$6) { 72565 constructor() { 72566 super(...arguments); 72567 this.displayTitle = false;
72568 this.displayText = false; 72569 this.invalidateCurrentAccreditation = (_value) => { 72570 dp(`currentAccreditation`).invalidate(); 72571 }; 72572 } 72573 connectedCallback() { 72574 super.connectedCallback(); 72575 dp(`accreditationLoginResult`).onAssign(this.invalidateCurrentAccreditation); 72576 } 72577 disconnectedCallback() { 72578 super.disconnectedCallback(); 72579 dp(`accreditationLoginResult`).offAssign(this.invalidateCurrentAccreditation); 72580 } 72581 render() { 72582 return b$1` <!-- Test si l'utilisateur a accès à la liste ou s'il doit s'authentifier --> 72583 <sonic-fetch 72584 dataProvider="currentAccreditation" 72585 endPoint="accreditations/current" 72586 noErrorsRecordings 72587 ></sonic-fetch> 72588 72589 <sonic-page-layout 72590 pageTitle=${t("accreditations_directory_title")} 72591 pageText=${t("accreditations_directory_text")} 72592 ?displayTitle=${this.displayTitle} 72593 ?displayText=${this.displayText} 72594 > 72595 <!-- Pas connecté - Formulaire de login --> 72596 ${!this.currentAccreditation ? this.showLoginForm() : A$1} 72597 72598 <!-- Connecté - Liste des accreditations --> 72599 ${this.currentAccreditation ? this.showAccreditationsList() : A$1} 72600 </sonic-page-layout>`; 72601 } 72602 showLoginForm() { 72603 return b$1` 72604 <form formDataProvider="accreditationLogin" submitResultDataProvider="accreditationLoginResult"> 72605 <sonic-fieldset class="max-w-[25rem]"> 72606 <sonic-legend iconLibrary="custom" iconName="lock" label=${t("LIB_annuaire_access_accreditations_directory")}> 72607 </sonic-legend> 72608 <sonic-form-layout> 72609 <sonic-submit onEnterKey endpoint="accreditations/login" method="post"> 72610 <sonic-form-layout> 72611 <sonic-input type="email" label=${t("email")} name="mail" placeholder="[email protected]"></sonic-input> 72612 <sonic-input 72613 type="text" 72614 label="${t("accreditation_number")}" 72615 name="number" 72616 placeholder="- - - - -" 72617 ></sonic-input> 72618 </sonic-form-layout> 72619 </sonic-submit> 72620 <sonic-form-actions> 72621 <sonic-submit onClick endpoint="accreditations/login" method="post"> 72622 <sonic-button radio noAutoFill type="success"> 72623 <sonic-icon slot="prefix" name="check"></sonic-icon> 72624 ${t("confirm")} 72625 </sonic-button> 72626 </sonic-submit> 72627 </sonic-form-actions> 72628 </sonic-form-layout> 72629 </sonic-fieldset> 72630 </form> 72631 `; 72632 } 72633 showAccreditationsList() { 72634 return b$1` 72635 <!-- Connecté - Bouton déconnexion --> 72636 ${this.showHeader()} 72637 <sonic-divider class="mt-5 mb-8"></sonic-divider> 72638 <div 72639 formDataProvider="accreditationsFilters" 72640 dataProvider="accreditationsFilters" 72641 class="flex flex-wrap gap-3 mb-8 max-w-[40rem]" 72642 > 72643 <sonic-input inlineContent name="search" type="search" placeholder="${t("Search...")}" class="grow"> 72644 <sonic-icon library="custom" name="magnifying-glass" slot="prefix"></sonic-icon> 72645 </sonic-input> 72646 72647 <!-- Récupération des types de structure pour remplir le select --> 72648 <sonic-fetch 72649 endpoint="/accreditations/structures_types" 72650 dataProvider="optionsAccreditationsTypes" 72651 key="data" 72652 ></sonic-fetch> 72653 ${this.optionsAccreditationsTypes?.length ? b$1` <sonic-select 72654 name="structureTypeID" 72655 valueKey="id" 72656 wordingKey="title" 72657 class="min-w-[15rem]" 72658 .options=${[{ id: "", title: t("accreditation_structure_types") }, ...this.optionsAccreditationsTypes]} 72659 ></sonic-select>` : A$1} 72660 <!-- TODO ajouter un sorter --> 72661 </div> 72662 72663 <sonic-queue 72664 dataProvider="accreditations" 72665 dataFilterProvider="accreditationsFilters" 72666 dataProviderExpression="/accreditations?offset=$offset&limit=$limit" 72667 key="data" 72668 class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4" 72669 > 72670 <template data-value="no-item"> 72671 <sonic-no-result></sonic-no-result> 72672 </template> 72673 <template> 72674 <accreditation-card formDataProvider="accreditationsFilters"></accreditation-card> 72675 </template> 72676 <template data-value="skeleton"> 72677 <accreditation-card formDataProvider="accreditationsFilters" skeleton></accreditation-card> 72678 </template> 72679 </sonic-queue> 72680 72681 ${this.showContactModal()} 72682 `; 72683 } 72684 showHeader() { 72685 return b$1`<div class=" flex gap-x-5 items-center flex-wrap"> 72686 <div> 72687 <div class="text-sm ">${t("LIB_connected_as")} :</div> 72688 <div> 72689 <sonic-icon library="custom" name="id-card"></sonic-icon>
72690 <span class="font-bold"> 72691 ${this.currentAccreditation?.firstName} ${this.currentAccreditation?.lastName} â N° 72692 ${this.currentAccreditation?.number}</span 72693 > 72694 </div> 72695 </div> 72696 72697 <sonic-button @click=${() => this.handleLogout()} size="inherit" variant="outline" class="text-xs lg:text-sm"> 72698 <sonic-icon library="custom" name="arrow-right-arrow-left"></sonic-icon> 72699 ${t("LIB_switch")} 72700 </sonic-button> 72701 </div> `; 72702 } 72703 showContactModal() { 72704 if (!this.accreditationContact?.contact) { 72705 return A$1; 72706 } 72707 return b$1` <sonic-modal @hidden="${this.unsetAccreditationContact}" visible width="36rem"> 72708 <sonic-modal-title class="flex gap-2" 72709 ><sonic-icon library="custom" name="envelope" size="lg"></sonic-icon> ${t("LIB_annuaire_contacter")} 72710 ${this.accreditationContact.firstName} ${this.accreditationContact.lastName}</sonic-modal-title 72711 > 72712 72713 <accreditation-card 72714 dataProvider="accreditationContact" 72715 noContactButton 72716 class="pointer-events-none w-full mb-4" 72717 ></accreditation-card> 72718 72719 <form formDataProvider="accreditationContactForm" class="w-full"> 72720 <sonic-fieldset label="${t("LIB_annuaire_your_information")}"> 72721 <sonic-form-layout> 72722 <sonic-input 72723 required 72724 type="email" 72725 name="mail" 72726 label="${t("email")}" 72727 value="${this.currentAccreditation?.email}" 72728 ></sonic-input> 72729 <sonic-input 72730 required 72731 name="fullname" 72732 label="${t("LIB_annuaire_full_name")}" 72733 placeholder="${t("LIB_annuaire_full_name_placeholder")}" 72734 value="${this.currentAccreditation?.firstName} ${this.currentAccreditation?.lastName}" 72735 ></sonic-input> 72736 <sonic-textarea 72737 required 72738 name="message" 72739 label="${t("LIB_annuaire_your_message")}" 72740 resize="vertical" 72741 ></sonic-textarea> 72742 <sonic-input type="hidden" name="contact" value="${this.accreditationContact.contact}"></sonic-input> 72743 </sonic-form-layout> 72744 </sonic-fieldset> 72745 <sonic-form-actions> 72746 <sonic-submit 72747 endPoint="/accreditations/contact" 72748 method="POST" 72749 submitResultDataProvider="accreditationContactResult" 72750 onclick 72751 > 72752 <sonic-button type="neutral"> 72753 <sonic-icon library="custom" name="paper-plane"></sonic-icon> 72754 ${t("LIB_annuaire_send")} 72755 </sonic-button> 72756 </sonic-submit> 72757 </sonic-form-actions> 72758 </form> 72759 </sonic-modal>`; 72760 } 72761 handleLogout() { 72762 const api2 = new API(HTML.getApiConfiguration(this)); 72763 api2.get(`/accreditations/logout`).then(() => { 72764 dp(`currentAccreditation`).invalidate(); 72765 }); 72766 } 72767 unsetAccreditationContact() { 72768 dp(`accreditationContact`).set({}); 72769 } 72770 }; 72771 SonicAccreditationsDirectory.styles = [tailwind]; 72772 __decorateClass$3([ 72773 n$5({ type: Boolean }) 72774 ], SonicAccreditationsDirectory.prototype, "displayTitle", 2); 72775 __decorateClass$3([ 72776 n$5({ type: Boolean }) 72777 ], SonicAccreditationsDirectory.prototype, "displayText", 2); 72778 __decorateClass$3([ 72779 bind$1("currentAccreditation.data"), 72780 r$5() 72781 ], SonicAccreditationsDirectory.prototype, "currentAccreditation", 2); 72782 __decorateClass$3([ 72783 bind$1("accreditationContact"), 72784 r$5() 72785 ], SonicAccreditationsDirectory.prototype, "accreditationContact", 2); 72786 __decorateClass$3([ 72787 bind$1("optionsAccreditationsTypes"), 72788 r$5() 72789 ], SonicAccreditationsDirectory.prototype, "optionsAccreditationsTypes", 2); 72790 SonicAccreditationsDirectory = __decorateClass$3([ 72791 t$3(tagName$1) 72792 ], SonicAccreditationsDirectory); 72793 var __defProp$2 = Object.defineProperty; 72794 var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor; 72795 var __decorateClass$2 = (decorators, target, key, kind) => { 72796 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target; 72797 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 72798 if (decorator = decorators[i2]) 72799 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 72800 if (kind && result) __defProp$2(target, key, result); 72801 return result; 72802 }; 72803 const tagName = "sonic-default-router"; 72804 let SonicDefaultRouter = class extends Subscriber$1(i$6) { 72805 constructor() { 72806 super(...arguments); 72807 this.defaultRoutes = defaultAppRoutes; 72808 } 72809 getRouterRoutes() { 72810 const routes = this.defaultRoutes; 72811 const routerRoutes = { 72812 // -- PANIER 72813 [routes.cart]: () => b$1`<sonic-cart></sonic-cart>`, 72814 // -- PLACEMENT 72815 [routes.seatmap]: ({ slug }) => { 72816 const id = idFromSlug(slug); 72817 const endpoint = entityEndPoint({ 72818 entityType: EntityType.Event, 72819 entityId: Number(id), 72820 view: entityView.full 72821 }); 72822 return b$1`<sonic-fetch dataProvider="default/seatmap/view" endpoint=${endpoint} key="data" 72823 ><sonic-seatmap></sonic-seatmap 72824 ></sonic-fetch>`; 72825 }, 72826 // -- AGENDA 72827 [`${routes.agenda}$`]: () => b$1` 72828 <sonic-modal visible removeHashOnHide maxWidth="95vw"> 72829 <sonic-modal-content><sonic-agenda></sonic-agenda></sonic-modal-content> 72830 </sonic-modal> 72831 `, 72832 // -- INFOS PRICES 72833 [`${routes.infosPrices}$`]: () => b$1` 72834 <sonic-modal visible removeHashOnHide maxWidth="42rem"> 72835 <sonic-modal-content 72836 ><sonic-infos-prices displayTitle smallTitle displayText></sonic-infos-prices 72837 ></sonic-modal-content> 72838 </sonic-modal> 72839 `, 72840 // -- RECUPERER UNE COMMANDE 72841 [`${routes.orderRecover}$`]: () => b$1` 72842 <sonic-modal visible removeHashOnHide maxWidth="42rem"> 72843 <sonic-modal-content 72844 ><sonic-order-recover displayTitle smallTitle displayText></sonic-order-recover 72845 ></sonic-modal-content> 72846 </sonic-modal> 72847 `, 72848 // -- CARTE CADEAU 72849 [`${routes.giftcards}$`]: () => b$1` 72850 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="60rem"> 72851 <sonic-modal-content 72852 ><sonic-giftcards displayTitle smallTitle displayText></sonic-giftcards 72853 ></sonic-modal-content> 72854 </sonic-modal> 72855 `, 72856 // -- CODE PROMO 72857 [`${routes.promo}$`]: () => b$1` 72858 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="30rem"> 72859 <sonic-modal-content><sonic-promo displayTitle smallTitle></sonic-promo></sonic-modal-content> 72860 </sonic-modal> 72861 `, 72862 // -- DEMANDE DE REMBOURSEMENT 72863 [`${routes.refund}$`]: () => b$1` 72864 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="42rem"> 72865 <sonic-modal-content><sonic-refund displayTitle displayText></sonic-refund></sonic-modal-content> 72866 </sonic-modal> 72867 `, 72868 // -- ABONNEMENT 72869 [`${routes.subscription}$`]: () => b$1` 72870 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="90rem"> 72871 <sonic-modal-content><sonic-subscription displayTitle displayText></sonic-subscription></sonic-modal-content> 72872 </sonic-modal> 72873 `, 72874 // -- ÃVÃNEMENT 72875 [routes.event]: ({ slug }) => { 72876 const id = idFromSlug(slug); 72877 const endpoint = entityEndPoint({ 72878 entityType: "show", 72879 entityId: Number(id), 72880 view: entityView.essential, 72881 next: true, 72882 customSearchParams: new URLSearchParams({ 72883 clean_sessions_data: "true" 72884 }) 72885 }); 72886 return b$1` 72887 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="100rem"> 72888 <sonic-modal-content> 72889 <sonic-fetch dataProvider=${endpoint} key="data"> 72890 <sonic-event-page noRelated noNavigation></sonic-event-page> 72891 </sonic-fetch> 72892 </sonic-modal-content> 72893 </sonic-modal> 72894 `; 72895 }, 72896 // -- LISTE D'ATTENTE 72897 [`${routes.waitingList}`]: ({ id }) => { 72898 return b$1` 72899 <sonic-modal visible forceAction removeHashOnHide maxWidth="60rem"> 72900 <sonic-modal-content> 72901 <sonic-waiting-list-form .requestId=${Number(id)}></sonic-waiting-list-form> 72902 </sonic-modal-content> 72903 </sonic-modal> 72904 `; 72905 }, 72906 // -- LIBÃRER UNE PLACE GRATUITE 72907 [`${routes.freeup}$`]: () => b$1` 72908 <sonic-modal visible removeHashOnHide maxWidth="38rem"> 72909 <sonic-modal-content 72910 ><sonic-ticket-freeup displayTitle smallTitle displayText></sonic-ticket-freeup 72911 ></sonic-modal-content> 72912 </sonic-modal> 72913 `, 72914 // -- CAMPAIGN 72915 [routes.campaign]: () => b$1`<sonic-campaign></sonic-campaign>`, 72916 // -- DEMANDE DE COMPTE PRO 72917 [`${routes.askProAccount}$`]: () => b$1` 72918 <sonic-modal visible removeHashOnHide maxWidth="42rem"> 72919 <sonic-modal-content 72920 ><sonic-ask-pro-account displayTitle smallTitle displayText></sonic-ask-pro-account 72921 ></sonic-modal-content> 72922 </sonic-modal> 72923 `, 72924 // -- LISTE d'attente 72925 [routes.customList]: ({ slug }) => b$1` 72926 <sonic-custom-list dataProvider="custom-list/${slug}"></sonic-custom-list> 72927 `, 72928 // -- CHANGER DE MOT DE PASSE 72929 [routes.changePassword]: () => { 72930 const searchParams = new URLSearchParams(window.location.search); 72931 const hashFromUrl = searchParams.get("sonic_hash"); 72932 return b$1` 72933 <sonic-redirect 72934 to="./" 72935 pushState 72936 dataprovider="change-password-result" 72937 subDataProvider="_sonic_http_response_" 72938 ondata="ok" 72939 ></sonic-redirect> 72940 <sonic-modal addHTTPResponse visible removeHashOnHide maxWidth="42rem"> 72941 <sonic-modal-content> 72942 <div dataProvider="sonic-wording"> 72943 <sonic-page-header label="${t("my_password")}"></sonic-page-header> 72944 </div> 72945 <sonic-sdui 72946 fetch 72947 sduiKey="data" 72948 dataProvider="sdui-provider" 72949 submitResultDataProvider="change-password-result" 72950 endPoint="/user/form/change-password/${hashFromUrl ?? ""}" 72951 headersDataProvider="ticketsAppHeadersProvider" 72952 ></sonic-sdui> 72953 </sonic-modal-content> 72954 </sonic-modal> 72955 `; 72956 },
72957 [routes["checkout.end"]]: () => b$1` 72958 <sonic-modal visible removeHashOnHide maxWidth="42rem"> 72959 <sonic-modal-content> 72960 <sonic-checkout-process-end></sonic-checkout-process-end> 72961 </sonic-modal-content> 72962 </sonic-modal> 72963 `, 72964 [routes.carpooling]: () => b$1` 72965 <sonic-fullscreen-layout> 72966 <sonic-carpooling></sonic-carpooling> 72967 </sonic-fullscreen-layout> 72968 `, 72969 [routes.accreditationsDirectory]: () => b$1` 72970 <sonic-fullscreen-layout> 72971 <sonic-accreditations-directory></sonic-accreditations-directory> 72972 </sonic-fullscreen-layout> 72973 `, 72974 // -- STORE 72975 [routes.store]: () => b$1` 72976 <sonic-modal visible removeHashOnHide maxWidth="90rem"> 72977 <sonic-modal-content> 72978 <sonic-event-store displayTitle displayText formDataProvider="defaultEventStoreFilters"></sonic-event-store> 72979 </sonic-modal-content> 72980 </sonic-modal> 72981 `, 72982 // -- DEMANDE DE RÃSERVATION 72983 [routes.reservationRequest]: () => b$1` 72984 <sonic-modal visible removeHashOnHide maxWidth="95vw" height="90vh"> 72985 <sonic-modal-content> 72986 <sonic-reservation-request displayText displayTitle smallTitle></sonic-reservation-request> 72987 </sonic-modal-content> 72988 </sonic-modal> 72989 `, 72990 // -- SHOP 72991 [`${routes.shop}$`]: () => b$1` 72992 <sonic-modal visible removeHashOnHide maxWidth="90rem"> 72993 <sonic-modal-content><sonic-shop displayTitle displayText noRouting></sonic-shop></sonic-modal-content> 72994 </sonic-modal> 72995 `, 72996 // -- MERCH 72997 [routes.merch]: ({ slug }) => { 72998 const id = idFromSlug(slug); 72999 const endpoint = entityEndPoint({ 73000 entityType: EntityType.Merch, 73001 entityId: Number(id), 73002 view: entityView.full 73003 }); 73004 return b$1` 73005 <sonic-modal visible removeHashOnHide width="95vw" maxWidth="60rem"> 73006 <sonic-modal-content> 73007 <sonic-fetch key="data" dataProvider=${endpoint}> 73008 <sonic-merch displayTitle displayText></sonic-merch> 73009 </sonic-fetch> 73010 </sonic-modal-content> 73011 </sonic-modal> 73012 `; 73013 } 73014 }; 73015 if (!this.customRoutes?.["account"]) { 73016 routerRoutes[routes.account] = () => b$1`<sonic-account></sonic-account>`; 73017 } 73018 return routerRoutes; 73019 } 73020 render() { 73021 return b$1`<sonic-router .routes=${this.getRouterRoutes()}></sonic-router>`; 73022 } 73023 }; 73024 __decorateClass$2([ 73025 n$5({ type: Object }) 73026 ], SonicDefaultRouter.prototype, "defaultRoutes", 2); 73027 __decorateClass$2([ 73028 n$5({ type: Object }) 73029 ], SonicDefaultRouter.prototype, "customRoutes", 2); 73030 SonicDefaultRouter = __decorateClass$2([ 73031 t$3(tagName), 73032 awaitConnectedAncestors(APP_TAG_SELECTOR) 73033 ], SonicDefaultRouter); 73034 const cleanCartMessages = (result) => { 73035 const muteCartSuccessMessages = dp("toastSettings").muteCartSuccessMessages?.get() ? true : false; 73036 const counterContext = document.querySelector("sonic-counter-app"); 73037 const isIframeContext = window.self !== window.top; 73038 if (!muteCartSuccessMessages && !counterContext && !isIframeContext) { 73039 return result; 73040 } 73041 const textToExclude = [ 73042 "ajouté au panier", 73043 "retiré du panier", 73044 "mis à jour dans votre panier", 73045 "has been added to the cart", 73046 "has been removed from the cart", 73047 "has been updated in your cart", 73048 "wurde dem Warenkorb hinzugefügt", 73049 "wurde aus dem Warenkorb entfernt", 73050 "wurde in Ihrem Warenkorb aktualisiert", 73051 "toegevoegd aan het mandje", 73052 "verwijderd uit het mandje", 73053 "bijgewerkt in uw mandje" 73054 ]; 73055 if (result?.messages && result.messages?.length > 0) { 73056 result.messages = result.messages.filter((message) => { 73057 const messageContent = message?.content?.toLowerCase(); 73058 if (messageContent) { 73059 return !textToExclude.some((term) => messageContent.includes(term.toLowerCase())); 73060 } 73061 return true; 73062 }); 73063 } 73064 return result; 73065 }; 73066 dp("sonic-api").lastResponse.processed.onAssign((processed) => { 73067 if (processed?.data && "cartType" in processed.data) { 73068 processed = cleanCartMessages(processed); 73069 } 73070 const hasSuccessMessage = processed?.messages?.some((message) => message.status === "success"); 73071 if (hasSuccessMessage && typeof SonicToast !== "undefined") { 73072 SonicToast.removeTemporaryItems(); 73073 } 73074 set("defaultMessages", processed); 73075 }); 73076 (() => { 73077 const seq = ["ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight", "b", "a"]; 73078 let idx = 0; 73079 window.addEventListener("keydown", (e2) => {
73080 const k2 = e2.key.length === 1 ? e2.key.toLowerCase() : e2.key; 73081 const target = seq[idx].length === 1 ? seq[idx].toLowerCase() : seq[idx]; 73082 if (k2 === target) { 73083 idx++; 73084 if (idx === seq.length) { 73085 idx = 0; 73086 if (!document.getElementById("guichet-easter-egg-script")) { 73087 const s2 = document.createElement("script"); 73088 s2.id = "guichet-easter-egg-script"; 73089 s2.src = `/sites/all/modules/la-billetterie/traitements/mockups/guichet_easter_egg.js?v=${Date.now()}`; 73090 document.body.appendChild(s2); 73091 } 73092 } 73093 } else { 73094 idx = 0; 73095 } 73096 }); 73097 })(); 73098 var __defProp$1 = Object.defineProperty; 73099 var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor; 73100 var __decorateClass$1 = (decorators, target, key, kind) => { 73101 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target; 73102 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 73103 if (decorator = decorators[i2]) 73104 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 73105 if (kind && result) __defProp$1(target, key, result); 73106 return result; 73107 }; 73108 let SonicReservationSummary = class extends Fetcher$1(Subscriber$1(i$6)) { 73109 constructor() { 73110 super(...arguments); 73111 this.skeleton = false; 73112 this.can_split = false; 73113 this.showLastQuote = false; 73114 } 73115 // @property({type: String, attribute: "data-id"}) id = ""; 73116 connectedCallback() { 73117 this.isFetchEnabled = this.hasAttribute("fetch"); 73118 this.setAttribute("invalidateOnPageShow", "invalidateOnPageShow"); 73119 super.connectedCallback(); 73120 } 73121 willUpdate(_changedProperties) { 73122 if (_changedProperties.has("props")) { 73123 this.can_split = !isLockedForever(this.props?.status ?? ReservationStatus.Draft) && !isRequest(this.props?.cartType); 73124 } 73125 } 73126 renderSkeleton() { 73127 return b$1`<div class="flex @container py-6"> 73128 <div 73129 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" 73130 > 73131 <div class=""> 73132 <div class=" w-20 h-4 bg-neutral-100 rounded mb-1"></div> 73133 <div class=" w-10 h-3 bg-neutral-100 rounded"></div> 73134 </div> 73135 <div> 73136 <div class=" w-20 h-4 bg-neutral-100 rounded mb-1"></div> 73137 <div class=" w-30 h-4 bg-neutral-100 rounded"></div> 73138 </div> 73139 <div> 73140 <div class="flex h-6"> 73141 <div class=" w-30 h-4 bg-neutral-200 rounded mb-1"></div> 73142 <div class=" w-30 h-6 bg-neutral-200 rounded mb-1 ml-auto"></div> 73143 </div> 73144 <div class="mb-[2px] w-full border-t border-t-neutral-200"></div> 73145 </div> 73146 </div> 73147 <div class="ml-auto text-right"> 73148 <div class=" w-9 h-9 bg-neutral-100 rounded-full"></div> 73149 </div> 73150 </div>`; 73151 } 73152 render() { 73153 if (this.skeleton) { 73154 return this.renderSkeleton(); 73155 } 73156 if (!this.props?.id) { 73157 return A$1; 73158 } 73159 let routeName = "reservation"; 73160 if (isWaitingList(this.props?.cartType)) { 73161 routeName = "admin.waitingList"; 73162 } else if (isReservationRequest(this.props?.cartType)) { 73163 routeName = "admin.reservation-request"; 73164 } 73165 return b$1`<div class="flex @container py-4 text-sm"> 73166 <div 73167 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" 73168 > 73169 <div> 73170 <div class="font-bold text-sm uppercase">N° ${getCartNumber(this.props)}</div> 73171 <sonic-date 73172 date="${this.props?.created_at}" 73173 class="leading-none w-20 inline-block whitespace-nowrap" 73174 day="2-digit" 73175 weekday="hidden" 73176 month="2-digit" 73177 > 73178 </sonic-date> 73179 73180 <div class="mt-2"> 73181 ${isInitialRequest(this.props) ? b$1`<sonic-badge type="neutral" class="mb-1" size="xs"> 73182 <sonic-icon name="circle-info" library="custom"></sonic-icon> 73183 ${t("initial_request")} 73184 </sonic-badge>` : A$1} 73185 73186 <sonic-reservation-status size="xs"></sonic-reservation-status> 73187 73188 ${this.currentQuoteInfos()} 73189 ${displayExpired(this.props?.status ?? ReservationStatus.Draft) ? b$1`<sonic-cart-remaining-time class=" mt-1" badge></sonic-cart-remaining-time> ` : A$1} 73190 </div> 73191 ${this.props.canCheckout === false ? b$1`<sonic-tooltip label="${t("cart_payement_buttons_error_reservation")}" class="my-2 mx-2"> 73192 <sonic-icon 73193 name="triangle-exclamation" 73194 library="custom" 73195 class="text-danger " 73196 size="xl" 73197 tabindex="0" 73198 ></sonic-icon> 73199 </sonic-tooltip>` : A$1} 73200 ${this.props?.passCulture?.enabled ? b$1`<div class="mt-2"> 73201 <sonic-tooltip label="Prise en charge pass culture"> 73202 ${svgPassCulture({ 73203 color: "currentColor" 73204 })} 73205 </sonic-tooltip> 73206 </div>` : A$1} 73207 </div> 73208 <div> 73209 <sonic-user-info subDataProvider="buyer"></sonic-user-info> 73210 73211 ${this.props?.publicNotes ? b$1`<div class="hidden @5xl:flex my-3 gap-x-2 text-info items-start"> 73212 <sonic-icon name="comment" library="custom" class="shrink-0" size="lg" prefix="light"></sonic-icon> 73213 <div class=" text-xs leading-tight" style="overflow-wrap: break-word;word-break:break-word"> 73214 <div class="whitespace-pre-line">${this.props.publicNotes}</div> 73215 </div> 73216 </div>` : A$1} 73217 ${this.props?.admin && this.props?.admin.id !== 1 ? b$1` 73218 <div class="hidden mt-3 mb-3 gap-2 @3xl:flex @5xl:flex"> 73219 <sonic-icon name="face-smile" library="custom" class="shrink-0" size="lg" prefix="light"></sonic-icon> 73220 <div> 73221 <div class="text-2xs text-neutral-500 uppercase">Opérateur</div> 73222 <div class="font-bold">${this.props.admin.name}</div> 73223 </div> 73224 </div> 73225 ` : A$1} 73226 ${this.props?.notes ? b$1`<div class="hidden @5xl:flex gap-x-2 text-info items-start"> 73227 <sonic-icon 73228 name="comment-exclamation" 73229 library="custom" 73230 class="shrink-0" 73231 size="lg" 73232 prefix="light" 73233 ></sonic-icon> 73234 <div class=" text-xs leading-tight " style="overflow-wrap: break-word;word-break:break-word"> 73235 <div class="whitespace-pre-line">${this.props.notes}</div> 73236 </div> 73237 </div>` : A$1} 73238 </div> 73239 <div class="@5xl:pl-4 justify-center"> 73240 ${this.props?.title ? b$1`<div class="text-lg font-bold mb-2">${this.props.title}</div>` : A$1} 73241 <sonic-cart-items-condensed mode="readonly"></sonic-cart-items-condensed> 73242 ${this.renderLastQuote()} 73243 </div> 73244 </div> 73245 <div class="ml-auto text-right flex flex-col gap-2 items-center"> 73246 <sonic-tooltip label="Modifier"> 73247 <sonic-app-link 73248 variant="default" 73249 shape="circle" 73250 type="neutral" 73251 to=${routeName} 73252 .id="${this.props.id.toString()}" 73253 size="sm" 73254 ><sonic-icon name="pen" library="custom"></sonic-icon 73255 ></sonic-app-link> 73256 </sonic-tooltip> 73257 73258 ${this.can_split ? b$1`<sonic-tooltip label="Retrait partiel" placement="bottom"> 73259 <sonic-app-link 73260 icon 73261 variant="outline" 73262 shape="circle" 73263 type="neutral" 73264 to=${routeName} 73265 .id="${this.props.id.toString()}" 73266 .query=${{ display_split: true }} 73267 size="xs" 73268 ><sonic-icon name="split" library="custom"></sonic-icon 73269 ></sonic-app-link> 73270 </sonic-tooltip>` : A$1} 73271 </div> 73272 </div>`; 73273 } 73274 toggleLastQuote() { 73275 this.showLastQuote = !this.showLastQuote; 73276 } 73277 currentQuoteInfos() { 73278 const currentQuote = this.props?.quotes?.current; 73279 if (!currentQuote?.email_history?.length) return A$1; 73280 const { email_history } = currentQuote; 73281 const hasPaymentLink = email_history.some((item) => item.has_payment_link); 73282 const hasQuote = email_history.length > 0; 73283 if (!hasPaymentLink && !hasQuote) return A$1; 73284 return b$1`<div class="flex items-center gap-x-5 gap-y-1 text-sm flex-wrap my-3 text-info"> 73285 ${hasQuote ? b$1`<sonic-badge type="info" variant="ghost" class="flex items-start gap-[.35em] text-xs"> 73286 <sonic-icon name="envelope-open-text" library="custom"></sonic-icon> ${getQuoteTypeLabel( 73287 this.props?.cartType 73288 )} 73289 envoyé 73290 </sonic-badge>` : A$1} 73291 ${hasPaymentLink ? b$1`<sonic-badge type="info" variant="ghost" class="flex items-start gap-[.35em] text-xs"> 73292 <sonic-icon name="square-arrow-up-right" library="custom"></sonic-icon> Lien de paiement envoyé 73293 </sonic-badge>` : A$1} 73294 </div>`; 73295 } 73296 renderLastQuote() { 73297 if (isRequest(this.props?.cartType)) return A$1; 73298 const lastQuote = this.props?.quotes?.current || this.props?.quotes?.all?.[0]; 73299 const isPendingOrConfirmed = this.props?.status === ReservationStatus.Pending || this.props?.status === ReservationStatus.Confirmed || this.props?.status === ReservationStatus.Submitted; 73300 const lastQuotePrefix = isPendingOrConfirmed ? "Devis en cours" : "Dernier devis"; 73301 const renderLastQuote = lastQuote && this.props?.status !== ReservationStatus.Draft; 73302 if (!renderLastQuote) return A$1; 73303 return b$1` 73304 <div class="flex gap-3 items-center mt-5 mb-3 "> 73305 <sonic-button 73306 @click=${() => this.toggleLastQuote()} 73307 variant="outline" 73308 size="xs" 73309 class="shrink-0 ${isPendingOrConfirmed ? "pointer-events-none" : ""}" 73310 ><span class="font-bold">${lastQuotePrefix} : ${lastQuote.title}</span> 73311 ${!isPendingOrConfirmed ? b$1`<sonic-icon 73312 name=${this.showLastQuote ? "chevron-up" : "chevron-down"} 73313 class="ml-2" 73314 library="custom" 73315 ></sonic-icon>` : A$1} 73316 </sonic-button> 73317 <div class="border-t w-full"></div> 73318 </div> 73319 ${this.showLastQuote ? b$1`<sonic-cart-items-condensed class="mb-2 " subDataProvider="quotes.all.0"></sonic-cart-items-condensed>` : A$1} 73320 `; 73321 } 73322 }; 73323 SonicReservationSummary.styles = [ 73324 tailwind, 73325 i$9` 73326 :host([skeleton]) { 73327 min-height: 8rem; 73328 display: block; 73329 } 73330 ` 73331 ]; 73332 __decorateClass$1([ 73333 n$5({ type: Boolean }) 73334 ], SonicReservationSummary.prototype, "skeleton", 2); 73335 __decorateClass$1([ 73336 r$5() 73337 ], SonicReservationSummary.prototype, "can_split", 2); 73338 __decorateClass$1([ 73339 r$5() 73340 ], SonicReservationSummary.prototype, "showLastQuote", 2); 73341 SonicReservationSummary = __decorateClass$1([ 73342 t$3("sonic-reservation-summary") 73343 ], SonicReservationSummary); 73344 var __defProp = Object.defineProperty; 73345 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 73346 var __decorateClass = (decorators, target, key, kind) => { 73347 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; 73348 for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--) 73349 if (decorator = decorators[i2]) 73350 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 73351 if (kind && result) __defProp(target, key, result); 73352 return result; 73353 }; 73354 let SonicUserCartList = class extends i$6 { 73355 constructor() { 73356 super(...arguments); 73357 this.userId = 0; 73358 this.userEmail = ""; 73359 this.cartType = CartType.Cart; 73360 this.dataProviderExpression = ""; 73361 this._count = 0; 73362 this.statuses = [ 73363 ReservationStatus.Pending, 73364 ReservationStatus.Confirmed, 73365 ReservationStatus.Processing, 73366 ReservationStatus.Submitted, 73367 ReservationStatus.Declined, 73368 ReservationStatus.PartiallyProcessed, 73369 ReservationStatus.Draft 73370 ]; 73371 } 73372 async willUpdate(changedProperties) { 73373 if (changedProperties.has("userId")) { 73374 this.dataProviderExpression = getCartEndpoint({ 73375 type: this.cartType, 73376 userId: this.userId, 73377 statuses: this.statuses, 73378 isQueue: true 73379 }); 73380 await this.setCount(); 73381 } 73382 } 73383 async setCount() { 73384 const api2 = new API(HTML.getApiConfiguration(this)); 73385 const endpoint = getCartEndpoint({ 73386 type: this.cartType, 73387 userId: this.userId, 73388 statuses: this.statuses, 73389 isQueue: true, 73390 limit: 1 73391 }); 73392 const response = await api2.get(endpoint); 73393 this._count = response?.total ?? 0; 73394 } 73395 getTitle() { 73396 switch (this.cartType) { 73397 case CartType.WaitingLists: 73398 return "Listes d'attente"; 73399 case CartType.ReservationRequest: 73400 return "Demandes de réservation"; 73401 case CartType.Reservation: 73402 return "Réservations / Invitations"; 73403 case CartType.Cart: 73404 return "Paniers"; 73405 default: 73406 return "Paniers"; 73407 } 73408 } 73409 getCartTypeIconName() { 73410 switch (this.cartType) { 73411 case CartType.WaitingLists: 73412 return "list-ol"; 73413 case CartType.ReservationRequest: 73414 return "file-heart"; 73415 case CartType.Reservation: 73416 return "badge-check"; 73417 case CartType.Cart: 73418 return "shopping-basket"; 73419 default: 73420 return "cart"; 73421 } 73422 } 73423 getLinkHref() { 73424 if (!this.userEmail) { 73425 return void 0; 73426 } 73427 switch (this.cartType) { 73428 case CartType.WaitingLists: 73429 return appRoute("admin.waitingLists").query({ "reset-filtres": 1, nom_prenom_email: this.userEmail }); 73430 case CartType.ReservationRequest: 73431 return appRoute("admin.reservation-requests").query({ "reset-filtres": 1, nom_prenom_email: this.userEmail }); 73432 case CartType.Reservation: 73433 return appRoute("reservations").query({ "reset-filtres": 1, nom_prenom_email: this.userEmail }); 73434 } 73435 return void 0; 73436 } 73437 render() { 73438 return b$1`<div class="text-2xl font-normal mb-2 flex items-center gap-2"> 73439 <sonic-icon library="custom" name=${this.getCartTypeIconName()} variant="ghost" shape="circle"></sonic-icon> 73440 ${this._count} ${this.getTitle()}
73441 ${this.getLinkHref() ? b$1` <sonic-divider vertical></sonic-divider> 73442 <sonic-tooltip label="Voir tous"> 73443 <sonic-button shape="circle" variant="outline" icon size="xs" href=${this.getLinkHref()}> 73444 <sonic-icon library="custom" name="arrow-right" variant="ghost" shape="circle"></sonic-icon> 73445 </sonic-button> 73446 </sonic-tooltip>` : A$1} 73447 </div> 73448 ${this.renderQueue()}`; 73449 } 73450 renderQueue() { 73451 if (!this.dataProviderExpression || this._count === 0) { 73452 return A$1; 73453 } 73454 return b$1`<sonic-queue 73455 lazyload 73456 dataProviderExpression=${this.dataProviderExpression} 73457 key="data" 73458 class="border border-neutral-100 block rounded-md" 73459 .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>`} 73460 .items=${(_item, metadata) => { 73461 const { firstChild, lastChild, odd } = metadata; 73462 return b$1`<sonic-reservation-summary 73463 class=" ${odd ? "bg-neutral-50" : ""} ${firstChild ? "rounded-t-md" : ""} ${lastChild ? "rounded-b-md" : ""} block p-2" 73464 ></sonic-reservation-summary>`; 73465 }} 73466 > 73467 </sonic-queue>`; 73468 } 73469 }; 73470 SonicUserCartList.styles = [tailwind]; 73471 __decorateClass([ 73472 n$5({ type: Number }) 73473 ], SonicUserCartList.prototype, "userId", 2); 73474 __decorateClass([ 73475 n$5({ type: String }) 73476 ], SonicUserCartList.prototype, "userEmail", 2); 73477 __decorateClass([ 73478 n$5({ type: String }) 73479 ], SonicUserCartList.prototype, "cartType", 2); 73480 __decorateClass([ 73481 r$5() 73482 ], SonicUserCartList.prototype, "dataProviderExpression", 2); 73483 __decorateClass([ 73484 r$5() 73485 ], SonicUserCartList.prototype, "_count", 2); 73486 SonicUserCartList = __decorateClass([ 73487 t$3("sonic-user-cart-list"), 73488 awaitConnectedAncestors(APP_TAG_SELECTOR) 73489 ], SonicUserCartList); 73490 const windowAny = window;
73491 windowAny["concordeIsLoaded"] = true; 73492 window.dispatchEvent(new CustomEvent("concorde-loaded")); 73493})();
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.