@gomusdev/web-components 4.8.0 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.8.1 (2026-07-16)
4
+
5
+ ### Bug Fixes
6
+
7
+ * **couponRedemption:** clear stale error when flush() succeeds
8
+ * **forms:** clear form-level api errors on valid submit, closes [#apiErrors](https://gitlab.giantmonkey.de/gomus/frontend/issues/apiErrors) [#147](https://gitlab.giantmonkey.de/gomus/frontend/issues/147)
9
+ * **forms:** reset stale success message on valid submit
10
+
3
11
  ## 4.8.0 (2026-07-15)
4
12
 
5
13
  ### Features
@@ -14872,6 +14872,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14872
14872
  * @param {string[] | Record<string, string[]>} errors - Errors passed as an array or an object where keys are API field keys and values are arrays of error messages. If an array is provided, it assigns the errors directly. If an object is provided, it maps the errors to the respective fields based on their API keys.
14873
14873
  */
14874
14874
  set apiErrors(errors) {
14875
+ set(this.#apiErrors, [], true);
14875
14876
  this.fields.forEach((f) => f.apiErrors = []);
14876
14877
  if (isArray(errors)) {
14877
14878
  set(this.#apiErrors, errors, true);
@@ -14912,7 +14913,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14912
14913
  */
14913
14914
  get fields() {
14914
14915
  const parent = this.form.closest("go-form");
14915
- return Array.from(this.form.querySelectorAll("go-field")).filter((fe) => fe.closest("go-form") === parent).map((fe) => fe.getField?.()).filter((f) => f);
14916
+ return Array.from(this.form.querySelectorAll("go-field")).filter((fe) => fe.closest("go-form") === parent).map((fe) => fe.getField?.()).filter((f) => !!f);
14916
14917
  }
14917
14918
  toString() {
14918
14919
  return `Form: ${this.formId}, Fields: [${this.fields.map((f) => f.key).join(", ")}], Data: ${JSON.stringify(this.formData)}`;
@@ -14980,6 +14981,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14980
14981
  details?.form?.dispatchEvent(new Event("go-after-validation", event));
14981
14982
  if (details.isValid) {
14982
14983
  details.apiErrors = {};
14984
+ details.successMessage = void 0;
14983
14985
  details?.form?.dispatchEvent(new Event("go-submit", event));
14984
14986
  $$props.$$host.dispatchEvent(new Event("submit", {
14985
14987
  bubbles: true,
@@ -18599,6 +18601,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18599
18601
  form.details.apiErrors = result.errors;
18600
18602
  return result;
18601
18603
  }
18604
+ form.details.apiErrors = [];
18602
18605
  if (field) field.value = "";
18603
18606
  form.dispatchEvent(new Event("go-success", {
18604
18607
  bubbles: true,
@@ -14871,6 +14871,7 @@ var FormDetails = class {
14871
14871
  * @param {string[] | Record<string, string[]>} errors - Errors passed as an array or an object where keys are API field keys and values are arrays of error messages. If an array is provided, it assigns the errors directly. If an object is provided, it maps the errors to the respective fields based on their API keys.
14872
14872
  */
14873
14873
  set apiErrors(errors) {
14874
+ set(this.#apiErrors, [], true);
14874
14875
  this.fields.forEach((f) => f.apiErrors = []);
14875
14876
  if (isArray(errors)) {
14876
14877
  set(this.#apiErrors, errors, true);
@@ -14911,7 +14912,7 @@ var FormDetails = class {
14911
14912
  */
14912
14913
  get fields() {
14913
14914
  const parent = this.form.closest("go-form");
14914
- return Array.from(this.form.querySelectorAll("go-field")).filter((fe) => fe.closest("go-form") === parent).map((fe) => fe.getField?.()).filter((f) => f);
14915
+ return Array.from(this.form.querySelectorAll("go-field")).filter((fe) => fe.closest("go-form") === parent).map((fe) => fe.getField?.()).filter((f) => !!f);
14915
14916
  }
14916
14917
  toString() {
14917
14918
  return `Form: ${this.formId}, Fields: [${this.fields.map((f) => f.key).join(", ")}], Data: ${JSON.stringify(this.formData)}`;
@@ -14979,6 +14980,7 @@ function Form($$anchor, $$props) {
14979
14980
  details?.form?.dispatchEvent(new Event("go-after-validation", event));
14980
14981
  if (details.isValid) {
14981
14982
  details.apiErrors = {};
14983
+ details.successMessage = void 0;
14982
14984
  details?.form?.dispatchEvent(new Event("go-submit", event));
14983
14985
  $$props.$$host.dispatchEvent(new Event("submit", {
14984
14986
  bubbles: true,
@@ -18598,6 +18600,7 @@ function CouponRedemption($$anchor, $$props) {
18598
18600
  form.details.apiErrors = result.errors;
18599
18601
  return result;
18600
18602
  }
18603
+ form.details.apiErrors = [];
18601
18604
  if (field) field.value = "";
18602
18605
  form.dispatchEvent(new Event("go-success", {
18603
18606
  bubbles: true,
@@ -72,9 +72,9 @@ ${i}
72
72
 
73
73
  `)}h.write("payload.value = newResult;"),h.write("return payload;");const x=h.compile();return(k,T)=>x(p,k,T)};let s;const a=Wa,o=!Za.jitless,c=o&&fw.value,f=t.catchall;let u;e._zod.parse=(p,h)=>{u??(u=n.value);const g=p.value;return a(g)?o&&c&&h?.async===!1&&h.jitless!==!0?(s||(s=i(t.shape)),p=s(p,h),f?ph([],g,p,h,u,e):p):r(p,h):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function mh(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const i=e.filter(s=>!Pi(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(a=>ei(a,n,Qn())))}),t)}var X0=H("$ZodUnion",(e,t)=>{ct.init(e,t),Be(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Be(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Be(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Be(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>au(i.source)).join("|")})$`)}});const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let s=!1;const a=[];for(const o of t.options){const l=o._zod.run({value:n.value,issues:[]},i);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(o=>mh(o,n,e,i)):mh(a,n,e,i)}}),ek=H("$ZodIntersection",(e,t)=>{ct.init(e,t),e._zod.parse=(r,n)=>{const i=r.value,s=t.left._zod.run({value:i,issues:[]},n),a=t.right._zod.run({value:i,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([o,l])=>vh(r,o,l)):vh(r,s,a)}});function du(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Fs(e)&&Fs(t)){const r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),i={...e,...t};for(const s of n){const a=du(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};i[s]=a.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const i=e[n],s=t[n],a=du(i,s);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function vh(e,t,r){const n=new Map;let i;for(const o of t.issues)if(o.code==="unrecognized_keys"){i??(i=o);for(const l of o.keys)n.has(l)||n.set(l,{}),n.get(l).l=!0}else e.issues.push(o);for(const o of r.issues)if(o.code==="unrecognized_keys")for(const l of o.keys)n.has(l)||n.set(l,{}),n.get(l).r=!0;else e.issues.push(o);const s=[...n].filter(([,o])=>o.l&&o.r).map(([o])=>o);if(s.length&&i&&e.issues.push({...i,keys:s}),Pi(e))return e;const a=du(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var tk=H("$ZodEnum",(e,t)=>{ct.init(e,t);const r=Gf(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>hw.has(typeof i)).map(i=>typeof i=="string"?Ha(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{const a=i.value;return n.has(a)||i.issues.push({code:"invalid_value",values:r,input:a,inst:e}),i}}),rk=H("$ZodTransform",(e,t)=>{ct.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Hf(e.constructor.name);const i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(r.value=s,r.fallback=!0,r));if(i instanceof Promise)throw new Ii;return r.value=i,r.fallback=!0,r}});function gh(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var yh=H("$ZodOptional",(e,t)=>{ct.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Be(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${au(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const i=r.value,s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>gh(a,i)):gh(s,i)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),nk=H("$ZodExactOptional",(e,t)=>{yh.init(e,t),Be(e._zod,"values",()=>t.innerType._zod.values),Be(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),ik=H("$ZodNullable",(e,t)=>{ct.init(e,t),Be(e._zod,"optin",()=>t.innerType._zod.optin),Be(e._zod,"optout",()=>t.innerType._zod.optout),Be(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${au(r.source)}|null)$`):void 0}),Be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),sk=H("$ZodDefault",(e,t)=>{ct.init(e,t),e._zod.optin="optional",Be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>bh(s,t)):bh(i,t)}});function bh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ak=H("$ZodPrefault",(e,t)=>{ct.init(e,t),e._zod.optin="optional",Be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),ok=H("$ZodNonOptional",(e,t)=>{ct.init(e,t),Be(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>_h(s,e)):_h(i,e)}});function _h(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var lk=H("$ZodCatch",(e,t)=>{ct.init(e,t),e._zod.optin="optional",Be(e._zod,"optout",()=>t.innerType._zod.optout),Be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>ei(a,n,Qn()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>ei(s,n,Qn()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),uk=H("$ZodPipe",(e,t)=>{ct.init(e,t),Be(e._zod,"values",()=>t.in._zod.values),Be(e._zod,"optin",()=>t.in._zod.optin),Be(e._zod,"optout",()=>t.out._zod.optout),Be(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(r,n);return s instanceof Promise?s.then(a=>Xa(a,t.in,n)):Xa(s,t.in,n)}const i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Xa(s,t.out,n)):Xa(i,t.out,n)}});function Xa(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var ck=H("$ZodReadonly",(e,t)=>{ct.init(e,t),Be(e._zod,"propValues",()=>t.innerType._zod.propValues),Be(e._zod,"values",()=>t.innerType._zod.values),Be(e._zod,"optin",()=>t.innerType?._zod?.optin),Be(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(wh):wh(i)}});function wh(e){return e.value=Object.freeze(e.value),e}var dk=H("$ZodCustom",(e,t)=>{Ut.init(e,t),ct.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(s=>kh(s,r,n,e));kh(i,r,n,e)}});function kh(e,t,r,n){if(!e){const i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(Ns(i))}}var Sh,fk=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function hk(){return new fk}(Sh=globalThis).__zod_globalRegistry??(Sh.__zod_globalRegistry=hk());var Rs=globalThis.__zod_globalRegistry;function pk(e,t){return new e({type:"string",...be(t)})}function mk(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...be(t)})}function Eh(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...be(t)})}function vk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...be(t)})}function gk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...be(t)})}function yk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...be(t)})}function bk(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...be(t)})}function _k(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...be(t)})}function wk(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...be(t)})}function kk(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...be(t)})}function Sk(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...be(t)})}function Ek(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...be(t)})}function xk(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...be(t)})}function Tk(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...be(t)})}function Ak(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...be(t)})}function Ck(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...be(t)})}function Ok(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...be(t)})}function Dk(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...be(t)})}function Ik(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...be(t)})}function Pk(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...be(t)})}function $k(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...be(t)})}function Mk(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...be(t)})}function Fk(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...be(t)})}function Nk(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...be(t)})}function Rk(e,t){return new e({type:"string",format:"date",check:"string_format",...be(t)})}function Lk(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...be(t)})}function zk(e,t){return new e({type:"string",format:"duration",check:"string_format",...be(t)})}function qk(e,t){return new e({type:"number",checks:[],...be(t)})}function Uk(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...be(t)})}function Vk(e){return new e({type:"unknown"})}function Bk(e,t){return new e({type:"never",...be(t)})}function xh(e,t){return new lh({check:"less_than",...be(t),value:e,inclusive:!1})}function fu(e,t){return new lh({check:"less_than",...be(t),value:e,inclusive:!0})}function Th(e,t){return new uh({check:"greater_than",...be(t),value:e,inclusive:!1})}function hu(e,t){return new uh({check:"greater_than",...be(t),value:e,inclusive:!0})}function Ah(e,t){return new l0({check:"multiple_of",...be(t),value:e})}function Ch(e,t){return new c0({check:"max_length",...be(t),maximum:e})}function eo(e,t){return new d0({check:"min_length",...be(t),minimum:e})}function Oh(e,t){return new f0({check:"length_equals",...be(t),length:e})}function jk(e,t){return new h0({check:"string_format",format:"regex",...be(t),pattern:e})}function Zk(e){return new p0({check:"string_format",format:"lowercase",...be(e)})}function Wk(e){return new m0({check:"string_format",format:"uppercase",...be(e)})}function Hk(e,t){return new v0({check:"string_format",format:"includes",...be(t),includes:e})}function Gk(e,t){return new g0({check:"string_format",format:"starts_with",...be(t),prefix:e})}function Kk(e,t){return new y0({check:"string_format",format:"ends_with",...be(t),suffix:e})}function $i(e){return new b0({check:"overwrite",tx:e})}function Yk(e){return $i(t=>t.normalize(e))}function Jk(){return $i(e=>e.trim())}function Qk(){return $i(e=>e.toLowerCase())}function Xk(){return $i(e=>e.toUpperCase())}function eS(){return $i(e=>dw(e))}function tS(e,t,r){return new e({type:"array",element:t,...be(r)})}function rS(e,t,r){return new e({type:"custom",check:"custom",fn:t,...be(r)})}function nS(e,t){const r=iS(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(Ns(i,n.value,r._zod.def));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(Ns(s))}},e(n.value,n)),t);return r}function iS(e,t){const r=new Ut({check:"custom",...be(t)});return r._zod.check=e,r}function Dh(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Rs,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function _t(e,t,r={path:[],schemaPath:[]}){var n;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);const o=e._zod.toJSONSchema?.();if(o)a.schema=o;else{const c={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,c);else{const u=a.schema,p=t.processors[i.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);p(e,t,u,c)}const f=e._zod.parent;f&&(a.ref||(a.ref=f),_t(f,t,c),t.seen.get(f).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Dt(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Ih(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const a of e.seen.entries()){const o=e.metadataRegistry.get(a[0])?.id;if(o){const l=n.get(o);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${o}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(o,a[0])}}const i=a=>{const o=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(a[0])?.id,u=e.external.uri??(h=>h);if(f)return{ref:u(f)};const p=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=p,{defId:p,ref:`${u("__shared")}#/${o}/${p}`}}if(a[1]===r)return{ref:"#"};const l=`#/${o}/`,c=a[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:l+c}},s=a=>{if(a[1].schema.$ref)return;const o=a[1],{ref:l,defId:c}=i(a);o.def={...o.schema},c&&(o.defId=c);const f=o.schema;for(const u in f)delete f[u];f.$ref=l};if(e.cycles==="throw")for(const a of e.seen.entries()){const o=a[1];if(o.cycle)throw new Error(`Cycle detected: #/${o.cycle?.join("/")}/<root>
74
74
 
75
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const o=a[1];if(t===a[0]){s(a);continue}if(e.external){const l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(o.cycle){s(a);continue}if(o.count>1&&e.reused==="ref"){s(a);continue}}}function Ph(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=o=>{const l=e.seen.get(o);if(l.ref===null)return;const c=l.def??l.schema,f={...c},u=l.ref;if(l.ref=null,u){n(u);const h=e.seen.get(u),g=h.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,f),o._zod.parent===u)for(const m in c)m==="$ref"||m==="allOf"||m in f||delete c[m];if(g.$ref&&h.def)for(const m in c)m==="$ref"||m==="allOf"||m in h.def&&JSON.stringify(c[m])===JSON.stringify(h.def[m])&&delete c[m]}const p=o._zod.parent;if(p&&p!==u){n(p);const h=e.seen.get(p);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(const g in c)g==="$ref"||g==="allOf"||g in h.def&&JSON.stringify(c[g])===JSON.stringify(h.def[g])&&delete c[g]}e.override({zodSchema:o,jsonSchema:c,path:l.path??[]})};for(const o of[...e.seen.entries()].reverse())n(o[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,r.def??r.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&i.id===s&&delete i.id;const a=e.external?.defs??{};for(const o of e.seen.entries()){const l=o[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,a[l.defId]=l.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:to(t,"input",e.processors),output:to(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Dt(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Dt(n.element,r);if(n.type==="set")return Dt(n.valueType,r);if(n.type==="lazy")return Dt(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Dt(n.innerType,r);if(n.type==="intersection")return Dt(n.left,r)||Dt(n.right,r);if(n.type==="record"||n.type==="map")return Dt(n.keyType,r)||Dt(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Dt(n.in,r)||Dt(n.out,r);if(n.type==="object"){for(const i in n.shape)if(Dt(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(Dt(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(Dt(i,r))return!0;return!!(n.rest&&Dt(n.rest,r))}return!1}var sS=(e,t={})=>r=>{const n=Dh({...r,processors:t});return _t(e,n),Ih(n,e),Ph(n,e)},to=(e,t,r={})=>n=>{const{libraryOptions:i,target:s}=n??{},a=Dh({...i??{},target:s,io:t,processors:r});return _t(e,a),Ih(a,e),Ph(a,e)},aS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oS=(e,t,r,n)=>{const i=r;i.type="string";const{minimum:s,maximum:a,format:o,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof a=="number"&&(i.maxLength=a),o&&(i.format=aS[o]??o,i.format===""&&delete i.format,o==="time"&&delete i.format),c&&(i.contentEncoding=c),l&&l.size>0){const f=[...l];f.length===1?i.pattern=f[0].source:f.length>1&&(i.allOf=[...f.map(u=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:u.source}))])}},lS=(e,t,r,n)=>{const i=r,{minimum:s,maximum:a,format:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:f}=e._zod.bag;typeof o=="string"&&o.includes("int")?i.type="integer":i.type="number";const u=typeof f=="number"&&f>=(s??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";u?h?(i.minimum=f,i.exclusiveMinimum=!0):i.exclusiveMinimum=f:typeof s=="number"&&(i.minimum=s),p?h?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof a=="number"&&(i.maximum=a),typeof l=="number"&&(i.multipleOf=l)},uS=(e,t,r,n)=>{r.not={}},cS=(e,t,r,n)=>{},dS=(e,t,r,n)=>{const i=e._zod.def,s=Gf(i.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},fS=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},hS=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},pS=(e,t,r,n)=>{const i=r,s=e._zod.def,{minimum:a,maximum:o}=e._zod.bag;typeof a=="number"&&(i.minItems=a),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=_t(s.element,t,{...n,path:[...n.path,"items"]})},mS=(e,t,r,n)=>{const i=r,s=e._zod.def;i.type="object",i.properties={};const a=s.shape;for(const c in a)i.properties[c]=_t(a[c],t,{...n,path:[...n.path,"properties",c]});const o=new Set(Object.keys(a)),l=new Set([...o].filter(c=>{const f=s.shape[c]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));l.size>0&&(i.required=Array.from(l)),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=_t(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},vS=(e,t,r,n)=>{const i=e._zod.def,s=i.inclusive===!1,a=i.options.map((o,l)=>_t(o,t,{...n,path:[...n.path,s?"oneOf":"anyOf",l]}));s?r.oneOf=a:r.anyOf=a},gS=(e,t,r,n)=>{const i=e._zod.def,s=_t(i.left,t,{...n,path:[...n.path,"allOf",0]}),a=_t(i.right,t,{...n,path:[...n.path,"allOf",1]}),o=l=>"allOf"in l&&Object.keys(l).length===1;r.allOf=[...o(s)?s.allOf:[s],...o(a)?a.allOf:[a]]},yS=(e,t,r,n)=>{const i=e._zod.def,s=_t(i.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},bS=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType},_S=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},wS=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},kS=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},SS=(e,t,r,n)=>{const i=e._zod.def,s=i.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?s?i.out:i.in:i.out;_t(a,t,n);const o=t.seen.get(e);o.ref=a},ES=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType,r.readOnly=!0},$h=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType},xS=H("ZodISODateTime",(e,t)=>{$0.init(e,t),Xe.init(e,t)});function TS(e){return Nk(xS,e)}var AS=H("ZodISODate",(e,t)=>{M0.init(e,t),Xe.init(e,t)});function CS(e){return Rk(AS,e)}var OS=H("ZodISOTime",(e,t)=>{F0.init(e,t),Xe.init(e,t)});function DS(e){return Lk(OS,e)}var IS=H("ZodISODuration",(e,t)=>{N0.init(e,t),Xe.init(e,t)});function PS(e){return zk(IS,e)}var $S=(e,t)=>{th.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>xw(e,r)},flatten:{value:r=>Ew(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,nu,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,nu,2)}},isEmpty:{get(){return e.issues.length===0}}})},dr=H("ZodError",$S,{Parent:Error}),MS=lu(dr),FS=uu(dr),NS=Ka(dr),RS=Ya(dr),LS=Cw(dr),zS=Ow(dr),qS=Dw(dr),US=Iw(dr),VS=Pw(dr),BS=$w(dr),jS=Mw(dr),ZS=Fw(dr),Mh=new WeakMap;function Ls(e,t,r){const n=Object.getPrototypeOf(e);let i=Mh.get(n);if(i||(i=new Set,Mh.set(n,i)),!i.has(t)){i.add(t);for(const s in r){const a=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){const o=a.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o}),o},set(o){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o})}})}}}var dt=H("ZodType",(e,t)=>(ct.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:to(e,"input"),output:to(e,"output")}}),e.toJSONSchema=sS(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>MS(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>NS(e,r,n),e.parseAsync=async(r,n)=>FS(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>RS(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>LS(e,r,n),e.decode=(r,n)=>zS(e,r,n),e.encodeAsync=async(r,n)=>qS(e,r,n),e.decodeAsync=async(r,n)=>US(e,r,n),e.safeEncode=(r,n)=>VS(e,r,n),e.safeDecode=(r,n)=>BS(e,r,n),e.safeEncodeAsync=async(r,n)=>jS(e,r,n),e.safeDecodeAsync=async(r,n)=>ZS(e,r,n),Ls(e,"ZodType",{check(...r){const n=this.def;return this.clone(An(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return Cn(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(N1(r,n))},superRefine(r,n){return this.check(R1(r,n))},overwrite(r){return this.check($i(r))},optional(){return Vh(this)},exactOptional(){return E1(this)},nullable(){return Bh(this)},nullish(){return Vh(Bh(this))},nonoptional(r){return D1(this,r)},array(){return qh(this)},or(r){return g1([this,r])},and(r){return b1(this,r)},transform(r){return Zh(this,k1(r))},default(r){return A1(this,r)},prefault(r){return O1(this,r)},catch(r){return P1(this,r)},pipe(r){return Zh(this,r)},readonly(){return F1(this)},describe(r){const n=this.clone();return Rs.add(n,{description:r}),n},meta(...r){if(r.length===0)return Rs.get(this);const n=this.clone();return Rs.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Rs.get(e)?.description},configurable:!0}),e)),Fh=H("_ZodString",(e,t)=>{cu.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(n,i,s)=>oS(e,n,i,s);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Ls(e,"_ZodString",{regex(...n){return this.check(jk(...n))},includes(...n){return this.check(Hk(...n))},startsWith(...n){return this.check(Gk(...n))},endsWith(...n){return this.check(Kk(...n))},min(...n){return this.check(eo(...n))},max(...n){return this.check(Ch(...n))},length(...n){return this.check(Oh(...n))},nonempty(...n){return this.check(eo(1,...n))},lowercase(n){return this.check(Zk(n))},uppercase(n){return this.check(Wk(n))},trim(){return this.check(Jk())},normalize(...n){return this.check(Yk(...n))},toLowerCase(){return this.check(Qk())},toUpperCase(){return this.check(Xk())},slugify(){return this.check(eS())}})}),WS=H("ZodString",(e,t)=>{cu.init(e,t),Fh.init(e,t),e.email=r=>e.check(mk(HS,r)),e.url=r=>e.check(_k(GS,r)),e.jwt=r=>e.check(Fk(u1,r)),e.emoji=r=>e.check(wk(KS,r)),e.guid=r=>e.check(Eh(Nh,r)),e.uuid=r=>e.check(vk(ro,r)),e.uuidv4=r=>e.check(gk(ro,r)),e.uuidv6=r=>e.check(yk(ro,r)),e.uuidv7=r=>e.check(bk(ro,r)),e.nanoid=r=>e.check(kk(YS,r)),e.guid=r=>e.check(Eh(Nh,r)),e.cuid=r=>e.check(Sk(JS,r)),e.cuid2=r=>e.check(Ek(QS,r)),e.ulid=r=>e.check(xk(XS,r)),e.base64=r=>e.check(Pk(a1,r)),e.base64url=r=>e.check($k(o1,r)),e.xid=r=>e.check(Tk(e1,r)),e.ksuid=r=>e.check(Ak(t1,r)),e.ipv4=r=>e.check(Ck(r1,r)),e.ipv6=r=>e.check(Ok(n1,r)),e.cidrv4=r=>e.check(Dk(i1,r)),e.cidrv6=r=>e.check(Ik(s1,r)),e.e164=r=>e.check(Mk(l1,r)),e.datetime=r=>e.check(TS(r)),e.date=r=>e.check(CS(r)),e.time=r=>e.check(DS(r)),e.duration=r=>e.check(PS(r))});function Jt(e){return pk(WS,e)}var Xe=H("ZodStringFormat",(e,t)=>{Je.init(e,t),Fh.init(e,t)}),HS=H("ZodEmail",(e,t)=>{E0.init(e,t),Xe.init(e,t)}),Nh=H("ZodGUID",(e,t)=>{k0.init(e,t),Xe.init(e,t)}),ro=H("ZodUUID",(e,t)=>{S0.init(e,t),Xe.init(e,t)}),GS=H("ZodURL",(e,t)=>{x0.init(e,t),Xe.init(e,t)}),KS=H("ZodEmoji",(e,t)=>{T0.init(e,t),Xe.init(e,t)}),YS=H("ZodNanoID",(e,t)=>{A0.init(e,t),Xe.init(e,t)}),JS=H("ZodCUID",(e,t)=>{C0.init(e,t),Xe.init(e,t)}),QS=H("ZodCUID2",(e,t)=>{O0.init(e,t),Xe.init(e,t)}),XS=H("ZodULID",(e,t)=>{D0.init(e,t),Xe.init(e,t)}),e1=H("ZodXID",(e,t)=>{I0.init(e,t),Xe.init(e,t)}),t1=H("ZodKSUID",(e,t)=>{P0.init(e,t),Xe.init(e,t)}),r1=H("ZodIPv4",(e,t)=>{R0.init(e,t),Xe.init(e,t)}),n1=H("ZodIPv6",(e,t)=>{L0.init(e,t),Xe.init(e,t)}),i1=H("ZodCIDRv4",(e,t)=>{z0.init(e,t),Xe.init(e,t)}),s1=H("ZodCIDRv6",(e,t)=>{q0.init(e,t),Xe.init(e,t)}),a1=H("ZodBase64",(e,t)=>{U0.init(e,t),Xe.init(e,t)}),o1=H("ZodBase64URL",(e,t)=>{B0.init(e,t),Xe.init(e,t)}),l1=H("ZodE164",(e,t)=>{j0.init(e,t),Xe.init(e,t)}),u1=H("ZodJWT",(e,t)=>{W0.init(e,t),Xe.init(e,t)}),Rh=H("ZodNumber",(e,t)=>{dh.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(n,i,s)=>lS(e,n,i,s),Ls(e,"ZodNumber",{gt(n,i){return this.check(Th(n,i))},gte(n,i){return this.check(hu(n,i))},min(n,i){return this.check(hu(n,i))},lt(n,i){return this.check(xh(n,i))},lte(n,i){return this.check(fu(n,i))},max(n,i){return this.check(fu(n,i))},int(n){return this.check(Lh(n))},safe(n){return this.check(Lh(n))},positive(n){return this.check(Th(0,n))},nonnegative(n){return this.check(hu(0,n))},negative(n){return this.check(xh(0,n))},nonpositive(n){return this.check(fu(0,n))},multipleOf(n,i){return this.check(Ah(n,i))},step(n,i){return this.check(Ah(n,i))},finite(){return this}});const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function zs(e){return qk(Rh,e)}var c1=H("ZodNumberFormat",(e,t)=>{H0.init(e,t),Rh.init(e,t)});function Lh(e){return Uk(c1,e)}var d1=H("ZodUnknown",(e,t)=>{G0.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>cS(e,r,n,i)});function zh(){return Vk(d1)}var f1=H("ZodNever",(e,t)=>{K0.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>uS(e,r,n,i)});function h1(e){return Bk(f1,e)}var p1=H("ZodArray",(e,t)=>{Y0.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>pS(e,r,n,i),e.element=t.element,Ls(e,"ZodArray",{min(r,n){return this.check(eo(r,n))},nonempty(r){return this.check(eo(1,r))},max(r,n){return this.check(Ch(r,n))},length(r,n){return this.check(Oh(r,n))},unwrap(){return this.element}})});function qh(e,t){return tS(p1,e,t)}var m1=H("ZodObject",(e,t)=>{Q0.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>mS(e,r,n,i),Be(e,"shape",()=>t.shape),Ls(e,"ZodObject",{keyof(){return _1(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:zh()})},loose(){return this.clone({...this._zod.def,catchall:zh()})},strict(){return this.clone({...this._zod.def,catchall:h1()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return yw(this,r)},safeExtend(r){return bw(this,r)},merge(r){return _w(this,r)},pick(r){return vw(this,r)},omit(r){return gw(this,r)},partial(...r){return ww(Uh,this,r[0])},required(...r){return kw(jh,this,r[0])}})});function pu(e,t){return new m1({type:"object",shape:e??{},...be(t)})}var v1=H("ZodUnion",(e,t)=>{X0.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>vS(e,r,n,i),e.options=t.options});function g1(e,t){return new v1({type:"union",options:e,...be(t)})}var y1=H("ZodIntersection",(e,t)=>{ek.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>gS(e,r,n,i)});function b1(e,t){return new y1({type:"intersection",left:e,right:t})}var mu=H("ZodEnum",(e,t)=>{tk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(n,i,s)=>dS(e,n,i,s),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,i)=>{const s={};for(const a of n)if(r.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new mu({...t,checks:[],...be(i),entries:s})},e.exclude=(n,i)=>{const s={...t.entries};for(const a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new mu({...t,checks:[],...be(i),entries:s})}});function _1(e,t){return new mu({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e,...be(t)})}var w1=H("ZodTransform",(e,t)=>{rk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>hS(e,r,n,i),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Hf(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ns(s,r.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Ns(a))}};const i=t.transform(r.value,r);return i instanceof Promise?i.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function k1(e){return new w1({type:"transform",transform:e})}var Uh=H("ZodOptional",(e,t)=>{yh.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>$h(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function Vh(e){return new Uh({type:"optional",innerType:e})}var S1=H("ZodExactOptional",(e,t)=>{nk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>$h(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function E1(e){return new S1({type:"optional",innerType:e})}var x1=H("ZodNullable",(e,t)=>{ik.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>yS(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function Bh(e){return new x1({type:"nullable",innerType:e})}var T1=H("ZodDefault",(e,t)=>{sk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>_S(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function A1(e,t){return new T1({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Qf(t)}})}var C1=H("ZodPrefault",(e,t)=>{ak.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>wS(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function O1(e,t){return new C1({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Qf(t)}})}var jh=H("ZodNonOptional",(e,t)=>{ok.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>bS(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function D1(e,t){return new jh({type:"nonoptional",innerType:e,...be(t)})}var I1=H("ZodCatch",(e,t)=>{lk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>kS(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function P1(e,t){return new I1({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var $1=H("ZodPipe",(e,t)=>{uk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>SS(e,r,n,i),e.in=t.in,e.out=t.out});function Zh(e,t){return new $1({type:"pipe",in:e,out:t})}var M1=H("ZodReadonly",(e,t)=>{ck.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ES(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function F1(e){return new M1({type:"readonly",innerType:e})}var Wh=H("ZodCustom",(e,t)=>{dk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>fS(e,r,n,i)});function N1(e,t={}){return rS(Wh,e,t)}function R1(e,t){return nS(e,t)}function L1(e,t={}){const r=new Wh({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...be(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var z1=pu({id:zs(),customer:pu({customer_salutation_id:zs().positive({message:"user.fieldErrors.titleRequire"}),name:Jt().min(1,{message:"user.fieldErrors.nameRequire"}),surname:Jt().min(1,{message:"user.fieldErrors.surnameRequire"}),email:Jt().email({message:"user.fieldErrors.emailValid"}).min(1,{message:"user.fieldErrors.emailRequire"}),email_confirmation:Jt().email({message:"user.fieldErrors.emailValidRequire"}).optional(),addr_street:Jt().min(1,{message:"user.fieldErrors.streetRequire"}),addr_zip:Jt().min(1,{message:"user.fieldErrors.postRequire"}),addr_city:Jt().min(1,{message:"user.fieldErrors.cityRequire"}),addr_country_id:zs().positive().default(60),language_id:zs().positive({message:"user.fieldErrors.languageRequire"}).default(1)})}),XF=pu({ticket_sale_id:zs(),start_at:Jt().date(),personalizations:qh(z1)});function vu(e,t){return e-t*Math.floor(e/t)}var Hh=1721426;function no(e,t,r,n){t=gu(e,t);let i=t-1,s=-2;return r<=2?s=0:io(t)&&(s=-1),Hh-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*r-362)/12+s+n)}function io(e){return e%4===0&&(e%100!==0||e%400===0)}function gu(e,t){return e==="BC"?1-t:t}function q1(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}var U1={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},Mi=class{fromJulianDay(e){let t=e,r=t-Hh,n=Math.floor(r/146097),i=vu(r,146097),s=Math.floor(i/36524),a=vu(i,36524),o=Math.floor(a/1461),l=vu(a,1461),c=Math.floor(l/365),[f,u]=q1(n*400+s*100+o*4+c+(s!==4&&c!==4?1:0)),p=t-no(f,u,1,1),h=2;t<no(f,u,3,1)?h=0:io(u)&&(h=1);let g=Math.floor(((p+h)*12+373)/367);return new Bs(f,u,g,t-no(f,u,g,1)+1)}toJulianDay(e){return no(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return U1[io(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return io(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return e.era==="BC"}balanceDate(e){e.year<=0&&(e.era=e.era==="BC"?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}},V1={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function On(e,t){return t=Qt(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function yu(e,t){return t=Qt(t,e.calendar),e=_u(e),t=_u(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function B1(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function j1(e,t){return On(e,ti(t))}var Z1={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Gh(e,t,r){let n=e.calendar.toJulianDay(e),i=r?Z1[r]:Y1(t),s=Math.ceil(n+1-i)%7;return s<0&&(s+=7),s}function W1(e){return Vr(Date.now(),e)}function ti(e){return X1(W1(e))}function Kh(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function Yh(e,t){return Jh(e)-Jh(t)}function Jh(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}var bu=null,H1=!1;function Vt(){return bu==null&&(bu=new Intl.DateTimeFormat().resolvedOptions().timeZone),bu}function Qh(){return H1}function _u(e){return e.subtract({days:e.day-1})}function G1(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}var Xh=new Map,wu=new Map;function K1(e){if(Intl.Locale){let r=Xh.get(e);return r||(r=new Intl.Locale(e).maximize().region,r&&Xh.set(e,r)),r}let t=e.split("-")[1];return t==="u"?void 0:t}function Y1(e){let t=wu.get(e);if(!t){if(Intl.Locale){let n=new Intl.Locale(e);if("getWeekInfo"in n&&(t=n.getWeekInfo(),t))return wu.set(e,t),t.firstDay}let r=K1(e);if(e.includes("-fw-")){let n=e.split("-fw-")[1].split("-")[0];n==="mon"?t={firstDay:1}:n==="tue"?t={firstDay:2}:n==="wed"?t={firstDay:3}:n==="thu"?t={firstDay:4}:n==="fri"?t={firstDay:5}:n==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:r&&V1[r]||0};wu.set(e,t)}return t.firstDay}function Dn(e){return e=Qt(e,new Mi),ep(gu(e.era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function ep(e,t,r,n,i,s,a){let o=new Date;return o.setUTCHours(n,i,s,a),o.setUTCFullYear(e,t-1,r),o.getTime()}function qs(e,t){if(t==="UTC")return 0;if(e>0&&t===Vt()&&!Qh())return new Date(e).getTimezoneOffset()*-6e4;let{year:r,month:n,day:i,hour:s,minute:a,second:o}=rp(e,t);return ep(r,n,i,s,a,o,0)-Math.floor(e/1e3)*1e3}var tp=new Map;function rp(e,t){let r=tp.get(t);r||(r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),tp.set(t,r));let n=r.formatToParts(new Date(e)),i={};for(let s of n)s.type!=="literal"&&(i[s.type]=s.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}var so=864e5;function J1(e,t){let r=Dn(e);return np(e,t,r-qs(r-so,t),r-qs(r+so,t))}function np(e,t,r,n){return(r===n?[r]:[r,n]).filter(i=>Q1(e,t,i))}function Q1(e,t,r){let n=rp(r,t);return e.year===n.year&&e.month===n.month&&e.day===n.day&&e.hour===n.hour&&e.minute===n.minute&&e.second===n.second}function Ur(e,t,r="compatible"){let n=In(e);if(t==="UTC")return Dn(n);if(t===Vt()&&r==="compatible"&&!Qh()){n=Qt(n,new Mi);let l=new Date,c=gu(n.era,n.year);return l.setFullYear(c,n.month-1,n.day),l.setHours(n.hour,n.minute,n.second,n.millisecond),l.getTime()}let i=Dn(n),s=qs(i-so,t),a=qs(i+so,t),o=np(n,t,i-s,i-a);if(o.length===1)return o[0];if(o.length>1)switch(r){case"compatible":case"earlier":return o[0];case"later":return o[o.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(r){case"earlier":return Math.min(i-s,i-a);case"compatible":case"later":return Math.max(i-s,i-a);case"reject":throw new RangeError("No such absolute time found")}}function ip(e,t,r="compatible"){return new Date(Ur(e,t,r))}function Vr(e,t){let r=qs(e,t),n=new Date(e+r),i=n.getUTCFullYear(),s=n.getUTCMonth()+1,a=n.getUTCDate(),o=n.getUTCHours(),l=n.getUTCMinutes(),c=n.getUTCSeconds(),f=n.getUTCMilliseconds();return new Pn(i<1?"BC":"AD",i<1?-i+1:i,s,a,t,r,o,l,c,f)}function X1(e){return new Bs(e.calendar,e.era,e.year,e.month,e.day)}function In(e,t){let r=0,n=0,i=0,s=0;if("timeZone"in e)({hour:r,minute:n,second:i,millisecond:s}=e);else if("hour"in e&&!t)return e;return t&&({hour:r,minute:n,second:i,millisecond:s}=t),new Fi(e.calendar,e.era,e.year,e.month,e.day,r,n,i,s)}function eE(e){return new pE(e.hour,e.minute,e.second,e.millisecond)}function Qt(e,t){if(B1(e.calendar,t))return e;let r=t.fromJulianDay(e.calendar.toJulianDay(e)),n=e.copy();return n.calendar=t,n.era=r.era,n.year=r.year,n.month=r.month,n.day=r.day,ri(n),n}function tE(e,t,r){return e instanceof Pn?e.timeZone===t?e:sp(e,t):Vr(Ur(e,t,r),t)}function rE(e){let t=Dn(e)-e.offset;return new Date(t)}function sp(e,t){return Qt(Vr(Dn(e)-e.offset,t),e.calendar)}var Us=36e5;function ao(e,t){let r=e.copy(),n="hour"in r?up(r,t):0;ku(r,t.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e),r.month+=t.months||0,Su(r),ap(r),r.day+=(t.weeks||0)*7,r.day+=t.days||0,r.day+=n,nE(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);let i=r.calendar.getYearsInEra(r);if(r.year>i){let a=r.calendar.isInverseEra?.(r);r.year=i,r.month=a?1:r.calendar.getMonthsInYear(r),r.day=a?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);let s=r.calendar.getMonthsInYear(r);return r.month>s&&(r.month=s,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r}function ku(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Su(e){for(;e.month<1;)ku(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,ku(e,1)}function nE(e){for(;e.day<1;)e.month--,Su(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Su(e)}function ap(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function ri(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),ap(e)}function Eu(e){let t={};for(let r in e)typeof e[r]=="number"&&(t[r]=-e[r]);return t}function op(e,t){return ao(e,Eu(t))}function xu(e,t){let r=e.copy();return t.era!=null&&(r.era=t.era),t.year!=null&&(r.year=t.year),t.month!=null&&(r.month=t.month),t.day!=null&&(r.day=t.day),ri(r),r}function Vs(e,t){let r=e.copy();return t.hour!=null&&(r.hour=t.hour),t.minute!=null&&(r.minute=t.minute),t.second!=null&&(r.second=t.second),t.millisecond!=null&&(r.millisecond=t.millisecond),lp(r),r}function iE(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=oo(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=oo(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=oo(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=oo(e.hour,24),t}function lp(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function oo(e,t){let r=e%t;return r<0&&(r+=t),r}function up(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,iE(e)}function cp(e,t){let r=e.copy();return up(r,t),r}function sE(e,t){return cp(e,Eu(t))}function Tu(e,t,r,n){let i=e.copy();switch(t){case"era":{let s=e.calendar.getEras(),a=s.indexOf(e.era);if(a<0)throw new Error("Invalid era: "+e.era);a=an(a,r,0,s.length-1,n?.round),i.era=s[a],ri(i);break}case"year":i.calendar.isInverseEra?.(i)&&(r=-r),i.year=an(e.year,r,-1/0,9999,n?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case"month":i.month=an(e.month,r,1,e.calendar.getMonthsInYear(e),n?.round);break;case"day":i.day=an(e.day,r,1,e.calendar.getDaysInMonth(e),n?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),ri(i),i}function Au(e,t,r,n){let i=e.copy();switch(t){case"hour":{let s=e.hour,a=0,o=23;if(n?.hourCycle===12){let l=s>=12;a=l?12:0,o=l?23:11}i.hour=an(s,r,a,o,n?.round);break}case"minute":i.minute=an(e.minute,r,0,59,n?.round);break;case"second":i.second=an(e.second,r,0,59,n?.round);break;case"millisecond":i.millisecond=an(e.millisecond,r,0,999,n?.round);break;default:throw new Error("Unsupported field "+t)}return i}function an(e,t,r,n,i=!1){if(i){e+=Math.sign(t),e<r&&(e=n);let s=Math.abs(t);t>0?e=Math.ceil(e/s)*s:e=Math.floor(e/s)*s,e>n&&(e=r)}else e+=t,e<r?e=n-(r-e-1):e>n&&(e=r+(e-n-1));return e}function dp(e,t){let r;return t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0?r=Ur(ao(In(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):r=Dn(e)-e.offset,r+=t.milliseconds||0,r+=(t.seconds||0)*1e3,r+=(t.minutes||0)*6e4,r+=(t.hours||0)*36e5,Qt(Vr(r,e.timeZone),e.calendar)}function aE(e,t){return dp(e,Eu(t))}function oE(e,t,r,n){switch(t){case"hour":{let i=0,s=23;if(n?.hourCycle===12){let g=e.hour>=12;i=g?12:0,s=g?23:11}let a=In(e),o=Qt(Vs(a,{hour:i}),new Mi),l=[Ur(o,e.timeZone,"earlier"),Ur(o,e.timeZone,"later")].filter(g=>Vr(g,e.timeZone).day===o.day)[0],c=Qt(Vs(a,{hour:s}),new Mi),f=[Ur(c,e.timeZone,"earlier"),Ur(c,e.timeZone,"later")].filter(g=>Vr(g,e.timeZone).day===c.day).pop(),u=Dn(e)-e.offset,p=Math.floor(u/Us),h=u%Us;return u=an(p,r,Math.floor(l/Us),Math.floor(f/Us),n?.round)*Us+h,Qt(Vr(u,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Au(e,t,r,n);case"era":case"year":case"month":case"day":return Qt(Vr(Ur(Tu(In(e),t,r,n),e.timeZone),e.timeZone),e.calendar);default:throw new Error("Unsupported field "+t)}}function lE(e,t,r){let n=In(e),i=Vs(xu(n,t),t);return i.compare(n)===0?e:Qt(Vr(Ur(i,e.timeZone,r),e.timeZone),e.calendar)}var uE=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,cE=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,dE=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::?(\d{2}))?(?::?(\d{2}))?)?\[(.*?)\]$/,Cu=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/,fE=["hours","minutes","seconds"],eN=["years","months","weeks","days",...fE];function lo(e){let t=e.match(uE);if(!t)throw Cu.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let r=new Bs(qe(t[1],0,9999),qe(t[2],1,12),1);return r.day=qe(t[3],1,r.calendar.getDaysInMonth(r)),r}function fp(e){let t=e.match(cE);if(!t)throw Cu.test(e)?new Error(`Invalid ISO 8601 date time string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date time string: "+e);let r=qe(t[1],-9999,9999),n=new Fi(r<1?"BC":"AD",r<1?-r+1:r,qe(t[2],1,12),1,t[4]?qe(t[4],0,23):0,t[5]?qe(t[5],0,59):0,t[6]?qe(t[6],0,59):0,t[7]?qe(t[7],0,1/0)*1e3:0);return n.day=qe(t[3],0,n.calendar.getDaysInMonth(n)),n}function hp(e,t){let r=e.match(dE);if(!r)throw new Error("Invalid ISO 8601 date time string: "+e);let n=qe(r[1],-9999,9999),i=new Pn(n<1?"BC":"AD",n<1?-n+1:n,qe(r[2],1,12),1,r[11],0,r[4]?qe(r[4],0,23):0,r[5]?qe(r[5],0,59):0,r[6]?qe(r[6],0,59):0,r[7]?qe(r[7],0,1/0)*1e3:0);i.day=qe(r[3],0,i.calendar.getDaysInMonth(i));let s=In(i),a;if(r[8]){let o=qe(r[8],-23,23);if(i.offset=Math.sign(o)*(Math.abs(o)*36e5+qe(r[9]??"0",0,59)*6e4+qe(r[10]??"0",0,59)*1e3),a=Dn(i)-i.offset,!J1(s,i.timeZone).includes(a))throw new Error(`Offset ${gp(i.offset)} is invalid for ${Ou(i)} in ${i.timeZone}`)}else a=Ur(In(s),i.timeZone,t);return Vr(a,i.timeZone)}function pp(e,t){let r=e.match(Cu);if(!r)throw new Error("Invalid ISO 8601 date time string: "+e);let n=qe(r[1],-9999,9999),i=new Pn(n<1?"BC":"AD",n<1?-n+1:n,qe(r[2],1,12),1,t,0,r[4]?qe(r[4],0,23):0,r[5]?qe(r[5],0,59):0,r[6]?qe(r[6],0,59):0,r[7]?qe(r[7],0,1/0)*1e3:0);return i.day=qe(r[3],0,i.calendar.getDaysInMonth(i)),r[8]&&(i.offset=qe(r[8],-23,23)*36e5+qe(r[9]??"0",0,59)*6e4),sp(i,t)}function qe(e,t,r){let n=Number(e);if(n<t||n>r)throw new RangeError(`Value out of range: ${t} <= ${n} <= ${r}`);return n}function mp(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function vp(e){let t=Qt(e,new Mi),r;return t.era==="BC"?r=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):r=String(t.year).padStart(4,"0"),`${r}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Ou(e){return`${vp(e)}T${mp(e)}`}function gp(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let r=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),s=`${t}${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`;return i!==0&&(s+=`:${String(i).padStart(2,"0")}`),s}function hE(e){return`${Ou(e)}${gp(e.offset)}[${e.timeZone}]`}function Du(e){let t=typeof e[0]=="object"?e.shift():new Mi,r;if(typeof e[0]=="string")r=e.shift();else{let a=t.getEras();r=a[a.length-1]}let n=e.shift(),i=e.shift(),s=e.shift();return[t,r,n,i,s]}var Bs=class fd{#e;constructor(...t){let[r,n,i,s,a]=Du(t);this.calendar=r,this.era=n,this.year=i,this.month=s,this.day=a,ri(this)}copy(){return this.era?new fd(this.calendar,this.era,this.year,this.month,this.day):new fd(this.calendar,this.year,this.month,this.day)}add(t){return ao(this,t)}subtract(t){return op(this,t)}set(t){return xu(this,t)}cycle(t,r,n){return Tu(this,t,r,n)}toDate(t){return ip(this,t)}toString(){return vp(this)}compare(t){return Kh(this,t)}},pE=class hy{#e;constructor(t=0,r=0,n=0,i=0){this.hour=t,this.minute=r,this.second=n,this.millisecond=i,lp(this)}copy(){return new hy(this.hour,this.minute,this.second,this.millisecond)}add(t){return cp(this,t)}subtract(t){return sE(this,t)}set(t){return Vs(this,t)}cycle(t,r,n){return Au(this,t,r,n)}toString(){return mp(this)}compare(t){return Yh(this,t)}},Fi=class hd{#e;constructor(...t){let[r,n,i,s,a]=Du(t);this.calendar=r,this.era=n,this.year=i,this.month=s,this.day=a,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ri(this)}copy(){return this.era?new hd(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new hd(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return ao(this,t)}subtract(t){return op(this,t)}set(t){return xu(Vs(this,t),t)}cycle(t,r,n){switch(t){case"era":case"year":case"month":case"day":return Tu(this,t,r,n);default:return Au(this,t,r,n)}}toDate(t,r){return ip(this,t,r)}toString(){return Ou(this)}compare(t){let r=Kh(this,t);return r===0?Yh(this,In(t)):r}},Pn=class pd{#e;constructor(...t){let[r,n,i,s,a]=Du(t),o=t.shift(),l=t.shift();this.calendar=r,this.era=n,this.year=i,this.month=s,this.day=a,this.timeZone=o,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ri(this)}copy(){return this.era?new pd(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new pd(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return dp(this,t)}subtract(t){return aE(this,t)}set(t,r){return lE(this,t,r)}cycle(t,r,n){return oE(this,t,r,n)}toDate(){return rE(this)}toString(){return hE(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-tE(t,this.timeZone).toDate().getTime()}},Iu=new Map,kr=class{constructor(e,t={}){this.formatter=yp(e,t),this.options=t}format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(e,t);if(t<e)throw new RangeError("End date must be >= start date");return`${this.formatter.format(e)} – ${this.formatter.format(t)}`}formatRangeToParts(e,t){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(e,t);if(t<e)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(e),n=this.formatter.formatToParts(t);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...n.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return gE()&&(this.resolvedHourCycle||(this.resolvedHourCycle=yE(e.locale,this.options)),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),e.calendar==="ethiopic-amete-alem"&&(e.calendar="ethioaa"),e}},mE={true:{ja:"h11"},false:{}};function yp(e,t={}){if(typeof t.hour12=="boolean"&&vE()){t={...t};let i=mE[String(t.hour12)][e.split("-")[0]],s=t.hour12?"h12":"h23";t.hourCycle=i??s,delete t.hour12}let r=e+(t?Object.entries(t).sort((i,s)=>i[0]<s[0]?-1:1).join():"");if(Iu.has(r))return Iu.get(r);let n=new Intl.DateTimeFormat(e,t);return Iu.set(r,n),n}var Pu=null;function vE(){return Pu==null&&(Pu=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Pu}var $u=null;function gE(){return $u==null&&($u=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),$u}function yE(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let r=yp(e,{...t,timeZone:void 0}),n=parseInt(r.formatToParts(new Date(2020,2,3,0)).find(s=>s.type==="hour").value,10),i=parseInt(r.formatToParts(new Date(2020,2,3,23)).find(s=>s.type==="hour").value,10);if(n===0&&i===23)return"h23";if(n===24&&i===23)return"h24";if(n===0&&i===11)return"h11";if(n===12&&i===11)return"h12";throw new Error("Unexpected hour cycle result")}function $n(e){return eE(pp(e,"Europe/Berlin")).toString().slice(0,-3)}function ni(e,t={weekday:"long",year:"numeric",month:"long",day:"numeric"},r="de"){const n=pp(e instanceof Date?e.toISOString():e,"Europe/Berlin");return new kr(r,{timeZone:n.timeZone,...t}).format(n.toDate())}function js(e){if(e===void 0)throw Error("priceCents is required");return new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e/100)}function Mu(e){return e?.type==="Ticket"}function Br(e){const t=e;return!!t&&t.type==="Ticket"&&t.is_mantle===!0&&!!t.sub_tickets&&Object.keys(t.sub_tickets).length>0}function Zs(e){return Object.entries(e.sub_tickets??{}).map(([t,r])=>({id:Number(t),title:r?.title??"",description:r?.description??null,min_persons:r?.min_persons??0,max_persons:r?.max_persons??0}))}function uo(e,t){return{...e,selectedTime:t?.selectedTime??"",type:"Ticket",subtype:{time_slot:"timeslot",normal:"day",annual:"annual"}[e.ticket_type],shop_order:e.shop_order??0,content:void 0}}function Mn(e,t=""){return sw(Object.values(e).map(r=>uo(r,{selectedTime:t})),r=>r.shop_order)}function Fn(e,t=""){let r=Object.entries(e);return t!==""&&(r=r.filter(([,n])=>n.total_capacities?.[t]&&n.total_capacities[t]>0)),Object.fromEntries(r)}var bp=e=>qr(Object.values(e.mantle?.composition??{}));function bE(e){const t=e.quantity??0;return Br(e.product)?t*bp(e):t}function Fu(e,t,r,n){e.clearPrecart();let i=0;for(const s of[...r.items,...t.items]){if(!Mu(s.product))continue;const a=bE(s);s===n&&(i=a),e.addPrecartItemQuantity(s.product.id,a)}return i}var _E=function(e,t,r,n){if(e.capacityPolicy(r)!=="quotas")throw new Error("(getMaxQuantityQuotas) impossible");if(!Mu(r.product))throw new Error("(getMaxQuantityQuotas) impossible");const i=r.product,s=e.quotaManager,a=Fu(s,t,n,r),o=s.ticketCapacity(i.id,i.selectedTime,a),l=s.totalCapacity(i.id,i.selectedTime);return{max:Math.min(i.max_persons||100,o),min:i.min_persons||0,bookedOut:o===0,unavailable:l===0}},wE=function(e,t,r,n){if(e.capacityPolicy(r)!=="mantle")throw new Error("(maxQuantity_Mantle) impossible");if(!Br(r.product))throw new Error("(maxQuantity_Mantle) impossible");const i=r.product,s=e.quotaManager,a=Fu(s,t,n,r),o=s.ticketCapacity(i.id,i.selectedTime,a),l=s.totalCapacity(i.id,i.selectedTime),c=bp(r),f=c>1?Math.floor(o/c):o;return{max:Math.min(i.max_persons||100,f),min:i.min_persons||0,bookedOut:f===0,unavailable:l===0}},kE=e=>Object.fromEntries(Zs(e).map(t=>[t.id,t.max_persons]));function SE(e,t,r,n){if(e.capacityPolicy(r)!=="mantle")throw new Error("(maxSubQuantities) impossible");if(!Br(r.product))throw new Error("(maxSubQuantities) impossible");const i=r.product,s=r.quantity??0;let a=1/0;return s>0&&(Fu(e.quotaManager,t,n,r),a=Math.floor(e.quotaManager.ticketCapacity(i.id,i.selectedTime,0)/s)),Object.fromEntries(Zs(i).map(o=>[o.id,Math.min(o.max_persons,(r.mantle?.composition?.[o.id]??0)+a)]))}function Ws(e){return e?.type==="Event"}function EE(e){return Ws(e)&&e.subtype==="scale"}function xE(e,t,r){const n={type:"Event",id:t,tax_included:!0,...e};if(r?.date){const i=r.date;r.date_title=i.title||"",r.date_description=i.description||"",r.event_title=i.event_title||"",r.event_subtitle=i.event_sub_title||"",r.price_title=e.title||"",r.price_description=e.description||""}return{dateId:t,minAvailableCapacity:0,selectedTime:"",...r,...n,...e,type:"Event",subtype:e.scale_price_id===void 0?"flat":"scale"}}function Nu(e,t,r){return xE(e,t,r)}var TE=function(e,t,r,n){if(e.capacityPolicy(r)!=="seats")throw new Error("(getMaxQuantitySeats) impossible");if(!Ws(r.product))throw new Error("(getMaxQuantitySeats) impossible");const i=r.product.dateId,s=e.allSeats[i];if(!s)return console.error("(getMaxQuantity) no seats found for dateId",i),{max:0,min:0,unavailable:!0,bookedOut:!1};const a=Math.min(s.max||100,s.max_per_registration||100,s.available??100),o={max_per_registration:a,available:100,overbook:!1,...s};let l=a;o.overbook&&(l=Math.min(o.max||100,o.max_per_registration||100));const c=n.totalQuantity,f=qr(t.items.filter(p=>n.items.some(h=>h.uuid===p.uuid)),p=>p.quantity),u=Math.max(l-f-c+r.quantity,0);return{max:u,min:o.min??0,unavailable:o.available===0,bookedOut:u===0}},AE=function(e,t,r,n){if(e.capacityPolicy(r)!=="unlimited")throw new Error("(getMaxQuantityUnlimited) impossible");return{max:r.product.max_persons??100,min:r.product.min_persons??0,unavailable:!1,bookedOut:!1}};function CE(e){return{apiData:e,_timeslots:[],addQuotas(t){this._timeslots=[],this.apiData={...this.apiData,...t}},precart:{},clearPrecart(){this.precart={},this._timeslots=[]},setPrecartItemQuantity(t,r){this.precart[t]=r,this._timeslots=[]},addPrecartItemQuantity(t,r){this.precart[t]=(this.precart[t]??0)+r,this._timeslots=[]},getPrecartItemQuantity(t){return this.precart[t]??0},timeslots(){return this._timeslots.length===0&&(this._timeslots=Object.entries(this.apiData).flatMap(([t,r])=>Object.keys(r.capacities).map(n=>{const i=qr(r.ticket_ids.map(s=>this.getPrecartItemQuantity(s)));return{timeSlot:n,quota:t,capacity:r.capacities[n]-i,tickets:r.ticket_ids,totalCapacity:r.total_capacities[n]}}))),this._timeslots},filterBy({timeslot:t,ticketId:r,date:n}={}){let i=this.timeslots();return r&&(i=i.filter(s=>s.tickets.includes(r))),t&&(i=i.filter(s=>s.timeSlot===t)),n&&(i=i.filter(s=>s.timeSlot.startsWith(n))),i.flatMap(s=>s.tickets.map(a=>({timeslot:t,ticket:a,quota:s.quota,capacity:s.capacity,totalCapacity:s.totalCapacity})))},ticketCapacity(t,r,n=this.getPrecartItemQuantity(t)){const i=ru(this.filterBy({timeslot:r,ticketId:t}).map(s=>s.capacity))??0;return Math.max(0,i+n)},totalCapacity(t,r){return ru(this.filterBy({timeslot:r,ticketId:t}).map(n=>n.totalCapacity))??0},timeslotsOn(t,r){let n=this.timeslots().filter(s=>s.timeSlot.startsWith(t.toString()));r&&(n=n.filter(s=>s.tickets.some(a=>r.includes(a))));const i=iw(n,s=>s.timeSlot);return Object.values(i).map(s=>aw(ow(s.flatMap(a=>a.tickets)).map(a=>ru(s.filter(o=>o.tickets.includes(a)),o=>o.capacity)).filter(a=>a!==null),a=>a.capacity)??s[0]).sort((s,a)=>s.timeSlot.localeCompare(a.timeSlot))}}}function OE(e){let t=0;Es(()=>{ve(()=>{if(e.items.length===t)return;const r=e.items.length>t?"go-cart-item-added":"go-cart-item-removed";t=e.items.length,document.dispatchEvent(new CustomEvent(r,{detail:e.items.length}))})})}function _p(e){return e?.type==="Tour"}function wp(e,t){return{...e,type:"Tour",description:"",price_cents:e.totalPriceCents,tax_included:!0,vat_pct:0,instanceKey:t?.instanceKey??crypto.randomUUID(),wire:DE(e)}}function DE(e){const t={language_id:e.languageId};return e.quantities?t.quantities=e.quantities:t.quantity=e.participants,e.gradeId!=null&&(t.grade_id=e.gradeId),e.ageGroupId!=null&&(t.age_group_id=e.ageGroupId),e.surcharges&&(t.surcharges=e.surcharges),e.equipment&&(t.equipment=e.equipment),e.attendees&&(t.attendees=e.attendees),e.customs&&(t.customs=e.customs),t}function IE(e){const{type:t,description:r,price_cents:n,tax_included:i,vat_pct:s,instanceKey:a,wire:o,...l}=e;return wp({...l,totalPriceCents:n},{instanceKey:a})}var PE=0;function ot(e,t){const r={quantity:0,time:"",...t??{}};return Br(e)&&(r.mantle={composition:r.mantle?.composition??Object.fromEntries(Zs(e).map(n=>[n.id,n.max_persons])),key:r.mantle?.key??`mantle-${PE++}`}),{...r,type:e.type,product:e,orderAttributes(){const n={shipped_with_merchandise_id:null,shipping_mode:"email",id:this.product.id,uuid:this.uuid};switch(e.type){case"Ticket":return{...n,time:this.time,quantity:this.quantity,...Br(this.product)&&this.mantle?{sub_ticket_quantities:this.mantle.composition}:{}};case"Event":switch(e.subtype){case"flat":return{...n,quantity:this.quantity};case"scale":return{...n,quantities:{[e.scale_price_id]:this.quantity}};default:throw new Error(`(orderAttributes) Unhandled Event subtype: ${e}`)}case"Coupon":return{...n,quantity:this.quantity};case"Tour":return{...n,start_time:this.time,...e.wire};default:throw new Error(`(orderAttributes) Unhandled product type: ${e}`)}},get uuid(){return this.type+"-"+this.product.id+this.subUId},get subUId(){const n=[];return this.time&&n.push(`time: ${this.time}`),EE(this.product)&&n.push(`scale_price: ${this.product.scale_price_id}`),_p(this.product)&&n.push(`tour: ${this.product.instanceKey}`),this.display?.discounted&&n.push("discounted"),Br(this.product)&&this.mantle?.key&&n.push(`mantle_key: ${this.mantle.key}`),this.voucher?.code&&n.push(`voucher_code: ${this.voucher.code}`),n.length>0?` (${n.join(", ")})`:""},toString(){return this.uuid+":"+this.quantity},get price_cents(){return this.time&&this.product.dynamic_prices?.[this.time]!=null?this.product.dynamic_prices[this.time]:this.product.price_cents},get price_formatted(){return fr(this.price_cents)},get final_price_cents(){const n=this.product.tax_included?1:1+this.product.vat_pct/100;return this.price_cents*n},get final_price_formatted(){return fr(this.final_price_cents)},get total_price_cents(){return this.quantity*this.final_price_cents},get total_price_formatted(){return fr(this.total_price_cents)}}}var tN=15*6e4;function co(){return typeof window<"u"&&typeof localStorage<"u"}function $E(e,t){if(co())try{localStorage.setItem(e,JSON.stringify(t))}catch(r){console.warn(`Failed to save to localStorage (${e}):`,r)}}function Ru(e){if(!co())return null;try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return console.warn(`Failed to load from localStorage (${e}):`,t),null}}function kp(e){if(co())try{localStorage.removeItem(e)}catch(t){console.warn(`Failed to remove from localStorage (${e}):`,t)}}function Sp(e){return{...e,description:"",tax_included:!0,type:"Coupon"}}var Ep="go-cart",fo=(e,t)=>localStorage.setItem(Ep,JSON.stringify({items:e,coupons:t,savedAt:Date.now()}));function ME(e){const t=e.product.type;switch(t){case"Ticket":return Lu(e)?ot(uo(e.product,{selectedTime:e.product.selectedTime}),{time:e.time,quantity:e.quantity,mantle:e.mantle,voucher:e.voucher}):void 0;case"Event":return Lu(e)?ot(Nu(e.product,e.id),{time:e.time,quantity:e.quantity}):void 0;case"Tour":return Lu(e)?ot(IE(e.product),{time:e.time,quantity:e.quantity}):void 0;case"Coupon":return ot(Sp(e.product),{quantity:e.quantity});default:throw new Error(`Unhandled case: ${t}`)}}function FE(e){let t=[],r=[],n;try{const i=localStorage.getItem(Ep);if(!i)return[];const s=JSON.parse(i);if(Array.isArray(s))t=s,r=[];else if(typeof s=="object"&&s!==null)t=s.items||[],r=s.coupons||[],n=s.savedAt;else throw console.dir({parsed:s,content:i}),new Error("go-cart has invalid format");return n&&Date.now()-n>9e5?(e.clearItems(),e.clearCoupons(),fo([],[]),[]):(t.length===0?e.clearItems():e.items=t.map(ME).filter(zE),e.clearCoupons(),r.forEach(a=>e.addCoupon(typeof a=="string"?{code:a,kind:"actionToken"}:a)),e.items)}catch(i){return console.error(i),fo([],[]),[]}}function NE(e){FE(e);let t=JSON.stringify({items:e.items||[],coupons:e.coupons||[]});fo(e.items||[],e.coupons||[]),Es(()=>{ve(()=>{const r=JSON.stringify({items:e.items||[],coupons:e.coupons||[]});r!==t&&(t=r,fo(e.items||[],e.coupons||[]))})})}var RE=e=>new Date<new Date(e),LE=e=>lo(e.slice(0,10)).compare(ti(Vt()))>=0,Lu=e=>e.time?e.product.subtype==="day"?LE(e.time):RE(e.time):!0,zE=e=>e!==void 0,qE=0;function Ni(e,t=20){const r={items:Pe([]),coupons:Pe([]),paymentModeId:void 0,uid:`cart-${qE++}`,get nonEmptyItems(){return this.items.filter(n=>n.quantity>0)},get totalPriceCents(){return Math.max(0,qr(this.items,n=>n.total_price_cents))},get totalQuantity(){return qr(this.items,n=>n.quantity)},get valueVoucherCents(){return qr(this.coupons.filter(n=>n.kind==="valueVoucher"),n=>n.valueCents??0)},get amountToPayCents(){return Math.max(0,this.totalPriceCents-this.valueVoucherCents)},toString(){return this.uid+" > ["+this.items.map(n=>n.uuid+":"+n.quantity).join(", ")+"]"},orderData(){return{items:this.items.map(n=>({type:n.type,attributes:n.orderAttributes()})),shipping_address_id:null,comment:null,reference:null,payment_mode_id:this.paymentModeId??C.settings?.defaultPaymentModeId,coupons:this.coupons.map(n=>n.code),donations:[],affiliate:{},total:this.amountToPayCents}},get totalFormatted(){return fr(this.totalPriceCents)},clearItems(){for(;this.items.length>0;)this.items.pop()},deleteItem(n){for(let i=this.items.length-1;i>=0;i--)this.items[i].uuid===n.uuid&&this.items.splice(i,1);n?.voucher?.code&&!this.items.some(i=>i.voucher?.code===n.voucher.code)&&this.removeCoupon(n.voucher.code)},addItem(n){const i=this.items.find(s=>s.uuid===n.uuid);i?i.quantity+=n.quantity:this.items.push(n)},addItems(n){n.forEach(i=>this.addItem(i))},addCoupon(n){const i={...n,code:n.code.toUpperCase()};this.coupons.some(s=>s.code===i.code)||this.coupons.push(i)},removeCoupon(n){const i=n.toUpperCase(),s=this.coupons.findIndex(a=>a.code===i);if(s>-1){const[a]=this.coupons.splice(s,1);if(a.kind==="serviceVoucher")for(let o=this.items.length-1;o>=0;o--)this.items[o].voucher?.code===i&&this.items.splice(o,1)}},clearCoupons(){for(;this.coupons.length>0;)this.coupons.pop()}};return e&&e.forEach(n=>r.addItem(ot(n))),r}function fr(e){return e=e??0,new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e/100)}function UE(){const e=Pe(Ni());return NE(e),OE(e),e}var Ri="go-capacity";function xp(e,t){const r=Ru(Ri);$E(Ri,{allSeats:{...r?.allSeats||{},...e},allQuotas:{...r?.allQuotas||{},...t},savedAt:Date.now()})}function Tp(e){const t=Ru(Ri);if(t){if(!t.savedAt||Date.now()-t.savedAt>9e5){kp(Ri);return}if(t.allSeats)for(const r in t.allSeats){const n=parseInt(r);e.addSeats(n,t.allSeats[n],!1)}t.allQuotas&&e.addQuotas(t.allQuotas,!1)}}function VE(e){co()&&window.addEventListener("storage",t=>{if(t.key===Ri&&Tp(e),t.key==="go-cart"){const r=Ru("go-cart");(!r||!r.items||r.items.length===0)&&kp(Ri)}})}function Ap(){const e={allSeats:{},allQuotas:{},quotaManager:CE({}),addQuotas(t,r=!0){this.allQuotas={...this.allQuotas,...t},this.quotaManager.addQuotas(t),r&&xp(this.allSeats,this.allQuotas)},addSeats(t,r,n=!0){this.allSeats[t]=r,n&&xp(this.allSeats,this.allQuotas)},capacityPolicy(t){const r=t.product.type;switch(r){case"Ticket":const n=t.product,i=n.subtype;switch(i){case"timeslot":case"event:ticket":case"day":return Br(n)?"mantle":"quotas";case"annual":return"unlimited";default:throw new Error(`(getMaxAvailability) Unhandled case: ${i}`)}case"Event":const s=t.product.subtype;switch(s){case"flat":case"scale":return"seats";default:throw new Error(`(getMaxAvailability) Unhandled case: ${s}`)}case"Coupon":return"unlimited";case"Tour":return"unlimited";default:throw new Error(`(getMaxAvailability) Unhandled case: ${r}`)}},capacity(t,r,n){const i=this.capacityPolicy(r),s={quotas:_E,mantle:wE,seats:TE,unlimited:AE}[i];if(!s)throw new Error(`(maxQuantity) impossible: ${i}`);return Ne(()=>s(this,t,r,n))},subTicketMaxes(t,r,n){if(!Br(r.product))return{};const i=this.capacityPolicy(r);if(i!=="mantle"&&i!=="unlimited")throw new Error(`(subTicketMaxes) impossible: ${i}`);return Ne(()=>i==="mantle"?SE(this,t,r,n):kE(r.product))}};return Tp(e),VE(e),e}function Cp(e){if(typeof document>"u"||!e)return;const t=`; ${document.cookie}`.split(`; ${e}=`);if(t.length===2){const r=t.pop()?.split(";").shift();return r?decodeURIComponent(r):void 0}}var Op=class{get isAuthenticated(){return this.isLoggedIn||this.isGuest}},BE=class extends Op{constructor(){super()}get isLoggedIn(){try{const e=Cp("auth_headers");if(!e)return!1;const t=JSON.parse(e),r=Math.floor(Date.now()/1e3);return!t["access-token"]||parseInt(t.expiry,10)<r?!1:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t.uid)}catch{return!1}}get isGuest(){if(this.isLoggedIn)return!1;try{const e=Cp("auth_headers");if(!e)return!0;const t=JSON.parse(e);return typeof t.uid=="string"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t.uid)}catch{return!0}}},jE=class extends Op{get isGuest(){throw new Error("Not implemented.")}get isLoggedIn(){throw new Error("Not implemented")}},ZE=e=>{switch(e){case"angular":return new BE;case"jmb":return new jE;default:throw new Error("Unhandled shop type: "+e)}};function WE(e){return e==null||typeof e=="string"&&e.trim()===""}function HE(e,t){const r={};if(!t||t.length===0)return r;for(const n of t)(!(n in e)||WE(e[n]))&&(r[n]=[`Field '${n}' is required and cannot be empty`]);return r}function GE(e,t){return HE(e,t)}var KE={withStackTrace:!1},Dp=(e,t,r=KE)=>({data:t.isOk()?{type:"Ok",value:t.value}:{type:"Err",value:t.error},message:e,stack:r.withStackTrace?new Error().stack:void 0});function ii(e,t,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(f){try{c(n.next(f))}catch(u){a(u)}}function l(f){try{c(n.throw(f))}catch(u){a(u)}}function c(f){f.done?s(f.value):i(f.value).then(o,l)}c((n=n.apply(e,t||[])).next())})}function Ip(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function jr(e){return this instanceof jr?(this.v=e,this):new jr(e)}function Pp(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(h){return function(g){return Promise.resolve(g).then(h,u)}}function o(h,g){n[h]&&(i[h]=function(m){return new Promise(function(v,y){s.push([h,m,v,y])>1||l(h,m)})},g&&(i[h]=g(i[h])))}function l(h,g){try{c(n[h](g))}catch(m){p(s[0][3],m)}}function c(h){h.value instanceof jr?Promise.resolve(h.value.v).then(f,u):p(s[0][2],h)}function f(h){l("next",h)}function u(h){l("throw",h)}function p(h,g){h(g),s.shift(),s.length&&l(s[0][0],s[0][1])}}function YE(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=e[i]?function(a){return(r=!r)?{value:jr(e[i](a)),done:!1}:s?s(a):a}:s}}function JE(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Ip=="function"?Ip(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(a){return new Promise(function(o,l){a=e[s](a),i(o,l,a.done,a.value)})}}function i(s,a,o,l){Promise.resolve(l).then(function(c){s({value:c,done:o})},a)}}var si=class yr{constructor(t){this._promise=t}static fromSafePromise(t){return new yr(t.then(r=>new Wr(r)))}static fromPromise(t,r){return new yr(t.then(n=>new Wr(n)).catch(n=>new Sr(r(n))))}static fromThrowable(t,r){return(...n)=>new yr(ii(this,void 0,void 0,function*(){try{return new Wr(yield t(...n))}catch(i){return new Sr(r?r(i):i)}}))}static combine(t){return QE(t)}static combineWithAllErrors(t){return XE(t)}map(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){return r.isErr()?new Sr(r.error):new Wr(yield t(r.value))})))}andThrough(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){if(r.isErr())return new Sr(r.error);const n=yield t(r.value);return n.isErr()?new Sr(n.error):new Wr(r.value)})))}andTee(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){if(r.isErr())return new Sr(r.error);try{yield t(r.value)}catch{}return new Wr(r.value)})))}orTee(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){if(r.isOk())return new Wr(r.value);try{yield t(r.error)}catch{}return new Sr(r.error)})))}mapErr(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){return r.isOk()?new Wr(r.value):new Sr(yield t(r.error))})))}andThen(t){return new yr(this._promise.then(r=>{if(r.isErr())return new Sr(r.error);const n=t(r.value);return n instanceof yr?n._promise:n}))}orElse(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){return r.isErr()?t(r.error):new Wr(r.value)})))}match(t,r){return this._promise.then(n=>n.match(t,r))}unwrapOr(t){return this._promise.then(r=>r.unwrapOr(t))}safeUnwrap(){return Pp(this,arguments,function*(){return yield jr(yield jr(yield*YE(JE(yield jr(this._promise.then(r=>r.safeUnwrap()))))))})}then(t,r){return this._promise.then(t,r)}[Symbol.asyncIterator](){return Pp(this,arguments,function*(){const r=yield jr(this._promise);return r.isErr()&&(yield yield jr(ho(r.error))),yield jr(r.value)})}};function ho(e){return new si(Promise.resolve(new Sr(e)))}var rN=si.fromPromise,nN=si.fromSafePromise,iN=si.fromThrowable,$p=e=>{let t=Nn([]);for(const r of e)if(r.isErr()){t=Zr(r.error);break}else t.map(n=>n.push(r.value));return t},QE=e=>si.fromSafePromise(Promise.all(e)).andThen($p),Mp=e=>{let t=Nn([]);for(const r of e)r.isErr()&&t.isErr()?t.error.push(r.error):r.isErr()&&t.isOk()?t=Zr([r.error]):r.isOk()&&t.isOk()&&t.value.push(r.value);return t},XE=e=>si.fromSafePromise(Promise.all(e)).andThen(Mp),zu;(function(e){function t(i,s){return(...a)=>{try{return Nn(i(...a))}catch(o){return Zr(s?s(o):o)}}}e.fromThrowable=t;function r(i){return $p(i)}e.combine=r;function n(i){return Mp(i)}e.combineWithAllErrors=n})(zu||(zu={}));function Nn(e){return new Wr(e)}function Zr(e){return new Sr(e)}var Wr=class{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}map(e){return Nn(e(this.value))}mapErr(e){return Nn(this.value)}andThen(e){return e(this.value)}andThrough(e){return e(this.value).map(t=>this.value)}andTee(e){try{e(this.value)}catch{}return Nn(this.value)}orTee(e){return Nn(this.value)}orElse(e){return Nn(this.value)}asyncAndThen(e){return e(this.value)}asyncAndThrough(e){return e(this.value).map(()=>this.value)}asyncMap(e){return si.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}safeUnwrap(){const e=this.value;return(function*(){return e})()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw Dp("Called `_unsafeUnwrapErr` on an Ok",this,e)}*[Symbol.iterator](){return this.value}},Sr=class{constructor(e){this.error=e}isOk(){return!1}isErr(){return!this.isOk()}map(e){return Zr(this.error)}mapErr(e){return Zr(e(this.error))}andThrough(e){return Zr(this.error)}andTee(e){return Zr(this.error)}orTee(e){try{e(this.error)}catch{}return Zr(this.error)}andThen(e){return Zr(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return ho(this.error)}asyncAndThrough(e){return ho(this.error)}asyncMap(e){return ho(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}safeUnwrap(){const e=this.error;return(function*(){throw yield Zr(e),new Error("Do not use this generator out of `safeTry`")})()}_unsafeUnwrap(e){throw Dp("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}*[Symbol.iterator](){const e=this;return yield e,e}},sN=zu.fromThrowable,ex=/\{[^{}]+\}/g,tx=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function rx(){return Math.random().toString(36).slice(2,11)}function nx(e){let{baseUrl:t="",Request:r=globalThis.Request,fetch:n=globalThis.fetch,querySerializer:i,bodySerializer:s,pathSerializer:a,headers:o,requestInitExt:l=void 0,...c}={...e};l=tx()?l:void 0,t=zp(t);const f=[];async function u(p,h){const{baseUrl:g,fetch:m=n,Request:v=r,headers:y,params:x={},parseAs:k="json",querySerializer:T,bodySerializer:S=s??sx,pathSerializer:O,body:P,middleware:R=[],...j}=h||{};let N=t;g&&(N=zp(g)??t);let B=typeof i=="function"?i:Rp(i);T&&(B=typeof T=="function"?T:Rp({...typeof i=="object"?i:{},...T}));const U=O||a||ix,oe=P===void 0?void 0:S(P,Lp(o,y,x.header)),he=Lp(oe===void 0||oe instanceof FormData?{}:{"Content-Type":"application/json"},o,y,x.header),J=[...f,...R],ae={redirect:"follow",...c,...j,body:oe,headers:he};let te,ce,fe=new v(ax(p,{baseUrl:N,params:x,querySerializer:B,pathSerializer:U}),ae),G;for(const F in j)F in fe||(fe[F]=j[F]);if(J.length){te=rx(),ce=Object.freeze({baseUrl:N,fetch:m,parseAs:k,querySerializer:B,bodySerializer:S,pathSerializer:U});for(const F of J)if(F&&typeof F=="object"&&typeof F.onRequest=="function"){const de=await F.onRequest({request:fe,schemaPath:p,params:x,options:ce,id:te});if(de)if(de instanceof v)fe=de;else if(de instanceof Response){G=de;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!G){try{G=await m(fe,l)}catch(F){let de=F;if(J.length)for(let q=J.length-1;q>=0;q--){const ke=J[q];if(ke&&typeof ke=="object"&&typeof ke.onError=="function"){const K=await ke.onError({request:fe,error:de,schemaPath:p,params:x,options:ce,id:te});if(K){if(K instanceof Response){de=void 0,G=K;break}if(K instanceof Error){de=K;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(de)throw de}if(J.length)for(let F=J.length-1;F>=0;F--){const de=J[F];if(de&&typeof de=="object"&&typeof de.onResponse=="function"){const q=await de.onResponse({request:fe,response:G,schemaPath:p,params:x,options:ce,id:te});if(q){if(!(q instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");G=q}}}}const X=G.headers.get("Content-Length");if(G.status===204||fe.method==="HEAD"||X==="0"&&!G.headers.get("Transfer-Encoding")?.includes("chunked"))return G.ok?{data:void 0,response:G}:{error:void 0,response:G};if(G.ok)return{data:await(async()=>{if(k==="stream")return G.body;if(k==="json"&&!X){const de=await G.text();return de?JSON.parse(de):void 0}return await G[k]()})(),response:G};let ue=await G.text();try{ue=JSON.parse(ue)}catch{}return{error:ue,response:G}}return{request(p,h,g){return u(h,{...g,method:p.toUpperCase()})},GET(p,h){return u(p,{...h,method:"GET"})},PUT(p,h){return u(p,{...h,method:"PUT"})},POST(p,h){return u(p,{...h,method:"POST"})},DELETE(p,h){return u(p,{...h,method:"DELETE"})},OPTIONS(p,h){return u(p,{...h,method:"OPTIONS"})},HEAD(p,h){return u(p,{...h,method:"HEAD"})},PATCH(p,h){return u(p,{...h,method:"PATCH"})},TRACE(p,h){return u(p,{...h,method:"TRACE"})},use(...p){for(const h of p)if(h){if(typeof h!="object"||!("onRequest"in h||"onResponse"in h||"onError"in h))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");f.push(h)}},eject(...p){for(const h of p){const g=f.indexOf(h);g!==-1&&f.splice(g,1)}}}}function po(e,t,r){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${r?.allowReserved===!0?t:encodeURIComponent(t)}`}function Fp(e,t,r){if(!t||typeof t!="object")return"";const n=[],i={simple:",",label:".",matrix:";"}[r.style]||"&";if(r.style!=="deepObject"&&r.explode===!1){for(const o in t)n.push(o,r.allowReserved===!0?t[o]:encodeURIComponent(t[o]));const a=n.join(",");switch(r.style){case"form":return`${e}=${a}`;case"label":return`.${a}`;case"matrix":return`;${e}=${a}`;default:return a}}for(const a in t){const o=r.style==="deepObject"?`${e}[${a}]`:a;n.push(po(o,t[a],r))}const s=n.join(i);return r.style==="label"||r.style==="matrix"?`${i}${s}`:s}function Np(e,t,r){if(!Array.isArray(t))return"";if(r.explode===!1){const s={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[r.style]||",",a=(r.allowReserved===!0?t:t.map(o=>encodeURIComponent(o))).join(s);switch(r.style){case"simple":return a;case"label":return`.${a}`;case"matrix":return`;${e}=${a}`;default:return`${e}=${a}`}}const n={simple:",",label:".",matrix:";"}[r.style]||"&",i=[];for(const s of t)r.style==="simple"||r.style==="label"?i.push(r.allowReserved===!0?s:encodeURIComponent(s)):i.push(po(e,s,r));return r.style==="label"||r.style==="matrix"?`${n}${i.join(n)}`:i.join(n)}function Rp(e){return function(r){const n=[];if(r&&typeof r=="object")for(const i in r){const s=r[i];if(s!=null){if(Array.isArray(s)){if(s.length===0)continue;n.push(Np(i,s,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof s=="object"){n.push(Fp(i,s,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}n.push(po(i,s,e))}}return n.join("&")}}function ix(e,t){let r=e;for(const n of e.match(ex)??[]){let i=n.substring(1,n.length-1),s=!1,a="simple";if(i.endsWith("*")&&(s=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(a="label",i=i.substring(1)):i.startsWith(";")&&(a="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;const o=t[i];if(Array.isArray(o)){r=r.replace(n,Np(i,o,{style:a,explode:s}));continue}if(typeof o=="object"){r=r.replace(n,Fp(i,o,{style:a,explode:s}));continue}if(a==="matrix"){r=r.replace(n,`;${po(i,o)}`);continue}r=r.replace(n,a==="label"?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return r}function sx(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function ax(e,t){let r=`${t.baseUrl}${e}`;t.params?.path&&(r=t.pathSerializer(r,t.params.path));let n=t.querySerializer(t.params.query??{});return n.startsWith("?")&&(n=n.substring(1)),n&&(r+=`?${n}`),r}function Lp(...e){const t=new Headers;for(const r of e){if(!r||typeof r!="object")continue;const n=r instanceof Headers?r.entries():Object.entries(r);for(const[i,s]of n)if(s===null)t.delete(i);else if(Array.isArray(s))for(const a of s)t.append(i,a);else s!==void 0&&t.set(i,s)}return t}function zp(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function ox(e,t){return nx({baseUrl:e,headers:{"X-Shop-Url":t}})}var lx="/api/v4/calendar",ux="/api/v4/tickets/calendar",cx="/api/v4/auth/validate_token",dx="/api/v4/tickets/list_and_quotas",fx="/api/v4/tickets",hx="/api/v4/auth/sign_in",px="/api/v4/auth",mx="/api/v4/orders/withdrawals",vx="/api/v4/customer/memberships/activate",gx="/api/v4/orders",yx="/api/v4/customer/customer_addresses",bx="/api/v4/customer/memberships",qp={SHOP_GUEST:10,SHOP:20},mo={error:{success:!1,errors:["Not signed in"]}},_x=class{type;#e=se(Pe({customerSalutations:[],countries:[],locales:[]}));#t={};constructor(e,t,r,n="angular"){this.type=n,e&&t&&r&&this.load(e,t,r,n)}async load(e,t,r,n="angular"){(e.includes("jmb-staging.gomus.de")||e.includes("jmb.gomus.de"))&&(this.type="jmb"),d(this.#e).urls=J_(this.type),d(this.#e).currentUser=ZE(this.type),d(this.#e).apiUrl=e,d(this.#e).shopDomain=t,d(this.#e).locale=r||"de",this.#t={},d(this.#e).client=ox(e,t),d(this.#e).capacityManager=Ap(),d(this.#e).cart=UE(),d(this.#e).auth=new Zf,d(this.#e).client.use(new uw(this.auth)),await this.waitForAllFetches(this.shop)}get capacityManager(){return d(this.#e).capacityManager||(d(this.#e).capacityManager=Ap()),d(this.#e).capacityManager}get cart(){return d(this.#e).cart}get auth(){return d(this.#e).auth||(d(this.#e).auth=new Zf),d(this.#e).auth}get currentUser(){return d(this.#e).currentUser}get slug(){return this.shopDomain?.match(/^(?:https?:\/\/)?([^.-]+)/)?.[1]}get client(){return d(this.#e).client}get name(){return this.shop?.name}get config(){return this.shop?.config}get payment_modes(){return this.shop?.payment_modes}get content(){return this.shop?.content}get settings(){return this.shop?.settings}get donations(){return this.shop?.config.donations}get translations(){return this.shop?.translations}get currency(){return this.shop?.config.currency}t(e,t){return this.translate(e,t)}translate(e,t){if(!this.translations?.[e])return e;let r=this.translations[e];if(t&&r)for(const[n,i]of Object.entries(t))r=r.replace(`{{${n}}}`,i);return r||""}get apiUrl(){return d(this.#e).apiUrl}get shopDomain(){return d(this.#e).shopDomain}get baseUrl(){return"https://"+this.shopDomain}get locale(){return d(this.#e).locale}get shop(){return this.fetchAndCache("/api/v4/shop","shop","shop")}get _data(){return d(this.#e)}getCustomer(){return this.auth.data.accessToken?this.fetchAndCache(cx,"getCustomer","",{cache:5}):mo}getOrders(e={}){return this.auth.data.accessToken?this.fetchAndCache(gx,`orders-${JSON.stringify(e)}`,"",{cache:5,query:e}):mo}getCustomerAddresses(){return this.auth.data.accessToken?this.fetchAndCache(yx,"customerAddresses","",{cache:5}):mo}getCustomerMemberships(){return this.auth.data.accessToken?this.fetchAndCache(bx,"customerMemberships","",{cache:5}):mo}ticketsCalendar(e){return this.fetchAndCache(ux,`ticketsCalendar-${JSON.stringify(e)}`,"data",{cache:60,query:e})}calendar(e){return this.fetchAndCache(lx,`calendar-${JSON.stringify(e)}`,"data",{cache:60,query:e})}ticketsAndQuotas(e){return this.fetchAndCache(dx,`ticketsAndQuotas-${JSON.stringify(e)}`,"",{cache:60,query:xt({per_page:100},e??{})})}tickets(e){return this.fetchAndCache(fx,`tickets-${JSON.stringify(e)}`,"tickets",{cache:60,query:xt({per_page:100},e??{})})}ticketsContent(e){return this.fetchAndCache("/api/v4/tickets/content",`ticketsContent-${JSON.stringify(e)}`,"data",{cache:300,query:xt({"ticket_ids[]":e},{per_page:100})})}signIn(e){return this.apiPost(hx,{body:e,requiredFields:["email","password"]})}signUp(e,t=!1){e=xt({addr_addressat:"",addr_street:"n/a",addr_zip:"n/a",addr_city:"n/a",level:t?qp.SHOP_GUEST:qp.SHOP},e);let r=["name","surname","email","email_confirmation","terms"];return t||r.push("password","password_confirmation"),this.apiPost(px,{body:e,requiredFields:r})}withdrawal(e){const t={...e,order_id:String(e.order_id)};return t.note||delete t.note,this.apiPost(mx,{body:t,requiredFields:["order_id","first_name","last_name","email"],parseAs:"text"})}getDates(e){return this.fetchAndCache("/api/v4/dates",`dates-${JSON.stringify(e)}`,"dates",{query:xt({per_page:100},e),cache:60})}updatePassword(e){return this.apiPut("/api/v4/auth/password",{body:e,requiredFields:["current_password","password","password_confirmation"]})}passwordReset(e){return this.apiPost("/api/v4/auth/password",{body:e,requiredFields:["email"]})}activateMembership(e){return this.apiPost(vx,{body:e,requiredFields:["email"],parseAs:"text"})}checkout(e){return this.apiPost("/api/v4/orders",{body:e,requiredFields:["items","total"]})}#r=null;async createCart(e){const t=JSON.stringify({items:e.items??[],coupons:e.coupons??[]});if(this.#r?.key===t)return this.#r.result;const r=await this.apiPost("/api/v4/cart",{body:e,requiredFields:["items"]});return this.#r={key:t,result:r},r}order(e){return this.fetchAndCache("/api/v4/orders/{id}",`order-${e}`,"order",{path:{id:e}})}annualOrder(e){return this.fetchAndCache("/api/v4/annual/order",`annual-order-${e}`,"order",{query:{token:e}})}finalizePersonalizations(e,t){return this.apiPost("/api/v4/annual/personalization/finalize",{body:t,params:{query:{token:e}}})}uploadPersonalizationPhoto(e,t,r){const n=new FormData;return n.append("file",r),this.apiUpload("/api/v4/annual/personalizations/{id}/upload",{body:n,params:{path:{id:t},query:{token:e}}})}fetchAndCache(e,t,r,n){if(n??={},n.query??={},n.cache??=1e3,n.path??={},!this.#i())return console.warn("(fetchAndCache) Couldn't fetch, Shop not loaded!"),d(this.#e)[t];const i=n.query,s=e+JSON.stringify(i),a=!this.#t[s],o=this.#t[s]?.fetchedAt<Date.now()-n.cache*1e3;return(a||o)&&this.apiGet(e,i,n.path).then(l=>{l&&(d(this.#e)[t]=r===""?l:l[r])}),d(this.#e)[t]}get museums(){return this.fetchAndCache("/api/v4/museums","museums","museums",{query:{per_page:100}})}get exhibitions(){return this.fetchAndCache("/api/v4/exhibitions","exhibitions","exhibitions",{query:{per_page:100}})}getEvent(e){return this.fetchAndCache(`/api/v4/events/${e}`,`single_event_${e}`,"event")}getTicketCapacities(e,t){return this.apiPost("/api/v4/tickets/capacities",{body:{date:e,ticket_ids:t},requiredFields:["date","ticket_ids"]})}getCouponSaleByBarcode(e){return this.fetchAndCache(`/api/v4/coupon_sales/barcode/${e}`,`coupon_sale_barcode_${e}`,"coupon_sale",{cache:0})}getCoupons(){return this.fetchAndCache("/api/v4/coupons","coupons","coupons",{query:{online_available:!0,per_page:100}})}getEventDetailsOnDate(e,t){return this.fetchAndCache(`/api/v4/events/${e}/dates/${t}`,`/api/v4/events/${e}/dates/${t}`,"date")}get events(){return this.fetchAndCache("/api/v4/events","events","events",{query:{per_page:100}})}get upcomingEvents(){return this.fetchAndCache("/api/v4/events","events","events",{query:{by_bookable:!0,with_bookings_in_future:1,per_page:100}})}get tours(){return this.fetchAndCache("/api/v4/tours","tours","tours",{query:{per_page:100}})}get merchandises(){return this.fetchAndCache("/api/v4/merchandises","merchandises","merchandises",{query:{per_page:100}})}get customerSalutations(){return this.fetchAndCache("/api/v3/customer_salutations","customerSalutations","customer_salutations")}get countries(){return this.fetchAndCache("/api/v3/countries","countries","countries",{query:{per_page:100}})}get locales(){return this.fetchAndCache("/api/v4/locales","locales","locales_options")}get urls(){return d(this.#e).urls}get#n(){return{params:{query:{locale:this.locale},header:{"X-Shop-Url":this.shopDomain}}}}async apiPost(e,t){return this.apiCall(e,{method:"POST",...t})}async apiPut(e,t){return this.apiCall(e,{method:"PUT",...t})}async apiDELETE(e,t){return this.apiCall(e,{method:"DELETE",...t})}async apiUpload(e,t){this.#s();const{body:r,params:n={}}=t;return await this.client.POST(e,{body:r,params:xt(this.#n,{params:n}).params,bodySerializer:i=>i})}async apiCall(e,t){this.#s();const{body:r,params:n={},requiredFields:i,parseAs:s}=t,a=GE(r,i);if(Object.keys(a).length>0)return{error:{errors:a}};const o=this.client[t.method];return await o(e,{body:r,params:xt(this.#n,{params:n}).params,parseAs:s})}async asyncFetch(e){return await this.waitForAllFetches(e()),e()}async waitForAllFetches(...e){for(;Object.values(this.#t).filter(t=>t.status==="fetching").length;)await ew(10)}async apiGet(e,t={},r){this.#s();const n=e+JSON.stringify(t);this.#t[n]={status:"fetching",fetchedAt:Date.now()};let i=this.#n;t&&(i=xt(i,{params:{query:t}})),e&&(i=xt(i,{params:{path:r}}));const s=await this.client.GET(e,i);return this.#t[n]={status:"completed",fetchedAt:Date.now()},s.data||s}#i=()=>this.apiUrl!==void 0&&this.shopDomain!==void 0&&this.locale!==void 0&&this.client!==void 0;#s=()=>{if(this.apiUrl===void 0)throw new Error("Public API URL is not set");if(this.shopDomain===void 0)throw new Error("Shop Domain (X-Shop-Url) is not set");if(this.locale===void 0)throw new Error("Locale is not set");if(this.client===void 0)throw new Error("client is not set");if(!this.#i())throw new Error("Fetch is not possible.")}},C=new _x;function Li(e){return function(t,r){if(t)t.addEventListener(e,n=>{n.stopPropagation(),n.detail.value=r});else throw new Error("(createSetDetails) Host is undefined, You are probably trying to use this in a non-web-component context.")}}var wx=class py{host;KEY;pollDuration;#e=se(Pe({value:void 0}));error=!1;constructor(t,r,n=1e3){this.host=t,this.KEY=r,this.pollDuration=n}static static(t){const r=new py(null,null);return r.value=t,r}load(){eu(()=>(this.host.dispatchEvent(new CustomEvent(this.KEY,{detail:this,bubbles:!0})),this.value),this.pollDuration).then(()=>{},()=>{this.error=!0,console.warn("(createGetDetails) could not load data for:",this.KEY)})}get value(){return d(this.#e).value}set value(t){d(this.#e).value=t}};function zi(e){return function(t,r={pollDuration:1e3}){if(t){const n=new wx(t,e,r.pollDuration);return n.load(r.pollDuration),n}else throw new Error("(createGetDetails) Host is undefined, You are probably trying to use this in a non-web-component context.")}}var kx={urls:{},navigateTo:e=>{window.location.assign(e)},forms:{},fields:{},quantityStepper:!0},Sx=class{defaultConfig=xt(kx,window.customOptions);override=this.defaultConfig;#e=se(Pe(this.defaultConfig));get options(){return d(this.#e)}set options(e){M(this.#e,e,!0)}constructor(){this.update()}update(){const e=xt(this.defaultConfig,this.override);e.forms=Object.keys({...this.defaultConfig.forms,...this.override.forms}).reduce((t,r)=>(t[r]={...this.defaultConfig.forms[r],...this.override.forms[r]},t),{}),this.options=e}get config(){return this.options}define(e){return this.override=xt(this.override,e),this.update(),this}default(e){return this.defaultConfig=xt(this.defaultConfig,e),this.update(),this}},Qe=new Sx,Up=class{#e=se();get token(){return d(this.#e)}set token(e){M(this.#e,e,!0)}#t=se();get ticketSaleId(){return d(this.#t)}set ticketSaleId(e){M(this.#t,e,!0)}get order(){if(this.token)return ml(C.annualOrder(this.token))}get ticketSale(){if(this.ticketSaleId)return ml(this.order?.ticket_sales.find(e=>e.id==this.ticketSaleId))}get isBmcTicket(){return this.ticketSale?.is_bmc_ticket||!1}goToPersonalization(e){return Qe.config.urls.annualTicketPersonalizationForm?Qe.config.urls.annualTicketPersonalizationForm(this.token,e.id):C.urls.annualTicketPersonalizationForm(this.token,e.id)}},Vp="go-annual-ticket-personalization",Bp=Li(Vp),Ex=zi(Vp),xx=V("<li><a> </a></li>"),Tx=V('<ul class="go-annual-ticket"><li class="go-annual-ticket-title"> </li> <li class="go-annual-ticket-personalization-count"> </li> <!></ul>');function Ax(e,t){re(t,!0);let r=_(t,"token",7);const n=new Up;Bp(t.$$host,n),ve(()=>{n.token=r()});let i=D(()=>n.order);var s={details:n,get token(){return r()},set token(c){r(c),b()}},a=ee(),o=z(a),l=c=>{var f=ee(),u=z(f);Fe(u,17,()=>d(i).ticket_sales,p=>p.id,(p,h)=>{var g=Tx(),m=$(g),v=$(m,!0);I(m);var y=W(m,2),x=$(y,!0);I(y);var k=W(y,2),T=S=>{var O=xx(),P=$(O),R=$(P,!0);I(P),I(O),Q((j,N)=>{me(P,"href",j),Y(R,N)},[()=>n.goToPersonalization(d(h)),()=>C.t("ticket.annual.personalization.list.personalize.add")]),E(S,O)};le(k,S=>{d(h).status=="not_ready_to_send"&&S(T)}),I(g),Q(S=>{me(g,"data-ticket-sale-id",d(h).id),Y(v,d(h).title),Y(x,S)},[()=>C.t("ticket.annual.personalization.detail.title",{count:d(h).personalizations.length})]),E(p,g)}),E(c,f)};return le(o,c=>{d(i)&&c(l)}),E(e,a),ne(s)}customElements.define("go-annual-ticket-personalization",ie(Ax,{token:{attribute:"token",reflect:!0,type:"String"}},[],["details"]));var Cx={salutation:{key:"salutation",apiKey:"customer_salutation_id",type:"select",label:"user.registration.form.customer_salutation_id",placeholder:"",description:"",autocomplete:"honorific-prefix",options:()=>C.customerSalutations.map(e=>({label:e.salutation,value:e.id}))},firstName:{key:"firstName",apiKey:"name",type:"text",label:"user.registration.form.name",placeholder:"",description:"",autocomplete:"given-name"},lastName:{key:"lastName",apiKey:"surname",type:"text",label:"user.registration.form.surname",placeholder:"",description:"",autocomplete:"family-name"},email:{key:"email",apiKey:"email",type:"email",label:"user.registration.form.email",placeholder:"",description:"",autocomplete:"email",validator:Jt().email("user.fieldErrors.emailValid")},confirmEmail:{key:"confirmEmail",apiKey:"email_confirmation",type:"email",label:"user.registration.form.confirmEmail",placeholder:"",description:"",autocomplete:"email",validator:Jt().email("user.fieldErrors.emailValid")},password:{key:"password",apiKey:"password",type:"password",label:"user.registration.form.password",placeholder:"",description:"",autocomplete:"current-password"},currentPassword:{key:"current_password",apiKey:"current_password",type:"password",label:"user.registration.form.password",placeholder:"",description:"",autocomplete:"current-password"},newPassword:{key:"password",apiKey:"password",type:"password",label:"user.registration.form.password",placeholder:"",description:"",autocomplete:"new-password",validator:Jt().min(6,"user.fieldErrors.passwordTooShort")},confirmPassword:{key:"confirmPassword",apiKey:"password_confirmation",type:"password",label:"user.registration.form.confirmPassword",placeholder:"",description:"",autocomplete:"new-password"},addressee:{key:"addressee",apiKey:"addr_addressat",type:"text",label:"user.registration.form.adressat",placeholder:"",description:"",autocomplete:"name"},street:{key:"street",apiKey:"addr_street",type:"text",label:"user.registration.form.street",placeholder:"",description:"",autocomplete:"street-address"},postcode:{key:"postcode",apiKey:"addr_zip",type:"text",label:"user.registration.form.plz",placeholder:"",description:"",autocomplete:"postal-code"},city:{key:"city",apiKey:"addr_city",type:"text",label:"user.registration.form.city",placeholder:"",description:"",autocomplete:"address-level2"},country:{key:"country",apiKey:"addr_country_id",type:"select",label:"user.registration.form.country",placeholder:"",description:"",autocomplete:"country",options:()=>C.countries.map(e=>({label:e.name,value:e.id}))},language:{key:"language",apiKey:"language_id",type:"select",label:"user.registration.form.language",placeholder:"",description:"",autocomplete:"language",options:()=>(C.locales??[]).map(e=>({label:C.t(`languages.${e.locale}`),value:e.id}))},acceptTerms:{key:"acceptTerms",apiKey:"terms",type:"checkbox",label:"user.registration.form.accept",placeholder:"",description:"",autocomplete:"off"},startAt:{apiKey:"start_at",key:"startAt",type:"date",label:"ticket.annual.personalization.list.startAt.update",placeholder:"",description:"",autocomplete:"off",validator:Jt().date()},dateOfBirth:{key:"dateOfBirth",apiKey:"date_of_birth",type:"date",label:"user.registration.form.dateOfBirth",placeholder:"",description:"",autocomplete:"bday",validator:Jt().date()},token:{key:"token",apiKey:"id",type:"text",label:"cart.coupon.form.code",placeholder:"",description:"",autocomplete:"off"},photo:{key:"photo",apiKey:"file",type:"file",label:"ticket.annual.personalization.form.photo",placeholder:"",description:"",autocomplete:"off",validator:L1(File)},withdrawalFirstName:{key:"withdrawalFirstName",apiKey:"first_name",type:"text",label:"user.registration.form.name",placeholder:"",description:"",autocomplete:"given-name"},withdrawalLastName:{key:"withdrawalLastName",apiKey:"last_name",type:"text",label:"user.registration.form.surname",placeholder:"",description:"",autocomplete:"family-name"},orderNumber:{key:"orderNumber",apiKey:"order_id",type:"text",label:"withdrawal.form.orderNumber",placeholder:"",description:"",autocomplete:"off"},withdrawalNote:{key:"withdrawalNote",apiKey:"note",type:"textarea",label:"withdrawal.form.note",placeholder:"",description:"",autocomplete:"off"},paymentMode:{key:"paymentMode",apiKey:"payment_mode_id",type:"paymentMode",label:"cart.paymentMode.label",placeholder:"",description:"",autocomplete:"off",options:()=>(C.payment_modes?Object.values(C.payment_modes):[]).map(e=>({value:String(e.id),label:e.name}))}};function Ox(e,t){return{...e,errors:e.errors||[],value:e.value??Dx(e.type),options:e.options,autocomplete:e.autocomplete??"",placeholder:e.placeholder??"",description:e.description,apiErrors:e.apiErrors??[],mounted:e.mounted??!1,required:t,validate(){Ix(this)}}}function Dx(e){return e==="checkbox"?!1:e==="file"?null:""}function Ix(e){if(e.errors=[],!e.validator){e.required&&(e.value===!1||e.value===""||e.value===null||e.value===void 0)&&(e.errors=["common.fieldErrors.required"]);return}const t=e.validator.safeParse(e.value);t.success?e.errors=[]:e.errors=t.error.format()._errors}var Bt=class il{static#e={};static defineForm(t){Qe.default({forms:{[t.id]:{fields:t.fields,submitLabel:t.submitLabel}}})}static defineFields(t){Qe.default({fields:t})}static{il.defineFields(Cx)}static setRequiredApiKeys(t,r){il.#e[t]=r}static getFormOptions(t){return Qe.config.forms[t]}static createField(t,r){const n=il.getFieldInit(t);if(!n)throw new Error(`(formFields) Field "${t}" not found`);return Ox(n,r)}static getFormFields(t){return Px(t)}static getFieldInit(t){return Qe.config.fields[t]}};function Px(e){const t=Qe.config.forms[e];if(!t)throw new Error(`(formFields) Form ${e} not found`);const r=t.fields;return r||(console.warn("(formFields) No fields defined for form",e),[])}function qu(e){return e?e.filter(t=>t.mounted&&(t.errors?.length||t.apiErrors?.length)).length:0}function $x(e,t){re(t,!0);let r=_(t,"token",7),n=_(t,"ticketSaleId",7),i;const s=new Up;Bp(t.$$host,s),ve(()=>{s.token=r(),s.ticketSaleId=n()}),Bt.defineForm({id:"ticketPersonalization",fields:[{key:"startAt",required:!0}]});async function a(){if(!i)return;const m=s.ticketSale.personalizations.length,v=document.querySelectorAll('go-form:not([form-id="ticketPersonalization"])'),y=jf(m,(S,O)=>{const P=v[O-1].details;return S.push(P),S},[]);if(y.forEach(S=>{S.fields.forEach(O=>{S.validateField(O)})}),!jf(m,(S,O)=>y[O-1].isValid,!1))return;if(s.ticketSale?.photo_mandatory==="mandatory"){const S=y.map(async(P,R)=>{const j=s.ticketSale.personalizations[R].id,N=P.fields.find(U=>U.key==="photo")?.value;if(!(N instanceof File))return{ok:!1,error:"ticket.annual.personalization.photo.missing"};const B=await C.uploadPersonalizationPhoto(r(),j,N);return B.error?{ok:!1,error:B.error.error??"ticket.annual.personalization.photo.upload_failed"}:{ok:!0,error:""}}),O=(await Promise.all(S)).find(P=>!P.ok);if(O){i.details.apiErrors=[O.error];return}}const x={personalization:{ticket_sale_id:s.ticketSaleId,start_at:i.details.formData.start_at,personalizations:y.map((S,O)=>{const P=lw(S.formData,["email_confirmation"]);return{id:s.ticketSale?.personalizations[O].id,customer:P}})}},k=await C.finalizePersonalizations(r(),x);if(k.error){i.details.apiErrors=[k.error.error];return}const T=Qe.config.forms.personalization?.beforeSubmit;T&&T(x),Qe.config.urls.annualTicketPersonalizationFormSubmit?.()&&Qe.config.navigateTo(Qe.config.urls.annualTicketPersonalizationFormSubmit())}let o=null,l=null,c=null,f=0;function u(m){m.querySelectorAll("go-field").forEach(v=>v.replaceChildren())}function p(){return o?!0:(o=t.$$host.querySelector("go-personalization-form"),o?(l=o.cloneNode(!0),u(l),c=new Comment("go-personalization-form-anchor"),o.after(c),!0):(console.warn("[personalization] No <go-personalization-form> supplied"),!1))}function h(m){if(!p()||!o||!l||!c)return;const v=o.parentElement;if(!v)return;const y=Math.max(m,1),x=Array.from(v.querySelectorAll("go-personalization-form"));for(;x.length<y;){const T=l.cloneNode(!0);u(T),v.insertBefore(T,c),x.push(T)}for(;x.length>y;){const T=x.pop();T&&T!==o&&T.remove()}const k=s.ticketSale?.personalizations??[];x.forEach((T,S)=>{const O=k[S];O&&(T.dataset.personalizationId=String(O.id))}),f=y}En(()=>{p(),t.$$host.addEventListener("go-submit",a),i=document.querySelector('go-form[form-id="ticketPersonalization"]')}),ve(()=>{if(!s.ticketSale)return;const m=s.ticketSale?.personalizations.length??1;m!==f&&h(m)});var g={details:s,get token(){return r()},set token(m){r(m),b()},get ticketSaleId(){return n()},set ticketSaleId(m){n(m),b()}};return ne(g)}customElements.define("go-annual-ticket-personalization-form",ie($x,{token:{attribute:"token",reflect:!0,type:"String"},ticketSaleId:{attribute:"ticket-sale-id",reflect:!0,type:"Number"}},[],["details"]));var Mx=class{formId;form;#e=se(Pe([]));#t=D(()=>qu(this.fields)==0);get isValid(){return d(this.#t)}set isValid(e){M(this.#t,e)}#r=se();get successMessage(){return d(this.#r)}set successMessage(e){M(this.#r,e,!0)}get formData(){function e(r){return nw(r)||tw(r)?r:r==="true"||r==="false"?r==="true":!Number.isNaN(+r)&&r.trim()!==""?+r:r}const t=this.fields.filter(r=>r!==void 0).filter(r=>r.type!=="file").filter(r=>r.value!=="");return Object.fromEntries(t.map(r=>[r.apiKey,e(r.value)]))}fieldValue(e){return this.fields.find(t=>t.key===e)?.value}get apiErrors(){return d(this.#e)}set apiErrors(e){if(this.fields.forEach(t=>t.apiErrors=[]),tu(e)){M(this.#e,e,!0);return}if(e.errors&&tu(e.errors)&&M(this.#e,e.errors,!0),rw(e.error)){M(this.#e,[e.error],!0);return}for(const[t,r]of Object.entries(e)){if(t==="full_messages"||t==="success"||t==="errors")continue;const n=this.fields.find(i=>i.apiKey===t);if(!n){console.error(`(set apiErrors) Field with API key ${t} not found`);continue}n.apiErrors=r}}validateForm(){this.fields.forEach(e=>this.validateField(e))}validateField(e){if(e.validate(),e.apiKey==="password_confirmation"){const t=this.fields.find(r=>r.apiKey==="password");(!t||t&&e.value!==t.value)&&e.errors.push("user.fieldErrors.passwordMatch")}else if(e.apiKey==="email_confirmation"){const t=this.fields.find(r=>r.apiKey==="email");(!t||t&&e.value!==t.value)&&e.errors.push("user.fieldErrors.emailMatch")}}get fields(){const e=this.form.closest("go-form");return Array.from(this.form.querySelectorAll("go-field")).filter(t=>t.closest("go-form")===e).map(t=>t.getField?.()).filter(t=>t)}toString(){return`Form: ${this.formId}, Fields: [${this.fields.map(e=>e.key).join(", ")}], Data: ${JSON.stringify(this.formData)}`}fill(e){const t=this.fields;Object.entries(e).forEach(([r,n])=>{const i=t.find(s=>s.apiKey===r);if(!i){console.warn(`(FormDetails.fill) Field with API key ${r} not found.`);return}if(i.type==="select"&&!i.options?.().find(s=>s.value===n))throw new Error(`(FormDetails.fill) Field ${r} has invalid value: ${n}`);if(i.type==="checkbox"&&![!0,!1].includes(n))throw new Error(`(FormDetails.fill) Field ${r} has invalid value: ${n}`);i.value=n})}constructor(e,t){this.formId=e,this.form=t}},jp="go-form-details",Fx=Li(jp),qi=zi(jp);function Hr(e,t,r){const n=e.firstElementChild||void 0;if(e.children?.length===1&&n?.tagName.toLowerCase()===t)return n;const i=document.createElement(t);r&&Object.entries(r).forEach(([a,o])=>{typeof o=="boolean"?o&&i.setAttribute(a,""):i.setAttribute(a,o)});const s=document.createDocumentFragment();for(;e.firstChild;)s.appendChild(e.firstChild);return i.appendChild(s),e.replaceChildren(i),i}var Nx=V("<go-all-fields></go-all-fields> <go-form-feedback><go-errors-feedback></go-errors-feedback> <go-success-feedback></go-success-feedback></go-form-feedback> <go-submit> </go-submit>",3);function Rx(e,t){re(t,!0);let r=_(t,"formId",7),n=_(t,"custom",7);const i=new Mx(r(),t.$$host);Fx(t.$$host,i);async function s(f){f.preventDefault(),f.stopPropagation(),i.validateForm(),i?.form?.dispatchEvent(new Event("go-after-validation",f)),i.isValid&&(i.apiErrors={},i?.form?.dispatchEvent(new Event("go-submit",f)),t.$$host.dispatchEvent(new Event("submit",{bubbles:!0,composed:!0})))}En(()=>{const f=Hr(t.$$host,"form",{novalidate:!0});f.addEventListener("submit",s),i.form=f});var a={details:i,get formId(){return r()},set formId(f){r(f),b()},get custom(){return n()},set custom(f){n(f),b()}},o=ee(),l=z(o),c=f=>{var u=Nx(),p=z(u),h=W(p,2),g=W(h,2),m=$(g,!0);I(g),Q(v=>Y(m,v),[()=>C.t(Bt.getFormOptions(r())?.submitLabel||"Submit")]),E(f,u)};return le(l,f=>{n()||f(c)}),E(e,o),ne(a)}customElements.define("go-form",ie(Rx,{formId:{attribute:"form-id",reflect:!0,type:"String"},custom:{attribute:"custom",reflect:!0,type:"Boolean"}},[],["details"]));var Lx=V("<go-form></go-form>",2);function zx(e,t){re(t,!0);let r=_(t,"custom",7,!1);Bt.defineForm({id:"passwordReset",submitLabel:"user.passwordReset.actions.requestPasswordReset",fields:[{key:"email",required:!0}]});async function n(a){const o=a.target.details,l=await C.passwordReset(o.formData);l.data?(t.$$host.dispatchEvent(new Event("go-success",{bubbles:!0,composed:!0})),o.successMessage=l.data.message,o.apiErrors=[]):o.apiErrors=l.error.errors}var i={get custom(){return r()},set custom(a=!1){r(a),b()}},s=Lx();return Jn(s,"formId","passwordReset"),Q(()=>Jn(s,"custom",r())),La("submit",s,n),E(e,s),ne(i)}customElements.define("go-password-reset",ie(zx,{custom:{}},[],[]));function qx(e,t){re(t,!0),Bt.defineForm({id:"signIn",submitLabel:"common.actions.login",fields:[{key:"email",required:!0},{key:"password",required:!0}]});let r=_(t,"custom",7,!1);async function n(i){const s=i.target.details,a=await C.signIn(s.formData);a.data?t.$$host.dispatchEvent(new Event("go-success",{bubbles:!0,composed:!0})):s.apiErrors=a.error.errors}return Hr(t.$$host,"go-form",{"form-id":"signIn",custom:r()}),t.$$host.addEventListener("submit",n),ne({get custom(){return r()},set custom(i=!1){r(i),b()}})}customElements.define("go-sign-in",ie(qx,{custom:{attribute:"custom",reflect:!0,type:"Boolean"}},[],[]));function Ux(e,t){re(t,!0);let r=_(t,"custom",7,!1);Bt.defineForm({id:"signUp",submitLabel:"common.actions.register",fields:[{key:"firstName",required:!0},{key:"lastName",required:!0},{key:"email",required:!0},{key:"confirmEmail",required:!0},{key:"newPassword",required:!0},{key:"confirmPassword",required:!0},{key:"acceptTerms",required:!0}]});async function n(i){const s=i.target.details,a=await C.signUp(s.formData,!1);a.data?t.$$host.dispatchEvent(new Event("go-success",{bubbles:!0,composed:!0})):s.apiErrors=a.error.errors}return Hr(t.$$host,"go-form",{"form-id":"signUp",custom:r()}),t.$$host.addEventListener("submit",n),ne({get custom(){return r()},set custom(i=!1){r(i),b()}})}customElements.define("go-sign-up",ie(Ux,{custom:{attribute:"custom",reflect:!0,type:"Boolean"}},[],[]));function Vx(e,t){if(typeof e=="number"&&Number.isFinite(e))return e;if(e&&typeof e=="object"){const r=Object.values(e).reduce((n,i)=>typeof i=="number"&&Number.isFinite(i)?n+i:n,0);if(r>0)return r}return t}function Bx(e){return"quantity"in e&&e.quantity!==void 0?e.quantity:e.quantities}function jx(e){return Vx(Bx(e),0)}function Zx(e,t){const r=Ni(),n=new Set(t.map(i=>i.attributes.coupon).filter(Boolean).map(i=>i.toUpperCase()));return e.coupons.forEach(i=>r.addCoupon({...i,applied:i.kind!=="actionToken"||n.has(i.code)})),t.forEach(i=>{const s=i.attributes,a=s.uuid,o=e.items.find(l=>l.uuid===a);if(!o){console.error("(go-cart) Ignoring unmatched cart line",{type:i.type,attrs:s});return}r.addItem(Wx(o,s))}),r}function Wx(e,t){const r=_p(e.product)?1:jx(t),n=e.product.price_cents,i=n===0?0:t.price_cents??n,s=i<n;return ot({...e.product,price_cents:i},{quantity:r,time:e.time,voucher:e.voucher,mantle:e.mantle,display:{discounted:s,reference_uuid:e.uuid,originalPrice:n}})}var Hx=class{#e=se();get displayCart(){return d(this.#e)}set displayCart(e){M(this.#e,e,!0)}#t=se(!1);get preview(){return d(this.#t)}set preview(e){M(this.#t,e,!0)}get totalPriceCents(){return this.displayCart?.amountToPayCents??0}get subtotalPriceCents(){return C.cart?.totalPriceCents??0}get discountedAmountCents(){return Math.max(0,this.subtotalPriceCents-this.totalPriceCents)}get isDiscounted(){return this.discountedAmountCents>0}async calculateDisplayCart(){const e=C.cart;if(e)try{const{items:t,coupons:r}=e.orderData(),n=await C.createCart({items:t,coupons:r});if(n?.data){this.displayCart=Zx(e,n.data.items??[]);return}console.error("(go-cart) Unable to fetch discounted cart data",n?.error),this.displayCart=e}catch(t){console.error("(go-cart) Unable to fetch discounted cart data",t),this.displayCart=e}}},Zp="go-cart-details",Gx=Li(Zp),Ui=zi(Zp),Kx=V('<span class="go-cart-item-title" data-testid="cart-item-title"> </span>');function Wp(e,t){re(t,!0);let r=_(t,"cartItem",7);var n={get cartItem(){return r()},set cartItem(a){r(a),b()}},i=Kx(),s=$(i,!0);return I(i),Q(()=>Y(s,r().product.title)),E(e,i),ne(n)}ie(Wp,{cartItem:{}},[],[],{mode:"open"});var Yx=V('<span class="go-cart-item-date" data-testid="cart-item-date"> </span><span class="go-cart-item-time" data-testid="cart-item-time"> </span>',1),Jx=V('<span class="go-cart-item-title" data-testid="cart-item-title"><span class="go-cart-item-title-event-title"> </span><span class="go-cart-item-title-ticket-title"> </span></span><!>',1);function Hp(e,t){re(t,!0);let r=_(t,"cartItem",7);if(!Ws(r().product))throw new Error("Product is not an event ticket");const n=r().product;var i={get cartItem(){return r()},set cartItem(h){r(h),b()}},s=Jx(),a=z(s),o=$(a),l=$(o,!0);I(o);var c=W(o),f=$(c,!0);I(c),I(a);var u=W(a),p=h=>{var g=Yx(),m=z(g),v=$(m,!0);I(m);var y=W(m),x=$(y,!0);I(y),Q((k,T)=>{Y(v,k),Y(x,T)},[()=>ni(r().time,{month:"numeric",day:"numeric"},C.locale),()=>$n(r().time)]),E(h,g)};return le(u,h=>{r().time&&h(p)}),Q(()=>{Y(l,n.event_title),Y(f,n.title)}),E(e,s),ne(i)}ie(Hp,{cartItem:{}},[],[],{mode:"open"});var Qx=V('<span class="go-cart-item-time" data-testid="cart-item-time"> </span>'),Xx=V('<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>',1),eT=V('<span class="go-cart-item-title" data-testid="cart-item-title"> </span> <!>',1);function Gp(e,t){re(t,!0);let r=_(t,"cartItem",7);var n={get cartItem(){return r()},set cartItem(c){r(c),b()}},i=eT(),s=z(i),a=$(s,!0);I(s);var o=W(s,2),l=c=>{var f=Xx(),u=z(f),p=$(u,!0);I(u);var h=W(u,2),g=m=>{var v=Qx(),y=$(v,!0);I(v),Q(x=>Y(y,x),[()=>$n(r().time)]),E(m,v)};le(h,m=>{r().product.type==="Ticket"&&r().product.subtype==="timeslot"&&m(g)}),Q(m=>Y(p,m),[()=>ni(r().time,{month:"numeric",day:"numeric"},C.locale)]),E(c,f)};return le(o,c=>{r().time&&c(l)}),Q(()=>Y(a,r().product.title)),E(e,i),ne(n)}ie(Gp,{cartItem:{}},[],[],{mode:"open"});var tT=V('<span class="go-cart-item-time" data-testid="cart-item-time"> </span>'),rT=V('<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>',1),nT=V('<span class="go-cart-item-custom" data-testid="cart-item-custom"> </span>'),iT=V('<span class="go-cart-item-title" data-testid="cart-item-title"> </span> <span class="go-cart-item-participants" data-testid="cart-item-participants"> </span> <!> <!>',1);function Kp(e,t){re(t,!0);let r=_(t,"cartItem",7);const n=D(()=>r().product),i=D(()=>{if(!r().time)return null;try{return{date:ni(r().time,{year:"numeric",month:"numeric",day:"numeric"},C.locale),time:$n(r().time)}}catch{return{date:r().time,time:""}}}),s=v=>v==null?"":typeof v=="object"?JSON.stringify(v):String(v),a=D(()=>Object.entries(d(n).customs??{}).filter(([,v])=>v!=null&&v!==""));var o={get cartItem(){return r()},set cartItem(v){r(v),b()}},l=iT(),c=z(l),f=$(c,!0);I(c);var u=W(c,2),p=$(u,!0);I(u);var h=W(u,2),g=v=>{var y=rT(),x=z(y),k=$(x,!0);I(x);var T=W(x,2),S=O=>{var P=tT(),R=$(P,!0);I(P),Q(()=>Y(R,d(i).time)),E(O,P)};le(T,O=>{d(i).time&&O(S)}),Q(()=>Y(k,d(i).date)),E(v,y)};le(h,v=>{d(i)&&v(g)});var m=W(h,2);return Fe(m,17,()=>d(a),([v,y])=>v,(v,y)=>{var x=D(()=>Jy(d(y),2));let k=()=>d(x)[0],T=()=>d(x)[1];var S=nT(),O=$(S);I(S),Q(P=>Y(O,`${k()??""}: ${P??""}`),[()=>s(T())]),E(v,S)}),Q(v=>{Y(f,d(n).title),Y(p,v)},[()=>C.t("cart.item.participants",{count:d(n).participants})]),E(e,l),ne(o)}ie(Kp,{cartItem:{}},[],[],{mode:"open"});function Yp(e,{min:t,max:r}){const n=e<t?Math.max(t,1):e+1;return n>r?e:n}function sT(e,{min:t,floor:r=0}){return e<=t?r:e-1}function aT(e,{min:t,max:r,floor:n=0}){if(!Number.isFinite(e)||e<=0)return n;let i=Math.floor(e);return i<t&&(i=t),i>r&&(i=r),i}function oT(e,{min:t,max:r,floor:n=0}){return e<0||e>r?!1:e===n||e>=t}function Jp(e,t){return Yp(e,t)>e}function Qp(e,{floor:t=0}){return e>t}var lT=V('<div class="go-quantity-stepper" role="group"><button type="button" class="go-quantity-stepper-button go-quantity-stepper-decrement" tabindex="-1"><span aria-hidden="true">−</span></button> <input class="go-quantity-stepper-value" type="text" role="spinbutton" inputmode="numeric" autocomplete="off"/> <button type="button" class="go-quantity-stepper-button go-quantity-stepper-increment" tabindex="-1"><span aria-hidden="true">+</span></button></div>');function Xp(e,t){const r=mt();re(t,!0);let n=_(t,"value",7),i=_(t,"min",7),s=_(t,"max",7),a=_(t,"floor",7,0),o=_(t,"label",7),l=_(t,"decreaseLabel",7),c=_(t,"increaseLabel",7),f=_(t,"onChange",7);const u=D(()=>({min:i(),max:s(),floor:a()}));let p,h=se(!1);const g=D(()=>!Qp(n(),d(u))),m=D(()=>!Jp(n(),d(u)));function v(B){B!==n()&&f()(B)}function y(){Qp(n(),d(u))&&v(sT(n(),d(u)))}function x(){Jp(n(),d(u))&&v(Yp(n(),d(u)))}function k(){const B=aT(parseInt(p.value,10),d(u));M(h,!1),p.value=String(B),v(B)}function T(){const B=p.value.trim();M(h,!(/^\d+$/.test(B)&&oT(parseInt(B,10),d(u))))}function S(B){switch(B.key){case"ArrowUp":B.preventDefault(),x();break;case"ArrowDown":B.preventDefault(),y();break;case"Home":B.preventDefault(),v(a());break;case"End":B.preventDefault(),v(s());break;case"Enter":B.preventDefault(),k();break}}var O={get value(){return n()},set value(B){n(B),b()},get min(){return i()},set min(B){i(B),b()},get max(){return s()},set max(B){s(B),b()},get floor(){return a()},set floor(B=0){a(B),b()},get label(){return o()},set label(B){o(B),b()},get decreaseLabel(){return l()},set decreaseLabel(B){l(B),b()},get increaseLabel(){return c()},set increaseLabel(B){c(B),b()},get onChange(){return f()},set onChange(B){f(B),b()}},P=lT(),R=$(P),j=W(R,2);Ms(j),Ql(j,B=>p=B,()=>p);var N=W(j,2);return I(P),Q(()=>{me(P,"aria-label",o()),me(R,"title",l()),me(R,"aria-controls",r),me(R,"aria-disabled",d(g)),me(j,"id",r),me(j,"aria-label",o()),Bl(j,n()),me(j,"aria-valuenow",n()),me(j,"aria-valuemin",a()),me(j,"aria-valuemax",s()),me(j,"aria-invalid",d(h)?"true":void 0),me(N,"title",c()),me(N,"aria-controls",r),me(N,"aria-disabled",d(m))}),pt("click",R,y),pt("input",j,T),pt("change",j,k),La("blur",j,k),pt("keydown",j,S),pt("click",N,x),E(e,P),ne(O)}ur(["click","input","change","keydown"]),ie(Xp,{value:{},min:{},max:{},floor:{},label:{},decreaseLabel:{},increaseLabel:{},onChange:{}},[],[],{mode:"open"});function uT(e,t,r={floor:0}){const{floor:n}=r;if(t===0||t===n)return[vo(n)];if(t<e)return e>n?[vo(e)]:[];const i=Math.max(e,n),s=[vo(n)];for(let a=i;a<=t;a++)a!==n&&s.push(vo(a));return s}function vo(e){return{value:e,label:e.toString()}}var cT=V("<option> </option>"),dT=V('<select class="go-quantity-select"></select>');function go(e,t){re(t,!0);let r=_(t,"value",7),n=_(t,"min",7),i=_(t,"max",7),s=_(t,"label",7),a=_(t,"floor",7,0),o=_(t,"deselectable",7,!0),l=_(t,"onChange",7);const c=D(()=>Qe.config.quantityStepper);var f={get value(){return r()},set value(m){r(m),b()},get min(){return n()},set min(m){n(m),b()},get max(){return i()},set max(m){i(m),b()},get label(){return s()},set label(m){s(m),b()},get floor(){return a()},set floor(m=0){a(m),b()},get deselectable(){return o()},set deselectable(m=!0){o(m),b()},get onChange(){return l()},set onChange(m){l(m),b()}},u=ee(),p=z(u),h=m=>{{let v=D(()=>o()?0:n()),y=D(()=>C.t("quantity.decrease")),x=D(()=>C.t("quantity.increase"));Xp(m,{get value(){return r()},get min(){return n()},get max(){return i()},get floor(){return d(v)},get label(){return s()},get decreaseLabel(){return d(y)},get increaseLabel(){return d(x)},get onChange(){return l()}})}},g=m=>{var v=dT();Fe(v,21,()=>uT(n(),i(),{floor:o()?a():n()}),y=>y.value,(y,x)=>{var k=cT(),T=$(k,!0);I(k);var S={};Q(()=>{Ff(k,r()===d(x).value),Y(T,d(x).label),S!==(S=d(x).value)&&(k.value=(k.__value=d(x).value)??"")}),E(y,k)}),I(v),Q(()=>me(v,"aria-label",s())),pt("change",v,y=>l()(parseInt(y.target.value,10))),E(m,v)};return le(p,m=>{d(c)?m(h):m(g,-1)}),E(e,u),ne(f)}ur(["change"]),ie(go,{value:{},min:{},max:{},label:{},floor:{},deselectable:{},onChange:{}},[],[],{mode:"open"});function em(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function fT(e){if(Array.isArray(e))return e}function hT(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,a,o=[],l=!0,c=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(l=(n=s.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(f){c=!0,i=f}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return o}}function pT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
75
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const o=a[1];if(t===a[0]){s(a);continue}if(e.external){const l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(o.cycle){s(a);continue}if(o.count>1&&e.reused==="ref"){s(a);continue}}}function Ph(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=o=>{const l=e.seen.get(o);if(l.ref===null)return;const c=l.def??l.schema,f={...c},u=l.ref;if(l.ref=null,u){n(u);const h=e.seen.get(u),g=h.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,f),o._zod.parent===u)for(const m in c)m==="$ref"||m==="allOf"||m in f||delete c[m];if(g.$ref&&h.def)for(const m in c)m==="$ref"||m==="allOf"||m in h.def&&JSON.stringify(c[m])===JSON.stringify(h.def[m])&&delete c[m]}const p=o._zod.parent;if(p&&p!==u){n(p);const h=e.seen.get(p);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(const g in c)g==="$ref"||g==="allOf"||g in h.def&&JSON.stringify(c[g])===JSON.stringify(h.def[g])&&delete c[g]}e.override({zodSchema:o,jsonSchema:c,path:l.path??[]})};for(const o of[...e.seen.entries()].reverse())n(o[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,r.def??r.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&i.id===s&&delete i.id;const a=e.external?.defs??{};for(const o of e.seen.entries()){const l=o[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,a[l.defId]=l.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:to(t,"input",e.processors),output:to(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Dt(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Dt(n.element,r);if(n.type==="set")return Dt(n.valueType,r);if(n.type==="lazy")return Dt(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Dt(n.innerType,r);if(n.type==="intersection")return Dt(n.left,r)||Dt(n.right,r);if(n.type==="record"||n.type==="map")return Dt(n.keyType,r)||Dt(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Dt(n.in,r)||Dt(n.out,r);if(n.type==="object"){for(const i in n.shape)if(Dt(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(Dt(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(Dt(i,r))return!0;return!!(n.rest&&Dt(n.rest,r))}return!1}var sS=(e,t={})=>r=>{const n=Dh({...r,processors:t});return _t(e,n),Ih(n,e),Ph(n,e)},to=(e,t,r={})=>n=>{const{libraryOptions:i,target:s}=n??{},a=Dh({...i??{},target:s,io:t,processors:r});return _t(e,a),Ih(a,e),Ph(a,e)},aS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oS=(e,t,r,n)=>{const i=r;i.type="string";const{minimum:s,maximum:a,format:o,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof a=="number"&&(i.maxLength=a),o&&(i.format=aS[o]??o,i.format===""&&delete i.format,o==="time"&&delete i.format),c&&(i.contentEncoding=c),l&&l.size>0){const f=[...l];f.length===1?i.pattern=f[0].source:f.length>1&&(i.allOf=[...f.map(u=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:u.source}))])}},lS=(e,t,r,n)=>{const i=r,{minimum:s,maximum:a,format:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:f}=e._zod.bag;typeof o=="string"&&o.includes("int")?i.type="integer":i.type="number";const u=typeof f=="number"&&f>=(s??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";u?h?(i.minimum=f,i.exclusiveMinimum=!0):i.exclusiveMinimum=f:typeof s=="number"&&(i.minimum=s),p?h?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof a=="number"&&(i.maximum=a),typeof l=="number"&&(i.multipleOf=l)},uS=(e,t,r,n)=>{r.not={}},cS=(e,t,r,n)=>{},dS=(e,t,r,n)=>{const i=e._zod.def,s=Gf(i.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},fS=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},hS=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},pS=(e,t,r,n)=>{const i=r,s=e._zod.def,{minimum:a,maximum:o}=e._zod.bag;typeof a=="number"&&(i.minItems=a),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=_t(s.element,t,{...n,path:[...n.path,"items"]})},mS=(e,t,r,n)=>{const i=r,s=e._zod.def;i.type="object",i.properties={};const a=s.shape;for(const c in a)i.properties[c]=_t(a[c],t,{...n,path:[...n.path,"properties",c]});const o=new Set(Object.keys(a)),l=new Set([...o].filter(c=>{const f=s.shape[c]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));l.size>0&&(i.required=Array.from(l)),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=_t(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},vS=(e,t,r,n)=>{const i=e._zod.def,s=i.inclusive===!1,a=i.options.map((o,l)=>_t(o,t,{...n,path:[...n.path,s?"oneOf":"anyOf",l]}));s?r.oneOf=a:r.anyOf=a},gS=(e,t,r,n)=>{const i=e._zod.def,s=_t(i.left,t,{...n,path:[...n.path,"allOf",0]}),a=_t(i.right,t,{...n,path:[...n.path,"allOf",1]}),o=l=>"allOf"in l&&Object.keys(l).length===1;r.allOf=[...o(s)?s.allOf:[s],...o(a)?a.allOf:[a]]},yS=(e,t,r,n)=>{const i=e._zod.def,s=_t(i.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},bS=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType},_S=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},wS=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},kS=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},SS=(e,t,r,n)=>{const i=e._zod.def,s=i.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?s?i.out:i.in:i.out;_t(a,t,n);const o=t.seen.get(e);o.ref=a},ES=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType,r.readOnly=!0},$h=(e,t,r,n)=>{const i=e._zod.def;_t(i.innerType,t,n);const s=t.seen.get(e);s.ref=i.innerType},xS=H("ZodISODateTime",(e,t)=>{$0.init(e,t),Xe.init(e,t)});function TS(e){return Nk(xS,e)}var AS=H("ZodISODate",(e,t)=>{M0.init(e,t),Xe.init(e,t)});function CS(e){return Rk(AS,e)}var OS=H("ZodISOTime",(e,t)=>{F0.init(e,t),Xe.init(e,t)});function DS(e){return Lk(OS,e)}var IS=H("ZodISODuration",(e,t)=>{N0.init(e,t),Xe.init(e,t)});function PS(e){return zk(IS,e)}var $S=(e,t)=>{th.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>xw(e,r)},flatten:{value:r=>Ew(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,nu,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,nu,2)}},isEmpty:{get(){return e.issues.length===0}}})},dr=H("ZodError",$S,{Parent:Error}),MS=lu(dr),FS=uu(dr),NS=Ka(dr),RS=Ya(dr),LS=Cw(dr),zS=Ow(dr),qS=Dw(dr),US=Iw(dr),VS=Pw(dr),BS=$w(dr),jS=Mw(dr),ZS=Fw(dr),Mh=new WeakMap;function Ls(e,t,r){const n=Object.getPrototypeOf(e);let i=Mh.get(n);if(i||(i=new Set,Mh.set(n,i)),!i.has(t)){i.add(t);for(const s in r){const a=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){const o=a.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o}),o},set(o){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:o})}})}}}var dt=H("ZodType",(e,t)=>(ct.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:to(e,"input"),output:to(e,"output")}}),e.toJSONSchema=sS(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>MS(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>NS(e,r,n),e.parseAsync=async(r,n)=>FS(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>RS(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>LS(e,r,n),e.decode=(r,n)=>zS(e,r,n),e.encodeAsync=async(r,n)=>qS(e,r,n),e.decodeAsync=async(r,n)=>US(e,r,n),e.safeEncode=(r,n)=>VS(e,r,n),e.safeDecode=(r,n)=>BS(e,r,n),e.safeEncodeAsync=async(r,n)=>jS(e,r,n),e.safeDecodeAsync=async(r,n)=>ZS(e,r,n),Ls(e,"ZodType",{check(...r){const n=this.def;return this.clone(An(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return Cn(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(N1(r,n))},superRefine(r,n){return this.check(R1(r,n))},overwrite(r){return this.check($i(r))},optional(){return Vh(this)},exactOptional(){return E1(this)},nullable(){return Bh(this)},nullish(){return Vh(Bh(this))},nonoptional(r){return D1(this,r)},array(){return qh(this)},or(r){return g1([this,r])},and(r){return b1(this,r)},transform(r){return Zh(this,k1(r))},default(r){return A1(this,r)},prefault(r){return O1(this,r)},catch(r){return P1(this,r)},pipe(r){return Zh(this,r)},readonly(){return F1(this)},describe(r){const n=this.clone();return Rs.add(n,{description:r}),n},meta(...r){if(r.length===0)return Rs.get(this);const n=this.clone();return Rs.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Rs.get(e)?.description},configurable:!0}),e)),Fh=H("_ZodString",(e,t)=>{cu.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(n,i,s)=>oS(e,n,i,s);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Ls(e,"_ZodString",{regex(...n){return this.check(jk(...n))},includes(...n){return this.check(Hk(...n))},startsWith(...n){return this.check(Gk(...n))},endsWith(...n){return this.check(Kk(...n))},min(...n){return this.check(eo(...n))},max(...n){return this.check(Ch(...n))},length(...n){return this.check(Oh(...n))},nonempty(...n){return this.check(eo(1,...n))},lowercase(n){return this.check(Zk(n))},uppercase(n){return this.check(Wk(n))},trim(){return this.check(Jk())},normalize(...n){return this.check(Yk(...n))},toLowerCase(){return this.check(Qk())},toUpperCase(){return this.check(Xk())},slugify(){return this.check(eS())}})}),WS=H("ZodString",(e,t)=>{cu.init(e,t),Fh.init(e,t),e.email=r=>e.check(mk(HS,r)),e.url=r=>e.check(_k(GS,r)),e.jwt=r=>e.check(Fk(u1,r)),e.emoji=r=>e.check(wk(KS,r)),e.guid=r=>e.check(Eh(Nh,r)),e.uuid=r=>e.check(vk(ro,r)),e.uuidv4=r=>e.check(gk(ro,r)),e.uuidv6=r=>e.check(yk(ro,r)),e.uuidv7=r=>e.check(bk(ro,r)),e.nanoid=r=>e.check(kk(YS,r)),e.guid=r=>e.check(Eh(Nh,r)),e.cuid=r=>e.check(Sk(JS,r)),e.cuid2=r=>e.check(Ek(QS,r)),e.ulid=r=>e.check(xk(XS,r)),e.base64=r=>e.check(Pk(a1,r)),e.base64url=r=>e.check($k(o1,r)),e.xid=r=>e.check(Tk(e1,r)),e.ksuid=r=>e.check(Ak(t1,r)),e.ipv4=r=>e.check(Ck(r1,r)),e.ipv6=r=>e.check(Ok(n1,r)),e.cidrv4=r=>e.check(Dk(i1,r)),e.cidrv6=r=>e.check(Ik(s1,r)),e.e164=r=>e.check(Mk(l1,r)),e.datetime=r=>e.check(TS(r)),e.date=r=>e.check(CS(r)),e.time=r=>e.check(DS(r)),e.duration=r=>e.check(PS(r))});function Jt(e){return pk(WS,e)}var Xe=H("ZodStringFormat",(e,t)=>{Je.init(e,t),Fh.init(e,t)}),HS=H("ZodEmail",(e,t)=>{E0.init(e,t),Xe.init(e,t)}),Nh=H("ZodGUID",(e,t)=>{k0.init(e,t),Xe.init(e,t)}),ro=H("ZodUUID",(e,t)=>{S0.init(e,t),Xe.init(e,t)}),GS=H("ZodURL",(e,t)=>{x0.init(e,t),Xe.init(e,t)}),KS=H("ZodEmoji",(e,t)=>{T0.init(e,t),Xe.init(e,t)}),YS=H("ZodNanoID",(e,t)=>{A0.init(e,t),Xe.init(e,t)}),JS=H("ZodCUID",(e,t)=>{C0.init(e,t),Xe.init(e,t)}),QS=H("ZodCUID2",(e,t)=>{O0.init(e,t),Xe.init(e,t)}),XS=H("ZodULID",(e,t)=>{D0.init(e,t),Xe.init(e,t)}),e1=H("ZodXID",(e,t)=>{I0.init(e,t),Xe.init(e,t)}),t1=H("ZodKSUID",(e,t)=>{P0.init(e,t),Xe.init(e,t)}),r1=H("ZodIPv4",(e,t)=>{R0.init(e,t),Xe.init(e,t)}),n1=H("ZodIPv6",(e,t)=>{L0.init(e,t),Xe.init(e,t)}),i1=H("ZodCIDRv4",(e,t)=>{z0.init(e,t),Xe.init(e,t)}),s1=H("ZodCIDRv6",(e,t)=>{q0.init(e,t),Xe.init(e,t)}),a1=H("ZodBase64",(e,t)=>{U0.init(e,t),Xe.init(e,t)}),o1=H("ZodBase64URL",(e,t)=>{B0.init(e,t),Xe.init(e,t)}),l1=H("ZodE164",(e,t)=>{j0.init(e,t),Xe.init(e,t)}),u1=H("ZodJWT",(e,t)=>{W0.init(e,t),Xe.init(e,t)}),Rh=H("ZodNumber",(e,t)=>{dh.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(n,i,s)=>lS(e,n,i,s),Ls(e,"ZodNumber",{gt(n,i){return this.check(Th(n,i))},gte(n,i){return this.check(hu(n,i))},min(n,i){return this.check(hu(n,i))},lt(n,i){return this.check(xh(n,i))},lte(n,i){return this.check(fu(n,i))},max(n,i){return this.check(fu(n,i))},int(n){return this.check(Lh(n))},safe(n){return this.check(Lh(n))},positive(n){return this.check(Th(0,n))},nonnegative(n){return this.check(hu(0,n))},negative(n){return this.check(xh(0,n))},nonpositive(n){return this.check(fu(0,n))},multipleOf(n,i){return this.check(Ah(n,i))},step(n,i){return this.check(Ah(n,i))},finite(){return this}});const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function zs(e){return qk(Rh,e)}var c1=H("ZodNumberFormat",(e,t)=>{H0.init(e,t),Rh.init(e,t)});function Lh(e){return Uk(c1,e)}var d1=H("ZodUnknown",(e,t)=>{G0.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>cS(e,r,n,i)});function zh(){return Vk(d1)}var f1=H("ZodNever",(e,t)=>{K0.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>uS(e,r,n,i)});function h1(e){return Bk(f1,e)}var p1=H("ZodArray",(e,t)=>{Y0.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>pS(e,r,n,i),e.element=t.element,Ls(e,"ZodArray",{min(r,n){return this.check(eo(r,n))},nonempty(r){return this.check(eo(1,r))},max(r,n){return this.check(Ch(r,n))},length(r,n){return this.check(Oh(r,n))},unwrap(){return this.element}})});function qh(e,t){return tS(p1,e,t)}var m1=H("ZodObject",(e,t)=>{Q0.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>mS(e,r,n,i),Be(e,"shape",()=>t.shape),Ls(e,"ZodObject",{keyof(){return _1(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:zh()})},loose(){return this.clone({...this._zod.def,catchall:zh()})},strict(){return this.clone({...this._zod.def,catchall:h1()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return yw(this,r)},safeExtend(r){return bw(this,r)},merge(r){return _w(this,r)},pick(r){return vw(this,r)},omit(r){return gw(this,r)},partial(...r){return ww(Uh,this,r[0])},required(...r){return kw(jh,this,r[0])}})});function pu(e,t){return new m1({type:"object",shape:e??{},...be(t)})}var v1=H("ZodUnion",(e,t)=>{X0.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>vS(e,r,n,i),e.options=t.options});function g1(e,t){return new v1({type:"union",options:e,...be(t)})}var y1=H("ZodIntersection",(e,t)=>{ek.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>gS(e,r,n,i)});function b1(e,t){return new y1({type:"intersection",left:e,right:t})}var mu=H("ZodEnum",(e,t)=>{tk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(n,i,s)=>dS(e,n,i,s),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,i)=>{const s={};for(const a of n)if(r.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new mu({...t,checks:[],...be(i),entries:s})},e.exclude=(n,i)=>{const s={...t.entries};for(const a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new mu({...t,checks:[],...be(i),entries:s})}});function _1(e,t){return new mu({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e,...be(t)})}var w1=H("ZodTransform",(e,t)=>{rk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>hS(e,r,n,i),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Hf(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ns(s,r.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Ns(a))}};const i=t.transform(r.value,r);return i instanceof Promise?i.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function k1(e){return new w1({type:"transform",transform:e})}var Uh=H("ZodOptional",(e,t)=>{yh.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>$h(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function Vh(e){return new Uh({type:"optional",innerType:e})}var S1=H("ZodExactOptional",(e,t)=>{nk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>$h(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function E1(e){return new S1({type:"optional",innerType:e})}var x1=H("ZodNullable",(e,t)=>{ik.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>yS(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function Bh(e){return new x1({type:"nullable",innerType:e})}var T1=H("ZodDefault",(e,t)=>{sk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>_S(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function A1(e,t){return new T1({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Qf(t)}})}var C1=H("ZodPrefault",(e,t)=>{ak.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>wS(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function O1(e,t){return new C1({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Qf(t)}})}var jh=H("ZodNonOptional",(e,t)=>{ok.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>bS(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function D1(e,t){return new jh({type:"nonoptional",innerType:e,...be(t)})}var I1=H("ZodCatch",(e,t)=>{lk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>kS(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function P1(e,t){return new I1({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var $1=H("ZodPipe",(e,t)=>{uk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>SS(e,r,n,i),e.in=t.in,e.out=t.out});function Zh(e,t){return new $1({type:"pipe",in:e,out:t})}var M1=H("ZodReadonly",(e,t)=>{ck.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ES(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function F1(e){return new M1({type:"readonly",innerType:e})}var Wh=H("ZodCustom",(e,t)=>{dk.init(e,t),dt.init(e,t),e._zod.processJSONSchema=(r,n,i)=>fS(e,r,n,i)});function N1(e,t={}){return rS(Wh,e,t)}function R1(e,t){return nS(e,t)}function L1(e,t={}){const r=new Wh({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...be(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var z1=pu({id:zs(),customer:pu({customer_salutation_id:zs().positive({message:"user.fieldErrors.titleRequire"}),name:Jt().min(1,{message:"user.fieldErrors.nameRequire"}),surname:Jt().min(1,{message:"user.fieldErrors.surnameRequire"}),email:Jt().email({message:"user.fieldErrors.emailValid"}).min(1,{message:"user.fieldErrors.emailRequire"}),email_confirmation:Jt().email({message:"user.fieldErrors.emailValidRequire"}).optional(),addr_street:Jt().min(1,{message:"user.fieldErrors.streetRequire"}),addr_zip:Jt().min(1,{message:"user.fieldErrors.postRequire"}),addr_city:Jt().min(1,{message:"user.fieldErrors.cityRequire"}),addr_country_id:zs().positive().default(60),language_id:zs().positive({message:"user.fieldErrors.languageRequire"}).default(1)})}),XF=pu({ticket_sale_id:zs(),start_at:Jt().date(),personalizations:qh(z1)});function vu(e,t){return e-t*Math.floor(e/t)}var Hh=1721426;function no(e,t,r,n){t=gu(e,t);let i=t-1,s=-2;return r<=2?s=0:io(t)&&(s=-1),Hh-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*r-362)/12+s+n)}function io(e){return e%4===0&&(e%100!==0||e%400===0)}function gu(e,t){return e==="BC"?1-t:t}function q1(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}var U1={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},Mi=class{fromJulianDay(e){let t=e,r=t-Hh,n=Math.floor(r/146097),i=vu(r,146097),s=Math.floor(i/36524),a=vu(i,36524),o=Math.floor(a/1461),l=vu(a,1461),c=Math.floor(l/365),[f,u]=q1(n*400+s*100+o*4+c+(s!==4&&c!==4?1:0)),p=t-no(f,u,1,1),h=2;t<no(f,u,3,1)?h=0:io(u)&&(h=1);let g=Math.floor(((p+h)*12+373)/367);return new Bs(f,u,g,t-no(f,u,g,1)+1)}toJulianDay(e){return no(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return U1[io(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return io(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return e.era==="BC"}balanceDate(e){e.year<=0&&(e.era=e.era==="BC"?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}},V1={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function On(e,t){return t=Qt(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function yu(e,t){return t=Qt(t,e.calendar),e=_u(e),t=_u(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function B1(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function j1(e,t){return On(e,ti(t))}var Z1={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Gh(e,t,r){let n=e.calendar.toJulianDay(e),i=r?Z1[r]:Y1(t),s=Math.ceil(n+1-i)%7;return s<0&&(s+=7),s}function W1(e){return Vr(Date.now(),e)}function ti(e){return X1(W1(e))}function Kh(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function Yh(e,t){return Jh(e)-Jh(t)}function Jh(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}var bu=null,H1=!1;function Vt(){return bu==null&&(bu=new Intl.DateTimeFormat().resolvedOptions().timeZone),bu}function Qh(){return H1}function _u(e){return e.subtract({days:e.day-1})}function G1(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}var Xh=new Map,wu=new Map;function K1(e){if(Intl.Locale){let r=Xh.get(e);return r||(r=new Intl.Locale(e).maximize().region,r&&Xh.set(e,r)),r}let t=e.split("-")[1];return t==="u"?void 0:t}function Y1(e){let t=wu.get(e);if(!t){if(Intl.Locale){let n=new Intl.Locale(e);if("getWeekInfo"in n&&(t=n.getWeekInfo(),t))return wu.set(e,t),t.firstDay}let r=K1(e);if(e.includes("-fw-")){let n=e.split("-fw-")[1].split("-")[0];n==="mon"?t={firstDay:1}:n==="tue"?t={firstDay:2}:n==="wed"?t={firstDay:3}:n==="thu"?t={firstDay:4}:n==="fri"?t={firstDay:5}:n==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:r&&V1[r]||0};wu.set(e,t)}return t.firstDay}function Dn(e){return e=Qt(e,new Mi),ep(gu(e.era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function ep(e,t,r,n,i,s,a){let o=new Date;return o.setUTCHours(n,i,s,a),o.setUTCFullYear(e,t-1,r),o.getTime()}function qs(e,t){if(t==="UTC")return 0;if(e>0&&t===Vt()&&!Qh())return new Date(e).getTimezoneOffset()*-6e4;let{year:r,month:n,day:i,hour:s,minute:a,second:o}=rp(e,t);return ep(r,n,i,s,a,o,0)-Math.floor(e/1e3)*1e3}var tp=new Map;function rp(e,t){let r=tp.get(t);r||(r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),tp.set(t,r));let n=r.formatToParts(new Date(e)),i={};for(let s of n)s.type!=="literal"&&(i[s.type]=s.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}var so=864e5;function J1(e,t){let r=Dn(e);return np(e,t,r-qs(r-so,t),r-qs(r+so,t))}function np(e,t,r,n){return(r===n?[r]:[r,n]).filter(i=>Q1(e,t,i))}function Q1(e,t,r){let n=rp(r,t);return e.year===n.year&&e.month===n.month&&e.day===n.day&&e.hour===n.hour&&e.minute===n.minute&&e.second===n.second}function Ur(e,t,r="compatible"){let n=In(e);if(t==="UTC")return Dn(n);if(t===Vt()&&r==="compatible"&&!Qh()){n=Qt(n,new Mi);let l=new Date,c=gu(n.era,n.year);return l.setFullYear(c,n.month-1,n.day),l.setHours(n.hour,n.minute,n.second,n.millisecond),l.getTime()}let i=Dn(n),s=qs(i-so,t),a=qs(i+so,t),o=np(n,t,i-s,i-a);if(o.length===1)return o[0];if(o.length>1)switch(r){case"compatible":case"earlier":return o[0];case"later":return o[o.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(r){case"earlier":return Math.min(i-s,i-a);case"compatible":case"later":return Math.max(i-s,i-a);case"reject":throw new RangeError("No such absolute time found")}}function ip(e,t,r="compatible"){return new Date(Ur(e,t,r))}function Vr(e,t){let r=qs(e,t),n=new Date(e+r),i=n.getUTCFullYear(),s=n.getUTCMonth()+1,a=n.getUTCDate(),o=n.getUTCHours(),l=n.getUTCMinutes(),c=n.getUTCSeconds(),f=n.getUTCMilliseconds();return new Pn(i<1?"BC":"AD",i<1?-i+1:i,s,a,t,r,o,l,c,f)}function X1(e){return new Bs(e.calendar,e.era,e.year,e.month,e.day)}function In(e,t){let r=0,n=0,i=0,s=0;if("timeZone"in e)({hour:r,minute:n,second:i,millisecond:s}=e);else if("hour"in e&&!t)return e;return t&&({hour:r,minute:n,second:i,millisecond:s}=t),new Fi(e.calendar,e.era,e.year,e.month,e.day,r,n,i,s)}function eE(e){return new pE(e.hour,e.minute,e.second,e.millisecond)}function Qt(e,t){if(B1(e.calendar,t))return e;let r=t.fromJulianDay(e.calendar.toJulianDay(e)),n=e.copy();return n.calendar=t,n.era=r.era,n.year=r.year,n.month=r.month,n.day=r.day,ri(n),n}function tE(e,t,r){return e instanceof Pn?e.timeZone===t?e:sp(e,t):Vr(Ur(e,t,r),t)}function rE(e){let t=Dn(e)-e.offset;return new Date(t)}function sp(e,t){return Qt(Vr(Dn(e)-e.offset,t),e.calendar)}var Us=36e5;function ao(e,t){let r=e.copy(),n="hour"in r?up(r,t):0;ku(r,t.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e),r.month+=t.months||0,Su(r),ap(r),r.day+=(t.weeks||0)*7,r.day+=t.days||0,r.day+=n,nE(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);let i=r.calendar.getYearsInEra(r);if(r.year>i){let a=r.calendar.isInverseEra?.(r);r.year=i,r.month=a?1:r.calendar.getMonthsInYear(r),r.day=a?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);let s=r.calendar.getMonthsInYear(r);return r.month>s&&(r.month=s,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r}function ku(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Su(e){for(;e.month<1;)ku(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,ku(e,1)}function nE(e){for(;e.day<1;)e.month--,Su(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Su(e)}function ap(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function ri(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),ap(e)}function Eu(e){let t={};for(let r in e)typeof e[r]=="number"&&(t[r]=-e[r]);return t}function op(e,t){return ao(e,Eu(t))}function xu(e,t){let r=e.copy();return t.era!=null&&(r.era=t.era),t.year!=null&&(r.year=t.year),t.month!=null&&(r.month=t.month),t.day!=null&&(r.day=t.day),ri(r),r}function Vs(e,t){let r=e.copy();return t.hour!=null&&(r.hour=t.hour),t.minute!=null&&(r.minute=t.minute),t.second!=null&&(r.second=t.second),t.millisecond!=null&&(r.millisecond=t.millisecond),lp(r),r}function iE(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=oo(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=oo(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=oo(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=oo(e.hour,24),t}function lp(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function oo(e,t){let r=e%t;return r<0&&(r+=t),r}function up(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,iE(e)}function cp(e,t){let r=e.copy();return up(r,t),r}function sE(e,t){return cp(e,Eu(t))}function Tu(e,t,r,n){let i=e.copy();switch(t){case"era":{let s=e.calendar.getEras(),a=s.indexOf(e.era);if(a<0)throw new Error("Invalid era: "+e.era);a=an(a,r,0,s.length-1,n?.round),i.era=s[a],ri(i);break}case"year":i.calendar.isInverseEra?.(i)&&(r=-r),i.year=an(e.year,r,-1/0,9999,n?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case"month":i.month=an(e.month,r,1,e.calendar.getMonthsInYear(e),n?.round);break;case"day":i.day=an(e.day,r,1,e.calendar.getDaysInMonth(e),n?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),ri(i),i}function Au(e,t,r,n){let i=e.copy();switch(t){case"hour":{let s=e.hour,a=0,o=23;if(n?.hourCycle===12){let l=s>=12;a=l?12:0,o=l?23:11}i.hour=an(s,r,a,o,n?.round);break}case"minute":i.minute=an(e.minute,r,0,59,n?.round);break;case"second":i.second=an(e.second,r,0,59,n?.round);break;case"millisecond":i.millisecond=an(e.millisecond,r,0,999,n?.round);break;default:throw new Error("Unsupported field "+t)}return i}function an(e,t,r,n,i=!1){if(i){e+=Math.sign(t),e<r&&(e=n);let s=Math.abs(t);t>0?e=Math.ceil(e/s)*s:e=Math.floor(e/s)*s,e>n&&(e=r)}else e+=t,e<r?e=n-(r-e-1):e>n&&(e=r+(e-n-1));return e}function dp(e,t){let r;return t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0?r=Ur(ao(In(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):r=Dn(e)-e.offset,r+=t.milliseconds||0,r+=(t.seconds||0)*1e3,r+=(t.minutes||0)*6e4,r+=(t.hours||0)*36e5,Qt(Vr(r,e.timeZone),e.calendar)}function aE(e,t){return dp(e,Eu(t))}function oE(e,t,r,n){switch(t){case"hour":{let i=0,s=23;if(n?.hourCycle===12){let g=e.hour>=12;i=g?12:0,s=g?23:11}let a=In(e),o=Qt(Vs(a,{hour:i}),new Mi),l=[Ur(o,e.timeZone,"earlier"),Ur(o,e.timeZone,"later")].filter(g=>Vr(g,e.timeZone).day===o.day)[0],c=Qt(Vs(a,{hour:s}),new Mi),f=[Ur(c,e.timeZone,"earlier"),Ur(c,e.timeZone,"later")].filter(g=>Vr(g,e.timeZone).day===c.day).pop(),u=Dn(e)-e.offset,p=Math.floor(u/Us),h=u%Us;return u=an(p,r,Math.floor(l/Us),Math.floor(f/Us),n?.round)*Us+h,Qt(Vr(u,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Au(e,t,r,n);case"era":case"year":case"month":case"day":return Qt(Vr(Ur(Tu(In(e),t,r,n),e.timeZone),e.timeZone),e.calendar);default:throw new Error("Unsupported field "+t)}}function lE(e,t,r){let n=In(e),i=Vs(xu(n,t),t);return i.compare(n)===0?e:Qt(Vr(Ur(i,e.timeZone,r),e.timeZone),e.calendar)}var uE=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,cE=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,dE=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::?(\d{2}))?(?::?(\d{2}))?)?\[(.*?)\]$/,Cu=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/,fE=["hours","minutes","seconds"],eN=["years","months","weeks","days",...fE];function lo(e){let t=e.match(uE);if(!t)throw Cu.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let r=new Bs(qe(t[1],0,9999),qe(t[2],1,12),1);return r.day=qe(t[3],1,r.calendar.getDaysInMonth(r)),r}function fp(e){let t=e.match(cE);if(!t)throw Cu.test(e)?new Error(`Invalid ISO 8601 date time string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date time string: "+e);let r=qe(t[1],-9999,9999),n=new Fi(r<1?"BC":"AD",r<1?-r+1:r,qe(t[2],1,12),1,t[4]?qe(t[4],0,23):0,t[5]?qe(t[5],0,59):0,t[6]?qe(t[6],0,59):0,t[7]?qe(t[7],0,1/0)*1e3:0);return n.day=qe(t[3],0,n.calendar.getDaysInMonth(n)),n}function hp(e,t){let r=e.match(dE);if(!r)throw new Error("Invalid ISO 8601 date time string: "+e);let n=qe(r[1],-9999,9999),i=new Pn(n<1?"BC":"AD",n<1?-n+1:n,qe(r[2],1,12),1,r[11],0,r[4]?qe(r[4],0,23):0,r[5]?qe(r[5],0,59):0,r[6]?qe(r[6],0,59):0,r[7]?qe(r[7],0,1/0)*1e3:0);i.day=qe(r[3],0,i.calendar.getDaysInMonth(i));let s=In(i),a;if(r[8]){let o=qe(r[8],-23,23);if(i.offset=Math.sign(o)*(Math.abs(o)*36e5+qe(r[9]??"0",0,59)*6e4+qe(r[10]??"0",0,59)*1e3),a=Dn(i)-i.offset,!J1(s,i.timeZone).includes(a))throw new Error(`Offset ${gp(i.offset)} is invalid for ${Ou(i)} in ${i.timeZone}`)}else a=Ur(In(s),i.timeZone,t);return Vr(a,i.timeZone)}function pp(e,t){let r=e.match(Cu);if(!r)throw new Error("Invalid ISO 8601 date time string: "+e);let n=qe(r[1],-9999,9999),i=new Pn(n<1?"BC":"AD",n<1?-n+1:n,qe(r[2],1,12),1,t,0,r[4]?qe(r[4],0,23):0,r[5]?qe(r[5],0,59):0,r[6]?qe(r[6],0,59):0,r[7]?qe(r[7],0,1/0)*1e3:0);return i.day=qe(r[3],0,i.calendar.getDaysInMonth(i)),r[8]&&(i.offset=qe(r[8],-23,23)*36e5+qe(r[9]??"0",0,59)*6e4),sp(i,t)}function qe(e,t,r){let n=Number(e);if(n<t||n>r)throw new RangeError(`Value out of range: ${t} <= ${n} <= ${r}`);return n}function mp(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function vp(e){let t=Qt(e,new Mi),r;return t.era==="BC"?r=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):r=String(t.year).padStart(4,"0"),`${r}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Ou(e){return`${vp(e)}T${mp(e)}`}function gp(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let r=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),s=`${t}${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`;return i!==0&&(s+=`:${String(i).padStart(2,"0")}`),s}function hE(e){return`${Ou(e)}${gp(e.offset)}[${e.timeZone}]`}function Du(e){let t=typeof e[0]=="object"?e.shift():new Mi,r;if(typeof e[0]=="string")r=e.shift();else{let a=t.getEras();r=a[a.length-1]}let n=e.shift(),i=e.shift(),s=e.shift();return[t,r,n,i,s]}var Bs=class fd{#e;constructor(...t){let[r,n,i,s,a]=Du(t);this.calendar=r,this.era=n,this.year=i,this.month=s,this.day=a,ri(this)}copy(){return this.era?new fd(this.calendar,this.era,this.year,this.month,this.day):new fd(this.calendar,this.year,this.month,this.day)}add(t){return ao(this,t)}subtract(t){return op(this,t)}set(t){return xu(this,t)}cycle(t,r,n){return Tu(this,t,r,n)}toDate(t){return ip(this,t)}toString(){return vp(this)}compare(t){return Kh(this,t)}},pE=class hy{#e;constructor(t=0,r=0,n=0,i=0){this.hour=t,this.minute=r,this.second=n,this.millisecond=i,lp(this)}copy(){return new hy(this.hour,this.minute,this.second,this.millisecond)}add(t){return cp(this,t)}subtract(t){return sE(this,t)}set(t){return Vs(this,t)}cycle(t,r,n){return Au(this,t,r,n)}toString(){return mp(this)}compare(t){return Yh(this,t)}},Fi=class hd{#e;constructor(...t){let[r,n,i,s,a]=Du(t);this.calendar=r,this.era=n,this.year=i,this.month=s,this.day=a,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ri(this)}copy(){return this.era?new hd(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new hd(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return ao(this,t)}subtract(t){return op(this,t)}set(t){return xu(Vs(this,t),t)}cycle(t,r,n){switch(t){case"era":case"year":case"month":case"day":return Tu(this,t,r,n);default:return Au(this,t,r,n)}}toDate(t,r){return ip(this,t,r)}toString(){return Ou(this)}compare(t){let r=Kh(this,t);return r===0?Yh(this,In(t)):r}},Pn=class pd{#e;constructor(...t){let[r,n,i,s,a]=Du(t),o=t.shift(),l=t.shift();this.calendar=r,this.era=n,this.year=i,this.month=s,this.day=a,this.timeZone=o,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ri(this)}copy(){return this.era?new pd(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new pd(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return dp(this,t)}subtract(t){return aE(this,t)}set(t,r){return lE(this,t,r)}cycle(t,r,n){return oE(this,t,r,n)}toDate(){return rE(this)}toString(){return hE(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-tE(t,this.timeZone).toDate().getTime()}},Iu=new Map,kr=class{constructor(e,t={}){this.formatter=yp(e,t),this.options=t}format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(e,t);if(t<e)throw new RangeError("End date must be >= start date");return`${this.formatter.format(e)} – ${this.formatter.format(t)}`}formatRangeToParts(e,t){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(e,t);if(t<e)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(e),n=this.formatter.formatToParts(t);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...n.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return gE()&&(this.resolvedHourCycle||(this.resolvedHourCycle=yE(e.locale,this.options)),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),e.calendar==="ethiopic-amete-alem"&&(e.calendar="ethioaa"),e}},mE={true:{ja:"h11"},false:{}};function yp(e,t={}){if(typeof t.hour12=="boolean"&&vE()){t={...t};let i=mE[String(t.hour12)][e.split("-")[0]],s=t.hour12?"h12":"h23";t.hourCycle=i??s,delete t.hour12}let r=e+(t?Object.entries(t).sort((i,s)=>i[0]<s[0]?-1:1).join():"");if(Iu.has(r))return Iu.get(r);let n=new Intl.DateTimeFormat(e,t);return Iu.set(r,n),n}var Pu=null;function vE(){return Pu==null&&(Pu=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Pu}var $u=null;function gE(){return $u==null&&($u=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),$u}function yE(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let r=yp(e,{...t,timeZone:void 0}),n=parseInt(r.formatToParts(new Date(2020,2,3,0)).find(s=>s.type==="hour").value,10),i=parseInt(r.formatToParts(new Date(2020,2,3,23)).find(s=>s.type==="hour").value,10);if(n===0&&i===23)return"h23";if(n===24&&i===23)return"h24";if(n===0&&i===11)return"h11";if(n===12&&i===11)return"h12";throw new Error("Unexpected hour cycle result")}function $n(e){return eE(pp(e,"Europe/Berlin")).toString().slice(0,-3)}function ni(e,t={weekday:"long",year:"numeric",month:"long",day:"numeric"},r="de"){const n=pp(e instanceof Date?e.toISOString():e,"Europe/Berlin");return new kr(r,{timeZone:n.timeZone,...t}).format(n.toDate())}function js(e){if(e===void 0)throw Error("priceCents is required");return new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e/100)}function Mu(e){return e?.type==="Ticket"}function Br(e){const t=e;return!!t&&t.type==="Ticket"&&t.is_mantle===!0&&!!t.sub_tickets&&Object.keys(t.sub_tickets).length>0}function Zs(e){return Object.entries(e.sub_tickets??{}).map(([t,r])=>({id:Number(t),title:r?.title??"",description:r?.description??null,min_persons:r?.min_persons??0,max_persons:r?.max_persons??0}))}function uo(e,t){return{...e,selectedTime:t?.selectedTime??"",type:"Ticket",subtype:{time_slot:"timeslot",normal:"day",annual:"annual"}[e.ticket_type],shop_order:e.shop_order??0,content:void 0}}function Mn(e,t=""){return sw(Object.values(e).map(r=>uo(r,{selectedTime:t})),r=>r.shop_order)}function Fn(e,t=""){let r=Object.entries(e);return t!==""&&(r=r.filter(([,n])=>n.total_capacities?.[t]&&n.total_capacities[t]>0)),Object.fromEntries(r)}var bp=e=>qr(Object.values(e.mantle?.composition??{}));function bE(e){const t=e.quantity??0;return Br(e.product)?t*bp(e):t}function Fu(e,t,r,n){e.clearPrecart();let i=0;for(const s of[...r.items,...t.items]){if(!Mu(s.product))continue;const a=bE(s);s===n&&(i=a),e.addPrecartItemQuantity(s.product.id,a)}return i}var _E=function(e,t,r,n){if(e.capacityPolicy(r)!=="quotas")throw new Error("(getMaxQuantityQuotas) impossible");if(!Mu(r.product))throw new Error("(getMaxQuantityQuotas) impossible");const i=r.product,s=e.quotaManager,a=Fu(s,t,n,r),o=s.ticketCapacity(i.id,i.selectedTime,a),l=s.totalCapacity(i.id,i.selectedTime);return{max:Math.min(i.max_persons||100,o),min:i.min_persons||0,bookedOut:o===0,unavailable:l===0}},wE=function(e,t,r,n){if(e.capacityPolicy(r)!=="mantle")throw new Error("(maxQuantity_Mantle) impossible");if(!Br(r.product))throw new Error("(maxQuantity_Mantle) impossible");const i=r.product,s=e.quotaManager,a=Fu(s,t,n,r),o=s.ticketCapacity(i.id,i.selectedTime,a),l=s.totalCapacity(i.id,i.selectedTime),c=bp(r),f=c>1?Math.floor(o/c):o;return{max:Math.min(i.max_persons||100,f),min:i.min_persons||0,bookedOut:f===0,unavailable:l===0}},kE=e=>Object.fromEntries(Zs(e).map(t=>[t.id,t.max_persons]));function SE(e,t,r,n){if(e.capacityPolicy(r)!=="mantle")throw new Error("(maxSubQuantities) impossible");if(!Br(r.product))throw new Error("(maxSubQuantities) impossible");const i=r.product,s=r.quantity??0;let a=1/0;return s>0&&(Fu(e.quotaManager,t,n,r),a=Math.floor(e.quotaManager.ticketCapacity(i.id,i.selectedTime,0)/s)),Object.fromEntries(Zs(i).map(o=>[o.id,Math.min(o.max_persons,(r.mantle?.composition?.[o.id]??0)+a)]))}function Ws(e){return e?.type==="Event"}function EE(e){return Ws(e)&&e.subtype==="scale"}function xE(e,t,r){const n={type:"Event",id:t,tax_included:!0,...e};if(r?.date){const i=r.date;r.date_title=i.title||"",r.date_description=i.description||"",r.event_title=i.event_title||"",r.event_subtitle=i.event_sub_title||"",r.price_title=e.title||"",r.price_description=e.description||""}return{dateId:t,minAvailableCapacity:0,selectedTime:"",...r,...n,...e,type:"Event",subtype:e.scale_price_id===void 0?"flat":"scale"}}function Nu(e,t,r){return xE(e,t,r)}var TE=function(e,t,r,n){if(e.capacityPolicy(r)!=="seats")throw new Error("(getMaxQuantitySeats) impossible");if(!Ws(r.product))throw new Error("(getMaxQuantitySeats) impossible");const i=r.product.dateId,s=e.allSeats[i];if(!s)return console.error("(getMaxQuantity) no seats found for dateId",i),{max:0,min:0,unavailable:!0,bookedOut:!1};const a=Math.min(s.max||100,s.max_per_registration||100,s.available??100),o={max_per_registration:a,available:100,overbook:!1,...s};let l=a;o.overbook&&(l=Math.min(o.max||100,o.max_per_registration||100));const c=n.totalQuantity,f=qr(t.items.filter(p=>n.items.some(h=>h.uuid===p.uuid)),p=>p.quantity),u=Math.max(l-f-c+r.quantity,0);return{max:u,min:o.min??0,unavailable:o.available===0,bookedOut:u===0}},AE=function(e,t,r,n){if(e.capacityPolicy(r)!=="unlimited")throw new Error("(getMaxQuantityUnlimited) impossible");return{max:r.product.max_persons??100,min:r.product.min_persons??0,unavailable:!1,bookedOut:!1}};function CE(e){return{apiData:e,_timeslots:[],addQuotas(t){this._timeslots=[],this.apiData={...this.apiData,...t}},precart:{},clearPrecart(){this.precart={},this._timeslots=[]},setPrecartItemQuantity(t,r){this.precart[t]=r,this._timeslots=[]},addPrecartItemQuantity(t,r){this.precart[t]=(this.precart[t]??0)+r,this._timeslots=[]},getPrecartItemQuantity(t){return this.precart[t]??0},timeslots(){return this._timeslots.length===0&&(this._timeslots=Object.entries(this.apiData).flatMap(([t,r])=>Object.keys(r.capacities).map(n=>{const i=qr(r.ticket_ids.map(s=>this.getPrecartItemQuantity(s)));return{timeSlot:n,quota:t,capacity:r.capacities[n]-i,tickets:r.ticket_ids,totalCapacity:r.total_capacities[n]}}))),this._timeslots},filterBy({timeslot:t,ticketId:r,date:n}={}){let i=this.timeslots();return r&&(i=i.filter(s=>s.tickets.includes(r))),t&&(i=i.filter(s=>s.timeSlot===t)),n&&(i=i.filter(s=>s.timeSlot.startsWith(n))),i.flatMap(s=>s.tickets.map(a=>({timeslot:t,ticket:a,quota:s.quota,capacity:s.capacity,totalCapacity:s.totalCapacity})))},ticketCapacity(t,r,n=this.getPrecartItemQuantity(t)){const i=ru(this.filterBy({timeslot:r,ticketId:t}).map(s=>s.capacity))??0;return Math.max(0,i+n)},totalCapacity(t,r){return ru(this.filterBy({timeslot:r,ticketId:t}).map(n=>n.totalCapacity))??0},timeslotsOn(t,r){let n=this.timeslots().filter(s=>s.timeSlot.startsWith(t.toString()));r&&(n=n.filter(s=>s.tickets.some(a=>r.includes(a))));const i=iw(n,s=>s.timeSlot);return Object.values(i).map(s=>aw(ow(s.flatMap(a=>a.tickets)).map(a=>ru(s.filter(o=>o.tickets.includes(a)),o=>o.capacity)).filter(a=>a!==null),a=>a.capacity)??s[0]).sort((s,a)=>s.timeSlot.localeCompare(a.timeSlot))}}}function OE(e){let t=0;Es(()=>{ve(()=>{if(e.items.length===t)return;const r=e.items.length>t?"go-cart-item-added":"go-cart-item-removed";t=e.items.length,document.dispatchEvent(new CustomEvent(r,{detail:e.items.length}))})})}function _p(e){return e?.type==="Tour"}function wp(e,t){return{...e,type:"Tour",description:"",price_cents:e.totalPriceCents,tax_included:!0,vat_pct:0,instanceKey:t?.instanceKey??crypto.randomUUID(),wire:DE(e)}}function DE(e){const t={language_id:e.languageId};return e.quantities?t.quantities=e.quantities:t.quantity=e.participants,e.gradeId!=null&&(t.grade_id=e.gradeId),e.ageGroupId!=null&&(t.age_group_id=e.ageGroupId),e.surcharges&&(t.surcharges=e.surcharges),e.equipment&&(t.equipment=e.equipment),e.attendees&&(t.attendees=e.attendees),e.customs&&(t.customs=e.customs),t}function IE(e){const{type:t,description:r,price_cents:n,tax_included:i,vat_pct:s,instanceKey:a,wire:o,...l}=e;return wp({...l,totalPriceCents:n},{instanceKey:a})}var PE=0;function ot(e,t){const r={quantity:0,time:"",...t??{}};return Br(e)&&(r.mantle={composition:r.mantle?.composition??Object.fromEntries(Zs(e).map(n=>[n.id,n.max_persons])),key:r.mantle?.key??`mantle-${PE++}`}),{...r,type:e.type,product:e,orderAttributes(){const n={shipped_with_merchandise_id:null,shipping_mode:"email",id:this.product.id,uuid:this.uuid};switch(e.type){case"Ticket":return{...n,time:this.time,quantity:this.quantity,...Br(this.product)&&this.mantle?{sub_ticket_quantities:this.mantle.composition}:{}};case"Event":switch(e.subtype){case"flat":return{...n,quantity:this.quantity};case"scale":return{...n,quantities:{[e.scale_price_id]:this.quantity}};default:throw new Error(`(orderAttributes) Unhandled Event subtype: ${e}`)}case"Coupon":return{...n,quantity:this.quantity};case"Tour":return{...n,start_time:this.time,...e.wire};default:throw new Error(`(orderAttributes) Unhandled product type: ${e}`)}},get uuid(){return this.type+"-"+this.product.id+this.subUId},get subUId(){const n=[];return this.time&&n.push(`time: ${this.time}`),EE(this.product)&&n.push(`scale_price: ${this.product.scale_price_id}`),_p(this.product)&&n.push(`tour: ${this.product.instanceKey}`),this.display?.discounted&&n.push("discounted"),Br(this.product)&&this.mantle?.key&&n.push(`mantle_key: ${this.mantle.key}`),this.voucher?.code&&n.push(`voucher_code: ${this.voucher.code}`),n.length>0?` (${n.join(", ")})`:""},toString(){return this.uuid+":"+this.quantity},get price_cents(){return this.time&&this.product.dynamic_prices?.[this.time]!=null?this.product.dynamic_prices[this.time]:this.product.price_cents},get price_formatted(){return fr(this.price_cents)},get final_price_cents(){const n=this.product.tax_included?1:1+this.product.vat_pct/100;return this.price_cents*n},get final_price_formatted(){return fr(this.final_price_cents)},get total_price_cents(){return this.quantity*this.final_price_cents},get total_price_formatted(){return fr(this.total_price_cents)}}}var tN=15*6e4;function co(){return typeof window<"u"&&typeof localStorage<"u"}function $E(e,t){if(co())try{localStorage.setItem(e,JSON.stringify(t))}catch(r){console.warn(`Failed to save to localStorage (${e}):`,r)}}function Ru(e){if(!co())return null;try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return console.warn(`Failed to load from localStorage (${e}):`,t),null}}function kp(e){if(co())try{localStorage.removeItem(e)}catch(t){console.warn(`Failed to remove from localStorage (${e}):`,t)}}function Sp(e){return{...e,description:"",tax_included:!0,type:"Coupon"}}var Ep="go-cart",fo=(e,t)=>localStorage.setItem(Ep,JSON.stringify({items:e,coupons:t,savedAt:Date.now()}));function ME(e){const t=e.product.type;switch(t){case"Ticket":return Lu(e)?ot(uo(e.product,{selectedTime:e.product.selectedTime}),{time:e.time,quantity:e.quantity,mantle:e.mantle,voucher:e.voucher}):void 0;case"Event":return Lu(e)?ot(Nu(e.product,e.id),{time:e.time,quantity:e.quantity}):void 0;case"Tour":return Lu(e)?ot(IE(e.product),{time:e.time,quantity:e.quantity}):void 0;case"Coupon":return ot(Sp(e.product),{quantity:e.quantity});default:throw new Error(`Unhandled case: ${t}`)}}function FE(e){let t=[],r=[],n;try{const i=localStorage.getItem(Ep);if(!i)return[];const s=JSON.parse(i);if(Array.isArray(s))t=s,r=[];else if(typeof s=="object"&&s!==null)t=s.items||[],r=s.coupons||[],n=s.savedAt;else throw console.dir({parsed:s,content:i}),new Error("go-cart has invalid format");return n&&Date.now()-n>9e5?(e.clearItems(),e.clearCoupons(),fo([],[]),[]):(t.length===0?e.clearItems():e.items=t.map(ME).filter(zE),e.clearCoupons(),r.forEach(a=>e.addCoupon(typeof a=="string"?{code:a,kind:"actionToken"}:a)),e.items)}catch(i){return console.error(i),fo([],[]),[]}}function NE(e){FE(e);let t=JSON.stringify({items:e.items||[],coupons:e.coupons||[]});fo(e.items||[],e.coupons||[]),Es(()=>{ve(()=>{const r=JSON.stringify({items:e.items||[],coupons:e.coupons||[]});r!==t&&(t=r,fo(e.items||[],e.coupons||[]))})})}var RE=e=>new Date<new Date(e),LE=e=>lo(e.slice(0,10)).compare(ti(Vt()))>=0,Lu=e=>e.time?e.product.subtype==="day"?LE(e.time):RE(e.time):!0,zE=e=>e!==void 0,qE=0;function Ni(e,t=20){const r={items:Pe([]),coupons:Pe([]),paymentModeId:void 0,uid:`cart-${qE++}`,get nonEmptyItems(){return this.items.filter(n=>n.quantity>0)},get totalPriceCents(){return Math.max(0,qr(this.items,n=>n.total_price_cents))},get totalQuantity(){return qr(this.items,n=>n.quantity)},get valueVoucherCents(){return qr(this.coupons.filter(n=>n.kind==="valueVoucher"),n=>n.valueCents??0)},get amountToPayCents(){return Math.max(0,this.totalPriceCents-this.valueVoucherCents)},toString(){return this.uid+" > ["+this.items.map(n=>n.uuid+":"+n.quantity).join(", ")+"]"},orderData(){return{items:this.items.map(n=>({type:n.type,attributes:n.orderAttributes()})),shipping_address_id:null,comment:null,reference:null,payment_mode_id:this.paymentModeId??C.settings?.defaultPaymentModeId,coupons:this.coupons.map(n=>n.code),donations:[],affiliate:{},total:this.amountToPayCents}},get totalFormatted(){return fr(this.totalPriceCents)},clearItems(){for(;this.items.length>0;)this.items.pop()},deleteItem(n){for(let i=this.items.length-1;i>=0;i--)this.items[i].uuid===n.uuid&&this.items.splice(i,1);n?.voucher?.code&&!this.items.some(i=>i.voucher?.code===n.voucher.code)&&this.removeCoupon(n.voucher.code)},addItem(n){const i=this.items.find(s=>s.uuid===n.uuid);i?i.quantity+=n.quantity:this.items.push(n)},addItems(n){n.forEach(i=>this.addItem(i))},addCoupon(n){const i={...n,code:n.code.toUpperCase()};this.coupons.some(s=>s.code===i.code)||this.coupons.push(i)},removeCoupon(n){const i=n.toUpperCase(),s=this.coupons.findIndex(a=>a.code===i);if(s>-1){const[a]=this.coupons.splice(s,1);if(a.kind==="serviceVoucher")for(let o=this.items.length-1;o>=0;o--)this.items[o].voucher?.code===i&&this.items.splice(o,1)}},clearCoupons(){for(;this.coupons.length>0;)this.coupons.pop()}};return e&&e.forEach(n=>r.addItem(ot(n))),r}function fr(e){return e=e??0,new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e/100)}function UE(){const e=Pe(Ni());return NE(e),OE(e),e}var Ri="go-capacity";function xp(e,t){const r=Ru(Ri);$E(Ri,{allSeats:{...r?.allSeats||{},...e},allQuotas:{...r?.allQuotas||{},...t},savedAt:Date.now()})}function Tp(e){const t=Ru(Ri);if(t){if(!t.savedAt||Date.now()-t.savedAt>9e5){kp(Ri);return}if(t.allSeats)for(const r in t.allSeats){const n=parseInt(r);e.addSeats(n,t.allSeats[n],!1)}t.allQuotas&&e.addQuotas(t.allQuotas,!1)}}function VE(e){co()&&window.addEventListener("storage",t=>{if(t.key===Ri&&Tp(e),t.key==="go-cart"){const r=Ru("go-cart");(!r||!r.items||r.items.length===0)&&kp(Ri)}})}function Ap(){const e={allSeats:{},allQuotas:{},quotaManager:CE({}),addQuotas(t,r=!0){this.allQuotas={...this.allQuotas,...t},this.quotaManager.addQuotas(t),r&&xp(this.allSeats,this.allQuotas)},addSeats(t,r,n=!0){this.allSeats[t]=r,n&&xp(this.allSeats,this.allQuotas)},capacityPolicy(t){const r=t.product.type;switch(r){case"Ticket":const n=t.product,i=n.subtype;switch(i){case"timeslot":case"event:ticket":case"day":return Br(n)?"mantle":"quotas";case"annual":return"unlimited";default:throw new Error(`(getMaxAvailability) Unhandled case: ${i}`)}case"Event":const s=t.product.subtype;switch(s){case"flat":case"scale":return"seats";default:throw new Error(`(getMaxAvailability) Unhandled case: ${s}`)}case"Coupon":return"unlimited";case"Tour":return"unlimited";default:throw new Error(`(getMaxAvailability) Unhandled case: ${r}`)}},capacity(t,r,n){const i=this.capacityPolicy(r),s={quotas:_E,mantle:wE,seats:TE,unlimited:AE}[i];if(!s)throw new Error(`(maxQuantity) impossible: ${i}`);return Ne(()=>s(this,t,r,n))},subTicketMaxes(t,r,n){if(!Br(r.product))return{};const i=this.capacityPolicy(r);if(i!=="mantle"&&i!=="unlimited")throw new Error(`(subTicketMaxes) impossible: ${i}`);return Ne(()=>i==="mantle"?SE(this,t,r,n):kE(r.product))}};return Tp(e),VE(e),e}function Cp(e){if(typeof document>"u"||!e)return;const t=`; ${document.cookie}`.split(`; ${e}=`);if(t.length===2){const r=t.pop()?.split(";").shift();return r?decodeURIComponent(r):void 0}}var Op=class{get isAuthenticated(){return this.isLoggedIn||this.isGuest}},BE=class extends Op{constructor(){super()}get isLoggedIn(){try{const e=Cp("auth_headers");if(!e)return!1;const t=JSON.parse(e),r=Math.floor(Date.now()/1e3);return!t["access-token"]||parseInt(t.expiry,10)<r?!1:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t.uid)}catch{return!1}}get isGuest(){if(this.isLoggedIn)return!1;try{const e=Cp("auth_headers");if(!e)return!0;const t=JSON.parse(e);return typeof t.uid=="string"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t.uid)}catch{return!0}}},jE=class extends Op{get isGuest(){throw new Error("Not implemented.")}get isLoggedIn(){throw new Error("Not implemented")}},ZE=e=>{switch(e){case"angular":return new BE;case"jmb":return new jE;default:throw new Error("Unhandled shop type: "+e)}};function WE(e){return e==null||typeof e=="string"&&e.trim()===""}function HE(e,t){const r={};if(!t||t.length===0)return r;for(const n of t)(!(n in e)||WE(e[n]))&&(r[n]=[`Field '${n}' is required and cannot be empty`]);return r}function GE(e,t){return HE(e,t)}var KE={withStackTrace:!1},Dp=(e,t,r=KE)=>({data:t.isOk()?{type:"Ok",value:t.value}:{type:"Err",value:t.error},message:e,stack:r.withStackTrace?new Error().stack:void 0});function ii(e,t,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(f){try{c(n.next(f))}catch(u){a(u)}}function l(f){try{c(n.throw(f))}catch(u){a(u)}}function c(f){f.done?s(f.value):i(f.value).then(o,l)}c((n=n.apply(e,t||[])).next())})}function Ip(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function jr(e){return this instanceof jr?(this.v=e,this):new jr(e)}function Pp(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(h){return function(g){return Promise.resolve(g).then(h,u)}}function o(h,g){n[h]&&(i[h]=function(m){return new Promise(function(v,y){s.push([h,m,v,y])>1||l(h,m)})},g&&(i[h]=g(i[h])))}function l(h,g){try{c(n[h](g))}catch(m){p(s[0][3],m)}}function c(h){h.value instanceof jr?Promise.resolve(h.value.v).then(f,u):p(s[0][2],h)}function f(h){l("next",h)}function u(h){l("throw",h)}function p(h,g){h(g),s.shift(),s.length&&l(s[0][0],s[0][1])}}function YE(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=e[i]?function(a){return(r=!r)?{value:jr(e[i](a)),done:!1}:s?s(a):a}:s}}function JE(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Ip=="function"?Ip(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(a){return new Promise(function(o,l){a=e[s](a),i(o,l,a.done,a.value)})}}function i(s,a,o,l){Promise.resolve(l).then(function(c){s({value:c,done:o})},a)}}var si=class yr{constructor(t){this._promise=t}static fromSafePromise(t){return new yr(t.then(r=>new Wr(r)))}static fromPromise(t,r){return new yr(t.then(n=>new Wr(n)).catch(n=>new Sr(r(n))))}static fromThrowable(t,r){return(...n)=>new yr(ii(this,void 0,void 0,function*(){try{return new Wr(yield t(...n))}catch(i){return new Sr(r?r(i):i)}}))}static combine(t){return QE(t)}static combineWithAllErrors(t){return XE(t)}map(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){return r.isErr()?new Sr(r.error):new Wr(yield t(r.value))})))}andThrough(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){if(r.isErr())return new Sr(r.error);const n=yield t(r.value);return n.isErr()?new Sr(n.error):new Wr(r.value)})))}andTee(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){if(r.isErr())return new Sr(r.error);try{yield t(r.value)}catch{}return new Wr(r.value)})))}orTee(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){if(r.isOk())return new Wr(r.value);try{yield t(r.error)}catch{}return new Sr(r.error)})))}mapErr(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){return r.isOk()?new Wr(r.value):new Sr(yield t(r.error))})))}andThen(t){return new yr(this._promise.then(r=>{if(r.isErr())return new Sr(r.error);const n=t(r.value);return n instanceof yr?n._promise:n}))}orElse(t){return new yr(this._promise.then(r=>ii(this,void 0,void 0,function*(){return r.isErr()?t(r.error):new Wr(r.value)})))}match(t,r){return this._promise.then(n=>n.match(t,r))}unwrapOr(t){return this._promise.then(r=>r.unwrapOr(t))}safeUnwrap(){return Pp(this,arguments,function*(){return yield jr(yield jr(yield*YE(JE(yield jr(this._promise.then(r=>r.safeUnwrap()))))))})}then(t,r){return this._promise.then(t,r)}[Symbol.asyncIterator](){return Pp(this,arguments,function*(){const r=yield jr(this._promise);return r.isErr()&&(yield yield jr(ho(r.error))),yield jr(r.value)})}};function ho(e){return new si(Promise.resolve(new Sr(e)))}var rN=si.fromPromise,nN=si.fromSafePromise,iN=si.fromThrowable,$p=e=>{let t=Nn([]);for(const r of e)if(r.isErr()){t=Zr(r.error);break}else t.map(n=>n.push(r.value));return t},QE=e=>si.fromSafePromise(Promise.all(e)).andThen($p),Mp=e=>{let t=Nn([]);for(const r of e)r.isErr()&&t.isErr()?t.error.push(r.error):r.isErr()&&t.isOk()?t=Zr([r.error]):r.isOk()&&t.isOk()&&t.value.push(r.value);return t},XE=e=>si.fromSafePromise(Promise.all(e)).andThen(Mp),zu;(function(e){function t(i,s){return(...a)=>{try{return Nn(i(...a))}catch(o){return Zr(s?s(o):o)}}}e.fromThrowable=t;function r(i){return $p(i)}e.combine=r;function n(i){return Mp(i)}e.combineWithAllErrors=n})(zu||(zu={}));function Nn(e){return new Wr(e)}function Zr(e){return new Sr(e)}var Wr=class{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}map(e){return Nn(e(this.value))}mapErr(e){return Nn(this.value)}andThen(e){return e(this.value)}andThrough(e){return e(this.value).map(t=>this.value)}andTee(e){try{e(this.value)}catch{}return Nn(this.value)}orTee(e){return Nn(this.value)}orElse(e){return Nn(this.value)}asyncAndThen(e){return e(this.value)}asyncAndThrough(e){return e(this.value).map(()=>this.value)}asyncMap(e){return si.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}safeUnwrap(){const e=this.value;return(function*(){return e})()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw Dp("Called `_unsafeUnwrapErr` on an Ok",this,e)}*[Symbol.iterator](){return this.value}},Sr=class{constructor(e){this.error=e}isOk(){return!1}isErr(){return!this.isOk()}map(e){return Zr(this.error)}mapErr(e){return Zr(e(this.error))}andThrough(e){return Zr(this.error)}andTee(e){return Zr(this.error)}orTee(e){try{e(this.error)}catch{}return Zr(this.error)}andThen(e){return Zr(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return ho(this.error)}asyncAndThrough(e){return ho(this.error)}asyncMap(e){return ho(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}safeUnwrap(){const e=this.error;return(function*(){throw yield Zr(e),new Error("Do not use this generator out of `safeTry`")})()}_unsafeUnwrap(e){throw Dp("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}*[Symbol.iterator](){const e=this;return yield e,e}},sN=zu.fromThrowable,ex=/\{[^{}]+\}/g,tx=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function rx(){return Math.random().toString(36).slice(2,11)}function nx(e){let{baseUrl:t="",Request:r=globalThis.Request,fetch:n=globalThis.fetch,querySerializer:i,bodySerializer:s,pathSerializer:a,headers:o,requestInitExt:l=void 0,...c}={...e};l=tx()?l:void 0,t=zp(t);const f=[];async function u(p,h){const{baseUrl:g,fetch:m=n,Request:v=r,headers:y,params:x={},parseAs:k="json",querySerializer:T,bodySerializer:S=s??sx,pathSerializer:O,body:P,middleware:R=[],...j}=h||{};let N=t;g&&(N=zp(g)??t);let B=typeof i=="function"?i:Rp(i);T&&(B=typeof T=="function"?T:Rp({...typeof i=="object"?i:{},...T}));const U=O||a||ix,oe=P===void 0?void 0:S(P,Lp(o,y,x.header)),he=Lp(oe===void 0||oe instanceof FormData?{}:{"Content-Type":"application/json"},o,y,x.header),J=[...f,...R],ae={redirect:"follow",...c,...j,body:oe,headers:he};let te,ce,fe=new v(ax(p,{baseUrl:N,params:x,querySerializer:B,pathSerializer:U}),ae),G;for(const F in j)F in fe||(fe[F]=j[F]);if(J.length){te=rx(),ce=Object.freeze({baseUrl:N,fetch:m,parseAs:k,querySerializer:B,bodySerializer:S,pathSerializer:U});for(const F of J)if(F&&typeof F=="object"&&typeof F.onRequest=="function"){const de=await F.onRequest({request:fe,schemaPath:p,params:x,options:ce,id:te});if(de)if(de instanceof v)fe=de;else if(de instanceof Response){G=de;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!G){try{G=await m(fe,l)}catch(F){let de=F;if(J.length)for(let q=J.length-1;q>=0;q--){const ke=J[q];if(ke&&typeof ke=="object"&&typeof ke.onError=="function"){const K=await ke.onError({request:fe,error:de,schemaPath:p,params:x,options:ce,id:te});if(K){if(K instanceof Response){de=void 0,G=K;break}if(K instanceof Error){de=K;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(de)throw de}if(J.length)for(let F=J.length-1;F>=0;F--){const de=J[F];if(de&&typeof de=="object"&&typeof de.onResponse=="function"){const q=await de.onResponse({request:fe,response:G,schemaPath:p,params:x,options:ce,id:te});if(q){if(!(q instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");G=q}}}}const X=G.headers.get("Content-Length");if(G.status===204||fe.method==="HEAD"||X==="0"&&!G.headers.get("Transfer-Encoding")?.includes("chunked"))return G.ok?{data:void 0,response:G}:{error:void 0,response:G};if(G.ok)return{data:await(async()=>{if(k==="stream")return G.body;if(k==="json"&&!X){const de=await G.text();return de?JSON.parse(de):void 0}return await G[k]()})(),response:G};let ue=await G.text();try{ue=JSON.parse(ue)}catch{}return{error:ue,response:G}}return{request(p,h,g){return u(h,{...g,method:p.toUpperCase()})},GET(p,h){return u(p,{...h,method:"GET"})},PUT(p,h){return u(p,{...h,method:"PUT"})},POST(p,h){return u(p,{...h,method:"POST"})},DELETE(p,h){return u(p,{...h,method:"DELETE"})},OPTIONS(p,h){return u(p,{...h,method:"OPTIONS"})},HEAD(p,h){return u(p,{...h,method:"HEAD"})},PATCH(p,h){return u(p,{...h,method:"PATCH"})},TRACE(p,h){return u(p,{...h,method:"TRACE"})},use(...p){for(const h of p)if(h){if(typeof h!="object"||!("onRequest"in h||"onResponse"in h||"onError"in h))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");f.push(h)}},eject(...p){for(const h of p){const g=f.indexOf(h);g!==-1&&f.splice(g,1)}}}}function po(e,t,r){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${r?.allowReserved===!0?t:encodeURIComponent(t)}`}function Fp(e,t,r){if(!t||typeof t!="object")return"";const n=[],i={simple:",",label:".",matrix:";"}[r.style]||"&";if(r.style!=="deepObject"&&r.explode===!1){for(const o in t)n.push(o,r.allowReserved===!0?t[o]:encodeURIComponent(t[o]));const a=n.join(",");switch(r.style){case"form":return`${e}=${a}`;case"label":return`.${a}`;case"matrix":return`;${e}=${a}`;default:return a}}for(const a in t){const o=r.style==="deepObject"?`${e}[${a}]`:a;n.push(po(o,t[a],r))}const s=n.join(i);return r.style==="label"||r.style==="matrix"?`${i}${s}`:s}function Np(e,t,r){if(!Array.isArray(t))return"";if(r.explode===!1){const s={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[r.style]||",",a=(r.allowReserved===!0?t:t.map(o=>encodeURIComponent(o))).join(s);switch(r.style){case"simple":return a;case"label":return`.${a}`;case"matrix":return`;${e}=${a}`;default:return`${e}=${a}`}}const n={simple:",",label:".",matrix:";"}[r.style]||"&",i=[];for(const s of t)r.style==="simple"||r.style==="label"?i.push(r.allowReserved===!0?s:encodeURIComponent(s)):i.push(po(e,s,r));return r.style==="label"||r.style==="matrix"?`${n}${i.join(n)}`:i.join(n)}function Rp(e){return function(r){const n=[];if(r&&typeof r=="object")for(const i in r){const s=r[i];if(s!=null){if(Array.isArray(s)){if(s.length===0)continue;n.push(Np(i,s,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof s=="object"){n.push(Fp(i,s,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}n.push(po(i,s,e))}}return n.join("&")}}function ix(e,t){let r=e;for(const n of e.match(ex)??[]){let i=n.substring(1,n.length-1),s=!1,a="simple";if(i.endsWith("*")&&(s=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(a="label",i=i.substring(1)):i.startsWith(";")&&(a="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;const o=t[i];if(Array.isArray(o)){r=r.replace(n,Np(i,o,{style:a,explode:s}));continue}if(typeof o=="object"){r=r.replace(n,Fp(i,o,{style:a,explode:s}));continue}if(a==="matrix"){r=r.replace(n,`;${po(i,o)}`);continue}r=r.replace(n,a==="label"?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return r}function sx(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function ax(e,t){let r=`${t.baseUrl}${e}`;t.params?.path&&(r=t.pathSerializer(r,t.params.path));let n=t.querySerializer(t.params.query??{});return n.startsWith("?")&&(n=n.substring(1)),n&&(r+=`?${n}`),r}function Lp(...e){const t=new Headers;for(const r of e){if(!r||typeof r!="object")continue;const n=r instanceof Headers?r.entries():Object.entries(r);for(const[i,s]of n)if(s===null)t.delete(i);else if(Array.isArray(s))for(const a of s)t.append(i,a);else s!==void 0&&t.set(i,s)}return t}function zp(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function ox(e,t){return nx({baseUrl:e,headers:{"X-Shop-Url":t}})}var lx="/api/v4/calendar",ux="/api/v4/tickets/calendar",cx="/api/v4/auth/validate_token",dx="/api/v4/tickets/list_and_quotas",fx="/api/v4/tickets",hx="/api/v4/auth/sign_in",px="/api/v4/auth",mx="/api/v4/orders/withdrawals",vx="/api/v4/customer/memberships/activate",gx="/api/v4/orders",yx="/api/v4/customer/customer_addresses",bx="/api/v4/customer/memberships",qp={SHOP_GUEST:10,SHOP:20},mo={error:{success:!1,errors:["Not signed in"]}},_x=class{type;#e=se(Pe({customerSalutations:[],countries:[],locales:[]}));#t={};constructor(e,t,r,n="angular"){this.type=n,e&&t&&r&&this.load(e,t,r,n)}async load(e,t,r,n="angular"){(e.includes("jmb-staging.gomus.de")||e.includes("jmb.gomus.de"))&&(this.type="jmb"),d(this.#e).urls=J_(this.type),d(this.#e).currentUser=ZE(this.type),d(this.#e).apiUrl=e,d(this.#e).shopDomain=t,d(this.#e).locale=r||"de",this.#t={},d(this.#e).client=ox(e,t),d(this.#e).capacityManager=Ap(),d(this.#e).cart=UE(),d(this.#e).auth=new Zf,d(this.#e).client.use(new uw(this.auth)),await this.waitForAllFetches(this.shop)}get capacityManager(){return d(this.#e).capacityManager||(d(this.#e).capacityManager=Ap()),d(this.#e).capacityManager}get cart(){return d(this.#e).cart}get auth(){return d(this.#e).auth||(d(this.#e).auth=new Zf),d(this.#e).auth}get currentUser(){return d(this.#e).currentUser}get slug(){return this.shopDomain?.match(/^(?:https?:\/\/)?([^.-]+)/)?.[1]}get client(){return d(this.#e).client}get name(){return this.shop?.name}get config(){return this.shop?.config}get payment_modes(){return this.shop?.payment_modes}get content(){return this.shop?.content}get settings(){return this.shop?.settings}get donations(){return this.shop?.config.donations}get translations(){return this.shop?.translations}get currency(){return this.shop?.config.currency}t(e,t){return this.translate(e,t)}translate(e,t){if(!this.translations?.[e])return e;let r=this.translations[e];if(t&&r)for(const[n,i]of Object.entries(t))r=r.replace(`{{${n}}}`,i);return r||""}get apiUrl(){return d(this.#e).apiUrl}get shopDomain(){return d(this.#e).shopDomain}get baseUrl(){return"https://"+this.shopDomain}get locale(){return d(this.#e).locale}get shop(){return this.fetchAndCache("/api/v4/shop","shop","shop")}get _data(){return d(this.#e)}getCustomer(){return this.auth.data.accessToken?this.fetchAndCache(cx,"getCustomer","",{cache:5}):mo}getOrders(e={}){return this.auth.data.accessToken?this.fetchAndCache(gx,`orders-${JSON.stringify(e)}`,"",{cache:5,query:e}):mo}getCustomerAddresses(){return this.auth.data.accessToken?this.fetchAndCache(yx,"customerAddresses","",{cache:5}):mo}getCustomerMemberships(){return this.auth.data.accessToken?this.fetchAndCache(bx,"customerMemberships","",{cache:5}):mo}ticketsCalendar(e){return this.fetchAndCache(ux,`ticketsCalendar-${JSON.stringify(e)}`,"data",{cache:60,query:e})}calendar(e){return this.fetchAndCache(lx,`calendar-${JSON.stringify(e)}`,"data",{cache:60,query:e})}ticketsAndQuotas(e){return this.fetchAndCache(dx,`ticketsAndQuotas-${JSON.stringify(e)}`,"",{cache:60,query:xt({per_page:100},e??{})})}tickets(e){return this.fetchAndCache(fx,`tickets-${JSON.stringify(e)}`,"tickets",{cache:60,query:xt({per_page:100},e??{})})}ticketsContent(e){return this.fetchAndCache("/api/v4/tickets/content",`ticketsContent-${JSON.stringify(e)}`,"data",{cache:300,query:xt({"ticket_ids[]":e},{per_page:100})})}signIn(e){return this.apiPost(hx,{body:e,requiredFields:["email","password"]})}signUp(e,t=!1){e=xt({addr_addressat:"",addr_street:"n/a",addr_zip:"n/a",addr_city:"n/a",level:t?qp.SHOP_GUEST:qp.SHOP},e);let r=["name","surname","email","email_confirmation","terms"];return t||r.push("password","password_confirmation"),this.apiPost(px,{body:e,requiredFields:r})}withdrawal(e){const t={...e,order_id:String(e.order_id)};return t.note||delete t.note,this.apiPost(mx,{body:t,requiredFields:["order_id","first_name","last_name","email"],parseAs:"text"})}getDates(e){return this.fetchAndCache("/api/v4/dates",`dates-${JSON.stringify(e)}`,"dates",{query:xt({per_page:100},e),cache:60})}updatePassword(e){return this.apiPut("/api/v4/auth/password",{body:e,requiredFields:["current_password","password","password_confirmation"]})}passwordReset(e){return this.apiPost("/api/v4/auth/password",{body:e,requiredFields:["email"]})}activateMembership(e){return this.apiPost(vx,{body:e,requiredFields:["email"],parseAs:"text"})}checkout(e){return this.apiPost("/api/v4/orders",{body:e,requiredFields:["items","total"]})}#r=null;async createCart(e){const t=JSON.stringify({items:e.items??[],coupons:e.coupons??[]});if(this.#r?.key===t)return this.#r.result;const r=await this.apiPost("/api/v4/cart",{body:e,requiredFields:["items"]});return this.#r={key:t,result:r},r}order(e){return this.fetchAndCache("/api/v4/orders/{id}",`order-${e}`,"order",{path:{id:e}})}annualOrder(e){return this.fetchAndCache("/api/v4/annual/order",`annual-order-${e}`,"order",{query:{token:e}})}finalizePersonalizations(e,t){return this.apiPost("/api/v4/annual/personalization/finalize",{body:t,params:{query:{token:e}}})}uploadPersonalizationPhoto(e,t,r){const n=new FormData;return n.append("file",r),this.apiUpload("/api/v4/annual/personalizations/{id}/upload",{body:n,params:{path:{id:t},query:{token:e}}})}fetchAndCache(e,t,r,n){if(n??={},n.query??={},n.cache??=1e3,n.path??={},!this.#i())return console.warn("(fetchAndCache) Couldn't fetch, Shop not loaded!"),d(this.#e)[t];const i=n.query,s=e+JSON.stringify(i),a=!this.#t[s],o=this.#t[s]?.fetchedAt<Date.now()-n.cache*1e3;return(a||o)&&this.apiGet(e,i,n.path).then(l=>{l&&(d(this.#e)[t]=r===""?l:l[r])}),d(this.#e)[t]}get museums(){return this.fetchAndCache("/api/v4/museums","museums","museums",{query:{per_page:100}})}get exhibitions(){return this.fetchAndCache("/api/v4/exhibitions","exhibitions","exhibitions",{query:{per_page:100}})}getEvent(e){return this.fetchAndCache(`/api/v4/events/${e}`,`single_event_${e}`,"event")}getTicketCapacities(e,t){return this.apiPost("/api/v4/tickets/capacities",{body:{date:e,ticket_ids:t},requiredFields:["date","ticket_ids"]})}getCouponSaleByBarcode(e){return this.fetchAndCache(`/api/v4/coupon_sales/barcode/${e}`,`coupon_sale_barcode_${e}`,"coupon_sale",{cache:0})}getCoupons(){return this.fetchAndCache("/api/v4/coupons","coupons","coupons",{query:{online_available:!0,per_page:100}})}getEventDetailsOnDate(e,t){return this.fetchAndCache(`/api/v4/events/${e}/dates/${t}`,`/api/v4/events/${e}/dates/${t}`,"date")}get events(){return this.fetchAndCache("/api/v4/events","events","events",{query:{per_page:100}})}get upcomingEvents(){return this.fetchAndCache("/api/v4/events","events","events",{query:{by_bookable:!0,with_bookings_in_future:1,per_page:100}})}get tours(){return this.fetchAndCache("/api/v4/tours","tours","tours",{query:{per_page:100}})}get merchandises(){return this.fetchAndCache("/api/v4/merchandises","merchandises","merchandises",{query:{per_page:100}})}get customerSalutations(){return this.fetchAndCache("/api/v3/customer_salutations","customerSalutations","customer_salutations")}get countries(){return this.fetchAndCache("/api/v3/countries","countries","countries",{query:{per_page:100}})}get locales(){return this.fetchAndCache("/api/v4/locales","locales","locales_options")}get urls(){return d(this.#e).urls}get#n(){return{params:{query:{locale:this.locale},header:{"X-Shop-Url":this.shopDomain}}}}async apiPost(e,t){return this.apiCall(e,{method:"POST",...t})}async apiPut(e,t){return this.apiCall(e,{method:"PUT",...t})}async apiDELETE(e,t){return this.apiCall(e,{method:"DELETE",...t})}async apiUpload(e,t){this.#s();const{body:r,params:n={}}=t;return await this.client.POST(e,{body:r,params:xt(this.#n,{params:n}).params,bodySerializer:i=>i})}async apiCall(e,t){this.#s();const{body:r,params:n={},requiredFields:i,parseAs:s}=t,a=GE(r,i);if(Object.keys(a).length>0)return{error:{errors:a}};const o=this.client[t.method];return await o(e,{body:r,params:xt(this.#n,{params:n}).params,parseAs:s})}async asyncFetch(e){return await this.waitForAllFetches(e()),e()}async waitForAllFetches(...e){for(;Object.values(this.#t).filter(t=>t.status==="fetching").length;)await ew(10)}async apiGet(e,t={},r){this.#s();const n=e+JSON.stringify(t);this.#t[n]={status:"fetching",fetchedAt:Date.now()};let i=this.#n;t&&(i=xt(i,{params:{query:t}})),e&&(i=xt(i,{params:{path:r}}));const s=await this.client.GET(e,i);return this.#t[n]={status:"completed",fetchedAt:Date.now()},s.data||s}#i=()=>this.apiUrl!==void 0&&this.shopDomain!==void 0&&this.locale!==void 0&&this.client!==void 0;#s=()=>{if(this.apiUrl===void 0)throw new Error("Public API URL is not set");if(this.shopDomain===void 0)throw new Error("Shop Domain (X-Shop-Url) is not set");if(this.locale===void 0)throw new Error("Locale is not set");if(this.client===void 0)throw new Error("client is not set");if(!this.#i())throw new Error("Fetch is not possible.")}},C=new _x;function Li(e){return function(t,r){if(t)t.addEventListener(e,n=>{n.stopPropagation(),n.detail.value=r});else throw new Error("(createSetDetails) Host is undefined, You are probably trying to use this in a non-web-component context.")}}var wx=class py{host;KEY;pollDuration;#e=se(Pe({value:void 0}));error=!1;constructor(t,r,n=1e3){this.host=t,this.KEY=r,this.pollDuration=n}static static(t){const r=new py(null,null);return r.value=t,r}load(){eu(()=>(this.host.dispatchEvent(new CustomEvent(this.KEY,{detail:this,bubbles:!0})),this.value),this.pollDuration).then(()=>{},()=>{this.error=!0,console.warn("(createGetDetails) could not load data for:",this.KEY)})}get value(){return d(this.#e).value}set value(t){d(this.#e).value=t}};function zi(e){return function(t,r={pollDuration:1e3}){if(t){const n=new wx(t,e,r.pollDuration);return n.load(r.pollDuration),n}else throw new Error("(createGetDetails) Host is undefined, You are probably trying to use this in a non-web-component context.")}}var kx={urls:{},navigateTo:e=>{window.location.assign(e)},forms:{},fields:{},quantityStepper:!0},Sx=class{defaultConfig=xt(kx,window.customOptions);override=this.defaultConfig;#e=se(Pe(this.defaultConfig));get options(){return d(this.#e)}set options(e){M(this.#e,e,!0)}constructor(){this.update()}update(){const e=xt(this.defaultConfig,this.override);e.forms=Object.keys({...this.defaultConfig.forms,...this.override.forms}).reduce((t,r)=>(t[r]={...this.defaultConfig.forms[r],...this.override.forms[r]},t),{}),this.options=e}get config(){return this.options}define(e){return this.override=xt(this.override,e),this.update(),this}default(e){return this.defaultConfig=xt(this.defaultConfig,e),this.update(),this}},Qe=new Sx,Up=class{#e=se();get token(){return d(this.#e)}set token(e){M(this.#e,e,!0)}#t=se();get ticketSaleId(){return d(this.#t)}set ticketSaleId(e){M(this.#t,e,!0)}get order(){if(this.token)return ml(C.annualOrder(this.token))}get ticketSale(){if(this.ticketSaleId)return ml(this.order?.ticket_sales.find(e=>e.id==this.ticketSaleId))}get isBmcTicket(){return this.ticketSale?.is_bmc_ticket||!1}goToPersonalization(e){return Qe.config.urls.annualTicketPersonalizationForm?Qe.config.urls.annualTicketPersonalizationForm(this.token,e.id):C.urls.annualTicketPersonalizationForm(this.token,e.id)}},Vp="go-annual-ticket-personalization",Bp=Li(Vp),Ex=zi(Vp),xx=V("<li><a> </a></li>"),Tx=V('<ul class="go-annual-ticket"><li class="go-annual-ticket-title"> </li> <li class="go-annual-ticket-personalization-count"> </li> <!></ul>');function Ax(e,t){re(t,!0);let r=_(t,"token",7);const n=new Up;Bp(t.$$host,n),ve(()=>{n.token=r()});let i=D(()=>n.order);var s={details:n,get token(){return r()},set token(c){r(c),b()}},a=ee(),o=z(a),l=c=>{var f=ee(),u=z(f);Fe(u,17,()=>d(i).ticket_sales,p=>p.id,(p,h)=>{var g=Tx(),m=$(g),v=$(m,!0);I(m);var y=W(m,2),x=$(y,!0);I(y);var k=W(y,2),T=S=>{var O=xx(),P=$(O),R=$(P,!0);I(P),I(O),Q((j,N)=>{me(P,"href",j),Y(R,N)},[()=>n.goToPersonalization(d(h)),()=>C.t("ticket.annual.personalization.list.personalize.add")]),E(S,O)};le(k,S=>{d(h).status=="not_ready_to_send"&&S(T)}),I(g),Q(S=>{me(g,"data-ticket-sale-id",d(h).id),Y(v,d(h).title),Y(x,S)},[()=>C.t("ticket.annual.personalization.detail.title",{count:d(h).personalizations.length})]),E(p,g)}),E(c,f)};return le(o,c=>{d(i)&&c(l)}),E(e,a),ne(s)}customElements.define("go-annual-ticket-personalization",ie(Ax,{token:{attribute:"token",reflect:!0,type:"String"}},[],["details"]));var Cx={salutation:{key:"salutation",apiKey:"customer_salutation_id",type:"select",label:"user.registration.form.customer_salutation_id",placeholder:"",description:"",autocomplete:"honorific-prefix",options:()=>C.customerSalutations.map(e=>({label:e.salutation,value:e.id}))},firstName:{key:"firstName",apiKey:"name",type:"text",label:"user.registration.form.name",placeholder:"",description:"",autocomplete:"given-name"},lastName:{key:"lastName",apiKey:"surname",type:"text",label:"user.registration.form.surname",placeholder:"",description:"",autocomplete:"family-name"},email:{key:"email",apiKey:"email",type:"email",label:"user.registration.form.email",placeholder:"",description:"",autocomplete:"email",validator:Jt().email("user.fieldErrors.emailValid")},confirmEmail:{key:"confirmEmail",apiKey:"email_confirmation",type:"email",label:"user.registration.form.confirmEmail",placeholder:"",description:"",autocomplete:"email",validator:Jt().email("user.fieldErrors.emailValid")},password:{key:"password",apiKey:"password",type:"password",label:"user.registration.form.password",placeholder:"",description:"",autocomplete:"current-password"},currentPassword:{key:"current_password",apiKey:"current_password",type:"password",label:"user.registration.form.password",placeholder:"",description:"",autocomplete:"current-password"},newPassword:{key:"password",apiKey:"password",type:"password",label:"user.registration.form.password",placeholder:"",description:"",autocomplete:"new-password",validator:Jt().min(6,"user.fieldErrors.passwordTooShort")},confirmPassword:{key:"confirmPassword",apiKey:"password_confirmation",type:"password",label:"user.registration.form.confirmPassword",placeholder:"",description:"",autocomplete:"new-password"},addressee:{key:"addressee",apiKey:"addr_addressat",type:"text",label:"user.registration.form.adressat",placeholder:"",description:"",autocomplete:"name"},street:{key:"street",apiKey:"addr_street",type:"text",label:"user.registration.form.street",placeholder:"",description:"",autocomplete:"street-address"},postcode:{key:"postcode",apiKey:"addr_zip",type:"text",label:"user.registration.form.plz",placeholder:"",description:"",autocomplete:"postal-code"},city:{key:"city",apiKey:"addr_city",type:"text",label:"user.registration.form.city",placeholder:"",description:"",autocomplete:"address-level2"},country:{key:"country",apiKey:"addr_country_id",type:"select",label:"user.registration.form.country",placeholder:"",description:"",autocomplete:"country",options:()=>C.countries.map(e=>({label:e.name,value:e.id}))},language:{key:"language",apiKey:"language_id",type:"select",label:"user.registration.form.language",placeholder:"",description:"",autocomplete:"language",options:()=>(C.locales??[]).map(e=>({label:C.t(`languages.${e.locale}`),value:e.id}))},acceptTerms:{key:"acceptTerms",apiKey:"terms",type:"checkbox",label:"user.registration.form.accept",placeholder:"",description:"",autocomplete:"off"},startAt:{apiKey:"start_at",key:"startAt",type:"date",label:"ticket.annual.personalization.list.startAt.update",placeholder:"",description:"",autocomplete:"off",validator:Jt().date()},dateOfBirth:{key:"dateOfBirth",apiKey:"date_of_birth",type:"date",label:"user.registration.form.dateOfBirth",placeholder:"",description:"",autocomplete:"bday",validator:Jt().date()},token:{key:"token",apiKey:"id",type:"text",label:"cart.coupon.form.code",placeholder:"",description:"",autocomplete:"off"},photo:{key:"photo",apiKey:"file",type:"file",label:"ticket.annual.personalization.form.photo",placeholder:"",description:"",autocomplete:"off",validator:L1(File)},withdrawalFirstName:{key:"withdrawalFirstName",apiKey:"first_name",type:"text",label:"user.registration.form.name",placeholder:"",description:"",autocomplete:"given-name"},withdrawalLastName:{key:"withdrawalLastName",apiKey:"last_name",type:"text",label:"user.registration.form.surname",placeholder:"",description:"",autocomplete:"family-name"},orderNumber:{key:"orderNumber",apiKey:"order_id",type:"text",label:"withdrawal.form.orderNumber",placeholder:"",description:"",autocomplete:"off"},withdrawalNote:{key:"withdrawalNote",apiKey:"note",type:"textarea",label:"withdrawal.form.note",placeholder:"",description:"",autocomplete:"off"},paymentMode:{key:"paymentMode",apiKey:"payment_mode_id",type:"paymentMode",label:"cart.paymentMode.label",placeholder:"",description:"",autocomplete:"off",options:()=>(C.payment_modes?Object.values(C.payment_modes):[]).map(e=>({value:String(e.id),label:e.name}))}};function Ox(e,t){return{...e,errors:e.errors||[],value:e.value??Dx(e.type),options:e.options,autocomplete:e.autocomplete??"",placeholder:e.placeholder??"",description:e.description,apiErrors:e.apiErrors??[],mounted:e.mounted??!1,required:t,validate(){Ix(this)}}}function Dx(e){return e==="checkbox"?!1:e==="file"?null:""}function Ix(e){if(e.errors=[],!e.validator){e.required&&(e.value===!1||e.value===""||e.value===null||e.value===void 0)&&(e.errors=["common.fieldErrors.required"]);return}const t=e.validator.safeParse(e.value);t.success?e.errors=[]:e.errors=t.error.format()._errors}var Bt=class il{static#e={};static defineForm(t){Qe.default({forms:{[t.id]:{fields:t.fields,submitLabel:t.submitLabel}}})}static defineFields(t){Qe.default({fields:t})}static{il.defineFields(Cx)}static setRequiredApiKeys(t,r){il.#e[t]=r}static getFormOptions(t){return Qe.config.forms[t]}static createField(t,r){const n=il.getFieldInit(t);if(!n)throw new Error(`(formFields) Field "${t}" not found`);return Ox(n,r)}static getFormFields(t){return Px(t)}static getFieldInit(t){return Qe.config.fields[t]}};function Px(e){const t=Qe.config.forms[e];if(!t)throw new Error(`(formFields) Form ${e} not found`);const r=t.fields;return r||(console.warn("(formFields) No fields defined for form",e),[])}function qu(e){return e?e.filter(t=>t.mounted&&(t.errors?.length||t.apiErrors?.length)).length:0}function $x(e,t){re(t,!0);let r=_(t,"token",7),n=_(t,"ticketSaleId",7),i;const s=new Up;Bp(t.$$host,s),ve(()=>{s.token=r(),s.ticketSaleId=n()}),Bt.defineForm({id:"ticketPersonalization",fields:[{key:"startAt",required:!0}]});async function a(){if(!i)return;const m=s.ticketSale.personalizations.length,v=document.querySelectorAll('go-form:not([form-id="ticketPersonalization"])'),y=jf(m,(S,O)=>{const P=v[O-1].details;return S.push(P),S},[]);if(y.forEach(S=>{S.fields.forEach(O=>{S.validateField(O)})}),!jf(m,(S,O)=>y[O-1].isValid,!1))return;if(s.ticketSale?.photo_mandatory==="mandatory"){const S=y.map(async(P,R)=>{const j=s.ticketSale.personalizations[R].id,N=P.fields.find(U=>U.key==="photo")?.value;if(!(N instanceof File))return{ok:!1,error:"ticket.annual.personalization.photo.missing"};const B=await C.uploadPersonalizationPhoto(r(),j,N);return B.error?{ok:!1,error:B.error.error??"ticket.annual.personalization.photo.upload_failed"}:{ok:!0,error:""}}),O=(await Promise.all(S)).find(P=>!P.ok);if(O){i.details.apiErrors=[O.error];return}}const x={personalization:{ticket_sale_id:s.ticketSaleId,start_at:i.details.formData.start_at,personalizations:y.map((S,O)=>{const P=lw(S.formData,["email_confirmation"]);return{id:s.ticketSale?.personalizations[O].id,customer:P}})}},k=await C.finalizePersonalizations(r(),x);if(k.error){i.details.apiErrors=[k.error.error];return}const T=Qe.config.forms.personalization?.beforeSubmit;T&&T(x),Qe.config.urls.annualTicketPersonalizationFormSubmit?.()&&Qe.config.navigateTo(Qe.config.urls.annualTicketPersonalizationFormSubmit())}let o=null,l=null,c=null,f=0;function u(m){m.querySelectorAll("go-field").forEach(v=>v.replaceChildren())}function p(){return o?!0:(o=t.$$host.querySelector("go-personalization-form"),o?(l=o.cloneNode(!0),u(l),c=new Comment("go-personalization-form-anchor"),o.after(c),!0):(console.warn("[personalization] No <go-personalization-form> supplied"),!1))}function h(m){if(!p()||!o||!l||!c)return;const v=o.parentElement;if(!v)return;const y=Math.max(m,1),x=Array.from(v.querySelectorAll("go-personalization-form"));for(;x.length<y;){const T=l.cloneNode(!0);u(T),v.insertBefore(T,c),x.push(T)}for(;x.length>y;){const T=x.pop();T&&T!==o&&T.remove()}const k=s.ticketSale?.personalizations??[];x.forEach((T,S)=>{const O=k[S];O&&(T.dataset.personalizationId=String(O.id))}),f=y}En(()=>{p(),t.$$host.addEventListener("go-submit",a),i=document.querySelector('go-form[form-id="ticketPersonalization"]')}),ve(()=>{if(!s.ticketSale)return;const m=s.ticketSale?.personalizations.length??1;m!==f&&h(m)});var g={details:s,get token(){return r()},set token(m){r(m),b()},get ticketSaleId(){return n()},set ticketSaleId(m){n(m),b()}};return ne(g)}customElements.define("go-annual-ticket-personalization-form",ie($x,{token:{attribute:"token",reflect:!0,type:"String"},ticketSaleId:{attribute:"ticket-sale-id",reflect:!0,type:"Number"}},[],["details"]));var Mx=class{formId;form;#e=se(Pe([]));#t=D(()=>qu(this.fields)==0);get isValid(){return d(this.#t)}set isValid(e){M(this.#t,e)}#r=se();get successMessage(){return d(this.#r)}set successMessage(e){M(this.#r,e,!0)}get formData(){function e(r){return nw(r)||tw(r)?r:r==="true"||r==="false"?r==="true":!Number.isNaN(+r)&&r.trim()!==""?+r:r}const t=this.fields.filter(r=>r!==void 0).filter(r=>r.type!=="file").filter(r=>r.value!=="");return Object.fromEntries(t.map(r=>[r.apiKey,e(r.value)]))}fieldValue(e){return this.fields.find(t=>t.key===e)?.value}get apiErrors(){return d(this.#e)}set apiErrors(e){if(M(this.#e,[],!0),this.fields.forEach(t=>t.apiErrors=[]),tu(e)){M(this.#e,e,!0);return}if(e.errors&&tu(e.errors)&&M(this.#e,e.errors,!0),rw(e.error)){M(this.#e,[e.error],!0);return}for(const[t,r]of Object.entries(e)){if(t==="full_messages"||t==="success"||t==="errors")continue;const n=this.fields.find(i=>i.apiKey===t);if(!n){console.error(`(set apiErrors) Field with API key ${t} not found`);continue}n.apiErrors=r}}validateForm(){this.fields.forEach(e=>this.validateField(e))}validateField(e){if(e.validate(),e.apiKey==="password_confirmation"){const t=this.fields.find(r=>r.apiKey==="password");(!t||t&&e.value!==t.value)&&e.errors.push("user.fieldErrors.passwordMatch")}else if(e.apiKey==="email_confirmation"){const t=this.fields.find(r=>r.apiKey==="email");(!t||t&&e.value!==t.value)&&e.errors.push("user.fieldErrors.emailMatch")}}get fields(){const e=this.form.closest("go-form");return Array.from(this.form.querySelectorAll("go-field")).filter(t=>t.closest("go-form")===e).map(t=>t.getField?.()).filter(t=>!!t)}toString(){return`Form: ${this.formId}, Fields: [${this.fields.map(e=>e.key).join(", ")}], Data: ${JSON.stringify(this.formData)}`}fill(e){const t=this.fields;Object.entries(e).forEach(([r,n])=>{const i=t.find(s=>s.apiKey===r);if(!i){console.warn(`(FormDetails.fill) Field with API key ${r} not found.`);return}if(i.type==="select"&&!i.options?.().find(s=>s.value===n))throw new Error(`(FormDetails.fill) Field ${r} has invalid value: ${n}`);if(i.type==="checkbox"&&![!0,!1].includes(n))throw new Error(`(FormDetails.fill) Field ${r} has invalid value: ${n}`);i.value=n})}constructor(e,t){this.formId=e,this.form=t}},jp="go-form-details",Fx=Li(jp),qi=zi(jp);function Hr(e,t,r){const n=e.firstElementChild||void 0;if(e.children?.length===1&&n?.tagName.toLowerCase()===t)return n;const i=document.createElement(t);r&&Object.entries(r).forEach(([a,o])=>{typeof o=="boolean"?o&&i.setAttribute(a,""):i.setAttribute(a,o)});const s=document.createDocumentFragment();for(;e.firstChild;)s.appendChild(e.firstChild);return i.appendChild(s),e.replaceChildren(i),i}var Nx=V("<go-all-fields></go-all-fields> <go-form-feedback><go-errors-feedback></go-errors-feedback> <go-success-feedback></go-success-feedback></go-form-feedback> <go-submit> </go-submit>",3);function Rx(e,t){re(t,!0);let r=_(t,"formId",7),n=_(t,"custom",7);const i=new Mx(r(),t.$$host);Fx(t.$$host,i);async function s(f){f.preventDefault(),f.stopPropagation(),i.validateForm(),i?.form?.dispatchEvent(new Event("go-after-validation",f)),i.isValid&&(i.apiErrors={},i.successMessage=void 0,i?.form?.dispatchEvent(new Event("go-submit",f)),t.$$host.dispatchEvent(new Event("submit",{bubbles:!0,composed:!0})))}En(()=>{const f=Hr(t.$$host,"form",{novalidate:!0});f.addEventListener("submit",s),i.form=f});var a={details:i,get formId(){return r()},set formId(f){r(f),b()},get custom(){return n()},set custom(f){n(f),b()}},o=ee(),l=z(o),c=f=>{var u=Nx(),p=z(u),h=W(p,2),g=W(h,2),m=$(g,!0);I(g),Q(v=>Y(m,v),[()=>C.t(Bt.getFormOptions(r())?.submitLabel||"Submit")]),E(f,u)};return le(l,f=>{n()||f(c)}),E(e,o),ne(a)}customElements.define("go-form",ie(Rx,{formId:{attribute:"form-id",reflect:!0,type:"String"},custom:{attribute:"custom",reflect:!0,type:"Boolean"}},[],["details"]));var Lx=V("<go-form></go-form>",2);function zx(e,t){re(t,!0);let r=_(t,"custom",7,!1);Bt.defineForm({id:"passwordReset",submitLabel:"user.passwordReset.actions.requestPasswordReset",fields:[{key:"email",required:!0}]});async function n(a){const o=a.target.details,l=await C.passwordReset(o.formData);l.data?(t.$$host.dispatchEvent(new Event("go-success",{bubbles:!0,composed:!0})),o.successMessage=l.data.message,o.apiErrors=[]):o.apiErrors=l.error.errors}var i={get custom(){return r()},set custom(a=!1){r(a),b()}},s=Lx();return Jn(s,"formId","passwordReset"),Q(()=>Jn(s,"custom",r())),La("submit",s,n),E(e,s),ne(i)}customElements.define("go-password-reset",ie(zx,{custom:{}},[],[]));function qx(e,t){re(t,!0),Bt.defineForm({id:"signIn",submitLabel:"common.actions.login",fields:[{key:"email",required:!0},{key:"password",required:!0}]});let r=_(t,"custom",7,!1);async function n(i){const s=i.target.details,a=await C.signIn(s.formData);a.data?t.$$host.dispatchEvent(new Event("go-success",{bubbles:!0,composed:!0})):s.apiErrors=a.error.errors}return Hr(t.$$host,"go-form",{"form-id":"signIn",custom:r()}),t.$$host.addEventListener("submit",n),ne({get custom(){return r()},set custom(i=!1){r(i),b()}})}customElements.define("go-sign-in",ie(qx,{custom:{attribute:"custom",reflect:!0,type:"Boolean"}},[],[]));function Ux(e,t){re(t,!0);let r=_(t,"custom",7,!1);Bt.defineForm({id:"signUp",submitLabel:"common.actions.register",fields:[{key:"firstName",required:!0},{key:"lastName",required:!0},{key:"email",required:!0},{key:"confirmEmail",required:!0},{key:"newPassword",required:!0},{key:"confirmPassword",required:!0},{key:"acceptTerms",required:!0}]});async function n(i){const s=i.target.details,a=await C.signUp(s.formData,!1);a.data?t.$$host.dispatchEvent(new Event("go-success",{bubbles:!0,composed:!0})):s.apiErrors=a.error.errors}return Hr(t.$$host,"go-form",{"form-id":"signUp",custom:r()}),t.$$host.addEventListener("submit",n),ne({get custom(){return r()},set custom(i=!1){r(i),b()}})}customElements.define("go-sign-up",ie(Ux,{custom:{attribute:"custom",reflect:!0,type:"Boolean"}},[],[]));function Vx(e,t){if(typeof e=="number"&&Number.isFinite(e))return e;if(e&&typeof e=="object"){const r=Object.values(e).reduce((n,i)=>typeof i=="number"&&Number.isFinite(i)?n+i:n,0);if(r>0)return r}return t}function Bx(e){return"quantity"in e&&e.quantity!==void 0?e.quantity:e.quantities}function jx(e){return Vx(Bx(e),0)}function Zx(e,t){const r=Ni(),n=new Set(t.map(i=>i.attributes.coupon).filter(Boolean).map(i=>i.toUpperCase()));return e.coupons.forEach(i=>r.addCoupon({...i,applied:i.kind!=="actionToken"||n.has(i.code)})),t.forEach(i=>{const s=i.attributes,a=s.uuid,o=e.items.find(l=>l.uuid===a);if(!o){console.error("(go-cart) Ignoring unmatched cart line",{type:i.type,attrs:s});return}r.addItem(Wx(o,s))}),r}function Wx(e,t){const r=_p(e.product)?1:jx(t),n=e.product.price_cents,i=n===0?0:t.price_cents??n,s=i<n;return ot({...e.product,price_cents:i},{quantity:r,time:e.time,voucher:e.voucher,mantle:e.mantle,display:{discounted:s,reference_uuid:e.uuid,originalPrice:n}})}var Hx=class{#e=se();get displayCart(){return d(this.#e)}set displayCart(e){M(this.#e,e,!0)}#t=se(!1);get preview(){return d(this.#t)}set preview(e){M(this.#t,e,!0)}get totalPriceCents(){return this.displayCart?.amountToPayCents??0}get subtotalPriceCents(){return C.cart?.totalPriceCents??0}get discountedAmountCents(){return Math.max(0,this.subtotalPriceCents-this.totalPriceCents)}get isDiscounted(){return this.discountedAmountCents>0}async calculateDisplayCart(){const e=C.cart;if(e)try{const{items:t,coupons:r}=e.orderData(),n=await C.createCart({items:t,coupons:r});if(n?.data){this.displayCart=Zx(e,n.data.items??[]);return}console.error("(go-cart) Unable to fetch discounted cart data",n?.error),this.displayCart=e}catch(t){console.error("(go-cart) Unable to fetch discounted cart data",t),this.displayCart=e}}},Zp="go-cart-details",Gx=Li(Zp),Ui=zi(Zp),Kx=V('<span class="go-cart-item-title" data-testid="cart-item-title"> </span>');function Wp(e,t){re(t,!0);let r=_(t,"cartItem",7);var n={get cartItem(){return r()},set cartItem(a){r(a),b()}},i=Kx(),s=$(i,!0);return I(i),Q(()=>Y(s,r().product.title)),E(e,i),ne(n)}ie(Wp,{cartItem:{}},[],[],{mode:"open"});var Yx=V('<span class="go-cart-item-date" data-testid="cart-item-date"> </span><span class="go-cart-item-time" data-testid="cart-item-time"> </span>',1),Jx=V('<span class="go-cart-item-title" data-testid="cart-item-title"><span class="go-cart-item-title-event-title"> </span><span class="go-cart-item-title-ticket-title"> </span></span><!>',1);function Hp(e,t){re(t,!0);let r=_(t,"cartItem",7);if(!Ws(r().product))throw new Error("Product is not an event ticket");const n=r().product;var i={get cartItem(){return r()},set cartItem(h){r(h),b()}},s=Jx(),a=z(s),o=$(a),l=$(o,!0);I(o);var c=W(o),f=$(c,!0);I(c),I(a);var u=W(a),p=h=>{var g=Yx(),m=z(g),v=$(m,!0);I(m);var y=W(m),x=$(y,!0);I(y),Q((k,T)=>{Y(v,k),Y(x,T)},[()=>ni(r().time,{month:"numeric",day:"numeric"},C.locale),()=>$n(r().time)]),E(h,g)};return le(u,h=>{r().time&&h(p)}),Q(()=>{Y(l,n.event_title),Y(f,n.title)}),E(e,s),ne(i)}ie(Hp,{cartItem:{}},[],[],{mode:"open"});var Qx=V('<span class="go-cart-item-time" data-testid="cart-item-time"> </span>'),Xx=V('<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>',1),eT=V('<span class="go-cart-item-title" data-testid="cart-item-title"> </span> <!>',1);function Gp(e,t){re(t,!0);let r=_(t,"cartItem",7);var n={get cartItem(){return r()},set cartItem(c){r(c),b()}},i=eT(),s=z(i),a=$(s,!0);I(s);var o=W(s,2),l=c=>{var f=Xx(),u=z(f),p=$(u,!0);I(u);var h=W(u,2),g=m=>{var v=Qx(),y=$(v,!0);I(v),Q(x=>Y(y,x),[()=>$n(r().time)]),E(m,v)};le(h,m=>{r().product.type==="Ticket"&&r().product.subtype==="timeslot"&&m(g)}),Q(m=>Y(p,m),[()=>ni(r().time,{month:"numeric",day:"numeric"},C.locale)]),E(c,f)};return le(o,c=>{r().time&&c(l)}),Q(()=>Y(a,r().product.title)),E(e,i),ne(n)}ie(Gp,{cartItem:{}},[],[],{mode:"open"});var tT=V('<span class="go-cart-item-time" data-testid="cart-item-time"> </span>'),rT=V('<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>',1),nT=V('<span class="go-cart-item-custom" data-testid="cart-item-custom"> </span>'),iT=V('<span class="go-cart-item-title" data-testid="cart-item-title"> </span> <span class="go-cart-item-participants" data-testid="cart-item-participants"> </span> <!> <!>',1);function Kp(e,t){re(t,!0);let r=_(t,"cartItem",7);const n=D(()=>r().product),i=D(()=>{if(!r().time)return null;try{return{date:ni(r().time,{year:"numeric",month:"numeric",day:"numeric"},C.locale),time:$n(r().time)}}catch{return{date:r().time,time:""}}}),s=v=>v==null?"":typeof v=="object"?JSON.stringify(v):String(v),a=D(()=>Object.entries(d(n).customs??{}).filter(([,v])=>v!=null&&v!==""));var o={get cartItem(){return r()},set cartItem(v){r(v),b()}},l=iT(),c=z(l),f=$(c,!0);I(c);var u=W(c,2),p=$(u,!0);I(u);var h=W(u,2),g=v=>{var y=rT(),x=z(y),k=$(x,!0);I(x);var T=W(x,2),S=O=>{var P=tT(),R=$(P,!0);I(P),Q(()=>Y(R,d(i).time)),E(O,P)};le(T,O=>{d(i).time&&O(S)}),Q(()=>Y(k,d(i).date)),E(v,y)};le(h,v=>{d(i)&&v(g)});var m=W(h,2);return Fe(m,17,()=>d(a),([v,y])=>v,(v,y)=>{var x=D(()=>Jy(d(y),2));let k=()=>d(x)[0],T=()=>d(x)[1];var S=nT(),O=$(S);I(S),Q(P=>Y(O,`${k()??""}: ${P??""}`),[()=>s(T())]),E(v,S)}),Q(v=>{Y(f,d(n).title),Y(p,v)},[()=>C.t("cart.item.participants",{count:d(n).participants})]),E(e,l),ne(o)}ie(Kp,{cartItem:{}},[],[],{mode:"open"});function Yp(e,{min:t,max:r}){const n=e<t?Math.max(t,1):e+1;return n>r?e:n}function sT(e,{min:t,floor:r=0}){return e<=t?r:e-1}function aT(e,{min:t,max:r,floor:n=0}){if(!Number.isFinite(e)||e<=0)return n;let i=Math.floor(e);return i<t&&(i=t),i>r&&(i=r),i}function oT(e,{min:t,max:r,floor:n=0}){return e<0||e>r?!1:e===n||e>=t}function Jp(e,t){return Yp(e,t)>e}function Qp(e,{floor:t=0}){return e>t}var lT=V('<div class="go-quantity-stepper" role="group"><button type="button" class="go-quantity-stepper-button go-quantity-stepper-decrement" tabindex="-1"><span aria-hidden="true">−</span></button> <input class="go-quantity-stepper-value" type="text" role="spinbutton" inputmode="numeric" autocomplete="off"/> <button type="button" class="go-quantity-stepper-button go-quantity-stepper-increment" tabindex="-1"><span aria-hidden="true">+</span></button></div>');function Xp(e,t){const r=mt();re(t,!0);let n=_(t,"value",7),i=_(t,"min",7),s=_(t,"max",7),a=_(t,"floor",7,0),o=_(t,"label",7),l=_(t,"decreaseLabel",7),c=_(t,"increaseLabel",7),f=_(t,"onChange",7);const u=D(()=>({min:i(),max:s(),floor:a()}));let p,h=se(!1);const g=D(()=>!Qp(n(),d(u))),m=D(()=>!Jp(n(),d(u)));function v(B){B!==n()&&f()(B)}function y(){Qp(n(),d(u))&&v(sT(n(),d(u)))}function x(){Jp(n(),d(u))&&v(Yp(n(),d(u)))}function k(){const B=aT(parseInt(p.value,10),d(u));M(h,!1),p.value=String(B),v(B)}function T(){const B=p.value.trim();M(h,!(/^\d+$/.test(B)&&oT(parseInt(B,10),d(u))))}function S(B){switch(B.key){case"ArrowUp":B.preventDefault(),x();break;case"ArrowDown":B.preventDefault(),y();break;case"Home":B.preventDefault(),v(a());break;case"End":B.preventDefault(),v(s());break;case"Enter":B.preventDefault(),k();break}}var O={get value(){return n()},set value(B){n(B),b()},get min(){return i()},set min(B){i(B),b()},get max(){return s()},set max(B){s(B),b()},get floor(){return a()},set floor(B=0){a(B),b()},get label(){return o()},set label(B){o(B),b()},get decreaseLabel(){return l()},set decreaseLabel(B){l(B),b()},get increaseLabel(){return c()},set increaseLabel(B){c(B),b()},get onChange(){return f()},set onChange(B){f(B),b()}},P=lT(),R=$(P),j=W(R,2);Ms(j),Ql(j,B=>p=B,()=>p);var N=W(j,2);return I(P),Q(()=>{me(P,"aria-label",o()),me(R,"title",l()),me(R,"aria-controls",r),me(R,"aria-disabled",d(g)),me(j,"id",r),me(j,"aria-label",o()),Bl(j,n()),me(j,"aria-valuenow",n()),me(j,"aria-valuemin",a()),me(j,"aria-valuemax",s()),me(j,"aria-invalid",d(h)?"true":void 0),me(N,"title",c()),me(N,"aria-controls",r),me(N,"aria-disabled",d(m))}),pt("click",R,y),pt("input",j,T),pt("change",j,k),La("blur",j,k),pt("keydown",j,S),pt("click",N,x),E(e,P),ne(O)}ur(["click","input","change","keydown"]),ie(Xp,{value:{},min:{},max:{},floor:{},label:{},decreaseLabel:{},increaseLabel:{},onChange:{}},[],[],{mode:"open"});function uT(e,t,r={floor:0}){const{floor:n}=r;if(t===0||t===n)return[vo(n)];if(t<e)return e>n?[vo(e)]:[];const i=Math.max(e,n),s=[vo(n)];for(let a=i;a<=t;a++)a!==n&&s.push(vo(a));return s}function vo(e){return{value:e,label:e.toString()}}var cT=V("<option> </option>"),dT=V('<select class="go-quantity-select"></select>');function go(e,t){re(t,!0);let r=_(t,"value",7),n=_(t,"min",7),i=_(t,"max",7),s=_(t,"label",7),a=_(t,"floor",7,0),o=_(t,"deselectable",7,!0),l=_(t,"onChange",7);const c=D(()=>Qe.config.quantityStepper);var f={get value(){return r()},set value(m){r(m),b()},get min(){return n()},set min(m){n(m),b()},get max(){return i()},set max(m){i(m),b()},get label(){return s()},set label(m){s(m),b()},get floor(){return a()},set floor(m=0){a(m),b()},get deselectable(){return o()},set deselectable(m=!0){o(m),b()},get onChange(){return l()},set onChange(m){l(m),b()}},u=ee(),p=z(u),h=m=>{{let v=D(()=>o()?0:n()),y=D(()=>C.t("quantity.decrease")),x=D(()=>C.t("quantity.increase"));Xp(m,{get value(){return r()},get min(){return n()},get max(){return i()},get floor(){return d(v)},get label(){return s()},get decreaseLabel(){return d(y)},get increaseLabel(){return d(x)},get onChange(){return l()}})}},g=m=>{var v=dT();Fe(v,21,()=>uT(n(),i(),{floor:o()?a():n()}),y=>y.value,(y,x)=>{var k=cT(),T=$(k,!0);I(k);var S={};Q(()=>{Ff(k,r()===d(x).value),Y(T,d(x).label),S!==(S=d(x).value)&&(k.value=(k.__value=d(x).value)??"")}),E(y,k)}),I(v),Q(()=>me(v,"aria-label",s())),pt("change",v,y=>l()(parseInt(y.target.value,10))),E(m,v)};return le(p,m=>{d(c)?m(h):m(g,-1)}),E(e,u),ne(f)}ur(["change"]),ie(go,{value:{},min:{},max:{},label:{},floor:{},deselectable:{},onChange:{}},[],[],{mode:"open"});function em(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function fT(e){if(Array.isArray(e))return e}function hT(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,a,o=[],l=!0,c=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(l=(n=s.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(f){c=!0,i=f}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return o}}function pT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
76
76
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mT(e,t){return fT(e)||hT(e,t)||vT(e,t)||pT()}function vT(e,t){if(e){if(typeof e=="string")return em(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?em(e,t):void 0}}var tm=Object.entries,rm=Object.setPrototypeOf,gT=Object.isFrozen,yT=Object.getPrototypeOf,bT=Object.getOwnPropertyDescriptor,It=Object.freeze,hr=Object.seal,Vi=Object.create,nm=typeof Reflect<"u"&&Reflect,Uu=nm.apply,Vu=nm.construct;It||(It=function(t){return t}),hr||(hr=function(t){return t}),Uu||(Uu=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];return t.apply(r,i)}),Vu||(Vu=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return new t(...n)});var Bi=ft(Array.prototype.forEach),_T=ft(Array.prototype.lastIndexOf),im=ft(Array.prototype.pop),ji=ft(Array.prototype.push),wT=ft(Array.prototype.splice),Pt=Array.isArray,Hs=ft(String.prototype.toLowerCase),Bu=ft(String.prototype.toString),sm=ft(String.prototype.match),Zi=ft(String.prototype.replace),am=ft(String.prototype.indexOf),kT=ft(String.prototype.trim),ST=ft(Number.prototype.toString),ET=ft(Boolean.prototype.toString),om=typeof BigInt>"u"?null:ft(BigInt.prototype.toString),lm=typeof Symbol>"u"?null:ft(Symbol.prototype.toString),rt=ft(Object.prototype.hasOwnProperty),Gs=ft(Object.prototype.toString),wt=ft(RegExp.prototype.test),Ks=xT(TypeError);function ft(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return Uu(e,t,n)}}function xT(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Vu(e,r)}}function Ae(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Hs;if(rm&&rm(e,null),!Pt(t))return e;let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){const s=r(i);s!==i&&(gT(t)||(t[n]=s),i=s)}e[i]=!0}return e}function TT(e){for(let t=0;t<e.length;t++)rt(e,t)||(e[t]=null);return e}function Tt(e){const t=Vi(null);for(const n of tm(e)){var r=mT(n,2);const i=r[0],s=r[1];rt(e,i)&&(Pt(s)?t[i]=TT(s):s&&typeof s=="object"&&s.constructor===Object?t[i]=Tt(s):t[i]=s)}return t}function AT(e){switch(typeof e){case"string":return e;case"number":return ST(e);case"boolean":return ET(e);case"bigint":return om?om(e):"0";case"symbol":return lm?lm(e):"Symbol()";case"undefined":return Gs(e);case"function":case"object":{if(e===null)return Gs(e);const t=e,r=Gr(t,"toString");if(typeof r=="function"){const n=r(t);return typeof n=="string"?n:Gs(n)}return Gs(e)}default:return Gs(e)}}function Gr(e,t){for(;e!==null;){const n=bT(e,t);if(n){if(n.get)return ft(n.get);if(typeof n.value=="function")return ft(n.value)}e=yT(e)}function r(){return null}return r}function CT(e){try{return wt(e,""),!0}catch{return!1}}var um=It(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ju=It(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Zu=It(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),OT=It(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Wu=It(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),DT=It(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),cm=It(["#text"]),dm=It(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Hu=It(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),fm=It(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),yo=It(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),IT=hr(/{{[\w\W]*|^[\w\W]*}}/g),PT=hr(/<%[\w\W]*|^[\w\W]*%>/g),$T=hr(/\${[\w\W]*/g),MT=hr(/^data-[\-\w.\u00B7-\uFFFF]+$/),FT=hr(/^aria-[\-\w]+$/),hm=hr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),NT=hr(/^(?:\w+script|data):/i),RT=hr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),LT=hr(/^html$/i),zT=hr(/^[a-z][.\w]*(-[.\w]+)+$/i),Kr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},qT=function(){return typeof window>"u"?null:window},UT=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const s="dompurify"+(n?"#"+n:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},pm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function mm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qT();const t=ye=>mm(ye);if(t.version="3.4.7",t.removed=[],!e||!e.document||e.document.nodeType!==Kr.document||!e.Element)return t.isSupported=!1,t;let r=e.document;const n=r,i=n.currentScript;e.DocumentFragment;const s=e.HTMLTemplateElement,a=e.Node,o=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const c=e.DOMParser,f=e.trustedTypes,u=o.prototype,p=Gr(u,"cloneNode"),h=Gr(u,"remove"),g=Gr(u,"nextSibling"),m=Gr(u,"childNodes"),v=Gr(u,"parentNode"),y=Gr(u,"shadowRoot"),x=Gr(u,"attributes"),k=a&&a.prototype?Gr(a.prototype,"nodeType"):null,T=a&&a.prototype?Gr(a.prototype,"nodeName"):null;if(typeof s=="function"){const ye=r.createElement("template");ye.content&&ye.content.ownerDocument&&(r=ye.content.ownerDocument)}let S,O="";const P=r,R=P.implementation,j=P.createNodeIterator,N=P.createDocumentFragment,B=P.getElementsByTagName,U=n.importNode;let oe=pm();t.isSupported=typeof tm=="function"&&typeof v=="function"&&R&&R.createHTMLDocument!==void 0;const he=IT,J=PT,ae=$T,te=MT,ce=FT,fe=NT,G=RT,X=zT;let ue=hm,F=null;const de=Ae({},[...um,...ju,...Zu,...Wu,...cm]);let q=null;const ke=Ae({},[...dm,...Hu,...fm,...yo]);let K=Object.seal(Vi(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),w=null,ge=null;const Se=Object.seal(Vi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let je=!0,Ge=!0,Ze=!1,kt=!0,st=!1,tr=!0,At=!1,Ft=!1,rr=!1,Wt=!1,mr=!1,Ir=!1,Pr=!0,yn=!1;const $r="user-content-";let vr=!0,Xr=!1,en={},St=null;const Vn=Ae({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let as=null;const os=Ae({},["audio","video","img","source","image","track"]);let pa=null;const id=Ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bi="http://www.w3.org/1998/Math/MathML",ls="http://www.w3.org/2000/svg",gr="http://www.w3.org/1999/xhtml";let Bn=gr,sd=!1,ad=null;const oF=Ae({},[bi,ls,gr],Bu);let od=Ae({},["mi","mo","mn","ms","mtext"]),ld=Ae({},["annotation-xml"]);const lF=Ae({},["title","style","font","a","script"]);let ma=null;const uF=["application/xhtml+xml","text/html"],cF="text/html";let lt=null,us=null;const dF=r.createElement("form"),ty=function(A){return A instanceof RegExp||A instanceof Function},ud=function(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(us&&us===A)return;(!A||typeof A!="object")&&(A={}),A=Tt(A),ma=uF.indexOf(A.PARSER_MEDIA_TYPE)===-1?cF:A.PARSER_MEDIA_TYPE,lt=ma==="application/xhtml+xml"?Bu:Hs,F=rt(A,"ALLOWED_TAGS")&&Pt(A.ALLOWED_TAGS)?Ae({},A.ALLOWED_TAGS,lt):de,q=rt(A,"ALLOWED_ATTR")&&Pt(A.ALLOWED_ATTR)?Ae({},A.ALLOWED_ATTR,lt):ke,ad=rt(A,"ALLOWED_NAMESPACES")&&Pt(A.ALLOWED_NAMESPACES)?Ae({},A.ALLOWED_NAMESPACES,Bu):oF,pa=rt(A,"ADD_URI_SAFE_ATTR")&&Pt(A.ADD_URI_SAFE_ATTR)?Ae(Tt(id),A.ADD_URI_SAFE_ATTR,lt):id,as=rt(A,"ADD_DATA_URI_TAGS")&&Pt(A.ADD_DATA_URI_TAGS)?Ae(Tt(os),A.ADD_DATA_URI_TAGS,lt):os,St=rt(A,"FORBID_CONTENTS")&&Pt(A.FORBID_CONTENTS)?Ae({},A.FORBID_CONTENTS,lt):Vn,w=rt(A,"FORBID_TAGS")&&Pt(A.FORBID_TAGS)?Ae({},A.FORBID_TAGS,lt):Tt({}),ge=rt(A,"FORBID_ATTR")&&Pt(A.FORBID_ATTR)?Ae({},A.FORBID_ATTR,lt):Tt({}),en=rt(A,"USE_PROFILES")?A.USE_PROFILES&&typeof A.USE_PROFILES=="object"?Tt(A.USE_PROFILES):A.USE_PROFILES:!1,je=A.ALLOW_ARIA_ATTR!==!1,Ge=A.ALLOW_DATA_ATTR!==!1,Ze=A.ALLOW_UNKNOWN_PROTOCOLS||!1,kt=A.ALLOW_SELF_CLOSE_IN_ATTR!==!1,st=A.SAFE_FOR_TEMPLATES||!1,tr=A.SAFE_FOR_XML!==!1,At=A.WHOLE_DOCUMENT||!1,Wt=A.RETURN_DOM||!1,mr=A.RETURN_DOM_FRAGMENT||!1,Ir=A.RETURN_TRUSTED_TYPE||!1,rr=A.FORCE_BODY||!1,Pr=A.SANITIZE_DOM!==!1,yn=A.SANITIZE_NAMED_PROPS||!1,vr=A.KEEP_CONTENT!==!1,Xr=A.IN_PLACE||!1,ue=CT(A.ALLOWED_URI_REGEXP)?A.ALLOWED_URI_REGEXP:hm,Bn=typeof A.NAMESPACE=="string"?A.NAMESPACE:gr,od=rt(A,"MATHML_TEXT_INTEGRATION_POINTS")&&A.MATHML_TEXT_INTEGRATION_POINTS&&typeof A.MATHML_TEXT_INTEGRATION_POINTS=="object"?Tt(A.MATHML_TEXT_INTEGRATION_POINTS):Ae({},["mi","mo","mn","ms","mtext"]),ld=rt(A,"HTML_INTEGRATION_POINTS")&&A.HTML_INTEGRATION_POINTS&&typeof A.HTML_INTEGRATION_POINTS=="object"?Tt(A.HTML_INTEGRATION_POINTS):Ae({},["annotation-xml"]);const Z=rt(A,"CUSTOM_ELEMENT_HANDLING")&&A.CUSTOM_ELEMENT_HANDLING&&typeof A.CUSTOM_ELEMENT_HANDLING=="object"?Tt(A.CUSTOM_ELEMENT_HANDLING):Vi(null);if(K=Vi(null),rt(Z,"tagNameCheck")&&ty(Z.tagNameCheck)&&(K.tagNameCheck=Z.tagNameCheck),rt(Z,"attributeNameCheck")&&ty(Z.attributeNameCheck)&&(K.attributeNameCheck=Z.attributeNameCheck),rt(Z,"allowCustomizedBuiltInElements")&&typeof Z.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=Z.allowCustomizedBuiltInElements),st&&(Ge=!1),mr&&(Wt=!0),en&&(F=Ae({},cm),q=Vi(null),en.html===!0&&(Ae(F,um),Ae(q,dm)),en.svg===!0&&(Ae(F,ju),Ae(q,Hu),Ae(q,yo)),en.svgFilters===!0&&(Ae(F,Zu),Ae(q,Hu),Ae(q,yo)),en.mathMl===!0&&(Ae(F,Wu),Ae(q,fm),Ae(q,yo))),Se.tagCheck=null,Se.attributeCheck=null,rt(A,"ADD_TAGS")&&(typeof A.ADD_TAGS=="function"?Se.tagCheck=A.ADD_TAGS:Pt(A.ADD_TAGS)&&(F===de&&(F=Tt(F)),Ae(F,A.ADD_TAGS,lt))),rt(A,"ADD_ATTR")&&(typeof A.ADD_ATTR=="function"?Se.attributeCheck=A.ADD_ATTR:Pt(A.ADD_ATTR)&&(q===ke&&(q=Tt(q)),Ae(q,A.ADD_ATTR,lt))),rt(A,"ADD_URI_SAFE_ATTR")&&Pt(A.ADD_URI_SAFE_ATTR)&&Ae(pa,A.ADD_URI_SAFE_ATTR,lt),rt(A,"FORBID_CONTENTS")&&Pt(A.FORBID_CONTENTS)&&(St===Vn&&(St=Tt(St)),Ae(St,A.FORBID_CONTENTS,lt)),rt(A,"ADD_FORBID_CONTENTS")&&Pt(A.ADD_FORBID_CONTENTS)&&(St===Vn&&(St=Tt(St)),Ae(St,A.ADD_FORBID_CONTENTS,lt)),vr&&(F["#text"]=!0),At&&Ae(F,["html","head","body"]),F.table&&(Ae(F,["tbody"]),delete w.tbody),A.TRUSTED_TYPES_POLICY){if(typeof A.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ks('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof A.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ks('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=A.TRUSTED_TYPES_POLICY,O=S.createHTML("")}else S===void 0&&(S=UT(f,i)),S!==null&&typeof O=="string"&&(O=S.createHTML(""));(oe.uponSanitizeElement.length>0||oe.uponSanitizeAttribute.length>0)&&F===de&&(F=Tt(F)),oe.uponSanitizeAttribute.length>0&&q===ke&&(q=Tt(q)),It&&It(A),us=A},ry=Ae({},[...ju,...Zu,...OT]),ny=Ae({},[...Wu,...DT]),fF=function(A){let Z=v(A);(!Z||!Z.tagName)&&(Z={namespaceURI:Bn,tagName:"template"});const pe=Hs(A.tagName),De=Hs(Z.tagName);return ad[A.namespaceURI]?A.namespaceURI===ls?Z.namespaceURI===gr?pe==="svg":Z.namespaceURI===bi?pe==="svg"&&(De==="annotation-xml"||od[De]):!!ry[pe]:A.namespaceURI===bi?Z.namespaceURI===gr?pe==="math":Z.namespaceURI===ls?pe==="math"&&ld[De]:!!ny[pe]:A.namespaceURI===gr?Z.namespaceURI===ls&&!ld[De]||Z.namespaceURI===bi&&!od[De]?!1:!ny[pe]&&(lF[pe]||!ry[pe]):!!(ma==="application/xhtml+xml"&&ad[A.namespaceURI]):!1},Mr=function(A){ji(t.removed,{element:A});try{v(A).removeChild(A)}catch{h(A)}},_i=function(A,Z){try{ji(t.removed,{attribute:Z.getAttributeNode(A),from:Z})}catch{ji(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute(A),A==="is")if(Wt||mr)try{Mr(Z)}catch{}else try{Z.setAttribute(A,"")}catch{}},iy=function(A){let Z=null,pe=null;if(rr)A="<remove></remove>"+A;else{const tt=sm(A,/^[\r\n\t ]+/);pe=tt&&tt[0]}ma==="application/xhtml+xml"&&Bn===gr&&(A='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+A+"</body></html>");const De=S?S.createHTML(A):A;if(Bn===gr)try{Z=new c().parseFromString(De,ma)}catch{}if(!Z||!Z.documentElement){Z=R.createDocument(Bn,"template",null);try{Z.documentElement.innerHTML=sd?O:De}catch{}}const Re=Z.body||Z.documentElement;return A&&pe&&Re.insertBefore(r.createTextNode(pe),Re.childNodes[0]||null),Bn===gr?B.call(Z,At?"html":"body")[0]:At?Z.documentElement:Re},sy=function(A){return j.call(A.ownerDocument||A,A,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ay=function(A){A.normalize();const Z=j.call(A.ownerDocument||A,A,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let pe=Z.nextNode();for(;pe;){let De=pe.data;Bi([he,J,ae],Re=>{De=Zi(De,Re," ")}),pe.data=De,pe=Z.nextNode()}},tl=function(A){const Z=T?T(A):null;return typeof Z!="string"||lt(Z)!=="form"?!1:typeof A.nodeName!="string"||typeof A.textContent!="string"||typeof A.removeChild!="function"||A.attributes!==x(A)||typeof A.removeAttribute!="function"||typeof A.setAttribute!="function"||typeof A.namespaceURI!="string"||typeof A.insertBefore!="function"||typeof A.hasChildNodes!="function"||A.nodeType!==k(A)||A.childNodes!==m(A)},va=function(A){if(!k||typeof A!="object"||A===null)return!1;try{return k(A)===Kr.documentFragment}catch{return!1}},rl=function(A){if(!k||typeof A!="object"||A===null)return!1;try{return typeof k(A)=="number"}catch{return!1}};function bn(ye,A,Z){Bi(ye,pe=>{pe.call(t,A,Z,us)})}const oy=function(A){let Z=null;if(bn(oe.beforeSanitizeElements,A,null),tl(A))return Mr(A),!0;const pe=lt(A.nodeName);if(bn(oe.uponSanitizeElement,A,{tagName:pe,allowedTags:F}),tr&&A.hasChildNodes()&&!rl(A.firstElementChild)&&wt(/<[/\w!]/g,A.innerHTML)&&wt(/<[/\w!]/g,A.textContent)||tr&&A.namespaceURI===gr&&pe==="style"&&rl(A.firstElementChild)||A.nodeType===Kr.progressingInstruction||tr&&A.nodeType===Kr.comment&&wt(/<[/\w]/g,A.data))return Mr(A),!0;if(w[pe]||!(Se.tagCheck instanceof Function&&Se.tagCheck(pe))&&!F[pe]){if(!w[pe]&&uy(pe)&&(K.tagNameCheck instanceof RegExp&&wt(K.tagNameCheck,pe)||K.tagNameCheck instanceof Function&&K.tagNameCheck(pe)))return!1;if(vr&&!St[pe]){const De=v(A),Re=m(A);if(Re&&De){const tt=Re.length;for(let Ht=tt-1;Ht>=0;--Ht){const jn=p(Re[Ht],!0);De.insertBefore(jn,g(A))}}}return Mr(A),!0}return(k?k(A):A.nodeType)===Kr.element&&!fF(A)||(pe==="noscript"||pe==="noembed"||pe==="noframes")&&wt(/<\/no(script|embed|frames)/i,A.innerHTML)?(Mr(A),!0):(st&&A.nodeType===Kr.text&&(Z=A.textContent,Bi([he,J,ae],De=>{Z=Zi(Z,De," ")}),A.textContent!==Z&&(ji(t.removed,{element:A.cloneNode()}),A.textContent=Z)),bn(oe.afterSanitizeElements,A,null),!1)},ly=function(A,Z,pe){if(ge[Z]||Pr&&(Z==="id"||Z==="name")&&(pe in r||pe in dF))return!1;const De=q[Z]||Se.attributeCheck instanceof Function&&Se.attributeCheck(Z,A);if(!(Ge&&!ge[Z]&&wt(te,Z))){if(!(je&&wt(ce,Z))){if(!De||ge[Z]){if(!(uy(A)&&(K.tagNameCheck instanceof RegExp&&wt(K.tagNameCheck,A)||K.tagNameCheck instanceof Function&&K.tagNameCheck(A))&&(K.attributeNameCheck instanceof RegExp&&wt(K.attributeNameCheck,Z)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(Z,A))||Z==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&wt(K.tagNameCheck,pe)||K.tagNameCheck instanceof Function&&K.tagNameCheck(pe))))return!1}else if(!pa[Z]){if(!wt(ue,Zi(pe,G,""))){if(!((Z==="src"||Z==="xlink:href"||Z==="href")&&A!=="script"&&am(pe,"data:")===0&&as[A])){if(!(Ze&&!wt(fe,Zi(pe,G,"")))){if(pe)return!1}}}}}}return!0},hF=Ae({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),uy=function(A){return!hF[Hs(A)]&&wt(X,A)},cy=function(A){bn(oe.beforeSanitizeAttributes,A,null);const Z=A.attributes;if(!Z||tl(A))return;const pe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q,forceKeepAttr:void 0};let De=Z.length;for(;De--;){const Re=Z[De],tt=Re.name,Ht=Re.namespaceURI,jn=Re.value,_n=lt(tt),cd=jn;let yt=tt==="value"?cd:kT(cd);if(pe.attrName=_n,pe.attrValue=yt,pe.keepAttr=!0,pe.forceKeepAttr=void 0,bn(oe.uponSanitizeAttribute,A,pe),yt=pe.attrValue,yn&&(_n==="id"||_n==="name")&&am(yt,$r)!==0&&(_i(tt,A),yt=$r+yt),tr&&wt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,yt)){_i(tt,A);continue}if(_n==="attributename"&&sm(yt,"href")){_i(tt,A);continue}if(pe.forceKeepAttr)continue;if(!pe.keepAttr){_i(tt,A);continue}if(!kt&&wt(/\/>/i,yt)){_i(tt,A);continue}st&&Bi([he,J,ae],fy=>{yt=Zi(yt,fy," ")});const dy=lt(A.nodeName);if(!ly(dy,_n,yt)){_i(tt,A);continue}if(S&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Ht)switch(f.getAttributeType(dy,_n)){case"TrustedHTML":yt=S.createHTML(yt);break;case"TrustedScriptURL":yt=S.createScriptURL(yt);break}if(yt!==cd)try{Ht?A.setAttributeNS(Ht,tt,yt):A.setAttribute(tt,yt),tl(A)?Mr(A):im(t.removed)}catch{_i(tt,A)}}bn(oe.afterSanitizeAttributes,A,null)},nl=function(A){let Z=null;const pe=sy(A);for(bn(oe.beforeSanitizeShadowDOM,A,null);Z=pe.nextNode();)if(bn(oe.uponSanitizeShadowNode,Z,null),oy(Z),cy(Z),va(Z.content)&&nl(Z.content),(k?k(Z):Z.nodeType)===Kr.element){const De=y?y(Z):Z.shadowRoot;va(De)&&(cs(De),nl(De))}bn(oe.afterSanitizeShadowDOM,A,null)},cs=function(A){const Z=k?k(A):A.nodeType;if(Z===Kr.element){const Re=y?y(A):A.shadowRoot;va(Re)&&(cs(Re),nl(Re))}const pe=m?m(A):A.childNodes;if(!pe)return;const De=[];Bi(pe,Re=>{ji(De,Re)});for(const Re of De)cs(Re);if(Z===Kr.element){const Re=T?T(A):null;if(typeof Re=="string"&&lt(Re)==="template"){const tt=A.content;va(tt)&&cs(tt)}}};return t.sanitize=function(ye){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=null,pe=null,De=null,Re=null;if(sd=!ye,sd&&(ye="<!-->"),typeof ye!="string"&&!rl(ye)&&(ye=AT(ye),typeof ye!="string"))throw Ks("dirty is not a string, aborting");if(!t.isSupported)return ye;if(Ft||ud(A),t.removed=[],typeof ye=="string"&&(Xr=!1),Xr){const jn=T?T(ye):ye.nodeName;if(typeof jn=="string"){const _n=lt(jn);if(!F[_n]||w[_n])throw Ks("root node is forbidden and cannot be sanitized in-place")}if(tl(ye))throw Ks("root node is clobbered and cannot be sanitized in-place");cs(ye)}else if(rl(ye))Z=iy("<!---->"),pe=Z.ownerDocument.importNode(ye,!0),pe.nodeType===Kr.element&&pe.nodeName==="BODY"||pe.nodeName==="HTML"?Z=pe:Z.appendChild(pe),cs(pe);else{if(!Wt&&!st&&!At&&ye.indexOf("<")===-1)return S&&Ir?S.createHTML(ye):ye;if(Z=iy(ye),!Z)return Wt?null:Ir?O:""}Z&&rr&&Mr(Z.firstChild);const tt=sy(Xr?ye:Z);for(;De=tt.nextNode();)oy(De),cy(De),va(De.content)&&nl(De.content);if(Xr)return st&&ay(ye),ye;if(Wt){if(st&&ay(Z),mr)for(Re=N.call(Z.ownerDocument);Z.firstChild;)Re.appendChild(Z.firstChild);else Re=Z;return(q.shadowroot||q.shadowrootmode)&&(Re=U.call(n,Re,!0)),Re}let Ht=At?Z.outerHTML:Z.innerHTML;return At&&F["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&wt(LT,Z.ownerDocument.doctype.name)&&(Ht="<!DOCTYPE "+Z.ownerDocument.doctype.name+`>
77
- `+Ht),st&&Bi([he,J,ae],jn=>{Ht=Zi(Ht,jn," ")}),S&&Ir?S.createHTML(Ht):Ht},t.setConfig=function(){ud(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),Ft=!0},t.clearConfig=function(){us=null,Ft=!1},t.isValidAttribute=function(ye,A,Z){return us||ud({}),ly(lt(ye),lt(A),Z)},t.addHook=function(ye,A){typeof A=="function"&&ji(oe[ye],A)},t.removeHook=function(ye,A){if(A!==void 0){const Z=_T(oe[ye],A);return Z===-1?void 0:wT(oe[ye],Z,1)[0]}return im(oe[ye])},t.removeHooks=function(ye){oe[ye]=[]},t.removeAllHooks=function(){oe=pm()},t}var vm=mm(),VT=V('<span class="go-sub-ticket-description"></span>'),BT=V('<span class="go-sub-ticket-quantity"> </span>'),jT=V('<li><span class="go-sub-ticket-title"> </span> <!> <!></li>');function Gu(e,t){re(t,!0);let r=_(t,"sub",7),n=_(t,"quantity",7),i=_(t,"max",23,()=>r().max_persons),s=_(t,"onChange",7),a=_(t,"preview",7,!1);const o=D(()=>r().min_persons===r().max_persons);var l={get sub(){return r()},set sub(y){r(y),b()},get quantity(){return n()},set quantity(y){n(y),b()},get max(){return i()},set max(y=r.max_persons){i(y),b()},get onChange(){return s()},set onChange(y){s(y),b()},get preview(){return a()},set preview(y=!1){a(y),b()}},c=jT(),f=$(c),u=$(f,!0);I(f);var p=W(f,2),h=y=>{var x=VT();Af(x,()=>vm.sanitize(r().description),!0),I(x),E(y,x)};le(p,y=>{r().description&&y(h)});var g=W(p,2),m=y=>{var x=BT(),k=$(x,!0);I(x),Q(()=>{me(x,"data-testid",`sub-ticket-${r().id??""}-quantity`),Y(k,n())}),E(y,x)},v=y=>{{let x=D(()=>r().title||C.t("cart.content.table.edit"));go(y,{get value(){return n()},get min(){return r().min_persons},get max(){return i()},get label(){return d(x)},deselectable:!1,get onChange(){return s()}})}};return le(g,y=>{a()||d(o)?y(m):y(v,-1)}),I(c),Q(()=>{Et(c,1,cr(["go-sub-ticket",d(o)&&"is-fixed",a()&&"is-preview",n()===0&&"is-empty"])),me(c,"data-testid",`sub-ticket-${r().id??""}`),Y(u,r().title)}),E(e,c),ne(l)}ie(Gu,{sub:{},quantity:{},max:{},onChange:{},preview:{}},[],[],{mode:"open"});function gm(e){const{product:t}=e;return Ws(t)?[t.event_title,e.time&&$n(e.time),t.title].filter(Boolean).join(" - "):t.title}var ZT=V('<s class="go-cart-item-price-original"> </s> <span class="go-cart-item-price-discounted"> </span>',1),WT=V('<span class="go-cart-item-price-discounted"> </span>'),HT=V('<span data-testid="cart-item-participant-count"> </span>'),GT=V('<span data-testid="cart-item-voucher-quantity"> </span>'),KT=V("<span> </span>"),YT=V('<li class="go-cart-item-remove"><button class="go-cart-remove">⨉</button></li>'),JT=V('<ul class="go-sub-tickets" role="list"></ul>'),QT=V('<article class="go-cart-item-content"><ul><li class="go-cart-item-title-container"><!></li> <li class="go-cart-item-price"><!></li> <li class="go-cart-item-count"><!></li> <!> <li class="go-cart-item-sum"> </li></ul></article> <!>',1);function ym(e,t){re(t,!0);let r=_(t,"displayItem",7),n=_(t,"displayCart",7),i=_(t,"preview",7),s=se(void 0),a=se(Pe({}));const o=D(()=>C.cart?.items.find(y=>y.uuid===(r().display?.reference_uuid??r().uuid))),l=D(()=>Br(r().product)?r().product:null),c=Ni();ve(()=>{C.cart?.items.map(y=>y.quantity),C.cart?.items.forEach(y=>y.mantle&&Object.values(y.mantle.composition)),Ne(()=>{M(s,C.capacityManager.capacity(n(),r(),c),!0),M(a,d(o)?C.capacityManager.subTicketMaxes(C.cart,d(o),c):{},!0)})});function f(y){if(!d(o)){console.error("(CartItem) Could not find main item for line",r());return}d(o).quantity=Math.max(0,d(o).quantity-r().quantity+y)}function u(){if(!d(o)){console.error("(CartItem) Could not find main item for line",r());return}const y=Math.max(0,d(o).quantity-r().quantity);y===0?C.cart?.deleteItem(d(o)):d(o).quantity=y}function p(y,x){if(!d(o)){console.error("(CartItem) Could not find main item for line",r());return}d(o).mantle&&(d(o).mantle.composition[y]=x)}var h={get displayItem(){return r()},set displayItem(y){r(y),b()},get displayCart(){return n()},set displayCart(y){n(y),b()},get preview(){return i()},set preview(y){i(y),b()}},g=ee(),m=z(g),v=y=>{var x=QT(),k=z(x),T=$(k),S=$(T),O=$(S),P=K=>{Gp(K,{get cartItem(){return r()}})},R=K=>{Hp(K,{get cartItem(){return r()}})},j=K=>{Wp(K,{get cartItem(){return r()}})},N=K=>{Kp(K,{get cartItem(){return r()}})};le(O,K=>{r().product.type==="Ticket"?K(P):r().product.type==="Event"?K(R,1):r().product.type==="Coupon"?K(j,2):r().product.type==="Tour"&&K(N,3)}),I(S);var B=W(S,2),U=$(B),oe=K=>{var w=ZT(),ge=z(w),Se=$(ge,!0);I(ge);var je=W(ge,2),Ge=$(je,!0);I(je),Q((Ze,kt)=>{Y(Se,Ze),Y(Ge,kt)},[()=>fr(r().display.originalPrice),()=>fr(r().final_price_cents)]),E(K,w)},he=K=>{var w=WT(),ge=$(w,!0);I(w),Q(Se=>Y(ge,Se),[()=>fr(r().final_price_cents)]),E(K,w)};le(U,K=>{r().display?.discounted?K(oe):K(he,-1)}),I(B);var J=W(B,2),ae=$(J),te=K=>{var w=HT(),ge=$(w,!0);I(w),Q(()=>Y(ge,r().product.participants)),E(K,w)},ce=K=>{var w=GT(),ge=$(w,!0);I(w),Q(()=>Y(ge,r().quantity)),E(K,w)},fe=K=>{var w=KT(),ge=$(w,!0);I(w),Q(()=>Y(ge,r().quantity)),E(K,w)},G=K=>{{let w=D(()=>r().quantity??0),ge=D(()=>gm(r()));go(K,{get value(){return d(w)},get min(){return d(s).min},get max(){return d(s).max},get label(){return d(ge)},floor:1,onChange:f})}};le(ae,K=>{r().product.type==="Tour"?K(te):r().voucher?.code?K(ce,1):i()?K(fe,2):K(G,-1)}),I(J);var X=W(J,2),ue=K=>{var w=YT(),ge=$(w);I(w),Q(Se=>me(ge,"aria-label",Se),[()=>C.t("cart.item.remove")]),pt("click",ge,u),E(K,w)};le(X,K=>{i()||K(ue)});var F=W(X,2),de=$(F,!0);I(F),I(T),I(k);var q=W(k,2),ke=K=>{var w=JT();Fe(w,21,()=>Zs(d(l)),ge=>ge.id,(ge,Se)=>{{let je=D(()=>r().mantle?.composition?.[d(Se).id]??0);Gu(ge,{get sub(){return d(Se)},get preview(){return i()},get quantity(){return d(je)},get max(){return d(a)[d(Se).id]},onChange:Ge=>p(d(Se).id,Ge)})}}),I(w),Q(()=>me(w,"aria-label",d(l).title)),E(K,w)};le(q,K=>{d(l)&&K(ke)}),Q(K=>Y(de,K),[()=>fr(r().total_price_cents)]),E(y,x)};return le(m,y=>{d(s)&&y(v)}),E(e,g),ne(h)}ur(["click"]),ie(ym,{displayItem:{},displayCart:{},preview:{}},[],[],{mode:"open"});var XT=V('<li class="go-cart-header-remove"></li>'),eA=V('<li class="go-cart-item"><!></li>'),tA=V('<ol data-testid="cart-items"><li class="go-cart-header"><ul><li class="go-cart-header-title"> </li> <li class="go-cart-header-price"> </li> <li class="go-cart-header-count"> </li> <!> <li class="go-cart-header-sum"> </li></ul></li> <!></ol>');function rA(e,t){re(t,!0);const r=Ui(t.$$host),n=D(()=>r.value);var i=ee(),s=z(i),a=o=>{var l=tA(),c=$(l),f=$(c),u=$(f),p=$(u,!0);I(u);var h=W(u,2),g=$(h,!0);I(h);var m=W(h,2),v=$(m,!0);I(m);var y=W(m,2),x=O=>{var P=XT();E(O,P)};le(y,O=>{d(n).preview||O(x)});var k=W(y,2),T=$(k,!0);I(k),I(f),I(c);var S=W(c,2);Fe(S,17,()=>d(n).displayCart.items,O=>O.uuid,(O,P)=>{var R=eA();ym($(R),{get displayItem(){return d(P)},get displayCart(){return d(n).displayCart},get preview(){return d(n).preview}}),I(R),E(O,R)}),I(l),Q((O,P,R,j)=>{Y(p,O),Y(g,P),Y(v,R),Y(T,j)},[()=>C.t("cart.content.table.desc"),()=>C.t("cart.content.table.price"),()=>C.t("cart.content.table.quantity"),()=>C.t("cart.content.table.total")]),E(o,l)};le(s,o=>{d(n)&&d(n).displayCart&&d(n).displayCart.items.length&&o(a)}),E(e,i),ne()}customElements.define("go-cart-items",ie(rA,{},[],[]));var nA=V('<li class="go-cart-coupon-remove-cell"><button class="go-cart-remove go-cart-coupon-remove">⨉</button></li>'),iA=V('<li><article class="go-cart-coupon-content"><ul><li class="go-cart-coupon-code"> </li> <!></ul></article></li>'),sA=V('<ol data-testid="cart-coupons"></ol>');function aA(e,t){re(t,!0);const r=Ui(t.$$host),n=D(()=>r.value);var i=ee(),s=z(i),a=o=>{var l=sA();Fe(l,21,()=>d(n).displayCart.coupons,c=>c.code,(c,f)=>{var u=iA();let p;var h=$(u),g=$(h),m=$(g),v=$(m,!0);I(m);var y=W(m,2),x=k=>{var T=nA(),S=$(T);I(T),Q(O=>me(S,"aria-label",O),[()=>C.t("cart.coupons.remove")]),pt("click",S,()=>C.cart?.removeCoupon(d(f).code)),E(k,T)};le(y,k=>{d(n).preview||k(x)}),I(g),I(h),I(u),Q(()=>{p=Et(u,1,"go-cart-coupon",null,p,{"go-cart-coupon-inactive":!d(f).applied}),Y(v,d(f).code)}),E(c,u)}),I(l),E(o,l)};le(s,o=>{d(n)&&d(n).displayCart&&d(n).displayCart.coupons.length>0&&o(a)}),E(e,i),ne()}ur(["click"]),customElements.define("go-cart-coupons",ie(aA,{},[],[]));var oA=V('<span class="go-cart-total-amount" data-testid="cart-total-amount"> </span>');function lA(e,t){re(t,!0);const r=Ui(t.$$host),n=D(()=>r.value);var i=ee(),s=z(i),a=o=>{var l=oA(),c=$(l,!0);I(l),Q(f=>Y(c,f),[()=>fr(d(n).totalPriceCents)]),E(o,l)};le(s,o=>{d(n)&&d(n).displayCart&&d(n).displayCart.items.length&&o(a)}),E(e,i),ne()}customElements.define("go-cart-total-amount",ie(lA,{},[],[]));function uA(e,t){re(t,!0);const r=_(t,"preview",7,!1),n=new Hx;Gx(t.$$host,n),ve(()=>{n.preview=r()}),ve(()=>{C.cart&&(C.cart.items.map(s=>s.uuid+":"+s.quantity+":"+s.time),C.cart.coupons.map(s=>s.code).join("|"),C.cart.items.forEach(s=>s.mantle&&Object.values(s.mantle.composition)),Ne(()=>n.calculateDisplayCart()))});async function i(){const s=t.$$host.querySelectorAll("go-coupon-redemption");let a=!0;for(const o of s){const l=await o.flush?.();l&&!l.success&&(a=!1)}return a}return t.$$host.addEventListener("click",async s=>{const a=s.target.closest("go-submit");if(!a)return;const o=a.closest("go-form");if(o&&t.$$host.contains(o))return;const l=await i();l&&t.$$host.dispatchEvent(new CustomEvent("go-submit",{detail:{ok:l},bubbles:!0,composed:!0}))}),ne({get preview(){return r()},set preview(s=!1){r(s),b()}})}customElements.define("go-cart",ie(uA,{preview:{attribute:"preview",reflect:!0,type:"Boolean"}},[],[]));var cA=V('<span class="go-cart-subtotal-amount" data-testid="cart-subtotal-amount"> </span>');function dA(e,t){re(t,!0);const r=Ui(t.$$host),n=D(()=>r.value);var i=ee(),s=z(i),a=o=>{var l=cA(),c=$(l,!0);I(l),Q(f=>Y(c,f),[()=>fr(d(n).subtotalPriceCents)]),E(o,l)};le(s,o=>{d(n)&&C.cart?.items.length&&o(a)}),E(e,i),ne()}customElements.define("go-cart-subtotal-amount",ie(dA,{},[],[]));var fA=V('<span class="go-cart-discounted-amount" data-testid="cart-discounted-amount"><span class="go-cart-discounted-amount-sign">−</span> </span>');function hA(e,t){re(t,!0);const r=Ui(t.$$host),n=D(()=>r.value);var i=ee(),s=z(i),a=o=>{var l=fA(),c=W($(l),1,!0);I(l),Q(f=>Y(c,f),[()=>fr(d(n).discountedAmountCents)]),E(o,l)};le(s,o=>{d(n)&&d(n).discountedAmountCents>0&&o(a)}),E(e,i),ne()}customElements.define("go-cart-discounted-amount",ie(hA,{},[],[]));function pA(e,t){re(t,!0),Hr(t.$$host,"go-if",{when:"data.cart.items.length === 0"}),ne()}customElements.define("go-cart-empty",ie(pA,{},[],[]));function mA(e,t){re(t,!0);let r=D(()=>C.cart?.items.length);Ct();var n=qt();Q(()=>Y(n,d(r))),E(e,n),ne()}customElements.define("go-cart-counter",ie(mA,{},[],[]));async function bm(e,t){const r=C.cart;if(!r)return;const n=e.details.fieldValue("paymentMode");r.paymentModeId=n==null?void 0:String(n);const i=await C.checkout(r.orderData());if(i.error){e.details.apiErrors=i.error;return}const s=Qe.config.forms[t]?.beforeSubmit;s&&await s(e.details.formData);const a=i.data.meta.payment_url;Qe.config.navigateTo?.(a)}function _m(e,t){Bt.defineForm({id:"checkoutGuest",submitLabel:"cart.detail.actions.checkout",fields:[{key:"firstName",required:!0},{key:"lastName",required:!0},{key:"email",required:!0},{key:"confirmEmail",required:!0},{key:"acceptTerms",required:!0},{key:"paymentMode",required:!0}]}),Hr(e,"go-form",{"form-id":"checkoutGuest",custom:t}),e.addEventListener("submit",async r=>{const n=r.target;if(!C.cart)return;const i=await C.signUp(n.details.formData,!0);if(i.error){n.details.apiErrors=i.error.errors;return}await bm(n,"checkoutGuest")})}function vA(e,t){Bt.defineForm({id:"checkoutUser",submitLabel:"cart.detail.actions.checkout",fields:[{key:"acceptTerms",required:!0},{key:"paymentMode",required:!0}]}),Hr(e,"go-form",{"form-id":"checkoutUser",custom:t}),e.addEventListener("submit",async r=>{const n=r.target;await bm(n,"checkoutUser")})}function gA(e,t){re(t,!0);let r=_(t,"custom",7,!1);return _m(t.$$host,r()),ne({get custom(){return r()},set custom(n=!1){r(n),b()}})}customElements.define("go-checkout-form",ie(gA,{custom:{}},[],[]));function yA(e,t){re(t,!0);let r=_(t,"custom",7,!1);return _m(t.$$host,r()),ne({get custom(){return r()},set custom(n=!1){r(n),b()}})}customElements.define("go-checkout-guest",ie(yA,{custom:{}},[],[]));function bA(e,t){re(t,!0);let r=_(t,"custom",7,!1);return vA(t.$$host,r()),ne({get custom(){return r()},set custom(n=!1){r(n),b()}})}customElements.define("go-checkout-user",ie(bA,{custom:{}},[],[]));var _A="TokenActions::ApplyOrderDiscount";async function wA(e){if(!C.cart)throw new Error("(go-coupon-redemption): cart not found");const t=C.cart,r=await C.asyncFetch(()=>C.getCouponSaleByBarcode(e));return r?.is_valid?r.value_action===_A?(t.addCoupon({code:e,kind:"actionToken"}),{success:!0}):r.is_voucher_for?SA(e,r):r.value_cents&&r.value_cents>0?kA(e,r.value_cents):Ku([C.t("cart.coupon.form.errors.notValid")]):Ku([C.t("cart.coupon.form.errors.notValid")])}function kA(e,t){return C.cart.addCoupon({code:e,kind:"valueVoucher",valueCents:t}),{success:!0}}async function SA(e,t){const r=e.toUpperCase();if(C.cart.coupons.some(a=>a.code===r))return{success:!0};const n=await C.asyncFetch(()=>C.tickets({"by_ticket_ids[]":[t.is_voucher_for]})),i=Array.isArray(n)?n.find(a=>a.id===t.is_voucher_for):void 0;if(!i)return Ku([C.t("cart.coupon.form.errors.error")]);const s={...i,price_cents:0};return C.cart.addItem(ot(uo(s),{quantity:1,voucher:{code:r}})),C.cart.addCoupon({code:r,kind:"serviceVoucher"}),{success:!0}}function Ku(e){return{success:!1,errors:e}}var EA=V("<go-form></go-form>",2);function xA(e,t){re(t,!0),Bt.defineForm({id:"couponRedemption",submitLabel:"cart.coupon.form.submit",fields:[{key:"token",required:!0}]});async function r(o){const l=o.details.fields.find(u=>u.key==="token"),c=(o.details.fieldValue("token")??"").trim().toUpperCase();if(!c)return{success:!0};const f=await wA(c);return f.success?(l&&(l.value=""),o.dispatchEvent(new Event("go-success",{bubbles:!0,composed:!0})),f):(o.details.apiErrors=f.errors,f)}async function n(o){await r(o.target)}async function i(){const o=t.$$host.querySelector("go-form");return o?.details?r(o):{success:!0}}var s={flush:i},a=EA();return Jn(a,"formId","couponRedemption"),La("submit",a,n),E(e,a),ne(s)}customElements.define("go-coupon-redemption",ie(xA,{},[],["flush"])),kb();var TA=class{#e=se();get campaign(){return d(this.#e)}set campaign(e){M(this.#e,e,!0)}#t=se();get amount(){return d(this.#t)}set amount(e){M(this.#t,e,!0)}selectCampaign=e=>{this.campaign=e,document.getElementsByClassName("donation-actions")[0]?.scrollIntoView()};addDonationToCart=()=>{if(this.amount===void 0||this.campaign===void 0)return;const e={value:this.amount,campaign_id:this.campaign.id};let t=JSON.parse(localStorage.getItem("201600627v4donations")||"[]");qr(t.filter(r=>r.campaign_id=e.campaign_id),r=>r.value)+e.value>this.campaign.guest_limit&&this.campaign.guest_limit>0&&(!C.currentUser?.isAuthenticated||C.currentUser.isGuest)?this.skipDonation():(t.push(e),localStorage.setItem("201600627v4donations",JSON.stringify(t)),localStorage.setItem("skipDonation","true"),window.history.pushState(null,"",C.urls.cart()),window.location.replace(C.urls.cart()))};skipDonation=()=>{localStorage.setItem("skipDonation","true"),window.history.pushState(null,"",C.urls.cart()),window.location.replace(C.urls.cart())}},$t=new TA,AA=V('<img alt="logo"/>'),CA=V('<div role="button" tabindex="0"><div class="donation-image"><!></div> <div class="donation-info"><p class="donation-info-title"> </p> <p class="donation-info-description"> </p></div></div>');function wm(e,t){re(t,!0);let r=_(t,"campaign",7);const n=D(()=>r().translations);var i={get campaign(){return r()},set campaign(m){r(m),b()}},s=CA();let a;var o=$(s),l=$(o),c=m=>{var v=AA();Q(y=>me(v,"src",y),[()=>r().picture.thumbnail.replace("thumbnail","article_3x2")]),E(m,v)};le(l,m=>{r().picture.thumbnail&&m(c)}),I(o);var f=W(o,2),u=$(f),p=$(u,!0);I(u);var h=W(u,2),g=$(h,!0);return I(h),I(f),I(s),Q(()=>{a=Et(s,1,"go-donation-campaign",null,a,{selected:$t.campaign?.id===r()?.id}),Y(p,d(n)["donations.headline"]),Y(g,d(n)["donations.shop.info"])}),pt("click",s,()=>$t.selectCampaign(r())),pt("keydown",s,m=>{m.key==="Enter"&&$t.selectCampaign(r())}),E(e,s),ne(i)}ur(["click","keydown"]),ie(wm,{campaign:{}},[],[],{mode:"open"});function OA(e,t){return t=="CHF"?new Intl.NumberFormat("de-CH",{style:"currency",currency:t}).format(e):new Intl.NumberFormat("de-DE",{style:"currency",currency:t}).format(e)}function on(e){if(!e)return;const t=e.split(",").map(r=>r.trim()).map(Number).filter(r=>!isNaN(r)&&r>0);return t.length>0?t:void 0}var DA=V("<button> </button>"),IA=V('<form id="donationForm" action="" novalidate=""><div class="donation-custom form-group"><label for="donation-custom-amount"> </label> <input class="form-control" id="donation-custom-amount" type="number" min="1"/></div></form>'),PA=V('<div class="donation-selection"><h3> </h3> <div class="donation-options"></div> <!></div>');function km(e,t){re(t,!0);const r=$t.campaign?.guest_limit/100;let n=se(void 0);function i(p){$t.amount=p,M(n,null)}function s(p){const h=document.getElementById("donationForm");h.checkValidity()?$t.amount=p.target.valueAsNumber*100:($t.amount=void 0,h.reportValidity())}var a=PA(),o=$(a),l=$(o,!0);I(o);var c=W(o,2);Fe(c,20,()=>$t.campaign?.options,p=>p,(p,h)=>{var g=DA();let m;var v=$(g,!0);I(g),Q(y=>{m=Et(g,1,"btn btn-default",null,m,{selected:$t.amount===h}),Y(v,y)},[()=>OA(h/100,C.currency)]),pt("click",g,()=>i(h)),E(p,g)}),I(c);var f=W(c,2),u=p=>{var h=IA(),g=$(h),m=$(g),v=$(m,!0);I(m);var y=W(m,2);Ms(y),I(g),I(h),Q((x,k)=>{Y(v,x),me(y,"max",r),me(y,"placeholder",k),Bl(y,d(n))},[()=>C.t("donations.selection.custom.label"),()=>C.t("donations.selection.custom.input.placeholder")]),pt("input",y,s),E(p,h)};le(f,p=>{$t.campaign?.free_donations&&p(u)}),I(a),Q(p=>Y(l,p),[()=>C.t("donations.selection.title")]),E(e,a),ne()}ur(["click","input"]),ie(km,{},[],[],{mode:"open"});var $A=V('<div class="go-donations-list"><!> <!> <div class="donation-actions"><button class="btn btn-default"> </button> <button class="btn btn-primary"> </button></div></div>');function MA(e,t){re(t,!1),En(()=>{C.donations?.campaigns?.length==1&&$t.selectCampaign(C.donations?.campaigns[0])}),Xl();var r=ee(),n=z(r),i=s=>{var a=$A(),o=$(a);Fe(o,1,()=>C?.donations?.campaigns,m=>m.id,(m,v)=>{wm(m,{get campaign(){return d(v)}})});var l=W(o,2),c=m=>{km(m,{})};le(l,m=>{$t.campaign&&m(c)});var f=W(l,2),u=$(f),p=$(u,!0);I(u);var h=W(u,2),g=$(h,!0);I(h),I(f),I(a),Q((m,v)=>{Y(p,m),h.disabled=!$t.amount,Y(g,v)},[()=>C.t("donations.actions.continueWithoutDonation"),()=>C.t("donations.actions.addToCart")]),pt("click",u,function(...m){$t.skipDonation?.apply(this,m)}),pt("click",h,function(...m){$t.addDonationToCart?.apply(this,m)}),E(s,a)};le(n,s=>{C.donations&&C.donations.campaigns&&s(i)}),E(e,r),ne()}ur(["click"]),customElements.define("go-donations",ie(MA,{},[],[]));function FA(e){return typeof e=="function"}function Ys(e){return e!==null&&typeof e=="object"}var NA=["string","number","bigint","boolean"];function Yu(e){return e==null||NA.includes(typeof e)?!0:Array.isArray(e)?e.every(t=>Yu(t)):typeof e=="object"?Object.getPrototypeOf(e)===Object.prototype:!1}var bo=Symbol("box"),Sm=Symbol("is-writable");function L(e,t){const r=D(e);return t?{[bo]:!0,[Sm]:!0,get current(){return d(r)},set current(n){t(n)}}:{[bo]:!0,get current(){return e()}}}function Em(e){return Ys(e)&&bo in e}function RA(e){return Em(e)?e:FA(e)?L(e):Er(e)}function Er(e){let t=se(Pe(e));return{[bo]:!0,[Sm]:!0,get current(){return d(t)},set current(r){M(t,r,!0)}}}function xm(...e){return function(t){for(const r of e)if(r){if(t.defaultPrevented)return;typeof r=="function"?r.call(this,t):r.current?.call(this,t)}}}var Tm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,LA=/\n/g,zA=/^\s*/,qA=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,UA=/^:\s*/,VA=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,BA=/^[;\s]*/,jA=/^\s+|\s+$/g,ZA=`
77
+ `+Ht),st&&Bi([he,J,ae],jn=>{Ht=Zi(Ht,jn," ")}),S&&Ir?S.createHTML(Ht):Ht},t.setConfig=function(){ud(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),Ft=!0},t.clearConfig=function(){us=null,Ft=!1},t.isValidAttribute=function(ye,A,Z){return us||ud({}),ly(lt(ye),lt(A),Z)},t.addHook=function(ye,A){typeof A=="function"&&ji(oe[ye],A)},t.removeHook=function(ye,A){if(A!==void 0){const Z=_T(oe[ye],A);return Z===-1?void 0:wT(oe[ye],Z,1)[0]}return im(oe[ye])},t.removeHooks=function(ye){oe[ye]=[]},t.removeAllHooks=function(){oe=pm()},t}var vm=mm(),VT=V('<span class="go-sub-ticket-description"></span>'),BT=V('<span class="go-sub-ticket-quantity"> </span>'),jT=V('<li><span class="go-sub-ticket-title"> </span> <!> <!></li>');function Gu(e,t){re(t,!0);let r=_(t,"sub",7),n=_(t,"quantity",7),i=_(t,"max",23,()=>r().max_persons),s=_(t,"onChange",7),a=_(t,"preview",7,!1);const o=D(()=>r().min_persons===r().max_persons);var l={get sub(){return r()},set sub(y){r(y),b()},get quantity(){return n()},set quantity(y){n(y),b()},get max(){return i()},set max(y=r.max_persons){i(y),b()},get onChange(){return s()},set onChange(y){s(y),b()},get preview(){return a()},set preview(y=!1){a(y),b()}},c=jT(),f=$(c),u=$(f,!0);I(f);var p=W(f,2),h=y=>{var x=VT();Af(x,()=>vm.sanitize(r().description),!0),I(x),E(y,x)};le(p,y=>{r().description&&y(h)});var g=W(p,2),m=y=>{var x=BT(),k=$(x,!0);I(x),Q(()=>{me(x,"data-testid",`sub-ticket-${r().id??""}-quantity`),Y(k,n())}),E(y,x)},v=y=>{{let x=D(()=>r().title||C.t("cart.content.table.edit"));go(y,{get value(){return n()},get min(){return r().min_persons},get max(){return i()},get label(){return d(x)},deselectable:!1,get onChange(){return s()}})}};return le(g,y=>{a()||d(o)?y(m):y(v,-1)}),I(c),Q(()=>{Et(c,1,cr(["go-sub-ticket",d(o)&&"is-fixed",a()&&"is-preview",n()===0&&"is-empty"])),me(c,"data-testid",`sub-ticket-${r().id??""}`),Y(u,r().title)}),E(e,c),ne(l)}ie(Gu,{sub:{},quantity:{},max:{},onChange:{},preview:{}},[],[],{mode:"open"});function gm(e){const{product:t}=e;return Ws(t)?[t.event_title,e.time&&$n(e.time),t.title].filter(Boolean).join(" - "):t.title}var ZT=V('<s class="go-cart-item-price-original"> </s> <span class="go-cart-item-price-discounted"> </span>',1),WT=V('<span class="go-cart-item-price-discounted"> </span>'),HT=V('<span data-testid="cart-item-participant-count"> </span>'),GT=V('<span data-testid="cart-item-voucher-quantity"> </span>'),KT=V("<span> </span>"),YT=V('<li class="go-cart-item-remove"><button class="go-cart-remove">⨉</button></li>'),JT=V('<ul class="go-sub-tickets" role="list"></ul>'),QT=V('<article class="go-cart-item-content"><ul><li class="go-cart-item-title-container"><!></li> <li class="go-cart-item-price"><!></li> <li class="go-cart-item-count"><!></li> <!> <li class="go-cart-item-sum"> </li></ul></article> <!>',1);function ym(e,t){re(t,!0);let r=_(t,"displayItem",7),n=_(t,"displayCart",7),i=_(t,"preview",7),s=se(void 0),a=se(Pe({}));const o=D(()=>C.cart?.items.find(y=>y.uuid===(r().display?.reference_uuid??r().uuid))),l=D(()=>Br(r().product)?r().product:null),c=Ni();ve(()=>{C.cart?.items.map(y=>y.quantity),C.cart?.items.forEach(y=>y.mantle&&Object.values(y.mantle.composition)),Ne(()=>{M(s,C.capacityManager.capacity(n(),r(),c),!0),M(a,d(o)?C.capacityManager.subTicketMaxes(C.cart,d(o),c):{},!0)})});function f(y){if(!d(o)){console.error("(CartItem) Could not find main item for line",r());return}d(o).quantity=Math.max(0,d(o).quantity-r().quantity+y)}function u(){if(!d(o)){console.error("(CartItem) Could not find main item for line",r());return}const y=Math.max(0,d(o).quantity-r().quantity);y===0?C.cart?.deleteItem(d(o)):d(o).quantity=y}function p(y,x){if(!d(o)){console.error("(CartItem) Could not find main item for line",r());return}d(o).mantle&&(d(o).mantle.composition[y]=x)}var h={get displayItem(){return r()},set displayItem(y){r(y),b()},get displayCart(){return n()},set displayCart(y){n(y),b()},get preview(){return i()},set preview(y){i(y),b()}},g=ee(),m=z(g),v=y=>{var x=QT(),k=z(x),T=$(k),S=$(T),O=$(S),P=K=>{Gp(K,{get cartItem(){return r()}})},R=K=>{Hp(K,{get cartItem(){return r()}})},j=K=>{Wp(K,{get cartItem(){return r()}})},N=K=>{Kp(K,{get cartItem(){return r()}})};le(O,K=>{r().product.type==="Ticket"?K(P):r().product.type==="Event"?K(R,1):r().product.type==="Coupon"?K(j,2):r().product.type==="Tour"&&K(N,3)}),I(S);var B=W(S,2),U=$(B),oe=K=>{var w=ZT(),ge=z(w),Se=$(ge,!0);I(ge);var je=W(ge,2),Ge=$(je,!0);I(je),Q((Ze,kt)=>{Y(Se,Ze),Y(Ge,kt)},[()=>fr(r().display.originalPrice),()=>fr(r().final_price_cents)]),E(K,w)},he=K=>{var w=WT(),ge=$(w,!0);I(w),Q(Se=>Y(ge,Se),[()=>fr(r().final_price_cents)]),E(K,w)};le(U,K=>{r().display?.discounted?K(oe):K(he,-1)}),I(B);var J=W(B,2),ae=$(J),te=K=>{var w=HT(),ge=$(w,!0);I(w),Q(()=>Y(ge,r().product.participants)),E(K,w)},ce=K=>{var w=GT(),ge=$(w,!0);I(w),Q(()=>Y(ge,r().quantity)),E(K,w)},fe=K=>{var w=KT(),ge=$(w,!0);I(w),Q(()=>Y(ge,r().quantity)),E(K,w)},G=K=>{{let w=D(()=>r().quantity??0),ge=D(()=>gm(r()));go(K,{get value(){return d(w)},get min(){return d(s).min},get max(){return d(s).max},get label(){return d(ge)},floor:1,onChange:f})}};le(ae,K=>{r().product.type==="Tour"?K(te):r().voucher?.code?K(ce,1):i()?K(fe,2):K(G,-1)}),I(J);var X=W(J,2),ue=K=>{var w=YT(),ge=$(w);I(w),Q(Se=>me(ge,"aria-label",Se),[()=>C.t("cart.item.remove")]),pt("click",ge,u),E(K,w)};le(X,K=>{i()||K(ue)});var F=W(X,2),de=$(F,!0);I(F),I(T),I(k);var q=W(k,2),ke=K=>{var w=JT();Fe(w,21,()=>Zs(d(l)),ge=>ge.id,(ge,Se)=>{{let je=D(()=>r().mantle?.composition?.[d(Se).id]??0);Gu(ge,{get sub(){return d(Se)},get preview(){return i()},get quantity(){return d(je)},get max(){return d(a)[d(Se).id]},onChange:Ge=>p(d(Se).id,Ge)})}}),I(w),Q(()=>me(w,"aria-label",d(l).title)),E(K,w)};le(q,K=>{d(l)&&K(ke)}),Q(K=>Y(de,K),[()=>fr(r().total_price_cents)]),E(y,x)};return le(m,y=>{d(s)&&y(v)}),E(e,g),ne(h)}ur(["click"]),ie(ym,{displayItem:{},displayCart:{},preview:{}},[],[],{mode:"open"});var XT=V('<li class="go-cart-header-remove"></li>'),eA=V('<li class="go-cart-item"><!></li>'),tA=V('<ol data-testid="cart-items"><li class="go-cart-header"><ul><li class="go-cart-header-title"> </li> <li class="go-cart-header-price"> </li> <li class="go-cart-header-count"> </li> <!> <li class="go-cart-header-sum"> </li></ul></li> <!></ol>');function rA(e,t){re(t,!0);const r=Ui(t.$$host),n=D(()=>r.value);var i=ee(),s=z(i),a=o=>{var l=tA(),c=$(l),f=$(c),u=$(f),p=$(u,!0);I(u);var h=W(u,2),g=$(h,!0);I(h);var m=W(h,2),v=$(m,!0);I(m);var y=W(m,2),x=O=>{var P=XT();E(O,P)};le(y,O=>{d(n).preview||O(x)});var k=W(y,2),T=$(k,!0);I(k),I(f),I(c);var S=W(c,2);Fe(S,17,()=>d(n).displayCart.items,O=>O.uuid,(O,P)=>{var R=eA();ym($(R),{get displayItem(){return d(P)},get displayCart(){return d(n).displayCart},get preview(){return d(n).preview}}),I(R),E(O,R)}),I(l),Q((O,P,R,j)=>{Y(p,O),Y(g,P),Y(v,R),Y(T,j)},[()=>C.t("cart.content.table.desc"),()=>C.t("cart.content.table.price"),()=>C.t("cart.content.table.quantity"),()=>C.t("cart.content.table.total")]),E(o,l)};le(s,o=>{d(n)&&d(n).displayCart&&d(n).displayCart.items.length&&o(a)}),E(e,i),ne()}customElements.define("go-cart-items",ie(rA,{},[],[]));var nA=V('<li class="go-cart-coupon-remove-cell"><button class="go-cart-remove go-cart-coupon-remove">⨉</button></li>'),iA=V('<li><article class="go-cart-coupon-content"><ul><li class="go-cart-coupon-code"> </li> <!></ul></article></li>'),sA=V('<ol data-testid="cart-coupons"></ol>');function aA(e,t){re(t,!0);const r=Ui(t.$$host),n=D(()=>r.value);var i=ee(),s=z(i),a=o=>{var l=sA();Fe(l,21,()=>d(n).displayCart.coupons,c=>c.code,(c,f)=>{var u=iA();let p;var h=$(u),g=$(h),m=$(g),v=$(m,!0);I(m);var y=W(m,2),x=k=>{var T=nA(),S=$(T);I(T),Q(O=>me(S,"aria-label",O),[()=>C.t("cart.coupons.remove")]),pt("click",S,()=>C.cart?.removeCoupon(d(f).code)),E(k,T)};le(y,k=>{d(n).preview||k(x)}),I(g),I(h),I(u),Q(()=>{p=Et(u,1,"go-cart-coupon",null,p,{"go-cart-coupon-inactive":!d(f).applied}),Y(v,d(f).code)}),E(c,u)}),I(l),E(o,l)};le(s,o=>{d(n)&&d(n).displayCart&&d(n).displayCart.coupons.length>0&&o(a)}),E(e,i),ne()}ur(["click"]),customElements.define("go-cart-coupons",ie(aA,{},[],[]));var oA=V('<span class="go-cart-total-amount" data-testid="cart-total-amount"> </span>');function lA(e,t){re(t,!0);const r=Ui(t.$$host),n=D(()=>r.value);var i=ee(),s=z(i),a=o=>{var l=oA(),c=$(l,!0);I(l),Q(f=>Y(c,f),[()=>fr(d(n).totalPriceCents)]),E(o,l)};le(s,o=>{d(n)&&d(n).displayCart&&d(n).displayCart.items.length&&o(a)}),E(e,i),ne()}customElements.define("go-cart-total-amount",ie(lA,{},[],[]));function uA(e,t){re(t,!0);const r=_(t,"preview",7,!1),n=new Hx;Gx(t.$$host,n),ve(()=>{n.preview=r()}),ve(()=>{C.cart&&(C.cart.items.map(s=>s.uuid+":"+s.quantity+":"+s.time),C.cart.coupons.map(s=>s.code).join("|"),C.cart.items.forEach(s=>s.mantle&&Object.values(s.mantle.composition)),Ne(()=>n.calculateDisplayCart()))});async function i(){const s=t.$$host.querySelectorAll("go-coupon-redemption");let a=!0;for(const o of s){const l=await o.flush?.();l&&!l.success&&(a=!1)}return a}return t.$$host.addEventListener("click",async s=>{const a=s.target.closest("go-submit");if(!a)return;const o=a.closest("go-form");if(o&&t.$$host.contains(o))return;const l=await i();l&&t.$$host.dispatchEvent(new CustomEvent("go-submit",{detail:{ok:l},bubbles:!0,composed:!0}))}),ne({get preview(){return r()},set preview(s=!1){r(s),b()}})}customElements.define("go-cart",ie(uA,{preview:{attribute:"preview",reflect:!0,type:"Boolean"}},[],[]));var cA=V('<span class="go-cart-subtotal-amount" data-testid="cart-subtotal-amount"> </span>');function dA(e,t){re(t,!0);const r=Ui(t.$$host),n=D(()=>r.value);var i=ee(),s=z(i),a=o=>{var l=cA(),c=$(l,!0);I(l),Q(f=>Y(c,f),[()=>fr(d(n).subtotalPriceCents)]),E(o,l)};le(s,o=>{d(n)&&C.cart?.items.length&&o(a)}),E(e,i),ne()}customElements.define("go-cart-subtotal-amount",ie(dA,{},[],[]));var fA=V('<span class="go-cart-discounted-amount" data-testid="cart-discounted-amount"><span class="go-cart-discounted-amount-sign">−</span> </span>');function hA(e,t){re(t,!0);const r=Ui(t.$$host),n=D(()=>r.value);var i=ee(),s=z(i),a=o=>{var l=fA(),c=W($(l),1,!0);I(l),Q(f=>Y(c,f),[()=>fr(d(n).discountedAmountCents)]),E(o,l)};le(s,o=>{d(n)&&d(n).discountedAmountCents>0&&o(a)}),E(e,i),ne()}customElements.define("go-cart-discounted-amount",ie(hA,{},[],[]));function pA(e,t){re(t,!0),Hr(t.$$host,"go-if",{when:"data.cart.items.length === 0"}),ne()}customElements.define("go-cart-empty",ie(pA,{},[],[]));function mA(e,t){re(t,!0);let r=D(()=>C.cart?.items.length);Ct();var n=qt();Q(()=>Y(n,d(r))),E(e,n),ne()}customElements.define("go-cart-counter",ie(mA,{},[],[]));async function bm(e,t){const r=C.cart;if(!r)return;const n=e.details.fieldValue("paymentMode");r.paymentModeId=n==null?void 0:String(n);const i=await C.checkout(r.orderData());if(i.error){e.details.apiErrors=i.error;return}const s=Qe.config.forms[t]?.beforeSubmit;s&&await s(e.details.formData);const a=i.data.meta.payment_url;Qe.config.navigateTo?.(a)}function _m(e,t){Bt.defineForm({id:"checkoutGuest",submitLabel:"cart.detail.actions.checkout",fields:[{key:"firstName",required:!0},{key:"lastName",required:!0},{key:"email",required:!0},{key:"confirmEmail",required:!0},{key:"acceptTerms",required:!0},{key:"paymentMode",required:!0}]}),Hr(e,"go-form",{"form-id":"checkoutGuest",custom:t}),e.addEventListener("submit",async r=>{const n=r.target;if(!C.cart)return;const i=await C.signUp(n.details.formData,!0);if(i.error){n.details.apiErrors=i.error.errors;return}await bm(n,"checkoutGuest")})}function vA(e,t){Bt.defineForm({id:"checkoutUser",submitLabel:"cart.detail.actions.checkout",fields:[{key:"acceptTerms",required:!0},{key:"paymentMode",required:!0}]}),Hr(e,"go-form",{"form-id":"checkoutUser",custom:t}),e.addEventListener("submit",async r=>{const n=r.target;await bm(n,"checkoutUser")})}function gA(e,t){re(t,!0);let r=_(t,"custom",7,!1);return _m(t.$$host,r()),ne({get custom(){return r()},set custom(n=!1){r(n),b()}})}customElements.define("go-checkout-form",ie(gA,{custom:{}},[],[]));function yA(e,t){re(t,!0);let r=_(t,"custom",7,!1);return _m(t.$$host,r()),ne({get custom(){return r()},set custom(n=!1){r(n),b()}})}customElements.define("go-checkout-guest",ie(yA,{custom:{}},[],[]));function bA(e,t){re(t,!0);let r=_(t,"custom",7,!1);return vA(t.$$host,r()),ne({get custom(){return r()},set custom(n=!1){r(n),b()}})}customElements.define("go-checkout-user",ie(bA,{custom:{}},[],[]));var _A="TokenActions::ApplyOrderDiscount";async function wA(e){if(!C.cart)throw new Error("(go-coupon-redemption): cart not found");const t=C.cart,r=await C.asyncFetch(()=>C.getCouponSaleByBarcode(e));return r?.is_valid?r.value_action===_A?(t.addCoupon({code:e,kind:"actionToken"}),{success:!0}):r.is_voucher_for?SA(e,r):r.value_cents&&r.value_cents>0?kA(e,r.value_cents):Ku([C.t("cart.coupon.form.errors.notValid")]):Ku([C.t("cart.coupon.form.errors.notValid")])}function kA(e,t){return C.cart.addCoupon({code:e,kind:"valueVoucher",valueCents:t}),{success:!0}}async function SA(e,t){const r=e.toUpperCase();if(C.cart.coupons.some(a=>a.code===r))return{success:!0};const n=await C.asyncFetch(()=>C.tickets({"by_ticket_ids[]":[t.is_voucher_for]})),i=Array.isArray(n)?n.find(a=>a.id===t.is_voucher_for):void 0;if(!i)return Ku([C.t("cart.coupon.form.errors.error")]);const s={...i,price_cents:0};return C.cart.addItem(ot(uo(s),{quantity:1,voucher:{code:r}})),C.cart.addCoupon({code:r,kind:"serviceVoucher"}),{success:!0}}function Ku(e){return{success:!1,errors:e}}var EA=V("<go-form></go-form>",2);function xA(e,t){re(t,!0),Bt.defineForm({id:"couponRedemption",submitLabel:"cart.coupon.form.submit",fields:[{key:"token",required:!0}]});async function r(o){const l=o.details.fields.find(u=>u.key==="token"),c=(o.details.fieldValue("token")??"").trim().toUpperCase();if(!c)return{success:!0};const f=await wA(c);return f.success?(o.details.apiErrors=[],l&&(l.value=""),o.dispatchEvent(new Event("go-success",{bubbles:!0,composed:!0})),f):(o.details.apiErrors=f.errors,f)}async function n(o){await r(o.target)}async function i(){const o=t.$$host.querySelector("go-form");return o?.details?r(o):{success:!0}}var s={flush:i},a=EA();return Jn(a,"formId","couponRedemption"),La("submit",a,n),E(e,a),ne(s)}customElements.define("go-coupon-redemption",ie(xA,{},[],["flush"])),kb();var TA=class{#e=se();get campaign(){return d(this.#e)}set campaign(e){M(this.#e,e,!0)}#t=se();get amount(){return d(this.#t)}set amount(e){M(this.#t,e,!0)}selectCampaign=e=>{this.campaign=e,document.getElementsByClassName("donation-actions")[0]?.scrollIntoView()};addDonationToCart=()=>{if(this.amount===void 0||this.campaign===void 0)return;const e={value:this.amount,campaign_id:this.campaign.id};let t=JSON.parse(localStorage.getItem("201600627v4donations")||"[]");qr(t.filter(r=>r.campaign_id=e.campaign_id),r=>r.value)+e.value>this.campaign.guest_limit&&this.campaign.guest_limit>0&&(!C.currentUser?.isAuthenticated||C.currentUser.isGuest)?this.skipDonation():(t.push(e),localStorage.setItem("201600627v4donations",JSON.stringify(t)),localStorage.setItem("skipDonation","true"),window.history.pushState(null,"",C.urls.cart()),window.location.replace(C.urls.cart()))};skipDonation=()=>{localStorage.setItem("skipDonation","true"),window.history.pushState(null,"",C.urls.cart()),window.location.replace(C.urls.cart())}},$t=new TA,AA=V('<img alt="logo"/>'),CA=V('<div role="button" tabindex="0"><div class="donation-image"><!></div> <div class="donation-info"><p class="donation-info-title"> </p> <p class="donation-info-description"> </p></div></div>');function wm(e,t){re(t,!0);let r=_(t,"campaign",7);const n=D(()=>r().translations);var i={get campaign(){return r()},set campaign(m){r(m),b()}},s=CA();let a;var o=$(s),l=$(o),c=m=>{var v=AA();Q(y=>me(v,"src",y),[()=>r().picture.thumbnail.replace("thumbnail","article_3x2")]),E(m,v)};le(l,m=>{r().picture.thumbnail&&m(c)}),I(o);var f=W(o,2),u=$(f),p=$(u,!0);I(u);var h=W(u,2),g=$(h,!0);return I(h),I(f),I(s),Q(()=>{a=Et(s,1,"go-donation-campaign",null,a,{selected:$t.campaign?.id===r()?.id}),Y(p,d(n)["donations.headline"]),Y(g,d(n)["donations.shop.info"])}),pt("click",s,()=>$t.selectCampaign(r())),pt("keydown",s,m=>{m.key==="Enter"&&$t.selectCampaign(r())}),E(e,s),ne(i)}ur(["click","keydown"]),ie(wm,{campaign:{}},[],[],{mode:"open"});function OA(e,t){return t=="CHF"?new Intl.NumberFormat("de-CH",{style:"currency",currency:t}).format(e):new Intl.NumberFormat("de-DE",{style:"currency",currency:t}).format(e)}function on(e){if(!e)return;const t=e.split(",").map(r=>r.trim()).map(Number).filter(r=>!isNaN(r)&&r>0);return t.length>0?t:void 0}var DA=V("<button> </button>"),IA=V('<form id="donationForm" action="" novalidate=""><div class="donation-custom form-group"><label for="donation-custom-amount"> </label> <input class="form-control" id="donation-custom-amount" type="number" min="1"/></div></form>'),PA=V('<div class="donation-selection"><h3> </h3> <div class="donation-options"></div> <!></div>');function km(e,t){re(t,!0);const r=$t.campaign?.guest_limit/100;let n=se(void 0);function i(p){$t.amount=p,M(n,null)}function s(p){const h=document.getElementById("donationForm");h.checkValidity()?$t.amount=p.target.valueAsNumber*100:($t.amount=void 0,h.reportValidity())}var a=PA(),o=$(a),l=$(o,!0);I(o);var c=W(o,2);Fe(c,20,()=>$t.campaign?.options,p=>p,(p,h)=>{var g=DA();let m;var v=$(g,!0);I(g),Q(y=>{m=Et(g,1,"btn btn-default",null,m,{selected:$t.amount===h}),Y(v,y)},[()=>OA(h/100,C.currency)]),pt("click",g,()=>i(h)),E(p,g)}),I(c);var f=W(c,2),u=p=>{var h=IA(),g=$(h),m=$(g),v=$(m,!0);I(m);var y=W(m,2);Ms(y),I(g),I(h),Q((x,k)=>{Y(v,x),me(y,"max",r),me(y,"placeholder",k),Bl(y,d(n))},[()=>C.t("donations.selection.custom.label"),()=>C.t("donations.selection.custom.input.placeholder")]),pt("input",y,s),E(p,h)};le(f,p=>{$t.campaign?.free_donations&&p(u)}),I(a),Q(p=>Y(l,p),[()=>C.t("donations.selection.title")]),E(e,a),ne()}ur(["click","input"]),ie(km,{},[],[],{mode:"open"});var $A=V('<div class="go-donations-list"><!> <!> <div class="donation-actions"><button class="btn btn-default"> </button> <button class="btn btn-primary"> </button></div></div>');function MA(e,t){re(t,!1),En(()=>{C.donations?.campaigns?.length==1&&$t.selectCampaign(C.donations?.campaigns[0])}),Xl();var r=ee(),n=z(r),i=s=>{var a=$A(),o=$(a);Fe(o,1,()=>C?.donations?.campaigns,m=>m.id,(m,v)=>{wm(m,{get campaign(){return d(v)}})});var l=W(o,2),c=m=>{km(m,{})};le(l,m=>{$t.campaign&&m(c)});var f=W(l,2),u=$(f),p=$(u,!0);I(u);var h=W(u,2),g=$(h,!0);I(h),I(f),I(a),Q((m,v)=>{Y(p,m),h.disabled=!$t.amount,Y(g,v)},[()=>C.t("donations.actions.continueWithoutDonation"),()=>C.t("donations.actions.addToCart")]),pt("click",u,function(...m){$t.skipDonation?.apply(this,m)}),pt("click",h,function(...m){$t.addDonationToCart?.apply(this,m)}),E(s,a)};le(n,s=>{C.donations&&C.donations.campaigns&&s(i)}),E(e,r),ne()}ur(["click"]),customElements.define("go-donations",ie(MA,{},[],[]));function FA(e){return typeof e=="function"}function Ys(e){return e!==null&&typeof e=="object"}var NA=["string","number","bigint","boolean"];function Yu(e){return e==null||NA.includes(typeof e)?!0:Array.isArray(e)?e.every(t=>Yu(t)):typeof e=="object"?Object.getPrototypeOf(e)===Object.prototype:!1}var bo=Symbol("box"),Sm=Symbol("is-writable");function L(e,t){const r=D(e);return t?{[bo]:!0,[Sm]:!0,get current(){return d(r)},set current(n){t(n)}}:{[bo]:!0,get current(){return e()}}}function Em(e){return Ys(e)&&bo in e}function RA(e){return Em(e)?e:FA(e)?L(e):Er(e)}function Er(e){let t=se(Pe(e));return{[bo]:!0,[Sm]:!0,get current(){return d(t)},set current(r){M(t,r,!0)}}}function xm(...e){return function(t){for(const r of e)if(r){if(t.defaultPrevented)return;typeof r=="function"?r.call(this,t):r.current?.call(this,t)}}}var Tm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,LA=/\n/g,zA=/^\s*/,qA=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,UA=/^:\s*/,VA=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,BA=/^[;\s]*/,jA=/^\s+|\s+$/g,ZA=`
78
78
  `,Am="/",Cm="*",ai="",WA="comment",HA="declaration";function GA(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function i(g){var m=g.match(LA);m&&(r+=m.length);var v=g.lastIndexOf(ZA);n=~v?g.length-v:n+g.length}function s(){var g={line:r,column:n};return function(m){return m.position=new a(g),c(),m}}function a(g){this.start=g,this.end={line:r,column:n},this.source=t.source}a.prototype.content=e;function o(g){var m=new Error(t.source+":"+r+":"+n+": "+g);if(m.reason=g,m.filename=t.source,m.line=r,m.column=n,m.source=e,!t.silent)throw m}function l(g){var m=g.exec(e);if(m){var v=m[0];return i(v),e=e.slice(v.length),m}}function c(){l(zA)}function f(g){var m;for(g=g||[];m=u();)m!==!1&&g.push(m);return g}function u(){var g=s();if(!(Am!=e.charAt(0)||Cm!=e.charAt(1))){for(var m=2;ai!=e.charAt(m)&&(Cm!=e.charAt(m)||Am!=e.charAt(m+1));)++m;if(m+=2,ai===e.charAt(m-1))return o("End of comment missing");var v=e.slice(2,m-2);return n+=2,i(v),e=e.slice(m),n+=2,g({type:WA,comment:v})}}function p(){var g=s(),m=l(qA);if(m){if(u(),!l(UA))return o("property missing ':'");var v=l(VA),y=g({type:HA,property:Om(m[0].replace(Tm,ai)),value:v?Om(v[0].replace(Tm,ai)):ai});return l(BA),y}}function h(){var g=[];f(g);for(var m;m=p();)m!==!1&&(g.push(m),f(g));return g}return c(),h()}function Om(e){return e?e.replace(jA,ai):ai}function KA(e,t){let r=null;if(!e||typeof e!="string")return r;const n=GA(e),i=typeof t=="function";return n.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?t(a,o,s):o&&(r=r||{},r[a]=o)}),r}var YA=/\d/,JA=["-","_","/","."];function QA(e=""){if(!YA.test(e))return e!==e.toLowerCase()}function XA(e){const t=[];let r="",n,i;for(const s of e){const a=JA.includes(s);if(a===!0){t.push(r),r="",n=void 0;continue}const o=QA(s);if(i===!1){if(n===!1&&o===!0){t.push(r),r=s,n=o;continue}if(n===!0&&o===!1&&r.length>1){const l=r.at(-1);t.push(r.slice(0,Math.max(0,r.length-1))),r=l+s,n=o;continue}}r+=s,n=o,i=a}return t.push(r),t}function Dm(e){return e?XA(e).map(t=>tC(t)).join(""):""}function eC(e){return rC(Dm(e||""))}function tC(e){return e?e[0].toUpperCase()+e.slice(1):""}function rC(e){return e?e[0].toLowerCase()+e.slice(1):""}function Js(e){if(!e)return{};const t={};function r(n,i){if(n.startsWith("-moz-")||n.startsWith("-webkit-")||n.startsWith("-ms-")||n.startsWith("-o-")){t[Dm(n)]=i;return}if(n.startsWith("--")){t[n]=i;return}t[eC(n)]=i}return KA(e,r),t}function Qs(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}function nC(e,t){const r=RegExp(e,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,t):n}}var iC=nC(/[A-Z]/,e=>`-${e.toLowerCase()}`);function sC(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${iC(t)}: ${e[t]};`).join(`
79
79
  `)}function Xs(e={}){return sC(e).replace(`
80
80
  `," ")}var aC=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],oC=new Set(aC);function lC(e){return oC.has(e)}function Ke(...e){const t={...e[0]};for(let r=1;r<e.length;r++){const n=e[r];if(n){for(const i of Object.keys(n)){const s=t[i],a=n[i],o=typeof s=="function",l=typeof a=="function";if(o&&lC(i))t[i]=xm(s,a);else if(o&&l)t[i]=Qs(s,a);else if(i==="class"){const c=Yu(s),f=Yu(a);c&&f?t[i]=qa(s,a):c?t[i]=qa(s):f&&(t[i]=qa(a))}else if(i==="style"){const c=typeof s=="object",f=typeof a=="object",u=typeof s=="string",p=typeof a=="string";if(c&&f)t[i]={...s,...a};else if(c&&p){const h=Js(a);t[i]={...s,...h}}else if(u&&f)t[i]={...Js(s),...a};else if(u&&p){const h=Js(s),g=Js(a);t[i]={...h,...g}}else c?t[i]=s:f?t[i]=a:u?t[i]=s:p&&(t[i]=a)}else t[i]=a!==void 0?a:s}for(const i of Object.getOwnPropertySymbols(n)){const s=t[i],a=n[i];t[i]=a!==void 0?a:s}}}return typeof t.style=="object"&&(t.style=Xs(t.style).replaceAll(`
@@ -9743,7 +9743,7 @@ var Sx = class {
9743
9743
  return d(this.#e);
9744
9744
  }
9745
9745
  set apiErrors(e) {
9746
- if (this.fields.forEach((t) => t.apiErrors = []), uu(e)) {
9746
+ if (M(this.#e, [], !0), this.fields.forEach((t) => t.apiErrors = []), uu(e)) {
9747
9747
  M(this.#e, e, !0);
9748
9748
  return;
9749
9749
  }
@@ -9775,7 +9775,7 @@ var Sx = class {
9775
9775
  }
9776
9776
  get fields() {
9777
9777
  const e = this.form.closest("go-form");
9778
- return Array.from(this.form.querySelectorAll("go-field")).filter((t) => t.closest("go-form") === e).map((t) => t.getField?.()).filter((t) => t);
9778
+ return Array.from(this.form.querySelectorAll("go-field")).filter((t) => t.closest("go-form") === e).map((t) => t.getField?.()).filter((t) => !!t);
9779
9779
  }
9780
9780
  toString() {
9781
9781
  return `Form: ${this.formId}, Fields: [${this.fields.map((e) => e.key).join(", ")}], Data: ${JSON.stringify(this.formData)}`;
@@ -9817,7 +9817,7 @@ function Tx(e, t) {
9817
9817
  const i = new Sx(r(), t.$$host);
9818
9818
  Ex(t.$$host, i);
9819
9819
  async function s(f) {
9820
- f.preventDefault(), f.stopPropagation(), i.validateForm(), i?.form?.dispatchEvent(new Event("go-after-validation", f)), i.isValid && (i.apiErrors = {}, i?.form?.dispatchEvent(new Event("go-submit", f)), t.$$host.dispatchEvent(new Event("submit", {
9820
+ f.preventDefault(), f.stopPropagation(), i.validateForm(), i?.form?.dispatchEvent(new Event("go-after-validation", f)), i.isValid && (i.apiErrors = {}, i.successMessage = void 0, i?.form?.dispatchEvent(new Event("go-submit", f)), t.$$host.dispatchEvent(new Event("submit", {
9821
9821
  bubbles: !0,
9822
9822
  composed: !0
9823
9823
  })));
@@ -12389,7 +12389,7 @@ function pA(e, t) {
12389
12389
  const l = o.details.fields.find((u) => u.key === "token"), c = (o.details.fieldValue("token") ?? "").trim().toUpperCase();
12390
12390
  if (!c) return { success: !0 };
12391
12391
  const f = await cA(c);
12392
- return f.success ? (l && (l.value = ""), o.dispatchEvent(new Event("go-success", {
12392
+ return f.success ? (o.details.apiErrors = [], l && (l.value = ""), o.dispatchEvent(new Event("go-success", {
12393
12393
  bubbles: !0,
12394
12394
  composed: !0
12395
12395
  })), f) : (o.details.apiErrors = f.errors, f);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "Giantmonkey GmbH"
5
5
  },
6
6
  "license": "MIT",
7
- "version": "4.8.0",
7
+ "version": "4.8.1",
8
8
  "type": "module",
9
9
  "main": "./dist-js/gomus-webcomponents.iife.js",
10
10
  "module": "./dist-js/gomus-webcomponents.iife.js",