"use strict";(globalThis.webpackChunkhelphub=globalThis.webpackChunkhelphub||[]).push([[636],{838:(t,e,n)=>{function SelectorSet(){if(!(this instanceof SelectorSet))return new SelectorSet;this.size=0,this.uid=0,this.selectors=[],this.selectorObjects={},this.indexes=Object.create(this.indexes),this.activeIndexes=[]}n.d(e,{on:()=>on});var o=window.document.documentElement,i=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector;SelectorSet.prototype.matchesSelector=function(t,e){return i.call(t,e)},SelectorSet.prototype.querySelectorAll=function(t,e){return e.querySelectorAll(t)},SelectorSet.prototype.indexes=[];var s=/^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;SelectorSet.prototype.indexes.push({name:"ID",selector:function matchIdSelector(t){var e;if(e=t.match(s))return e[0].slice(1)},element:function getElementId(t){if(t.id)return[t.id]}});var r=/^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;SelectorSet.prototype.indexes.push({name:"CLASS",selector:function matchClassSelector(t){var e;if(e=t.match(r))return e[0].slice(1)},element:function getElementClassNames(t){var e=t.className;if(e){if("string"==typeof e)return e.split(/\s/);if("object"==typeof e&&"baseVal"in e)return e.baseVal.split(/\s/)}}});var c,a=/^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;SelectorSet.prototype.indexes.push({name:"TAG",selector:function matchTagSelector(t){var e;if(e=t.match(a))return e[0].toUpperCase()},element:function getElementTagName(t){return[t.nodeName.toUpperCase()]}}),SelectorSet.prototype.indexes.default={name:"UNIVERSAL",selector:function(){return!0},element:function(){return[!0]}},c="function"==typeof window.Map?window.Map:function(){function Map(){this.map={}}return Map.prototype.get=function(t){return this.map[t+" "]},Map.prototype.set=function(t,e){this.map[t+" "]=e},Map}();var l=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;function parseSelectorIndexes(t,e){var n,o,i,s,r,c,a=(t=t.slice(0).concat(t.default)).length,d=e,u=[];do{if(l.exec(""),(i=l.exec(d))&&(d=i[3],i[2]||!d))for(n=0;n3&&void 0!==arguments[3]?arguments[3]:{}).capture,i=o?u:d,s=i[t];s||(s=new SelectorSet,i[t]=s,document.addEventListener(t,dispatch,o)),s.add(e,n)}},5997:(t,e,n)=>{n.d(e,{Be:()=>createConsumer});var o={logger:"undefined"!=typeof console?console:void 0,WebSocket:"undefined"!=typeof WebSocket?WebSocket:void 0},i={log(...t){this.enabled&&(t.push(Date.now()),o.logger.log("[ActionCable]",...t))}};const now=()=>(new Date).getTime(),secondsSince=t=>(now()-t)/1e3;class ConnectionMonitor{constructor(t){this.visibilityDidChange=this.visibilityDidChange.bind(this),this.connection=t,this.reconnectAttempts=0}start(){this.isRunning()||(this.startedAt=now(),delete this.stoppedAt,this.startPolling(),addEventListener("visibilitychange",this.visibilityDidChange),i.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`))}stop(){this.isRunning()&&(this.stoppedAt=now(),this.stopPolling(),removeEventListener("visibilitychange",this.visibilityDidChange),i.log("ConnectionMonitor stopped"))}isRunning(){return this.startedAt&&!this.stoppedAt}recordMessage(){this.pingedAt=now()}recordConnect(){this.reconnectAttempts=0,delete this.disconnectedAt,i.log("ConnectionMonitor recorded connect")}recordDisconnect(){this.disconnectedAt=now(),i.log("ConnectionMonitor recorded disconnect")}startPolling(){this.stopPolling(),this.poll()}stopPolling(){clearTimeout(this.pollTimeout)}poll(){this.pollTimeout=setTimeout((()=>{this.reconnectIfStale(),this.poll()}),this.getPollInterval())}getPollInterval(){const{staleThreshold:t,reconnectionBackoffRate:e}=this.constructor;return 1e3*t*Math.pow(1+e,Math.min(this.reconnectAttempts,10))*(1+(0===this.reconnectAttempts?1:e)*Math.random())}reconnectIfStale(){this.connectionIsStale()&&(i.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${secondsSince(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`),this.reconnectAttempts++,this.disconnectedRecently()?i.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${secondsSince(this.disconnectedAt)} s`):(i.log("ConnectionMonitor reopening"),this.connection.reopen()))}get refreshedAt(){return this.pingedAt?this.pingedAt:this.startedAt}connectionIsStale(){return secondsSince(this.refreshedAt)>this.constructor.staleThreshold}disconnectedRecently(){return this.disconnectedAt&&secondsSince(this.disconnectedAt){!this.connectionIsStale()&&this.connection.isOpen()||(i.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`),this.connection.reopen())}),200)}}ConnectionMonitor.staleThreshold=6,ConnectionMonitor.reconnectionBackoffRate=.15;var s={message_types:{welcome:"welcome",disconnect:"disconnect",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},disconnect_reasons:{unauthorized:"unauthorized",invalid_request:"invalid_request",server_restart:"server_restart",remote:"remote"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]};const{message_types:r,protocols:c}=s,a=c.slice(0,c.length-1),l=[].indexOf;class Connection{constructor(t){this.open=this.open.bind(this),this.consumer=t,this.subscriptions=this.consumer.subscriptions,this.monitor=new ConnectionMonitor(this),this.disconnected=!0}send(t){return!!this.isOpen()&&(this.webSocket.send(JSON.stringify(t)),!0)}open(){if(this.isActive())return i.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`),!1;{const t=[...c,...this.consumer.subprotocols||[]];return i.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${t}`),this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new o.WebSocket(this.consumer.url,t),this.installEventHandlers(),this.monitor.start(),!0}}close({allowReconnect:t}={allowReconnect:!0}){if(t||this.monitor.stop(),this.isOpen())return this.webSocket.close()}reopen(){if(i.log(`Reopening WebSocket, current state is ${this.getState()}`),!this.isActive())return this.open();try{return this.close()}catch(t){i.log("Failed to reopen WebSocket",t)}finally{i.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`),setTimeout(this.open,this.constructor.reopenDelay)}}getProtocol(){if(this.webSocket)return this.webSocket.protocol}isOpen(){return this.isState("open")}isActive(){return this.isState("open","connecting")}triedToReconnect(){return this.monitor.reconnectAttempts>0}isProtocolSupported(){return l.call(a,this.getProtocol())>=0}isState(...t){return l.call(t,this.getState())>=0}getState(){if(this.webSocket)for(let t in o.WebSocket)if(o.WebSocket[t]===this.webSocket.readyState)return t.toLowerCase();return null}installEventHandlers(){for(let t in this.events){const e=this.events[t].bind(this);this.webSocket[`on${t}`]=e}}uninstallEventHandlers(){for(let t in this.events)this.webSocket[`on${t}`]=function(){}}}Connection.reopenDelay=500,Connection.prototype.events={message(t){if(!this.isProtocolSupported())return;const{identifier:e,message:n,reason:o,reconnect:s,type:c}=JSON.parse(t.data);switch(this.monitor.recordMessage(),c){case r.welcome:return this.triedToReconnect()&&(this.reconnectAttempted=!0),this.monitor.recordConnect(),this.subscriptions.reload();case r.disconnect:return i.log(`Disconnecting. Reason: ${o}`),this.close({allowReconnect:s});case r.ping:return null;case r.confirmation:return this.subscriptions.confirmSubscription(e),this.reconnectAttempted?(this.reconnectAttempted=!1,this.subscriptions.notify(e,"connected",{reconnected:!0})):this.subscriptions.notify(e,"connected",{reconnected:!1});case r.rejection:return this.subscriptions.reject(e);default:return this.subscriptions.notify(e,"received",n)}},open(){if(i.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`),this.disconnected=!1,!this.isProtocolSupported())return i.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close(t){if(i.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error(){i.log("WebSocket onerror event")}};class Subscription{constructor(t,e={},n){this.consumer=t,this.identifier=JSON.stringify(e),function(t,e){if(null!=e)for(let n in e){const o=e[n];t[n]=o}}(this,n)}perform(t,e={}){return e.action=t,this.send(e)}send(t){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(t)})}unsubscribe(){return this.consumer.subscriptions.remove(this)}}class SubscriptionGuarantor{constructor(t){this.subscriptions=t,this.pendingSubscriptions=[]}guarantee(t){-1==this.pendingSubscriptions.indexOf(t)?(i.log(`SubscriptionGuarantor guaranteeing ${t.identifier}`),this.pendingSubscriptions.push(t)):i.log(`SubscriptionGuarantor already guaranteeing ${t.identifier}`),this.startGuaranteeing()}forget(t){i.log(`SubscriptionGuarantor forgetting ${t.identifier}`),this.pendingSubscriptions=this.pendingSubscriptions.filter((e=>e!==t))}startGuaranteeing(){this.stopGuaranteeing(),this.retrySubscribing()}stopGuaranteeing(){clearTimeout(this.retryTimeout)}retrySubscribing(){this.retryTimeout=setTimeout((()=>{this.subscriptions&&"function"==typeof this.subscriptions.subscribe&&this.pendingSubscriptions.map((t=>{i.log(`SubscriptionGuarantor resubscribing ${t.identifier}`),this.subscriptions.subscribe(t)}))}),500)}}class Subscriptions{constructor(t){this.consumer=t,this.guarantor=new SubscriptionGuarantor(this),this.subscriptions=[]}create(t,e){const n="object"==typeof t?t:{channel:t},o=new Subscription(this.consumer,n,e);return this.add(o)}add(t){return this.subscriptions.push(t),this.consumer.ensureActiveConnection(),this.notify(t,"initialized"),this.subscribe(t),t}remove(t){return this.forget(t),this.findAll(t.identifier).length||this.sendCommand(t,"unsubscribe"),t}reject(t){return this.findAll(t).map((t=>(this.forget(t),this.notify(t,"rejected"),t)))}forget(t){return this.guarantor.forget(t),this.subscriptions=this.subscriptions.filter((e=>e!==t)),t}findAll(t){return this.subscriptions.filter((e=>e.identifier===t))}reload(){return this.subscriptions.map((t=>this.subscribe(t)))}notifyAll(t,...e){return this.subscriptions.map((n=>this.notify(n,t,...e)))}notify(t,e,...n){let o;return o="string"==typeof t?this.findAll(t):[t],o.map((t=>"function"==typeof t[e]?t[e](...n):void 0))}subscribe(t){this.sendCommand(t,"subscribe")&&this.guarantor.guarantee(t)}confirmSubscription(t){i.log(`Subscription confirmed ${t}`),this.findAll(t).map((t=>this.guarantor.forget(t)))}sendCommand(t,e){const{identifier:n}=t;return this.consumer.send({command:e,identifier:n})}}class Consumer{constructor(t){this._url=t,this.subscriptions=new Subscriptions(this),this.connection=new Connection(this),this.subprotocols=[]}get url(){return function createWebSocketURL(t){"function"==typeof t&&(t=t());if(t&&!/^wss?:/i.test(t)){const e=document.createElement("a");return e.href=t,e.href=e.href,e.protocol=e.protocol.replace("http","ws"),e.href}return t}(this._url)}send(t){return this.connection.send(t)}connect(){return this.connection.open()}disconnect(){return this.connection.close({allowReconnect:!1})}ensureActiveConnection(){if(!this.connection.isActive())return this.connection.open()}addSubProtocol(t){this.subprotocols=[...this.subprotocols,t]}}function createConsumer(t=function getConfig(t){const e=document.head.querySelector(`meta[name='action-cable-${t}']`);if(e)return e.getAttribute("content")}("url")||s.default_mount_path){return new Consumer(t)}},52426:(t,e,n)=>{n.r(e),n.d(e,{attr:()=>attr,autoShadowRoot:()=>autoShadowRoot,bind:()=>bind,controller:()=>controller,defineObservedAttributes:()=>defineObservedAttributes,findTarget:()=>findTarget,findTargets:()=>findTargets,initializeAttrs:()=>initializeAttrs,lazyDefine:()=>lazyDefine,listenForBind:()=>listenForBind,register:()=>register,target:()=>target,targets:()=>targets});const o=new WeakSet;function bind(t){o.add(t),t.shadowRoot&&bindShadow(t.shadowRoot),bindElements(t),listenForBind(t.ownerDocument)}function bindShadow(t){bindElements(t),listenForBind(t)}const i=new WeakMap;function listenForBind(t=document){if(i.has(t))return i.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)bindActions(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&bindElements(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const o={get closed(){return e},unsubscribe(){e=!0,i.delete(t),n.disconnect()}};return i.set(t,o),o}function bindElements(t){for(const e of t.querySelectorAll("[data-action]"))bindActions(e);t instanceof Element&&t.hasAttribute("data-action")&&bindActions(t)}function handleEvent(t){const e=t.currentTarget;for(const n of bindings(e))if(t.type===n.type){const i=e.closest(n.tag);o.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const s=e.getRootNode();if(s instanceof ShadowRoot&&o.has(s.host)&&s.host.matches(n.tag)){const e=s.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*bindings(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const t=e.lastIndexOf(":"),n=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,t),tag:e.slice(t+1,n),method:e.slice(n+1)||"handleEvent"}||"handleEvent"}}function bindActions(t){for(const e of bindings(t))t.addEventListener(e.type,handleEvent)}const dasherize=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),mustDasherize=(t,e="property")=>{const n=dasherize(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};function register(t){const e=dasherize(t.name).replace(/-element$/,"");try{window.customElements.define(e,t),window[t.name]=customElements.get(e)}catch(n){if(!(n instanceof DOMException&&"NotSupportedError"===n.name))throw n}return t}function findTarget(t,e){const n=t.tagName.toLowerCase();if(t.shadowRoot)for(const o of t.shadowRoot.querySelectorAll(`[data-target~="${n}.${e}"]`))if(!o.closest(n))return o;for(const o of t.querySelectorAll(`[data-target~="${n}.${e}"]`))if(o.closest(n)===t)return o}function findTargets(t,e){const n=t.tagName.toLowerCase(),o=[];if(t.shadowRoot)for(const i of t.shadowRoot.querySelectorAll(`[data-targets~="${n}.${e}"]`))i.closest(n)||o.push(i);for(const i of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))i.closest(n)===t&&o.push(i);return o}function autoShadowRoot(t){for(const e of t.querySelectorAll("template[data-shadowroot]"))e.parentElement===t&&t.attachShadow({mode:"closed"===e.getAttribute("data-shadowroot")?"closed":"open"}).append(e.content.cloneNode(!0))}const s="attr";function attr(t,e){meta(t,s).add(e)}const r=new WeakSet;function initializeAttrs(t,e){if(r.has(t))return;r.add(t);const n=Object.getPrototypeOf(t),o=n?.constructor?.attrPrefix??"data-";e||(e=meta(n,s));for(const i of e){const e=t[i],n=mustDasherize(`${o}${i}`);let s={configurable:!0,get(){return this.getAttribute(n)||""},set(t){this.setAttribute(n,t||"")}};"number"==typeof e?s={configurable:!0,get(){return Number(this.getAttribute(n)||0)},set(t){this.setAttribute(n,t)}}:"boolean"==typeof e&&(s={configurable:!0,get(){return this.hasAttribute(n)},set(t){this.toggleAttribute(n,t)}}),Object.defineProperty(t,i,s),i in t&&!t.hasAttribute(n)&&s.set.call(t,e)}}function defineObservedAttributes(t){let e=t.observedAttributes||[];const n=t.attrPrefix??"data-",attrToAttributeName=t=>mustDasherize(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...meta(t.prototype,s)].map(attrToAttributeName).concat(e),set(t){e=t}})}const c=Symbol.for("catalyst");class CatalystDelegate{constructor(t){const e=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){e.connectedCallback(this,n)};const o=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,o)};const i=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,n,o){e.attributeChangedCallback(this,t,n,o,i)};let s=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return e.observedAttributes(this,s)},set(t){s=t}}),defineObservedAttributes(t),register(t)}observedAttributes(t,e){return e}connectedCallback(t,e){t.toggleAttribute("data-catalyst",!0),customElements.upgrade(t),autoShadowRoot(t),initializeAttrs(t),bind(t),e?.call(t),t.shadowRoot&&bindShadow(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,o,i){initializeAttrs(t),"data-catalyst"!==e&&i&&i.call(t,e,n,o)}}function meta(t,e){if(!Object.prototype.hasOwnProperty.call(t,c)){const e=t[c],n=t[c]=new Map;if(e)for(const[t,o]of e)n.set(t,new Set(o))}const n=t[c];return n.has(e)||n.set(e,new Set),n.get(e)}function target(t,e){meta(t,"target").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return findTarget(this,e)}})}function targets(t,e){meta(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return findTargets(this,e)}})}function controller(t){new CatalystDelegate(t)}const a=new Map,l=new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),d=new Promise((t=>{const e=new AbortController;e.signal.addEventListener("abort",(()=>t()));const n={once:!0,passive:!0,signal:e.signal},handler=()=>e.abort();document.addEventListener("mousedown",handler,n),document.addEventListener("touchstart",handler,n),document.addEventListener("keydown",handler,n),document.addEventListener("pointerdown",handler,n)})),u={ready:()=>l,firstInteraction:()=>d,visible:t=>new Promise((e=>{const n=new IntersectionObserver((t=>{for(const o of t)if(o.isIntersecting)return e(),void n.disconnect()}),{rootMargin:"0px 0px 256px 0px",threshold:.01});for(const o of document.querySelectorAll(t))n.observe(o)}))},h=new WeakMap;function scan(t){cancelAnimationFrame(h.get(t)||0),h.set(t,requestAnimationFrame((()=>{for(const e of a.keys()){const n=t.matches(e)?t:t.querySelector(e);if(customElements.get(e)||n){const o=n?.getAttribute("data-load-on")||"ready",i=o in u?u[o]:u.ready;for(const t of a.get(e)||[])i(e).then(t);a.delete(e),h.delete(t)}}})))}let p;function lazyDefine(t,e){a.has(t)||a.set(t,new Set),a.get(t).add(e),scan(document.body),p||(p=new MutationObserver((t=>{if(a.size)for(const e of t)for(const t of e.addedNodes)t instanceof Element&&scan(t)})),p.observe(document,{subtree:!0,childList:!0}))}}}]);