@iai-lib/any-chat-widget 0.1.0-alpha.29 → 0.1.0-alpha.31

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.
@@ -1,4 +1,4 @@
1
- (function(q,Q){typeof exports=="object"&&typeof module<"u"?Q(exports):typeof define=="function"&&define.amd?define(["exports"],Q):(q=typeof globalThis<"u"?globalThis:q||self,Q(q.AnyChatbot={}))})(this,function(q){"use strict";var cr=(q,Q,ae)=>{if(!Q.has(q))throw TypeError("Cannot "+ae)};var Dn=(q,Q,ae)=>(cr(q,Q,"read from private field"),ae?ae.call(q):Q.get(q)),Ii=(q,Q,ae)=>{if(Q.has(q))throw TypeError("Cannot add the same private member more than once");Q instanceof WeakSet?Q.add(q):Q.set(q,ae)},De=(q,Q,ae,U)=>(cr(q,Q,"write to private field"),U?U.call(q,ae):Q.set(q,ae),ae);var Se,st;var Q=Object.defineProperty,ae=(i,e,t)=>e in i?Q(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,U=(i,e,t)=>(ae(i,typeof e!="symbol"?e+"":e,t),t),dr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Oi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Un=(i,e,t)=>(dr(i,e,"access private method"),t);/**
1
+ (function(q,Q){typeof exports=="object"&&typeof module<"u"?Q(exports):typeof define=="function"&&define.amd?define(["exports"],Q):(q=typeof globalThis<"u"?globalThis:q||self,Q(q.AnyChatbot={}))})(this,function(q){"use strict";var cr=(q,Q,ae)=>{if(!Q.has(q))throw TypeError("Cannot "+ae)};var Dn=(q,Q,ae)=>(cr(q,Q,"read from private field"),ae?ae.call(q):Q.get(q)),Ii=(q,Q,ae)=>{if(Q.has(q))throw TypeError("Cannot add the same private member more than once");Q instanceof WeakSet?Q.add(q):Q.set(q,ae)},De=(q,Q,ae,H)=>(cr(q,Q,"write to private field"),H?H.call(q,ae):Q.set(q,ae),ae);var Se,st;var Q=Object.defineProperty,ae=(i,e,t)=>e in i?Q(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,H=(i,e,t)=>(ae(i,typeof e!="symbol"?e+"":e,t),t),dr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Oi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Un=(i,e,t)=>(dr(i,e,"access private method"),t);/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -48,7 +48,7 @@
48
48
  * @license
49
49
  * Copyright 2017 Google LLC
50
50
  * SPDX-License-Identifier: BSD-3-Clause
51
- */const rs=(i,e,t)=>{const n=new Map;for(let s=e;s<=t;s++)n.set(i[s],s);return n},as=an(class extends on{constructor(i){if(super(i),i.type!==rn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let n;t===void 0?t=e:e!==void 0&&(n=e);const s=[],r=[];let a=0;for(const o of i)s[a]=n?n(o,a):a,r[a]=t(o,a),a++;return{values:r,keys:s}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,n]){const s=Ar(i),{values:r,keys:a}=this.dt(e,t,n);if(!Array.isArray(s))return this.ut=a,r;const o=this.ut??(this.ut=[]),l=[];let d,u,p=0,c=s.length-1,g=0,O=r.length-1;for(;p<=c&&g<=O;)if(s[p]===null)p++;else if(s[c]===null)c--;else if(o[p]===a[g])l[g]=Ve(s[p],r[g]),p++,g++;else if(o[c]===a[O])l[O]=Ve(s[c],r[O]),c--,O--;else if(o[p]===a[O])l[O]=Ve(s[p],r[O]),Et(i,l[O+1],s[p]),p++,O--;else if(o[c]===a[g])l[g]=Ve(s[c],r[g]),Et(i,s[p],s[c]),c--,g++;else if(d===void 0&&(d=rs(a,g,O),u=rs(o,p,c)),d.has(o[p]))if(d.has(o[c])){const B=u.get(a[g]),Y=B!==void 0?s[B]:null;if(Y===null){const Ze=Et(i,s[p]);Ve(Ze,r[g]),l[g]=Ze}else l[g]=Ve(Y,r[g]),Et(i,s[p],Y),s[B]=null;g++}else Kn(s[c]),c--;else Kn(s[p]),p++;for(;g<=O;){const B=Et(i,l[O+1]);Ve(B,r[g]),l[g++]=B}for(;p<=c;){const B=s[p++];B!==null&&Kn(B)}return this.ut=a,Cr(i,l),ge}}),$e=Ue`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-8{bottom:2rem}.left-0{left:0}.left-8{left:2rem}.right-0{right:0}.right-8{right:2rem}.top-0{top:0}.z-50{z-index:50}.m-0{margin:0}.m-0\\.5{margin:.125rem}.m-2{margin:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-auto{margin-top:auto;margin-bottom:auto}.mb-1{margin-bottom:.25rem}.mb-\\[-8px\\]{margin-bottom:-8px}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-20{margin-left:5rem}.mr-2{margin-right:.5rem}.mr-20{margin-right:5rem}.mt-4{margin-top:1rem}.inline-block{display:inline-block}.flex{display:flex}.hidden{display:none}.h-0{height:0px}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3\\/5{height:60%}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.max-h-20{max-height:5rem}.max-h-\\[90vh\\]{max-height:90vh}.w-0{width:0px}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-3\\/5{width:60%}.w-5{width:1.25rem}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.max-w-\\[90vw\\]{max-width:90vw}.flex-1{flex:1 1 0%}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-x-8{border-left-width:8px;border-right-width:8px}.border-t-8{border-top-width:8px}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-x-transparent{border-left-color:transparent;border-right-color:transparent}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.p-0{padding:0}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-0{padding-left:0;padding-right:0}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-semibold{font-weight:600}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:host{font-size:16px;line-height:1.2;color:#000;text-align:left;--iai-chat-i-primary-color: var(--iai-chat-primary-color, #0B64F4);--iai-chat-i-text-color: var(--iai-chat-text-color, #FFF);--iai-chat-i-header-bg: var(--iai-chat-header-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-header-fg: var(--iai-chat-header-text-color, var(--iai-chat-i-text-color));--iai-chat-i-button-bg: var(--iai-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-button-fg: var(--iai-chat-button-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-user-bg: var(--iai-chat-messages-user-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-message-user-fg: var(--iai-chat-messages-user-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-assistant-bg: var(--iai-chat-messages-assistant-background-color, #6B7280);--iai-chat-i-message-assistant-fg: var(--iai-chat-messages-assistant-text-color, var(--iai-chat-i-text-color));--iai-chat-i-ocb-bg: var(--iai-chat-open-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-ocb-fg: var(--iai-chat-open-chat-button-icon-color, var(--iai-chat-i-text-color));--iai-chat-i-iframe-modal-header-bg: var(--iai-chat-iframe-modal-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-iframe-modal-header-fg: var(--iai-chat-iframe-modal-text-color, var(--iai-chat-i-text-color))}input{background-color:#fff}h1{font-size:1.5em}h2{font-size:1.17em}h3{font-size:1em}ol,ul{display:flex;flex-direction:column;padding:0;margin-left:20px;gap:8px}ol{list-style-type:decimal}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\\:bg-gray-200:disabled{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width: 768px){.md\\:bottom-8{bottom:2rem}.md\\:left-8{left:2rem}.md\\:right-8{right:2rem}.md\\:flex{display:flex}.md\\:h-\\[500px\\]{height:500px}.md\\:h-fit{height:-moz-fit-content;height:fit-content}.md\\:w-\\[350px\\]{width:350px}.md\\:w-fit{width:-moz-fit-content;width:fit-content}.md\\:p-0{padding:0}.md\\:px-0{padding-left:0;padding-right:0}.md\\:pb-0{padding-bottom:0}}`;var Ir=Object.defineProperty,Or=Object.getOwnPropertyDescriptor,ln=(i,e,t,n)=>{for(var s=n>1?void 0:n?Or(e,t):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Ir(e,t,s),s};let ut=class extends ie{constructor(){super(...arguments),this.activeIndex=0,this.items=[]}render(){return z`
51
+ */const rs=(i,e,t)=>{const n=new Map;for(let s=e;s<=t;s++)n.set(i[s],s);return n},as=an(class extends on{constructor(i){if(super(i),i.type!==rn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let n;t===void 0?t=e:e!==void 0&&(n=e);const s=[],r=[];let a=0;for(const o of i)s[a]=n?n(o,a):a,r[a]=t(o,a),a++;return{values:r,keys:s}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,n]){const s=Ar(i),{values:r,keys:a}=this.dt(e,t,n);if(!Array.isArray(s))return this.ut=a,r;const o=this.ut??(this.ut=[]),l=[];let d,u,p=0,c=s.length-1,g=0,O=r.length-1;for(;p<=c&&g<=O;)if(s[p]===null)p++;else if(s[c]===null)c--;else if(o[p]===a[g])l[g]=Ve(s[p],r[g]),p++,g++;else if(o[c]===a[O])l[O]=Ve(s[c],r[O]),c--,O--;else if(o[p]===a[O])l[O]=Ve(s[p],r[O]),Et(i,l[O+1],s[p]),p++,O--;else if(o[c]===a[g])l[g]=Ve(s[c],r[g]),Et(i,s[p],s[c]),c--,g++;else if(d===void 0&&(d=rs(a,g,O),u=rs(o,p,c)),d.has(o[p]))if(d.has(o[c])){const U=u.get(a[g]),Y=U!==void 0?s[U]:null;if(Y===null){const Ze=Et(i,s[p]);Ve(Ze,r[g]),l[g]=Ze}else l[g]=Ve(Y,r[g]),Et(i,s[p],Y),s[U]=null;g++}else Kn(s[c]),c--;else Kn(s[p]),p++;for(;g<=O;){const U=Et(i,l[O+1]);Ve(U,r[g]),l[g++]=U}for(;p<=c;){const U=s[p++];U!==null&&Kn(U)}return this.ut=a,Cr(i,l),ge}}),$e=Ue`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-8{bottom:2rem}.left-0{left:0}.left-8{left:2rem}.right-0{right:0}.right-8{right:2rem}.top-0{top:0}.z-50{z-index:50}.m-0{margin:0}.m-0\\.5{margin:.125rem}.m-2{margin:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-auto{margin-top:auto;margin-bottom:auto}.mb-1{margin-bottom:.25rem}.mb-\\[-8px\\]{margin-bottom:-8px}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-20{margin-left:5rem}.mr-2{margin-right:.5rem}.mr-20{margin-right:5rem}.mt-4{margin-top:1rem}.inline-block{display:inline-block}.flex{display:flex}.hidden{display:none}.h-0{height:0px}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3\\/5{height:60%}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.max-h-20{max-height:5rem}.max-h-\\[90vh\\]{max-height:90vh}.w-0{width:0px}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-3\\/5{width:60%}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-9{width:2.25rem}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.max-w-\\[90vw\\]{max-width:90vw}.flex-1{flex:1 1 0%}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-x-8{border-left-width:8px;border-right-width:8px}.border-t-8{border-top-width:8px}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-x-transparent{border-left-color:transparent;border-right-color:transparent}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.p-0{padding:0}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-0{padding-left:0;padding-right:0}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-semibold{font-weight:600}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:host{font-size:16px;line-height:1.2;color:#000;text-align:left;--iai-chat-i-primary-color: var(--iai-chat-primary-color, #0B64F4);--iai-chat-i-text-color: var(--iai-chat-text-color, #FFF);--iai-chat-i-header-bg: var(--iai-chat-header-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-header-fg: var(--iai-chat-header-text-color, var(--iai-chat-i-text-color));--iai-chat-i-button-bg: var(--iai-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-button-fg: var(--iai-chat-button-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-user-bg: var(--iai-chat-messages-user-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-message-user-fg: var(--iai-chat-messages-user-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-assistant-bg: var(--iai-chat-messages-assistant-background-color, #6B7280);--iai-chat-i-message-assistant-fg: var(--iai-chat-messages-assistant-text-color, var(--iai-chat-i-text-color));--iai-chat-i-ocb-bg: var(--iai-chat-open-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-ocb-fg: var(--iai-chat-open-chat-button-icon-color, var(--iai-chat-i-text-color));--iai-chat-i-iframe-modal-header-bg: var(--iai-chat-iframe-modal-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-iframe-modal-header-fg: var(--iai-chat-iframe-modal-text-color, var(--iai-chat-i-text-color))}input{background-color:#fff}h1{font-size:1.5em}h2{font-size:1.17em}h3{font-size:1em}ol,ul{display:flex;flex-direction:column;padding:0;margin-left:20px;gap:8px}ol{list-style-type:decimal}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\\:bg-gray-200:disabled{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width: 768px){.md\\:bottom-8{bottom:2rem}.md\\:left-8{left:2rem}.md\\:right-8{right:2rem}.md\\:flex{display:flex}.md\\:h-\\[500px\\]{height:500px}.md\\:h-fit{height:-moz-fit-content;height:fit-content}.md\\:w-\\[350px\\]{width:350px}.md\\:w-fit{width:-moz-fit-content;width:fit-content}.md\\:p-0{padding:0}.md\\:px-0{padding-left:0;padding-right:0}.md\\:pb-0{padding-bottom:0}}`;var Ir=Object.defineProperty,Or=Object.getOwnPropertyDescriptor,ln=(i,e,t,n)=>{for(var s=n>1?void 0:n?Or(e,t):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Ir(e,t,s),s};let ut=class extends ie{constructor(){super(...arguments),this.activeIndex=0,this.items=[]}render(){return z`
52
52
  <div>
53
53
  <div
54
54
  id="carousel"
@@ -115,7 +115,7 @@
115
115
  * @license
116
116
  * Copyright 2018 Google LLC
117
117
  * SPDX-License-Identifier: BSD-3-Clause
118
- */const hs="important",Dr=" !"+hs,Je=an(class extends on{constructor(i){var e;if(super(i),i.type!==rn.ATTRIBUTE||i.name!=="style"||((e=i.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((e,t)=>{const n=i[t];return n==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(i,[e]){const{style:t}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const n of this.ft)e[n]==null&&(this.ft.delete(n),n.includes("-")?t.removeProperty(n):t[n]=null);for(const n in e){const s=e[n];if(s!=null){this.ft.add(n);const r=typeof s=="string"&&s.endsWith(Dr);n.includes("-")||r?t.setProperty(n,r?s.slice(0,-11):s,r?hs:""):t[n]=s}}return ge}});function Ur(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Yn={};(function(i){function e(o){o&&o.options&&clearTimeout(o.options.timer)}function t(o,l,d,u){var p={timer:void 0,lastArgs:[]},c=function(){for(var g=this,O=[],B=0;B<arguments.length;B++)O[B]=arguments[B];p.lastArgs=O,p.timer?clearTimeout(p.timer):l&&d.apply(this,p.lastArgs),p.timer=setTimeout(function(){l||d.apply(g,p.lastArgs),p.timer=void 0},o)};return u&&(c=c.bind(u)),c.options=p,c}function n(o,l,d,u){var p;Object.defineProperty(d,u,{configurable:!0,enumerable:!1,get:function(){return p},set:function(c){p=t(o,l,c,this)}})}function s(o,l,d){var u=d.value;return d.value=t(o,l,u),d}function r(o,l){for(var d=[],u=2;u<arguments.length;u++)d[u-2]=arguments[u];if(d.length===0)throw new Error("function applied debounce decorator should be a method");if(d.length===1)throw new Error("method applied debounce decorator should have valid name");var p=d[0],c=d[1],g=d.length===3&&d[2]?d[2]:Object.getOwnPropertyDescriptor(p,c);if(g)return s(o,l,g);n(o,l,p,c)}function a(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];var d=500,u=!1;if(o.length&&(typeof o[0]=="number"||typeof o[0]=="object"&&o[0].leading!==void 0)){typeof o[0]=="number"&&(d=o[0]);var p=void 0;return typeof o[0]=="object"&&o[0].leading!==void 0&&(p=o[0]),1<o.length&&typeof o[1]=="object"&&o[1].leading!==void 0&&(p=o[1]),p&&(u=p.leading),function(){for(var c=[],g=0;g<arguments.length;g++)c[g]=arguments[g];return r.apply(void 0,[d,u].concat(c))}}return r.apply(void 0,[d,u].concat(o))}Object.defineProperty(i,"__esModule",{value:!0}),i.cancel=e,i.debounce=a})(Yn);var N;(function(i){i.assertEqual=s=>s;function e(s){}i.assertIs=e;function t(s){throw new Error}i.assertNever=t,i.arrayToEnum=s=>{const r={};for(const a of s)r[a]=a;return r},i.getValidEnumValues=s=>{const r=i.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(const o of r)a[o]=s[o];return i.objectValues(a)},i.objectValues=s=>i.objectKeys(s).map(function(r){return s[r]}),i.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const r=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&r.push(a);return r},i.find=(s,r)=>{for(const a of s)if(r(a))return a},i.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,r=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(r)}i.joinValues=n,i.jsonStringifyReplacer=(s,r)=>typeof r=="bigint"?r.toString():r})(N||(N={}));var Gn;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(Gn||(Gn={}));const f=N.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oe=i=>{switch(typeof i){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(i)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(i)?f.array:i===null?f.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?f.promise:typeof Map<"u"&&i instanceof Map?f.map:typeof Set<"u"&&i instanceof Set?f.set:typeof Date<"u"&&i instanceof Date?f.date:f.object;default:return f.unknown}},m=N.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Hr=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class oe extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(r){return r.message},n={_errors:[]},s=r=>{for(const a of r.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(t(a));else{let o=n,l=0;for(;l<a.path.length;){const d=a.path[l];l===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],l++}}};return s(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,N.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}oe.create=i=>new oe(i);const At=(i,e)=>{let t;switch(i.code){case m.invalid_type:i.received===f.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case m.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,N.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:t=`Unrecognized key(s) in object: ${N.joinValues(i.keys,", ")}`;break;case m.invalid_union:t="Invalid input";break;case m.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${N.joinValues(i.options)}`;break;case m.invalid_enum_value:t=`Invalid enum value. Expected ${N.joinValues(i.options)}, received '${i.received}'`;break;case m.invalid_arguments:t="Invalid function arguments";break;case m.invalid_return_type:t="Invalid function return type";break;case m.invalid_date:t="Invalid date";break;case m.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:N.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case m.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case m.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case m.custom:t="Invalid input";break;case m.invalid_intersection_types:t="Intersection results could not be merged";break;case m.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case m.not_finite:t="Number must be finite";break;default:t=e.defaultError,N.assertNever(i)}return{message:t}};let ps=At;function Br(i){ps=i}function un(){return ps}const hn=i=>{const{data:e,path:t,errorMaps:n,issueData:s}=i,r=[...t,...s.path||[]],a={...s,path:r};let o="";const l=n.filter(d=>!!d).slice().reverse();for(const d of l)o=d(a,{data:e,defaultError:o}).message;return{...s,path:r,message:s.message||o}},Wr=[];function y(i,e){const t=hn({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,un(),At].filter(n=>!!n)});i.common.issues.push(t)}class X{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return S;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t)n.push({key:await s.key,value:await s.value});return X.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:r,value:a}=s;if(r.status==="aborted"||a.status==="aborted")return S;r.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[r.value]=a.value)}return{status:e.value,value:n}}}const S=Object.freeze({status:"aborted"}),ms=i=>({status:"dirty",value:i}),te=i=>({status:"valid",value:i}),Xn=i=>i.status==="aborted",ei=i=>i.status==="dirty",It=i=>i.status==="valid",pn=i=>typeof Promise<"u"&&i instanceof Promise;var x;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(x||(x={}));class fe{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gs=(i,e)=>{if(It(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new oe(i.common.issues);return this._error=t,this._error}}};function C(i){if(!i)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=i;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(r,a)=>r.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n??a.defaultError}:{message:t??a.defaultError},description:s}}class I{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Oe(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Oe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new X,ctx:{common:e.parent.common,data:e.data,parsedType:Oe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(pn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const s={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oe(e)},r=this._parseSync({data:e,path:s.path,parent:s});return gs(s,r)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oe(e)},s=this._parse({data:e,path:n.path,parent:n}),r=await(pn(s)?s:Promise.resolve(s));return gs(n,r)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,r)=>{const a=e(s),o=()=>r.addIssue({code:m.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new de({schema:this,typeName:T.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ee.create(this,this._def)}nullable(){return Xe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ce.create(this,this._def)}promise(){return gt.create(this,this._def)}or(e){return Pt.create([this,e],this._def)}and(e){return Nt.create(this,e,this._def)}transform(e){return new de({...C(this._def),schema:this,typeName:T.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Dt({...C(this._def),innerType:this,defaultValue:t,typeName:T.ZodDefault})}brand(){return new ys({typeName:T.ZodBranded,type:this,...C(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new bn({...C(this._def),innerType:this,catchValue:t,typeName:T.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ut.create(this,e)}readonly(){return xn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Fr=/^c[^\s-]{8,}$/i,Vr=/^[a-z][a-z0-9]*$/,qr=/^[0-9A-HJKMNP-TV-Z]{26}$/,Kr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Jr=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ti;const Yr=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Gr=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Xr=i=>i.precision?i.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}Z$`):i.precision===0?i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function ea(i,e){return!!((e==="v4"||!e)&&Yr.test(i)||(e==="v6"||!e)&&Gr.test(i))}class le extends I{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const s=this._getOrReturnCtx(e);return y(s,{code:m.invalid_type,expected:f.string,received:s.parsedType}),S}const t=new X;let n;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if(s.kind==="length"){const r=e.data.length>s.value,a=e.data.length<s.value;(r||a)&&(n=this._getOrReturnCtx(e,n),r?y(n,{code:m.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&y(n,{code:m.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if(s.kind==="email")Jr.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"email",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="emoji")ti||(ti=new RegExp(Qr,"u")),ti.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"emoji",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="uuid")Kr.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"uuid",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="cuid")Fr.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cuid",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="cuid2")Vr.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cuid2",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="ulid")qr.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"ulid",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),y(n,{validation:"url",code:m.invalid_string,message:s.message}),t.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"regex",code:m.invalid_string,message:s.message}),t.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):s.kind==="datetime"?Xr(s).test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:"datetime",message:s.message}),t.dirty()):s.kind==="ip"?ea(e.data,s.version)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"ip",code:m.invalid_string,message:s.message}),t.dirty()):N.assertNever(s);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:m.invalid_string,...x.errToObj(n)})}_addCheck(e){return new le({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...x.errToObj(e)})}url(e){return this._addCheck({kind:"url",...x.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...x.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...x.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...x.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...x.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...x.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...x.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...x.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...x.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...x.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...x.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...x.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...x.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...x.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...x.errToObj(t)})}nonempty(e){return this.min(1,x.errToObj(e))}trim(){return new le({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new le({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new le({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}le.create=i=>{var e;return new le({checks:[],typeName:T.ZodString,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...C(i)})};function ta(i,e){const t=(i.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,r=parseInt(i.toFixed(s).replace(".","")),a=parseInt(e.toFixed(s).replace(".",""));return r%a/Math.pow(10,s)}class Me extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const s=this._getOrReturnCtx(e);return y(s,{code:m.invalid_type,expected:f.number,received:s.parsedType}),S}let t;const n=new X;for(const s of this._def.checks)s.kind==="int"?N.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:m.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?ta(e.data,s.value)!==0&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:m.not_finite,message:s.message}),n.dirty()):N.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,n,s){return new Me({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:x.toString(s)}]})}_addCheck(e){return new Me({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:x.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:x.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&N.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Me.create=i=>new Me({checks:[],typeName:T.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...C(i)});class Re extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==f.bigint){const s=this._getOrReturnCtx(e);return y(s,{code:m.invalid_type,expected:f.bigint,received:s.parsedType}),S}let t;const n=new X;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):N.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,n,s){return new Re({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:x.toString(s)}]})}_addCheck(e){return new Re({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Re.create=i=>{var e;return new Re({checks:[],typeName:T.ZodBigInt,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...C(i)})};class Ot extends I{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.boolean,received:t.parsedType}),S}return te(e.data)}}Ot.create=i=>new Ot({typeName:T.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...C(i)});class Qe extends I{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const s=this._getOrReturnCtx(e);return y(s,{code:m.invalid_type,expected:f.date,received:s.parsedType}),S}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return y(s,{code:m.invalid_date}),S}const t=new X;let n;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),t.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),t.dirty()):N.assertNever(s);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Qe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:x.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:x.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Qe.create=i=>new Qe({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:T.ZodDate,...C(i)});class mn extends I{_parse(e){if(this._getType(e)!==f.symbol){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.symbol,received:t.parsedType}),S}return te(e.data)}}mn.create=i=>new mn({typeName:T.ZodSymbol,...C(i)});class Mt extends I{_parse(e){if(this._getType(e)!==f.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.undefined,received:t.parsedType}),S}return te(e.data)}}Mt.create=i=>new Mt({typeName:T.ZodUndefined,...C(i)});class Rt extends I{_parse(e){if(this._getType(e)!==f.null){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.null,received:t.parsedType}),S}return te(e.data)}}Rt.create=i=>new Rt({typeName:T.ZodNull,...C(i)});class ht extends I{constructor(){super(...arguments),this._any=!0}_parse(e){return te(e.data)}}ht.create=i=>new ht({typeName:T.ZodAny,...C(i)});class Ye extends I{constructor(){super(...arguments),this._unknown=!0}_parse(e){return te(e.data)}}Ye.create=i=>new Ye({typeName:T.ZodUnknown,...C(i)});class Te extends I{_parse(e){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.never,received:t.parsedType}),S}}Te.create=i=>new Te({typeName:T.ZodNever,...C(i)});class gn extends I{_parse(e){if(this._getType(e)!==f.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.void,received:t.parsedType}),S}return te(e.data)}}gn.create=i=>new gn({typeName:T.ZodVoid,...C(i)});class ce extends I{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==f.array)return y(t,{code:m.invalid_type,expected:f.array,received:t.parsedType}),S;if(s.exactLength!==null){const a=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(a||o)&&(y(t,{code:a?m.too_big:m.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(y(t,{code:m.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(y(t,{code:m.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((a,o)=>s.type._parseAsync(new fe(t,a,t.path,o)))).then(a=>X.mergeArray(n,a));const r=[...t.data].map((a,o)=>s.type._parseSync(new fe(t,a,t.path,o)));return X.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new ce({...this._def,minLength:{value:e,message:x.toString(t)}})}max(e,t){return new ce({...this._def,maxLength:{value:e,message:x.toString(t)}})}length(e,t){return new ce({...this._def,exactLength:{value:e,message:x.toString(t)}})}nonempty(e){return this.min(1,e)}}ce.create=(i,e)=>new ce({type:i,minLength:null,maxLength:null,exactLength:null,typeName:T.ZodArray,...C(e)});function pt(i){if(i instanceof F){const e={};for(const t in i.shape){const n=i.shape[t];e[t]=Ee.create(pt(n))}return new F({...i._def,shape:()=>e})}else return i instanceof ce?new ce({...i._def,type:pt(i.element)}):i instanceof Ee?Ee.create(pt(i.unwrap())):i instanceof Xe?Xe.create(pt(i.unwrap())):i instanceof ye?ye.create(i.items.map(e=>pt(e))):i}class F extends I{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=N.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==f.object){const l=this._getOrReturnCtx(e);return y(l,{code:m.invalid_type,expected:f.object,received:l.parsedType}),S}const{status:t,ctx:n}=this._processInputParams(e),{shape:s,keys:r}=this._getCached(),a=[];if(!(this._def.catchall instanceof Te&&this._def.unknownKeys==="strip"))for(const l in n.data)r.includes(l)||a.push(l);const o=[];for(const l of r){const d=s[l],u=n.data[l];o.push({key:{status:"valid",value:l},value:d._parse(new fe(n,u,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof Te){const l=this._def.unknownKeys;if(l==="passthrough")for(const d of a)o.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(l==="strict")a.length>0&&(y(n,{code:m.unrecognized_keys,keys:a}),t.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const d of a){const u=n.data[d];o.push({key:{status:"valid",value:d},value:l._parse(new fe(n,u,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const l=[];for(const d of o){const u=await d.key;l.push({key:u,value:await d.value,alwaysSet:d.alwaysSet})}return l}).then(l=>X.mergeObjectSync(t,l)):X.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return x.errToObj,new F({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,r,a,o;const l=(a=(r=(s=this._def).errorMap)===null||r===void 0?void 0:r.call(s,t,n).message)!==null&&a!==void 0?a:n.defaultError;return t.code==="unrecognized_keys"?{message:(o=x.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new F({...this._def,unknownKeys:"strip"})}passthrough(){return new F({...this._def,unknownKeys:"passthrough"})}extend(e){return new F({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new F({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:T.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new F({...this._def,catchall:e})}pick(e){const t={};return N.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new F({...this._def,shape:()=>t})}omit(e){const t={};return N.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new F({...this._def,shape:()=>t})}deepPartial(){return pt(this)}partial(e){const t={};return N.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}),new F({...this._def,shape:()=>t})}required(e){const t={};return N.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Ee;)s=s._def.innerType;t[n]=s}}),new F({...this._def,shape:()=>t})}keyof(){return fs(N.objectKeys(this.shape))}}F.create=(i,e)=>new F({shape:()=>i,unknownKeys:"strip",catchall:Te.create(),typeName:T.ZodObject,...C(e)}),F.strictCreate=(i,e)=>new F({shape:()=>i,unknownKeys:"strict",catchall:Te.create(),typeName:T.ZodObject,...C(e)}),F.lazycreate=(i,e)=>new F({shape:i,unknownKeys:"strip",catchall:Te.create(),typeName:T.ZodObject,...C(e)});class Pt extends I{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(r){for(const o of r)if(o.result.status==="valid")return o.result;for(const o of r)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const a=r.map(o=>new oe(o.ctx.common.issues));return y(t,{code:m.invalid_union,unionErrors:a}),S}if(t.common.async)return Promise.all(n.map(async r=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(s);{let r;const a=[];for(const l of n){const d={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:d});if(u.status==="valid")return u;u.status==="dirty"&&!r&&(r={result:u,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;const o=a.map(l=>new oe(l));return y(t,{code:m.invalid_union,unionErrors:o}),S}}get options(){return this._def.options}}Pt.create=(i,e)=>new Pt({options:i,typeName:T.ZodUnion,...C(e)});const fn=i=>i instanceof zt?fn(i.schema):i instanceof de?fn(i.innerType()):i instanceof Zt?[i.value]:i instanceof Pe?i.options:i instanceof Lt?Object.keys(i.enum):i instanceof Dt?fn(i._def.innerType):i instanceof Mt?[void 0]:i instanceof Rt?[null]:null;class yn extends I{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return y(t,{code:m.invalid_type,expected:f.object,received:t.parsedType}),S;const n=this.discriminator,s=t.data[n],r=this.optionsMap.get(s);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),S)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const s=new Map;for(const r of t){const a=fn(r.shape[e]);if(!a)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of a){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,r)}}return new yn({typeName:T.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...C(n)})}}function ni(i,e){const t=Oe(i),n=Oe(e);if(i===e)return{valid:!0,data:i};if(t===f.object&&n===f.object){const s=N.objectKeys(e),r=N.objectKeys(i).filter(o=>s.indexOf(o)!==-1),a={...i,...e};for(const o of r){const l=ni(i[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(t===f.array&&n===f.array){if(i.length!==e.length)return{valid:!1};const s=[];for(let r=0;r<i.length;r++){const a=i[r],o=e[r],l=ni(a,o);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return t===f.date&&n===f.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}class Nt extends I{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(r,a)=>{if(Xn(r)||Xn(a))return S;const o=ni(r.value,a.value);return o.valid?((ei(r)||ei(a))&&t.dirty(),{status:t.value,value:o.data}):(y(n,{code:m.invalid_intersection_types}),S)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,a])=>s(r,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Nt.create=(i,e,t)=>new Nt({left:i,right:e,typeName:T.ZodIntersection,...C(t)});class ye extends I{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return y(n,{code:m.invalid_type,expected:f.array,received:n.parsedType}),S;if(n.data.length<this._def.items.length)return y(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...n.data].map((r,a)=>{const o=this._def.items[a]||this._def.rest;return o?o._parse(new fe(n,r,n.path,a)):null}).filter(r=>!!r);return n.common.async?Promise.all(s).then(r=>X.mergeArray(t,r)):X.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ye({...this._def,rest:e})}}ye.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ye({items:i,typeName:T.ZodTuple,rest:null,...C(e)})};class jt extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.object)return y(n,{code:m.invalid_type,expected:f.object,received:n.parsedType}),S;const s=[],r=this._def.keyType,a=this._def.valueType;for(const o in n.data)s.push({key:r._parse(new fe(n,o,n.path,o)),value:a._parse(new fe(n,n.data[o],n.path,o))});return n.common.async?X.mergeObjectAsync(t,s):X.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof I?new jt({keyType:e,valueType:t,typeName:T.ZodRecord,...C(n)}):new jt({keyType:le.create(),valueType:e,typeName:T.ZodRecord,...C(t)})}}class vn extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return y(n,{code:m.invalid_type,expected:f.map,received:n.parsedType}),S;const s=this._def.keyType,r=this._def.valueType,a=[...n.data.entries()].map(([o,l],d)=>({key:s._parse(new fe(n,o,n.path,[d,"key"])),value:r._parse(new fe(n,l,n.path,[d,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const d=await l.key,u=await l.value;if(d.status==="aborted"||u.status==="aborted")return S;(d.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(d.value,u.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of a){const d=l.key,u=l.value;if(d.status==="aborted"||u.status==="aborted")return S;(d.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(d.value,u.value)}return{status:t.value,value:o}}}}vn.create=(i,e,t)=>new vn({valueType:e,keyType:i,typeName:T.ZodMap,...C(t)});class Ge extends I{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return y(n,{code:m.invalid_type,expected:f.set,received:n.parsedType}),S;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(y(n,{code:m.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(y(n,{code:m.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const r=this._def.valueType;function a(l){const d=new Set;for(const u of l){if(u.status==="aborted")return S;u.status==="dirty"&&t.dirty(),d.add(u.value)}return{status:t.value,value:d}}const o=[...n.data.values()].map((l,d)=>r._parse(new fe(n,l,n.path,d)));return n.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,t){return new Ge({...this._def,minSize:{value:e,message:x.toString(t)}})}max(e,t){return new Ge({...this._def,maxSize:{value:e,message:x.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ge.create=(i,e)=>new Ge({valueType:i,minSize:null,maxSize:null,typeName:T.ZodSet,...C(e)});class mt extends I{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return y(t,{code:m.invalid_type,expected:f.function,received:t.parsedType}),S;function n(o,l){return hn({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,un(),At].filter(d=>!!d),issueData:{code:m.invalid_arguments,argumentsError:l}})}function s(o,l){return hn({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,un(),At].filter(d=>!!d),issueData:{code:m.invalid_return_type,returnTypeError:l}})}const r={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof gt){const o=this;return te(async function(...l){const d=new oe([]),u=await o._def.args.parseAsync(l,r).catch(c=>{throw d.addIssue(n(l,c)),d}),p=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(p,r).catch(c=>{throw d.addIssue(s(p,c)),d})})}else{const o=this;return te(function(...l){const d=o._def.args.safeParse(l,r);if(!d.success)throw new oe([n(l,d.error)]);const u=Reflect.apply(a,this,d.data),p=o._def.returns.safeParse(u,r);if(!p.success)throw new oe([s(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mt({...this._def,args:ye.create(e).rest(Ye.create())})}returns(e){return new mt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new mt({args:e||ye.create([]).rest(Ye.create()),returns:t||Ye.create(),typeName:T.ZodFunction,...C(n)})}}class zt extends I{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}zt.create=(i,e)=>new zt({getter:i,typeName:T.ZodLazy,...C(e)});class Zt extends I{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:e.data}}get value(){return this._def.value}}Zt.create=(i,e)=>new Zt({value:i,typeName:T.ZodLiteral,...C(e)});function fs(i,e){return new Pe({values:i,typeName:T.ZodEnum,...C(e)})}class Pe extends I{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{expected:N.joinValues(n),received:t.parsedType,code:m.invalid_type}),S}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{received:t.data,code:m.invalid_enum_value,options:n}),S}return te(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Pe.create(e)}exclude(e){return Pe.create(this.options.filter(t=>!e.includes(t)))}}Pe.create=fs;class Lt extends I{_parse(e){const t=N.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){const s=N.objectValues(t);return y(n,{expected:N.joinValues(s),received:n.parsedType,code:m.invalid_type}),S}if(t.indexOf(e.data)===-1){const s=N.objectValues(t);return y(n,{received:n.data,code:m.invalid_enum_value,options:s}),S}return te(e.data)}get enum(){return this._def.values}}Lt.create=(i,e)=>new Lt({values:i,typeName:T.ZodNativeEnum,...C(e)});class gt extends I{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return y(t,{code:m.invalid_type,expected:f.promise,received:t.parsedType}),S;const n=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return te(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}gt.create=(i,e)=>new gt({type:i,typeName:T.ZodPromise,...C(e)});class de extends I{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===T.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,r={addIssue:a=>{y(n,a),a.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),s.type==="preprocess"){const a=s.transform(n.data,r);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(a).then(o=>this._def.schema._parseAsync({data:o,path:n.path,parent:n})):this._def.schema._parseSync({data:a,path:n.path,parent:n})}if(s.type==="refinement"){const a=o=>{const l=s.refinement(o,r);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?S:(o.status==="dirty"&&t.dirty(),a(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?S:(o.status==="dirty"&&t.dirty(),a(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!It(a))return a;const o=s.transform(a.value,r);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>It(a)?Promise.resolve(s.transform(a.value,r)).then(o=>({status:t.value,value:o})):a);N.assertNever(s)}}de.create=(i,e,t)=>new de({schema:i,typeName:T.ZodEffects,effect:e,...C(t)}),de.createWithPreprocess=(i,e,t)=>new de({schema:e,effect:{type:"preprocess",transform:i},typeName:T.ZodEffects,...C(t)});class Ee extends I{_parse(e){return this._getType(e)===f.undefined?te(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ee.create=(i,e)=>new Ee({innerType:i,typeName:T.ZodOptional,...C(e)});class Xe extends I{_parse(e){return this._getType(e)===f.null?te(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xe.create=(i,e)=>new Xe({innerType:i,typeName:T.ZodNullable,...C(e)});class Dt extends I{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Dt.create=(i,e)=>new Dt({innerType:i,typeName:T.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...C(e)});class bn extends I{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return pn(s)?s.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new oe(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new oe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}bn.create=(i,e)=>new bn({innerType:i,typeName:T.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...C(e)});class wn extends I{_parse(e){if(this._getType(e)!==f.nan){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.nan,received:t.parsedType}),S}return{status:"valid",value:e.data}}}wn.create=i=>new wn({typeName:T.ZodNaN,...C(i)});const na=Symbol("zod_brand");class ys extends I{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ut extends I{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?S:s.status==="dirty"?(t.dirty(),ms(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?S:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new Ut({in:e,out:t,typeName:T.ZodPipeline})}}class xn extends I{_parse(e){const t=this._def.innerType._parse(e);return It(t)&&(t.value=Object.freeze(t.value)),t}}xn.create=(i,e)=>new xn({innerType:i,typeName:T.ZodReadonly,...C(e)});const vs=(i,e={},t)=>i?ht.create().superRefine((n,s)=>{var r,a;if(!i(n)){const o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,l=(a=(r=o.fatal)!==null&&r!==void 0?r:t)!==null&&a!==void 0?a:!0,d=typeof o=="string"?{message:o}:o;s.addIssue({code:"custom",...d,fatal:l})}}):ht.create(),ia={object:F.lazycreate};var T;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(T||(T={}));const sa=(i,e={message:`Input not instance of ${i.name}`})=>vs(t=>t instanceof i,e),bs=le.create,ws=Me.create,ra=wn.create,aa=Re.create,xs=Ot.create,oa=Qe.create,la=mn.create,ca=Mt.create,da=Rt.create,ua=ht.create,ha=Ye.create,pa=Te.create,ma=gn.create,ga=ce.create,fa=F.create,ya=F.strictCreate,va=Pt.create,ba=yn.create,wa=Nt.create,xa=ye.create,_a=jt.create,ka=vn.create,$a=Ge.create,Ta=mt.create,Ea=zt.create,Sa=Zt.create,Ca=Pe.create,Aa=Lt.create,Ia=gt.create,_s=de.create,Oa=Ee.create,Ma=Xe.create,Ra=de.createWithPreprocess,Pa=Ut.create;var w=Object.freeze({__proto__:null,defaultErrorMap:At,setErrorMap:Br,getErrorMap:un,makeIssue:hn,EMPTY_PATH:Wr,addIssueToContext:y,ParseStatus:X,INVALID:S,DIRTY:ms,OK:te,isAborted:Xn,isDirty:ei,isValid:It,isAsync:pn,get util(){return N},get objectUtil(){return Gn},ZodParsedType:f,getParsedType:Oe,ZodType:I,ZodString:le,ZodNumber:Me,ZodBigInt:Re,ZodBoolean:Ot,ZodDate:Qe,ZodSymbol:mn,ZodUndefined:Mt,ZodNull:Rt,ZodAny:ht,ZodUnknown:Ye,ZodNever:Te,ZodVoid:gn,ZodArray:ce,ZodObject:F,ZodUnion:Pt,ZodDiscriminatedUnion:yn,ZodIntersection:Nt,ZodTuple:ye,ZodRecord:jt,ZodMap:vn,ZodSet:Ge,ZodFunction:mt,ZodLazy:zt,ZodLiteral:Zt,ZodEnum:Pe,ZodNativeEnum:Lt,ZodPromise:gt,ZodEffects:de,ZodTransformer:de,ZodOptional:Ee,ZodNullable:Xe,ZodDefault:Dt,ZodCatch:bn,ZodNaN:wn,BRAND:na,ZodBranded:ys,ZodPipeline:Ut,ZodReadonly:xn,custom:vs,Schema:I,ZodSchema:I,late:ia,get ZodFirstPartyTypeKind(){return T},coerce:{string:i=>le.create({...i,coerce:!0}),number:i=>Me.create({...i,coerce:!0}),boolean:i=>Ot.create({...i,coerce:!0}),bigint:i=>Re.create({...i,coerce:!0}),date:i=>Qe.create({...i,coerce:!0})},any:ua,array:ga,bigint:aa,boolean:xs,date:oa,discriminatedUnion:ba,effect:_s,enum:Ca,function:Ta,instanceof:sa,intersection:wa,lazy:Ea,literal:Sa,map:ka,nan:ra,nativeEnum:Aa,never:pa,null:da,nullable:Ma,number:ws,object:fa,oboolean:()=>xs().optional(),onumber:()=>ws().optional(),optional:Oa,ostring:()=>bs().optional(),pipeline:Pa,preprocess:Ra,promise:Ia,record:_a,set:$a,strictObject:ya,string:bs,symbol:la,transformer:_s,tuple:xa,undefined:ca,union:va,unknown:ha,void:ma,NEVER:S,ZodIssueCode:m,quotelessJson:Hr,ZodError:oe});const _n=w.object({assistantId:w.string(),params:w.record(w.any()).default({}),config:w.object({historyKey:w.string().refine(i=>i.replace(/-/g,"_")).nullable().default("main"),welcomeMessage:w.string().default("Hello! How can I help you today?"),inactivityWarningMessage:w.string().default("Are you still there? The chat will end soon if we don't hear from you."),chatEndedMessage:w.string().default("The chat has ended. Please restart the chat to continue."),initialReplyMessage:w.string().nullable().default(null),disclaimerMessage:w.string().nullable().default(null),simulateDelays:w.boolean().default(!0),placement:w.enum(["left","right"]).default("right"),openChatButton:w.object({imageSrc:w.string().optional(),width:w.union([w.string(),w.number()]).default("48px"),height:w.union([w.string(),w.number()]).default("48px"),cta:w.string().optional()}).default({}),chatWindow:w.object({header:w.object({text:w.string().nullable().default("AI Chat"),imageSrc:w.string().optional()}).default({}),showCloseButton:w.boolean().default(!0)}).default({}),styles:w.object({primaryColor:w.string().optional(),textColor:w.string().optional(),openChatButton:w.object({backgroundColor:w.string().optional(),iconColor:w.string().optional()}).optional(),header:w.object({backgroundColor:w.string().optional(),textColor:w.string().optional()}).optional(),button:w.object({backgroundColor:w.string().optional(),textColor:w.string().optional()}).optional(),messages:w.object({user:w.object({backgroundColor:w.string().optional(),textColor:w.string().optional()}).optional(),assistant:w.object({backgroundColor:w.string().optional(),textColor:w.string().optional()}).optional()}).optional()}).default({})}).default({}),handlers:w.object({functionCalls:w.record(w.function().returns(w.union([w.any(),w.promise(w.any())]))).default({}),enhancedContent:w.record(w.function().returns(w.union([w.any(),w.promise(w.any())]))).default({})}).default({})});var Na=Object.defineProperty,ja=Object.getOwnPropertyDescriptor,Ht=(i,e,t,n)=>{for(var s=n>1?void 0:n?ja(e,t):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Na(e,t,s),s};let et=class extends ie{constructor(){super(...arguments),this.isOpen=!1,this.onResizeHandler=()=>{this.isOpen&&window.innerWidth<768?Lr(this):ds(this)}}connectedCallback(){super.connectedCallback(),this.cleanOptions=_n.parse(this.options),this.onResizeHandler(),window.addEventListener("resize",this.onResizeHandler,{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),ds(this),window.removeEventListener("resize",this.onResizeHandler)}render(){const i=this.cleanOptions.config.placement!=="left",e=us({fixed:!0,"bottom-0":!0,"w-full":this.isOpen,"h-full":this.isOpen,...i&&{"right-0":!0,"md:right-8":!0},...!i&&{"left-0":!0,"md:left-8":!0},"md:bottom-8":!0,"md:w-fit":!0,"md:h-fit":!0}),t=us({"mt-4":!0,"px-8":!0,"pb-8":!0,"w-full":!0,hidden:this.isOpen,flex:!this.isOpen,"md:px-0":!0,"md:pb-0":!0,"md:w-[350px]":!0,"md:flex":!0});return z`
118
+ */const hs="important",Dr=" !"+hs,Je=an(class extends on{constructor(i){var e;if(super(i),i.type!==rn.ATTRIBUTE||i.name!=="style"||((e=i.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((e,t)=>{const n=i[t];return n==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(i,[e]){const{style:t}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const n of this.ft)e[n]==null&&(this.ft.delete(n),n.includes("-")?t.removeProperty(n):t[n]=null);for(const n in e){const s=e[n];if(s!=null){this.ft.add(n);const r=typeof s=="string"&&s.endsWith(Dr);n.includes("-")||r?t.setProperty(n,r?s.slice(0,-11):s,r?hs:""):t[n]=s}}return ge}});function Ur(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Yn={};(function(i){function e(o){o&&o.options&&clearTimeout(o.options.timer)}function t(o,l,d,u){var p={timer:void 0,lastArgs:[]},c=function(){for(var g=this,O=[],U=0;U<arguments.length;U++)O[U]=arguments[U];p.lastArgs=O,p.timer?clearTimeout(p.timer):l&&d.apply(this,p.lastArgs),p.timer=setTimeout(function(){l||d.apply(g,p.lastArgs),p.timer=void 0},o)};return u&&(c=c.bind(u)),c.options=p,c}function n(o,l,d,u){var p;Object.defineProperty(d,u,{configurable:!0,enumerable:!1,get:function(){return p},set:function(c){p=t(o,l,c,this)}})}function s(o,l,d){var u=d.value;return d.value=t(o,l,u),d}function r(o,l){for(var d=[],u=2;u<arguments.length;u++)d[u-2]=arguments[u];if(d.length===0)throw new Error("function applied debounce decorator should be a method");if(d.length===1)throw new Error("method applied debounce decorator should have valid name");var p=d[0],c=d[1],g=d.length===3&&d[2]?d[2]:Object.getOwnPropertyDescriptor(p,c);if(g)return s(o,l,g);n(o,l,p,c)}function a(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];var d=500,u=!1;if(o.length&&(typeof o[0]=="number"||typeof o[0]=="object"&&o[0].leading!==void 0)){typeof o[0]=="number"&&(d=o[0]);var p=void 0;return typeof o[0]=="object"&&o[0].leading!==void 0&&(p=o[0]),1<o.length&&typeof o[1]=="object"&&o[1].leading!==void 0&&(p=o[1]),p&&(u=p.leading),function(){for(var c=[],g=0;g<arguments.length;g++)c[g]=arguments[g];return r.apply(void 0,[d,u].concat(c))}}return r.apply(void 0,[d,u].concat(o))}Object.defineProperty(i,"__esModule",{value:!0}),i.cancel=e,i.debounce=a})(Yn);var N;(function(i){i.assertEqual=s=>s;function e(s){}i.assertIs=e;function t(s){throw new Error}i.assertNever=t,i.arrayToEnum=s=>{const r={};for(const a of s)r[a]=a;return r},i.getValidEnumValues=s=>{const r=i.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(const o of r)a[o]=s[o];return i.objectValues(a)},i.objectValues=s=>i.objectKeys(s).map(function(r){return s[r]}),i.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const r=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&r.push(a);return r},i.find=(s,r)=>{for(const a of s)if(r(a))return a},i.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,r=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(r)}i.joinValues=n,i.jsonStringifyReplacer=(s,r)=>typeof r=="bigint"?r.toString():r})(N||(N={}));var Gn;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(Gn||(Gn={}));const f=N.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oe=i=>{switch(typeof i){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(i)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(i)?f.array:i===null?f.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?f.promise:typeof Map<"u"&&i instanceof Map?f.map:typeof Set<"u"&&i instanceof Set?f.set:typeof Date<"u"&&i instanceof Date?f.date:f.object;default:return f.unknown}},m=N.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Hr=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class oe extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(r){return r.message},n={_errors:[]},s=r=>{for(const a of r.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(t(a));else{let o=n,l=0;for(;l<a.path.length;){const d=a.path[l];l===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],l++}}};return s(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,N.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}oe.create=i=>new oe(i);const At=(i,e)=>{let t;switch(i.code){case m.invalid_type:i.received===f.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case m.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,N.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:t=`Unrecognized key(s) in object: ${N.joinValues(i.keys,", ")}`;break;case m.invalid_union:t="Invalid input";break;case m.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${N.joinValues(i.options)}`;break;case m.invalid_enum_value:t=`Invalid enum value. Expected ${N.joinValues(i.options)}, received '${i.received}'`;break;case m.invalid_arguments:t="Invalid function arguments";break;case m.invalid_return_type:t="Invalid function return type";break;case m.invalid_date:t="Invalid date";break;case m.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:N.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case m.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case m.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case m.custom:t="Invalid input";break;case m.invalid_intersection_types:t="Intersection results could not be merged";break;case m.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case m.not_finite:t="Number must be finite";break;default:t=e.defaultError,N.assertNever(i)}return{message:t}};let ps=At;function Br(i){ps=i}function un(){return ps}const hn=i=>{const{data:e,path:t,errorMaps:n,issueData:s}=i,r=[...t,...s.path||[]],a={...s,path:r};let o="";const l=n.filter(d=>!!d).slice().reverse();for(const d of l)o=d(a,{data:e,defaultError:o}).message;return{...s,path:r,message:s.message||o}},Wr=[];function y(i,e){const t=hn({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,un(),At].filter(n=>!!n)});i.common.issues.push(t)}class X{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return S;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t)n.push({key:await s.key,value:await s.value});return X.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:r,value:a}=s;if(r.status==="aborted"||a.status==="aborted")return S;r.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[r.value]=a.value)}return{status:e.value,value:n}}}const S=Object.freeze({status:"aborted"}),ms=i=>({status:"dirty",value:i}),te=i=>({status:"valid",value:i}),Xn=i=>i.status==="aborted",ei=i=>i.status==="dirty",It=i=>i.status==="valid",pn=i=>typeof Promise<"u"&&i instanceof Promise;var x;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(x||(x={}));class fe{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gs=(i,e)=>{if(It(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new oe(i.common.issues);return this._error=t,this._error}}};function C(i){if(!i)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=i;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(r,a)=>r.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n??a.defaultError}:{message:t??a.defaultError},description:s}}class I{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Oe(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Oe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new X,ctx:{common:e.parent.common,data:e.data,parsedType:Oe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(pn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const s={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oe(e)},r=this._parseSync({data:e,path:s.path,parent:s});return gs(s,r)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oe(e)},s=this._parse({data:e,path:n.path,parent:n}),r=await(pn(s)?s:Promise.resolve(s));return gs(n,r)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,r)=>{const a=e(s),o=()=>r.addIssue({code:m.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new de({schema:this,typeName:T.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ee.create(this,this._def)}nullable(){return Xe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ce.create(this,this._def)}promise(){return gt.create(this,this._def)}or(e){return Pt.create([this,e],this._def)}and(e){return Nt.create(this,e,this._def)}transform(e){return new de({...C(this._def),schema:this,typeName:T.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Dt({...C(this._def),innerType:this,defaultValue:t,typeName:T.ZodDefault})}brand(){return new ys({typeName:T.ZodBranded,type:this,...C(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new bn({...C(this._def),innerType:this,catchValue:t,typeName:T.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ut.create(this,e)}readonly(){return xn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Fr=/^c[^\s-]{8,}$/i,Vr=/^[a-z][a-z0-9]*$/,qr=/^[0-9A-HJKMNP-TV-Z]{26}$/,Kr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Jr=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ti;const Yr=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Gr=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Xr=i=>i.precision?i.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}Z$`):i.precision===0?i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function ea(i,e){return!!((e==="v4"||!e)&&Yr.test(i)||(e==="v6"||!e)&&Gr.test(i))}class le extends I{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const s=this._getOrReturnCtx(e);return y(s,{code:m.invalid_type,expected:f.string,received:s.parsedType}),S}const t=new X;let n;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if(s.kind==="length"){const r=e.data.length>s.value,a=e.data.length<s.value;(r||a)&&(n=this._getOrReturnCtx(e,n),r?y(n,{code:m.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&y(n,{code:m.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if(s.kind==="email")Jr.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"email",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="emoji")ti||(ti=new RegExp(Qr,"u")),ti.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"emoji",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="uuid")Kr.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"uuid",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="cuid")Fr.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cuid",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="cuid2")Vr.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cuid2",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="ulid")qr.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"ulid",code:m.invalid_string,message:s.message}),t.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),y(n,{validation:"url",code:m.invalid_string,message:s.message}),t.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"regex",code:m.invalid_string,message:s.message}),t.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):s.kind==="datetime"?Xr(s).test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:"datetime",message:s.message}),t.dirty()):s.kind==="ip"?ea(e.data,s.version)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"ip",code:m.invalid_string,message:s.message}),t.dirty()):N.assertNever(s);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:m.invalid_string,...x.errToObj(n)})}_addCheck(e){return new le({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...x.errToObj(e)})}url(e){return this._addCheck({kind:"url",...x.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...x.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...x.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...x.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...x.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...x.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...x.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...x.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...x.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...x.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...x.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...x.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...x.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...x.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...x.errToObj(t)})}nonempty(e){return this.min(1,x.errToObj(e))}trim(){return new le({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new le({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new le({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}le.create=i=>{var e;return new le({checks:[],typeName:T.ZodString,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...C(i)})};function ta(i,e){const t=(i.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,r=parseInt(i.toFixed(s).replace(".","")),a=parseInt(e.toFixed(s).replace(".",""));return r%a/Math.pow(10,s)}class Me extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const s=this._getOrReturnCtx(e);return y(s,{code:m.invalid_type,expected:f.number,received:s.parsedType}),S}let t;const n=new X;for(const s of this._def.checks)s.kind==="int"?N.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:m.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?ta(e.data,s.value)!==0&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:m.not_finite,message:s.message}),n.dirty()):N.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,n,s){return new Me({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:x.toString(s)}]})}_addCheck(e){return new Me({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:x.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:x.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&N.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Me.create=i=>new Me({checks:[],typeName:T.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...C(i)});class Re extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==f.bigint){const s=this._getOrReturnCtx(e);return y(s,{code:m.invalid_type,expected:f.bigint,received:s.parsedType}),S}let t;const n=new X;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):N.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,n,s){return new Re({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:x.toString(s)}]})}_addCheck(e){return new Re({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Re.create=i=>{var e;return new Re({checks:[],typeName:T.ZodBigInt,coerce:(e=i==null?void 0:i.coerce)!==null&&e!==void 0?e:!1,...C(i)})};class Ot extends I{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.boolean,received:t.parsedType}),S}return te(e.data)}}Ot.create=i=>new Ot({typeName:T.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...C(i)});class Qe extends I{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const s=this._getOrReturnCtx(e);return y(s,{code:m.invalid_type,expected:f.date,received:s.parsedType}),S}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return y(s,{code:m.invalid_date}),S}const t=new X;let n;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),t.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),t.dirty()):N.assertNever(s);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Qe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:x.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:x.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Qe.create=i=>new Qe({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:T.ZodDate,...C(i)});class mn extends I{_parse(e){if(this._getType(e)!==f.symbol){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.symbol,received:t.parsedType}),S}return te(e.data)}}mn.create=i=>new mn({typeName:T.ZodSymbol,...C(i)});class Mt extends I{_parse(e){if(this._getType(e)!==f.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.undefined,received:t.parsedType}),S}return te(e.data)}}Mt.create=i=>new Mt({typeName:T.ZodUndefined,...C(i)});class Rt extends I{_parse(e){if(this._getType(e)!==f.null){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.null,received:t.parsedType}),S}return te(e.data)}}Rt.create=i=>new Rt({typeName:T.ZodNull,...C(i)});class ht extends I{constructor(){super(...arguments),this._any=!0}_parse(e){return te(e.data)}}ht.create=i=>new ht({typeName:T.ZodAny,...C(i)});class Ye extends I{constructor(){super(...arguments),this._unknown=!0}_parse(e){return te(e.data)}}Ye.create=i=>new Ye({typeName:T.ZodUnknown,...C(i)});class Te extends I{_parse(e){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.never,received:t.parsedType}),S}}Te.create=i=>new Te({typeName:T.ZodNever,...C(i)});class gn extends I{_parse(e){if(this._getType(e)!==f.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.void,received:t.parsedType}),S}return te(e.data)}}gn.create=i=>new gn({typeName:T.ZodVoid,...C(i)});class ce extends I{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==f.array)return y(t,{code:m.invalid_type,expected:f.array,received:t.parsedType}),S;if(s.exactLength!==null){const a=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(a||o)&&(y(t,{code:a?m.too_big:m.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(y(t,{code:m.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(y(t,{code:m.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((a,o)=>s.type._parseAsync(new fe(t,a,t.path,o)))).then(a=>X.mergeArray(n,a));const r=[...t.data].map((a,o)=>s.type._parseSync(new fe(t,a,t.path,o)));return X.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new ce({...this._def,minLength:{value:e,message:x.toString(t)}})}max(e,t){return new ce({...this._def,maxLength:{value:e,message:x.toString(t)}})}length(e,t){return new ce({...this._def,exactLength:{value:e,message:x.toString(t)}})}nonempty(e){return this.min(1,e)}}ce.create=(i,e)=>new ce({type:i,minLength:null,maxLength:null,exactLength:null,typeName:T.ZodArray,...C(e)});function pt(i){if(i instanceof F){const e={};for(const t in i.shape){const n=i.shape[t];e[t]=Ee.create(pt(n))}return new F({...i._def,shape:()=>e})}else return i instanceof ce?new ce({...i._def,type:pt(i.element)}):i instanceof Ee?Ee.create(pt(i.unwrap())):i instanceof Xe?Xe.create(pt(i.unwrap())):i instanceof ye?ye.create(i.items.map(e=>pt(e))):i}class F extends I{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=N.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==f.object){const l=this._getOrReturnCtx(e);return y(l,{code:m.invalid_type,expected:f.object,received:l.parsedType}),S}const{status:t,ctx:n}=this._processInputParams(e),{shape:s,keys:r}=this._getCached(),a=[];if(!(this._def.catchall instanceof Te&&this._def.unknownKeys==="strip"))for(const l in n.data)r.includes(l)||a.push(l);const o=[];for(const l of r){const d=s[l],u=n.data[l];o.push({key:{status:"valid",value:l},value:d._parse(new fe(n,u,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof Te){const l=this._def.unknownKeys;if(l==="passthrough")for(const d of a)o.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(l==="strict")a.length>0&&(y(n,{code:m.unrecognized_keys,keys:a}),t.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const d of a){const u=n.data[d];o.push({key:{status:"valid",value:d},value:l._parse(new fe(n,u,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const l=[];for(const d of o){const u=await d.key;l.push({key:u,value:await d.value,alwaysSet:d.alwaysSet})}return l}).then(l=>X.mergeObjectSync(t,l)):X.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return x.errToObj,new F({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,r,a,o;const l=(a=(r=(s=this._def).errorMap)===null||r===void 0?void 0:r.call(s,t,n).message)!==null&&a!==void 0?a:n.defaultError;return t.code==="unrecognized_keys"?{message:(o=x.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new F({...this._def,unknownKeys:"strip"})}passthrough(){return new F({...this._def,unknownKeys:"passthrough"})}extend(e){return new F({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new F({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:T.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new F({...this._def,catchall:e})}pick(e){const t={};return N.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new F({...this._def,shape:()=>t})}omit(e){const t={};return N.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new F({...this._def,shape:()=>t})}deepPartial(){return pt(this)}partial(e){const t={};return N.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}),new F({...this._def,shape:()=>t})}required(e){const t={};return N.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Ee;)s=s._def.innerType;t[n]=s}}),new F({...this._def,shape:()=>t})}keyof(){return fs(N.objectKeys(this.shape))}}F.create=(i,e)=>new F({shape:()=>i,unknownKeys:"strip",catchall:Te.create(),typeName:T.ZodObject,...C(e)}),F.strictCreate=(i,e)=>new F({shape:()=>i,unknownKeys:"strict",catchall:Te.create(),typeName:T.ZodObject,...C(e)}),F.lazycreate=(i,e)=>new F({shape:i,unknownKeys:"strip",catchall:Te.create(),typeName:T.ZodObject,...C(e)});class Pt extends I{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(r){for(const o of r)if(o.result.status==="valid")return o.result;for(const o of r)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const a=r.map(o=>new oe(o.ctx.common.issues));return y(t,{code:m.invalid_union,unionErrors:a}),S}if(t.common.async)return Promise.all(n.map(async r=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(s);{let r;const a=[];for(const l of n){const d={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:d});if(u.status==="valid")return u;u.status==="dirty"&&!r&&(r={result:u,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;const o=a.map(l=>new oe(l));return y(t,{code:m.invalid_union,unionErrors:o}),S}}get options(){return this._def.options}}Pt.create=(i,e)=>new Pt({options:i,typeName:T.ZodUnion,...C(e)});const fn=i=>i instanceof zt?fn(i.schema):i instanceof de?fn(i.innerType()):i instanceof Zt?[i.value]:i instanceof Pe?i.options:i instanceof Lt?Object.keys(i.enum):i instanceof Dt?fn(i._def.innerType):i instanceof Mt?[void 0]:i instanceof Rt?[null]:null;class yn extends I{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return y(t,{code:m.invalid_type,expected:f.object,received:t.parsedType}),S;const n=this.discriminator,s=t.data[n],r=this.optionsMap.get(s);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),S)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const s=new Map;for(const r of t){const a=fn(r.shape[e]);if(!a)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of a){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,r)}}return new yn({typeName:T.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...C(n)})}}function ni(i,e){const t=Oe(i),n=Oe(e);if(i===e)return{valid:!0,data:i};if(t===f.object&&n===f.object){const s=N.objectKeys(e),r=N.objectKeys(i).filter(o=>s.indexOf(o)!==-1),a={...i,...e};for(const o of r){const l=ni(i[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(t===f.array&&n===f.array){if(i.length!==e.length)return{valid:!1};const s=[];for(let r=0;r<i.length;r++){const a=i[r],o=e[r],l=ni(a,o);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return t===f.date&&n===f.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}class Nt extends I{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(r,a)=>{if(Xn(r)||Xn(a))return S;const o=ni(r.value,a.value);return o.valid?((ei(r)||ei(a))&&t.dirty(),{status:t.value,value:o.data}):(y(n,{code:m.invalid_intersection_types}),S)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,a])=>s(r,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Nt.create=(i,e,t)=>new Nt({left:i,right:e,typeName:T.ZodIntersection,...C(t)});class ye extends I{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return y(n,{code:m.invalid_type,expected:f.array,received:n.parsedType}),S;if(n.data.length<this._def.items.length)return y(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...n.data].map((r,a)=>{const o=this._def.items[a]||this._def.rest;return o?o._parse(new fe(n,r,n.path,a)):null}).filter(r=>!!r);return n.common.async?Promise.all(s).then(r=>X.mergeArray(t,r)):X.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ye({...this._def,rest:e})}}ye.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ye({items:i,typeName:T.ZodTuple,rest:null,...C(e)})};class jt extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.object)return y(n,{code:m.invalid_type,expected:f.object,received:n.parsedType}),S;const s=[],r=this._def.keyType,a=this._def.valueType;for(const o in n.data)s.push({key:r._parse(new fe(n,o,n.path,o)),value:a._parse(new fe(n,n.data[o],n.path,o))});return n.common.async?X.mergeObjectAsync(t,s):X.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof I?new jt({keyType:e,valueType:t,typeName:T.ZodRecord,...C(n)}):new jt({keyType:le.create(),valueType:e,typeName:T.ZodRecord,...C(t)})}}class vn extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return y(n,{code:m.invalid_type,expected:f.map,received:n.parsedType}),S;const s=this._def.keyType,r=this._def.valueType,a=[...n.data.entries()].map(([o,l],d)=>({key:s._parse(new fe(n,o,n.path,[d,"key"])),value:r._parse(new fe(n,l,n.path,[d,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const d=await l.key,u=await l.value;if(d.status==="aborted"||u.status==="aborted")return S;(d.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(d.value,u.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of a){const d=l.key,u=l.value;if(d.status==="aborted"||u.status==="aborted")return S;(d.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(d.value,u.value)}return{status:t.value,value:o}}}}vn.create=(i,e,t)=>new vn({valueType:e,keyType:i,typeName:T.ZodMap,...C(t)});class Ge extends I{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return y(n,{code:m.invalid_type,expected:f.set,received:n.parsedType}),S;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(y(n,{code:m.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(y(n,{code:m.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const r=this._def.valueType;function a(l){const d=new Set;for(const u of l){if(u.status==="aborted")return S;u.status==="dirty"&&t.dirty(),d.add(u.value)}return{status:t.value,value:d}}const o=[...n.data.values()].map((l,d)=>r._parse(new fe(n,l,n.path,d)));return n.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,t){return new Ge({...this._def,minSize:{value:e,message:x.toString(t)}})}max(e,t){return new Ge({...this._def,maxSize:{value:e,message:x.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ge.create=(i,e)=>new Ge({valueType:i,minSize:null,maxSize:null,typeName:T.ZodSet,...C(e)});class mt extends I{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return y(t,{code:m.invalid_type,expected:f.function,received:t.parsedType}),S;function n(o,l){return hn({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,un(),At].filter(d=>!!d),issueData:{code:m.invalid_arguments,argumentsError:l}})}function s(o,l){return hn({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,un(),At].filter(d=>!!d),issueData:{code:m.invalid_return_type,returnTypeError:l}})}const r={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof gt){const o=this;return te(async function(...l){const d=new oe([]),u=await o._def.args.parseAsync(l,r).catch(c=>{throw d.addIssue(n(l,c)),d}),p=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(p,r).catch(c=>{throw d.addIssue(s(p,c)),d})})}else{const o=this;return te(function(...l){const d=o._def.args.safeParse(l,r);if(!d.success)throw new oe([n(l,d.error)]);const u=Reflect.apply(a,this,d.data),p=o._def.returns.safeParse(u,r);if(!p.success)throw new oe([s(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mt({...this._def,args:ye.create(e).rest(Ye.create())})}returns(e){return new mt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new mt({args:e||ye.create([]).rest(Ye.create()),returns:t||Ye.create(),typeName:T.ZodFunction,...C(n)})}}class zt extends I{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}zt.create=(i,e)=>new zt({getter:i,typeName:T.ZodLazy,...C(e)});class Zt extends I{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:e.data}}get value(){return this._def.value}}Zt.create=(i,e)=>new Zt({value:i,typeName:T.ZodLiteral,...C(e)});function fs(i,e){return new Pe({values:i,typeName:T.ZodEnum,...C(e)})}class Pe extends I{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{expected:N.joinValues(n),received:t.parsedType,code:m.invalid_type}),S}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{received:t.data,code:m.invalid_enum_value,options:n}),S}return te(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Pe.create(e)}exclude(e){return Pe.create(this.options.filter(t=>!e.includes(t)))}}Pe.create=fs;class Lt extends I{_parse(e){const t=N.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){const s=N.objectValues(t);return y(n,{expected:N.joinValues(s),received:n.parsedType,code:m.invalid_type}),S}if(t.indexOf(e.data)===-1){const s=N.objectValues(t);return y(n,{received:n.data,code:m.invalid_enum_value,options:s}),S}return te(e.data)}get enum(){return this._def.values}}Lt.create=(i,e)=>new Lt({values:i,typeName:T.ZodNativeEnum,...C(e)});class gt extends I{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return y(t,{code:m.invalid_type,expected:f.promise,received:t.parsedType}),S;const n=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return te(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}gt.create=(i,e)=>new gt({type:i,typeName:T.ZodPromise,...C(e)});class de extends I{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===T.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,r={addIssue:a=>{y(n,a),a.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),s.type==="preprocess"){const a=s.transform(n.data,r);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(a).then(o=>this._def.schema._parseAsync({data:o,path:n.path,parent:n})):this._def.schema._parseSync({data:a,path:n.path,parent:n})}if(s.type==="refinement"){const a=o=>{const l=s.refinement(o,r);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?S:(o.status==="dirty"&&t.dirty(),a(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?S:(o.status==="dirty"&&t.dirty(),a(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!It(a))return a;const o=s.transform(a.value,r);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>It(a)?Promise.resolve(s.transform(a.value,r)).then(o=>({status:t.value,value:o})):a);N.assertNever(s)}}de.create=(i,e,t)=>new de({schema:i,typeName:T.ZodEffects,effect:e,...C(t)}),de.createWithPreprocess=(i,e,t)=>new de({schema:e,effect:{type:"preprocess",transform:i},typeName:T.ZodEffects,...C(t)});class Ee extends I{_parse(e){return this._getType(e)===f.undefined?te(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ee.create=(i,e)=>new Ee({innerType:i,typeName:T.ZodOptional,...C(e)});class Xe extends I{_parse(e){return this._getType(e)===f.null?te(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xe.create=(i,e)=>new Xe({innerType:i,typeName:T.ZodNullable,...C(e)});class Dt extends I{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Dt.create=(i,e)=>new Dt({innerType:i,typeName:T.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...C(e)});class bn extends I{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return pn(s)?s.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new oe(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new oe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}bn.create=(i,e)=>new bn({innerType:i,typeName:T.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...C(e)});class wn extends I{_parse(e){if(this._getType(e)!==f.nan){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:f.nan,received:t.parsedType}),S}return{status:"valid",value:e.data}}}wn.create=i=>new wn({typeName:T.ZodNaN,...C(i)});const na=Symbol("zod_brand");class ys extends I{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ut extends I{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?S:s.status==="dirty"?(t.dirty(),ms(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?S:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new Ut({in:e,out:t,typeName:T.ZodPipeline})}}class xn extends I{_parse(e){const t=this._def.innerType._parse(e);return It(t)&&(t.value=Object.freeze(t.value)),t}}xn.create=(i,e)=>new xn({innerType:i,typeName:T.ZodReadonly,...C(e)});const vs=(i,e={},t)=>i?ht.create().superRefine((n,s)=>{var r,a;if(!i(n)){const o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,l=(a=(r=o.fatal)!==null&&r!==void 0?r:t)!==null&&a!==void 0?a:!0,d=typeof o=="string"?{message:o}:o;s.addIssue({code:"custom",...d,fatal:l})}}):ht.create(),ia={object:F.lazycreate};var T;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(T||(T={}));const sa=(i,e={message:`Input not instance of ${i.name}`})=>vs(t=>t instanceof i,e),bs=le.create,ws=Me.create,ra=wn.create,aa=Re.create,xs=Ot.create,oa=Qe.create,la=mn.create,ca=Mt.create,da=Rt.create,ua=ht.create,ha=Ye.create,pa=Te.create,ma=gn.create,ga=ce.create,fa=F.create,ya=F.strictCreate,va=Pt.create,ba=yn.create,wa=Nt.create,xa=ye.create,_a=jt.create,ka=vn.create,$a=Ge.create,Ta=mt.create,Ea=zt.create,Sa=Zt.create,Ca=Pe.create,Aa=Lt.create,Ia=gt.create,_s=de.create,Oa=Ee.create,Ma=Xe.create,Ra=de.createWithPreprocess,Pa=Ut.create;var w=Object.freeze({__proto__:null,defaultErrorMap:At,setErrorMap:Br,getErrorMap:un,makeIssue:hn,EMPTY_PATH:Wr,addIssueToContext:y,ParseStatus:X,INVALID:S,DIRTY:ms,OK:te,isAborted:Xn,isDirty:ei,isValid:It,isAsync:pn,get util(){return N},get objectUtil(){return Gn},ZodParsedType:f,getParsedType:Oe,ZodType:I,ZodString:le,ZodNumber:Me,ZodBigInt:Re,ZodBoolean:Ot,ZodDate:Qe,ZodSymbol:mn,ZodUndefined:Mt,ZodNull:Rt,ZodAny:ht,ZodUnknown:Ye,ZodNever:Te,ZodVoid:gn,ZodArray:ce,ZodObject:F,ZodUnion:Pt,ZodDiscriminatedUnion:yn,ZodIntersection:Nt,ZodTuple:ye,ZodRecord:jt,ZodMap:vn,ZodSet:Ge,ZodFunction:mt,ZodLazy:zt,ZodLiteral:Zt,ZodEnum:Pe,ZodNativeEnum:Lt,ZodPromise:gt,ZodEffects:de,ZodTransformer:de,ZodOptional:Ee,ZodNullable:Xe,ZodDefault:Dt,ZodCatch:bn,ZodNaN:wn,BRAND:na,ZodBranded:ys,ZodPipeline:Ut,ZodReadonly:xn,custom:vs,Schema:I,ZodSchema:I,late:ia,get ZodFirstPartyTypeKind(){return T},coerce:{string:i=>le.create({...i,coerce:!0}),number:i=>Me.create({...i,coerce:!0}),boolean:i=>Ot.create({...i,coerce:!0}),bigint:i=>Re.create({...i,coerce:!0}),date:i=>Qe.create({...i,coerce:!0})},any:ua,array:ga,bigint:aa,boolean:xs,date:oa,discriminatedUnion:ba,effect:_s,enum:Ca,function:Ta,instanceof:sa,intersection:wa,lazy:Ea,literal:Sa,map:ka,nan:ra,nativeEnum:Aa,never:pa,null:da,nullable:Ma,number:ws,object:fa,oboolean:()=>xs().optional(),onumber:()=>ws().optional(),optional:Oa,ostring:()=>bs().optional(),pipeline:Pa,preprocess:Ra,promise:Ia,record:_a,set:$a,strictObject:ya,string:bs,symbol:la,transformer:_s,tuple:xa,undefined:ca,union:va,unknown:ha,void:ma,NEVER:S,ZodIssueCode:m,quotelessJson:Hr,ZodError:oe});const _n=w.object({assistantId:w.string(),params:w.record(w.any()).default({}),config:w.object({historyKey:w.string().refine(i=>i.replace(/-/g,"_")).nullable().default("main"),welcomeMessage:w.string().default("Hello! How can I help you today?"),inactivityWarningMessage:w.string().default("Are you still there? The chat will end soon if we don't hear from you."),chatEndedMessage:w.string().default("The chat has ended. Please restart the chat to continue."),initialReplyMessage:w.string().nullable().default(null),disclaimerMessage:w.string().nullable().default(null),simulateDelays:w.boolean().default(!0),placement:w.enum(["left","right"]).default("right"),openChatButton:w.object({imageSrc:w.string().optional(),width:w.union([w.string(),w.number()]).default("48px"),height:w.union([w.string(),w.number()]).default("48px"),cta:w.string().optional()}).default({}),chatWindow:w.object({header:w.object({text:w.string().nullable().default("AI Chat"),imageSrc:w.string().optional()}).default({}),showCloseButton:w.boolean().default(!0)}).default({}),styles:w.object({primaryColor:w.string().optional(),textColor:w.string().optional(),openChatButton:w.object({backgroundColor:w.string().optional(),iconColor:w.string().optional()}).optional(),header:w.object({backgroundColor:w.string().optional(),textColor:w.string().optional()}).optional(),button:w.object({backgroundColor:w.string().optional(),textColor:w.string().optional()}).optional(),messages:w.object({user:w.object({backgroundColor:w.string().optional(),textColor:w.string().optional()}).optional(),assistant:w.object({backgroundColor:w.string().optional(),textColor:w.string().optional()}).optional()}).optional()}).default({})}).default({}),handlers:w.object({functionCalls:w.record(w.function().returns(w.union([w.any(),w.promise(w.any())]))).default({}),enhancedContent:w.record(w.function().returns(w.union([w.any(),w.promise(w.any())]))).default({})}).default({})});var Na=Object.defineProperty,ja=Object.getOwnPropertyDescriptor,Ht=(i,e,t,n)=>{for(var s=n>1?void 0:n?ja(e,t):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Na(e,t,s),s};let et=class extends ie{constructor(){super(...arguments),this.isOpen=!1,this.onResizeHandler=()=>{this.isOpen&&window.innerWidth<768?Lr(this):ds(this)}}connectedCallback(){super.connectedCallback(),this.cleanOptions=_n.parse(this.options),this.onResizeHandler(),window.addEventListener("resize",this.onResizeHandler,{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),ds(this),window.removeEventListener("resize",this.onResizeHandler)}render(){const i=this.cleanOptions.config.placement!=="left",e=us({fixed:!0,"bottom-0":!0,"w-full":this.isOpen,"h-full":this.isOpen,...i&&{"right-0":!0,"md:right-8":!0},...!i&&{"left-0":!0,"md:left-8":!0},"md:bottom-8":!0,"md:w-fit":!0,"md:h-fit":!0}),t=us({"mt-4":!0,"px-8":!0,"pb-8":!0,"w-full":!0,hidden:this.isOpen,flex:!this.isOpen,"md:px-0":!0,"md:pb-0":!0,"md:w-[350px]":!0,"md:flex":!0});return z`
119
119
  <div
120
120
  class=${e}
121
121
  style=${Je({zIndex:"9999",colorScheme:"normal"})}
@@ -206,14 +206,14 @@
206
206
  <div class="flex-grow"></div>
207
207
 
208
208
  <button
209
- class="mr-2 h-6"
209
+ class="mr-2 h-6 w-6"
210
210
  @click="${this.resetChat}"
211
211
  >
212
212
  ${Fa}
213
213
  </button>
214
214
 
215
215
  ${Ne(n,()=>z`
216
- <button class="mr-2 h-6" @click="${this.closeChat}">
216
+ <button class="mr-2 h-6 w-6" @click="${this.closeChat}">
217
217
  ${Bt}
218
218
  </button>
219
219
  `)}
@@ -251,7 +251,7 @@
251
251
  ></textarea>
252
252
  <button
253
253
  type="submit"
254
- class="button rounded-lg p-2 disabled:opacity-50 h-9"
254
+ class="button rounded-lg p-2 disabled:opacity-50 h-9 w-9"
255
255
  .disabled="${this.isSubmitDisabled}"
256
256
  >
257
257
  ${Wa}
@@ -300,7 +300,7 @@
300
300
  .name {
301
301
  color: #8c8c8c;
302
302
  }
303
- `],ue([V({type:Object})],se.prototype,"options",2),ue([V()],se.prototype,"disableInput",2),ue([V()],se.prototype,"showTyping",2),ue([dt()],se.prototype,"messages",2),ue([dt()],se.prototype,"inputValue",2),ue([dt()],se.prototype,"internalDisableInput",2),ue([dt()],se.prototype,"internalShowTyping",2),ue([sn("#chat-container")],se.prototype,"chatContainer",2),ue([sn("#message-input")],se.prototype,"inputElement",2),ue([Yn.debounce(1)],se.prototype,"scrollChatToBottom",1),se=ue([ke("iai-chat")],se);var Es={exports:{}};(function(i){(function(e){if(typeof window>"u")return;var t=0,n=!1,s=!1,r="message",a=r.length,o="[iFrameSizer]",l=o.length,d=null,u=window.requestAnimationFrame,p=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),c={},g=null,O=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){he("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function B(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function Y(h,v,M){h.addEventListener(v,M,!1)}function Ze(h,v,M){h.removeEventListener(v,M,!1)}function jn(){var h=["moz","webkit","o","ms"],v;for(v=0;v<h.length&&!u;v+=1)u=window[h[v]+"RequestAnimationFrame"];u?u=u.bind(window):P("setup","RequestAnimationFrame not supported")}function zn(h){var v="Host page: "+h;return window.top!==window.self&&(v=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+h:"Nested host page: "+h),v}function Zn(h){return o+"["+zn(h)+"]"}function bt(h){return c[h]?c[h].log:n}function P(h,v){fi("log",h,v,bt(h))}function Qs(h,v){fi("info",h,v,bt(h))}function he(h,v){fi("warn",h,v,!0)}function fi(h,v,M,_){_===!0&&typeof window.console=="object"&&console[h](Zn(v),M)}function sl(h){function v(){function b(){nr(j),Xs(E),at("onResized",j)}L("Height"),L("Width"),ir(b,j,"init")}function M(){var b=me.slice(l).split(":"),A=b[1]?parseInt(b[1],10):0,H=c[b[0]]&&c[b[0]].iframe,W=getComputedStyle(H);return{iframe:H,id:b[0],height:A+_(W)+R(W),width:b[2],type:b[3]}}function _(b){if(b.boxSizing!=="border-box")return 0;var A=b.paddingTop?parseInt(b.paddingTop,10):0,H=b.paddingBottom?parseInt(b.paddingBottom,10):0;return A+H}function R(b){if(b.boxSizing!=="border-box")return 0;var A=b.borderTopWidth?parseInt(b.borderTopWidth,10):0,H=b.borderBottomWidth?parseInt(b.borderBottomWidth,10):0;return A+H}function L(b){var A=Number(c[E]["max"+b]),H=Number(c[E]["min"+b]),W=b.toLowerCase(),G=Number(j[W]);P(E,"Checking "+W+" is in range "+H+"-"+A),G<H&&(G=H,P(E,"Set "+W+" to min value")),G>A&&(G=A,P(E,"Set "+W+" to max value")),j[W]=""+G}function xe(){function b(){function W(){var ne=0,Ie=!1;for(P(E,"Checking connection is from allowed list of origins: "+H);ne<H.length;ne++)if(H[ne]===A){Ie=!0;break}return Ie}function G(){var ne=c[E]&&c[E].remoteHost;return P(E,"Checking connection is from: "+ne),A===ne}return H.constructor===Array?W():G()}var A=h.origin,H=c[E]&&c[E].checkOrigin;if(H&&""+A!="null"&&!b())throw new Error("Unexpected message received from: "+A+" for "+j.iframe.id+". Message was: "+h.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function rt(){return o===(""+me).slice(0,l)&&me.slice(l).split(":")[0]in c}function Ce(){var b=j.type in{true:1,false:1,undefined:1};return b&&P(E,"Ignoring init message from meta parent page"),b}function Ae(b){return me.slice(me.indexOf(":")+a+b)}function Le(b){P(E,"onMessage passed: {iframe: "+j.iframe.id+", message: "+b+"}"),at("onMessage",{iframe:j.iframe,message:JSON.parse(b)}),P(E,"--")}function _i(){var b=document.body.getBoundingClientRect(),A=j.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:A.height,iframeWidth:A.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(A.top-b.top,10),offsetLeft:parseInt(A.left-b.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function Ln(b,A){function H(){we("Send Page Info","pageInfo:"+_i(),b,A)}al(H,32,A)}function ki(){function b(G,ne){function Ie(){c[W]?Ln(c[W].iframe,W):A()}["scroll","resize"].forEach(function(lr){P(W,G+lr+" listener for sendPageInfo"),ne(window,lr,Ie)})}function A(){b("Remove ",Ze)}function H(){b("Add ",Y)}var W=E;H(),c[W]&&(c[W].stopPageInfo=A)}function $i(){c[E]&&c[E].stopPageInfo&&(c[E].stopPageInfo(),delete c[E].stopPageInfo)}function Ti(){var b=!0;return j.iframe===null&&(he(E,"IFrame ("+j.id+") not found"),b=!1),b}function k(b){var A=b.getBoundingClientRect();return Gs(E),{x:Math.floor(Number(A.left)+Number(d.x)),y:Math.floor(Number(A.top)+Number(d.y))}}function $(b){function A(){d=ne,J(),P(E,"--")}function H(){return{x:Number(j.width)+G.x,y:Number(j.height)+G.y}}function W(){window.parentIFrame?window.parentIFrame["scrollTo"+(b?"Offset":"")](ne.x,ne.y):he(E,"Unable to scroll to requested position, window.parentIFrame not found")}var G=b?k(j.iframe):{x:0,y:0},ne=H();P(E,"Reposition requested from iFrame (offset x:"+G.x+" y:"+G.y+")"),window.top===window.self?A():W()}function J(){at("onScroll",d)===!1?er():Xs(E)}function ee(b){function A(){var Ie=k(ne);P(E,"Moving to in page link (#"+W+") at x: "+Ie.x+" y: "+Ie.y),d={x:Ie.x,y:Ie.y},J(),P(E,"--")}function H(){window.parentIFrame?window.parentIFrame.moveToAnchor(W):P(E,"In page link #"+W+" not found and window.parentIFrame not found")}var W=b.split("#")[1]||"",G=decodeURIComponent(W),ne=document.getElementById(G)||document.getElementsByName(G)[0];ne?A():window.top===window.self?P(E,"In page link #"+W+" not found"):H()}function pe(b){var A={};if(Number(j.width)===0&&Number(j.height)===0){var H=Ae(9).split(":");A={x:H[1],y:H[0]}}else A={x:j.width,y:j.height};at(b,{iframe:j.iframe,screenX:Number(A.x),screenY:Number(A.y),type:j.type})}function at(b,A){return yi(E,b,A)}function Ei(){switch(c[E]&&c[E].firstRun&&Ai(),j.type){case"close":{vi(j.iframe);break}case"message":{Le(Ae(6));break}case"mouseenter":{pe("onMouseEnter");break}case"mouseleave":{pe("onMouseLeave");break}case"autoResize":{c[E].autoResize=JSON.parse(Ae(9));break}case"scrollTo":{$(!1);break}case"scrollToOffset":{$(!0);break}case"pageInfo":{Ln(c[E]&&c[E].iframe,E),ki();break}case"pageInfoStop":{$i();break}case"inPageLink":{ee(Ae(9));break}case"reset":{tr(j);break}case"init":{v(),at("onInit",j.iframe);break}default:Number(j.width)===0&&Number(j.height)===0?he("Unsupported message received ("+j.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):v()}}function Si(b){var A=!0;return c[b]||(A=!1,he(j.type+" No settings for "+b+". Message was: "+me)),A}function Ci(){for(var b in c)we("iFrame requested init",sr(b),c[b].iframe,b)}function Ai(){c[E]&&(c[E].firstRun=!1)}var me=h.data,j={},E=null;me==="[iFrameResizerChild]Ready"?Ci():rt()?(j=M(),E=j.id,c[E]&&(c[E].loaded=!0),!Ce()&&Si(E)&&(P(E,"Received: "+me),Ti()&&xe()&&Ei())):Qs(E,"Ignored: "+me)}function yi(h,v,M){var _=null,R=null;if(c[h])if(_=c[h][v],typeof _=="function")R=_(M);else throw new TypeError(v+" on iFrame["+h+"] is not a function");return R}function Ys(h){var v=h.id;delete c[v]}function vi(h){var v=h.id;if(yi(v,"onClose",v)===!1){P(v,"Close iframe cancelled by onClose event");return}P(v,"Removing iFrame: "+v);try{h.parentNode&&h.parentNode.removeChild(h)}catch(M){he(M)}yi(v,"onClosed",v),P(v,"--"),Ys(h)}function Gs(h){d===null&&(d={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset},P(h,"Get page position: "+d.x+","+d.y))}function Xs(h){d!==null&&(window.scrollTo(d.x,d.y),P(h,"Set page position: "+d.x+","+d.y),er())}function er(){d=null}function tr(h){function v(){nr(h),we("reset","reset",h.iframe,h.id)}P(h.id,"Size reset requested by "+(h.type==="init"?"host page":"iFrame")),Gs(h.id),ir(v,h,"reset")}function nr(h){function v(L){if(!h.id){P("undefined","messageData id not set");return}h.iframe.style[L]=h[L]+"px",P(h.id,"IFrame ("+R+") "+L+" set to "+h[L]+"px")}function M(L){!s&&h[L]==="0"&&(s=!0,P(R,"Hidden iFrame detected, creating visibility listener"),ol())}function _(L){v(L),M(L)}var R=h.iframe.id;c[R]&&(c[R].sizeHeight&&_("height"),c[R].sizeWidth&&_("width"))}function ir(h,v,M){M!==v.type&&u&&!window.jasmine?(P(v.id,"Requesting animation frame"),u(h)):h()}function we(h,v,M,_,R){function L(){var Le=c[_]&&c[_].targetOrigin;P(_,"["+h+"] Sending msg to iframe["+_+"] ("+v+") targetOrigin: "+Le),M.contentWindow.postMessage(o+v,Le)}function xe(){he(_,"["+h+"] IFrame("+_+") not found")}function rt(){M&&"contentWindow"in M&&M.contentWindow!==null?L():xe()}function Ce(){function Le(){c[_]&&!c[_].loaded&&!Ae&&(Ae=!0,he(_,"IFrame has not responded within "+c[_].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}R&&c[_]&&c[_].warningTimeout&&(c[_].msgTimeout=setTimeout(Le,c[_].warningTimeout))}var Ae=!1;_=_||M.id,c[_]&&(rt(),Ce())}function sr(h){return h+":"+c[h].bodyMarginV1+":"+c[h].sizeWidth+":"+c[h].log+":"+c[h].interval+":"+c[h].enablePublicMethods+":"+c[h].autoResize+":"+c[h].bodyMargin+":"+c[h].heightCalculationMethod+":"+c[h].bodyBackground+":"+c[h].bodyPadding+":"+c[h].tolerance+":"+c[h].inPageLinks+":"+c[h].resizeFrom+":"+c[h].widthCalculationMethod+":"+c[h].mouseEvents}function rl(h){return typeof h=="number"}function rr(h,v){function M(){function $(ee){var pe=c[k][ee];pe!==1/0&&pe!==0&&(h.style[ee]=rl(pe)?pe+"px":pe,P(k,"Set "+ee+" = "+h.style[ee]))}function J(ee){if(c[k]["min"+ee]>c[k]["max"+ee])throw new Error("Value for min"+ee+" can not be greater than max"+ee)}J("Height"),J("Width"),$("maxHeight"),$("minHeight"),$("maxWidth"),$("minWidth")}function _(){var $=v&&v.id||O.id+t++;return document.getElementById($)!==null&&($+=t++),$}function R($){if(typeof $!="string")throw new TypeError("Invaild id for iFrame. Expected String");return $===""&&(h.id=$=_(),n=(v||{}).log,P($,"Added missing iframe ID: "+$+" ("+h.src+")")),$}function L(){switch(P(k,"IFrame scrolling "+(c[k]&&c[k].scrolling?"enabled":"disabled")+" for "+k),h.style.overflow=(c[k]&&c[k].scrolling)===!1?"hidden":"auto",c[k]&&c[k].scrolling){case"omit":break;case!0:{h.scrolling="yes";break}case!1:{h.scrolling="no";break}default:h.scrolling=c[k]?c[k].scrolling:"no"}}function xe(){(typeof(c[k]&&c[k].bodyMargin)=="number"||(c[k]&&c[k].bodyMargin)==="0")&&(c[k].bodyMarginV1=c[k].bodyMargin,c[k].bodyMargin=""+c[k].bodyMargin+"px")}function rt(){var $=c[k]&&c[k].firstRun,J=c[k]&&c[k].heightCalculationMethod in p;!$&&J&&tr({iframe:h,height:0,width:0,type:"init"})}function Ce(){c[k]&&(c[k].iframe.iFrameResizer={close:vi.bind(null,c[k].iframe),removeListeners:Ys.bind(null,c[k].iframe),resize:we.bind(null,"Window resize","resize",c[k].iframe),moveToAnchor:function($){we("Move to anchor","moveToAnchor:"+$,c[k].iframe,k)},sendMessage:function($){$=JSON.stringify($),we("Send Message","message:"+$,c[k].iframe,k)}})}function Ae($){function J(){we("iFrame.onload",$,h,e,!0),rt()}function ee(at){if(h.parentNode){var Ei=new at(function(Si){Si.forEach(function(Ci){var Ai=Array.prototype.slice.call(Ci.removedNodes);Ai.forEach(function(me){me===h&&vi(h)})})});Ei.observe(h.parentNode,{childList:!0})}}var pe=B();pe&&ee(pe),Y(h,"load",J),we("init",$,h,e,!0)}function Le($){if(typeof $!="object")throw new TypeError("Options is not an object")}function _i($){for(var J in O)Object.prototype.hasOwnProperty.call(O,J)&&(c[k][J]=Object.prototype.hasOwnProperty.call($,J)?$[J]:O[J])}function Ln($){return $===""||$.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":$}function ki($){var J=$.split("Callback");if(J.length===2){var ee="on"+J[0].charAt(0).toUpperCase()+J[0].slice(1);this[ee]=this[$],delete this[$],he(k,"Deprecated: '"+$+"' has been renamed '"+ee+"'. The old method will be removed in the next major version.")}}function $i($){$=$||{},c[k]=Object.create(null),c[k].iframe=h,c[k].firstRun=!0,c[k].remoteHost=h.src&&h.src.split("/").slice(0,3).join("/"),Le($),Object.keys($).forEach(ki,$),_i($),c[k]&&(c[k].targetOrigin=c[k].checkOrigin===!0?Ln(c[k].remoteHost):"*")}function Ti(){return k in c&&"iFrameResizer"in h}var k=R(h.id);Ti()?he(k,"Ignored iFrame, already setup."):($i(v),L(),M(),xe(),Ae(sr(k)),Ce())}function bi(h,v){g===null&&(g=setTimeout(function(){g=null,h()},v))}var wi={};function al(h,v,M){wi[M]||(wi[M]=setTimeout(function(){wi[M]=null,h()},v))}function ol(){function h(){function R(L){function xe(Ce){return(c[L]&&c[L].iframe.style[Ce])==="0px"}function rt(Ce){return Ce.offsetParent!==null}c[L]&&rt(c[L].iframe)&&(xe("height")||xe("width"))&&we("Visibility change","resize",c[L].iframe,L)}Object.keys(c).forEach(function(L){R(L)})}function v(R){P("window","Mutation observed: "+R[0].target+" "+R[0].type),bi(h,16)}function M(){var R=document.querySelector("body"),L={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},xe=new _(v);xe.observe(R,L)}var _=B();_&&M()}function ll(h){function v(){or("Window "+h,"resize")}P("window","Trigger event: "+h),bi(v,16)}function ar(){function h(){or("Tab Visible","resize")}document.visibilityState!=="hidden"&&(P("document","Trigger event: Visibility change"),bi(h,16))}function or(h,v){function M(_){return c[_]&&c[_].resizeFrom==="parent"&&c[_].autoResize&&!c[_].firstRun}Object.keys(c).forEach(function(_){M(_)&&we(h,v,c[_].iframe,_)})}function cl(){Y(window,"message",sl),Y(window,"resize",function(){ll("resize")}),Y(document,"visibilitychange",ar),Y(document,"-webkit-visibilitychange",ar)}function xi(){function h(_,R){function L(){if(R.tagName){if(R.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+R.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}R&&(L(),rr(R,_),M.push(R))}function v(_){_&&_.enablePublicMethods&&he("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var M;return jn(),cl(),function(_,R){switch(M=[],v(_),typeof R){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(R||"iframe"),h.bind(e,_));break}case"object":{h(_,R);break}default:throw new TypeError("Unexpected data type ("+typeof R+")")}return M}}function dl(h){h.fn?h.fn.iFrameResize||(h.fn.iFrameResize=function(v){function M(_,R){rr(R,v)}return this.filter("iframe").each(M).end()}):Qs("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==e&&dl(window.jQuery),typeof e=="function"&&e.amd?e([],xi):i.exports=xi(),window.iFrameResize=window.iFrameResize||xi()})()})(Es);var Ka=Es.exports;const Ja=Ur(Ka);var Qa=Object.defineProperty,Ya=Object.getOwnPropertyDescriptor,si=(i,e,t,n)=>{for(var s=n>1?void 0:n?Ya(e,t):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Qa(e,t,s),s};let Wt=class extends ie{constructor(){super(...arguments),this.src="",this.showCloseButton=!1}async onLoad(i){Ja({log:!1,heightCalculationMethod:"max",onMessage:({message:e})=>{this.dispatchEvent(new CustomEvent("message-received",{bubbles:!0,composed:!0,detail:e}))}},i.target)}close(){this.dispatchEvent(new CustomEvent("close"))}render(){return z`
303
+ `],ue([V({type:Object})],se.prototype,"options",2),ue([V()],se.prototype,"disableInput",2),ue([V()],se.prototype,"showTyping",2),ue([dt()],se.prototype,"messages",2),ue([dt()],se.prototype,"inputValue",2),ue([dt()],se.prototype,"internalDisableInput",2),ue([dt()],se.prototype,"internalShowTyping",2),ue([sn("#chat-container")],se.prototype,"chatContainer",2),ue([sn("#message-input")],se.prototype,"inputElement",2),ue([Yn.debounce(1)],se.prototype,"scrollChatToBottom",1),se=ue([ke("iai-chat")],se);var Es={exports:{}};(function(i){(function(e){if(typeof window>"u")return;var t=0,n=!1,s=!1,r="message",a=r.length,o="[iFrameSizer]",l=o.length,d=null,u=window.requestAnimationFrame,p=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),c={},g=null,O=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){he("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function U(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function Y(h,v,M){h.addEventListener(v,M,!1)}function Ze(h,v,M){h.removeEventListener(v,M,!1)}function jn(){var h=["moz","webkit","o","ms"],v;for(v=0;v<h.length&&!u;v+=1)u=window[h[v]+"RequestAnimationFrame"];u?u=u.bind(window):P("setup","RequestAnimationFrame not supported")}function zn(h){var v="Host page: "+h;return window.top!==window.self&&(v=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+h:"Nested host page: "+h),v}function Zn(h){return o+"["+zn(h)+"]"}function bt(h){return c[h]?c[h].log:n}function P(h,v){fi("log",h,v,bt(h))}function Qs(h,v){fi("info",h,v,bt(h))}function he(h,v){fi("warn",h,v,!0)}function fi(h,v,M,_){_===!0&&typeof window.console=="object"&&console[h](Zn(v),M)}function sl(h){function v(){function b(){nr(j),Xs(E),at("onResized",j)}L("Height"),L("Width"),ir(b,j,"init")}function M(){var b=me.slice(l).split(":"),A=b[1]?parseInt(b[1],10):0,B=c[b[0]]&&c[b[0]].iframe,W=getComputedStyle(B);return{iframe:B,id:b[0],height:A+_(W)+R(W),width:b[2],type:b[3]}}function _(b){if(b.boxSizing!=="border-box")return 0;var A=b.paddingTop?parseInt(b.paddingTop,10):0,B=b.paddingBottom?parseInt(b.paddingBottom,10):0;return A+B}function R(b){if(b.boxSizing!=="border-box")return 0;var A=b.borderTopWidth?parseInt(b.borderTopWidth,10):0,B=b.borderBottomWidth?parseInt(b.borderBottomWidth,10):0;return A+B}function L(b){var A=Number(c[E]["max"+b]),B=Number(c[E]["min"+b]),W=b.toLowerCase(),G=Number(j[W]);P(E,"Checking "+W+" is in range "+B+"-"+A),G<B&&(G=B,P(E,"Set "+W+" to min value")),G>A&&(G=A,P(E,"Set "+W+" to max value")),j[W]=""+G}function xe(){function b(){function W(){var ne=0,Ie=!1;for(P(E,"Checking connection is from allowed list of origins: "+B);ne<B.length;ne++)if(B[ne]===A){Ie=!0;break}return Ie}function G(){var ne=c[E]&&c[E].remoteHost;return P(E,"Checking connection is from: "+ne),A===ne}return B.constructor===Array?W():G()}var A=h.origin,B=c[E]&&c[E].checkOrigin;if(B&&""+A!="null"&&!b())throw new Error("Unexpected message received from: "+A+" for "+j.iframe.id+". Message was: "+h.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function rt(){return o===(""+me).slice(0,l)&&me.slice(l).split(":")[0]in c}function Ce(){var b=j.type in{true:1,false:1,undefined:1};return b&&P(E,"Ignoring init message from meta parent page"),b}function Ae(b){return me.slice(me.indexOf(":")+a+b)}function Le(b){P(E,"onMessage passed: {iframe: "+j.iframe.id+", message: "+b+"}"),at("onMessage",{iframe:j.iframe,message:JSON.parse(b)}),P(E,"--")}function _i(){var b=document.body.getBoundingClientRect(),A=j.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:A.height,iframeWidth:A.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(A.top-b.top,10),offsetLeft:parseInt(A.left-b.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function Ln(b,A){function B(){we("Send Page Info","pageInfo:"+_i(),b,A)}al(B,32,A)}function ki(){function b(G,ne){function Ie(){c[W]?Ln(c[W].iframe,W):A()}["scroll","resize"].forEach(function(lr){P(W,G+lr+" listener for sendPageInfo"),ne(window,lr,Ie)})}function A(){b("Remove ",Ze)}function B(){b("Add ",Y)}var W=E;B(),c[W]&&(c[W].stopPageInfo=A)}function $i(){c[E]&&c[E].stopPageInfo&&(c[E].stopPageInfo(),delete c[E].stopPageInfo)}function Ti(){var b=!0;return j.iframe===null&&(he(E,"IFrame ("+j.id+") not found"),b=!1),b}function k(b){var A=b.getBoundingClientRect();return Gs(E),{x:Math.floor(Number(A.left)+Number(d.x)),y:Math.floor(Number(A.top)+Number(d.y))}}function $(b){function A(){d=ne,J(),P(E,"--")}function B(){return{x:Number(j.width)+G.x,y:Number(j.height)+G.y}}function W(){window.parentIFrame?window.parentIFrame["scrollTo"+(b?"Offset":"")](ne.x,ne.y):he(E,"Unable to scroll to requested position, window.parentIFrame not found")}var G=b?k(j.iframe):{x:0,y:0},ne=B();P(E,"Reposition requested from iFrame (offset x:"+G.x+" y:"+G.y+")"),window.top===window.self?A():W()}function J(){at("onScroll",d)===!1?er():Xs(E)}function ee(b){function A(){var Ie=k(ne);P(E,"Moving to in page link (#"+W+") at x: "+Ie.x+" y: "+Ie.y),d={x:Ie.x,y:Ie.y},J(),P(E,"--")}function B(){window.parentIFrame?window.parentIFrame.moveToAnchor(W):P(E,"In page link #"+W+" not found and window.parentIFrame not found")}var W=b.split("#")[1]||"",G=decodeURIComponent(W),ne=document.getElementById(G)||document.getElementsByName(G)[0];ne?A():window.top===window.self?P(E,"In page link #"+W+" not found"):B()}function pe(b){var A={};if(Number(j.width)===0&&Number(j.height)===0){var B=Ae(9).split(":");A={x:B[1],y:B[0]}}else A={x:j.width,y:j.height};at(b,{iframe:j.iframe,screenX:Number(A.x),screenY:Number(A.y),type:j.type})}function at(b,A){return yi(E,b,A)}function Ei(){switch(c[E]&&c[E].firstRun&&Ai(),j.type){case"close":{vi(j.iframe);break}case"message":{Le(Ae(6));break}case"mouseenter":{pe("onMouseEnter");break}case"mouseleave":{pe("onMouseLeave");break}case"autoResize":{c[E].autoResize=JSON.parse(Ae(9));break}case"scrollTo":{$(!1);break}case"scrollToOffset":{$(!0);break}case"pageInfo":{Ln(c[E]&&c[E].iframe,E),ki();break}case"pageInfoStop":{$i();break}case"inPageLink":{ee(Ae(9));break}case"reset":{tr(j);break}case"init":{v(),at("onInit",j.iframe);break}default:Number(j.width)===0&&Number(j.height)===0?he("Unsupported message received ("+j.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):v()}}function Si(b){var A=!0;return c[b]||(A=!1,he(j.type+" No settings for "+b+". Message was: "+me)),A}function Ci(){for(var b in c)we("iFrame requested init",sr(b),c[b].iframe,b)}function Ai(){c[E]&&(c[E].firstRun=!1)}var me=h.data,j={},E=null;me==="[iFrameResizerChild]Ready"?Ci():rt()?(j=M(),E=j.id,c[E]&&(c[E].loaded=!0),!Ce()&&Si(E)&&(P(E,"Received: "+me),Ti()&&xe()&&Ei())):Qs(E,"Ignored: "+me)}function yi(h,v,M){var _=null,R=null;if(c[h])if(_=c[h][v],typeof _=="function")R=_(M);else throw new TypeError(v+" on iFrame["+h+"] is not a function");return R}function Ys(h){var v=h.id;delete c[v]}function vi(h){var v=h.id;if(yi(v,"onClose",v)===!1){P(v,"Close iframe cancelled by onClose event");return}P(v,"Removing iFrame: "+v);try{h.parentNode&&h.parentNode.removeChild(h)}catch(M){he(M)}yi(v,"onClosed",v),P(v,"--"),Ys(h)}function Gs(h){d===null&&(d={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset},P(h,"Get page position: "+d.x+","+d.y))}function Xs(h){d!==null&&(window.scrollTo(d.x,d.y),P(h,"Set page position: "+d.x+","+d.y),er())}function er(){d=null}function tr(h){function v(){nr(h),we("reset","reset",h.iframe,h.id)}P(h.id,"Size reset requested by "+(h.type==="init"?"host page":"iFrame")),Gs(h.id),ir(v,h,"reset")}function nr(h){function v(L){if(!h.id){P("undefined","messageData id not set");return}h.iframe.style[L]=h[L]+"px",P(h.id,"IFrame ("+R+") "+L+" set to "+h[L]+"px")}function M(L){!s&&h[L]==="0"&&(s=!0,P(R,"Hidden iFrame detected, creating visibility listener"),ol())}function _(L){v(L),M(L)}var R=h.iframe.id;c[R]&&(c[R].sizeHeight&&_("height"),c[R].sizeWidth&&_("width"))}function ir(h,v,M){M!==v.type&&u&&!window.jasmine?(P(v.id,"Requesting animation frame"),u(h)):h()}function we(h,v,M,_,R){function L(){var Le=c[_]&&c[_].targetOrigin;P(_,"["+h+"] Sending msg to iframe["+_+"] ("+v+") targetOrigin: "+Le),M.contentWindow.postMessage(o+v,Le)}function xe(){he(_,"["+h+"] IFrame("+_+") not found")}function rt(){M&&"contentWindow"in M&&M.contentWindow!==null?L():xe()}function Ce(){function Le(){c[_]&&!c[_].loaded&&!Ae&&(Ae=!0,he(_,"IFrame has not responded within "+c[_].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}R&&c[_]&&c[_].warningTimeout&&(c[_].msgTimeout=setTimeout(Le,c[_].warningTimeout))}var Ae=!1;_=_||M.id,c[_]&&(rt(),Ce())}function sr(h){return h+":"+c[h].bodyMarginV1+":"+c[h].sizeWidth+":"+c[h].log+":"+c[h].interval+":"+c[h].enablePublicMethods+":"+c[h].autoResize+":"+c[h].bodyMargin+":"+c[h].heightCalculationMethod+":"+c[h].bodyBackground+":"+c[h].bodyPadding+":"+c[h].tolerance+":"+c[h].inPageLinks+":"+c[h].resizeFrom+":"+c[h].widthCalculationMethod+":"+c[h].mouseEvents}function rl(h){return typeof h=="number"}function rr(h,v){function M(){function $(ee){var pe=c[k][ee];pe!==1/0&&pe!==0&&(h.style[ee]=rl(pe)?pe+"px":pe,P(k,"Set "+ee+" = "+h.style[ee]))}function J(ee){if(c[k]["min"+ee]>c[k]["max"+ee])throw new Error("Value for min"+ee+" can not be greater than max"+ee)}J("Height"),J("Width"),$("maxHeight"),$("minHeight"),$("maxWidth"),$("minWidth")}function _(){var $=v&&v.id||O.id+t++;return document.getElementById($)!==null&&($+=t++),$}function R($){if(typeof $!="string")throw new TypeError("Invaild id for iFrame. Expected String");return $===""&&(h.id=$=_(),n=(v||{}).log,P($,"Added missing iframe ID: "+$+" ("+h.src+")")),$}function L(){switch(P(k,"IFrame scrolling "+(c[k]&&c[k].scrolling?"enabled":"disabled")+" for "+k),h.style.overflow=(c[k]&&c[k].scrolling)===!1?"hidden":"auto",c[k]&&c[k].scrolling){case"omit":break;case!0:{h.scrolling="yes";break}case!1:{h.scrolling="no";break}default:h.scrolling=c[k]?c[k].scrolling:"no"}}function xe(){(typeof(c[k]&&c[k].bodyMargin)=="number"||(c[k]&&c[k].bodyMargin)==="0")&&(c[k].bodyMarginV1=c[k].bodyMargin,c[k].bodyMargin=""+c[k].bodyMargin+"px")}function rt(){var $=c[k]&&c[k].firstRun,J=c[k]&&c[k].heightCalculationMethod in p;!$&&J&&tr({iframe:h,height:0,width:0,type:"init"})}function Ce(){c[k]&&(c[k].iframe.iFrameResizer={close:vi.bind(null,c[k].iframe),removeListeners:Ys.bind(null,c[k].iframe),resize:we.bind(null,"Window resize","resize",c[k].iframe),moveToAnchor:function($){we("Move to anchor","moveToAnchor:"+$,c[k].iframe,k)},sendMessage:function($){$=JSON.stringify($),we("Send Message","message:"+$,c[k].iframe,k)}})}function Ae($){function J(){we("iFrame.onload",$,h,e,!0),rt()}function ee(at){if(h.parentNode){var Ei=new at(function(Si){Si.forEach(function(Ci){var Ai=Array.prototype.slice.call(Ci.removedNodes);Ai.forEach(function(me){me===h&&vi(h)})})});Ei.observe(h.parentNode,{childList:!0})}}var pe=U();pe&&ee(pe),Y(h,"load",J),we("init",$,h,e,!0)}function Le($){if(typeof $!="object")throw new TypeError("Options is not an object")}function _i($){for(var J in O)Object.prototype.hasOwnProperty.call(O,J)&&(c[k][J]=Object.prototype.hasOwnProperty.call($,J)?$[J]:O[J])}function Ln($){return $===""||$.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":$}function ki($){var J=$.split("Callback");if(J.length===2){var ee="on"+J[0].charAt(0).toUpperCase()+J[0].slice(1);this[ee]=this[$],delete this[$],he(k,"Deprecated: '"+$+"' has been renamed '"+ee+"'. The old method will be removed in the next major version.")}}function $i($){$=$||{},c[k]=Object.create(null),c[k].iframe=h,c[k].firstRun=!0,c[k].remoteHost=h.src&&h.src.split("/").slice(0,3).join("/"),Le($),Object.keys($).forEach(ki,$),_i($),c[k]&&(c[k].targetOrigin=c[k].checkOrigin===!0?Ln(c[k].remoteHost):"*")}function Ti(){return k in c&&"iFrameResizer"in h}var k=R(h.id);Ti()?he(k,"Ignored iFrame, already setup."):($i(v),L(),M(),xe(),Ae(sr(k)),Ce())}function bi(h,v){g===null&&(g=setTimeout(function(){g=null,h()},v))}var wi={};function al(h,v,M){wi[M]||(wi[M]=setTimeout(function(){wi[M]=null,h()},v))}function ol(){function h(){function R(L){function xe(Ce){return(c[L]&&c[L].iframe.style[Ce])==="0px"}function rt(Ce){return Ce.offsetParent!==null}c[L]&&rt(c[L].iframe)&&(xe("height")||xe("width"))&&we("Visibility change","resize",c[L].iframe,L)}Object.keys(c).forEach(function(L){R(L)})}function v(R){P("window","Mutation observed: "+R[0].target+" "+R[0].type),bi(h,16)}function M(){var R=document.querySelector("body"),L={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},xe=new _(v);xe.observe(R,L)}var _=U();_&&M()}function ll(h){function v(){or("Window "+h,"resize")}P("window","Trigger event: "+h),bi(v,16)}function ar(){function h(){or("Tab Visible","resize")}document.visibilityState!=="hidden"&&(P("document","Trigger event: Visibility change"),bi(h,16))}function or(h,v){function M(_){return c[_]&&c[_].resizeFrom==="parent"&&c[_].autoResize&&!c[_].firstRun}Object.keys(c).forEach(function(_){M(_)&&we(h,v,c[_].iframe,_)})}function cl(){Y(window,"message",sl),Y(window,"resize",function(){ll("resize")}),Y(document,"visibilitychange",ar),Y(document,"-webkit-visibilitychange",ar)}function xi(){function h(_,R){function L(){if(R.tagName){if(R.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+R.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}R&&(L(),rr(R,_),M.push(R))}function v(_){_&&_.enablePublicMethods&&he("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var M;return jn(),cl(),function(_,R){switch(M=[],v(_),typeof R){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(R||"iframe"),h.bind(e,_));break}case"object":{h(_,R);break}default:throw new TypeError("Unexpected data type ("+typeof R+")")}return M}}function dl(h){h.fn?h.fn.iFrameResize||(h.fn.iFrameResize=function(v){function M(_,R){rr(R,v)}return this.filter("iframe").each(M).end()}):Qs("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==e&&dl(window.jQuery),typeof e=="function"&&e.amd?e([],xi):i.exports=xi(),window.iFrameResize=window.iFrameResize||xi()})()})(Es);var Ka=Es.exports;const Ja=Ur(Ka);var Qa=Object.defineProperty,Ya=Object.getOwnPropertyDescriptor,si=(i,e,t,n)=>{for(var s=n>1?void 0:n?Ya(e,t):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Qa(e,t,s),s};let Wt=class extends ie{constructor(){super(...arguments),this.src="",this.showCloseButton=!1}async onLoad(i){Ja({log:!1,heightCalculationMethod:"max",onMessage:({message:e})=>{this.dispatchEvent(new CustomEvent("message-received",{bubbles:!0,composed:!0,detail:e}))}},i.target)}close(){this.dispatchEvent(new CustomEvent("close"))}render(){return z`
304
304
  <div class="relative">
305
305
  ${Ne(this.showCloseButton,()=>z`
306
306
  <button class="absolute top-0 right-0 m-2 h-6 text-white focus:outline-none" @click="${this.close}">
@@ -354,7 +354,7 @@
354
354
  * SPDX-License-Identifier: BSD-3-Clause
355
355
  */class ri extends on{constructor(e){if(super(e),this.it=K,e.type!==rn.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===K||e==null)return this._t=void 0,this.it=e;if(e===ge)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}ri.directiveName="unsafeHTML",ri.resultType=1;const Ss=an(ri);function ai(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let tt=ai();function Cs(i){tt=i}const As=/[&<>"']/,eo=new RegExp(As.source,"g"),Is=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,to=new RegExp(Is.source,"g"),no={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Os=i=>no[i];function re(i,e){if(e){if(As.test(i))return i.replace(eo,Os)}else if(Is.test(i))return i.replace(to,Os);return i}const io=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function so(i){return i.replace(io,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const ro=/(^|[^\[])\^/g;function D(i,e){let t=typeof i=="string"?i:i.source;e=e||"";const n={replace:(s,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(ro,"$1"),t=t.replace(s,a),n},getRegex:()=>new RegExp(t,e)};return n}function Ms(i){try{i=encodeURI(i).replace(/%25/g,"%")}catch{return null}return i}const Ft={exec:()=>null};function Rs(i,e){const t=i.replace(/\|/g,(r,a,o)=>{let l=!1,d=a;for(;--d>=0&&o[d]==="\\";)l=!l;return l?"|":" |"}),n=t.split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(/\\\|/g,"|");return n}function $n(i,e,t){const n=i.length;if(n===0)return"";let s=0;for(;s<n;){const r=i.charAt(n-s-1);if(r===e&&!t)s++;else if(r!==e&&t)s++;else break}return i.slice(0,n-s)}function ao(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<i.length;n++)if(i[n]==="\\")n++;else if(i[n]===e[0])t++;else if(i[n]===e[1]&&(t--,t<0))return n;return-1}function Ps(i,e,t,n){const s=e.href,r=e.title?re(e.title):null,a=i[1].replace(/\\([\[\]])/g,"$1");if(i[0].charAt(0)!=="!"){n.state.inLink=!0;const o={type:"link",raw:t,href:s,title:r,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,o}return{type:"image",raw:t,href:s,title:r,text:re(a)}}function oo(i,e){const t=i.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
356
356
  `).map(s=>{const r=s.match(/^\s+/);if(r===null)return s;const[a]=r;return a.length>=n.length?s.slice(n.length):s}).join(`
357
- `)}class Tn{constructor(e){U(this,"options"),U(this,"rules"),U(this,"lexer"),this.options=e||tt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:$n(n,`
357
+ `)}class Tn{constructor(e){H(this,"options"),H(this,"rules"),H(this,"lexer"),this.options=e||tt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:$n(n,`
358
358
  `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],s=oo(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const s=$n(n,"#");(this.options.pedantic||!s||/ $/.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
359
359
  $1`);n=$n(n.replace(/^ *>[ \t]?/gm,""),`
360
360
  `);const s=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(n);return this.lexer.state.top=s,{type:"blockquote",raw:t[0],tokens:r,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const a=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let o="",l="",d=!1;for(;e;){let u=!1;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;o=t[0],e=e.substring(o.length);let p=t[2].split(`
@@ -364,10 +364,10 @@
364
364
  `,1)[0];if(c=bt,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),zn.test(c)||Zn.test(c)||Ze.test(c)||jn.test(e))break;if(c.search(/[^ ]/)>=g||!c.trim())l+=`
365
365
  `+c.slice(g);else{if(O||p.search(/[^ ]/)>=4||zn.test(p)||Zn.test(p)||jn.test(p))break;l+=`
366
366
  `+c}!O&&!c.trim()&&(O=!0),o+=bt+`
367
- `,e=e.substring(bt.length+1),p=c.slice(g)}}r.loose||(d?r.loose=!0:/\n *\n *$/.test(o)&&(d=!0));let B=null,Y;this.options.gfm&&(B=/^\[[ xX]\] /.exec(l),B&&(Y=B[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:o,task:!!B,checked:Y,loose:!1,text:l,tokens:[]}),r.raw+=o}r.items[r.items.length-1].raw=o.trimEnd(),r.items[r.items.length-1].text=l.trimEnd(),r.raw=r.raw.trimEnd();for(let u=0;u<r.items.length;u++)if(this.lexer.state.top=!1,r.items[u].tokens=this.lexer.blockTokens(r.items[u].text,[]),!r.loose){const p=r.items[u].tokens.filter(g=>g.type==="space"),c=p.length>0&&p.some(g=>/\n.*\n/.test(g.raw));r.loose=c}if(r.loose)for(let u=0;u<r.items.length;u++)r.items[u].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),s=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=Rs(t[1]),s=t[2].replace(/^\||\| *$/g,"").split("|"),r=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
367
+ `,e=e.substring(bt.length+1),p=c.slice(g)}}r.loose||(d?r.loose=!0:/\n *\n *$/.test(o)&&(d=!0));let U=null,Y;this.options.gfm&&(U=/^\[[ xX]\] /.exec(l),U&&(Y=U[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:o,task:!!U,checked:Y,loose:!1,text:l,tokens:[]}),r.raw+=o}r.items[r.items.length-1].raw=o.trimEnd(),r.items[r.items.length-1].text=l.trimEnd(),r.raw=r.raw.trimEnd();for(let u=0;u<r.items.length;u++)if(this.lexer.state.top=!1,r.items[u].tokens=this.lexer.blockTokens(r.items[u].text,[]),!r.loose){const p=r.items[u].tokens.filter(g=>g.type==="space"),c=p.length>0&&p.some(g=>/\n.*\n/.test(g.raw));r.loose=c}if(r.loose)for(let u=0;u<r.items.length;u++)r.items[u].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),s=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=Rs(t[1]),s=t[2].replace(/^\||\| *$/g,"").split("|"),r=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
368
368
  `):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const o of s)/^ *-+: *$/.test(o)?a.align.push("right"):/^ *:-+: *$/.test(o)?a.align.push("center"):/^ *:-+ *$/.test(o)?a.align.push("left"):a.align.push(null);for(const o of n)a.header.push({text:o,tokens:this.lexer.inline(o)});for(const o of r)a.rows.push(Rs(o,a.header.length).map(l=>({text:l,tokens:this.lexer.inline(l)})));return a}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
369
369
  `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:re(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const a=$n(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{const a=ao(t[2],"()");if(a>-1){const o=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let s=t[2],r="";if(this.options.pedantic){const a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);a&&(s=a[1],r=a[3])}else r=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^</.test(s)&&(this.options.pedantic&&!/>$/.test(n)?s=s.slice(1):s=s.slice(1,-1)),Ps(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const s=(n[2]||n[1]).replace(/\s+/g," "),r=t[s.toLowerCase()];if(!r){const a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Ps(n,r,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||s[3]&&n.match(/[\p{L}\p{N}]/u))&&(!(s[1]||s[2])||!n||this.rules.inline.punctuation.exec(n))){const r=[...s[0]].length-1;let a,o,l=r,d=0;const u=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+r);(s=u.exec(t))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(o=[...a].length,s[3]||s[4]){l+=o;continue}else if((s[5]||s[6])&&r%3&&!((r+o)%3)){d+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+d);const p=[...s[0]][0].length,c=e.slice(0,r+s.index+p+o);if(Math.min(r,o)%2){const O=c.slice(1,-1);return{type:"em",raw:c,text:O,tokens:this.lexer.inlineTokens(O)}}const g=c.slice(2,-2);return{type:"strong",raw:c,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const s=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return s&&r&&(n=n.substring(1,n.length-1)),n=re(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,s;return t[2]==="@"?(n=re(t[1]),s="mailto:"+n):(n=re(t[1]),s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var t;let n;if(n=this.rules.inline.url.exec(e)){let s,r;if(n[2]==="@")s=re(n[0]),r="mailto:"+s;else{let a;do a=n[0],n[0]=((t=this.rules.inline._backpedal.exec(n[0]))==null?void 0:t[0])??"";while(a!==n[0]);s=re(n[0]),n[1]==="www."?r="http://"+n[0]:r=n[0]}return{type:"link",raw:n[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=re(t[0]),{type:"text",raw:t[0],text:n}}}}const lo=/^(?: *(?:\n|$))+/,co=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,uo=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Vt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ho=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ns=/(?:[*+-]|\d{1,9}[.)])/,js=D(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Ns).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),oi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,po=/^[^\n]+/,li=/(?!\s*\])(?:\\.|[^\[\]\\])+/,mo=D(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",li).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),go=D(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ns).getRegex(),En="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ci=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fo=D("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",ci).replace("tag",En).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),zs=D(oi).replace("hr",Vt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",En).getRegex(),yo=D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",zs).getRegex(),di={blockquote:yo,code:co,def:mo,fences:uo,heading:ho,hr:Vt,html:fo,lheading:js,list:go,newline:lo,paragraph:zs,table:Ft,text:po},Zs=D("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Vt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",En).getRegex(),vo={...di,table:Zs,paragraph:D(oi).replace("hr",Vt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Zs).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",En).getRegex()},bo={...di,html:D(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ci).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:D(oi).replace("hr",Vt).replace("heading",` *#{1,6} *[^
370
- ]`).replace("lheading",js).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ls=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wo=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ds=/^( {2,}|\\)\n(?!\s*$)/,xo=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,qt="\\p{P}\\p{S}",_o=D(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,qt).getRegex(),ko=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,$o=D(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,qt).getRegex(),To=D("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,qt).getRegex(),Eo=D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,qt).getRegex(),So=D(/\\([punct])/,"gu").replace(/punct/g,qt).getRegex(),Co=D(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ao=D(ci).replace("(?:-->|$)","-->").getRegex(),Io=D("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ao).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Sn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Oo=D(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Sn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Us=D(/^!?\[(label)\]\[(ref)\]/).replace("label",Sn).replace("ref",li).getRegex(),Hs=D(/^!?\[(ref)\](?:\[\])?/).replace("ref",li).getRegex(),Mo=D("reflink|nolink(?!\\()","g").replace("reflink",Us).replace("nolink",Hs).getRegex(),ui={_backpedal:Ft,anyPunctuation:So,autolink:Co,blockSkip:ko,br:Ds,code:wo,del:Ft,emStrongLDelim:$o,emStrongRDelimAst:To,emStrongRDelimUnd:Eo,escape:Ls,link:Oo,nolink:Hs,punctuation:_o,reflink:Us,reflinkSearch:Mo,tag:Io,text:xo,url:Ft},Ro={...ui,link:D(/^!?\[(label)\]\((.*?)\)/).replace("label",Sn).getRegex(),reflink:D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Sn).getRegex()},hi={...ui,escape:D(Ls).replace("])","~|])").getRegex(),url:D(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Po={...hi,br:D(Ds).replace("{2,}","*").getRegex(),text:D(hi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Cn={normal:di,gfm:vo,pedantic:bo},Kt={normal:ui,gfm:hi,breaks:Po,pedantic:Ro};class ve{constructor(e){U(this,"tokens"),U(this,"options"),U(this,"state"),U(this,"tokenizer"),U(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||tt,this.options.tokenizer=this.options.tokenizer||new Tn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Cn.normal,inline:Kt.normal};this.options.pedantic?(t.block=Cn.pedantic,t.inline=Kt.pedantic):this.options.gfm&&(t.block=Cn.gfm,this.options.breaks?t.inline=Kt.breaks:t.inline=Kt.gfm),this.tokenizer.rules=t}static get rules(){return{block:Cn,inline:Kt}}static lex(e,t){return new ve(t).lex(e)}static lexInline(e,t){return new ve(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
370
+ ]`).replace("lheading",js).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ls=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wo=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ds=/^( {2,}|\\)\n(?!\s*$)/,xo=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,qt="\\p{P}\\p{S}",_o=D(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,qt).getRegex(),ko=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,$o=D(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,qt).getRegex(),To=D("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,qt).getRegex(),Eo=D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,qt).getRegex(),So=D(/\\([punct])/,"gu").replace(/punct/g,qt).getRegex(),Co=D(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ao=D(ci).replace("(?:-->|$)","-->").getRegex(),Io=D("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ao).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Sn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Oo=D(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Sn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Us=D(/^!?\[(label)\]\[(ref)\]/).replace("label",Sn).replace("ref",li).getRegex(),Hs=D(/^!?\[(ref)\](?:\[\])?/).replace("ref",li).getRegex(),Mo=D("reflink|nolink(?!\\()","g").replace("reflink",Us).replace("nolink",Hs).getRegex(),ui={_backpedal:Ft,anyPunctuation:So,autolink:Co,blockSkip:ko,br:Ds,code:wo,del:Ft,emStrongLDelim:$o,emStrongRDelimAst:To,emStrongRDelimUnd:Eo,escape:Ls,link:Oo,nolink:Hs,punctuation:_o,reflink:Us,reflinkSearch:Mo,tag:Io,text:xo,url:Ft},Ro={...ui,link:D(/^!?\[(label)\]\((.*?)\)/).replace("label",Sn).getRegex(),reflink:D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Sn).getRegex()},hi={...ui,escape:D(Ls).replace("])","~|])").getRegex(),url:D(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Po={...hi,br:D(Ds).replace("{2,}","*").getRegex(),text:D(hi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Cn={normal:di,gfm:vo,pedantic:bo},Kt={normal:ui,gfm:hi,breaks:Po,pedantic:Ro};class ve{constructor(e){H(this,"tokens"),H(this,"options"),H(this,"state"),H(this,"tokenizer"),H(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||tt,this.options.tokenizer=this.options.tokenizer||new Tn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Cn.normal,inline:Kt.normal};this.options.pedantic?(t.block=Cn.pedantic,t.inline=Kt.pedantic):this.options.gfm&&(t.block=Cn.gfm,this.options.breaks?t.inline=Kt.breaks:t.inline=Kt.gfm),this.tokenizer.rules=t}static get rules(){return{block:Cn,inline:Kt}}static lex(e,t){return new ve(t).lex(e)}static lexInline(e,t){return new ve(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
371
371
  `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(o,l,d)=>l+" ".repeat(d.length));let n,s,r,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(o=>(n=o.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=`
372
372
  `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=`
373
373
  `+n.raw,s.text+=`
@@ -377,7 +377,7 @@
377
377
  `+n.raw,s.text+=`
378
378
  `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),a=r.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&s.type==="text"?(s.raw+=`
379
379
  `+n.raw,s.text+=`
380
- `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,r,a=e,o,l,d;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(d=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,a,d)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(r=e,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const p=e.slice(1);let c;this.options.extensions.startInline.forEach(g=>{c=g.call({lexer:this},p),typeof c=="number"&&c>=0&&(u=Math.min(u,c))}),u<1/0&&u>=0&&(r=e.substring(0,u+1))}if(n=this.tokenizer.inlineText(r)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(d=n.raw.slice(-1)),l=!0,s=t[t.length-1],s&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}}class An{constructor(e){U(this,"options"),this.options=e||tt}code(e,t,n){var s;const r=(s=(t||"").match(/^\S*/))==null?void 0:s[0];return e=e.replace(/\n$/,"")+`
380
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,r,a=e,o,l,d;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(d=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,a,d)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(r=e,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const p=e.slice(1);let c;this.options.extensions.startInline.forEach(g=>{c=g.call({lexer:this},p),typeof c=="number"&&c>=0&&(u=Math.min(u,c))}),u<1/0&&u>=0&&(r=e.substring(0,u+1))}if(n=this.tokenizer.inlineText(r)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(d=n.raw.slice(-1)),l=!0,s=t[t.length-1],s&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}}class An{constructor(e){H(this,"options"),this.options=e||tt}code(e,t,n){var s;const r=(s=(t||"").match(/^\S*/))==null?void 0:s[0];return e=e.replace(/\n$/,"")+`
381
381
  `,r?'<pre><code class="language-'+re(r)+'">'+(n?e:re(e,!0))+`</code></pre>
382
382
  `:"<pre><code>"+(n?e:re(e,!0))+`</code></pre>
383
383
  `}blockquote(e){return`<blockquote>
@@ -395,8 +395,8 @@ ${e}</blockquote>
395
395
  `}tablerow(e){return`<tr>
396
396
  ${e}</tr>
397
397
  `}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
398
- `}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const s=Ms(e);if(s===null)return n;e=s;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){const s=Ms(e);if(s===null)return n;e=s;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=">",r}text(e){return e}}class pi{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class be{constructor(e){U(this,"options"),U(this,"renderer"),U(this,"textRenderer"),this.options=e||tt,this.options.renderer=this.options.renderer||new An,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new pi}static parse(e,t){return new be(t).parse(e)}static parseInline(e,t){return new be(t).parseInline(e)}parse(e,t=!0){let n="";for(let s=0;s<e.length;s++){const r=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const a=r,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=o||"";continue}}switch(r.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{const a=r;n+=this.renderer.heading(this.parseInline(a.tokens),a.depth,so(this.parseInline(a.tokens,this.textRenderer)));continue}case"code":{const a=r;n+=this.renderer.code(a.text,a.lang,!!a.escaped);continue}case"table":{const a=r;let o="",l="";for(let u=0;u<a.header.length;u++)l+=this.renderer.tablecell(this.parseInline(a.header[u].tokens),{header:!0,align:a.align[u]});o+=this.renderer.tablerow(l);let d="";for(let u=0;u<a.rows.length;u++){const p=a.rows[u];l="";for(let c=0;c<p.length;c++)l+=this.renderer.tablecell(this.parseInline(p[c].tokens),{header:!1,align:a.align[c]});d+=this.renderer.tablerow(l)}n+=this.renderer.table(o,d);continue}case"blockquote":{const a=r,o=this.parse(a.tokens);n+=this.renderer.blockquote(o);continue}case"list":{const a=r,o=a.ordered,l=a.start,d=a.loose;let u="";for(let p=0;p<a.items.length;p++){const c=a.items[p],g=c.checked,O=c.task;let B="";if(c.task){const Y=this.renderer.checkbox(!!g);d?c.tokens.length>0&&c.tokens[0].type==="paragraph"?(c.tokens[0].text=Y+" "+c.tokens[0].text,c.tokens[0].tokens&&c.tokens[0].tokens.length>0&&c.tokens[0].tokens[0].type==="text"&&(c.tokens[0].tokens[0].text=Y+" "+c.tokens[0].tokens[0].text)):c.tokens.unshift({type:"text",text:Y+" "}):B+=Y+" "}B+=this.parse(c.tokens,d),u+=this.renderer.listitem(B,O,!!g)}n+=this.renderer.list(u,o,l);continue}case"html":{const a=r;n+=this.renderer.html(a.text,a.block);continue}case"paragraph":{const a=r;n+=this.renderer.paragraph(this.parseInline(a.tokens));continue}case"text":{let a=r,o=a.tokens?this.parseInline(a.tokens):a.text;for(;s+1<e.length&&e[s+1].type==="text";)a=e[++s],o+=`
399
- `+(a.tokens?this.parseInline(a.tokens):a.text);n+=t?this.renderer.paragraph(o):o;continue}default:{const a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let s=0;s<e.length;s++){const r=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=a||"";continue}}switch(r.type){case"escape":{const a=r;n+=t.text(a.text);break}case"html":{const a=r;n+=t.html(a.text);break}case"link":{const a=r;n+=t.link(a.href,a.title,this.parseInline(a.tokens,t));break}case"image":{const a=r;n+=t.image(a.href,a.title,a.text);break}case"strong":{const a=r;n+=t.strong(this.parseInline(a.tokens,t));break}case"em":{const a=r;n+=t.em(this.parseInline(a.tokens,t));break}case"codespan":{const a=r;n+=t.codespan(a.text);break}case"br":{n+=t.br();break}case"del":{const a=r;n+=t.del(this.parseInline(a.tokens,t));break}case"text":{const a=r;n+=t.text(a.text);break}default:{const a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}}class Jt{constructor(e){U(this,"options"),this.options=e||tt}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}U(Jt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var In,mi,gi,Bs;class No{constructor(...e){Oi(this,In),Oi(this,gi),U(this,"defaults",ai()),U(this,"options",this.setOptions),U(this,"parse",Un(this,In,mi).call(this,ve.lex,be.parse)),U(this,"parseInline",Un(this,In,mi).call(this,ve.lexInline,be.parseInline)),U(this,"Parser",be),U(this,"Renderer",An),U(this,"TextRenderer",pi),U(this,"Lexer",ve),U(this,"Tokenizer",Tn),U(this,"Hooks",Jt),this.use(...e)}walkTokens(e,t){var n,s;let r=[];for(const a of e)switch(r=r.concat(t.call(this,a)),a.type){case"table":{const o=a;for(const l of o.header)r=r.concat(this.walkTokens(l.tokens,t));for(const l of o.rows)for(const d of l)r=r.concat(this.walkTokens(d.tokens,t));break}case"list":{const o=a;r=r.concat(this.walkTokens(o.items,t));break}default:{const o=a;(s=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&s[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{const d=o[l].flat(1/0);r=r.concat(this.walkTokens(d,t))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const a=t.renderers[r.name];a?t.renderers[r.name]=function(...o){let l=r.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const a=t[r.level];a?a.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),s.extensions=t),n.renderer){const r=this.defaults.renderer||new An(this.defaults);for(const a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(a==="options")continue;const o=a,l=n.renderer[o],d=r[o];r[o]=(...u)=>{let p=l.apply(r,u);return p===!1&&(p=d.apply(r,u)),p||""}}s.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new Tn(this.defaults);for(const a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const o=a,l=n.tokenizer[o],d=r[o];r[o]=(...u)=>{let p=l.apply(r,u);return p===!1&&(p=d.apply(r,u)),p}}s.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new Jt;for(const a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(a==="options")continue;const o=a,l=n.hooks[o],d=r[o];Jt.passThroughHooks.has(a)?r[o]=u=>{if(this.defaults.async)return Promise.resolve(l.call(r,u)).then(c=>d.call(r,c));const p=l.call(r,u);return d.call(r,p)}:r[o]=(...u)=>{let p=l.apply(r,u);return p===!1&&(p=d.apply(r,u)),p}}s.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,a=n.walkTokens;s.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),r&&(l=l.concat(r.call(this,o))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ve.lex(e,t??this.defaults)}parser(e,t){return be.parse(e,t??this.defaults)}}In=new WeakSet,mi=function(i,e){return(t,n)=>{const s={...n},r={...this.defaults,...s};this.defaults.async===!0&&s.async===!1&&(r.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),r.async=!0);const a=Un(this,gi,Bs).call(this,!!r.silent,!!r.async);if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(r.hooks&&(r.hooks.options=r),r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(t):t).then(o=>i(o,r)).then(o=>r.hooks?r.hooks.processAllTokens(o):o).then(o=>r.walkTokens?Promise.all(this.walkTokens(o,r.walkTokens)).then(()=>o):o).then(o=>e(o,r)).then(o=>r.hooks?r.hooks.postprocess(o):o).catch(a);try{r.hooks&&(t=r.hooks.preprocess(t));let o=i(t,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let l=e(o,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(o){return a(o)}}},gi=new WeakSet,Bs=function(i,e){return t=>{if(t.message+=`
398
+ `}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const s=Ms(e);if(s===null)return n;e=s;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){const s=Ms(e);if(s===null)return n;e=s;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=">",r}text(e){return e}}class pi{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class be{constructor(e){H(this,"options"),H(this,"renderer"),H(this,"textRenderer"),this.options=e||tt,this.options.renderer=this.options.renderer||new An,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new pi}static parse(e,t){return new be(t).parse(e)}static parseInline(e,t){return new be(t).parseInline(e)}parse(e,t=!0){let n="";for(let s=0;s<e.length;s++){const r=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const a=r,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=o||"";continue}}switch(r.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{const a=r;n+=this.renderer.heading(this.parseInline(a.tokens),a.depth,so(this.parseInline(a.tokens,this.textRenderer)));continue}case"code":{const a=r;n+=this.renderer.code(a.text,a.lang,!!a.escaped);continue}case"table":{const a=r;let o="",l="";for(let u=0;u<a.header.length;u++)l+=this.renderer.tablecell(this.parseInline(a.header[u].tokens),{header:!0,align:a.align[u]});o+=this.renderer.tablerow(l);let d="";for(let u=0;u<a.rows.length;u++){const p=a.rows[u];l="";for(let c=0;c<p.length;c++)l+=this.renderer.tablecell(this.parseInline(p[c].tokens),{header:!1,align:a.align[c]});d+=this.renderer.tablerow(l)}n+=this.renderer.table(o,d);continue}case"blockquote":{const a=r,o=this.parse(a.tokens);n+=this.renderer.blockquote(o);continue}case"list":{const a=r,o=a.ordered,l=a.start,d=a.loose;let u="";for(let p=0;p<a.items.length;p++){const c=a.items[p],g=c.checked,O=c.task;let U="";if(c.task){const Y=this.renderer.checkbox(!!g);d?c.tokens.length>0&&c.tokens[0].type==="paragraph"?(c.tokens[0].text=Y+" "+c.tokens[0].text,c.tokens[0].tokens&&c.tokens[0].tokens.length>0&&c.tokens[0].tokens[0].type==="text"&&(c.tokens[0].tokens[0].text=Y+" "+c.tokens[0].tokens[0].text)):c.tokens.unshift({type:"text",text:Y+" "}):U+=Y+" "}U+=this.parse(c.tokens,d),u+=this.renderer.listitem(U,O,!!g)}n+=this.renderer.list(u,o,l);continue}case"html":{const a=r;n+=this.renderer.html(a.text,a.block);continue}case"paragraph":{const a=r;n+=this.renderer.paragraph(this.parseInline(a.tokens));continue}case"text":{let a=r,o=a.tokens?this.parseInline(a.tokens):a.text;for(;s+1<e.length&&e[s+1].type==="text";)a=e[++s],o+=`
399
+ `+(a.tokens?this.parseInline(a.tokens):a.text);n+=t?this.renderer.paragraph(o):o;continue}default:{const a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let s=0;s<e.length;s++){const r=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=a||"";continue}}switch(r.type){case"escape":{const a=r;n+=t.text(a.text);break}case"html":{const a=r;n+=t.html(a.text);break}case"link":{const a=r;n+=t.link(a.href,a.title,this.parseInline(a.tokens,t));break}case"image":{const a=r;n+=t.image(a.href,a.title,a.text);break}case"strong":{const a=r;n+=t.strong(this.parseInline(a.tokens,t));break}case"em":{const a=r;n+=t.em(this.parseInline(a.tokens,t));break}case"codespan":{const a=r;n+=t.codespan(a.text);break}case"br":{n+=t.br();break}case"del":{const a=r;n+=t.del(this.parseInline(a.tokens,t));break}case"text":{const a=r;n+=t.text(a.text);break}default:{const a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}}class Jt{constructor(e){H(this,"options"),this.options=e||tt}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}H(Jt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var In,mi,gi,Bs;class No{constructor(...e){Oi(this,In),Oi(this,gi),H(this,"defaults",ai()),H(this,"options",this.setOptions),H(this,"parse",Un(this,In,mi).call(this,ve.lex,be.parse)),H(this,"parseInline",Un(this,In,mi).call(this,ve.lexInline,be.parseInline)),H(this,"Parser",be),H(this,"Renderer",An),H(this,"TextRenderer",pi),H(this,"Lexer",ve),H(this,"Tokenizer",Tn),H(this,"Hooks",Jt),this.use(...e)}walkTokens(e,t){var n,s;let r=[];for(const a of e)switch(r=r.concat(t.call(this,a)),a.type){case"table":{const o=a;for(const l of o.header)r=r.concat(this.walkTokens(l.tokens,t));for(const l of o.rows)for(const d of l)r=r.concat(this.walkTokens(d.tokens,t));break}case"list":{const o=a;r=r.concat(this.walkTokens(o.items,t));break}default:{const o=a;(s=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&s[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{const d=o[l].flat(1/0);r=r.concat(this.walkTokens(d,t))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const a=t.renderers[r.name];a?t.renderers[r.name]=function(...o){let l=r.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const a=t[r.level];a?a.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),s.extensions=t),n.renderer){const r=this.defaults.renderer||new An(this.defaults);for(const a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(a==="options")continue;const o=a,l=n.renderer[o],d=r[o];r[o]=(...u)=>{let p=l.apply(r,u);return p===!1&&(p=d.apply(r,u)),p||""}}s.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new Tn(this.defaults);for(const a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const o=a,l=n.tokenizer[o],d=r[o];r[o]=(...u)=>{let p=l.apply(r,u);return p===!1&&(p=d.apply(r,u)),p}}s.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new Jt;for(const a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(a==="options")continue;const o=a,l=n.hooks[o],d=r[o];Jt.passThroughHooks.has(a)?r[o]=u=>{if(this.defaults.async)return Promise.resolve(l.call(r,u)).then(c=>d.call(r,c));const p=l.call(r,u);return d.call(r,p)}:r[o]=(...u)=>{let p=l.apply(r,u);return p===!1&&(p=d.apply(r,u)),p}}s.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,a=n.walkTokens;s.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),r&&(l=l.concat(r.call(this,o))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ve.lex(e,t??this.defaults)}parser(e,t){return be.parse(e,t??this.defaults)}}In=new WeakSet,mi=function(i,e){return(t,n)=>{const s={...n},r={...this.defaults,...s};this.defaults.async===!0&&s.async===!1&&(r.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),r.async=!0);const a=Un(this,gi,Bs).call(this,!!r.silent,!!r.async);if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(r.hooks&&(r.hooks.options=r),r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(t):t).then(o=>i(o,r)).then(o=>r.hooks?r.hooks.processAllTokens(o):o).then(o=>r.walkTokens?Promise.all(this.walkTokens(o,r.walkTokens)).then(()=>o):o).then(o=>e(o,r)).then(o=>r.hooks?r.hooks.postprocess(o):o).catch(a);try{r.hooks&&(t=r.hooks.preprocess(t));let o=i(t,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let l=e(o,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(o){return a(o)}}},gi=new WeakSet,Bs=function(i,e){return t=>{if(t.message+=`
400
400
  Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An error occurred:</p><pre>"+re(t.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(t);throw t}};const nt=new No;function Z(i,e){return nt.parse(i,e)}Z.options=Z.setOptions=function(i){return nt.setOptions(i),Z.defaults=nt.defaults,Cs(Z.defaults),Z},Z.getDefaults=ai,Z.defaults=tt,Z.use=function(...i){return nt.use(...i),Z.defaults=nt.defaults,Cs(Z.defaults),Z},Z.walkTokens=function(i,e){return nt.walkTokens(i,e)},Z.parseInline=nt.parseInline,Z.Parser=be,Z.parser=be.parse,Z.Renderer=An,Z.TextRenderer=pi,Z.Lexer=ve,Z.lexer=ve.lex,Z.Tokenizer=Tn,Z.Hooks=Jt,Z.parse=Z,Z.options,Z.setOptions,Z.use,Z.walkTokens,Z.parseInline,be.parse,ve.lex;function jo(i){return i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ws(i,e=""){return Object.keys(i).reduce((t,n)=>{const s=jo(n),r=e?`${e}-${s}`:s;return typeof i[n]=="object"&&i[n]!==null?Object.assign(t,Ws(i[n],r)):t[r]=i[n],t},{})}function zo(i){const e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return i.replace(/[&<>"']/g,t=>e[t])}function Fs(i){const e=zo(i);return Z.parse(e)}var Zo=Object.defineProperty,Lo=Object.getOwnPropertyDescriptor,Vs=(i,e,t,n)=>{for(var s=n>1?void 0:n?Lo(e,t):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(n?a(e,t,s):a(s))||s);return n&&s&&Zo(e,t,s),s};let On=class extends ie{constructor(){super(...arguments),this.content=""}get htmlContent(){return Fs(this.content)}render(){return z`
401
401
  <div class="flex items-end mr-20">
402
402
  <div class="message rounded-lg px-4 py-2 flex flex-col gap-3">
@@ -474,11 +474,11 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
474
474
  </div>
475
475
  `)}
476
476
  </iai-chat-carousel>
477
- `}function Jo(i){return async function({id:t,params:n,chatWindow:s}){s.setInputDisabled(!0);const r={...n.guestCardId&&{guestCardId:n.guestCardId},...n.customerFirstName&&{firstName:n.customerFirstName},...n.customerLastName&&{lastName:n.customerLastName},...n.customerEmail&&{email:n.customerEmail},...n.customerPhoneNumber&&{phone:n.customerPhoneNumber},...n.desiredMoveInDate&&{moveInDate:n.desiredMoveInDate}},a=document.createElement("iai-chat-iframe-modal");a.title="Schedule a Tour",a.src=`${i}?${new URLSearchParams(r).toString()}`,a.showHeader=!1;const o=()=>{a.remove(),window.removeEventListener("beforeunload",u),s.setInputDisabled(!1)},l=async({detail:p})=>{if(p.type!=="tourScheduled")return;const{tourType:c,tourDate:g,tourTime:O}=p;o(),s.addMessage({role:"system",content:"Your tour has been scheduled!"}),await s.sendFunctionCallResponse(t,{status:"scheduled",tourType:c,tourDate:g,tourTime:O},!0)},d=async()=>{o(),s.addMessage({role:"system",content:"Tour Scheduler Closed"}),await s.sendFunctionCallResponse(t,{status:"canceled"},!0)},u=async()=>{o(),s.addMessage({role:"system",content:"Tour Scheduler Closed"})};a.addEventListener("message-received",l),a.addEventListener("close",d),window.addEventListener("beforeunload",u),document.body.appendChild(a),s.addMessage({role:"system",content:"Tour Scheduler Opened"})}}function Ks(i){return{all:i=i||new Map,on:function(e,t){var n=i.get(e);n?n.push(t):i.set(e,[t])},off:function(e,t){var n=i.get(e);n&&(t?n.splice(n.indexOf(t)>>>0,1):i.set(e,[]))},emit:function(e,t){var n=i.get(e);n&&n.slice().map(function(s){s(t)}),(n=i.get("*"))&&n.slice().map(function(s){s(e,t)})}}}class Qo{constructor(e){this.chatWsUrl=e,this._emitter=Ks(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),this.reconnectCodes=new Set([1006]),this.reconnectAttempts=0,this.maxReconnectAttempts=10}connect(){const e=new WebSocket(this.chatWsUrl);e.onopen=async()=>{this.reconnectAttempts=0,e.send(JSON.stringify({type:"ready"}))},e.onmessage=t=>{const n=JSON.parse(t.data);this._emitter.emit(n.type,n.data)},e.onclose=t=>{console.log("Disconnected: ",t.code,t.reason||"No reason provided"),this._emitter.emit("disconnected",t),this.reconnectCodes.has(t.code)&&this.reconnectAttempts<this.maxReconnectAttempts&&(console.log("Reconnecting..."),this._emitter.emit("reconnecting"),this.reconnectAttempts++,setTimeout(()=>this.connect(),this.reconnectAttempts*1e3))},e.onerror=t=>{console.log("Error:",t),this._emitter.emit("error",t)},this.ws=e}reconnect(){this.reconnectAttempts=0,this.connect()}disconnect(){var e;(e=this.ws)==null||e.close()}destroy(){this.disconnect(),this._emitter.all.clear()}}var Pn;(i=>{(e=>{e.TEXT="TEXT"})(i.MessageType||(i.MessageType={})),(e=>{e.DELIVERED="DELIVERED",e.READ="READ",e.FAILED="FAILED"})(i.AcknowledgeType||(i.AcknowledgeType={})),(e=>{e.GENERIC="GENERIC",e.SMS="SMS",e.RCS="RCS",e.FACEBOOK="FACEBOOK",e.TWITTER="TWITTER",e.WHATSAPP="WHATSAPP",e.WECHAT="WECHAT",e.QQMOBILE="QQMOBILE",e.APPLE_BUSINESS_CHAT="APPLE_BUSINESS_CHAT",e.SKYPE="SKYPE",e.SNAPCHAT="SNAPCHAT",e.VIBER="VIBER",e.LINE="LINE",e.TELEGRAM="TELEGRAM",e.KAKAO="KAKAO"})(i.ContentType||(i.ContentType={})),(e=>{e.SYSTEM="SYSTEM",e.USER="USER"})(i.ConversationEventOrigin||(i.ConversationEventOrigin={})),(e=>{e.PENDING="PENDING",e.ACTIVE="ACTIVE",e.TERMINATED="TERMINATED"})(i.ConversationStatus||(i.ConversationStatus={}))})(Pn||(Pn={}));const Yo=Pn.AcknowledgeType,Go="Anyone Home",Xo="IB Chat Leasing - Development";let el="https://five9.ah.inhabit.work";const tl="https://five9.ah.inhabit.work".replace("http","ws").replace(/\/$/,""),Gt=class Gt{constructor(){Ii(this,Se,void 0);Ii(this,st,void 0);this._emitter=Ks(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),De(this,Se,null),De(this,st,null),this.conversationStarted=!1}serialize(){return JSON.stringify({sessionToken:this.sessionToken,conversationId:this.conversationId,conversationStarted:this.conversationStarted})}static deserialize(e){const t=JSON.parse(e),n=new Gt;return t.sessionToken&&n.setSession(t.sessionToken),t.conversationId&&n.setConversationId(t.conversationId),n.conversationStarted=t.conversationStarted||!1,n}static generateBaseUrl(e){return`https://${e}/appsvcs/rs/svc`}async createSession(){const e=await fetch(`${Gt.generateBaseUrl("app-scl.five9.com")}/auth/anon?cookieless=true`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({tenantName:Go})});return De(this,Se,await e.json()),Dn(this,Se)}setSession(e){De(this,Se,e)}setConversationId(e){De(this,st,e),this.five9WebSocket&&(this.five9WebSocket.destroy(),this.five9WebSocket=void 0,e&&this.connectToWebSocket())}connect(){if(!this.sessionToken)throw new Error("Session not created");if(!this.conversationId)throw new Error("Conversation not started");this.connectToWebSocket()}connectToWebSocket(){if(!this.conversationId)throw new Error("Conversation not started");this.five9WebSocket&&this.five9WebSocket.destroy();const e=new Qo(`${tl}/conversations/${this.conversationId}/ws`);e.on("*",(t,n)=>{this._emitter.emit(t,n)}),e.on("conversationCreated",t=>{this.conversationStarted=!0,console.log("Conversation Created:",t)}),e.on("conversationAccepted",t=>{console.log("Conversation Accepted:",t)}),e.on("agentJoined",t=>{console.log("Agent Joined:",t)}),e.on("agentTransferredConversation",t=>{console.log("Agent Transferred Conversation:",t)}),e.on("conversationTransferredToGroup",t=>{console.log("Conversation Transferred To Group:",t)}),e.on("agentLeftConversation",t=>{console.log("Agent Left Conversation:",t)}),e.on("agentTyping",t=>{console.log("Agent Typing:",t)}),e.on("message",async t=>{console.log("Message:",t),await this.acknowledgeMessage({messages:[{messageId:t.messageId,type:Yo.READ}]})}),e.on("conversationTerminated",t=>{console.log("Conversation Terminated:",t)}),e.on("error",t=>{console.log("Error:",t)}),this.five9WebSocket=e,e.connect()}async authenticatedFetch(e,t={}){const{sessionToken:n}=this;if(!n)throw new Error("Session not found");e=e.startsWith("/")?e:`/${e}`;const s=n.metadata.dataCenters[0].apiUrls[0].host,r=await fetch(`${Gt.generateBaseUrl(s)}${e}`,{...t,headers:{...t.headers,"Content-Type":"application/json",Accept:"application/json",Authorization:n.tokenId,farmId:n.context.farmId}});return r.status===204?null:r.json()}async getMetadata(){if(!this.sessionToken)throw new Error("Session not created");return this.authenticatedFetch("/auth/metadata",{method:"GET"})}async createConversation(e){if(!this.sessionToken)throw new Error("Session not created");const t=e.contact||{};Object.keys(t).forEach(r=>{const a=r;t[a]||delete t[a]});const n={...e,campaignName:Xo,tenantId:this.tenantId,callbackUrl:el};console.log("body",n);const s=await this.authenticatedFetch("/conversations",{method:"POST",body:JSON.stringify(n)});return this.setConversationId(s.id),s}async sendMessage(e){const{conversationId:t,conversationStarted:n}=this;if(!t||!n)throw new Error("Conversation not started");const s={messageType:Pn.MessageType.TEXT,message:e};await this.authenticatedFetch(`/conversations/${t}/messages`,{method:"POST",body:JSON.stringify(s)})}async sendTyping(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/messages/typing`,{method:"PUT"})}async acknowledgeMessage(e){const{conversationId:t}=this;if(!t)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${t}/messages/acknowledge`,{method:"PUT",body:JSON.stringify(e)})}async terminateConversation(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/terminate`,{method:"POST"}),this.destroy()}destroy(){this.five9WebSocket&&this.five9WebSocket.destroy(),De(this,Se,null),De(this,st,null)}get sessionToken(){return Dn(this,Se)}get conversationId(){return Dn(this,st)}get dataCenter(){var e;return(e=this.sessionToken)==null?void 0:e.metadata.dataCenters[0]}get apiUrl(){var e;return(e=this.dataCenter)==null?void 0:e.apiUrls[0].host}get tenantId(){var e;return(e=this.sessionToken)==null?void 0:e.orgId}get tokenId(){var e;return(e=this.sessionToken)==null?void 0:e.tokenId}get farmId(){var e;return(e=this.sessionToken)==null?void 0:e.context.farmId}};Se=new WeakMap,st=new WeakMap;let Nn=Gt;function Yt(i){return`any-${i||"main"}-chatSession`}async function nl({id:i,params:e,chatWindow:t,html:n}){t=t;const s=async()=>{t.removeMessage("transferMessageId"),await t.sendFunctionCallResponse(i,{transfer:"Declined"},!0),t.setInputDisabled(!1)},r=async()=>{t.setInputDisabled(!0),t.removeMessage("transferMessageId"),t.addMessage({role:"system",content:"Please wait while we connect you to a live agent"}),t.chatManager.stopInactivityTimers();const a=new Nn;await a.createSession();const{summary:o,subject:l,...d}=e;await a.createConversation({contact:d,attributes:{Question:l,"AI Summary":o}}),localStorage.setItem(Yt(t.cleanOptions.config.historyKey),a.serialize()),Js(t,a)};t.addMessage({id:"transferMessageId",role:"system",contentHtmlTemplate:n`
477
+ `}function Jo(i){return async function({id:t,params:n,chatWindow:s}){s.setInputDisabled(!0);const r={...n.guestCardId&&{guestCardId:n.guestCardId},...n.customerFirstName&&{firstName:n.customerFirstName},...n.customerLastName&&{lastName:n.customerLastName},...n.customerEmail&&{email:n.customerEmail},...n.customerPhoneNumber&&{phone:n.customerPhoneNumber},...n.desiredMoveInDate&&{moveInDate:n.desiredMoveInDate}},a=document.createElement("iai-chat-iframe-modal");a.title="Schedule a Tour",a.src=`${i}?${new URLSearchParams(r).toString()}`,a.showHeader=!1;const o=()=>{a.remove(),window.removeEventListener("beforeunload",u),s.setInputDisabled(!1)},l=async({detail:p})=>{if(p.type!=="tourScheduled")return;const{tourType:c,tourDate:g,tourTime:O,guestCardId:U}=p;o(),s.addMessage({role:"system",content:"Your tour has been scheduled!"}),await s.sendFunctionCallResponse(t,{status:"scheduled",tourType:c,tourDate:g,tourTime:O,guestCardId:U},!0)},d=async()=>{o(),s.addMessage({role:"system",content:"Tour Scheduler Closed"}),await s.sendFunctionCallResponse(t,{status:"canceled"},!0)},u=async()=>{o(),s.addMessage({role:"system",content:"Tour Scheduler Closed"})};a.addEventListener("message-received",l),a.addEventListener("close",d),window.addEventListener("beforeunload",u),document.body.appendChild(a),s.addMessage({role:"system",content:"Tour Scheduler Opened"})}}function Ks(i){return{all:i=i||new Map,on:function(e,t){var n=i.get(e);n?n.push(t):i.set(e,[t])},off:function(e,t){var n=i.get(e);n&&(t?n.splice(n.indexOf(t)>>>0,1):i.set(e,[]))},emit:function(e,t){var n=i.get(e);n&&n.slice().map(function(s){s(t)}),(n=i.get("*"))&&n.slice().map(function(s){s(e,t)})}}}class Qo{constructor(e){this.chatWsUrl=e,this._emitter=Ks(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),this.reconnectCodes=new Set([1006]),this.reconnectAttempts=0,this.maxReconnectAttempts=10}connect(){const e=new WebSocket(this.chatWsUrl);e.onopen=async()=>{this.reconnectAttempts=0,e.send(JSON.stringify({type:"ready"}))},e.onmessage=t=>{const n=JSON.parse(t.data);this._emitter.emit(n.type,n.data)},e.onclose=t=>{console.log("Disconnected: ",t.code,t.reason||"No reason provided"),this._emitter.emit("disconnected",t),this.reconnectCodes.has(t.code)&&this.reconnectAttempts<this.maxReconnectAttempts&&(console.log("Reconnecting..."),this._emitter.emit("reconnecting"),this.reconnectAttempts++,setTimeout(()=>this.connect(),this.reconnectAttempts*1e3))},e.onerror=t=>{console.log("Error:",t),this._emitter.emit("error",t)},this.ws=e}reconnect(){this.reconnectAttempts=0,this.connect()}disconnect(){var e;(e=this.ws)==null||e.close()}destroy(){this.disconnect(),this._emitter.all.clear()}}var Pn;(i=>{(e=>{e.TEXT="TEXT"})(i.MessageType||(i.MessageType={})),(e=>{e.DELIVERED="DELIVERED",e.READ="READ",e.FAILED="FAILED"})(i.AcknowledgeType||(i.AcknowledgeType={})),(e=>{e.GENERIC="GENERIC",e.SMS="SMS",e.RCS="RCS",e.FACEBOOK="FACEBOOK",e.TWITTER="TWITTER",e.WHATSAPP="WHATSAPP",e.WECHAT="WECHAT",e.QQMOBILE="QQMOBILE",e.APPLE_BUSINESS_CHAT="APPLE_BUSINESS_CHAT",e.SKYPE="SKYPE",e.SNAPCHAT="SNAPCHAT",e.VIBER="VIBER",e.LINE="LINE",e.TELEGRAM="TELEGRAM",e.KAKAO="KAKAO"})(i.ContentType||(i.ContentType={})),(e=>{e.SYSTEM="SYSTEM",e.USER="USER"})(i.ConversationEventOrigin||(i.ConversationEventOrigin={})),(e=>{e.PENDING="PENDING",e.ACTIVE="ACTIVE",e.TERMINATED="TERMINATED"})(i.ConversationStatus||(i.ConversationStatus={}))})(Pn||(Pn={}));const Yo=Pn.AcknowledgeType,Go="Anyone Home",Xo="IB Chat Leasing - Development";let el="https://five9.ah.inhabit.work";const tl="https://five9.ah.inhabit.work".replace("http","ws").replace(/\/$/,""),Gt=class Gt{constructor(){Ii(this,Se,void 0);Ii(this,st,void 0);this._emitter=Ks(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),De(this,Se,null),De(this,st,null),this.conversationStarted=!1}serialize(){return JSON.stringify({sessionToken:this.sessionToken,conversationId:this.conversationId,conversationStarted:this.conversationStarted})}static deserialize(e){const t=JSON.parse(e),n=new Gt;return t.sessionToken&&n.setSession(t.sessionToken),t.conversationId&&n.setConversationId(t.conversationId),n.conversationStarted=t.conversationStarted||!1,n}static generateBaseUrl(e){return`https://${e}/appsvcs/rs/svc`}async createSession(){const e=await fetch(`${Gt.generateBaseUrl("app-scl.five9.com")}/auth/anon?cookieless=true`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({tenantName:Go})});return De(this,Se,await e.json()),Dn(this,Se)}setSession(e){De(this,Se,e)}setConversationId(e){De(this,st,e),this.five9WebSocket&&(this.five9WebSocket.destroy(),this.five9WebSocket=void 0,e&&this.connectToWebSocket())}connect(){if(!this.sessionToken)throw new Error("Session not created");if(!this.conversationId)throw new Error("Conversation not started");this.connectToWebSocket()}connectToWebSocket(){if(!this.conversationId)throw new Error("Conversation not started");this.five9WebSocket&&this.five9WebSocket.destroy();const e=new Qo(`${tl}/conversations/${this.conversationId}/ws`);e.on("*",(t,n)=>{this._emitter.emit(t,n)}),e.on("conversationCreated",t=>{this.conversationStarted=!0,console.log("Conversation Created:",t)}),e.on("conversationAccepted",t=>{console.log("Conversation Accepted:",t)}),e.on("agentJoined",t=>{console.log("Agent Joined:",t)}),e.on("agentTransferredConversation",t=>{console.log("Agent Transferred Conversation:",t)}),e.on("conversationTransferredToGroup",t=>{console.log("Conversation Transferred To Group:",t)}),e.on("agentLeftConversation",t=>{console.log("Agent Left Conversation:",t)}),e.on("agentTyping",t=>{console.log("Agent Typing:",t)}),e.on("message",async t=>{console.log("Message:",t),await this.acknowledgeMessage({messages:[{messageId:t.messageId,type:Yo.READ}]})}),e.on("conversationTerminated",t=>{console.log("Conversation Terminated:",t)}),e.on("error",t=>{console.log("Error:",t)}),this.five9WebSocket=e,e.connect()}async authenticatedFetch(e,t={}){const{sessionToken:n}=this;if(!n)throw new Error("Session not found");e=e.startsWith("/")?e:`/${e}`;const s=n.metadata.dataCenters[0].apiUrls[0].host,r=await fetch(`${Gt.generateBaseUrl(s)}${e}`,{...t,headers:{...t.headers,"Content-Type":"application/json",Accept:"application/json",Authorization:n.tokenId,farmId:n.context.farmId}});return r.status===204?null:r.json()}async getMetadata(){if(!this.sessionToken)throw new Error("Session not created");return this.authenticatedFetch("/auth/metadata",{method:"GET"})}async createConversation(e){if(!this.sessionToken)throw new Error("Session not created");const t=e.contact||{};Object.keys(t).forEach(r=>{const a=r;t[a]||delete t[a]});const n={...e,campaignName:Xo,tenantId:this.tenantId,callbackUrl:el};console.log("body",n);const s=await this.authenticatedFetch("/conversations",{method:"POST",body:JSON.stringify(n)});return this.setConversationId(s.id),s}async sendMessage(e){const{conversationId:t,conversationStarted:n}=this;if(!t||!n)throw new Error("Conversation not started");const s={messageType:Pn.MessageType.TEXT,message:e};await this.authenticatedFetch(`/conversations/${t}/messages`,{method:"POST",body:JSON.stringify(s)})}async sendTyping(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/messages/typing`,{method:"PUT"})}async acknowledgeMessage(e){const{conversationId:t}=this;if(!t)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${t}/messages/acknowledge`,{method:"PUT",body:JSON.stringify(e)})}async terminateConversation(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/terminate`,{method:"POST"}),this.destroy()}destroy(){this.five9WebSocket&&this.five9WebSocket.destroy(),De(this,Se,null),De(this,st,null)}get sessionToken(){return Dn(this,Se)}get conversationId(){return Dn(this,st)}get dataCenter(){var e;return(e=this.sessionToken)==null?void 0:e.metadata.dataCenters[0]}get apiUrl(){var e;return(e=this.dataCenter)==null?void 0:e.apiUrls[0].host}get tenantId(){var e;return(e=this.sessionToken)==null?void 0:e.orgId}get tokenId(){var e;return(e=this.sessionToken)==null?void 0:e.tokenId}get farmId(){var e;return(e=this.sessionToken)==null?void 0:e.context.farmId}};Se=new WeakMap,st=new WeakMap;let Nn=Gt;function Yt(i){return`any-${i||"main"}-chatSession`}async function nl({id:i,params:e,chatWindow:t,html:n}){t=t;const s=async()=>{t.removeMessage("transferMessageId"),await t.sendFunctionCallResponse(i,{transfer:"Declined"},!0),t.setInputDisabled(!1)},r=async()=>{t.setInputDisabled(!0),t.removeMessage("transferMessageId"),t.addMessage({role:"system",content:"Please wait while we connect you to a live agent"}),t.chatManager.stopInactivityTimers();const a=new Nn;await a.createSession();const{summary:o,subject:l,...d}=e;await a.createConversation({contact:d,attributes:{Question:l,"AI Summary":o}}),localStorage.setItem(Yt(t.cleanOptions.config.historyKey),a.serialize()),Js(t,a)};t.addMessage({id:"transferMessageId",role:"system",contentHtmlTemplate:n`
478
478
  <style>
479
479
  .btn {
480
- background-color: #007bff;
481
- color: white;
480
+ background-color: var(--iai-chat-i-message-user-bg);
481
+ color: var(--iai-chat-i-message-user-fg);
482
482
  border: none;
483
483
  padding: 10px 20px;
484
484
  text-align: center;
@@ -491,7 +491,8 @@ Please report this to https://github.com/markedjs/marked.`,i){const n="<p>An err
491
491
  }
492
492
 
493
493
  .btn-no {
494
- background-color: #dc3545;
494
+ background-color: var(--iai-chat-i-message-assistant-bg);
495
+ color: var(--iai-chat-i-message-assistant-fg);
495
496
  }
496
497
  </style>
497
498
  <div class="my-4">