{"version":3,"file":"index.js","sources":["../../../../frontend/node_modules/@lit/reactive-element/css-tag.js","../../../../frontend/node_modules/@lit/reactive-element/reactive-element.js","../../../../frontend/node_modules/lit-html/lit-html.js","../../../../frontend/node_modules/lit-element/lit-element.js","../../../../frontend/node_modules/@lit/reactive-element/decorators/custom-element.js","../../../../frontend/node_modules/@lit/reactive-element/decorators/property.js","../../../../frontend/node_modules/@lit/reactive-element/decorators/state.js","../../../../frontend/node_modules/@lit/reactive-element/decorators/base.js","../../../../frontend/node_modules/@lit/reactive-element/decorators/query.js","../../../../frontend/node_modules/lit-html/directive.js","../../../../frontend/node_modules/lit-html/directives/unsafe-html.js","../../../../frontend/node_modules/@lit/context/lib/context-request-event.js","../../../../frontend/node_modules/@lit/context/lib/create-context.js","../../../../frontend/node_modules/@lit/context/lib/controllers/context-consumer.js","../../../../frontend/node_modules/@lit/context/lib/value-notifier.js","../../../../frontend/node_modules/@lit/context/lib/controllers/context-provider.js","../../../../frontend/node_modules/@lit/context/lib/decorators/provide.js","../../../../frontend/node_modules/@lit/context/lib/decorators/consume.js","../../../../frontend/src/shared/tailwind.element.ts","../../../../frontend/src/context/context.ts","../../../../frontend/src/constants/constants.ts","../../../../frontend/src/constants/custom-event-names.ts","../../../../frontend/src/services/apiService.ts","../../../../frontend/src/shared/clarificationUtil.ts","../../../../frontend/src/components/progress-bar/progress-bar.ts","../../../../frontend/node_modules/lit-html/directive-helpers.js","../../../../frontend/node_modules/lit-html/directives/repeat.js","../../../../frontend/node_modules/lit-html/async-directive.js","../../../../frontend/node_modules/lit-html/directives/ref.js","../../../../frontend/node_modules/lit-html/directives/if-defined.js","../../../../frontend/src/constants/text.ts","../../../../frontend/src/components/question/question.ts","../../../../frontend/src/components/action-bar/action-bar.ts","../../../../frontend/node_modules/striptags/src/striptags.js","../../../../frontend/src/components/report/report.ts","../../../../frontend/src/components/dialogs/dialog.ts","../../../../frontend/src/components/dialogs/clarification-dialog.ts","../../../../frontend/src/components/dialogs/resume-dialog.ts","../../../../frontend/src/components/dialogs/error-dialog.ts","../../../../frontend/src/components/layout/layout.ts","../../../../frontend/src/components/dialogs/enter-code-dialog.ts","../../../../frontend/src/components/resume-button/resume-button.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,adoptStyles,css,getCompatibleStyle,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:r,getOwnPropertyNames:h,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),y={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...h(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$ES??=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$ES?.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$ES?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$ES?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$EO(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null}}requestUpdate(t,s,i,e=!1,r){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f)(e?r:this[t],s))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.C(s,this[s],i)}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$ES?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$ET()}catch(s){throw t=!1,this._$ET(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$ES?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:\"open\"},b[d(\"elementProperties\")]=new Map,b[d(\"finalized\")]=new Map,p?.({ReactiveElement:b}),(a.reactiveElementVersions??=[]).push(\"2.0.1\");export{b as ReactiveElement,u as defaultConverter,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=\"$lit$\",h=`lit$${(Math.random()+\"\").slice(9)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=Symbol.for(\"lit-noChange\"),T=Symbol.for(\"lit-nothing\"),A=new WeakMap,E=r.createTreeWalker(r,129);function C(t,i){if(!Array.isArray(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const P=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"\":\"\")),o]};class V{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=P(t,s);if(this.el=V.createElement(f,n),E.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=E.nextNode())&&d.length0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=T}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=N(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new M(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{z as _$LH,x as html,w as noChange,T as nothing,j as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as i}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class s extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return i}}s._$litElement$=!0,s[(\"finalized\",\"finalized\")]=!0,globalThis.litElementHydrateSupport?.({LitElement:s});const r=globalThis.litElementPolyfillSupport;r?.({LitElement:s});const o={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(globalThis.litElementVersions??=[]).push(\"4.0.1\");export{s as LitElement,o as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=t=>(e,o)=>{void 0!==o?o.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};export{t as customElement};\n//# sourceMappingURL=custom-element.js.map\n","import{defaultConverter as t,notEqual as e}from\"../reactive-element.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o={attribute:!0,type:String,converter:t,reflect:!1,hasChanged:e},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(r.name,t),\"accessor\"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.C(o,void 0,t),e}}}if(\"setter\"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error(\"Unsupported decorator location: \"+n)};function n(t){return(e,o)=>\"object\"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}export{n as property,r as standardProperty};\n//# sourceMappingURL=property.js.map\n","import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst e=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&\"object\"!=typeof t&&Object.defineProperty(e,t,c),c);export{e as desc};\n//# sourceMappingURL=base.js.map\n","import{desc as t}from\"./base.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function e(e,r){return(n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:u}=\"object\"==typeof s?n:i??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return t(n,s,{get(){if(r){let t=e.call(this);return void 0===t&&(t=o(this),u.call(this,t)),t}return o(this)}})}return t(n,s,{get(){return o(this)}})}}export{e as query};\n//# sourceMappingURL=query.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{nothing as t,noChange as i}from\"../lit-html.js\";import{Directive as r,PartType as s,directive as n}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends r{constructor(i){if(super(i),this.et=t,i.type!==s.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(r){if(r===t||null==r)return this.vt=void 0,this.et=r;if(r===i)return r;if(\"string\"!=typeof r)throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(r===this.et)return this.vt;this.et=r;const s=[r];return s.raw=s,this.vt={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName=\"unsafeHTML\",e.resultType=1;const o=n(e);export{e as UnsafeHTMLDirective,o as unsafeHTML};\n//# sourceMappingURL=unsafe-html.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s extends Event{constructor(s,t,e){super(\"context-request\",{bubbles:!0,composed:!0}),this.context=s,this.callback=t,this.subscribe=e??!1}}export{s as ContextRequestEvent};\n//# sourceMappingURL=context-request-event.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction n(n){return n}export{n as createContext};\n//# sourceMappingURL=create-context.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class s{constructor(t,s,i,h){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,s)=>{this.unsubscribe&&(this.unsubscribe!==s&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,s)),this.unsubscribe=s},this.host=t,void 0!==s.context){const t=s;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=s,this.callback=i,this.subscribe=h??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new t(this.context,this.t,this.subscribe))}}export{s as ContextConsumer};\n//# sourceMappingURL=context-consumer.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s{get value(){return this.o}set value(s){this.setValue(s)}setValue(s,t=!1){const i=t||!Object.is(s,this.o);this.o=s,i&&this.updateObservers()}constructor(s){this.subscriptions=new Map,this.updateObservers=()=>{for(const[s,{disposer:t}]of this.subscriptions)s(this.o,t)},void 0!==s&&(this.value=s)}addCallback(s,t,i){if(!i)return void s(this.value);this.subscriptions.has(s)||this.subscriptions.set(s,{disposer:()=>{this.subscriptions.delete(s)},consumerHost:t});const{disposer:h}=this.subscriptions.get(s);s(this.value,h)}clearCallbacks(){this.subscriptions.clear()}}export{s as ValueNotifier};\n//# sourceMappingURL=value-notifier.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";import{ValueNotifier as s}from\"../value-notifier.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends Event{constructor(t){super(\"context-provider\",{bubbles:!0,composed:!0}),this.context=t}}class i extends s{constructor(s,e,i){super(void 0!==e.context?e.initialValue:i),this.onContextRequest=t=>{const s=t.composedPath()[0];t.context===this.context&&s!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,s,t.subscribe))},this.onProviderRequest=s=>{const e=s.composedPath()[0];if(s.context!==this.context||e===this.host)return;const i=new Set;for(const[s,{consumerHost:e}]of this.subscriptions)i.has(s)||(i.add(s),e.dispatchEvent(new t(this.context,s,!0)));s.stopPropagation()},this.host=s,void 0!==e.context?this.context=e.context:this.context=e,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 e(this.context))}}export{i as ContextProvider,e as ContextProviderEvent};\n//# sourceMappingURL=context-provider.js.map\n","import{ContextProvider as t}from\"../controllers/context-provider.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function e({context:e}){return(n,i)=>{const o=new WeakMap;if(\"object\"==typeof i)return i.addInitializer((function(){o.set(this,new t(this,{context:e}))})),{get(){return n.get.call(this)},set(t){return o.get(this)?.setValue(t),n.set.call(this,t)},init(t){return o.get(this)?.setValue(t),t}};{n.constructor.addInitializer((n=>{o.set(n,new t(n,{context:e}))}));const r=Object.getOwnPropertyDescriptor(n,i);let s;if(void 0===r){const t=new WeakMap;s={get:function(){return t.get(this)},set:function(e){o.get(this).setValue(e),t.set(this,e)}}}else{const t=r?.set;s={...r,set:function(e){o.get(this)?.setValue(e),t?.call(this,e)}}}return void Object.defineProperty(n,i,s)}}}export{e as provide};\n//# sourceMappingURL=provide.js.map\n","import{ContextConsumer as t}from\"../controllers/context-consumer.js\";\n/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function c({context:c,subscribe:e}){return(o,n)=>{\"object\"==typeof n?n.addInitializer((function(){new t(this,{context:c,callback:t=>{this[n.name]=t},subscribe:e})})):o.constructor.addInitializer((o=>{new t(o,{context:c,callback:t=>{o[n]=t},subscribe:e})}))}}export{c as consume};\n//# sourceMappingURL=consume.js.map\n","// https://blog.bitsrc.io/how-to-develop-a-web-component-using-tailwind-a-modern-starter-kit-vite-tailwind-lit-element-4db824b50b23\nimport { LitElement, unsafeCSS } from 'lit';\n\nimport style from './tailwind.global.css?inline';\n\nconst tailwindElement = unsafeCSS(style);\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport const TailwindElement = (style = {}) =>\n\tclass extends LitElement {\n\t\tstatic styles = [tailwindElement, unsafeCSS(style)];\n\t};\n","import { createContext } from '@lit/context';\nimport { type QuestionaireData } from '../interfaces/interfaces';\nexport type { QuestionaireData } from '../interfaces/interfaces';\n\nexport const questionaireContext = createContext(Symbol('questionaireContext'));\n","export const LocalStorageKey = 'responseCode';\nexport const ResumeUrlParam = 'autoresume';\nexport const ClarificationClassName = 'clarification';\nexport const ClarificationClass = `.${ClarificationClassName}`;\nexport const ContinueUrl = '/questionnaire?autoresume=true';\nexport const ContentType = 'application/json';\nexport const FixedElementHeight = 80;\n\nexport enum ApiUrls {\n\tQuestionnaireStart = '/api/questionnaire/start',\n\tQuestionAnswer = '/api/question/answer',\n\tQuestionOpen = '/api/question/open',\n\tReportOpen = '/api/report/open',\n\tQuestionnaireOpen = '/api/questionnaire/open',\n\tClarificationOpen = '/api/clarification/open',\n\tQuestionaire = '/api/questionnaire',\n}\n","export enum CustomEventNames {\n\tOpenResumeDialog = 'open-resume-dialog',\n\tDialogCloseOrAccept = 'dialog-close-or-accept',\n\tLoadingDone = 'loading-done',\n\tStartQuestionnaire = 'start-questionnaire',\n\tSubmitForm = 'submit-form',\n\tOpenQuestion = 'open-question',\n\tResumeLater = 'resume-later',\n\tOpenClarificationDialog = 'open-clarification-dialog',\n\tShowEnterCodeDialog = 'show-enter-code-dialog',\n\tAnswerQuestion = 'answer-question',\n\tOpenErrorDialog = 'open-error-dialog',\n\tBlockQuestionaire = 'block-questionaire',\n\tUnblockQuestionaire = 'unblock-questionaire',\n\tOpenReport = 'open-report',\n\tShowResultBtn = 'show-result-btn',\n}\n","import { ApiUrls, ContentType } from '../constants/constants';\nimport { CustomEventNames } from '../constants/custom-event-names';\nimport {\n\ttype QuestionOpenData,\n\ttype AnswerData,\n\ttype QuestionaireData,\n\ttype QuestionaireStartPageData,\n\ttype ReportData,\n\ttype ClarificationData,\n} from '../interfaces/interfaces';\n\nclass ApiService {\n\tprivate readonly errorMessage: string = 'Er is iets fout gegaan, probeer het later opnieuw.';\n\n\t// get questionaire startpage data\n\tpublic async getQuestionnaire(): Promise {\n\t\treturn await this.getApiResponse(ApiUrls.Questionaire, 'GET', null);\n\t}\n\n\t// post to start questionnaire\n\tpublic async postStartQuestionnaire(): Promise {\n\t\treturn await this.getApiResponse(ApiUrls.QuestionnaireStart, 'POST', null);\n\t}\n\n\t// post to answer question\n\tpublic async postAnswerQuestion(answer: AnswerData): Promise {\n\t\treturn await this.getApiResponse(ApiUrls.QuestionAnswer, 'POST', answer);\n\t}\n\n\t// open question\n\tpublic async openQuestion(questionOpenData: QuestionOpenData): Promise {\n\t\treturn await this.getApiResponse(ApiUrls.QuestionOpen, 'POST', questionOpenData);\n\t}\n\n\t// open report\n\tpublic async openReport(responseCode: string): Promise {\n\t\treturn await this.getApiResponse(ApiUrls.ReportOpen, 'POST', { responseCode });\n\t}\n\n\t// open questionaire\n\tpublic async openQuestionnaire(responseCode: string): Promise {\n\t\treturn await this.getApiResponse(ApiUrls.QuestionnaireOpen, 'POST', { responseCode });\n\t}\n\n\t// open clarification\n\tpublic async openClarification(clarificationId: string): Promise {\n\t\treturn await this.getApiResponse(ApiUrls.ClarificationOpen, 'POST', { clarificationId });\n\t}\n\n\tprivate async getApiResponse(apiUrl: string, method: string, body: object | null): Promise {\n\t\ttry {\n\t\t\tconst parameters: RequestInit = {\n\t\t\t\tmethod,\n\t\t\t\theaders: {\n\t\t\t\t\tAccept: ContentType,\n\t\t\t\t\t'Content-Type': ContentType,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tif (body != null) {\n\t\t\t\tparameters.body = JSON.stringify(body);\n\t\t\t}\n\n\t\t\tconst response = await fetch(`${apiUrl}`, parameters);\n\n\t\t\tif (\n\t\t\t\tresponse.status === 500 ||\n\t\t\t\tresponse.status === 400 ||\n\t\t\t\tresponse.status === 401 ||\n\t\t\t\tresponse.status === 403 ||\n\t\t\t\tresponse.status === 404\n\t\t\t) {\n\t\t\t\tconst error = await response.json();\n\t\t\t\tthrow new ApiException(response.status, error.detail);\n\t\t\t}\n\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new ApiException(response.status, this.errorMessage);\n\t\t\t}\n\n\t\t\tif (response.headers.get('content-type')?.includes(ContentType) ?? false) {\n\t\t\t\treturn (await response.json()) as T;\n\t\t\t}\n\n\t\t\tthrow new ApiException(400, 'Response was not JSON');\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof ApiException)) {\n\t\t\t\tthis.triggerErrorDialog(-1, this.errorMessage);\n\t\t\t} else {\n\t\t\t\tthis.triggerErrorDialog(error.statusCode, error.message);\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tprivate triggerErrorDialog(errorCode: number, errorMessage: string): void {\n\t\tconst event = new CustomEvent(CustomEventNames.OpenErrorDialog, {\n\t\t\tdetail: {\n\t\t\t\tmessage: { errorCode, errorMessage },\n\t\t\t},\n\t\t});\n\t\twindow.dispatchEvent(event);\n\t}\n}\n\nexport const apiService = new ApiService();\n\nclass ApiException extends Error {\n\tpublic statusCode: number;\n\tpublic handled: boolean = false;\n\n\tconstructor(statusCode: number, message: string, handled: boolean = false) {\n\t\tsuper(message);\n\t\tObject.setPrototypeOf(this, ApiException.prototype);\n\t\tthis.statusCode = statusCode;\n\t\tthis.handled = handled;\n\t}\n}\n","import { FixedElementHeight } from '../constants/constants';\nimport { CustomEventNames } from '../constants/custom-event-names';\n\n// clarificationUtil.ts\nexport function addClarificationAttributes(root: ShadowRoot | null, component: EventTarget): (event: Event) => void {\n\tconst clickHandler = (event: Event): void => {\n\t\thandleClarificationClick(event, component);\n\t};\n\troot?.querySelectorAll('.clarification').forEach((item) => {\n\t\titem.setAttribute('tabindex', '0');\n\t\titem.setAttribute('role', 'button');\n\t\titem.setAttribute('aria-haspopup', 'true');\n\t\titem.setAttribute('aria-label', 'Klik om de toelichting te openen');\n\t\titem.addEventListener('click', clickHandler);\n\t\titem.addEventListener('keydown', (event: Event) => {\n\t\t\tif (event instanceof KeyboardEvent) {\n\t\t\t\tif (event.code === 'Enter' || event.code === 'Space') {\n\t\t\t\t\tclickHandler(event);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\titem.addEventListener('focus', () => {\n\t\t\titem.scrollIntoView({ behavior: 'auto', block: 'nearest', inline: 'nearest' });\n\t\t\twindow.scrollBy(0, FixedElementHeight);\n\t\t});\n\t});\n\treturn clickHandler;\n}\n\nexport function handleClarificationClick(event: Event, component: EventTarget): void {\n\tconst clickedElement = event.target as HTMLElement;\n\tevent.preventDefault();\n\tconst dataId = clickedElement.getAttribute('data-id');\n\tconst clarificationOpenEvent = new CustomEvent(CustomEventNames.OpenClarificationDialog, {\n\t\tdetail: {\n\t\t\tid: dataId,\n\t\t},\n\t\tbubbles: true,\n\t\tcomposed: true,\n\t});\n\tcomponent.dispatchEvent(clarificationOpenEvent);\n}\n","import { type TemplateResult, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TailwindElement } from '../../shared/tailwind.element';\nimport { questionaireContext } from '../../context/context';\nimport { consume } from '@lit/context';\nimport { type QuestionaireData } from '../../interfaces/interfaces';\n\n@customElement('szw-ba-progress-bar')\nexport class SzwBaProgressBar extends TailwindElement() {\n\t@consume({ context: questionaireContext, subscribe: true })\n\t@property({ attribute: false })\n\tdata!: QuestionaireData;\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t}\n\n\tgetProgress(): number {\n\t\tconst progress = this.data?.canOpenReport && this.data?.question == null ? 100 : this.data?.question?.progress ?? 0;\n\t\treturn Math.floor(progress);\n\t}\n\n\trender(): TemplateResult {\n\t\treturn html`\n\t\t\t${this.data?.question != null || this.data?.canOpenReport\n\t\t\t\t? html`
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t
`\n\t\t\t\t: null}\n\t\t`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'szw-ba-progress-bar': SzwBaProgressBar;\n\t}\n}\n","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{D:t}=o,i=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,n={HTML:1,SVG:2},e=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,l=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,d=o=>o?._$litDirective$,f=o=>void 0===o.strings,s=()=>document.createComment(\"\"),r=(o,i,n)=>{const e=o._$AA.parentNode,l=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=e.insertBefore(s(),l),c=e.insertBefore(s(),l);n=new t(i,c,o,o.options)}else{const t=n._$AB.nextSibling,i=n._$AM,c=i!==o;if(c){let t;n._$AQ?.(o),n._$AM=o,void 0!==n._$AP&&(t=o._$AU)!==i._$AU&&n._$AP(t)}if(t!==l||c){let o=n._$AA;for(;o!==t;){const t=o.nextSibling;e.insertBefore(o,l),o=t}}}return n},v=(o,t,i=o)=>(o._$AI(t,i),o),u={},m=(o,t=u)=>o._$AH=t,p=o=>o._$AH,h=o=>{o._$AP?.(!1,!0);let t=o._$AA;const i=o._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o}},j=o=>{o._$AR()};export{n as TemplateResultType,j as clearPart,p as getCommittedValue,d as getDirectiveClass,r as insertPart,l as isCompiledTemplateResult,c as isDirectiveResult,i as isPrimitive,f as isSingleExpression,e as isTemplateResult,h as removePart,v as setChildPartValue,m as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{noChange as e}from\"../lit-html.js\";import{directive as s,Directive as t,PartType as r}from\"../directive.js\";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error(\"repeat() can only be used in text expressions\")}ht(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.ht(e,s,t).values}update(s,[t,r,c]){const d=l(s),{values:p,keys:a}=this.ht(t,r,c);if(!Array.isArray(d))return this.dt=a,p;const h=this.dt??=[],v=[];let m,y,x=0,j=d.length-1,k=0,w=p.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h[x]===a[k])v[k]=o(d[x],p[k]),x++,k++;else if(h[j]===a[w])v[w]=o(d[j],p[w]),j--,w--;else if(h[x]===a[w])v[w]=o(d[x],p[w]),i(s,v[w+1],d[x]),x++,w--;else if(h[j]===a[k])v[k]=o(d[j],p[k]),i(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h,x,j)),m.has(h[x]))if(m.has(h[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=i(s,d[x]);o(e,p[k]),v[k]=e}else v[k]=o(t,p[k]),i(s,d[x],t),d[e]=null;k++}else n(d[j]),j--;else n(d[x]),x++;for(;k<=w;){const e=i(s,v[w+1]);o(e,p[k]),v[k++]=e}for(;x<=j;){const e=d[x++];null!==e&&n(e)}return this.dt=a,f(s,v),e}});export{c as repeat};\n//# sourceMappingURL=repeat.js.map\n","import{isSingleExpression as i}from\"./directive-helpers.js\";import{Directive as t,PartType as e}from\"./directive.js\";export{Directive,PartType,directive}from\"./directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t)}};function h(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i{i.type==e.CHILD&&(i._$AP??=n,i._$AQ??=h)};class f extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{f as AsyncDirective};\n//# sourceMappingURL=async-directive.js.map\n","import{nothing as t}from\"../lit-html.js\";import{AsyncDirective as i}from\"../async-directive.js\";import{directive as s}from\"../directive.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=()=>new h;class h{}const o=new WeakMap,n=s(class extends i{render(i){return t}update(i,[s]){const e=s!==this.G;return e&&void 0!==this.G&&this.ot(void 0),(e||this.rt!==this.lt)&&(this.G=s,this.ct=i.options?.host,this.ot(this.lt=i.element)),t}ot(t){if(\"function\"==typeof this.G){const i=this.ct??globalThis;let s=o.get(i);void 0===s&&(s=new WeakMap,o.set(i,s)),void 0!==s.get(this.G)&&this.G.call(this.ct,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ct,t)}else this.G.value=t}get rt(){return\"function\"==typeof this.G?o.get(this.ct??globalThis)?.get(this.G):this.G?.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});export{e as createRef,n as ref};\n//# sourceMappingURL=ref.js.map\n","import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","export const textItems = {\n\tclose: 'Afsluiten',\n\tcloseAndContinue: 'Sluiten en verdergaan',\n\tcloseAndRestart: 'Sluiten en opnieuw beginnen',\n\tstart: 'Start',\n\tresumeLater: 'Later verdergaan',\n\tresumeLaterClarification:\n\t\t'Sla onderstaande code op, zodat u deze op een later moment weer kunt invoeren om verder te gaan met de vragenlijst waar u gebleven was. Dat kan vanaf elk apparaat.',\n\tnext: 'Volgende',\n\tprevious: 'Vorige',\n\tresume: 'Verdergaan',\n\tclarification: 'Toelichting',\n\tclarificationLoading: 'Toelichting wordt geladen...',\n\tgetQuestionaire: 'Vragenlijst ophalen',\n\tgetQuestionaireByCode: 'Vragenlijst ophalen met code',\n\tgetQuestionaireByCodeClarification: 'Vul hier uw code in om verder te gaan met de vragenlijst.',\n\tgetQuestionaireByCodeErrorCodeRequired: 'U heeft geen code ingevuld',\n\tgetQuestionaireByCodeErrorInvalidLength:\n\t\t'De door u ingevulde code heeft niet het juiste aantal tekens. De code moet 12 tekens lang zijn',\n\tgetQuestionaireByCodeErrorInvalid: 'Ongeldige invoer',\n\terrorTitle: 'Er is iets mis gegaan',\n\terrorClarification: `Probeer het later nog eens. Als het probleem zich blijft voordoen, neem dan contact op met\n\twebmodule@minszw.nl`,\n\tresumeDialogTitle: 'Vragenlijst verdergaan waar u gebleven was?',\n\tresumeDialogClarification:\n\t\t'Er is een vragenlijst gevonden waar u mee bezig was, wilt u met deze vragenlijst verdergaan?',\n\trestart: 'Opnieuw beginnen',\n\tprint: 'Printen',\n\ttoReport: 'Naar resultaten',\n\ticons: {\n\t\tclose: 'Venster sluiten',\n\t\twarning: 'Fout',\n\t\tloading: 'Laden',\n\t\tnext: 'Volgende vraag',\n\t\tprevious: 'Vorige vraag',\n\t\tprint: 'Afdrukken',\n\t\tdocument: 'Document',\n\t},\n};\n","import { type TemplateResult, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { TailwindElement } from '../../shared/tailwind.element';\nimport { questionaireContext } from '../../context/context';\nimport { consume } from '@lit/context';\nimport { type Message, type Answer, type AnswerData, type QuestionaireData } from '../../interfaces/interfaces';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { type Ref, createRef, ref } from 'lit/directives/ref.js';\nimport { addClarificationAttributes } from '../../shared/clarificationUtil';\nimport { CustomEventNames } from '../../constants/custom-event-names';\nimport { ClarificationClass } from '../../constants/constants';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { textItems } from '../../constants/text';\n\n@customElement('szw-ba-question')\nexport class SzwBaQuestion extends TailwindElement() {\n\t@consume({ context: questionaireContext, subscribe: true })\n\t@property({ attribute: false })\n\tdata!: QuestionaireData;\n\n\t@state()\n\tshowError = false;\n\n\t@property({ attribute: false })\n\tblockingMessage?: Message = undefined;\n\n\tprivate readonly formRef: Ref = createRef();\n\tprivate readonly boundHandleKeyPress: (event: KeyboardEvent) => void;\n\tprivate readonly boundHandleSubmit: (event: Event) => void;\n\tprivate readonly boundResetError: (_: Event) => void;\n\tprivate clarificationClickHandler?: (event: Event) => void;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.boundHandleKeyPress = this.handleKeyPress.bind(this);\n\t\tthis.boundHandleSubmit = this.handleSubmit.bind(this);\n\t\tthis.boundResetError = this.resetError.bind(this);\n\t}\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\tvoid this.updateComplete.then(() => {\n\t\t\tconst form = this.formRef.value;\n\t\t\tif (form != null) {\n\t\t\t\tform.addEventListener('keypress', this.boundHandleKeyPress);\n\t\t\t\tform.addEventListener('submit', this.boundHandleSubmit);\n\t\t\t\tform.addEventListener('change', this.boundResetError);\n\t\t\t}\n\t\t});\n\t\tthis.addEventListener(CustomEventNames.SubmitForm, this.boundHandleSubmit);\n\t\tthis.addEventListener(CustomEventNames.OpenQuestion, this.boundResetError);\n\t}\n\n\tupdated(changedProperties: Map): void {\n\t\tsuper.updated(changedProperties);\n\t\tif (changedProperties.has('data')) {\n\t\t\tif (this.data?.givenAnswer?.id != null)\n\t\t\t\tthis.handleAnswerSelection(\n\t\t\t\t\ttrue,\n\t\t\t\t\tthis.data?.question?.answers.find((answer) => answer.id === this.data?.givenAnswer?.id) as Answer,\n\t\t\t\t);\n\t\t\tthis.formRef.value?.scrollIntoView({ behavior: 'auto' });\n\t\t\tthis.clarificationClickHandler = addClarificationAttributes(this.shadowRoot, this);\n\t\t\tconst mainContent = document.querySelector('main') as HTMLElement;\n\t\t\tif (mainContent != null) {\n\t\t\t\tmainContent.setAttribute('tabindex', '-1');\n\t\t\t\tmainContent.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback();\n\t\tconst form = this.formRef.value;\n\t\tif (form != null) {\n\t\t\tform.removeEventListener('keypress', this.boundHandleKeyPress);\n\t\t\tform.removeEventListener('submit', this.boundHandleSubmit);\n\t\t\tform.removeEventListener('change', this.boundResetError);\n\t\t}\n\t\tthis.removeEventListener(CustomEventNames.SubmitForm, this.boundHandleSubmit);\n\t\tthis.removeEventListener(CustomEventNames.OpenQuestion, this.boundResetError);\n\t\tif (this.clarificationClickHandler != null) {\n\t\t\tthis.shadowRoot?.querySelectorAll(ClarificationClass).forEach((item) => {\n\t\t\t\tif (this.clarificationClickHandler != null) {\n\t\t\t\t\titem.removeEventListener('click', this.clarificationClickHandler);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tresetError(_: Event): void {\n\t\tthis.showError = false;\n\t}\n\n\thandleKeyPress(event: KeyboardEvent): void {\n\t\tif (event.code === 'Enter' && event.target instanceof HTMLInputElement) {\n\t\t\tevent.preventDefault();\n\t\t\tthis.handleSubmit(event);\n\t\t}\n\t}\n\n\thandleSubmit(event: Event): void {\n\t\tevent.preventDefault();\n\t\tif (this.blockingMessage != null) return;\n\t\tif ((this.formRef.value?.checkValidity() ?? false) && this.data?.question != null) {\n\t\t\tthis.showError = false;\n\t\t\tconst formData = new FormData(this.formRef.value);\n\t\t\tconst detail: AnswerData = {\n\t\t\t\tanswerId: formData.get(this.data.question.id) as string,\n\t\t\t\tresponseCode: this.data.responseCode,\n\t\t\t\tquestionId: this.data.question.id,\n\t\t\t};\n\t\t\tconst customEvent = new CustomEvent(CustomEventNames.AnswerQuestion, {\n\t\t\t\tdetail,\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t});\n\t\t\tthis.dispatchEvent(customEvent);\n\t\t} else {\n\t\t\tthis.showError = true;\n\t\t\tconst eventTarget = event.target as HTMLElement;\n\t\t\tif (eventTarget !== null) eventTarget.scrollIntoView({ behavior: 'auto', block: 'center' });\n\t\t\tthis.formRef.value?.reportValidity();\n\t\t\tthis.dispatchEvent(new Event(CustomEventNames.LoadingDone, { bubbles: true, composed: true }));\n\t\t}\n\t}\n\n\trender(): TemplateResult {\n\t\treturn html`\n\t\t\t\n\t\t`;\n\t}\n\n\trenderAnswerTemplate(answer: Answer): TemplateResult {\n\t\treturn html`\n\t\t\t${answer.messages?.length > 0\n\t\t\t\t? html` ${answer.messages.map(\n\t\t\t\t\t\t(message) =>\n\t\t\t\t\t\t\thtml`
\n\t\t\t\t\t\t\t\t
${unsafeHTML(message.descriptionHtml)}
\n\t\t\t\t\t\t\t
`,\n\t\t\t\t )}`\n\t\t\t\t: null} `;\n\t}\n\n\tresetAnswer(): void {\n\t\tthis.blockingMessage = undefined;\n\t\tconst customEvent = new CustomEvent(CustomEventNames.UnblockQuestionaire, {\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t});\n\t\tthis.dispatchEvent(customEvent);\n\t\t// add !hidden class to all messages selected by class js-message\n\t\tthis.shadowRoot?.querySelectorAll('.js-message').forEach((item) => {\n\t\t\titem.classList.add('!hidden');\n\t\t\titem.setAttribute('aria-hidden', 'true');\n\t\t});\n\t}\n\n\thandleChecked(answer: Answer): boolean {\n\t\tthis.handleAnswerSelection(true, answer);\n\t\treturn true;\n\t}\n\n\thandleAnswerSelection(isChecked: boolean, answer: Answer): void {\n\t\tif (!isChecked || answer == null) return;\n\t\tthis.resetAnswer();\n\t\tif (this.data?.canOpenReport) {\n\t\t\tconst customEvent = new CustomEvent(CustomEventNames.ShowResultBtn, {\n\t\t\t\tdetail: this.data?.givenAnswer?.id === answer.id,\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t});\n\t\t\tthis.dispatchEvent(customEvent);\n\t\t}\n\t\tif (answer.messages?.length > 0) {\n\t\t\tconst messages = this.shadowRoot?.querySelectorAll(`[data-answer-id=\"message-${answer.id}\"]`);\n\t\t\tmessages?.forEach((message) => {\n\t\t\t\tmessage.classList.remove('!hidden');\n\t\t\t\tmessage.setAttribute('aria-hidden', 'false');\n\t\t\t});\n\t\t\t// check if any of the messages is blocking\n\t\t\tthis.blockingMessage = answer.messages.find((message) => message.isBlocking);\n\t\t\tif (this.blockingMessage != null) {\n\t\t\t\tconst customEvent = new CustomEvent(CustomEventNames.BlockQuestionaire, {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcomposed: true,\n\t\t\t\t});\n\t\t\t\tthis.dispatchEvent(customEvent);\n\t\t\t}\n\t\t}\n\t}\n\n\trenderErrorMessageTemplate(): TemplateResult {\n\t\treturn html`
\n\t\t\t\n\t\t\tEr is nog geen antwoord gekozen. Kies één van de onderstaande antwoorden.\n\t\t
`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'szw-ba-question': SzwBaQuestion;\n\t}\n}\n","import { type TemplateResult, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { TailwindElement } from '../../shared/tailwind.element';\nimport { questionaireContext } from '../../context/context';\nimport { consume } from '@lit/context';\nimport { type QuestionaireData } from '../../interfaces/interfaces';\nimport { CustomEventNames } from '../../constants/custom-event-names';\nimport { textItems } from '../../constants/text';\n\nenum ButtonId {\n\tStartButton = 'startButton',\n\tAnswerButton = 'answerButton',\n\tOpenButton = 'openButton',\n\tResumeButton = 'resumeButton',\n}\n\nfunction LoadingIndicator(buttonId: ButtonId) {\n\treturn function (_target: unknown, _propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n\t\tconst originalMethod = descriptor.value;\n\n\t\tdescriptor.value = function (this: { isLoading: boolean; loadingButton: ButtonId | null }, ...args: unknown[]) {\n\t\t\tthis.loadingButton = buttonId;\n\t\t\tthis.isLoading = true;\n\t\t\treturn originalMethod.apply(this, args);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n\n@customElement('szw-ba-action-bar')\nexport class SzwBaActionBar extends TailwindElement() {\n\t@consume({ context: questionaireContext, subscribe: true })\n\t@property({ attribute: false })\n\tdata!: QuestionaireData;\n\n\t@state()\n\tisLoading = false;\n\n\t@state()\n\tshowResultBtn = false;\n\n\t@state()\n\tisDisabled = false;\n\n\t@state()\n\tloadingButton: ButtonId | null = null;\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\twindow.addEventListener(CustomEventNames.LoadingDone, this.handleLoadingDone);\n\t\twindow.addEventListener(CustomEventNames.BlockQuestionaire, () => {\n\t\t\tthis.isDisabled = true;\n\t\t});\n\t\twindow.addEventListener(CustomEventNames.UnblockQuestionaire, () => {\n\t\t\tthis.isDisabled = false;\n\t\t});\n\t\twindow.addEventListener(CustomEventNames.ShowResultBtn, (event: Event) => {\n\t\t\tconst e = event as CustomEvent;\n\t\t\tthis.showResultBtn = e.detail;\n\t\t});\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback();\n\t\twindow.removeEventListener(CustomEventNames.LoadingDone, this.handleLoadingDone);\n\t\twindow.removeEventListener(CustomEventNames.BlockQuestionaire, () => {\n\t\t\tthis.isDisabled = true;\n\t\t});\n\t\twindow.removeEventListener(CustomEventNames.UnblockQuestionaire, () => {\n\t\t\tthis.isDisabled = false;\n\t\t});\n\t}\n\n\thandleLoadingDone = (): void => {\n\t\tthis.isLoading = false;\n\t\tthis.loadingButton = null;\n\t};\n\n\tloaderTemplate(): TemplateResult {\n\t\treturn html`