{"version":3,"names":["NAMESPACE","BUILD","allRenderFn","appendChildSlotFix","asyncLoading","asyncQueue","attachStyles","cloneNodeFix","constructableCSS","cssAnnotations","devTools","element","event","experimentalScopedSlotChanges","experimentalSlotFixes","formAssociated","hasRenderFn","hostListener","hostListenerTarget","hostListenerTargetBody","hostListenerTargetDocument","hostListenerTargetParent","hostListenerTargetWindow","hotModuleReplacement","hydrateClientSide","hydrateServerSide","hydratedAttribute","hydratedClass","hydratedSelectorName","initializeNextTick","invisiblePrehydration","isDebug","isDev","isTesting","lazyLoad","lifecycle","lifecycleDOMEvents","member","method","mode","modernPropertyDecls","observeAttribute","profile","prop","propBoolean","propMutable","propNumber","propString","reflect","scoped","scopedSlotTextContentFix","scriptDataOpts","shadowDelegatesFocus","shadowDom","slot","slotChildNodesFix","slotRelocation","state","style","svg","taskQueue","transformTagName","updatable","vdomAttribute","vdomClass","vdomFunctional","vdomKey","vdomListener","vdomPropOrAttr","vdomRef","vdomRender","vdomStyle","vdomText","vdomXlink","watchCallback","__defProp","Object","defineProperty","__export","target","all","name","get","enumerable","getHostRef","ref","__stencil__getHostRef","registerInstance","lazyInstance","hostRef","$lazyInstance$","registerHost","hostElement","cmpMeta","$flags$","$hostElement$","$cmpMeta$","$instanceValues$","Map","$onInstancePromise$","Promise","r","$onInstanceResolve$","$onReadyPromise$","$onReadyResolve$","isMemberInElement","elm","memberName","consoleError","e","el","console","error","cmpModules","loadModule","hmrVersionId","exportName","$tagName$","replace","bundleId","$lazyBundleId$","module","import","then","importedModule","set","styles","HYDRATED_STYLE_ID","HYDRATED_CSS","SLOT_FB_CSS","win","window","plt","$resourcesUrl$","jmp","h2","raf","requestAnimationFrame","ael","eventName","listener","opts","addEventListener","rel","removeEventListener","ce","CustomEvent","supportsShadow","BUILD6","supportsListenerOptions","_a","supportsListenerOptions2","document","promiseResolve","v","resolve","supportsConstructableStylesheets","CSSStyleSheet","replaceSync","queuePending","queueDomReads","queueDomWrites","queueTask","queue","write","cb","push","nextTick","flush","consume","i2","length","performance","now","writeTask","isComplexType","o","queryNonceMetaTagContent","doc","_b","_c","head","querySelector","getAttribute","result_exports","err","map","ok","unwrap","unwrapErr","value","isOk","isErr","result","fn","val","newVal","createTime","fnName","tagName","uniqueTime","key","measureText","h","nodeName","vnodeData","children","child","simple","lastSimple","vNodeChildren","walk","c","Array","isArray","String","$text$","newVNode","classData","className","class","keys","filter","k","join","vdomFnUtils","vnode","$attrs$","$children$","$key$","tag","text","$tag$","$elm$","Host","isHost","node","forEach","convertToPublic","convertToPrivate","vattrs","vchildren","vkey","vname","$name$","vtag","vtext","parsePropertyValue","propValue","propType","getElement","createEvent","flags","emit","detail","emitEvent","bubbles","composed","cancelable","ev","dispatchEvent","rootAppliedStyles","WeakMap","registerStyle","scopeId2","cssText","allowCS","addStyle","styleContainerNode","getScopeId","nodeType","appliedStyles","styleElm","Set","has","createElement","innerHTML","nonce","$nonce$","setAttribute","preconnectLinks","querySelectorAll","referenceNode2","nextSibling","insertBefore","parentNode","stylesheet","adoptedStyleSheets","existingStyleContainer","prepend","append","add","includes","endAttachStyles","getRootNode","cmp","setAccessor","oldValue","newValue","isSvg","initialRender","isProp","ln","toLowerCase","classList","oldClasses","parseClassList","newClasses","remove","slice","capture","endsWith","CAPTURE_EVENT_SUFFIX","CAPTURE_EVENT_REGEX","isComplex","n","__lookupSetter__","removeAttribute","parseClassListRegex","baseVal","split","RegExp","updateElement","oldVnode","newVnode","isSvgMode2","isInitialRender","host","oldVnodeAttrs","newVnodeAttrs","sortedAttrNames","attrNames","attr","hostTagName","useNativeShadowDom","isSvgMode","createElm","oldParentVNode","newParentVNode","childIndex","newVNode2","childNode","createTextNode","Error","BUILD19","appendChild","addVnodes","parentElm","before","parentVNode","vnodes","startIdx","endIdx","containerElm","removeVnodes","index","nullifyVNodeRefs","updateChildren","oldCh","newCh","oldStartIdx","newStartIdx","idxInOld","oldEndIdx","oldStartVnode","oldEndVnode","newEndIdx","newStartVnode","newEndVnode","elmToMove","isSameVnode","patch","leftVNode","rightVNode","oldVNode","oldChildren","newChildren","textContent","data","vNode","parent","newNode","reference","renderVdom","renderFnResults","isInitialLoad","hostElm","$vnode$","rootVnode","hasAttribute","attachToAncestor","ancestorComponent","$onRenderResolve$","splice","scheduleUpdate","$ancestorComponent$","dispatch","dispatchHooks","endSchedule","instance","maybePromise","$queuedListeners$","methodName","safeCall","enqueue","updateComponent","isPromisey","catch","err2","async","endUpdate","rc","endRender","callRender","childrenPromises","postUpdate","postUpdateComponent","render","endPostUpdate","addHydratedFlag","appDidLoad","who","namespace","arg","BUILD20","getValue","propName","setValue","oldVal","$members$","areBothNaN","Number","isNaN","didValueChange","$watchers$","watchMethods","watchMethodName","componentShouldUpdate","proxyComponent","Cstr","prototype","watchers","members","entries","memberFlags","origGetter","origSetter","getOwnPropertyDescriptor","this","configurable","currentValue","apply","setterSetVal","args","_a2","_a3","attrNameToPropName","attributeChangedCallback","attrName","hasOwnProperty","BUILD22","flags2","entry","callbackName","call","propDesc","observedAttributes","from","_","m","initializeComponent","CstrImport","endLoad","$modeName$","isProxied","endNewInstance","fireConnectedCallback","constructor","cmpTag","localName","customElements","whenDefined","endRegisterStyles","schedule","connectedCallback","endConnected","addHostEventListeners","$listeners$","disconnectInstance","disconnectedCallback","$rmListeners$","rmListener","delete","shadowRoot","bootstrapLazy","lazyBundles","options","warn","endBootstrap","cmpTags","exclude","customElements2","metaCharset","dataStyles","deferredConnectedCallbacks","appLoadFallback","isBootstrapping","assign","URL","resourcesUrl","baseURI","href","hasSlotRelocation","lazyBundle","compactMeta","HostElement","HTMLElement","self","super","hasRegisteredEventListeners","clearTimeout","findIndex","Node","isConnected","componentOnReady","define","sort","firstChild","setTimeout","Fragment","listeners","attachParentListeners","getHostListenerTarget","handler","hostListenerProxy","hostListenerOpts","passive","setNonce","GangLogLevel","doNothing","gangNoOpLogger","trace","debug","info","GangHttp","rootPath","fetch","url","init","GangLocationService","location","origin","protocol","pushState","history","title","_instance","isFunction","createErrorClass","createImpl","_super","stack","ctorFunc","create","UnsubscriptionError","UnsubscriptionErrorImpl","errors","message","i","toString","arrRemove","arr","item","indexOf","Subscription","initialTeardown","closed","_parentage","_finalizers","unsubscribe","initialFinalizer","finalizer","execFinalizer","teardown","_hasParent","_addParent","_removeParent","EMPTY","empty","EMPTY_SUBSCRIPTION","isSubscription","config","onUnhandledError","onStoppedNotification","undefined","useDeprecatedSynchronousErrorHandling","useDeprecatedNextContext","timeoutProvider","timeout","delegate","handle","reportUnhandledError","noop","COMPLETE_NOTIFICATION","createNotification","errorNotification","nextNotification","kind","context","errorContext","isRoot","errorThrown","Subscriber","destination","isStopped","EMPTY_OBSERVER","next","complete","SafeSubscriber","handleStoppedNotification","_next","_error","_complete","_bind","Function","bind","thisArg","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","defaultErrorHandler","notification","subscriber","observable","Symbol","identity","x","pipeFromArray","fns","piped","input","reduce","prev","Observable","subscribe","_subscribe","lift","operator","source","isSubscriber","_trySubscribe","sink","promiseCtor","getPromiseCtor","reject","Symbol_observable","pipe","operations","toPromise","isObserver","ObjectUnsubscribedError","ObjectUnsubscribedErrorImpl","Subject","currentObservers","observers","hasError","thrownError","subject","AnonymousSubject","_throwIfClosed","observer","shift","observed","_checkFinalizedStatuses","_innerSubscribe","asObservable","BehaviorSubject","_value","subscription","dateTimestampProvider","Date","ReplaySubject","_bufferSize","Infinity","_windowTime","_timestampProvider","_buffer","_infiniteTimeWindow","Math","max","_trimBuffer","copy","adjustedBufferSize","last","base64UrlToBytes","Uint8Array","atob","charCodeAt","bytesToString","fromCharCode","bytesToBase64Url","btoa","POW_2_24","POW_2_32","POW_2_53","encode","ArrayBuffer","dataView","DataView","lastLength","offset","prepareWrite","newByteLength","byteLength","requiredLength","oldDataView","uint32count","setUint32","getUint32","commitWrite","writeFloat64","setFloat64","writeUint8","setUint8","writeUint8Array","writeUint16","setUint16","writeUint32","writeUint64","low","high","writeTypeAndLength","type","encodeItem","floor","utf8data","charCode","ret","retView","getUint8","decode","tagger","simpleValue","commitRead","readArrayBuffer","readFloat16","tempArrayBuffer","tempDataView","readUint16","sign","exponent","fraction","getFloat32","readFloat32","readFloat64","getFloat64","readUint8","getUint16","readUint32","readUint64","readBreak","readLength","additionalInformation","readIndefiniteStringLength","majorType","initialByte","appendUtf16Data","utf16data","decodeItem","elements","fullArrayLength","fullArray","fullArrayOffset","retArray","retObject","CBOR","clean","obj","test","GangUrlBuilder","urlString","protocolSplit","path","root","parameters","part","kv","addParameter","setParameter","setParameters","getParameterString","removeParameter","build","separator","values","getGangId","dash","crypto","getRandomValues","getRandomBytes","globalThis","readString","buffer","start","Uint32Array","stringToBytes","viewToBuffer","view","byteOffset","GangAuthentication","credentialId","clientData","authenticatorData","signature","clientDataJSON","GangAuthenticationCredential","id","transports","GangPublicKey","keyType","algorithm","cbor","p","isView","GangCredentialRegistration","publicKey","challenge","authData","idLength","getInt16","NO_RETRY","RETRY_INIT","RETRY_MAX","GangCommandWrapper","sn","rsn","GangConnectionState","GangEventTypes","GangWebSocket","parse","send","close","onMessage","GANG_COMMAND_TIMEDOUT","GANG_COMMAND_TIMEOUT_DEFAULT_MS","GangCommandTypes","GangNotificationTypes","GangService","connectionState","connectionSubject","connected","webSocketFactory","settings","GangContext","defaultSettings","initialState","retry","retryingIn","unsentCommands","onConnection","disconnected","onConnectionRetry","connectionRetrySubject","onAuthenticated","authenticatedSubject","onMemberConnected","memberConnectedSubject","onMemberDisconnected","memberDisconnectedSubject","onCommand","commandSubject","onReceipt","receiptSubject","onState","stateSubject","connect","disconnect","connectionParameters","logger","connecting","connectionUrlBuilder","rootUrl","properties","gangId","token","connectionUrl","retryConnect","retrying","setInterval","clearRetryConnect","clearInterval","webSocket","wrapper","sendCommandWrapper","online","offline","reason","memberId","auth","application","authenticate","Member","Denied","MemberConnected","MemberDisconnected","Command","CommandReceipt","w","State","isAuthenticated","wait","setState","mapEvents","component","subs","componentKey","serviceKey","sub","mapActions","actions","executeCommand","sendCommand","emptySent","JSON","stringify","commands","receipts","sendState","a","sna","waitForCommand","predicate","waitForState","s","USER_ID_KEY","USER_TOKEN_KEY","GangAuthenticationService","http","credentials","vault","_platform","hasAuthenticator","PublicKeyCredential","isUserVerifyingPlatformAuthenticatorAvailable","platform","requestLink","email","headers","body","tryGetLinkCodeFromUrl","parameterName","urlBuilder","code","validateLink","tryGetChallenge","registerCredential","tokenData","decodeToken","userId","rp","app","user","displayName","pubKeyCredParams","alg","authenticatorSelection","authenticatorAttachment","userVerification","requireResidentKey","residentKey","extensions","prf","eval","first","attestation","credential","response","validate","attestationObject","getTransports","credentialRegistration","Authorization","extensionResults","getClientExtensionResults","seed","results","setSeed","setEncrypted","validateCredential","allowCredentials","navigator","onLine","validation","getEncrypted","challengeString","tokenParts","parseGangEvent","json","createGangWebSocket","onOpen","onError","onClose","WebSocket","binaryType","onopen","onmessage","onerror","onclose","GangVault","keyParameters","getCryptoKey","cryptoKey","setCryptoKey","execute","func","open","indexedDB","onupgradeneeded","createObjectStore","store","onsuccess","db","tx","transaction","objectStore","oncomplete","deleteCryptoKey","subtle","generateKey","getDefault","decrypt","iv","tagLength","additionalData","put","encrypt","service","_service","createService","_auth","authRootPath","_vault"],"sources":["@stencil/core/internal/app-data","node_modules/@stencil/core/internal/client/index.js?app-data=conditional","../GangJs/Core/dist/logging/GangLogLevel.js","../GangJs/Core/dist/logging/gangNoOpLogger.js","../GangJs/Core/dist/services/GangHttp.js","../GangJs/Core/dist/services/GangLocationService.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/util/isFunction.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/util/createErrorClass.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/util/UnsubscriptionError.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/util/arrRemove.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/Subscription.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/config.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/scheduler/timeoutProvider.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/util/reportUnhandledError.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/util/noop.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/NotificationFactories.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/util/errorContext.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/Subscriber.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/symbol/observable.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/util/identity.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/util/pipe.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/Observable.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/util/ObjectUnsubscribedError.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/Subject.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/BehaviorSubject.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/scheduler/dateTimestampProvider.js","../GangJs/Core/node_modules/rxjs/dist/esm/internal/ReplaySubject.js","../GangJs/Core/dist/services/utils/base64UrlToBytes.js","../GangJs/Core/dist/services/utils/bytesToString.js","../GangJs/Core/dist/services/utils/bytesToBase64Url.js","../GangJs/Core/dist/services/utils/cbor.js","../GangJs/Core/dist/services/utils/clean.js","../GangJs/Core/dist/services/utils/GangUrlBuilder.js","../GangJs/Core/dist/services/utils/getGangId.js","../GangJs/Core/dist/services/utils/getRandomBytes.js","../GangJs/Core/dist/services/utils/readString.js","../GangJs/Core/dist/services/utils/readUint32.js","../GangJs/Core/dist/services/utils/stringToBytes.js","../GangJs/Core/dist/services/utils/viewToBuffer.js","../GangJs/Core/dist/models/authentication/GangAuthentication.js","../GangJs/Core/dist/models/authentication/GangAuthenticationCredential.js","../GangJs/Core/dist/models/authentication/GangPublicKey.js","../GangJs/Core/dist/models/authentication/GangCredentialRegistration.js","../GangJs/Core/dist/models/communications/constants.js","../GangJs/Core/dist/models/communications/GangCommandWrapper.js","../GangJs/Core/dist/models/communications/GangConnectionState.js","../GangJs/Core/dist/models/communications/GangEventTypes.js","../GangJs/Core/dist/models/communications/GangWebSocket.js","../GangJs/Core/dist/models/constants/GANG_COMMAND_TIMEDOUT.js","../GangJs/Core/dist/models/constants/GANG_COMMAND_TIMEOUT_DEFAULT_MS.js","../GangJs/Core/dist/models/state/GangCommands.js","../GangJs/Core/dist/models/state/GangNotificationTypes.js","../GangJs/Core/dist/services/GangService.js","../GangJs/Core/dist/services/authentication/GangAuthenticationService.js","../GangJs/Core/dist/services/communications/parseGangEvent.js","../GangJs/Core/dist/services/communications/createGangWebSocket.js","../GangJs/Core/dist/services/storage/GangVault.js","../GangJs/Core/dist/context.js"],"sourcesContent":["export const NAMESPACE = 'app';\nexport const BUILD = /* app */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: \"hydrated\", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: false, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };\nexport const Env = /* app */ {};\n","/*\n Stencil Client Platform v4.27.1 | MIT Licensed | https://stenciljs.com\n */\nvar __defProp = Object.defineProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\n\n// src/client/client-build.ts\nimport { BUILD } from \"@stencil/core/internal/app-data\";\nvar Build = {\n isDev: BUILD.isDev ? true : false,\n isBrowser: true,\n isServer: false,\n isTesting: BUILD.isTesting ? true : false\n};\n\n// src/client/client-host-ref.ts\nimport { BUILD as BUILD3 } from \"@stencil/core/internal/app-data\";\n\n// src/utils/es2022-rewire-class-members.ts\nimport { BUILD as BUILD2 } from \"@stencil/core/internal/app-data\";\n\n// src/utils/constants.ts\nvar SVG_NS = \"http://www.w3.org/2000/svg\";\nvar HTML_NS = \"http://www.w3.org/1999/xhtml\";\n\n// src/utils/es2022-rewire-class-members.ts\nvar reWireGetterSetter = (instance, hostRef) => {\n var _a;\n const cmpMeta = hostRef.$cmpMeta$;\n const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});\n members.map(([memberName, [memberFlags]]) => {\n if ((BUILD2.state || BUILD2.prop) && (memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {\n const ogValue = instance[memberName];\n const ogDescriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(instance), memberName);\n Object.defineProperty(instance, memberName, {\n get() {\n return ogDescriptor.get.call(this);\n },\n set(newValue) {\n ogDescriptor.set.call(this, newValue);\n },\n configurable: true,\n enumerable: true\n });\n instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;\n }\n });\n};\n\n// src/client/client-host-ref.ts\nvar getHostRef = (ref) => {\n if (ref.__stencil__getHostRef) {\n return ref.__stencil__getHostRef();\n }\n return void 0;\n};\nvar registerInstance = (lazyInstance, hostRef) => {\n lazyInstance.__stencil__getHostRef = () => hostRef;\n hostRef.$lazyInstance$ = lazyInstance;\n if (BUILD3.modernPropertyDecls && (BUILD3.state || BUILD3.prop)) {\n reWireGetterSetter(lazyInstance, hostRef);\n }\n};\nvar registerHost = (hostElement, cmpMeta) => {\n const hostRef = {\n $flags$: 0,\n $hostElement$: hostElement,\n $cmpMeta$: cmpMeta,\n $instanceValues$: /* @__PURE__ */ new Map()\n };\n if (BUILD3.isDev) {\n hostRef.$renderCount$ = 0;\n }\n if (BUILD3.method && BUILD3.lazyLoad) {\n hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);\n }\n if (BUILD3.asyncLoading) {\n hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);\n hostElement[\"s-p\"] = [];\n hostElement[\"s-rc\"] = [];\n }\n const ref = hostRef;\n hostElement.__stencil__getHostRef = () => ref;\n if (!BUILD3.lazyLoad && BUILD3.modernPropertyDecls && (BUILD3.state || BUILD3.prop)) {\n reWireGetterSetter(hostElement, hostRef);\n }\n return ref;\n};\nvar isMemberInElement = (elm, memberName) => memberName in elm;\n\n// src/client/client-load-module.ts\nimport { BUILD as BUILD5 } from \"@stencil/core/internal/app-data\";\n\n// src/client/client-log.ts\nimport { BUILD as BUILD4 } from \"@stencil/core/internal/app-data\";\nvar customError;\nvar consoleError = (e, el) => (customError || console.error)(e, el);\nvar STENCIL_DEV_MODE = BUILD4.isTesting ? [\"STENCIL:\"] : [\n \"%cstencil\",\n \"color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px\"\n];\nvar consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);\nvar consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);\nvar consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);\nvar setErrorHandler = (handler) => customError = handler;\n\n// src/client/client-load-module.ts\nvar cmpModules = /* @__PURE__ */ new Map();\nvar MODULE_IMPORT_PREFIX = \"./\";\nvar loadModule = (cmpMeta, hostRef, hmrVersionId) => {\n const exportName = cmpMeta.$tagName$.replace(/-/g, \"_\");\n const bundleId = cmpMeta.$lazyBundleId$;\n if (BUILD5.isDev && typeof bundleId !== \"string\") {\n consoleDevError(\n `Trying to lazily load component <${cmpMeta.$tagName$}> with style mode \"${hostRef.$modeName$}\", but it does not exist.`\n );\n return void 0;\n } else if (!bundleId) {\n return void 0;\n }\n const module = !BUILD5.hotModuleReplacement ? cmpModules.get(bundleId) : false;\n if (module) {\n return module[exportName];\n }\n /*!__STENCIL_STATIC_IMPORT_SWITCH__*/\n return import(\n /* @vite-ignore */\n /* webpackInclude: /\\.entry\\.js$/ */\n /* webpackExclude: /\\.system\\.entry\\.js$/ */\n /* webpackMode: \"lazy\" */\n `./${bundleId}.entry.js${BUILD5.hotModuleReplacement && hmrVersionId ? \"?s-hmr=\" + hmrVersionId : \"\"}`\n ).then(\n (importedModule) => {\n if (!BUILD5.hotModuleReplacement) {\n cmpModules.set(bundleId, importedModule);\n }\n return importedModule[exportName];\n },\n (e) => {\n consoleError(e, hostRef.$hostElement$);\n }\n );\n};\n\n// src/client/client-style.ts\nvar styles = /* @__PURE__ */ new Map();\nvar modeResolutionChain = [];\n\n// src/client/client-task-queue.ts\nimport { BUILD as BUILD7 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/runtime-constants.ts\nvar CONTENT_REF_ID = \"r\";\nvar ORG_LOCATION_ID = \"o\";\nvar SLOT_NODE_ID = \"s\";\nvar TEXT_NODE_ID = \"t\";\nvar COMMENT_NODE_ID = \"c\";\nvar HYDRATE_ID = \"s-id\";\nvar HYDRATED_STYLE_ID = \"sty-id\";\nvar HYDRATE_CHILD_ID = \"c-id\";\nvar HYDRATED_CSS = \"{visibility:hidden}.hydrated{visibility:inherit}\";\nvar STENCIL_DOC_DATA = \"_stencilDocData\";\nvar DEFAULT_DOC_DATA = {\n hostIds: 0,\n rootLevelIds: 0,\n staticComponents: /* @__PURE__ */ new Set()\n};\nvar SLOT_FB_CSS = \"slot-fb{display:contents}slot-fb[hidden]{display:none}\";\nvar XLINK_NS = \"http://www.w3.org/1999/xlink\";\nvar FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [\n \"formAssociatedCallback\",\n \"formResetCallback\",\n \"formDisabledCallback\",\n \"formStateRestoreCallback\"\n];\n\n// src/client/client-window.ts\nimport { BUILD as BUILD6 } from \"@stencil/core/internal/app-data\";\nvar win = typeof window !== \"undefined\" ? window : {};\nvar H = win.HTMLElement || class {\n};\nvar plt = {\n $flags$: 0,\n $resourcesUrl$: \"\",\n jmp: (h2) => h2(),\n raf: (h2) => requestAnimationFrame(h2),\n ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),\n rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),\n ce: (eventName, opts) => new CustomEvent(eventName, opts)\n};\nvar setPlatformHelpers = (helpers) => {\n Object.assign(plt, helpers);\n};\nvar supportsShadow = BUILD6.shadowDom;\nvar supportsListenerOptions = /* @__PURE__ */ (() => {\n var _a;\n let supportsListenerOptions2 = false;\n try {\n (_a = win.document) == null ? void 0 : _a.addEventListener(\n \"e\",\n null,\n Object.defineProperty({}, \"passive\", {\n get() {\n supportsListenerOptions2 = true;\n }\n })\n );\n } catch (e) {\n }\n return supportsListenerOptions2;\n})();\nvar promiseResolve = (v) => Promise.resolve(v);\nvar supportsConstructableStylesheets = BUILD6.constructableCSS ? /* @__PURE__ */ (() => {\n try {\n new CSSStyleSheet();\n return typeof new CSSStyleSheet().replaceSync === \"function\";\n } catch (e) {\n }\n return false;\n})() : false;\n\n// src/client/client-task-queue.ts\nvar queueCongestion = 0;\nvar queuePending = false;\nvar queueDomReads = [];\nvar queueDomWrites = [];\nvar queueDomWritesLow = [];\nvar queueTask = (queue, write) => (cb) => {\n queue.push(cb);\n if (!queuePending) {\n queuePending = true;\n if (write && plt.$flags$ & 4 /* queueSync */) {\n nextTick(flush);\n } else {\n plt.raf(flush);\n }\n }\n};\nvar consume = (queue) => {\n for (let i2 = 0; i2 < queue.length; i2++) {\n try {\n queue[i2](performance.now());\n } catch (e) {\n consoleError(e);\n }\n }\n queue.length = 0;\n};\nvar consumeTimeout = (queue, timeout) => {\n let i2 = 0;\n let ts = 0;\n while (i2 < queue.length && (ts = performance.now()) < timeout) {\n try {\n queue[i2++](ts);\n } catch (e) {\n consoleError(e);\n }\n }\n if (i2 === queue.length) {\n queue.length = 0;\n } else if (i2 !== 0) {\n queue.splice(0, i2);\n }\n};\nvar flush = () => {\n if (BUILD7.asyncQueue) {\n queueCongestion++;\n }\n consume(queueDomReads);\n if (BUILD7.asyncQueue) {\n const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : Infinity;\n consumeTimeout(queueDomWrites, timeout);\n consumeTimeout(queueDomWritesLow, timeout);\n if (queueDomWrites.length > 0) {\n queueDomWritesLow.push(...queueDomWrites);\n queueDomWrites.length = 0;\n }\n if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {\n plt.raf(flush);\n } else {\n queueCongestion = 0;\n }\n } else {\n consume(queueDomWrites);\n if (queuePending = queueDomReads.length > 0) {\n plt.raf(flush);\n }\n }\n};\nvar nextTick = (cb) => promiseResolve().then(cb);\nvar readTask = /* @__PURE__ */ queueTask(queueDomReads, false);\nvar writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);\n\n// src/client/index.ts\nimport { BUILD as BUILD29, Env, NAMESPACE as NAMESPACE2 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/asset-path.ts\nvar getAssetPath = (path) => {\n const assetUrl = new URL(path, plt.$resourcesUrl$);\n return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;\n};\nvar setAssetPath = (path) => plt.$resourcesUrl$ = path;\n\n// src/runtime/bootstrap-custom-element.ts\nimport { BUILD as BUILD26 } from \"@stencil/core/internal/app-data\";\n\n// src/utils/helpers.ts\nvar isDef = (v) => v != null && v !== void 0;\nvar isComplexType = (o) => {\n o = typeof o;\n return o === \"object\" || o === \"function\";\n};\n\n// src/utils/query-nonce-meta-tag-content.ts\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) == null ? void 0 : _b.getAttribute(\"content\")) != null ? _c : void 0;\n}\n\n// src/utils/regular-expression.ts\nvar escapeRegExpSpecialCharacters = (text) => {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n};\n\n// src/utils/result.ts\nvar result_exports = {};\n__export(result_exports, {\n err: () => err,\n map: () => map,\n ok: () => ok,\n unwrap: () => unwrap,\n unwrapErr: () => unwrapErr\n});\nvar ok = (value) => ({\n isOk: true,\n isErr: false,\n value\n});\nvar err = (value) => ({\n isOk: false,\n isErr: true,\n value\n});\nfunction map(result, fn) {\n if (result.isOk) {\n const val = fn(result.value);\n if (val instanceof Promise) {\n return val.then((newVal) => ok(newVal));\n } else {\n return ok(val);\n }\n }\n if (result.isErr) {\n const value = result.value;\n return err(value);\n }\n throw \"should never get here\";\n}\nvar unwrap = (result) => {\n if (result.isOk) {\n return result.value;\n } else {\n throw result.value;\n }\n};\nvar unwrapErr = (result) => {\n if (result.isErr) {\n return result.value;\n } else {\n throw result.value;\n }\n};\n\n// src/runtime/connected-callback.ts\nimport { BUILD as BUILD24 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/client-hydrate.ts\nimport { BUILD as BUILD12 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/dom-extras.ts\nimport { BUILD as BUILD9 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/slot-polyfill-utils.ts\nimport { BUILD as BUILD8 } from \"@stencil/core/internal/app-data\";\nvar updateFallbackSlotVisibility = (elm) => {\n const childNodes = internalCall(elm, \"childNodes\");\n if (elm.tagName && elm.tagName.includes(\"-\") && elm[\"s-cr\"] && elm.tagName !== \"SLOT-FB\") {\n getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {\n if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === \"SLOT-FB\") {\n if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {\n slotNode.hidden = true;\n } else {\n slotNode.hidden = false;\n }\n }\n });\n }\n let i2 = 0;\n for (i2 = 0; i2 < childNodes.length; i2++) {\n const childNode = childNodes[i2];\n if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, \"childNodes\").length) {\n updateFallbackSlotVisibility(childNode);\n }\n }\n};\nvar getSlottedChildNodes = (childNodes) => {\n const result = [];\n for (let i2 = 0; i2 < childNodes.length; i2++) {\n const slottedNode = childNodes[i2][\"s-nr\"] || void 0;\n if (slottedNode && slottedNode.isConnected) {\n result.push(slottedNode);\n }\n }\n return result;\n};\nfunction getHostSlotNodes(childNodes, hostName, slotName) {\n let i2 = 0;\n let slottedNodes = [];\n let childNode;\n for (; i2 < childNodes.length; i2++) {\n childNode = childNodes[i2];\n if (childNode[\"s-sr\"] && (!hostName || childNode[\"s-hn\"] === hostName) && (slotName === void 0 || getSlotName(childNode) === slotName)) {\n slottedNodes.push(childNode);\n if (typeof slotName !== \"undefined\") return slottedNodes;\n }\n slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];\n }\n return slottedNodes;\n}\nvar getSlotChildSiblings = (slot, slotName, includeSlot = true) => {\n const childNodes = [];\n if (includeSlot && slot[\"s-sr\"] || !slot[\"s-sr\"]) childNodes.push(slot);\n let node = slot;\n while (node = node.nextSibling) {\n if (getSlotName(node) === slotName && (includeSlot || !node[\"s-sr\"])) childNodes.push(node);\n }\n return childNodes;\n};\nvar isNodeLocatedInSlot = (nodeToRelocate, slotName) => {\n if (nodeToRelocate.nodeType === 1 /* ElementNode */) {\n if (nodeToRelocate.getAttribute(\"slot\") === null && slotName === \"\") {\n return true;\n }\n if (nodeToRelocate.getAttribute(\"slot\") === slotName) {\n return true;\n }\n return false;\n }\n if (nodeToRelocate[\"s-sn\"] === slotName) {\n return true;\n }\n return slotName === \"\";\n};\nvar addSlotRelocateNode = (newChild, slotNode, prepend, position) => {\n if (newChild[\"s-ol\"] && newChild[\"s-ol\"].isConnected) {\n return;\n }\n const slottedNodeLocation = document.createTextNode(\"\");\n slottedNodeLocation[\"s-nr\"] = newChild;\n if (!slotNode[\"s-cr\"] || !slotNode[\"s-cr\"].parentNode) return;\n const parent = slotNode[\"s-cr\"].parentNode;\n const appendMethod = prepend ? internalCall(parent, \"prepend\") : internalCall(parent, \"appendChild\");\n if (BUILD8.hydrateClientSide && typeof position !== \"undefined\") {\n slottedNodeLocation[\"s-oo\"] = position;\n const childNodes = internalCall(parent, \"childNodes\");\n const slotRelocateNodes = [slottedNodeLocation];\n childNodes.forEach((n) => {\n if (n[\"s-nr\"]) slotRelocateNodes.push(n);\n });\n slotRelocateNodes.sort((a, b) => {\n if (!a[\"s-oo\"] || a[\"s-oo\"] < (b[\"s-oo\"] || 0)) return -1;\n else if (!b[\"s-oo\"] || b[\"s-oo\"] < a[\"s-oo\"]) return 1;\n return 0;\n });\n slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));\n } else {\n appendMethod.call(parent, slottedNodeLocation);\n }\n newChild[\"s-ol\"] = slottedNodeLocation;\n newChild[\"s-sh\"] = slotNode[\"s-hn\"];\n};\nvar getSlotName = (node) => typeof node[\"s-sn\"] === \"string\" ? node[\"s-sn\"] : node.nodeType === 1 && node.getAttribute(\"slot\") || void 0;\nfunction patchSlotNode(node) {\n if (node.assignedElements || node.assignedNodes || !node[\"s-sr\"]) return;\n const assignedFactory = (elementsOnly) => (function(opts) {\n const toReturn = [];\n const slotName = this[\"s-sn\"];\n if (opts == null ? void 0 : opts.flatten) {\n console.error(`\n Flattening is not supported for Stencil non-shadow slots. \n You can use \\`.childNodes\\` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n `);\n }\n const parent = this[\"s-cr\"].parentElement;\n const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);\n slottedNodes.forEach((n) => {\n if (slotName === getSlotName(n)) {\n toReturn.push(n);\n }\n });\n if (elementsOnly) {\n return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);\n }\n return toReturn;\n }).bind(node);\n node.assignedElements = assignedFactory(true);\n node.assignedNodes = assignedFactory(false);\n}\nfunction dispatchSlotChangeEvent(elm) {\n elm.dispatchEvent(new CustomEvent(\"slotchange\", { bubbles: false, cancelable: false, composed: false }));\n}\nfunction findSlotFromSlottedNode(slottedNode, parentHost) {\n var _a;\n parentHost = parentHost || ((_a = slottedNode[\"s-ol\"]) == null ? void 0 : _a.parentElement);\n if (!parentHost) return { slotNode: null, slotName: \"\" };\n const slotName = slottedNode[\"s-sn\"] = getSlotName(slottedNode) || \"\";\n const childNodes = internalCall(parentHost, \"childNodes\");\n const slotNode = getHostSlotNodes(childNodes, parentHost.tagName, slotName)[0];\n return { slotNode, slotName };\n}\n\n// src/runtime/dom-extras.ts\nvar patchPseudoShadowDom = (hostElementPrototype) => {\n patchCloneNode(hostElementPrototype);\n patchSlotAppendChild(hostElementPrototype);\n patchSlotAppend(hostElementPrototype);\n patchSlotPrepend(hostElementPrototype);\n patchSlotInsertAdjacentElement(hostElementPrototype);\n patchSlotInsertAdjacentHTML(hostElementPrototype);\n patchSlotInsertAdjacentText(hostElementPrototype);\n patchInsertBefore(hostElementPrototype);\n patchTextContent(hostElementPrototype);\n patchChildSlotNodes(hostElementPrototype);\n patchSlotRemoveChild(hostElementPrototype);\n};\nvar patchCloneNode = (HostElementPrototype) => {\n const orgCloneNode = HostElementPrototype.cloneNode;\n HostElementPrototype.cloneNode = function(deep) {\n const srcNode = this;\n const isShadowDom = BUILD9.shadowDom ? srcNode.shadowRoot && supportsShadow : false;\n const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);\n if (BUILD9.slot && !isShadowDom && deep) {\n let i2 = 0;\n let slotted, nonStencilNode;\n const stencilPrivates = [\n \"s-id\",\n \"s-cr\",\n \"s-lr\",\n \"s-rc\",\n \"s-sc\",\n \"s-p\",\n \"s-cn\",\n \"s-sr\",\n \"s-sn\",\n \"s-hn\",\n \"s-ol\",\n \"s-nr\",\n \"s-si\",\n \"s-rf\",\n \"s-scs\"\n ];\n const childNodes = this.__childNodes || this.childNodes;\n for (; i2 < childNodes.length; i2++) {\n slotted = childNodes[i2][\"s-nr\"];\n nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);\n if (slotted) {\n if (BUILD9.appendChildSlotFix && clonedNode.__appendChild) {\n clonedNode.__appendChild(slotted.cloneNode(true));\n } else {\n clonedNode.appendChild(slotted.cloneNode(true));\n }\n }\n if (nonStencilNode) {\n clonedNode.appendChild(childNodes[i2].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nvar patchSlotAppendChild = (HostElementPrototype) => {\n HostElementPrototype.__appendChild = HostElementPrototype.appendChild;\n HostElementPrototype.appendChild = function(newChild) {\n const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);\n if (slotNode) {\n addSlotRelocateNode(newChild, slotNode);\n const slotChildNodes = getSlotChildSiblings(slotNode, slotName);\n const appendAfter = slotChildNodes[slotChildNodes.length - 1];\n const parent = internalCall(appendAfter, \"parentNode\");\n const insertedNode = internalCall(parent, \"insertBefore\")(newChild, appendAfter.nextSibling);\n dispatchSlotChangeEvent(slotNode);\n updateFallbackSlotVisibility(this);\n return insertedNode;\n }\n return this.__appendChild(newChild);\n };\n};\nvar patchSlotRemoveChild = (ElementPrototype) => {\n ElementPrototype.__removeChild = ElementPrototype.removeChild;\n ElementPrototype.removeChild = function(toRemove) {\n if (toRemove && typeof toRemove[\"s-sn\"] !== \"undefined\") {\n const childNodes = this.__childNodes || this.childNodes;\n const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove[\"s-sn\"]);\n if (slotNode && toRemove.isConnected) {\n toRemove.remove();\n updateFallbackSlotVisibility(this);\n return;\n }\n }\n return this.__removeChild(toRemove);\n };\n};\nvar patchSlotPrepend = (HostElementPrototype) => {\n HostElementPrototype.__prepend = HostElementPrototype.prepend;\n HostElementPrototype.prepend = function(...newChildren) {\n newChildren.forEach((newChild) => {\n if (typeof newChild === \"string\") {\n newChild = this.ownerDocument.createTextNode(newChild);\n }\n const slotName = (newChild[\"s-sn\"] = getSlotName(newChild)) || \"\";\n const childNodes = internalCall(this, \"childNodes\");\n const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];\n if (slotNode) {\n addSlotRelocateNode(newChild, slotNode, true);\n const slotChildNodes = getSlotChildSiblings(slotNode, slotName);\n const appendAfter = slotChildNodes[0];\n const parent = internalCall(appendAfter, \"parentNode\");\n const toReturn = internalCall(parent, \"insertBefore\")(newChild, internalCall(appendAfter, \"nextSibling\"));\n dispatchSlotChangeEvent(slotNode);\n return toReturn;\n }\n if (newChild.nodeType === 1 && !!newChild.getAttribute(\"slot\")) {\n newChild.hidden = true;\n }\n return HostElementPrototype.__prepend(newChild);\n });\n };\n};\nvar patchSlotAppend = (HostElementPrototype) => {\n HostElementPrototype.__append = HostElementPrototype.append;\n HostElementPrototype.append = function(...newChildren) {\n newChildren.forEach((newChild) => {\n if (typeof newChild === \"string\") {\n newChild = this.ownerDocument.createTextNode(newChild);\n }\n this.appendChild(newChild);\n });\n };\n};\nvar patchSlotInsertAdjacentHTML = (HostElementPrototype) => {\n const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;\n HostElementPrototype.insertAdjacentHTML = function(position, text) {\n if (position !== \"afterbegin\" && position !== \"beforeend\") {\n return originalInsertAdjacentHtml.call(this, position, text);\n }\n const container = this.ownerDocument.createElement(\"_\");\n let node;\n container.innerHTML = text;\n if (position === \"afterbegin\") {\n while (node = container.firstChild) {\n this.prepend(node);\n }\n } else if (position === \"beforeend\") {\n while (node = container.firstChild) {\n this.append(node);\n }\n }\n };\n};\nvar patchSlotInsertAdjacentText = (HostElementPrototype) => {\n HostElementPrototype.insertAdjacentText = function(position, text) {\n this.insertAdjacentHTML(position, text);\n };\n};\nvar patchInsertBefore = (HostElementPrototype) => {\n const eleProto = HostElementPrototype;\n if (eleProto.__insertBefore) return;\n eleProto.__insertBefore = HostElementPrototype.insertBefore;\n HostElementPrototype.insertBefore = function(newChild, currentChild) {\n const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);\n const slottedNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);\n if (slotNode) {\n let found = false;\n slottedNodes.forEach((childNode) => {\n if (childNode === currentChild || currentChild === null) {\n found = true;\n if (currentChild === null || slotName !== currentChild[\"s-sn\"]) {\n this.appendChild(newChild);\n return;\n }\n if (slotName === currentChild[\"s-sn\"]) {\n addSlotRelocateNode(newChild, slotNode);\n const parent = internalCall(currentChild, \"parentNode\");\n internalCall(parent, \"insertBefore\")(newChild, currentChild);\n dispatchSlotChangeEvent(slotNode);\n }\n return;\n }\n });\n if (found) return newChild;\n }\n const parentNode = currentChild == null ? void 0 : currentChild.__parentNode;\n if (parentNode && !this.isSameNode(parentNode)) {\n return this.appendChild(newChild);\n }\n return this.__insertBefore(newChild, currentChild);\n };\n};\nvar patchSlotInsertAdjacentElement = (HostElementPrototype) => {\n const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;\n HostElementPrototype.insertAdjacentElement = function(position, element) {\n if (position !== \"afterbegin\" && position !== \"beforeend\") {\n return originalInsertAdjacentElement.call(this, position, element);\n }\n if (position === \"afterbegin\") {\n this.prepend(element);\n return element;\n } else if (position === \"beforeend\") {\n this.append(element);\n return element;\n }\n return element;\n };\n};\nvar patchTextContent = (hostElementPrototype) => {\n patchHostOriginalAccessor(\"textContent\", hostElementPrototype);\n Object.defineProperty(hostElementPrototype, \"textContent\", {\n get: function() {\n let text = \"\";\n const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);\n childNodes.forEach((node) => text += node.textContent || \"\");\n return text;\n },\n set: function(value) {\n const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);\n childNodes.forEach((node) => {\n if (node[\"s-ol\"]) node[\"s-ol\"].remove();\n node.remove();\n });\n this.insertAdjacentHTML(\"beforeend\", value);\n }\n });\n};\nvar patchChildSlotNodes = (elm) => {\n class FakeNodeList extends Array {\n item(n) {\n return this[n];\n }\n }\n patchHostOriginalAccessor(\"children\", elm);\n Object.defineProperty(elm, \"children\", {\n get() {\n return this.childNodes.filter((n) => n.nodeType === 1);\n }\n });\n Object.defineProperty(elm, \"childElementCount\", {\n get() {\n return this.children.length;\n }\n });\n patchHostOriginalAccessor(\"firstChild\", elm);\n Object.defineProperty(elm, \"firstChild\", {\n get() {\n return this.childNodes[0];\n }\n });\n patchHostOriginalAccessor(\"lastChild\", elm);\n Object.defineProperty(elm, \"lastChild\", {\n get() {\n return this.childNodes[this.childNodes.length - 1];\n }\n });\n patchHostOriginalAccessor(\"childNodes\", elm);\n Object.defineProperty(elm, \"childNodes\", {\n get() {\n const result = new FakeNodeList();\n result.push(...getSlottedChildNodes(this.__childNodes));\n return result;\n }\n });\n};\nvar patchSlottedNode = (node) => {\n if (!node || node.__nextSibling !== void 0 || !globalThis.Node) return;\n patchNextSibling(node);\n patchPreviousSibling(node);\n patchParentNode(node);\n if (node.nodeType === Node.ELEMENT_NODE) {\n patchNextElementSibling(node);\n patchPreviousElementSibling(node);\n }\n};\nvar patchNextSibling = (node) => {\n if (!node || node.__nextSibling) return;\n patchHostOriginalAccessor(\"nextSibling\", node);\n Object.defineProperty(node, \"nextSibling\", {\n get: function() {\n var _a;\n const parentNodes = (_a = this[\"s-ol\"]) == null ? void 0 : _a.parentNode.childNodes;\n const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);\n if (parentNodes && index > -1) {\n return parentNodes[index + 1];\n }\n return this.__nextSibling;\n }\n });\n};\nvar patchNextElementSibling = (element) => {\n if (!element || element.__nextElementSibling) return;\n patchHostOriginalAccessor(\"nextElementSibling\", element);\n Object.defineProperty(element, \"nextElementSibling\", {\n get: function() {\n var _a;\n const parentEles = (_a = this[\"s-ol\"]) == null ? void 0 : _a.parentNode.children;\n const index = parentEles == null ? void 0 : parentEles.indexOf(this);\n if (parentEles && index > -1) {\n return parentEles[index + 1];\n }\n return this.__nextElementSibling;\n }\n });\n};\nvar patchPreviousSibling = (node) => {\n if (!node || node.__previousSibling) return;\n patchHostOriginalAccessor(\"previousSibling\", node);\n Object.defineProperty(node, \"previousSibling\", {\n get: function() {\n var _a;\n const parentNodes = (_a = this[\"s-ol\"]) == null ? void 0 : _a.parentNode.childNodes;\n const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);\n if (parentNodes && index > -1) {\n return parentNodes[index - 1];\n }\n return this.__previousSibling;\n }\n });\n};\nvar patchPreviousElementSibling = (element) => {\n if (!element || element.__previousElementSibling) return;\n patchHostOriginalAccessor(\"previousElementSibling\", element);\n Object.defineProperty(element, \"previousElementSibling\", {\n get: function() {\n var _a;\n const parentNodes = (_a = this[\"s-ol\"]) == null ? void 0 : _a.parentNode.children;\n const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);\n if (parentNodes && index > -1) {\n return parentNodes[index - 1];\n }\n return this.__previousElementSibling;\n }\n });\n};\nvar patchParentNode = (node) => {\n if (!node || node.__parentNode) return;\n patchHostOriginalAccessor(\"parentNode\", node);\n Object.defineProperty(node, \"parentNode\", {\n get: function() {\n var _a;\n return ((_a = this[\"s-ol\"]) == null ? void 0 : _a.parentNode) || this.__parentNode;\n },\n set: function(value) {\n this.__parentNode = value;\n }\n });\n};\nvar validElementPatches = [\"children\", \"nextElementSibling\", \"previousElementSibling\"];\nvar validNodesPatches = [\n \"childNodes\",\n \"firstChild\",\n \"lastChild\",\n \"nextSibling\",\n \"previousSibling\",\n \"textContent\",\n \"parentNode\"\n];\nfunction patchHostOriginalAccessor(accessorName, node) {\n let accessor;\n if (validElementPatches.includes(accessorName)) {\n accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);\n } else if (validNodesPatches.includes(accessorName)) {\n accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);\n }\n if (!accessor) {\n accessor = Object.getOwnPropertyDescriptor(node, accessorName);\n }\n if (accessor) Object.defineProperty(node, \"__\" + accessorName, accessor);\n}\nfunction internalCall(node, method) {\n if (\"__\" + method in node) {\n const toReturn = node[\"__\" + method];\n if (typeof toReturn !== \"function\") return toReturn;\n return toReturn.bind(node);\n } else {\n if (typeof node[method] !== \"function\") return node[method];\n return node[method].bind(node);\n }\n}\n\n// src/runtime/profile.ts\nimport { BUILD as BUILD10 } from \"@stencil/core/internal/app-data\";\nvar i = 0;\nvar createTime = (fnName, tagName = \"\") => {\n if (BUILD10.profile && performance.mark) {\n const key = `st:${fnName}:${tagName}:${i++}`;\n performance.mark(key);\n return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);\n } else {\n return () => {\n return;\n };\n }\n};\nvar uniqueTime = (key, measureText) => {\n if (BUILD10.profile && performance.mark) {\n if (performance.getEntriesByName(key, \"mark\").length === 0) {\n performance.mark(key);\n }\n return () => {\n if (performance.getEntriesByName(measureText, \"measure\").length === 0) {\n performance.measure(measureText, key);\n }\n };\n } else {\n return () => {\n return;\n };\n }\n};\nvar inspect = (ref) => {\n const hostRef = getHostRef(ref);\n if (!hostRef) {\n return void 0;\n }\n const flags = hostRef.$flags$;\n const hostElement = hostRef.$hostElement$;\n return {\n renderCount: hostRef.$renderCount$,\n flags: {\n hasRendered: !!(flags & 2 /* hasRendered */),\n hasConnected: !!(flags & 1 /* hasConnected */),\n isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),\n isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),\n isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),\n hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),\n hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),\n isWatchReady: !!(flags & 128 /* isWatchReady */),\n isListenReady: !!(flags & 256 /* isListenReady */),\n needsRerender: !!(flags & 512 /* needsRerender */)\n },\n instanceValues: hostRef.$instanceValues$,\n ancestorComponent: hostRef.$ancestorComponent$,\n hostElement,\n lazyInstance: hostRef.$lazyInstance$,\n vnode: hostRef.$vnode$,\n modeName: hostRef.$modeName$,\n onReadyPromise: hostRef.$onReadyPromise$,\n onReadyResolve: hostRef.$onReadyResolve$,\n onInstancePromise: hostRef.$onInstancePromise$,\n onInstanceResolve: hostRef.$onInstanceResolve$,\n onRenderResolve: hostRef.$onRenderResolve$,\n queuedListeners: hostRef.$queuedListeners$,\n rmListeners: hostRef.$rmListeners$,\n [\"s-id\"]: hostElement[\"s-id\"],\n [\"s-cr\"]: hostElement[\"s-cr\"],\n [\"s-lr\"]: hostElement[\"s-lr\"],\n [\"s-p\"]: hostElement[\"s-p\"],\n [\"s-rc\"]: hostElement[\"s-rc\"],\n [\"s-sc\"]: hostElement[\"s-sc\"]\n };\n};\nvar installDevTools = () => {\n if (BUILD10.devTools) {\n const stencil = win.stencil = win.stencil || {};\n const originalInspect = stencil.inspect;\n stencil.inspect = (ref) => {\n let result = inspect(ref);\n if (!result && typeof originalInspect === \"function\") {\n result = originalInspect(ref);\n }\n return result;\n };\n }\n};\n\n// src/runtime/vdom/h.ts\nimport { BUILD as BUILD11 } from \"@stencil/core/internal/app-data\";\nvar h = (nodeName, vnodeData, ...children) => {\n let child = null;\n let key = null;\n let slotName = null;\n let simple = false;\n let lastSimple = false;\n const vNodeChildren = [];\n const walk = (c) => {\n for (let i2 = 0; i2 < c.length; i2++) {\n child = c[i2];\n if (Array.isArray(child)) {\n walk(child);\n } else if (child != null && typeof child !== \"boolean\") {\n if (simple = typeof nodeName !== \"function\" && !isComplexType(child)) {\n child = String(child);\n } else if (BUILD11.isDev && typeof nodeName !== \"function\" && child.$flags$ === void 0) {\n consoleDevError(`vNode passed as children has unexpected type.\nMake sure it's using the correct h() function.\nEmpty objects can also be the cause, look for JSX comments that became objects.`);\n }\n if (simple && lastSimple) {\n vNodeChildren[vNodeChildren.length - 1].$text$ += child;\n } else {\n vNodeChildren.push(simple ? newVNode(null, child) : child);\n }\n lastSimple = simple;\n }\n }\n };\n walk(children);\n if (vnodeData) {\n if (BUILD11.isDev && nodeName === \"input\") {\n validateInputProperties(vnodeData);\n }\n if (BUILD11.vdomKey && vnodeData.key) {\n key = vnodeData.key;\n }\n if (BUILD11.slotRelocation && vnodeData.name) {\n slotName = vnodeData.name;\n }\n if (BUILD11.vdomClass) {\n const classData = vnodeData.className || vnodeData.class;\n if (classData) {\n vnodeData.class = typeof classData !== \"object\" ? classData : Object.keys(classData).filter((k) => classData[k]).join(\" \");\n }\n }\n }\n if (BUILD11.isDev && vNodeChildren.some(isHost)) {\n consoleDevError(`The must be the single root component. Make sure:\n- You are NOT using hostData() and in the same component.\n- is used once, and it's the single root component of the render() function.`);\n }\n if (BUILD11.vdomFunctional && typeof nodeName === \"function\") {\n return nodeName(\n vnodeData === null ? {} : vnodeData,\n vNodeChildren,\n vdomFnUtils\n );\n }\n const vnode = newVNode(nodeName, null);\n vnode.$attrs$ = vnodeData;\n if (vNodeChildren.length > 0) {\n vnode.$children$ = vNodeChildren;\n }\n if (BUILD11.vdomKey) {\n vnode.$key$ = key;\n }\n if (BUILD11.slotRelocation) {\n vnode.$name$ = slotName;\n }\n return vnode;\n};\nvar newVNode = (tag, text) => {\n const vnode = {\n $flags$: 0,\n $tag$: tag,\n $text$: text,\n $elm$: null,\n $children$: null\n };\n if (BUILD11.vdomAttribute) {\n vnode.$attrs$ = null;\n }\n if (BUILD11.vdomKey) {\n vnode.$key$ = null;\n }\n if (BUILD11.slotRelocation) {\n vnode.$name$ = null;\n }\n return vnode;\n};\nvar Host = {};\nvar isHost = (node) => node && node.$tag$ === Host;\nvar vdomFnUtils = {\n forEach: (children, cb) => children.map(convertToPublic).forEach(cb),\n map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)\n};\nvar convertToPublic = (node) => ({\n vattrs: node.$attrs$,\n vchildren: node.$children$,\n vkey: node.$key$,\n vname: node.$name$,\n vtag: node.$tag$,\n vtext: node.$text$\n});\nvar convertToPrivate = (node) => {\n if (typeof node.vtag === \"function\") {\n const vnodeData = { ...node.vattrs };\n if (node.vkey) {\n vnodeData.key = node.vkey;\n }\n if (node.vname) {\n vnodeData.name = node.vname;\n }\n return h(node.vtag, vnodeData, ...node.vchildren || []);\n }\n const vnode = newVNode(node.vtag, node.vtext);\n vnode.$attrs$ = node.vattrs;\n vnode.$children$ = node.vchildren;\n vnode.$key$ = node.vkey;\n vnode.$name$ = node.vname;\n return vnode;\n};\nvar validateInputProperties = (inputElm) => {\n const props = Object.keys(inputElm);\n const value = props.indexOf(\"value\");\n if (value === -1) {\n return;\n }\n const typeIndex = props.indexOf(\"type\");\n const minIndex = props.indexOf(\"min\");\n const maxIndex = props.indexOf(\"max\");\n const stepIndex = props.indexOf(\"step\");\n if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {\n consoleDevWarn(`The \"value\" prop of should be set after \"min\", \"max\", \"type\" and \"step\"`);\n }\n};\n\n// src/runtime/client-hydrate.ts\nvar initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {\n const endHydrate = createTime(\"hydrateClient\", tagName);\n const shadowRoot = hostElm.shadowRoot;\n const childRenderNodes = [];\n const slotNodes = [];\n const slottedNodes = [];\n const shadowRootNodes = BUILD12.shadowDom && shadowRoot ? [] : null;\n const vnode = newVNode(tagName, null);\n vnode.$elm$ = hostElm;\n let scopeId2;\n if (BUILD12.scoped) {\n const cmpMeta = hostRef.$cmpMeta$;\n if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm[\"s-sc\"]) {\n scopeId2 = hostElm[\"s-sc\"];\n hostElm.classList.add(scopeId2 + \"-h\");\n } else if (hostElm[\"s-sc\"]) {\n delete hostElm[\"s-sc\"];\n }\n }\n if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {\n initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());\n }\n hostElm[HYDRATE_ID] = hostId;\n hostElm.removeAttribute(HYDRATE_ID);\n hostRef.$vnode$ = clientHydrate(\n vnode,\n childRenderNodes,\n slotNodes,\n shadowRootNodes,\n hostElm,\n hostElm,\n hostId,\n slottedNodes\n );\n let crIndex = 0;\n const crLength = childRenderNodes.length;\n let childRenderNode;\n for (crIndex; crIndex < crLength; crIndex++) {\n childRenderNode = childRenderNodes[crIndex];\n const orgLocationId = childRenderNode.$hostId$ + \".\" + childRenderNode.$nodeId$;\n const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);\n const node = childRenderNode.$elm$;\n if (!shadowRoot) {\n node[\"s-hn\"] = tagName.toUpperCase();\n if (childRenderNode.$tag$ === \"slot\") {\n node[\"s-cr\"] = hostElm[\"s-cr\"];\n }\n }\n if (childRenderNode.$tag$ === \"slot\") {\n childRenderNode.$name$ = childRenderNode.$elm$[\"s-sn\"] || childRenderNode.$elm$[\"name\"] || null;\n if (childRenderNode.$children$) {\n childRenderNode.$flags$ |= 2 /* isSlotFallback */;\n if (!childRenderNode.$elm$.childNodes.length) {\n childRenderNode.$children$.forEach((c) => {\n childRenderNode.$elm$.appendChild(c.$elm$);\n });\n }\n } else {\n childRenderNode.$flags$ |= 1 /* isSlotReference */;\n }\n }\n if (orgLocationNode && orgLocationNode.isConnected) {\n if (shadowRoot && orgLocationNode[\"s-en\"] === \"\") {\n orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);\n }\n orgLocationNode.parentNode.removeChild(orgLocationNode);\n if (!shadowRoot) {\n node[\"s-oo\"] = parseInt(childRenderNode.$nodeId$);\n }\n }\n plt.$orgLocNodes$.delete(orgLocationId);\n }\n const hosts = [];\n const snLen = slottedNodes.length;\n let snIndex = 0;\n let slotGroup;\n let snGroupIdx;\n let snGroupLen;\n let slottedItem;\n for (snIndex; snIndex < snLen; snIndex++) {\n slotGroup = slottedNodes[snIndex];\n if (!slotGroup || !slotGroup.length) continue;\n snGroupLen = slotGroup.length;\n snGroupIdx = 0;\n for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {\n slottedItem = slotGroup[snGroupIdx];\n if (!hosts[slottedItem.hostId]) {\n hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);\n }\n if (!hosts[slottedItem.hostId]) continue;\n const hostEle = hosts[slottedItem.hostId];\n if (!hostEle.shadowRoot || !shadowRoot) {\n slottedItem.slot[\"s-cr\"] = hostEle[\"s-cr\"];\n if (!slottedItem.slot[\"s-cr\"] && hostEle.shadowRoot) {\n slottedItem.slot[\"s-cr\"] = hostEle;\n } else {\n slottedItem.slot[\"s-cr\"] = (hostEle.__childNodes || hostEle.childNodes)[0];\n }\n addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node[\"s-oo\"]);\n if (BUILD12.experimentalSlotFixes) {\n patchSlottedNode(slottedItem.node);\n }\n }\n if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {\n hostEle.appendChild(slottedItem.node);\n }\n }\n }\n if (BUILD12.scoped && scopeId2 && slotNodes.length) {\n slotNodes.forEach((slot) => {\n slot.$elm$.parentElement.classList.add(scopeId2 + \"-s\");\n });\n }\n if (BUILD12.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {\n let rnIdex = 0;\n const rnLen = shadowRootNodes.length;\n if (rnLen) {\n for (rnIdex; rnIdex < rnLen; rnIdex++) {\n shadowRoot.appendChild(shadowRootNodes[rnIdex]);\n }\n Array.from(hostElm.childNodes).forEach((node) => {\n if (typeof node[\"s-sn\"] !== \"string\") {\n if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {\n node.removeAttribute(\"hidden\");\n } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {\n node.parentNode.removeChild(node);\n }\n }\n });\n }\n }\n plt.$orgLocNodes$.delete(hostElm[\"s-id\"]);\n hostRef.$hostElement$ = hostElm;\n endHydrate();\n};\nvar clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {\n let childNodeType;\n let childIdSplt;\n let childVNode;\n let i2;\n const scopeId2 = hostElm[\"s-sc\"];\n if (node.nodeType === 1 /* ElementNode */) {\n childNodeType = node.getAttribute(HYDRATE_CHILD_ID);\n if (childNodeType) {\n childIdSplt = childNodeType.split(\".\");\n if (childIdSplt[0] === hostId || childIdSplt[0] === \"0\") {\n childVNode = createSimpleVNode({\n $flags$: 0,\n $hostId$: childIdSplt[0],\n $nodeId$: childIdSplt[1],\n $depth$: childIdSplt[2],\n $index$: childIdSplt[3],\n $tag$: node.tagName.toLowerCase(),\n $elm$: node,\n // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch\n // won't try to reconcile them. Classes set on the node will be blown away.\n $attrs$: { class: node.className || \"\" }\n });\n childRenderNodes.push(childVNode);\n node.removeAttribute(HYDRATE_CHILD_ID);\n if (!parentVNode.$children$) {\n parentVNode.$children$ = [];\n }\n if (BUILD12.scoped && scopeId2) {\n node[\"s-si\"] = scopeId2;\n childVNode.$attrs$.class += \" \" + scopeId2;\n }\n const slotName = childVNode.$elm$.getAttribute(\"s-sn\");\n if (typeof slotName === \"string\") {\n if (childVNode.$tag$ === \"slot-fb\") {\n addSlot(\n slotName,\n childIdSplt[2],\n childVNode,\n node,\n parentVNode,\n childRenderNodes,\n slotNodes,\n shadowRootNodes,\n slottedNodes\n );\n if (BUILD12.scoped && scopeId2) {\n node.classList.add(scopeId2);\n }\n }\n childVNode.$elm$[\"s-sn\"] = slotName;\n childVNode.$elm$.removeAttribute(\"s-sn\");\n }\n if (childVNode.$index$ !== void 0) {\n parentVNode.$children$[childVNode.$index$] = childVNode;\n }\n parentVNode = childVNode;\n if (shadowRootNodes && childVNode.$depth$ === \"0\") {\n shadowRootNodes[childVNode.$index$] = childVNode.$elm$;\n }\n }\n }\n if (node.shadowRoot) {\n for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {\n clientHydrate(\n parentVNode,\n childRenderNodes,\n slotNodes,\n shadowRootNodes,\n hostElm,\n node.shadowRoot.childNodes[i2],\n hostId,\n slottedNodes\n );\n }\n }\n const nonShadowNodes = node.__childNodes || node.childNodes;\n for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {\n clientHydrate(\n parentVNode,\n childRenderNodes,\n slotNodes,\n shadowRootNodes,\n hostElm,\n nonShadowNodes[i2],\n hostId,\n slottedNodes\n );\n }\n } else if (node.nodeType === 8 /* CommentNode */) {\n childIdSplt = node.nodeValue.split(\".\");\n if (childIdSplt[1] === hostId || childIdSplt[1] === \"0\") {\n childNodeType = childIdSplt[0];\n childVNode = createSimpleVNode({\n $hostId$: childIdSplt[1],\n $nodeId$: childIdSplt[2],\n $depth$: childIdSplt[3],\n $index$: childIdSplt[4] || \"0\",\n $elm$: node,\n $attrs$: null,\n $children$: null,\n $key$: null,\n $name$: null,\n $tag$: null,\n $text$: null\n });\n if (childNodeType === TEXT_NODE_ID) {\n childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);\n if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {\n childVNode.$text$ = childVNode.$elm$.textContent;\n childRenderNodes.push(childVNode);\n node.remove();\n if (hostId === childVNode.$hostId$) {\n if (!parentVNode.$children$) {\n parentVNode.$children$ = [];\n }\n parentVNode.$children$[childVNode.$index$] = childVNode;\n }\n if (shadowRootNodes && childVNode.$depth$ === \"0\") {\n shadowRootNodes[childVNode.$index$] = childVNode.$elm$;\n }\n }\n } else if (childNodeType === COMMENT_NODE_ID) {\n childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);\n if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {\n childRenderNodes.push(childVNode);\n node.remove();\n }\n } else if (childVNode.$hostId$ === hostId) {\n if (childNodeType === SLOT_NODE_ID) {\n const slotName = node[\"s-sn\"] = childIdSplt[5] || \"\";\n addSlot(\n slotName,\n childIdSplt[2],\n childVNode,\n node,\n parentVNode,\n childRenderNodes,\n slotNodes,\n shadowRootNodes,\n slottedNodes\n );\n } else if (childNodeType === CONTENT_REF_ID) {\n if (BUILD12.shadowDom && shadowRootNodes) {\n node.remove();\n } else if (BUILD12.slotRelocation) {\n hostElm[\"s-cr\"] = node;\n node[\"s-cn\"] = true;\n }\n }\n }\n }\n } else if (parentVNode && parentVNode.$tag$ === \"style\") {\n const vnode = newVNode(null, node.textContent);\n vnode.$elm$ = node;\n vnode.$index$ = \"0\";\n parentVNode.$children$ = [vnode];\n } else {\n if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {\n node.remove();\n }\n }\n return parentVNode;\n};\nvar initializeDocumentHydrate = (node, orgLocNodes) => {\n if (node.nodeType === 1 /* ElementNode */) {\n const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);\n if (componentId) {\n orgLocNodes.set(componentId, node);\n }\n let i2 = 0;\n if (node.shadowRoot) {\n for (; i2 < node.shadowRoot.childNodes.length; i2++) {\n initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);\n }\n }\n const nonShadowNodes = node.__childNodes || node.childNodes;\n for (i2 = 0; i2 < nonShadowNodes.length; i2++) {\n initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);\n }\n } else if (node.nodeType === 8 /* CommentNode */) {\n const childIdSplt = node.nodeValue.split(\".\");\n if (childIdSplt[0] === ORG_LOCATION_ID) {\n orgLocNodes.set(childIdSplt[1] + \".\" + childIdSplt[2], node);\n node.nodeValue = \"\";\n node[\"s-en\"] = childIdSplt[3];\n }\n }\n};\nvar createSimpleVNode = (vnode) => {\n const defaultVNode = {\n $flags$: 0,\n $hostId$: null,\n $nodeId$: null,\n $depth$: null,\n $index$: \"0\",\n $elm$: null,\n $attrs$: null,\n $children$: null,\n $key$: null,\n $name$: null,\n $tag$: null,\n $text$: null\n };\n return { ...defaultVNode, ...vnode };\n};\nfunction addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {\n node[\"s-sr\"] = true;\n childVNode.$name$ = slotName || null;\n childVNode.$tag$ = \"slot\";\n const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$[\"s-id\"] || parentVNode.$elm$.getAttribute(\"s-id\") : \"\";\n if (BUILD12.shadowDom && shadowRootNodes && win.document) {\n const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);\n if (childVNode.$name$) {\n childVNode.$elm$.setAttribute(\"name\", slotName);\n }\n if (parentNodeId && parentNodeId !== childVNode.$hostId$) {\n parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);\n } else {\n node.parentNode.insertBefore(childVNode.$elm$, node);\n }\n addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);\n node.remove();\n if (childVNode.$depth$ === \"0\") {\n shadowRootNodes[childVNode.$index$] = childVNode.$elm$;\n }\n } else {\n const slot = childVNode.$elm$;\n const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;\n addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);\n patchSlotNode(node);\n if (shouldMove) {\n parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);\n }\n childRenderNodes.push(childVNode);\n }\n slotNodes.push(childVNode);\n if (!parentVNode.$children$) {\n parentVNode.$children$ = [];\n }\n parentVNode.$children$[childVNode.$index$] = childVNode;\n}\nvar addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {\n let slottedNode = slotNode.nextSibling;\n slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];\n while (slottedNode && ((slottedNode[\"getAttribute\"] && slottedNode.getAttribute(\"slot\") || slottedNode[\"s-sn\"]) === slotName || slotName === \"\" && !slottedNode[\"s-sn\"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(\".\") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {\n slottedNode[\"s-sn\"] = slotName;\n slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });\n slottedNode = slottedNode.nextSibling;\n }\n};\nvar findCorrespondingNode = (node, type) => {\n let sibling = node;\n do {\n sibling = sibling.nextSibling;\n } while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));\n return sibling;\n};\n\n// src/runtime/initialize-component.ts\nimport { BUILD as BUILD23 } from \"@stencil/core/internal/app-data\";\n\n// src/utils/shadow-css.ts\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n *\n * This file is a port of shadowCSS from `webcomponents.js` to TypeScript.\n * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js\n * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts\n */\nvar safeSelector = (selector) => {\n const placeholders = [];\n let index = 0;\n selector = selector.replace(/(\\[[^\\]]*\\])/g, (_, keep) => {\n const replaceBy = `__ph-${index}__`;\n placeholders.push(keep);\n index++;\n return replaceBy;\n });\n const content = selector.replace(/(:nth-[-\\w]+)(\\([^)]+\\))/g, (_, pseudo, exp) => {\n const replaceBy = `__ph-${index}__`;\n placeholders.push(exp);\n index++;\n return pseudo + replaceBy;\n });\n const ss = {\n content,\n placeholders\n };\n return ss;\n};\nvar restoreSafeSelector = (placeholders, content) => {\n return content.replace(/__ph-(\\d+)__/g, (_, index) => placeholders[+index]);\n};\nvar _polyfillHost = \"-shadowcsshost\";\nvar _polyfillSlotted = \"-shadowcssslotted\";\nvar _polyfillHostContext = \"-shadowcsscontext\";\nvar _parenSuffix = \")(?:\\\\(((?:\\\\([^)(]*\\\\)|[^)(]*)+?)\\\\))?([^,{]*)\";\nvar _cssColonHostRe = new RegExp(\"(\" + _polyfillHost + _parenSuffix, \"gim\");\nvar _cssColonHostContextRe = new RegExp(\"(\" + _polyfillHostContext + _parenSuffix, \"gim\");\nvar _cssColonSlottedRe = new RegExp(\"(\" + _polyfillSlotted + _parenSuffix, \"gim\");\nvar _polyfillHostNoCombinator = _polyfillHost + \"-no-combinator\";\nvar _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\\s]*)/;\nvar _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];\nvar _selectorReSuffix = \"([>\\\\s~+[.,{:][\\\\s\\\\S]*)?$\";\nvar _polyfillHostRe = /-shadowcsshost/gim;\nvar createSupportsRuleRe = (selector) => new RegExp(`((? {\n return input.replace(_commentRe, \"\");\n};\nvar _commentWithHashRe = /\\/\\*\\s*#\\s*source(Mapping)?URL=[\\s\\S]+?\\*\\//g;\nvar extractCommentsWithHash = (input) => {\n return input.match(_commentWithHashRe) || [];\n};\nvar _ruleRe = /(\\s*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))/g;\nvar _curlyRe = /([{}])/g;\nvar _selectorPartsRe = /(^.*?[^\\\\])??((:+)(.*)|$)/;\nvar OPEN_CURLY = \"{\";\nvar CLOSE_CURLY = \"}\";\nvar BLOCK_PLACEHOLDER = \"%BLOCK%\";\nvar processRules = (input, ruleCallback) => {\n const inputWithEscapedBlocks = escapeBlocks(input);\n let nextBlockIndex = 0;\n return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {\n const selector = m[2];\n let content = \"\";\n let suffix = m[4];\n let contentPrefix = \"\";\n if (suffix && suffix.startsWith(\"{\" + BLOCK_PLACEHOLDER)) {\n content = inputWithEscapedBlocks.blocks[nextBlockIndex++];\n suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);\n contentPrefix = \"{\";\n }\n const cssRule = {\n selector,\n content\n };\n const rule = ruleCallback(cssRule);\n return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;\n });\n};\nvar escapeBlocks = (input) => {\n const inputParts = input.split(_curlyRe);\n const resultParts = [];\n const escapedBlocks = [];\n let bracketCount = 0;\n let currentBlockParts = [];\n for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {\n const part = inputParts[partIndex];\n if (part === CLOSE_CURLY) {\n bracketCount--;\n }\n if (bracketCount > 0) {\n currentBlockParts.push(part);\n } else {\n if (currentBlockParts.length > 0) {\n escapedBlocks.push(currentBlockParts.join(\"\"));\n resultParts.push(BLOCK_PLACEHOLDER);\n currentBlockParts = [];\n }\n resultParts.push(part);\n }\n if (part === OPEN_CURLY) {\n bracketCount++;\n }\n }\n if (currentBlockParts.length > 0) {\n escapedBlocks.push(currentBlockParts.join(\"\"));\n resultParts.push(BLOCK_PLACEHOLDER);\n }\n const strEscapedBlocks = {\n escapedString: resultParts.join(\"\"),\n blocks: escapedBlocks\n };\n return strEscapedBlocks;\n};\nvar insertPolyfillHostInCssText = (cssText) => {\n cssText = cssText.replace(_colonHostContextRe, `$1${_polyfillHostContext}`).replace(_colonHostRe, `$1${_polyfillHost}`).replace(_colonSlottedRe, `$1${_polyfillSlotted}`);\n return cssText;\n};\nvar convertColonRule = (cssText, regExp, partReplacer) => {\n return cssText.replace(regExp, (...m) => {\n if (m[2]) {\n const parts = m[2].split(\",\");\n const r = [];\n for (let i2 = 0; i2 < parts.length; i2++) {\n const p = parts[i2].trim();\n if (!p) break;\n r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));\n }\n return r.join(\",\");\n } else {\n return _polyfillHostNoCombinator + m[3];\n }\n });\n};\nvar colonHostPartReplacer = (host, part, suffix) => {\n return host + part.replace(_polyfillHost, \"\") + suffix;\n};\nvar convertColonHost = (cssText) => {\n return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);\n};\nvar colonHostContextPartReplacer = (host, part, suffix) => {\n if (part.indexOf(_polyfillHost) > -1) {\n return colonHostPartReplacer(host, part, suffix);\n } else {\n return host + part + suffix + \", \" + part + \" \" + host + suffix;\n }\n};\nvar convertColonSlotted = (cssText, slotScopeId) => {\n const slotClass = \".\" + slotScopeId + \" > \";\n const selectors = [];\n cssText = cssText.replace(_cssColonSlottedRe, (...m) => {\n if (m[2]) {\n const compound = m[2].trim();\n const suffix = m[3];\n const slottedSelector = slotClass + compound + suffix;\n let prefixSelector = \"\";\n for (let i2 = m[4] - 1; i2 >= 0; i2--) {\n const char = m[5][i2];\n if (char === \"}\" || char === \",\") {\n break;\n }\n prefixSelector = char + prefixSelector;\n }\n const orgSelector = (prefixSelector + slottedSelector).trim();\n const addedSelector = `${prefixSelector.trimEnd()}${slottedSelector.trim()}`.trim();\n if (orgSelector !== addedSelector) {\n const updatedSelector = `${addedSelector}, ${orgSelector}`;\n selectors.push({\n orgSelector,\n updatedSelector\n });\n }\n return slottedSelector;\n } else {\n return _polyfillHostNoCombinator + m[3];\n }\n });\n return {\n selectors,\n cssText\n };\n};\nvar convertColonHostContext = (cssText) => {\n return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);\n};\nvar convertShadowDOMSelectors = (cssText) => {\n return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, \" \"), cssText);\n};\nvar makeScopeMatcher = (scopeSelector2) => {\n const lre = /\\[/g;\n const rre = /\\]/g;\n scopeSelector2 = scopeSelector2.replace(lre, \"\\\\[\").replace(rre, \"\\\\]\");\n return new RegExp(\"^(\" + scopeSelector2 + \")\" + _selectorReSuffix, \"m\");\n};\nvar selectorNeedsScoping = (selector, scopeSelector2) => {\n const re = makeScopeMatcher(scopeSelector2);\n return !re.test(selector);\n};\nvar injectScopingSelector = (selector, scopingSelector) => {\n return selector.replace(_selectorPartsRe, (_, before = \"\", _colonGroup, colon = \"\", after = \"\") => {\n return before + scopingSelector + colon + after;\n });\n};\nvar applySimpleSelectorScope = (selector, scopeSelector2, hostSelector) => {\n _polyfillHostRe.lastIndex = 0;\n if (_polyfillHostRe.test(selector)) {\n const replaceBy = `.${hostSelector}`;\n return selector.replace(_polyfillHostNoCombinatorRe, (_, selector2) => injectScopingSelector(selector2, replaceBy)).replace(_polyfillHostRe, replaceBy + \" \");\n }\n return scopeSelector2 + \" \" + selector;\n};\nvar applyStrictSelectorScope = (selector, scopeSelector2, hostSelector) => {\n const isRe = /\\[is=([^\\]]*)\\]/g;\n scopeSelector2 = scopeSelector2.replace(isRe, (_, ...parts) => parts[0]);\n const className = \".\" + scopeSelector2;\n const _scopeSelectorPart = (p) => {\n let scopedP = p.trim();\n if (!scopedP) {\n return \"\";\n }\n if (p.indexOf(_polyfillHostNoCombinator) > -1) {\n scopedP = applySimpleSelectorScope(p, scopeSelector2, hostSelector);\n } else {\n const t = p.replace(_polyfillHostRe, \"\");\n if (t.length > 0) {\n scopedP = injectScopingSelector(t, className);\n }\n }\n return scopedP;\n };\n const safeContent = safeSelector(selector);\n selector = safeContent.content;\n let scopedSelector = \"\";\n let startIndex = 0;\n let res;\n const sep = /( |>|\\+|~(?!=))\\s*/g;\n const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;\n let shouldScope = !hasHost;\n while ((res = sep.exec(selector)) !== null) {\n const separator = res[1];\n const part2 = selector.slice(startIndex, res.index).trim();\n shouldScope = shouldScope || part2.indexOf(_polyfillHostNoCombinator) > -1;\n const scopedPart = shouldScope ? _scopeSelectorPart(part2) : part2;\n scopedSelector += `${scopedPart} ${separator} `;\n startIndex = sep.lastIndex;\n }\n const part = selector.substring(startIndex);\n shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;\n scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;\n return restoreSafeSelector(safeContent.placeholders, scopedSelector);\n};\nvar scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {\n return selector.split(\",\").map((shallowPart) => {\n if (slotSelector && shallowPart.indexOf(\".\" + slotSelector) > -1) {\n return shallowPart.trim();\n }\n if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {\n return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();\n } else {\n return shallowPart.trim();\n }\n }).join(\", \");\n};\nvar scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {\n return processRules(cssText, (rule) => {\n let selector = rule.selector;\n let content = rule.content;\n if (rule.selector[0] !== \"@\") {\n selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);\n } else if (rule.selector.startsWith(\"@media\") || rule.selector.startsWith(\"@supports\") || rule.selector.startsWith(\"@page\") || rule.selector.startsWith(\"@document\")) {\n content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector);\n }\n const cssRule = {\n selector: selector.replace(/\\s{2,}/g, \" \").trim(),\n content\n };\n return cssRule;\n });\n};\nvar scopeCssText = (cssText, scopeId2, hostScopeId, slotScopeId, commentOriginalSelector) => {\n cssText = insertPolyfillHostInCssText(cssText);\n cssText = convertColonHost(cssText);\n cssText = convertColonHostContext(cssText);\n const slotted = convertColonSlotted(cssText, slotScopeId);\n cssText = slotted.cssText;\n cssText = convertShadowDOMSelectors(cssText);\n if (scopeId2) {\n cssText = scopeSelectors(cssText, scopeId2, hostScopeId, slotScopeId, commentOriginalSelector);\n }\n cssText = replaceShadowCssHost(cssText, hostScopeId);\n cssText = cssText.replace(/>\\s*\\*\\s+([^{, ]+)/gm, \" $1 \");\n return {\n cssText: cssText.trim(),\n // We need to replace the shadow CSS host string in each of these selectors since we created\n // them prior to the replacement happening in the components CSS text.\n slottedSelectors: slotted.selectors.map((ref) => ({\n orgSelector: replaceShadowCssHost(ref.orgSelector, hostScopeId),\n updatedSelector: replaceShadowCssHost(ref.updatedSelector, hostScopeId)\n }))\n };\n};\nvar replaceShadowCssHost = (cssText, hostScopeId) => {\n return cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);\n};\nvar scopeCss = (cssText, scopeId2, commentOriginalSelector) => {\n const hostScopeId = scopeId2 + \"-h\";\n const slotScopeId = scopeId2 + \"-s\";\n const commentsWithHash = extractCommentsWithHash(cssText);\n cssText = stripComments(cssText);\n const orgSelectors = [];\n if (commentOriginalSelector) {\n const processCommentedSelector = (rule) => {\n const placeholder = `/*!@___${orgSelectors.length}___*/`;\n const comment = `/*!@${rule.selector}*/`;\n orgSelectors.push({ placeholder, comment });\n rule.selector = placeholder + rule.selector;\n return rule;\n };\n cssText = processRules(cssText, (rule) => {\n if (rule.selector[0] !== \"@\") {\n return processCommentedSelector(rule);\n } else if (rule.selector.startsWith(\"@media\") || rule.selector.startsWith(\"@supports\") || rule.selector.startsWith(\"@page\") || rule.selector.startsWith(\"@document\")) {\n rule.content = processRules(rule.content, processCommentedSelector);\n return rule;\n }\n return rule;\n });\n }\n const scoped = scopeCssText(cssText, scopeId2, hostScopeId, slotScopeId, commentOriginalSelector);\n cssText = [scoped.cssText, ...commentsWithHash].join(\"\\n\");\n if (commentOriginalSelector) {\n orgSelectors.forEach(({ placeholder, comment }) => {\n cssText = cssText.replace(placeholder, comment);\n });\n }\n scoped.slottedSelectors.forEach((slottedSelector) => {\n const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector), \"g\");\n cssText = cssText.replace(regex, slottedSelector.updatedSelector);\n });\n return cssText;\n};\n\n// src/runtime/mode.ts\nvar computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);\nvar setMode = (handler) => modeResolutionChain.push(handler);\nvar getMode = (ref) => getHostRef(ref).$modeName$;\n\n// src/runtime/proxy-component.ts\nimport { BUILD as BUILD22 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/set-value.ts\nimport { BUILD as BUILD21 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/parse-property-value.ts\nimport { BUILD as BUILD13 } from \"@stencil/core/internal/app-data\";\nvar parsePropertyValue = (propValue, propType) => {\n if (propValue != null && !isComplexType(propValue)) {\n if (BUILD13.propBoolean && propType & 4 /* Boolean */) {\n return propValue === \"false\" ? false : propValue === \"\" || !!propValue;\n }\n if (BUILD13.propNumber && propType & 2 /* Number */) {\n return parseFloat(propValue);\n }\n if (BUILD13.propString && propType & 1 /* String */) {\n return String(propValue);\n }\n return propValue;\n }\n return propValue;\n};\n\n// src/runtime/update-component.ts\nimport { BUILD as BUILD20, NAMESPACE } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/event-emitter.ts\nimport { BUILD as BUILD15 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/element.ts\nimport { BUILD as BUILD14 } from \"@stencil/core/internal/app-data\";\nvar getElement = (ref) => BUILD14.lazyLoad ? getHostRef(ref).$hostElement$ : ref;\n\n// src/runtime/event-emitter.ts\nvar createEvent = (ref, name, flags) => {\n const elm = getElement(ref);\n return {\n emit: (detail) => {\n if (BUILD15.isDev && !elm.isConnected) {\n consoleDevWarn(`The \"${name}\" event was emitted, but the dispatcher node is no longer connected to the dom.`);\n }\n return emitEvent(elm, name, {\n bubbles: !!(flags & 4 /* Bubbles */),\n composed: !!(flags & 2 /* Composed */),\n cancelable: !!(flags & 1 /* Cancellable */),\n detail\n });\n }\n };\n};\nvar emitEvent = (elm, name, opts) => {\n const ev = plt.ce(name, opts);\n elm.dispatchEvent(ev);\n return ev;\n};\n\n// src/runtime/styles.ts\nimport { BUILD as BUILD16 } from \"@stencil/core/internal/app-data\";\nvar rootAppliedStyles = /* @__PURE__ */ new WeakMap();\nvar registerStyle = (scopeId2, cssText, allowCS) => {\n let style = styles.get(scopeId2);\n if (supportsConstructableStylesheets && allowCS) {\n style = style || new CSSStyleSheet();\n if (typeof style === \"string\") {\n style = cssText;\n } else {\n style.replaceSync(cssText);\n }\n } else {\n style = cssText;\n }\n styles.set(scopeId2, style);\n};\nvar addStyle = (styleContainerNode, cmpMeta, mode) => {\n var _a;\n const scopeId2 = getScopeId(cmpMeta, mode);\n const style = styles.get(scopeId2);\n if (!BUILD16.attachStyles || !win.document) {\n return scopeId2;\n }\n styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;\n if (style) {\n if (typeof style === \"string\") {\n styleContainerNode = styleContainerNode.head || styleContainerNode;\n let appliedStyles = rootAppliedStyles.get(styleContainerNode);\n let styleElm;\n if (!appliedStyles) {\n rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());\n }\n if (!appliedStyles.has(scopeId2)) {\n if (BUILD16.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}=\"${scopeId2}\"]`))) {\n styleElm.innerHTML = style;\n } else {\n styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}=\"${scopeId2}\"]`) || win.document.createElement(\"style\");\n styleElm.innerHTML = style;\n const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);\n if (nonce != null) {\n styleElm.setAttribute(\"nonce\", nonce);\n }\n if ((BUILD16.hydrateServerSide || BUILD16.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {\n styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);\n }\n if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {\n if (styleContainerNode.nodeName === \"HEAD\") {\n const preconnectLinks = styleContainerNode.querySelectorAll(\"link[rel=preconnect]\");\n const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector(\"style\");\n styleContainerNode.insertBefore(\n styleElm,\n (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null\n );\n } else if (\"host\" in styleContainerNode) {\n if (supportsConstructableStylesheets) {\n const stylesheet = new CSSStyleSheet();\n stylesheet.replaceSync(style);\n styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];\n } else {\n const existingStyleContainer = styleContainerNode.querySelector(\"style\");\n if (existingStyleContainer) {\n existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;\n } else {\n styleContainerNode.prepend(styleElm);\n }\n }\n } else {\n styleContainerNode.append(styleElm);\n }\n }\n if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {\n styleContainerNode.insertBefore(styleElm, null);\n }\n }\n if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {\n styleElm.innerHTML += SLOT_FB_CSS;\n }\n if (appliedStyles) {\n appliedStyles.add(scopeId2);\n }\n }\n } else if (BUILD16.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {\n styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];\n }\n }\n return scopeId2;\n};\nvar attachStyles = (hostRef) => {\n const cmpMeta = hostRef.$cmpMeta$;\n const elm = hostRef.$hostElement$;\n const flags = cmpMeta.$flags$;\n const endAttachStyles = createTime(\"attachStyles\", cmpMeta.$tagName$);\n const scopeId2 = addStyle(\n BUILD16.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),\n cmpMeta,\n hostRef.$modeName$\n );\n if ((BUILD16.shadowDom || BUILD16.scoped) && BUILD16.cssAnnotations && (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {\n elm[\"s-sc\"] = scopeId2;\n elm.classList.add(scopeId2 + \"-h\");\n }\n endAttachStyles();\n};\nvar getScopeId = (cmp, mode) => \"sc-\" + (BUILD16.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + \"-\" + mode : cmp.$tagName$);\nvar convertScopedToShadow = (css) => css.replace(/\\/\\*!@([^\\/]+)\\*\\/[^\\{]+\\{/g, \"$1{\");\nvar hydrateScopedToShadow = () => {\n if (!win.document) {\n return;\n }\n const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);\n let i2 = 0;\n for (; i2 < styles2.length; i2++) {\n registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);\n }\n};\n\n// src/runtime/vdom/vdom-render.ts\nimport { BUILD as BUILD19 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/vdom/update-element.ts\nimport { BUILD as BUILD18 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/vdom/set-accessor.ts\nimport { BUILD as BUILD17 } from \"@stencil/core/internal/app-data\";\nvar setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {\n if (oldValue === newValue) {\n return;\n }\n let isProp = isMemberInElement(elm, memberName);\n let ln = memberName.toLowerCase();\n if (BUILD17.vdomClass && memberName === \"class\") {\n const classList = elm.classList;\n const oldClasses = parseClassList(oldValue);\n let newClasses = parseClassList(newValue);\n if (BUILD17.hydrateClientSide && elm[\"s-si\"] && initialRender) {\n newClasses.push(elm[\"s-si\"]);\n oldClasses.forEach((c) => {\n if (c.startsWith(elm[\"s-si\"])) newClasses.push(c);\n });\n newClasses = [...new Set(newClasses)];\n classList.add(...newClasses);\n } else {\n classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));\n classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));\n }\n } else if (BUILD17.vdomStyle && memberName === \"style\") {\n if (BUILD17.updatable) {\n for (const prop in oldValue) {\n if (!newValue || newValue[prop] == null) {\n if (!BUILD17.hydrateServerSide && prop.includes(\"-\")) {\n elm.style.removeProperty(prop);\n } else {\n elm.style[prop] = \"\";\n }\n }\n }\n }\n for (const prop in newValue) {\n if (!oldValue || newValue[prop] !== oldValue[prop]) {\n if (!BUILD17.hydrateServerSide && prop.includes(\"-\")) {\n elm.style.setProperty(prop, newValue[prop]);\n } else {\n elm.style[prop] = newValue[prop];\n }\n }\n }\n } else if (BUILD17.vdomKey && memberName === \"key\") {\n } else if (BUILD17.vdomRef && memberName === \"ref\") {\n if (newValue) {\n newValue(elm);\n }\n } else if (BUILD17.vdomListener && (BUILD17.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === \"o\" && memberName[1] === \"n\") {\n if (memberName[2] === \"-\") {\n memberName = memberName.slice(3);\n } else if (isMemberInElement(win, ln)) {\n memberName = ln.slice(2);\n } else {\n memberName = ln[2] + memberName.slice(3);\n }\n if (oldValue || newValue) {\n const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);\n memberName = memberName.replace(CAPTURE_EVENT_REGEX, \"\");\n if (oldValue) {\n plt.rel(elm, memberName, oldValue, capture);\n }\n if (newValue) {\n plt.ael(elm, memberName, newValue, capture);\n }\n }\n } else if (BUILD17.vdomPropOrAttr) {\n const isComplex = isComplexType(newValue);\n if ((isProp || isComplex && newValue !== null) && !isSvg) {\n try {\n if (!elm.tagName.includes(\"-\")) {\n const n = newValue == null ? \"\" : newValue;\n if (memberName === \"list\") {\n isProp = false;\n } else if (oldValue == null || elm[memberName] != n) {\n if (typeof elm.__lookupSetter__(memberName) === \"function\") {\n elm[memberName] = n;\n } else {\n elm.setAttribute(memberName, n);\n }\n }\n } else if (elm[memberName] !== newValue) {\n elm[memberName] = newValue;\n }\n } catch (e) {\n }\n }\n let xlink = false;\n if (BUILD17.vdomXlink) {\n if (ln !== (ln = ln.replace(/^xlink\\:?/, \"\"))) {\n memberName = ln;\n xlink = true;\n }\n }\n if (newValue == null || newValue === false) {\n if (newValue !== false || elm.getAttribute(memberName) === \"\") {\n if (BUILD17.vdomXlink && xlink) {\n elm.removeAttributeNS(XLINK_NS, memberName);\n } else {\n elm.removeAttribute(memberName);\n }\n }\n } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {\n newValue = newValue === true ? \"\" : newValue;\n if (BUILD17.vdomXlink && xlink) {\n elm.setAttributeNS(XLINK_NS, memberName, newValue);\n } else {\n elm.setAttribute(memberName, newValue);\n }\n }\n }\n};\nvar parseClassListRegex = /\\s/;\nvar parseClassList = (value) => {\n if (typeof value === \"object\" && value && \"baseVal\" in value) {\n value = value.baseVal;\n }\n if (!value || typeof value !== \"string\") {\n return [];\n }\n return value.split(parseClassListRegex);\n};\nvar CAPTURE_EVENT_SUFFIX = \"Capture\";\nvar CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + \"$\");\n\n// src/runtime/vdom/update-element.ts\nvar updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {\n const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;\n const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};\n const newVnodeAttrs = newVnode.$attrs$ || {};\n if (BUILD18.updatable) {\n for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {\n if (!(memberName in newVnodeAttrs)) {\n setAccessor(\n elm,\n memberName,\n oldVnodeAttrs[memberName],\n void 0,\n isSvgMode2,\n newVnode.$flags$,\n isInitialRender\n );\n }\n }\n }\n for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {\n setAccessor(\n elm,\n memberName,\n oldVnodeAttrs[memberName],\n newVnodeAttrs[memberName],\n isSvgMode2,\n newVnode.$flags$,\n isInitialRender\n );\n }\n};\nfunction sortedAttrNames(attrNames) {\n return attrNames.includes(\"ref\") ? (\n // we need to sort these to ensure that `'ref'` is the last attr\n [...attrNames.filter((attr) => attr !== \"ref\"), \"ref\"]\n ) : (\n // no need to sort, return the original array\n attrNames\n );\n}\n\n// src/runtime/vdom/vdom-render.ts\nvar scopeId;\nvar contentRef;\nvar hostTagName;\nvar useNativeShadowDom = false;\nvar checkSlotFallbackVisibility = false;\nvar checkSlotRelocate = false;\nvar isSvgMode = false;\nvar createElm = (oldParentVNode, newParentVNode, childIndex) => {\n var _a;\n const newVNode2 = newParentVNode.$children$[childIndex];\n let i2 = 0;\n let elm;\n let childNode;\n let oldVNode;\n if (BUILD19.slotRelocation && !useNativeShadowDom) {\n checkSlotRelocate = true;\n if (newVNode2.$tag$ === \"slot\") {\n newVNode2.$flags$ |= newVNode2.$children$ ? (\n // slot element has fallback content\n // still create an element that \"mocks\" the slot element\n 2 /* isSlotFallback */\n ) : (\n // slot element does not have fallback content\n // create an html comment we'll use to always reference\n // where actual slot content should sit next to\n 1 /* isSlotReference */\n );\n }\n }\n if (BUILD19.isDev && newVNode2.$elm$) {\n consoleDevError(\n `The JSX ${newVNode2.$text$ !== null ? `\"${newVNode2.$text$}\" text` : `\"${newVNode2.$tag$}\" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`\n );\n }\n if (BUILD19.vdomText && newVNode2.$text$ !== null) {\n elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);\n } else if (BUILD19.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {\n elm = newVNode2.$elm$ = BUILD19.isDebug || BUILD19.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : win.document.createTextNode(\"\");\n if (BUILD19.vdomAttribute) {\n updateElement(null, newVNode2, isSvgMode);\n }\n } else {\n if (BUILD19.svg && !isSvgMode) {\n isSvgMode = newVNode2.$tag$ === \"svg\";\n }\n if (!win.document) {\n throw new Error(\n \"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.\"\n );\n }\n elm = newVNode2.$elm$ = BUILD19.svg ? win.document.createElementNS(\n isSvgMode ? SVG_NS : HTML_NS,\n !useNativeShadowDom && BUILD19.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? \"slot-fb\" : newVNode2.$tag$\n ) : win.document.createElement(\n !useNativeShadowDom && BUILD19.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? \"slot-fb\" : newVNode2.$tag$\n );\n if (BUILD19.svg && isSvgMode && newVNode2.$tag$ === \"foreignObject\") {\n isSvgMode = false;\n }\n if (BUILD19.vdomAttribute) {\n updateElement(null, newVNode2, isSvgMode);\n }\n if (BUILD19.scoped && isDef(scopeId) && elm[\"s-si\"] !== scopeId) {\n elm.classList.add(elm[\"s-si\"] = scopeId);\n }\n if (newVNode2.$children$) {\n for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {\n childNode = createElm(oldParentVNode, newVNode2, i2);\n if (childNode) {\n elm.appendChild(childNode);\n }\n }\n }\n if (BUILD19.svg) {\n if (newVNode2.$tag$ === \"svg\") {\n isSvgMode = false;\n } else if (elm.tagName === \"foreignObject\") {\n isSvgMode = true;\n }\n }\n }\n elm[\"s-hn\"] = hostTagName;\n if (BUILD19.slotRelocation) {\n if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {\n elm[\"s-sr\"] = true;\n elm[\"s-cr\"] = contentRef;\n elm[\"s-sn\"] = newVNode2.$name$ || \"\";\n elm[\"s-rf\"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;\n patchSlotNode(elm);\n oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];\n if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {\n if (BUILD19.experimentalSlotFixes) {\n relocateToHostRoot(oldParentVNode.$elm$);\n } else {\n putBackInOriginalLocation(oldParentVNode.$elm$, false);\n }\n }\n if (BUILD19.scoped) {\n addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);\n }\n }\n }\n return elm;\n};\nvar relocateToHostRoot = (parentElm) => {\n plt.$flags$ |= 1 /* isTmpDisconnected */;\n const host = parentElm.closest(hostTagName.toLowerCase());\n if (host != null) {\n const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(\n (ref) => ref[\"s-cr\"]\n );\n const childNodeArray = Array.from(\n parentElm.__childNodes || parentElm.childNodes\n );\n for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {\n if (childNode[\"s-sh\"] != null) {\n insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);\n childNode[\"s-sh\"] = void 0;\n checkSlotRelocate = true;\n }\n }\n }\n plt.$flags$ &= ~1 /* isTmpDisconnected */;\n};\nvar putBackInOriginalLocation = (parentElm, recursive) => {\n plt.$flags$ |= 1 /* isTmpDisconnected */;\n const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);\n if (parentElm[\"s-sr\"] && BUILD19.experimentalSlotFixes) {\n let node = parentElm;\n while (node = node.nextSibling) {\n if (node && node[\"s-sn\"] === parentElm[\"s-sn\"] && node[\"s-sh\"] === hostTagName) {\n oldSlotChildNodes.push(node);\n }\n }\n }\n for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {\n const childNode = oldSlotChildNodes[i2];\n if (childNode[\"s-hn\"] !== hostTagName && childNode[\"s-ol\"]) {\n insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));\n childNode[\"s-ol\"].remove();\n childNode[\"s-ol\"] = void 0;\n childNode[\"s-sh\"] = void 0;\n checkSlotRelocate = true;\n }\n if (recursive) {\n putBackInOriginalLocation(childNode, recursive);\n }\n }\n plt.$flags$ &= ~1 /* isTmpDisconnected */;\n};\nvar addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {\n let containerElm = BUILD19.slotRelocation && parentElm[\"s-cr\"] && parentElm[\"s-cr\"].parentNode || parentElm;\n let childNode;\n if (BUILD19.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {\n containerElm = containerElm.shadowRoot;\n }\n for (; startIdx <= endIdx; ++startIdx) {\n if (vnodes[startIdx]) {\n childNode = createElm(null, parentVNode, startIdx);\n if (childNode) {\n vnodes[startIdx].$elm$ = childNode;\n insertBefore(containerElm, childNode, BUILD19.slotRelocation ? referenceNode(before) : before);\n }\n }\n }\n};\nvar removeVnodes = (vnodes, startIdx, endIdx) => {\n for (let index = startIdx; index <= endIdx; ++index) {\n const vnode = vnodes[index];\n if (vnode) {\n const elm = vnode.$elm$;\n nullifyVNodeRefs(vnode);\n if (elm) {\n if (BUILD19.slotRelocation) {\n checkSlotFallbackVisibility = true;\n if (elm[\"s-ol\"]) {\n elm[\"s-ol\"].remove();\n } else {\n putBackInOriginalLocation(elm, true);\n }\n }\n elm.remove();\n }\n }\n }\n};\nvar updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {\n let oldStartIdx = 0;\n let newStartIdx = 0;\n let idxInOld = 0;\n let i2 = 0;\n let oldEndIdx = oldCh.length - 1;\n let oldStartVnode = oldCh[0];\n let oldEndVnode = oldCh[oldEndIdx];\n let newEndIdx = newCh.length - 1;\n let newStartVnode = newCh[0];\n let newEndVnode = newCh[newEndIdx];\n let node;\n let elmToMove;\n while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n if (oldStartVnode == null) {\n oldStartVnode = oldCh[++oldStartIdx];\n } else if (oldEndVnode == null) {\n oldEndVnode = oldCh[--oldEndIdx];\n } else if (newStartVnode == null) {\n newStartVnode = newCh[++newStartIdx];\n } else if (newEndVnode == null) {\n newEndVnode = newCh[--newEndIdx];\n } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {\n patch(oldStartVnode, newStartVnode, isInitialRender);\n oldStartVnode = oldCh[++oldStartIdx];\n newStartVnode = newCh[++newStartIdx];\n } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {\n patch(oldEndVnode, newEndVnode, isInitialRender);\n oldEndVnode = oldCh[--oldEndIdx];\n newEndVnode = newCh[--newEndIdx];\n } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {\n if (BUILD19.slotRelocation && (oldStartVnode.$tag$ === \"slot\" || newEndVnode.$tag$ === \"slot\")) {\n putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);\n }\n patch(oldStartVnode, newEndVnode, isInitialRender);\n insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);\n oldStartVnode = oldCh[++oldStartIdx];\n newEndVnode = newCh[--newEndIdx];\n } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {\n if (BUILD19.slotRelocation && (oldStartVnode.$tag$ === \"slot\" || newEndVnode.$tag$ === \"slot\")) {\n putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);\n }\n patch(oldEndVnode, newStartVnode, isInitialRender);\n insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);\n oldEndVnode = oldCh[--oldEndIdx];\n newStartVnode = newCh[++newStartIdx];\n } else {\n idxInOld = -1;\n if (BUILD19.vdomKey) {\n for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {\n if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {\n idxInOld = i2;\n break;\n }\n }\n }\n if (BUILD19.vdomKey && idxInOld >= 0) {\n elmToMove = oldCh[idxInOld];\n if (elmToMove.$tag$ !== newStartVnode.$tag$) {\n node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);\n } else {\n patch(elmToMove, newStartVnode, isInitialRender);\n oldCh[idxInOld] = void 0;\n node = elmToMove.$elm$;\n }\n newStartVnode = newCh[++newStartIdx];\n } else {\n node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);\n newStartVnode = newCh[++newStartIdx];\n }\n if (node) {\n if (BUILD19.slotRelocation) {\n insertBefore(\n referenceNode(oldStartVnode.$elm$).parentNode,\n node,\n referenceNode(oldStartVnode.$elm$)\n );\n } else {\n insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);\n }\n }\n }\n }\n if (oldStartIdx > oldEndIdx) {\n addVnodes(\n parentElm,\n newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,\n newVNode2,\n newCh,\n newStartIdx,\n newEndIdx\n );\n } else if (BUILD19.updatable && newStartIdx > newEndIdx) {\n removeVnodes(oldCh, oldStartIdx, oldEndIdx);\n }\n};\nvar isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {\n if (leftVNode.$tag$ === rightVNode.$tag$) {\n if (BUILD19.slotRelocation && leftVNode.$tag$ === \"slot\") {\n return leftVNode.$name$ === rightVNode.$name$;\n }\n if (BUILD19.vdomKey && !isInitialRender) {\n return leftVNode.$key$ === rightVNode.$key$;\n }\n if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {\n leftVNode.$key$ = rightVNode.$key$;\n }\n return true;\n }\n return false;\n};\nvar referenceNode = (node) => node && node[\"s-ol\"] || node;\nvar patch = (oldVNode, newVNode2, isInitialRender = false) => {\n const elm = newVNode2.$elm$ = oldVNode.$elm$;\n const oldChildren = oldVNode.$children$;\n const newChildren = newVNode2.$children$;\n const tag = newVNode2.$tag$;\n const text = newVNode2.$text$;\n let defaultHolder;\n if (!BUILD19.vdomText || text === null) {\n if (BUILD19.svg) {\n isSvgMode = tag === \"svg\" ? true : tag === \"foreignObject\" ? false : isSvgMode;\n }\n if (BUILD19.vdomAttribute || BUILD19.reflect) {\n if (BUILD19.slot && tag === \"slot\" && !useNativeShadowDom) {\n if (BUILD19.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {\n newVNode2.$elm$[\"s-sn\"] = newVNode2.$name$ || \"\";\n relocateToHostRoot(newVNode2.$elm$.parentElement);\n }\n }\n updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);\n }\n if (BUILD19.updatable && oldChildren !== null && newChildren !== null) {\n updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);\n } else if (newChildren !== null) {\n if (BUILD19.updatable && BUILD19.vdomText && oldVNode.$text$ !== null) {\n elm.textContent = \"\";\n }\n addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);\n } else if (\n // don't do this on initial render as it can cause non-hydrated content to be removed\n !isInitialRender && BUILD19.updatable && oldChildren !== null\n ) {\n removeVnodes(oldChildren, 0, oldChildren.length - 1);\n }\n if (BUILD19.svg && isSvgMode && tag === \"svg\") {\n isSvgMode = false;\n }\n } else if (BUILD19.vdomText && BUILD19.slotRelocation && (defaultHolder = elm[\"s-cr\"])) {\n defaultHolder.parentNode.textContent = text;\n } else if (BUILD19.vdomText && oldVNode.$text$ !== text) {\n elm.data = text;\n }\n};\nvar relocateNodes = [];\nvar markSlotContentForRelocation = (elm) => {\n let node;\n let hostContentNodes;\n let j;\n const children = elm.__childNodes || elm.childNodes;\n for (const childNode of children) {\n if (childNode[\"s-sr\"] && (node = childNode[\"s-cr\"]) && node.parentNode) {\n hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;\n const slotName = childNode[\"s-sn\"];\n for (j = hostContentNodes.length - 1; j >= 0; j--) {\n node = hostContentNodes[j];\n if (!node[\"s-cn\"] && !node[\"s-nr\"] && node[\"s-hn\"] !== childNode[\"s-hn\"] && (!BUILD19.experimentalSlotFixes || !node[\"s-sh\"] || node[\"s-sh\"] !== childNode[\"s-hn\"])) {\n if (isNodeLocatedInSlot(node, slotName)) {\n let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);\n checkSlotFallbackVisibility = true;\n node[\"s-sn\"] = node[\"s-sn\"] || slotName;\n if (relocateNodeData) {\n relocateNodeData.$nodeToRelocate$[\"s-sh\"] = childNode[\"s-hn\"];\n relocateNodeData.$slotRefNode$ = childNode;\n } else {\n node[\"s-sh\"] = childNode[\"s-hn\"];\n relocateNodes.push({\n $slotRefNode$: childNode,\n $nodeToRelocate$: node\n });\n }\n if (node[\"s-sr\"]) {\n relocateNodes.map((relocateNode) => {\n if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node[\"s-sn\"])) {\n relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);\n if (relocateNodeData && !relocateNode.$slotRefNode$) {\n relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;\n }\n }\n });\n }\n } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {\n relocateNodes.push({\n $nodeToRelocate$: node\n });\n }\n }\n }\n }\n if (childNode.nodeType === 1 /* ElementNode */) {\n markSlotContentForRelocation(childNode);\n }\n }\n};\nvar nullifyVNodeRefs = (vNode) => {\n if (BUILD19.vdomRef) {\n vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);\n vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);\n }\n};\nvar insertBefore = (parent, newNode, reference) => {\n if (BUILD19.scoped && typeof newNode[\"s-sn\"] === \"string\" && !!newNode[\"s-sr\"] && !!newNode[\"s-cr\"]) {\n addRemoveSlotScopedClass(newNode[\"s-cr\"], newNode, parent, newNode.parentElement);\n } else if (BUILD19.experimentalSlotFixes && typeof newNode[\"s-sn\"] === \"string\") {\n if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {\n patchParentNode(newNode);\n }\n parent.insertBefore(newNode, reference);\n const { slotNode } = findSlotFromSlottedNode(newNode);\n if (slotNode) dispatchSlotChangeEvent(slotNode);\n return newNode;\n }\n if (BUILD19.experimentalSlotFixes && parent.__insertBefore) {\n return parent.__insertBefore(newNode, reference);\n } else {\n return parent == null ? void 0 : parent.insertBefore(newNode, reference);\n }\n};\nfunction addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {\n var _a, _b;\n let scopeId2;\n if (reference && typeof slotNode[\"s-sn\"] === \"string\" && !!slotNode[\"s-sr\"] && reference.parentNode && reference.parentNode[\"s-sc\"] && (scopeId2 = slotNode[\"s-si\"] || reference.parentNode[\"s-sc\"])) {\n const scopeName = slotNode[\"s-sn\"];\n const hostName = slotNode[\"s-hn\"];\n (_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + \"-s\");\n if (oldParent && ((_b = oldParent.classList) == null ? void 0 : _b.contains(scopeId2 + \"-s\"))) {\n let child = (oldParent.__childNodes || oldParent.childNodes)[0];\n let found = false;\n while (child) {\n if (child[\"s-sn\"] !== scopeName && child[\"s-hn\"] === hostName && !!child[\"s-sr\"]) {\n found = true;\n break;\n }\n child = child.nextSibling;\n }\n if (!found) oldParent.classList.remove(scopeId2 + \"-s\");\n }\n }\n}\nvar renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {\n var _a, _b, _c, _d, _e;\n const hostElm = hostRef.$hostElement$;\n const cmpMeta = hostRef.$cmpMeta$;\n const oldVNode = hostRef.$vnode$ || newVNode(null, null);\n const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);\n hostTagName = hostElm.tagName;\n if (BUILD19.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {\n throw new Error(`The must be the single root component.\nLooks like the render() function of \"${hostTagName.toLowerCase()}\" is returning an array that contains the .\n\nThe render() function should look like this instead:\n\nrender() {\n // Do not return an array\n return (\n {content}\n );\n}\n `);\n }\n if (BUILD19.reflect && cmpMeta.$attrsToReflect$) {\n rootVnode.$attrs$ = rootVnode.$attrs$ || {};\n cmpMeta.$attrsToReflect$.map(\n ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]\n );\n }\n if (isInitialLoad && rootVnode.$attrs$) {\n for (const key of Object.keys(rootVnode.$attrs$)) {\n if (hostElm.hasAttribute(key) && ![\"key\", \"ref\", \"style\", \"class\"].includes(key)) {\n rootVnode.$attrs$[key] = hostElm[key];\n }\n }\n }\n rootVnode.$tag$ = null;\n rootVnode.$flags$ |= 4 /* isHost */;\n hostRef.$vnode$ = rootVnode;\n rootVnode.$elm$ = oldVNode.$elm$ = BUILD19.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;\n if (BUILD19.scoped || BUILD19.shadowDom) {\n scopeId = hostElm[\"s-sc\"];\n }\n useNativeShadowDom = supportsShadow && !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);\n if (BUILD19.slotRelocation) {\n contentRef = hostElm[\"s-cr\"];\n checkSlotFallbackVisibility = false;\n }\n patch(oldVNode, rootVnode, isInitialLoad);\n if (BUILD19.slotRelocation) {\n plt.$flags$ |= 1 /* isTmpDisconnected */;\n if (checkSlotRelocate) {\n markSlotContentForRelocation(rootVnode.$elm$);\n for (const relocateData of relocateNodes) {\n const nodeToRelocate = relocateData.$nodeToRelocate$;\n if (!nodeToRelocate[\"s-ol\"] && win.document) {\n const orgLocationNode = BUILD19.isDebug || BUILD19.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : win.document.createTextNode(\"\");\n orgLocationNode[\"s-nr\"] = nodeToRelocate;\n insertBefore(nodeToRelocate.parentNode, nodeToRelocate[\"s-ol\"] = orgLocationNode, nodeToRelocate);\n }\n }\n for (const relocateData of relocateNodes) {\n const nodeToRelocate = relocateData.$nodeToRelocate$;\n const slotRefNode = relocateData.$slotRefNode$;\n if (slotRefNode) {\n const parentNodeRef = slotRefNode.parentNode;\n let insertBeforeNode = slotRefNode.nextSibling;\n if (!BUILD19.hydrateServerSide && (!BUILD19.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {\n let orgLocationNode = (_a = nodeToRelocate[\"s-ol\"]) == null ? void 0 : _a.previousSibling;\n while (orgLocationNode) {\n let refNode = (_b = orgLocationNode[\"s-nr\"]) != null ? _b : null;\n if (refNode && refNode[\"s-sn\"] === nodeToRelocate[\"s-sn\"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {\n refNode = refNode.nextSibling;\n while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode[\"s-sr\"])) {\n refNode = refNode == null ? void 0 : refNode.nextSibling;\n }\n if (!refNode || !refNode[\"s-nr\"]) {\n insertBeforeNode = refNode;\n break;\n }\n }\n orgLocationNode = orgLocationNode.previousSibling;\n }\n }\n const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;\n const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;\n if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {\n if (nodeToRelocate !== insertBeforeNode) {\n if (!BUILD19.experimentalSlotFixes && !nodeToRelocate[\"s-hn\"] && nodeToRelocate[\"s-ol\"]) {\n nodeToRelocate[\"s-hn\"] = nodeToRelocate[\"s-ol\"].parentNode.nodeName;\n }\n insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);\n if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== \"SLOT-FB\") {\n nodeToRelocate.hidden = (_c = nodeToRelocate[\"s-ih\"]) != null ? _c : false;\n }\n }\n }\n nodeToRelocate && typeof slotRefNode[\"s-rf\"] === \"function\" && slotRefNode[\"s-rf\"](slotRefNode);\n } else {\n if (nodeToRelocate.nodeType === 1 /* ElementNode */) {\n if (isInitialLoad) {\n nodeToRelocate[\"s-ih\"] = (_d = nodeToRelocate.hidden) != null ? _d : false;\n }\n nodeToRelocate.hidden = true;\n }\n }\n }\n }\n if (checkSlotFallbackVisibility) {\n updateFallbackSlotVisibility(rootVnode.$elm$);\n }\n plt.$flags$ &= ~1 /* isTmpDisconnected */;\n relocateNodes.length = 0;\n }\n if (BUILD19.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;\n for (const childNode of children) {\n if (childNode[\"s-hn\"] !== hostTagName && !childNode[\"s-sh\"]) {\n if (isInitialLoad && childNode[\"s-ih\"] == null) {\n childNode[\"s-ih\"] = (_e = childNode.hidden) != null ? _e : false;\n }\n childNode.hidden = true;\n }\n }\n }\n contentRef = void 0;\n};\nvar slotReferenceDebugNode = (slotVNode) => {\n var _a;\n return (_a = win.document) == null ? void 0 : _a.createComment(\n ` (host=${hostTagName.toLowerCase()})`\n );\n};\nvar originalLocationDebugNode = (nodeToRelocate) => {\n var _a;\n return (_a = win.document) == null ? void 0 : _a.createComment(\n `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate[\"s-hn\"]})` : `[${nodeToRelocate.textContent}]`)\n );\n};\n\n// src/runtime/update-component.ts\nvar attachToAncestor = (hostRef, ancestorComponent) => {\n if (BUILD20.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent[\"s-p\"]) {\n const index = ancestorComponent[\"s-p\"].push(\n new Promise(\n (r) => hostRef.$onRenderResolve$ = () => {\n ancestorComponent[\"s-p\"].splice(index - 1, 1);\n r();\n }\n )\n );\n }\n};\nvar scheduleUpdate = (hostRef, isInitialLoad) => {\n if (BUILD20.taskQueue && BUILD20.updatable) {\n hostRef.$flags$ |= 16 /* isQueuedForUpdate */;\n }\n if (BUILD20.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {\n hostRef.$flags$ |= 512 /* needsRerender */;\n return;\n }\n attachToAncestor(hostRef, hostRef.$ancestorComponent$);\n const dispatch = () => dispatchHooks(hostRef, isInitialLoad);\n return BUILD20.taskQueue ? writeTask(dispatch) : dispatch();\n};\nvar dispatchHooks = (hostRef, isInitialLoad) => {\n const elm = hostRef.$hostElement$;\n const endSchedule = createTime(\"scheduleUpdate\", hostRef.$cmpMeta$.$tagName$);\n const instance = BUILD20.lazyLoad ? hostRef.$lazyInstance$ : elm;\n if (!instance) {\n throw new Error(\n `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \\`externalRuntime: true\\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`\n );\n }\n let maybePromise;\n if (isInitialLoad) {\n if (BUILD20.lazyLoad && BUILD20.hostListener) {\n hostRef.$flags$ |= 256 /* isListenReady */;\n if (hostRef.$queuedListeners$) {\n hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));\n hostRef.$queuedListeners$ = void 0;\n }\n }\n emitLifecycleEvent(elm, \"componentWillLoad\");\n maybePromise = safeCall(instance, \"componentWillLoad\", void 0, elm);\n } else {\n emitLifecycleEvent(elm, \"componentWillUpdate\");\n maybePromise = safeCall(instance, \"componentWillUpdate\", void 0, elm);\n }\n emitLifecycleEvent(elm, \"componentWillRender\");\n maybePromise = enqueue(maybePromise, () => safeCall(instance, \"componentWillRender\", void 0, elm));\n endSchedule();\n return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));\n};\nvar enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {\n console.error(err2);\n fn();\n}) : fn();\nvar isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === \"function\";\nvar updateComponent = async (hostRef, instance, isInitialLoad) => {\n var _a;\n const elm = hostRef.$hostElement$;\n const endUpdate = createTime(\"update\", hostRef.$cmpMeta$.$tagName$);\n const rc = elm[\"s-rc\"];\n if (BUILD20.style && isInitialLoad) {\n attachStyles(hostRef);\n }\n const endRender = createTime(\"render\", hostRef.$cmpMeta$.$tagName$);\n if (BUILD20.isDev) {\n hostRef.$flags$ |= 1024 /* devOnRender */;\n }\n if (BUILD20.hydrateServerSide) {\n await callRender(hostRef, instance, elm, isInitialLoad);\n } else {\n callRender(hostRef, instance, elm, isInitialLoad);\n }\n if (BUILD20.isDev) {\n hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;\n hostRef.$flags$ &= ~1024 /* devOnRender */;\n }\n if (BUILD20.hydrateServerSide) {\n try {\n serverSideConnected(elm);\n if (isInitialLoad) {\n if (hostRef.$cmpMeta$.$flags$ & 1 /* shadowDomEncapsulation */) {\n elm[\"s-en\"] = \"\";\n } else if (hostRef.$cmpMeta$.$flags$ & 2 /* scopedCssEncapsulation */) {\n elm[\"s-en\"] = \"c\";\n }\n }\n } catch (e) {\n consoleError(e, elm);\n }\n }\n if (BUILD20.asyncLoading && rc) {\n rc.map((cb) => cb());\n elm[\"s-rc\"] = void 0;\n }\n endRender();\n endUpdate();\n if (BUILD20.asyncLoading) {\n const childrenPromises = (_a = elm[\"s-p\"]) != null ? _a : [];\n const postUpdate = () => postUpdateComponent(hostRef);\n if (childrenPromises.length === 0) {\n postUpdate();\n } else {\n Promise.all(childrenPromises).then(postUpdate);\n hostRef.$flags$ |= 4 /* isWaitingForChildren */;\n childrenPromises.length = 0;\n }\n } else {\n postUpdateComponent(hostRef);\n }\n};\nvar renderingRef = null;\nvar callRender = (hostRef, instance, elm, isInitialLoad) => {\n const allRenderFn = BUILD20.allRenderFn ? true : false;\n const lazyLoad = BUILD20.lazyLoad ? true : false;\n const taskQueue = BUILD20.taskQueue ? true : false;\n const updatable = BUILD20.updatable ? true : false;\n try {\n renderingRef = instance;\n instance = allRenderFn ? instance.render() : instance.render && instance.render();\n if (updatable && taskQueue) {\n hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;\n }\n if (updatable || lazyLoad) {\n hostRef.$flags$ |= 2 /* hasRendered */;\n }\n if (BUILD20.hasRenderFn || BUILD20.reflect) {\n if (BUILD20.vdomRender || BUILD20.reflect) {\n if (BUILD20.hydrateServerSide) {\n return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));\n } else {\n renderVdom(hostRef, instance, isInitialLoad);\n }\n } else {\n const shadowRoot = elm.shadowRoot;\n if (hostRef.$cmpMeta$.$flags$ & 1 /* shadowDomEncapsulation */) {\n shadowRoot.textContent = instance;\n } else {\n elm.textContent = instance;\n }\n }\n }\n } catch (e) {\n consoleError(e, hostRef.$hostElement$);\n }\n renderingRef = null;\n return null;\n};\nvar getRenderingRef = () => renderingRef;\nvar postUpdateComponent = (hostRef) => {\n const tagName = hostRef.$cmpMeta$.$tagName$;\n const elm = hostRef.$hostElement$;\n const endPostUpdate = createTime(\"postUpdate\", tagName);\n const instance = BUILD20.lazyLoad ? hostRef.$lazyInstance$ : elm;\n const ancestorComponent = hostRef.$ancestorComponent$;\n if (BUILD20.isDev) {\n hostRef.$flags$ |= 1024 /* devOnRender */;\n }\n safeCall(instance, \"componentDidRender\", void 0, elm);\n if (BUILD20.isDev) {\n hostRef.$flags$ &= ~1024 /* devOnRender */;\n }\n emitLifecycleEvent(elm, \"componentDidRender\");\n if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {\n hostRef.$flags$ |= 64 /* hasLoadedComponent */;\n if (BUILD20.asyncLoading && BUILD20.cssAnnotations) {\n addHydratedFlag(elm);\n }\n if (BUILD20.isDev) {\n hostRef.$flags$ |= 2048 /* devOnDidLoad */;\n }\n safeCall(instance, \"componentDidLoad\", void 0, elm);\n if (BUILD20.isDev) {\n hostRef.$flags$ &= ~2048 /* devOnDidLoad */;\n }\n emitLifecycleEvent(elm, \"componentDidLoad\");\n endPostUpdate();\n if (BUILD20.asyncLoading) {\n hostRef.$onReadyResolve$(elm);\n if (!ancestorComponent) {\n appDidLoad(tagName);\n }\n }\n } else {\n if (BUILD20.isDev) {\n hostRef.$flags$ |= 1024 /* devOnRender */;\n }\n safeCall(instance, \"componentDidUpdate\", void 0, elm);\n if (BUILD20.isDev) {\n hostRef.$flags$ &= ~1024 /* devOnRender */;\n }\n emitLifecycleEvent(elm, \"componentDidUpdate\");\n endPostUpdate();\n }\n if (BUILD20.method && BUILD20.lazyLoad) {\n hostRef.$onInstanceResolve$(elm);\n }\n if (BUILD20.asyncLoading) {\n if (hostRef.$onRenderResolve$) {\n hostRef.$onRenderResolve$();\n hostRef.$onRenderResolve$ = void 0;\n }\n if (hostRef.$flags$ & 512 /* needsRerender */) {\n nextTick(() => scheduleUpdate(hostRef, false));\n }\n hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);\n }\n};\nvar forceUpdate = (ref) => {\n if (BUILD20.updatable && (Build.isBrowser || Build.isTesting)) {\n const hostRef = getHostRef(ref);\n const isConnected = hostRef.$hostElement$.isConnected;\n if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {\n scheduleUpdate(hostRef, false);\n }\n return isConnected;\n }\n return false;\n};\nvar appDidLoad = (who) => {\n if (BUILD20.asyncQueue) {\n plt.$flags$ |= 2 /* appLoaded */;\n }\n nextTick(() => emitEvent(win, \"appload\", { detail: { namespace: NAMESPACE } }));\n if (BUILD20.profile && performance.measure) {\n performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, \"st:app:start\");\n }\n};\nvar safeCall = (instance, method, arg, elm) => {\n if (instance && instance[method]) {\n try {\n return instance[method](arg);\n } catch (e) {\n consoleError(e, elm);\n }\n }\n return void 0;\n};\nvar emitLifecycleEvent = (elm, lifecycleName) => {\n if (BUILD20.lifecycleDOMEvents) {\n emitEvent(elm, \"stencil_\" + lifecycleName, {\n bubbles: true,\n composed: true,\n detail: {\n namespace: NAMESPACE\n }\n });\n }\n};\nvar addHydratedFlag = (elm) => {\n var _a, _b;\n return BUILD20.hydratedClass ? elm.classList.add((_a = BUILD20.hydratedSelectorName) != null ? _a : \"hydrated\") : BUILD20.hydratedAttribute ? elm.setAttribute((_b = BUILD20.hydratedSelectorName) != null ? _b : \"hydrated\", \"\") : void 0;\n};\nvar serverSideConnected = (elm) => {\n const children = elm.children;\n if (children != null) {\n for (let i2 = 0, ii = children.length; i2 < ii; i2++) {\n const childElm = children[i2];\n if (typeof childElm.connectedCallback === \"function\") {\n childElm.connectedCallback();\n }\n serverSideConnected(childElm);\n }\n }\n};\n\n// src/runtime/set-value.ts\nvar getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);\nvar setValue = (ref, propName, newVal, cmpMeta) => {\n const hostRef = getHostRef(ref);\n if (BUILD21.lazyLoad && !hostRef) {\n throw new Error(\n `Couldn't find host element for \"${cmpMeta.$tagName$}\" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`\n );\n }\n const elm = BUILD21.lazyLoad ? hostRef.$hostElement$ : ref;\n const oldVal = hostRef.$instanceValues$.get(propName);\n const flags = hostRef.$flags$;\n const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : elm;\n newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);\n const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);\n const didValueChange = newVal !== oldVal && !areBothNaN;\n if ((!BUILD21.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {\n hostRef.$instanceValues$.set(propName, newVal);\n if (BUILD21.isDev) {\n if (hostRef.$flags$ & 1024 /* devOnRender */) {\n consoleDevWarn(\n `The state/prop \"${propName}\" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,\n \"\\nElement\",\n elm,\n \"\\nNew value\",\n newVal,\n \"\\nOld value\",\n oldVal\n );\n } else if (hostRef.$flags$ & 2048 /* devOnDidLoad */) {\n consoleDevWarn(\n `The state/prop \"${propName}\" changed during \"componentDidLoad()\", this triggers extra re-renders, try to setup on \"componentWillLoad()\"`,\n \"\\nElement\",\n elm,\n \"\\nNew value\",\n newVal,\n \"\\nOld value\",\n oldVal\n );\n }\n }\n if (!BUILD21.lazyLoad || instance) {\n if (BUILD21.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {\n const watchMethods = cmpMeta.$watchers$[propName];\n if (watchMethods) {\n watchMethods.map((watchMethodName) => {\n try {\n instance[watchMethodName](newVal, oldVal, propName);\n } catch (e) {\n consoleError(e, elm);\n }\n });\n }\n }\n if (BUILD21.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {\n if (instance.componentShouldUpdate) {\n if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {\n return;\n }\n }\n scheduleUpdate(hostRef, false);\n }\n }\n }\n};\n\n// src/runtime/proxy-component.ts\nvar proxyComponent = (Cstr, cmpMeta, flags) => {\n var _a, _b;\n const prototype = Cstr.prototype;\n if (BUILD22.isTesting) {\n if (prototype.__stencilAugmented) {\n return;\n }\n prototype.__stencilAugmented = true;\n }\n if (BUILD22.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {\n FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {\n const originalFormAssociatedCallback = prototype[cbName];\n Object.defineProperty(prototype, cbName, {\n value(...args) {\n const hostRef = getHostRef(this);\n const instance = BUILD22.lazyLoad ? hostRef.$lazyInstance$ : this;\n if (!instance) {\n hostRef.$onReadyPromise$.then((asyncInstance) => {\n const cb = asyncInstance[cbName];\n typeof cb === \"function\" && cb.call(asyncInstance, ...args);\n });\n } else {\n const cb = BUILD22.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;\n typeof cb === \"function\" && cb.call(instance, ...args);\n }\n }\n });\n });\n }\n if (BUILD22.member && cmpMeta.$members$ || BUILD22.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {\n if (BUILD22.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {\n cmpMeta.$watchers$ = Cstr.watchers;\n }\n const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});\n members.map(([memberName, [memberFlags]]) => {\n if ((BUILD22.prop || BUILD22.state) && (memberFlags & 31 /* Prop */ || (!BUILD22.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {\n const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};\n if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;\n if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;\n if (flags & 1 /* isElementConstructor */ || !origGetter) {\n Object.defineProperty(prototype, memberName, {\n get() {\n if (BUILD22.lazyLoad) {\n if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {\n return getValue(this, memberName);\n }\n const ref = getHostRef(this);\n const instance = ref ? ref.$lazyInstance$ : prototype;\n if (!instance) return;\n return instance[memberName];\n }\n if (!BUILD22.lazyLoad) {\n return origGetter ? origGetter.apply(this) : getValue(this, memberName);\n }\n },\n configurable: true,\n enumerable: true\n });\n }\n Object.defineProperty(prototype, memberName, {\n set(newValue) {\n const ref = getHostRef(this);\n if (BUILD22.isDev) {\n if (\n // we are proxying the instance (not element)\n (flags & 1 /* isElementConstructor */) === 0 && // if the class has a setter, then the Element can update instance values, so ignore\n (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0 && // the element is not constructing\n (ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop\n (memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable\n (memberFlags & 1024 /* Mutable */) === 0\n ) {\n consoleDevWarn(\n `@Prop() \"${memberName}\" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`\n );\n }\n }\n if (origSetter) {\n const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];\n if (typeof currentValue === \"undefined\" && ref.$instanceValues$.get(memberName)) {\n newValue = ref.$instanceValues$.get(memberName);\n } else if (!ref.$instanceValues$.get(memberName) && currentValue) {\n ref.$instanceValues$.set(memberName, currentValue);\n }\n origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);\n newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];\n setValue(this, memberName, newValue, cmpMeta);\n return;\n }\n if (!BUILD22.lazyLoad) {\n setValue(this, memberName, newValue, cmpMeta);\n return;\n }\n if (BUILD22.lazyLoad) {\n if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {\n setValue(this, memberName, newValue, cmpMeta);\n if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {\n ref.$onReadyPromise$.then(() => {\n if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {\n ref.$lazyInstance$[memberName] = newValue;\n }\n });\n }\n return;\n }\n const setterSetVal = () => {\n const currentValue = ref.$lazyInstance$[memberName];\n if (!ref.$instanceValues$.get(memberName) && currentValue) {\n ref.$instanceValues$.set(memberName, currentValue);\n }\n ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);\n setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);\n };\n if (ref.$lazyInstance$) {\n setterSetVal();\n } else {\n ref.$onReadyPromise$.then(() => setterSetVal());\n }\n }\n }\n });\n } else if (BUILD22.lazyLoad && BUILD22.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {\n Object.defineProperty(prototype, memberName, {\n value(...args) {\n var _a2;\n const ref = getHostRef(this);\n return (_a2 = ref == null ? void 0 : ref.$onInstancePromise$) == null ? void 0 : _a2.then(() => {\n var _a3;\n return (_a3 = ref.$lazyInstance$) == null ? void 0 : _a3[memberName](...args);\n });\n }\n });\n }\n });\n if (BUILD22.observeAttribute && (!BUILD22.lazyLoad || flags & 1 /* isElementConstructor */)) {\n const attrNameToPropName = /* @__PURE__ */ new Map();\n prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {\n plt.jmp(() => {\n var _a2;\n const propName = attrNameToPropName.get(attrName);\n if (this.hasOwnProperty(propName) && BUILD22.lazyLoad) {\n newValue = this[propName];\n delete this[propName];\n } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === \"number\" && // cast type to number to avoid TS compiler issues\n this[propName] == newValue) {\n return;\n } else if (propName == null) {\n const hostRef = getHostRef(this);\n const flags2 = hostRef == null ? void 0 : hostRef.$flags$;\n if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {\n const elm = BUILD22.lazyLoad ? hostRef.$hostElement$ : this;\n const instance = BUILD22.lazyLoad ? hostRef.$lazyInstance$ : elm;\n const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];\n entry == null ? void 0 : entry.forEach((callbackName) => {\n if (instance[callbackName] != null) {\n instance[callbackName].call(instance, newValue, oldValue, attrName);\n }\n });\n }\n return;\n }\n const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);\n newValue = newValue === null && typeof this[propName] === \"boolean\" ? false : newValue;\n if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {\n this[propName] = newValue;\n }\n });\n };\n Cstr.observedAttributes = Array.from(\n /* @__PURE__ */ new Set([\n ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),\n ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {\n var _a2;\n const attrName = m[1] || propName;\n attrNameToPropName.set(attrName, propName);\n if (BUILD22.reflect && m[0] & 512 /* ReflectAttr */) {\n (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);\n }\n return attrName;\n })\n ])\n );\n }\n }\n return Cstr;\n};\n\n// src/runtime/initialize-component.ts\nvar initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {\n let Cstr;\n if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {\n hostRef.$flags$ |= 32 /* hasInitializedComponent */;\n const bundleId = cmpMeta.$lazyBundleId$;\n if (BUILD23.lazyLoad && bundleId) {\n const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);\n if (CstrImport && \"then\" in CstrImport) {\n const endLoad = uniqueTime(\n `st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`,\n `[Stencil] Load module for <${cmpMeta.$tagName$}>`\n );\n Cstr = await CstrImport;\n endLoad();\n } else {\n Cstr = CstrImport;\n }\n if (!Cstr) {\n throw new Error(`Constructor for \"${cmpMeta.$tagName$}#${hostRef.$modeName$}\" was not found`);\n }\n if (BUILD23.member && !Cstr.isProxied) {\n if (BUILD23.watchCallback) {\n cmpMeta.$watchers$ = Cstr.watchers;\n }\n proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);\n Cstr.isProxied = true;\n }\n const endNewInstance = createTime(\"createInstance\", cmpMeta.$tagName$);\n if (BUILD23.member) {\n hostRef.$flags$ |= 8 /* isConstructingInstance */;\n }\n try {\n new Cstr(hostRef);\n } catch (e) {\n consoleError(e, elm);\n }\n if (BUILD23.member) {\n hostRef.$flags$ &= ~8 /* isConstructingInstance */;\n }\n if (BUILD23.watchCallback) {\n hostRef.$flags$ |= 128 /* isWatchReady */;\n }\n endNewInstance();\n fireConnectedCallback(hostRef.$lazyInstance$, elm);\n } else {\n Cstr = elm.constructor;\n const cmpTag = elm.localName;\n customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);\n }\n if (BUILD23.style && Cstr && Cstr.style) {\n let style;\n if (typeof Cstr.style === \"string\") {\n style = Cstr.style;\n } else if (BUILD23.mode && typeof Cstr.style !== \"string\") {\n hostRef.$modeName$ = computeMode(elm);\n if (hostRef.$modeName$) {\n style = Cstr.style[hostRef.$modeName$];\n }\n if (BUILD23.hydrateServerSide && hostRef.$modeName$) {\n elm.setAttribute(\"s-mode\", hostRef.$modeName$);\n }\n }\n const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);\n if (!styles.has(scopeId2)) {\n const endRegisterStyles = createTime(\"registerStyles\", cmpMeta.$tagName$);\n if (BUILD23.hydrateServerSide && BUILD23.shadowDom && cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {\n style = scopeCss(style, scopeId2, true);\n }\n registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));\n endRegisterStyles();\n }\n }\n }\n const ancestorComponent = hostRef.$ancestorComponent$;\n const schedule = () => scheduleUpdate(hostRef, true);\n if (BUILD23.asyncLoading && ancestorComponent && ancestorComponent[\"s-rc\"]) {\n ancestorComponent[\"s-rc\"].push(schedule);\n } else {\n schedule();\n }\n};\nvar fireConnectedCallback = (instance, elm) => {\n if (BUILD23.lazyLoad) {\n safeCall(instance, \"connectedCallback\", void 0, elm);\n }\n};\n\n// src/runtime/connected-callback.ts\nvar connectedCallback = (elm) => {\n if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {\n const hostRef = getHostRef(elm);\n const cmpMeta = hostRef.$cmpMeta$;\n const endConnected = createTime(\"connectedCallback\", cmpMeta.$tagName$);\n if (BUILD24.hostListenerTargetParent) {\n addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);\n }\n if (!(hostRef.$flags$ & 1 /* hasConnected */)) {\n hostRef.$flags$ |= 1 /* hasConnected */;\n let hostId;\n if (BUILD24.hydrateClientSide) {\n hostId = elm.getAttribute(HYDRATE_ID);\n if (hostId) {\n if (BUILD24.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {\n const scopeId2 = BUILD24.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute(\"s-mode\")) : addStyle(elm.shadowRoot, cmpMeta);\n elm.classList.remove(scopeId2 + \"-h\", scopeId2 + \"-s\");\n } else if (BUILD24.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n const scopeId2 = getScopeId(cmpMeta, BUILD24.mode ? elm.getAttribute(\"s-mode\") : void 0);\n elm[\"s-sc\"] = scopeId2;\n }\n initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);\n }\n }\n if (BUILD24.slotRelocation && !hostId) {\n if (BUILD24.hydrateServerSide || (BUILD24.slot || BUILD24.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field\n cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {\n setContentReference(elm);\n }\n }\n if (BUILD24.asyncLoading) {\n let ancestorComponent = elm;\n while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {\n if (BUILD24.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute(\"s-id\") && ancestorComponent[\"s-p\"] || ancestorComponent[\"s-p\"]) {\n attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);\n break;\n }\n }\n }\n if (BUILD24.prop && !BUILD24.hydrateServerSide && cmpMeta.$members$) {\n Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {\n if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {\n const value = elm[memberName];\n delete elm[memberName];\n elm[memberName] = value;\n }\n });\n }\n if (BUILD24.initializeNextTick) {\n nextTick(() => initializeComponent(elm, hostRef, cmpMeta));\n } else {\n initializeComponent(elm, hostRef, cmpMeta);\n }\n } else {\n addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);\n if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {\n fireConnectedCallback(hostRef.$lazyInstance$, elm);\n } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {\n hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));\n }\n }\n endConnected();\n }\n};\nvar setContentReference = (elm) => {\n if (!win.document) {\n return;\n }\n const contentRefElm = elm[\"s-cr\"] = win.document.createComment(\n BUILD24.isDebug ? `content-ref (host=${elm.localName})` : \"\"\n );\n contentRefElm[\"s-cn\"] = true;\n insertBefore(elm, contentRefElm, elm.firstChild);\n};\n\n// src/runtime/disconnected-callback.ts\nimport { BUILD as BUILD25 } from \"@stencil/core/internal/app-data\";\nvar disconnectInstance = (instance, elm) => {\n if (BUILD25.lazyLoad) {\n safeCall(instance, \"disconnectedCallback\", void 0, elm || instance);\n }\n};\nvar disconnectedCallback = async (elm) => {\n if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {\n const hostRef = getHostRef(elm);\n if (BUILD25.hostListener) {\n if (hostRef.$rmListeners$) {\n hostRef.$rmListeners$.map((rmListener) => rmListener());\n hostRef.$rmListeners$ = void 0;\n }\n }\n if (!BUILD25.lazyLoad) {\n disconnectInstance(elm);\n } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {\n disconnectInstance(hostRef.$lazyInstance$, elm);\n } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {\n hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));\n }\n }\n if (rootAppliedStyles.has(elm)) {\n rootAppliedStyles.delete(elm);\n }\n if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {\n rootAppliedStyles.delete(elm.shadowRoot);\n }\n};\n\n// src/runtime/bootstrap-custom-element.ts\nvar defineCustomElement = (Cstr, compactMeta) => {\n customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));\n};\nvar proxyCustomElement = (Cstr, compactMeta) => {\n const cmpMeta = {\n $flags$: compactMeta[0],\n $tagName$: compactMeta[1]\n };\n if (BUILD26.member) {\n cmpMeta.$members$ = compactMeta[2];\n }\n if (BUILD26.hostListener) {\n cmpMeta.$listeners$ = compactMeta[3];\n }\n if (BUILD26.watchCallback) {\n cmpMeta.$watchers$ = Cstr.$watchers$;\n }\n if (BUILD26.reflect) {\n cmpMeta.$attrsToReflect$ = [];\n }\n if (BUILD26.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {\n cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;\n }\n if (BUILD26.experimentalSlotFixes) {\n if (BUILD26.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n patchPseudoShadowDom(Cstr.prototype);\n }\n } else {\n if (BUILD26.slotChildNodesFix) {\n patchChildSlotNodes(Cstr.prototype);\n }\n if (BUILD26.cloneNodeFix) {\n patchCloneNode(Cstr.prototype);\n }\n if (BUILD26.appendChildSlotFix) {\n patchSlotAppendChild(Cstr.prototype);\n }\n if (BUILD26.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n patchTextContent(Cstr.prototype);\n }\n }\n if (BUILD26.hydrateClientSide && BUILD26.shadowDom) {\n hydrateScopedToShadow();\n }\n const originalConnectedCallback = Cstr.prototype.connectedCallback;\n const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;\n Object.assign(Cstr.prototype, {\n __hasHostListenerAttached: false,\n __registerHost() {\n registerHost(this, cmpMeta);\n },\n connectedCallback() {\n if (!this.__hasHostListenerAttached) {\n const hostRef = getHostRef(this);\n addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);\n this.__hasHostListenerAttached = true;\n }\n connectedCallback(this);\n if (originalConnectedCallback) {\n originalConnectedCallback.call(this);\n }\n },\n disconnectedCallback() {\n disconnectedCallback(this);\n if (originalDisconnectedCallback) {\n originalDisconnectedCallback.call(this);\n }\n },\n __attachShadow() {\n if (supportsShadow) {\n if (!this.shadowRoot) {\n if (BUILD26.shadowDelegatesFocus) {\n this.attachShadow({\n mode: \"open\",\n delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)\n });\n } else {\n this.attachShadow({ mode: \"open\" });\n }\n } else {\n if (this.shadowRoot.mode !== \"open\") {\n throw new Error(\n `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`\n );\n }\n }\n } else {\n this.shadowRoot = this;\n }\n }\n });\n Cstr.is = cmpMeta.$tagName$;\n return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);\n};\nvar forceModeUpdate = (elm) => {\n if (BUILD26.style && BUILD26.mode && !BUILD26.lazyLoad) {\n const mode = computeMode(elm);\n const hostRef = getHostRef(elm);\n if (hostRef.$modeName$ !== mode) {\n const cmpMeta = hostRef.$cmpMeta$;\n const oldScopeId = elm[\"s-sc\"];\n const scopeId2 = getScopeId(cmpMeta, mode);\n const style = elm.constructor.style[mode];\n const flags = cmpMeta.$flags$;\n if (style) {\n if (!styles.has(scopeId2)) {\n registerStyle(scopeId2, style, !!(flags & 1 /* shadowDomEncapsulation */));\n }\n hostRef.$modeName$ = mode;\n elm.classList.remove(oldScopeId + \"-h\", oldScopeId + \"-s\");\n attachStyles(hostRef);\n forceUpdate(elm);\n }\n }\n }\n};\n\n// src/runtime/bootstrap-lazy.ts\nimport { BUILD as BUILD27 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/hmr-component.ts\nvar hmrStart = (hostElement, cmpMeta, hmrVersionId) => {\n const hostRef = getHostRef(hostElement);\n hostRef.$flags$ = 1 /* hasConnected */;\n initializeComponent(hostElement, hostRef, cmpMeta, hmrVersionId);\n};\n\n// src/runtime/bootstrap-lazy.ts\nvar bootstrapLazy = (lazyBundles, options = {}) => {\n var _a;\n if (BUILD27.profile && performance.mark) {\n performance.mark(\"st:app:start\");\n }\n installDevTools();\n if (!win.document) {\n console.warn(\"Stencil: No document found. Skipping bootstrapping lazy components.\");\n return;\n }\n const endBootstrap = createTime(\"bootstrapLazy\");\n const cmpTags = [];\n const exclude = options.exclude || [];\n const customElements2 = win.customElements;\n const head = win.document.head;\n const metaCharset = /* @__PURE__ */ head.querySelector(\"meta[charset]\");\n const dataStyles = /* @__PURE__ */ win.document.createElement(\"style\");\n const deferredConnectedCallbacks = [];\n let appLoadFallback;\n let isBootstrapping = true;\n Object.assign(plt, options);\n plt.$resourcesUrl$ = new URL(options.resourcesUrl || \"./\", win.document.baseURI).href;\n if (BUILD27.asyncQueue) {\n if (options.syncQueue) {\n plt.$flags$ |= 4 /* queueSync */;\n }\n }\n if (BUILD27.hydrateClientSide) {\n plt.$flags$ |= 2 /* appLoaded */;\n }\n if (BUILD27.hydrateClientSide && BUILD27.shadowDom) {\n hydrateScopedToShadow();\n }\n let hasSlotRelocation = false;\n lazyBundles.map((lazyBundle) => {\n lazyBundle[1].map((compactMeta) => {\n var _a2;\n const cmpMeta = {\n $flags$: compactMeta[0],\n $tagName$: compactMeta[1],\n $members$: compactMeta[2],\n $listeners$: compactMeta[3]\n };\n if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {\n hasSlotRelocation = true;\n }\n if (BUILD27.member) {\n cmpMeta.$members$ = compactMeta[2];\n }\n if (BUILD27.hostListener) {\n cmpMeta.$listeners$ = compactMeta[3];\n }\n if (BUILD27.reflect) {\n cmpMeta.$attrsToReflect$ = [];\n }\n if (BUILD27.watchCallback) {\n cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};\n }\n if (BUILD27.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {\n cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;\n }\n const tagName = BUILD27.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;\n const HostElement = class extends HTMLElement {\n // StencilLazyHost\n constructor(self) {\n super(self);\n this.hasRegisteredEventListeners = false;\n self = this;\n registerHost(self, cmpMeta);\n if (BUILD27.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {\n if (supportsShadow) {\n if (!self.shadowRoot) {\n if (BUILD27.shadowDelegatesFocus) {\n self.attachShadow({\n mode: \"open\",\n delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)\n });\n } else {\n self.attachShadow({ mode: \"open\" });\n }\n } else {\n if (self.shadowRoot.mode !== \"open\") {\n throw new Error(\n `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${self.shadowRoot.mode} but Stencil only supports open shadow roots.`\n );\n }\n }\n } else if (!BUILD27.hydrateServerSide && !(\"shadowRoot\" in self)) {\n self.shadowRoot = self;\n }\n }\n }\n connectedCallback() {\n const hostRef = getHostRef(this);\n if (!this.hasRegisteredEventListeners) {\n this.hasRegisteredEventListeners = true;\n addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);\n }\n if (appLoadFallback) {\n clearTimeout(appLoadFallback);\n appLoadFallback = null;\n }\n if (isBootstrapping) {\n deferredConnectedCallbacks.push(this);\n } else {\n plt.jmp(() => connectedCallback(this));\n }\n }\n disconnectedCallback() {\n plt.jmp(() => disconnectedCallback(this));\n plt.raf(() => {\n var _a3;\n const hostRef = getHostRef(this);\n const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);\n if (i2 > -1) {\n deferredConnectedCallbacks.splice(i2, 1);\n }\n if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {\n delete hostRef.$vnode$.$elm$;\n }\n });\n }\n componentOnReady() {\n return getHostRef(this).$onReadyPromise$;\n }\n };\n if (BUILD27.experimentalSlotFixes) {\n if (BUILD27.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n patchPseudoShadowDom(HostElement.prototype);\n }\n } else {\n if (BUILD27.slotChildNodesFix) {\n patchChildSlotNodes(HostElement.prototype);\n }\n if (BUILD27.cloneNodeFix) {\n patchCloneNode(HostElement.prototype);\n }\n if (BUILD27.appendChildSlotFix) {\n patchSlotAppendChild(HostElement.prototype);\n }\n if (BUILD27.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n patchTextContent(HostElement.prototype);\n }\n }\n if (BUILD27.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {\n HostElement.formAssociated = true;\n }\n if (BUILD27.hotModuleReplacement) {\n HostElement.prototype[\"s-hmr\"] = function(hmrVersionId) {\n hmrStart(this, cmpMeta, hmrVersionId);\n };\n }\n cmpMeta.$lazyBundleId$ = lazyBundle[0];\n if (!exclude.includes(tagName) && !customElements2.get(tagName)) {\n cmpTags.push(tagName);\n customElements2.define(\n tagName,\n proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)\n );\n }\n });\n });\n if (cmpTags.length > 0) {\n if (hasSlotRelocation) {\n dataStyles.textContent += SLOT_FB_CSS;\n }\n if (BUILD27.invisiblePrehydration && (BUILD27.hydratedClass || BUILD27.hydratedAttribute)) {\n dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;\n }\n if (dataStyles.innerHTML.length) {\n dataStyles.setAttribute(\"data-styles\", \"\");\n const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);\n if (nonce != null) {\n dataStyles.setAttribute(\"nonce\", nonce);\n }\n head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);\n }\n }\n isBootstrapping = false;\n if (deferredConnectedCallbacks.length) {\n deferredConnectedCallbacks.map((host) => host.connectedCallback());\n } else {\n if (BUILD27.profile) {\n plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, \"timeout\"));\n } else {\n plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));\n }\n }\n endBootstrap();\n};\n\n// src/runtime/fragment.ts\nvar Fragment = (_, children) => children;\n\n// src/runtime/host-listener.ts\nimport { BUILD as BUILD28 } from \"@stencil/core/internal/app-data\";\nvar addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {\n if (BUILD28.hostListener && listeners && win.document) {\n if (BUILD28.hostListenerTargetParent) {\n if (attachParentListeners) {\n listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);\n } else {\n listeners = listeners.filter(([flags]) => !(flags & 32 /* TargetParent */));\n }\n }\n listeners.map(([flags, name, method]) => {\n const target = BUILD28.hostListenerTarget ? getHostListenerTarget(win.document, elm, flags) : elm;\n const handler = hostListenerProxy(hostRef, method);\n const opts = hostListenerOpts(flags);\n plt.ael(target, name, handler, opts);\n (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));\n });\n }\n};\nvar hostListenerProxy = (hostRef, methodName) => (ev) => {\n var _a;\n try {\n if (BUILD28.lazyLoad) {\n if (hostRef.$flags$ & 256 /* isListenReady */) {\n (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);\n } else {\n (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);\n }\n } else {\n hostRef.$hostElement$[methodName](ev);\n }\n } catch (e) {\n consoleError(e, hostRef.$hostElement$);\n }\n};\nvar getHostListenerTarget = (doc, elm, flags) => {\n if (BUILD28.hostListenerTargetDocument && flags & 4 /* TargetDocument */) {\n return doc;\n }\n if (BUILD28.hostListenerTargetWindow && flags & 8 /* TargetWindow */) {\n return win;\n }\n if (BUILD28.hostListenerTargetBody && flags & 16 /* TargetBody */) {\n return doc.body;\n }\n if (BUILD28.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement) {\n return elm.parentElement;\n }\n return elm;\n};\nvar hostListenerOpts = (flags) => supportsListenerOptions ? {\n passive: (flags & 1 /* Passive */) !== 0,\n capture: (flags & 2 /* Capture */) !== 0\n} : (flags & 2 /* Capture */) !== 0;\n\n// src/runtime/nonce.ts\nvar setNonce = (nonce) => plt.$nonce$ = nonce;\n\n// src/runtime/platform-options.ts\nvar setPlatformOptions = (opts) => Object.assign(plt, opts);\n\n// src/runtime/vdom/vdom-annotations.ts\nvar insertVdomAnnotations = (doc, staticComponents) => {\n if (doc != null) {\n const docData = STENCIL_DOC_DATA in doc ? doc[STENCIL_DOC_DATA] : { ...DEFAULT_DOC_DATA };\n docData.staticComponents = new Set(staticComponents);\n const orgLocationNodes = [];\n parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);\n orgLocationNodes.forEach((orgLocationNode) => {\n var _a;\n if (orgLocationNode != null && orgLocationNode[\"s-nr\"]) {\n const nodeRef = orgLocationNode[\"s-nr\"];\n let hostId = nodeRef[\"s-host-id\"];\n let nodeId = nodeRef[\"s-node-id\"];\n let childId = `${hostId}.${nodeId}`;\n if (hostId == null) {\n hostId = 0;\n docData.rootLevelIds++;\n nodeId = docData.rootLevelIds;\n childId = `${hostId}.${nodeId}`;\n if (nodeRef.nodeType === 1 /* ElementNode */) {\n nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);\n if (typeof nodeRef[\"s-sn\"] === \"string\" && !nodeRef.getAttribute(\"slot\")) {\n nodeRef.setAttribute(\"s-sn\", nodeRef[\"s-sn\"]);\n }\n } else if (nodeRef.nodeType === 3 /* TextNode */) {\n if (hostId === 0) {\n const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim();\n if (textContent === \"\") {\n orgLocationNode.remove();\n return;\n }\n }\n const commentBeforeTextNode = doc.createComment(childId);\n commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;\n insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef);\n } else if (nodeRef.nodeType === 8 /* CommentNode */) {\n const commentBeforeTextNode = doc.createComment(childId);\n commentBeforeTextNode.nodeValue = `${COMMENT_NODE_ID}.${childId}`;\n nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);\n }\n }\n let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;\n const orgLocationParentNode = orgLocationNode.parentElement;\n if (orgLocationParentNode) {\n if (orgLocationParentNode[\"s-en\"] === \"\") {\n orgLocationNodeId += `.`;\n } else if (orgLocationParentNode[\"s-en\"] === \"c\") {\n orgLocationNodeId += `.c`;\n }\n }\n orgLocationNode.nodeValue = orgLocationNodeId;\n }\n });\n }\n};\nvar parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {\n var _a;\n if (node == null) {\n return;\n }\n if (node[\"s-nr\"] != null) {\n orgLocationNodes.push(node);\n }\n if (node.nodeType === 1 /* ElementNode */) {\n const childNodes = [...Array.from(node.childNodes), ...Array.from(((_a = node.shadowRoot) == null ? void 0 : _a.childNodes) || [])];\n childNodes.forEach((childNode) => {\n const hostRef = getHostRef(childNode);\n if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {\n const cmpData = {\n nodeIds: 0\n };\n insertVNodeAnnotations(doc, childNode, hostRef.$vnode$, docData, cmpData);\n }\n parseVNodeAnnotations(doc, childNode, docData, orgLocationNodes);\n });\n }\n};\nvar insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {\n if (vnode != null) {\n const hostId = ++docData.hostIds;\n hostElm.setAttribute(HYDRATE_ID, hostId);\n if (hostElm[\"s-cr\"] != null) {\n hostElm[\"s-cr\"].nodeValue = `${CONTENT_REF_ID}.${hostId}`;\n }\n if (vnode.$children$ != null) {\n const depth = 0;\n vnode.$children$.forEach((vnodeChild, index) => {\n insertChildVNodeAnnotations(doc, vnodeChild, cmpData, hostId, depth, index);\n });\n }\n if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute(HYDRATE_CHILD_ID)) {\n const parent = hostElm.parentElement;\n if (parent && parent.childNodes) {\n const parentChildNodes = Array.from(parent.childNodes);\n const comment = parentChildNodes.find(\n (node) => node.nodeType === 8 /* CommentNode */ && node[\"s-sr\"]\n );\n if (comment) {\n const index = parentChildNodes.indexOf(hostElm) - 1;\n vnode.$elm$.setAttribute(\n HYDRATE_CHILD_ID,\n `${comment[\"s-host-id\"]}.${comment[\"s-node-id\"]}.0.${index}`\n );\n }\n }\n }\n }\n};\nvar insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, index) => {\n const childElm = vnodeChild.$elm$;\n if (childElm == null) {\n return;\n }\n const nodeId = cmpData.nodeIds++;\n const childId = `${hostId}.${nodeId}.${depth}.${index}`;\n childElm[\"s-host-id\"] = hostId;\n childElm[\"s-node-id\"] = nodeId;\n if (childElm.nodeType === 1 /* ElementNode */) {\n childElm.setAttribute(HYDRATE_CHILD_ID, childId);\n if (typeof childElm[\"s-sn\"] === \"string\" && !childElm.getAttribute(\"slot\")) {\n childElm.setAttribute(\"s-sn\", childElm[\"s-sn\"]);\n }\n } else if (childElm.nodeType === 3 /* TextNode */) {\n const parentNode = childElm.parentNode;\n const nodeName = parentNode == null ? void 0 : parentNode.nodeName;\n if (nodeName !== \"STYLE\" && nodeName !== \"SCRIPT\") {\n const textNodeId = `${TEXT_NODE_ID}.${childId}`;\n const commentBeforeTextNode = doc.createComment(textNodeId);\n insertBefore(parentNode, commentBeforeTextNode, childElm);\n }\n } else if (childElm.nodeType === 8 /* CommentNode */) {\n if (childElm[\"s-sr\"]) {\n const slotName = childElm[\"s-sn\"] || \"\";\n const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`;\n childElm.nodeValue = slotNodeId;\n }\n }\n if (vnodeChild.$children$ != null) {\n const childDepth = depth + 1;\n vnodeChild.$children$.forEach((vnode, index2) => {\n insertChildVNodeAnnotations(doc, vnode, cmpData, hostId, childDepth, index2);\n });\n }\n};\nexport {\n BUILD29 as BUILD,\n Build,\n Env,\n Fragment,\n H,\n H as HTMLElement,\n Host,\n NAMESPACE2 as NAMESPACE,\n STENCIL_DEV_MODE,\n addHostEventListeners,\n bootstrapLazy,\n cmpModules,\n connectedCallback,\n consoleDevError,\n consoleDevInfo,\n consoleDevWarn,\n consoleError,\n createEvent,\n defineCustomElement,\n disconnectedCallback,\n forceModeUpdate,\n forceUpdate,\n getAssetPath,\n getElement,\n getHostRef,\n getMode,\n getRenderingRef,\n getValue,\n h,\n insertVdomAnnotations,\n isMemberInElement,\n loadModule,\n modeResolutionChain,\n nextTick,\n parsePropertyValue,\n plt,\n postUpdateComponent,\n promiseResolve,\n proxyComponent,\n proxyCustomElement,\n readTask,\n registerHost,\n registerInstance,\n renderVdom,\n setAssetPath,\n setErrorHandler,\n setMode,\n setNonce,\n setPlatformHelpers,\n setPlatformOptions,\n setValue,\n styles,\n supportsConstructableStylesheets,\n supportsListenerOptions,\n supportsShadow,\n win,\n writeTask\n};\n","export var GangLogLevel;\n(function (GangLogLevel) {\n GangLogLevel[GangLogLevel[\"Trace\"] = 0] = \"Trace\";\n GangLogLevel[GangLogLevel[\"Debug\"] = 1] = \"Debug\";\n GangLogLevel[GangLogLevel[\"Information\"] = 2] = \"Information\";\n GangLogLevel[GangLogLevel[\"Warning\"] = 3] = \"Warning\";\n GangLogLevel[GangLogLevel[\"Error\"] = 4] = \"Error\";\n})(GangLogLevel || (GangLogLevel = {}));\n","const doNothing = () => {\n /* do nothing */\n};\nexport const gangNoOpLogger = {\n trace: doNothing,\n debug: doNothing,\n info: doNothing,\n warn: doNothing,\n error: doNothing\n};\n","/**\n * Small wrapper for HTTP functions\n */\nexport class GangHttp {\n constructor(rootPath) {\n this.rootPath = rootPath;\n }\n fetch(url, init) {\n return fetch(`${this.rootPath}${url}`, init);\n }\n}\n","/**\n * Small wrapper for location functions\n */\nexport class GangLocationService {\n get host() {\n return location.host;\n }\n get origin() {\n return `${location.protocol}//${location.host}`;\n }\n get href() {\n return location.href;\n }\n pushState(url) {\n history.pushState(null, document.title, url);\n }\n static get instance() {\n return GangLocationService._instance || (GangLocationService._instance = new GangLocationService());\n }\n}\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","export function createErrorClass(createImpl) {\n const _super = (instance) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport const UnsubscriptionError = createErrorClass((_super) => function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nexport class Subscription {\n constructor(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n unsubscribe() {\n let errors;\n if (!this.closed) {\n this.closed = true;\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n add(teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n }\n _hasParent(parent) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n _addParent(parent) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n _removeParent(parent) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n remove(teardown) {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\nSubscription.EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n})();\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export const config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","export const timeoutProvider = {\n setTimeout(handler, timeout, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","export const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined))();\nexport function errorNotification(error) {\n return createNotification('E', undefined, error);\n}\nexport function nextNotification(value) {\n return createNotification('N', value, undefined);\n}\nexport function createNotification(kind, value, error) {\n return {\n kind,\n value,\n error,\n };\n}\n//# sourceMappingURL=NotificationFactories.js.map","import { config } from '../config';\nlet context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nexport class Subscriber extends Subscription {\n constructor(destination) {\n super();\n this.isStopped = false;\n if (destination) {\n this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(this);\n }\n }\n else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n static create(next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n }\n next(value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n }\n error(err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n }\n complete() {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n }\n unsubscribe() {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null;\n }\n }\n _next(value) {\n this.destination.next(value);\n }\n _error(err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n _complete() {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n }\n}\nconst _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nclass ConsumerObserver {\n constructor(partialObserver) {\n this.partialObserver = partialObserver;\n }\n next(value) {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n error(err) {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n }\n complete() {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\nexport class SafeSubscriber extends Subscriber {\n constructor(observerOrNext, error, complete) {\n super();\n let partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n let context;\n if (this && config.useDeprecatedNextContext) {\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\nexport const EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export const observable = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe(...fns) {\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce((prev, fn) => fn(prev), input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nexport class Observable {\n constructor(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n lift(operator) {\n const observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n subscribe(observerOrNext, error, complete) {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n this._subscribe(subscriber)\n :\n this._trySubscribe(subscriber));\n });\n return subscriber;\n }\n _trySubscribe(sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n }\n forEach(next, promiseCtor) {\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor((resolve, reject) => {\n const subscriber = new SafeSubscriber({\n next: (value) => {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n });\n }\n _subscribe(subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n }\n [Symbol_observable]() {\n return this;\n }\n pipe(...operations) {\n return pipeFromArray(operations)(this);\n }\n toPromise(promiseCtor) {\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor((resolve, reject) => {\n let value;\n this.subscribe((x) => (value = x), (err) => reject(err), () => resolve(value));\n });\n }\n}\nObservable.create = (subscribe) => {\n return new Observable(subscribe);\n};\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { createErrorClass } from './createErrorClass';\nexport const ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nexport class Subject extends Observable {\n constructor() {\n super();\n this.closed = false;\n this.currentObservers = null;\n this.observers = [];\n this.isStopped = false;\n this.hasError = false;\n this.thrownError = null;\n }\n lift(operator) {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n }\n _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n next(value) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n error(err) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n }\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n }\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n }\n get observed() {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n }\n _trySubscribe(subscriber) {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n _subscribe(subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n _innerSubscribe(subscriber) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n _checkFinalizedStatuses(subscriber) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n }\n asObservable() {\n const observable = new Observable();\n observable.source = this;\n return observable;\n }\n}\nSubject.create = (destination, source) => {\n return new AnonymousSubject(destination, source);\n};\nexport class AnonymousSubject extends Subject {\n constructor(destination, source) {\n super();\n this.destination = destination;\n this.source = source;\n }\n next(value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n }\n error(err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n }\n complete() {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n _subscribe(subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n }\n}\n//# sourceMappingURL=Subject.js.map","import { Subject } from './Subject';\nexport class BehaviorSubject extends Subject {\n constructor(_value) {\n super();\n this._value = _value;\n }\n get value() {\n return this.getValue();\n }\n _subscribe(subscriber) {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n getValue() {\n const { hasError, thrownError, _value } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n next(value) {\n super.next((this._value = value));\n }\n}\n//# sourceMappingURL=BehaviorSubject.js.map","export const dateTimestampProvider = {\n now() {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { Subject } from './Subject';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nexport class ReplaySubject extends Subject {\n constructor(_bufferSize = Infinity, _windowTime = Infinity, _timestampProvider = dateTimestampProvider) {\n super();\n this._bufferSize = _bufferSize;\n this._windowTime = _windowTime;\n this._timestampProvider = _timestampProvider;\n this._buffer = [];\n this._infiniteTimeWindow = true;\n this._infiniteTimeWindow = _windowTime === Infinity;\n this._bufferSize = Math.max(1, _bufferSize);\n this._windowTime = Math.max(1, _windowTime);\n }\n next(value) {\n const { isStopped, _buffer, _infiniteTimeWindow, _timestampProvider, _windowTime } = this;\n if (!isStopped) {\n _buffer.push(value);\n !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);\n }\n this._trimBuffer();\n super.next(value);\n }\n _subscribe(subscriber) {\n this._throwIfClosed();\n this._trimBuffer();\n const subscription = this._innerSubscribe(subscriber);\n const { _infiniteTimeWindow, _buffer } = this;\n const copy = _buffer.slice();\n for (let i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {\n subscriber.next(copy[i]);\n }\n this._checkFinalizedStatuses(subscriber);\n return subscription;\n }\n _trimBuffer() {\n const { _bufferSize, _timestampProvider, _buffer, _infiniteTimeWindow } = this;\n const adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;\n _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);\n if (!_infiniteTimeWindow) {\n const now = _timestampProvider.now();\n let last = 0;\n for (let i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) {\n last = i;\n }\n last && _buffer.splice(0, last + 1);\n }\n }\n}\n//# sourceMappingURL=ReplaySubject.js.map","export function base64UrlToBytes(value) {\n return Uint8Array.from(atob(value.replace(/-/g, '+').replace(/_/g, '/')), (c) => c.charCodeAt(0));\n}\n","export function bytesToString(value) {\n return String.fromCharCode.apply(null, new Uint8Array(value));\n}\n","import { bytesToString } from './bytesToString';\nexport function bytesToBase64Url(value) {\n return btoa(bytesToString(value)).replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n}\n","/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2014-2016 Patrick Gansterer \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n/* eslint-disable */\nconst POW_2_24 = 5.960464477539063e-8, POW_2_32 = 4294967296, POW_2_53 = 9007199254740992;\nfunction encode(value) {\n let data = new ArrayBuffer(256);\n let dataView = new DataView(data);\n let lastLength;\n let offset = 0;\n function prepareWrite(length) {\n let newByteLength = data.byteLength;\n const requiredLength = offset + length;\n while (newByteLength < requiredLength)\n newByteLength <<= 1;\n if (newByteLength !== data.byteLength) {\n const oldDataView = dataView;\n data = new ArrayBuffer(newByteLength);\n dataView = new DataView(data);\n const uint32count = (offset + 3) >> 2;\n for (let i = 0; i < uint32count; ++i)\n dataView.setUint32(i << 2, oldDataView.getUint32(i << 2));\n }\n lastLength = length;\n return dataView;\n }\n function commitWrite(_) {\n offset += lastLength;\n }\n function writeFloat64(value) {\n commitWrite(prepareWrite(8).setFloat64(offset, value));\n }\n function writeUint8(value) {\n commitWrite(prepareWrite(1).setUint8(offset, value));\n }\n function writeUint8Array(value) {\n const dataView = prepareWrite(value.length);\n for (let i = 0; i < value.length; ++i)\n dataView.setUint8(offset + i, value[i]);\n commitWrite();\n }\n function writeUint16(value) {\n commitWrite(prepareWrite(2).setUint16(offset, value));\n }\n function writeUint32(value) {\n commitWrite(prepareWrite(4).setUint32(offset, value));\n }\n function writeUint64(value) {\n const low = value % POW_2_32;\n const high = (value - low) / POW_2_32;\n const dataView = prepareWrite(8);\n dataView.setUint32(offset, high);\n dataView.setUint32(offset + 4, low);\n commitWrite();\n }\n function writeTypeAndLength(type, length) {\n if (length < 24) {\n writeUint8((type << 5) | length);\n }\n else if (length < 0x100) {\n writeUint8((type << 5) | 24);\n writeUint8(length);\n }\n else if (length < 0x10000) {\n writeUint8((type << 5) | 25);\n writeUint16(length);\n }\n else if (length < 0x100000000) {\n writeUint8((type << 5) | 26);\n writeUint32(length);\n }\n else {\n writeUint8((type << 5) | 27);\n writeUint64(length);\n }\n }\n function encodeItem(value) {\n let i;\n if (value === false)\n return writeUint8(0xf4);\n if (value === true)\n return writeUint8(0xf5);\n if (value === null)\n return writeUint8(0xf6);\n if (value === undefined)\n return writeUint8(0xf7);\n switch (typeof value) {\n case 'number':\n if (Math.floor(value) === value) {\n if (0 <= value && value <= POW_2_53)\n return writeTypeAndLength(0, value);\n if (-POW_2_53 <= value && value < 0)\n return writeTypeAndLength(1, -(value + 1));\n }\n writeUint8(0xfb);\n return writeFloat64(value);\n case 'string':\n const utf8data = [];\n for (let i = 0; i < value.length; ++i) {\n let charCode = value.charCodeAt(i);\n if (charCode < 0x80) {\n utf8data.push(charCode);\n }\n else if (charCode < 0x800) {\n utf8data.push(0xc0 | (charCode >> 6));\n utf8data.push(0x80 | (charCode & 0x3f));\n }\n else if (charCode < 0xd800) {\n utf8data.push(0xe0 | (charCode >> 12));\n utf8data.push(0x80 | ((charCode >> 6) & 0x3f));\n utf8data.push(0x80 | (charCode & 0x3f));\n }\n else {\n charCode = (charCode & 0x3ff) << 10;\n charCode |= value.charCodeAt(++i) & 0x3ff;\n charCode += 0x10000;\n utf8data.push(0xf0 | (charCode >> 18));\n utf8data.push(0x80 | ((charCode >> 12) & 0x3f));\n utf8data.push(0x80 | ((charCode >> 6) & 0x3f));\n utf8data.push(0x80 | (charCode & 0x3f));\n }\n }\n writeTypeAndLength(3, utf8data.length);\n return writeUint8Array(utf8data);\n default:\n let length;\n if (Array.isArray(value)) {\n length = value.length;\n writeTypeAndLength(4, length);\n for (i = 0; i < length; ++i)\n encodeItem(value[i]);\n }\n else if (value instanceof Uint8Array) {\n writeTypeAndLength(2, value.length);\n writeUint8Array(value);\n }\n else {\n const keys = Object.keys(value);\n length = keys.length;\n writeTypeAndLength(5, length);\n for (i = 0; i < length; ++i) {\n const key = keys[i];\n encodeItem(key);\n encodeItem(value[key]);\n }\n }\n }\n }\n encodeItem(value);\n if ('slice' in data)\n return data.slice(0, offset);\n const ret = new ArrayBuffer(offset);\n const retView = new DataView(ret);\n for (let i = 0; i < offset; ++i)\n retView.setUint8(i, dataView.getUint8(i));\n return ret;\n}\nfunction decode(data, tagger, simpleValue) {\n const dataView = new DataView(data);\n let offset = 0;\n if (typeof tagger !== 'function')\n tagger = function (value) {\n return value;\n };\n if (typeof simpleValue !== 'function')\n simpleValue = function () {\n return undefined;\n };\n function commitRead(length, value) {\n offset += length;\n return value;\n }\n function readArrayBuffer(length) {\n return commitRead(length, new Uint8Array(data, offset, length));\n }\n function readFloat16() {\n const tempArrayBuffer = new ArrayBuffer(4);\n const tempDataView = new DataView(tempArrayBuffer);\n const value = readUint16();\n const sign = value & 0x8000;\n let exponent = value & 0x7c00;\n const fraction = value & 0x03ff;\n if (exponent === 0x7c00)\n exponent = 0xff << 10;\n else if (exponent !== 0)\n exponent += (127 - 15) << 10;\n else if (fraction !== 0)\n return (sign ? -1 : 1) * fraction * POW_2_24;\n tempDataView.setUint32(0, (sign << 16) | (exponent << 13) | (fraction << 13));\n return tempDataView.getFloat32(0);\n }\n function readFloat32() {\n return commitRead(4, dataView.getFloat32(offset));\n }\n function readFloat64() {\n return commitRead(8, dataView.getFloat64(offset));\n }\n function readUint8() {\n return commitRead(1, dataView.getUint8(offset));\n }\n function readUint16() {\n return commitRead(2, dataView.getUint16(offset));\n }\n function readUint32() {\n return commitRead(4, dataView.getUint32(offset));\n }\n function readUint64() {\n return readUint32() * POW_2_32 + readUint32();\n }\n function readBreak() {\n if (dataView.getUint8(offset) !== 0xff)\n return false;\n offset += 1;\n return true;\n }\n function readLength(additionalInformation) {\n if (additionalInformation < 24)\n return additionalInformation;\n if (additionalInformation === 24)\n return readUint8();\n if (additionalInformation === 25)\n return readUint16();\n if (additionalInformation === 26)\n return readUint32();\n if (additionalInformation === 27)\n return readUint64();\n if (additionalInformation === 31)\n return -1;\n throw 'Invalid length encoding';\n }\n function readIndefiniteStringLength(majorType) {\n const initialByte = readUint8();\n if (initialByte === 0xff)\n return -1;\n const length = readLength(initialByte & 0x1f);\n if (length < 0 || initialByte >> 5 !== majorType)\n throw 'Invalid indefinite length element';\n return length;\n }\n function appendUtf16Data(utf16data, length) {\n for (let i = 0; i < length; ++i) {\n let value = readUint8();\n if (value & 0x80) {\n if (value < 0xe0) {\n value = ((value & 0x1f) << 6) | (readUint8() & 0x3f);\n length -= 1;\n }\n else if (value < 0xf0) {\n value = ((value & 0x0f) << 12) | ((readUint8() & 0x3f) << 6) | (readUint8() & 0x3f);\n length -= 2;\n }\n else {\n value =\n ((value & 0x0f) << 18) | ((readUint8() & 0x3f) << 12) | ((readUint8() & 0x3f) << 6) | (readUint8() & 0x3f);\n length -= 3;\n }\n }\n if (value < 0x10000) {\n utf16data.push(value);\n }\n else {\n value -= 0x10000;\n utf16data.push(0xd800 | (value >> 10));\n utf16data.push(0xdc00 | (value & 0x3ff));\n }\n }\n }\n function decodeItem() {\n const initialByte = readUint8();\n const majorType = initialByte >> 5;\n const additionalInformation = initialByte & 0x1f;\n let i;\n let length;\n if (majorType === 7) {\n switch (additionalInformation) {\n case 25:\n return readFloat16();\n case 26:\n return readFloat32();\n case 27:\n return readFloat64();\n }\n }\n length = readLength(additionalInformation);\n if (length < 0 && (majorType < 2 || 6 < majorType))\n throw 'Invalid length';\n switch (majorType) {\n case 0:\n return length;\n case 1:\n return -1 - length;\n case 2:\n if (length < 0) {\n const elements = [];\n let fullArrayLength = 0;\n while ((length = readIndefiniteStringLength(majorType)) >= 0) {\n fullArrayLength += length;\n elements.push(readArrayBuffer(length));\n }\n const fullArray = new Uint8Array(fullArrayLength);\n let fullArrayOffset = 0;\n for (i = 0; i < elements.length; ++i) {\n fullArray.set(elements[i], fullArrayOffset);\n fullArrayOffset += elements[i].length;\n }\n return fullArray;\n }\n return readArrayBuffer(length);\n case 3:\n const utf16data = [];\n if (length < 0) {\n while ((length = readIndefiniteStringLength(majorType)) >= 0)\n appendUtf16Data(utf16data, length);\n }\n else\n appendUtf16Data(utf16data, length);\n return String.fromCharCode.apply(null, utf16data);\n case 4:\n let retArray;\n if (length < 0) {\n retArray = [];\n while (!readBreak())\n retArray.push(decodeItem());\n }\n else {\n retArray = new Array(length);\n for (i = 0; i < length; ++i)\n retArray[i] = decodeItem();\n }\n return retArray;\n case 5:\n const retObject = {};\n for (i = 0; i < length || (length < 0 && !readBreak()); ++i) {\n const key = decodeItem();\n retObject[key] = decodeItem();\n }\n return retObject;\n case 6:\n return tagger(decodeItem(), length);\n case 7:\n switch (length) {\n case 20:\n return false;\n case 21:\n return true;\n case 22:\n return null;\n case 23:\n return undefined;\n default:\n return simpleValue(length);\n }\n }\n }\n const ret = decodeItem();\n if (offset !== data.byteLength)\n throw 'Remaining bytes';\n return ret;\n}\nexport const CBOR = {\n encode,\n decode\n};\n","/* Remove properties given a test\n * Defaults removing null properties\n */\nexport function clean(obj, test = (v) => v == null) {\n if (obj == null)\n return obj;\n return Object.entries(obj).reduce((n, [k, v]) => (test(v) ? n : ((n[k] = v), n)), {});\n}\n","export class GangUrlBuilder {\n constructor(urlString) {\n const protocolSplit = urlString.split(':');\n if (protocolSplit.length < 2)\n throw new Error(`GangUrlBuilder.ctor protocol not found ${urlString}`);\n this.protocol = protocolSplit[0];\n const path = protocolSplit.slice(1).join(':').split('?');\n this.root = path[0];\n this.parameters = {};\n if (path[1]) {\n path[1].split('&').forEach((part) => {\n const kv = part.split('=');\n this.addParameter(kv[0], kv[1]);\n });\n }\n }\n static from(urlString) {\n return new GangUrlBuilder(urlString);\n }\n addParameter(key, value) {\n if (!key)\n throw new Error('GangUrlBuilder.add key is required');\n if (!value)\n throw new Error('GangUrlBuilder.add value is required');\n if (this.parameters[key] != null) {\n this.parameters[key].push(value);\n }\n else {\n this.parameters[key] = [value];\n }\n return this;\n }\n setParameter(key, value) {\n if (!key)\n throw new Error('GangUrlBuilder.set key is required');\n if (!value) {\n delete this.parameters[key];\n }\n else if (Array.isArray(value)) {\n this.parameters[key] = value;\n }\n else {\n this.parameters[key] = [value];\n }\n return this;\n }\n setParameters(data) {\n if (data == null)\n return this;\n return Object.entries(data).reduce((o, [k, v]) => o.setParameter(k, v), this);\n }\n getParameterString(key) {\n return this.parameters[key] === undefined ? undefined : this.parameters[key][0];\n }\n removeParameter(key) {\n delete this.parameters[key];\n return this;\n }\n build() {\n let url = `${this.protocol}:${this.root}`;\n if (this.parameters) {\n const keys = Object.keys(this.parameters);\n if (keys.length) {\n let separator = '?';\n keys.forEach((key) => {\n const values = this.parameters[key];\n values.forEach((value) => {\n url += `${separator}${key}=${value}`;\n separator = '&';\n });\n });\n }\n }\n return url;\n }\n}\n","export const getGangId = (function () {\n const map = [];\n const dash = [3, 5, 7, 9];\n for (let i = 0; i < 256; i++) {\n map[i] = (i < 16 ? '0' : '') + i.toString(16);\n }\n return () => {\n const r = crypto.getRandomValues(new Uint8Array(16));\n r[6] = (r[6] & 0x0f) | 0x40;\n r[8] = (r[8] & 0x3f) | 0x80;\n return [...r.entries()].map((v, i) => `${map[v[1]]}${dash.includes(i) ? '-' : ''}`).join('');\n };\n})();\n","export function getRandomBytes(length = 16) {\n return globalThis.crypto.getRandomValues(new Uint8Array(length));\n}\n","export function readString(buffer, start = 0, length) {\n return String.fromCharCode.apply(null, new Uint8Array(length ? buffer.slice(start, start + length) : buffer.slice(start)));\n}\n","export function readUint32(buffer, start = 0) {\n return new Uint32Array(buffer.slice(start, start + 4))[0];\n}\n","export function stringToBytes(value) {\n return Uint8Array.from(value, (c) => c.charCodeAt(0));\n}\n","export function viewToBuffer(view) {\n if (view == null)\n return null;\n if (view instanceof ArrayBuffer)\n return view;\n return view.buffer.slice(view.byteOffset, view.byteOffset + view.byteLength);\n}\n","import { bytesToBase64Url } from '../../services/utils';\nexport class GangAuthentication {\n constructor(credentialId, clientData, authenticatorData, signature) {\n this.credentialId = credentialId;\n this.clientData = clientData;\n this.authenticatorData = authenticatorData;\n this.signature = signature;\n }\n static from(credentialId, clientDataJSON, authenticatorData, signature) {\n return new GangAuthentication(credentialId, bytesToBase64Url(clientDataJSON), bytesToBase64Url(authenticatorData), bytesToBase64Url(signature));\n }\n}\n","export class GangAuthenticationCredential {\n constructor(id, transports) {\n this.id = id;\n this.transports = transports;\n }\n static from(data) {\n return new GangAuthenticationCredential(data.id, data.transports);\n }\n}\n","import { bytesToBase64Url, CBOR, viewToBuffer } from '../../services/utils';\nexport class GangPublicKey {\n constructor(keyType, algorithm, parameters) {\n this.keyType = keyType;\n this.algorithm = algorithm;\n this.parameters = parameters;\n }\n static from(data) {\n if (data == null)\n return null;\n const cbor = CBOR.decode(data);\n let keyType;\n let algorithm;\n const parameters = Object.keys(cbor).reduce((p, k) => {\n const data = cbor[k];\n switch (k) {\n case '1':\n keyType = data;\n break;\n case '3':\n algorithm = data;\n break;\n default: {\n if (data != null) {\n if (data instanceof ArrayBuffer)\n p[k] = bytesToBase64Url(data);\n else if (ArrayBuffer.isView(data))\n p[k] = bytesToBase64Url(viewToBuffer(data));\n else\n p[k] = data.toString();\n }\n break;\n }\n }\n return p;\n }, {});\n return new GangPublicKey(keyType, algorithm, parameters);\n }\n}\n","import { bytesToBase64Url, bytesToString, viewToBuffer } from '../../services/utils';\nimport { GangPublicKey } from './GangPublicKey';\nexport class GangCredentialRegistration {\n constructor(credentialId, publicKey, transports, challenge) {\n this.credentialId = credentialId;\n this.publicKey = publicKey;\n this.transports = transports;\n this.challenge = challenge;\n }\n static from(authData, transports, challenge) {\n const buffer = viewToBuffer(authData);\n const idLength = new DataView(buffer).getInt16(53);\n return new GangCredentialRegistration(bytesToBase64Url(buffer.slice(55, 55 + idLength)), GangPublicKey.from(buffer.slice(55 + idLength)), transports, bytesToString(challenge));\n }\n}\n","export const NO_RETRY = -1;\nexport const RETRY_INIT = 5;\nexport const RETRY_MAX = 40;\n","/** wraps command data */\nexport class GangCommandWrapper {\n constructor(\n /** command data type */\n type, \n /** command data */\n data, \n /** sequence number */\n sn = undefined, \n /** in reply to sequence number */\n rsn = undefined) {\n this.type = type;\n this.data = data;\n this.sn = sn;\n this.rsn = rsn;\n }\n}\n","export var GangConnectionState;\n(function (GangConnectionState) {\n GangConnectionState[GangConnectionState[\"connecting\"] = 0] = \"connecting\";\n GangConnectionState[GangConnectionState[\"connected\"] = 1] = \"connected\";\n GangConnectionState[GangConnectionState[\"disconnected\"] = 2] = \"disconnected\";\n GangConnectionState[GangConnectionState[\"error\"] = 3] = \"error\";\n})(GangConnectionState || (GangConnectionState = {}));\n","export var GangEventTypes;\n(function (GangEventTypes) {\n GangEventTypes[\"Host\"] = \"H\";\n GangEventTypes[\"Member\"] = \"M\";\n GangEventTypes[\"Denied\"] = \"D\";\n GangEventTypes[\"MemberConnected\"] = \"+\";\n GangEventTypes[\"MemberDisconnected\"] = \"-\";\n GangEventTypes[\"Command\"] = \"C\";\n GangEventTypes[\"CommandReceipt\"] = \"R\";\n GangEventTypes[\"State\"] = \"S\";\n})(GangEventTypes || (GangEventTypes = {}));\n","export class GangWebSocket {\n constructor(parse, subject, send, close) {\n this.parse = parse;\n this.subject = subject;\n this.send = send;\n this.close = close;\n }\n subscribe(onMessage, error, complete) {\n return this.subject.subscribe({\n next: (e) => onMessage(this.parse(e.data)),\n error,\n complete\n });\n }\n}\n","export const GANG_COMMAND_TIMEDOUT = 'COMMAND_TIMEDOUT';\n","export const GANG_COMMAND_TIMEOUT_DEFAULT_MS = 30000;\n","export var GangCommandTypes;\n(function (GangCommandTypes) {\n GangCommandTypes[\"notify\"] = \"gangNotify\";\n})(GangCommandTypes || (GangCommandTypes = {}));\n","export var GangNotificationTypes;\n(function (GangNotificationTypes) {\n GangNotificationTypes[GangNotificationTypes[\"info\"] = 0] = \"info\";\n GangNotificationTypes[GangNotificationTypes[\"success\"] = 1] = \"success\";\n GangNotificationTypes[GangNotificationTypes[\"warning\"] = 2] = \"warning\";\n GangNotificationTypes[GangNotificationTypes[\"danger\"] = 3] = \"danger\";\n})(GangNotificationTypes || (GangNotificationTypes = {}));\n","import { BehaviorSubject, Subject, ReplaySubject } from 'rxjs';\nimport { GangContext } from '../context';\nimport { GangConnectionState, GangCommandWrapper, NO_RETRY, RETRY_INIT, RETRY_MAX, GangEventTypes, GANG_COMMAND_TIMEOUT_DEFAULT_MS, GANG_COMMAND_TIMEDOUT } from '../models';\nimport { GangUrlBuilder, clean } from './utils';\nexport class GangService {\n get connectionState() {\n return this.connectionSubject.value;\n }\n get isConnected() {\n return this.connectionSubject.value === GangConnectionState.connected;\n }\n constructor(webSocketFactory, settings = GangContext.defaultSettings, initialState = null) {\n this.webSocketFactory = webSocketFactory;\n this.settings = settings;\n this.initialState = initialState;\n this.retry = RETRY_INIT;\n this.retryingIn = undefined;\n this.unsentCommands = [];\n this.sn = 0;\n this.onConnection = this.connectionSubject = new BehaviorSubject(GangConnectionState.disconnected);\n this.onConnectionRetry = this.connectionRetrySubject = new Subject();\n this.onAuthenticated = this.authenticatedSubject = new ReplaySubject(1);\n this.onMemberConnected = this.memberConnectedSubject = new Subject();\n this.onMemberDisconnected = this.memberDisconnectedSubject = new Subject();\n this.onCommand = this.commandSubject = new Subject();\n this.onReceipt = this.receiptSubject = new Subject();\n this.onState = this.stateSubject = new BehaviorSubject(initialState);\n }\n /**\n * Connect to gang\n */\n async connect(parameters) {\n if (this.isConnected)\n await this.disconnect('reconnect');\n this.connectionParameters = Object.assign(Object.assign({}, this.connectionParameters), clean(parameters));\n GangContext.logger.debug('GangService.connect', this.connectionParameters);\n return new Promise((resolve) => {\n this.connectionSubject.next(GangConnectionState.connecting);\n const connectionUrlBuilder = GangUrlBuilder.from(this.settings.rootUrl + this.connectionParameters.path)\n .setParameters(this.connectionParameters.properties)\n .setParameter('gangId', this.connectionParameters.gangId)\n .setParameter('token', this.connectionParameters.token);\n const connectionUrl = connectionUrlBuilder.build();\n GangContext.logger.debug('GangService.connecting', this.settings.rootUrl + this.connectionParameters.path, connectionUrl);\n const retryConnect = (() => {\n if (this.retry === NO_RETRY || this.retrying || this.isConnected)\n return;\n GangContext.logger.debug('GangService.retryConnect in', this.retry);\n this.retryingIn = this.retry;\n this.retrying = window.setInterval(() => {\n this.retryingIn--;\n this.connectionRetrySubject.next(this.retryingIn);\n if (this.retryingIn === 0) {\n clearRetryConnect();\n this.connect(parameters).catch(() => {\n // do nothing.\n });\n }\n }, 1000);\n if (this.retry < RETRY_MAX)\n this.retry *= 2;\n }).bind(this);\n const clearRetryConnect = (() => {\n if (this.retrying) {\n clearInterval(this.retrying);\n this.retrying = null;\n }\n }).bind(this);\n try {\n this.webSocket = this.webSocketFactory(connectionUrl, (e) => {\n GangContext.logger.debug('GangService.onopen', e);\n this.connectionSubject.next(GangConnectionState.connected);\n this.retry = RETRY_INIT;\n this.retryingIn = undefined;\n resolve(true);\n let wrapper;\n while ((wrapper = this.unsentCommands.shift()))\n this.sendCommandWrapper(wrapper);\n window.removeEventListener('online', this.online);\n this.offline = () => {\n GangContext.logger.debug('GangService.offline');\n this.isConnected && this.disconnect(null);\n };\n window.addEventListener('offline', this.offline);\n clearRetryConnect();\n }, (e) => {\n GangContext.logger.debug('GangService.onerror', e);\n this.connectionSubject.next(GangConnectionState.error);\n resolve(false);\n }, (e) => {\n GangContext.logger.debug('GangService.onclose', e);\n this.connectionSubject.next(GangConnectionState.disconnected);\n window.removeEventListener('offline', this.offline);\n if (!e.reason) {\n this.online = () => {\n GangContext.logger.debug('GangService.online');\n !this.isConnected &&\n this.connect(parameters).catch(() => {\n // do nothing.\n });\n };\n window.addEventListener('online', this.online);\n retryConnect();\n }\n });\n this.webSocket.subscribe((e) => {\n GangContext.logger.debug('GangService.webSocket.message', e);\n switch (e.type) {\n case GangEventTypes.Host:\n this.isHost = true;\n this.memberId = e.auth.memberId;\n this.application = e.auth.application;\n this.authenticate(e.auth.token);\n break;\n case GangEventTypes.Member:\n this.isHost = false;\n this.memberId = e.auth.memberId;\n this.application = e.auth.application;\n this.authenticate(e.auth.token);\n break;\n case GangEventTypes.Denied:\n this.memberId = e.auth.memberId;\n this.application = e.auth.application;\n this.authenticate(null);\n break;\n case GangEventTypes.MemberConnected:\n this.memberConnectedSubject.next(e.memberId);\n break;\n case GangEventTypes.MemberDisconnected:\n this.memberDisconnectedSubject.next(e.memberId);\n break;\n case GangEventTypes.Command:\n this.commandSubject.next(e.wrapper);\n break;\n case GangEventTypes.CommandReceipt:\n this.receiptSubject.next(e.rsn);\n this.unsentCommands = this.unsentCommands.filter((w) => w.sn !== e.rsn);\n break;\n case GangEventTypes.State:\n this.stateSubject.next(Object.assign(Object.assign({}, this.stateSubject.value), e.state));\n break;\n }\n });\n }\n catch (err) {\n GangContext.logger.debug('GangService.connect', err);\n }\n retryConnect();\n });\n }\n authenticate(token) {\n this.isAuthenticated = !!token;\n this.authenticatedSubject.next(token);\n const state = this.initialState;\n this.stateSubject.next(state);\n }\n disconnect(reason = 'disconnected') {\n GangContext.logger.debug('GangService.disconnect');\n return new Promise((resolve) => {\n if (this.isConnected) {\n let wait = null;\n wait = this.connectionSubject.subscribe((state) => {\n if (state === GangConnectionState.disconnected) {\n GangContext.logger.debug('GangService.disconnect disconnected');\n wait === null || wait === void 0 ? void 0 : wait.unsubscribe();\n resolve();\n }\n });\n this.retry = NO_RETRY;\n this.webSocket.close(reason);\n }\n else {\n resolve();\n }\n });\n }\n /** Set the local current state, ie not sent to the server\n *\n * @param state the passed state will be shallow merged with the current state\n */\n setState(state) {\n this.stateSubject.next(Object.assign(Object.assign({}, this.stateSubject.value), state));\n }\n /**\n * Map gang events to the component\n *\n * @param component the component to map to\n */\n mapEvents(component) {\n const subs = [];\n [\n 'Connection',\n 'Authenticated',\n 'State',\n 'Command',\n 'MemberConnected',\n 'MemberDisconnected',\n 'ConnectionRetry'\n ].forEach((key) => {\n const componentKey = `onGang${key}`;\n const serviceKey = `on${key}`;\n if (component[componentKey])\n subs.push(this[serviceKey].subscribe((e) => component[componentKey](e)));\n else if (component[serviceKey] !== undefined)\n console.warn(`${serviceKey} changed to ${componentKey}, please update your code`, component);\n });\n const disconnectedCallback = component.disconnectedCallback;\n component.disconnectedCallback = () => {\n if (disconnectedCallback)\n disconnectedCallback.call(component);\n subs.forEach((sub) => sub.unsubscribe());\n };\n }\n /**\n * Map the actions to a component, injecting this service\n *\n * @param component the component to map to\n * @param actions a map of the executors e.g. { actionOne, actionTwo }\n */\n mapActions(component, actions) {\n Object.keys(actions).forEach((key) => {\n component[key] = actions[key](this);\n });\n }\n /**\n * Executes a command locally no data is sent to the host\n *\n * @param type Command type name\n * @param data Command data\n */\n executeCommand(type, data) {\n const wrapper = new GangCommandWrapper(type, data);\n GangContext.logger.debug('GangService.executeCommand', {\n wrapper,\n isConnected: this.isConnected\n });\n this.commandSubject.next(wrapper);\n }\n /**\n * Sends a command to the host member\n * await this if you expect a reply command from the host\n *\n * @param type Command type name\n * @param data Command data\n *\n * @returns a IGangCommandSent\n */\n sendCommand(type, data) {\n const sn = ++this.sn;\n const wrapper = new GangCommandWrapper(type, data, sn);\n GangContext.logger.debug('GangService.sendCommand', {\n wrapper,\n isConnected: this.isConnected\n });\n this.unsentCommands = [...this.unsentCommands, wrapper];\n if (!this.isConnected)\n return this.emptySent(wrapper.sn);\n if (this.isHost) {\n this.commandSubject.next(wrapper);\n return this.emptySent(wrapper.sn);\n }\n return this.sendCommandWrapper(wrapper);\n }\n sendCommandWrapper(wrapper) {\n this.send(JSON.stringify({\n type: wrapper.type,\n data: wrapper.data\n }), wrapper.sn);\n GangContext.logger.debug('GangService.sendCommandWrapper', wrapper);\n return {\n sn: wrapper.sn,\n wait: (options) => new Promise((resolve, reject) => {\n const commands = this.onCommand.subscribe((w) => {\n if (w.rsn == wrapper.sn) {\n commands.unsubscribe();\n receipts.unsubscribe();\n resolve(w);\n }\n });\n const receipts = this.onReceipt.subscribe((r) => {\n if (r == wrapper.sn) {\n commands.unsubscribe();\n receipts.unsubscribe();\n resolve(null);\n }\n });\n setTimeout(() => {\n commands.unsubscribe();\n receipts.unsubscribe();\n reject(GANG_COMMAND_TIMEDOUT);\n }, (options === null || options === void 0 ? void 0 : options.timeout) || GANG_COMMAND_TIMEOUT_DEFAULT_MS);\n })\n };\n }\n emptySent(sn) {\n return {\n sn,\n wait: () => Promise.resolve(null)\n };\n }\n sendState(state) {\n if (!this.isHost)\n throw new Error('only host can send state');\n this.stateSubject.next(state);\n this.send(JSON.stringify(state));\n GangContext.logger.debug('GangService.sendState', state);\n }\n send(data, sn) {\n let a = Uint8Array.from(data, (x) => x.charCodeAt(0));\n if (sn) {\n const sna = Uint32Array.from([sn]);\n a = new Uint8Array([...new Uint8Array(sna.buffer), ...a]);\n }\n try {\n this.webSocket.send(a.buffer);\n }\n catch (err) {\n GangContext.logger.error('GangService.send error', err);\n }\n }\n waitForCommand(type, predicate, options) {\n const test = (c) => {\n return (!type || type === c.type) && (!predicate || predicate(c.data));\n };\n return new Promise((resolve, reject) => {\n const sub = this.onCommand.subscribe((c) => {\n if (test(c)) {\n sub.unsubscribe();\n resolve();\n }\n });\n setTimeout(() => {\n sub.unsubscribe();\n reject();\n }, (options === null || options === void 0 ? void 0 : options.timeout) || 10000);\n });\n }\n waitForState(predicate, options) {\n return new Promise((resolve, reject) => {\n const sub = this.onState.subscribe((s) => {\n if (predicate(s)) {\n sub.unsubscribe();\n resolve();\n }\n });\n setTimeout(() => {\n sub.unsubscribe();\n reject();\n }, (options === null || options === void 0 ? void 0 : options.timeout) || 10000);\n });\n }\n}\n","import { GangContext } from '../../context';\nimport { GangCredentialRegistration, GangAuthentication, GangAuthenticationCredential } from '../../models';\nimport { GangUrlBuilder, base64UrlToBytes, bytesToBase64Url, bytesToString, CBOR, getRandomBytes, stringToBytes, viewToBuffer } from '../utils';\nconst USER_ID_KEY = 'AUTH.USER_ID';\nconst USER_TOKEN_KEY = 'AUTH.TOKEN';\nexport class GangAuthenticationService {\n /**\n * Create a service\n * @param settings\n * @param http\n * @param location\n * @param credentials\n * @param vault\n */\n constructor(settings, http, location, credentials, vault) {\n this.settings = settings;\n this.http = http;\n this.location = location;\n this.credentials = credentials;\n this.vault = vault;\n this._platform = {\n hasAuthenticator: true\n };\n if (window.PublicKeyCredential)\n PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable().then((value) => {\n this._platform = Object.assign(Object.assign({}, this.platform), { hasAuthenticator: value });\n });\n }\n get platform() {\n return this._platform;\n }\n /**\n * Request a link code\n *\n * @param email email address\n */\n async requestLink(email) {\n const result = await this.http.fetch(`/request-link`, {\n method: 'POST',\n headers: {\n 'Content-type': 'application/json'\n },\n body: `\"${email}\"`\n });\n return result.ok;\n }\n /**\n * gets the code from the current url and removes if found\n *\n * @param {string} [parameterName=link-code] - name of the url parameter\n */\n tryGetLinkCodeFromUrl(parameterName = 'link-code') {\n const urlBuilder = new GangUrlBuilder(this.location.href);\n const code = urlBuilder.getParameterString(parameterName);\n if (code) {\n // code found, remove from the url and link\n delete urlBuilder.parameters[parameterName];\n this.location.pushState(urlBuilder.build());\n return code;\n }\n return undefined;\n }\n /**\n * Attempts to get a session token, given a code\n *\n * @param {string} [code]\n */\n async validateLink(email, code) {\n const result = await this.http.fetch(`/validate-link`, {\n method: 'POST',\n headers: {\n 'Content-type': 'application/json'\n },\n body: JSON.stringify({\n email,\n code\n })\n });\n if (!result.ok)\n return undefined;\n return await result.text();\n }\n /**\n * Try and get a challenge for the user from the server\n *\n * @param token valid session token\n */\n async tryGetChallenge(token) {\n if (!token)\n return null;\n const headers = { 'Content-type': 'application/json' };\n if (token)\n headers['Authorization'] = token;\n const result = await this.http.fetch(`/request-challenge`, {\n method: 'POST',\n headers\n });\n if (!result.ok)\n return null;\n return stringToBytes(await result.text());\n }\n /**\n * Register a credential from the device on the server\n * shows the authenticator UI e.g. fingerprint, face or pin\n *\n * @param token required, valid session token\n * @param challenge required, challenge from the server\n *\n * @returns credential, which can be stored and passed to authenticateCredential\n */\n async registerCredential(token, challenge) {\n var _a;\n const tokenData = this.decodeToken(token);\n if (!tokenData)\n throw new Error('token is required');\n if (!challenge)\n throw new Error('challenge is required');\n const userId = crypto.getRandomValues(new Uint8Array(16));\n const options = {\n challenge,\n rp: {\n name: this.settings.app.name\n },\n user: {\n id: userId,\n name: tokenData.email,\n displayName: tokenData.name || tokenData.email\n },\n pubKeyCredParams: [\n { alg: -7, type: 'public-key' }, // ios, Android\n { alg: -257, type: 'public-key' } // windows hello\n ],\n authenticatorSelection: {\n authenticatorAttachment: this.platform.hasAuthenticator ? 'platform' : 'cross-platform',\n userVerification: 'discouraged',\n requireResidentKey: true,\n residentKey: 'preferred'\n },\n extensions: {\n prf: { eval: { first: userId } }\n },\n attestation: 'none'\n };\n try {\n const credential = (await this.credentials.create({ publicKey: options }));\n const response = credential.response;\n this.validate(response.clientDataJSON, challenge);\n const attestationObject = CBOR.decode(response.attestationObject);\n const transports = response.getTransports();\n const credentialRegistration = GangCredentialRegistration.from(attestationObject.authData, transports, challenge);\n const result = await this.http.fetch(`/register-credential`, {\n method: 'POST',\n headers: {\n 'Content-type': 'application/json',\n Authorization: token\n },\n body: JSON.stringify(credentialRegistration)\n });\n if (!result.ok)\n throw new Error('Credential was not registered');\n this.vault.set(USER_ID_KEY, userId);\n const extensionResults = credential.getClientExtensionResults();\n const seed = ((_a = extensionResults === null || extensionResults === void 0 ? void 0 : extensionResults.prf) === null || _a === void 0 ? void 0 : _a.results)\n ? viewToBuffer(extensionResults.prf.results.first)\n : viewToBuffer(userId);\n this.vault.setSeed(seed);\n await this.vault.setEncrypted(USER_TOKEN_KEY, token);\n GangContext.logger.debug('GangAuthenticationService.registerCredential success', {\n id: tokenData.id,\n prf: !!(extensionResults === null || extensionResults === void 0 ? void 0 : extensionResults.prf)\n });\n return new GangAuthenticationCredential(credential.id, transports);\n }\n catch (error) {\n GangContext.logger.error('GangAuthenticationService.registerCredential', { error });\n return null;\n }\n }\n /**\n * Validate the credential passed\n * shows the authenticator UI e.g. fingerprint, face or pin\n *\n * throws on failure\n *\n * offline will only do basic validation\n * online will pass back to the server for detailed auth\n *\n * @param credential Stored registered credential\n *\n * @returns when offline returns null, online will return a new session token\n */\n async validateCredential(credential) {\n var _a, _b;\n GangContext.logger.debug('GangAuthenticationService.validateCredential', { credential });\n const challenge = getRandomBytes();\n const options = {\n challenge,\n userVerification: 'required'\n };\n const userId = await this.vault.get(USER_ID_KEY);\n if (userId)\n options.extensions = {\n prf: { eval: { first: userId } }\n };\n if (credential)\n options.allowCredentials = [\n {\n id: base64UrlToBytes(credential.id),\n type: 'public-key',\n transports: credential.transports\n }\n ];\n let publicKey;\n try {\n publicKey = (await this.credentials.get({ publicKey: options }));\n }\n catch (error) {\n GangContext.logger.error('GangAuthenticationService.validateCredential', { error });\n return null;\n }\n const response = publicKey.response;\n this.validate(response.clientDataJSON, challenge);\n const extensionResults = publicKey.getClientExtensionResults();\n const seed = ((_a = extensionResults === null || extensionResults === void 0 ? void 0 : extensionResults.prf) === null || _a === void 0 ? void 0 : _a.results)\n ? viewToBuffer((_b = extensionResults.prf.results) === null || _b === void 0 ? void 0 : _b.first)\n : viewToBuffer(userId);\n this.vault.setSeed(seed);\n GangContext.logger.debug('GangAuthenticationService.validateCredential success', {\n prf: !!(extensionResults === null || extensionResults === void 0 ? void 0 : extensionResults.prf)\n });\n if (navigator.onLine) {\n const validation = GangAuthentication.from(credential.id, response.clientDataJSON, response.authenticatorData, response.signature);\n const result = await this.http.fetch(`/validate-credential`, {\n method: 'POST',\n headers: {\n 'Content-type': 'application/json'\n },\n body: JSON.stringify(validation)\n });\n if (!result.ok)\n throw new Error('Credential Invalid');\n const token = await result.text();\n await this.vault.setEncrypted(USER_TOKEN_KEY, token);\n return token;\n }\n return await this.vault.getEncrypted(USER_TOKEN_KEY); // get stored token when offline\n }\n validate(clientDataJSON, challenge) {\n const clientData = JSON.parse(bytesToString(clientDataJSON));\n const challengeString = bytesToBase64Url(challenge);\n if (clientData.challenge !== challengeString)\n throw new Error('Invalid authenticator response challenge');\n if (clientData.origin !== this.location.origin)\n throw new Error('Invalid authenticator response origin');\n }\n /**\n * decode a token to data\n *\n * @param token valid token\n */\n decodeToken(token) {\n if (!token)\n return undefined;\n const tokenParts = token.split('.');\n if (tokenParts.length != 2)\n return undefined;\n const data = tokenParts[0];\n return JSON.parse(atob(data));\n }\n}\n","import { readString, readUint32 } from '../utils';\nimport { GangEventTypes } from '../../models';\nexport function parseGangEvent(data) {\n const type = readString(data, 0, 1);\n switch (type) {\n default:\n throw new Error(`unknown message type: ${type}`);\n case GangEventTypes.Host:\n case GangEventTypes.Member:\n case GangEventTypes.Denied:\n return {\n type,\n auth: JSON.parse(readString(data, 1))\n };\n case GangEventTypes.MemberConnected:\n case GangEventTypes.MemberDisconnected:\n return {\n type,\n memberId: readString(data, 1)\n };\n case GangEventTypes.Command:\n return {\n type,\n wrapper: Object.assign(Object.assign({}, (data.byteLength > 5 ? JSON.parse(readString(data, 5)) : {})), { sn: readUint32(data, 1) })\n };\n case GangEventTypes.CommandReceipt:\n return {\n type,\n rsn: readUint32(data, 1)\n };\n case GangEventTypes.State:\n var json = readString(data, 1);\n return {\n type,\n state: json ? JSON.parse(json) : {}\n };\n }\n}\n","import { Subject, Observable } from 'rxjs';\nimport { GangWebSocket } from '../../models';\nimport { parseGangEvent } from './parseGangEvent';\nexport function createGangWebSocket(url, onOpen, onError, onClose, create = null) {\n const webSocket = !create ? new WebSocket(url) : create(url);\n webSocket.binaryType = 'arraybuffer';\n const observable = new Observable((o) => {\n webSocket.onopen = onOpen;\n webSocket.onmessage = o.next.bind(o);\n webSocket.onerror = (e) => {\n if (onError)\n onError(e);\n o.error(e);\n };\n webSocket.onclose = (e) => {\n if (onClose)\n onClose(e);\n o.complete();\n webSocket.onopen = null;\n webSocket.onmessage = null;\n webSocket.onerror = null;\n webSocket.onclose = null;\n subscription.unsubscribe();\n };\n });\n const subject = new Subject();\n const subscription = observable.subscribe(subject);\n const send = (data) => webSocket.send(data);\n const close = (reason) => webSocket.close(1000, reason);\n return new GangWebSocket(parseGangEvent, subject, send, close);\n}\n","import { bytesToString, getRandomBytes, stringToBytes } from '../utils';\nconst onError = (e) => {\n console.error(`${e}`);\n throw new Error(`${e}`);\n};\nexport class GangVault {\n constructor(settings) {\n this.settings = settings;\n this.keyParameters = {\n name: 'AES-GCM',\n length: 256\n };\n this.getCryptoKey().then(async (cryptoKey) => {\n this.cryptoKey = cryptoKey;\n if (!cryptoKey)\n await this.setCryptoKey();\n });\n }\n setSeed(value) {\n this.seed = value;\n }\n execute(mode, func, onError) {\n const open = indexedDB.open(this.settings.name, 1);\n open.onupgradeneeded = () => {\n open.result.createObjectStore(this.settings.store);\n };\n open.onerror = (e) => onError(e);\n open.onsuccess = () => {\n const db = open.result;\n const tx = db.transaction(this.settings.store, mode);\n const store = tx.objectStore(this.settings.store);\n func(store);\n tx.onerror = (e) => onError(e);\n tx.oncomplete = () => db.close();\n };\n }\n async deleteCryptoKey() {\n await this.delete(this.settings.key);\n }\n async getCryptoKey() {\n return await this.get(this.settings.key);\n }\n async setCryptoKey() {\n try {\n this.cryptoKey = (await globalThis.crypto.subtle.generateKey(this.keyParameters, false, [\n 'encrypt',\n 'decrypt'\n ]));\n await this.set(this.settings.key, this.cryptoKey);\n return this.cryptoKey;\n }\n catch (err) {\n onError(err);\n }\n }\n get(key, getDefault = null) {\n return new Promise((resolve, reject) => {\n this.execute('readonly', async (store) => {\n const get = store.get(key);\n get.onsuccess = () => {\n if (get.result === undefined) {\n resolve(getDefault && getDefault());\n return;\n }\n resolve(get.result);\n };\n }, (e) => reject(e));\n });\n }\n async getEncrypted(key) {\n try {\n const data = await this.get(key);\n const buffer = await globalThis.crypto.subtle.decrypt({\n name: this.keyParameters.name,\n iv: data.iv,\n tagLength: 128,\n additionalData: this.seed\n }, this.cryptoKey, data.value);\n return JSON.parse(bytesToString(buffer));\n }\n catch (err) {\n onError(err);\n }\n }\n set(key, value) {\n return new Promise((resolve, reject) => {\n this.execute('readwrite', (store) => {\n const put = store.put(value, key);\n put.onsuccess = () => {\n resolve();\n };\n }, (e) => reject(e));\n });\n }\n async setEncrypted(key, value) {\n try {\n const buffer = stringToBytes(JSON.stringify(value));\n const iv = getRandomBytes(12);\n const data = {\n value: await globalThis.crypto.subtle.encrypt({\n name: this.keyParameters.name,\n iv,\n tagLength: 128,\n additionalData: this.seed\n }, this.cryptoKey, buffer),\n iv\n };\n await this.set(key, data);\n }\n catch (err) {\n onError(err);\n }\n }\n async delete(key) {\n return new Promise((resolve, reject) => {\n this.execute('readwrite', (store) => {\n const put = store.delete(key);\n put.onsuccess = () => {\n resolve();\n };\n }, (e) => reject(e));\n });\n }\n}\n","import { gangNoOpLogger } from './logging';\nimport { GangService, createGangWebSocket, GangAuthenticationService, GangHttp, GangLocationService, GangVault } from './services';\n/**\n * Provides static access to services\n */\nexport class GangContext {\n constructor() { }\n static get service() {\n return (GangContext._service ||\n (GangContext._service = new GangService(createGangWebSocket, GangContext.settings, GangContext.initialState)));\n }\n static createService() {\n return new GangService(createGangWebSocket, GangContext.settings, GangContext.initialState);\n }\n static get auth() {\n return (GangContext._auth ||\n (GangContext._auth = new GangAuthenticationService(GangContext.settings, new GangHttp(GangContext.settings.authRootPath), GangLocationService.instance, navigator.credentials, GangContext.vault)));\n }\n static get vault() {\n return GangContext._vault || (GangContext._vault = new GangVault(GangContext.settings.vault));\n }\n}\nGangContext.logger = gangNoOpLogger;\nGangContext.defaultSettings = {\n app: {\n id: null,\n name: 'Gang App'\n },\n rootUrl: `${location === null || location === void 0 ? void 0 : location.protocol.replace('http', 'ws')}//${location === null || location === void 0 ? void 0 : location.host}`,\n authRoot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