helpdock 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/fixtures.d.ts +38 -0
- package/dist/components/ArticleDetail.test.d.ts +1 -0
- package/dist/components/ArticlesTab.test.d.ts +1 -0
- package/dist/components/ContactTab.d.ts +1 -0
- package/dist/components/ContactTab.test.d.ts +1 -0
- package/dist/components/HelpDock.d.ts +1 -1
- package/dist/components/HelpDock.test.d.ts +1 -0
- package/dist/components/Panel.test.d.ts +1 -0
- package/dist/components/WidgetButton.d.ts +5 -0
- package/dist/components/WidgetButton.test.d.ts +1 -0
- package/dist/context/config-context.d.ts +14 -0
- package/dist/helpdock.js +770 -658
- package/dist/helpdock.umd.cjs +83 -32
- package/dist/index.d.ts +1 -1
- package/dist/schema/article.test.d.ts +1 -0
- package/dist/schema/config.d.ts +14 -0
- package/dist/schema/config.test.d.ts +1 -0
- package/dist/schema/contact.d.ts +48 -0
- package/dist/services/analytics.test.d.ts +1 -0
- package/dist/services/attachments.test.d.ts +1 -0
- package/dist/services/search.test.d.ts +1 -0
- package/package.json +15 -3
package/dist/helpdock.umd.cjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
(function(h,
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),et=/'/g,tt=/"/g,it=/^(?:script|style|textarea|title)$/i,Qt=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),f=Qt(1),Q=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),nt=new WeakMap,I=U.createTreeWalker(U,129);function st(t,e){if(!Pe(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ke!==void 0?Ke.createHTML(e):e}const Wt=(t,e)=>{const i=t.length-1,n=[];let s,r=e===2?"<svg>":e===3?"<math>":"",o=se;for(let a=0;a<i;a++){const l=t[a];let c,d,p=-1,b=0;for(;b<l.length&&(o.lastIndex=b,d=o.exec(l),d!==null);)b=o.lastIndex,o===se?d[1]==="!--"?o=Je:d[1]!==void 0?o=Xe:d[2]!==void 0?(it.test(d[2])&&(s=RegExp("</"+d[2],"g")),o=R):d[3]!==void 0&&(o=R):o===R?d[0]===">"?(o=s??se,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?R:d[3]==='"'?tt:et):o===tt||o===et?o=R:o===Je||o===Xe?o=se:(o=R,s=void 0);const E=o===R&&t[a+1].startsWith("/>")?" ":"";r+=o===se?l+Ht:p>=0?(n.push(c),l.slice(0,p)+Ge+l.slice(p)+j+E):l+j+(p===-2?a:E)}return[st(t,r+(t[i]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class re{constructor({strings:e,_$litType$:i},n){let s;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,d]=Wt(e,i);if(this.el=re.createElement(c,n),I.currentNode=this.el.content,i===2||i===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(s=I.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const p of s.getAttributeNames())if(p.endsWith(Ge)){const b=d[o++],E=s.getAttribute(p).split(j),O=/([.?@])?(.*)/.exec(b);l.push({type:1,index:r,name:O[2],strings:E,ctor:O[1]==="."?Gt:O[1]==="?"?Yt:O[1]==="@"?Jt:me}),s.removeAttribute(p)}else p.startsWith(j)&&(l.push({type:6,index:r}),s.removeAttribute(p));if(it.test(s.tagName)){const p=s.textContent.split(j),b=p.length-1;if(b>0){s.textContent=fe?fe.emptyScript:"";for(let E=0;E<b;E++)s.append(p[E],ie()),I.nextNode(),l.push({type:2,index:++r});s.append(p[b],ie())}}}else if(s.nodeType===8)if(s.data===Ye)l.push({type:2,index:r});else{let p=-1;for(;(p=s.data.indexOf(j,p+1))!==-1;)l.push({type:7,index:r}),p+=j.length-1}r++}}static createElement(e,i){const n=U.createElement("template");return n.innerHTML=e,n}}function W(t,e,i=t,n){if(e===Q)return e;let s=n!==void 0?i._$Co?.[n]:i._$Cl;const r=ne(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(t),s._$AT(t,i,n)),n!==void 0?(i._$Co??=[])[n]=s:i._$Cl=s),s!==void 0&&(e=W(t,s._$AS(t,e.values),s,n)),e}class Kt{constructor(e,i){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:i},parts:n}=this._$AD,s=(e?.creationScope??U).importNode(i,!0);I.currentNode=s;let r=I.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new oe(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new Xt(r,this,e)),this._$AV.push(c),l=n[++a]}o!==l?.index&&(r=I.nextNode(),o++)}return I.currentNode=U,s}p(e){let i=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,i),i+=n.strings.length-2):n._$AI(e[i])),i++}}class oe{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,i,n,s){this.type=2,this._$AH=x,this._$AN=void 0,this._$AA=e,this._$AB=i,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const i=this._$AM;return i!==void 0&&e?.nodeType===11&&(e=i.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,i=this){e=W(this,e,i),ne(e)?e===x||e==null||e===""?(this._$AH!==x&&this._$AR(),this._$AH=x):e!==this._$AH&&e!==Q&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):qt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==x&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(U.createTextNode(e)),this._$AH=e}$(e){const{values:i,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=re.createElement(st(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(i);else{const r=new Kt(s,this),o=r.u(this.options);r.p(i),this.T(o),this._$AH=r}}_$AC(e){let i=nt.get(e.strings);return i===void 0&&nt.set(e.strings,i=new re(e)),i}k(e){Pe(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let n,s=0;for(const r of e)s===i.length?i.push(n=new oe(this.O(ie()),this.O(ie()),this,this.options)):n=i[s],n._$AI(r),s++;s<i.length&&(this._$AR(n&&n._$AB.nextSibling,s),i.length=s)}_$AR(e=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);e!==this._$AB;){const n=e.nextSibling;e.remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class me{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,i,n,s,r){this.type=1,this._$AH=x,this._$AN=void 0,this.element=e,this.name=i,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=x}_$AI(e,i=this,n,s){const r=this.strings;let o=!1;if(r===void 0)e=W(this,e,i,0),o=!ne(e)||e!==this._$AH&&e!==Q,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=W(this,a[n+l],i,l),c===Q&&(c=this._$AH[l]),o||=!ne(c)||c!==this._$AH[l],c===x?e=x:e!==x&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!s&&this.j(e)}j(e){e===x?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Gt extends me{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===x?void 0:e}}class Yt extends me{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==x)}}class Jt extends me{constructor(e,i,n,s,r){super(e,i,n,s,r),this.type=5}_$AI(e,i=this){if((e=W(this,e,i,0)??x)===Q)return;const n=this._$AH,s=e===x&&n!==x||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==x&&(n===x||s);s&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Xt{constructor(e,i,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=i,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){W(this,e)}}const ei=Te.litHtmlPolyfillSupport;ei?.(re,oe),(Te.litHtmlVersions??=[]).push("3.3.1");const ti=(t,e,i)=>{const n=i?.renderBefore??e;let s=n._$litPart$;if(s===void 0){const r=i?.renderBefore??null;n._$litPart$=s=new oe(e.insertBefore(ie(),r),r,void 0,i??{})}return s._$AI(t),s};const Me=globalThis;let M=class extends q{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ti(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}};M._$litElement$=!0,M.finalized=!0,Me.litElementHydrateSupport?.({LitElement:M});const ii=Me.litElementPolyfillSupport;ii?.({LitElement:M}),(Me.litElementVersions??=[]).push("4.2.1");const K=t=>(e,i)=>{i!==void 0?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};const ni={attribute:!0,type:String,converter:pe,reflect:!1,hasChanged:Ce},si=(t=ni,e,i)=>{const{kind:n,metadata:s}=i;let r=globalThis.litPropertyMetadata.get(s);if(r===void 0&&globalThis.litPropertyMetadata.set(s,r=new Map),n==="setter"&&((t=Object.create(t)).wrapped=!0),r.set(i.name,t),n==="accessor"){const{name:o}=i;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,t)},init(a){return a!==void 0&&this.C(o,void 0,t,a),a}}}if(n==="setter"){const{name:o}=i;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,t)}}throw Error("Unsupported decorator location: "+n)};function D(t){return(e,i)=>typeof i=="object"?si(t,e,i):((n,s,r)=>{const o=s.hasOwnProperty(r);return s.constructor.createProperty(r,n),o?Object.getOwnPropertyDescriptor(s,r):void 0})(t,e,i)}function k(t){return D({...t,state:!0,attribute:!1})}let rt=class extends Event{constructor(e,i,n,s){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=i,this.callback=n,this.subscribe=s??!1}};function Hs(t){return t}let ot=class{constructor(e,i,n,s){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=e,i.context!==void 0){const r=i;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=i,this.callback=n,this.subscribe=s??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new rt(this.context,this.host,this.t,this.subscribe))}};class ri{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,i=!1){const n=i||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[i,{disposer:n}]of this.subscriptions)i(this.o,n)},e!==void 0&&(this.value=e)}addCallback(e,i,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:i});const{disposer:s}=this.subscriptions.get(e);e(this.value,s)}clearCallbacks(){this.subscriptions.clear()}}let oi=class extends Event{constructor(e,i){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=i}};class Fe extends ri{constructor(e,i,n){super(i.context!==void 0?i.initialValue:n),this.onContextRequest=s=>{if(s.context!==this.context)return;const r=s.contextTarget??s.composedPath()[0];r!==this.host&&(s.stopPropagation(),this.addCallback(s.callback,r,s.subscribe))},this.onProviderRequest=s=>{if(s.context!==this.context||(s.contextTarget??s.composedPath()[0])===this.host)return;const r=new Set;for(const[o,{consumerHost:a}]of this.subscriptions)r.has(o)||(r.add(o),a.dispatchEvent(new rt(this.context,a,o,!0)));s.stopPropagation()},this.host=e,i.context!==void 0?this.context=i.context:this.context=i,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new oi(this.context,this.host))}}function ai({context:t}){return(e,i)=>{const n=new WeakMap;if(typeof i=="object")return{get(){return e.get.call(this)},set(s){return n.get(this).setValue(s),e.set.call(this,s)},init(s){return n.set(this,new Fe(this,{context:t,initialValue:s})),s}};{e.constructor.addInitializer((o=>{n.set(o,new Fe(o,{context:t}))}));const s=Object.getOwnPropertyDescriptor(e,i);let r;if(s===void 0){const o=new WeakMap;r={get(){return o.get(this)},set(a){n.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=s.set;r={...s,set(a){n.get(this).setValue(a),o?.call(this,a)}}}return void Object.defineProperty(e,i,r)}}}function ae({context:t,subscribe:e}){return(i,n)=>{typeof n=="object"?n.addInitializer((function(){new ot(this,{context:t,callback:s=>{i.set.call(this,s)},subscribe:e})})):i.constructor.addInitializer((s=>{new ot(s,{context:t,callback:r=>{s[n]=r},subscribe:e})}))}}function m(t,e,i){function n(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,l);const c=o.prototype,d=Object.keys(c);for(let p=0;p<d.length;p++){const b=d[p];b in a||(a[b]=c[b].bind(a))}}const s=i?.Parent??Object;class r extends s{}Object.defineProperty(r,"name",{value:t});function o(a){var l;const c=i?.Parent?new r:this;n(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const d of c._zod.deferred)d();return c}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>i?.Parent&&a instanceof i.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}class G extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ci extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const li={};function Y(t){return li}function di(t){const e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,s])=>e.indexOf(+n)===-1).map(([n,s])=>s)}function ui(t,e){return typeof e=="bigint"?e.toString():e}function at(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function hi(t){return t==null}function ct(t){const e=t.startsWith("^")?1:0,i=t.endsWith("$")?t.length-1:t.length;return t.slice(e,i)}const lt=Symbol("evaluating");function C(t,e,i){let n;Object.defineProperty(t,e,{get(){if(n!==lt)return n===void 0&&(n=lt,n=i()),n},set(s){Object.defineProperty(t,e,{value:s})},configurable:!0})}function dt(t,e,i){Object.defineProperty(t,e,{value:i,writable:!0,enumerable:!0,configurable:!0})}function ut(...t){const e={};for(const i of t){const n=Object.getOwnPropertyDescriptors(i);Object.assign(e,n)}return Object.defineProperties({},e)}const ht="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ge(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ze(t){if(ge(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const i=e.prototype;return!(ge(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function pi(t){return Ze(t)?{...t}:Array.isArray(t)?[...t]:t}const fi=new Set(["string","number","symbol"]);function je(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function De(t,e,i){const n=new t._zod.constr(e??t._zod.def);return(!e||i?.parent)&&(n._zod.parent=t),n}function z(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function mi(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function gi(t,e){if(!Ze(e))throw new Error("Invalid input to extend: expected a plain object");const i=t._zod.def.checks;if(i&&i.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const s=ut(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return dt(this,"shape",r),r},checks:[]});return De(t,s)}function vi(t,e,i){const n=ut(e._zod.def,{get shape(){const s=e._zod.def.shape,r={...s};for(const o in s)r[o]=t?new t({type:"optional",innerType:s[o]}):s[o];return dt(this,"shape",r),r},checks:[]});return De(e,n)}function ce(t,e=0){if(t.aborted===!0)return!0;for(let i=e;i<t.issues.length;i++)if(t.issues[i]?.continue!==!0)return!0;return!1}function L(t,e){return e.map(i=>{var n;return(n=i).path??(n.path=[]),i.path.unshift(t),i})}function ve(t){return typeof t=="string"?t:t?.message}function J(t,e,i){const n={...t,path:t.path??[]};if(!t.message){const s=ve(t.inst?._zod.def?.error?.(t))??ve(e?.error?.(t))??ve(i.customError?.(t))??ve(i.localeError?.(t))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function bi(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function yi(...t){const[e,i,n]=t;return typeof e=="string"?{message:e,code:"custom",input:i,inst:n}:{...e}}const pt=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,ui,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},ki=m("$ZodError",pt),be=m("$ZodError",pt,{Parent:Error}),Ue=(t=>(e,i,n,s)=>{const r=n?Object.assign(n,{async:!1}):{async:!1},o=e._zod.run({value:i,issues:[]},r);if(o instanceof Promise)throw new G;if(o.issues.length){const a=new(s?.Err??t)(o.issues.map(l=>J(l,r,Y())));throw ht(a,s?.callee),a}return o.value})(be),Re=(t=>async(e,i,n,s)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let o=e._zod.run({value:i,issues:[]},r);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(s?.Err??t)(o.issues.map(l=>J(l,r,Y())));throw ht(a,s?.callee),a}return o.value})(be),ft=(t=>(e,i,n)=>{const s=n?{...n,async:!1}:{async:!1},r=e._zod.run({value:i,issues:[]},s);if(r instanceof Promise)throw new G;return r.issues.length?{success:!1,error:new(t??ki)(r.issues.map(o=>J(o,s,Y())))}:{success:!0,data:r.value}})(be),mt=(t=>async(e,i,n)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let r=e._zod.run({value:i,issues:[]},s);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new t(r.issues.map(o=>J(o,s,Y())))}:{success:!0,data:r.value}})(be),$i="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function _i(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function wi(t){const e=_i({precision:t.precision}),i=["Z"];t.local&&i.push(""),t.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${e}(?:${i.join("|")})`;return new RegExp(`^${$i}T(?:${n})$`)}const xi=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Ai=/^-?\d+(?:\.\d+)?/,Si=/^(?:true|false)$/i,ye=m("$ZodCheck",(t,e)=>{var i;t._zod??(t._zod={}),t._zod.def=e,(i=t._zod).onattach??(i.onattach=[])}),zi={number:"number",bigint:"bigint",object:"date"},Ei=m("$ZodCheckGreaterThan",(t,e)=>{ye.init(t,e);const i=zi[typeof e.value];t._zod.onattach.push(n=>{const s=n._zod.bag,r=(e.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>r&&(e.inclusive?s.minimum=e.value:s.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:i,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Ci=m("$ZodCheckMinLength",(t,e)=>{var i;ye.init(t,e),(i=t._zod.def).when??(i.when=n=>{const s=n.value;return!hi(s)&&s.length!==void 0}),t._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>s&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{const s=n.value;if(s.length>=e.minimum)return;const o=bi(s);n.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),Ti=m("$ZodCheckStringFormat",(t,e)=>{var i,n;ye.init(t,e),t._zod.onattach.push(s=>{const r=s._zod.bag;r.format=e.format,e.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(e.pattern))}),e.pattern?(i=t._zod).check??(i.check=s=>{e.pattern.lastIndex=0,!e.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:e.format,input:s.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),Pi={major:4,minor:2,patch:1},w=m("$ZodType",(t,e)=>{var i;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Pi;const n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(const s of n)for(const r of s._zod.onattach)r(t);if(n.length===0)(i=t._zod).deferred??(i.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const s=(o,a,l)=>{let c=ce(o),d;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(c)continue;const b=o.issues.length,E=p._zod.check(o);if(E instanceof Promise&&l?.async===!1)throw new G;if(d||E instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await E,o.issues.length!==b&&(c||(c=ce(o,b)))});else{if(o.issues.length===b)continue;c||(c=ce(o,b))}}return d?d.then(()=>o):o},r=(o,a,l)=>{if(ce(o))return o.aborted=!0,o;const c=s(a,n,l);if(c instanceof Promise){if(l.async===!1)throw new G;return c.then(d=>t._zod.parse(d,l))}return t._zod.parse(c,l)};t._zod.run=(o,a)=>{if(a.skipChecks)return t._zod.parse(o,a);if(a.direction==="backward"){const c=t._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(d=>r(d,o,a)):r(c,o,a)}const l=t._zod.parse(o,a);if(l instanceof Promise){if(a.async===!1)throw new G;return l.then(c=>s(c,n,a))}return s(l,n,a)}}t["~standard"]={validate:s=>{try{const r=ft(t,s);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return mt(t,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}}),gt=m("$ZodString",(t,e)=>{w.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??xi(t._zod.bag),t._zod.parse=(i,n)=>{if(e.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:t}),i}}),vt=m("$ZodStringFormat",(t,e)=>{Ti.init(t,e),gt.init(t,e)}),Oi=m("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=wi(e)),vt.init(t,e)}),Mi=m("$ZodNumber",(t,e)=>{w.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ai,t._zod.parse=(i,n)=>{if(e.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const r=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:t,...r?{received:r}:{}}),i}}),Fi=m("$ZodBoolean",(t,e)=>{w.init(t,e),t._zod.pattern=Si,t._zod.parse=(i,n)=>{if(e.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:t}),i}}),Zi=m("$ZodUnknown",(t,e)=>{w.init(t,e),t._zod.parse=i=>i}),ji=m("$ZodVoid",(t,e)=>{w.init(t,e),t._zod.parse=(i,n)=>{const s=i.value;return typeof s>"u"||i.issues.push({expected:"void",code:"invalid_type",input:s,inst:t}),i}});function bt(t,e,i){t.issues.length&&e.issues.push(...L(i,t.issues)),e.value[i]=t.value}const Di=m("$ZodArray",(t,e)=>{w.init(t,e),t._zod.parse=(i,n)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:t}),i;i.value=Array(s.length);const r=[];for(let o=0;o<s.length;o++){const a=s[o],l=e.element._zod.run({value:a,issues:[]},n);l instanceof Promise?r.push(l.then(c=>bt(c,i,o))):bt(l,i,o)}return r.length?Promise.all(r).then(()=>i):i}});function ke(t,e,i,n){t.issues.length&&e.issues.push(...L(i,t.issues)),t.value===void 0?i in n&&(e.value[i]=void 0):e.value[i]=t.value}function Ui(t){const e=Object.keys(t.shape);for(const n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const i=mi(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(i)}}function Ri(t,e,i,n,s,r){const o=[],a=s.keySet,l=s.catchall._zod,c=l.def.type;for(const d in e){if(a.has(d))continue;if(c==="never"){o.push(d);continue}const p=l.run({value:e[d],issues:[]},n);p instanceof Promise?t.push(p.then(b=>ke(b,i,d,e))):ke(p,i,d,e)}return o.length&&i.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:r}),t.length?Promise.all(t).then(()=>i):i}const Ii=m("$ZodObject",(t,e)=>{if(w.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){const a=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...a};return Object.defineProperty(e,"shape",{value:l}),l}})}const n=at(()=>Ui(e));C(t._zod,"propValues",()=>{const a=e.shape,l={};for(const c in a){const d=a[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(const p of d.values)l[c].add(p)}}return l});const s=ge,r=e.catchall;let o;t._zod.parse=(a,l)=>{o??(o=n.value);const c=a.value;if(!s(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:t}),a;a.value={};const d=[],p=o.shape;for(const b of o.keys){const O=p[b]._zod.run({value:c[b],issues:[]},l);O instanceof Promise?d.push(O.then(Vs=>ke(Vs,a,b,c))):ke(O,a,b,c)}return r?Ri(d,c,a,l,n.value,t):d.length?Promise.all(d).then(()=>a):a}});function yt(t,e,i,n){for(const r of t)if(r.issues.length===0)return e.value=r.value,e;const s=t.filter(r=>!ce(r));return s.length===1?(e.value=s[0].value,s[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:i,errors:t.map(r=>r.issues.map(o=>J(o,n,Y())))}),e)}const kt=m("$ZodUnion",(t,e)=>{w.init(t,e),C(t._zod,"optin",()=>e.options.some(s=>s._zod.optin==="optional")?"optional":void 0),C(t._zod,"optout",()=>e.options.some(s=>s._zod.optout==="optional")?"optional":void 0),C(t._zod,"values",()=>{if(e.options.every(s=>s._zod.values))return new Set(e.options.flatMap(s=>Array.from(s._zod.values)))}),C(t._zod,"pattern",()=>{if(e.options.every(s=>s._zod.pattern)){const s=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${s.map(r=>ct(r.source)).join("|")})$`)}});const i=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(s,r)=>{if(i)return n(s,r);let o=!1;const a=[];for(const l of e.options){const c=l._zod.run({value:s.value,issues:[]},r);if(c instanceof Promise)a.push(c),o=!0;else{if(c.issues.length===0)return c;a.push(c)}}return o?Promise.all(a).then(l=>yt(l,s,t,r)):yt(a,s,t,r)}}),Li=m("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,kt.init(t,e);const i=t._zod.parse;C(t._zod,"propValues",()=>{const s={};for(const r of e.options){const o=r._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(const[a,l]of Object.entries(o)){s[a]||(s[a]=new Set);for(const c of l)s[a].add(c)}}return s});const n=at(()=>{const s=e.options,r=new Map;for(const o of s){const a=o._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const l of a){if(r.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);r.set(l,o)}}return r});t._zod.parse=(s,r)=>{const o=s.value;if(!ge(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),s;const a=n.value.get(o?.[e.discriminator]);return a?a._zod.run(s,r):e.unionFallback?i(s,r):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:o,path:[e.discriminator],inst:t}),s)}}),$t=m("$ZodTuple",(t,e)=>{w.init(t,e);const i=e.items;t._zod.parse=(n,s)=>{const r=n.value;if(!Array.isArray(r))return n.issues.push({input:r,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];const o=[],a=[...i].reverse().findIndex(d=>d._zod.optin!=="optional"),l=a===-1?0:i.length-a;if(!e.rest){const d=r.length>i.length,p=r.length<l-1;if(d||p)return n.issues.push({...d?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},input:r,inst:t,origin:"array"}),n}let c=-1;for(const d of i){if(c++,c>=r.length&&c>=l)continue;const p=d._zod.run({value:r[c],issues:[]},s);p instanceof Promise?o.push(p.then(b=>$e(b,n,c))):$e(p,n,c)}if(e.rest){const d=r.slice(i.length);for(const p of d){c++;const b=e.rest._zod.run({value:p,issues:[]},s);b instanceof Promise?o.push(b.then(E=>$e(E,n,c))):$e(b,n,c)}}return o.length?Promise.all(o).then(()=>n):n}});function $e(t,e,i){t.issues.length&&e.issues.push(...L(i,t.issues)),e.value[i]=t.value}const Ni=m("$ZodRecord",(t,e)=>{w.init(t,e),t._zod.parse=(i,n)=>{const s=i.value;if(!Ze(s))return i.issues.push({expected:"record",code:"invalid_type",input:s,inst:t}),i;const r=[],o=e.keyType._zod.values;if(o){i.value={};const a=new Set;for(const c of o)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const d=e.valueType._zod.run({value:s[c],issues:[]},n);d instanceof Promise?r.push(d.then(p=>{p.issues.length&&i.issues.push(...L(c,p.issues)),i.value[c]=p.value})):(d.issues.length&&i.issues.push(...L(c,d.issues)),i.value[c]=d.value)}let l;for(const c in s)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:l})}else{i.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__")continue;const l=e.keyType._zod.run({value:a,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){e.mode==="loose"?i.value[a]=s[a]:i.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>J(d,n,Y())),input:a,path:[a],inst:t});continue}const c=e.valueType._zod.run({value:s[a],issues:[]},n);c instanceof Promise?r.push(c.then(d=>{d.issues.length&&i.issues.push(...L(a,d.issues)),i.value[l.value]=d.value})):(c.issues.length&&i.issues.push(...L(a,c.issues)),i.value[l.value]=c.value)}}return r.length?Promise.all(r).then(()=>i):i}}),Bi=m("$ZodEnum",(t,e)=>{w.init(t,e);const i=di(e.entries),n=new Set(i);t._zod.values=n,t._zod.pattern=new RegExp(`^(${i.filter(s=>fi.has(typeof s)).map(s=>typeof s=="string"?je(s):s.toString()).join("|")})$`),t._zod.parse=(s,r)=>{const o=s.value;return n.has(o)||s.issues.push({code:"invalid_value",values:i,input:o,inst:t}),s}}),Vi=m("$ZodLiteral",(t,e)=>{if(w.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(e.values);t._zod.values=i,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?je(n):n?je(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,s)=>{const r=n.value;return i.has(r)||n.issues.push({code:"invalid_value",values:e.values,input:r,inst:t}),n}}),Hi=m("$ZodTransform",(t,e)=>{w.init(t,e),t._zod.parse=(i,n)=>{if(n.direction==="backward")throw new ci(t.constructor.name);const s=e.transform(i.value,i);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(i.value=o,i));if(s instanceof Promise)throw new G;return i.value=s,i}});function _t(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}const qi=m("$ZodOptional",(t,e)=>{w.init(t,e),t._zod.optin="optional",t._zod.optout="optional",C(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),C(t._zod,"pattern",()=>{const i=e.innerType._zod.pattern;return i?new RegExp(`^(${ct(i.source)})?$`):void 0}),t._zod.parse=(i,n)=>{if(e.innerType._zod.optin==="optional"){const s=e.innerType._zod.run(i,n);return s instanceof Promise?s.then(r=>_t(r,i.value)):_t(s,i.value)}return i.value===void 0?i:e.innerType._zod.run(i,n)}}),Qi=m("$ZodDefault",(t,e)=>{w.init(t,e),t._zod.optin="optional",C(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(i,n)=>{if(n.direction==="backward")return e.innerType._zod.run(i,n);if(i.value===void 0)return i.value=e.defaultValue,i;const s=e.innerType._zod.run(i,n);return s instanceof Promise?s.then(r=>wt(r,e)):wt(s,e)}});function wt(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const Wi=m("$ZodPipe",(t,e)=>{w.init(t,e),C(t._zod,"values",()=>e.in._zod.values),C(t._zod,"optin",()=>e.in._zod.optin),C(t._zod,"optout",()=>e.out._zod.optout),C(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(i,n)=>{if(n.direction==="backward"){const r=e.out._zod.run(i,n);return r instanceof Promise?r.then(o=>_e(o,e.in,n)):_e(r,e.in,n)}const s=e.in._zod.run(i,n);return s instanceof Promise?s.then(r=>_e(r,e.out,n)):_e(s,e.out,n)}});function _e(t,e,i){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},i)}const Ki=m("$ZodFunction",(t,e)=>(w.init(t,e),t._def=e,t._zod.def=e,t.implement=i=>{if(typeof i!="function")throw new Error("implement() must be called with a function");return function(...n){const s=t._def.input?Ue(t._def.input,n):n,r=Reflect.apply(i,this,s);return t._def.output?Ue(t._def.output,r):r}},t.implementAsync=i=>{if(typeof i!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){const s=t._def.input?await Re(t._def.input,n):n,r=await Reflect.apply(i,this,s);return t._def.output?await Re(t._def.output,r):r}},t._zod.parse=(i,n)=>typeof i.value!="function"?(i.issues.push({code:"invalid_type",expected:"function",input:i.value,inst:t}),i):(t._def.output&&t._def.output._zod.def.type==="promise"?i.value=t.implementAsync(i.value):i.value=t.implement(i.value),i),t.input=(...i)=>{const n=t.constructor;return Array.isArray(i[0])?new n({type:"function",input:new $t({type:"tuple",items:i[0],rest:i[1]}),output:t._def.output}):new n({type:"function",input:i[0],output:t._def.output})},t.output=i=>{const n=t.constructor;return new n({type:"function",input:t._def.input,output:i})},t)),Gi=m("$ZodPromise",(t,e)=>{w.init(t,e),t._zod.parse=(i,n)=>Promise.resolve(i.value).then(s=>e.innerType._zod.run({value:s,issues:[]},n))}),Yi=m("$ZodCustom",(t,e)=>{ye.init(t,e),w.init(t,e),t._zod.parse=(i,n)=>i,t._zod.check=i=>{const n=i.value,s=e.fn(n);if(s instanceof Promise)return s.then(r=>xt(r,i,n,t));xt(s,i,n,t)}});function xt(t,e,i,n){if(!t){const s={code:"custom",input:i,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),e.issues.push(yi(s))}}var At;class Ji{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...i){const n=i[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const i=this._map.get(e);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(e),this}get(e){const i=e._zod.parent;if(i){const n={...this.get(i)??{}};delete n.id;const s={...n,...this._map.get(e)};return Object.keys(s).length?s:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Xi(){return new Ji}(At=globalThis).__zod_globalRegistry??(At.__zod_globalRegistry=Xi());function en(t,e){return new t({type:"string",...z(e)})}function tn(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(e)})}function nn(t,e){return new t({type:"number",checks:[],...z(e)})}function sn(t,e){return new t({type:"boolean",...z(e)})}function rn(t){return new t({type:"unknown"})}function on(t,e){return new t({type:"void",...z(e)})}function we(t,e){return new Ei({check:"greater_than",...z(e),value:t,inclusive:!0})}function an(t,e){return new Ci({check:"min_length",...z(e),minimum:t})}function cn(t,e,i){const n=z(i);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}const A=m("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");w.init(t,e),t.def=e,t.type=e.type,t.parse=(i,n)=>Ue(t,i,n,{callee:t.parse}),t.safeParse=(i,n)=>ft(t,i,n),t.parseAsync=async(i,n)=>Re(t,i,n,{callee:t.parseAsync}),t.safeParseAsync=async(i,n)=>mt(t,i,n),t.check=(...i)=>t.clone({...e,checks:[...e.checks??[],...i.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(i,n)=>De(t,i,n),t.brand=()=>t,t.register=((i,n)=>(i.add(t,n),t))}),St=m("ZodMiniString",(t,e)=>{gt.init(t,e),A.init(t,e)});function u(t){return en(St,t)}const ln=m("ZodMiniStringFormat",(t,e)=>{vt.init(t,e),St.init(t,e)}),dn=m("ZodMiniNumber",(t,e)=>{Mi.init(t,e),A.init(t,e)});function y(t){return nn(dn,t)}const un=m("ZodMiniBoolean",(t,e)=>{Fi.init(t,e),A.init(t,e)});function P(t){return sn(un,t)}const hn=m("ZodMiniUnknown",(t,e)=>{Zi.init(t,e),A.init(t,e)});function Ie(){return rn(hn)}const pn=m("ZodMiniVoid",(t,e)=>{ji.init(t,e),A.init(t,e)});function fn(t){return on(pn,t)}const mn=m("ZodMiniArray",(t,e)=>{Di.init(t,e),A.init(t,e)});function N(t,e){return new mn({type:"array",element:t,...z(e)})}const gn=m("ZodMiniObject",(t,e)=>{Ii.init(t,e),A.init(t,e),C(t,"shape",()=>e.shape)});function g(t,e){const i={type:"object",shape:t??{},...z(e)};return new gn(i)}function le(t,e){return gi(t,e)}function zt(t,e){return vi(Ct,t)}const vn=m("ZodMiniUnion",(t,e)=>{kt.init(t,e),A.init(t,e)});function bn(t,e){return new vn({type:"union",options:t,...z(e)})}const yn=m("ZodMiniDiscriminatedUnion",(t,e)=>{Li.init(t,e),A.init(t,e)});function xe(t,e,i){return new yn({type:"union",options:e,discriminator:t,...z(i)})}const kn=m("ZodMiniTuple",(t,e)=>{$t.init(t,e),A.init(t,e)});function $n(t,e,i){const n=e instanceof w,s=n?i:e,r=n?e:null;return new kn({type:"tuple",items:t,rest:r,...z(s)})}const _n=m("ZodMiniRecord",(t,e)=>{Ni.init(t,e),A.init(t,e)});function wn(t,e,i){return new _n({type:"record",keyType:t,valueType:e,...z(i)})}const xn=m("ZodMiniEnum",(t,e)=>{Bi.init(t,e),A.init(t,e),t.options=Object.values(e.entries)});function B(t,e){const i=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new xn({type:"enum",entries:i,...z(e)})}const An=m("ZodMiniLiteral",(t,e)=>{Vi.init(t,e),A.init(t,e)});function v(t,e){return new An({type:"literal",values:Array.isArray(t)?t:[t],...z(e)})}const Sn=m("ZodMiniTransform",(t,e)=>{Hi.init(t,e),A.init(t,e)});function Et(t){return new Sn({type:"transform",transform:t})}const Ct=m("ZodMiniOptional",(t,e)=>{qi.init(t,e),A.init(t,e)});function S(t){return new Ct({type:"optional",innerType:t})}const zn=m("ZodMiniDefault",(t,e)=>{Qi.init(t,e),A.init(t,e)});function _(t,e){return new zn({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():pi(e)}})}const En=m("ZodMiniPipe",(t,e)=>{Wi.init(t,e),A.init(t,e)});function Tt(t,e){return new En({type:"pipe",in:t,out:e})}const Cn=m("ZodMiniPromise",(t,e)=>{Gi.init(t,e),A.init(t,e)});function Le(t){return new Cn({type:"promise",innerType:t})}const Tn=m("ZodMiniCustom",(t,e)=>{Yi.init(t,e),A.init(t,e)});function Pn(t,e){return cn(Tn,t??(()=>!0),e)}function On(t,e={error:`Input not instance of ${t.name}`}){const i=Pn(n=>n instanceof t,e);return i._zod.bag.Class=t,i}const Mn=m("ZodMiniFunction",(t,e)=>{Ki.init(t,e),A.init(t,e)});function de(t){return new Mn({type:"function",input:Array.isArray(t?.input)?$n(t?.input):t?.input??N(Ie()),output:t?.output??Ie()})}const Fn=m("ZodMiniISODateTime",(t,e)=>{Oi.init(t,e),ln.init(t,e)});function Zn(t){return tn(Fn,t)}const jn=g({id:u(),title:u(),description:u(),category:S(u()),tags:_(N(u()),[]),updatedAt:S(Zn())}),Dn=le(jn,{content:u(),contentType:_(B(["markdown","html"]),"markdown")}),Un=g({type:v("function"),fetch:de({input:[],output:Le(g({articles:N(Dn)}))})}),Rn=xe("type",[Un]),Ae=g({name:u(),label:u(),required:_(P(),!1),placeholder:S(u())}),In=le(Ae,{type:v("text")}),Ln=le(Ae,{type:v("email")}),Nn=le(Ae,{type:v("textarea"),rows:_(y(),4)}),Bn=g({value:u(),label:u()}),Vn=le(Ae,{type:v("select"),options:N(Bn)}),Hn=xe("type",[In,Ln,Nn,Vn]),qn=g({mode:v("disabled")}),Qn=g({mode:v("inline"),maxFiles:_(y().check(we(1)),3),maxSizeMB:_(y().check(we(.1)),5),accept:S(u())}),Wn=g({mode:v("presigned"),maxFiles:_(y().check(we(1)),3),maxSizeMB:_(y().check(we(.1)),5),accept:S(u()),getUploadUrl:de({input:[g({filename:u(),contentType:u(),size:y()})],output:Le(g({uploadUrl:u(),fileUrl:u()}))})}),Kn=xe("mode",[qn,Qn,Wn]),Gn=g({filename:u(),url:u(),contentType:u(),size:y()}),Yn=g({type:v("function"),handler:de({input:[g({fields:wn(u(),Ie()),attachments:S(bn([N(On(File)),N(Gn)]))})],output:Le(g({success:_(P(),!0),message:u()}))})}),Jn=g({title:_(u(),"How can we help?"),subtitle:S(u()),fields:N(Hn).check(an(1)),attachments:_(Kn,{mode:"disabled"}),submit:Yn,submitButtonText:_(u(),"Send message")});g({timestamp:y(),sessionId:u()});const Xn=g({type:v("widget:open"),trigger:B(["button_click","programmatic","auto"])}),es=g({type:v("widget:close"),trigger:B(["button_click","escape","click_outside","programmatic"])}),ts=g({type:v("tab:change"),from:B(["articles","contact"]),to:B(["articles","contact"])}),is=g({type:v("articles:view"),articleCount:y(),hasSearchQuery:P()}),ns=g({type:v("article:click"),articleId:u(),articleTitle:u(),articleCategory:S(u()),fromSearch:P(),searchQuery:S(u())}),ss=g({type:v("article:view"),articleId:u(),articleTitle:u(),articleCategory:S(u())}),rs=g({type:v("article:close"),articleId:u(),articleTitle:u(),timeSpent:y()}),os=g({type:v("article:link:click"),articleId:u(),articleTitle:u(),linkUrl:u(),linkText:u(),external:P()}),as=g({type:v("search:query"),query:u(),resultCount:y(),timeToResults:y()}),cs=g({type:v("search:result:click"),query:u(),articleId:u(),articleTitle:u(),resultPosition:y()}),ls=g({type:v("search:clear"),previousQuery:u()}),ds=g({type:v("contact:view")}),us=g({type:v("contact:field:focus"),fieldName:u()}),hs=g({type:v("contact:submit"),hasName:P(),hasEmail:P(),hasMessage:P(),messageLength:y(),attachmentCount:y(),totalAttachmentSize:y()}),ps=g({type:v("contact:success"),responseTime:y()}),fs=g({type:v("contact:error"),errorType:u(),errorMessage:u()}),ms=g({type:v("contact:attachment:add"),fileName:u(),fileSize:y(),fileType:u(),attachmentCount:y()}),gs=g({type:v("contact:attachment:remove"),fileName:u(),attachmentCount:y()}),vs=g({type:v("contact:attachment:upload:start"),fileName:u(),fileSize:y()}),bs=g({type:v("contact:attachment:upload:success"),fileName:u(),uploadTime:y()}),ys=g({type:v("contact:attachment:upload:error"),fileName:u(),errorMessage:u()}),ks=g({type:v("filter:category"),category:u(),resultCount:y()}),$s=g({type:v("filter:tag"),tag:u(),resultCount:y()}),_s=xe("type",[Xn,es,ts,is,ns,ss,rs,os,as,cs,ls,ds,us,hs,ps,fs,ms,gs,vs,bs,ys,ks,$s]),ws=g({enabled:_(P(),!0),onEvent:S(de({input:[_s],output:fn()})),getSessionId:S(de({input:[],output:u()}))}),xs=g({widget:u(),close:u()}),As=g({articlesTab:u(),contactTab:u(),searchPlaceholder:u(),noResults:u(),loading:u(),backToArticles:u(),emptyStateTitle:u(),emptyStateSearchMessage:u(),emptyStateNoArticlesMessage:u(),getInTouch:u()}),Pt=g({position:_(B(["bottomRight","bottomLeft"]),"bottomRight"),offset:_(g({x:_(y(),20),y:_(y(),20)}),{x:20,y:20}),panelWidth:_(y(),400),panelHeight:_(y(),600),mobileBreakpoint:_(y(),768),articles:Rn,contact:S(Jn),icons:S(Tt(S(zt(xs)),Et(t=>({widget:f`<svg width="24" height="24" viewBox="5 2 14 20" fill="currentColor">
|
|
1
|
+
(function(h,j){typeof exports=="object"&&typeof module<"u"?j(exports):typeof define=="function"&&define.amd?define(["exports"],j):(h=typeof globalThis<"u"?globalThis:h||self,j(h.helpdock={}))})(this,(function(h){"use strict";const j=globalThis,Te=j.ShadowRoot&&(j.ShadyCSS===void 0||j.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Pe=Symbol(),qe=new WeakMap;let We=class{constructor(e,i,s){if(this._$cssResult$=!0,s!==Pe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=i}get styleSheet(){let e=this.o;const i=this.t;if(Te&&e===void 0){const s=i!==void 0&&i.length===1;s&&(e=qe.get(i)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&qe.set(i,e))}return e}toString(){return this.cssText}};const jt=t=>new We(typeof t=="string"?t:t+"",void 0,Pe),H=(t,...e)=>{const i=t.length===1?t[0]:e.reduce(((s,n,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[r+1]),t[0]);return new We(i,t,Pe)},Dt=(t,e)=>{if(Te)t.adoptedStyleSheets=e.map((i=>i instanceof CSSStyleSheet?i:i.styleSheet));else for(const i of e){const s=document.createElement("style"),n=j.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=i.cssText,t.appendChild(s)}},Qe=Te?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let i="";for(const s of e.cssRules)i+=s.cssText;return jt(i)})(t):t;const{is:Ut,defineProperty:Rt,getOwnPropertyDescriptor:It,getOwnPropertyNames:Lt,getOwnPropertySymbols:Bt,getPrototypeOf:Vt}=Object,fe=globalThis,Ke=fe.trustedTypes,Nt=Ke?Ke.emptyScript:"",Ht=fe.reactiveElementPolyfillSupport,ie=(t,e)=>t,me={toAttribute(t,e){switch(e){case Boolean:t=t?Nt:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=t!==null;break;case Number:i=t===null?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},Oe=(t,e)=>!Ut(t,e),Ge={attribute:!0,type:String,converter:me,reflect:!1,useDefault:!1,hasChanged:Oe};Symbol.metadata??=Symbol("metadata"),fe.litPropertyMetadata??=new WeakMap;let q=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,i=Ge){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(e,i),!i.noAccessor){const s=Symbol(),n=this.getPropertyDescriptor(e,s,i);n!==void 0&&Rt(this.prototype,e,n)}}static getPropertyDescriptor(e,i,s){const{get:n,set:r}=It(this.prototype,e)??{get(){return this[i]},set(o){this[i]=o}};return{get:n,set(o){const a=n?.call(this);r?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ge}static _$Ei(){if(this.hasOwnProperty(ie("elementProperties")))return;const e=Vt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ie("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ie("properties"))){const i=this.properties,s=[...Lt(i),...Bt(i)];for(const n of s)this.createProperty(n,i[n])}const e=this[Symbol.metadata];if(e!==null){const i=litPropertyMetadata.get(e);if(i!==void 0)for(const[s,n]of i)this.elementProperties.set(s,n)}this._$Eh=new Map;for(const[i,s]of this.elementProperties){const n=this._$Eu(i,s);n!==void 0&&this._$Eh.set(n,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const i=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const n of s)i.unshift(Qe(n))}else e!==void 0&&i.push(Qe(e));return i}static _$Eu(e,i){const s=i.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,i=this.constructor.elementProperties;for(const s of i.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Dt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,i,s){this._$AK(e,s)}_$ET(e,i){const s=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,s);if(n!==void 0&&s.reflect===!0){const r=(s.converter?.toAttribute!==void 0?s.converter:me).toAttribute(i,s.type);this._$Em=e,r==null?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(e,i){const s=this.constructor,n=s._$Eh.get(e);if(n!==void 0&&this._$Em!==n){const r=s.getPropertyOptions(n),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:me;this._$Em=n;const a=o.fromAttribute(i,r.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(e,i,s){if(e!==void 0){const n=this.constructor,r=this[e];if(s??=n.getPropertyOptions(e),!((s.hasChanged??Oe)(r,i)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(n._$Eu(e,s))))return;this.C(e,i,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,i,{useDefault:s,reflect:n,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??i??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(i=void 0),this._$AL.set(e,i)),n===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[n,r]of s){const{wrapped:o}=r,a=this[n];o!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,r,a)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(i)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(i)}willUpdate(e){}_$AE(e){this._$EO?.forEach((i=>i.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((i=>this._$ET(i,this[i]))),this._$EM()}updated(e){}firstUpdated(e){}};q.elementStyles=[],q.shadowRootOptions={mode:"open"},q[ie("elementProperties")]=new Map,q[ie("finalized")]=new Map,Ht?.({ReactiveElement:q}),(fe.reactiveElementVersions??=[]).push("2.1.1");const Me=globalThis,ge=Me.trustedTypes,Ye=ge?ge.createPolicy("lit-html",{createHTML:t=>t}):void 0,Je="$lit$",D=`lit$${Math.random().toFixed(9).slice(2)}$`,Xe="?"+D,qt=`<${Xe}>`,U=document,se=()=>U.createComment(""),ne=t=>t===null||typeof t!="object"&&typeof t!="function",Fe=Array.isArray,Wt=t=>Fe(t)||typeof t?.[Symbol.iterator]=="function",Ze=`[
|
|
2
|
+
\f\r]`,re=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,et=/-->/g,tt=/>/g,R=RegExp(`>|${Ze}(?:([^\\s"'>=/]+)(${Ze}*=${Ze}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),it=/'/g,st=/"/g,nt=/^(?:script|style|textarea|title)$/i,Qt=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),f=Qt(1),W=Symbol.for("lit-noChange"),S=Symbol.for("lit-nothing"),rt=new WeakMap,I=U.createTreeWalker(U,129);function ot(t,e){if(!Fe(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ye!==void 0?Ye.createHTML(e):e}const Kt=(t,e)=>{const i=t.length-1,s=[];let n,r=e===2?"<svg>":e===3?"<math>":"",o=re;for(let a=0;a<i;a++){const l=t[a];let c,d,p=-1,b=0;for(;b<l.length&&(o.lastIndex=b,d=o.exec(l),d!==null);)b=o.lastIndex,o===re?d[1]==="!--"?o=et:d[1]!==void 0?o=tt:d[2]!==void 0?(nt.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=R):d[3]!==void 0&&(o=R):o===R?d[0]===">"?(o=n??re,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?R:d[3]==='"'?st:it):o===st||o===it?o=R:o===et||o===tt?o=re:(o=R,n=void 0);const E=o===R&&t[a+1].startsWith("/>")?" ":"";r+=o===re?l+qt:p>=0?(s.push(c),l.slice(0,p)+Je+l.slice(p)+D+E):l+D+(p===-2?a:E)}return[ot(t,r+(t[i]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};class oe{constructor({strings:e,_$litType$:i},s){let n;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,d]=Kt(e,i);if(this.el=oe.createElement(c,s),I.currentNode=this.el.content,i===2||i===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=I.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(const p of n.getAttributeNames())if(p.endsWith(Je)){const b=d[o++],E=n.getAttribute(p).split(D),O=/([.?@])?(.*)/.exec(b);l.push({type:1,index:r,name:O[2],strings:E,ctor:O[1]==="."?Yt:O[1]==="?"?Jt:O[1]==="@"?Xt:ve}),n.removeAttribute(p)}else p.startsWith(D)&&(l.push({type:6,index:r}),n.removeAttribute(p));if(nt.test(n.tagName)){const p=n.textContent.split(D),b=p.length-1;if(b>0){n.textContent=ge?ge.emptyScript:"";for(let E=0;E<b;E++)n.append(p[E],se()),I.nextNode(),l.push({type:2,index:++r});n.append(p[b],se())}}}else if(n.nodeType===8)if(n.data===Xe)l.push({type:2,index:r});else{let p=-1;for(;(p=n.data.indexOf(D,p+1))!==-1;)l.push({type:7,index:r}),p+=D.length-1}r++}}static createElement(e,i){const s=U.createElement("template");return s.innerHTML=e,s}}function Q(t,e,i=t,s){if(e===W)return e;let n=s!==void 0?i._$Co?.[s]:i._$Cl;const r=ne(e)?void 0:e._$litDirective$;return n?.constructor!==r&&(n?._$AO?.(!1),r===void 0?n=void 0:(n=new r(t),n._$AT(t,i,s)),s!==void 0?(i._$Co??=[])[s]=n:i._$Cl=n),n!==void 0&&(e=Q(t,n._$AS(t,e.values),n,s)),e}class Gt{constructor(e,i){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:i},parts:s}=this._$AD,n=(e?.creationScope??U).importNode(i,!0);I.currentNode=n;let r=I.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new ae(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new ei(r,this,e)),this._$AV.push(c),l=s[++a]}o!==l?.index&&(r=I.nextNode(),o++)}return I.currentNode=U,n}p(e){let i=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,i),i+=s.strings.length-2):s._$AI(e[i])),i++}}class ae{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,i,s,n){this.type=2,this._$AH=S,this._$AN=void 0,this._$AA=e,this._$AB=i,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const i=this._$AM;return i!==void 0&&e?.nodeType===11&&(e=i.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,i=this){e=Q(this,e,i),ne(e)?e===S||e==null||e===""?(this._$AH!==S&&this._$AR(),this._$AH=S):e!==this._$AH&&e!==W&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Wt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==S&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(U.createTextNode(e)),this._$AH=e}$(e){const{values:i,_$litType$:s}=e,n=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=oe.createElement(ot(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(i);else{const r=new Gt(n,this),o=r.u(this.options);r.p(i),this.T(o),this._$AH=r}}_$AC(e){let i=rt.get(e.strings);return i===void 0&&rt.set(e.strings,i=new oe(e)),i}k(e){Fe(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,n=0;for(const r of e)n===i.length?i.push(s=new ae(this.O(se()),this.O(se()),this,this.options)):s=i[n],s._$AI(r),n++;n<i.length&&(this._$AR(s&&s._$AB.nextSibling,n),i.length=n)}_$AR(e=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class ve{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,i,s,n,r){this.type=1,this._$AH=S,this._$AN=void 0,this.element=e,this.name=i,this._$AM=n,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=S}_$AI(e,i=this,s,n){const r=this.strings;let o=!1;if(r===void 0)e=Q(this,e,i,0),o=!ne(e)||e!==this._$AH&&e!==W,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=Q(this,a[s+l],i,l),c===W&&(c=this._$AH[l]),o||=!ne(c)||c!==this._$AH[l],c===S?e=S:e!==S&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!n&&this.j(e)}j(e){e===S?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Yt extends ve{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===S?void 0:e}}class Jt extends ve{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==S)}}class Xt extends ve{constructor(e,i,s,n,r){super(e,i,s,n,r),this.type=5}_$AI(e,i=this){if((e=Q(this,e,i,0)??S)===W)return;const s=this._$AH,n=e===S&&s!==S||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==S&&(s===S||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ei{constructor(e,i,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Q(this,e)}}const ti=Me.litHtmlPolyfillSupport;ti?.(oe,ae),(Me.litHtmlVersions??=[]).push("3.3.1");const ii=(t,e,i)=>{const s=i?.renderBefore??e;let n=s._$litPart$;if(n===void 0){const r=i?.renderBefore??null;s._$litPart$=n=new ae(e.insertBefore(se(),r),r,void 0,i??{})}return n._$AI(t),n};const je=globalThis;let M=class extends q{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ii(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return W}};M._$litElement$=!0,M.finalized=!0,je.litElementHydrateSupport?.({LitElement:M});const si=je.litElementPolyfillSupport;si?.({LitElement:M}),(je.litElementVersions??=[]).push("4.2.1");const K=t=>(e,i)=>{i!==void 0?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};const ni={attribute:!0,type:String,converter:me,reflect:!1,hasChanged:Oe},ri=(t=ni,e,i)=>{const{kind:s,metadata:n}=i;let r=globalThis.litPropertyMetadata.get(n);if(r===void 0&&globalThis.litPropertyMetadata.set(n,r=new Map),s==="setter"&&((t=Object.create(t)).wrapped=!0),r.set(i.name,t),s==="accessor"){const{name:o}=i;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,t)},init(a){return a!==void 0&&this.C(o,void 0,t,a),a}}}if(s==="setter"){const{name:o}=i;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,t)}}throw Error("Unsupported decorator location: "+s)};function Z(t){return(e,i)=>typeof i=="object"?ri(t,e,i):((s,n,r)=>{const o=n.hasOwnProperty(r);return n.constructor.createProperty(r,s),o?Object.getOwnPropertyDescriptor(n,r):void 0})(t,e,i)}function k(t){return Z({...t,state:!0,attribute:!1})}let at=class extends Event{constructor(e,i,s,n){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=i,this.callback=s,this.subscribe=n??!1}};function qn(t){return t}let ct=class{constructor(e,i,s,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=e,i.context!==void 0){const r=i;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=i,this.callback=s,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new at(this.context,this.host,this.t,this.subscribe))}};class oi{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,i=!1){const s=i||!Object.is(e,this.o);this.o=e,s&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[i,{disposer:s}]of this.subscriptions)i(this.o,s)},e!==void 0&&(this.value=e)}addCallback(e,i,s){if(!s)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:i});const{disposer:n}=this.subscriptions.get(e);e(this.value,n)}clearCallbacks(){this.subscriptions.clear()}}let ai=class extends Event{constructor(e,i){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=i}};class De extends oi{constructor(e,i,s){super(i.context!==void 0?i.initialValue:s),this.onContextRequest=n=>{if(n.context!==this.context)return;const r=n.contextTarget??n.composedPath()[0];r!==this.host&&(n.stopPropagation(),this.addCallback(n.callback,r,n.subscribe))},this.onProviderRequest=n=>{if(n.context!==this.context||(n.contextTarget??n.composedPath()[0])===this.host)return;const r=new Set;for(const[o,{consumerHost:a}]of this.subscriptions)r.has(o)||(r.add(o),a.dispatchEvent(new at(this.context,a,o,!0)));n.stopPropagation()},this.host=e,i.context!==void 0?this.context=i.context:this.context=i,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new ai(this.context,this.host))}}function ci({context:t}){return(e,i)=>{const s=new WeakMap;if(typeof i=="object")return{get(){return e.get.call(this)},set(n){return s.get(this).setValue(n),e.set.call(this,n)},init(n){return s.set(this,new De(this,{context:t,initialValue:n})),n}};{e.constructor.addInitializer((o=>{s.set(o,new De(o,{context:t}))}));const n=Object.getOwnPropertyDescriptor(e,i);let r;if(n===void 0){const o=new WeakMap;r={get(){return o.get(this)},set(a){s.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=n.set;r={...n,set(a){s.get(this).setValue(a),o?.call(this,a)}}}return void Object.defineProperty(e,i,r)}}}function ce({context:t,subscribe:e}){return(i,s)=>{typeof s=="object"?s.addInitializer((function(){new ct(this,{context:t,callback:n=>{i.set.call(this,n)},subscribe:e})})):i.constructor.addInitializer((n=>{new ct(n,{context:t,callback:r=>{n[s]=r},subscribe:e})}))}}function m(t,e,i){function s(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,l);const c=o.prototype,d=Object.keys(c);for(let p=0;p<d.length;p++){const b=d[p];b in a||(a[b]=c[b].bind(a))}}const n=i?.Parent??Object;class r extends n{}Object.defineProperty(r,"name",{value:t});function o(a){var l;const c=i?.Parent?new r:this;s(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const d of c._zod.deferred)d();return c}return Object.defineProperty(o,"init",{value:s}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>i?.Parent&&a instanceof i.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}class G extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class li extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const di={};function Y(t){return di}function ui(t){const e=Object.values(t).filter(s=>typeof s=="number");return Object.entries(t).filter(([s,n])=>e.indexOf(+s)===-1).map(([s,n])=>n)}function hi(t,e){return typeof e=="bigint"?e.toString():e}function lt(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function pi(t){return t==null}function dt(t){const e=t.startsWith("^")?1:0,i=t.endsWith("$")?t.length-1:t.length;return t.slice(e,i)}const ut=Symbol("evaluating");function C(t,e,i){let s;Object.defineProperty(t,e,{get(){if(s!==ut)return s===void 0&&(s=ut,s=i()),s},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function ht(t,e,i){Object.defineProperty(t,e,{value:i,writable:!0,enumerable:!0,configurable:!0})}function pt(...t){const e={};for(const i of t){const s=Object.getOwnPropertyDescriptors(i);Object.assign(e,s)}return Object.defineProperties({},e)}const ft="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function be(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ue(t){if(be(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const i=e.prototype;return!(be(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function fi(t){return Ue(t)?{...t}:Array.isArray(t)?[...t]:t}const mi=new Set(["string","number","symbol"]);function Re(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ie(t,e,i){const s=new t._zod.constr(e??t._zod.def);return(!e||i?.parent)&&(s._zod.parent=t),s}function z(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function gi(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function vi(t,e){if(!Ue(e))throw new Error("Invalid input to extend: expected a plain object");const i=t._zod.def.checks;if(i&&i.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const n=pt(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return ht(this,"shape",r),r},checks:[]});return Ie(t,n)}function bi(t,e,i){const s=pt(e._zod.def,{get shape(){const n=e._zod.def.shape,r={...n};for(const o in n)r[o]=t?new t({type:"optional",innerType:n[o]}):n[o];return ht(this,"shape",r),r},checks:[]});return Ie(e,s)}function le(t,e=0){if(t.aborted===!0)return!0;for(let i=e;i<t.issues.length;i++)if(t.issues[i]?.continue!==!0)return!0;return!1}function L(t,e){return e.map(i=>{var s;return(s=i).path??(s.path=[]),i.path.unshift(t),i})}function ye(t){return typeof t=="string"?t:t?.message}function J(t,e,i){const s={...t,path:t.path??[]};if(!t.message){const n=ye(t.inst?._zod.def?.error?.(t))??ye(e?.error?.(t))??ye(i.customError?.(t))??ye(i.localeError?.(t))??"Invalid input";s.message=n}return delete s.inst,delete s.continue,e?.reportInput||delete s.input,s}function yi(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function ki(...t){const[e,i,s]=t;return typeof e=="string"?{message:e,code:"custom",input:i,inst:s}:{...e}}const mt=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,hi,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},wi=m("$ZodError",mt),ke=m("$ZodError",mt,{Parent:Error}),Le=(t=>(e,i,s,n)=>{const r=s?Object.assign(s,{async:!1}):{async:!1},o=e._zod.run({value:i,issues:[]},r);if(o instanceof Promise)throw new G;if(o.issues.length){const a=new(n?.Err??t)(o.issues.map(l=>J(l,r,Y())));throw ft(a,n?.callee),a}return o.value})(ke),Be=(t=>async(e,i,s,n)=>{const r=s?Object.assign(s,{async:!0}):{async:!0};let o=e._zod.run({value:i,issues:[]},r);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(n?.Err??t)(o.issues.map(l=>J(l,r,Y())));throw ft(a,n?.callee),a}return o.value})(ke),gt=(t=>(e,i,s)=>{const n=s?{...s,async:!1}:{async:!1},r=e._zod.run({value:i,issues:[]},n);if(r instanceof Promise)throw new G;return r.issues.length?{success:!1,error:new(t??wi)(r.issues.map(o=>J(o,n,Y())))}:{success:!0,data:r.value}})(ke),vt=(t=>async(e,i,s)=>{const n=s?Object.assign(s,{async:!0}):{async:!0};let r=e._zod.run({value:i,issues:[]},n);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new t(r.issues.map(o=>J(o,n,Y())))}:{success:!0,data:r.value}})(ke),$i="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function _i(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xi(t){const e=_i({precision:t.precision}),i=["Z"];t.local&&i.push(""),t.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${e}(?:${i.join("|")})`;return new RegExp(`^${$i}T(?:${s})$`)}const Si=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Ai=/^-?\d+(?:\.\d+)?/,zi=/^(?:true|false)$/i,we=m("$ZodCheck",(t,e)=>{var i;t._zod??(t._zod={}),t._zod.def=e,(i=t._zod).onattach??(i.onattach=[])}),Ei={number:"number",bigint:"bigint",object:"date"},Ci=m("$ZodCheckGreaterThan",(t,e)=>{we.init(t,e);const i=Ei[typeof e.value];t._zod.onattach.push(s=>{const n=s._zod.bag,r=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>r&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=s=>{(e.inclusive?s.value>=e.value:s.value>e.value)||s.issues.push({origin:i,code:"too_small",minimum:e.value,input:s.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Ti=m("$ZodCheckMinLength",(t,e)=>{var i;we.init(t,e),(i=t._zod.def).when??(i.when=s=>{const n=s.value;return!pi(n)&&n.length!==void 0}),t._zod.onattach.push(s=>{const n=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(s._zod.bag.minimum=e.minimum)}),t._zod.check=s=>{const n=s.value;if(n.length>=e.minimum)return;const o=yi(n);s.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Pi=m("$ZodCheckStringFormat",(t,e)=>{var i,s;we.init(t,e),t._zod.onattach.push(n=>{const r=n._zod.bag;r.format=e.format,e.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(e.pattern))}),e.pattern?(i=t._zod).check??(i.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(s=t._zod).check??(s.check=()=>{})}),Oi={major:4,minor:2,patch:1},_=m("$ZodType",(t,e)=>{var i;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Oi;const s=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&s.unshift(t);for(const n of s)for(const r of n._zod.onattach)r(t);if(s.length===0)(i=t._zod).deferred??(i.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const n=(o,a,l)=>{let c=le(o),d;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(c)continue;const b=o.issues.length,E=p._zod.check(o);if(E instanceof Promise&&l?.async===!1)throw new G;if(d||E instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await E,o.issues.length!==b&&(c||(c=le(o,b)))});else{if(o.issues.length===b)continue;c||(c=le(o,b))}}return d?d.then(()=>o):o},r=(o,a,l)=>{if(le(o))return o.aborted=!0,o;const c=n(a,s,l);if(c instanceof Promise){if(l.async===!1)throw new G;return c.then(d=>t._zod.parse(d,l))}return t._zod.parse(c,l)};t._zod.run=(o,a)=>{if(a.skipChecks)return t._zod.parse(o,a);if(a.direction==="backward"){const c=t._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(d=>r(d,o,a)):r(c,o,a)}const l=t._zod.parse(o,a);if(l instanceof Promise){if(a.async===!1)throw new G;return l.then(c=>n(c,s,a))}return n(l,s,a)}}t["~standard"]={validate:n=>{try{const r=gt(t,n);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return vt(t,n).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}}),bt=m("$ZodString",(t,e)=>{_.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Si(t._zod.bag),t._zod.parse=(i,s)=>{if(e.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:t}),i}}),yt=m("$ZodStringFormat",(t,e)=>{Pi.init(t,e),bt.init(t,e)}),Mi=m("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=xi(e)),yt.init(t,e)}),Fi=m("$ZodNumber",(t,e)=>{_.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ai,t._zod.parse=(i,s)=>{if(e.coerce)try{i.value=Number(i.value)}catch{}const n=i.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return i;const r=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...r?{received:r}:{}}),i}}),Zi=m("$ZodBoolean",(t,e)=>{_.init(t,e),t._zod.pattern=zi,t._zod.parse=(i,s)=>{if(e.coerce)try{i.value=!!i.value}catch{}const n=i.value;return typeof n=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),i}}),ji=m("$ZodUnknown",(t,e)=>{_.init(t,e),t._zod.parse=i=>i}),Di=m("$ZodVoid",(t,e)=>{_.init(t,e),t._zod.parse=(i,s)=>{const n=i.value;return typeof n>"u"||i.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),i}});function kt(t,e,i){t.issues.length&&e.issues.push(...L(i,t.issues)),e.value[i]=t.value}const Ui=m("$ZodArray",(t,e)=>{_.init(t,e),t._zod.parse=(i,s)=>{const n=i.value;if(!Array.isArray(n))return i.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),i;i.value=Array(n.length);const r=[];for(let o=0;o<n.length;o++){const a=n[o],l=e.element._zod.run({value:a,issues:[]},s);l instanceof Promise?r.push(l.then(c=>kt(c,i,o))):kt(l,i,o)}return r.length?Promise.all(r).then(()=>i):i}});function $e(t,e,i,s){t.issues.length&&e.issues.push(...L(i,t.issues)),t.value===void 0?i in s&&(e.value[i]=void 0):e.value[i]=t.value}function Ri(t){const e=Object.keys(t.shape);for(const s of e)if(!t.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const i=gi(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(i)}}function Ii(t,e,i,s,n,r){const o=[],a=n.keySet,l=n.catchall._zod,c=l.def.type;for(const d in e){if(a.has(d))continue;if(c==="never"){o.push(d);continue}const p=l.run({value:e[d],issues:[]},s);p instanceof Promise?t.push(p.then(b=>$e(b,i,d,e))):$e(p,i,d,e)}return o.length&&i.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:r}),t.length?Promise.all(t).then(()=>i):i}const Li=m("$ZodObject",(t,e)=>{if(_.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){const a=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...a};return Object.defineProperty(e,"shape",{value:l}),l}})}const s=lt(()=>Ri(e));C(t._zod,"propValues",()=>{const a=e.shape,l={};for(const c in a){const d=a[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(const p of d.values)l[c].add(p)}}return l});const n=be,r=e.catchall;let o;t._zod.parse=(a,l)=>{o??(o=s.value);const c=a.value;if(!n(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:t}),a;a.value={};const d=[],p=o.shape;for(const b of o.keys){const O=p[b]._zod.run({value:c[b],issues:[]},l);O instanceof Promise?d.push(O.then(Hn=>$e(Hn,a,b,c))):$e(O,a,b,c)}return r?Ii(d,c,a,l,s.value,t):d.length?Promise.all(d).then(()=>a):a}});function wt(t,e,i,s){for(const r of t)if(r.issues.length===0)return e.value=r.value,e;const n=t.filter(r=>!le(r));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:i,errors:t.map(r=>r.issues.map(o=>J(o,s,Y())))}),e)}const $t=m("$ZodUnion",(t,e)=>{_.init(t,e),C(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),C(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),C(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),C(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){const n=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>dt(r.source)).join("|")})$`)}});const i=e.options.length===1,s=e.options[0]._zod.run;t._zod.parse=(n,r)=>{if(i)return s(n,r);let o=!1;const a=[];for(const l of e.options){const c=l._zod.run({value:n.value,issues:[]},r);if(c instanceof Promise)a.push(c),o=!0;else{if(c.issues.length===0)return c;a.push(c)}}return o?Promise.all(a).then(l=>wt(l,n,t,r)):wt(a,n,t,r)}}),Bi=m("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,$t.init(t,e);const i=t._zod.parse;C(t._zod,"propValues",()=>{const n={};for(const r of e.options){const o=r._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(const[a,l]of Object.entries(o)){n[a]||(n[a]=new Set);for(const c of l)n[a].add(c)}}return n});const s=lt(()=>{const n=e.options,r=new Map;for(const o of n){const a=o._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const l of a){if(r.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);r.set(l,o)}}return r});t._zod.parse=(n,r)=>{const o=n.value;if(!be(o))return n.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),n;const a=s.value.get(o?.[e.discriminator]);return a?a._zod.run(n,r):e.unionFallback?i(n,r):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:o,path:[e.discriminator],inst:t}),n)}}),_t=m("$ZodTuple",(t,e)=>{_.init(t,e);const i=e.items;t._zod.parse=(s,n)=>{const r=s.value;if(!Array.isArray(r))return s.issues.push({input:r,inst:t,expected:"tuple",code:"invalid_type"}),s;s.value=[];const o=[],a=[...i].reverse().findIndex(d=>d._zod.optin!=="optional"),l=a===-1?0:i.length-a;if(!e.rest){const d=r.length>i.length,p=r.length<l-1;if(d||p)return s.issues.push({...d?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},input:r,inst:t,origin:"array"}),s}let c=-1;for(const d of i){if(c++,c>=r.length&&c>=l)continue;const p=d._zod.run({value:r[c],issues:[]},n);p instanceof Promise?o.push(p.then(b=>_e(b,s,c))):_e(p,s,c)}if(e.rest){const d=r.slice(i.length);for(const p of d){c++;const b=e.rest._zod.run({value:p,issues:[]},n);b instanceof Promise?o.push(b.then(E=>_e(E,s,c))):_e(b,s,c)}}return o.length?Promise.all(o).then(()=>s):s}});function _e(t,e,i){t.issues.length&&e.issues.push(...L(i,t.issues)),e.value[i]=t.value}const Vi=m("$ZodRecord",(t,e)=>{_.init(t,e),t._zod.parse=(i,s)=>{const n=i.value;if(!Ue(n))return i.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),i;const r=[],o=e.keyType._zod.values;if(o){i.value={};const a=new Set;for(const c of o)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const d=e.valueType._zod.run({value:n[c],issues:[]},s);d instanceof Promise?r.push(d.then(p=>{p.issues.length&&i.issues.push(...L(c,p.issues)),i.value[c]=p.value})):(d.issues.length&&i.issues.push(...L(c,d.issues)),i.value[c]=d.value)}let l;for(const c in n)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:l})}else{i.value={};for(const a of Reflect.ownKeys(n)){if(a==="__proto__")continue;const l=e.keyType._zod.run({value:a,issues:[]},s);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){e.mode==="loose"?i.value[a]=n[a]:i.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>J(d,s,Y())),input:a,path:[a],inst:t});continue}const c=e.valueType._zod.run({value:n[a],issues:[]},s);c instanceof Promise?r.push(c.then(d=>{d.issues.length&&i.issues.push(...L(a,d.issues)),i.value[l.value]=d.value})):(c.issues.length&&i.issues.push(...L(a,c.issues)),i.value[l.value]=c.value)}}return r.length?Promise.all(r).then(()=>i):i}}),Ni=m("$ZodEnum",(t,e)=>{_.init(t,e);const i=ui(e.entries),s=new Set(i);t._zod.values=s,t._zod.pattern=new RegExp(`^(${i.filter(n=>mi.has(typeof n)).map(n=>typeof n=="string"?Re(n):n.toString()).join("|")})$`),t._zod.parse=(n,r)=>{const o=n.value;return s.has(o)||n.issues.push({code:"invalid_value",values:i,input:o,inst:t}),n}}),Hi=m("$ZodLiteral",(t,e)=>{if(_.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(e.values);t._zod.values=i,t._zod.pattern=new RegExp(`^(${e.values.map(s=>typeof s=="string"?Re(s):s?Re(s.toString()):String(s)).join("|")})$`),t._zod.parse=(s,n)=>{const r=s.value;return i.has(r)||s.issues.push({code:"invalid_value",values:e.values,input:r,inst:t}),s}}),qi=m("$ZodTransform",(t,e)=>{_.init(t,e),t._zod.parse=(i,s)=>{if(s.direction==="backward")throw new li(t.constructor.name);const n=e.transform(i.value,i);if(s.async)return(n instanceof Promise?n:Promise.resolve(n)).then(o=>(i.value=o,i));if(n instanceof Promise)throw new G;return i.value=n,i}});function xt(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}const Wi=m("$ZodOptional",(t,e)=>{_.init(t,e),t._zod.optin="optional",t._zod.optout="optional",C(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),C(t._zod,"pattern",()=>{const i=e.innerType._zod.pattern;return i?new RegExp(`^(${dt(i.source)})?$`):void 0}),t._zod.parse=(i,s)=>{if(e.innerType._zod.optin==="optional"){const n=e.innerType._zod.run(i,s);return n instanceof Promise?n.then(r=>xt(r,i.value)):xt(n,i.value)}return i.value===void 0?i:e.innerType._zod.run(i,s)}}),Qi=m("$ZodDefault",(t,e)=>{_.init(t,e),t._zod.optin="optional",C(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(i,s)=>{if(s.direction==="backward")return e.innerType._zod.run(i,s);if(i.value===void 0)return i.value=e.defaultValue,i;const n=e.innerType._zod.run(i,s);return n instanceof Promise?n.then(r=>St(r,e)):St(n,e)}});function St(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const Ki=m("$ZodPipe",(t,e)=>{_.init(t,e),C(t._zod,"values",()=>e.in._zod.values),C(t._zod,"optin",()=>e.in._zod.optin),C(t._zod,"optout",()=>e.out._zod.optout),C(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(i,s)=>{if(s.direction==="backward"){const r=e.out._zod.run(i,s);return r instanceof Promise?r.then(o=>xe(o,e.in,s)):xe(r,e.in,s)}const n=e.in._zod.run(i,s);return n instanceof Promise?n.then(r=>xe(r,e.out,s)):xe(n,e.out,s)}});function xe(t,e,i){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},i)}const Gi=m("$ZodFunction",(t,e)=>(_.init(t,e),t._def=e,t._zod.def=e,t.implement=i=>{if(typeof i!="function")throw new Error("implement() must be called with a function");return function(...s){const n=t._def.input?Le(t._def.input,s):s,r=Reflect.apply(i,this,n);return t._def.output?Le(t._def.output,r):r}},t.implementAsync=i=>{if(typeof i!="function")throw new Error("implementAsync() must be called with a function");return async function(...s){const n=t._def.input?await Be(t._def.input,s):s,r=await Reflect.apply(i,this,n);return t._def.output?await Be(t._def.output,r):r}},t._zod.parse=(i,s)=>typeof i.value!="function"?(i.issues.push({code:"invalid_type",expected:"function",input:i.value,inst:t}),i):(t._def.output&&t._def.output._zod.def.type==="promise"?i.value=t.implementAsync(i.value):i.value=t.implement(i.value),i),t.input=(...i)=>{const s=t.constructor;return Array.isArray(i[0])?new s({type:"function",input:new _t({type:"tuple",items:i[0],rest:i[1]}),output:t._def.output}):new s({type:"function",input:i[0],output:t._def.output})},t.output=i=>{const s=t.constructor;return new s({type:"function",input:t._def.input,output:i})},t)),Yi=m("$ZodPromise",(t,e)=>{_.init(t,e),t._zod.parse=(i,s)=>Promise.resolve(i.value).then(n=>e.innerType._zod.run({value:n,issues:[]},s))}),Ji=m("$ZodCustom",(t,e)=>{we.init(t,e),_.init(t,e),t._zod.parse=(i,s)=>i,t._zod.check=i=>{const s=i.value,n=e.fn(s);if(n instanceof Promise)return n.then(r=>At(r,i,s,t));At(n,i,s,t)}});function At(t,e,i,s){if(!t){const n={code:"custom",input:i,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(n.params=s._zod.def.params),e.issues.push(ki(n))}}var zt;class Xi{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...i){const s=i[0];if(this._map.set(e,s),s&&typeof s=="object"&&"id"in s){if(this._idmap.has(s.id))throw new Error(`ID ${s.id} already exists in the registry`);this._idmap.set(s.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const i=this._map.get(e);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(e),this}get(e){const i=e._zod.parent;if(i){const s={...this.get(i)??{}};delete s.id;const n={...s,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function es(){return new Xi}(zt=globalThis).__zod_globalRegistry??(zt.__zod_globalRegistry=es());function ts(t,e){return new t({type:"string",...z(e)})}function is(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(e)})}function ss(t,e){return new t({type:"number",checks:[],...z(e)})}function ns(t,e){return new t({type:"boolean",...z(e)})}function rs(t){return new t({type:"unknown"})}function os(t,e){return new t({type:"void",...z(e)})}function Se(t,e){return new Ci({check:"greater_than",...z(e),value:t,inclusive:!0})}function as(t,e){return new Ti({check:"min_length",...z(e),minimum:t})}function cs(t,e,i){const s=z(i);return s.abort??(s.abort=!0),new t({type:"custom",check:"custom",fn:e,...s})}const A=m("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");_.init(t,e),t.def=e,t.type=e.type,t.parse=(i,s)=>Le(t,i,s,{callee:t.parse}),t.safeParse=(i,s)=>gt(t,i,s),t.parseAsync=async(i,s)=>Be(t,i,s,{callee:t.parseAsync}),t.safeParseAsync=async(i,s)=>vt(t,i,s),t.check=(...i)=>t.clone({...e,checks:[...e.checks??[],...i.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),t.clone=(i,s)=>Ie(t,i,s),t.brand=()=>t,t.register=((i,s)=>(i.add(t,s),t))}),Et=m("ZodMiniString",(t,e)=>{bt.init(t,e),A.init(t,e)});function u(t){return ts(Et,t)}const ls=m("ZodMiniStringFormat",(t,e)=>{yt.init(t,e),Et.init(t,e)}),ds=m("ZodMiniNumber",(t,e)=>{Fi.init(t,e),A.init(t,e)});function y(t){return ss(ds,t)}const us=m("ZodMiniBoolean",(t,e)=>{Zi.init(t,e),A.init(t,e)});function T(t){return ns(us,t)}const hs=m("ZodMiniUnknown",(t,e)=>{ji.init(t,e),A.init(t,e)});function de(){return rs(hs)}const ps=m("ZodMiniVoid",(t,e)=>{Di.init(t,e),A.init(t,e)});function fs(t){return os(ps,t)}const ms=m("ZodMiniArray",(t,e)=>{Ui.init(t,e),A.init(t,e)});function B(t,e){return new ms({type:"array",element:t,...z(e)})}const gs=m("ZodMiniObject",(t,e)=>{Li.init(t,e),A.init(t,e),C(t,"shape",()=>e.shape)});function g(t,e){const i={type:"object",shape:t??{},...z(e)};return new gs(i)}function ue(t,e){return vi(t,e)}function Ct(t,e){return bi(Pt,t)}const vs=m("ZodMiniUnion",(t,e)=>{$t.init(t,e),A.init(t,e)});function bs(t,e){return new vs({type:"union",options:t,...z(e)})}const ys=m("ZodMiniDiscriminatedUnion",(t,e)=>{Bi.init(t,e),A.init(t,e)});function he(t,e,i){return new ys({type:"union",options:e,discriminator:t,...z(i)})}const ks=m("ZodMiniTuple",(t,e)=>{_t.init(t,e),A.init(t,e)});function ws(t,e,i){const s=e instanceof _,n=s?i:e,r=s?e:null;return new ks({type:"tuple",items:t,rest:r,...z(n)})}const $s=m("ZodMiniRecord",(t,e)=>{Vi.init(t,e),A.init(t,e)});function Ve(t,e,i){return new $s({type:"record",keyType:t,valueType:e,...z(i)})}const _s=m("ZodMiniEnum",(t,e)=>{Ni.init(t,e),A.init(t,e),t.options=Object.values(e.entries)});function V(t,e){const i=Array.isArray(t)?Object.fromEntries(t.map(s=>[s,s])):t;return new _s({type:"enum",entries:i,...z(e)})}const xs=m("ZodMiniLiteral",(t,e)=>{Hi.init(t,e),A.init(t,e)});function v(t,e){return new xs({type:"literal",values:Array.isArray(t)?t:[t],...z(e)})}const Ss=m("ZodMiniTransform",(t,e)=>{qi.init(t,e),A.init(t,e)});function Tt(t){return new Ss({type:"transform",transform:t})}const Pt=m("ZodMiniOptional",(t,e)=>{Wi.init(t,e),A.init(t,e)});function x(t){return new Pt({type:"optional",innerType:t})}const As=m("ZodMiniDefault",(t,e)=>{Qi.init(t,e),A.init(t,e)});function $(t,e){return new As({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():fi(e)}})}const zs=m("ZodMiniPipe",(t,e)=>{Ki.init(t,e),A.init(t,e)});function Ot(t,e){return new zs({type:"pipe",in:t,out:e})}const Es=m("ZodMiniPromise",(t,e)=>{Yi.init(t,e),A.init(t,e)});function Ae(t){return new Es({type:"promise",innerType:t})}const Cs=m("ZodMiniCustom",(t,e)=>{Ji.init(t,e),A.init(t,e)});function Ts(t,e){return cs(Cs,t??(()=>!0),e)}function Ps(t,e={error:`Input not instance of ${t.name}`}){const i=Ts(s=>s instanceof t,e);return i._zod.bag.Class=t,i}const Os=m("ZodMiniFunction",(t,e)=>{Gi.init(t,e),A.init(t,e)});function X(t){return new Os({type:"function",input:Array.isArray(t?.input)?ws(t?.input):t?.input??B(de()),output:t?.output??de()})}const Ms=m("ZodMiniISODateTime",(t,e)=>{Mi.init(t,e),ls.init(t,e)});function Fs(t){return is(Ms,t)}const Zs=g({id:u(),title:u(),description:u(),category:x(u()),tags:$(B(u()),[]),updatedAt:x(Fs())}),js=ue(Zs,{content:u(),contentType:$(V(["markdown","html"]),"markdown")}),Ds=g({type:v("function"),fetch:X({input:[],output:Ae(g({articles:B(js)}))})}),Us=he("type",[Ds]),ze=g({name:u(),label:u(),required:$(T(),!1),placeholder:x(u()),defaultValue:x(u())}),Rs=ue(ze,{type:v("text")}),Is=ue(ze,{type:v("email")}),Ls=ue(ze,{type:v("textarea"),rows:$(y(),4)}),Bs=g({value:u(),label:u()}),Vs=ue(ze,{type:v("select"),options:B(Bs)}),Ns=he("type",[Rs,Is,Ls,Vs]),Hs=g({mode:v("disabled")}),qs=g({mode:v("inline"),maxFiles:$(y().check(Se(1)),3),maxSizeMB:$(y().check(Se(.1)),5),accept:x(u())}),Ws=g({mode:v("presigned"),maxFiles:$(y().check(Se(1)),3),maxSizeMB:$(y().check(Se(.1)),5),accept:x(u()),getUploadUrl:X({input:[g({filename:u(),contentType:u(),size:y()})],output:Ae(g({uploadUrl:u(),fileUrl:u()}))})}),Qs=he("mode",[Hs,qs,Ws]),Ks=g({filename:u(),url:u(),contentType:u(),size:y()}),Gs=he("proceed",[g({proceed:v(!0),extraFields:x(Ve(u(),de()))}),g({proceed:v(!1),error:u()})]),Ys=g({type:v("function"),beforeSubmit:x(X({input:[g({fields:Ve(u(),de())})],output:Ae(Gs)})),handler:X({input:[g({fields:Ve(u(),de()),attachments:x(bs([B(Ps(File)),B(Ks)]))})],output:Ae(g({success:$(T(),!0),message:u()}))})}),Js=g({title:$(u(),"How can we help?"),subtitle:x(u()),fields:B(Ns).check(as(1)),attachments:$(Qs,{mode:"disabled"}),submit:Ys,submitButtonText:$(u(),"Send message")});g({timestamp:y(),sessionId:u()});const Xs=g({type:v("widget:open"),trigger:V(["button_click","programmatic","auto"])}),en=g({type:v("widget:close"),trigger:V(["button_click","escape","click_outside","programmatic"])}),tn=g({type:v("tab:change"),from:V(["articles","contact"]),to:V(["articles","contact"])}),sn=g({type:v("articles:view"),articleCount:y(),hasSearchQuery:T()}),nn=g({type:v("article:click"),articleId:u(),articleTitle:u(),articleCategory:x(u()),fromSearch:T(),searchQuery:x(u())}),rn=g({type:v("article:view"),articleId:u(),articleTitle:u(),articleCategory:x(u())}),on=g({type:v("article:close"),articleId:u(),articleTitle:u(),timeSpent:y()}),an=g({type:v("article:link:click"),articleId:u(),articleTitle:u(),linkUrl:u(),linkText:u(),external:T()}),cn=g({type:v("search:query"),query:u(),resultCount:y(),timeToResults:y()}),ln=g({type:v("search:result:click"),query:u(),articleId:u(),articleTitle:u(),resultPosition:y()}),dn=g({type:v("search:clear"),previousQuery:u()}),un=g({type:v("contact:view")}),hn=g({type:v("contact:field:focus"),fieldName:u()}),pn=g({type:v("contact:submit"),hasName:T(),hasEmail:T(),hasMessage:T(),messageLength:y(),attachmentCount:y(),totalAttachmentSize:y()}),fn=g({type:v("contact:success"),responseTime:y()}),mn=g({type:v("contact:error"),errorType:u(),errorMessage:u()}),gn=g({type:v("contact:attachment:add"),fileName:u(),fileSize:y(),fileType:u(),attachmentCount:y()}),vn=g({type:v("contact:attachment:remove"),fileName:u(),attachmentCount:y()}),bn=g({type:v("contact:attachment:upload:start"),fileName:u(),fileSize:y()}),yn=g({type:v("contact:attachment:upload:success"),fileName:u(),uploadTime:y()}),kn=g({type:v("contact:attachment:upload:error"),fileName:u(),errorMessage:u()}),wn=g({type:v("filter:category"),category:u(),resultCount:y()}),$n=g({type:v("filter:tag"),tag:u(),resultCount:y()}),_n=he("type",[Xs,en,tn,sn,nn,rn,on,an,cn,ln,dn,un,hn,pn,fn,mn,gn,vn,bn,yn,kn,wn,$n]),xn=g({enabled:$(T(),!0),onEvent:x(X({input:[_n],output:fs()})),getSessionId:x(X({input:[],output:u()}))}),Sn=g({widget:u(),close:u()}),An=g({articlesTab:u(),contactTab:u(),searchPlaceholder:u(),noResults:u(),loading:u(),backToArticles:u(),emptyStateTitle:u(),emptyStateSearchMessage:u(),emptyStateNoArticlesMessage:u(),getInTouch:u()}),Mt=g({position:$(V(["bottomRight","bottomLeft"]),"bottomRight"),offset:$(g({x:$(y(),20),y:$(y(),20)}),{x:20,y:20}),panelWidth:$(y(),400),panelHeight:$(y(),600),mobileBreakpoint:$(y(),768),articles:Us,contact:x(Js),icons:x(Ot(x(Ct(Sn)),Tt(t=>({widget:f`<svg width="24" height="24" viewBox="5 2 14 20" fill="currentColor">
|
|
4
4
|
<path d="M12 4C9.243 4 7 6.243 7 9h2c0-1.654 1.346-3 3-3s3 1.346 3 3c0 1.069-.454 1.465-1.481 2.255-.382.294-.813.626-1.226 1.038C10.981 13.604 10.995 14.897 11 15v2h2v-2.009c0-.024.023-.601.707-1.284.32-.32.682-.598 1.031-.867C15.798 12.024 17 11.1 17 9c0-2.757-2.243-5-5-5zm-1 14h2v2h-2z"/>
|
|
5
5
|
</svg>`,close:f`<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
|
6
6
|
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
|
7
|
-
</svg>`,...t})))),labels:
|
|
8
|
-
<helpdock-button
|
|
7
|
+
</svg>`,...t})))),labels:x(Ot(x(Ct(An)),Tt(t=>({articlesTab:"Articles",contactTab:"Contact",searchPlaceholder:"Search articles...",noResults:"No articles found",loading:"Loading...",backToArticles:"Back",emptyStateTitle:"Hmm...",emptyStateSearchMessage:"We couldn't find any articles that match your search. Try searching a broader term, or",emptyStateNoArticlesMessage:"No articles found.",getInTouch:"Get in touch",...t})))),defaultTab:$(V(["articles","contact"]),"articles"),closeOnEscape:$(T(),!0),closeOnClickOutside:$(T(),!1),introAnimation:$(T(),!0),analytics:x(xn)}),Ne="articles",Ee="config";function Ft(t,e){if(!e.trim())return t;const i=e.toLowerCase().trim(),s=i.split(/\s+/);return t.map(n=>{const r=[n.title,n.description,n.content,...n.tags||[],n.category||""].join(" ").toLowerCase();let o=0;n.title.toLowerCase().includes(i)&&(o+=100),n.description.toLowerCase().includes(i)&&(o+=50);for(const a of s)n.title.toLowerCase().includes(a)&&(o+=20),n.description.toLowerCase().includes(a)&&(o+=10),r.includes(a)&&(o+=5);return{article:n,score:o}}).filter(({score:n})=>n>0).sort((n,r)=>r.score-n.score).map(({article:n})=>n)}function zn(t,e,i=3){return e.category?t.filter(s=>s.id!==e.id&&s.category===e.category).slice(0,i):[]}class En{constructor(){this.config=null,this.isInitialized=!1,this.sessionId=this.generateDefaultSessionId()}init(e){if(!e||!e.enabled){this.isInitialized=!1,this.config=null;return}if(this.config=e,e.getSessionId)try{this.sessionId=e.getSessionId()}catch(i){console.error("[HelpDock Analytics] Error getting session ID:",i),this.sessionId=this.generateDefaultSessionId()}else this.sessionId=this.generateDefaultSessionId();this.isInitialized=!0}track(e){if(!this.isInitialized||!this.config?.onEvent)return;const i={...e,timestamp:Date.now(),sessionId:this.sessionId};try{this.config.onEvent(i)}catch(s){console.error("[HelpDock Analytics] Error in onEvent callback:",s)}}generateDefaultSessionId(){return`hd_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}}const w=new En;var Cn=Object.defineProperty,Tn=Object.getOwnPropertyDescriptor,F=(t,e,i,s)=>{for(var n=s>1?void 0:s?Tn(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&Cn(e,i,n),n};h.HelpDock=class extends M{constructor(){super(...arguments),this.open=!1,this.config=null,this.articles=[],this.articlesLoading=!1,this.selectedArticle=null,this.expanded=!1,this.searchQuery="",this.articleOpenTime=null,this.widgetOpenTrigger="button_click",this.articlesProvider=new De(this,{context:Ne,initialValue:{articles:[],loading:!1,searchQuery:"",filteredArticles:[],selectedArticle:null}}),this.handleOpen=()=>{this.open=!this.open,this.open?(w.track({type:"widget:open",trigger:this.widgetOpenTrigger}),this.widgetOpenTrigger="button_click"):w.track({type:"widget:close",trigger:"button_click"}),this.open&&this.articles.length===0&&this.config&&this.fetchArticles(),this.open||(this.selectedArticle=null,this.expanded=!1,this.searchQuery="",this.updateContextValue()),this.requestUpdate()},this.handleArticleOpen=e=>{this.selectedArticle=e.detail.article,this.expanded=!0,this.articleOpenTime=Date.now(),w.track({type:"article:view",articleId:e.detail.article.id,articleTitle:e.detail.article.title,articleCategory:e.detail.article.category}),this.updateContextValue(),this.requestUpdate()},this.handleArticleClose=()=>{if(this.selectedArticle&&this.articleOpenTime){const e=Date.now()-this.articleOpenTime;w.track({type:"article:close",articleId:this.selectedArticle.id,articleTitle:this.selectedArticle.title,timeSpent:e})}this.selectedArticle=null,this.expanded=!1,this.articleOpenTime=null,this.updateContextValue(),this.requestUpdate()},this.handleToggleExpand=()=>{this.expanded=!this.expanded,this.requestUpdate()},this.handleSearch=e=>{const i=Date.now(),s=this.searchQuery;if(this.searchQuery=e.detail.query,this.updateContextValue(),this.requestUpdate(),this.searchQuery){const n=Ft(this.articles,this.searchQuery);w.track({type:"search:query",query:this.searchQuery,resultCount:n.length,timeToResults:Date.now()-i})}else s&&w.track({type:"search:clear",previousQuery:s})}}static init(e,i){const s=i||document.querySelector("help-dock");s instanceof h.HelpDock&&s.updateConfig(e)}updateContextValue(){this.articlesProvider.setValue({articles:this.articles,loading:this.articlesLoading,searchQuery:this.searchQuery,filteredArticles:this.searchQuery?Ft(this.articles,this.searchQuery):this.articles,selectedArticle:this.selectedArticle})}connectedCallback(){super.connectedCallback(),this.updateConfig(),this.addEventListener("helpdock:open",this.handleOpen),this.addEventListener("helpdock:article-open",this.handleArticleOpen),this.addEventListener("helpdock:article-close",this.handleArticleClose),this.addEventListener("helpdock:toggle-expand",this.handleToggleExpand),this.addEventListener("helpdock:search",this.handleSearch)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("helpdock:open",this.handleOpen),this.removeEventListener("helpdock:article-open",this.handleArticleOpen),this.removeEventListener("helpdock:article-close",this.handleArticleClose),this.removeEventListener("helpdock:toggle-expand",this.handleToggleExpand),this.removeEventListener("helpdock:search",this.handleSearch)}updateConfig(e){const i=Mt.safeParse(window.HelpDockConfig||{}),s=e?Mt.parse(e):null;this.config=s||(i.success?i.data:null),this.config&&w.init(this.config.analytics),this.requestUpdate(),this.fetchArticles()}async fetchArticles(){if(this.config?.articles){this.articlesLoading=!0,this.updateContextValue();try{if(this.config.articles.type==="function"){const e=await this.config.articles.fetch();this.articles=e.articles}}catch(e){console.error("Failed to fetch articles:",e),this.articles=[]}finally{this.articlesLoading=!1,this.updateContextValue()}}}render(){if(!this.config)return f`<h1>Not Running!</h1>`;const e=this.selectedArticle!==null;return f`
|
|
8
|
+
<helpdock-button
|
|
9
|
+
.open=${this.open}
|
|
10
|
+
.introAnimation=${this.config.introAnimation??!0}
|
|
11
|
+
>
|
|
9
12
|
<span slot="widget-icon">${this.config.icons?.widget}</span>
|
|
10
13
|
<span slot="close-icon">${this.config.icons?.close}</span>
|
|
11
14
|
</helpdock-button>
|
|
@@ -130,7 +133,7 @@
|
|
|
130
133
|
::-webkit-scrollbar-thumb:hover {
|
|
131
134
|
background: var(--helpdock-text-muted);
|
|
132
135
|
}
|
|
133
|
-
`,F([
|
|
136
|
+
`,F([Z({type:Boolean})],h.HelpDock.prototype,"open",2),F([ci({context:Ee}),k()],h.HelpDock.prototype,"config",2),F([k()],h.HelpDock.prototype,"articles",2),F([k()],h.HelpDock.prototype,"articlesLoading",2),F([k()],h.HelpDock.prototype,"selectedArticle",2),F([k()],h.HelpDock.prototype,"expanded",2),F([k()],h.HelpDock.prototype,"searchQuery",2),F([k()],h.HelpDock.prototype,"articleOpenTime",2),F([k()],h.HelpDock.prototype,"widgetOpenTrigger",2),h.HelpDock=F([K("help-dock")],h.HelpDock);function Pn(t){return e=>{e instanceof CustomEvent&&t(e)}}function N(t,e,i){const s=new CustomEvent(e,{bubbles:!0,composed:!0,detail:i});t.dispatchEvent(s)}var On=Object.defineProperty,Mn=Object.getOwnPropertyDescriptor,Ce=(t,e,i,s)=>{for(var n=s>1?void 0:s?Mn(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&On(e,i,n),n};h.WidgetButton=class extends M{constructor(){super(...arguments),this.open=!1,this.introAnimation=!1,this.showPulse=!1}getStorageKey(){return"helpdock-intro-animation-shown"}shouldShowAnimation(){return!this.introAnimation||this.open?!1:!localStorage.getItem(this.getStorageKey())}firstUpdated(){this.shouldShowAnimation()&&(this.showPulse=!0,localStorage.setItem(this.getStorageKey(),"true"),setTimeout(()=>{this.showPulse=!1},1100))}_onClick(){N(this,"helpdock:open")}render(){const e=this.open?"close-icon":"widget-icon";return f`
|
|
134
137
|
<button
|
|
135
138
|
class="widget-button"
|
|
136
139
|
part="button"
|
|
@@ -140,6 +143,13 @@
|
|
|
140
143
|
<span class="icon">
|
|
141
144
|
<slot name=${e}></slot>
|
|
142
145
|
</span>
|
|
146
|
+
${this.showPulse?f`
|
|
147
|
+
<span class="pulse is-visible">
|
|
148
|
+
<svg width="56" height="56" viewBox="0 0 56 56" fill="none">
|
|
149
|
+
<circle cx="28" cy="28" r="28" fill="var(--helpdock-primary, #646cff)"/>
|
|
150
|
+
</svg>
|
|
151
|
+
</span>
|
|
152
|
+
`:""}
|
|
143
153
|
</button>
|
|
144
154
|
`}},h.WidgetButton.styles=H`
|
|
145
155
|
:host {
|
|
@@ -147,6 +157,7 @@
|
|
|
147
157
|
}
|
|
148
158
|
|
|
149
159
|
.widget-button {
|
|
160
|
+
position: relative;
|
|
150
161
|
width: 56px;
|
|
151
162
|
height: 56px;
|
|
152
163
|
border-radius: 50%;
|
|
@@ -188,25 +199,65 @@
|
|
|
188
199
|
width: 24px;
|
|
189
200
|
height: 24px;
|
|
190
201
|
}
|
|
191
|
-
|
|
202
|
+
|
|
203
|
+
.pulse {
|
|
204
|
+
position: absolute;
|
|
205
|
+
top: 0;
|
|
206
|
+
left: 0;
|
|
207
|
+
width: 100%;
|
|
208
|
+
height: 100%;
|
|
209
|
+
pointer-events: none;
|
|
210
|
+
display: none;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.pulse.is-visible {
|
|
214
|
+
display: block;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.pulse.is-visible svg {
|
|
218
|
+
display: block !important;
|
|
219
|
+
opacity: 0.25;
|
|
220
|
+
animation:
|
|
221
|
+
1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94) pulse-scale 0.1s both,
|
|
222
|
+
0.9s cubic-bezier(0.4, 0, 0.2, 1) pulse-fade-out 0.2s both;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@keyframes pulse-scale {
|
|
226
|
+
0% {
|
|
227
|
+
transform: scale(1);
|
|
228
|
+
}
|
|
229
|
+
100% {
|
|
230
|
+
transform: scale(4.2);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
@keyframes pulse-fade-out {
|
|
235
|
+
0% {
|
|
236
|
+
opacity: 0.25;
|
|
237
|
+
}
|
|
238
|
+
100% {
|
|
239
|
+
opacity: 0;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
`,Ce([Z({type:Boolean,reflect:!0})],h.WidgetButton.prototype,"open",2),Ce([Z({type:Boolean})],h.WidgetButton.prototype,"introAnimation",2),Ce([k()],h.WidgetButton.prototype,"showPulse",2),h.WidgetButton=Ce([K("helpdock-button")],h.WidgetButton);var Fn=Object.defineProperty,Zn=Object.getOwnPropertyDescriptor,ee=(t,e,i,s)=>{for(var n=s>1?void 0:s?Zn(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&Fn(e,i,n),n};h.ArticlesTab=class extends M{constructor(){super(...arguments),this.expanded=!1,this.searchValue="",this.hasTrackedArticlesView=!1}get articles(){return this.articlesData?.filteredArticles??[]}get loading(){return this.articlesData?.loading??!1}selectArticle(e,i){const s=!!this.articlesData?.searchQuery;w.track({type:"article:click",articleId:e.id,articleTitle:e.title,articleCategory:e.category,fromSearch:s,searchQuery:s?this.articlesData?.searchQuery:void 0}),s&&i!==void 0&&this.articlesData?.searchQuery&&w.track({type:"search:result:click",query:this.articlesData.searchQuery,articleId:e.id,articleTitle:e.title,resultPosition:i}),N(this,"helpdock:article-open",{article:e})}handleSearchInput(e){if(!(e.target instanceof HTMLInputElement))return;const i=e.target;this.searchValue=i.value,N(this,"helpdock:search",{query:i.value})}handleContactClick(e){e.preventDefault(),N(this,"helpdock:switch-tab",{tab:"contact"})}updated(e){super.updated(e),!this.hasTrackedArticlesView&&!this.loading&&this.articles.length>0&&(this.hasTrackedArticlesView=!0,w.track({type:"articles:view",articleCount:this.articles.length,hasSearchQuery:!!this.articlesData?.searchQuery})),(this.loading||this.articles.length===0)&&(this.hasTrackedArticlesView=!1)}render(){let e;if(this.loading)e=f`
|
|
192
243
|
<div class="loading">
|
|
193
244
|
<span>Loading articles...</span>
|
|
194
245
|
</div>
|
|
195
|
-
`;else if(this.articles.length===0){const i=!!this.articlesData?.searchQuery,
|
|
246
|
+
`;else if(this.articles.length===0){const i=!!this.articlesData?.searchQuery,s=this.config?.labels,n=s?.emptyStateTitle||"Hmm...",r=s?.getInTouch||"Get in touch";e=f`
|
|
196
247
|
<div class="empty">
|
|
197
248
|
<div class="empty-card">
|
|
198
|
-
<h2 class="empty-title">${
|
|
249
|
+
<h2 class="empty-title">${n}</h2>
|
|
199
250
|
<p class="empty-message">
|
|
200
|
-
${i?f`${
|
|
251
|
+
${i?f`${s?.emptyStateSearchMessage||"We couldn't find any articles that match your search. Try searching a broader term, or"} <a href="#" class="empty-link" @click=${this.handleContactClick}>${r}</a>.`:f`${s?.emptyStateNoArticlesMessage||"No articles found."} <a href="#" class="empty-link" @click=${this.handleContactClick}>${r}</a> if you need help.`}
|
|
201
252
|
</p>
|
|
202
253
|
</div>
|
|
203
254
|
</div>
|
|
204
255
|
`}else e=f`
|
|
205
256
|
<h2 class="list-heading">Instant Answers</h2>
|
|
206
|
-
${this.articles.map((i,
|
|
257
|
+
${this.articles.map((i,s)=>f`
|
|
207
258
|
<article
|
|
208
259
|
class="article-card"
|
|
209
|
-
@click=${()=>this.selectArticle(i,
|
|
260
|
+
@click=${()=>this.selectArticle(i,s)}
|
|
210
261
|
>
|
|
211
262
|
<h3 class="article-title">${i.title}</h3>
|
|
212
263
|
<p class="article-description">${i.description}</p>
|
|
@@ -403,7 +454,7 @@
|
|
|
403
454
|
opacity: 0.8;
|
|
404
455
|
text-decoration: underline;
|
|
405
456
|
}
|
|
406
|
-
`,
|
|
457
|
+
`,ee([Z({type:Boolean})],h.ArticlesTab.prototype,"expanded",2),ee([ce({context:Ne,subscribe:!0}),k()],h.ArticlesTab.prototype,"articlesData",2),ee([ce({context:Ee,subscribe:!0}),k()],h.ArticlesTab.prototype,"config",2),ee([k()],h.ArticlesTab.prototype,"searchValue",2),ee([k()],h.ArticlesTab.prototype,"hasTrackedArticlesView",2),h.ArticlesTab=ee([K("helpdock-articles-tab")],h.ArticlesTab);var jn=Object.defineProperty,Dn=Object.getOwnPropertyDescriptor,He=(t,e,i,s)=>{for(var n=s>1?void 0:s?Dn(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&jn(e,i,n),n};let pe=class extends M{constructor(){super(...arguments),this.expanded=!1,this.handleContentClick=t=>{if(!(t.target instanceof HTMLElement))return;const e=t.target,i=this.shadowRoot?.querySelector(".detail-content");if(!i||!this.selectedArticle)return;const s=i.querySelectorAll("a[href]");for(const n of s)if(n===e||n.contains(e)){if(!(n instanceof HTMLAnchorElement))continue;const r=n,o=r.hostname!==window.location.hostname&&r.hostname!=="";w.track({type:"article:link:click",articleId:this.selectedArticle.id,articleTitle:this.selectedArticle.title,linkUrl:r.href,linkText:r.textContent||"",external:o});break}}}get articles(){return this.articlesData?.articles??[]}get selectedArticle(){return this.articlesData?.selectedArticle??null}closeArticle(){N(this,"helpdock:article-close")}toggleExpand(){N(this,"helpdock:toggle-expand")}selectArticle(t){N(this,"helpdock:article-open",{article:t})}firstUpdated(){const t=this.shadowRoot?.querySelector(".detail-content");t&&t.addEventListener("click",this.handleContentClick)}disconnectedCallback(){super.disconnectedCallback();const t=this.shadowRoot?.querySelector(".detail-content");t&&t.removeEventListener("click",this.handleContentClick)}render(){const t=this.selectedArticle;if(!t)return S;const e=zn(this.articles,t);return f`
|
|
407
458
|
<div class="article-detail">
|
|
408
459
|
<div class="detail-actions">
|
|
409
460
|
<button
|
|
@@ -450,10 +501,10 @@
|
|
|
450
501
|
`)}
|
|
451
502
|
</div>
|
|
452
503
|
</div>
|
|
453
|
-
`:
|
|
504
|
+
`:S}
|
|
454
505
|
</div>
|
|
455
506
|
</div>
|
|
456
|
-
`}};
|
|
507
|
+
`}};pe.styles=H`
|
|
457
508
|
:host {
|
|
458
509
|
display: flex;
|
|
459
510
|
flex-direction: column;
|
|
@@ -567,7 +618,7 @@
|
|
|
567
618
|
font-weight: 500;
|
|
568
619
|
color: var(--helpdock-primary);
|
|
569
620
|
}
|
|
570
|
-
`,
|
|
621
|
+
`,He([Z({type:Boolean})],pe.prototype,"expanded",2),He([ce({context:Ne,subscribe:!0})],pe.prototype,"articlesData",2),pe=He([K("helpdock-article-detail")],pe);function Un(t,e,i){if(e.mode==="disabled")return{valid:!1,error:"Attachments are disabled"};const s=e.maxFiles;if(i+t.length>s)return{valid:!1,error:`You can only attach up to ${s} file${s>1?"s":""}`};const n=e.maxSizeMB,r=n*1024*1024;return t.filter(a=>a.size>r).length>0?{valid:!1,error:`File size must not exceed ${n}MB`}:{valid:!0}}async function Rn(t,e,i){const s=t.name;try{i?.({filename:s,progress:0,status:"uploading"});const{uploadUrl:n,fileUrl:r}=await e({filename:t.name,contentType:t.type,size:t.size});await new Promise((a,l)=>{const c=new XMLHttpRequest;c.upload.addEventListener("progress",d=>{if(d.lengthComputable){const p=Math.round(d.loaded/d.total*100);i?.({filename:s,progress:p,status:"uploading"})}}),c.addEventListener("load",()=>{c.status>=200&&c.status<300?a():l(new Error(`Upload failed with status ${c.status}`))}),c.addEventListener("error",()=>{l(new Error("Network error during upload"))}),c.addEventListener("abort",()=>{l(new Error("Upload aborted"))}),c.open("PUT",n),c.setRequestHeader("Content-Type",t.type),c.send(t)});const o={filename:t.name,url:r,contentType:t.type,size:t.size};return i?.({filename:s,progress:100,status:"success"}),{success:!0,file:o}}catch(n){const r=n instanceof Error?n.message:"Upload failed";return i?.({filename:s,progress:0,status:"error",error:r}),{success:!1,error:r}}}async function In(t,e,i){const s=[];for(const n of t){const r=await Rn(n,e,i);s.push(r)}return s}function Zt(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(1)} GB`}var Ln=Object.defineProperty,Bn=Object.getOwnPropertyDescriptor,P=(t,e,i,s)=>{for(var n=s>1?void 0:s?Bn(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&Ln(e,i,n),n};h.ContactTab=class extends M{constructor(){super(...arguments),this.formValues={},this.formErrors={},this.isSubmitting=!1,this.submitSuccess=!1,this.submitError=null,this.attachedFiles=[],this.uploadedFiles=[],this.uploadingFiles=new Map,this.uploadErrors=new Map,this.hasTrackedContactView=!1}firstUpdated(){this.hasTrackedContactView||(this.hasTrackedContactView=!0,w.track({type:"contact:view"})),this.initializeFormDefaults()}initializeFormDefaults(){const e=this.config?.contact?.fields||[],i={};for(const s of e)s.defaultValue&&(i[s.name]=s.defaultValue);Object.keys(i).length>0&&(this.formValues={...i,...this.formValues})}handleInput(e,i){if(this.formValues={...this.formValues,[e]:i},this.formErrors[e]){const{[e]:s,...n}=this.formErrors;this.formErrors=n}}handleFieldFocus(e){w.track({type:"contact:field:focus",fieldName:e})}validateForm(){const e={},i=this.config?.contact?.fields||[];for(const s of i){const n=this.formValues[s.name]||"";if(s.required&&!n.trim()){e[s.name]=`${s.label} is required`;continue}s.type==="email"&&n.trim()&&(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)||(e[s.name]="Please enter a valid email address"))}return this.formErrors=e,Object.keys(e).length===0}async handleFileSelect(e){if(!(e.target instanceof HTMLInputElement))return;const i=e.target,s=Array.from(i.files||[]);if(s.length===0)return;const n=this.config?.contact?.attachments;if(!n||n.mode==="disabled")return;const r=n.mode==="presigned"?this.uploadedFiles.length:this.attachedFiles.length,o=Un(s,n,r);if(!o.valid){this.submitError=o.error||"Invalid files",i.value="";return}if(this.submitError=null,n.mode==="presigned")await this.handlePresignedUploads(s);else{this.attachedFiles=[...this.attachedFiles,...s];for(const a of s)w.track({type:"contact:attachment:add",fileName:a.name,fileSize:a.size,fileType:a.type,attachmentCount:this.attachedFiles.length})}i.value=""}async handlePresignedUploads(e){const i=this.config?.contact?.attachments;if(!i||i.mode!=="presigned")return;const s=new Map;for(const o of e){const a=Date.now();s.set(o.name,a),w.track({type:"contact:attachment:upload:start",fileName:o.name,fileSize:o.size})}const n=o=>{if(o.status==="uploading")this.uploadingFiles=new Map(this.uploadingFiles),this.uploadingFiles.set(o.filename,o.progress);else if(o.status==="success"){this.uploadingFiles=new Map(this.uploadingFiles),this.uploadingFiles.delete(o.filename);const a=s.get(o.filename);w.track({type:"contact:attachment:upload:success",fileName:o.filename,uploadTime:a?Date.now()-a:0})}else o.status==="error"&&(this.uploadingFiles=new Map(this.uploadingFiles),this.uploadingFiles.delete(o.filename),this.uploadErrors=new Map(this.uploadErrors),this.uploadErrors.set(o.filename,o.error||"Upload failed"),w.track({type:"contact:attachment:upload:error",fileName:o.filename,errorMessage:o.error||"Upload failed"}));this.requestUpdate()},r=await In(e,i.getUploadUrl,n);for(const o of r)o.success&&o.file&&(this.uploadedFiles=[...this.uploadedFiles,o.file],w.track({type:"contact:attachment:add",fileName:o.file.filename,fileSize:o.file.size,fileType:o.file.contentType||"unknown",attachmentCount:this.uploadedFiles.length}))}removeAttachedFile(e){const i=this.attachedFiles[e];this.attachedFiles=this.attachedFiles.filter((s,n)=>n!==e),i&&w.track({type:"contact:attachment:remove",fileName:i.name,attachmentCount:this.attachedFiles.length})}removeUploadedFile(e){const i=this.uploadedFiles[e];this.uploadedFiles=this.uploadedFiles.filter((s,n)=>n!==e),i&&w.track({type:"contact:attachment:remove",fileName:i.filename,attachmentCount:this.uploadedFiles.length})}clearUploadError(e){this.uploadErrors=new Map(this.uploadErrors),this.uploadErrors.delete(e),this.requestUpdate()}async handleSubmit(e){if(e.preventDefault(),!this.validateForm())return;if(this.uploadingFiles.size>0){this.submitError="Please wait for file uploads to complete";return}const i=this.config?.contact?.submit;if(!i){this.submitError="Form submission is not configured. Please contact support.";return}const s=this.config?.contact?.attachments;this.isSubmitting=!0,this.submitError=null;const n=s?.mode==="inline"?this.attachedFiles.reduce((c,d)=>c+d.size,0):this.uploadedFiles.reduce((c,d)=>c+d.size,0),r=s?.mode==="inline"?this.attachedFiles.length:this.uploadedFiles.length,o=this.config?.contact?.fields.find(c=>c.type==="textarea"),a=o?(this.formValues[o.name]||"").length:0;w.track({type:"contact:submit",hasName:!!this.formValues.name,hasEmail:!!this.formValues.email,hasMessage:a>0,messageLength:a,attachmentCount:r,totalAttachmentSize:n});const l=Date.now();try{if(i.beforeSubmit){const p=await i.beforeSubmit({fields:this.formValues});if(!p.proceed){this.submitError=p.error,this.isSubmitting=!1;return}p.extraFields&&Object.assign(this.formValues,p.extraFields)}let c;s?.mode==="inline"?c=this.attachedFiles:s?.mode==="presigned"&&(c=this.uploadedFiles);const d=await i.handler({fields:this.formValues,attachments:c});d.success?(this.submitSuccess=!0,this.formValues={},this.attachedFiles=[],this.uploadedFiles=[],w.track({type:"contact:success",responseTime:Date.now()-l})):(this.submitError=d.message||"Failed to submit form",w.track({type:"contact:error",errorType:"submission_failed",errorMessage:d.message||"Failed to submit form"}))}catch(c){console.error("Form submission error:",c);const d=c instanceof Error?c.message:"An error occurred while submitting the form";this.submitError=d,w.track({type:"contact:error",errorType:"exception",errorMessage:d})}finally{this.isSubmitting=!1}}renderField(e){const i=this.formValues[e.name]||"",s=this.formErrors[e.name],n=!!s,r=`form-field ${n?"has-error":""}`;switch(e.type){case"text":case"email":return f`
|
|
571
622
|
<div class=${r}>
|
|
572
623
|
<label class="field-label" for=${e.name}>
|
|
573
624
|
${e.label}
|
|
@@ -581,10 +632,10 @@
|
|
|
581
632
|
placeholder=${e.placeholder||""}
|
|
582
633
|
?disabled=${this.isSubmitting}
|
|
583
634
|
@focus=${()=>this.handleFieldFocus(e.name)}
|
|
584
|
-
@input=${o=>this.handleInput(e.name,o.target.value)}
|
|
635
|
+
@input=${o=>{o.target instanceof HTMLInputElement&&this.handleInput(e.name,o.target.value)}}
|
|
585
636
|
class="field-input"
|
|
586
637
|
/>
|
|
587
|
-
${
|
|
638
|
+
${n?f`<span class="field-error">${s}</span>`:""}
|
|
588
639
|
</div>
|
|
589
640
|
`;case"textarea":return f`
|
|
590
641
|
<div class=${r}>
|
|
@@ -600,10 +651,10 @@
|
|
|
600
651
|
rows=${e.rows||4}
|
|
601
652
|
?disabled=${this.isSubmitting}
|
|
602
653
|
@focus=${()=>this.handleFieldFocus(e.name)}
|
|
603
|
-
@input=${o=>this.handleInput(e.name,o.target.value)}
|
|
654
|
+
@input=${o=>{o.target instanceof HTMLTextAreaElement&&this.handleInput(e.name,o.target.value)}}
|
|
604
655
|
class="field-input"
|
|
605
656
|
></textarea>
|
|
606
|
-
${
|
|
657
|
+
${n?f`<span class="field-error">${s}</span>`:""}
|
|
607
658
|
</div>
|
|
608
659
|
`;case"select":return f`
|
|
609
660
|
<div class=${r}>
|
|
@@ -617,7 +668,7 @@
|
|
|
617
668
|
.value=${i}
|
|
618
669
|
?disabled=${this.isSubmitting}
|
|
619
670
|
@focus=${()=>this.handleFieldFocus(e.name)}
|
|
620
|
-
@change=${o=>this.handleInput(e.name,o.target.value)}
|
|
671
|
+
@change=${o=>{o.target instanceof HTMLSelectElement&&this.handleInput(e.name,o.target.value)}}
|
|
621
672
|
class="field-input"
|
|
622
673
|
>
|
|
623
674
|
<option value="">Select an option</option>
|
|
@@ -627,13 +678,13 @@
|
|
|
627
678
|
</option>
|
|
628
679
|
`)}
|
|
629
680
|
</select>
|
|
630
|
-
${
|
|
681
|
+
${n?f`<span class="field-error">${s}</span>`:""}
|
|
631
682
|
</div>
|
|
632
|
-
`;default:return f``}}renderAttachments(){const e=this.config?.contact?.attachments;if(!e||e.mode==="disabled")return f``;const i=e.maxFiles,
|
|
683
|
+
`;default:return f``}}renderAttachments(){const e=this.config?.contact?.attachments;if(!e||e.mode==="disabled")return f``;const i=e.maxFiles,s=e.maxSizeMB,n=e.accept||"*",o=(e.mode==="presigned"?this.uploadedFiles.length:this.attachedFiles.length)<i,a=this.uploadingFiles.size>0;return f`
|
|
633
684
|
<div class="attachments-section">
|
|
634
685
|
<label class="field-label">
|
|
635
686
|
Attachments
|
|
636
|
-
<span class="field-hint">(up to ${i} file${i>1?"s":""}, ${
|
|
687
|
+
<span class="field-hint">(up to ${i} file${i>1?"s":""}, ${s}MB each)</span>
|
|
637
688
|
</label>
|
|
638
689
|
|
|
639
690
|
<!-- Attached/Uploaded files list -->
|
|
@@ -649,7 +700,7 @@
|
|
|
649
700
|
</div>
|
|
650
701
|
<div class="file-info">
|
|
651
702
|
<div class="file-name">${l.name}</div>
|
|
652
|
-
<div class="file-size">${
|
|
703
|
+
<div class="file-size">${Zt(l.size)}</div>
|
|
653
704
|
</div>
|
|
654
705
|
<button
|
|
655
706
|
type="button"
|
|
@@ -679,7 +730,7 @@
|
|
|
679
730
|
</div>
|
|
680
731
|
<div class="file-info">
|
|
681
732
|
<div class="file-name">${l.filename}</div>
|
|
682
|
-
<div class="file-size">${
|
|
733
|
+
<div class="file-size">${Zt(l.size)}</div>
|
|
683
734
|
</div>
|
|
684
735
|
<button
|
|
685
736
|
type="button"
|
|
@@ -749,7 +800,7 @@
|
|
|
749
800
|
<label class="file-upload-button" ?disabled=${this.isSubmitting||a}>
|
|
750
801
|
<input
|
|
751
802
|
type="file"
|
|
752
|
-
accept=${
|
|
803
|
+
accept=${n}
|
|
753
804
|
multiple
|
|
754
805
|
@change=${this.handleFileSelect}
|
|
755
806
|
?disabled=${this.isSubmitting||a}
|
|
@@ -774,7 +825,7 @@
|
|
|
774
825
|
<p>No contact form configured</p>
|
|
775
826
|
</div>
|
|
776
827
|
</div>
|
|
777
|
-
`;const e=this.config.contact.fields||[],i=this.config.contact.submitButtonText||"Send message",
|
|
828
|
+
`;const e=this.config.contact.fields||[],i=this.config.contact.submitButtonText||"Send message",s=this.config.contact.title||"How can we help?",n=this.config.contact.subtitle;return this.submitSuccess?f`
|
|
778
829
|
<div class="contact-wrapper">
|
|
779
830
|
<div class="success-card">
|
|
780
831
|
<div class="success-icon">
|
|
@@ -790,8 +841,8 @@
|
|
|
790
841
|
`:f`
|
|
791
842
|
<div class="contact-wrapper">
|
|
792
843
|
<div class="contact-header">
|
|
793
|
-
<h2 class="contact-title">${
|
|
794
|
-
${
|
|
844
|
+
<h2 class="contact-title">${s}</h2>
|
|
845
|
+
${n?f`<p class="contact-subtitle">${n}</p>`:""}
|
|
795
846
|
</div>
|
|
796
847
|
|
|
797
848
|
<form class="contact-form" @submit=${this.handleSubmit}>
|
|
@@ -1287,7 +1338,7 @@
|
|
|
1287
1338
|
padding-right: 36px;
|
|
1288
1339
|
appearance: none;
|
|
1289
1340
|
}
|
|
1290
|
-
`,
|
|
1341
|
+
`,P([ce({context:Ee,subscribe:!0}),k()],h.ContactTab.prototype,"config",2),P([k()],h.ContactTab.prototype,"formValues",2),P([k()],h.ContactTab.prototype,"formErrors",2),P([k()],h.ContactTab.prototype,"isSubmitting",2),P([k()],h.ContactTab.prototype,"submitSuccess",2),P([k()],h.ContactTab.prototype,"submitError",2),P([k()],h.ContactTab.prototype,"attachedFiles",2),P([k()],h.ContactTab.prototype,"uploadedFiles",2),P([k()],h.ContactTab.prototype,"uploadingFiles",2),P([k()],h.ContactTab.prototype,"uploadErrors",2),P([k()],h.ContactTab.prototype,"hasTrackedContactView",2),h.ContactTab=P([K("helpdock-contact-tab")],h.ContactTab);var Vn=Object.defineProperty,Nn=Object.getOwnPropertyDescriptor,te=(t,e,i,s)=>{for(var n=s>1?void 0:s?Nn(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&Vn(e,i,n),n};h.Panel=class extends M{constructor(){super(...arguments),this.open=!1,this.expanded=!1,this.articleOpen=!1,this.activeTab="articles",this.switchTabListener=Pn(e=>{e.detail?.tab&&this.setActiveTab(e.detail.tab)})}setActiveTab(e){const i=this.activeTab;i!==e&&(this.activeTab=e,w.track({type:"tab:change",from:i,to:e}))}connectedCallback(){super.connectedCallback(),this.addEventListener("helpdock:switch-tab",this.switchTabListener)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("helpdock:switch-tab",this.switchTabListener)}render(){const e=["panel",this.open?"open":"",this.expanded?"expanded":"",this.articleOpen?"article-open":""].filter(Boolean).join(" ");return f`
|
|
1291
1342
|
<div class=${e}>
|
|
1292
1343
|
${this.articleOpen?null:f`
|
|
1293
1344
|
<div class="panel-header">
|
|
@@ -1421,4 +1472,4 @@
|
|
|
1421
1472
|
flex-direction: column;
|
|
1422
1473
|
}
|
|
1423
1474
|
|
|
1424
|
-
`,
|
|
1475
|
+
`,te([Z({type:Boolean})],h.Panel.prototype,"open",2),te([Z({type:Boolean})],h.Panel.prototype,"expanded",2),te([Z({type:Boolean})],h.Panel.prototype,"articleOpen",2),te([ce({context:Ee,subscribe:!0}),k()],h.Panel.prototype,"config",2),te([k()],h.Panel.prototype,"activeTab",2),h.Panel=te([K("helpdock-panel")],h.Panel),Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}));
|